theokit 0.77.1 → 0.77.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/dist/{actions-virtual-module-UIX5YWZR.js → actions-virtual-module-CA4YEAL3.js} +3 -3
- package/dist/{actions-virtual-module-V5Q4XVL5.js → actions-virtual-module-QRTV4NHS.js} +2 -2
- package/dist/{agent-MJWQRSJ2.js → agent-IBDE65UJ.js} +2 -2
- package/dist/{app-typed-client-6FQB5FQO.js → app-typed-client-ZCLFXBEC.js} +3 -3
- package/dist/{app-typed-client-JCBQGPMP.js → app-typed-client-ZCMCBS45.js} +2 -2
- package/dist/{aws-lambda-XT7ZDJ6B.js → aws-lambda-JXUPC5QM.js} +17 -6
- package/dist/aws-lambda-JXUPC5QM.js.map +1 -0
- package/dist/boot/index.js +3 -3
- package/dist/{build-Y457R5HE.js → build-2VOQOWZE.js} +7 -7
- package/dist/{bun-PJLDELDT.js → bun-73JZLCKU.js} +16 -5
- package/dist/bun-73JZLCKU.js.map +1 -0
- package/dist/{chunk-35OI2TKT.js → chunk-5UJRZC4J.js} +37 -19
- package/dist/chunk-5UJRZC4J.js.map +1 -0
- package/dist/{chunk-EQJF2EH5.js → chunk-DDWF3UUI.js} +32 -1
- package/dist/chunk-DDWF3UUI.js.map +1 -0
- package/dist/{chunk-OSSNCUS6.js → chunk-FCBRWSBH.js} +4 -4
- package/dist/{chunk-BFDEEJOK.js → chunk-GNQKV2NP.js} +1 -1
- package/dist/{chunk-BFDEEJOK.js.map → chunk-GNQKV2NP.js.map} +1 -1
- package/dist/{chunk-KQBY62AE.js → chunk-HWRZUQPE.js} +31 -25
- package/dist/chunk-HWRZUQPE.js.map +1 -0
- package/dist/{chunk-OKFRGAYZ.js → chunk-IBZITTK7.js} +47 -27
- package/dist/chunk-IBZITTK7.js.map +1 -0
- package/dist/{chunk-3TCWOHLY.js → chunk-JZLNZOEL.js} +1 -1
- package/dist/{chunk-G3DDIEYE.js → chunk-MQCXYZEV.js} +4 -2
- package/dist/chunk-MQCXYZEV.js.map +1 -0
- package/dist/{chunk-E22GPCCO.js → chunk-MSSUMKFR.js} +61 -55
- package/dist/chunk-MSSUMKFR.js.map +1 -0
- package/dist/{chunk-XLFDYTWO.js → chunk-N7KDDYDB.js} +5 -3
- package/dist/chunk-N7KDDYDB.js.map +1 -0
- package/dist/{chunk-TODO6J42.js → chunk-PV6IO25S.js} +1 -1
- package/dist/chunk-PV6IO25S.js.map +1 -0
- package/dist/{chunk-N5YHENWJ.js → chunk-SHBPXX5E.js} +2 -2
- package/dist/{chunk-HZAXFD55.js → chunk-VSK5Y4ET.js} +2 -2
- package/dist/{chunk-GNV34JMI.js → chunk-XCPM72D6.js} +2 -2
- package/dist/{chunk-HNALEGOL.js → chunk-YM6ONZYE.js} +12 -10
- package/dist/chunk-YM6ONZYE.js.map +1 -0
- package/dist/cli/index.js +12 -12
- package/dist/{cloudflare-F7KLBOU4.js → cloudflare-6ONK5HCO.js} +11 -3
- package/dist/cloudflare-6ONK5HCO.js.map +1 -0
- package/dist/{config-support-2TER2BYD.js → config-support-ZJIRVUWZ.js} +10 -5
- package/dist/config-support-ZJIRVUWZ.js.map +1 -0
- package/dist/{db-5WOK6HA2.js → db-72T47G5S.js} +2 -2
- package/dist/{deno-deploy-LJ5JQQVR.js → deno-deploy-ZM2UR5ZI.js} +16 -5
- package/dist/deno-deploy-ZM2UR5ZI.js.map +1 -0
- package/dist/{dev-N5LQFLBR.js → dev-AE7EWSB7.js} +6 -6
- package/dist/{docker-OTV3M54A.js → docker-3ARABEZ2.js} +2 -2
- package/dist/{generate-4DY3MEYB.js → generate-DAVXE5RV.js} +2 -2
- package/dist/{index-C2lcEI-4.d.ts → index-CY_llLI7.d.ts} +4 -1
- package/dist/index.js +4 -4
- package/dist/{info-ELSPSCXK.js → info-AYTNH6YT.js} +2 -2
- package/dist/{internal-api-H3C2ID6N.js → internal-api-JFA4JI3Z.js} +3 -3
- package/dist/{internal-api-5FTPYSEQ.js → internal-api-KQQHFTCG.js} +2 -2
- package/dist/{load-config-SKLFH7YL.js → load-config-YU5E76DL.js} +2 -2
- package/dist/{mcp-3ENI2IPS.js → mcp-UBGNYDMW.js} +3 -3
- package/dist/{netlify-ZPQNREFH.js → netlify-GRVT3MTT.js} +53 -10
- package/dist/netlify-GRVT3MTT.js.map +1 -0
- package/dist/{node-3EV3CVWB.js → node-UYRQNJNF.js} +2 -2
- package/dist/{openapi-OVXYHZ2S.js → openapi-ICJB2RBE.js} +2 -2
- package/dist/{preview-Y3JNYOFK.js → preview-XQJZ75QE.js} +3 -3
- package/dist/registry-JHWY7JRY.js +34 -0
- package/dist/{routes-UNJ77IQU.js → routes-XYXXR72Z.js} +2 -2
- package/dist/server/define/index.d.ts +7 -2
- package/dist/server/define/index.js +1 -1
- package/dist/server/http/index.d.ts +2 -1
- package/dist/server/http/index.js +8 -2
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +10 -10
- package/dist/{server-boundary-5ZTBC2KF.js → server-boundary-JA3UOKJS.js} +2 -2
- package/dist/{server-boundary-DTF6ZEUO.js → server-boundary-OJ6YIPQT.js} +3 -3
- package/dist/{start-EJFYT7ZU.js → start-AE5YCDVS.js} +7 -6
- package/dist/{start-EJFYT7ZU.js.map → start-AE5YCDVS.js.map} +1 -1
- package/dist/{static-VNN4HYRN.js → static-C7PWUTQO.js} +2 -2
- package/dist/{theo-cloud-243SPOIA.js → theo-cloud-NKZUJO3H.js} +2 -2
- package/dist/{vercel-EXKSZ2OQ.js → vercel-MRZXLOIQ.js} +19 -5
- package/dist/vercel-MRZXLOIQ.js.map +1 -0
- package/dist/vite-plugin/index.js +4 -4
- package/dist/{vite-plugin-MNZHNOM4.js → vite-plugin-JMWUVMP3.js} +5 -5
- package/package.json +3 -3
- package/dist/aws-lambda-XT7ZDJ6B.js.map +0 -1
- package/dist/bun-PJLDELDT.js.map +0 -1
- package/dist/chunk-35OI2TKT.js.map +0 -1
- package/dist/chunk-E22GPCCO.js.map +0 -1
- package/dist/chunk-EQJF2EH5.js.map +0 -1
- package/dist/chunk-G3DDIEYE.js.map +0 -1
- package/dist/chunk-HNALEGOL.js.map +0 -1
- package/dist/chunk-KQBY62AE.js.map +0 -1
- package/dist/chunk-OKFRGAYZ.js.map +0 -1
- package/dist/chunk-TODO6J42.js.map +0 -1
- package/dist/chunk-XLFDYTWO.js.map +0 -1
- package/dist/cloudflare-F7KLBOU4.js.map +0 -1
- package/dist/config-support-2TER2BYD.js.map +0 -1
- package/dist/deno-deploy-LJ5JQQVR.js.map +0 -1
- package/dist/netlify-ZPQNREFH.js.map +0 -1
- package/dist/registry-3D2KR7UE.js +0 -34
- package/dist/vercel-EXKSZ2OQ.js.map +0 -1
- /package/dist/{actions-virtual-module-UIX5YWZR.js.map → actions-virtual-module-CA4YEAL3.js.map} +0 -0
- /package/dist/{actions-virtual-module-V5Q4XVL5.js.map → actions-virtual-module-QRTV4NHS.js.map} +0 -0
- /package/dist/{agent-MJWQRSJ2.js.map → agent-IBDE65UJ.js.map} +0 -0
- /package/dist/{app-typed-client-6FQB5FQO.js.map → app-typed-client-ZCLFXBEC.js.map} +0 -0
- /package/dist/{app-typed-client-JCBQGPMP.js.map → app-typed-client-ZCMCBS45.js.map} +0 -0
- /package/dist/{build-Y457R5HE.js.map → build-2VOQOWZE.js.map} +0 -0
- /package/dist/{chunk-OSSNCUS6.js.map → chunk-FCBRWSBH.js.map} +0 -0
- /package/dist/{chunk-3TCWOHLY.js.map → chunk-JZLNZOEL.js.map} +0 -0
- /package/dist/{chunk-N5YHENWJ.js.map → chunk-SHBPXX5E.js.map} +0 -0
- /package/dist/{chunk-HZAXFD55.js.map → chunk-VSK5Y4ET.js.map} +0 -0
- /package/dist/{chunk-GNV34JMI.js.map → chunk-XCPM72D6.js.map} +0 -0
- /package/dist/{db-5WOK6HA2.js.map → db-72T47G5S.js.map} +0 -0
- /package/dist/{dev-N5LQFLBR.js.map → dev-AE7EWSB7.js.map} +0 -0
- /package/dist/{docker-OTV3M54A.js.map → docker-3ARABEZ2.js.map} +0 -0
- /package/dist/{generate-4DY3MEYB.js.map → generate-DAVXE5RV.js.map} +0 -0
- /package/dist/{info-ELSPSCXK.js.map → info-AYTNH6YT.js.map} +0 -0
- /package/dist/{internal-api-H3C2ID6N.js.map → internal-api-JFA4JI3Z.js.map} +0 -0
- /package/dist/{internal-api-5FTPYSEQ.js.map → internal-api-KQQHFTCG.js.map} +0 -0
- /package/dist/{load-config-SKLFH7YL.js.map → load-config-YU5E76DL.js.map} +0 -0
- /package/dist/{mcp-3ENI2IPS.js.map → mcp-UBGNYDMW.js.map} +0 -0
- /package/dist/{node-3EV3CVWB.js.map → node-UYRQNJNF.js.map} +0 -0
- /package/dist/{openapi-OVXYHZ2S.js.map → openapi-ICJB2RBE.js.map} +0 -0
- /package/dist/{preview-Y3JNYOFK.js.map → preview-XQJZ75QE.js.map} +0 -0
- /package/dist/{registry-3D2KR7UE.js.map → registry-JHWY7JRY.js.map} +0 -0
- /package/dist/{routes-UNJ77IQU.js.map → routes-XYXXR72Z.js.map} +0 -0
- /package/dist/{server-boundary-5ZTBC2KF.js.map → server-boundary-JA3UOKJS.js.map} +0 -0
- /package/dist/{server-boundary-DTF6ZEUO.js.map → server-boundary-OJ6YIPQT.js.map} +0 -0
- /package/dist/{static-VNN4HYRN.js.map → static-C7PWUTQO.js.map} +0 -0
- /package/dist/{theo-cloud-243SPOIA.js.map → theo-cloud-NKZUJO3H.js.map} +0 -0
- /package/dist/{vite-plugin-MNZHNOM4.js.map → vite-plugin-JMWUVMP3.js.map} +0 -0
|
@@ -4,17 +4,19 @@ import {
|
|
|
4
4
|
deployedCorsFragment,
|
|
5
5
|
deployedCsrfFragment,
|
|
6
6
|
securityHeadersDeclarations
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DDWF3UUI.js";
|
|
8
8
|
|
|
9
9
|
// src/adapters/deployed-preamble.ts
|
|
10
|
-
function deployedEntryPreamble(runtimeConfig, agentsFragment, opts, host) {
|
|
10
|
+
function deployedEntryPreamble(runtimeConfig, agentsFragment, opts, host, reservedRoutes) {
|
|
11
11
|
return [
|
|
12
12
|
...securityHeadersDeclarations(opts.securityHeaders),
|
|
13
13
|
``,
|
|
14
14
|
...runtimeConfig.imports,
|
|
15
15
|
...agentsFragment.imports,
|
|
16
|
+
...reservedRoutes.imports,
|
|
16
17
|
...runtimeConfig.declarations,
|
|
17
18
|
...agentsFragment.declarations,
|
|
19
|
+
...reservedRoutes.declarations,
|
|
18
20
|
...deployedCsrfFragment(opts),
|
|
19
21
|
``,
|
|
20
22
|
...deployedCorsFragment(opts.cors, host)
|
|
@@ -24,4 +26,4 @@ function deployedEntryPreamble(runtimeConfig, agentsFragment, opts, host) {
|
|
|
24
26
|
export {
|
|
25
27
|
deployedEntryPreamble
|
|
26
28
|
};
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-N7KDDYDB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/adapters/deployed-preamble.ts"],"sourcesContent":["import type { SecurityHeadersConfig } from '../core/contracts/security-headers.js'\n\nimport type { DeployedAgentsFragment } from './deployed-agents.js'\nimport { deployedCorsFragment, type DeployedCorsOptions } from './deployed-cors.js'\nimport { deployedCsrfFragment, type DeployedCsrfOptions } from './deployed-csrf.js'\nimport type { DeployedReservedRoutesFragment } from './deployed-reserved-routes.js'\nimport { securityHeadersDeclarations } from './security-headers.js'\n\n/**\n * The module-level preamble five deploy entries emit, in the order they emit it.\n *\n * `bun`, `deno-deploy`, `vercel`, `netlify` and `aws-lambda` wrote these nine lines identically —\n * blank lines included — with one string different between them: the host name the CORS fragment\n * is told. Verified by matching the exact text, not by reading: the template below was searched\n * for in all six adapters and found in five.\n *\n * ## Why this was extracted, and what the alternative was\n *\n * SonarCloud's duplication gate is a REQUIRED check on `develop`, and it failed a promotion PR at\n * 4.2% on new code against a 3% ceiling. Three smaller extractions — the scan source, the security\n * declarations, the entry-options type — took it to 3.9% and stopped helping, because each one\n * ADDS an identical call site and an identical import to every caller. Measured on that PR: of 226\n * added lines under `src/`, 26 repeated, and every one of them was an import or a call.\n *\n * That is the metric describing the shape of extraction rather than a defect, and it is why the\n * answer had to be one bigger seam rather than a fourth small one. This collapses nine repeated\n * lines into one call in five files.\n *\n * Raising the threshold was never on the list: `rules/autonomy-envelope.md` floor 3 forbids moving\n * a bound to pass it, and a duplication gate whose ceiling rises stops reporting duplication.\n *\n * ## Why `cloudflare` is not a caller\n *\n * Its order is genuinely different — security declarations, then CSRF, then the runtime and agents\n * declarations, then CORS — and its CSRF fragment takes a second argument (`'a Worker'`) that no\n * other host passes. Forcing it through here would need a flag per difference, which turns this\n * function into a switch over its callers: the shape that drifts, and the one\n * `serveThroughPluginLifecycle` was extracted to undo after five copies had (#405).\n *\n * A Worker being the odd one is not an accident. It has no filesystem, so it bakes what the others\n * scan, and that changes what has to be declared before what.\n */\nexport function deployedEntryPreamble(\n runtimeConfig: { imports: string[]; declarations: string[] },\n agentsFragment: DeployedAgentsFragment,\n opts: { securityHeaders?: SecurityHeadersConfig } & DeployedCsrfOptions & DeployedCorsOptions,\n host: string,\n reservedRoutes: DeployedReservedRoutesFragment,\n): string[] {\n return [\n ...securityHeadersDeclarations(opts.securityHeaders),\n ``,\n ...runtimeConfig.imports,\n ...agentsFragment.imports,\n ...reservedRoutes.imports,\n ...runtimeConfig.declarations,\n ...agentsFragment.declarations,\n ...reservedRoutes.declarations,\n ...deployedCsrfFragment(opts),\n ``,\n ...deployedCorsFragment(opts.cors, host),\n ]\n}\n"],"mappings":";;;;;;;;;AA0CO,SAAS,sBACd,eACA,gBACA,MACA,MACA,gBACU;AACV,SAAO;AAAA,IACL,GAAG,4BAA4B,KAAK,eAAe;AAAA,IACnD;AAAA,IACA,GAAG,cAAc;AAAA,IACjB,GAAG,eAAe;AAAA,IAClB,GAAG,eAAe;AAAA,IAClB,GAAG,cAAc;AAAA,IACjB,GAAG,eAAe;AAAA,IAClB,GAAG,eAAe;AAAA,IAClB,GAAG,qBAAqB,IAAI;AAAA,IAC5B;AAAA,IACA,GAAG,qBAAqB,KAAK,MAAM,IAAI;AAAA,EACzC;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/adapters/types.ts"],"sourcesContent":["import type { Plugin } from 'vite'\n\nimport type { TheoConfig } from '../config/schema.js'\nimport type { SecurityHeadersConfig } from '../core/contracts/security-headers.js'\n\nimport type { DeployedAgent } from './deployed-agents.js'\nimport type { DeployedCorsOptions } from './deployed-cors.js'\nimport type { DeployedCsrfOptions } from './deployed-csrf.js'\nimport type { DeployedRateLimitOptions } from './deployed-rate-limit.js'\nimport type { DeployedReservedRoutesOptions } from './deployed-reserved-routes.js'\nimport type {\n DeployedAgentsDirOptions,\n DeployedRuntimeConfigOptions,\n DeployedServerDirOptions,\n} from './deployed-runtime-config.js'\n\n/**\n * Everything a filesystem deploy entry accepts.\n *\n * `vercel`, `aws-lambda` and `deno-deploy` declared this same six-member intersection, character\n * for character. Extracted after SonarCloud's duplication gate named it among the repeated blocks\n * on a pull request — the gate measuring something real, because a member added to the set had to\n * be added in three places or the targets would silently disagree about what they accept.\n *\n * `netlify` is deliberately NOT a user: it resolves `serverDir` as a literal `resolve(cwd, 'server')`\n * rather than from configuration, so it carries no `DeployedServerDirOptions`. Widening this type to\n * cover it would let netlify accept a `serverDir` it then ignores, which is the accepted-and-ignored\n * failure this framework refuses elsewhere. That netlify cannot take one is a separate gap, not a\n * reason to lie about the type.\n */\nexport type DeployedEntryOptions = {\n securityHeaders?: SecurityHeadersConfig\n} & DeployedAgentsDirOptions &\n DeployedCsrfOptions &\n DeployedRuntimeConfigOptions &\n DeployedServerDirOptions &\n DeployedCorsOptions &\n DeployedRateLimitOptions &\n DeployedReservedRoutesOptions\n\n/**\n * Build context injected by the CLI into adapter.build.\n *\n * - `makeVitePlugins` — optional factory provided by CLI for adapters\n * that drive `viteBuild()` directly (currently: `nodeAdapter`).\n * When omitted, adapters that need Vite must fail with an actionable\n * error. This inverts the previous direct edge `adapters → vite-plugin`\n * per ADR-0001 v3 (T1.1 of the architecture-cleanup plan).\n *\n * The factory MAY return a Promise — `theokit build` uses\n * `theoPluginAsync` to wire the full Plugin[] chain (actions virtual\n * module + typed client + services + @theokit/ui auto-chain) so adapters\n * MUST `await` the result. See `cli/commands/build.ts` for the canonical\n * invocation.\n */\n/** One server route, flattened to what an adapter can bake into an emitted entry (#369). */\nexport interface AdapterRoute {\n /** Path relative to the project root — both the import specifier and the executor's lookup key. */\n filePath: string\n routePath: string\n methods: readonly string[]\n}\n\nexport interface AdapterBuildContext {\n /**\n * `ssrStreaming` is here because the flag decides WHICH server entry the plugin emits, and\n * without a field for it no caller could pass one. `vite-plugin/index.ts` reads\n * `options.ssrStreaming === true`, so an absent field evaluated `undefined === true` forever:\n * a project declaring `ssrStreaming: true` got the buffering entry, its server found no\n * streaming renderer to call, and every response was the fully buffered document. Measured\n * 2026-09-24 on a released build — TTFB tracked the slowest Suspense boundary (60ms delay ->\n * 73ms, 800ms -> 815ms) with a single socket arrival. Same shape as `#95`, which added the\n * three directories to this object for the same reason.\n */\n makeVitePlugins?: (opts: {\n root: string\n ssr?: boolean\n ssrStreaming?: boolean\n }) => Plugin[] | Promise<Plugin[]>\n /**\n * Scan the project's routes, INJECTED for the same reason `makeVitePlugins` is (#369).\n *\n * A Worker has no filesystem, so the Cloudflare entry has to bake its routes at build time\n * instead of scanning for them at request time. Importing the scanner here would put an\n * `adapters → server` edge in the graph — the layering inversion ADR-0001 v3 removed for\n * `vite-plugin`, and the one `adapters-may-only-depend-on-core-router-services` refuses. The CLI\n * already imports both sides, so it composes this and passes it in.\n */\n scanRoutes?: (serverDir: string) => {\n routes: AdapterRoute[]\n wsRoutes: string[]\n /**\n * The app's agents (#367). A different scan from the routes, served by a different function —\n * which is precisely why no adapter had ever heard of them and every deployed\n * `/api/agents/<name>` was a 404.\n */\n agents?: DeployedAgent[]\n /**\n * B-185 — the app's `server/context.ts`, project-relative, or `undefined` when it has none.\n *\n * A Worker has no filesystem on which to find it at request time, so a target that bakes its\n * agents bakes this too (ADR 0014) and hands the factory to the subject resolver. Decided HERE,\n * beside the agents, because this provider is the only place that holds `serverDir` — the same\n * inversion argument the `agents` field above records for #367.\n */\n contextModule?: string\n }\n}\n\n/**\n * A configuration key that a request handler applies at runtime. Build-time\n * keys are deliberately absent: a runtime cannot silently drop them.\n */\nexport type ConfigConcern =\n | 'rateLimit'\n | 'cors'\n | 'csrf'\n | 'disallowed'\n | 'serialization'\n | 'plugins'\n | 'securityHeaders'\n | 'jobs'\n | 'ready'\n\nexport interface DeployAdapter {\n name: string\n /**\n * #382 — does the handler this adapter emits hand its runtime a response\n * whose body is still being written?\n *\n * The claim is deliberately narrow, and it is the only part we can verify\n * without a real deployment: `true` means the emitted contract carries a\n * live body (a `Response` over a `ReadableStream`, or a chunk-by-chunk drain\n * into the runtime's own writable) rather than a fully materialized string\n * or buffer. It does NOT claim the platform was observed flushing early —\n * that needs a deploy, and none of these targets has one in CI.\n *\n * Omitted means no, on purpose: a new adapter should have to state that it\n * streams, because the failure mode of the opposite default is a target\n * silently listed for something nobody exercised.\n *\n * `aws-lambda` is the one target that answers no by construction — its v2\n * result object carries `body` as a string, so the response cannot exist\n * before the run ends. Making it stream means `awslambda.streamifyResponse`\n * plus a Function URL in `RESPONSE_STREAM` invoke mode, which this adapter\n * does not emit and which would break every API Gateway deployment of it.\n */\n streamsResponses?: boolean\n /**\n * Which configuration keys the handler this adapter emits actually applies.\n *\n * Same contract as `streamsResponses`, for the same reason: omitted means\n * **none**, on purpose. A new adapter should have to state what it honours,\n * because the failure mode of the opposite default is a target that parses a\n * rate limit, validates it, and refuses nothing — with no line anywhere\n * saying so.\n *\n * `'runtime-not-emitted-here'` is a third answer, not a synonym for none: it\n * belongs to an adapter that emits no request handler at all, so this build\n * genuinely cannot say what the runtime applies. Reporting such a target as\n * dropping configuration would be asserting rather than measuring.\n *\n * The declaration is a claim, and nothing here can verify it — a wrong claim\n * reads exactly like a right one. What it buys is that dropping a concern\n * becomes a visible edit instead of an omission.\n */\n /**\n * #367 — can the handler this adapter emits serve an AGENT?\n *\n * Same contract as `streamsResponses` and `appliesConfig`, for the same reason: omitted means\n * **no**, on purpose. The gap this answers went unnoticed because nothing in this layer had ever\n * heard of agents — `grep -rc \"agent\"` over the 14 adapter files returned nothing — so an agent\n * was served by no pipeline at all outside a machine running `theokit start`, in a framework\n * whose stated reason to exist is that the agent ships through the same pipeline as the page.\n *\n * `true` claims the emitted entry routes `/api/agents/<name>` to `mountAgent`. It is a claim\n * nothing here can verify, exactly like the other two; what it buys is that a target which drops\n * agents has to say so rather than be silently assumed to serve them.\n */\n servesAgents?: boolean\n appliesConfig?: readonly ConfigConcern[] | 'runtime-not-emitted-here'\n\n /**\n * B-257 — can the emitted entry ENFORCE a declared rate limit, and under what condition?\n *\n * Separate from `appliesConfig` because the two answer different questions and one list could not\n * carry both. `findUnappliedConfig` reads the first to WARN; `assertRateLimitEnforceable` reads\n * this one to REFUSE. Welded, adding `'rateLimit'` to stop a warning also satisfied\n * `applied.includes('rateLimit')` and returned before the throw — switching the refusal off on a\n * runtime where the limit still cannot hold. `config-support.ts:213-215` wrote that refusal\n * because \"`rateLimit` is the one whose absence looks exactly like success\".\n *\n * `'always'` a long-lived process; the in-process counter survives between requests.\n * `'never'` this adapter emits no request handler that could enforce anything. A\n * TRUE claim, unlike the abstain below: nothing answers for a static\n * export at runtime, so there is no other runtime to defer to.\n * `'with-a-store'` a per-invocation or per-isolate runtime. It enforces only when the config\n * names a durable store, because an in-process counter there forgets, and a\n * limit that forgets is a limit that does not limit.\n * `'not-ours-to-judge'` this adapter emits no request handler OF ITS OWN, and another runtime\n * answers for it. An ABSTAIN: `config-support.ts:105-108` calls that \"a\n * different fact from saying no\", and refusing there would assert something\n * unmeasured about somebody else's runtime.\n *\n * **Omitted REFUSES**, and it does not abstain. Abstaining is a claim about another runtime, and a\n * claim is made rather than inferred from silence. The first cut defaulted to the abstain and\n * inverted the rule it replaced: `appliesConfig ?? []` refused an adapter that declared nothing,\n * while `?? 'not-ours-to-judge'` let it through. Measured on `static.ts`, which declares neither\n * field and is registered — it went from refusing a declared limit to proceeding with a warning.\n * This member is on the EXPORTED interface, so every third-party adapter inherited that inversion.\n */\n enforcesRateLimit?: 'always' | 'never' | 'with-a-store' | 'not-ours-to-judge'\n\n /**\n * Whether the deployed entry can read the project's SOURCE TREE while serving a request.\n *\n * The question behind four separate repairs, asked too late every time:\n *\n * cloudflare #369 / #367 routes and agents baked\n * vercel B-319 routes baked\n * netlify B-338 routes and agents baked\n * aws-lambda B-344 routes and agents baked\n *\n * `false` means the entry MUST bake its routes and agents at build time. A runtime\n * `scanServerRoutes` is a `readdirSync`, and where the artifact was uploaded alone there is nothing\n * to read: measured on netlify and aws-lambda, every `/api/*` answered its own 404. Where a tree IS\n * carried the route files are TypeScript, which a plain Node runtime cannot compile — the\n * `SyntaxError: Unexpected token ')'` netlify answered with before B-338.\n *\n * `true` means the project directory is present at run time, so the scan is legitimate and cheaper\n * than baking. `bun` and `deno-deploy` are the two, and `deno-deploy` can additionally compile the\n * TypeScript it finds.\n *\n * **Omitted is neither answer**, and `a-deployed-entry-is-self-contained-where-it-must-be.test.ts`\n * refuses it. This follows `enforcesRateLimit`'s own lesson one field up: its first cut defaulted to\n * the permissive value and inverted the rule it replaced. A default of `true` would excuse a scan on\n * a platform that cannot serve it; a default of `false` would demand baking from an adapter that\n * has no reason to. Neither silence is safe, so silence is refused.\n */\n readsSourceAtRunTime?: boolean\n\n /**\n * Who makes the entry's bare specifiers resolvable.\n *\n * The entry imports `theokit/server/scan` and its siblings by bare specifier, and whether that\n * breaks depends entirely on who resolves it afterwards — the table `docs/adr/0020` opens with:\n *\n * `'this-adapter'` nobody else does, so the adapter bundles the entry itself through\n * `bundleDeployedFunction`. Omitting the call ships source, and the\n * platform answers\n * `ERR_MODULE_NOT_FOUND: Cannot find package 'theokit'` — measured on\n * vercel (B-316), netlify (B-339) and aws-lambda (B-342).\n * `'the-platform'` the platform's own bundler resolves at deploy time. `cloudflare`\n * only: wrangler runs esbuild, validated live on 2026-09-26. Bundling\n * twice would be work with no observable effect.\n * `'the-project-at-run-time'` the project's `node_modules` is present when the entry runs, so\n * nothing has to be inlined. `bun` and `deno-deploy`.\n *\n * **Omitted is refused**, for the reason given on the field above: an entry whose specifiers nobody\n * resolves does not fail late, it fails at import, and a silence that reads as one of the three\n * answers would let that ship.\n */\n specifiersResolvedBy?: 'this-adapter' | 'the-platform' | 'the-project-at-run-time'\n /**\n * Why THIS target cannot stream, in the words its own maintainer would use.\n *\n * The refusal is computed centrally so it can run before anything is destroyed (B-336), and a central\n * check cannot know that Lambda's v2 result object carries the body as a string or that\n * `awslambda.streamifyResponse` is what would be needed. Declared here for the same reason\n * `streamsResponses` is: the adapter is the only thing that knows.\n *\n * Read only when `streamsResponses` is not `true`. Absent is fine — the generic refusal still names\n * the target, the config key and the alternatives.\n */\n streamingUnsupportedDetail?: string\n build(config: TheoConfig, cwd: string, ctx?: AdapterBuildContext): Promise<void>\n}\n\nexport type BuildTarget =\n | 'node'\n | 'vercel'\n | 'cloudflare'\n | 'static'\n | 'bun'\n | 'deno-deploy'\n | 'netlify'\n | 'aws-lambda'\n | 'theo-cloud'\n\n/**\n * Whether a target's emitted entry renders the HTML document on the server.\n *\n * The build printed `(SSR)` from `config.ssr` alone, so a target that delegates the document to a\n * static host was announced as server-rendering. Measured 2026-09-28 on a real project built with\n * `--target bun` and driven under Bun 1.3.14: the build said `✓ Build complete → bun (SSR)` and `GET /`\n * answered 531 bytes whose body was an empty `<div id=\"root\">`.\n *\n * This answers CAN the target render, not WILL it on this build — the config flag that turns rendering\n * on differs per target (`ssrStreaming` for Cloudflare, `ssr` for the rest), and each adapter already\n * knows its own. A caller wanting the second question asks both.\n *\n * Kept beside `VALID_TARGETS` rather than on `DeployAdapter`, because the CLI prints the note before\n * and after the adapter runs and never holds the emitted text. `check` in the test suite compares this\n * table against what each adapter's source actually reaches, in both directions, so it cannot drift\n * into describing a fleet that moved.\n */\nconst RENDERS_DOCUMENT: ReadonlySet<BuildTarget> = new Set<BuildTarget>([\n 'cloudflare',\n 'vercel',\n 'node',\n 'static',\n 'bun',\n])\n\nexport function targetRendersDocument(target: BuildTarget): boolean {\n return RENDERS_DOCUMENT.has(target)\n}\n\nexport const VALID_TARGETS: BuildTarget[] = [\n 'node',\n 'vercel',\n 'cloudflare',\n 'static',\n 'bun',\n 'deno-deploy',\n 'netlify',\n 'aws-lambda',\n 'theo-cloud',\n]\n"],"mappings":";;;;AAkTA,IAAM,mBAA6C,oBAAI,IAAiB;AAAA,EACtE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,SAAS,sBAAsB,QAA8B;AAClE,SAAO,iBAAiB,IAAI,MAAM;AACpC;AAEO,IAAM,gBAA+B;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
dispatchCsrfWarn
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HWRZUQPE.js";
|
|
4
4
|
import {
|
|
5
5
|
incomingMessageToWebRequest,
|
|
6
6
|
sendError
|
|
@@ -172,4 +172,4 @@ export {
|
|
|
172
172
|
scanControllerModules,
|
|
173
173
|
dispatchControllerRequest
|
|
174
174
|
};
|
|
175
|
-
//# sourceMappingURL=chunk-
|
|
175
|
+
//# sourceMappingURL=chunk-SHBPXX5E.js.map
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
parseAgentRequestBody,
|
|
27
27
|
readAgentPolicy,
|
|
28
28
|
subjectFromContext
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-MSSUMKFR.js";
|
|
30
30
|
import {
|
|
31
31
|
getApprovalRegistry
|
|
32
32
|
} from "./chunk-4JRXZTVQ.js";
|
|
@@ -954,4 +954,4 @@ export {
|
|
|
954
954
|
applyNonceToInlineScripts,
|
|
955
955
|
setupSsrDevMiddleware
|
|
956
956
|
};
|
|
957
|
-
//# sourceMappingURL=chunk-
|
|
957
|
+
//# sourceMappingURL=chunk-VSK5Y4ET.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "tsx/esm";
|
|
3
3
|
import {
|
|
4
4
|
jobBackendFromConfig
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-VSK5Y4ET.js";
|
|
6
6
|
import {
|
|
7
7
|
extractTraceContext,
|
|
8
8
|
generateNewTraceContext
|
|
@@ -500,4 +500,4 @@ export {
|
|
|
500
500
|
prepareJobBackend,
|
|
501
501
|
startJobWorker
|
|
502
502
|
};
|
|
503
|
-
//# sourceMappingURL=chunk-
|
|
503
|
+
//# sourceMappingURL=chunk-XCPM72D6.js.map
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
serveReservedRoute,
|
|
16
16
|
serveThroughPluginLifecycle,
|
|
17
17
|
setupSsrDevMiddleware
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-VSK5Y4ET.js";
|
|
19
19
|
import {
|
|
20
20
|
resolveTheoRootDir
|
|
21
21
|
} from "./chunk-FDOOBTXJ.js";
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
mountAgent,
|
|
38
38
|
readAgentPolicy,
|
|
39
39
|
writeWebResponseToServerResponse
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-MSSUMKFR.js";
|
|
41
41
|
import {
|
|
42
42
|
getApprovalRegistry,
|
|
43
43
|
resolveProvider
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
} from "./chunk-4WP7A7RX.js";
|
|
72
72
|
import {
|
|
73
73
|
loadConfig
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-5UJRZC4J.js";
|
|
75
75
|
import {
|
|
76
76
|
buildServicesProxyConfig
|
|
77
77
|
} from "./chunk-L4V5V2TI.js";
|
|
@@ -439,7 +439,8 @@ function createActionMiddleware(vite, serverDir, options) {
|
|
|
439
439
|
requestId,
|
|
440
440
|
pluginRunner,
|
|
441
441
|
csrfMode,
|
|
442
|
-
disallowed
|
|
442
|
+
disallowed,
|
|
443
|
+
options?.jobBackend
|
|
443
444
|
);
|
|
444
445
|
logRequest(
|
|
445
446
|
{
|
|
@@ -1023,7 +1024,8 @@ async function runConfigureServer(server, ctx) {
|
|
|
1023
1024
|
createActionMiddleware(server, serverDir, {
|
|
1024
1025
|
pluginRunner: ctx.pluginRunner,
|
|
1025
1026
|
csrfMode: ctx.csrfMode,
|
|
1026
|
-
disallowed: ctx.disallowed
|
|
1027
|
+
disallowed: ctx.disallowed,
|
|
1028
|
+
jobBackend: ctx.jobBackend
|
|
1027
1029
|
})
|
|
1028
1030
|
);
|
|
1029
1031
|
server.middlewares.use(
|
|
@@ -2281,7 +2283,7 @@ async function theoPluginAsync(rootOrOptions) {
|
|
|
2281
2283
|
}
|
|
2282
2284
|
const { assetsMapPlugin } = await import("./assets-map-BMQASQHW.js");
|
|
2283
2285
|
const assetsMap = assetsMapPlugin({ appDir: resolve5(projectRoot, options.appDir ?? "app") });
|
|
2284
|
-
const { appTypedClientPlugin } = await import("./app-typed-client-
|
|
2286
|
+
const { appTypedClientPlugin } = await import("./app-typed-client-ZCMCBS45.js");
|
|
2285
2287
|
const appClientPlugin = appTypedClientPlugin({
|
|
2286
2288
|
cwd: projectRoot,
|
|
2287
2289
|
serverDir: serverDirAbs,
|
|
@@ -2289,13 +2291,13 @@ async function theoPluginAsync(rootOrOptions) {
|
|
|
2289
2291
|
// B-313 — the same name line 226 already passes. This call passed neither it nor the root.
|
|
2290
2292
|
agentsDir: agentsDirName
|
|
2291
2293
|
});
|
|
2292
|
-
const { actionsVirtualModule } = await import("./actions-virtual-module-
|
|
2294
|
+
const { actionsVirtualModule } = await import("./actions-virtual-module-QRTV4NHS.js");
|
|
2293
2295
|
const actionsPlugin = actionsVirtualModule({
|
|
2294
2296
|
serverDir: serverDirAbs,
|
|
2295
2297
|
distDir: resolve5(projectRoot, ".theokit")
|
|
2296
2298
|
});
|
|
2297
2299
|
const { agentsTypedClientPlugin } = await import("./agents-typed-client-D4OA2TXB.js");
|
|
2298
|
-
const { generateManifest } = await import("./internal-api-
|
|
2300
|
+
const { generateManifest } = await import("./internal-api-KQQHFTCG.js");
|
|
2299
2301
|
const agentsClientPlugin = agentsTypedClientPlugin({
|
|
2300
2302
|
projectRoot,
|
|
2301
2303
|
agentsDir: agentsDirName,
|
|
@@ -2312,7 +2314,7 @@ async function theoPluginAsync(rootOrOptions) {
|
|
|
2312
2314
|
const controllerTransformPlugin = controllerSwcTransformPlugin({
|
|
2313
2315
|
serverDir: serverDirAbs
|
|
2314
2316
|
});
|
|
2315
|
-
const { serverOnlyImportBoundary } = await import("./server-boundary-
|
|
2317
|
+
const { serverOnlyImportBoundary } = await import("./server-boundary-JA3UOKJS.js");
|
|
2316
2318
|
const serverBoundaryPlugin = serverOnlyImportBoundary({
|
|
2317
2319
|
projectRoot,
|
|
2318
2320
|
serverDir: serverDirAbs
|
|
@@ -2495,4 +2497,4 @@ export {
|
|
|
2495
2497
|
buildOptimizeDepsInclude,
|
|
2496
2498
|
theoPlugin
|
|
2497
2499
|
};
|
|
2498
|
-
//# sourceMappingURL=chunk-
|
|
2500
|
+
//# sourceMappingURL=chunk-YM6ONZYE.js.map
|