theokit 0.72.0 → 0.72.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 (62) hide show
  1. package/dist/{actions-virtual-module-6LND2WHL.js → actions-virtual-module-EAKYEMGF.js} +2 -2
  2. package/dist/{actions-virtual-module-WP47EKD7.js → actions-virtual-module-OHENNMQG.js} +4 -4
  3. package/dist/adapters/agent-mount.js +2 -2
  4. package/dist/{agent-KUP3XA2S.js → agent-VJTZ4DQ7.js} +2 -2
  5. package/dist/{app-typed-client-6VIHSYJH.js → app-typed-client-ILLQYTXP.js} +4 -4
  6. package/dist/{app-typed-client-IMRSVARP.js → app-typed-client-LHH77QDB.js} +2 -2
  7. package/dist/{build-4J24BAEC.js → build-23QF5FNQ.js} +2 -2
  8. package/dist/{chunk-KOG5K26V.js → chunk-2Z7TANA4.js} +2 -2
  9. package/dist/{chunk-RDG5GMDW.js → chunk-4EQEJ4PH.js} +7 -7
  10. package/dist/{chunk-IVGQMV3S.js → chunk-6U67SO5U.js} +2 -2
  11. package/dist/{chunk-YWWMYEAC.js → chunk-CLSYYO5F.js} +2 -2
  12. package/dist/{chunk-JMN4COMK.js → chunk-D7STTNQN.js} +3 -3
  13. package/dist/{chunk-LJNMSKFL.js → chunk-DKX7LF5Q.js} +2 -2
  14. package/dist/{chunk-EZHDAVAF.js → chunk-E2RC367T.js} +25 -2
  15. package/dist/chunk-E2RC367T.js.map +1 -0
  16. package/dist/{chunk-7CHPOMP5.js → chunk-L6UHMWXU.js} +2 -2
  17. package/dist/{chunk-4D4YVXHR.js → chunk-SYIQV4UH.js} +29 -2
  18. package/dist/{chunk-4D4YVXHR.js.map → chunk-SYIQV4UH.js.map} +1 -1
  19. package/dist/{chunk-BZ6DFSKG.js → chunk-XLSJWKSP.js} +9 -9
  20. package/dist/cli/index.js +6 -6
  21. package/dist/{dev-JZVHEYN4.js → dev-JDJWMRLH.js} +4 -4
  22. package/dist/{index-inRdhi59.d.ts → index-CmkWlIDO.d.ts} +3 -1
  23. package/dist/index.js +5 -5
  24. package/dist/{internal-api-3IZVNNGB.js → internal-api-6XNLCNI5.js} +4 -4
  25. package/dist/{internal-api-BNDRCEPZ.js → internal-api-VDYOXOT7.js} +2 -2
  26. package/dist/{mcp-HCXHATU3.js → mcp-WJNCTM7M.js} +2 -2
  27. package/dist/{preview-FSUPVADO.js → preview-BARW75PN.js} +3 -3
  28. package/dist/server/http/index.d.ts +1 -1
  29. package/dist/server/http/index.js +5 -3
  30. package/dist/server/index.d.ts +1 -1
  31. package/dist/server/index.js +5 -3
  32. package/dist/server/index.js.map +1 -1
  33. package/dist/{server-boundary-P52I6YMH.js → server-boundary-AO6EELRF.js} +2 -2
  34. package/dist/{server-boundary-WUKORSW2.js → server-boundary-E5GFVPLB.js} +4 -4
  35. package/dist/{start-LCA67RES.js → start-4JTYXQQJ.js} +3 -3
  36. package/dist/vite-plugin/index.js +5 -5
  37. package/dist/{vite-plugin-WFA7NPYK.js → vite-plugin-3ON45MQE.js} +4 -4
  38. package/package.json +3 -3
  39. package/dist/chunk-EZHDAVAF.js.map +0 -1
  40. /package/dist/{actions-virtual-module-6LND2WHL.js.map → actions-virtual-module-EAKYEMGF.js.map} +0 -0
  41. /package/dist/{actions-virtual-module-WP47EKD7.js.map → actions-virtual-module-OHENNMQG.js.map} +0 -0
  42. /package/dist/{agent-KUP3XA2S.js.map → agent-VJTZ4DQ7.js.map} +0 -0
  43. /package/dist/{app-typed-client-6VIHSYJH.js.map → app-typed-client-ILLQYTXP.js.map} +0 -0
  44. /package/dist/{app-typed-client-IMRSVARP.js.map → app-typed-client-LHH77QDB.js.map} +0 -0
  45. /package/dist/{build-4J24BAEC.js.map → build-23QF5FNQ.js.map} +0 -0
  46. /package/dist/{chunk-KOG5K26V.js.map → chunk-2Z7TANA4.js.map} +0 -0
  47. /package/dist/{chunk-RDG5GMDW.js.map → chunk-4EQEJ4PH.js.map} +0 -0
  48. /package/dist/{chunk-IVGQMV3S.js.map → chunk-6U67SO5U.js.map} +0 -0
  49. /package/dist/{chunk-YWWMYEAC.js.map → chunk-CLSYYO5F.js.map} +0 -0
  50. /package/dist/{chunk-JMN4COMK.js.map → chunk-D7STTNQN.js.map} +0 -0
  51. /package/dist/{chunk-LJNMSKFL.js.map → chunk-DKX7LF5Q.js.map} +0 -0
  52. /package/dist/{chunk-7CHPOMP5.js.map → chunk-L6UHMWXU.js.map} +0 -0
  53. /package/dist/{chunk-BZ6DFSKG.js.map → chunk-XLSJWKSP.js.map} +0 -0
  54. /package/dist/{dev-JZVHEYN4.js.map → dev-JDJWMRLH.js.map} +0 -0
  55. /package/dist/{internal-api-3IZVNNGB.js.map → internal-api-6XNLCNI5.js.map} +0 -0
  56. /package/dist/{internal-api-BNDRCEPZ.js.map → internal-api-VDYOXOT7.js.map} +0 -0
  57. /package/dist/{mcp-HCXHATU3.js.map → mcp-WJNCTM7M.js.map} +0 -0
  58. /package/dist/{preview-FSUPVADO.js.map → preview-BARW75PN.js.map} +0 -0
  59. /package/dist/{server-boundary-P52I6YMH.js.map → server-boundary-AO6EELRF.js.map} +0 -0
  60. /package/dist/{server-boundary-WUKORSW2.js.map → server-boundary-E5GFVPLB.js.map} +0 -0
  61. /package/dist/{start-LCA67RES.js.map → start-4JTYXQQJ.js.map} +0 -0
  62. /package/dist/{vite-plugin-WFA7NPYK.js.map → vite-plugin-3ON45MQE.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import "tsx/esm";
3
- import "./chunk-EZHDAVAF.js";
3
+ import "./chunk-E2RC367T.js";
4
4
  import "./chunk-BINRCILF.js";
5
5
  import "./chunk-QD5X56I3.js";
6
6
  import "./chunk-WSMLSIS5.js";
@@ -218,4 +218,4 @@ export const actions = manifest
218
218
  export {
219
219
  actionsVirtualModule
220
220
  };
221
- //# sourceMappingURL=actions-virtual-module-6LND2WHL.js.map
221
+ //# sourceMappingURL=actions-virtual-module-EAKYEMGF.js.map
@@ -1,9 +1,9 @@
1
- import "./chunk-JMN4COMK.js";
1
+ import "./chunk-D7STTNQN.js";
2
2
  import "./chunk-WBB3MEEN.js";
3
3
  import "./chunk-WSOAN4KN.js";
4
4
  import "./chunk-ENSFCKP6.js";
5
- import "./chunk-KOG5K26V.js";
6
- import "./chunk-4D4YVXHR.js";
5
+ import "./chunk-2Z7TANA4.js";
6
+ import "./chunk-SYIQV4UH.js";
7
7
  import "./chunk-P6OS7652.js";
8
8
  import "./chunk-ZDUO4IYN.js";
9
9
  import "./chunk-IDWN2OSG.js";
@@ -234,4 +234,4 @@ export const actions = manifest
234
234
  export {
235
235
  actionsVirtualModule
236
236
  };
237
- //# sourceMappingURL=actions-virtual-module-WP47EKD7.js.map
237
+ //# sourceMappingURL=actions-virtual-module-OHENNMQG.js.map
@@ -3,11 +3,11 @@ import {
3
3
  createSubjectResolverFromFactory,
4
4
  matchAgentAuxRoute,
5
5
  serveMatchedAuxRoute
6
- } from "../chunk-IVGQMV3S.js";
6
+ } from "../chunk-6U67SO5U.js";
7
7
  import {
8
8
  mountAgent
9
9
  } from "../chunk-WBB3MEEN.js";
10
- import "../chunk-4D4YVXHR.js";
10
+ import "../chunk-SYIQV4UH.js";
11
11
  import "../chunk-P6OS7652.js";
12
12
  import "../chunk-IDWN2OSG.js";
13
13
  import "../chunk-PVNMLZ5G.js";
@@ -3,7 +3,7 @@ import "tsx/esm";
3
3
  import {
4
4
  agentCommand,
5
5
  createAgentSsrLoader
6
- } from "./chunk-LJNMSKFL.js";
6
+ } from "./chunk-DKX7LF5Q.js";
7
7
  import "./chunk-BINRCILF.js";
8
8
  import "./chunk-R7G2B2WH.js";
9
9
  import "./chunk-Z7CJHDLS.js";
@@ -12,4 +12,4 @@ export {
12
12
  agentCommand,
13
13
  createAgentSsrLoader
14
14
  };
15
- //# sourceMappingURL=agent-KUP3XA2S.js.map
15
+ //# sourceMappingURL=agent-VJTZ4DQ7.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  scanControllerModules
3
- } from "./chunk-JMN4COMK.js";
3
+ } from "./chunk-D7STTNQN.js";
4
4
  import "./chunk-WBB3MEEN.js";
5
5
  import "./chunk-WSOAN4KN.js";
6
6
  import "./chunk-ENSFCKP6.js";
7
- import "./chunk-KOG5K26V.js";
8
- import "./chunk-4D4YVXHR.js";
7
+ import "./chunk-2Z7TANA4.js";
8
+ import "./chunk-SYIQV4UH.js";
9
9
  import "./chunk-P6OS7652.js";
10
10
  import "./chunk-ZDUO4IYN.js";
11
11
  import "./chunk-IDWN2OSG.js";
@@ -427,4 +427,4 @@ export {
427
427
  generateClientDts,
428
428
  shouldReemitForFile
429
429
  };
430
- //# sourceMappingURL=app-typed-client-6VIHSYJH.js.map
430
+ //# sourceMappingURL=app-typed-client-ILLQYTXP.js.map
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import "tsx/esm";
3
- import "./chunk-EZHDAVAF.js";
3
+ import "./chunk-E2RC367T.js";
4
4
  import "./chunk-BINRCILF.js";
5
5
  import {
6
6
  scanControllerModules
@@ -411,4 +411,4 @@ export {
411
411
  generateClientDts,
412
412
  shouldReemitForFile
413
413
  };
414
- //# sourceMappingURL=app-typed-client-IMRSVARP.js.map
414
+ //# sourceMappingURL=app-typed-client-LHH77QDB.js.map
@@ -554,7 +554,7 @@ async function buildCommand(options) {
554
554
  `);
555
555
  }
556
556
  async function runAdapterBuild(target, config, cwd) {
557
- const { theoPluginAsync } = await import("./vite-plugin-WFA7NPYK.js");
557
+ const { theoPluginAsync } = await import("./vite-plugin-3ON45MQE.js");
558
558
  const { default: react } = await import("@vitejs/plugin-react");
559
559
  const ctx = {
560
560
  // `react()` may return Plugin or Plugin[] depending on version; spread the
@@ -681,4 +681,4 @@ function relativize3(absPath, root) {
681
681
  export {
682
682
  buildCommand
683
683
  };
684
- //# sourceMappingURL=build-4J24BAEC.js.map
684
+ //# sourceMappingURL=build-23QF5FNQ.js.map
@@ -6,7 +6,7 @@ import {
6
6
  runZodValidation,
7
7
  sendError,
8
8
  sendJson
9
- } from "./chunk-4D4YVXHR.js";
9
+ } from "./chunk-SYIQV4UH.js";
10
10
  import {
11
11
  enforceCsrf
12
12
  } from "./chunk-P6OS7652.js";
@@ -1039,4 +1039,4 @@ export {
1039
1039
  createCorsHandler,
1040
1040
  createCorsWebHandler
1041
1041
  };
1042
- //# sourceMappingURL=chunk-KOG5K26V.js.map
1042
+ //# sourceMappingURL=chunk-2Z7TANA4.js.map
@@ -12,7 +12,7 @@ import {
12
12
  serveMatchedAuxRoute,
13
13
  serveThroughPluginLifecycle,
14
14
  setupSsrDevMiddleware
15
- } from "./chunk-7CHPOMP5.js";
15
+ } from "./chunk-L6UHMWXU.js";
16
16
  import {
17
17
  resolveTheoRootDir
18
18
  } from "./chunk-FDOOBTXJ.js";
@@ -34,7 +34,7 @@ import {
34
34
  mountAgent,
35
35
  readAgentPolicy,
36
36
  writeWebResponseToServerResponse
37
- } from "./chunk-EZHDAVAF.js";
37
+ } from "./chunk-E2RC367T.js";
38
38
  import {
39
39
  getApprovalRegistry,
40
40
  resolveProvider
@@ -2195,19 +2195,19 @@ async function theoPluginAsync(rootOrOptions) {
2195
2195
  }
2196
2196
  const { assetsMapPlugin } = await import("./assets-map-BMQASQHW.js");
2197
2197
  const assetsMap = assetsMapPlugin({ appDir: resolve5(projectRoot, options.appDir ?? "app") });
2198
- const { appTypedClientPlugin } = await import("./app-typed-client-IMRSVARP.js");
2198
+ const { appTypedClientPlugin } = await import("./app-typed-client-LHH77QDB.js");
2199
2199
  const appClientPlugin = appTypedClientPlugin({
2200
2200
  cwd: projectRoot,
2201
2201
  serverDir: serverDirAbs,
2202
2202
  distDir: resolve5(projectRoot, ".theokit")
2203
2203
  });
2204
- const { actionsVirtualModule } = await import("./actions-virtual-module-6LND2WHL.js");
2204
+ const { actionsVirtualModule } = await import("./actions-virtual-module-EAKYEMGF.js");
2205
2205
  const actionsPlugin = actionsVirtualModule({
2206
2206
  serverDir: serverDirAbs,
2207
2207
  distDir: resolve5(projectRoot, ".theokit")
2208
2208
  });
2209
2209
  const { agentsTypedClientPlugin } = await import("./agents-typed-client-D4OA2TXB.js");
2210
- const { generateManifest } = await import("./internal-api-BNDRCEPZ.js");
2210
+ const { generateManifest } = await import("./internal-api-VDYOXOT7.js");
2211
2211
  const agentsClientPlugin = agentsTypedClientPlugin({
2212
2212
  projectRoot,
2213
2213
  agentsDir: agentsDirName,
@@ -2224,7 +2224,7 @@ async function theoPluginAsync(rootOrOptions) {
2224
2224
  const controllerTransformPlugin = controllerSwcTransformPlugin({
2225
2225
  serverDir: serverDirAbs
2226
2226
  });
2227
- const { serverOnlyImportBoundary } = await import("./server-boundary-P52I6YMH.js");
2227
+ const { serverOnlyImportBoundary } = await import("./server-boundary-AO6EELRF.js");
2228
2228
  const serverBoundaryPlugin = serverOnlyImportBoundary({
2229
2229
  projectRoot,
2230
2230
  serverDir: serverDirAbs
@@ -2400,4 +2400,4 @@ export {
2400
2400
  theoPluginAsync,
2401
2401
  theoPlugin
2402
2402
  };
2403
- //# sourceMappingURL=chunk-RDG5GMDW.js.map
2403
+ //# sourceMappingURL=chunk-4EQEJ4PH.js.map
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-WBB3MEEN.js";
17
17
  import {
18
18
  createServerContext
19
- } from "./chunk-4D4YVXHR.js";
19
+ } from "./chunk-SYIQV4UH.js";
20
20
  import {
21
21
  validateCsrfRequest
22
22
  } from "./chunk-P6OS7652.js";
@@ -570,4 +570,4 @@ export {
570
570
  createAgentSubjectResolver,
571
571
  createSubjectResolverFromFactory
572
572
  };
573
- //# sourceMappingURL=chunk-IVGQMV3S.js.map
573
+ //# sourceMappingURL=chunk-6U67SO5U.js.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-O2KGDLA7.js";
5
5
  import {
6
6
  validateRouteInput
7
- } from "./chunk-4D4YVXHR.js";
7
+ } from "./chunk-SYIQV4UH.js";
8
8
  import {
9
9
  evaluateRoutePolicy,
10
10
  subjectFromContext
@@ -296,4 +296,4 @@ export {
296
296
  callProcedure,
297
297
  createOpenApiHandler
298
298
  };
299
- //# sourceMappingURL=chunk-YWWMYEAC.js.map
299
+ //# sourceMappingURL=chunk-CLSYYO5F.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  dispatchCsrfWarn
3
- } from "./chunk-KOG5K26V.js";
3
+ } from "./chunk-2Z7TANA4.js";
4
4
  import {
5
5
  incomingMessageToWebRequest,
6
6
  sendError
7
- } from "./chunk-4D4YVXHR.js";
7
+ } from "./chunk-SYIQV4UH.js";
8
8
  import {
9
9
  enforceCsrf
10
10
  } from "./chunk-P6OS7652.js";
@@ -172,4 +172,4 @@ export {
172
172
  scanControllerModules,
173
173
  dispatchControllerRequest
174
174
  };
175
- //# sourceMappingURL=chunk-JMN4COMK.js.map
175
+ //# sourceMappingURL=chunk-D7STTNQN.js.map
@@ -178,7 +178,7 @@ async function agentCommand(name, message, deps = {}) {
178
178
  async function createAgentSsrLoader(projectRoot) {
179
179
  const { createServer } = await import("vite");
180
180
  const react = (await import("@vitejs/plugin-react")).default;
181
- const { theoPluginAsync } = await import("./vite-plugin-WFA7NPYK.js");
181
+ const { theoPluginAsync } = await import("./vite-plugin-3ON45MQE.js");
182
182
  const { loadConfig } = await import("./load-config-52H3EKAA.js");
183
183
  const config = await loadConfig(projectRoot);
184
184
  const theoPlugins = await theoPluginAsync({
@@ -212,4 +212,4 @@ export {
212
212
  agentCommand,
213
213
  createAgentSsrLoader
214
214
  };
215
- //# sourceMappingURL=chunk-LJNMSKFL.js.map
215
+ //# sourceMappingURL=chunk-DKX7LF5Q.js.map
@@ -542,6 +542,24 @@ async function runWebShapedMiddleware(mw, req, res, context) {
542
542
  function isWebShaped(mw) {
543
543
  return WEB_SHAPED_MIDDLEWARE in mw;
544
544
  }
545
+ var warnedUninvocable = /* @__PURE__ */ new Set();
546
+ function describeUninvocable(value) {
547
+ if (value === void 0) return "no default export";
548
+ if (value === null) return "a default export of `null`";
549
+ if (typeof value !== "object") return `a default export of type \`${typeof value}\``;
550
+ const keys = Object.keys(value);
551
+ if (keys.includes("build") && keys.includes("handle")) {
552
+ return "a middleware BUILDER that was never built \u2014 call `.handle(fn).build()` on it";
553
+ }
554
+ return `an object with keys [${keys.join(", ")}]`;
555
+ }
556
+ function reportUninvocableMiddleware(path, value) {
557
+ if (warnedUninvocable.has(path)) return;
558
+ warnedUninvocable.add(path);
559
+ console.warn(
560
+ `[theokit] middleware not run: ${path} exports ${describeUninvocable(value)}. The file-scan runner invokes a function; this export is not one, so it was skipped and the request was answered without it.`
561
+ );
562
+ }
545
563
  async function runScannedMiddleware(mw, req, res, context) {
546
564
  if (isWebShaped(mw)) {
547
565
  const { shortCircuited } = await runWebShapedMiddleware(mw, req, res, context);
@@ -600,7 +618,10 @@ async function runMiddlewareAndContext(req, res, loadModule, serverDir) {
600
618
  for (const mwPath of dirMiddlewares) {
601
619
  const mod = await loadModule(mwPath);
602
620
  const mw = mod.default;
603
- if (typeof mw !== "function") continue;
621
+ if (typeof mw !== "function") {
622
+ reportUninvocableMiddleware(mwPath, mod.default);
623
+ continue;
624
+ }
604
625
  const { aborted } = await runScannedMiddleware(mw, req, res, middlewareCtx);
605
626
  if (aborted) return { ctx: middlewareCtx, aborted: true };
606
627
  }
@@ -611,6 +632,8 @@ async function runMiddlewareAndContext(req, res, loadModule, serverDir) {
611
632
  if (typeof mw === "function") {
612
633
  const { aborted } = await runScannedMiddleware(mw, req, res, middlewareCtx);
613
634
  if (aborted) return { ctx: middlewareCtx, aborted: true };
635
+ } else {
636
+ reportUninvocableMiddleware(singleFilePath, mod.default);
614
637
  }
615
638
  }
616
639
  const factoryCtx = await createServerContext(req, res, loadModule, serverDir);
@@ -2712,4 +2735,4 @@ export {
2712
2735
  CsrfReadinessStore,
2713
2736
  applySecurityHeaders
2714
2737
  };
2715
- //# sourceMappingURL=chunk-EZHDAVAF.js.map
2738
+ //# sourceMappingURL=chunk-E2RC367T.js.map