theokit 0.48.2 → 0.48.4

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 (189) hide show
  1. package/LICENSE +2 -2
  2. package/dist/{actions-virtual-module-2VVLVXHY.js → actions-virtual-module-GB5FWUPS.js} +6 -6
  3. package/dist/{actions-virtual-module-Z5LXAX7E.js → actions-virtual-module-YQXRSSMW.js} +2 -2
  4. package/dist/add-3VLFUPF4.js +0 -0
  5. package/dist/{agent-Y3JKRROD.js → agent-OAFIXOR5.js} +2 -2
  6. package/dist/{agents-typed-client-X56CQ6FX.js → agents-typed-client-D4OA2TXB.js} +12 -4
  7. package/dist/agents-typed-client-D4OA2TXB.js.map +1 -0
  8. package/dist/{agents-typed-client-TNHCUU7Q.js → agents-typed-client-INR2E7B3.js} +12 -4
  9. package/dist/agents-typed-client-INR2E7B3.js.map +1 -0
  10. package/dist/{app-typed-client-N4I4RBLT.js → app-typed-client-5QDNHANF.js} +6 -6
  11. package/dist/{app-typed-client-NI3CM2FA.js → app-typed-client-GHO3EWZK.js} +2 -2
  12. package/dist/{aws-lambda-7SUTORXM.js → aws-lambda-CYNDGU5O.js} +3 -3
  13. package/dist/body-parser-web-TIOTXPDW.js +0 -0
  14. package/dist/broadcast-LUMOJIJT.js +0 -0
  15. package/dist/{build-SJQDRD2B.js → build-QYEU5OOZ.js} +13 -12
  16. package/dist/build-QYEU5OOZ.js.map +1 -0
  17. package/dist/build-request-body-preview-XPZ2GYMG.js +0 -0
  18. package/dist/{bun-TLYZCEGE.js → bun-33RD6K7O.js} +3 -3
  19. package/dist/check-45NKUVSQ.js +0 -0
  20. package/dist/chunk-2CVV6CNN.js +0 -0
  21. package/dist/{chunk-ORKNVORZ.js → chunk-47CINLWF.js} +2 -2
  22. package/dist/chunk-47VNWTL4.js +0 -0
  23. package/dist/chunk-5ODOE6EF.js +0 -0
  24. package/dist/chunk-6GGWS7J3.js +0 -0
  25. package/dist/{chunk-O5W7XSUX.js → chunk-6PWNTTPI.js} +4 -4
  26. package/dist/{chunk-GEHX6CAE.js → chunk-6RJSGTMN.js} +3 -3
  27. package/dist/{chunk-GEHX6CAE.js.map → chunk-6RJSGTMN.js.map} +1 -1
  28. package/dist/{chunk-HRCNHWLP.js → chunk-7CQ6DEWZ.js} +2 -2
  29. package/dist/{chunk-YRRWQDKK.js → chunk-7QAYC757.js} +89 -14
  30. package/dist/chunk-7QAYC757.js.map +1 -0
  31. package/dist/{chunk-CUYEA62B.js → chunk-7VPQHEAJ.js} +2 -4
  32. package/dist/chunk-7VPQHEAJ.js.map +1 -0
  33. package/dist/{chunk-5JJCNEUS.js → chunk-A4ZEP3FE.js} +17 -8
  34. package/dist/chunk-A4ZEP3FE.js.map +1 -0
  35. package/dist/chunk-A7JBF5FO.js +0 -0
  36. package/dist/{chunk-MNIQ5F3Y.js → chunk-BMHS4WAN.js} +1 -1
  37. package/dist/{chunk-MNIQ5F3Y.js.map → chunk-BMHS4WAN.js.map} +1 -1
  38. package/dist/{chunk-DGQO372T.js → chunk-E576KYYT.js} +3 -3
  39. package/dist/chunk-E576KYYT.js.map +1 -0
  40. package/dist/{chunk-L5Z6IY5U.js → chunk-FNTLKHZ7.js} +1 -1
  41. package/dist/{chunk-L5Z6IY5U.js.map → chunk-FNTLKHZ7.js.map} +1 -1
  42. package/dist/chunk-GEQJAFSV.js +0 -0
  43. package/dist/{chunk-AOGYAXPY.js → chunk-GH32R55S.js} +2 -2
  44. package/dist/{chunk-Y2KHTD2W.js → chunk-GQNBZDYK.js} +1 -1
  45. package/dist/{chunk-Y2KHTD2W.js.map → chunk-GQNBZDYK.js.map} +1 -1
  46. package/dist/{chunk-VTJMND23.js → chunk-H6YBKIUN.js} +2 -2
  47. package/dist/chunk-HBU2GIMZ.js +0 -0
  48. package/dist/chunk-IEES3CHD.js +0 -0
  49. package/dist/{chunk-62EU2BVZ.js → chunk-J5MXCGKA.js} +1 -1
  50. package/dist/{chunk-62EU2BVZ.js.map → chunk-J5MXCGKA.js.map} +1 -1
  51. package/dist/{chunk-HNBWZKIQ.js → chunk-KTMQUYED.js} +1 -1
  52. package/dist/{chunk-HNBWZKIQ.js.map → chunk-KTMQUYED.js.map} +1 -1
  53. package/dist/chunk-LNVMHQ2Z.js +0 -0
  54. package/dist/{chunk-2ADKT37V.js → chunk-LXAESF4Y.js} +2 -2
  55. package/dist/{chunk-2ADKT37V.js.map → chunk-LXAESF4Y.js.map} +1 -1
  56. package/dist/{chunk-FXZZS7YW.js → chunk-T5C46IIU.js} +1 -1
  57. package/dist/chunk-T5C46IIU.js.map +1 -0
  58. package/dist/{chunk-ZALJIZH2.js → chunk-VQ62FIQW.js} +80 -16
  59. package/dist/chunk-VQ62FIQW.js.map +1 -0
  60. package/dist/chunk-VQIUTCK2.js +0 -0
  61. package/dist/{chunk-FO55VGMQ.js → chunk-XR74JD4M.js} +1 -1
  62. package/dist/{chunk-FO55VGMQ.js.map → chunk-XR74JD4M.js.map} +1 -1
  63. package/dist/{chunk-KSZGBUTI.js → chunk-YGAXV5HR.js} +1 -1
  64. package/dist/{chunk-KSZGBUTI.js.map → chunk-YGAXV5HR.js.map} +1 -1
  65. package/dist/{chunk-D3425YDV.js → chunk-ZB7D62OA.js} +2 -2
  66. package/dist/cli/index.js +14 -14
  67. package/dist/cli/index.js.map +1 -1
  68. package/dist/{cloudflare-JTBKOX3F.js → cloudflare-KYUWCEPL.js} +3 -3
  69. package/dist/configure-agent-registry-ZOBVU3MV.js +0 -0
  70. package/dist/controller-swc-transform-LUJ4VAZJ.js +0 -0
  71. package/dist/db-IVVCQE5Z.js +0 -0
  72. package/dist/{define-websocket-CPQcQK9h.d.ts → define-websocket-DzPn1sR6.d.ts} +0 -1
  73. package/dist/{deno-deploy-3ESNGYZU.js → deno-deploy-CCTB7HGS.js} +3 -3
  74. package/dist/{dev-6TWDBX6G.js → dev-5BKIKJYI.js} +12 -12
  75. package/dist/{dev-emit-7ZZRTYF3.js → dev-emit-GWD6IXV7.js} +3 -3
  76. package/dist/{dev-emit-E5Z26AMV.js → dev-emit-NBT6JD7R.js} +2 -2
  77. package/dist/dispatcher-KMZBGMM5.js +0 -0
  78. package/dist/docker-LZZB4D5E.js +0 -0
  79. package/dist/doctor-Y53QTUSP.js +0 -0
  80. package/dist/{generate-WQSNW4F6.js → generate-Y3GWM57K.js} +2 -2
  81. package/dist/generate-Y3GWM57K.js.map +1 -0
  82. package/dist/index.d.ts +36 -8
  83. package/dist/index.js +3 -3
  84. package/dist/{info-QB7Q3SHP.js → info-MSBQ72EM.js} +4 -4
  85. package/dist/{internal-api-XQA2L663.js → internal-api-ICU7ITJD.js} +6 -6
  86. package/dist/{internal-api-REGN3WMX.js → internal-api-WEOSTMSN.js} +2 -2
  87. package/dist/{load-config-JKJ73TOD.js → load-config-2LP2OEKD.js} +4 -4
  88. package/dist/{mcp-CO4AGAXV.js → mcp-4FNNCFPM.js} +3 -3
  89. package/dist/{netlify-OFJUYXTZ.js → netlify-AFMDNKT4.js} +3 -3
  90. package/dist/node-ZJQEJSP3.js +10 -0
  91. package/dist/{openapi-5CZCL7YP.js → openapi-FWNYHB6T.js} +10 -10
  92. package/dist/{openapi-5CZCL7YP.js.map → openapi-FWNYHB6T.js.map} +1 -1
  93. package/dist/registry-UJ6KNQPJ.js +23 -0
  94. package/dist/{router-6MAACS25.js → router-V64GKAS6.js} +1 -1
  95. package/dist/router-V64GKAS6.js.map +1 -0
  96. package/dist/{routes-GWAWUVVQ.js → routes-6AMNVFMI.js} +5 -5
  97. package/dist/scan-7MJC6PYU.js +0 -0
  98. package/dist/{schema-BpH6ivDY.d.ts → schema-BdakLtuC.d.ts} +1 -1
  99. package/dist/{schema-2JEG6TTU.js → schema-Z3Y7SFLE.js} +3 -7
  100. package/dist/server/agent/index.d.ts +1 -1
  101. package/dist/server/cost/index.d.ts +0 -3
  102. package/dist/server/cost/index.js +1 -1
  103. package/dist/server/cron/index.d.ts +0 -4
  104. package/dist/server/cron/index.js +1 -1
  105. package/dist/server/define/index.d.ts +2 -3
  106. package/dist/server/define/index.js +1 -1
  107. package/dist/server/index.d.ts +4 -6
  108. package/dist/server/index.js +6 -6
  109. package/dist/server/index.js.map +1 -1
  110. package/dist/server/jobs/index.d.ts +1 -4
  111. package/dist/server/jobs/index.js +1 -1
  112. package/dist/server/realtime/index.d.ts +1 -1
  113. package/dist/server/scan/index.js +1 -1
  114. package/dist/server/storage/index.d.ts +1 -1
  115. package/dist/server/webhook/index.d.ts +2 -2
  116. package/dist/server-error-to-envelope-4TGCDQ2S.js +0 -0
  117. package/dist/{server-routes-hmr-4W5L2MKN.js → server-routes-hmr-5D2ZPL74.js} +1 -1
  118. package/dist/server-routes-hmr-5D2ZPL74.js.map +1 -0
  119. package/dist/{server-routes-hmr-6CRNSEWF.js → server-routes-hmr-BWN3WIGR.js} +1 -1
  120. package/dist/{server-routes-hmr-6CRNSEWF.js.map → server-routes-hmr-BWN3WIGR.js.map} +1 -1
  121. package/dist/services-json-7ZXJ4CIS.js +0 -0
  122. package/dist/{services-typed-client-II7LKXKO.js → services-typed-client-PSAGRPFF.js} +2 -2
  123. package/dist/{sessions-gc-H4WC4IXB.js → sessions-gc-VAZR654G.js} +3 -3
  124. package/dist/sessions-gc-VAZR654G.js.map +1 -0
  125. package/dist/{start-IO3ZYGEX.js → start-QDPYXPW2.js} +14 -14
  126. package/dist/start-QDPYXPW2.js.map +1 -0
  127. package/dist/{static-HTT2WNIT.js → static-R25HSXEF.js} +3 -3
  128. package/dist/{storage-manager-ZSQFLEYT.js → storage-manager-3O5PDO6O.js} +1 -1
  129. package/dist/storage-manager-3O5PDO6O.js.map +1 -0
  130. package/dist/{storage-manager-C4jsO0Tp.d.ts → storage-manager-C6hmsaer.d.ts} +1 -1
  131. package/dist/{theo-cloud-ZTQLXGPS.js → theo-cloud-XAHWOUFK.js} +2 -2
  132. package/dist/{upgrade-readiness-77P6VNB4.js → upgrade-readiness-OILJRFOV.js} +1 -1
  133. package/dist/{upgrade-readiness-77P6VNB4.js.map → upgrade-readiness-OILJRFOV.js.map} +1 -1
  134. package/dist/{vercel-72HFEMJ3.js → vercel-SRS2DH6O.js} +3 -3
  135. package/dist/vite-plugin/index.d.ts +1 -1
  136. package/dist/vite-plugin/index.js +3 -3
  137. package/dist/{vite-plugin-NQ6F7FGV.js → vite-plugin-YOCPU4C6.js} +11 -11
  138. package/dist/{webhook-types-CNUZY7o1.d.ts → webhook-types-DGIjjcaI.d.ts} +0 -2
  139. package/package.json +11 -10
  140. package/dist/agents-typed-client-TNHCUU7Q.js.map +0 -1
  141. package/dist/agents-typed-client-X56CQ6FX.js.map +0 -1
  142. package/dist/build-SJQDRD2B.js.map +0 -1
  143. package/dist/chunk-5JJCNEUS.js.map +0 -1
  144. package/dist/chunk-CUYEA62B.js.map +0 -1
  145. package/dist/chunk-DGQO372T.js.map +0 -1
  146. package/dist/chunk-FXZZS7YW.js.map +0 -1
  147. package/dist/chunk-YRRWQDKK.js.map +0 -1
  148. package/dist/chunk-ZALJIZH2.js.map +0 -1
  149. package/dist/generate-WQSNW4F6.js.map +0 -1
  150. package/dist/node-ND4MJU3Z.js +0 -10
  151. package/dist/registry-QTSMLOVG.js +0 -23
  152. package/dist/router-6MAACS25.js.map +0 -1
  153. package/dist/server-routes-hmr-4W5L2MKN.js.map +0 -1
  154. package/dist/sessions-gc-H4WC4IXB.js.map +0 -1
  155. package/dist/start-IO3ZYGEX.js.map +0 -1
  156. package/dist/storage-manager-ZSQFLEYT.js.map +0 -1
  157. /package/dist/{actions-virtual-module-2VVLVXHY.js.map → actions-virtual-module-GB5FWUPS.js.map} +0 -0
  158. /package/dist/{actions-virtual-module-Z5LXAX7E.js.map → actions-virtual-module-YQXRSSMW.js.map} +0 -0
  159. /package/dist/{agent-Y3JKRROD.js.map → agent-OAFIXOR5.js.map} +0 -0
  160. /package/dist/{app-typed-client-N4I4RBLT.js.map → app-typed-client-5QDNHANF.js.map} +0 -0
  161. /package/dist/{app-typed-client-NI3CM2FA.js.map → app-typed-client-GHO3EWZK.js.map} +0 -0
  162. /package/dist/{aws-lambda-7SUTORXM.js.map → aws-lambda-CYNDGU5O.js.map} +0 -0
  163. /package/dist/{bun-TLYZCEGE.js.map → bun-33RD6K7O.js.map} +0 -0
  164. /package/dist/{chunk-ORKNVORZ.js.map → chunk-47CINLWF.js.map} +0 -0
  165. /package/dist/{chunk-O5W7XSUX.js.map → chunk-6PWNTTPI.js.map} +0 -0
  166. /package/dist/{chunk-HRCNHWLP.js.map → chunk-7CQ6DEWZ.js.map} +0 -0
  167. /package/dist/{chunk-AOGYAXPY.js.map → chunk-GH32R55S.js.map} +0 -0
  168. /package/dist/{chunk-VTJMND23.js.map → chunk-H6YBKIUN.js.map} +0 -0
  169. /package/dist/{chunk-D3425YDV.js.map → chunk-ZB7D62OA.js.map} +0 -0
  170. /package/dist/{cloudflare-JTBKOX3F.js.map → cloudflare-KYUWCEPL.js.map} +0 -0
  171. /package/dist/{deno-deploy-3ESNGYZU.js.map → deno-deploy-CCTB7HGS.js.map} +0 -0
  172. /package/dist/{dev-6TWDBX6G.js.map → dev-5BKIKJYI.js.map} +0 -0
  173. /package/dist/{dev-emit-7ZZRTYF3.js.map → dev-emit-GWD6IXV7.js.map} +0 -0
  174. /package/dist/{dev-emit-E5Z26AMV.js.map → dev-emit-NBT6JD7R.js.map} +0 -0
  175. /package/dist/{info-QB7Q3SHP.js.map → info-MSBQ72EM.js.map} +0 -0
  176. /package/dist/{internal-api-XQA2L663.js.map → internal-api-ICU7ITJD.js.map} +0 -0
  177. /package/dist/{internal-api-REGN3WMX.js.map → internal-api-WEOSTMSN.js.map} +0 -0
  178. /package/dist/{load-config-JKJ73TOD.js.map → load-config-2LP2OEKD.js.map} +0 -0
  179. /package/dist/{mcp-CO4AGAXV.js.map → mcp-4FNNCFPM.js.map} +0 -0
  180. /package/dist/{netlify-OFJUYXTZ.js.map → netlify-AFMDNKT4.js.map} +0 -0
  181. /package/dist/{node-ND4MJU3Z.js.map → node-ZJQEJSP3.js.map} +0 -0
  182. /package/dist/{registry-QTSMLOVG.js.map → registry-UJ6KNQPJ.js.map} +0 -0
  183. /package/dist/{routes-GWAWUVVQ.js.map → routes-6AMNVFMI.js.map} +0 -0
  184. /package/dist/{schema-2JEG6TTU.js.map → schema-Z3Y7SFLE.js.map} +0 -0
  185. /package/dist/{services-typed-client-II7LKXKO.js.map → services-typed-client-PSAGRPFF.js.map} +0 -0
  186. /package/dist/{static-HTT2WNIT.js.map → static-R25HSXEF.js.map} +0 -0
  187. /package/dist/{theo-cloud-ZTQLXGPS.js.map → theo-cloud-XAHWOUFK.js.map} +0 -0
  188. /package/dist/{vercel-72HFEMJ3.js.map → vercel-SRS2DH6O.js.map} +0 -0
  189. /package/dist/{vite-plugin-NQ6F7FGV.js.map → vite-plugin-YOCPU4C6.js.map} +0 -0
package/dist/index.js CHANGED
@@ -8,11 +8,11 @@ import {
8
8
  scanRoutes,
9
9
  theoConfigSchema,
10
10
  theoPlugin
11
- } from "./chunk-YRRWQDKK.js";
11
+ } from "./chunk-7QAYC757.js";
12
12
  import "./chunk-SSYDEKWF.js";
13
13
  import "./chunk-OIGJOYX6.js";
14
14
  import "./chunk-OJLL4YD6.js";
15
- import "./chunk-FO55VGMQ.js";
15
+ import "./chunk-XR74JD4M.js";
16
16
  import "./chunk-XALU5LCU.js";
17
17
  import "./chunk-47FFT43U.js";
18
18
  import "./chunk-NTDN54XO.js";
@@ -20,7 +20,7 @@ import "./chunk-KD5G3YXI.js";
20
20
  import "./chunk-VSLTKX5L.js";
21
21
  import "./chunk-TNI4MARH.js";
22
22
  import "./chunk-7LVM22VG.js";
23
- import "./chunk-KSZGBUTI.js";
23
+ import "./chunk-YGAXV5HR.js";
24
24
  import "./chunk-DV34VG3N.js";
25
25
  import "./chunk-FB2HBNIC.js";
26
26
  import "./chunk-MTEWLGVY.js";
@@ -5,10 +5,10 @@ import {
5
5
  } from "./chunk-IEES3CHD.js";
6
6
  import {
7
7
  loadConfig
8
- } from "./chunk-AOGYAXPY.js";
8
+ } from "./chunk-GH32R55S.js";
9
9
  import "./chunk-HBU2GIMZ.js";
10
- import "./chunk-5JJCNEUS.js";
11
- import "./chunk-CUYEA62B.js";
10
+ import "./chunk-A4ZEP3FE.js";
11
+ import "./chunk-7VPQHEAJ.js";
12
12
 
13
13
  // src/cli/commands/info.ts
14
14
  import { existsSync, readFileSync } from "fs";
@@ -101,4 +101,4 @@ export {
101
101
  buildInfo,
102
102
  infoCommand
103
103
  };
104
- //# sourceMappingURL=info-QB7Q3SHP.js.map
104
+ //# sourceMappingURL=info-MSBQ72EM.js.map
@@ -10,7 +10,7 @@ import {
10
10
  handleBatchRequest,
11
11
  handleCspReport,
12
12
  handleCsrfReadiness
13
- } from "./chunk-HRCNHWLP.js";
13
+ } from "./chunk-7CQ6DEWZ.js";
14
14
  import {
15
15
  applySecurityHeaders,
16
16
  createPluginRunnerFromConfig,
@@ -21,7 +21,7 @@ import {
21
21
  findSuggestion,
22
22
  generateNonce,
23
23
  mountAgent
24
- } from "./chunk-VTJMND23.js";
24
+ } from "./chunk-H6YBKIUN.js";
25
25
  import {
26
26
  resolveProvider
27
27
  } from "./chunk-6GGWS7J3.js";
@@ -30,10 +30,10 @@ import {
30
30
  incomingMessageToHandlerRequest,
31
31
  logRequest,
32
32
  sendError
33
- } from "./chunk-FXZZS7YW.js";
33
+ } from "./chunk-T5C46IIU.js";
34
34
  import {
35
35
  generateManifest
36
- } from "./chunk-D3425YDV.js";
36
+ } from "./chunk-ZB7D62OA.js";
37
37
  import {
38
38
  scanAgents
39
39
  } from "./chunk-LNVMHQ2Z.js";
@@ -43,7 +43,7 @@ import {
43
43
  scanServerActionsEnriched,
44
44
  scanServerRoutes,
45
45
  scanWebSocketRoutes
46
- } from "./chunk-MNIQ5F3Y.js";
46
+ } from "./chunk-BMHS4WAN.js";
47
47
  import "./chunk-A7JBF5FO.js";
48
48
  import "./chunk-VQIUTCK2.js";
49
49
  export {
@@ -78,4 +78,4 @@ export {
78
78
  scanWebSocketRoutes,
79
79
  sendError
80
80
  };
81
- //# sourceMappingURL=internal-api-XQA2L663.js.map
81
+ //# sourceMappingURL=internal-api-ICU7ITJD.js.map
@@ -37,7 +37,7 @@ import {
37
37
  scanServerActionsEnriched,
38
38
  scanServerRoutes,
39
39
  scanWebSocketRoutes
40
- } from "./chunk-KSZGBUTI.js";
40
+ } from "./chunk-YGAXV5HR.js";
41
41
  import "./chunk-DV34VG3N.js";
42
42
  import "./chunk-FB2HBNIC.js";
43
43
  import {
@@ -91,4 +91,4 @@ export {
91
91
  scanWebSocketRoutes,
92
92
  sendError
93
93
  };
94
- //# sourceMappingURL=internal-api-REGN3WMX.js.map
94
+ //# sourceMappingURL=internal-api-WEOSTMSN.js.map
@@ -3,12 +3,12 @@ import "tsx/esm";
3
3
  import {
4
4
  deepMerge,
5
5
  loadConfig
6
- } from "./chunk-AOGYAXPY.js";
6
+ } from "./chunk-GH32R55S.js";
7
7
  import "./chunk-HBU2GIMZ.js";
8
- import "./chunk-5JJCNEUS.js";
9
- import "./chunk-CUYEA62B.js";
8
+ import "./chunk-A4ZEP3FE.js";
9
+ import "./chunk-7VPQHEAJ.js";
10
10
  export {
11
11
  deepMerge,
12
12
  loadConfig
13
13
  };
14
- //# sourceMappingURL=load-config-JKJ73TOD.js.map
14
+ //# sourceMappingURL=load-config-2LP2OEKD.js.map
@@ -2,7 +2,7 @@
2
2
  import "tsx/esm";
3
3
  import {
4
4
  createAgentSsrLoader
5
- } from "./chunk-O5W7XSUX.js";
5
+ } from "./chunk-6PWNTTPI.js";
6
6
  import {
7
7
  extractAppResources,
8
8
  handleMcpJsonRpc
@@ -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-JKJ73TOD.js")).loadConfig(projectRoot)).agentsDir;
49
+ const agentsDir = deps.agentsDir ?? (await (await import("./load-config-2LP2OEKD.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-CO4AGAXV.js.map
78
+ //# sourceMappingURL=mcp-4FNNCFPM.js.map
@@ -2,11 +2,11 @@
2
2
  import "tsx/esm";
3
3
  import {
4
4
  nodeAdapter
5
- } from "./chunk-DGQO372T.js";
5
+ } from "./chunk-E576KYYT.js";
6
6
  import {
7
7
  assertServicesUnsupported,
8
8
  readManifest
9
- } from "./chunk-CUYEA62B.js";
9
+ } from "./chunk-7VPQHEAJ.js";
10
10
 
11
11
  // src/adapters/netlify.ts
12
12
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -147,4 +147,4 @@ export {
147
147
  netlifyAdapter,
148
148
  renderNetlifyFunction
149
149
  };
150
- //# sourceMappingURL=netlify-OFJUYXTZ.js.map
150
+ //# sourceMappingURL=netlify-AFMDNKT4.js.map
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import "tsx/esm";
3
+ import {
4
+ nodeAdapter
5
+ } from "./chunk-E576KYYT.js";
6
+ import "./chunk-7VPQHEAJ.js";
7
+ export {
8
+ nodeAdapter
9
+ };
10
+ //# sourceMappingURL=node-ZJQEJSP3.js.map
@@ -6,22 +6,22 @@ import {
6
6
  } from "./chunk-47VNWTL4.js";
7
7
  import {
8
8
  loadConfig
9
- } from "./chunk-AOGYAXPY.js";
9
+ } from "./chunk-GH32R55S.js";
10
10
  import "./chunk-HBU2GIMZ.js";
11
- import "./chunk-5JJCNEUS.js";
12
- import "./chunk-CUYEA62B.js";
11
+ import "./chunk-A4ZEP3FE.js";
12
+ import "./chunk-7VPQHEAJ.js";
13
13
  import {
14
14
  generateManifest
15
- } from "./chunk-D3425YDV.js";
15
+ } from "./chunk-ZB7D62OA.js";
16
16
  import "./chunk-LNVMHQ2Z.js";
17
- import "./chunk-MNIQ5F3Y.js";
17
+ import "./chunk-BMHS4WAN.js";
18
18
  import "./chunk-A7JBF5FO.js";
19
19
 
20
20
  // src/cli/commands/openapi.ts
21
21
  import { mkdtempSync, rmSync } from "fs";
22
22
  import { tmpdir } from "os";
23
23
  import { join, resolve } from "path";
24
- var MIGRATION_GUIDE_URL = "docs/concepts/openapi.md";
24
+ var OPENAPI_DOCS_URL = "https://theokit.dev/concepts/openapi";
25
25
  async function openapiCommand(options = {}) {
26
26
  const cwd = options.cwd ?? process.cwd();
27
27
  const config = await loadConfig(cwd);
@@ -39,7 +39,7 @@ async function openapiCommand(options = {}) {
39
39
  },
40
40
  })
41
41
 
42
- See ${MIGRATION_GUIDE_URL} for the full reference.
42
+ See ${OPENAPI_DOCS_URL} for the full reference.
43
43
  `
44
44
  );
45
45
  process.exit(1);
@@ -54,7 +54,7 @@ async function openapiCommand(options = {}) {
54
54
  \u2713 openapi.json (dry-run): ${String(hydrated.length)} ops`);
55
55
  console.log(JSON.stringify(result2.document, null, 2));
56
56
  console.log(`
57
- Docs: ${MIGRATION_GUIDE_URL}
57
+ Docs: ${OPENAPI_DOCS_URL}
58
58
  `);
59
59
  return;
60
60
  }
@@ -66,7 +66,7 @@ async function openapiCommand(options = {}) {
66
66
  console.log(
67
67
  `
68
68
  \u2713 openapi.json: ${String(hydrated.length)} ops \u2192 ${result.path}
69
- Docs: ${MIGRATION_GUIDE_URL}
69
+ Docs: ${OPENAPI_DOCS_URL}
70
70
  `
71
71
  );
72
72
  }
@@ -82,4 +82,4 @@ function emitOpenApiInMemory(manifest, config) {
82
82
  export {
83
83
  openapiCommand
84
84
  };
85
- //# sourceMappingURL=openapi-5CZCL7YP.js.map
85
+ //# sourceMappingURL=openapi-FWNYHB6T.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cli/commands/openapi.ts"],"sourcesContent":["/**\n * `theokit openapi` — regenerate `<distDir>/openapi.json` standalone.\n *\n * Mirrors trpc-openapi's `pnpm codegen` script. Useful in dev workflows\n * when only schemas changed and a full `theokit build` would be\n * overkill.\n *\n * Per G2 plan v1.1 T2.3. Single output (dev location only) — for the\n * dist artifact, run `theokit build`.\n *\n * Flags:\n * --dry-run Validate + print the document to stdout; skip the\n * filesystem write (EC-3 absorbed).\n */\nimport { mkdtempSync, rmSync } from 'node:fs'\nimport { tmpdir } from 'node:os'\nimport { join, resolve } from 'node:path'\n\nimport { loadConfig } from '../../config/load-config.js'\nimport { generateManifest } from '../../server/scan/manifest.js'\nimport { emitOpenApi } from '../../vite-plugin/openapi-emit/emit.js'\nimport { loadRoutesForOpenApi } from '../../vite-plugin/openapi-emit/load-routes.js'\n\nconst MIGRATION_GUIDE_URL = 'docs/concepts/openapi.md'\n\ninterface OpenApiCommandOptions {\n /** Project root (defaults to `process.cwd()`). */\n cwd?: string\n /** Skip the filesystem write; print the document to stdout (EC-3). */\n dryRun?: boolean\n}\n\nexport async function openapiCommand(options: OpenApiCommandOptions = {}): Promise<void> {\n const cwd = options.cwd ?? process.cwd()\n const config = await loadConfig(cwd)\n\n if (config.openapi === undefined) {\n console.error(\n `\\n ✗ openapi: not configured in theo.config.ts\\n\\n` +\n ` Add the \\`openapi\\` block to opt in:\\n\\n` +\n ` export default defineConfig({\\n` +\n ` openapi: {\\n` +\n ` title: 'My App',\\n` +\n ` version: '1.0.0',\\n` +\n ` },\\n` +\n ` })\\n\\n` +\n ` See ${MIGRATION_GUIDE_URL} for the full reference.\\n`,\n )\n process.exit(1)\n return\n }\n\n const serverDir = resolve(cwd, config.serverDir)\n const manifest = generateManifest(serverDir)\n const hydrated = await loadRoutesForOpenApi({ serverDir, routes: manifest.routes })\n\n if (options.dryRun) {\n // Build the document without writing — for the dry-run we still want a\n // valid emit pass, but with an in-memory output dir we never touch disk.\n const result = emitOpenApiInMemory(hydrated, config.openapi)\n console.log(`\\n ✓ openapi.json (dry-run): ${String(hydrated.length)} ops`)\n console.log(JSON.stringify(result.document, null, 2))\n console.log(`\\n Docs: ${MIGRATION_GUIDE_URL}\\n`)\n return\n }\n\n const distDir = resolve(cwd, config.distDir)\n const result = emitOpenApi({\n manifest: hydrated,\n config: { ...config.openapi, outDir: distDir },\n })\n console.log(\n `\\n ✓ openapi.json: ${String(hydrated.length)} ops → ${result.path}\\n` +\n ` Docs: ${MIGRATION_GUIDE_URL}\\n`,\n )\n}\n\n/**\n * Dry-run helper: build the OpenAPI doc without writing. Routes through\n * the same `emitOpenApi` but discards the side-effecting write by\n * targeting a temp directory we immediately ignore.\n *\n * Honest tradeoff: this still calls `mkdirSync` (no-op on existing tmpdir)\n * + a synchronous write to a discardable tempfile. Cost is < 1ms and the\n * code stays the single transformation. A pure no-write helper would\n * duplicate the orchestration in `emit.ts` — KISS prefers reuse.\n */\nfunction emitOpenApiInMemory(\n manifest: Parameters<typeof emitOpenApi>[0]['manifest'],\n config: Omit<Parameters<typeof emitOpenApi>[0]['config'], 'outDir'>,\n): { document: unknown } {\n const tmp = mkdtempSync(join(tmpdir(), 'theokit-openapi-dryrun-'))\n try {\n const result = emitOpenApi({ manifest, config: { ...config, outDir: tmp } })\n return { document: result.document }\n } finally {\n rmSync(tmp, { recursive: true, force: true })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAcA,SAAS,aAAa,cAAc;AACpC,SAAS,cAAc;AACvB,SAAS,MAAM,eAAe;AAO9B,IAAM,sBAAsB;AAS5B,eAAsB,eAAe,UAAiC,CAAC,GAAkB;AACvF,QAAM,MAAM,QAAQ,OAAO,QAAQ,IAAI;AACvC,QAAM,SAAS,MAAM,WAAW,GAAG;AAEnC,MAAI,OAAO,YAAY,QAAW;AAChC,YAAQ;AAAA,MACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQW,mBAAmB;AAAA;AAAA,IAChC;AACA,YAAQ,KAAK,CAAC;AACd;AAAA,EACF;AAEA,QAAM,YAAY,QAAQ,KAAK,OAAO,SAAS;AAC/C,QAAM,WAAW,iBAAiB,SAAS;AAC3C,QAAM,WAAW,MAAM,qBAAqB,EAAE,WAAW,QAAQ,SAAS,OAAO,CAAC;AAElF,MAAI,QAAQ,QAAQ;AAGlB,UAAMA,UAAS,oBAAoB,UAAU,OAAO,OAAO;AAC3D,YAAQ,IAAI;AAAA,mCAAiC,OAAO,SAAS,MAAM,CAAC,MAAM;AAC1E,YAAQ,IAAI,KAAK,UAAUA,QAAO,UAAU,MAAM,CAAC,CAAC;AACpD,YAAQ,IAAI;AAAA,UAAa,mBAAmB;AAAA,CAAI;AAChD;AAAA,EACF;AAEA,QAAM,UAAU,QAAQ,KAAK,OAAO,OAAO;AAC3C,QAAM,SAAS,YAAY;AAAA,IACzB,UAAU;AAAA,IACV,QAAQ,EAAE,GAAG,OAAO,SAAS,QAAQ,QAAQ;AAAA,EAC/C,CAAC;AACD,UAAQ;AAAA,IACN;AAAA,yBAAuB,OAAO,SAAS,MAAM,CAAC,eAAU,OAAO,IAAI;AAAA,UACtD,mBAAmB;AAAA;AAAA,EAClC;AACF;AAYA,SAAS,oBACP,UACA,QACuB;AACvB,QAAM,MAAM,YAAY,KAAK,OAAO,GAAG,yBAAyB,CAAC;AACjE,MAAI;AACF,UAAM,SAAS,YAAY,EAAE,UAAU,QAAQ,EAAE,GAAG,QAAQ,QAAQ,IAAI,EAAE,CAAC;AAC3E,WAAO,EAAE,UAAU,OAAO,SAAS;AAAA,EACrC,UAAE;AACA,WAAO,KAAK,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,EAC9C;AACF;","names":["result"]}
1
+ {"version":3,"sources":["../src/cli/commands/openapi.ts"],"sourcesContent":["/**\n * `theokit openapi` — regenerate `<distDir>/openapi.json` standalone.\n *\n * Mirrors trpc-openapi's `pnpm codegen` script. Useful in dev workflows\n * when only schemas changed and a full `theokit build` would be\n * overkill.\n *\n * Per G2 plan v1.1 T2.3. Single output (dev location only) — for the\n * dist artifact, run `theokit build`.\n *\n * Flags:\n * --dry-run Validate + print the document to stdout; skip the\n * filesystem write (EC-3 absorbed).\n */\nimport { mkdtempSync, rmSync } from 'node:fs'\nimport { tmpdir } from 'node:os'\nimport { join, resolve } from 'node:path'\n\nimport { loadConfig } from '../../config/load-config.js'\nimport { generateManifest } from '../../server/scan/manifest.js'\nimport { emitOpenApi } from '../../vite-plugin/openapi-emit/emit.js'\nimport { loadRoutesForOpenApi } from '../../vite-plugin/openapi-emit/load-routes.js'\n\nconst OPENAPI_DOCS_URL = 'https://theokit.dev/concepts/openapi'\n\ninterface OpenApiCommandOptions {\n /** Project root (defaults to `process.cwd()`). */\n cwd?: string\n /** Skip the filesystem write; print the document to stdout (EC-3). */\n dryRun?: boolean\n}\n\nexport async function openapiCommand(options: OpenApiCommandOptions = {}): Promise<void> {\n const cwd = options.cwd ?? process.cwd()\n const config = await loadConfig(cwd)\n\n if (config.openapi === undefined) {\n console.error(\n `\\n ✗ openapi: not configured in theo.config.ts\\n\\n` +\n ` Add the \\`openapi\\` block to opt in:\\n\\n` +\n ` export default defineConfig({\\n` +\n ` openapi: {\\n` +\n ` title: 'My App',\\n` +\n ` version: '1.0.0',\\n` +\n ` },\\n` +\n ` })\\n\\n` +\n ` See ${OPENAPI_DOCS_URL} for the full reference.\\n`,\n )\n process.exit(1)\n return\n }\n\n const serverDir = resolve(cwd, config.serverDir)\n const manifest = generateManifest(serverDir)\n const hydrated = await loadRoutesForOpenApi({ serverDir, routes: manifest.routes })\n\n if (options.dryRun) {\n // Build the document without writing — for the dry-run we still want a\n // valid emit pass, but with an in-memory output dir we never touch disk.\n const result = emitOpenApiInMemory(hydrated, config.openapi)\n console.log(`\\n ✓ openapi.json (dry-run): ${String(hydrated.length)} ops`)\n console.log(JSON.stringify(result.document, null, 2))\n console.log(`\\n Docs: ${OPENAPI_DOCS_URL}\\n`)\n return\n }\n\n const distDir = resolve(cwd, config.distDir)\n const result = emitOpenApi({\n manifest: hydrated,\n config: { ...config.openapi, outDir: distDir },\n })\n console.log(\n `\\n ✓ openapi.json: ${String(hydrated.length)} ops → ${result.path}\\n` +\n ` Docs: ${OPENAPI_DOCS_URL}\\n`,\n )\n}\n\n/**\n * Dry-run helper: build the OpenAPI doc without writing. Routes through\n * the same `emitOpenApi` but discards the side-effecting write by\n * targeting a temp directory we immediately ignore.\n *\n * Honest tradeoff: this still calls `mkdirSync` (no-op on existing tmpdir)\n * + a synchronous write to a discardable tempfile. Cost is < 1ms and the\n * code stays the single transformation. A pure no-write helper would\n * duplicate the orchestration in `emit.ts` — KISS prefers reuse.\n */\nfunction emitOpenApiInMemory(\n manifest: Parameters<typeof emitOpenApi>[0]['manifest'],\n config: Omit<Parameters<typeof emitOpenApi>[0]['config'], 'outDir'>,\n): { document: unknown } {\n const tmp = mkdtempSync(join(tmpdir(), 'theokit-openapi-dryrun-'))\n try {\n const result = emitOpenApi({ manifest, config: { ...config, outDir: tmp } })\n return { document: result.document }\n } finally {\n rmSync(tmp, { recursive: true, force: true })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAcA,SAAS,aAAa,cAAc;AACpC,SAAS,cAAc;AACvB,SAAS,MAAM,eAAe;AAO9B,IAAM,mBAAmB;AASzB,eAAsB,eAAe,UAAiC,CAAC,GAAkB;AACvF,QAAM,MAAM,QAAQ,OAAO,QAAQ,IAAI;AACvC,QAAM,SAAS,MAAM,WAAW,GAAG;AAEnC,MAAI,OAAO,YAAY,QAAW;AAChC,YAAQ;AAAA,MACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQW,gBAAgB;AAAA;AAAA,IAC7B;AACA,YAAQ,KAAK,CAAC;AACd;AAAA,EACF;AAEA,QAAM,YAAY,QAAQ,KAAK,OAAO,SAAS;AAC/C,QAAM,WAAW,iBAAiB,SAAS;AAC3C,QAAM,WAAW,MAAM,qBAAqB,EAAE,WAAW,QAAQ,SAAS,OAAO,CAAC;AAElF,MAAI,QAAQ,QAAQ;AAGlB,UAAMA,UAAS,oBAAoB,UAAU,OAAO,OAAO;AAC3D,YAAQ,IAAI;AAAA,mCAAiC,OAAO,SAAS,MAAM,CAAC,MAAM;AAC1E,YAAQ,IAAI,KAAK,UAAUA,QAAO,UAAU,MAAM,CAAC,CAAC;AACpD,YAAQ,IAAI;AAAA,UAAa,gBAAgB;AAAA,CAAI;AAC7C;AAAA,EACF;AAEA,QAAM,UAAU,QAAQ,KAAK,OAAO,OAAO;AAC3C,QAAM,SAAS,YAAY;AAAA,IACzB,UAAU;AAAA,IACV,QAAQ,EAAE,GAAG,OAAO,SAAS,QAAQ,QAAQ;AAAA,EAC/C,CAAC;AACD,UAAQ;AAAA,IACN;AAAA,yBAAuB,OAAO,SAAS,MAAM,CAAC,eAAU,OAAO,IAAI;AAAA,UACtD,gBAAgB;AAAA;AAAA,EAC/B;AACF;AAYA,SAAS,oBACP,UACA,QACuB;AACvB,QAAM,MAAM,YAAY,KAAK,OAAO,GAAG,yBAAyB,CAAC;AACjE,MAAI;AACF,UAAM,SAAS,YAAY,EAAE,UAAU,QAAQ,EAAE,GAAG,QAAQ,QAAQ,IAAI,EAAE,CAAC;AAC3E,WAAO,EAAE,UAAU,OAAO,SAAS;AAAA,EACrC,UAAE;AACA,WAAO,KAAK,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,EAC9C;AACF;","names":["result"]}
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ import "tsx/esm";
3
+
4
+ // src/adapters/registry.ts
5
+ var adapterRegistry = {
6
+ node: async () => (await import("./node-ZJQEJSP3.js")).nodeAdapter,
7
+ vercel: async () => (await import("./vercel-SRS2DH6O.js")).vercelAdapter,
8
+ cloudflare: async () => (await import("./cloudflare-KYUWCEPL.js")).cloudflareAdapter,
9
+ static: async () => (await import("./static-R25HSXEF.js")).staticAdapter,
10
+ bun: async () => (await import("./bun-33RD6K7O.js")).bunAdapter,
11
+ "deno-deploy": async () => (await import("./deno-deploy-CCTB7HGS.js")).denoDeployAdapter,
12
+ netlify: async () => (await import("./netlify-AFMDNKT4.js")).netlifyAdapter,
13
+ "aws-lambda": async () => (await import("./aws-lambda-CYNDGU5O.js")).awsLambdaAdapter,
14
+ "theo-cloud": async () => (await import("./theo-cloud-XAHWOUFK.js")).theoCloudAdapter
15
+ };
16
+ async function resolveAdapter(target) {
17
+ const factory = adapterRegistry[target];
18
+ return factory();
19
+ }
20
+ export {
21
+ resolveAdapter
22
+ };
23
+ //# sourceMappingURL=registry-UJ6KNQPJ.js.map
@@ -269,4 +269,4 @@ export {
269
269
  isPortInUse,
270
270
  routerMigrateCommand
271
271
  };
272
- //# sourceMappingURL=router-6MAACS25.js.map
272
+ //# sourceMappingURL=router-V64GKAS6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/commands/migrate/router.ts","../src/cli/commands/migrate/router-codemod.ts"],"sourcesContent":["/**\n * G6 T2.1 — `theokit migrate router` CLI subcommand.\n *\n *\n * Wraps the pure `planRouterMigration` with side effects:\n * - EC-2: pre-flight `isPortInUse(3000|3100)` warning to prevent the\n * dev-server HMR cascade described in the edge-case review.\n * - EC-7: partial failure produces a typed `RouterMigrationPartialFailure`\n * with `filesAlreadyMigrated` so a re-run can continue from where it\n * stopped (idempotent by virtue of `planRouterMigration`).\n * - Prefers `git mv $from $to` so the rename appears as a single\n * history entry; falls back to `mkdir -p $(dirname $to) && fs.rename`\n * when not in a git repo or git mv fails.\n */\nimport { execFileSync } from 'node:child_process'\nimport { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs'\nimport { createServer } from 'node:net'\nimport { dirname, resolve } from 'node:path'\n\nimport {\n computeDepthDelta,\n planRouterMigration,\n rewriteRelativeImports,\n type RouterMigrationPlanItem,\n} from './router-codemod.js'\n\ninterface RouterMigrateOptions {\n /** Absolute path to `<project>/server/routes`. Defaults to `<cwd>/server/routes`. */\n routesDir?: string\n /**\n * Skip the EC-2 dev-server port pre-flight check (CI / non-TTY).\n * Default: false.\n */\n force?: boolean\n /** When true, prints the plan but performs no renames (dry-run). */\n dryRun?: boolean\n /** When true, suppresses stdout (used in tests). */\n silent?: boolean\n}\n\n/**\n * Thrown when the codemod completes with at least one successful rename\n * AND at least one failure — caller can re-run safely (idempotent) and\n * the second pass will skip already-migrated files.\n */\nclass RouterMigrationPartialFailure extends Error {\n override readonly name = 'RouterMigrationPartialFailure'\n readonly filesAlreadyMigrated: string[]\n readonly failedFile: string\n readonly causeMessage: string\n constructor(filesAlreadyMigrated: string[], failedFile: string, causeMessage: string) {\n super(\n `Router migration partial failure: ${filesAlreadyMigrated.length} files migrated successfully, then failed on ${failedFile}: ${causeMessage}. Re-run \\`theokit migrate router\\` to retry — already-migrated files will be skipped.`,\n )\n this.filesAlreadyMigrated = filesAlreadyMigrated\n this.failedFile = failedFile\n this.causeMessage = causeMessage\n }\n}\n\n/**\n * EC-2: dev-server detection. Returns true if the port is in use (someone\n * is already listening on localhost:<port>). Uses Node's `node:net` —\n * zero new deps.\n */\nexport async function isPortInUse(port: number): Promise<boolean> {\n return await new Promise<boolean>((resolve) => {\n const probe = createServer()\n probe.once('error', (err: NodeJS.ErrnoException) => {\n probe.close(() => {\n resolve(err.code === 'EADDRINUSE')\n })\n })\n probe.once('listening', () => {\n probe.close(() => {\n resolve(false)\n })\n })\n probe.listen(port, '127.0.0.1')\n })\n}\n\n/**\n * EC-2 pre-flight: returns the first port in use among the typical\n * theokit dev ports (3000 + 3100) so the caller can warn the user.\n */\nexport async function findRunningDevServerPort(): Promise<number | null> {\n for (const port of [3000, 3100]) {\n if (await isPortInUse(port)) return port\n }\n return null\n}\n\nfunction tryGitMv(from: string, to: string): boolean {\n try {\n mkdirSync(dirname(to), { recursive: true })\n // Arguments are absolute paths from a recursive walk of <routesDir>.\n // Pass as argv to avoid shell parsing entirely (no `shell: true`).\n // `git` is resolved via the operator's PATH (same security model as\n // every other CLI tool — `theokit dev`, `pnpm install`, etc.).\n\n execFileSync('git', ['mv', from, to], { stdio: 'pipe' })\n return true\n } catch {\n return false\n }\n}\n\nfunction fallbackRename(from: string, to: string): void {\n mkdirSync(dirname(to), { recursive: true })\n renameSync(from, to)\n}\n\nfunction applyRename(item: RouterMigrationPlanItem): void {\n if (!existsSync(item.from)) {\n // Idempotency: already migrated — skip silently\n return\n }\n if (existsSync(item.to)) {\n // The plan() phase would have thrown CollisionError if we knew about\n // it at plan time. This branch covers a race condition where the\n // target was created between plan and apply.\n throw new Error(\n `Refusing to overwrite existing file at ${item.to} during migration of ${item.from}`,\n )\n }\n if (!tryGitMv(item.from, item.to)) {\n fallbackRename(item.from, item.to)\n }\n}\n\n/**\n * Adjust relative imports inside the renamed file to compensate for the\n * extra nesting depth. Without this, `import { foo } from './chat'` inside\n * a file moved from `routes/admin.sdk-config.ts` → `routes/admin/sdk-config.ts`\n * would fail to resolve at typecheck/runtime — the import needs `../chat`\n * now that the file lives one level deeper.\n */\nfunction applyImportRewrite(item: RouterMigrationPlanItem, routesDir: string): void {\n const delta = computeDepthDelta(item.from, item.to, routesDir)\n if (delta <= 0) return\n const source = readFileSync(item.to, 'utf8')\n const rewritten = rewriteRelativeImports(source, delta)\n if (rewritten !== source) {\n writeFileSync(item.to, rewritten, 'utf8')\n }\n}\n\ninterface RouterMigrateResult {\n /** Successfully renamed (from, to) pairs. */\n migrated: RouterMigrationPlanItem[]\n /** Plan was empty — nothing to do (already-nested). */\n alreadyClean: boolean\n}\n\ntype LogFn = (msg: string) => void\n\nfunction makeLog(silent: boolean | undefined): LogFn {\n if (silent) {\n return (_msg: string) => {\n // intentionally silent\n }\n }\n return (msg: string) => {\n console.log(msg)\n }\n}\n\nasync function assertNoRunningDevServer(opts: RouterMigrateOptions): Promise<void> {\n if (opts.force) return\n const runningPort = await findRunningDevServerPort()\n if (runningPort !== null) {\n throw new Error(\n `Detected theokit dev server running on port ${runningPort}. STOP it before running migration to avoid HMR cascade (see EC-2). Re-run with --force to override.`,\n )\n }\n}\n\nfunction executeRenames(\n plan: readonly RouterMigrationPlanItem[],\n routesDir: string,\n log: LogFn,\n): RouterMigrationPlanItem[] {\n const migrated: RouterMigrationPlanItem[] = []\n for (const item of plan) {\n try {\n applyRename(item)\n applyImportRewrite(item, routesDir)\n migrated.push(item)\n log(` ✓ ${item.from} → ${item.to}`)\n } catch (err) {\n // EC-7: partial failure observability — emit structured error with\n // the list of already-migrated files so a re-run can recover.\n const causeMessage = err instanceof Error ? err.message : String(err)\n throw new RouterMigrationPartialFailure(\n migrated.map((m) => m.from),\n item.from,\n causeMessage,\n )\n }\n }\n return migrated\n}\n\nexport async function routerMigrateCommand(\n opts: RouterMigrateOptions = {},\n): Promise<RouterMigrateResult> {\n const routesDir = opts.routesDir ?? resolve(process.cwd(), 'server', 'routes')\n const log = makeLog(opts.silent)\n\n await assertNoRunningDevServer(opts)\n\n const plan = planRouterMigration(routesDir)\n if (plan.length === 0) {\n log(' ✓ Router already uses directory-nested convention. Nothing to do.')\n return { migrated: [], alreadyClean: true }\n }\n\n log(` → Migrating ${plan.length} dotted route(s) to directory-nested form...`)\n\n if (opts.dryRun) {\n for (const item of plan) {\n log(` [dry-run] ${item.from} → ${item.to}`)\n }\n return { migrated: [], alreadyClean: false }\n }\n\n const migrated = executeRenames(plan, routesDir, log)\n log(` ✓ Migrated ${migrated.length} route(s).`)\n return { migrated, alreadyClean: false }\n}\n","/**\n * G6 T2.1 — Pure codemod core for `theokit migrate router`.\n *\n *\n * `planRouterMigration` walks `<routesDir>` recursively and returns the\n * set of (from, to) renames required to convert legacy dotted-basename\n * routes (`auth.[provider].login.ts`) into the directory-nested form\n * (`auth/[provider]/login.ts`). The function is PURE — it does NOT\n * touch the filesystem beyond `readdirSync`/`statSync`. The CLI subcommand\n * (`router.ts`) is responsible for executing the renames via `git mv`\n * or `fs.rename` with the appropriate error handling.\n *\n * Edge cases covered:\n * - EC-4: co-located `*.test.[jt]sx?` / `*.spec.[jt]sx?` files are\n * silently skipped (same filter as the scanner).\n * - EC-5: target collision detection is CASE-INSENSITIVE so a\n * macOS/Windows dev doesn't silently overwrite a sibling file that\n * differs only in case.\n * - Idempotent: invoked twice on the same tree, the second pass is empty.\n */\nimport { readdirSync, statSync } from 'node:fs'\nimport { extname, join, relative, sep } from 'node:path'\n\nconst ROUTE_EXTENSIONS = new Set(['.ts', '.tsx', '.js', '.jsx'])\nconst TEST_OR_SPEC_RE = /\\.(test|spec)\\.[jt]sx?$/\n\n/**\n * One pending rename emitted by `planRouterMigration`.\n */\nexport interface RouterMigrationPlanItem {\n /** Absolute path of the offending dotted-basename file. */\n from: string\n /** Absolute path of the proposed directory-nested replacement. */\n to: string\n}\n\n/**\n * `RouterMigrationCollisionError` is thrown when migrating a dotted file\n * would overwrite an existing file (case-insensitive). The caller MUST\n * resolve the conflict manually before re-running the codemod.\n */\nexport class RouterMigrationCollisionError extends Error {\n override readonly name = 'RouterMigrationCollisionError'\n readonly from: string\n readonly to: string\n constructor(from: string, to: string) {\n super(\n `Router migration collision: ${from} would rename to ${to}, but that file already exists (case-insensitive match). Resolve manually.`,\n )\n this.from = from\n this.to = to\n }\n}\n\n/**\n * Compute the depth delta (number of extra `..` levels needed) between\n * the original (dotted) path and the migrated (nested) path, relative\n * to a common `routesDir` ancestor.\n *\n * - `admin.sdk-config.ts` (depth 0) → `admin/sdk-config.ts` (depth 1): delta = 1\n * - `debug.stability.last.ts` (depth 0) → `debug/stability/last.ts` (depth 2): delta = 2\n * - `canvas/artifacts.[id].ts` (depth 1) → `canvas/artifacts/[id].ts` (depth 2): delta = 1\n */\nexport function computeDepthDelta(from: string, to: string, routesDir: string): number {\n const depthOf = (p: string): number => {\n const rel = relative(routesDir, p).replace(/\\\\/g, '/')\n // depth = number of `/` separators in the relative path\n return rel.split('/').length - 1\n }\n return depthOf(to) - depthOf(from)\n}\n\n/**\n * Rewrite all relative imports in `source` by prepending `../` × `delta`\n * to every `./X` or `../X` specifier. Absolute / package specifiers\n * (`theokit/server`, `zod`, `node:fs`) are untouched.\n *\n * Handles three import shapes:\n * - `import ... from './foo'`\n * - `import('./foo')` (dynamic)\n * - `import './foo'` (side-effect only)\n * - `export ... from './foo'` (re-exports)\n *\n * Pure: returns the new source; does NOT touch disk.\n */\nexport function rewriteRelativeImports(source: string, delta: number): string {\n if (delta <= 0) return source\n\n const prefix = '../'.repeat(delta)\n\n // Rewrites a captured relative specifier: `./foo` → `<prefix>foo`,\n // `../foo` → `<prefix>../foo`. Single source of truth for the algorithm\n // shared by all three import-shape regexes below.\n const transformSpecifier = (specifier: string): string => {\n if (specifier.startsWith('./')) return `${prefix}${specifier.slice(2)}`\n return `${prefix}${specifier}`\n }\n\n // Three narrow regexes keep us out of catastrophic-backtracking territory.\n // Each is anchored on a keyword (`from`, `import`) and uses a possessive\n // character class (`[^'\"]+`) for the specifier, so backtracking is bounded.\n const fromRe = /\\bfrom\\s+(['\"])(\\.{1,2}\\/[^'\"]+)\\1/g\n const dynRe = /\\bimport\\s*\\(\\s*(['\"])(\\.{1,2}\\/[^'\"]+)\\1\\s*\\)/g\n const sideRe = /\\bimport\\s+(['\"])(\\.{1,2}\\/[^'\"]+)\\1/g\n\n const fromSub = (_m: string, q: string, spec: string): string =>\n `from ${q}${transformSpecifier(spec)}${q}`\n const dynSub = (_m: string, q: string, spec: string): string =>\n `import(${q}${transformSpecifier(spec)}${q})`\n const sideSub = (_m: string, q: string, spec: string): string =>\n `import ${q}${transformSpecifier(spec)}${q}`\n\n // `from` covers both `import ... from '...'` and `export ... from '...'`\n // (the `\\bfrom\\s+` anchor matches the keyword position in both shapes).\n // `dynRe` handles `import('...')`. `sideRe` handles bare `import '...'`.\n // No overlap — `sideRe` requires `import` followed by whitespace then\n // a quote (vs. `import(` for dynRe and `import ... from` for fromRe).\n return source.replace(fromRe, fromSub).replace(dynRe, dynSub).replace(sideRe, sideSub)\n}\n\nfunction isTestOrSpecFile(filePath: string): boolean {\n return TEST_OR_SPEC_RE.test(filePath)\n}\n\nfunction hasDotOutsideBrackets(segment: string): boolean {\n let depth = 0\n for (const ch of segment) {\n if (ch === '[') depth++\n else if (ch === ']') depth--\n else if (ch === '.' && depth === 0) return true\n }\n return false\n}\n\nfunction splitDottedSegmentOutsideBrackets(segment: string): string[] {\n const parts: string[] = []\n let current = ''\n let depth = 0\n for (const ch of segment) {\n if (ch === '[') {\n depth++\n current += ch\n } else if (ch === ']') {\n depth--\n current += ch\n } else if (ch === '.' && depth === 0) {\n if (current) parts.push(current)\n current = ''\n } else {\n current += ch\n }\n }\n if (current) parts.push(current)\n return parts\n}\n\nfunction toDirectoryNestedPath(filePath: string, routesDir: string): string {\n const rel = relative(routesDir, filePath).replace(/\\\\/g, '/')\n const ext = extname(rel)\n const withoutExt = rel.slice(0, -ext.length)\n const flattened = withoutExt.split('/').flatMap(splitDottedSegmentOutsideBrackets)\n return join(routesDir, `${flattened.join(sep)}${ext}`)\n}\n\nfunction walkRoutes(root: string, onFile: (absPath: string) => void): void {\n let entries\n try {\n entries = readdirSync(root, { withFileTypes: true })\n } catch {\n return\n }\n for (const entry of entries) {\n if (entry.name.startsWith('_') || entry.name.startsWith('.')) continue\n const full = join(root, entry.name)\n if (entry.isDirectory()) {\n walkRoutes(full, onFile)\n } else if (entry.isFile() && ROUTE_EXTENSIONS.has(extname(entry.name))) {\n onFile(full)\n }\n }\n}\n\nfunction isDottedRouteFile(filePath: string, routesDir: string): boolean {\n const rel = relative(routesDir, filePath).replace(/\\\\/g, '/')\n const ext = extname(rel)\n const withoutExt = rel.slice(0, -ext.length)\n return withoutExt.split('/').some(hasDotOutsideBrackets)\n}\n\n/**\n * Compute the migration plan for a `<server>/routes` tree.\n *\n * Pure: does NOT mutate the filesystem.\n *\n * @throws RouterMigrationCollisionError when a target collides with an\n * existing file (case-insensitive).\n */\nexport function planRouterMigration(routesDir: string): RouterMigrationPlanItem[] {\n const plan: RouterMigrationPlanItem[] = []\n const existingPathsLowercase = new Set<string>()\n\n walkRoutes(routesDir, (absPath) => {\n existingPathsLowercase.add(absPath.toLowerCase())\n })\n\n walkRoutes(routesDir, (absPath) => {\n if (isTestOrSpecFile(absPath)) return\n if (!isDottedRouteFile(absPath, routesDir)) return\n\n const to = toDirectoryNestedPath(absPath, routesDir)\n\n // EC-5: case-insensitive collision check — macOS HFS+/APFS default\n // and Windows NTFS treat case-only differences as the same path. If\n // any pre-existing file at a case-insensitive match exists, the codemod\n // would silently overwrite on those platforms; we bail explicitly.\n const targetLower = to.toLowerCase()\n if (existingPathsLowercase.has(targetLower) && targetLower !== absPath.toLowerCase()) {\n throw new RouterMigrationCollisionError(absPath, to)\n }\n // Also guard against statSync race using an explicit existence check.\n try {\n if (statSync(to).isFile()) {\n throw new RouterMigrationCollisionError(absPath, to)\n }\n } catch (err) {\n if (err instanceof RouterMigrationCollisionError) throw err\n // ENOENT — fine, target does not exist\n }\n\n plan.push({ from: absPath, to })\n })\n\n return plan\n}\n"],"mappings":";;;;AAcA,SAAS,oBAAoB;AAC7B,SAAS,YAAY,WAAW,cAAc,YAAY,qBAAqB;AAC/E,SAAS,oBAAoB;AAC7B,SAAS,SAAS,eAAe;;;ACGjC,SAAS,aAAa,gBAAgB;AACtC,SAAS,SAAS,MAAM,UAAU,WAAW;AAE7C,IAAM,mBAAmB,oBAAI,IAAI,CAAC,OAAO,QAAQ,OAAO,MAAM,CAAC;AAC/D,IAAM,kBAAkB;AAiBjB,IAAM,gCAAN,cAA4C,MAAM;AAAA,EACrC,OAAO;AAAA,EAChB;AAAA,EACA;AAAA,EACT,YAAY,MAAc,IAAY;AACpC;AAAA,MACE,+BAA+B,IAAI,oBAAoB,EAAE;AAAA,IAC3D;AACA,SAAK,OAAO;AACZ,SAAK,KAAK;AAAA,EACZ;AACF;AAWO,SAAS,kBAAkB,MAAc,IAAY,WAA2B;AACrF,QAAM,UAAU,CAAC,MAAsB;AACrC,UAAM,MAAM,SAAS,WAAW,CAAC,EAAE,QAAQ,OAAO,GAAG;AAErD,WAAO,IAAI,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,UAAI,kBAAkB,KAAK,IAAI,WAAM,KAAK,EAAE,EAAE;AAAA,IAChD;AACA,WAAO,EAAE,UAAU,CAAC,GAAG,cAAc,MAAM;AAAA,EAC7C;AAEA,QAAM,WAAW,eAAe,MAAM,WAAW,GAAG;AACpD,MAAI,qBAAgB,SAAS,MAAM,YAAY;AAC/C,SAAO,EAAE,UAAU,cAAc,MAAM;AACzC;","names":["resolve"]}
@@ -5,15 +5,15 @@ import {
5
5
  } from "./chunk-GEQJAFSV.js";
6
6
  import {
7
7
  loadConfig
8
- } from "./chunk-AOGYAXPY.js";
8
+ } from "./chunk-GH32R55S.js";
9
9
  import "./chunk-HBU2GIMZ.js";
10
- import "./chunk-5JJCNEUS.js";
11
- import "./chunk-CUYEA62B.js";
10
+ import "./chunk-A4ZEP3FE.js";
11
+ import "./chunk-7VPQHEAJ.js";
12
12
  import {
13
13
  scanServerActions,
14
14
  scanServerRoutes,
15
15
  scanWebSocketRoutes
16
- } from "./chunk-MNIQ5F3Y.js";
16
+ } from "./chunk-BMHS4WAN.js";
17
17
  import "./chunk-A7JBF5FO.js";
18
18
 
19
19
  // src/cli/commands/routes.ts
@@ -62,4 +62,4 @@ async function routesCommand() {
62
62
  export {
63
63
  routesCommand
64
64
  };
65
- //# sourceMappingURL=routes-GWAWUVVQ.js.map
65
+ //# sourceMappingURL=routes-6AMNVFMI.js.map
File without changes
@@ -8,7 +8,7 @@ import { z } from 'zod';
8
8
  * boots alongside the TheoKit TS app. Empty `services: {}` is the default
9
9
  * and preserves Wave 1 behavior (no impact on TS-only apps).
10
10
  *
11
- * See ADRs 0012-0015 + plan: docs/plans/wave-2-polyglot-services-plan.md
11
+ * See ADRs 0012-0015 +
12
12
  */
13
13
 
14
14
  /**
@@ -3,20 +3,16 @@ import "tsx/esm";
3
3
  import {
4
4
  cacheSchema,
5
5
  corsSchema,
6
- rateLimitSchema,
7
6
  securityHeadersSchema,
8
- securitySchema,
9
7
  storageSchema,
10
8
  theoConfigSchema
11
- } from "./chunk-5JJCNEUS.js";
12
- import "./chunk-CUYEA62B.js";
9
+ } from "./chunk-A4ZEP3FE.js";
10
+ import "./chunk-7VPQHEAJ.js";
13
11
  export {
14
12
  cacheSchema,
15
13
  corsSchema,
16
- rateLimitSchema,
17
14
  securityHeadersSchema,
18
- securitySchema,
19
15
  storageSchema,
20
16
  theoConfigSchema
21
17
  };
22
- //# sourceMappingURL=schema-2JEG6TTU.js.map
18
+ //# sourceMappingURL=schema-Z3Y7SFLE.js.map
@@ -3,7 +3,7 @@ import { C as CustomTool } from '../../define-agent-tool-cRuSpidb.js';
3
3
  import { AcpTransport } from '@theokit/agents';
4
4
  export { InProcessApprovalRequest, InProcessApprovalRequiredError, InProcessAwaitApproval, StreamAgentTurnDeps, StreamAgentTurnInProcessInput, streamAgentTurnInProcess } from '@theokit/agents';
5
5
  import { CustomTool as CustomTool$1 } from '@theokit/sdk';
6
- import { V as VerifyFn } from '../../webhook-types-CNUZY7o1.js';
6
+ import { V as VerifyFn } from '../../webhook-types-DGIjjcaI.js';
7
7
 
8
8
  /**
9
9
  * Provider Resolver — Strategy + Registry pattern (FAANG-grade).
@@ -4,8 +4,6 @@ export { InMemoryUsageStorage as NeutralUsageStorage } from '@theokit/agents/usa
4
4
  /**
5
5
  * Cost tracking types (R0.5.11).
6
6
  *
7
- * @see docs/adr/0002-job-backend-interface-neutral-contract.md (mirror pattern)
8
- *
9
7
  * Phase 5 — Production-Readiness #4: adds `ToolUsageRecord` for per-tool
10
8
  * latency / error tracking via SDK's onToolStart/onToolEnd/onToolError hooks.
11
9
  * Same UsageStorageAdapter handles both via discriminated union.
@@ -114,7 +112,6 @@ interface TrackAgentRunOptions {
114
112
  * Agents tab can render the run. Prod tree-shakes the entire dispatcher
115
113
  * import via the `__IS_DEV` IIFE guard.
116
114
  *
117
- * @see docs/concepts/cost-tracking.md (when implemented in T6.3)
118
115
  */
119
116
  declare function trackAgentRun(input: TrackAgentRunInput, opts: TrackAgentRunOptions): Promise<void>;
120
117
 
@@ -3,7 +3,7 @@ import {
3
3
  InMemoryUsageStorage2,
4
4
  trackAgentRun,
5
5
  trackAgentTools
6
- } from "../../chunk-Y2KHTD2W.js";
6
+ } from "../../chunk-GQNBZDYK.js";
7
7
  import "../../chunk-XTHN6JBX.js";
8
8
  export {
9
9
  InMemoryUsageStorage,
@@ -1,7 +1,5 @@
1
1
  /**
2
2
  * Cron primitive types (R0.5.4).
3
- *
4
- * @see docs/adr/0004-cron-schedule-5-field-utc-strict.md
5
3
  */
6
4
  type CronConcurrencyPolicy = 'forbid' | 'allow';
7
5
  interface CronContext {
@@ -67,8 +65,6 @@ declare function defineCron(name: string, options: CronOptions): CronDefinition;
67
65
  *
68
66
  * Throws on every invalid input. Every error message includes the
69
67
  * original input and the fix.
70
- *
71
- * @see docs/adr/0004-cron-schedule-5-field-utc-strict.md
72
68
  */
73
69
  declare function validateCronSchedule(schedule: string): void;
74
70
 
@@ -14,7 +14,7 @@ import {
14
14
  translateCronToVercel,
15
15
  validateCronSchedule,
16
16
  writeCronManifest
17
- } from "../../chunk-2ADKT37V.js";
17
+ } from "../../chunk-LXAESF4Y.js";
18
18
  import "../../chunk-VZTYCAO6.js";
19
19
  import "../../chunk-RWNSW4FM.js";
20
20
  import "../../chunk-52PDWL5S.js";
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { W as WebSocketHandler, b as WebSocketLike } from '../../define-websocket-CPQcQK9h.js';
3
- export { a as WebSocketHandlerWeb } from '../../define-websocket-CPQcQK9h.js';
2
+ import { W as WebSocketHandler, b as WebSocketLike } from '../../define-websocket-DzPn1sR6.js';
3
+ export { a as WebSocketHandlerWeb } from '../../define-websocket-DzPn1sR6.js';
4
4
  import { b as ToolTransform, C as CustomTool } from '../../define-agent-tool-cRuSpidb.js';
5
5
  export { D as DefineAgentToolSpec, T as ToolContextMessage, a as ToolHandlerContext, c as applyTransform } from '../../define-agent-tool-cRuSpidb.js';
6
6
  import { f as OnRequestHook, i as PreHandlerHook, g as OnResponseHook, O as OnErrorHook, T as TheoPlugin } from '../../plugin-types-D69-lJZ9.js';
@@ -382,7 +382,6 @@ declare function defineChannel<TMessage = unknown>(handler: ChannelHandler<TMess
382
382
  * — the rest of the surface (onMessage, onUnsubscribe) is shape-agnostic
383
383
  * (WebSocketLike is already Web-standards-compatible per `define-websocket.ts`).
384
384
  *
385
- * Per `docs/plans/t5a2-incoming-message-to-request-shape-refactor-plan.md`
386
385
  * v1.0 § Phase F.
387
386
  *
388
387
  * **Architectural note:** WebSocket upgrade semantics differ across
@@ -8,7 +8,7 @@ import {
8
8
  tool,
9
9
  uiMessageStreamResponse,
10
10
  websocket
11
- } from "../../chunk-62EU2BVZ.js";
11
+ } from "../../chunk-J5MXCGKA.js";
12
12
  import {
13
13
  HEALTH_PATH,
14
14
  READY_PATH,
@@ -1,6 +1,6 @@
1
1
  import { RouteConfig } from './define/index.js';
2
2
  export { ActionAccept, ActionBuilder, ActionConfig, ChannelHandler, MiddlewareBuilder, MiddlewareHandler, PluginBuilder, RouteBuilder, ToolBuilder, WebChannelHandler, WebSocketBuilder, action, defineChannel, defineWebChannel, middleware, plugin, route, tool, uiMessageStreamResponse, websocket } from './define/index.js';
3
- export { W as WebSocketHandler, a as WebSocketHandlerWeb, b as WebSocketLike } from '../define-websocket-CPQcQK9h.js';
3
+ export { W as WebSocketHandler, a as WebSocketHandlerWeb, b as WebSocketLike } from '../define-websocket-DzPn1sR6.js';
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-cRuSpidb.js';
5
5
  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';
6
6
  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, g as CorsConfig, h as CorsHandler, i as CorsOrigin, j as CorsWebHandler, k as CustomErrorPages, E as ExecuteActionOptions, l as ExecuteRouteContext, H as HandleBatchOptions, M as MAX_ERROR_HTML_BYTES, m as MiddlewareResult, N as NotFoundError, S as STRIPPED_HEADERS, n as SendErrorInput, o as SendErrorOptions, T as TRACE_HEADER, p as TRACE_PARENT_HEADER, q as TheoError, r as TheoTransformer, _ as _resetMiddlewareCacheForTests, s as appendCookieToHeaders, t as appendDeleteCookieToHeaders, u as createCorsHandler, v as createCorsWebHandler, w as deleteCookie, x as envelopeCodeToStatus, y as executeAction, z as executeRoute, A as extractTraceId, D as extractTraceIdFromRequest, F as fromUnknown, G as getCookie, I as getCookieFromRequest, J as handleBatchRequest, K as handleRequestError, L as handleWebRequestError, O as jsonTransformer, P as loadCustomErrorPages, Q as matchesOrigin, R as parseCookieHeader, U as parseTraceparent, V as resolveTransformer, W as runMiddlewareAndContext, X as sendError, Y as sendJson, Z as serializeCookie, $ as serveStaticFile, a0 as serverErrorToEnvelope, a1 as setCookie, a2 as superjsonTransformer } from '../index-BEtEv6ZH.js';
@@ -26,17 +26,17 @@ export { ChannelManager } from './realtime/index.js';
26
26
  export { CSP_REPORT_PATH, CSRF_READINESS_PATH, CSRF_READINESS_RESET_PATH, CspMode, CspReportHandlerOptions, CspViolation, DEFAULT_CSP, DEFAULT_PERMISSIONS_POLICY, SecurityEnv, SecurityHeadersConfig, SecurityHeadersOptions, applySecurityHeaders, buildSecurityHeaders, handleCspReport, handleCspReportRequest, handleCsrfReadiness, handleCsrfReadinessRequest, normalizeLegacy, normalizeNew } from './security/index.js';
27
27
  export { C as CSRF_WARN_CODE, a as CSRF_WARN_DOCS_URL, b as CsrfLogger, c as CsrfMode, d as CsrfWarnPayload, D as DisallowedConfig, e as enforceCsrf, m as matchDisallowed, v as validateCsrf, f as validateCsrfRequest } from '../csrf-BBrEZSBW.js';
28
28
  export { a as CsrfReadinessRouteSummary, C as CsrfReadinessStore, b as CsrfReadinessSummary, c as CsrfWarnRecord } from '../csrf-readiness-store-CjIoub3U.js';
29
- export { P as PostgresFactory, R as RedisFactory, S as StorageManager, g as getStorageManager } from '../storage-manager-C4jsO0Tp.js';
29
+ export { P as PostgresFactory, R as RedisFactory, S as StorageManager, g as getStorageManager } from '../storage-manager-C6hmsaer.js';
30
30
  export { Db0Database, UnstorageInstance, useDatabase, useUnstorage } from './storage/index.js';
31
31
  export { G as GenericFactory, a as PoolLike, P as PostgresDatabaseConfig, c as RedisLike, R as RedisServerConfig, S as ServerConfig, d as StorageAdapter, b as StorageConfig, T as TlsConfig } from '../storage-types-DsDTCPbp.js';
32
32
  export { BodyTooLargeError, DEFAULT_MAX_BODY_BYTES, RawBodyResult, ReadRawBodyOptions, defineWebhook, dispatchWebhook, readRawBody, timingSafeEqual } from './webhook/index.js';
33
- export { D as DefineWebhookOptions, V as VerifyFn, a as VerifyResult, W as WebhookContext, b as WebhookDefinition } from '../webhook-types-CNUZY7o1.js';
33
+ export { D as DefineWebhookOptions, V as VerifyFn, a as VerifyResult, W as WebhookContext, b as WebhookDefinition } from '../webhook-types-DGIjjcaI.js';
34
34
  import { z } from 'zod';
35
35
  import { IncomingMessage } from 'node:http';
36
36
  import { W as WebOnRequestHook, b as WebPreHandlerHook, c as WebOnResponseHook, d as WebOnErrorHook } from '../plugin-types-D69-lJZ9.js';
37
37
  export { e as HookName, H as HookResult, O as OnErrorHook, f as OnRequestHook, g as OnResponseHook, P as PluginContext, h as PluginErrorContext, i as PreHandlerHook, R as RunHookOptions, a as TheoApp, T as TheoPlugin } from '../plugin-types-D69-lJZ9.js';
38
38
  export { ComposeInstructionsOptions, ComposedInstructions, ConfigLayer, ContextPressure, ContextPressureThresholdError, ContextPressureThresholds, CustomCommand, CustomCommandsResult, DEFAULT_CONTEXT_PRESSURE_THRESHOLDS, InstructionBlock, InstructionSource, InstructionTree, InstructionTreeBudget, LayerOutOfOrderError, LayeredConfig, LayeredConfigInput, LayeredConfigResult, LoadCustomCommandsInput, LoadInstructionTreeInput, ParsedFrontmatter, PrecedenceReport, ProvenancePerKey, TrustRecord, TrustStore, TrustStorePermissionsError, composeInstructions, contextPressure, effectiveContextWindow, frontmatterValue, loadCustomCommands, loadInstructionTree, splitFrontmatter } from '@theokit/agents/config';
39
- export { a as ServiceDefinition, S as ServicesConfig, b as ServicesConfigInput, c as ServicesConfigOutput } from '../schema-BpH6ivDY.js';
39
+ export { a as ServiceDefinition, S as ServicesConfig, b as ServicesConfigInput, c as ServicesConfigOutput } from '../schema-BdakLtuC.js';
40
40
  import '@theokit/presenter/wire';
41
41
  import 'vite';
42
42
  import '@theokit/sdk';
@@ -865,7 +865,6 @@ declare function validateRouteInput(config: RouteInputSchemas, raw: RawRouteInpu
865
865
  * check. Failures throw typed errors (there is no HTTP status off-web).
866
866
  *
867
867
  * Prior art: tRPC `callProcedure` / `createCallerFactory`
868
- * (`.claude/knowledge-base/references/trpc/packages/server/src/unstable-core-do-not-import/router.ts:401,441`).
869
868
  *
870
869
  * Design (ADR-0044 / blueprint §5.4): the AUTHOR passes structured input `{query?, body?, params?}`
871
870
  * — never synthesizes a Request. A minimal in-process `Request` is provided to the handler ONLY so
@@ -972,7 +971,6 @@ declare const CTX_WRITERS: {
972
971
 
973
972
  /**
974
973
  * Types for `loadEnv()` — env auto-load utility (Phase 1 of
975
- * docs/plans/framework-zero-config-polish-plan.md).
976
974
  *
977
975
  * The shape mirrors Next.js's `LoadedEnvFiles` (`next-env/index.ts:114`).
978
976
  */
@@ -28,7 +28,7 @@ import {
28
28
  defineJob,
29
29
  scanJobs,
30
30
  writeJobManifest
31
- } from "../chunk-L5Z6IY5U.js";
31
+ } from "../chunk-FNTLKHZ7.js";
32
32
  import {
33
33
  ConsoleObservabilityAdapter,
34
34
  NoopObservabilityAdapter,
@@ -61,7 +61,7 @@ import {
61
61
  resolveTransformer,
62
62
  superjsonTransformer,
63
63
  validateRouteInput
64
- } from "../chunk-FO55VGMQ.js";
64
+ } from "../chunk-XR74JD4M.js";
65
65
  import {
66
66
  ActionError,
67
67
  ActionInputError,
@@ -134,7 +134,7 @@ import {
134
134
  scanServerRoutes,
135
135
  scanWebSocketRoutes,
136
136
  writeManifest
137
- } from "../chunk-KSZGBUTI.js";
137
+ } from "../chunk-YGAXV5HR.js";
138
138
  import "../chunk-DV34VG3N.js";
139
139
  import {
140
140
  scanMiddlewares
@@ -249,7 +249,7 @@ import {
249
249
  InMemoryUsageStorage2,
250
250
  trackAgentRun,
251
251
  trackAgentTools
252
- } from "../chunk-Y2KHTD2W.js";
252
+ } from "../chunk-GQNBZDYK.js";
253
253
  import {
254
254
  CRON_MANIFEST_SCHEMA_VERSION,
255
255
  DuplicateCronNameError,
@@ -266,7 +266,7 @@ import {
266
266
  translateCronToVercel,
267
267
  validateCronSchedule,
268
268
  writeCronManifest
269
- } from "../chunk-2ADKT37V.js";
269
+ } from "../chunk-LXAESF4Y.js";
270
270
  import "../chunk-VZTYCAO6.js";
271
271
  import "../chunk-RWNSW4FM.js";
272
272
  import "../chunk-52PDWL5S.js";
@@ -281,7 +281,7 @@ import {
281
281
  tool,
282
282
  uiMessageStreamResponse,
283
283
  websocket
284
- } from "../chunk-62EU2BVZ.js";
284
+ } from "../chunk-J5MXCGKA.js";
285
285
  import {
286
286
  HEALTH_PATH,
287
287
  READY_PATH,