theokit 0.74.0 → 0.74.1

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.
Files changed (36) hide show
  1. package/dist/{agent-GU6JIEFJ.js → agent-5J7CQAYR.js} +2 -2
  2. package/dist/{build-6FVZKORI.js → build-7YZSJGP2.js} +3 -3
  3. package/dist/{chunk-S5QN3O22.js → chunk-NQZIQJFH.js} +3 -2
  4. package/dist/{chunk-S5QN3O22.js.map → chunk-NQZIQJFH.js.map} +1 -1
  5. package/dist/{chunk-RFZ263XP.js → chunk-QX5Q3FBJ.js} +3 -2
  6. package/dist/chunk-QX5Q3FBJ.js.map +1 -0
  7. package/dist/{chunk-ODYLKWRT.js → chunk-SG62LZOJ.js} +2 -2
  8. package/dist/cli/index.js +5 -5
  9. package/dist/{cloudflare-AMH4TJNL.js → cloudflare-Q5SUXRXY.js} +83 -3
  10. package/dist/cloudflare-Q5SUXRXY.js.map +1 -0
  11. package/dist/{deno-deploy-6H354VRA.js → deno-deploy-XW3Q6OMD.js} +94 -6
  12. package/dist/deno-deploy-XW3Q6OMD.js.map +1 -0
  13. package/dist/{dev-HJUD6X3R.js → dev-FZ4OTCPT.js} +2 -2
  14. package/dist/index.js +1 -1
  15. package/dist/{mcp-MVKDWZEQ.js → mcp-VUHRRX36.js} +2 -2
  16. package/dist/{preview-5HUID27O.js → preview-II33QNAC.js} +2 -2
  17. package/dist/{registry-OMLCP4AS.js → registry-WVUO2WNR.js} +4 -4
  18. package/dist/theo-cloud-GIA67L4Q.js +40 -0
  19. package/dist/theo-cloud-GIA67L4Q.js.map +1 -0
  20. package/dist/vite-plugin/index.d.ts +10 -1
  21. package/dist/vite-plugin/index.js +3 -1
  22. package/dist/{vite-plugin-JVGI6QUO.js → vite-plugin-3LTZJTUM.js} +4 -2
  23. package/package.json +2 -2
  24. package/dist/chunk-RFZ263XP.js.map +0 -1
  25. package/dist/cloudflare-AMH4TJNL.js.map +0 -1
  26. package/dist/deno-deploy-6H354VRA.js.map +0 -1
  27. package/dist/theo-cloud-HMFNZ3FS.js +0 -33
  28. package/dist/theo-cloud-HMFNZ3FS.js.map +0 -1
  29. /package/dist/{agent-GU6JIEFJ.js.map → agent-5J7CQAYR.js.map} +0 -0
  30. /package/dist/{build-6FVZKORI.js.map → build-7YZSJGP2.js.map} +0 -0
  31. /package/dist/{chunk-ODYLKWRT.js.map → chunk-SG62LZOJ.js.map} +0 -0
  32. /package/dist/{dev-HJUD6X3R.js.map → dev-FZ4OTCPT.js.map} +0 -0
  33. /package/dist/{mcp-MVKDWZEQ.js.map → mcp-VUHRRX36.js.map} +0 -0
  34. /package/dist/{preview-5HUID27O.js.map → preview-II33QNAC.js.map} +0 -0
  35. /package/dist/{registry-OMLCP4AS.js.map → registry-WVUO2WNR.js.map} +0 -0
  36. /package/dist/{vite-plugin-JVGI6QUO.js.map → vite-plugin-3LTZJTUM.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/adapters/theo-cloud.ts"],"sourcesContent":["/**\n * TheoCloud deploy adapter — builds the application, validates the service manifest, hands over.\n *\n * Per ADR-0012 (mission expansion) + the 2026-06-05 owner architectural decision, TheoKit OSS does\n * NOT emit K8s manifests. That decision is unchanged and it is well argued: an OSS framework must\n * emit formats consumed by public or neutral systems, not a proprietary platform's internal shape.\n * K8s emission lives entirely inside TheoCloud, on receiving the upload.\n *\n * ## What the thinness did NOT cover, and did\n *\n * Until 2026-09-30 this adapter read `.theokit/services.json`, checked its version, logged, and\n * returned. Measured on a fresh `create-theokit` scaffold:\n *\n * theokit build --target theo-cloud\n * [theo-cloud] … Bundle ready for upload — …\n * ✓ Build complete → theo-cloud\n * ls .theokit\n * crons.json jobs.json manifest.json services.json\n *\n * Four manifests and no application: no client, no server entry, nothing a runtime could serve. And a\n * build empties its output first, so running this target DESTROYED whatever the previous one left and\n * reported a bundle in its place.\n *\n * Two of this repository's own documents state the contract it did not keep —\n * `docs/surfaces/build-adapters.md` (\"validates a service manifest, logs the services and **hands over\n * a bundle**\") and the capability matrix (\"Validates `.theokit/services.json` and **prepares the\n * bundle**\"). Declared twice, implemented nowhere.\n *\n * The argument for thinness is about the PLATFORM'S format. The application is not that: it is the\n * same client and server entry every other target builds, and `nodeAdapter` is what builds it — which\n * is what `vercel` already delegates to for the same half of the same problem.\n */\nimport type { TheoConfig } from '../config/schema.js'\nimport {\n prepareTheoCloudArtifacts,\n readManifest as readManifestFromDisk,\n} from '../services/index.js'\n\nimport { nodeAdapter } from './node.js'\nimport type { AdapterBuildContext, DeployAdapter } from './types.js'\n\n/** The seams this build reaches the world through, injectable so the decision is testable. */\nexport interface TheoCloudBuildDeps {\n /** Builds the application. Defaults to the node adapter, which is what produces one. */\n readonly runNodeBuild?: (\n config: TheoConfig,\n cwd: string,\n ctx?: AdapterBuildContext,\n ) => Promise<void>\n /** Reads `.theokit/services.json`. Defaults to the real reader. */\n readonly readManifest?: typeof readManifestFromDisk\n}\n\n/**\n * The build, with its seams injectable — the shape `buildVercel` already has in this directory.\n *\n * `DeployAdapter['build']` takes three parameters, so a fourth for the seams does not typecheck at the\n * call site. Exporting the function and having the method delegate is how the other adapters solved\n * the same problem, and it keeps the injection out of the interface every adapter implements.\n *\n * @param config the project's resolved config\n * @param cwd the project root\n * @param deps the seams, defaulted to the real ones\n * @param ctx the build context, forwarded to the node build unchanged\n */\nexport async function buildTheoCloud(\n config: TheoConfig,\n cwd: string,\n deps: TheoCloudBuildDeps = {},\n ctx?: AdapterBuildContext,\n): Promise<void> {\n const runNodeBuild = deps.runNodeBuild ?? nodeAdapter.build.bind(nodeAdapter)\n const readManifest = deps.readManifest ?? readManifestFromDisk\n\n // The application first: without it there is nothing for the sentence below to be about.\n await runNodeBuild(config, cwd, ctx)\n\n const artifacts = prepareTheoCloudArtifacts(readManifest(cwd))\n const summary =\n artifacts.services.length === 0 ? 'TS-only app (no services)' : artifacts.services.join(', ')\n // `Wave 3 v2.0` and `TheoCloud emits K8s manifests internally` are ASSERTED invariants, each with\n // its reason stated in `tests/unit/theo-cloud-adapter-v2.test.ts` — the version tag and the\n // architectural mental model. Rewording them was scope this fix did not need, and it broke both.\n // What the fix adds is where the bundle is, so `ready for upload` is checkable.\n //\n // eslint-disable-next-line no-console -- CLI build progress\n console.log(\n `[theo-cloud] Wave 3 v2.0: manifest schemaVersion=${String(artifacts.manifestVersion)}, ` +\n `services=${summary}. Bundle ready for upload from ${config.distDir} — TheoCloud emits K8s ` +\n `manifests internally upon deploy.`,\n )\n}\n\nexport const theoCloudAdapter: DeployAdapter = {\n name: 'theo-cloud',\n // #382 — this adapter emits no request handler of its own; TheoCloud's runtime serves the bundle.\n streamsResponses: false,\n // This adapter emits no request handler -- TheoCloud's proprietary runtime\n // serves the bundle. What that runtime applies is not knowable from here, and\n // reporting the config as dropped would be asserting rather than measuring.\n appliesConfig: 'runtime-not-emitted-here',\n // B-257 — emits no request handler; this build cannot answer for that runtime.\n enforcesRateLimit: 'not-ours-to-judge',\n\n build(config: TheoConfig, cwd: string, ctx?: AdapterBuildContext): Promise<void> {\n return buildTheoCloud(config, cwd, {}, ctx)\n },\n}\n"],"mappings":";;;;;;;;;;;AAiEA,eAAsB,eACpB,QACA,KACA,OAA2B,CAAC,GAC5B,KACe;AACf,QAAM,eAAe,KAAK,gBAAgB,YAAY,MAAM,KAAK,WAAW;AAC5E,QAAMA,gBAAe,KAAK,gBAAgB;AAG1C,QAAM,aAAa,QAAQ,KAAK,GAAG;AAEnC,QAAM,YAAY,0BAA0BA,cAAa,GAAG,CAAC;AAC7D,QAAM,UACJ,UAAU,SAAS,WAAW,IAAI,8BAA8B,UAAU,SAAS,KAAK,IAAI;AAO9F,UAAQ;AAAA,IACN,oDAAoD,OAAO,UAAU,eAAe,CAAC,cACvE,OAAO,kCAAkC,OAAO,OAAO;AAAA,EAEvE;AACF;AAEO,IAAM,mBAAkC;AAAA,EAC7C,MAAM;AAAA;AAAA,EAEN,kBAAkB;AAAA;AAAA;AAAA;AAAA,EAIlB,eAAe;AAAA;AAAA,EAEf,mBAAmB;AAAA,EAEnB,MAAM,QAAoB,KAAa,KAA0C;AAC/E,WAAO,eAAe,QAAQ,KAAK,CAAC,GAAG,GAAG;AAAA,EAC5C;AACF;","names":["readManifest"]}
@@ -129,6 +129,15 @@ interface TheoPluginOptions {
129
129
  * factory remains for backward compatibility and tests.
130
130
  */
131
131
  declare function theoPluginAsync(rootOrOptions?: string | TheoPluginOptions): Promise<Plugin[]>;
132
+ /**
133
+ * Build the `optimizeDeps.include` array Vite uses to pre-bundle heavy
134
+ * deps at server startup. Detects `@theokit/ui` and `lucide-react` in
135
+ * the consumer's `node_modules` (auto-include) and appends user-declared
136
+ * peer deps via `viteOptimizeDeps` (e.g., `mermaid` for plugin-canvas
137
+ * — without this hint Vite fails to resolve dynamic `import('mermaid')`
138
+ * inside an installed plugin at dev time). T4.1 of canvas-ecosystem-refactor.
139
+ */
140
+ declare function buildOptimizeDepsInclude(projectRoot: string, viteOptimizeDeps: readonly string[] | undefined): string[];
132
141
  declare function theoPlugin(rootOrOptions?: string | TheoPluginOptions): Plugin;
133
142
 
134
- export { type Hook as IntegrationHook, type HookContext as IntegrationHookContext, type HookName as IntegrationHookName, type IntegrationRegistry, type IntegrationRegistryOptions, type IntegrationRoute, IntegrationRouteCollisionError, type RouteHandler as IntegrationRouteHandler, IntegrationVirtualModulePrefixError, type TheoIntegration, type TheoPluginOptions, createIntegrationRegistry, defineTheoIntegration, theoPlugin, theoPluginAsync };
143
+ export { type Hook as IntegrationHook, type HookContext as IntegrationHookContext, type HookName as IntegrationHookName, type IntegrationRegistry, type IntegrationRegistryOptions, type IntegrationRoute, IntegrationRouteCollisionError, type RouteHandler as IntegrationRouteHandler, IntegrationVirtualModulePrefixError, type TheoIntegration, type TheoPluginOptions, buildOptimizeDepsInclude, createIntegrationRegistry, defineTheoIntegration, theoPlugin, theoPluginAsync };
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  IntegrationRouteCollisionError,
3
3
  IntegrationVirtualModulePrefixError,
4
+ buildOptimizeDepsInclude,
4
5
  createIntegrationRegistry,
5
6
  defineTheoIntegration,
6
7
  theoPlugin,
7
8
  theoPluginAsync
8
- } from "../chunk-S5QN3O22.js";
9
+ } from "../chunk-NQZIQJFH.js";
9
10
  import "../chunk-7NRFZBAL.js";
10
11
  import "../chunk-SSYDEKWF.js";
11
12
  import "../chunk-D7STTNQN.js";
@@ -48,6 +49,7 @@ import "../chunk-XTHN6JBX.js";
48
49
  export {
49
50
  IntegrationRouteCollisionError,
50
51
  IntegrationVirtualModulePrefixError,
52
+ buildOptimizeDepsInclude,
51
53
  createIntegrationRegistry,
52
54
  defineTheoIntegration,
53
55
  theoPlugin,
@@ -3,11 +3,12 @@ import "tsx/esm";
3
3
  import {
4
4
  IntegrationRouteCollisionError,
5
5
  IntegrationVirtualModulePrefixError,
6
+ buildOptimizeDepsInclude,
6
7
  createIntegrationRegistry,
7
8
  defineTheoIntegration,
8
9
  theoPlugin,
9
10
  theoPluginAsync
10
- } from "./chunk-RFZ263XP.js";
11
+ } from "./chunk-QX5Q3FBJ.js";
11
12
  import "./chunk-QAS5SKZP.js";
12
13
  import "./chunk-BDH5GKFZ.js";
13
14
  import "./chunk-3PWQQWT6.js";
@@ -35,9 +36,10 @@ import "./chunk-VQIUTCK2.js";
35
36
  export {
36
37
  IntegrationRouteCollisionError,
37
38
  IntegrationVirtualModulePrefixError,
39
+ buildOptimizeDepsInclude,
38
40
  createIntegrationRegistry,
39
41
  defineTheoIntegration,
40
42
  theoPlugin,
41
43
  theoPluginAsync
42
44
  };
43
- //# sourceMappingURL=vite-plugin-JVGI6QUO.js.map
45
+ //# sourceMappingURL=vite-plugin-3LTZJTUM.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "theokit",
3
- "version": "0.74.0",
3
+ "version": "0.74.1",
4
4
  "description": "The TheoKit web framework — file-based routing, typed server surfaces, the Vite plugin, the CLI and the deploy adapters, around agents served from agents/*.ts.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -140,7 +140,7 @@
140
140
  "busboy": "^1.6.0",
141
141
  "cac": "^6.7.14",
142
142
  "cron-parser": "^5.5.0",
143
- "devalue": "^5.8.1",
143
+ "devalue": "^5.9.3",
144
144
  "dotenv": "^16.6.1",
145
145
  "dotenv-expand": "^11.0.7",
146
146
  "goober": "^2.1.19",