[{"data":1,"prerenderedAt":4741},["ShallowReactive",2],{"navigation_docs":3,"-docs-essentials-context-and-lifecycle":493,"-docs-essentials-context-and-lifecycle-surround":4736},[4,46,135,218,257,292,355,377,420],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":45},"Getting Started","i-lucide-rocket","\u002Fdocs\u002Fgetting-started","docs\u002F01.getting-started",[10,15,20,25,30,35,40],{"title":11,"path":12,"stem":13,"icon":14},"What is Heximon?","\u002Fdocs\u002Fgetting-started\u002Fintroduction","docs\u002F01.getting-started\u002F01.introduction","i-lucide-info",{"title":16,"path":17,"stem":18,"icon":19},"Installation","\u002Fdocs\u002Fgetting-started\u002Finstallation","docs\u002F01.getting-started\u002F02.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Quick Start","\u002Fdocs\u002Fgetting-started\u002Fquick-start","docs\u002F01.getting-started\u002F03.quick-start","i-lucide-zap",{"title":26,"path":27,"stem":28,"icon":29},"Core Concepts","\u002Fdocs\u002Fgetting-started\u002Fcore-concepts","docs\u002F01.getting-started\u002F04.core-concepts","i-lucide-shapes",{"title":31,"path":32,"stem":33,"icon":34},"Examples","\u002Fdocs\u002Fgetting-started\u002Fexamples","docs\u002F01.getting-started\u002F05.examples","i-lucide-library",{"title":36,"path":37,"stem":38,"icon":39},"Where Next?","\u002Fdocs\u002Fgetting-started\u002Fwhere-next","docs\u002F01.getting-started\u002F06.where-next","i-lucide-signpost",{"title":41,"path":42,"stem":43,"icon":44},"Troubleshooting","\u002Fdocs\u002Fgetting-started\u002Ftroubleshooting","docs\u002F01.getting-started\u002F07.troubleshooting","i-lucide-life-buoy",false,{"title":47,"icon":48,"path":49,"stem":50,"children":51,"page":45},"Essentials","i-lucide-boxes","\u002Fdocs\u002Fessentials","docs\u002F02.essentials",[52,56,61,66,71,76,81,86,91,96,101,105,110,115,120,125,130],{"title":53,"path":54,"stem":55,"icon":48},"Modules & DI","\u002Fdocs\u002Fessentials\u002Fmodules-and-di","docs\u002F02.essentials\u002F01.modules-and-di",{"title":57,"path":58,"stem":59,"icon":60},"Controllers","\u002Fdocs\u002Fessentials\u002Fcontrollers","docs\u002F02.essentials\u002F02.controllers","i-lucide-route",{"title":62,"path":63,"stem":64,"icon":65},"Validation & DTOs","\u002Fdocs\u002Fessentials\u002Fvalidation","docs\u002F02.essentials\u002F03.validation","i-lucide-shield-check",{"title":67,"path":68,"stem":69,"icon":70},"Contracts","\u002Fdocs\u002Fessentials\u002Fcontracts","docs\u002F02.essentials\u002F04.contracts","i-lucide-file-signature",{"title":72,"path":73,"stem":74,"icon":75},"REST Client","\u002Fdocs\u002Fessentials\u002Fclient","docs\u002F02.essentials\u002F05.client","i-lucide-plug",{"title":77,"path":78,"stem":79,"icon":80},"Database","\u002Fdocs\u002Fessentials\u002Fdatabase","docs\u002F02.essentials\u002F06.database","i-lucide-database",{"title":82,"path":83,"stem":84,"icon":85},"Drizzle ORM","\u002Fdocs\u002Fessentials\u002Fdrizzle","docs\u002F02.essentials\u002F07.drizzle","i-lucide-database-zap",{"title":87,"path":88,"stem":89,"icon":90},"Persistence & Transactions","\u002Fdocs\u002Fessentials\u002Fpersistence","docs\u002F02.essentials\u002F08.persistence","i-lucide-database-backup",{"title":92,"path":93,"stem":94,"icon":95},"Migrations","\u002Fdocs\u002Fessentials\u002Fmigrations","docs\u002F02.essentials\u002F09.migrations","i-lucide-git-branch",{"title":97,"path":98,"stem":99,"icon":100},"Authentication","\u002Fdocs\u002Fessentials\u002Fauthentication","docs\u002F02.essentials\u002F10.authentication","i-lucide-key-round",{"title":102,"path":103,"stem":104,"icon":65},"Permissions & scopes","\u002Fdocs\u002Fessentials\u002Fpermissions","docs\u002F02.essentials\u002F11.permissions",{"title":106,"path":107,"stem":108,"icon":109},"Error Handling","\u002Fdocs\u002Fessentials\u002Ferrors","docs\u002F02.essentials\u002F12.errors","i-lucide-triangle-alert",{"title":111,"path":112,"stem":113,"icon":114},"Testing a Heximon App","\u002Fdocs\u002Fessentials\u002Ftesting","docs\u002F02.essentials\u002F13.testing","i-lucide-flask-conical",{"title":116,"path":117,"stem":118,"icon":119},"Test app harness","\u002Fdocs\u002Fessentials\u002Fcreatetestapp","docs\u002F02.essentials\u002F14.createtestapp","i-lucide-test-tube",{"title":121,"path":122,"stem":123,"icon":124},"Logging & Observability","\u002Fdocs\u002Fessentials\u002Flogging","docs\u002F02.essentials\u002F17.logging","i-lucide-scroll-text",{"title":126,"path":127,"stem":128,"icon":129},"Context & Lifecycle","\u002Fdocs\u002Fessentials\u002Fcontext-and-lifecycle","docs\u002F02.essentials\u002F18.context-and-lifecycle","i-lucide-radio",{"title":131,"path":132,"stem":133,"icon":134},"Project Structure","\u002Fdocs\u002Fessentials\u002Fproject-structure","docs\u002F02.essentials\u002F19.project-structure","i-lucide-folder-tree",{"title":136,"icon":137,"path":138,"stem":139,"children":140,"page":45},"Capabilities","i-lucide-sparkles","\u002Fdocs\u002Fcapabilities","docs\u002F03.capabilities",[141,145,150,155,160,164,169,174,179,184,188,193,198,203,208,213],{"title":142,"path":143,"stem":144,"icon":137},"Overview","\u002Fdocs\u002Fcapabilities\u002Foverview","docs\u002F03.capabilities\u002F01.overview",{"title":146,"path":147,"stem":148,"icon":149},"Events","\u002Fdocs\u002Fcapabilities\u002Fevents","docs\u002F03.capabilities\u002F02.events","i-lucide-radio-tower",{"title":151,"path":152,"stem":153,"icon":154},"Queue","\u002Fdocs\u002Fcapabilities\u002Fbackground-jobs","docs\u002F03.capabilities\u002F03.background-jobs","i-lucide-list-ordered",{"title":156,"path":157,"stem":158,"icon":159},"Scheduled Work","\u002Fdocs\u002Fcapabilities\u002Fscheduled-jobs","docs\u002F03.capabilities\u002F04.scheduled-jobs","i-lucide-clock",{"title":161,"path":162,"stem":163,"icon":85},"Caching","\u002Fdocs\u002Fcapabilities\u002Fcaching","docs\u002F03.capabilities\u002F05.caching",{"title":165,"path":166,"stem":167,"icon":168},"Key\u002FValue Storage","\u002Fdocs\u002Fcapabilities\u002Fkey-value","docs\u002F03.capabilities\u002F06.key-value","i-lucide-hard-drive",{"title":170,"path":171,"stem":172,"icon":173},"Blob Storage","\u002Fdocs\u002Fcapabilities\u002Fblob","docs\u002F03.capabilities\u002F07.blob","i-lucide-folder-open",{"title":175,"path":176,"stem":177,"icon":178},"Health & Readiness","\u002Fdocs\u002Fcapabilities\u002Fhealth","docs\u002F03.capabilities\u002F08.health","i-lucide-heart-pulse",{"title":180,"path":181,"stem":182,"icon":183},"Notifications","\u002Fdocs\u002Fcapabilities\u002Fnotifications","docs\u002F03.capabilities\u002F09.notifications","i-lucide-mail",{"title":185,"path":186,"stem":187,"icon":65},"Idempotency","\u002Fdocs\u002Fcapabilities\u002Fidempotency","docs\u002F03.capabilities\u002F10.idempotency",{"title":189,"path":190,"stem":191,"icon":192},"Security Hardening","\u002Fdocs\u002Fcapabilities\u002Fsecurity","docs\u002F03.capabilities\u002F11.security","i-lucide-shield",{"title":194,"path":195,"stem":196,"icon":197},"Observability & Tracing","\u002Fdocs\u002Fcapabilities\u002Fobservability","docs\u002F03.capabilities\u002F12.observability","i-lucide-activity",{"title":199,"path":200,"stem":201,"icon":202},"OpenAPI","\u002Fdocs\u002Fcapabilities\u002Fopenapi","docs\u002F03.capabilities\u002F13.openapi","i-lucide-book-marked",{"title":204,"path":205,"stem":206,"icon":207},"MCP Server","\u002Fdocs\u002Fcapabilities\u002Fmcp","docs\u002F03.capabilities\u002F14.mcp","i-lucide-bot",{"title":209,"path":210,"stem":211,"icon":212},"Schema DTOs","\u002Fdocs\u002Fcapabilities\u002Fschema","docs\u002F03.capabilities\u002F15.schema","i-lucide-file-json",{"title":214,"path":215,"stem":216,"icon":217},"Branded IDs","\u002Fdocs\u002Fcapabilities\u002Fbranded-ids","docs\u002F03.capabilities\u002F16.branded-ids","i-lucide-tag",{"title":219,"icon":220,"path":221,"stem":222,"children":223,"page":45},"Architecture","i-lucide-building","\u002Fdocs\u002Farchitecture","docs\u002F04.architecture",[224,227,232,237,242,247,252],{"title":142,"path":225,"stem":226,"icon":220},"\u002Fdocs\u002Farchitecture\u002Foverview","docs\u002F04.architecture\u002F01.overview",{"title":228,"path":229,"stem":230,"icon":231},"Domain-Driven Design","\u002Fdocs\u002Farchitecture\u002Fddd","docs\u002F04.architecture\u002F02.ddd","i-lucide-hexagon",{"title":233,"path":234,"stem":235,"icon":236},"CQRS","\u002Fdocs\u002Farchitecture\u002Fcqrs","docs\u002F04.architecture\u002F03.cqrs","i-lucide-split",{"title":238,"path":239,"stem":240,"icon":241},"Repository Pattern","\u002Fdocs\u002Farchitecture\u002Frepository-pattern","docs\u002F04.architecture\u002F04.repository-pattern","i-lucide-archive",{"title":243,"path":244,"stem":245,"icon":246},"Integration Events","\u002Fdocs\u002Farchitecture\u002Fintegration-events","docs\u002F04.architecture\u002F05.integration-events","i-lucide-send-horizontal",{"title":248,"path":249,"stem":250,"icon":251},"Saga Orchestration","\u002Fdocs\u002Farchitecture\u002Fsagas","docs\u002F04.architecture\u002F06.sagas","i-lucide-hourglass",{"title":253,"path":254,"stem":255,"icon":256},"Durable Workflows","\u002Fdocs\u002Farchitecture\u002Fworkflows","docs\u002F04.architecture\u002F07.workflows","i-lucide-workflow",{"title":258,"icon":259,"path":260,"stem":261,"children":262,"page":45},"Realtime","i-lucide-cable","\u002Fdocs\u002Frealtime","docs\u002F05.realtime",[263,266,270,274,279,284,288],{"title":142,"path":264,"stem":265,"icon":259},"\u002Fdocs\u002Frealtime\u002Foverview","docs\u002F05.realtime\u002F01.overview",{"title":267,"path":268,"stem":269,"icon":129},"WebSockets","\u002Fdocs\u002Frealtime\u002Fwebsockets","docs\u002F05.realtime\u002F02.websockets",{"title":271,"path":272,"stem":273,"icon":70},"WebSocket Contracts","\u002Fdocs\u002Frealtime\u002Fwebsocket-contracts","docs\u002F05.realtime\u002F03.websocket-contracts",{"title":275,"path":276,"stem":277,"icon":278},"Server-Sent Events","\u002Fdocs\u002Frealtime\u002Fserver-sent-events","docs\u002F05.realtime\u002F04.server-sent-events","i-lucide-rss",{"title":280,"path":281,"stem":282,"icon":283},"Typed Clients","\u002Fdocs\u002Frealtime\u002Ftyped-clients","docs\u002F05.realtime\u002F05.typed-clients","i-lucide-plug-zap",{"title":285,"path":286,"stem":287,"icon":259},"AsyncAPI","\u002Fdocs\u002Frealtime\u002Fasyncapi","docs\u002F05.realtime\u002F06.asyncapi",{"title":289,"path":290,"stem":291,"icon":80},"Durable Objects","\u002Fdocs\u002Frealtime\u002Fdurable-objects","docs\u002F05.realtime\u002F07.durable-objects",{"title":293,"icon":294,"path":295,"stem":296,"children":297,"page":45},"Deploy","i-lucide-cloud-upload","\u002Fdocs\u002Fdeploy","docs\u002F06.deploy",[298,301,306,311,316,321,326,331,336,341,345,350],{"title":142,"path":299,"stem":300,"icon":6},"\u002Fdocs\u002Fdeploy\u002Foverview","docs\u002F06.deploy\u002F01.overview",{"title":302,"path":303,"stem":304,"icon":305},"Node","\u002Fdocs\u002Fdeploy\u002Fnode","docs\u002F06.deploy\u002F02.node","la:node-js",{"title":307,"path":308,"stem":309,"icon":310},"Cloudflare","\u002Fdocs\u002Fdeploy\u002Fcloudflare","docs\u002F06.deploy\u002F03.cloudflare","simple-icons:cloudflare",{"title":312,"path":313,"stem":314,"icon":315},"Vercel","\u002Fdocs\u002Fdeploy\u002Fvercel","docs\u002F06.deploy\u002F04.vercel","ri:vercel-fill",{"title":317,"path":318,"stem":319,"icon":320},"Netlify","\u002Fdocs\u002Fdeploy\u002Fnetlify","docs\u002F06.deploy\u002F05.netlify","i-simple-icons-netlify",{"title":322,"path":323,"stem":324,"icon":325},"AWS Lambda","\u002Fdocs\u002Fdeploy\u002Faws-lambda","docs\u002F06.deploy\u002F06.aws-lambda","hugeicons:aws-lambda",{"title":327,"path":328,"stem":329,"icon":330},"Deno Deploy","\u002Fdocs\u002Fdeploy\u002Fdeno-deploy","docs\u002F06.deploy\u002F07.deno-deploy","simple-icons:denodeploy",{"title":332,"path":333,"stem":334,"icon":335},"Nitro","\u002Fdocs\u002Fdeploy\u002Fnitro","docs\u002F06.deploy\u002F08.nitro","i-unjs-nitro",{"title":337,"path":338,"stem":339,"icon":340},"Nuxt","\u002Fdocs\u002Fdeploy\u002Fnuxt","docs\u002F06.deploy\u002F09.nuxt","i-devicon-nuxt",{"title":342,"path":343,"stem":344,"icon":236},"Mixed-runtime split","\u002Fdocs\u002Fdeploy\u002Fmixed-runtime-split","docs\u002F06.deploy\u002F10.mixed-runtime-split",{"title":346,"path":347,"stem":348,"icon":349},"Hosts","\u002Fdocs\u002Fdeploy\u002Fhosts","docs\u002F06.deploy\u002F11.hosts","i-lucide-map",{"title":351,"path":352,"stem":353,"icon":354},"Cross-service events","\u002Fdocs\u002Fdeploy\u002Fcross-service-events","docs\u002F06.deploy\u002F12.cross-service-events","i-lucide-network",{"title":356,"icon":357,"path":358,"stem":359,"children":360,"page":45},"CLI","i-lucide-terminal","\u002Fdocs\u002Fcli","docs\u002F07.cli",[361,365,369,373],{"title":362,"path":363,"stem":364,"icon":357},"The heximon CLI","\u002Fdocs\u002Fcli\u002Foverview","docs\u002F07.cli\u002F01.overview",{"title":366,"path":367,"stem":368,"icon":137},"Create a New App","\u002Fdocs\u002Fcli\u002Fcreate","docs\u002F07.cli\u002F02.create",{"title":370,"path":371,"stem":372,"icon":95},"Migrations from the CLI","\u002Fdocs\u002Fcli\u002Fmigrations","docs\u002F07.cli\u002F03.migrations",{"title":374,"path":375,"stem":376,"icon":6},"Deploying a Heximon app","\u002Fdocs\u002Fcli\u002Fdeploy","docs\u002F07.cli\u002F04.deploy",{"title":378,"icon":379,"path":380,"stem":381,"children":382,"page":45},"Under the Hood","i-lucide-wrench","\u002Fdocs\u002Funder-the-hood","docs\u002F08.under-the-hood",[383,388,393,397,402,407,411,415],{"title":384,"path":385,"stem":386,"icon":387},"How the Compiler Works","\u002Fdocs\u002Funder-the-hood\u002Fhow-the-compiler-works","docs\u002F08.under-the-hood\u002F01.how-the-compiler-works","i-lucide-cog",{"title":389,"path":390,"stem":391,"icon":392},"Compiler","\u002Fdocs\u002Funder-the-hood\u002Fextending-the-compiler","docs\u002F08.under-the-hood\u002F02.extending-the-compiler","i-lucide-cpu",{"title":394,"path":395,"stem":396,"icon":357},"Compiler Diagnostics","\u002Fdocs\u002Funder-the-hood\u002Fcompiler-diagnostics","docs\u002F08.under-the-hood\u002F03.compiler-diagnostics",{"title":398,"path":399,"stem":400,"icon":401},"Library Mode","\u002Fdocs\u002Funder-the-hood\u002Flibrary-mode","docs\u002F08.under-the-hood\u002F04.library-mode","i-lucide-package",{"title":403,"path":404,"stem":405,"icon":406},"Other bundlers","\u002Fdocs\u002Funder-the-hood\u002Falternate-bundlers","docs\u002F08.under-the-hood\u002F05.alternate-bundlers","i-lucide-blocks",{"title":408,"path":409,"stem":410,"icon":401},"Packages","\u002Fdocs\u002Funder-the-hood\u002Fpackages","docs\u002F08.under-the-hood\u002F06.packages",{"title":412,"path":413,"stem":414,"icon":207},"AI Skills","\u002Fdocs\u002Funder-the-hood\u002Fai-and-agents","docs\u002F08.under-the-hood\u002F07.ai-and-agents",{"title":416,"path":417,"stem":418,"icon":419},"Advanced DI","\u002Fdocs\u002Funder-the-hood\u002Fadvanced-di","docs\u002F08.under-the-hood\u002F08.advanced-di","i-lucide-git-fork",{"title":421,"icon":422,"path":423,"stem":424,"children":425,"page":45},"Recipes","i-lucide-book-open-check","\u002Fdocs\u002Frecipes","docs\u002F09.recipes",[426,431,436,440,444,448,452,456,460,465,469,474,479,484,488],{"title":427,"path":428,"stem":429,"icon":430},"Send an Email","\u002Fdocs\u002Frecipes\u002Fsend-an-email","docs\u002F09.recipes\u002F01.send-an-email","i-lucide-send",{"title":432,"path":433,"stem":434,"icon":435},"Upload a File","\u002Fdocs\u002Frecipes\u002Fupload-a-file","docs\u002F09.recipes\u002F02.upload-a-file","i-lucide-upload",{"title":437,"path":438,"stem":439,"icon":24},"Cache an Expensive Call","\u002Fdocs\u002Frecipes\u002Fcache-an-expensive-call","docs\u002F09.recipes\u002F03.cache-an-expensive-call",{"title":441,"path":442,"stem":443,"icon":154},"Paginate a List","\u002Fdocs\u002Frecipes\u002Fpaginate-a-list","docs\u002F09.recipes\u002F04.paginate-a-list",{"title":445,"path":446,"stem":447,"icon":65},"Protect Admin Routes","\u002Fdocs\u002Frecipes\u002Fprotect-admin-routes","docs\u002F09.recipes\u002F05.protect-admin-routes",{"title":449,"path":450,"stem":451,"icon":178},"Health Probes and a Nightly Job","\u002Fdocs\u002Frecipes\u002Fhealth-probes-and-a-nightly-job","docs\u002F09.recipes\u002F06.health-probes-and-a-nightly-job",{"title":453,"path":454,"stem":455,"icon":80},"Build a CRUD API","\u002Fdocs\u002Frecipes\u002Fcrud-api","docs\u002F09.recipes\u002F07.crud-api",{"title":457,"path":458,"stem":459,"icon":100},"Add Authentication","\u002Fdocs\u002Frecipes\u002Fadd-authentication","docs\u002F09.recipes\u002F08.add-authentication",{"title":461,"path":462,"stem":463,"icon":464},"Background Jobs","\u002Fdocs\u002Frecipes\u002Fbackground-jobs","docs\u002F09.recipes\u002F09.background-jobs","i-lucide-timer",{"title":466,"path":467,"stem":468,"icon":149},"Decouple Features with Events","\u002Fdocs\u002Frecipes\u002Fevent-driven-module","docs\u002F09.recipes\u002F10.event-driven-module",{"title":470,"path":471,"stem":472,"icon":473},"Build a DDD Aggregate","\u002Fdocs\u002Frecipes\u002Fddd-aggregate","docs\u002F09.recipes\u002F11.ddd-aggregate","i-lucide-box",{"title":475,"path":476,"stem":477,"icon":478},"Publish a Feature Package","\u002Fdocs\u002Frecipes\u002Ffeature-package","docs\u002F09.recipes\u002F12.feature-package","i-lucide-package-open",{"title":480,"path":481,"stem":482,"icon":483},"Reliable Integration Events","\u002Fdocs\u002Frecipes\u002Freliable-integration-events","docs\u002F09.recipes\u002F13.reliable-integration-events","i-lucide-inbox",{"title":485,"path":486,"stem":487,"icon":95},"Reactive Choreography","\u002Fdocs\u002Frecipes\u002Freactive-choreography","docs\u002F09.recipes\u002F14.reactive-choreography",{"title":489,"path":490,"stem":491,"icon":492},"Build a Production CRUD API","\u002Fdocs\u002Frecipes\u002Fproduction-crud-api","docs\u002F09.recipes\u002F15.production-crud-api","i-lucide-layers",{"id":494,"title":126,"body":495,"description":4729,"extension":4730,"links":4731,"meta":4732,"navigation":4733,"path":127,"seo":4734,"stem":128,"__hash__":4735},"docs\u002Fdocs\u002F02.essentials\u002F18.context-and-lifecycle.md",{"type":496,"value":497,"toc":4703},"minimark",[498,510,681,695,700,708,716,720,737,816,828,880,891,895,903,932,943,946,1066,1104,1108,1122,1132,1141,1603,1613,1616,1636,1806,1810,1817,1852,1858,1865,1871,1918,1932,1936,1946,1985,1995,2004,2008,2019,2127,2134,2231,2241,2245,2259,2321,2330,2334,2347,2559,2569,2573,2595,2812,2830,2834,2846,2866,3068,3085,3103,3119,3144,3148,3161,3259,3268,3340,3344,3353,3384,3396,3400,3411,3644,3751,3760,3764,3777,3798,3822,3826,3845,3924,3946,3950,3954,3979,3992,4212,4233,4249,4253,4277,4289,4293,4313,4368,4381,4385,4404,4575,4592,4604,4630,4634,4699],[499,500,501,502,506,507,509],"p",{},"You need the request id, the tenant, or the authenticated caller in a function five calls deep. The\nnaive fix is to thread it through every signature in between — every method grows a parameter it doesn't\nuse, just to pass it along. ",[503,504,505],"code",{},"Context"," is request-scoped data without the threading: a transport seeds it\nonce per request, and any provider reads it by injecting ",[503,508,505],{},", no matter how deep.",[511,512,518],"pre",{"className":513,"code":514,"filename":515,"language":516,"meta":517,"style":517},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { Context } from \"@heximon\u002Fruntime\";\n\nexport class Reporter {\n  public constructor(private readonly context: Context) {}\n\n  public trace() {\n    return this.context.get(\"requestId\"); \u002F\u002F reads the frame this request opened\n  }\n}\n","reporter.ts","ts","",[503,519,520,556,563,580,613,618,632,669,675],{"__ignoreMap":517},[521,522,525,529,533,537,540,543,546,550,553],"span",{"class":523,"line":524},"line",1,[521,526,528],{"class":527},"s7zQu","import",[521,530,532],{"class":531},"sMK4o"," {",[521,534,536],{"class":535},"sTEyZ"," Context",[521,538,539],{"class":531}," }",[521,541,542],{"class":527}," from",[521,544,545],{"class":531}," \"",[521,547,549],{"class":548},"sfazB","@heximon\u002Fruntime",[521,551,552],{"class":531},"\"",[521,554,555],{"class":531},";\n",[521,557,559],{"class":523,"line":558},2,[521,560,562],{"emptyLinePlaceholder":561},true,"\n",[521,564,566,569,573,577],{"class":523,"line":565},3,[521,567,568],{"class":527},"export",[521,570,572],{"class":571},"spNyl"," class",[521,574,576],{"class":575},"sBMFI"," Reporter",[521,578,579],{"class":531}," {\n",[521,581,583,586,589,592,595,598,602,605,607,610],{"class":523,"line":582},4,[521,584,585],{"class":571},"  public",[521,587,588],{"class":571}," constructor",[521,590,591],{"class":531},"(",[521,593,594],{"class":571},"private",[521,596,597],{"class":571}," readonly",[521,599,601],{"class":600},"sHdIc"," context",[521,603,604],{"class":531},":",[521,606,536],{"class":575},[521,608,609],{"class":531},")",[521,611,612],{"class":531}," {}\n",[521,614,616],{"class":523,"line":615},5,[521,617,562],{"emptyLinePlaceholder":561},[521,619,621,623,627,630],{"class":523,"line":620},6,[521,622,585],{"class":571},[521,624,626],{"class":625},"swJcz"," trace",[521,628,629],{"class":531},"()",[521,631,579],{"class":531},[521,633,635,638,641,644,647,651,653,655,658,660,662,665],{"class":523,"line":634},7,[521,636,637],{"class":527},"    return",[521,639,640],{"class":531}," this.",[521,642,643],{"class":535},"context",[521,645,646],{"class":531},".",[521,648,650],{"class":649},"s2Zo4","get",[521,652,591],{"class":625},[521,654,552],{"class":531},[521,656,657],{"class":548},"requestId",[521,659,552],{"class":531},[521,661,609],{"class":625},[521,663,664],{"class":531},";",[521,666,668],{"class":667},"sHwdD"," \u002F\u002F reads the frame this request opened\n",[521,670,672],{"class":523,"line":671},8,[521,673,674],{"class":531},"  }\n",[521,676,678],{"class":523,"line":677},9,[521,679,680],{"class":531},"}\n",[499,682,683,685,686,689,690,694],{},[503,684,505],{}," is backed by Node's ",[503,687,688],{},"AsyncLocalStorage",", so the value you read is the one that belongs to ",[691,692,693],"em",{},"this","\nrequest — concurrent requests never see each other's data, with nothing passed by hand.",[696,697,699],"h2",{"id":698},"inject-the-context","Inject the Context",[499,701,702,704,705,707],{},[503,703,505],{}," is an ordinary provider — declare it in a constructor, nothing extra to register. There is no\n\"the context object\" to find and pass around; class identity is enough, and a deep collaborator that\nresolves its own ",[503,706,505],{}," still sees the frame the transport opened.",[499,709,710,711,646],{},"The HTTP transport opens and seeds a frame for you per request, so a handler or any provider it calls can\nread straight away. You only open a frame yourself in a test or a standalone script — see\n",[712,713,715],"a",{"href":714},"#open-a-context","Open a context",[696,717,719],{"id":718},"read-and-write-request-data","Read and write request data",[499,721,722,723,726,727,730,731,733,734,646],{},"The data bag is typed through the augmentable ",[503,724,725],{},"ContextData"," interface. Each transport and package declares\nthe keys it produces — HTTP adds ",[503,728,729],{},"request"," — and you add your own. Read with ",[503,732,650],{},", write with ",[503,735,736],{},"set",[511,738,740],{"className":513,"code":739,"language":516,"meta":517,"style":517},"this.context.get(\"requestId\");          \u002F\u002F ContextData[\"requestId\"] | undefined\nthis.context.set(\"tenantId\", tenantId); \u002F\u002F available to everything downstream in this request\nthis.context.isActive();                \u002F\u002F is this code running inside a request frame?\n",[503,741,742,768,798],{"__ignoreMap":517},[521,743,744,747,749,751,753,755,757,759,761,763,765],{"class":523,"line":524},[521,745,746],{"class":531},"this.",[521,748,643],{"class":535},[521,750,646],{"class":531},[521,752,650],{"class":649},[521,754,591],{"class":535},[521,756,552],{"class":531},[521,758,657],{"class":548},[521,760,552],{"class":531},[521,762,609],{"class":535},[521,764,664],{"class":531},[521,766,767],{"class":667},"          \u002F\u002F ContextData[\"requestId\"] | undefined\n",[521,769,770,772,774,776,778,780,782,785,787,790,793,795],{"class":523,"line":558},[521,771,746],{"class":531},[521,773,643],{"class":535},[521,775,646],{"class":531},[521,777,736],{"class":649},[521,779,591],{"class":535},[521,781,552],{"class":531},[521,783,784],{"class":548},"tenantId",[521,786,552],{"class":531},[521,788,789],{"class":531},",",[521,791,792],{"class":535}," tenantId)",[521,794,664],{"class":531},[521,796,797],{"class":667}," \u002F\u002F available to everything downstream in this request\n",[521,799,800,802,804,806,809,811,813],{"class":523,"line":565},[521,801,746],{"class":531},[521,803,643],{"class":535},[521,805,646],{"class":531},[521,807,808],{"class":649},"isActive",[521,810,629],{"class":535},[521,812,664],{"class":531},[521,814,815],{"class":667},"                \u002F\u002F is this code running inside a request frame?\n",[499,817,818,819,821,822,824,825,827],{},"To carry your own typed value, augment ",[503,820,725],{}," once; every ",[503,823,650],{},"\u002F",[503,826,736],{}," for that key is then typed\nacross the whole app:",[511,829,832],{"className":513,"code":830,"filename":831,"language":516,"meta":517,"style":517},"declare module \"@heximon\u002Fruntime\" {\n  interface ContextData {\n    tenantId: string;\n  }\n}\n","context.d.ts",[503,833,834,850,860,872,876],{"__ignoreMap":517},[521,835,836,839,842,844,846,848],{"class":523,"line":524},[521,837,838],{"class":571},"declare",[521,840,841],{"class":571}," module",[521,843,545],{"class":531},[521,845,549],{"class":548},[521,847,552],{"class":531},[521,849,579],{"class":531},[521,851,852,855,858],{"class":523,"line":558},[521,853,854],{"class":571},"  interface",[521,856,857],{"class":575}," ContextData",[521,859,579],{"class":531},[521,861,862,865,867,870],{"class":523,"line":565},[521,863,864],{"class":625},"    tenantId",[521,866,604],{"class":531},[521,868,869],{"class":575}," string",[521,871,555],{"class":531},[521,873,874],{"class":523,"line":582},[521,875,674],{"class":531},[521,877,878],{"class":523,"line":615},[521,879,680],{"class":531},[499,881,882,883,886,887,890],{},"The bag is typed rather than a free-form ",[503,884,885],{},"Map\u003Cstring, unknown>"," on purpose: a misspelled key or a wrong\nvalue type is a compile error, not a ",[503,888,889],{},"undefined"," you debug at runtime.",[696,892,894],{"id":893},"request-correlation-id","Request \u002F correlation id",[499,896,897,899,900,902],{},[503,898,657],{}," is a built-in ",[503,901,725],{}," key core owns so any transport — HTTP, queue drain, WebSocket — can\nseed and any provider can read it without an HTTP dependency. The HTTP transport derives it from the incoming\nrequest in precedence order:",[904,905,906,914,921],"ol",{},[907,908,909,910,913],"li",{},"the ",[503,911,912],{},"x-request-id"," header, when present and non-empty (caller-supplied passthrough);",[907,915,916,917,920],{},"the trace-id segment of a W3C ",[503,918,919],{},"traceparent"," header (32 lowercase-hex chars, not all-zero);",[907,922,923,924,927,928,931],{},"a freshly minted ",[503,925,926],{},"uuid.v7()"," (edge-safe — no ",[503,929,930],{},"node:crypto",").",[499,933,934,935,939,940,942],{},"The id is seeded into the context frame for the request ",[936,937,938],"strong",{},"and"," echoed on every response as ",[503,941,912],{},",\nso the caller can correlate a response back to its request without any extra work.",[499,944,945],{},"A provider reads it anywhere in the request with no threading:",[511,947,950],{"className":513,"code":948,"filename":949,"language":516,"meta":517,"style":517},"import { Context } from \"@heximon\u002Fruntime\";\n\nexport class Reporter {\n  public constructor(private readonly context: Context) {}\n\n  public trace(): string | undefined {\n    return this.context.get(\"requestId\"); \u002F\u002F present for every HTTP request\n  }\n}\n","src\u002Freporter.ts",[503,951,952,972,976,986,1008,1012,1031,1058,1062],{"__ignoreMap":517},[521,953,954,956,958,960,962,964,966,968,970],{"class":523,"line":524},[521,955,528],{"class":527},[521,957,532],{"class":531},[521,959,536],{"class":535},[521,961,539],{"class":531},[521,963,542],{"class":527},[521,965,545],{"class":531},[521,967,549],{"class":548},[521,969,552],{"class":531},[521,971,555],{"class":531},[521,973,974],{"class":523,"line":558},[521,975,562],{"emptyLinePlaceholder":561},[521,977,978,980,982,984],{"class":523,"line":565},[521,979,568],{"class":527},[521,981,572],{"class":571},[521,983,576],{"class":575},[521,985,579],{"class":531},[521,987,988,990,992,994,996,998,1000,1002,1004,1006],{"class":523,"line":582},[521,989,585],{"class":571},[521,991,588],{"class":571},[521,993,591],{"class":531},[521,995,594],{"class":571},[521,997,597],{"class":571},[521,999,601],{"class":600},[521,1001,604],{"class":531},[521,1003,536],{"class":575},[521,1005,609],{"class":531},[521,1007,612],{"class":531},[521,1009,1010],{"class":523,"line":615},[521,1011,562],{"emptyLinePlaceholder":561},[521,1013,1014,1016,1018,1021,1023,1026,1029],{"class":523,"line":620},[521,1015,585],{"class":571},[521,1017,626],{"class":625},[521,1019,1020],{"class":531},"():",[521,1022,869],{"class":575},[521,1024,1025],{"class":531}," |",[521,1027,1028],{"class":575}," undefined",[521,1030,579],{"class":531},[521,1032,1033,1035,1037,1039,1041,1043,1045,1047,1049,1051,1053,1055],{"class":523,"line":634},[521,1034,637],{"class":527},[521,1036,640],{"class":531},[521,1038,643],{"class":535},[521,1040,646],{"class":531},[521,1042,650],{"class":649},[521,1044,591],{"class":625},[521,1046,552],{"class":531},[521,1048,657],{"class":548},[521,1050,552],{"class":531},[521,1052,609],{"class":625},[521,1054,664],{"class":531},[521,1056,1057],{"class":667}," \u002F\u002F present for every HTTP request\n",[521,1059,1060],{"class":523,"line":671},[521,1061,674],{"class":531},[521,1063,1064],{"class":523,"line":677},[521,1065,680],{"class":531},[1067,1068,1070,1073,1074,1076,1077,1080,1081,1084,1085,1088,1089,1091,1092,1094,1095,1097,1098,1100,1101,646],"callout",{"type":1069},"warning",[936,1071,1072],{},"Writing to the context only works inside a request frame."," ",[503,1075,736],{},", ",[503,1078,1079],{},"waitUntil",", and ",[503,1082,1083],{},"onEnd"," mutate the\nactive frame, so calling one with no frame open throws ",[503,1086,1087],{},"Error: No active context"," — which catches\nbackground code that assumes a request it isn't part of. ",[503,1090,650],{}," and ",[503,1093,808],{}," are always safe: ",[503,1096,650],{},"\nreturns ",[503,1099,889],{}," when there is no frame, so a value reader never has to guard. To run outside a request\n(a CLI script, a test), open a frame first with ",[503,1102,1103],{},"run",[696,1105,1107],{"id":1106},"authenticate-once-read-everywhere","Authenticate once, read everywhere",[499,1109,1110,1111,1117,1118,1121],{},"This is the pattern in practice. The ",[712,1112,1116],{"href":1113,"rel":1114},"https:\u002F\u002Fgithub.com\u002Fheximon\u002Fheximon\u002Ftree\u002Fmain\u002Fexamples\u002Fladder\u002FL07-auth",[1115],"nofollow","ladder's L07 — Auth","\nverifies the bearer token in ",[503,1119,1120],{},"JWTAuthMiddleware"," (it reads the cookie, verifies it, and stores the principal\non the request), and a handler further down the chain reads that principal back — nothing threaded through\nany signature.",[499,1123,1124,1125,1128,1129,1131],{},"Heximon's ",[503,1126,1127],{},"AuthContext"," is a typed wrapper over ",[503,1130,505],{},", so the storage is exactly the\nrequest-scoped bag above.",[499,1133,1134,1135,1137,1138,1140],{},"The controller lists ",[503,1136,1120],{}," so it authenticates every request before a handler runs, then reads\nthe principal straight from its own injected ",[503,1139,1127],{}," — it was never passed in:",[511,1142,1145],{"className":513,"code":1143,"filename":1144,"language":516,"meta":517,"style":517},"import { AuthContext, JWTAuthMiddleware } from \"@heximon\u002Fauth\";\nimport { Controller, type Get } from \"@heximon\u002Fhttp\";\n\nexport class AdminController implements Controller\u003C{\n  prefix: \"\u002Fadmin\";\n  middlewares: [JWTAuthMiddleware];\n}> {\n  private static readonly requiredScope: string = \"admin:stats:read\";\n\n  public constructor(private readonly authContext: AuthContext) {}\n\n  public async stats(action: Get\u003C\"\u002Fstats\">): Promise\u003CResponse> {\n    if (this.authContext.principal() === null) {\n      return action.respond(401, { error: \"Authentication is required.\" }); \u002F\u002F no principal in the frame\n    }\n    if (!this.authContext.isAllowed(AdminController.requiredScope)) {\n      return action.respond(403, { error: `Requires the '${AdminController.requiredScope}' scope.` });\n    }\n    return action.respond(200, { totalRequests: 42, activeSessions: 7 });\n  }\n}\n","src\u002Fadmin\u002Fadmin.controller.ts",[503,1146,1147,1174,1204,1208,1225,1241,1258,1265,1294,1298,1322,1327,1373,1407,1452,1458,1490,1544,1549,1593,1598],{"__ignoreMap":517},[521,1148,1149,1151,1153,1156,1158,1161,1163,1165,1167,1170,1172],{"class":523,"line":524},[521,1150,528],{"class":527},[521,1152,532],{"class":531},[521,1154,1155],{"class":535}," AuthContext",[521,1157,789],{"class":531},[521,1159,1160],{"class":535}," JWTAuthMiddleware",[521,1162,539],{"class":531},[521,1164,542],{"class":527},[521,1166,545],{"class":531},[521,1168,1169],{"class":548},"@heximon\u002Fauth",[521,1171,552],{"class":531},[521,1173,555],{"class":531},[521,1175,1176,1178,1180,1183,1185,1188,1191,1193,1195,1197,1200,1202],{"class":523,"line":558},[521,1177,528],{"class":527},[521,1179,532],{"class":531},[521,1181,1182],{"class":535}," Controller",[521,1184,789],{"class":531},[521,1186,1187],{"class":527}," type",[521,1189,1190],{"class":535}," Get",[521,1192,539],{"class":531},[521,1194,542],{"class":527},[521,1196,545],{"class":531},[521,1198,1199],{"class":548},"@heximon\u002Fhttp",[521,1201,552],{"class":531},[521,1203,555],{"class":531},[521,1205,1206],{"class":523,"line":565},[521,1207,562],{"emptyLinePlaceholder":561},[521,1209,1210,1212,1214,1217,1220,1222],{"class":523,"line":582},[521,1211,568],{"class":527},[521,1213,572],{"class":571},[521,1215,1216],{"class":575}," AdminController",[521,1218,1219],{"class":571}," implements",[521,1221,1182],{"class":649},[521,1223,1224],{"class":531},"\u003C{\n",[521,1226,1227,1230,1232,1234,1237,1239],{"class":523,"line":615},[521,1228,1229],{"class":625},"  prefix",[521,1231,604],{"class":531},[521,1233,545],{"class":531},[521,1235,1236],{"class":548},"\u002Fadmin",[521,1238,552],{"class":531},[521,1240,555],{"class":531},[521,1242,1243,1246,1248,1251,1253,1256],{"class":523,"line":620},[521,1244,1245],{"class":625},"  middlewares",[521,1247,604],{"class":531},[521,1249,1250],{"class":535}," [",[521,1252,1120],{"class":575},[521,1254,1255],{"class":535},"]",[521,1257,555],{"class":531},[521,1259,1260,1263],{"class":523,"line":634},[521,1261,1262],{"class":531},"}>",[521,1264,579],{"class":531},[521,1266,1267,1270,1273,1275,1278,1280,1282,1285,1287,1290,1292],{"class":523,"line":671},[521,1268,1269],{"class":571},"  private",[521,1271,1272],{"class":571}," static",[521,1274,597],{"class":571},[521,1276,1277],{"class":625}," requiredScope",[521,1279,604],{"class":531},[521,1281,869],{"class":575},[521,1283,1284],{"class":531}," =",[521,1286,545],{"class":531},[521,1288,1289],{"class":548},"admin:stats:read",[521,1291,552],{"class":531},[521,1293,555],{"class":531},[521,1295,1296],{"class":523,"line":677},[521,1297,562],{"emptyLinePlaceholder":561},[521,1299,1301,1303,1305,1307,1309,1311,1314,1316,1318,1320],{"class":523,"line":1300},10,[521,1302,585],{"class":571},[521,1304,588],{"class":571},[521,1306,591],{"class":531},[521,1308,594],{"class":571},[521,1310,597],{"class":571},[521,1312,1313],{"class":600}," authContext",[521,1315,604],{"class":531},[521,1317,1155],{"class":575},[521,1319,609],{"class":531},[521,1321,612],{"class":531},[521,1323,1325],{"class":523,"line":1324},11,[521,1326,562],{"emptyLinePlaceholder":561},[521,1328,1330,1332,1335,1338,1340,1343,1345,1347,1350,1352,1355,1357,1360,1363,1365,1368,1371],{"class":523,"line":1329},12,[521,1331,585],{"class":571},[521,1333,1334],{"class":571}," async",[521,1336,1337],{"class":625}," stats",[521,1339,591],{"class":531},[521,1341,1342],{"class":600},"action",[521,1344,604],{"class":531},[521,1346,1190],{"class":575},[521,1348,1349],{"class":531},"\u003C",[521,1351,552],{"class":531},[521,1353,1354],{"class":548},"\u002Fstats",[521,1356,552],{"class":531},[521,1358,1359],{"class":531},">):",[521,1361,1362],{"class":575}," Promise",[521,1364,1349],{"class":531},[521,1366,1367],{"class":575},"Response",[521,1369,1370],{"class":531},">",[521,1372,579],{"class":531},[521,1374,1376,1379,1382,1384,1387,1389,1392,1395,1398,1401,1404],{"class":523,"line":1375},13,[521,1377,1378],{"class":527},"    if",[521,1380,1381],{"class":625}," (",[521,1383,746],{"class":531},[521,1385,1386],{"class":535},"authContext",[521,1388,646],{"class":531},[521,1390,1391],{"class":649},"principal",[521,1393,1394],{"class":625},"() ",[521,1396,1397],{"class":531},"===",[521,1399,1400],{"class":531}," null",[521,1402,1403],{"class":625},") ",[521,1405,1406],{"class":531},"{\n",[521,1408,1410,1413,1416,1418,1421,1423,1427,1429,1431,1434,1436,1438,1441,1443,1445,1447,1449],{"class":523,"line":1409},14,[521,1411,1412],{"class":527},"      return",[521,1414,1415],{"class":535}," action",[521,1417,646],{"class":531},[521,1419,1420],{"class":649},"respond",[521,1422,591],{"class":625},[521,1424,1426],{"class":1425},"sbssI","401",[521,1428,789],{"class":531},[521,1430,532],{"class":531},[521,1432,1433],{"class":625}," error",[521,1435,604],{"class":531},[521,1437,545],{"class":531},[521,1439,1440],{"class":548},"Authentication is required.",[521,1442,552],{"class":531},[521,1444,539],{"class":531},[521,1446,609],{"class":625},[521,1448,664],{"class":531},[521,1450,1451],{"class":667}," \u002F\u002F no principal in the frame\n",[521,1453,1455],{"class":523,"line":1454},15,[521,1456,1457],{"class":531},"    }\n",[521,1459,1461,1463,1465,1468,1470,1472,1475,1477,1480,1482,1485,1488],{"class":523,"line":1460},16,[521,1462,1378],{"class":527},[521,1464,1381],{"class":625},[521,1466,1467],{"class":531},"!this.",[521,1469,1386],{"class":535},[521,1471,646],{"class":531},[521,1473,1474],{"class":649},"isAllowed",[521,1476,591],{"class":625},[521,1478,1479],{"class":535},"AdminController",[521,1481,646],{"class":531},[521,1483,1484],{"class":535},"requiredScope",[521,1486,1487],{"class":625},")) ",[521,1489,1406],{"class":531},[521,1491,1493,1495,1497,1499,1501,1503,1506,1508,1510,1512,1514,1517,1520,1523,1525,1527,1529,1532,1535,1538,1540,1542],{"class":523,"line":1492},17,[521,1494,1412],{"class":527},[521,1496,1415],{"class":535},[521,1498,646],{"class":531},[521,1500,1420],{"class":649},[521,1502,591],{"class":625},[521,1504,1505],{"class":1425},"403",[521,1507,789],{"class":531},[521,1509,532],{"class":531},[521,1511,1433],{"class":625},[521,1513,604],{"class":531},[521,1515,1516],{"class":531}," `",[521,1518,1519],{"class":548},"Requires the '",[521,1521,1522],{"class":531},"${",[521,1524,1479],{"class":535},[521,1526,646],{"class":531},[521,1528,1484],{"class":535},[521,1530,1531],{"class":531},"}",[521,1533,1534],{"class":548},"' scope.",[521,1536,1537],{"class":531},"`",[521,1539,539],{"class":531},[521,1541,609],{"class":625},[521,1543,555],{"class":531},[521,1545,1547],{"class":523,"line":1546},18,[521,1548,1457],{"class":531},[521,1550,1552,1554,1556,1558,1560,1562,1565,1567,1569,1572,1574,1577,1579,1582,1584,1587,1589,1591],{"class":523,"line":1551},19,[521,1553,637],{"class":527},[521,1555,1415],{"class":535},[521,1557,646],{"class":531},[521,1559,1420],{"class":649},[521,1561,591],{"class":625},[521,1563,1564],{"class":1425},"200",[521,1566,789],{"class":531},[521,1568,532],{"class":531},[521,1570,1571],{"class":625}," totalRequests",[521,1573,604],{"class":531},[521,1575,1576],{"class":1425}," 42",[521,1578,789],{"class":531},[521,1580,1581],{"class":625}," activeSessions",[521,1583,604],{"class":531},[521,1585,1586],{"class":1425}," 7",[521,1588,539],{"class":531},[521,1590,609],{"class":625},[521,1592,555],{"class":531},[521,1594,1596],{"class":523,"line":1595},20,[521,1597,674],{"class":531},[521,1599,1601],{"class":523,"line":1600},21,[521,1602,680],{"class":531},[499,1604,1605,1606,1608,1609,1612],{},"The middleware and the handler never share an argument — they share the request frame. ",[503,1607,1120],{},"\nwrites the principal once, ",[503,1610,1611],{},"stats"," reads it back, and nothing in between has to know the value exists.",[696,1614,715],{"id":1615},"open-a-context",[499,1617,1618,1619,1622,1623,1626,1627,1629,1630,1632,1633,1635],{},"In a test or a script there is no transport to open the frame, so you open one with ",[503,1620,1621],{},"run(body, data?, options?)",". It runs ",[503,1624,1625],{},"body",", and once ",[503,1628,1625],{}," settles it fires every ",[503,1631,1083],{}," teardown and awaits any deferred\n",[503,1634,1079],{}," work — so the frame cleans up after itself.",[511,1637,1640],{"className":513,"code":1638,"filename":1639,"language":516,"meta":517,"style":517},"import { Context } from \"@heximon\u002Fruntime\";\n\nconst context = await app.get(Context);\n\nawait context.run(\n  async () => {\n    context.set(\"tenantId\", \"acme\");\n    return service.report(); \u002F\u002F anything it calls now reads tenantId from the frame\n  },\n  { requestId: \"req-1\" }, \u002F\u002F seed the frame's data bag\n);\n","auth.test.ts",[503,1641,1642,1662,1666,1692,1696,1710,1723,1753,1772,1777,1800],{"__ignoreMap":517},[521,1643,1644,1646,1648,1650,1652,1654,1656,1658,1660],{"class":523,"line":524},[521,1645,528],{"class":527},[521,1647,532],{"class":531},[521,1649,536],{"class":535},[521,1651,539],{"class":531},[521,1653,542],{"class":527},[521,1655,545],{"class":531},[521,1657,549],{"class":548},[521,1659,552],{"class":531},[521,1661,555],{"class":531},[521,1663,1664],{"class":523,"line":558},[521,1665,562],{"emptyLinePlaceholder":561},[521,1667,1668,1671,1674,1677,1680,1683,1685,1687,1690],{"class":523,"line":565},[521,1669,1670],{"class":571},"const",[521,1672,1673],{"class":535}," context ",[521,1675,1676],{"class":531},"=",[521,1678,1679],{"class":527}," await",[521,1681,1682],{"class":535}," app",[521,1684,646],{"class":531},[521,1686,650],{"class":649},[521,1688,1689],{"class":535},"(Context)",[521,1691,555],{"class":531},[521,1693,1694],{"class":523,"line":582},[521,1695,562],{"emptyLinePlaceholder":561},[521,1697,1698,1701,1703,1705,1707],{"class":523,"line":615},[521,1699,1700],{"class":527},"await",[521,1702,601],{"class":535},[521,1704,646],{"class":531},[521,1706,1103],{"class":649},[521,1708,1709],{"class":535},"(\n",[521,1711,1712,1715,1718,1721],{"class":523,"line":620},[521,1713,1714],{"class":571},"  async",[521,1716,1717],{"class":531}," ()",[521,1719,1720],{"class":571}," =>",[521,1722,579],{"class":531},[521,1724,1725,1728,1730,1732,1734,1736,1738,1740,1742,1744,1747,1749,1751],{"class":523,"line":634},[521,1726,1727],{"class":535},"    context",[521,1729,646],{"class":531},[521,1731,736],{"class":649},[521,1733,591],{"class":625},[521,1735,552],{"class":531},[521,1737,784],{"class":548},[521,1739,552],{"class":531},[521,1741,789],{"class":531},[521,1743,545],{"class":531},[521,1745,1746],{"class":548},"acme",[521,1748,552],{"class":531},[521,1750,609],{"class":625},[521,1752,555],{"class":531},[521,1754,1755,1757,1760,1762,1765,1767,1769],{"class":523,"line":671},[521,1756,637],{"class":527},[521,1758,1759],{"class":535}," service",[521,1761,646],{"class":531},[521,1763,1764],{"class":649},"report",[521,1766,629],{"class":625},[521,1768,664],{"class":531},[521,1770,1771],{"class":667}," \u002F\u002F anything it calls now reads tenantId from the frame\n",[521,1773,1774],{"class":523,"line":677},[521,1775,1776],{"class":531},"  },\n",[521,1778,1779,1782,1785,1787,1789,1792,1794,1797],{"class":523,"line":1300},[521,1780,1781],{"class":531},"  {",[521,1783,1784],{"class":625}," requestId",[521,1786,604],{"class":531},[521,1788,545],{"class":531},[521,1790,1791],{"class":548},"req-1",[521,1793,552],{"class":531},[521,1795,1796],{"class":531}," },",[521,1798,1799],{"class":667}," \u002F\u002F seed the frame's data bag\n",[521,1801,1802,1804],{"class":523,"line":1324},[521,1803,609],{"class":535},[521,1805,555],{"class":531},[696,1807,1809],{"id":1808},"defer-background-work-past-the-response","Defer background work past the response",[499,1811,1812,1813,1816],{},"Analytics, an audit write, a cache warm — work the caller shouldn't wait for. ",[503,1814,1815],{},"waitUntil(promise)"," hands\nit to the frame instead of blocking the handler's return.",[511,1818,1820],{"className":513,"code":1819,"language":516,"meta":517,"style":517},"this.context.waitUntil(this.analytics.record(event)); \u002F\u002F the response returns without awaiting this\n",[503,1821,1822],{"__ignoreMap":517},[521,1823,1824,1826,1828,1830,1832,1834,1836,1839,1841,1844,1847,1849],{"class":523,"line":524},[521,1825,746],{"class":531},[521,1827,643],{"class":535},[521,1829,646],{"class":531},[521,1831,1079],{"class":649},[521,1833,591],{"class":535},[521,1835,746],{"class":531},[521,1837,1838],{"class":535},"analytics",[521,1840,646],{"class":531},[521,1842,1843],{"class":649},"record",[521,1845,1846],{"class":535},"(event))",[521,1848,664],{"class":531},[521,1850,1851],{"class":667}," \u002F\u002F the response returns without awaiting this\n",[499,1853,1854,1855,1857],{},"Where the promise runs depends on the host. A serverless platform that supplies a ",[503,1856,1079],{}," sink\n(Cloudflare Workers does) keeps the worker alive past the response, so the response returns immediately and\nthe work still completes. With no sink, the frame tracks the promise and awaits it when the frame ends.\nEither way you call the same method.",[499,1859,1860,1861,1864],{},"A long-lived producer like an SSE stream can check\n",[503,1862,1863],{},"hasWaitUntilSink()"," to learn which world it's in before deciding how to signal completion.",[499,1866,1867,1870],{},[503,1868,1869],{},"background(promise)"," is the fire-and-forget counterpart — reach for it when the work must never block the\nresponse and must be safe to call even outside a request (a queue producer's send, a boot self-registration):",[511,1872,1874],{"className":513,"code":1873,"language":516,"meta":517,"style":517},"this.context.background(this.queue.publish(\"orders.placed\", order)); \u002F\u002F never blocks; never throws; never lost\n",[503,1875,1876],{"__ignoreMap":517},[521,1877,1878,1880,1882,1884,1887,1889,1891,1894,1896,1899,1901,1903,1906,1908,1910,1913,1915],{"class":523,"line":524},[521,1879,746],{"class":531},[521,1881,643],{"class":535},[521,1883,646],{"class":531},[521,1885,1886],{"class":649},"background",[521,1888,591],{"class":535},[521,1890,746],{"class":531},[521,1892,1893],{"class":535},"queue",[521,1895,646],{"class":531},[521,1897,1898],{"class":649},"publish",[521,1900,591],{"class":535},[521,1902,552],{"class":531},[521,1904,1905],{"class":548},"orders.placed",[521,1907,552],{"class":531},[521,1909,789],{"class":531},[521,1911,1912],{"class":535}," order))",[521,1914,664],{"class":531},[521,1916,1917],{"class":667}," \u002F\u002F never blocks; never throws; never lost\n",[499,1919,1920,1921,1923,1924,1926,1927,1931],{},"Reach for ",[503,1922,1079],{}," only when the work genuinely must complete before the frame is considered done (a\ntelemetry flush, a write the response implies); reach for ",[503,1925,1886],{}," for everything fire-and-forget. See\n",[712,1928,1930],{"href":1929},"#background-vs-waituntil-per-host","the per-host behavior table"," below for exactly where each one runs.",[696,1933,1935],{"id":1934},"register-teardown","Register teardown",[499,1937,1938,1941,1942,1945],{},[503,1939,1940],{},"onEnd(disposer)"," runs a callback when the frame ends — releasing a connection, closing a transaction,\nclearing a lock. Disposers run in ",[936,1943,1944],{},"reverse"," registration order by default, so teardown unwinds the way\nsetup nested (release the connection after the transaction that used it).",[511,1947,1949],{"className":513,"code":1948,"language":516,"meta":517,"style":517},"this.context.onEnd(() => this.connection.release()); \u002F\u002F runs when the request frame settles\n",[503,1950,1951],{"__ignoreMap":517},[521,1952,1953,1955,1957,1959,1961,1963,1965,1967,1969,1972,1974,1977,1980,1982],{"class":523,"line":524},[521,1954,746],{"class":531},[521,1956,643],{"class":535},[521,1958,646],{"class":531},[521,1960,1083],{"class":649},[521,1962,591],{"class":535},[521,1964,629],{"class":531},[521,1966,1720],{"class":571},[521,1968,640],{"class":531},[521,1970,1971],{"class":535},"connection",[521,1973,646],{"class":531},[521,1975,1976],{"class":649},"release",[521,1978,1979],{"class":535},"())",[521,1981,664],{"class":531},[521,1983,1984],{"class":667}," \u002F\u002F runs when the request frame settles\n",[499,1986,1987,1988,1991,1992,1994],{},"Pass ",[503,1989,1990],{},"independentDisposers: true"," to ",[503,1993,1103],{}," when the disposers don't depend on each other — they then run in\nparallel. The default stays ordered because the common case, a transaction over a connection, needs it.",[499,1996,1997,2000,2001,2003],{},[503,1998,1999],{},"TransactionContext"," is built on ",[503,2002,505],{},": it tracks which transaction is active for the current request\nand leaves the concrete handle to your database dialect, so the core runtime never reaches into SQL or ORM\nspecifics. You inject it the same way, but the Drizzle layer drives it for you and you rarely touch it\ndirectly.",[696,2005,2007],{"id":2006},"bindings-host-supplied-boot-values","Bindings — host-supplied boot values",[499,2009,2010,2011,2014,2015,2018],{},"Some values aren't declared in a module — a host supplies them once at boot: the validated config, an\nin-process client, a transport handle. The host passes them to ",[503,2012,2013],{},"createApp"," as ",[936,2016,2017],{},"bindings",", and a\nprovider that injects one resolves it from that bag.",[511,2020,2023],{"className":513,"code":2021,"filename":2022,"language":516,"meta":517,"style":517},"import { CoreConfig } from \"@heximon\u002Fruntime\";\n\u002F\u002F createApp is generated per app by the compiler — hosts import it from the wiring output.\nimport { createApp } from \".\u002F.heximon\u002Fapps\u002Fmain.wiring.js\";\n\nconst app = await createApp({\n  CoreConfig: new CoreConfig(process.env), \u002F\u002F a typed pass-through, seeded for the whole app\n});\n","host boot",[503,2024,2025,2046,2051,2073,2077,2094,2119],{"__ignoreMap":517},[521,2026,2027,2029,2031,2034,2036,2038,2040,2042,2044],{"class":523,"line":524},[521,2028,528],{"class":527},[521,2030,532],{"class":531},[521,2032,2033],{"class":535}," CoreConfig",[521,2035,539],{"class":531},[521,2037,542],{"class":527},[521,2039,545],{"class":531},[521,2041,549],{"class":548},[521,2043,552],{"class":531},[521,2045,555],{"class":531},[521,2047,2048],{"class":523,"line":558},[521,2049,2050],{"class":667},"\u002F\u002F createApp is generated per app by the compiler — hosts import it from the wiring output.\n",[521,2052,2053,2055,2057,2060,2062,2064,2066,2069,2071],{"class":523,"line":565},[521,2054,528],{"class":527},[521,2056,532],{"class":531},[521,2058,2059],{"class":535}," createApp",[521,2061,539],{"class":531},[521,2063,542],{"class":527},[521,2065,545],{"class":531},[521,2067,2068],{"class":548},".\u002F.heximon\u002Fapps\u002Fmain.wiring.js",[521,2070,552],{"class":531},[521,2072,555],{"class":531},[521,2074,2075],{"class":523,"line":582},[521,2076,562],{"emptyLinePlaceholder":561},[521,2078,2079,2081,2084,2086,2088,2090,2092],{"class":523,"line":615},[521,2080,1670],{"class":571},[521,2082,2083],{"class":535}," app ",[521,2085,1676],{"class":531},[521,2087,1679],{"class":527},[521,2089,2059],{"class":649},[521,2091,591],{"class":535},[521,2093,1406],{"class":531},[521,2095,2096,2099,2101,2104,2106,2109,2111,2114,2116],{"class":523,"line":620},[521,2097,2098],{"class":625},"  CoreConfig",[521,2100,604],{"class":531},[521,2102,2103],{"class":531}," new",[521,2105,2033],{"class":649},[521,2107,2108],{"class":535},"(process",[521,2110,646],{"class":531},[521,2112,2113],{"class":535},"env)",[521,2115,789],{"class":531},[521,2117,2118],{"class":667}," \u002F\u002F a typed pass-through, seeded for the whole app\n",[521,2120,2121,2123,2125],{"class":523,"line":634},[521,2122,1531],{"class":531},[521,2124,609],{"class":535},[521,2126,555],{"class":531},[499,2128,2129,2130,2133],{},"A provider then injects ",[503,2131,2132],{},"CoreConfig"," by class identity, like any dependency:",[511,2135,2137],{"className":513,"code":2136,"filename":515,"language":516,"meta":517,"style":517},"import { CoreConfig } from \"@heximon\u002Fruntime\";\n\nexport class Reporter {\n  public constructor(private readonly config: CoreConfig) {}\n  public isVerbose() {\n    return this.config.debug;\n  }\n}\n",[503,2138,2139,2159,2163,2173,2196,2207,2223,2227],{"__ignoreMap":517},[521,2140,2141,2143,2145,2147,2149,2151,2153,2155,2157],{"class":523,"line":524},[521,2142,528],{"class":527},[521,2144,532],{"class":531},[521,2146,2033],{"class":535},[521,2148,539],{"class":531},[521,2150,542],{"class":527},[521,2152,545],{"class":531},[521,2154,549],{"class":548},[521,2156,552],{"class":531},[521,2158,555],{"class":531},[521,2160,2161],{"class":523,"line":558},[521,2162,562],{"emptyLinePlaceholder":561},[521,2164,2165,2167,2169,2171],{"class":523,"line":565},[521,2166,568],{"class":527},[521,2168,572],{"class":571},[521,2170,576],{"class":575},[521,2172,579],{"class":531},[521,2174,2175,2177,2179,2181,2183,2185,2188,2190,2192,2194],{"class":523,"line":582},[521,2176,585],{"class":571},[521,2178,588],{"class":571},[521,2180,591],{"class":531},[521,2182,594],{"class":571},[521,2184,597],{"class":571},[521,2186,2187],{"class":600}," config",[521,2189,604],{"class":531},[521,2191,2033],{"class":575},[521,2193,609],{"class":531},[521,2195,612],{"class":531},[521,2197,2198,2200,2203,2205],{"class":523,"line":615},[521,2199,585],{"class":571},[521,2201,2202],{"class":625}," isVerbose",[521,2204,629],{"class":531},[521,2206,579],{"class":531},[521,2208,2209,2211,2213,2216,2218,2221],{"class":523,"line":620},[521,2210,637],{"class":527},[521,2212,640],{"class":531},[521,2214,2215],{"class":535},"config",[521,2217,646],{"class":531},[521,2219,2220],{"class":535},"debug",[521,2222,555],{"class":531},[521,2224,2225],{"class":523,"line":634},[521,2226,674],{"class":531},[521,2228,2229],{"class":523,"line":671},[521,2230,680],{"class":531},[499,2232,2233,2234,2236,2237,2240],{},"A missing binding throws at construction, not as a silent ",[503,2235,889],{}," discovered deep in a service later —\nthe failure is loud and early, where you can fix it. ",[503,2238,2239],{},"InternalClient"," is supplied the same way: an\nin-process HTTP client a host wires up so a packaged module can call the running app with no network hop,\nregistered only when some module injects it.",[696,2242,2244],{"id":2243},"platform-bindings","Platform bindings",[499,2246,2247,2250,2251,2254,2255,2258],{},[503,2248,2249],{},"Platform"," is the seam for deployment bindings — a Cloudflare Workers ",[503,2252,2253],{},"env",", a queue binding, an R2\nbucket. Packages and your app declare typed bindings through ",[503,2256,2257],{},"PlatformBindings",", then read them by name.",[511,2260,2262],{"className":513,"code":2261,"language":516,"meta":517,"style":517},"import { Platform } from \"@heximon\u002Fruntime\";\n\nconst queue = Platform.binding(\"ORDERS_QUEUE\"); \u002F\u002F typed via the merged PlatformBindings interface\n",[503,2263,2264,2285,2289],{"__ignoreMap":517},[521,2265,2266,2268,2270,2273,2275,2277,2279,2281,2283],{"class":523,"line":524},[521,2267,528],{"class":527},[521,2269,532],{"class":531},[521,2271,2272],{"class":535}," Platform",[521,2274,539],{"class":531},[521,2276,542],{"class":527},[521,2278,545],{"class":531},[521,2280,549],{"class":548},[521,2282,552],{"class":531},[521,2284,555],{"class":531},[521,2286,2287],{"class":523,"line":558},[521,2288,562],{"emptyLinePlaceholder":561},[521,2290,2291,2293,2296,2298,2300,2302,2305,2307,2309,2312,2314,2316,2318],{"class":523,"line":565},[521,2292,1670],{"class":571},[521,2294,2295],{"class":535}," queue ",[521,2297,1676],{"class":531},[521,2299,2272],{"class":535},[521,2301,646],{"class":531},[521,2303,2304],{"class":649},"binding",[521,2306,591],{"class":535},[521,2308,552],{"class":531},[521,2310,2311],{"class":548},"ORDERS_QUEUE",[521,2313,552],{"class":531},[521,2315,609],{"class":535},[521,2317,664],{"class":531},[521,2319,2320],{"class":667}," \u002F\u002F typed via the merged PlatformBindings interface\n",[499,2322,2323,2324,2326,2327,2329],{},"Bindings live on ",[503,2325,2249],{}," rather than in ",[503,2328,725],{}," because they're per-deployment, not per-request —\nthe same binding serves every request the worker handles.",[696,2331,2333],{"id":2332},"logging","Logging",[499,2335,2336,2339,2340,2343,2344,2346],{},[503,2337,2338],{},"Logger"," is a consola-backed logger you instantiate directly in a service field — it is ",[936,2341,2342],{},"not"," a DI\nprovider, because the active level and output format are process-wide state, not per-instance dependencies.\nThe natural pairing with ",[503,2345,505],{}," is to read the correlation id off the ambient request and bind it onto a\nchild logger, so every line a handler writes carries the id that ties it to one request:",[511,2348,2351],{"className":513,"code":2349,"filename":2350,"language":516,"meta":517,"style":517},"import { Context, Logger } from \"@heximon\u002Fruntime\";\n\nexport class UsersService {\n  private readonly logger = new Logger(\"UsersService\");\n\n  public constructor(private readonly context: Context) {}\n\n  public async create(input: CreateUser): Promise\u003CUser> {\n    this.logger.child({ requestId: this.context.get(\"requestId\") }).log(\"creating user\");\n    \u002F\u002F …\n  }\n}\n","users.service.ts",[503,2352,2353,2378,2382,2393,2421,2425,2447,2451,2484,2546,2551,2555],{"__ignoreMap":517},[521,2354,2355,2357,2359,2361,2363,2366,2368,2370,2372,2374,2376],{"class":523,"line":524},[521,2356,528],{"class":527},[521,2358,532],{"class":531},[521,2360,536],{"class":535},[521,2362,789],{"class":531},[521,2364,2365],{"class":535}," Logger",[521,2367,539],{"class":531},[521,2369,542],{"class":527},[521,2371,545],{"class":531},[521,2373,549],{"class":548},[521,2375,552],{"class":531},[521,2377,555],{"class":531},[521,2379,2380],{"class":523,"line":558},[521,2381,562],{"emptyLinePlaceholder":561},[521,2383,2384,2386,2388,2391],{"class":523,"line":565},[521,2385,568],{"class":527},[521,2387,572],{"class":571},[521,2389,2390],{"class":575}," UsersService",[521,2392,579],{"class":531},[521,2394,2395,2397,2399,2402,2404,2406,2408,2410,2412,2415,2417,2419],{"class":523,"line":582},[521,2396,1269],{"class":571},[521,2398,597],{"class":571},[521,2400,2401],{"class":625}," logger",[521,2403,1284],{"class":531},[521,2405,2103],{"class":531},[521,2407,2365],{"class":625},[521,2409,591],{"class":535},[521,2411,552],{"class":531},[521,2413,2414],{"class":548},"UsersService",[521,2416,552],{"class":531},[521,2418,609],{"class":535},[521,2420,555],{"class":531},[521,2422,2423],{"class":523,"line":615},[521,2424,562],{"emptyLinePlaceholder":561},[521,2426,2427,2429,2431,2433,2435,2437,2439,2441,2443,2445],{"class":523,"line":620},[521,2428,585],{"class":571},[521,2430,588],{"class":571},[521,2432,591],{"class":531},[521,2434,594],{"class":571},[521,2436,597],{"class":571},[521,2438,601],{"class":600},[521,2440,604],{"class":531},[521,2442,536],{"class":575},[521,2444,609],{"class":531},[521,2446,612],{"class":531},[521,2448,2449],{"class":523,"line":634},[521,2450,562],{"emptyLinePlaceholder":561},[521,2452,2453,2455,2457,2460,2462,2465,2467,2470,2473,2475,2477,2480,2482],{"class":523,"line":671},[521,2454,585],{"class":571},[521,2456,1334],{"class":571},[521,2458,2459],{"class":625}," create",[521,2461,591],{"class":531},[521,2463,2464],{"class":600},"input",[521,2466,604],{"class":531},[521,2468,2469],{"class":575}," CreateUser",[521,2471,2472],{"class":531},"):",[521,2474,1362],{"class":575},[521,2476,1349],{"class":531},[521,2478,2479],{"class":575},"User",[521,2481,1370],{"class":531},[521,2483,579],{"class":531},[521,2485,2486,2489,2492,2494,2497,2499,2502,2504,2506,2508,2510,2512,2514,2516,2518,2520,2522,2524,2526,2528,2530,2533,2535,2537,2540,2542,2544],{"class":523,"line":677},[521,2487,2488],{"class":531},"    this.",[521,2490,2491],{"class":535},"logger",[521,2493,646],{"class":531},[521,2495,2496],{"class":649},"child",[521,2498,591],{"class":625},[521,2500,2501],{"class":531},"{",[521,2503,1784],{"class":625},[521,2505,604],{"class":531},[521,2507,640],{"class":531},[521,2509,643],{"class":535},[521,2511,646],{"class":531},[521,2513,650],{"class":649},[521,2515,591],{"class":625},[521,2517,552],{"class":531},[521,2519,657],{"class":548},[521,2521,552],{"class":531},[521,2523,1403],{"class":625},[521,2525,1531],{"class":531},[521,2527,609],{"class":625},[521,2529,646],{"class":531},[521,2531,2532],{"class":649},"log",[521,2534,591],{"class":625},[521,2536,552],{"class":531},[521,2538,2539],{"class":548},"creating user",[521,2541,552],{"class":531},[521,2543,609],{"class":625},[521,2545,555],{"class":531},[521,2547,2548],{"class":523,"line":1300},[521,2549,2550],{"class":667},"    \u002F\u002F …\n",[521,2552,2553],{"class":523,"line":1324},[521,2554,674],{"class":531},[521,2556,2557],{"class":523,"line":1329},[521,2558,680],{"class":531},[499,2560,2561,2562,2564,2565,2568],{},"See ",[712,2563,121],{"href":122}," for levels, the pretty and JSON reporters,\n",[503,2566,2567],{},"Logger.configure",", and the boot summary.",[696,2570,2572],{"id":2571},"run-async-setup-with-oninit","Run async setup with OnInit",[499,2574,2575,2576,2578,2579,2582,2583,2586,2587,2590,2591,2594],{},"A constructor is synchronous — it can't open a connection pool, run a migration, or ",[503,2577,1700],{}," anything.\nImplement ",[503,2580,2581],{},"OnInit"," and Heximon calls ",[503,2584,2585],{},"onInit()"," once, ",[936,2588,2589],{},"after"," your class is constructed and ",[936,2592,2593],{},"before","\nthe app serves its first request. By the time it runs, everything injected into the class is already\nbuilt and initialized — so it's the safe place to do work that depends on a collaborator being ready.",[511,2596,2599],{"className":513,"code":2597,"filename":2598,"language":516,"meta":517,"style":517},"import { type OnInit } from \"@heximon\u002Fruntime\";\nimport { sql } from \"drizzle-orm\";\nimport { AppDatabase } from \"..\u002Fdatabase\u002Fapp-database\";\n\nexport class TasksRepository implements OnInit {\n  public constructor(private readonly database: AppDatabase) {}\n\n  \u002F\u002F Runs once, after construction, before the first request — the async init a constructor cannot do.\n  public async onInit(): Promise\u003Cvoid> {\n    await this.database.getOrm().run(sql`\n      CREATE TABLE IF NOT EXISTS tasks (\n        id    INTEGER PRIMARY KEY AUTOINCREMENT,\n        title TEXT NOT NULL,\n        done  INTEGER NOT NULL DEFAULT 0\n      )\n    `);\n  }\n}\n","src\u002Ftasks\u002Ftasks.repository.ts",[503,2600,2601,2624,2646,2668,2672,2687,2710,2714,2719,2741,2770,2775,2780,2785,2790,2795,2804,2808],{"__ignoreMap":517},[521,2602,2603,2605,2607,2609,2612,2614,2616,2618,2620,2622],{"class":523,"line":524},[521,2604,528],{"class":527},[521,2606,532],{"class":531},[521,2608,1187],{"class":527},[521,2610,2611],{"class":535}," OnInit",[521,2613,539],{"class":531},[521,2615,542],{"class":527},[521,2617,545],{"class":531},[521,2619,549],{"class":548},[521,2621,552],{"class":531},[521,2623,555],{"class":531},[521,2625,2626,2628,2630,2633,2635,2637,2639,2642,2644],{"class":523,"line":558},[521,2627,528],{"class":527},[521,2629,532],{"class":531},[521,2631,2632],{"class":535}," sql",[521,2634,539],{"class":531},[521,2636,542],{"class":527},[521,2638,545],{"class":531},[521,2640,2641],{"class":548},"drizzle-orm",[521,2643,552],{"class":531},[521,2645,555],{"class":531},[521,2647,2648,2650,2652,2655,2657,2659,2661,2664,2666],{"class":523,"line":565},[521,2649,528],{"class":527},[521,2651,532],{"class":531},[521,2653,2654],{"class":535}," AppDatabase",[521,2656,539],{"class":531},[521,2658,542],{"class":527},[521,2660,545],{"class":531},[521,2662,2663],{"class":548},"..\u002Fdatabase\u002Fapp-database",[521,2665,552],{"class":531},[521,2667,555],{"class":531},[521,2669,2670],{"class":523,"line":582},[521,2671,562],{"emptyLinePlaceholder":561},[521,2673,2674,2676,2678,2681,2683,2685],{"class":523,"line":615},[521,2675,568],{"class":527},[521,2677,572],{"class":571},[521,2679,2680],{"class":575}," TasksRepository",[521,2682,1219],{"class":571},[521,2684,2611],{"class":575},[521,2686,579],{"class":531},[521,2688,2689,2691,2693,2695,2697,2699,2702,2704,2706,2708],{"class":523,"line":620},[521,2690,585],{"class":571},[521,2692,588],{"class":571},[521,2694,591],{"class":531},[521,2696,594],{"class":571},[521,2698,597],{"class":571},[521,2700,2701],{"class":600}," database",[521,2703,604],{"class":531},[521,2705,2654],{"class":575},[521,2707,609],{"class":531},[521,2709,612],{"class":531},[521,2711,2712],{"class":523,"line":634},[521,2713,562],{"emptyLinePlaceholder":561},[521,2715,2716],{"class":523,"line":671},[521,2717,2718],{"class":667},"  \u002F\u002F Runs once, after construction, before the first request — the async init a constructor cannot do.\n",[521,2720,2721,2723,2725,2728,2730,2732,2734,2737,2739],{"class":523,"line":677},[521,2722,585],{"class":571},[521,2724,1334],{"class":571},[521,2726,2727],{"class":625}," onInit",[521,2729,1020],{"class":531},[521,2731,1362],{"class":575},[521,2733,1349],{"class":531},[521,2735,2736],{"class":575},"void",[521,2738,1370],{"class":531},[521,2740,579],{"class":531},[521,2742,2743,2746,2748,2751,2753,2756,2758,2760,2762,2764,2767],{"class":523,"line":1300},[521,2744,2745],{"class":527},"    await",[521,2747,640],{"class":531},[521,2749,2750],{"class":535},"database",[521,2752,646],{"class":531},[521,2754,2755],{"class":649},"getOrm",[521,2757,629],{"class":625},[521,2759,646],{"class":531},[521,2761,1103],{"class":649},[521,2763,591],{"class":625},[521,2765,2766],{"class":649},"sql",[521,2768,2769],{"class":531},"`\n",[521,2771,2772],{"class":523,"line":1324},[521,2773,2774],{"class":548},"      CREATE TABLE IF NOT EXISTS tasks (\n",[521,2776,2777],{"class":523,"line":1329},[521,2778,2779],{"class":548},"        id    INTEGER PRIMARY KEY AUTOINCREMENT,\n",[521,2781,2782],{"class":523,"line":1375},[521,2783,2784],{"class":548},"        title TEXT NOT NULL,\n",[521,2786,2787],{"class":523,"line":1409},[521,2788,2789],{"class":548},"        done  INTEGER NOT NULL DEFAULT 0\n",[521,2791,2792],{"class":523,"line":1454},[521,2793,2794],{"class":548},"      )\n",[521,2796,2797,2800,2802],{"class":523,"line":1460},[521,2798,2799],{"class":531},"    `",[521,2801,609],{"class":625},[521,2803,555],{"class":531},[521,2805,2806],{"class":523,"line":1492},[521,2807,674],{"class":531},[521,2809,2810],{"class":523,"line":1546},[521,2811,680],{"class":531},[499,2813,2814,2815,2818,2819,2822,2823,2826,2827,2829],{},"This is straight from the libsql example: the in-memory database resets on every boot, so the repository creates its table in ",[503,2816,2817],{},"onInit"," instead of a migration. The hook fires in ",[936,2820,2821],{},"dependency order"," — a class's dependencies are constructed and initialized before it is, so ",[503,2824,2825],{},"this.database"," is guaranteed live by the time ",[503,2828,2817],{}," runs.",[696,2831,2833],{"id":2832},"run-boot-time-work-with-onbootstrap","Run boot-time work with OnBootstrap",[499,2835,2836,2838,2839,2842,2843,2845],{},[503,2837,2581],{}," is ",[936,2840,2841],{},"lazy"," — a provider's ",[503,2844,2817],{}," runs the first time something resolves it, which on the hot path is the request that needs it. That keeps cold starts lean: an app pays only for what a request touches.",[499,2847,2848,2849,2852,2853,1091,2856,1073,2858,2861,2862,2865],{},"But some providers must run at boot ",[691,2850,2851],{},"regardless of traffic"," — a queue consumer's poll loop, a scheduler's timers, a service registering itself with a discovery backend. Implement ",[503,2854,2855],{},"OnBootstrap",[503,2857,2013],{},[936,2859,2860],{},"force-loads"," that provider at boot: it constructs the provider and calls ",[503,2863,2864],{},"onBootstrap()"," before the app serves, while every other module stays lazy.",[511,2867,2870],{"className":513,"code":2868,"filename":2869,"language":516,"meta":517,"style":517},"import { Context, type OnBootstrap } from \"@heximon\u002Fruntime\";\nimport { ServiceRegistry } from \".\u002Fservice-registry\";\n\nexport class FeedRegistration implements OnBootstrap {\n  public constructor(\n    private readonly context: Context,\n    private readonly registry: ServiceRegistry,\n  ) {}\n\n  \u002F\u002F Runs at boot — createApp force-loads this provider whether or not a request ever arrives.\n  public onBootstrap(): void {\n    \u002F\u002F Hand boot work to Context.background, the host-shaped fire-and-forget seam: on a freezing\u002Fevicting host\n    \u002F\u002F (Cloudflare Workers) it rides the boot frame's waitUntil sink so it survives past the boot invocation; on\n    \u002F\u002F a long-lived host (Node) it just runs in the background. A bare `void` would be severed on the edge.\n    this.context.background(this.registry.register(\"feed\"));\n  }\n}\n","src\u002Ffeed\u002Ffeed-registration.ts",[503,2871,2872,2899,2921,2925,2940,2948,2964,2979,2986,2990,2995,3009,3014,3019,3024,3060,3064],{"__ignoreMap":517},[521,2873,2874,2876,2878,2880,2882,2884,2887,2889,2891,2893,2895,2897],{"class":523,"line":524},[521,2875,528],{"class":527},[521,2877,532],{"class":531},[521,2879,536],{"class":535},[521,2881,789],{"class":531},[521,2883,1187],{"class":527},[521,2885,2886],{"class":535}," OnBootstrap",[521,2888,539],{"class":531},[521,2890,542],{"class":527},[521,2892,545],{"class":531},[521,2894,549],{"class":548},[521,2896,552],{"class":531},[521,2898,555],{"class":531},[521,2900,2901,2903,2905,2908,2910,2912,2914,2917,2919],{"class":523,"line":558},[521,2902,528],{"class":527},[521,2904,532],{"class":531},[521,2906,2907],{"class":535}," ServiceRegistry",[521,2909,539],{"class":531},[521,2911,542],{"class":527},[521,2913,545],{"class":531},[521,2915,2916],{"class":548},".\u002Fservice-registry",[521,2918,552],{"class":531},[521,2920,555],{"class":531},[521,2922,2923],{"class":523,"line":565},[521,2924,562],{"emptyLinePlaceholder":561},[521,2926,2927,2929,2931,2934,2936,2938],{"class":523,"line":582},[521,2928,568],{"class":527},[521,2930,572],{"class":571},[521,2932,2933],{"class":575}," FeedRegistration",[521,2935,1219],{"class":571},[521,2937,2886],{"class":575},[521,2939,579],{"class":531},[521,2941,2942,2944,2946],{"class":523,"line":615},[521,2943,585],{"class":571},[521,2945,588],{"class":571},[521,2947,1709],{"class":531},[521,2949,2950,2953,2955,2957,2959,2961],{"class":523,"line":620},[521,2951,2952],{"class":571},"    private",[521,2954,597],{"class":571},[521,2956,601],{"class":600},[521,2958,604],{"class":531},[521,2960,536],{"class":575},[521,2962,2963],{"class":531},",\n",[521,2965,2966,2968,2970,2973,2975,2977],{"class":523,"line":634},[521,2967,2952],{"class":571},[521,2969,597],{"class":571},[521,2971,2972],{"class":600}," registry",[521,2974,604],{"class":531},[521,2976,2907],{"class":575},[521,2978,2963],{"class":531},[521,2980,2981,2984],{"class":523,"line":671},[521,2982,2983],{"class":531},"  )",[521,2985,612],{"class":531},[521,2987,2988],{"class":523,"line":677},[521,2989,562],{"emptyLinePlaceholder":561},[521,2991,2992],{"class":523,"line":1300},[521,2993,2994],{"class":667},"  \u002F\u002F Runs at boot — createApp force-loads this provider whether or not a request ever arrives.\n",[521,2996,2997,2999,3002,3004,3007],{"class":523,"line":1324},[521,2998,585],{"class":571},[521,3000,3001],{"class":625}," onBootstrap",[521,3003,1020],{"class":531},[521,3005,3006],{"class":575}," void",[521,3008,579],{"class":531},[521,3010,3011],{"class":523,"line":1329},[521,3012,3013],{"class":667},"    \u002F\u002F Hand boot work to Context.background, the host-shaped fire-and-forget seam: on a freezing\u002Fevicting host\n",[521,3015,3016],{"class":523,"line":1375},[521,3017,3018],{"class":667},"    \u002F\u002F (Cloudflare Workers) it rides the boot frame's waitUntil sink so it survives past the boot invocation; on\n",[521,3020,3021],{"class":523,"line":1409},[521,3022,3023],{"class":667},"    \u002F\u002F a long-lived host (Node) it just runs in the background. A bare `void` would be severed on the edge.\n",[521,3025,3026,3028,3030,3032,3034,3036,3038,3041,3043,3046,3048,3050,3053,3055,3058],{"class":523,"line":1454},[521,3027,2488],{"class":531},[521,3029,643],{"class":535},[521,3031,646],{"class":531},[521,3033,1886],{"class":649},[521,3035,591],{"class":625},[521,3037,746],{"class":531},[521,3039,3040],{"class":535},"registry",[521,3042,646],{"class":531},[521,3044,3045],{"class":649},"register",[521,3047,591],{"class":625},[521,3049,552],{"class":531},[521,3051,3052],{"class":548},"feed",[521,3054,552],{"class":531},[521,3056,3057],{"class":625},"))",[521,3059,555],{"class":531},[521,3061,3062],{"class":523,"line":1460},[521,3063,674],{"class":531},[521,3065,3066],{"class":523,"line":1492},[521,3067,680],{"class":531},[499,3069,3070,3071,3074,3075,3077,3078,3084],{},"Only providers that declare ",[503,3072,3073],{},"onBootstrap"," are loaded at boot — everything else stays lazy, so cold starts pay only for the eager-boot work you asked for. ",[503,3076,2013],{}," runs the hook inside whatever boot frame the host opened, and ",[712,3079,3081],{"href":3080},"#defer-background-work-past-the-response",[503,3082,3083],{},"Context.background"," routes the work correctly per host — never block boot, never lose it to an eviction.",[499,3086,3087,3088,3093,3094,3096,3097,3102],{},"The framework's own eager-boot providers use this hook: the polling queue consumers (",[712,3089,3090],{"href":152},[503,3091,3092],{},"@heximon\u002Fqueue",") start their drain loop in ",[503,3095,3073],{},", and the Node schedule driver (",[712,3098,3099],{"href":157},[503,3100,3101],{},"@heximon\u002Fschedule",") arms its cron timers there — so a queue-only or cron-only deploy starts working without waiting for an HTTP request.",[499,3104,3105,1091,3107,3109,3110,3112,3113,3115,3116,3118],{},[503,3106,2581],{},[503,3108,2855],{}," are independent: a provider may implement either or both. When a bootstrap provider also has an ",[503,3111,2817],{},", its ",[503,3114,2817],{}," (own-state setup) runs first, then ",[503,3117,3073],{}," (the standing boot work).",[499,3120,2561,3121,1091,3125,3129,3130,3133,3134,3136,3137,3139,3140,3143],{},[712,3122,3124],{"href":3123},"#eager-boot-for-opaque-providers","Eager boot for opaque providers",[712,3126,3128],{"href":3127},"#boot-is-two-phase","boot's two phases"," below for the subtler cases — a ",[503,3131,3132],{},"useFactory","-built provider, and exactly when ",[503,3135,3073],{}," is guaranteed to see ",[503,3138,2817],{},"-established state from ",[691,3141,3142],{},"other"," modules.",[696,3145,3147],{"id":3146},"release-resources-with-onshutdown","Release resources with OnShutdown",[499,3149,3150,3151,2582,3154,3157,3158,3160],{},"JavaScript has no destructor, so there's no built-in moment to close a pool or flush a buffer. Implement ",[503,3152,3153],{},"OnShutdown",[503,3155,3156],{},"onShutdown()"," when the app tears down, in ",[936,3159,1944],{}," construction order — dependents shut down before the dependencies they rely on, so nothing closes a resource another instance is still using.",[511,3162,3165],{"className":513,"code":3163,"filename":3164,"language":516,"meta":517,"style":517},"import { type OnShutdown } from \"@heximon\u002Fruntime\";\n\nexport class Database implements OnShutdown {\n  public async onShutdown(): Promise\u003Cvoid> {\n    await this.pool.end(); \u002F\u002F close the connection pool as the app stops\n  }\n}\n","src\u002Fdatabase\u002Fdatabase.ts",[503,3166,3167,3190,3194,3209,3230,3251,3255],{"__ignoreMap":517},[521,3168,3169,3171,3173,3175,3178,3180,3182,3184,3186,3188],{"class":523,"line":524},[521,3170,528],{"class":527},[521,3172,532],{"class":531},[521,3174,1187],{"class":527},[521,3176,3177],{"class":535}," OnShutdown",[521,3179,539],{"class":531},[521,3181,542],{"class":527},[521,3183,545],{"class":531},[521,3185,549],{"class":548},[521,3187,552],{"class":531},[521,3189,555],{"class":531},[521,3191,3192],{"class":523,"line":558},[521,3193,562],{"emptyLinePlaceholder":561},[521,3195,3196,3198,3200,3203,3205,3207],{"class":523,"line":565},[521,3197,568],{"class":527},[521,3199,572],{"class":571},[521,3201,3202],{"class":575}," Database",[521,3204,1219],{"class":571},[521,3206,3177],{"class":575},[521,3208,579],{"class":531},[521,3210,3211,3213,3215,3218,3220,3222,3224,3226,3228],{"class":523,"line":582},[521,3212,585],{"class":571},[521,3214,1334],{"class":571},[521,3216,3217],{"class":625}," onShutdown",[521,3219,1020],{"class":531},[521,3221,1362],{"class":575},[521,3223,1349],{"class":531},[521,3225,2736],{"class":575},[521,3227,1370],{"class":531},[521,3229,579],{"class":531},[521,3231,3232,3234,3236,3239,3241,3244,3246,3248],{"class":523,"line":615},[521,3233,2745],{"class":527},[521,3235,640],{"class":531},[521,3237,3238],{"class":535},"pool",[521,3240,646],{"class":531},[521,3242,3243],{"class":649},"end",[521,3245,629],{"class":625},[521,3247,664],{"class":531},[521,3249,3250],{"class":667}," \u002F\u002F close the connection pool as the app stops\n",[521,3252,3253],{"class":523,"line":620},[521,3254,674],{"class":531},[521,3256,3257],{"class":523,"line":634},[521,3258,680],{"class":531},[499,3260,3261,3262,3264,3265,3267],{},"Implement only the hook a constructor can't replace — async initialization (",[503,3263,2581],{},") and teardown (",[503,3266,3153],{},"). Plain synchronous setup belongs in the constructor, where it's clearer and runs eagerly. You never call either hook yourself; the compiler weaves both into the wiring it generates.",[3269,3270,3271,3288],"table",{},[3272,3273,3274],"thead",{},[3275,3276,3277,3282,3285],"tr",{},[3278,3279,3281],"th",{"align":3280},"left","Hook",[3278,3283,3284],{"align":3280},"When it runs",[3278,3286,3287],{"align":3280},"Order",[3289,3290,3291,3304,3325],"tbody",{},[3275,3292,3293,3298,3301],{},[3294,3295,3296],"td",{"align":3280},[503,3297,2581],{},[3294,3299,3300],{"align":3280},"After construction (lazy — on first resolution)",[3294,3302,3303],{"align":3280},"Dependency order — dependencies first",[3275,3305,3306,3310,3316],{},[3294,3307,3308],{"align":3280},[503,3309,2855],{},[3294,3311,3312,3313,3315],{"align":3280},"At ",[503,3314,2013],{},", before the app serves — the provider is force-loaded regardless of traffic",[3294,3317,3318,3319,1073,3322,3324],{"align":3280},"After ",[936,3320,3321],{},"every",[503,3323,2817],{}," has completed (boot phase 2), in registration order",[3275,3326,3327,3331,3337],{},[3294,3328,3329],{"align":3280},[503,3330,3153],{},[3294,3332,3333,3334],{"align":3280},"On ",[503,3335,3336],{},"app.shutdown()",[3294,3338,3339],{"align":3280},"Reverse construction order — dependents first",[696,3341,3343],{"id":3342},"resolve-a-provider","Resolve a provider",[499,3345,3346,3348,3349,3352],{},[503,3347,650],{}," looks a class up by identity and hands back its single shared instance, constructing it (and its dependency subtree) on first call, then memoizing. It keys on the ",[936,3350,3351],{},"class object itself"," — never a name string — so two different classes that happen to share a name never collide.",[511,3354,3357],{"className":513,"code":3355,"filename":3356,"language":516,"meta":517,"style":517},"const tasks = await app.get(TasksRepository); \u002F\u002F constructs the repository and its database on first call\n","resolve a provider",[503,3358,3359],{"__ignoreMap":517},[521,3360,3361,3363,3366,3368,3370,3372,3374,3376,3379,3381],{"class":523,"line":524},[521,3362,1670],{"class":571},[521,3364,3365],{"class":535}," tasks ",[521,3367,1676],{"class":531},[521,3369,1679],{"class":527},[521,3371,1682],{"class":535},[521,3373,646],{"class":531},[521,3375,650],{"class":649},[521,3377,3378],{"class":535},"(TasksRepository)",[521,3380,664],{"class":531},[521,3382,3383],{"class":667}," \u002F\u002F constructs the repository and its database on first call\n",[499,3385,3386,3388,3389,3392,3393,3395],{},[503,3387,650],{}," is always ",[503,3390,3391],{},"async"," because resolving a token can trigger the construction of a whole subtree, and a constructor's dependency may itself have an ",[503,3394,2581],{}," to await. Treating resolution as async keeps that uniform whether the instance already exists or is built on the spot.",[696,3397,3399],{"id":3398},"run-a-task-standalone","Run a task standalone",[499,3401,3402,3403,3406,3407,3410],{},"A ",[503,3404,3405],{},"Task"," is an ordinary injectable, discovered by ",[503,3408,3409],{},"extends Task\u003C…>"," and wired like any provider. Outside a\nrequest — a migration script, a cron entry — you resolve it through the handle and run it inside a request\ncontext so it can read the same per-operation state your handlers see.",[511,3412,3415],{"className":513,"code":3413,"filename":3414,"language":516,"meta":517,"style":517},"import { Task, type TaskResult } from \"@heximon\u002Fruntime\";\nimport { MigrationRunner } from \"@heximon\u002Fpersistence\";\n\n\u002F\u002F `apply()` is idempotent — it reads the bookkeeping table, applies only the pending migrations in name\n\u002F\u002F order, and returns their names. A second run returns `[]` and leaves the schema untouched.\nexport class MigrateTask extends Task\u003Cstring> {\n  public constructor(private readonly runner: MigrationRunner) {\n    super();\n  }\n\n  public override async run(): Promise\u003CTaskResult\u003Cstring>> {\n    const applied = await this.runner.apply();\n    return { result: `Applied ${applied.length} migration(s).` };\n  }\n}\n","src\u002Fdatabase\u002Fmigrate.task.ts",[503,3416,3417,3445,3467,3471,3476,3481,3504,3527,3536,3540,3544,3574,3600,3636,3640],{"__ignoreMap":517},[521,3418,3419,3421,3423,3426,3428,3430,3433,3435,3437,3439,3441,3443],{"class":523,"line":524},[521,3420,528],{"class":527},[521,3422,532],{"class":531},[521,3424,3425],{"class":535}," Task",[521,3427,789],{"class":531},[521,3429,1187],{"class":527},[521,3431,3432],{"class":535}," TaskResult",[521,3434,539],{"class":531},[521,3436,542],{"class":527},[521,3438,545],{"class":531},[521,3440,549],{"class":548},[521,3442,552],{"class":531},[521,3444,555],{"class":531},[521,3446,3447,3449,3451,3454,3456,3458,3460,3463,3465],{"class":523,"line":558},[521,3448,528],{"class":527},[521,3450,532],{"class":531},[521,3452,3453],{"class":535}," MigrationRunner",[521,3455,539],{"class":531},[521,3457,542],{"class":527},[521,3459,545],{"class":531},[521,3461,3462],{"class":548},"@heximon\u002Fpersistence",[521,3464,552],{"class":531},[521,3466,555],{"class":531},[521,3468,3469],{"class":523,"line":565},[521,3470,562],{"emptyLinePlaceholder":561},[521,3472,3473],{"class":523,"line":582},[521,3474,3475],{"class":667},"\u002F\u002F `apply()` is idempotent — it reads the bookkeeping table, applies only the pending migrations in name\n",[521,3477,3478],{"class":523,"line":615},[521,3479,3480],{"class":667},"\u002F\u002F order, and returns their names. A second run returns `[]` and leaves the schema untouched.\n",[521,3482,3483,3485,3487,3490,3493,3495,3497,3500,3502],{"class":523,"line":620},[521,3484,568],{"class":527},[521,3486,572],{"class":571},[521,3488,3489],{"class":575}," MigrateTask",[521,3491,3492],{"class":571}," extends",[521,3494,3425],{"class":575},[521,3496,1349],{"class":531},[521,3498,3499],{"class":575},"string",[521,3501,1370],{"class":531},[521,3503,579],{"class":531},[521,3505,3506,3508,3510,3512,3514,3516,3519,3521,3523,3525],{"class":523,"line":634},[521,3507,585],{"class":571},[521,3509,588],{"class":571},[521,3511,591],{"class":531},[521,3513,594],{"class":571},[521,3515,597],{"class":571},[521,3517,3518],{"class":600}," runner",[521,3520,604],{"class":531},[521,3522,3453],{"class":575},[521,3524,609],{"class":531},[521,3526,579],{"class":531},[521,3528,3529,3532,3534],{"class":523,"line":671},[521,3530,3531],{"class":535},"    super",[521,3533,629],{"class":625},[521,3535,555],{"class":531},[521,3537,3538],{"class":523,"line":677},[521,3539,674],{"class":531},[521,3541,3542],{"class":523,"line":1300},[521,3543,562],{"emptyLinePlaceholder":561},[521,3545,3546,3548,3551,3553,3556,3558,3560,3562,3565,3567,3569,3572],{"class":523,"line":1324},[521,3547,585],{"class":571},[521,3549,3550],{"class":571}," override",[521,3552,1334],{"class":571},[521,3554,3555],{"class":625}," run",[521,3557,1020],{"class":531},[521,3559,1362],{"class":575},[521,3561,1349],{"class":531},[521,3563,3564],{"class":575},"TaskResult",[521,3566,1349],{"class":531},[521,3568,3499],{"class":575},[521,3570,3571],{"class":531},">>",[521,3573,579],{"class":531},[521,3575,3576,3579,3582,3584,3586,3588,3591,3593,3596,3598],{"class":523,"line":1329},[521,3577,3578],{"class":571},"    const",[521,3580,3581],{"class":535}," applied",[521,3583,1284],{"class":531},[521,3585,1679],{"class":527},[521,3587,640],{"class":531},[521,3589,3590],{"class":535},"runner",[521,3592,646],{"class":531},[521,3594,3595],{"class":649},"apply",[521,3597,629],{"class":625},[521,3599,555],{"class":531},[521,3601,3602,3604,3606,3609,3611,3613,3616,3618,3621,3623,3626,3628,3631,3633],{"class":523,"line":1375},[521,3603,637],{"class":527},[521,3605,532],{"class":531},[521,3607,3608],{"class":625}," result",[521,3610,604],{"class":531},[521,3612,1516],{"class":531},[521,3614,3615],{"class":548},"Applied ",[521,3617,1522],{"class":531},[521,3619,3620],{"class":535},"applied",[521,3622,646],{"class":531},[521,3624,3625],{"class":535},"length",[521,3627,1531],{"class":531},[521,3629,3630],{"class":548}," migration(s).",[521,3632,1537],{"class":531},[521,3634,3635],{"class":531}," };\n",[521,3637,3638],{"class":523,"line":1409},[521,3639,674],{"class":531},[521,3641,3642],{"class":523,"line":1454},[521,3643,680],{"class":531},[511,3645,3648],{"className":513,"code":3646,"filename":3647,"language":516,"meta":517,"style":517},"const task = await app.get(MigrateTask); \u002F\u002F resolved by class identity\nconst context = await app.get(Context);\nconst rerun = await context.run(() => task.run()); \u002F\u002F run inside a context frame\n\nrerun.result; \u002F\u002F \"Applied 0 migration(s).\" — the boot-time onInit already applied it once\n","a manual re-run",[503,3649,3650,3675,3695,3732,3736],{"__ignoreMap":517},[521,3651,3652,3654,3657,3659,3661,3663,3665,3667,3670,3672],{"class":523,"line":524},[521,3653,1670],{"class":571},[521,3655,3656],{"class":535}," task ",[521,3658,1676],{"class":531},[521,3660,1679],{"class":527},[521,3662,1682],{"class":535},[521,3664,646],{"class":531},[521,3666,650],{"class":649},[521,3668,3669],{"class":535},"(MigrateTask)",[521,3671,664],{"class":531},[521,3673,3674],{"class":667}," \u002F\u002F resolved by class identity\n",[521,3676,3677,3679,3681,3683,3685,3687,3689,3691,3693],{"class":523,"line":558},[521,3678,1670],{"class":571},[521,3680,1673],{"class":535},[521,3682,1676],{"class":531},[521,3684,1679],{"class":527},[521,3686,1682],{"class":535},[521,3688,646],{"class":531},[521,3690,650],{"class":649},[521,3692,1689],{"class":535},[521,3694,555],{"class":531},[521,3696,3697,3699,3702,3704,3706,3708,3710,3712,3714,3716,3718,3721,3723,3725,3727,3729],{"class":523,"line":565},[521,3698,1670],{"class":571},[521,3700,3701],{"class":535}," rerun ",[521,3703,1676],{"class":531},[521,3705,1679],{"class":527},[521,3707,601],{"class":535},[521,3709,646],{"class":531},[521,3711,1103],{"class":649},[521,3713,591],{"class":535},[521,3715,629],{"class":531},[521,3717,1720],{"class":571},[521,3719,3720],{"class":535}," task",[521,3722,646],{"class":531},[521,3724,1103],{"class":649},[521,3726,1979],{"class":535},[521,3728,664],{"class":531},[521,3730,3731],{"class":667}," \u002F\u002F run inside a context frame\n",[521,3733,3734],{"class":523,"line":582},[521,3735,562],{"emptyLinePlaceholder":561},[521,3737,3738,3741,3743,3746,3748],{"class":523,"line":615},[521,3739,3740],{"class":535},"rerun",[521,3742,646],{"class":531},[521,3744,3745],{"class":535},"result",[521,3747,664],{"class":531},[521,3749,3750],{"class":667}," \u002F\u002F \"Applied 0 migration(s).\" — the boot-time onInit already applied it once\n",[499,3752,3753,3756,3757,3759],{},[503,3754,3755],{},"context.run"," opens the per-operation frame your transports normally open per request — running the task\ninside it means the task, and anything it injects, reads the same ",[503,3758,505],{}," state as a live handler. There's\nno container lookup and no global app to reach for: you hold the handle and ask it for what you need.",[696,3761,3763],{"id":3762},"warm-a-server-at-boot","Warm a server at boot",[499,3765,3766,3767,3770,3771,3773,3774,3776],{},"By default the compiled wiring constructs your modules ",[936,3768,3769],{},"lazily"," — each module is built the first time something resolves a provider it owns, so a cold start (an edge isolate, a Workers invocation) pays only for what the first request touches. The exception is ",[503,3772,2855],{}," providers, whose modules ",[503,3775,2013],{}," force-loads at boot (see above).",[499,3778,3779,3780,3783,3784,3786,3787,3789,3790,3792,3793,3795,3796,646],{},"Call ",[503,3781,3782],{},"preload()"," when you want to force a full warm-up explicitly — construct ",[691,3785,3321],{}," module and run every not-yet-loaded module's ",[503,3788,2581],{},"s (open pools, create tables) before a long-lived server starts accepting traffic. The ",[503,3791,2855],{}," hooks already ran inside ",[503,3794,2013],{},", after every ",[503,3797,2817],{},[511,3799,3802],{"className":513,"code":3800,"filename":3801,"language":516,"meta":517,"style":517},"await app.preload(); \u002F\u002F construct every module and run the remaining OnInit hooks up front\n","warm the app",[503,3803,3804],{"__ignoreMap":517},[521,3805,3806,3808,3810,3812,3815,3817,3819],{"class":523,"line":524},[521,3807,1700],{"class":527},[521,3809,1682],{"class":535},[521,3811,646],{"class":531},[521,3813,3814],{"class":649},"preload",[521,3816,629],{"class":535},[521,3818,664],{"class":531},[521,3820,3821],{"class":667}," \u002F\u002F construct every module and run the remaining OnInit hooks up front\n",[696,3823,3825],{"id":3824},"shut-down-gracefully","Shut down gracefully",[499,3827,3828,3830,3831,3833,3834,824,3837,3840,3841,3844],{},[503,3829,3336],{}," runs ",[503,3832,3153],{}," on every constructed instance in reverse construction order. On Node\nthe generated server entry also registers ",[503,3835,3836],{},"SIGTERM",[503,3838,3839],{},"SIGINT"," handlers that drain in-flight requests\nfirst, then shut the app down. The drain waits for all open ",[503,3842,3843],{},"Context.run"," frames to settle\n(requests that are still running) before tearing down, so no request is cut short mid-flight.",[511,3846,3849],{"className":513,"code":3847,"filename":3848,"language":516,"meta":517,"style":517},"const context = await app.get(Context);\n\n\u002F\u002F Wait up to 10 s for in-flight requests, then shut down.\nawait context.drain({ timeoutMs: 10_000 });\nawait app.shutdown();\n","manual graceful teardown",[503,3850,3851,3871,3875,3880,3909],{"__ignoreMap":517},[521,3852,3853,3855,3857,3859,3861,3863,3865,3867,3869],{"class":523,"line":524},[521,3854,1670],{"class":571},[521,3856,1673],{"class":535},[521,3858,1676],{"class":531},[521,3860,1679],{"class":527},[521,3862,1682],{"class":535},[521,3864,646],{"class":531},[521,3866,650],{"class":649},[521,3868,1689],{"class":535},[521,3870,555],{"class":531},[521,3872,3873],{"class":523,"line":558},[521,3874,562],{"emptyLinePlaceholder":561},[521,3876,3877],{"class":523,"line":565},[521,3878,3879],{"class":667},"\u002F\u002F Wait up to 10 s for in-flight requests, then shut down.\n",[521,3881,3882,3884,3886,3888,3891,3893,3895,3898,3900,3903,3905,3907],{"class":523,"line":582},[521,3883,1700],{"class":527},[521,3885,601],{"class":535},[521,3887,646],{"class":531},[521,3889,3890],{"class":649},"drain",[521,3892,591],{"class":535},[521,3894,2501],{"class":531},[521,3896,3897],{"class":625}," timeoutMs",[521,3899,604],{"class":531},[521,3901,3902],{"class":1425}," 10_000",[521,3904,539],{"class":531},[521,3906,609],{"class":535},[521,3908,555],{"class":531},[521,3910,3911,3913,3915,3917,3920,3922],{"class":523,"line":615},[521,3912,1700],{"class":527},[521,3914,1682],{"class":535},[521,3916,646],{"class":531},[521,3918,3919],{"class":649},"shutdown",[521,3921,629],{"class":535},[521,3923,555],{"class":531},[499,3925,3926,3929,3930,3933,3934,3937,3938,824,3940,3942,3943,3945],{},[503,3927,3928],{},"Context.drain()"," resolves immediately when nothing is in flight, so calling it is always safe.\nWithout a timeout it waits indefinitely; a ",[503,3931,3932],{},"timeoutMs"," budget lets the host proceed to ",[503,3935,3936],{},"shutdown()","\neven if a straggler is still running. The generated server entry handles this automatically on\n",[503,3939,3836],{},[503,3941,3839],{}," — reach for ",[503,3944,3890],{}," yourself only in tests or custom hosts.",[696,3947,3949],{"id":3948},"youll-need-this-later","You'll need this later",[3951,3952,3124],"h3",{"id":3953},"eager-boot-for-opaque-providers",[499,3955,3956,3957,3959,3960,3963,3964,3967,3968,3971,3972,3974,3975,3978],{},"The compiler detects ",[503,3958,2855],{}," by reading a provider's implementation class — so a bare ",[503,3961,3962],{},"class"," or a ",[503,3965,3966],{},"useClass"," provider is force-loaded automatically. A ",[503,3969,3970],{},"useValue"," value and a ",[503,3973,3132],{}," result are ",[936,3976,3977],{},"opaque",": the compiler can't see their methods, so it can't know to load them at boot.",[499,3980,3981,3982,3985,3986,3988,3989,3991],{},"Mark such a provider ",[503,3983,3984],{},"eager: true"," and Heximon treats it like any other eager-boot provider — force-constructed at ",[503,3987,2013],{},", with its ",[503,3990,3073],{}," dispatched:",[511,3993,3996],{"className":513,"code":3994,"filename":3995,"language":516,"meta":517,"style":517},"import { Context, Module } from \"@heximon\u002Fruntime\";\nimport { FeedRegistration } from \".\u002Ffeed-registration\";\nimport { ServiceRegistry } from \".\u002Fservice-registry\";\n\nexport class FeedModule extends Module({\n  providers: [\n    ServiceRegistry,\n    \u002F\u002F `FeedRegistration` is built by a factory, so its hooks are opaque — `eager: true` opts it into the\n    \u002F\u002F boot force-load + onBootstrap dispatch. The TYPE system REQUIRES the flag here (the factory result\n    \u002F\u002F implements OnBootstrap), so forgetting it is a compile error, not silently-dropped boot work.\n    {\n      provide: FeedRegistration,\n      useFactory: (context: Context, registry: ServiceRegistry) =>\n        new FeedRegistration(context, registry),\n      eager: true,\n    },\n  ],\n}) {}\n","src\u002Ffeed\u002Ffeed.module.ts",[503,3997,3998,4023,4044,4064,4068,4085,4095,4102,4107,4112,4117,4122,4133,4161,4178,4191,4196,4203],{"__ignoreMap":517},[521,3999,4000,4002,4004,4006,4008,4011,4013,4015,4017,4019,4021],{"class":523,"line":524},[521,4001,528],{"class":527},[521,4003,532],{"class":531},[521,4005,536],{"class":535},[521,4007,789],{"class":531},[521,4009,4010],{"class":535}," Module",[521,4012,539],{"class":531},[521,4014,542],{"class":527},[521,4016,545],{"class":531},[521,4018,549],{"class":548},[521,4020,552],{"class":531},[521,4022,555],{"class":531},[521,4024,4025,4027,4029,4031,4033,4035,4037,4040,4042],{"class":523,"line":558},[521,4026,528],{"class":527},[521,4028,532],{"class":531},[521,4030,2933],{"class":535},[521,4032,539],{"class":531},[521,4034,542],{"class":527},[521,4036,545],{"class":531},[521,4038,4039],{"class":548},".\u002Ffeed-registration",[521,4041,552],{"class":531},[521,4043,555],{"class":531},[521,4045,4046,4048,4050,4052,4054,4056,4058,4060,4062],{"class":523,"line":565},[521,4047,528],{"class":527},[521,4049,532],{"class":531},[521,4051,2907],{"class":535},[521,4053,539],{"class":531},[521,4055,542],{"class":527},[521,4057,545],{"class":531},[521,4059,2916],{"class":548},[521,4061,552],{"class":531},[521,4063,555],{"class":531},[521,4065,4066],{"class":523,"line":582},[521,4067,562],{"emptyLinePlaceholder":561},[521,4069,4070,4072,4074,4077,4079,4081,4083],{"class":523,"line":615},[521,4071,568],{"class":527},[521,4073,572],{"class":571},[521,4075,4076],{"class":575}," FeedModule",[521,4078,3492],{"class":571},[521,4080,4010],{"class":649},[521,4082,591],{"class":535},[521,4084,1406],{"class":531},[521,4086,4087,4090,4092],{"class":523,"line":620},[521,4088,4089],{"class":625},"  providers",[521,4091,604],{"class":531},[521,4093,4094],{"class":535}," [\n",[521,4096,4097,4100],{"class":523,"line":634},[521,4098,4099],{"class":535},"    ServiceRegistry",[521,4101,2963],{"class":531},[521,4103,4104],{"class":523,"line":671},[521,4105,4106],{"class":667},"    \u002F\u002F `FeedRegistration` is built by a factory, so its hooks are opaque — `eager: true` opts it into the\n",[521,4108,4109],{"class":523,"line":677},[521,4110,4111],{"class":667},"    \u002F\u002F boot force-load + onBootstrap dispatch. The TYPE system REQUIRES the flag here (the factory result\n",[521,4113,4114],{"class":523,"line":1300},[521,4115,4116],{"class":667},"    \u002F\u002F implements OnBootstrap), so forgetting it is a compile error, not silently-dropped boot work.\n",[521,4118,4119],{"class":523,"line":1324},[521,4120,4121],{"class":531},"    {\n",[521,4123,4124,4127,4129,4131],{"class":523,"line":1329},[521,4125,4126],{"class":625},"      provide",[521,4128,604],{"class":531},[521,4130,2933],{"class":535},[521,4132,2963],{"class":531},[521,4134,4135,4138,4140,4142,4144,4146,4148,4150,4152,4154,4156,4158],{"class":523,"line":1375},[521,4136,4137],{"class":649},"      useFactory",[521,4139,604],{"class":531},[521,4141,1381],{"class":531},[521,4143,643],{"class":600},[521,4145,604],{"class":531},[521,4147,536],{"class":575},[521,4149,789],{"class":531},[521,4151,2972],{"class":600},[521,4153,604],{"class":531},[521,4155,2907],{"class":575},[521,4157,609],{"class":531},[521,4159,4160],{"class":571}," =>\n",[521,4162,4163,4166,4168,4171,4173,4176],{"class":523,"line":1409},[521,4164,4165],{"class":531},"        new",[521,4167,2933],{"class":649},[521,4169,4170],{"class":535},"(context",[521,4172,789],{"class":531},[521,4174,4175],{"class":535}," registry)",[521,4177,2963],{"class":531},[521,4179,4180,4183,4185,4189],{"class":523,"line":1454},[521,4181,4182],{"class":625},"      eager",[521,4184,604],{"class":531},[521,4186,4188],{"class":4187},"sfNiH"," true",[521,4190,2963],{"class":531},[521,4192,4193],{"class":523,"line":1460},[521,4194,4195],{"class":531},"    },\n",[521,4197,4198,4201],{"class":523,"line":1492},[521,4199,4200],{"class":535},"  ]",[521,4202,2963],{"class":531},[521,4204,4205,4207,4209],{"class":523,"line":1546},[521,4206,1531],{"class":531},[521,4208,1403],{"class":535},[521,4210,4211],{"class":531},"{}\n",[499,4213,4214,4216,4217,824,4219,4221,4222,4224,4225,4228,4229,4232],{},[503,4215,3984],{}," is the explicit opposite of a lazy provider — use it on any ",[503,4218,3970],{},[503,4220,3132],{}," you want constructed at boot. When the produced value implements ",[503,4223,2855],{},", the flag is ",[936,4226,4227],{},"mandatory"," (a ",[503,4230,4231],{},"Module(...)"," config error names the offending entry otherwise), so eager-boot work can never be silently lost to a missing flag.",[499,4234,3402,4235,824,4237,4239,4240,1091,4242,4245,4246,4248],{},[503,4236,3970],{},[503,4238,3132],{}," provider also runs ",[503,4241,2817],{},[503,4243,4244],{},"onShutdown"," if its value declares them (duck-typed at runtime) — so a ",[503,4247,3132],{},"-built pool is torn down on shutdown without any flag.",[3951,4250,4252],{"id":4251},"boot-is-two-phase","Boot is two-phase",[499,4254,4255,4256,4259,4260,4262,4263,4265,4266,4268,4269,4271,4272,1073,4274,4276],{},"Boot is ",[936,4257,4258],{},"two-phase",". Phase 1 constructs each loaded module's providers and runs their ",[503,4261,2817],{}," — including the module instance's own — at module load. Phase 2 then runs every collected ",[503,4264,3073],{},", once, in registration order, still inside ",[503,4267,2013],{},", only after ",[936,4270,3321],{}," force-loaded module has loaded and ",[936,4273,3321],{},[503,4275,2817],{}," has completed.",[499,4278,4279,4280,4282,4283,4285,4286,4288],{},"So an ",[503,4281,3073],{}," hook can rely on all ",[503,4284,2817],{},"-established state across the whole app — a boot DDL in a database module's ",[503,4287,2817],{}," is guaranteed to finish before an outbox relay's crash-recovery drain reads the table, even when the DDL is asynchronous and lives in a different module.",[3951,4290,4292],{"id":4291},"background-vs-waituntil-per-host","Background vs waitUntil per host",[499,4294,4295,4297,4298,4301,4302,4305,4306,4309,4310,4312],{},[503,4296,1079],{}," means ",[691,4299,4300],{},"\"this must finish before the frame is done\""," — it ",[936,4303,4304],{},"blocks"," at frame teardown when there\nis no sink, and ",[936,4307,4308],{},"throws"," if there is no active frame. ",[503,4311,1886],{}," never blocks and never throws, but\nexactly what \"runs in the background\" means depends on the host:",[3269,4314,4315,4327],{},[3272,4316,4317],{},[3275,4318,4319,4322],{},[3278,4320,4321],{},"Where it runs",[3278,4323,4324],{},[503,4325,4326],{},"background(p)",[3289,4328,4329,4340,4352,4360],{},[3275,4330,4331,4337],{},[3294,4332,4333,4334,4336],{},"Cloudflare \u002F edge (has a ",[503,4335,1079],{}," sink)",[3294,4338,4339],{},"hands to the sink — kept alive past the response",[3275,4341,4342,4349],{},[3294,4343,4344,4345,4348],{},"Vercel \u002F Netlify \u002F Lambda ",[936,4346,4347],{},"function"," (no sink, freezes between invocations)",[3294,4350,4351],{},"awaited at frame teardown — completes before the function freezes",[3275,4353,4354,4357],{},[3294,4355,4356],{},"Node \u002F Bun \u002F Deno (long-lived)",[3294,4358,4359],{},"detached — fire-and-forget, never blocks the frame",[3275,4361,4362,4365],{},[3294,4363,4364],{},"no active frame (boot, a cron tick)",[3294,4366,4367],{},"detached — never throws",[499,4369,4370,4371,2838,4374,4377,4378,4380],{},"A bare ",[503,4372,4373],{},"void somePromise",[936,4375,4376],{},"severed"," on a freezing\u002Fevicting host when the response returns — ",[503,4379,1886],{},"\nis what makes detached work edge-safe. Failures are logged, never rethrown.",[3951,4382,4384],{"id":4383},"selecting-a-real-dependency-vs-a-dev-stand-in","Selecting a real dependency vs a dev stand-in",[499,4386,4387,4388,4391,4392,4395,4396,4399,4400,4403],{},"A factory often has to choose between a ",[936,4389,4390],{},"real"," platform dependency (a hosted queue, a remote database) and\nan in-process ",[936,4393,4394],{},"stand-in"," that lets ",[503,4397,4398],{},"vp dev"," and tests run without the platform. Select on ",[936,4401,4402],{},"what is\nconfigured",", not on which platform you're running:",[511,4405,4408],{"className":513,"code":4406,"filename":4407,"language":516,"meta":517,"style":517},"{\n  \u002F\u002F A real deploy delivers each drained outbox row DURABLY through the platform's own Vercel Queue; dev \u002F CI\n  \u002F\u002F keep the in-process transport — no platform. Both branches share the same TURSO_DATABASE_URL signal the\n  \u002F\u002F database connection reads. `Platform.get` is the portable env accessor.\n  provide: OutboxRelay,\n  useFactory: (store: OutboxStore, memoryTarget: MemoryIntegrationEventTransport, context: Context): OutboxRelay =>\n    new OutboxRelay(\n      store,\n      Platform.get(\"TURSO_DATABASE_URL\") !== undefined\n        ? new VercelQueueIntegrationEventTransport()\n        : memoryTarget,\n      context,\n    ),\n  eager: true,\n}\n","database.module.ts",[503,4409,4410,4414,4419,4424,4429,4441,4482,4491,4498,4524,4537,4546,4553,4560,4571],{"__ignoreMap":517},[521,4411,4412],{"class":523,"line":524},[521,4413,1406],{"class":531},[521,4415,4416],{"class":523,"line":558},[521,4417,4418],{"class":667},"  \u002F\u002F A real deploy delivers each drained outbox row DURABLY through the platform's own Vercel Queue; dev \u002F CI\n",[521,4420,4421],{"class":523,"line":565},[521,4422,4423],{"class":667},"  \u002F\u002F keep the in-process transport — no platform. Both branches share the same TURSO_DATABASE_URL signal the\n",[521,4425,4426],{"class":523,"line":582},[521,4427,4428],{"class":667},"  \u002F\u002F database connection reads. `Platform.get` is the portable env accessor.\n",[521,4430,4431,4434,4436,4439],{"class":523,"line":615},[521,4432,4433],{"class":575},"  provide",[521,4435,604],{"class":531},[521,4437,4438],{"class":535}," OutboxRelay",[521,4440,2963],{"class":531},[521,4442,4443,4446,4448,4450,4453,4455,4458,4460,4463,4465,4468,4470,4472,4474,4476,4478,4480],{"class":523,"line":620},[521,4444,4445],{"class":575},"  useFactory",[521,4447,604],{"class":531},[521,4449,1381],{"class":531},[521,4451,4452],{"class":600},"store",[521,4454,604],{"class":531},[521,4456,4457],{"class":575}," OutboxStore",[521,4459,789],{"class":531},[521,4461,4462],{"class":600}," memoryTarget",[521,4464,604],{"class":531},[521,4466,4467],{"class":575}," MemoryIntegrationEventTransport",[521,4469,789],{"class":531},[521,4471,601],{"class":600},[521,4473,604],{"class":531},[521,4475,536],{"class":575},[521,4477,2472],{"class":531},[521,4479,4438],{"class":575},[521,4481,4160],{"class":571},[521,4483,4484,4487,4489],{"class":523,"line":634},[521,4485,4486],{"class":531},"    new",[521,4488,4438],{"class":649},[521,4490,1709],{"class":625},[521,4492,4493,4496],{"class":523,"line":671},[521,4494,4495],{"class":535},"      store",[521,4497,2963],{"class":531},[521,4499,4500,4503,4505,4507,4509,4511,4514,4516,4518,4521],{"class":523,"line":677},[521,4501,4502],{"class":535},"      Platform",[521,4504,646],{"class":531},[521,4506,650],{"class":649},[521,4508,591],{"class":625},[521,4510,552],{"class":531},[521,4512,4513],{"class":548},"TURSO_DATABASE_URL",[521,4515,552],{"class":531},[521,4517,1403],{"class":625},[521,4519,4520],{"class":531},"!==",[521,4522,4523],{"class":531}," undefined\n",[521,4525,4526,4529,4531,4534],{"class":523,"line":1300},[521,4527,4528],{"class":531},"        ?",[521,4530,2103],{"class":531},[521,4532,4533],{"class":649}," VercelQueueIntegrationEventTransport",[521,4535,4536],{"class":625},"()\n",[521,4538,4539,4542,4544],{"class":523,"line":1324},[521,4540,4541],{"class":531},"        :",[521,4543,4462],{"class":535},[521,4545,2963],{"class":531},[521,4547,4548,4551],{"class":523,"line":1329},[521,4549,4550],{"class":535},"      context",[521,4552,2963],{"class":531},[521,4554,4555,4558],{"class":523,"line":1375},[521,4556,4557],{"class":625},"    )",[521,4559,2963],{"class":531},[521,4561,4562,4565,4567,4569],{"class":523,"line":1409},[521,4563,4564],{"class":575},"  eager",[521,4566,604],{"class":531},[521,4568,4188],{"class":4187},[521,4570,2963],{"class":531},[521,4572,4573],{"class":523,"line":1454},[521,4574,680],{"class":531},[499,4576,4577,4580,4581,4584,4585,4580,4588,4591],{},[503,4578,4579],{},"Platform.get(\"KEY\") !== undefined"," asks ",[691,4582,4583],{},"is this dependency configured?"," — the question that actually\ndecides which branch runs. ",[503,4586,4587],{},"Platform.isVercel()",[691,4589,4590],{},"what platform am I on?"," instead, which fails on two\nfronts.",[499,4593,4594,4596,4597,2838,4600,4603],{},[503,4595,4398],{}," actually runs the Node preset (",[503,4598,4599],{},"Platform.current()",[503,4601,4602],{},"\"node\""," in dev, never a synthesized\nidentity), so an identity check would force you to fake identity just to reach the real branch; and a\nmisconfigured deploy still takes the \"real\" branch and throws where the misconfiguration actually is,\ninstead of silently falling back to a stand-in.",[499,4605,4606,4608,4609,4611,4612,4615,4616,4619,4620,4627,4628,646],{},[503,4607,4599],{}," \u002F ",[503,4610,4587],{}," stay correct for accurate ",[691,4613,4614],{},"reporting"," (logs, traces) — just not\nfor ",[691,4617,4618],{},"dependency availability",". The flagship's ",[712,4621,4624],{"href":4622,"rel":4623},"https:\u002F\u002Fgithub.com\u002Fheximon\u002Fheximon\u002Ftree\u002Fmain\u002Fexamples\u002Fflagship\u002Fapps\u002Fvercel",[1115],[503,4625,4626],{},"apps\u002Fvercel","\nwires its database connection and outbox relay terminal this way, both keyed on ",[503,4629,4513],{},[696,4631,4633],{"id":4632},"see-also","See also",[4635,4636,4637,4646,4655,4662,4673,4692],"ul",{},[907,4638,4639,4642,4643,4645],{},[712,4640,4641],{"href":54},"Providers & DI"," — provider forms and the abstract-class token convention ",[503,4644,650],{}," resolves against.",[907,4647,4648,4650,4651,4654],{},[712,4649,106],{"href":107}," — error filters receive the ",[503,4652,4653],{},"Request"," that triggered the error,\nso they can map a domain failure to the right problem+json.",[907,4656,4657,4659,4660,646],{},[712,4658,92],{"href":93}," — the production alternative to creating tables in ",[503,4661,2817],{},[907,4663,4664,4669,4670,4672],{},[712,4665,4668],{"href":4666,"rel":4667},"https:\u002F\u002Fgithub.com\u002Fheximon\u002Fheximon\u002Ftree\u002Fmain\u002Fexamples\u002Fladder\u002FL04-database",[1115],"the ladder's L04 — Database"," — a repository that creates its table in ",[503,4671,2817],{},", plus an end-to-end test that boots the compiled app and drives its CRUD routes.",[907,4674,4675,4680,4681,4684,4685,4688,4689,4691],{},[712,4676,4679],{"href":4677,"rel":4678},"https:\u002F\u002Fgithub.com\u002Fheximon\u002Fheximon\u002Ftree\u002Fmain\u002Fexamples\u002Fladder\u002FL06-ddd",[1115],"the ladder's L06 — DDD"," — ",[503,4682,4683],{},"MigrateTask"," applied automatically from ",[503,4686,4687],{},"DatabaseModule","'s ",[503,4690,2817],{},", plus a test that proves a manual re-run is a no-op.",[907,4693,4694,4698],{},[712,4695,4697],{"href":1113,"rel":4696},[1115],"the ladder's L07 — Auth","\n— middleware that authenticates a request once and stores the principal, a handler that reads it back\nscope-by-scope, and an end-to-end test that proves the 401\u002F403 split.",[4700,4701,4702],"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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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 .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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}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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":517,"searchDepth":558,"depth":558,"links":4704},[4705,4706,4707,4708,4709,4710,4711,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4728],{"id":698,"depth":558,"text":699},{"id":718,"depth":558,"text":719},{"id":893,"depth":558,"text":894},{"id":1106,"depth":558,"text":1107},{"id":1615,"depth":558,"text":715},{"id":1808,"depth":558,"text":1809},{"id":1934,"depth":558,"text":1935},{"id":2006,"depth":558,"text":2007},{"id":2243,"depth":558,"text":2244},{"id":2332,"depth":558,"text":2333},{"id":2571,"depth":558,"text":2572},{"id":2832,"depth":558,"text":2833},{"id":3146,"depth":558,"text":3147},{"id":3342,"depth":558,"text":3343},{"id":3398,"depth":558,"text":3399},{"id":3762,"depth":558,"text":3763},{"id":3824,"depth":558,"text":3825},{"id":3948,"depth":558,"text":3949,"children":4723},[4724,4725,4726,4727],{"id":3953,"depth":565,"text":3124},{"id":4251,"depth":565,"text":4252},{"id":4291,"depth":565,"text":4292},{"id":4383,"depth":565,"text":4384},{"id":4632,"depth":558,"text":4633},"Request-scoped data with Context and the augmentable ContextData, deferred work via waitUntil and background, plus the OnInit, OnBootstrap, and OnShutdown lifecycle hooks, createApp, get, preload, and graceful shutdown with drain.","md",null,{},{"icon":129},{"title":126,"description":4729},"hcl9orTxigu8SSpYro7QItsN77pGsWANfb6Ma__H5AI",[4737,4739],{"title":121,"path":122,"stem":123,"description":4738,"icon":124,"children":-1},"Logger, child fields, Logger.configure, LoggerReporter pretty and json, log levels, HEXIMON_DEBUG, shipping logs to drains, opt-in wide events, and the startup summary lines.",{"title":131,"path":132,"stem":133,"description":4740,"icon":134,"children":-1},"The recommended directory layout for a Heximon app — one folder per feature module, the three config files, naming conventions, and the generated boot entry.",1783300761903]