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