theokit 0.4.0-beta.0 → 0.4.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 (297) hide show
  1. package/dist/{actions-virtual-module-HWNTIEPI.js → actions-virtual-module-IY46EEEX.js} +2 -2
  2. package/dist/{actions-virtual-module-SEIPACG5.js → actions-virtual-module-XNHDNCZ6.js} +2 -2
  3. package/dist/add-2ZFFGGE4.js +0 -0
  4. package/dist/{app-typed-client-ITIYTBXO.js → app-typed-client-OUJO3V5J.js} +10 -5
  5. package/dist/{app-typed-client-62FYBLVJ.js.map → app-typed-client-OUJO3V5J.js.map} +1 -1
  6. package/dist/{app-typed-client-62FYBLVJ.js → app-typed-client-YOMWSA3F.js} +11 -6
  7. package/dist/{app-typed-client-ITIYTBXO.js.map → app-typed-client-YOMWSA3F.js.map} +1 -1
  8. package/dist/audit-log-BQWM5YLG.d.ts +60 -0
  9. package/dist/{aws-lambda-XYCGZH3I.js → aws-lambda-GKSTX6HD.js} +3 -3
  10. package/dist/body-parser-web-MUWBKZ3F.js +70 -0
  11. package/dist/body-parser-web-MUWBKZ3F.js.map +1 -0
  12. package/dist/broadcast-QOQGUNNK.js +0 -0
  13. package/dist/{build-HIGHJQQV.js → build-D4J7XECU.js} +31 -22
  14. package/dist/build-D4J7XECU.js.map +1 -0
  15. package/dist/build-request-body-preview-II2235E6.js +0 -0
  16. package/dist/{bun-K73TQEWC.js → bun-ISHSNFIO.js} +3 -3
  17. package/dist/{check-PZR67OY5.js → check-NXYPLM6M.js} +2 -2
  18. package/dist/{chunk-WZ7CPVQB.js → chunk-27LWMYNK.js} +28 -24
  19. package/dist/chunk-27LWMYNK.js.map +1 -0
  20. package/dist/{chunk-BIGBFZSU.js → chunk-2F4FROEQ.js} +1689 -1521
  21. package/dist/chunk-2F4FROEQ.js.map +1 -0
  22. package/dist/chunk-4HBI7DHP.js +20 -0
  23. package/dist/chunk-4HBI7DHP.js.map +1 -0
  24. package/dist/{chunk-X4JAX2U3.js → chunk-4S2UCILN.js} +180 -125
  25. package/dist/chunk-4S2UCILN.js.map +1 -0
  26. package/dist/{chunk-C52GSJPF.js → chunk-4S6YHNG2.js} +11 -8
  27. package/dist/chunk-4S6YHNG2.js.map +1 -0
  28. package/dist/chunk-5ODOE6EF.js +0 -0
  29. package/dist/{chunk-KJVEJILQ.js → chunk-5PU65T5W.js} +9 -3
  30. package/dist/chunk-5PU65T5W.js.map +1 -0
  31. package/dist/chunk-5QW7IQQU.js +36 -0
  32. package/dist/chunk-5QW7IQQU.js.map +1 -0
  33. package/dist/chunk-5Z2727GV.js +1324 -0
  34. package/dist/chunk-5Z2727GV.js.map +1 -0
  35. package/dist/{chunk-YLBSSEHX.js → chunk-6NEXVBPY.js} +5 -15
  36. package/dist/chunk-6NEXVBPY.js.map +1 -0
  37. package/dist/chunk-7MQOHNHE.js +36 -0
  38. package/dist/chunk-7MQOHNHE.js.map +1 -0
  39. package/dist/{chunk-TPCT3MXV.js → chunk-ABVITXFH.js} +405 -272
  40. package/dist/chunk-ABVITXFH.js.map +1 -0
  41. package/dist/chunk-ASDXVRJD.js +185 -0
  42. package/dist/chunk-ASDXVRJD.js.map +1 -0
  43. package/dist/chunk-B3L3TJVF.js +406 -0
  44. package/dist/chunk-B3L3TJVF.js.map +1 -0
  45. package/dist/{chunk-PB4GR7EP.js → chunk-C3ZZ56YZ.js} +1 -18
  46. package/dist/chunk-C3ZZ56YZ.js.map +1 -0
  47. package/dist/{chunk-O7335ZGH.js → chunk-CG563V5M.js} +5 -3
  48. package/dist/chunk-CG563V5M.js.map +1 -0
  49. package/dist/{chunk-5OFPQK6N.js → chunk-COXLEZCN.js} +2 -1
  50. package/dist/chunk-COXLEZCN.js.map +1 -0
  51. package/dist/{chunk-O4BLVPML.js → chunk-DNMSV3R3.js} +22 -28
  52. package/dist/chunk-DNMSV3R3.js.map +1 -0
  53. package/dist/chunk-E3JH6YUM.js +1 -0
  54. package/dist/chunk-ESC54TAK.js +220 -0
  55. package/dist/chunk-ESC54TAK.js.map +1 -0
  56. package/dist/chunk-FI7MPTJW.js +77 -0
  57. package/dist/chunk-FI7MPTJW.js.map +1 -0
  58. package/dist/chunk-H4J2LECY.js +201 -0
  59. package/dist/chunk-H4J2LECY.js.map +1 -0
  60. package/dist/chunk-IAJ2JVEH.js +256 -0
  61. package/dist/chunk-IAJ2JVEH.js.map +1 -0
  62. package/dist/{chunk-F3TG5FJV.js → chunk-IEZCAT2I.js} +7 -1
  63. package/dist/{chunk-F3TG5FJV.js.map → chunk-IEZCAT2I.js.map} +1 -1
  64. package/dist/chunk-JHEAWR3L.js +1 -0
  65. package/dist/chunk-JQSKBMXP.js +17 -0
  66. package/dist/chunk-JQSKBMXP.js.map +1 -0
  67. package/dist/{chunk-4QTKSLTO.js → chunk-K4M64WD6.js} +9 -5
  68. package/dist/{chunk-4QTKSLTO.js.map → chunk-K4M64WD6.js.map} +1 -1
  69. package/dist/chunk-KI7OWQUX.js +293 -0
  70. package/dist/chunk-KI7OWQUX.js.map +1 -0
  71. package/dist/chunk-KT3MWNZG.js +0 -0
  72. package/dist/{chunk-ZJW5FFYJ.js → chunk-LC5PYNJP.js} +2 -2
  73. package/dist/{chunk-JAAHOGKI.js → chunk-M2EY7KDR.js} +1223 -1124
  74. package/dist/chunk-M2EY7KDR.js.map +1 -0
  75. package/dist/{chunk-2VQKDRVF.js → chunk-MR7OLIC6.js} +3 -3
  76. package/dist/chunk-NM4WF3XD.js +63 -0
  77. package/dist/chunk-NM4WF3XD.js.map +1 -0
  78. package/dist/chunk-NPMCKOX4.js +1 -0
  79. package/dist/{chunk-VRHXOKRP.js → chunk-NZXH2LQQ.js} +86 -83
  80. package/dist/chunk-NZXH2LQQ.js.map +1 -0
  81. package/dist/{chunk-B6RP57M3.js → chunk-OLPB36O2.js} +4 -4
  82. package/dist/chunk-PIVX3DYW.js +142 -0
  83. package/dist/chunk-PIVX3DYW.js.map +1 -0
  84. package/dist/{chunk-7TOMTMHT.js → chunk-R7OC6UDK.js} +2 -1
  85. package/dist/chunk-R7OC6UDK.js.map +1 -0
  86. package/dist/chunk-RESN62GB.js +269 -0
  87. package/dist/chunk-RESN62GB.js.map +1 -0
  88. package/dist/{chunk-64JI5LTO.js → chunk-RMU7EBRO.js} +2 -2
  89. package/dist/chunk-RMU7EBRO.js.map +1 -0
  90. package/dist/chunk-TQYSPYKU.js +131 -0
  91. package/dist/chunk-TQYSPYKU.js.map +1 -0
  92. package/dist/chunk-TSLSIRBR.js +107 -0
  93. package/dist/chunk-TSLSIRBR.js.map +1 -0
  94. package/dist/{chunk-XP7YXRHO.js → chunk-U6TPSW4L.js} +37 -5
  95. package/dist/chunk-U6TPSW4L.js.map +1 -0
  96. package/dist/chunk-UD3LFGDL.js +45 -0
  97. package/dist/chunk-UD3LFGDL.js.map +1 -0
  98. package/dist/chunk-UUFYP2UM.js +161 -0
  99. package/dist/chunk-UUFYP2UM.js.map +1 -0
  100. package/dist/{chunk-OXIQI2XZ.js → chunk-VBZCVFSA.js} +2 -2
  101. package/dist/chunk-VMEWD57H.js +137 -0
  102. package/dist/chunk-VMEWD57H.js.map +1 -0
  103. package/dist/{chunk-TRH2L3FI.js → chunk-WEGALZEU.js} +3 -3
  104. package/dist/{chunk-ZOXNJV2O.js → chunk-WGHJD6I7.js} +35 -138
  105. package/dist/chunk-WGHJD6I7.js.map +1 -0
  106. package/dist/chunk-XMS5VRIK.js +0 -0
  107. package/dist/chunk-Y4H3JNVK.js +18 -0
  108. package/dist/chunk-Y4H3JNVK.js.map +1 -0
  109. package/dist/chunk-Z5IGLBWE.js +329 -0
  110. package/dist/chunk-Z5IGLBWE.js.map +1 -0
  111. package/dist/chunk-ZEGYW52B.js +26 -0
  112. package/dist/chunk-ZEGYW52B.js.map +1 -0
  113. package/dist/chunk-ZJQ4O76G.js +87 -0
  114. package/dist/chunk-ZJQ4O76G.js.map +1 -0
  115. package/dist/cli/index.js +32 -21
  116. package/dist/cli/index.js.map +1 -1
  117. package/dist/client/index.d.ts +107 -1
  118. package/dist/client/index.js +152 -6
  119. package/dist/client/index.js.map +1 -1
  120. package/dist/{cloudflare-LCAOTRYZ.js → cloudflare-OJGJ7R2D.js} +3 -3
  121. package/dist/configure-agent-registry-6YGTJYBC.js +0 -0
  122. package/dist/cookies-MJKMGJ7N.js +22 -0
  123. package/dist/csrf-BBrEZSBW.d.ts +107 -0
  124. package/dist/csrf-readiness-store-CjIoub3U.d.ts +43 -0
  125. package/dist/define-websocket-CdK94O-D.d.ts +64 -0
  126. package/dist/{deno-deploy-ZN4RE5HF.js → deno-deploy-BHWKFTOW.js} +3 -3
  127. package/dist/{dev-266MVCVA.js → dev-MJVSRZGF.js} +11 -11
  128. package/dist/{dev-emit-RBSFZZNO.js → dev-emit-5VPRCHOD.js} +39 -142
  129. package/dist/dev-emit-5VPRCHOD.js.map +1 -0
  130. package/dist/{dev-emit-NO6OZJOQ.js → dev-emit-HHP2XJXE.js} +5 -5
  131. package/dist/devtools/entry.js +185 -131
  132. package/dist/devtools/entry.js.map +1 -1
  133. package/dist/{dispatcher-AQJGI3HU.js → dispatcher-63LBXYLE.js} +2 -2
  134. package/dist/{dispatcher-E6QV32BO.js → dispatcher-EJME6C6M.js} +5 -2
  135. package/dist/dispatcher-EJME6C6M.js.map +1 -0
  136. package/dist/{dist-5V77Z223.js → dist-KRW6OVD4.js} +7 -7
  137. package/dist/dist-KRW6OVD4.js.map +1 -0
  138. package/dist/docker-EZDA5FT7.js +0 -0
  139. package/dist/error-envelope-BsNzzAV5.d.ts +62 -0
  140. package/dist/{generate-DT4IIAHF.js → generate-AZ2K6Z2Z.js} +75 -2
  141. package/dist/generate-AZ2K6Z2Z.js.map +1 -0
  142. package/dist/index-DWWEdFh5.d.ts +399 -0
  143. package/dist/index.d.ts +161 -1391
  144. package/dist/index.js +20 -8
  145. package/dist/index.js.map +1 -1
  146. package/dist/{info-FJ4NXKTB.js → info-47VB62MV.js} +5 -5
  147. package/dist/job-backend-CgC8Xf33.d.ts +68 -0
  148. package/dist/{lib-NL5JXGEB.js → lib-NST3PNZX.js} +31 -31
  149. package/dist/lib-NST3PNZX.js.map +1 -0
  150. package/dist/module-loader-Cfz7dgCP.d.ts +26 -0
  151. package/dist/{netlify-5VQ22Z2P.js → netlify-GSNSJGMN.js} +3 -3
  152. package/dist/{node-3APTLGWB.js → node-6I5B6RL3.js} +3 -3
  153. package/dist/node-6I5B6RL3.js.map +1 -0
  154. package/dist/{openapi-FNVSWZOL.js → openapi-NFLSNNVQ.js} +10 -10
  155. package/dist/plugin-runner-BGBkzgi0.d.ts +95 -0
  156. package/dist/plugin-types-DNJGxr4Z.d.ts +79 -0
  157. package/dist/{proper-lockfile-4Y3DP3RP.js → proper-lockfile-MVKMQGFK.js} +27 -27
  158. package/dist/proper-lockfile-MVKMQGFK.js.map +1 -0
  159. package/dist/rate-limit-BdNDZ3vt.d.ts +58 -0
  160. package/dist/registry-QHEZ3BWB.js +25 -0
  161. package/dist/router-RGZFX75G.js +0 -0
  162. package/dist/{routes-H4SPLFHJ.js → routes-3A4XGIEJ.js} +6 -6
  163. package/dist/{scan-C2BOKLSY.js → scan-NQFI5S7P.js} +2 -2
  164. package/dist/scan-NQFI5S7P.js.map +1 -0
  165. package/dist/schema-D3v8VB7o.d.ts +76 -0
  166. package/dist/{schema-VR6YNVLQ.js → schema-KZVOV333.js} +5 -3
  167. package/dist/schema-KZVOV333.js.map +1 -0
  168. package/dist/server/agent/index.d.ts +229 -0
  169. package/dist/server/agent/index.js +16 -0
  170. package/dist/server/agent/index.js.map +1 -0
  171. package/dist/server/auth/index.d.ts +46 -1
  172. package/dist/server/auth/index.js +10 -3
  173. package/dist/server/cost/index.d.ts +1 -3
  174. package/dist/server/cost/index.js +1 -1
  175. package/dist/server/cron/index.js +4 -2
  176. package/dist/server/define/index.d.ts +281 -0
  177. package/dist/server/define/index.js +26 -0
  178. package/dist/server/define/index.js.map +1 -0
  179. package/dist/server/http/index.d.ts +10 -0
  180. package/dist/server/http/index.js +74 -0
  181. package/dist/server/http/index.js.map +1 -0
  182. package/dist/server/index.d.ts +151 -1677
  183. package/dist/server/index.js +558 -1102
  184. package/dist/server/index.js.map +1 -1
  185. package/dist/server/jobs/index.d.ts +348 -2
  186. package/dist/server/jobs/index.js +5 -3
  187. package/dist/server/observability/index.d.ts +324 -0
  188. package/dist/server/observability/index.js +48 -0
  189. package/dist/server/observability/index.js.map +1 -0
  190. package/dist/server/plugins/index.d.ts +17 -0
  191. package/dist/server/plugins/index.js +17 -0
  192. package/dist/server/plugins/index.js.map +1 -0
  193. package/dist/server/rate-limit/index.d.ts +105 -0
  194. package/dist/server/rate-limit/index.js +25 -0
  195. package/dist/server/rate-limit/index.js.map +1 -0
  196. package/dist/server/realtime/index.d.ts +15 -0
  197. package/dist/server/realtime/index.js +8 -0
  198. package/dist/server/realtime/index.js.map +1 -0
  199. package/dist/server/scan/index.d.ts +106 -0
  200. package/dist/server/scan/index.js +43 -0
  201. package/dist/server/scan/index.js.map +1 -0
  202. package/dist/server/security/index.d.ts +193 -0
  203. package/dist/server/security/index.js +50 -0
  204. package/dist/server/security/index.js.map +1 -0
  205. package/dist/server/storage/index.d.ts +22 -0
  206. package/dist/server/storage/index.js +14 -0
  207. package/dist/server/storage/index.js.map +1 -0
  208. package/dist/server/webhook/index.d.ts +148 -0
  209. package/dist/server/webhook/index.js +19 -0
  210. package/dist/server/webhook/index.js.map +1 -0
  211. package/dist/server-error-to-envelope-NO4CCAFQ.js +8 -0
  212. package/dist/server-error-to-envelope-NO4CCAFQ.js.map +1 -0
  213. package/dist/server-error-to-envelope-UJK6OWDJ.js +134 -0
  214. package/dist/server-error-to-envelope-UJK6OWDJ.js.map +1 -0
  215. package/dist/server-routes-hmr-GZJGPWMS.js +0 -0
  216. package/dist/services-json-Z2QNGVPW.js +142 -0
  217. package/dist/services-json-Z2QNGVPW.js.map +1 -0
  218. package/dist/{services-typed-client-XWYYBWGW.js → services-typed-client-KK6RHRDG.js} +2 -2
  219. package/dist/{services-typed-client-ZX5JUHH3.js → services-typed-client-T7M5VPBP.js} +2 -2
  220. package/dist/{sqlite-vec-ARPNUBWT.js → sqlite-vec-54KB4RD3.js} +2 -2
  221. package/dist/sqlite-vec-54KB4RD3.js.map +1 -0
  222. package/dist/{start-HX3QUSOS.js → start-CGSZPBAG.js} +23 -23
  223. package/dist/start-CGSZPBAG.js.map +1 -0
  224. package/dist/{static-TZBVBDTB.js → static-QI5NQT2X.js} +6 -6
  225. package/dist/storage-manager-C4jsO0Tp.d.ts +89 -0
  226. package/dist/storage-manager-D5KBXXKB.js +0 -0
  227. package/dist/{storage-types-DtIVejC1.d.ts → storage-types-DsDTCPbp.d.ts} +1 -1
  228. package/dist/{theo-cloud-3K4DGB3S.js → theo-cloud-RSQCBNXL.js} +4 -4
  229. package/dist/theo-cloud-RSQCBNXL.js.map +1 -0
  230. package/dist/upgrade-readiness-GUJBCJIS.js +0 -0
  231. package/dist/{vercel-MWW24ABC.js → vercel-TKPZK62A.js} +3 -3
  232. package/dist/vite-plugin/index.d.ts +3 -1
  233. package/dist/vite-plugin/index.js +20 -8
  234. package/dist/{vite-plugin-IK3NOWXS.js → vite-plugin-CR4JDFUQ.js} +9 -9
  235. package/dist/vite-plugin-CR4JDFUQ.js.map +1 -0
  236. package/package.json +59 -10
  237. package/LICENSE +0 -201
  238. package/dist/build-HIGHJQQV.js.map +0 -1
  239. package/dist/chunk-5OFPQK6N.js.map +0 -1
  240. package/dist/chunk-64JI5LTO.js.map +0 -1
  241. package/dist/chunk-7TOMTMHT.js.map +0 -1
  242. package/dist/chunk-BIGBFZSU.js.map +0 -1
  243. package/dist/chunk-C52GSJPF.js.map +0 -1
  244. package/dist/chunk-CZM6WWWS.js +0 -2450
  245. package/dist/chunk-CZM6WWWS.js.map +0 -1
  246. package/dist/chunk-JAAHOGKI.js.map +0 -1
  247. package/dist/chunk-KJVEJILQ.js.map +0 -1
  248. package/dist/chunk-O4BLVPML.js.map +0 -1
  249. package/dist/chunk-O7335ZGH.js.map +0 -1
  250. package/dist/chunk-PB4GR7EP.js.map +0 -1
  251. package/dist/chunk-TPCT3MXV.js.map +0 -1
  252. package/dist/chunk-VRHXOKRP.js.map +0 -1
  253. package/dist/chunk-WZ7CPVQB.js.map +0 -1
  254. package/dist/chunk-X4JAX2U3.js.map +0 -1
  255. package/dist/chunk-XP7YXRHO.js.map +0 -1
  256. package/dist/chunk-YLBSSEHX.js.map +0 -1
  257. package/dist/chunk-ZOXNJV2O.js.map +0 -1
  258. package/dist/dev-emit-RBSFZZNO.js.map +0 -1
  259. package/dist/dispatcher-E6QV32BO.js.map +0 -1
  260. package/dist/dist-5V77Z223.js.map +0 -1
  261. package/dist/generate-DT4IIAHF.js.map +0 -1
  262. package/dist/index-li83Swxa.d.ts +0 -506
  263. package/dist/lib-NL5JXGEB.js.map +0 -1
  264. package/dist/proper-lockfile-4Y3DP3RP.js.map +0 -1
  265. package/dist/registry-4MZ26TZD.js +0 -25
  266. package/dist/schema-CjVly9c_.d.ts +0 -274
  267. package/dist/sqlite-vec-ARPNUBWT.js.map +0 -1
  268. package/dist/start-HX3QUSOS.js.map +0 -1
  269. package/dist/theo-cloud-3K4DGB3S.js.map +0 -1
  270. /package/dist/{actions-virtual-module-HWNTIEPI.js.map → actions-virtual-module-IY46EEEX.js.map} +0 -0
  271. /package/dist/{actions-virtual-module-SEIPACG5.js.map → actions-virtual-module-XNHDNCZ6.js.map} +0 -0
  272. /package/dist/{aws-lambda-XYCGZH3I.js.map → aws-lambda-GKSTX6HD.js.map} +0 -0
  273. /package/dist/{bun-K73TQEWC.js.map → bun-ISHSNFIO.js.map} +0 -0
  274. /package/dist/{check-PZR67OY5.js.map → check-NXYPLM6M.js.map} +0 -0
  275. /package/dist/{dispatcher-AQJGI3HU.js.map → chunk-E3JH6YUM.js.map} +0 -0
  276. /package/dist/{node-3APTLGWB.js.map → chunk-JHEAWR3L.js.map} +0 -0
  277. /package/dist/{chunk-ZJW5FFYJ.js.map → chunk-LC5PYNJP.js.map} +0 -0
  278. /package/dist/{chunk-2VQKDRVF.js.map → chunk-MR7OLIC6.js.map} +0 -0
  279. /package/dist/{scan-C2BOKLSY.js.map → chunk-NPMCKOX4.js.map} +0 -0
  280. /package/dist/{chunk-B6RP57M3.js.map → chunk-OLPB36O2.js.map} +0 -0
  281. /package/dist/{chunk-OXIQI2XZ.js.map → chunk-VBZCVFSA.js.map} +0 -0
  282. /package/dist/{chunk-TRH2L3FI.js.map → chunk-WEGALZEU.js.map} +0 -0
  283. /package/dist/{cloudflare-LCAOTRYZ.js.map → cloudflare-OJGJ7R2D.js.map} +0 -0
  284. /package/dist/{schema-VR6YNVLQ.js.map → cookies-MJKMGJ7N.js.map} +0 -0
  285. /package/dist/{deno-deploy-ZN4RE5HF.js.map → deno-deploy-BHWKFTOW.js.map} +0 -0
  286. /package/dist/{dev-266MVCVA.js.map → dev-MJVSRZGF.js.map} +0 -0
  287. /package/dist/{dev-emit-NO6OZJOQ.js.map → dev-emit-HHP2XJXE.js.map} +0 -0
  288. /package/dist/{vite-plugin-IK3NOWXS.js.map → dispatcher-63LBXYLE.js.map} +0 -0
  289. /package/dist/{info-FJ4NXKTB.js.map → info-47VB62MV.js.map} +0 -0
  290. /package/dist/{netlify-5VQ22Z2P.js.map → netlify-GSNSJGMN.js.map} +0 -0
  291. /package/dist/{openapi-FNVSWZOL.js.map → openapi-NFLSNNVQ.js.map} +0 -0
  292. /package/dist/{registry-4MZ26TZD.js.map → registry-QHEZ3BWB.js.map} +0 -0
  293. /package/dist/{routes-H4SPLFHJ.js.map → routes-3A4XGIEJ.js.map} +0 -0
  294. /package/dist/{services-typed-client-XWYYBWGW.js.map → services-typed-client-KK6RHRDG.js.map} +0 -0
  295. /package/dist/{services-typed-client-ZX5JUHH3.js.map → services-typed-client-T7M5VPBP.js.map} +0 -0
  296. /package/dist/{static-TZBVBDTB.js.map → static-QI5NQT2X.js.map} +0 -0
  297. /package/dist/{vercel-MWW24ABC.js.map → vercel-TKPZK62A.js.map} +0 -0
@@ -0,0 +1,281 @@
1
+ import { z } from 'zod';
2
+ import { A as AgentEvent } from '../../agent-events-B3KNV9ER.js';
3
+ import { b as WebSocketLike } from '../../define-websocket-CdK94O-D.js';
4
+ export { W as WebSocketHandler, a as WebSocketHandlerWeb, d as defineWebSocket, c as defineWebSocketWeb } from '../../define-websocket-CdK94O-D.js';
5
+ import { IncomingMessage } from 'node:http';
6
+ import { T as TheoPlugin } from '../../plugin-types-DNJGxr4Z.js';
7
+
8
+ /**
9
+ * core/contracts/route-config.ts
10
+ *
11
+ * Canonical home for `RouteConfig<TQuery, TBody, TParams, TCtx, TResponse>` —
12
+ * the contract shape consumed by `defineRoute()` (server) and
13
+ * `defineCachedRoute()` (cache).
14
+ *
15
+ * Moved here in T2.2 of architecture-cleanup so `cache → core/contracts`
16
+ * is the legal edge (replacing the prior `cache → server` violation).
17
+ *
18
+ * GAP-4 (plan v1.1): the 5-arity generic shape `<TQuery, TBody, TParams, TCtx, TResponse>`
19
+ * MUST be preserved byte-by-byte. Type tests assert this in
20
+ * `tests/unit/route-config-generic-arity.test.ts`.
21
+ */
22
+
23
+ interface RouteConfig<TQuery extends z.ZodType = z.ZodUndefined, TBody extends z.ZodType = z.ZodUndefined, TParams extends z.ZodType = z.ZodUndefined, TCtx = unknown, TResponse = unknown> {
24
+ query?: TQuery;
25
+ body?: TBody;
26
+ params?: TParams;
27
+ status?: number;
28
+ /**
29
+ * Opt out of CSRF enforcement for this route. Use for endpoints that
30
+ * legitimately receive third-party POSTs (Stripe webhooks, GitHub
31
+ * webhooks, OAuth callbacks). Defaults to enforced per `config.security.csrf`.
32
+ *
33
+ * Setting `csrf: false` only disables the per-route check — it does NOT
34
+ * disable the global mode setting for other routes.
35
+ */
36
+ csrf?: false;
37
+ handler: (ctx: {
38
+ query: z.infer<TQuery>;
39
+ body: z.infer<TBody>;
40
+ params: z.infer<TParams>;
41
+ request: Request;
42
+ ctx: TCtx;
43
+ }) => TResponse | Promise<TResponse>;
44
+ }
45
+
46
+ /**
47
+ * Define a typed HTTP route.
48
+ * Identity function — provides type inference for route handlers.
49
+ */
50
+ declare function defineRoute<TQuery extends z.ZodType = z.ZodUndefined, TBody extends z.ZodType = z.ZodUndefined, TParams extends z.ZodType = z.ZodUndefined, TCtx = unknown, TResponse = unknown>(config: RouteConfig<TQuery, TBody, TParams, TCtx, TResponse>): RouteConfig<TQuery, TBody, TParams, TCtx, TResponse>;
51
+
52
+ /**
53
+ * Action wire-protocol accept mode per plan g3-server-actions-and-useaction
54
+ * v1.2 ADR D1. Default behavior (when omitted) is `'json'`. `'form'` opts the
55
+ * action into FormData multipart parsing for progressive-enhancement forms;
56
+ * the runtime in `server/http/action-execute.ts` will coerce FormData entries
57
+ * against the `input` schema via `formDataToObject` (Astro pattern).
58
+ */
59
+ type ActionAccept = 'form' | 'json';
60
+ interface ActionConfig<TInput extends z.ZodType, TCtx = unknown> {
61
+ /**
62
+ * Zod input schema. Required: every action declares its input contract via
63
+ * Zod (architecture rule: zod-is-SSOT). The shape becomes the handler's
64
+ * typed `input` parameter via `z.infer<TInput>`.
65
+ */
66
+ input: TInput;
67
+ /**
68
+ * Wire-protocol accept mode. Defaults to `'json'` when omitted. Setting
69
+ * `'form'` switches the runtime to FormData multipart parsing — the input
70
+ * schema MUST be `z.object(...)` so field-by-field coercion can drive
71
+ * boolean string / number / array coercion (Astro pattern).
72
+ */
73
+ accept?: ActionAccept;
74
+ handler: (ctx: {
75
+ input: z.infer<TInput>;
76
+ ctx: TCtx;
77
+ }) => unknown;
78
+ }
79
+ /**
80
+ * Define a typed server action.
81
+ *
82
+ * Identity function — provides type inference for action handlers. The
83
+ * runtime that consumes the config (validation + invocation + serialization)
84
+ * lives in `server/http/action-execute.ts`.
85
+ *
86
+ * Per plan g3-server-actions-and-useaction v1.2 § Phase 1 / T1.2: the new
87
+ * `accept?: 'form' | 'json'` field is the only contract change vs the
88
+ * pre-G3 identity. Existing callsites (`defineAction({input, handler})`)
89
+ * continue to compile — `accept` is opt-in.
90
+ */
91
+ declare function defineAction<TInput extends z.ZodType, TCtx = unknown>(config: ActionConfig<TInput, TCtx>): ActionConfig<TInput, TCtx>;
92
+
93
+ type MiddlewareHandler = (request: Request, next: (request: Request) => Promise<Response>) => Response | Promise<Response>;
94
+ /**
95
+ * Define a middleware handler.
96
+ * Identity function — provides type annotation for middleware.
97
+ */
98
+ declare function defineMiddleware(handler: MiddlewareHandler): MiddlewareHandler;
99
+
100
+ /**
101
+ * T5.1 — defineAgentEndpoint
102
+ *
103
+ * Sugar over defineRoute (ADR D4). Accepts an async generator that yields
104
+ * AgentEvents and produces a RouteConfig whose handler returns a Response
105
+ * streaming Server-Sent Events (SSE).
106
+ *
107
+ * Wire format: `data: <JSON>\n\n` per event. Standards-compliant.
108
+ *
109
+ * The generator may throw — the wrapper catches and emits a final
110
+ * `{ type: 'error', message }` event before closing the stream.
111
+ *
112
+ * The wrapper observes `request.signal` (EC-7) — when aborted, the
113
+ * underlying generator is told to `return()` and the stream closes
114
+ * promptly.
115
+ *
116
+ * Note (EC-12, Out of Scope): SSE backpressure (slow consumer) is not
117
+ * handled here. For high-frequency token streaming consider a different
118
+ * transport (WS) or a buffer policy. This MVP enqueues each event
119
+ * immediately.
120
+ */
121
+ interface AgentEndpointHandlerArgs<TCtx = unknown, TBody = unknown> {
122
+ query: undefined;
123
+ body: TBody;
124
+ params: undefined;
125
+ request: Request;
126
+ ctx: TCtx;
127
+ /**
128
+ * Mutable headers bag that the wrapper merges into the SSE response BEFORE
129
+ * the stream starts. Used by `createConversationHistory` to issue a
130
+ * conversation-id cookie on first request. Append entries via
131
+ * `cookieHeaders.append('set-cookie', '<cookie-string>')`.
132
+ *
133
+ * Cookies appended AFTER the first yield are NOT applied — the response
134
+ * headers commit when the wrapper constructs the Response, before the
135
+ * async generator runs. This is per HTTP semantics, not a wrapper choice.
136
+ */
137
+ cookieHeaders: Headers;
138
+ /**
139
+ * Phase 3 (Production-Readiness #5) — request abort signal.
140
+ *
141
+ * Fires when the SSE client disconnects (browser closes tab, abort fetch,
142
+ * etc.). Thread this to `agent.send(msg, { signal })` so the SDK cancels
143
+ * the in-flight provider call — STOPS TOKENS FROM CHARGING for output
144
+ * the user will never receive.
145
+ *
146
+ * EC-1 (MUST FIX): the signal is derived via duck-type detection
147
+ * (`'aborted' in r.signal && typeof r.signal.addEventListener === 'function'`)
148
+ * to survive cross-realm scenarios (Node 18 polyfills, undici, Edge
149
+ * runtimes with their own AbortSignal globals). `instanceof AbortSignal`
150
+ * would fail in those cases.
151
+ */
152
+ signal: AbortSignal;
153
+ }
154
+ interface AgentEndpointConfig<TCtx = unknown, TBody = unknown> {
155
+ handler: (args: AgentEndpointHandlerArgs<TCtx, TBody>) => AsyncGenerator<AgentEvent, void, unknown>;
156
+ }
157
+ declare function defineAgentEndpoint<TBody = unknown, TCtx = unknown>(config: AgentEndpointConfig<TCtx, TBody>): RouteConfig<z.ZodUndefined, z.ZodUndefined, z.ZodUndefined, TCtx, Response>;
158
+
159
+ /**
160
+ * Item #4 — `defineAgentTool`
161
+ *
162
+ * Sugar over the `@theokit/sdk` `CustomTool` contract. Takes a Zod schema +
163
+ * handler and produces a structurally-compatible `CustomTool` that
164
+ * `Agent.create({ tools: [...] })` accepts.
165
+ *
166
+ * Uses Zod v4's native `z.toJSONSchema()` to convert the input schema to
167
+ * JSON Schema for LLM providers.
168
+ *
169
+ * Handler error propagation:
170
+ * `defineAgentTool` parses the input via the Zod schema BEFORE calling the
171
+ * user handler. Invalid input throws a `ZodError`, which the SDK's tool-
172
+ * dispatcher (or the `streamAgentRun` adapter) sees as a tool failure and
173
+ * surfaces as an `error` AgentEvent on the SSE wire (ADR D3).
174
+ */
175
+ /**
176
+ * Local mirror of the SDK's `CustomTool` interface. We don't `import type`
177
+ * from `@theokit/sdk` because the SDK is an optional peer (consumers who
178
+ * never call `defineAgentTool` shouldn't need it installed). The shape is
179
+ * the wire contract; any structurally-matching object is accepted by
180
+ * `Agent.create({ tools })`.
181
+ *
182
+ * @public
183
+ */
184
+ interface CustomTool {
185
+ name: string;
186
+ description: string;
187
+ inputSchema: Record<string, unknown>;
188
+ handler: (input: Record<string, unknown>) => string | Promise<string>;
189
+ }
190
+ /**
191
+ * Spec accepted by {@link defineAgentTool}. `inputSchema` is a Zod 3 schema
192
+ * rooted in `z.object(...)`. The `handler` argument type is inferred via
193
+ * `z.infer<T>`.
194
+ *
195
+ * @public
196
+ */
197
+ interface DefineAgentToolSpec<T extends z.ZodType> {
198
+ /** Tool name surfaced to the LLM. Must match `^[a-zA-Z][a-zA-Z0-9_-]{0,63}$`. */
199
+ name: string;
200
+ /** Description surfaced to the LLM. Required — drives tool-selection accuracy. */
201
+ description: string;
202
+ /** Zod schema describing the input. Must be `z.object(...)` at the root. */
203
+ inputSchema: T;
204
+ /** Handler invoked with the parsed input. */
205
+ handler: (input: z.infer<T>) => string | Promise<string>;
206
+ }
207
+ /**
208
+ * Build a {@link CustomTool} from a Zod 3 schema + handler.
209
+ *
210
+ * Behavior:
211
+ * - Validates `name` matches the LLM tool-name regex.
212
+ * - Requires `inputSchema` to be a `ZodObject` (Anthropic + SDK contract).
213
+ * - Warns (not throws) if `description` is empty — empty descriptions
214
+ * degrade LLM tool selection.
215
+ * - Converts the Zod schema to JSON Schema 7 inline (no `$ref`s — LLMs handle
216
+ * inline schemas more reliably).
217
+ * - Strips the top-level `$schema` field (Anthropic rejects schemas with
218
+ * `$schema` at root in some provider modes).
219
+ * - Wraps the handler to parse the input via the Zod schema BEFORE invoking
220
+ * the user code — bad LLM-supplied input throws `ZodError`, which the SDK
221
+ * converts to `tool_result(isError)`.
222
+ *
223
+ * @public
224
+ */
225
+ declare function defineAgentTool<T extends z.ZodType>(spec: DefineAgentToolSpec<T>): CustomTool;
226
+
227
+ interface ChannelHandler<TMessage = unknown> {
228
+ onSubscribe?: (ws: WebSocketLike, room: string, req: IncomingMessage) => void;
229
+ onMessage?: (ws: WebSocketLike, room: string, data: TMessage) => void;
230
+ onUnsubscribe?: (ws: WebSocketLike, room: string) => void;
231
+ }
232
+ /**
233
+ * Define a channel handler for WebSocket rooms.
234
+ * Identity function — provides type inference for channel handlers.
235
+ */
236
+ declare function defineChannel<TMessage = unknown>(handler: ChannelHandler<TMessage>): ChannelHandler<TMessage>;
237
+ /**
238
+ * T5a.2 Phase F slice 2/3 — Web-Standards channel handler.
239
+ *
240
+ * Mirror of `ChannelHandler<TMessage>` for the Web `Request` shape.
241
+ * `onSubscribe` receives `request: Request` instead of `req: IncomingMessage`
242
+ * — the rest of the surface (onMessage, onUnsubscribe) is shape-agnostic
243
+ * (WebSocketLike is already Web-standards-compatible per `define-websocket.ts`).
244
+ *
245
+ * Per `docs/plans/t5a2-incoming-message-to-request-shape-refactor-plan.md`
246
+ * v1.0 § Phase F.
247
+ *
248
+ * **Architectural note:** WebSocket upgrade semantics differ across
249
+ * runtimes:
250
+ * - Node: `WebSocketServer.handleUpgrade(req, socket, head, cb)` —
251
+ * hands you `req: IncomingMessage` at the upgrade handshake.
252
+ * - CF Workers: `new WebSocketPair()` + `request.headers` (the upgrade
253
+ * handshake IS a Web Request) — hands you `request: Request`.
254
+ * - Bun: `server.upgrade(request, { data })` — same Web Request shape.
255
+ * - Deno: `Deno.upgradeWebSocket(request)` — same Web Request shape.
256
+ *
257
+ * Channel handlers targeting CF/Bun/Deno use `WebChannelHandler`; legacy
258
+ * Node consumers stay on `ChannelHandler`. Cross-runtime channels ship
259
+ * both shapes.
260
+ */
261
+ interface WebChannelHandler<TMessage = unknown> {
262
+ onSubscribe?: (ws: WebSocketLike, room: string, request: Request) => void;
263
+ onMessage?: (ws: WebSocketLike, room: string, data: TMessage) => void;
264
+ onUnsubscribe?: (ws: WebSocketLike, room: string) => void;
265
+ }
266
+ /**
267
+ * Web-Standards `defineChannel` sibling. Identity function — provides
268
+ * type inference for Web channel handlers.
269
+ */
270
+ declare function defineWebChannel<TMessage = unknown>(handler: WebChannelHandler<TMessage>): WebChannelHandler<TMessage>;
271
+
272
+ /**
273
+ * Identity function for defining a Theo plugin.
274
+ *
275
+ * **Note:** Prefer `definePlugin` (shorter, canonical name per ADR-0008 D6).
276
+ * Both functions are identical — `defineTheoPlugin` is kept as an alias for
277
+ * existing in-tree consumers without forcing a migration sweep.
278
+ */
279
+ declare function defineTheoPlugin(plugin: TheoPlugin): TheoPlugin;
280
+
281
+ export { type ActionAccept, type ActionConfig, type AgentEndpointConfig, type AgentEndpointHandlerArgs, type ChannelHandler, type CustomTool, type DefineAgentToolSpec, type MiddlewareHandler, type RouteConfig, type WebChannelHandler, WebSocketLike, defineAction, defineAgentEndpoint, defineAgentTool, defineChannel, defineMiddleware, defineRoute, defineTheoPlugin, defineWebChannel };
@@ -0,0 +1,26 @@
1
+ import {
2
+ defineAction,
3
+ defineAgentEndpoint,
4
+ defineAgentTool,
5
+ defineChannel,
6
+ defineMiddleware,
7
+ defineRoute,
8
+ defineTheoPlugin,
9
+ defineWebChannel,
10
+ defineWebSocket,
11
+ defineWebSocketWeb
12
+ } from "../../chunk-H4J2LECY.js";
13
+ import "../../chunk-DGUM43GV.js";
14
+ export {
15
+ defineAction,
16
+ defineAgentEndpoint,
17
+ defineAgentTool,
18
+ defineChannel,
19
+ defineMiddleware,
20
+ defineRoute,
21
+ defineTheoPlugin,
22
+ defineWebChannel,
23
+ defineWebSocket,
24
+ defineWebSocketWeb
25
+ };
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,10 @@
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, 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, S as STRIPPED_HEADERS, n as SendErrorInput, o as SendErrorOptions, T as TRACE_HEADER, p as TRACE_PARENT_HEADER, _ as _resetMiddlewareCacheForTests, r as appendCookieToHeaders, s as appendDeleteCookieToHeaders, t as createCorsHandler, u as createCorsWebHandler, v as deleteCookie, w as executeAction, x as executeRoute, y as extractTraceId, z as extractTraceIdFromRequest, A as getCookie, D as getCookieFromRequest, F as handleBatchRequest, I as loadCustomErrorPages, J as matchesOrigin, K as parseCookieHeader, L as parseTraceparent, O as runMiddlewareAndContext, P as sendError, Q as sendJson, R as serializeCookie, U as serveStaticFile, V as setCookie } from '../../index-DWWEdFh5.js';
2
+ import 'node:http';
3
+ import '../../job-backend-CgC8Xf33.js';
4
+ import '../../plugin-runner-BGBkzgi0.js';
5
+ import '../../plugin-types-DNJGxr4Z.js';
6
+ import '../../module-loader-Cfz7dgCP.js';
7
+ import 'vite';
8
+ import '../../csrf-BBrEZSBW.js';
9
+ import '../../audit-log-BQWM5YLG.js';
10
+ import 'zod';
@@ -0,0 +1,74 @@
1
+ import {
2
+ MAX_ERROR_HTML_BYTES,
3
+ loadCustomErrorPages,
4
+ serveStaticFile
5
+ } from "../../chunk-FI7MPTJW.js";
6
+ import {
7
+ BATCH_PATH,
8
+ BatchPathConflictError,
9
+ STRIPPED_HEADERS,
10
+ TRACE_HEADER,
11
+ TRACE_PARENT_HEADER,
12
+ _resetMiddlewareCacheForTests,
13
+ createCorsHandler,
14
+ createCorsWebHandler,
15
+ executeAction,
16
+ executeRoute,
17
+ extractTraceId,
18
+ extractTraceIdFromRequest,
19
+ handleBatchRequest,
20
+ matchesOrigin,
21
+ parseTraceparent,
22
+ runMiddlewareAndContext,
23
+ sendError,
24
+ sendJson
25
+ } from "../../chunk-5Z2727GV.js";
26
+ import "../../chunk-GY5Q27BJ.js";
27
+ import "../../chunk-Z5IGLBWE.js";
28
+ import "../../chunk-ZEGYW52B.js";
29
+ import "../../chunk-TSLSIRBR.js";
30
+ import "../../chunk-UD3LFGDL.js";
31
+ import {
32
+ appendCookieToHeaders,
33
+ appendDeleteCookieToHeaders,
34
+ deleteCookie,
35
+ getCookie,
36
+ getCookieFromRequest,
37
+ parseCookieHeader,
38
+ serializeCookie,
39
+ setCookie
40
+ } from "../../chunk-ZJQ4O76G.js";
41
+ import "../../chunk-4HBI7DHP.js";
42
+ import "../../chunk-DGUM43GV.js";
43
+ export {
44
+ BATCH_PATH,
45
+ BatchPathConflictError,
46
+ MAX_ERROR_HTML_BYTES,
47
+ STRIPPED_HEADERS,
48
+ TRACE_HEADER,
49
+ TRACE_PARENT_HEADER,
50
+ _resetMiddlewareCacheForTests,
51
+ appendCookieToHeaders,
52
+ appendDeleteCookieToHeaders,
53
+ createCorsHandler,
54
+ createCorsWebHandler,
55
+ deleteCookie,
56
+ executeAction,
57
+ executeRoute,
58
+ extractTraceId,
59
+ extractTraceIdFromRequest,
60
+ getCookie,
61
+ getCookieFromRequest,
62
+ handleBatchRequest,
63
+ loadCustomErrorPages,
64
+ matchesOrigin,
65
+ parseCookieHeader,
66
+ parseTraceparent,
67
+ runMiddlewareAndContext,
68
+ sendError,
69
+ sendJson,
70
+ serializeCookie,
71
+ serveStaticFile,
72
+ setCookie
73
+ };
74
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}