[{"data":1,"prerenderedAt":3919},["ShallowReactive",2],{"navigation_docs":3,"-learn-catalogs":505,"-learn-catalogs-surround":3914},[4,30,80,123,288,420,475],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Start","\u002Fstart","1.start",[9,14,19,24],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fstart\u002Fintroduction","1.start\u002F1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Why start with evlog","\u002Fstart\u002Fwhy-evlog","1.start\u002F2.why-evlog","i-lucide-rocket",{"title":20,"path":21,"stem":22,"icon":23},"Installation","\u002Fstart\u002Finstallation","1.start\u002F3.installation","i-lucide-download",{"title":25,"path":26,"stem":27,"icon":28},"Quick Start","\u002Fstart\u002Fquick-start","1.start\u002F4.quick-start","i-lucide-zap",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Learn","\u002Flearn","2.learn",[35,40,45,50,55,60,65,70,75],{"title":36,"path":37,"stem":38,"icon":39},"Overview","\u002Flearn\u002Foverview","2.learn\u002F0.overview","i-lucide-list",{"title":41,"path":42,"stem":43,"icon":44},"Simple Logging","\u002Flearn\u002Fsimple-logging","2.learn\u002F1.simple-logging","i-lucide-terminal",{"title":46,"path":47,"stem":48,"icon":49},"Wide Events","\u002Flearn\u002Fwide-events","2.learn\u002F2.wide-events","i-lucide-layers",{"title":51,"path":52,"stem":53,"icon":54},"Structured Errors","\u002Flearn\u002Fstructured-errors","2.learn\u002F3.structured-errors","i-lucide-shield-alert",{"title":56,"path":57,"stem":58,"icon":59},"Lifecycle","\u002Flearn\u002Flifecycle","2.learn\u002F4.lifecycle","i-lucide-arrow-right-left",{"title":61,"path":62,"stem":63,"icon":64},"Sampling","\u002Flearn\u002Fsampling","2.learn\u002F5.sampling","i-lucide-filter",{"title":66,"path":67,"stem":68,"icon":69},"Auto-Redaction","\u002Flearn\u002Fredaction","2.learn\u002F6.redaction","i-lucide-eye-off",{"title":71,"path":72,"stem":73,"icon":74},"Typed Fields","\u002Flearn\u002Ftyped-fields","2.learn\u002F7.typed-fields","i-simple-icons-typescript",{"title":76,"path":77,"stem":78,"icon":79},"Catalogs","\u002Flearn\u002Fcatalogs","2.learn\u002F8.catalogs","i-lucide-book-open",{"title":81,"path":82,"stem":83,"children":84,"page":29},"CLI","\u002Fcli","3.cli",[85,88,93,98,103,108,113,118],{"title":36,"path":86,"stem":87,"icon":44},"\u002Fcli\u002Foverview","3.cli\u002F0.overview",{"title":89,"path":90,"stem":91,"icon":92},"init","\u002Fcli\u002Finit","3.cli\u002F1.init","i-lucide-wand-sparkles",{"title":94,"path":95,"stem":96,"icon":97},"map","\u002Fcli\u002Fmap","3.cli\u002F2.map","i-lucide-radar",{"title":99,"path":100,"stem":101,"icon":102},"Rules","\u002Fcli\u002Frules","3.cli\u002F3.rules","i-lucide-list-checks",{"title":104,"path":105,"stem":106,"icon":107},"Scoring","\u002Fcli\u002Fscoring","3.cli\u002F4.scoring","i-lucide-gauge",{"title":109,"path":110,"stem":111,"icon":112},"CI","\u002Fcli\u002Fci","3.cli\u002F5.ci","i-lucide-git-pull-request",{"title":114,"path":115,"stem":116,"icon":117},"doctor","\u002Fcli\u002Fdoctor","3.cli\u002F6.doctor","i-lucide-stethoscope",{"title":119,"path":120,"stem":121,"icon":122},"telemetry","\u002Fcli\u002Ftelemetry","3.cli\u002F7.telemetry","i-lucide-bar-chart-3",{"title":124,"path":125,"stem":126,"children":127,"page":29},"Integrate","\u002Fintegrate","4.integrate",[128,132,200],{"title":36,"path":129,"stem":130,"icon":131},"\u002Fintegrate\u002Foverview","4.integrate\u002F0.overview","i-lucide-plug",{"title":133,"path":134,"stem":135,"children":136,"page":29},"Adapters","\u002Fintegrate\u002Fadapters","4.integrate\u002Fadapters",[137,140,180],{"title":36,"path":138,"stem":139,"icon":39},"\u002Fintegrate\u002Fadapters\u002Foverview","4.integrate\u002Fadapters\u002F01.overview",{"title":141,"path":142,"stem":143,"children":144,"page":29},"Cloud","\u002Fintegrate\u002Fadapters\u002Fcloud","4.integrate\u002Fadapters\u002Fcloud",[145,150,155,160,165,170,175],{"title":146,"path":147,"stem":148,"icon":149},"Axiom","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Faxiom","4.integrate\u002Fadapters\u002Fcloud\u002F01.axiom","i-custom-axiom",{"title":151,"path":152,"stem":153,"icon":154},"OTLP","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fotlp","4.integrate\u002Fadapters\u002Fcloud\u002F02.otlp","i-simple-icons-opentelemetry",{"title":156,"path":157,"stem":158,"icon":159},"PostHog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fposthog","4.integrate\u002Fadapters\u002Fcloud\u002F03.posthog","i-simple-icons-posthog",{"title":161,"path":162,"stem":163,"icon":164},"Sentry","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fsentry","4.integrate\u002Fadapters\u002Fcloud\u002F04.sentry","i-simple-icons-sentry",{"title":166,"path":167,"stem":168,"icon":169},"Better Stack","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fbetter-stack","4.integrate\u002Fadapters\u002Fcloud\u002F05.better-stack","i-simple-icons-betterstack",{"title":171,"path":172,"stem":173,"icon":174},"Datadog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fdatadog","4.integrate\u002Fadapters\u002Fcloud\u002F06.datadog","i-simple-icons-datadog",{"title":176,"path":177,"stem":178,"icon":179},"HyperDX","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fhyperdx","4.integrate\u002Fadapters\u002Fcloud\u002F07.hyperdx","i-custom-hyperdx",{"title":181,"path":182,"stem":183,"children":184,"page":29},"Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fself-hosted","4.integrate\u002Fadapters\u002Fself-hosted",[185,190,195],{"title":186,"path":187,"stem":188,"icon":189},"File System","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Ffs","4.integrate\u002Fadapters\u002Fself-hosted\u002F01.fs","i-lucide-hard-drive",{"title":191,"path":192,"stem":193,"icon":194},"NuxtHub","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fnuxthub","4.integrate\u002Fadapters\u002Fself-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":196,"path":197,"stem":198,"icon":199},"Memory","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fmemory","4.integrate\u002Fadapters\u002Fself-hosted\u002F03.memory","i-lucide-cpu",{"title":201,"path":202,"stem":203,"children":204,"page":29},"Frameworks","\u002Fintegrate\u002Fframeworks","4.integrate\u002Fframeworks",[205,209,214,219,224,229,234,239,244,249,254,259,264,269,273,278,283],{"title":36,"path":206,"stem":207,"icon":208},"\u002Fintegrate\u002Fframeworks\u002Foverview","4.integrate\u002Fframeworks\u002F00.overview","i-lucide-layout-grid",{"title":210,"path":211,"stem":212,"icon":213},"Nuxt","\u002Fintegrate\u002Fframeworks\u002Fnuxt","4.integrate\u002Fframeworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":215,"path":216,"stem":217,"icon":218},"Next.js","\u002Fintegrate\u002Fframeworks\u002Fnextjs","4.integrate\u002Fframeworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":220,"path":221,"stem":222,"icon":223},"SvelteKit","\u002Fintegrate\u002Fframeworks\u002Fsveltekit","4.integrate\u002Fframeworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":225,"path":226,"stem":227,"icon":228},"Nitro","\u002Fintegrate\u002Fframeworks\u002Fnitro","4.integrate\u002Fframeworks\u002F04.nitro","i-custom-nitro",{"title":230,"path":231,"stem":232,"icon":233},"TanStack Start","\u002Fintegrate\u002Fframeworks\u002Ftanstack-start","4.integrate\u002Fframeworks\u002F05.tanstack-start","i-custom-tanstack",{"title":235,"path":236,"stem":237,"icon":238},"NestJS","\u002Fintegrate\u002Fframeworks\u002Fnestjs","4.integrate\u002Fframeworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":240,"path":241,"stem":242,"icon":243},"Express","\u002Fintegrate\u002Fframeworks\u002Fexpress","4.integrate\u002Fframeworks\u002F07.express","i-simple-icons-express",{"title":245,"path":246,"stem":247,"icon":248},"Hono","\u002Fintegrate\u002Fframeworks\u002Fhono","4.integrate\u002Fframeworks\u002F08.hono","i-simple-icons-hono",{"title":250,"path":251,"stem":252,"icon":253},"Fastify","\u002Fintegrate\u002Fframeworks\u002Ffastify","4.integrate\u002Fframeworks\u002F09.fastify","i-simple-icons-fastify",{"title":255,"path":256,"stem":257,"icon":258},"Elysia","\u002Fintegrate\u002Fframeworks\u002Felysia","4.integrate\u002Fframeworks\u002F10.elysia","i-custom-elysia",{"title":260,"path":261,"stem":262,"icon":263},"React Router","\u002Fintegrate\u002Fframeworks\u002Freact-router","4.integrate\u002Fframeworks\u002F11.react-router","i-custom-reactrouter",{"title":265,"path":266,"stem":267,"icon":268},"Cloudflare Workers","\u002Fintegrate\u002Fframeworks\u002Fcloudflare-workers","4.integrate\u002Fframeworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":270,"path":271,"stem":272,"icon":74},"Standalone","\u002Fintegrate\u002Fframeworks\u002Fstandalone","4.integrate\u002Fframeworks\u002F13.standalone",{"title":274,"path":275,"stem":276,"icon":277},"Astro","\u002Fintegrate\u002Fframeworks\u002Fastro","4.integrate\u002Fframeworks\u002F14.astro","i-simple-icons-astro",{"title":279,"path":280,"stem":281,"icon":282},"oRPC","\u002Fintegrate\u002Fframeworks\u002Forpc","4.integrate\u002Fframeworks\u002F15.orpc","i-lucide-network",{"title":284,"path":285,"stem":286,"icon":287},"AWS Lambda","\u002Fintegrate\u002Fframeworks\u002Faws-lambda","4.integrate\u002Fframeworks\u002F16.aws-lambda","i-custom-lambda",{"title":289,"path":290,"stem":291,"children":292,"page":29},"Use Cases","\u002Fuse-cases","5.use-cases",[293,296,301,330,357,389,410,415],{"title":36,"path":294,"stem":295,"icon":102},"\u002Fuse-cases\u002Foverview","5.use-cases\u002F0.overview",{"title":297,"path":298,"stem":299,"icon":300},"Client Logging","\u002Fuse-cases\u002Fclient-logging","5.use-cases\u002F1.client-logging","i-lucide-monitor",{"title":302,"icon":303,"path":304,"stem":305,"children":306,"page":29},"AI SDK","i-simple-icons-vercel","\u002Fuse-cases\u002Fai-sdk","5.use-cases\u002F2.ai-sdk",[307,310,315,320,325],{"title":36,"path":308,"stem":309,"icon":39},"\u002Fuse-cases\u002Fai-sdk\u002Foverview","5.use-cases\u002F2.ai-sdk\u002F01.overview",{"title":311,"path":312,"stem":313,"icon":314},"Usage","\u002Fuse-cases\u002Fai-sdk\u002Fusage","5.use-cases\u002F2.ai-sdk\u002F02.usage","i-lucide-code",{"title":316,"path":317,"stem":318,"icon":319},"Options","\u002Fuse-cases\u002Fai-sdk\u002Foptions","5.use-cases\u002F2.ai-sdk\u002F03.options","i-lucide-sliders",{"title":321,"path":322,"stem":323,"icon":324},"Metadata","\u002Fuse-cases\u002Fai-sdk\u002Fmetadata","5.use-cases\u002F2.ai-sdk\u002F04.metadata","i-lucide-database",{"title":326,"path":327,"stem":328,"icon":329},"Telemetry","\u002Fuse-cases\u002Fai-sdk\u002Ftelemetry","5.use-cases\u002F2.ai-sdk\u002F05.telemetry","i-lucide-activity",{"title":331,"icon":332,"path":333,"stem":334,"children":335,"page":29},"Better Auth","i-simple-icons-betterauth","\u002Fuse-cases\u002Fbetter-auth","5.use-cases\u002F3.better-auth",[336,339,344,349,353],{"title":36,"path":337,"stem":338,"icon":39},"\u002Fuse-cases\u002Fbetter-auth\u002Foverview","5.use-cases\u002F3.better-auth\u002F01.overview",{"title":340,"path":341,"stem":342,"icon":343},"Identify User","\u002Fuse-cases\u002Fbetter-auth\u002Fidentify-user","5.use-cases\u002F3.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":345,"path":346,"stem":347,"icon":348},"Middleware","\u002Fuse-cases\u002Fbetter-auth\u002Fmiddleware","5.use-cases\u002F3.better-auth\u002F03.middleware","i-lucide-shield",{"title":350,"path":351,"stem":352,"icon":300},"Client Sync","\u002Fuse-cases\u002Fbetter-auth\u002Fclient-sync","5.use-cases\u002F3.better-auth\u002F04.client-sync",{"title":354,"path":355,"stem":356,"icon":107},"Performance","\u002Fuse-cases\u002Fbetter-auth\u002Fperformance","5.use-cases\u002F3.better-auth\u002F05.performance",{"title":358,"icon":359,"path":360,"stem":361,"children":362,"page":29},"Audit Logs","i-lucide-shield-check","\u002Fuse-cases\u002Faudit","5.use-cases\u002F4.audit",[363,366,371,376,381,385],{"title":36,"path":364,"stem":365,"icon":39},"\u002Fuse-cases\u002Faudit\u002Foverview","5.use-cases\u002F4.audit\u002F01.overview",{"title":367,"path":368,"stem":369,"icon":370},"Schema","\u002Fuse-cases\u002Faudit\u002Fschema","5.use-cases\u002F4.audit\u002F02.schema","i-lucide-file-text",{"title":372,"path":373,"stem":374,"icon":375},"Recording","\u002Fuse-cases\u002Faudit\u002Frecording","5.use-cases\u002F4.audit\u002F03.recording","i-lucide-pen-line",{"title":377,"path":378,"stem":379,"icon":380},"Drains","\u002Fuse-cases\u002Faudit\u002Fpipeline","5.use-cases\u002F4.audit\u002F04.pipeline","i-lucide-link",{"title":382,"path":383,"stem":384,"icon":359},"Compliance","\u002Fuse-cases\u002Faudit\u002Fcompliance","5.use-cases\u002F4.audit\u002F05.compliance",{"title":386,"path":387,"stem":388,"icon":79},"Recipes","\u002Fuse-cases\u002Faudit\u002Frecipes","5.use-cases\u002F4.audit\u002F06.recipes",{"title":326,"icon":107,"path":390,"stem":391,"children":392,"page":29},"\u002Fuse-cases\u002Ftelemetry","5.use-cases\u002F4.telemetry",[393,396,401,406],{"title":36,"path":394,"stem":395,"icon":39},"\u002Fuse-cases\u002Ftelemetry\u002Foverview","5.use-cases\u002F4.telemetry\u002F01.overview",{"title":397,"path":398,"stem":399,"icon":400},"Setup","\u002Fuse-cases\u002Ftelemetry\u002Fsetup","5.use-cases\u002F4.telemetry\u002F02.setup","i-lucide-wrench",{"title":402,"path":403,"stem":404,"icon":405},"Ingest","\u002Fuse-cases\u002Ftelemetry\u002Fingest","5.use-cases\u002F4.telemetry\u002F03.ingest","i-lucide-server",{"title":407,"path":408,"stem":409,"icon":79},"Reference","\u002Fuse-cases\u002Ftelemetry\u002Freference","5.use-cases\u002F4.telemetry\u002F04.reference",{"title":411,"path":412,"stem":413,"icon":414},"Enrichers","\u002Fuse-cases\u002Fenrichers","5.use-cases\u002F5.enrichers","i-lucide-sparkles",{"title":416,"path":417,"stem":418,"icon":419},"eve","\u002Fuse-cases\u002Feve","5.use-cases\u002F5.eve","i-custom-eve",{"title":421,"path":422,"stem":423,"children":424,"page":29},"Extend","\u002Fextend","6.extend",[425,429,434,439,444,448,452,456,460,465,470],{"title":36,"path":426,"stem":427,"icon":428},"\u002Fextend\u002Foverview","6.extend\u002F0.overview","i-lucide-blocks",{"title":430,"path":431,"stem":432,"icon":433},"Stream","\u002Fextend\u002Fstream","6.extend\u002F1.stream","i-lucide-radio-tower",{"title":435,"path":436,"stem":437,"icon":438},"Custom framework","\u002Fextend\u002Fcustom-framework","6.extend\u002F10.custom-framework","i-lucide-puzzle",{"title":440,"path":441,"stem":442,"icon":443},"FS reader","\u002Fextend\u002Ffs-reader","6.extend\u002F2.fs-reader","i-lucide-folder-search",{"title":386,"path":445,"stem":446,"icon":447},"\u002Fextend\u002Fconsumer-recipes","6.extend\u002F3.consumer-recipes","i-lucide-chef-hat",{"title":449,"path":450,"stem":451,"icon":428},"Plugins","\u002Fextend\u002Fplugins","6.extend\u002F4.plugins",{"title":453,"path":454,"stem":455,"icon":414},"Custom enrichers","\u002Fextend\u002Fcustom-enrichers","6.extend\u002F5.custom-enrichers",{"title":457,"path":458,"stem":459,"icon":64},"Tail sampling","\u002Fextend\u002Ftail-sampling","6.extend\u002F6.tail-sampling",{"title":461,"path":462,"stem":463,"icon":464},"Identity headers","\u002Fextend\u002Fidentity-headers","6.extend\u002F7.identity-headers","i-lucide-fingerprint",{"title":466,"path":467,"stem":468,"icon":469},"Custom drains","\u002Fextend\u002Fcustom-drains","6.extend\u002F8.custom-drains","i-lucide-share-2",{"title":471,"path":472,"stem":473,"icon":474},"Drain pipeline","\u002Fextend\u002Fdrain-pipeline","6.extend\u002F9.drain-pipeline","i-lucide-workflow",{"title":407,"path":476,"stem":477,"children":478,"page":29},"\u002Freference","7.reference",[479,484,487,492,496,501],{"title":480,"path":481,"stem":482,"icon":483},"Configuration","\u002Freference\u002Fconfiguration","7.reference\u002F1.configuration","i-lucide-settings",{"title":354,"path":485,"stem":486,"icon":107},"\u002Freference\u002Fperformance","7.reference\u002F2.performance",{"title":488,"path":489,"stem":490,"icon":491},"Vite Plugin","\u002Freference\u002Fvite-plugin","7.reference\u002F3.vite-plugin","i-custom-vite",{"title":493,"path":494,"stem":495,"icon":359},"Best Practices","\u002Freference\u002Fbest-practices","7.reference\u002F4.best-practices",{"title":497,"path":498,"stem":499,"icon":500},"vs Other Loggers","\u002Freference\u002Fvs-other-loggers","7.reference\u002F5.vs-other-loggers","i-lucide-scale",{"title":502,"path":503,"stem":504,"icon":414},"Agent Skills","\u002Freference\u002Fagent-skills","7.reference\u002F6.agent-skills",{"id":506,"title":76,"body":507,"description":3904,"extension":3905,"links":3906,"meta":3910,"navigation":3911,"path":77,"seo":3912,"stem":78,"__hash__":3913},"docs\u002F2.learn\u002F8.catalogs.md",{"type":508,"value":509,"toc":3877},"minimark",[510,529,680,693,698,701,804,810,814,817,822,833,1233,1237,1251,1259,1472,1482,1486,1498,1504,1684,1694,1698,1708,1714,1718,1724,1730,1981,1985,2275,2288,2292,2364,2421,2570,2591,2595,2599,2609,2837,2841,2844,2889,3011,3015,3039,3176,3180,3199,3203,3262,3268,3272,3275,3321,3404,3413,3417,3537,3544,3548,3564,3577,3593,3670,3674,3830,3836,3840,3873],[511,512,513,514,518,519,518,522,518,525,528],"p",{},"The catalog primitives (",[515,516,517],"code",{},"defineError",", ",[515,520,521],{},"defineErrorCatalog",[515,523,524],{},"defineAuditAction",[515,526,527],{},"defineAuditCatalog",") are the same regardless of project size. What changes is how you organise them. This page is the deep-dive: conventions, scaling recipes from one file to a published npm package, composition patterns, and the opt-in type augmentation.",[530,531,534,540,671],"prompt",{":actions":532,"description":533,"icon":79},"[\"copy\",\"cursor\",\"claude\"]","Set up typed error and audit catalogs in my app",[511,535,536,537,539],{},"Group errors and audit actions in typed catalogs to eliminate magic strings, get autocomplete on ",[515,538,515],{}," everywhere, and ship them as npm packages in a monorepo.",[541,542,543,555,565,579,588,598,605,612,630,637,651,661],"ul",{},[544,545,546,547,550,551,554],"li",{},"Use ",[515,548,549],{},"defineErrorCatalog(prefix, map)"," for error bundles, ",[515,552,553],{},"defineAuditCatalog(prefix, map)"," for audit bundles",[544,556,546,557,560,561,564],{},[515,558,559],{},"defineError(code, options)"," and ",[515,562,563],{},"defineAuditAction(action, opts?)"," for one-off factories that don't fit a catalog",[544,566,567,568,571,572,518,575,578],{},"Convention: UPPER_SNAKE_CASE keys, lower.dot.case prefix, wire format is ",[515,569,570],{},"${prefix}.${KEY}"," (e.g. ",[515,573,574],{},"billing.PAYMENT_DECLINED",[515,576,577],{},"billing.INVOICE_REFUND",")",[544,580,581,582,518,585,578],{},"One catalog = one bounded context = one prefix = one file (e.g. ",[515,583,584],{},"errors\u002Fbilling.ts",[515,586,587],{},"audit\u002Fbilling.ts",[544,589,590,591,594,595],{},"Throw with ",[515,592,593],{},"billingErrors.PAYMENT_DECLINED({ cause, internal })",", audit with ",[515,596,597],{},"log.audit(billingAudit.INVOICE_REFUND({ actor, target }))",[544,599,600,601,604],{},"Use templated messages (",[515,602,603],{},"message: ({ id }) => \\","User ${id} not found``) when params are dynamic and required",[544,606,607,608,611],{},"Catalog defaults for ",[515,609,610],{},"internal"," are shallow-merged with call-site values (call-site wins)",[544,613,614,615,618,619,518,622,625,626,629],{},"Add the opt-in ",[515,616,617],{},"declare module 'evlog' { interface RegisteredErrorCatalogs { billing: typeof billingErrors } }"," augmentation to surface autocomplete on ",[515,620,621],{},"createError({ code })",[515,623,624],{},"parseError(err).code",", and ",[515,627,628],{},"throwError(code)"," everywhere",[544,631,632,633,636],{},"Scale by sharding: single file → folder per domain → sub-prefixes (",[515,634,635],{},"billing.payment",") → one npm package per bounded context (each owns its prefix, no conflicts possible)",[544,638,639,640,643,644,647,648],{},"Each shared package ships its own ",[515,641,642],{},"declare module 'evlog'"," block in ",[515,645,646],{},"src\u002Findex.ts"," so the type augmentation propagates to consumers via the published ",[515,649,650],{},".d.ts",[544,652,653,654,657,658],{},"Compare on ",[515,655,656],{},"factory.code"," in tests instead of string literals so renames are TS errors, not silent breaks: ",[515,659,660],{},"expect(err.code).toBe(billingErrors.PAYMENT_DECLINED.code)",[544,662,663,664,666,667,670],{},"Never override ",[515,665,515],{}," at the call site (the catalog defines the code identity); never put ",[515,668,669],{},"declare module"," blocks in test files (they leak into the main type-checker)",[511,672,673,674],{},"Docs: ",[675,676,677],"a",{"href":677,"rel":678},"https:\u002F\u002Fwww.evlog.dev\u002Flearn\u002Fcatalogs",[679],"nofollow",[681,682,683,684,560,688,692],"tip",{},"If you haven't yet, start with ",[675,685,687],{"href":686},"\u002Flearn\u002Fstructured-errors#error-catalogs","Structured Errors → Error Catalogs",[675,689,691],{"href":690},"\u002Fuse-cases\u002Faudit\u002Frecording#defineauditcatalog","Audit → defineAuditCatalog"," for the basics. This page assumes you've used the primitives at least once.",[694,695,697],"h2",{"id":696},"conventions","Conventions",[511,699,700],{},"A single set of conventions covers both error and audit catalogs.",[702,703,704,719],"table",{},[705,706,707],"thead",{},[708,709,710,713,716],"tr",{},[711,712],"th",{},[711,714,715],{},"Convention",[711,717,718],{},"Example",[720,721,722,745,769,788],"tbody",{},[708,723,724,731,737],{},[725,726,727],"td",{},[728,729,730],"strong",{},"Catalog key",[725,732,733,736],{},[515,734,735],{},"UPPER_SNAKE_CASE"," (enum-style, scales to hundreds of entries)",[725,738,739,518,742],{},[515,740,741],{},"PAYMENT_DECLINED",[515,743,744],{},"INVOICE_REFUND",[708,746,747,752,758],{},[725,748,749],{},[728,750,751],{},"Prefix",[725,753,754,757],{},[515,755,756],{},"lower.dot.case",", can be hierarchical",[725,759,760,518,763,518,766],{},[515,761,762],{},"'billing'",[515,764,765],{},"'billing.payment'",[515,767,768],{},"'auth.session'",[708,770,771,776,781],{},[725,772,773],{},[728,774,775],{},"Wire format",[725,777,778,780],{},[515,779,570],{}," (preserved casing)",[725,782,783,518,785],{},[515,784,574],{},[515,786,787],{},"auth.INVALID_TOKEN",[708,789,790,795,798],{},[725,791,792],{},[728,793,794],{},"One catalog =",[725,796,797],{},"One bounded context, one prefix, one file",[725,799,800,518,802],{},[515,801,584],{},[515,803,587],{},[511,805,806,807,809],{},"The wire format ends up in HTTP responses, wide events, drains, and dashboards. Stick to it across services so a ",[515,808,515],{}," from one service is recognisable in another.",[694,811,813],{"id":812},"scaling-story","Scaling story",[511,815,816],{},"The same primitives cover four scales without API change.",[818,819,821],"h3",{"id":820},"_1-file-small-repo","1 file — small repo",[511,823,824,825,828,829,832],{},"One ",[515,826,827],{},"errors.ts",", one ",[515,830,831],{},"audit.ts",". Done.",[834,835,836,1082],"code-group",{},[837,838,844],"pre",{"className":839,"code":840,"filename":841,"language":842,"meta":843,"style":843},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineErrorCatalog } from 'evlog'\n\nexport const errors = defineErrorCatalog('app', {\n  USER_NOT_FOUND: { status: 404, message: 'User not found' },\n  FORBIDDEN: { status: 403, message: 'Forbidden' },\n  VALIDATION_FAILED: {\n    status: 400,\n    message: ({ field }: { field: string }) => `Invalid ${field}`,\n  },\n})\n","src\u002Ferrors.ts","typescript","",[515,845,846,879,886,922,960,992,1002,1016,1067,1073],{"__ignoreMap":843},[847,848,851,855,859,863,866,869,872,876],"span",{"class":849,"line":850},"line",1,[847,852,854],{"class":853},"s7zQu","import",[847,856,858],{"class":857},"sMK4o"," {",[847,860,862],{"class":861},"sTEyZ"," defineErrorCatalog",[847,864,865],{"class":857}," }",[847,867,868],{"class":853}," from",[847,870,871],{"class":857}," '",[847,873,875],{"class":874},"sfazB","evlog",[847,877,878],{"class":857},"'\n",[847,880,882],{"class":849,"line":881},2,[847,883,885],{"emptyLinePlaceholder":884},true,"\n",[847,887,889,892,896,899,902,905,908,911,914,916,919],{"class":849,"line":888},3,[847,890,891],{"class":853},"export",[847,893,895],{"class":894},"spNyl"," const",[847,897,898],{"class":861}," errors ",[847,900,901],{"class":857},"=",[847,903,862],{"class":904},"s2Zo4",[847,906,907],{"class":861},"(",[847,909,910],{"class":857},"'",[847,912,913],{"class":874},"app",[847,915,910],{"class":857},[847,917,918],{"class":857},",",[847,920,921],{"class":857}," {\n",[847,923,925,929,932,934,937,939,943,945,948,950,952,955,957],{"class":849,"line":924},4,[847,926,928],{"class":927},"swJcz","  USER_NOT_FOUND",[847,930,931],{"class":857},":",[847,933,858],{"class":857},[847,935,936],{"class":927}," status",[847,938,931],{"class":857},[847,940,942],{"class":941},"sbssI"," 404",[847,944,918],{"class":857},[847,946,947],{"class":927}," message",[847,949,931],{"class":857},[847,951,871],{"class":857},[847,953,954],{"class":874},"User not found",[847,956,910],{"class":857},[847,958,959],{"class":857}," },\n",[847,961,963,966,968,970,972,974,977,979,981,983,985,988,990],{"class":849,"line":962},5,[847,964,965],{"class":927},"  FORBIDDEN",[847,967,931],{"class":857},[847,969,858],{"class":857},[847,971,936],{"class":927},[847,973,931],{"class":857},[847,975,976],{"class":941}," 403",[847,978,918],{"class":857},[847,980,947],{"class":927},[847,982,931],{"class":857},[847,984,871],{"class":857},[847,986,987],{"class":874},"Forbidden",[847,989,910],{"class":857},[847,991,959],{"class":857},[847,993,995,998,1000],{"class":849,"line":994},6,[847,996,997],{"class":927},"  VALIDATION_FAILED",[847,999,931],{"class":857},[847,1001,921],{"class":857},[847,1003,1005,1008,1010,1013],{"class":849,"line":1004},7,[847,1006,1007],{"class":927},"    status",[847,1009,931],{"class":857},[847,1011,1012],{"class":941}," 400",[847,1014,1015],{"class":857},",\n",[847,1017,1019,1022,1024,1027,1031,1034,1036,1038,1040,1044,1047,1050,1053,1056,1059,1062,1065],{"class":849,"line":1018},8,[847,1020,1021],{"class":904},"    message",[847,1023,931],{"class":857},[847,1025,1026],{"class":857}," ({",[847,1028,1030],{"class":1029},"sHdIc"," field",[847,1032,1033],{"class":857}," }:",[847,1035,858],{"class":857},[847,1037,1030],{"class":927},[847,1039,931],{"class":857},[847,1041,1043],{"class":1042},"sBMFI"," string",[847,1045,1046],{"class":857}," })",[847,1048,1049],{"class":894}," =>",[847,1051,1052],{"class":857}," `",[847,1054,1055],{"class":874},"Invalid ",[847,1057,1058],{"class":857},"${",[847,1060,1061],{"class":861},"field",[847,1063,1064],{"class":857},"}`",[847,1066,1015],{"class":857},[847,1068,1070],{"class":849,"line":1069},9,[847,1071,1072],{"class":857},"  },\n",[847,1074,1076,1079],{"class":849,"line":1075},10,[847,1077,1078],{"class":857},"}",[847,1080,1081],{"class":861},")\n",[837,1083,1086],{"className":839,"code":1084,"filename":1085,"language":842,"meta":843,"style":843},"import { defineAuditCatalog } from 'evlog'\n\nexport const audit = defineAuditCatalog('app', {\n  USER_LOGIN: { target: 'user', severity: 'medium' },\n  USER_DELETE: { target: 'user', severity: 'high', requiresChanges: true, requiresReason: true },\n})\n","src\u002Faudit.ts",[515,1087,1088,1107,1111,1136,1173,1227],{"__ignoreMap":843},[847,1089,1090,1092,1094,1097,1099,1101,1103,1105],{"class":849,"line":850},[847,1091,854],{"class":853},[847,1093,858],{"class":857},[847,1095,1096],{"class":861}," defineAuditCatalog",[847,1098,865],{"class":857},[847,1100,868],{"class":853},[847,1102,871],{"class":857},[847,1104,875],{"class":874},[847,1106,878],{"class":857},[847,1108,1109],{"class":849,"line":881},[847,1110,885],{"emptyLinePlaceholder":884},[847,1112,1113,1115,1117,1120,1122,1124,1126,1128,1130,1132,1134],{"class":849,"line":888},[847,1114,891],{"class":853},[847,1116,895],{"class":894},[847,1118,1119],{"class":861}," audit ",[847,1121,901],{"class":857},[847,1123,1096],{"class":904},[847,1125,907],{"class":861},[847,1127,910],{"class":857},[847,1129,913],{"class":874},[847,1131,910],{"class":857},[847,1133,918],{"class":857},[847,1135,921],{"class":857},[847,1137,1138,1141,1143,1145,1148,1150,1152,1155,1157,1159,1162,1164,1166,1169,1171],{"class":849,"line":924},[847,1139,1140],{"class":927},"  USER_LOGIN",[847,1142,931],{"class":857},[847,1144,858],{"class":857},[847,1146,1147],{"class":927}," target",[847,1149,931],{"class":857},[847,1151,871],{"class":857},[847,1153,1154],{"class":874},"user",[847,1156,910],{"class":857},[847,1158,918],{"class":857},[847,1160,1161],{"class":927}," severity",[847,1163,931],{"class":857},[847,1165,871],{"class":857},[847,1167,1168],{"class":874},"medium",[847,1170,910],{"class":857},[847,1172,959],{"class":857},[847,1174,1175,1178,1180,1182,1184,1186,1188,1190,1192,1194,1196,1198,1200,1203,1205,1207,1210,1212,1216,1218,1221,1223,1225],{"class":849,"line":962},[847,1176,1177],{"class":927},"  USER_DELETE",[847,1179,931],{"class":857},[847,1181,858],{"class":857},[847,1183,1147],{"class":927},[847,1185,931],{"class":857},[847,1187,871],{"class":857},[847,1189,1154],{"class":874},[847,1191,910],{"class":857},[847,1193,918],{"class":857},[847,1195,1161],{"class":927},[847,1197,931],{"class":857},[847,1199,871],{"class":857},[847,1201,1202],{"class":874},"high",[847,1204,910],{"class":857},[847,1206,918],{"class":857},[847,1208,1209],{"class":927}," requiresChanges",[847,1211,931],{"class":857},[847,1213,1215],{"class":1214},"sfNiH"," true",[847,1217,918],{"class":857},[847,1219,1220],{"class":927}," requiresReason",[847,1222,931],{"class":857},[847,1224,1215],{"class":1214},[847,1226,959],{"class":857},[847,1228,1229,1231],{"class":849,"line":994},[847,1230,1078],{"class":857},[847,1232,1081],{"class":861},[818,1234,1236],{"id":1235},"_1-folder-1-file-per-domain-medium-repo","1 folder, 1 file per domain — medium repo",[511,1238,1239,1240,560,1243,1246,1247,1250],{},"Group by bounded context. One file per domain in ",[515,1241,1242],{},"src\u002Ferrors\u002F",[515,1244,1245],{},"src\u002Faudit\u002F",". An ",[515,1248,1249],{},"index.ts"," re-exports for ergonomic imports and centralises the type augmentation.",[837,1252,1257],{"className":1253,"code":1255,"language":1256},[1254],"language-text","src\u002F\n├── errors\u002F\n│   ├── billing.ts        → billingErrors (prefix: 'billing')\n│   ├── auth.ts           → authErrors    (prefix: 'auth')\n│   ├── user.ts           → userErrors    (prefix: 'user')\n│   └── index.ts          → re-export + declare module\n├── audit\u002F\n│   ├── billing.ts        → billingAudit\n│   ├── auth.ts           → authAudit\n│   └── index.ts\n","text",[515,1258,1255],{"__ignoreMap":843},[837,1260,1263],{"className":839,"code":1261,"filename":1262,"language":842,"meta":843,"style":843},"import type { authErrors } from '.\u002Fauth'\nimport type { billingErrors } from '.\u002Fbilling'\nimport type { userErrors } from '.\u002Fuser'\n\nexport { authErrors } from '.\u002Fauth'\nexport { billingErrors } from '.\u002Fbilling'\nexport { userErrors } from '.\u002Fuser'\n\ndeclare module 'evlog' {\n  interface RegisteredErrorCatalogs {\n    auth: typeof authErrors\n    billing: typeof billingErrors\n    user: typeof userErrors\n  }\n}\n","src\u002Ferrors\u002Findex.ts",[515,1264,1265,1288,1310,1332,1336,1354,1372,1390,1394,1410,1420,1434,1447,1460,1466],{"__ignoreMap":843},[847,1266,1267,1269,1272,1274,1277,1279,1281,1283,1286],{"class":849,"line":850},[847,1268,854],{"class":853},[847,1270,1271],{"class":853}," type",[847,1273,858],{"class":857},[847,1275,1276],{"class":861}," authErrors",[847,1278,865],{"class":857},[847,1280,868],{"class":853},[847,1282,871],{"class":857},[847,1284,1285],{"class":874},".\u002Fauth",[847,1287,878],{"class":857},[847,1289,1290,1292,1294,1296,1299,1301,1303,1305,1308],{"class":849,"line":881},[847,1291,854],{"class":853},[847,1293,1271],{"class":853},[847,1295,858],{"class":857},[847,1297,1298],{"class":861}," billingErrors",[847,1300,865],{"class":857},[847,1302,868],{"class":853},[847,1304,871],{"class":857},[847,1306,1307],{"class":874},".\u002Fbilling",[847,1309,878],{"class":857},[847,1311,1312,1314,1316,1318,1321,1323,1325,1327,1330],{"class":849,"line":888},[847,1313,854],{"class":853},[847,1315,1271],{"class":853},[847,1317,858],{"class":857},[847,1319,1320],{"class":861}," userErrors",[847,1322,865],{"class":857},[847,1324,868],{"class":853},[847,1326,871],{"class":857},[847,1328,1329],{"class":874},".\u002Fuser",[847,1331,878],{"class":857},[847,1333,1334],{"class":849,"line":924},[847,1335,885],{"emptyLinePlaceholder":884},[847,1337,1338,1340,1342,1344,1346,1348,1350,1352],{"class":849,"line":962},[847,1339,891],{"class":853},[847,1341,858],{"class":857},[847,1343,1276],{"class":861},[847,1345,865],{"class":857},[847,1347,868],{"class":853},[847,1349,871],{"class":857},[847,1351,1285],{"class":874},[847,1353,878],{"class":857},[847,1355,1356,1358,1360,1362,1364,1366,1368,1370],{"class":849,"line":994},[847,1357,891],{"class":853},[847,1359,858],{"class":857},[847,1361,1298],{"class":861},[847,1363,865],{"class":857},[847,1365,868],{"class":853},[847,1367,871],{"class":857},[847,1369,1307],{"class":874},[847,1371,878],{"class":857},[847,1373,1374,1376,1378,1380,1382,1384,1386,1388],{"class":849,"line":1004},[847,1375,891],{"class":853},[847,1377,858],{"class":857},[847,1379,1320],{"class":861},[847,1381,865],{"class":857},[847,1383,868],{"class":853},[847,1385,871],{"class":857},[847,1387,1329],{"class":874},[847,1389,878],{"class":857},[847,1391,1392],{"class":849,"line":1018},[847,1393,885],{"emptyLinePlaceholder":884},[847,1395,1396,1399,1402,1404,1406,1408],{"class":849,"line":1069},[847,1397,1398],{"class":894},"declare",[847,1400,1401],{"class":894}," module",[847,1403,871],{"class":857},[847,1405,875],{"class":874},[847,1407,910],{"class":857},[847,1409,921],{"class":857},[847,1411,1412,1415,1418],{"class":849,"line":1075},[847,1413,1414],{"class":894},"  interface",[847,1416,1417],{"class":1042}," RegisteredErrorCatalogs",[847,1419,921],{"class":857},[847,1421,1423,1426,1428,1431],{"class":849,"line":1422},11,[847,1424,1425],{"class":927},"    auth",[847,1427,931],{"class":857},[847,1429,1430],{"class":857}," typeof",[847,1432,1433],{"class":861}," authErrors\n",[847,1435,1437,1440,1442,1444],{"class":849,"line":1436},12,[847,1438,1439],{"class":927},"    billing",[847,1441,931],{"class":857},[847,1443,1430],{"class":857},[847,1445,1446],{"class":861}," billingErrors\n",[847,1448,1450,1453,1455,1457],{"class":849,"line":1449},13,[847,1451,1452],{"class":927},"    user",[847,1454,931],{"class":857},[847,1456,1430],{"class":857},[847,1458,1459],{"class":861}," userErrors\n",[847,1461,1463],{"class":849,"line":1462},14,[847,1464,1465],{"class":857},"  }\n",[847,1467,1469],{"class":849,"line":1468},15,[847,1470,1471],{"class":857},"}\n",[511,1473,1474,1475,1477,1478,1481],{},"The augmentation is purely type-level: there is no ",[515,1476,89],{}," step, no runtime registration. Importing ",[515,1479,1480],{},"~\u002Ferrors"," once anywhere in your app is enough for TypeScript to pick up the merged type.",[818,1483,1485],{"id":1484},"sub-prefixes-very-large-repo","Sub-prefixes — very large repo",[511,1487,1488,1489,518,1491,518,1494,1497],{},"Hierarchical prefixes (",[515,1490,635],{},[515,1492,1493],{},"billing.subscription",[515,1495,1496],{},"auth.session",") keep keys short while preserving namespace clarity. One catalog per sub-domain.",[837,1499,1502],{"className":1500,"code":1501,"language":1256},[1254],"src\u002Ffeatures\u002F\n├── billing\u002F\n│   └── errors\u002F\n│       ├── payment.ts        → billingPaymentErrors (prefix: 'billing.payment')\n│       ├── subscription.ts   → billingSubscriptionErrors\n│       └── invoice.ts        → billingInvoiceErrors\n├── auth\u002F\n│   └── errors\u002F\n│       ├── session.ts        → authSessionErrors (prefix: 'auth.session')\n│       ├── oauth.ts          → authOAuthErrors\n│       └── mfa.ts            → authMfaErrors\n",[515,1503,1501],{"__ignoreMap":843},[837,1505,1508],{"className":839,"code":1506,"filename":1507,"language":842,"meta":843,"style":843},"import { defineErrorCatalog } from 'evlog'\n\nexport const billingPaymentErrors = defineErrorCatalog('billing.payment', {\n  DECLINED: { status: 402, message: 'Card declined' },\n  INSUFFICIENT_FUNDS: { status: 402, message: 'Insufficient funds' },\n  EXPIRED_CARD: { status: 402, message: 'Card expired' },\n  CVV_MISMATCH: { status: 402, message: 'CVV mismatch' },\n})\n","src\u002Ffeatures\u002Fbilling\u002Ferrors\u002Fpayment.ts",[515,1509,1510,1528,1532,1557,1588,1618,1648,1678],{"__ignoreMap":843},[847,1511,1512,1514,1516,1518,1520,1522,1524,1526],{"class":849,"line":850},[847,1513,854],{"class":853},[847,1515,858],{"class":857},[847,1517,862],{"class":861},[847,1519,865],{"class":857},[847,1521,868],{"class":853},[847,1523,871],{"class":857},[847,1525,875],{"class":874},[847,1527,878],{"class":857},[847,1529,1530],{"class":849,"line":881},[847,1531,885],{"emptyLinePlaceholder":884},[847,1533,1534,1536,1538,1541,1543,1545,1547,1549,1551,1553,1555],{"class":849,"line":888},[847,1535,891],{"class":853},[847,1537,895],{"class":894},[847,1539,1540],{"class":861}," billingPaymentErrors ",[847,1542,901],{"class":857},[847,1544,862],{"class":904},[847,1546,907],{"class":861},[847,1548,910],{"class":857},[847,1550,635],{"class":874},[847,1552,910],{"class":857},[847,1554,918],{"class":857},[847,1556,921],{"class":857},[847,1558,1559,1562,1564,1566,1568,1570,1573,1575,1577,1579,1581,1584,1586],{"class":849,"line":924},[847,1560,1561],{"class":927},"  DECLINED",[847,1563,931],{"class":857},[847,1565,858],{"class":857},[847,1567,936],{"class":927},[847,1569,931],{"class":857},[847,1571,1572],{"class":941}," 402",[847,1574,918],{"class":857},[847,1576,947],{"class":927},[847,1578,931],{"class":857},[847,1580,871],{"class":857},[847,1582,1583],{"class":874},"Card declined",[847,1585,910],{"class":857},[847,1587,959],{"class":857},[847,1589,1590,1593,1595,1597,1599,1601,1603,1605,1607,1609,1611,1614,1616],{"class":849,"line":962},[847,1591,1592],{"class":927},"  INSUFFICIENT_FUNDS",[847,1594,931],{"class":857},[847,1596,858],{"class":857},[847,1598,936],{"class":927},[847,1600,931],{"class":857},[847,1602,1572],{"class":941},[847,1604,918],{"class":857},[847,1606,947],{"class":927},[847,1608,931],{"class":857},[847,1610,871],{"class":857},[847,1612,1613],{"class":874},"Insufficient funds",[847,1615,910],{"class":857},[847,1617,959],{"class":857},[847,1619,1620,1623,1625,1627,1629,1631,1633,1635,1637,1639,1641,1644,1646],{"class":849,"line":994},[847,1621,1622],{"class":927},"  EXPIRED_CARD",[847,1624,931],{"class":857},[847,1626,858],{"class":857},[847,1628,936],{"class":927},[847,1630,931],{"class":857},[847,1632,1572],{"class":941},[847,1634,918],{"class":857},[847,1636,947],{"class":927},[847,1638,931],{"class":857},[847,1640,871],{"class":857},[847,1642,1643],{"class":874},"Card expired",[847,1645,910],{"class":857},[847,1647,959],{"class":857},[847,1649,1650,1653,1655,1657,1659,1661,1663,1665,1667,1669,1671,1674,1676],{"class":849,"line":1004},[847,1651,1652],{"class":927},"  CVV_MISMATCH",[847,1654,931],{"class":857},[847,1656,858],{"class":857},[847,1658,936],{"class":927},[847,1660,931],{"class":857},[847,1662,1572],{"class":941},[847,1664,918],{"class":857},[847,1666,947],{"class":927},[847,1668,931],{"class":857},[847,1670,871],{"class":857},[847,1672,1673],{"class":874},"CVV mismatch",[847,1675,910],{"class":857},[847,1677,959],{"class":857},[847,1679,1680,1682],{"class":849,"line":1018},[847,1681,1078],{"class":857},[847,1683,1081],{"class":861},[511,1685,1686,1687,518,1690,1693],{},"Wire codes become ",[515,1688,1689],{},"billing.payment.DECLINED",[515,1691,1692],{},"billing.payment.INSUFFICIENT_FUNDS",", etc. The convention scales to hundreds of entries without collisions.",[818,1695,1697],{"id":1696},"npm-packages-monorepo","npm packages — monorepo",[511,1699,1700,1701,1703,1704,1707],{},"In a monorepo, each bounded context can ship as its own npm package. Type augmentation propagates through the published ",[515,1702,650],{},", so consumers get autocomplete just by ",[515,1705,1706],{},"pnpm add @acme\u002Ferrors-billing",".",[837,1709,1712],{"className":1710,"code":1711,"language":1256},[1254],"acme-monorepo\u002F\n├── packages\u002F\n│   ├── errors-billing\u002F         → @acme\u002Ferrors-billing\n│   │   └── src\u002Findex.ts\n│   ├── errors-auth\u002F            → @acme\u002Ferrors-auth\n│   │   └── src\u002Findex.ts\n│   └── audit-billing\u002F          → @acme\u002Faudit-billing\n│       └── src\u002Findex.ts\n└── apps\u002F\n    ├── api\u002F                    → imports + re-exports the catalogs\n    └── worker\u002F\n",[515,1713,1711],{"__ignoreMap":843},[694,1715,1717],{"id":1716},"publishing-a-catalog-as-an-npm-package","Publishing a catalog as an npm package",[511,1719,1720,1721,1723],{},"A catalog is just regular TypeScript that depends on ",[515,1722,875],{}," as a peer dep. Here is the minimal recipe.",[818,1725,1727],{"id":1726},"packagejson",[515,1728,1729],{},"package.json",[837,1731,1736],{"className":1732,"code":1733,"filename":1734,"language":1735,"meta":843,"style":843},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"name\": \"@acme\u002Ferrors-billing\",\n  \"version\": \"1.0.0\",\n  \"type\": \"module\",\n  \"main\": \".\u002Fdist\u002Findex.mjs\",\n  \"types\": \".\u002Fdist\u002Findex.d.ts\",\n  \"exports\": {\n    \".\": {\n      \"import\": \".\u002Fdist\u002Findex.mjs\",\n      \"types\": \".\u002Fdist\u002Findex.d.ts\"\n    }\n  },\n  \"peerDependencies\": {\n    \"evlog\": \"^3.0.0\"\n  },\n  \"files\": [\"dist\"]\n}\n","packages\u002Ferrors-billing\u002Fpackage.json","json",[515,1737,1738,1743,1766,1786,1806,1826,1846,1859,1872,1891,1908,1913,1917,1930,1947,1951,1976],{"__ignoreMap":843},[847,1739,1740],{"class":849,"line":850},[847,1741,1742],{"class":857},"{\n",[847,1744,1745,1748,1751,1754,1756,1759,1762,1764],{"class":849,"line":881},[847,1746,1747],{"class":857},"  \"",[847,1749,1750],{"class":894},"name",[847,1752,1753],{"class":857},"\"",[847,1755,931],{"class":857},[847,1757,1758],{"class":857}," \"",[847,1760,1761],{"class":874},"@acme\u002Ferrors-billing",[847,1763,1753],{"class":857},[847,1765,1015],{"class":857},[847,1767,1768,1770,1773,1775,1777,1779,1782,1784],{"class":849,"line":888},[847,1769,1747],{"class":857},[847,1771,1772],{"class":894},"version",[847,1774,1753],{"class":857},[847,1776,931],{"class":857},[847,1778,1758],{"class":857},[847,1780,1781],{"class":874},"1.0.0",[847,1783,1753],{"class":857},[847,1785,1015],{"class":857},[847,1787,1788,1790,1793,1795,1797,1799,1802,1804],{"class":849,"line":924},[847,1789,1747],{"class":857},[847,1791,1792],{"class":894},"type",[847,1794,1753],{"class":857},[847,1796,931],{"class":857},[847,1798,1758],{"class":857},[847,1800,1801],{"class":874},"module",[847,1803,1753],{"class":857},[847,1805,1015],{"class":857},[847,1807,1808,1810,1813,1815,1817,1819,1822,1824],{"class":849,"line":962},[847,1809,1747],{"class":857},[847,1811,1812],{"class":894},"main",[847,1814,1753],{"class":857},[847,1816,931],{"class":857},[847,1818,1758],{"class":857},[847,1820,1821],{"class":874},".\u002Fdist\u002Findex.mjs",[847,1823,1753],{"class":857},[847,1825,1015],{"class":857},[847,1827,1828,1830,1833,1835,1837,1839,1842,1844],{"class":849,"line":994},[847,1829,1747],{"class":857},[847,1831,1832],{"class":894},"types",[847,1834,1753],{"class":857},[847,1836,931],{"class":857},[847,1838,1758],{"class":857},[847,1840,1841],{"class":874},".\u002Fdist\u002Findex.d.ts",[847,1843,1753],{"class":857},[847,1845,1015],{"class":857},[847,1847,1848,1850,1853,1855,1857],{"class":849,"line":1004},[847,1849,1747],{"class":857},[847,1851,1852],{"class":894},"exports",[847,1854,1753],{"class":857},[847,1856,931],{"class":857},[847,1858,921],{"class":857},[847,1860,1861,1864,1866,1868,1870],{"class":849,"line":1018},[847,1862,1863],{"class":857},"    \"",[847,1865,1707],{"class":1042},[847,1867,1753],{"class":857},[847,1869,931],{"class":857},[847,1871,921],{"class":857},[847,1873,1874,1877,1879,1881,1883,1885,1887,1889],{"class":849,"line":1069},[847,1875,1876],{"class":857},"      \"",[847,1878,854],{"class":941},[847,1880,1753],{"class":857},[847,1882,931],{"class":857},[847,1884,1758],{"class":857},[847,1886,1821],{"class":874},[847,1888,1753],{"class":857},[847,1890,1015],{"class":857},[847,1892,1893,1895,1897,1899,1901,1903,1905],{"class":849,"line":1075},[847,1894,1876],{"class":857},[847,1896,1832],{"class":941},[847,1898,1753],{"class":857},[847,1900,931],{"class":857},[847,1902,1758],{"class":857},[847,1904,1841],{"class":874},[847,1906,1907],{"class":857},"\"\n",[847,1909,1910],{"class":849,"line":1422},[847,1911,1912],{"class":857},"    }\n",[847,1914,1915],{"class":849,"line":1436},[847,1916,1072],{"class":857},[847,1918,1919,1921,1924,1926,1928],{"class":849,"line":1449},[847,1920,1747],{"class":857},[847,1922,1923],{"class":894},"peerDependencies",[847,1925,1753],{"class":857},[847,1927,931],{"class":857},[847,1929,921],{"class":857},[847,1931,1932,1934,1936,1938,1940,1942,1945],{"class":849,"line":1462},[847,1933,1863],{"class":857},[847,1935,875],{"class":1042},[847,1937,1753],{"class":857},[847,1939,931],{"class":857},[847,1941,1758],{"class":857},[847,1943,1944],{"class":874},"^3.0.0",[847,1946,1907],{"class":857},[847,1948,1949],{"class":849,"line":1468},[847,1950,1072],{"class":857},[847,1952,1954,1956,1959,1961,1963,1966,1968,1971,1973],{"class":849,"line":1953},16,[847,1955,1747],{"class":857},[847,1957,1958],{"class":894},"files",[847,1960,1753],{"class":857},[847,1962,931],{"class":857},[847,1964,1965],{"class":857}," [",[847,1967,1753],{"class":857},[847,1969,1970],{"class":874},"dist",[847,1972,1753],{"class":857},[847,1974,1975],{"class":857},"]\n",[847,1977,1979],{"class":849,"line":1978},17,[847,1980,1471],{"class":857},[818,1982,1984],{"id":1983},"source-catalog-augmentation-in-the-same-file","Source — catalog + augmentation in the same file",[837,1986,1989],{"className":839,"code":1987,"filename":1988,"language":842,"meta":843,"style":843},"import { defineErrorCatalog } from 'evlog'\n\nexport const billingErrors = defineErrorCatalog('billing', {\n  PAYMENT_DECLINED: {\n    status: 402,\n    message: 'Card declined',\n    why: 'Issuer declined the charge',\n    fix: 'Try a different payment method',\n    link: 'https:\u002F\u002Fdocs.example.com\u002Ferrors\u002Fbilling.payment_declined',\n  },\n  INSUFFICIENT_FUNDS: {\n    status: 402,\n    message: ({ available, required }: { available: number, required: number }) =>\n      `Insufficient funds: $${available}\u002F$${required}`,\n  },\n  \u002F\u002F ...\n})\n\ndeclare module 'evlog' {\n  interface RegisteredErrorCatalogs {\n    billing: typeof billingErrors\n  }\n}\n","packages\u002Ferrors-billing\u002Fsrc\u002Findex.ts",[515,1990,1991,2009,2013,2039,2048,2058,2072,2088,2104,2120,2124,2132,2142,2182,2209,2213,2219,2225,2230,2245,2254,2265,2270],{"__ignoreMap":843},[847,1992,1993,1995,1997,1999,2001,2003,2005,2007],{"class":849,"line":850},[847,1994,854],{"class":853},[847,1996,858],{"class":857},[847,1998,862],{"class":861},[847,2000,865],{"class":857},[847,2002,868],{"class":853},[847,2004,871],{"class":857},[847,2006,875],{"class":874},[847,2008,878],{"class":857},[847,2010,2011],{"class":849,"line":881},[847,2012,885],{"emptyLinePlaceholder":884},[847,2014,2015,2017,2019,2022,2024,2026,2028,2030,2033,2035,2037],{"class":849,"line":888},[847,2016,891],{"class":853},[847,2018,895],{"class":894},[847,2020,2021],{"class":861}," billingErrors ",[847,2023,901],{"class":857},[847,2025,862],{"class":904},[847,2027,907],{"class":861},[847,2029,910],{"class":857},[847,2031,2032],{"class":874},"billing",[847,2034,910],{"class":857},[847,2036,918],{"class":857},[847,2038,921],{"class":857},[847,2040,2041,2044,2046],{"class":849,"line":924},[847,2042,2043],{"class":927},"  PAYMENT_DECLINED",[847,2045,931],{"class":857},[847,2047,921],{"class":857},[847,2049,2050,2052,2054,2056],{"class":849,"line":962},[847,2051,1007],{"class":927},[847,2053,931],{"class":857},[847,2055,1572],{"class":941},[847,2057,1015],{"class":857},[847,2059,2060,2062,2064,2066,2068,2070],{"class":849,"line":994},[847,2061,1021],{"class":927},[847,2063,931],{"class":857},[847,2065,871],{"class":857},[847,2067,1583],{"class":874},[847,2069,910],{"class":857},[847,2071,1015],{"class":857},[847,2073,2074,2077,2079,2081,2084,2086],{"class":849,"line":1004},[847,2075,2076],{"class":927},"    why",[847,2078,931],{"class":857},[847,2080,871],{"class":857},[847,2082,2083],{"class":874},"Issuer declined the charge",[847,2085,910],{"class":857},[847,2087,1015],{"class":857},[847,2089,2090,2093,2095,2097,2100,2102],{"class":849,"line":1018},[847,2091,2092],{"class":927},"    fix",[847,2094,931],{"class":857},[847,2096,871],{"class":857},[847,2098,2099],{"class":874},"Try a different payment method",[847,2101,910],{"class":857},[847,2103,1015],{"class":857},[847,2105,2106,2109,2111,2113,2116,2118],{"class":849,"line":1069},[847,2107,2108],{"class":927},"    link",[847,2110,931],{"class":857},[847,2112,871],{"class":857},[847,2114,2115],{"class":874},"https:\u002F\u002Fdocs.example.com\u002Ferrors\u002Fbilling.payment_declined",[847,2117,910],{"class":857},[847,2119,1015],{"class":857},[847,2121,2122],{"class":849,"line":1075},[847,2123,1072],{"class":857},[847,2125,2126,2128,2130],{"class":849,"line":1422},[847,2127,1592],{"class":927},[847,2129,931],{"class":857},[847,2131,921],{"class":857},[847,2133,2134,2136,2138,2140],{"class":849,"line":1436},[847,2135,1007],{"class":927},[847,2137,931],{"class":857},[847,2139,1572],{"class":941},[847,2141,1015],{"class":857},[847,2143,2144,2146,2148,2150,2153,2155,2158,2160,2162,2164,2166,2169,2171,2173,2175,2177,2179],{"class":849,"line":1449},[847,2145,1021],{"class":904},[847,2147,931],{"class":857},[847,2149,1026],{"class":857},[847,2151,2152],{"class":1029}," available",[847,2154,918],{"class":857},[847,2156,2157],{"class":1029}," required",[847,2159,1033],{"class":857},[847,2161,858],{"class":857},[847,2163,2152],{"class":927},[847,2165,931],{"class":857},[847,2167,2168],{"class":1042}," number",[847,2170,918],{"class":857},[847,2172,2157],{"class":927},[847,2174,931],{"class":857},[847,2176,2168],{"class":1042},[847,2178,1046],{"class":857},[847,2180,2181],{"class":894}," =>\n",[847,2183,2184,2187,2190,2192,2195,2197,2200,2202,2205,2207],{"class":849,"line":1462},[847,2185,2186],{"class":857},"      `",[847,2188,2189],{"class":874},"Insufficient funds: $",[847,2191,1058],{"class":857},[847,2193,2194],{"class":861},"available",[847,2196,1078],{"class":857},[847,2198,2199],{"class":874},"\u002F$",[847,2201,1058],{"class":857},[847,2203,2204],{"class":861},"required",[847,2206,1064],{"class":857},[847,2208,1015],{"class":857},[847,2210,2211],{"class":849,"line":1468},[847,2212,1072],{"class":857},[847,2214,2215],{"class":849,"line":1953},[847,2216,2218],{"class":2217},"sHwdD","  \u002F\u002F ...\n",[847,2220,2221,2223],{"class":849,"line":1978},[847,2222,1078],{"class":857},[847,2224,1081],{"class":861},[847,2226,2228],{"class":849,"line":2227},18,[847,2229,885],{"emptyLinePlaceholder":884},[847,2231,2233,2235,2237,2239,2241,2243],{"class":849,"line":2232},19,[847,2234,1398],{"class":894},[847,2236,1401],{"class":894},[847,2238,871],{"class":857},[847,2240,875],{"class":874},[847,2242,910],{"class":857},[847,2244,921],{"class":857},[847,2246,2248,2250,2252],{"class":849,"line":2247},20,[847,2249,1414],{"class":894},[847,2251,1417],{"class":1042},[847,2253,921],{"class":857},[847,2255,2257,2259,2261,2263],{"class":849,"line":2256},21,[847,2258,1439],{"class":927},[847,2260,931],{"class":857},[847,2262,1430],{"class":857},[847,2264,1446],{"class":861},[847,2266,2268],{"class":849,"line":2267},22,[847,2269,1465],{"class":857},[847,2271,2273],{"class":849,"line":2272},23,[847,2274,1471],{"class":857},[511,2276,2277,2278,2280,2281,2284,2285,2287],{},"The ",[515,2279,669],{}," block lives inside the source file so the bundler emits it into the ",[515,2282,2283],{},"dist\u002Findex.d.ts",". Any consumer that imports from ",[515,2286,1761],{}," gets the augmentation transitively — no extra setup required on their side.",[818,2289,2291],{"id":2290},"consumption","Consumption",[837,2293,2296],{"className":839,"code":2294,"filename":2295,"language":842,"meta":843,"style":843},"\u002F\u002F Importing the package activates both the runtime catalog and the type augmentation.\nimport { billingErrors } from '@acme\u002Ferrors-billing'\nimport { authErrors } from '@acme\u002Ferrors-auth'\n\n\u002F\u002F Re-export from a central place so the rest of the app has one import path.\nexport { billingErrors, authErrors }\n","apps\u002Fapi\u002Fsrc\u002Finit.ts",[515,2297,2298,2303,2321,2340,2344,2349],{"__ignoreMap":843},[847,2299,2300],{"class":849,"line":850},[847,2301,2302],{"class":2217},"\u002F\u002F Importing the package activates both the runtime catalog and the type augmentation.\n",[847,2304,2305,2307,2309,2311,2313,2315,2317,2319],{"class":849,"line":881},[847,2306,854],{"class":853},[847,2308,858],{"class":857},[847,2310,1298],{"class":861},[847,2312,865],{"class":857},[847,2314,868],{"class":853},[847,2316,871],{"class":857},[847,2318,1761],{"class":874},[847,2320,878],{"class":857},[847,2322,2323,2325,2327,2329,2331,2333,2335,2338],{"class":849,"line":888},[847,2324,854],{"class":853},[847,2326,858],{"class":857},[847,2328,1276],{"class":861},[847,2330,865],{"class":857},[847,2332,868],{"class":853},[847,2334,871],{"class":857},[847,2336,2337],{"class":874},"@acme\u002Ferrors-auth",[847,2339,878],{"class":857},[847,2341,2342],{"class":849,"line":924},[847,2343,885],{"emptyLinePlaceholder":884},[847,2345,2346],{"class":849,"line":962},[847,2347,2348],{"class":2217},"\u002F\u002F Re-export from a central place so the rest of the app has one import path.\n",[847,2350,2351,2353,2355,2357,2359,2361],{"class":849,"line":994},[847,2352,891],{"class":853},[847,2354,858],{"class":857},[847,2356,1298],{"class":861},[847,2358,918],{"class":857},[847,2360,1276],{"class":861},[847,2362,2363],{"class":857}," }\n",[837,2365,2368],{"className":839,"code":2366,"filename":2367,"language":842,"meta":843,"style":843},"import { billingErrors } from '~\u002Finit'\n\nthrow billingErrors.PAYMENT_DECLINED({ cause: stripeErr })\n","apps\u002Fapi\u002Fsrc\u002Froutes\u002Fcheckout.post.ts",[515,2369,2370,2389,2393],{"__ignoreMap":843},[847,2371,2372,2374,2376,2378,2380,2382,2384,2387],{"class":849,"line":850},[847,2373,854],{"class":853},[847,2375,858],{"class":857},[847,2377,1298],{"class":861},[847,2379,865],{"class":857},[847,2381,868],{"class":853},[847,2383,871],{"class":857},[847,2385,2386],{"class":874},"~\u002Finit",[847,2388,878],{"class":857},[847,2390,2391],{"class":849,"line":881},[847,2392,885],{"emptyLinePlaceholder":884},[847,2394,2395,2398,2400,2402,2404,2406,2409,2412,2414,2417,2419],{"class":849,"line":888},[847,2396,2397],{"class":853},"throw",[847,2399,1298],{"class":861},[847,2401,1707],{"class":857},[847,2403,741],{"class":904},[847,2405,907],{"class":861},[847,2407,2408],{"class":857},"{",[847,2410,2411],{"class":927}," cause",[847,2413,931],{"class":857},[847,2415,2416],{"class":861}," stripeErr ",[847,2418,1078],{"class":857},[847,2420,1081],{"class":861},[837,2422,2425],{"className":839,"code":2423,"filename":2424,"language":842,"meta":843,"style":843},"import { createError, parseError } from 'evlog'\n\nthrow createError({\n  code: 'billing.PAYMENT_DECLINED', \u002F\u002F ← autocomplete from the registered catalog\n  message: 'Card declined',\n  status: 402,\n})\n\nconst err = parseError(caught)\nif (err.code === 'billing.PAYMENT_DECLINED') retry()\n\u002F\u002F                ↑ TypeScript knows the union of all registered codes\n","Anywhere in the app — autocomplete works",[515,2426,2427,2451,2455,2465,2483,2498,2509,2515,2519,2534,2565],{"__ignoreMap":843},[847,2428,2429,2431,2433,2436,2438,2441,2443,2445,2447,2449],{"class":849,"line":850},[847,2430,854],{"class":853},[847,2432,858],{"class":857},[847,2434,2435],{"class":861}," createError",[847,2437,918],{"class":857},[847,2439,2440],{"class":861}," parseError",[847,2442,865],{"class":857},[847,2444,868],{"class":853},[847,2446,871],{"class":857},[847,2448,875],{"class":874},[847,2450,878],{"class":857},[847,2452,2453],{"class":849,"line":881},[847,2454,885],{"emptyLinePlaceholder":884},[847,2456,2457,2459,2461,2463],{"class":849,"line":888},[847,2458,2397],{"class":853},[847,2460,2435],{"class":904},[847,2462,907],{"class":861},[847,2464,1742],{"class":857},[847,2466,2467,2470,2472,2474,2476,2478,2480],{"class":849,"line":924},[847,2468,2469],{"class":927},"  code",[847,2471,931],{"class":857},[847,2473,871],{"class":857},[847,2475,574],{"class":874},[847,2477,910],{"class":857},[847,2479,918],{"class":857},[847,2481,2482],{"class":2217}," \u002F\u002F ← autocomplete from the registered catalog\n",[847,2484,2485,2488,2490,2492,2494,2496],{"class":849,"line":962},[847,2486,2487],{"class":927},"  message",[847,2489,931],{"class":857},[847,2491,871],{"class":857},[847,2493,1583],{"class":874},[847,2495,910],{"class":857},[847,2497,1015],{"class":857},[847,2499,2500,2503,2505,2507],{"class":849,"line":994},[847,2501,2502],{"class":927},"  status",[847,2504,931],{"class":857},[847,2506,1572],{"class":941},[847,2508,1015],{"class":857},[847,2510,2511,2513],{"class":849,"line":1004},[847,2512,1078],{"class":857},[847,2514,1081],{"class":861},[847,2516,2517],{"class":849,"line":1018},[847,2518,885],{"emptyLinePlaceholder":884},[847,2520,2521,2524,2527,2529,2531],{"class":849,"line":1069},[847,2522,2523],{"class":894},"const",[847,2525,2526],{"class":861}," err ",[847,2528,901],{"class":857},[847,2530,2440],{"class":904},[847,2532,2533],{"class":861},"(caught)\n",[847,2535,2536,2539,2542,2544,2547,2550,2552,2554,2556,2559,2562],{"class":849,"line":1075},[847,2537,2538],{"class":853},"if",[847,2540,2541],{"class":861}," (err",[847,2543,1707],{"class":857},[847,2545,2546],{"class":861},"code ",[847,2548,2549],{"class":857},"===",[847,2551,871],{"class":857},[847,2553,574],{"class":874},[847,2555,910],{"class":857},[847,2557,2558],{"class":861},") ",[847,2560,2561],{"class":904},"retry",[847,2563,2564],{"class":861},"()\n",[847,2566,2567],{"class":849,"line":1422},[847,2568,2569],{"class":2217},"\u002F\u002F                ↑ TypeScript knows the union of all registered codes\n",[2571,2572,2575,2578,2579,2581,2582,518,2585,2581,2587,2590],"callout",{"color":2573,"icon":2574},"neutral","i-lucide-package",[728,2576,2577],{},"Each shared package owns its prefix."," ",[515,2580,1761],{}," owns ",[515,2583,2584],{},"billing.*",[515,2586,2337],{},[515,2588,2589],{},"auth.*",". Conflicts are impossible by construction. Bumping a catalog to a new minor (adding entries) propagates to consumers via the regular semver upgrade path — no codegen, no migration step.",[694,2592,2594],{"id":2593},"composition-patterns","Composition patterns",[818,2596,2598],{"id":2597},"mix-catalogs-and-standalone-factories","Mix catalogs and standalone factories",[511,2600,2601,560,2603,2605,2606,2608],{},[515,2602,517],{},[515,2604,521],{}," produce identical call-site shapes. Use catalogs for grouped errors, ",[515,2607,517],{}," for one-offs (e.g. cross-cutting concerns like rate-limiting that don't belong to a specific domain).",[837,2610,2612],{"className":839,"code":2611,"filename":1262,"language":842,"meta":843,"style":843},"import { defineError, defineErrorCatalog } from 'evlog'\n\nexport const billingErrors = defineErrorCatalog('billing', {\n  PAYMENT_DECLINED: { status: 402, message: 'Card declined' },\n})\n\nexport const rateLimited = defineError('app.RATE_LIMITED', {\n  status: 429,\n  message: ({ retryAfter }: { retryAfter: number }) =>\n    `Rate limited: retry in ${retryAfter}s`,\n})\n\n\u002F\u002F Both look identical at the call site:\nthrow billingErrors.PAYMENT_DECLINED()\nthrow rateLimited({ retryAfter: 30 })\n",[515,2613,2614,2637,2641,2665,2693,2699,2703,2729,2740,2765,2788,2794,2798,2803,2815],{"__ignoreMap":843},[847,2615,2616,2618,2620,2623,2625,2627,2629,2631,2633,2635],{"class":849,"line":850},[847,2617,854],{"class":853},[847,2619,858],{"class":857},[847,2621,2622],{"class":861}," defineError",[847,2624,918],{"class":857},[847,2626,862],{"class":861},[847,2628,865],{"class":857},[847,2630,868],{"class":853},[847,2632,871],{"class":857},[847,2634,875],{"class":874},[847,2636,878],{"class":857},[847,2638,2639],{"class":849,"line":881},[847,2640,885],{"emptyLinePlaceholder":884},[847,2642,2643,2645,2647,2649,2651,2653,2655,2657,2659,2661,2663],{"class":849,"line":888},[847,2644,891],{"class":853},[847,2646,895],{"class":894},[847,2648,2021],{"class":861},[847,2650,901],{"class":857},[847,2652,862],{"class":904},[847,2654,907],{"class":861},[847,2656,910],{"class":857},[847,2658,2032],{"class":874},[847,2660,910],{"class":857},[847,2662,918],{"class":857},[847,2664,921],{"class":857},[847,2666,2667,2669,2671,2673,2675,2677,2679,2681,2683,2685,2687,2689,2691],{"class":849,"line":924},[847,2668,2043],{"class":927},[847,2670,931],{"class":857},[847,2672,858],{"class":857},[847,2674,936],{"class":927},[847,2676,931],{"class":857},[847,2678,1572],{"class":941},[847,2680,918],{"class":857},[847,2682,947],{"class":927},[847,2684,931],{"class":857},[847,2686,871],{"class":857},[847,2688,1583],{"class":874},[847,2690,910],{"class":857},[847,2692,959],{"class":857},[847,2694,2695,2697],{"class":849,"line":962},[847,2696,1078],{"class":857},[847,2698,1081],{"class":861},[847,2700,2701],{"class":849,"line":994},[847,2702,885],{"emptyLinePlaceholder":884},[847,2704,2705,2707,2709,2712,2714,2716,2718,2720,2723,2725,2727],{"class":849,"line":1004},[847,2706,891],{"class":853},[847,2708,895],{"class":894},[847,2710,2711],{"class":861}," rateLimited ",[847,2713,901],{"class":857},[847,2715,2622],{"class":904},[847,2717,907],{"class":861},[847,2719,910],{"class":857},[847,2721,2722],{"class":874},"app.RATE_LIMITED",[847,2724,910],{"class":857},[847,2726,918],{"class":857},[847,2728,921],{"class":857},[847,2730,2731,2733,2735,2738],{"class":849,"line":1018},[847,2732,2502],{"class":927},[847,2734,931],{"class":857},[847,2736,2737],{"class":941}," 429",[847,2739,1015],{"class":857},[847,2741,2742,2744,2746,2748,2751,2753,2755,2757,2759,2761,2763],{"class":849,"line":1069},[847,2743,2487],{"class":904},[847,2745,931],{"class":857},[847,2747,1026],{"class":857},[847,2749,2750],{"class":1029}," retryAfter",[847,2752,1033],{"class":857},[847,2754,858],{"class":857},[847,2756,2750],{"class":927},[847,2758,931],{"class":857},[847,2760,2168],{"class":1042},[847,2762,1046],{"class":857},[847,2764,2181],{"class":894},[847,2766,2767,2770,2773,2775,2778,2780,2783,2786],{"class":849,"line":1075},[847,2768,2769],{"class":857},"    `",[847,2771,2772],{"class":874},"Rate limited: retry in ",[847,2774,1058],{"class":857},[847,2776,2777],{"class":861},"retryAfter",[847,2779,1078],{"class":857},[847,2781,2782],{"class":874},"s",[847,2784,2785],{"class":857},"`",[847,2787,1015],{"class":857},[847,2789,2790,2792],{"class":849,"line":1422},[847,2791,1078],{"class":857},[847,2793,1081],{"class":861},[847,2795,2796],{"class":849,"line":1436},[847,2797,885],{"emptyLinePlaceholder":884},[847,2799,2800],{"class":849,"line":1449},[847,2801,2802],{"class":2217},"\u002F\u002F Both look identical at the call site:\n",[847,2804,2805,2807,2809,2811,2813],{"class":849,"line":1462},[847,2806,2397],{"class":853},[847,2808,1298],{"class":861},[847,2810,1707],{"class":857},[847,2812,741],{"class":904},[847,2814,2564],{"class":861},[847,2816,2817,2819,2822,2824,2826,2828,2830,2833,2835],{"class":849,"line":1468},[847,2818,2397],{"class":853},[847,2820,2821],{"class":904}," rateLimited",[847,2823,907],{"class":861},[847,2825,2408],{"class":857},[847,2827,2750],{"class":927},[847,2829,931],{"class":857},[847,2831,2832],{"class":941}," 30",[847,2834,865],{"class":857},[847,2836,1081],{"class":861},[818,2838,2840],{"id":2839},"re-export-from-one-entry-per-domain","Re-export from one entry per domain",[511,2842,2843],{},"If a feature ships errors and audits together, give it a single re-export module so call sites only import once.",[837,2845,2848],{"className":839,"code":2846,"filename":2847,"language":842,"meta":843,"style":843},"export { billingErrors } from '.\u002Ferrors\u002Fbilling'\nexport { billingAudit } from '.\u002Faudit\u002Fbilling'\n","src\u002Ffeatures\u002Fbilling\u002Findex.ts",[515,2849,2850,2869],{"__ignoreMap":843},[847,2851,2852,2854,2856,2858,2860,2862,2864,2867],{"class":849,"line":850},[847,2853,891],{"class":853},[847,2855,858],{"class":857},[847,2857,1298],{"class":861},[847,2859,865],{"class":857},[847,2861,868],{"class":853},[847,2863,871],{"class":857},[847,2865,2866],{"class":874},".\u002Ferrors\u002Fbilling",[847,2868,878],{"class":857},[847,2870,2871,2873,2875,2878,2880,2882,2884,2887],{"class":849,"line":881},[847,2872,891],{"class":853},[847,2874,858],{"class":857},[847,2876,2877],{"class":861}," billingAudit",[847,2879,865],{"class":857},[847,2881,868],{"class":853},[847,2883,871],{"class":857},[847,2885,2886],{"class":874},".\u002Faudit\u002Fbilling",[847,2888,878],{"class":857},[837,2890,2893],{"className":839,"code":2891,"filename":2892,"language":842,"meta":843,"style":843},"import { billingErrors, billingAudit } from '~\u002Ffeatures\u002Fbilling'\n\nif (!cart.items.length) throw billingErrors.CART_EMPTY()\n\nlog.audit(billingAudit.INVOICE_REFUND({ actor, target: { id: 'inv_889' } }))\n","server\u002Fapi\u002Frefund.post.ts",[515,2894,2895,2918,2922,2956,2960],{"__ignoreMap":843},[847,2896,2897,2899,2901,2903,2905,2907,2909,2911,2913,2916],{"class":849,"line":850},[847,2898,854],{"class":853},[847,2900,858],{"class":857},[847,2902,1298],{"class":861},[847,2904,918],{"class":857},[847,2906,2877],{"class":861},[847,2908,865],{"class":857},[847,2910,868],{"class":853},[847,2912,871],{"class":857},[847,2914,2915],{"class":874},"~\u002Ffeatures\u002Fbilling",[847,2917,878],{"class":857},[847,2919,2920],{"class":849,"line":881},[847,2921,885],{"emptyLinePlaceholder":884},[847,2923,2924,2926,2929,2932,2935,2937,2940,2942,2945,2947,2949,2951,2954],{"class":849,"line":888},[847,2925,2538],{"class":853},[847,2927,2928],{"class":861}," (",[847,2930,2931],{"class":857},"!",[847,2933,2934],{"class":861},"cart",[847,2936,1707],{"class":857},[847,2938,2939],{"class":861},"items",[847,2941,1707],{"class":857},[847,2943,2944],{"class":861},"length) ",[847,2946,2397],{"class":853},[847,2948,1298],{"class":861},[847,2950,1707],{"class":857},[847,2952,2953],{"class":904},"CART_EMPTY",[847,2955,2564],{"class":861},[847,2957,2958],{"class":849,"line":924},[847,2959,885],{"emptyLinePlaceholder":884},[847,2961,2962,2965,2967,2970,2973,2975,2977,2979,2981,2984,2986,2988,2990,2992,2995,2997,2999,3002,3004,3006,3008],{"class":849,"line":962},[847,2963,2964],{"class":861},"log",[847,2966,1707],{"class":857},[847,2968,2969],{"class":904},"audit",[847,2971,2972],{"class":861},"(billingAudit",[847,2974,1707],{"class":857},[847,2976,744],{"class":904},[847,2978,907],{"class":861},[847,2980,2408],{"class":857},[847,2982,2983],{"class":861}," actor",[847,2985,918],{"class":857},[847,2987,1147],{"class":927},[847,2989,931],{"class":857},[847,2991,858],{"class":857},[847,2993,2994],{"class":927}," id",[847,2996,931],{"class":857},[847,2998,871],{"class":857},[847,3000,3001],{"class":874},"inv_889",[847,3003,910],{"class":857},[847,3005,865],{"class":857},[847,3007,865],{"class":857},[847,3009,3010],{"class":861},"))\n",[818,3012,3014],{"id":3013},"override-catalog-defaults-at-the-call-site","Override catalog defaults at the call site",[511,3016,3017,3018,518,3021,518,3024,518,3027,518,3030,518,3033,3035,3036,3038],{},"Every entry's defaults (",[515,3019,3020],{},"message",[515,3022,3023],{},"status",[515,3025,3026],{},"why",[515,3028,3029],{},"fix",[515,3031,3032],{},"link",[515,3034,610],{},") are overridable per call. ",[515,3037,610],{}," is shallow-merged (call-site wins on conflict).",[837,3040,3042],{"className":839,"code":3041,"language":842,"meta":843,"style":843},"\u002F\u002F Catalog default:\n\u002F\u002F message: 'Card declined'\n\u002F\u002F internal: { category: 'gateway' }\n\nthrow billingErrors.PAYMENT_DECLINED({\n  message: 'Custom message for this specific call',\n  internal: { stripeRef: 'ch_x', category: 'gateway-overridden' },\n  cause: stripeErr,\n})\n\n\u002F\u002F Resulting EvlogError:\n\u002F\u002F - message: 'Custom message for this specific call' (override)\n\u002F\u002F - status: 402 (catalog default)\n\u002F\u002F - why: 'Issuer declined the charge' (catalog default)\n\u002F\u002F - internal: { category: 'gateway-overridden', stripeRef: 'ch_x' }\n",[515,3043,3044,3049,3054,3059,3063,3077,3092,3129,3141,3147,3151,3156,3161,3166,3171],{"__ignoreMap":843},[847,3045,3046],{"class":849,"line":850},[847,3047,3048],{"class":2217},"\u002F\u002F Catalog default:\n",[847,3050,3051],{"class":849,"line":881},[847,3052,3053],{"class":2217},"\u002F\u002F message: 'Card declined'\n",[847,3055,3056],{"class":849,"line":888},[847,3057,3058],{"class":2217},"\u002F\u002F internal: { category: 'gateway' }\n",[847,3060,3061],{"class":849,"line":924},[847,3062,885],{"emptyLinePlaceholder":884},[847,3064,3065,3067,3069,3071,3073,3075],{"class":849,"line":962},[847,3066,2397],{"class":853},[847,3068,1298],{"class":861},[847,3070,1707],{"class":857},[847,3072,741],{"class":904},[847,3074,907],{"class":861},[847,3076,1742],{"class":857},[847,3078,3079,3081,3083,3085,3088,3090],{"class":849,"line":994},[847,3080,2487],{"class":927},[847,3082,931],{"class":857},[847,3084,871],{"class":857},[847,3086,3087],{"class":874},"Custom message for this specific call",[847,3089,910],{"class":857},[847,3091,1015],{"class":857},[847,3093,3094,3097,3099,3101,3104,3106,3108,3111,3113,3115,3118,3120,3122,3125,3127],{"class":849,"line":1004},[847,3095,3096],{"class":927},"  internal",[847,3098,931],{"class":857},[847,3100,858],{"class":857},[847,3102,3103],{"class":927}," stripeRef",[847,3105,931],{"class":857},[847,3107,871],{"class":857},[847,3109,3110],{"class":874},"ch_x",[847,3112,910],{"class":857},[847,3114,918],{"class":857},[847,3116,3117],{"class":927}," category",[847,3119,931],{"class":857},[847,3121,871],{"class":857},[847,3123,3124],{"class":874},"gateway-overridden",[847,3126,910],{"class":857},[847,3128,959],{"class":857},[847,3130,3131,3134,3136,3139],{"class":849,"line":1018},[847,3132,3133],{"class":927},"  cause",[847,3135,931],{"class":857},[847,3137,3138],{"class":861}," stripeErr",[847,3140,1015],{"class":857},[847,3142,3143,3145],{"class":849,"line":1069},[847,3144,1078],{"class":857},[847,3146,1081],{"class":861},[847,3148,3149],{"class":849,"line":1075},[847,3150,885],{"emptyLinePlaceholder":884},[847,3152,3153],{"class":849,"line":1422},[847,3154,3155],{"class":2217},"\u002F\u002F Resulting EvlogError:\n",[847,3157,3158],{"class":849,"line":1436},[847,3159,3160],{"class":2217},"\u002F\u002F - message: 'Custom message for this specific call' (override)\n",[847,3162,3163],{"class":849,"line":1449},[847,3164,3165],{"class":2217},"\u002F\u002F - status: 402 (catalog default)\n",[847,3167,3168],{"class":849,"line":1462},[847,3169,3170],{"class":2217},"\u002F\u002F - why: 'Issuer declined the charge' (catalog default)\n",[847,3172,3173],{"class":849,"line":1468},[847,3174,3175],{"class":2217},"\u002F\u002F - internal: { category: 'gateway-overridden', stripeRef: 'ch_x' }\n",[694,3177,3179],{"id":3178},"type-augmentation-deep-dive","Type augmentation — deep dive",[511,3181,3182,3183,3185,3186,518,3188,3190,3191,3194,3195,3198],{},"The opt-in ",[515,3184,642],{}," block is what surfaces autocomplete on ",[515,3187,621],{},[515,3189,624],{},", and the typed ",[515,3192,3193],{},"ErrorCode"," \u002F ",[515,3196,3197],{},"AuditAction"," exports.",[818,3200,3202],{"id":3201},"where-to-put-the-augmentation","Where to put the augmentation",[702,3204,3205,3215],{},[705,3206,3207],{},[708,3208,3209,3212],{},[711,3210,3211],{},"Repo shape",[711,3213,3214],{},"Recommended location",[720,3216,3217,3227,3241,3254],{},[708,3218,3219,3224],{},[725,3220,3221,3222,578],{},"Single file (",[515,3223,841],{},[725,3225,3226],{},"At the bottom of the same file",[708,3228,3229,3235],{},[725,3230,3231,3232,578],{},"Folder (",[515,3233,3234],{},"src\u002Ferrors\u002F*.ts",[725,3236,3237,3238,3240],{},"In ",[515,3239,1262],{}," (centralised) or each catalog file (decentralised)",[708,3242,3243,3246],{},[725,3244,3245],{},"npm package",[725,3247,3248,3249,3251,3252],{},"At the bottom of the package's main ",[515,3250,646],{}," so it ships in the published ",[515,3253,650],{},[708,3255,3256,3259],{},[725,3257,3258],{},"Monorepo",[725,3260,3261],{},"One augmentation per package, no central registry needed",[511,3263,3264,3265,3267],{},"Both centralised and decentralised work — TypeScript merges multiple ",[515,3266,642],{}," blocks across files automatically.",[818,3269,3271],{"id":3270},"how-to-add-custom-domains","How to add custom domains",[511,3273,3274],{},"Each augmentation key is the namespace name. Multiple catalogs sharing a prefix can either be merged into one key or split:",[837,3276,3279],{"className":839,"code":3277,"filename":3278,"language":842,"meta":843,"style":843},"declare module 'evlog' {\n  interface RegisteredErrorCatalogs {\n    billing: typeof billingErrors\n  }\n}\n","Centralised — one key per package",[515,3280,3281,3295,3303,3313,3317],{"__ignoreMap":843},[847,3282,3283,3285,3287,3289,3291,3293],{"class":849,"line":850},[847,3284,1398],{"class":894},[847,3286,1401],{"class":894},[847,3288,871],{"class":857},[847,3290,875],{"class":874},[847,3292,910],{"class":857},[847,3294,921],{"class":857},[847,3296,3297,3299,3301],{"class":849,"line":881},[847,3298,1414],{"class":894},[847,3300,1417],{"class":1042},[847,3302,921],{"class":857},[847,3304,3305,3307,3309,3311],{"class":849,"line":888},[847,3306,1439],{"class":927},[847,3308,931],{"class":857},[847,3310,1430],{"class":857},[847,3312,1446],{"class":861},[847,3314,3315],{"class":849,"line":924},[847,3316,1465],{"class":857},[847,3318,3319],{"class":849,"line":962},[847,3320,1471],{"class":857},[837,3322,3325],{"className":839,"code":3323,"filename":3324,"language":842,"meta":843,"style":843},"declare module 'evlog' {\n  interface RegisteredErrorCatalogs {\n    'billing.payment': typeof billingPaymentErrors\n    'billing.subscription': typeof billingSubscriptionErrors\n    'billing.invoice': typeof billingInvoiceErrors\n  }\n}\n","Decentralised — one key per sub-domain",[515,3326,3327,3341,3349,3365,3380,3396,3400],{"__ignoreMap":843},[847,3328,3329,3331,3333,3335,3337,3339],{"class":849,"line":850},[847,3330,1398],{"class":894},[847,3332,1401],{"class":894},[847,3334,871],{"class":857},[847,3336,875],{"class":874},[847,3338,910],{"class":857},[847,3340,921],{"class":857},[847,3342,3343,3345,3347],{"class":849,"line":881},[847,3344,1414],{"class":894},[847,3346,1417],{"class":1042},[847,3348,921],{"class":857},[847,3350,3351,3354,3356,3358,3360,3362],{"class":849,"line":888},[847,3352,3353],{"class":857},"    '",[847,3355,635],{"class":874},[847,3357,910],{"class":857},[847,3359,931],{"class":857},[847,3361,1430],{"class":857},[847,3363,3364],{"class":861}," billingPaymentErrors\n",[847,3366,3367,3369,3371,3373,3375,3377],{"class":849,"line":924},[847,3368,3353],{"class":857},[847,3370,1493],{"class":874},[847,3372,910],{"class":857},[847,3374,931],{"class":857},[847,3376,1430],{"class":857},[847,3378,3379],{"class":861}," billingSubscriptionErrors\n",[847,3381,3382,3384,3387,3389,3391,3393],{"class":849,"line":962},[847,3383,3353],{"class":857},[847,3385,3386],{"class":874},"billing.invoice",[847,3388,910],{"class":857},[847,3390,931],{"class":857},[847,3392,1430],{"class":857},[847,3394,3395],{"class":861}," billingInvoiceErrors\n",[847,3397,3398],{"class":849,"line":994},[847,3399,1465],{"class":857},[847,3401,3402],{"class":849,"line":1004},[847,3403,1471],{"class":857},[511,3405,2277,3406,3409,3410,3412],{},[515,3407,3408],{},"_codes"," literal union is what produces the actual ",[515,3411,3193],{}," type — the keys themselves are arbitrary, choose what feels right for your structure.",[818,3414,3416],{"id":3415},"verifying-the-augmentation","Verifying the augmentation",[837,3418,3421],{"className":839,"code":3419,"filename":3420,"language":842,"meta":843,"style":843},"import type { ErrorCode, AuditAction } from 'evlog'\n\n\u002F\u002F Hover the type in your IDE — should show the union of all registered codes.\ntype AllErrorCodes = ErrorCode\ntype AllAuditActions = AuditAction\n\n\u002F\u002F Compile-time check:\nconst validCode: ErrorCode = 'billing.PAYMENT_DECLINED' \u002F\u002F OK\nconst invalidCode: ErrorCode = 'billing.NOPE' \u002F\u002F ← TS error if catalog is registered\n","Anywhere in the codebase",[515,3422,3423,3449,3453,3458,3471,3483,3487,3492,3514],{"__ignoreMap":843},[847,3424,3425,3427,3429,3431,3434,3436,3439,3441,3443,3445,3447],{"class":849,"line":850},[847,3426,854],{"class":853},[847,3428,1271],{"class":853},[847,3430,858],{"class":857},[847,3432,3433],{"class":861}," ErrorCode",[847,3435,918],{"class":857},[847,3437,3438],{"class":861}," AuditAction",[847,3440,865],{"class":857},[847,3442,868],{"class":853},[847,3444,871],{"class":857},[847,3446,875],{"class":874},[847,3448,878],{"class":857},[847,3450,3451],{"class":849,"line":881},[847,3452,885],{"emptyLinePlaceholder":884},[847,3454,3455],{"class":849,"line":888},[847,3456,3457],{"class":2217},"\u002F\u002F Hover the type in your IDE — should show the union of all registered codes.\n",[847,3459,3460,3462,3465,3468],{"class":849,"line":924},[847,3461,1792],{"class":894},[847,3463,3464],{"class":1042}," AllErrorCodes",[847,3466,3467],{"class":857}," =",[847,3469,3470],{"class":1042}," ErrorCode\n",[847,3472,3473,3475,3478,3480],{"class":849,"line":962},[847,3474,1792],{"class":894},[847,3476,3477],{"class":1042}," AllAuditActions",[847,3479,3467],{"class":857},[847,3481,3482],{"class":1042}," AuditAction\n",[847,3484,3485],{"class":849,"line":994},[847,3486,885],{"emptyLinePlaceholder":884},[847,3488,3489],{"class":849,"line":1004},[847,3490,3491],{"class":2217},"\u002F\u002F Compile-time check:\n",[847,3493,3494,3496,3499,3501,3503,3505,3507,3509,3511],{"class":849,"line":1018},[847,3495,2523],{"class":894},[847,3497,3498],{"class":861}," validCode",[847,3500,931],{"class":857},[847,3502,3433],{"class":1042},[847,3504,3467],{"class":857},[847,3506,871],{"class":857},[847,3508,574],{"class":874},[847,3510,910],{"class":857},[847,3512,3513],{"class":2217}," \u002F\u002F OK\n",[847,3515,3516,3518,3521,3523,3525,3527,3529,3532,3534],{"class":849,"line":1069},[847,3517,2523],{"class":894},[847,3519,3520],{"class":861}," invalidCode",[847,3522,931],{"class":857},[847,3524,3433],{"class":1042},[847,3526,3467],{"class":857},[847,3528,871],{"class":857},[847,3530,3531],{"class":874},"billing.NOPE",[847,3533,910],{"class":857},[847,3535,3536],{"class":2217}," \u002F\u002F ← TS error if catalog is registered\n",[511,3538,3539,3540,3543],{},"If autocomplete is empty, either no catalog is registered yet, or the augmentation file is not in the TypeScript program (check ",[515,3541,3542],{},"tsconfig.json"," includes).",[694,3545,3547],{"id":3546},"common-pitfalls","Common pitfalls",[3549,3550,3551,3557,3558,3560,3561,1707],"warning",{},[728,3552,3553,3554,3556],{},"Don't put ",[515,3555,669],{}," blocks in test files."," Augmentations from test files leak into the type-checker for the rest of the codebase if the test files are included in the main ",[515,3559,3542],{},". Keep augmentations next to the catalog source, never inside ",[515,3562,3563],{},"*.test.ts",[3549,3565,3566,3569,3570,3573,3574,3576],{},[728,3567,3568],{},"Avoid prefix collisions across packages."," If two packages augment the same ",[515,3571,3572],{},"RegisteredErrorCatalogs"," key (say both ship a ",[515,3575,2032],{}," catalog), TypeScript merges them silently and the runtime keeps the last-registered factory. Convention: one prefix per package, no overlap.",[3549,3578,3579,3585,3586,3589,3590,3592],{},[728,3580,3581,3582,3584],{},"Never override the ",[515,3583,515],{}," at the call site."," The catalog defines the code identity — overriding it would break dashboards, alerts, and consumer code branching on ",[515,3587,3588],{},"err.code",". The factory's call-site signature deliberately omits ",[515,3591,515],{}," from the overridable fields.",[681,3594,3595,3604],{},[511,3596,3597,3603],{},[728,3598,3599,3600,3602],{},"Prefer ",[515,3601,656],{}," over string comparisons in tests."," Both forms below are valid; the first survives renames (refactor-safe), the second doesn't.",[837,3605,3607],{"className":839,"code":3606,"language":842,"meta":843,"style":843},"expect(err.code).toBe(billingErrors.PAYMENT_DECLINED.code) \u002F\u002F ✓ refactor-safe\nexpect(err.code).toBe('billing.PAYMENT_DECLINED')          \u002F\u002F ✗ string literal\n",[515,3608,3609,3642],{"__ignoreMap":843},[847,3610,3611,3614,3617,3619,3622,3624,3627,3630,3632,3634,3636,3639],{"class":849,"line":850},[847,3612,3613],{"class":904},"expect",[847,3615,3616],{"class":861},"(err",[847,3618,1707],{"class":857},[847,3620,3621],{"class":861},"code)",[847,3623,1707],{"class":857},[847,3625,3626],{"class":904},"toBe",[847,3628,3629],{"class":861},"(billingErrors",[847,3631,1707],{"class":857},[847,3633,741],{"class":861},[847,3635,1707],{"class":857},[847,3637,3638],{"class":861},"code) ",[847,3640,3641],{"class":2217},"\u002F\u002F ✓ refactor-safe\n",[847,3643,3644,3646,3648,3650,3652,3654,3656,3658,3660,3662,3664,3667],{"class":849,"line":881},[847,3645,3613],{"class":904},[847,3647,3616],{"class":861},[847,3649,1707],{"class":857},[847,3651,3621],{"class":861},[847,3653,1707],{"class":857},[847,3655,3626],{"class":904},[847,3657,907],{"class":861},[847,3659,910],{"class":857},[847,3661,574],{"class":874},[847,3663,910],{"class":857},[847,3665,3666],{"class":861},")          ",[847,3668,3669],{"class":2217},"\u002F\u002F ✗ string literal\n",[694,3671,3673],{"id":3672},"api-reference","API reference",[702,3675,3676,3689],{},[705,3677,3678],{},[708,3679,3680,3683,3686],{},[711,3681,3682],{},"Symbol",[711,3684,3685],{},"Kind",[711,3687,3688],{},"Purpose",[720,3690,3691,3703,3714,3725,3754,3770,3784,3796,3808,3819],{},[708,3692,3693,3697,3700],{},[725,3694,3695],{},[515,3696,559],{},[725,3698,3699],{},"factory",[725,3701,3702],{},"Standalone single-error factory. No prefix derivation.",[708,3704,3705,3709,3711],{},[725,3706,3707],{},[515,3708,549],{},[725,3710,3699],{},[725,3712,3713],{},"Bundle of typed errors sharing a prefix.",[708,3715,3716,3720,3722],{},[725,3717,3718],{},[515,3719,563],{},[725,3721,3699],{},[725,3723,3724],{},"Standalone single-action audit factory.",[708,3726,3727,3731,3733],{},[725,3728,3729],{},[515,3730,553],{},[725,3732,3699],{},[725,3734,3735,3736,518,3739,518,3742,518,3745,518,3748,518,3751,1707],{},"Bundle of typed audit actions sharing a prefix. Each entry accepts ",[515,3737,3738],{},"target",[515,3740,3741],{},"description",[515,3743,3744],{},"severity",[515,3746,3747],{},"requiresChanges",[515,3749,3750],{},"requiresReason",[515,3752,3753],{},"redactPaths",[708,3755,3756,3761,3763],{},[725,3757,3758],{},[515,3759,3760],{},"AuditCatalogEntry",[725,3762,1792],{},[725,3764,3765,3766,3769],{},"Metadata shape for a single catalog entry (alias of ",[515,3767,3768],{},"AuditActionDefinition",").",[708,3771,3772,3777,3779],{},[725,3773,3774],{},[515,3775,3776],{},"AuditSeverity",[725,3778,1792],{},[725,3780,3781,1707],{},[515,3782,3783],{},"'low' | 'medium' | 'high' | 'critical'",[708,3785,3786,3790,3793],{},[725,3787,3788],{},[515,3789,3572],{},[725,3791,3792],{},"interface",[725,3794,3795],{},"Augmentable registry of error catalogs.",[708,3797,3798,3803,3805],{},[725,3799,3800],{},[515,3801,3802],{},"RegisteredAuditCatalogs",[725,3804,3792],{},[725,3806,3807],{},"Augmentable registry of audit catalogs.",[708,3809,3810,3814,3816],{},[725,3811,3812],{},[515,3813,3193],{},[725,3815,1792],{},[725,3817,3818],{},"Union of all registered error codes.",[708,3820,3821,3825,3827],{},[725,3822,3823],{},[515,3824,3197],{},[725,3826,1792],{},[725,3828,3829],{},"Union of all registered audit actions.",[511,3831,3832,3833,3835],{},"Everything ships from the main ",[515,3834,875],{}," entrypoint.",[694,3837,3839],{"id":3838},"next-steps","Next Steps",[541,3841,3842,3855,3868],{},[544,3843,3844,3846,3847,3850,3851,3854],{},[675,3845,51],{"href":52},": The full ",[515,3848,3849],{},"createError"," API and ",[515,3852,3853],{},"parseError"," reference.",[544,3856,3857,3860,3861,518,3864,3867],{},[675,3858,3859],{"href":373},"Audit → Recording",": All audit-emission APIs (",[515,3862,3863],{},"log.audit",[515,3865,3866],{},"withAudit",", etc.).",[544,3869,3870,3872],{},[675,3871,201],{"href":206},": Auto-managed per-request loggers and HTTP error serialization.",[3874,3875,3876],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":843,"searchDepth":881,"depth":881,"links":3878},[3879,3880,3886,3891,3896,3901,3902,3903],{"id":696,"depth":881,"text":697},{"id":812,"depth":881,"text":813,"children":3881},[3882,3883,3884,3885],{"id":820,"depth":888,"text":821},{"id":1235,"depth":888,"text":1236},{"id":1484,"depth":888,"text":1485},{"id":1696,"depth":888,"text":1697},{"id":1716,"depth":881,"text":1717,"children":3887},[3888,3889,3890],{"id":1726,"depth":888,"text":1729},{"id":1983,"depth":888,"text":1984},{"id":2290,"depth":888,"text":2291},{"id":2593,"depth":881,"text":2594,"children":3892},[3893,3894,3895],{"id":2597,"depth":888,"text":2598},{"id":2839,"depth":888,"text":2840},{"id":3013,"depth":888,"text":3014},{"id":3178,"depth":881,"text":3179,"children":3897},[3898,3899,3900],{"id":3201,"depth":888,"text":3202},{"id":3270,"depth":888,"text":3271},{"id":3415,"depth":888,"text":3416},{"id":3546,"depth":881,"text":3547},{"id":3672,"depth":881,"text":3673},{"id":3838,"depth":881,"text":3839},"Scale typed error and audit catalogs from a single file to multi-package monorepos. Conventions, npm packaging recipe, composition patterns, and the type-augmentation deep dive.","md",[3907,3909],{"label":51,"icon":54,"to":52,"color":2573,"variant":3908},"subtle",{"label":358,"icon":359,"to":364,"color":2573,"variant":3908},{},{"icon":79},{"title":76,"description":3904},"wfaoWToc1ysqdEChFo0Q0Ng4sA3VJqnL47GFVg5kayY",[3915,3917],{"title":71,"path":72,"stem":73,"description":3916,"icon":74,"children":-1},"Add compile-time type safety to your wide events with TypeScript module augmentation. Prevent typos and ensure consistent field names across your codebase.",{"title":36,"path":86,"stem":87,"description":3918,"icon":44,"children":-1},"The evlog command line — map your app's observability coverage, diagnose your setup, and control telemetry. Install, global flags, output streams, exit codes, and monorepo behaviour.",1785224895049]