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