theokit 0.53.0 → 0.54.0

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 (108) hide show
  1. package/dist/{actions-virtual-module-VJYKUIXE.js → actions-virtual-module-FGJR3I7V.js} +5 -5
  2. package/dist/{actions-virtual-module-SNG4JC35.js → actions-virtual-module-M4MTKOAX.js} +7 -7
  3. package/dist/adapters/agent-mount.js +1 -1
  4. package/dist/{agent-GX4RIRRX.js → agent-TKCC4WZ6.js} +3 -3
  5. package/dist/{app-typed-client-DFRID25X.js → app-typed-client-22BZ3KDX.js} +7 -7
  6. package/dist/{app-typed-client-IPWJWM2E.js → app-typed-client-6MNNVMJU.js} +5 -5
  7. package/dist/{build-IVLQ5TUQ.js → build-JH53TZJI.js} +8 -8
  8. package/dist/{chunk-XLLW46MB.js → chunk-2HWWJTOH.js} +7 -5
  9. package/dist/chunk-2HWWJTOH.js.map +1 -0
  10. package/dist/{chunk-FH3SQR6P.js → chunk-4OTIXAUY.js} +11 -3
  11. package/dist/chunk-4OTIXAUY.js.map +1 -0
  12. package/dist/{chunk-6AM7HIRM.js → chunk-5NNFO7R7.js} +1 -1
  13. package/dist/{chunk-6AM7HIRM.js.map → chunk-5NNFO7R7.js.map} +1 -1
  14. package/dist/{chunk-GSIOWE5B.js → chunk-5VLP3GQ2.js} +2 -2
  15. package/dist/{chunk-2E7JLV7L.js → chunk-6VYF5PMG.js} +2 -2
  16. package/dist/{chunk-YZCD3DWE.js → chunk-AI7GBBRB.js} +2 -2
  17. package/dist/{chunk-VGE6AKEJ.js → chunk-DAE7BJ7H.js} +2 -2
  18. package/dist/{chunk-5BOKW3GX.js → chunk-FVFYACYK.js} +2 -2
  19. package/dist/chunk-FVFYACYK.js.map +1 -0
  20. package/dist/{chunk-QTHVHNJJ.js → chunk-HA35FS7U.js} +2 -2
  21. package/dist/{chunk-LPNSZK3A.js → chunk-HLDXHDCB.js} +12 -12
  22. package/dist/{chunk-VHB2FSPM.js → chunk-I2UN46ZX.js} +39 -24
  23. package/dist/chunk-I2UN46ZX.js.map +1 -0
  24. package/dist/{chunk-E53UIFH6.js → chunk-IHAQUUT2.js} +3 -3
  25. package/dist/chunk-IHAQUUT2.js.map +1 -0
  26. package/dist/{chunk-YYOBMOO4.js → chunk-NO6HA4FG.js} +35 -22
  27. package/dist/chunk-NO6HA4FG.js.map +1 -0
  28. package/dist/{chunk-Q5L5EGWZ.js → chunk-NZDGV4YJ.js} +2 -2
  29. package/dist/{chunk-VI7ZANB3.js → chunk-OSBGZYXZ.js} +20 -2
  30. package/dist/chunk-OSBGZYXZ.js.map +1 -0
  31. package/dist/{chunk-67DBYOXI.js → chunk-S6RWUH3J.js} +19 -11
  32. package/dist/chunk-S6RWUH3J.js.map +1 -0
  33. package/dist/{chunk-Y5E7VFNJ.js → chunk-SIGUGCBS.js} +5 -5
  34. package/dist/{chunk-JUDNKBDQ.js → chunk-WX6NHGKS.js} +20 -2
  35. package/dist/chunk-WX6NHGKS.js.map +1 -0
  36. package/dist/cli/index.js +9 -9
  37. package/dist/{dev-TLVSKNSH.js → dev-6KDYNF5E.js} +12 -12
  38. package/dist/{dev-emit-SPSV6UU7.js → dev-emit-QGSMUZLU.js} +4 -4
  39. package/dist/{dev-emit-G2E2U3NP.js → dev-emit-W27J3DLU.js} +2 -2
  40. package/dist/{index-C8YN9dpF.d.ts → index-ADEV6pen.d.ts} +1 -1
  41. package/dist/index.d.ts +2 -1
  42. package/dist/index.js +5 -5
  43. package/dist/{info-Y55RWS42.js → info-6WJ3JRNE.js} +4 -4
  44. package/dist/{internal-api-EL25ADPR.js → internal-api-TA37BXH7.js} +7 -7
  45. package/dist/{internal-api-S6BGJCZP.js → internal-api-VUDJUWYE.js} +5 -5
  46. package/dist/{load-config-4ATXQUN3.js → load-config-BKUAMGO5.js} +4 -4
  47. package/dist/{match-DmGgxjIU.d.ts → match-Dw4CNXJH.d.ts} +8 -0
  48. package/dist/{mcp-OZACRG7O.js → mcp-2RQCKWQR.js} +4 -4
  49. package/dist/{observability-bootstrap-M2WSDIDV.js → observability-bootstrap-H4NSILXD.js} +3 -3
  50. package/dist/{openapi-2IBBOS3Q.js → openapi-PKDDJ7M2.js} +7 -7
  51. package/dist/{preview-DCJPTZVW.js → preview-J57QZNTO.js} +3 -3
  52. package/dist/{routes-PP5PHHLR.js → routes-A2YLFEYC.js} +5 -5
  53. package/dist/{schema-SOAD43RQ.js → schema-WKTNTGX6.js} +3 -3
  54. package/dist/{schemas-4AXHQMV3.js → schemas-QCMSKQDK.js} +2 -2
  55. package/dist/server/http/index.d.ts +2 -2
  56. package/dist/server/http/index.js +2 -2
  57. package/dist/server/index.d.ts +2 -2
  58. package/dist/server/index.js +3 -3
  59. package/dist/server/scan/index.d.ts +8 -2
  60. package/dist/server/scan/index.js +1 -1
  61. package/dist/{server-boundary-XRXVVUMO.js → server-boundary-4UIGB3G5.js} +5 -5
  62. package/dist/{server-boundary-RNM25WWD.js → server-boundary-A2PUD4JV.js} +7 -7
  63. package/dist/{start-WILEDDW2.js → start-3F4LVHWS.js} +95 -13
  64. package/dist/start-3F4LVHWS.js.map +1 -0
  65. package/dist/vite-plugin/index.js +5 -5
  66. package/dist/{vite-plugin-KIBK7OYL.js → vite-plugin-VYNUCEI2.js} +11 -11
  67. package/package.json +2 -2
  68. package/dist/chunk-5BOKW3GX.js.map +0 -1
  69. package/dist/chunk-67DBYOXI.js.map +0 -1
  70. package/dist/chunk-E53UIFH6.js.map +0 -1
  71. package/dist/chunk-FH3SQR6P.js.map +0 -1
  72. package/dist/chunk-JUDNKBDQ.js.map +0 -1
  73. package/dist/chunk-VHB2FSPM.js.map +0 -1
  74. package/dist/chunk-VI7ZANB3.js.map +0 -1
  75. package/dist/chunk-XLLW46MB.js.map +0 -1
  76. package/dist/chunk-YYOBMOO4.js.map +0 -1
  77. package/dist/start-WILEDDW2.js.map +0 -1
  78. /package/dist/{actions-virtual-module-VJYKUIXE.js.map → actions-virtual-module-FGJR3I7V.js.map} +0 -0
  79. /package/dist/{actions-virtual-module-SNG4JC35.js.map → actions-virtual-module-M4MTKOAX.js.map} +0 -0
  80. /package/dist/{agent-GX4RIRRX.js.map → agent-TKCC4WZ6.js.map} +0 -0
  81. /package/dist/{app-typed-client-DFRID25X.js.map → app-typed-client-22BZ3KDX.js.map} +0 -0
  82. /package/dist/{app-typed-client-IPWJWM2E.js.map → app-typed-client-6MNNVMJU.js.map} +0 -0
  83. /package/dist/{build-IVLQ5TUQ.js.map → build-JH53TZJI.js.map} +0 -0
  84. /package/dist/{chunk-GSIOWE5B.js.map → chunk-5VLP3GQ2.js.map} +0 -0
  85. /package/dist/{chunk-2E7JLV7L.js.map → chunk-6VYF5PMG.js.map} +0 -0
  86. /package/dist/{chunk-YZCD3DWE.js.map → chunk-AI7GBBRB.js.map} +0 -0
  87. /package/dist/{chunk-VGE6AKEJ.js.map → chunk-DAE7BJ7H.js.map} +0 -0
  88. /package/dist/{chunk-QTHVHNJJ.js.map → chunk-HA35FS7U.js.map} +0 -0
  89. /package/dist/{chunk-LPNSZK3A.js.map → chunk-HLDXHDCB.js.map} +0 -0
  90. /package/dist/{chunk-Q5L5EGWZ.js.map → chunk-NZDGV4YJ.js.map} +0 -0
  91. /package/dist/{chunk-Y5E7VFNJ.js.map → chunk-SIGUGCBS.js.map} +0 -0
  92. /package/dist/{dev-TLVSKNSH.js.map → dev-6KDYNF5E.js.map} +0 -0
  93. /package/dist/{dev-emit-SPSV6UU7.js.map → dev-emit-QGSMUZLU.js.map} +0 -0
  94. /package/dist/{dev-emit-G2E2U3NP.js.map → dev-emit-W27J3DLU.js.map} +0 -0
  95. /package/dist/{info-Y55RWS42.js.map → info-6WJ3JRNE.js.map} +0 -0
  96. /package/dist/{internal-api-EL25ADPR.js.map → internal-api-TA37BXH7.js.map} +0 -0
  97. /package/dist/{internal-api-S6BGJCZP.js.map → internal-api-VUDJUWYE.js.map} +0 -0
  98. /package/dist/{load-config-4ATXQUN3.js.map → load-config-BKUAMGO5.js.map} +0 -0
  99. /package/dist/{mcp-OZACRG7O.js.map → mcp-2RQCKWQR.js.map} +0 -0
  100. /package/dist/{observability-bootstrap-M2WSDIDV.js.map → observability-bootstrap-H4NSILXD.js.map} +0 -0
  101. /package/dist/{openapi-2IBBOS3Q.js.map → openapi-PKDDJ7M2.js.map} +0 -0
  102. /package/dist/{preview-DCJPTZVW.js.map → preview-J57QZNTO.js.map} +0 -0
  103. /package/dist/{routes-PP5PHHLR.js.map → routes-A2YLFEYC.js.map} +0 -0
  104. /package/dist/{schema-SOAD43RQ.js.map → schema-WKTNTGX6.js.map} +0 -0
  105. /package/dist/{schemas-4AXHQMV3.js.map → schemas-QCMSKQDK.js.map} +0 -0
  106. /package/dist/{server-boundary-XRXVVUMO.js.map → server-boundary-4UIGB3G5.js.map} +0 -0
  107. /package/dist/{server-boundary-RNM25WWD.js.map → server-boundary-A2PUD4JV.js.map} +0 -0
  108. /package/dist/{vite-plugin-KIBK7OYL.js.map → vite-plugin-VYNUCEI2.js.map} +0 -0
@@ -3,14 +3,14 @@ import "tsx/esm";
3
3
  import {
4
4
  deepMerge,
5
5
  loadConfig
6
- } from "./chunk-QTHVHNJJ.js";
6
+ } from "./chunk-HA35FS7U.js";
7
7
  import "./chunk-3QPVEJ7D.js";
8
8
  import "./chunk-U5PWXS3J.js";
9
- import "./chunk-FH3SQR6P.js";
9
+ import "./chunk-4OTIXAUY.js";
10
10
  import "./chunk-ZNZISJDZ.js";
11
- import "./chunk-VI7ZANB3.js";
11
+ import "./chunk-OSBGZYXZ.js";
12
12
  export {
13
13
  deepMerge,
14
14
  loadConfig
15
15
  };
16
- //# sourceMappingURL=load-config-4ATXQUN3.js.map
16
+ //# sourceMappingURL=load-config-BKUAMGO5.js.map
@@ -31,6 +31,14 @@ interface ServerRouteNode {
31
31
  * compatibility with manifests generated before G1. Empty array means the
32
32
  * file has no HTTP exports (util-only); undefined means "not detected". */
33
33
  methods?: string[];
34
+ /**
35
+ * The subset of `methods` whose policy is the literal `'public'` (ADR 0001).
36
+ *
37
+ * `undefined` means "not detected" — a manifest built before the field existed — and is NOT the
38
+ * same as `[]`, which means "detected, and nothing is public". `public-exposure-gate.ts` depends
39
+ * on that distinction: reading absence as safety is the failure it exists to prevent.
40
+ */
41
+ publicMethods?: string[];
34
42
  }
35
43
  declare function compilePattern(routePath: string): {
36
44
  pattern: RegExp;
@@ -2,7 +2,7 @@
2
2
  import "tsx/esm";
3
3
  import {
4
4
  createAgentSsrLoader
5
- } from "./chunk-Y5E7VFNJ.js";
5
+ } from "./chunk-SIGUGCBS.js";
6
6
  import {
7
7
  extractAppResources,
8
8
  handleMcpJsonRpc
@@ -10,7 +10,7 @@ import {
10
10
  import "./chunk-5YPXXSYY.js";
11
11
  import {
12
12
  scanAgents
13
- } from "./chunk-6AM7HIRM.js";
13
+ } from "./chunk-5NNFO7R7.js";
14
14
  import "./chunk-Z7CJHDLS.js";
15
15
  import "./chunk-3QPVEJ7D.js";
16
16
 
@@ -46,7 +46,7 @@ async function serveMcpStdio(mod, name, appResources, streams) {
46
46
  // src/cli/commands/mcp.ts
47
47
  async function mcpCommand(name, deps = {}) {
48
48
  const projectRoot = deps.projectRoot ?? process.cwd();
49
- const agentsDir = deps.agentsDir ?? (await (await import("./load-config-4ATXQUN3.js")).loadConfig(projectRoot)).agentsDir;
49
+ const agentsDir = deps.agentsDir ?? (await (await import("./load-config-BKUAMGO5.js")).loadConfig(projectRoot)).agentsDir;
50
50
  const agent = scanAgents(projectRoot, agentsDir).find((a) => a.name === name);
51
51
  if (!agent) {
52
52
  const names = scanAgents(projectRoot, agentsDir).map((a) => a.name).join(", ");
@@ -75,4 +75,4 @@ async function mcpCommand(name, deps = {}) {
75
75
  export {
76
76
  mcpCommand
77
77
  };
78
- //# sourceMappingURL=mcp-OZACRG7O.js.map
78
+ //# sourceMappingURL=mcp-2RQCKWQR.js.map
@@ -4,13 +4,13 @@ import {
4
4
  _resetObservabilityAdapter,
5
5
  createObservabilityPluginFromConfig,
6
6
  getObservabilityAdapter
7
- } from "./chunk-GSIOWE5B.js";
7
+ } from "./chunk-5VLP3GQ2.js";
8
8
  import "./chunk-C27VRUVN.js";
9
9
  import "./chunk-7UZZHCRN.js";
10
- import "./chunk-VI7ZANB3.js";
10
+ import "./chunk-OSBGZYXZ.js";
11
11
  export {
12
12
  _resetObservabilityAdapter,
13
13
  createObservabilityPluginFromConfig,
14
14
  getObservabilityAdapter
15
15
  };
16
- //# sourceMappingURL=observability-bootstrap-M2WSDIDV.js.map
16
+ //# sourceMappingURL=observability-bootstrap-H4NSILXD.js.map
@@ -6,18 +6,18 @@ import {
6
6
  } from "./chunk-47VNWTL4.js";
7
7
  import {
8
8
  generateManifest
9
- } from "./chunk-XLLW46MB.js";
10
- import "./chunk-6AM7HIRM.js";
11
- import "./chunk-YYOBMOO4.js";
9
+ } from "./chunk-2HWWJTOH.js";
10
+ import "./chunk-5NNFO7R7.js";
11
+ import "./chunk-NO6HA4FG.js";
12
12
  import "./chunk-Z7CJHDLS.js";
13
13
  import {
14
14
  loadConfig
15
- } from "./chunk-QTHVHNJJ.js";
15
+ } from "./chunk-HA35FS7U.js";
16
16
  import "./chunk-3QPVEJ7D.js";
17
17
  import "./chunk-U5PWXS3J.js";
18
- import "./chunk-FH3SQR6P.js";
18
+ import "./chunk-4OTIXAUY.js";
19
19
  import "./chunk-ZNZISJDZ.js";
20
- import "./chunk-VI7ZANB3.js";
20
+ import "./chunk-OSBGZYXZ.js";
21
21
 
22
22
  // src/cli/commands/openapi.ts
23
23
  import { mkdtempSync, rmSync } from "fs";
@@ -84,4 +84,4 @@ function emitOpenApiInMemory(manifest, config) {
84
84
  export {
85
85
  openapiCommand
86
86
  };
87
- //# sourceMappingURL=openapi-2IBBOS3Q.js.map
87
+ //# sourceMappingURL=openapi-PKDDJ7M2.js.map
@@ -4,8 +4,8 @@ import "tsx/esm";
4
4
  // src/cli/commands/preview.ts
5
5
  async function defaultSteps() {
6
6
  const [{ buildCommand }, { startCommand }] = await Promise.all([
7
- import("./build-IVLQ5TUQ.js"),
8
- import("./start-WILEDDW2.js")
7
+ import("./build-JH53TZJI.js"),
8
+ import("./start-3F4LVHWS.js")
9
9
  ]);
10
10
  return {
11
11
  build: (opts) => buildCommand(opts),
@@ -20,4 +20,4 @@ async function previewCommand(options = {}, steps) {
20
20
  export {
21
21
  previewCommand
22
22
  };
23
- //# sourceMappingURL=preview-DCJPTZVW.js.map
23
+ //# sourceMappingURL=preview-J57QZNTO.js.map
@@ -7,16 +7,16 @@ import {
7
7
  scanServerActions,
8
8
  scanServerRoutes,
9
9
  scanWebSocketRoutes
10
- } from "./chunk-YYOBMOO4.js";
10
+ } from "./chunk-NO6HA4FG.js";
11
11
  import "./chunk-Z7CJHDLS.js";
12
12
  import {
13
13
  loadConfig
14
- } from "./chunk-QTHVHNJJ.js";
14
+ } from "./chunk-HA35FS7U.js";
15
15
  import "./chunk-3QPVEJ7D.js";
16
16
  import "./chunk-U5PWXS3J.js";
17
- import "./chunk-FH3SQR6P.js";
17
+ import "./chunk-4OTIXAUY.js";
18
18
  import "./chunk-ZNZISJDZ.js";
19
- import "./chunk-VI7ZANB3.js";
19
+ import "./chunk-OSBGZYXZ.js";
20
20
 
21
21
  // src/cli/commands/routes.ts
22
22
  import { resolve, relative } from "path";
@@ -64,4 +64,4 @@ async function routesCommand() {
64
64
  export {
65
65
  routesCommand
66
66
  };
67
- //# sourceMappingURL=routes-PP5PHHLR.js.map
67
+ //# sourceMappingURL=routes-A2YLFEYC.js.map
@@ -2,14 +2,14 @@
2
2
  import "tsx/esm";
3
3
  import {
4
4
  theoConfigSchema
5
- } from "./chunk-FH3SQR6P.js";
5
+ } from "./chunk-4OTIXAUY.js";
6
6
  import "./chunk-ZNZISJDZ.js";
7
7
  import {
8
8
  cacheSchema,
9
9
  corsSchema,
10
10
  securityHeadersSchema,
11
11
  storageSchema
12
- } from "./chunk-VI7ZANB3.js";
12
+ } from "./chunk-OSBGZYXZ.js";
13
13
  export {
14
14
  cacheSchema,
15
15
  corsSchema,
@@ -17,4 +17,4 @@ export {
17
17
  storageSchema,
18
18
  theoConfigSchema
19
19
  };
20
- //# sourceMappingURL=schema-SOAD43RQ.js.map
20
+ //# sourceMappingURL=schema-WKTNTGX6.js.map
@@ -10,7 +10,7 @@ import {
10
10
  securitySchema,
11
11
  storageSchema,
12
12
  uploadSchema
13
- } from "./chunk-VI7ZANB3.js";
13
+ } from "./chunk-OSBGZYXZ.js";
14
14
  export {
15
15
  cacheSchema,
16
16
  corsSchema,
@@ -22,4 +22,4 @@ export {
22
22
  storageSchema,
23
23
  uploadSchema
24
24
  };
25
- //# sourceMappingURL=schemas-4AXHQMV3.js.map
25
+ //# sourceMappingURL=schemas-QCMSKQDK.js.map
@@ -1,11 +1,11 @@
1
- export { B as BATCH_PATH, a as BatchExecuteFn, b as BatchPathConflictError, c as BatchPayload, d as BatchRequestItem, e as BatchResponse, f as BatchResultItem, C as CookieOptions, h as CorsConfig, i as CorsHandler, j as CorsOrigin, k as CorsWebHandler, l as CustomErrorPages, E as ExecuteActionOptions, m as ExecuteRouteContext, F as FileTooLargeError, H as HandleBatchOptions, M as MAX_ERROR_HTML_BYTES, n as MiddlewareResult, N as NotFoundError, p as ProcedureInputError, q as ProcedureOutputError, S as STRIPPED_HEADERS, u as SendErrorInput, v as SendErrorOptions, T as TRACE_HEADER, w as TRACE_PARENT_HEADER, x as TheoError, W as W3CTraceContext, _ as _resetMiddlewareCacheForTests, z as appendCookieToHeaders, A as appendDeleteCookieToHeaders, D as callProcedure, G as createCorsHandler, I as createCorsWebHandler, J as createOpenApiHandler, K as createServerContext, L as deleteCookie, Q as envelopeCodeToStatus, V as executeAction, X as executeRoute, Y as executeWebRequest, Z as extractTraceId, $ as extractTraceIdFromRequest, a0 as extractW3CTraceContext, a1 as fromUnknown, a2 as getCookie, a3 as getCookieFromRequest, a4 as handleBatchRequest, a5 as handleRequestError, a6 as handleWebRequestError, a7 as jsonTransformer, a8 as loadCustomErrorPages, a9 as matchesOrigin, aa as parseCookieHeader, ab as parseRequestBody, ac as parseTraceparent, ad as parseTraceparentContext, ae as resolveTransformer, af as runMiddlewareAndContext, ag as sendError, ah as sendJson, ai as serializeCookie, aj as serveStaticFile, ak as serverErrorToEnvelope, al as setCookie, am as superjsonTransformer, an as validateRouteInput } from '../../index-C8YN9dpF.js';
1
+ export { B as BATCH_PATH, a as BatchExecuteFn, b as BatchPathConflictError, c as BatchPayload, d as BatchRequestItem, e as BatchResponse, f as BatchResultItem, C as CookieOptions, h as CorsConfig, i as CorsHandler, j as CorsOrigin, k as CorsWebHandler, l as CustomErrorPages, E as ExecuteActionOptions, m as ExecuteRouteContext, F as FileTooLargeError, H as HandleBatchOptions, M as MAX_ERROR_HTML_BYTES, n as MiddlewareResult, N as NotFoundError, p as ProcedureInputError, q as ProcedureOutputError, S as STRIPPED_HEADERS, u as SendErrorInput, v as SendErrorOptions, T as TRACE_HEADER, w as TRACE_PARENT_HEADER, x as TheoError, W as W3CTraceContext, _ as _resetMiddlewareCacheForTests, z as appendCookieToHeaders, A as appendDeleteCookieToHeaders, D as callProcedure, G as createCorsHandler, I as createCorsWebHandler, J as createOpenApiHandler, K as createServerContext, L as deleteCookie, Q as envelopeCodeToStatus, V as executeAction, X as executeRoute, Y as executeWebRequest, Z as extractTraceId, $ as extractTraceIdFromRequest, a0 as extractW3CTraceContext, a1 as fromUnknown, a2 as getCookie, a3 as getCookieFromRequest, a4 as handleBatchRequest, a5 as handleRequestError, a6 as handleWebRequestError, a7 as jsonTransformer, a8 as loadCustomErrorPages, a9 as matchesOrigin, aa as parseCookieHeader, ab as parseRequestBody, ac as parseTraceparent, ad as parseTraceparentContext, ae as resolveTransformer, af as runMiddlewareAndContext, ag as sendError, ah as sendJson, ai as serializeCookie, aj as serveStaticFile, ak as serverErrorToEnvelope, al as setCookie, am as superjsonTransformer, an as validateRouteInput } from '../../index-ADEV6pen.js';
2
2
  export { A as ActionError, b as ActionInputError, f as extractUniversalIssues, i as isActionError, d as isInputError } from '../../action-protocol-tGm3NKRg.js';
3
3
  import '../../error-envelope-DG47lt8E.js';
4
4
  import 'node:http';
5
5
  import '../../plugin-types-BUVfUQ0V.js';
6
6
  import '../../plugin-runner-BVMOSxvb.js';
7
7
  import '../../job-backend-CgC8Xf33.js';
8
- import '../../match-DmGgxjIU.js';
8
+ import '../../match-Dw4CNXJH.js';
9
9
  import 'vite';
10
10
  import '../../csrf-Dgot9qSM.js';
11
11
  import '../../audit-log-BQWM5YLG.js';
@@ -6,7 +6,7 @@ import {
6
6
  createOpenApiHandler,
7
7
  loadCustomErrorPages,
8
8
  serveStaticFile
9
- } from "../../chunk-YZCD3DWE.js";
9
+ } from "../../chunk-AI7GBBRB.js";
10
10
  import {
11
11
  jsonTransformer,
12
12
  resolveTransformer,
@@ -31,7 +31,7 @@ import {
31
31
  sendError,
32
32
  sendJson,
33
33
  validateRouteInput
34
- } from "../../chunk-5BOKW3GX.js";
34
+ } from "../../chunk-FVFYACYK.js";
35
35
  import {
36
36
  ActionError,
37
37
  ActionInputError,
@@ -4,10 +4,10 @@ export { W as WebSocketHandler, a as WebSocketHandlerWeb, b as WebSocketLike } f
4
4
  export { C as CustomTool, D as DefineAgentToolSpec, T as ToolContextMessage, a as ToolHandlerContext, b as ToolTransform, c as applyTransform } from '../define-agent-tool-CizaYZwU.js';
5
5
  export { A as AccessDecision, R as RoutePolicy, b as RoutePolicyInput, a as RouteSubject, e as evaluateRoutePolicy, r as requireOwner, s as subjectFromContext } from '../route-policy-BxOycCDq.js';
6
6
  export { H as HEALTH_PATH, a as HealthRouteConfig, b as READY_PATH, c as ReadyRouteConfig, d as ReservedResponse, R as ReservedRoutes, e as defineHealthRoute, f as defineReadyRoute, s as serveReservedRoute } from '../health-route-C0hk64_U.js';
7
- export { B as BATCH_PATH, a as BatchExecuteFn, b as BatchPathConflictError, c as BatchPayload, d as BatchRequestItem, e as BatchResponse, f as BatchResultItem, g as BodyParserOptions, C as CookieOptions, h as CorsConfig, i as CorsHandler, j as CorsOrigin, k as CorsWebHandler, l as CustomErrorPages, E as ExecuteActionOptions, m as ExecuteRouteContext, F as FileTooLargeError, H as HandleBatchOptions, M as MAX_ERROR_HTML_BYTES, n as MiddlewareResult, N as NotFoundError, O as OpenApiDocsOptions, P as ParsedBody, o as ProcedureInput, p as ProcedureInputError, q as ProcedureOutputError, R as RawRouteInput, r as RouteInputChannel, s as RouteInputSchemas, t as RouteInputValidation, S as STRIPPED_HEADERS, u as SendErrorInput, v as SendErrorOptions, T as TRACE_HEADER, w as TRACE_PARENT_HEADER, x as TheoError, y as TheoTransformer, U as UploadedFile, W as W3CTraceContext, _ as _resetMiddlewareCacheForTests, z as appendCookieToHeaders, A as appendDeleteCookieToHeaders, D as callProcedure, G as createCorsHandler, I as createCorsWebHandler, J as createOpenApiHandler, K as createServerContext, L as deleteCookie, Q as envelopeCodeToStatus, V as executeAction, X as executeRoute, Y as executeWebRequest, Z as extractTraceId, $ as extractTraceIdFromRequest, a0 as extractW3CTraceContext, a1 as fromUnknown, a2 as getCookie, a3 as getCookieFromRequest, a4 as handleBatchRequest, a5 as handleRequestError, a6 as handleWebRequestError, a7 as jsonTransformer, a8 as loadCustomErrorPages, a9 as matchesOrigin, aa as parseCookieHeader, ab as parseRequestBody, ac as parseTraceparent, ad as parseTraceparentContext, ae as resolveTransformer, af as runMiddlewareAndContext, ag as sendError, ah as sendJson, ai as serializeCookie, aj as serveStaticFile, ak as serverErrorToEnvelope, al as setCookie, am as superjsonTransformer, an as validateRouteInput } from '../index-C8YN9dpF.js';
7
+ export { B as BATCH_PATH, a as BatchExecuteFn, b as BatchPathConflictError, c as BatchPayload, d as BatchRequestItem, e as BatchResponse, f as BatchResultItem, g as BodyParserOptions, C as CookieOptions, h as CorsConfig, i as CorsHandler, j as CorsOrigin, k as CorsWebHandler, l as CustomErrorPages, E as ExecuteActionOptions, m as ExecuteRouteContext, F as FileTooLargeError, H as HandleBatchOptions, M as MAX_ERROR_HTML_BYTES, n as MiddlewareResult, N as NotFoundError, O as OpenApiDocsOptions, P as ParsedBody, o as ProcedureInput, p as ProcedureInputError, q as ProcedureOutputError, R as RawRouteInput, r as RouteInputChannel, s as RouteInputSchemas, t as RouteInputValidation, S as STRIPPED_HEADERS, u as SendErrorInput, v as SendErrorOptions, T as TRACE_HEADER, w as TRACE_PARENT_HEADER, x as TheoError, y as TheoTransformer, U as UploadedFile, W as W3CTraceContext, _ as _resetMiddlewareCacheForTests, z as appendCookieToHeaders, A as appendDeleteCookieToHeaders, D as callProcedure, G as createCorsHandler, I as createCorsWebHandler, J as createOpenApiHandler, K as createServerContext, L as deleteCookie, Q as envelopeCodeToStatus, V as executeAction, X as executeRoute, Y as executeWebRequest, Z as extractTraceId, $ as extractTraceIdFromRequest, a0 as extractW3CTraceContext, a1 as fromUnknown, a2 as getCookie, a3 as getCookieFromRequest, a4 as handleBatchRequest, a5 as handleRequestError, a6 as handleWebRequestError, a7 as jsonTransformer, a8 as loadCustomErrorPages, a9 as matchesOrigin, aa as parseCookieHeader, ab as parseRequestBody, ac as parseTraceparent, ad as parseTraceparentContext, ae as resolveTransformer, af as runMiddlewareAndContext, ag as sendError, ah as sendJson, ai as serializeCookie, aj as serveStaticFile, ak as serverErrorToEnvelope, al as setCookie, am as superjsonTransformer, an as validateRouteInput } from '../index-ADEV6pen.js';
8
8
  export { A as ActionError, a as ActionErrorCode, b as ActionInputError, e as ActionManifestEntry, c as ActionResult, S as SerializedActionResult, U as UniversalZodIssue, f as extractUniversalIssues, i as isActionError, d as isInputError } from '../action-protocol-tGm3NKRg.js';
9
9
  export { ACTION_SCHEMAS_DIR, ActionNode, ActionScanError, LoadedManifest, ManifestAction, ManifestAgent, ManifestRoute, ManifestWebSocket, TheoManifest, WebSocketRouteNode, _resetRouteScanCacheForTests, compareRouteSpecificity, generateManifest, loadManifest, scanMiddlewares, scanServerActions, scanServerActionsEnriched, scanServerRoutes, scanWebSocketRoutes, writeManifest } from './scan/index.js';
10
- export { L as LoadModule, S as ServerRouteNode, c as compilePattern, a as createProductionLoader, b as createViteLoader, m as matchRoute } from '../match-DmGgxjIU.js';
10
+ export { L as LoadModule, S as ServerRouteNode, c as compilePattern, a as createProductionLoader, b as createViteLoader, m as matchRoute } from '../match-Dw4CNXJH.js';
11
11
  export { AcpToolConfig, AppResource, AppResourceInput, ChannelMessage, ChannelWebhookConfig, CodeModeApi, CodeModeConfig, CodeModePermission, CodeModePermissionDeniedError, McpResourceContents, McpResourceDescriptor, NodeAcpTransport, Sandbox, StdioStreams, VendorAgentClient, VendorAgentToolConfig, WorkflowLike, WorkflowToolConfig, buildResourceDescriptors, createACPTool, createCodeMode, createVendorAgentTool, createWorkflowTool, defineAppResource, extractAppResources, handleChannelWebhook, handleMcpStdioLine, isChannelPath, parseChannelPath, readAppResource, serveMcpStdio } from './agent/index.js';
12
12
  export { InProcessApprovalRequest, InProcessApprovalRequiredError, InProcessAwaitApproval, StreamAgentTurnDeps, StreamAgentTurnInProcessInput, streamAgentTurnInProcess } from '@theokit/agents';
13
13
  export { P as ProviderDescriptor, R as ResolvedProvider, l as listProviders, a as registerProvider, b as resetProviderRegistry, r as resolveProvider, t as tryResolveProvider } from '../provider-resolver-Dx6QuWrw.js';
@@ -25,7 +25,7 @@ import {
25
25
  createOpenApiHandler,
26
26
  loadCustomErrorPages,
27
27
  serveStaticFile
28
- } from "../chunk-YZCD3DWE.js";
28
+ } from "../chunk-AI7GBBRB.js";
29
29
  import {
30
30
  DuplicateJobNameError,
31
31
  InMemoryJobBackend,
@@ -86,7 +86,7 @@ import {
86
86
  sendError,
87
87
  sendJson,
88
88
  validateRouteInput
89
- } from "../chunk-5BOKW3GX.js";
89
+ } from "../chunk-FVFYACYK.js";
90
90
  import {
91
91
  ActionError,
92
92
  ActionInputError,
@@ -160,7 +160,7 @@ import {
160
160
  scanServerRoutes,
161
161
  scanWebSocketRoutes,
162
162
  writeManifest
163
- } from "../chunk-VHB2FSPM.js";
163
+ } from "../chunk-I2UN46ZX.js";
164
164
  import "../chunk-DV34VG3N.js";
165
165
  import "../chunk-IRASEXOG.js";
166
166
  import {
@@ -1,5 +1,5 @@
1
- import { S as ServerRouteNode } from '../../match-DmGgxjIU.js';
2
- export { L as LoadModule, c as compilePattern, a as createProductionLoader, b as createViteLoader, m as matchRoute } from '../../match-DmGgxjIU.js';
1
+ import { S as ServerRouteNode } from '../../match-Dw4CNXJH.js';
2
+ export { L as LoadModule, c as compilePattern, a as createProductionLoader, b as createViteLoader, m as matchRoute } from '../../match-Dw4CNXJH.js';
3
3
  import { A as AgentNode } from '../../agent-scan-BZa-pagG.js';
4
4
  import 'vite';
5
5
 
@@ -114,6 +114,12 @@ interface ManifestRoute {
114
114
  /** HTTP methods (uppercase) the route file exports. Optional — manifests
115
115
  * generated before G1 omit this; loaders treat absence as "unknown". */
116
116
  methods?: string[];
117
+ /**
118
+ * The subset of `methods` declaring `policy('public')`. Optional for the same reason `methods`
119
+ * is: a manifest written before the field existed has none, and `public-exposure-gate.ts` reads
120
+ * that absence as "not measured" rather than as "nothing is public".
121
+ */
122
+ publicMethods?: string[];
117
123
  }
118
124
  interface ManifestAction {
119
125
  filePath: string;
@@ -17,7 +17,7 @@ import {
17
17
  scanServerRoutes,
18
18
  scanWebSocketRoutes,
19
19
  writeManifest
20
- } from "../../chunk-VHB2FSPM.js";
20
+ } from "../../chunk-I2UN46ZX.js";
21
21
  import "../../chunk-DV34VG3N.js";
22
22
  import "../../chunk-IRASEXOG.js";
23
23
  import {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  resolveTheoRootDir
3
3
  } from "./chunk-VQPHPQ5L.js";
4
- import "./chunk-VGE6AKEJ.js";
5
- import "./chunk-JUDNKBDQ.js";
6
- import "./chunk-5BOKW3GX.js";
4
+ import "./chunk-DAE7BJ7H.js";
5
+ import "./chunk-WX6NHGKS.js";
6
+ import "./chunk-FVFYACYK.js";
7
7
  import "./chunk-ZDUO4IYN.js";
8
8
  import "./chunk-47FFT43U.js";
9
9
  import "./chunk-NTDN54XO.js";
@@ -15,7 +15,7 @@ import "./chunk-TNI4MARH.js";
15
15
  import "./chunk-OQCRCXCP.js";
16
16
  import {
17
17
  ACTION_SCHEMAS_DIR
18
- } from "./chunk-VHB2FSPM.js";
18
+ } from "./chunk-I2UN46ZX.js";
19
19
  import "./chunk-DV34VG3N.js";
20
20
  import "./chunk-IRASEXOG.js";
21
21
  import "./chunk-BX6EUYHU.js";
@@ -147,4 +147,4 @@ export {
147
147
  ServerOnlyImportError,
148
148
  serverOnlyImportBoundary
149
149
  };
150
- //# sourceMappingURL=server-boundary-XRXVVUMO.js.map
150
+ //# sourceMappingURL=server-boundary-4UIGB3G5.js.map
@@ -3,21 +3,21 @@ import "tsx/esm";
3
3
  import {
4
4
  resolveTheoRootDir
5
5
  } from "./chunk-FDOOBTXJ.js";
6
- import "./chunk-E53UIFH6.js";
6
+ import "./chunk-IHAQUUT2.js";
7
7
  import "./chunk-5YPXXSYY.js";
8
8
  import "./chunk-MWWFXYW3.js";
9
9
  import "./chunk-RPET332G.js";
10
- import "./chunk-GSIOWE5B.js";
10
+ import "./chunk-5VLP3GQ2.js";
11
11
  import "./chunk-C27VRUVN.js";
12
12
  import "./chunk-7UZZHCRN.js";
13
- import "./chunk-XLLW46MB.js";
14
- import "./chunk-6AM7HIRM.js";
13
+ import "./chunk-2HWWJTOH.js";
14
+ import "./chunk-5NNFO7R7.js";
15
15
  import {
16
16
  ACTION_SCHEMAS_DIR
17
- } from "./chunk-YYOBMOO4.js";
17
+ } from "./chunk-NO6HA4FG.js";
18
18
  import "./chunk-Z7CJHDLS.js";
19
19
  import "./chunk-U5PWXS3J.js";
20
- import "./chunk-VI7ZANB3.js";
20
+ import "./chunk-OSBGZYXZ.js";
21
21
  import "./chunk-VQIUTCK2.js";
22
22
 
23
23
  // src/vite-plugin/server-boundary.ts
@@ -131,4 +131,4 @@ export {
131
131
  ServerOnlyImportError,
132
132
  serverOnlyImportBoundary
133
133
  };
134
- //# sourceMappingURL=server-boundary-RNM25WWD.js.map
134
+ //# sourceMappingURL=server-boundary-A2PUD4JV.js.map
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-V7MTRM6Q.js";
9
9
  import {
10
10
  initCacheEngineFromConfig
11
- } from "./chunk-Q5L5EGWZ.js";
11
+ } from "./chunk-NZDGV4YJ.js";
12
12
  import {
13
13
  preflightNodeAndBindings
14
14
  } from "./chunk-KTMQUYED.js";
@@ -25,7 +25,7 @@ import {
25
25
  resolveTransformer,
26
26
  serveMatchedAuxRoute,
27
27
  serveThroughPluginLifecycle
28
- } from "./chunk-2E7JLV7L.js";
28
+ } from "./chunk-6VYF5PMG.js";
29
29
  import "./chunk-2CVV6CNN.js";
30
30
  import {
31
31
  findRootDiv
@@ -41,7 +41,7 @@ import {
41
41
  mountAgent,
42
42
  readAgentPolicy,
43
43
  writeWebResponseToServerResponse
44
- } from "./chunk-E53UIFH6.js";
44
+ } from "./chunk-IHAQUUT2.js";
45
45
  import {
46
46
  getApprovalRegistry,
47
47
  resolveProvider
@@ -60,7 +60,7 @@ import {
60
60
  createObservabilityPluginFromConfig,
61
61
  extractTraceId,
62
62
  generateNewTraceContext
63
- } from "./chunk-GSIOWE5B.js";
63
+ } from "./chunk-5VLP3GQ2.js";
64
64
  import {
65
65
  logRequest,
66
66
  warnOnce
@@ -68,27 +68,27 @@ import {
68
68
  import "./chunk-7UZZHCRN.js";
69
69
  import {
70
70
  loadManifest
71
- } from "./chunk-XLLW46MB.js";
71
+ } from "./chunk-2HWWJTOH.js";
72
72
  import {
73
73
  scanAgents
74
- } from "./chunk-6AM7HIRM.js";
74
+ } from "./chunk-5NNFO7R7.js";
75
75
  import {
76
76
  matchRoute,
77
77
  scanServerActions,
78
78
  scanServerRoutes,
79
79
  scanWebSocketRoutes
80
- } from "./chunk-YYOBMOO4.js";
80
+ } from "./chunk-NO6HA4FG.js";
81
81
  import "./chunk-Z7CJHDLS.js";
82
82
  import {
83
83
  loadConfig
84
- } from "./chunk-QTHVHNJJ.js";
84
+ } from "./chunk-HA35FS7U.js";
85
85
  import {
86
86
  loadEnv
87
87
  } from "./chunk-3QPVEJ7D.js";
88
88
  import "./chunk-U5PWXS3J.js";
89
- import "./chunk-FH3SQR6P.js";
89
+ import "./chunk-4OTIXAUY.js";
90
90
  import "./chunk-ZNZISJDZ.js";
91
- import "./chunk-VI7ZANB3.js";
91
+ import "./chunk-OSBGZYXZ.js";
92
92
  import "./chunk-VQIUTCK2.js";
93
93
 
94
94
  // src/cli/commands/start/index.ts
@@ -424,7 +424,7 @@ async function configureStorageManagerFromConfig(storageConfig) {
424
424
  if (storageConfig === void 0 || storageConfig === null) return;
425
425
  try {
426
426
  const { getStorageManager } = await import("./storage-manager-3O5PDO6O.js");
427
- const { storageSchema } = await import("./schema-SOAD43RQ.js");
427
+ const { storageSchema } = await import("./schema-WKTNTGX6.js");
428
428
  const parsed = storageSchema.parse(storageConfig);
429
429
  getStorageManager().configure(parsed);
430
430
  } catch (err) {
@@ -503,7 +503,7 @@ function installGracefulShutdown(server) {
503
503
  });
504
504
  }
505
505
  try {
506
- const { getObservabilityAdapter } = await import("./observability-bootstrap-M2WSDIDV.js");
506
+ const { getObservabilityAdapter } = await import("./observability-bootstrap-H4NSILXD.js");
507
507
  await getObservabilityAdapter()?.shutdown();
508
508
  } catch (err) {
509
509
  const msg = err instanceof Error ? err.message : String(err);
@@ -562,6 +562,63 @@ function loadRoutesAndActions(distDir, serverDir, agentsDir = "agents") {
562
562
  };
563
563
  }
564
564
 
565
+ // src/cli/commands/start/public-exposure-gate.ts
566
+ var MUTATING_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
567
+ var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "::1"]);
568
+ function isPubliclyBound(host) {
569
+ return !LOOPBACK_HOSTS.has(host.toLowerCase());
570
+ }
571
+ function unauthenticatedWrites(routes) {
572
+ const found = [];
573
+ for (const route of routes) {
574
+ for (const method of route.publicMethods ?? []) {
575
+ if (MUTATING_METHODS.has(method)) found.push({ routePath: route.routePath, method });
576
+ }
577
+ }
578
+ return found;
579
+ }
580
+ function cannotAnswer(routes) {
581
+ const anyDetected = routes.some((r) => r.publicMethods !== void 0);
582
+ if (anyDetected) return false;
583
+ return routes.some((r) => (r.methods ?? []).some((m) => MUTATING_METHODS.has(m)));
584
+ }
585
+ function refusalMessage(exposures, host) {
586
+ const list = exposures.map((e) => ` ${e.method} ${e.routePath}`).join("\n");
587
+ return [
588
+ exposures.length === 1 ? `Refusing to bind ${host}: 1 write route accepts unauthenticated requests.` : `Refusing to bind ${host}: ${String(exposures.length)} write routes accept unauthenticated requests.`,
589
+ "",
590
+ list,
591
+ "",
592
+ " Each declares `policy('public')`, so anyone who can reach this address can call it.",
593
+ " On a loopback bind that is a demo; on this one it is an open endpoint.",
594
+ "",
595
+ " Resolve it one of two ways:",
596
+ " \u2022 give each route a real policy \u2014 `policy(({ subject }) => subject !== null)`, or",
597
+ " `requireOwner(subject, record.ownerId)` from `theokit/server/define`. A plugin hook",
598
+ " establishes `ctx.subject`; the policy reads it.",
599
+ " \u2022 decide otherwise, in writing: `security: { allowUnauthenticatedWrites: true }` in",
600
+ " theo.config.ts. The routes stay open and the startup log keeps saying so."
601
+ ].join("\n");
602
+ }
603
+ function assessPublicExposure(input) {
604
+ if (!isPubliclyBound(input.target.host)) return { kind: "not-exposed" };
605
+ if (cannotAnswer(input.routes)) {
606
+ return {
607
+ kind: "unverified",
608
+ message: [
609
+ `Binding ${input.target.host} without checking whether its write routes are authenticated.`,
610
+ " This manifest predates the check and records no policy kinds. Run `theo build` to",
611
+ " regenerate it; until then the server starts, and this warning is the whole of what",
612
+ " is known about the exposure."
613
+ ].join("\n")
614
+ };
615
+ }
616
+ const exposures = unauthenticatedWrites(input.routes);
617
+ if (exposures.length === 0) return { kind: "allowed" };
618
+ if (input.allowUnauthenticatedWrites) return { kind: "allowed-by-override", exposures };
619
+ return { kind: "refused", exposures, message: refusalMessage(exposures, input.target.host) };
620
+ }
621
+
565
622
  // src/cli/commands/start/handlers.ts
566
623
  import { extname as extname2 } from "path";
567
624
  import { pathToFileURL } from "url";
@@ -1283,11 +1340,36 @@ async function startCommand(options) {
1283
1340
  createCronScheduler(cronDefinitions).start();
1284
1341
  }
1285
1342
  const listenTarget = resolveListenTarget(config.host);
1343
+ const exposure = assessPublicExposure({
1344
+ routes: cachedRoutes,
1345
+ target: listenTarget,
1346
+ allowUnauthenticatedWrites: config.security?.allowUnauthenticatedWrites ?? false
1347
+ });
1348
+ if (exposure.kind === "refused") {
1349
+ console.error(`
1350
+ ${exposure.message}
1351
+ `);
1352
+ process.exitCode = 1;
1353
+ return;
1354
+ }
1355
+ if (exposure.kind === "unverified") {
1356
+ console.warn(`
1357
+ ${exposure.message}
1358
+ `);
1359
+ }
1286
1360
  server.listen(port, listenTarget.host, () => {
1287
1361
  console.log(`
1288
1362
  Theo production server`);
1289
1363
  console.log(`${describeListenTarget(listenTarget, port)}
1290
1364
  `);
1365
+ if (exposure.kind === "allowed-by-override") {
1366
+ const n = exposure.exposures.length;
1367
+ console.warn(
1368
+ ` security.allowUnauthenticatedWrites is on \u2014 ${String(n)} unauthenticated write ${n === 1 ? "route is" : "routes are"} reachable:`
1369
+ );
1370
+ for (const e of exposure.exposures) console.warn(` ${e.method} ${e.routePath}`);
1371
+ console.warn("");
1372
+ }
1291
1373
  if (cronDefinitions.length > 0) {
1292
1374
  console.log(` Crons: ${String(cronDefinitions.length)} scheduled in-process
1293
1375
  `);
@@ -1299,4 +1381,4 @@ export {
1299
1381
  resolveSsrEntry,
1300
1382
  startCommand
1301
1383
  };
1302
- //# sourceMappingURL=start-WILEDDW2.js.map
1384
+ //# sourceMappingURL=start-3F4LVHWS.js.map