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