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