theokit 0.48.13 → 0.50.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 (327) hide show
  1. package/README.md +1 -0
  2. package/dist/{actions-virtual-module-YQXRSSMW.js → actions-virtual-module-5WBVSDOM.js} +22 -12
  3. package/dist/actions-virtual-module-5WBVSDOM.js.map +1 -0
  4. package/dist/{actions-virtual-module-LB4NGONI.js → actions-virtual-module-ZYLMNW6K.js} +13 -8
  5. package/dist/{actions-virtual-module-LB4NGONI.js.map → actions-virtual-module-ZYLMNW6K.js.map} +1 -1
  6. package/dist/adapters/agent-mount.d.ts +127 -0
  7. package/dist/adapters/agent-mount.js +24 -0
  8. package/dist/adapters/security-headers.d.ts +132 -0
  9. package/dist/adapters/security-headers.js +64 -0
  10. package/dist/adapters/security-headers.js.map +1 -0
  11. package/dist/adapters/web-shim.d.ts +100 -13
  12. package/dist/adapters/web-shim.js +158 -54
  13. package/dist/adapters/web-shim.js.map +1 -1
  14. package/dist/agent-GKUEL6OH.js +15 -0
  15. package/dist/agent-scan-BZa-pagG.d.ts +16 -0
  16. package/dist/{app-typed-client-GHO3EWZK.js → app-typed-client-4LAIEGFX.js} +23 -13
  17. package/dist/app-typed-client-4LAIEGFX.js.map +1 -0
  18. package/dist/{app-typed-client-G3J5G7E5.js → app-typed-client-DQM3Y6YY.js} +14 -9
  19. package/dist/app-typed-client-DQM3Y6YY.js.map +1 -0
  20. package/dist/aws-lambda-VKMYUMP2.js +261 -0
  21. package/dist/aws-lambda-VKMYUMP2.js.map +1 -0
  22. package/dist/{build-WU6AKKIB.js → build-FLX6VF7Q.js} +71 -26
  23. package/dist/build-FLX6VF7Q.js.map +1 -0
  24. package/dist/{bun-33RD6K7O.js → bun-L7PP6ID5.js} +105 -13
  25. package/dist/bun-L7PP6ID5.js.map +1 -0
  26. package/dist/{check-45NKUVSQ.js → check-GIPZBFTX.js} +2 -2
  27. package/dist/{chunk-KD5G3YXI.js → chunk-2AMLGJJA.js} +35 -9
  28. package/dist/chunk-2AMLGJJA.js.map +1 -0
  29. package/dist/chunk-3PBAN2YE.js +146 -0
  30. package/dist/chunk-3PBAN2YE.js.map +1 -0
  31. package/dist/{chunk-HBU2GIMZ.js → chunk-3QPVEJ7D.js} +15 -9
  32. package/dist/chunk-3QPVEJ7D.js.map +1 -0
  33. package/dist/{chunk-47CINLWF.js → chunk-44J2ANQC.js} +2 -2
  34. package/dist/{chunk-IEES3CHD.js → chunk-47MM2JUK.js} +8 -2
  35. package/dist/chunk-47MM2JUK.js.map +1 -0
  36. package/dist/chunk-4X6H2BXP.js +108 -0
  37. package/dist/chunk-4X6H2BXP.js.map +1 -0
  38. package/dist/{chunk-A7JBF5FO.js → chunk-5K4TDLRG.js} +8 -5
  39. package/dist/chunk-5K4TDLRG.js.map +1 -0
  40. package/dist/chunk-5YPXXSYY.js +181 -0
  41. package/dist/chunk-5YPXXSYY.js.map +1 -0
  42. package/dist/{chunk-YGAXV5HR.js → chunk-6J4JWHDJ.js} +191 -112
  43. package/dist/chunk-6J4JWHDJ.js.map +1 -0
  44. package/dist/chunk-72DMJBXI.js +424 -0
  45. package/dist/chunk-72DMJBXI.js.map +1 -0
  46. package/dist/chunk-7PM6K5EV.js +513 -0
  47. package/dist/chunk-7PM6K5EV.js.map +1 -0
  48. package/dist/{chunk-MTEWLGVY.js → chunk-BPYMC7SU.js} +4 -48
  49. package/dist/chunk-BPYMC7SU.js.map +1 -0
  50. package/dist/chunk-BU6RJPPJ.js +421 -0
  51. package/dist/chunk-BU6RJPPJ.js.map +1 -0
  52. package/dist/{chunk-FB2HBNIC.js → chunk-BX6EUYHU.js} +6 -2
  53. package/dist/chunk-BX6EUYHU.js.map +1 -0
  54. package/dist/{chunk-BIVCP6X5.js → chunk-C62IZEJI.js} +465 -202
  55. package/dist/chunk-C62IZEJI.js.map +1 -0
  56. package/dist/chunk-D4VP2QPR.js +16 -0
  57. package/dist/chunk-D4VP2QPR.js.map +1 -0
  58. package/dist/{chunk-J5MXCGKA.js → chunk-DHAD2O3S.js} +6 -6
  59. package/dist/chunk-DHAD2O3S.js.map +1 -0
  60. package/dist/chunk-E43VJ3E5.js +188 -0
  61. package/dist/chunk-E43VJ3E5.js.map +1 -0
  62. package/dist/chunk-EVZKNA2W.js +110 -0
  63. package/dist/chunk-EVZKNA2W.js.map +1 -0
  64. package/dist/chunk-FD4ZDTQ6.js +181 -0
  65. package/dist/chunk-FD4ZDTQ6.js.map +1 -0
  66. package/dist/chunk-FDOOBTXJ.js +17 -0
  67. package/dist/chunk-FDOOBTXJ.js.map +1 -0
  68. package/dist/chunk-FH3SQR6P.js +275 -0
  69. package/dist/chunk-FH3SQR6P.js.map +1 -0
  70. package/dist/chunk-HJHGTFEJ.js +23 -0
  71. package/dist/chunk-HJHGTFEJ.js.map +1 -0
  72. package/dist/{chunk-LXAESF4Y.js → chunk-HK4AZBKX.js} +7 -4
  73. package/dist/chunk-HK4AZBKX.js.map +1 -0
  74. package/dist/{chunk-T5C46IIU.js → chunk-HWBRS4DZ.js} +28 -269
  75. package/dist/chunk-HWBRS4DZ.js.map +1 -0
  76. package/dist/chunk-IRQGAC4L.js +52 -0
  77. package/dist/chunk-IRQGAC4L.js.map +1 -0
  78. package/dist/{chunk-FNTLKHZ7.js → chunk-JDN5SAAD.js} +7 -4
  79. package/dist/chunk-JDN5SAAD.js.map +1 -0
  80. package/dist/{chunk-GXEX4CBH.js → chunk-JIKNR5LX.js} +673 -484
  81. package/dist/chunk-JIKNR5LX.js.map +1 -0
  82. package/dist/{chunk-GRI4XHBJ.js → chunk-JWRCZIA4.js} +266 -108
  83. package/dist/chunk-JWRCZIA4.js.map +1 -0
  84. package/dist/{chunk-E576KYYT.js → chunk-KI4DOTN4.js} +25 -2
  85. package/dist/chunk-KI4DOTN4.js.map +1 -0
  86. package/dist/{chunk-ZB7D62OA.js → chunk-KUZVRJ7M.js} +3 -3
  87. package/dist/chunk-L4VFNFDL.js +248 -0
  88. package/dist/chunk-L4VFNFDL.js.map +1 -0
  89. package/dist/chunk-M2WC5MF7.js +127 -0
  90. package/dist/chunk-M2WC5MF7.js.map +1 -0
  91. package/dist/{chunk-O3JIAU3V.js → chunk-MCTC6HSE.js} +157 -103
  92. package/dist/chunk-MCTC6HSE.js.map +1 -0
  93. package/dist/{chunk-PXFXSFJL.js → chunk-NZ5JU6D3.js} +9 -9
  94. package/dist/{chunk-YRBR424R.js → chunk-OAUI273L.js} +338 -165
  95. package/dist/chunk-OAUI273L.js.map +1 -0
  96. package/dist/chunk-OGLS76RN.js +43 -0
  97. package/dist/chunk-OGLS76RN.js.map +1 -0
  98. package/dist/{chunk-7LVM22VG.js → chunk-OQCRCXCP.js} +6 -6
  99. package/dist/chunk-OQCRCXCP.js.map +1 -0
  100. package/dist/{chunk-OLGPYOLO.js → chunk-P6OS7652.js} +5 -2
  101. package/dist/chunk-P6OS7652.js.map +1 -0
  102. package/dist/chunk-Q5L5EGWZ.js +26 -0
  103. package/dist/chunk-Q5L5EGWZ.js.map +1 -0
  104. package/dist/{chunk-S433N3CT.js → chunk-QTHVHNJJ.js} +6 -36
  105. package/dist/chunk-QTHVHNJJ.js.map +1 -0
  106. package/dist/chunk-RPET332G.js +84 -0
  107. package/dist/chunk-RPET332G.js.map +1 -0
  108. package/dist/{chunk-646CA6RV.js → chunk-RQW5YMH7.js} +12 -4
  109. package/dist/chunk-RQW5YMH7.js.map +1 -0
  110. package/dist/{chunk-XALU5LCU.js → chunk-RWNYIU6A.js} +550 -146
  111. package/dist/chunk-RWNYIU6A.js.map +1 -0
  112. package/dist/chunk-SL7YUHPV.js +111 -0
  113. package/dist/chunk-SL7YUHPV.js.map +1 -0
  114. package/dist/chunk-U5PWXS3J.js +39 -0
  115. package/dist/chunk-U5PWXS3J.js.map +1 -0
  116. package/dist/chunk-ULDCFL2O.js +273 -0
  117. package/dist/chunk-ULDCFL2O.js.map +1 -0
  118. package/dist/{chunk-RWNSW4FM.js → chunk-UMNXCU3K.js} +12 -6
  119. package/dist/{chunk-RWNSW4FM.js.map → chunk-UMNXCU3K.js.map} +1 -1
  120. package/dist/chunk-VI7ZANB3.js +193 -0
  121. package/dist/chunk-VI7ZANB3.js.map +1 -0
  122. package/dist/chunk-VQPHPQ5L.js +14 -0
  123. package/dist/chunk-VQPHPQ5L.js.map +1 -0
  124. package/dist/chunk-WNJTJRM6.js +147 -0
  125. package/dist/chunk-WNJTJRM6.js.map +1 -0
  126. package/dist/chunk-WOBSEO75.js +790 -0
  127. package/dist/chunk-WOBSEO75.js.map +1 -0
  128. package/dist/{chunk-BMHS4WAN.js → chunk-XS7EX55U.js} +156 -42
  129. package/dist/chunk-XS7EX55U.js.map +1 -0
  130. package/dist/chunk-YN4W7LCX.js +31 -0
  131. package/dist/chunk-YN4W7LCX.js.map +1 -0
  132. package/dist/chunk-YSJOZEI6.js +1 -0
  133. package/dist/{chunk-JA2ZAT5Q.js → chunk-Z4PJMZLM.js} +2 -2
  134. package/dist/chunk-Z4PJMZLM.js.map +1 -0
  135. package/dist/{chunk-7VPQHEAJ.js → chunk-ZNZISJDZ.js} +6 -2
  136. package/dist/chunk-ZNZISJDZ.js.map +1 -0
  137. package/dist/chunk-ZWN3AODA.js +11 -0
  138. package/dist/chunk-ZWN3AODA.js.map +1 -0
  139. package/dist/cli/index.js +25 -10
  140. package/dist/cli/index.js.map +1 -1
  141. package/dist/client/core.d.ts +1 -1
  142. package/dist/client/core.js +2 -0
  143. package/dist/client/core.js.map +1 -1
  144. package/dist/client/index.d.ts +44 -10
  145. package/dist/client/index.js +35 -0
  146. package/dist/client/index.js.map +1 -1
  147. package/dist/cloudflare-SIG42OIW.js +335 -0
  148. package/dist/cloudflare-SIG42OIW.js.map +1 -0
  149. package/dist/config-support-WQHQIJTA.js +104 -0
  150. package/dist/config-support-WQHQIJTA.js.map +1 -0
  151. package/dist/{csrf-BBrEZSBW.d.ts → csrf-Dgot9qSM.d.ts} +1 -1
  152. package/dist/deno-deploy-LQAYOOPW.js +196 -0
  153. package/dist/deno-deploy-LQAYOOPW.js.map +1 -0
  154. package/dist/{dev-MUWJAZRD.js → dev-ANDSEVLB.js} +28 -18
  155. package/dist/dev-ANDSEVLB.js.map +1 -0
  156. package/dist/{dev-emit-GWD6IXV7.js → dev-emit-BFNMDCPB.js} +5 -5
  157. package/dist/{dev-emit-NBT6JD7R.js → dev-emit-MVAJAFGX.js} +5 -3
  158. package/dist/dev-emit-MVAJAFGX.js.map +1 -0
  159. package/dist/engine-singleton-X4R7AZBJ.js +315 -0
  160. package/dist/engine-singleton-X4R7AZBJ.js.map +1 -0
  161. package/dist/{generate-Y3GWM57K.js → generate-EN6EDITF.js} +43 -4
  162. package/dist/generate-EN6EDITF.js.map +1 -0
  163. package/dist/index-CzxtQcnp.d.ts +1058 -0
  164. package/dist/index.d.ts +4 -0
  165. package/dist/index.js +24 -13
  166. package/dist/index.js.map +1 -1
  167. package/dist/{info-XW7HGUPH.js → info-Y55RWS42.js} +8 -6
  168. package/dist/{info-XW7HGUPH.js.map → info-Y55RWS42.js.map} +1 -1
  169. package/dist/{internal-api-V5L65YSJ.js → internal-api-IP35YU3G.js} +22 -12
  170. package/dist/{internal-api-WEOSTMSN.js → internal-api-OPU456AT.js} +30 -16
  171. package/dist/internal-api-OPU456AT.js.map +1 -0
  172. package/dist/load-config-4ATXQUN3.js +16 -0
  173. package/dist/match-DmGgxjIU.d.ts +44 -0
  174. package/dist/{mcp-ULUFJNSZ.js → mcp-5LLNAGKA.js} +7 -7
  175. package/dist/netlify-C2IRCZKI.js +245 -0
  176. package/dist/netlify-C2IRCZKI.js.map +1 -0
  177. package/dist/node-OSVPYQ3D.js +10 -0
  178. package/dist/nonce-BXt7Qu_C.d.ts +31 -0
  179. package/dist/observability-bootstrap-MZMSOE66.js +15 -0
  180. package/dist/{openapi-HZXR335W.js → openapi-VFPEZSRI.js} +13 -11
  181. package/dist/{openapi-HZXR335W.js.map → openapi-VFPEZSRI.js.map} +1 -1
  182. package/dist/{plugin-runner-BFEcgtmJ.d.ts → plugin-runner-BVMOSxvb.d.ts} +1 -1
  183. package/dist/{plugin-types-D69-lJZ9.d.ts → plugin-types-BUVfUQ0V.d.ts} +13 -1
  184. package/dist/preview-GHPT2EQ5.js +23 -0
  185. package/dist/preview-GHPT2EQ5.js.map +1 -0
  186. package/dist/provider-resolver-Dx6QuWrw.d.ts +128 -0
  187. package/dist/registry-KBZDCFVQ.js +23 -0
  188. package/dist/route-config-Cm_ZMA1C.d.ts +72 -0
  189. package/dist/route-policy-BxOycCDq.d.ts +65 -0
  190. package/dist/router/element-scroll-restoration.d.ts +28 -0
  191. package/dist/router/element-scroll-restoration.js +96 -0
  192. package/dist/router/element-scroll-restoration.js.map +1 -0
  193. package/dist/{routes-OLNQX7CT.js → routes-BPLU3ISV.js} +11 -9
  194. package/dist/{routes-OLNQX7CT.js.map → routes-BPLU3ISV.js.map} +1 -1
  195. package/dist/{scan-7MJC6PYU.js → scan-YJEE4KQK.js} +2 -2
  196. package/dist/{schema-ZO3OSWVG.js → schema-SOAD43RQ.js} +7 -5
  197. package/dist/schemas-4AXHQMV3.js +25 -0
  198. package/dist/schemas-4AXHQMV3.js.map +1 -0
  199. package/dist/security-headers-Ccj7ncNx.d.ts +129 -0
  200. package/dist/server/agent/index.d.ts +2 -90
  201. package/dist/server/agent/index.js +1 -1
  202. package/dist/server/auth/index.d.ts +2 -21
  203. package/dist/server/auth/index.js +3 -2
  204. package/dist/server/cron/index.js +4 -3
  205. package/dist/server/define/index.d.ts +51 -57
  206. package/dist/server/define/index.js +10 -1
  207. package/dist/server/http/index.d.ts +7 -5
  208. package/dist/server/http/index.js +56 -12
  209. package/dist/server/index.d.ts +47 -439
  210. package/dist/server/index.js +119 -201
  211. package/dist/server/index.js.map +1 -1
  212. package/dist/server/jobs/index.js +4 -3
  213. package/dist/server/observability/index.d.ts +109 -35
  214. package/dist/server/observability/index.js +10 -7
  215. package/dist/server/plugins/index.d.ts +3 -3
  216. package/dist/server/scan/index.d.ts +47 -12
  217. package/dist/server/scan/index.js +13 -4
  218. package/dist/server/security/index.d.ts +61 -103
  219. package/dist/server/security/index.js +15 -6
  220. package/dist/server/webhook/index.d.ts +90 -3
  221. package/dist/server/webhook/index.js +12 -2
  222. package/dist/server-boundary-6B4ZQUY7.js +148 -0
  223. package/dist/server-boundary-6B4ZQUY7.js.map +1 -0
  224. package/dist/server-boundary-7VZQRPPX.js +133 -0
  225. package/dist/server-boundary-7VZQRPPX.js.map +1 -0
  226. package/dist/{services-typed-client-PSAGRPFF.js → services-typed-client-XGT5SUUN.js} +2 -2
  227. package/dist/{start-KR2JJR7K.js → start-UZDMOT7I.js} +342 -111
  228. package/dist/start-UZDMOT7I.js.map +1 -0
  229. package/dist/{static-M2W4HUWS.js → static-SVDWIOXJ.js} +24 -13
  230. package/dist/static-SVDWIOXJ.js.map +1 -0
  231. package/dist/{theo-cloud-XAHWOUFK.js → theo-cloud-3ET4G5T6.js} +9 -2
  232. package/dist/theo-cloud-3ET4G5T6.js.map +1 -0
  233. package/dist/vercel-BMCQKCWE.js +277 -0
  234. package/dist/vercel-BMCQKCWE.js.map +1 -0
  235. package/dist/vite-plugin/index.js +24 -13
  236. package/dist/vite-plugin-VKCT2LF2.js +42 -0
  237. package/dist/vite-plugin-VKCT2LF2.js.map +1 -0
  238. package/package.json +19 -6
  239. package/dist/actions-virtual-module-YQXRSSMW.js.map +0 -1
  240. package/dist/agent-7JJW3TPB.js +0 -15
  241. package/dist/app-typed-client-G3J5G7E5.js.map +0 -1
  242. package/dist/app-typed-client-GHO3EWZK.js.map +0 -1
  243. package/dist/aws-lambda-CYNDGU5O.js +0 -172
  244. package/dist/aws-lambda-CYNDGU5O.js.map +0 -1
  245. package/dist/build-WU6AKKIB.js.map +0 -1
  246. package/dist/bun-33RD6K7O.js.map +0 -1
  247. package/dist/chunk-646CA6RV.js.map +0 -1
  248. package/dist/chunk-6E5WKMDS.js +0 -67
  249. package/dist/chunk-6E5WKMDS.js.map +0 -1
  250. package/dist/chunk-6GGWS7J3.js +0 -91
  251. package/dist/chunk-6GGWS7J3.js.map +0 -1
  252. package/dist/chunk-7LVM22VG.js.map +0 -1
  253. package/dist/chunk-7VPQHEAJ.js.map +0 -1
  254. package/dist/chunk-A7JBF5FO.js.map +0 -1
  255. package/dist/chunk-AM3QABW5.js +0 -161
  256. package/dist/chunk-AM3QABW5.js.map +0 -1
  257. package/dist/chunk-BIVCP6X5.js.map +0 -1
  258. package/dist/chunk-BMHS4WAN.js.map +0 -1
  259. package/dist/chunk-E576KYYT.js.map +0 -1
  260. package/dist/chunk-FB2HBNIC.js.map +0 -1
  261. package/dist/chunk-FNTLKHZ7.js.map +0 -1
  262. package/dist/chunk-GRI4XHBJ.js.map +0 -1
  263. package/dist/chunk-GVW5EKEU.js +0 -422
  264. package/dist/chunk-GVW5EKEU.js.map +0 -1
  265. package/dist/chunk-GXEX4CBH.js.map +0 -1
  266. package/dist/chunk-HBU2GIMZ.js.map +0 -1
  267. package/dist/chunk-IEES3CHD.js.map +0 -1
  268. package/dist/chunk-J5MXCGKA.js.map +0 -1
  269. package/dist/chunk-JA2ZAT5Q.js.map +0 -1
  270. package/dist/chunk-KD5G3YXI.js.map +0 -1
  271. package/dist/chunk-LNVMHQ2Z.js +0 -54
  272. package/dist/chunk-LNVMHQ2Z.js.map +0 -1
  273. package/dist/chunk-LXAESF4Y.js.map +0 -1
  274. package/dist/chunk-MTEWLGVY.js.map +0 -1
  275. package/dist/chunk-O3JIAU3V.js.map +0 -1
  276. package/dist/chunk-OJLL4YD6.js +0 -403
  277. package/dist/chunk-OJLL4YD6.js.map +0 -1
  278. package/dist/chunk-OLGPYOLO.js.map +0 -1
  279. package/dist/chunk-S433N3CT.js.map +0 -1
  280. package/dist/chunk-T5C46IIU.js.map +0 -1
  281. package/dist/chunk-U267AOWS.js +0 -28
  282. package/dist/chunk-U267AOWS.js.map +0 -1
  283. package/dist/chunk-UW2TEAGR.js +0 -77
  284. package/dist/chunk-UW2TEAGR.js.map +0 -1
  285. package/dist/chunk-WPJOTQA5.js +0 -1
  286. package/dist/chunk-XALU5LCU.js.map +0 -1
  287. package/dist/chunk-XR74JD4M.js +0 -457
  288. package/dist/chunk-XR74JD4M.js.map +0 -1
  289. package/dist/chunk-YGAXV5HR.js.map +0 -1
  290. package/dist/chunk-YRBR424R.js.map +0 -1
  291. package/dist/cloudflare-KYUWCEPL.js +0 -122
  292. package/dist/cloudflare-KYUWCEPL.js.map +0 -1
  293. package/dist/deno-deploy-CCTB7HGS.js +0 -107
  294. package/dist/deno-deploy-CCTB7HGS.js.map +0 -1
  295. package/dist/dev-MUWJAZRD.js.map +0 -1
  296. package/dist/dev-emit-NBT6JD7R.js.map +0 -1
  297. package/dist/generate-Y3GWM57K.js.map +0 -1
  298. package/dist/index-BEtEv6ZH.d.ts +0 -575
  299. package/dist/load-config-VKD6LKWU.js +0 -14
  300. package/dist/match-CfbEFRG4.d.ts +0 -26
  301. package/dist/netlify-AFMDNKT4.js +0 -150
  302. package/dist/netlify-AFMDNKT4.js.map +0 -1
  303. package/dist/node-ZJQEJSP3.js +0 -10
  304. package/dist/registry-GKR3EWRW.js +0 -23
  305. package/dist/start-KR2JJR7K.js.map +0 -1
  306. package/dist/static-M2W4HUWS.js.map +0 -1
  307. package/dist/theo-cloud-XAHWOUFK.js.map +0 -1
  308. package/dist/vercel-SRS2DH6O.js +0 -133
  309. package/dist/vercel-SRS2DH6O.js.map +0 -1
  310. package/dist/vite-plugin-VPJFD4HK.js +0 -36
  311. /package/dist/{chunk-WPJOTQA5.js.map → adapters/agent-mount.js.map} +0 -0
  312. /package/dist/{agent-7JJW3TPB.js.map → agent-GKUEL6OH.js.map} +0 -0
  313. /package/dist/{check-45NKUVSQ.js.map → check-GIPZBFTX.js.map} +0 -0
  314. /package/dist/{chunk-47CINLWF.js.map → chunk-44J2ANQC.js.map} +0 -0
  315. /package/dist/{chunk-ZB7D62OA.js.map → chunk-KUZVRJ7M.js.map} +0 -0
  316. /package/dist/{chunk-PXFXSFJL.js.map → chunk-NZ5JU6D3.js.map} +0 -0
  317. /package/dist/{internal-api-WEOSTMSN.js.map → chunk-YSJOZEI6.js.map} +0 -0
  318. /package/dist/{dev-emit-GWD6IXV7.js.map → dev-emit-BFNMDCPB.js.map} +0 -0
  319. /package/dist/{internal-api-V5L65YSJ.js.map → internal-api-IP35YU3G.js.map} +0 -0
  320. /package/dist/{load-config-VKD6LKWU.js.map → load-config-4ATXQUN3.js.map} +0 -0
  321. /package/dist/{mcp-ULUFJNSZ.js.map → mcp-5LLNAGKA.js.map} +0 -0
  322. /package/dist/{node-ZJQEJSP3.js.map → node-OSVPYQ3D.js.map} +0 -0
  323. /package/dist/{scan-7MJC6PYU.js.map → observability-bootstrap-MZMSOE66.js.map} +0 -0
  324. /package/dist/{registry-GKR3EWRW.js.map → registry-KBZDCFVQ.js.map} +0 -0
  325. /package/dist/{schema-ZO3OSWVG.js.map → scan-YJEE4KQK.js.map} +0 -0
  326. /package/dist/{vite-plugin-VPJFD4HK.js.map → schema-SOAD43RQ.js.map} +0 -0
  327. /package/dist/{services-typed-client-PSAGRPFF.js.map → services-typed-client-XGT5SUUN.js.map} +0 -0
@@ -12,21 +12,70 @@ import {
12
12
  RUN_ID_HEADER,
13
13
  SSE_BASE_HEADERS,
14
14
  SSE_DONE_FRAME,
15
+ admitAgentRequest,
16
+ agentAccessDenied,
15
17
  applySecurityHeaders,
18
+ closePauseSpan,
19
+ createServerContext,
16
20
  encodeSse,
17
21
  formatSseFrame,
18
- generateNonce,
19
22
  getRunEventCache,
20
23
  makeThreadStartRun,
21
24
  mintRunId,
22
- parseAgentRequestBody
23
- } from "./chunk-BIVCP6X5.js";
25
+ parseAgentRequestBody,
26
+ readAgentPolicy,
27
+ subjectFromContext
28
+ } from "./chunk-C62IZEJI.js";
24
29
  import {
25
30
  getApprovalRegistry
26
- } from "./chunk-6GGWS7J3.js";
31
+ } from "./chunk-5YPXXSYY.js";
27
32
  import {
33
+ sendError,
28
34
  validateCsrfRequest
29
- } from "./chunk-T5C46IIU.js";
35
+ } from "./chunk-HWBRS4DZ.js";
36
+ import {
37
+ generateNonce
38
+ } from "./chunk-RPET332G.js";
39
+
40
+ // src/config/resolve-plugin-specifiers.ts
41
+ import { isAbsolute, resolve } from "path";
42
+ import { pathToFileURL } from "url";
43
+ var UnresolvablePluginSpecifierError = class extends Error {
44
+ constructor(index, specifier, reason) {
45
+ super(`plugins[${index}] (${specifier}) could not be loaded: ${reason}`);
46
+ this.name = "UnresolvablePluginSpecifierError";
47
+ }
48
+ };
49
+ async function resolvePluginSpecifiers(plugins, cwd) {
50
+ const resolved = [];
51
+ for (const [index, entry] of plugins.entries()) {
52
+ resolved.push(typeof entry === "string" ? await importPlugin(entry, index, cwd) : entry);
53
+ }
54
+ return resolved;
55
+ }
56
+ async function importPlugin(specifier, index, cwd) {
57
+ const target = isAbsolute(specifier) ? specifier : resolve(cwd, specifier);
58
+ let mod;
59
+ try {
60
+ mod = await import(
61
+ /* @vite-ignore */
62
+ pathToFileURL(target).href
63
+ );
64
+ } catch (err) {
65
+ throw new UnresolvablePluginSpecifierError(index, specifier, messageOf(err));
66
+ }
67
+ if (mod.default === void 0) {
68
+ throw new UnresolvablePluginSpecifierError(
69
+ index,
70
+ specifier,
71
+ "the module has no default export; a plugin module must `export default` its plugin"
72
+ );
73
+ }
74
+ return mod.default;
75
+ }
76
+ function messageOf(err) {
77
+ return err instanceof Error ? err.message : String(err);
78
+ }
30
79
 
31
80
  // src/server/transformer.ts
32
81
  import superjson from "superjson";
@@ -121,7 +170,7 @@ function hoistHeadTags(template, ssrHtml) {
121
170
 
122
171
  // src/vite-plugin/ssr-dev-middleware.ts
123
172
  import { readFileSync } from "fs";
124
- import { resolve } from "path";
173
+ import { resolve as resolve2 } from "path";
125
174
  function applyNonceToInlineScripts(html, nonce) {
126
175
  return html.replace(
127
176
  /<script(?![^>]*\ssrc=)(?![^>]*\snonce=)([^>]*)>/gi,
@@ -142,7 +191,7 @@ function setupSsrDevMiddleware(server, opts) {
142
191
  return;
143
192
  }
144
193
  try {
145
- const indexPath = resolve(opts.projectRoot, "index.html");
194
+ const indexPath = resolve2(opts.projectRoot, "index.html");
146
195
  let template = readFileSync(indexPath, "utf-8");
147
196
  const nonce = generateNonce();
148
197
  template = await server.transformIndexHtml(url, template);
@@ -244,6 +293,11 @@ function handleAgentCard(mod, name, route, baseUrl) {
244
293
 
245
294
  // src/server/agent/approve-agent.ts
246
295
  var APPROVE_SEGMENT = "/approve/";
296
+ var APPROVE_PATH = /^\/api\/agents\/([^/]+)\/approve\/([^/]+)$/;
297
+ function parseApprovalAgentName(urlPath) {
298
+ const match = APPROVE_PATH.exec(urlPath);
299
+ return match ? decodeURIComponent(match[1]) : null;
300
+ }
247
301
  function parseApprovalId(urlPath) {
248
302
  const at = urlPath.indexOf(APPROVE_SEGMENT);
249
303
  if (at === -1) return null;
@@ -276,7 +330,17 @@ function parseApprovalBody(body) {
276
330
  }
277
331
  return decision;
278
332
  }
279
- async function handleAgentApproval(request, urlPath, registry, csrfMode = "strict") {
333
+ async function refuseIfNotOwner(registry, approvalId, resolveSubject, params) {
334
+ const owner = registry.ownerOf(approvalId);
335
+ if (owner === void 0) return void 0;
336
+ const subject = resolveSubject === void 0 ? null : await resolveSubject();
337
+ if (subject?.id === owner) return void 0;
338
+ return agentAccessDenied(
339
+ { allowed: false, reason: "the approval belongs to another subject" },
340
+ params
341
+ );
342
+ }
343
+ async function handleAgentApproval(request, urlPath, registry, csrfMode = "strict", access = {}) {
280
344
  if (csrfMode !== "off") {
281
345
  const csrf = validateCsrfRequest(request);
282
346
  if (!csrf.valid && csrfMode === "strict") {
@@ -287,6 +351,15 @@ async function handleAgentApproval(request, urlPath, registry, csrfMode = "stric
287
351
  if (approvalId === null) {
288
352
  return jsonError(400, "BAD_REQUEST", "Approval path must be /api/agents/<name>/approve/<id>.");
289
353
  }
354
+ const params = {
355
+ agent: parseApprovalAgentName(urlPath) ?? "unknown",
356
+ endpoint: "approve",
357
+ approvalId
358
+ };
359
+ const decision = await admitAgentRequest(access.policy, access.resolveSubject, params);
360
+ if (!decision.allowed) return agentAccessDenied(decision, params);
361
+ const notOwner = await refuseIfNotOwner(registry, approvalId, access.resolveSubject, params);
362
+ if (notOwner !== void 0) return notOwner;
290
363
  let body = null;
291
364
  try {
292
365
  body = await request.json();
@@ -300,25 +373,13 @@ async function handleAgentApproval(request, urlPath, registry, csrfMode = "stric
300
373
  if (!resolved) {
301
374
  return jsonError(404, "NOT_PENDING", `No pending approval for id '${approvalId}'.`);
302
375
  }
376
+ closePauseSpan(approvalId, { resumeObserved: true });
303
377
  return new Response(JSON.stringify({ resolved: true }), {
304
378
  status: 200,
305
379
  headers: { "content-type": "application/json" }
306
380
  });
307
381
  }
308
382
 
309
- // src/server/agent/list-approvals-handler.ts
310
- var LIST_PATH = /^\/api\/agents\/([^/]+)\/approvals$/;
311
- function isListApprovalsPath(urlPath) {
312
- const match = LIST_PATH.exec(urlPath);
313
- return match ? decodeURIComponent(match[1]) : null;
314
- }
315
- function handleListApprovals(registry) {
316
- return new Response(JSON.stringify({ approvals: registry.list() }), {
317
- status: 200,
318
- headers: { "content-type": "application/json; charset=utf-8" }
319
- });
320
- }
321
-
322
383
  // src/server/agent/handle-agent-run-reconnect.ts
323
384
  var RUN_STREAM_PATH = /^\/api\/agents\/([^/]+)\/runs\/([^/]+)\/stream$/;
324
385
  function isAgentRunStreamPath(urlPath) {
@@ -483,7 +544,7 @@ function jsonError2(status, code, message) {
483
544
  });
484
545
  }
485
546
  async function handleThreadMessage(args) {
486
- const { mod, apiKey, sessionId, request, source, csrfMode = "strict" } = args;
547
+ const { mod, apiKey, sessionId, request, source, agentName, csrfMode = "strict" } = args;
487
548
  if (csrfMode === "strict") {
488
549
  const csrf = validateCsrfRequest(request);
489
550
  if (!csrf.valid) return jsonError2(403, "CSRF_FAILED", `CSRF check failed: ${csrf.reason}`);
@@ -501,7 +562,9 @@ async function handleThreadMessage(args) {
501
562
  {
502
563
  registry: getThreadRunRegistry(),
503
564
  cache: getRunEventCache(),
504
- startRun: makeThreadStartRun(mod, apiKey, source)
565
+ // usetheokit/theokit#381 — the request goes with it, so the run's spans join the trace of
566
+ // the caller that queued it instead of opening one of their own.
567
+ startRun: makeThreadStartRun(mod, apiKey, source, agentName, request)
505
568
  },
506
569
  sessionId,
507
570
  input.message
@@ -579,6 +642,19 @@ function waitThenAttachStream(sessionId, request, registry, cache, idleWaitMs) {
579
642
  return new Response(stream, { headers: { ...SSE_BASE_HEADERS } });
580
643
  }
581
644
 
645
+ // src/server/agent/list-approvals-handler.ts
646
+ var LIST_PATH = /^\/api\/agents\/([^/]+)\/approvals$/;
647
+ function isListApprovalsPath(urlPath) {
648
+ const match = LIST_PATH.exec(urlPath);
649
+ return match ? decodeURIComponent(match[1]) : null;
650
+ }
651
+ function handleListApprovals(registry) {
652
+ return new Response(JSON.stringify({ approvals: registry.list() }), {
653
+ status: 200,
654
+ headers: { "content-type": "application/json; charset=utf-8" }
655
+ });
656
+ }
657
+
582
658
  // src/server/agent/serve-aux-routes.ts
583
659
  function jsonError3(status, code, message) {
584
660
  return new Response(JSON.stringify({ error: { code, message } }), {
@@ -586,71 +662,135 @@ function jsonError3(status, code, message) {
586
662
  headers: { "content-type": "application/json; charset=utf-8" }
587
663
  });
588
664
  }
589
- async function serveAgentAuxRoute(request, urlPath, deps) {
590
- const method = request.method.toUpperCase();
591
- const cardName = isAgentCardPath(urlPath);
592
- if (cardName !== null) {
593
- if (method !== "GET") return null;
594
- const agent = deps.agents.find((a) => a.name === cardName);
595
- if (!agent) return null;
596
- const mod = await deps.loadModule(agent.filePath);
597
- return handleAgentCard(mod, agent.name, agent.agentPath, deps.baseUrl);
598
- }
599
- if (isListApprovalsPath(urlPath)) {
600
- if (method !== "GET") return null;
601
- return handleListApprovals(getApprovalRegistry());
602
- }
603
- const runStream = isAgentRunStreamPath(urlPath);
604
- if (runStream !== null) {
605
- if (method !== "GET") return null;
606
- if (!deps.agents.some((a) => a.name === runStream.name)) return null;
607
- return handleAgentRunReconnect(runStream.runId, request, getRunEventCache());
608
- }
609
- const threadResponse = await serveThreadRoute(request, method, urlPath, deps);
610
- if (threadResponse !== null) return threadResponse;
611
- const mcpName = isMcpPath(urlPath);
612
- if (mcpName !== null) {
613
- return serveMcpRoute(request, method, mcpName, deps);
614
- }
615
- return null;
616
- }
617
- async function serveThreadRoute(request, method, urlPath, deps) {
618
- const stream = isThreadStreamPath(urlPath);
619
- if (stream !== null) {
620
- if (method !== "GET") return null;
621
- if (!deps.agents.some((a) => a.name === stream.name)) return null;
622
- return handleThreadStream(stream.sessionId, request);
665
+ function routeFor(deps, name, build) {
666
+ if (name === null) return null;
667
+ const agent = deps.agents.find((a) => a.name === name);
668
+ return agent === void 0 ? null : build(agent);
669
+ }
670
+ function matchGetAuxRoute(verb, urlPath, deps) {
671
+ if (verb !== "GET") return null;
672
+ const card = routeFor(
673
+ deps,
674
+ isAgentCardPath(urlPath),
675
+ (agent) => ({ kind: "card", agent })
676
+ );
677
+ if (card !== null) return card;
678
+ const approvals = routeFor(
679
+ deps,
680
+ isListApprovalsPath(urlPath),
681
+ (agent) => ({ kind: "approvals", agent })
682
+ );
683
+ if (approvals !== null) return approvals;
684
+ const run = isAgentRunStreamPath(urlPath);
685
+ if (run !== null) {
686
+ return routeFor(
687
+ deps,
688
+ run.name,
689
+ (agent) => ({ kind: "run-stream", agent, runId: run.runId })
690
+ );
623
691
  }
692
+ const stream = isThreadStreamPath(urlPath);
693
+ if (stream === null) return null;
694
+ return routeFor(
695
+ deps,
696
+ stream.name,
697
+ (agent) => ({ kind: "thread-stream", agent, sessionId: stream.sessionId })
698
+ );
699
+ }
700
+ async function matchPostAuxRoute(verb, urlPath, deps) {
701
+ if (verb !== "POST") return null;
624
702
  const msg = isThreadMessagePath(urlPath);
625
703
  if (msg !== null) {
626
- if (method !== "POST") return null;
627
- const agent = deps.agents.find((a) => a.name === msg.name);
628
- if (!agent) return null;
629
- if (deps.resolveApiKey === void 0) {
630
- return jsonError3(
631
- 501,
632
- "NOT_CONFIGURED",
633
- "Thread follow-up requires a provider API key (resolveApiKey was not provided to serveAgentAuxRoute)."
634
- );
635
- }
636
- const mod = await deps.loadModule(agent.filePath);
637
- return handleThreadMessage({
638
- mod,
639
- apiKey: deps.resolveApiKey(),
640
- sessionId: msg.sessionId,
641
- request,
642
- source: `agent "${msg.name}"`,
643
- csrfMode: deps.csrfMode ?? "strict"
704
+ return routeFor(
705
+ deps,
706
+ msg.name,
707
+ (agent2) => ({ kind: "thread-message", agent: agent2, sessionId: msg.sessionId })
708
+ );
709
+ }
710
+ const agent = routeFor(deps, isMcpPath(urlPath), (found) => found);
711
+ if (agent === null) return null;
712
+ const mod = await deps.loadModule(agent.filePath);
713
+ return isMcpExposed(mod) ? { kind: "mcp", agent, mod } : null;
714
+ }
715
+ async function matchAgentAuxRoute(method, urlPath, deps) {
716
+ const verb = method.toUpperCase();
717
+ return matchGetAuxRoute(verb, urlPath, deps) ?? await matchPostAuxRoute(verb, urlPath, deps);
718
+ }
719
+ async function admitAux(deps, agent, params, body) {
720
+ const mod = await deps.loadModule(agent.filePath);
721
+ const decision = await admitAgentRequest(
722
+ readAgentPolicy(mod, agent.filePath),
723
+ deps.resolveSubject,
724
+ params,
725
+ body
726
+ );
727
+ return decision.allowed ? null : agentAccessDenied(decision, params);
728
+ }
729
+ async function serveMatchedAuxRoute(route, request, deps) {
730
+ if (route.kind === "card") {
731
+ const mod = await deps.loadModule(route.agent.filePath);
732
+ return handleAgentCard(mod, route.agent.name, route.agent.agentPath, deps.baseUrl);
733
+ }
734
+ if (route.kind === "approvals") {
735
+ const refusal = await admitAux(deps, route.agent, {
736
+ agent: route.agent.name,
737
+ endpoint: "approvals"
644
738
  });
739
+ return refusal ?? handleListApprovals(getApprovalRegistry());
645
740
  }
646
- return null;
741
+ if (route.kind === "run-stream") {
742
+ return handleAgentRunReconnect(route.runId, request, getRunEventCache());
743
+ }
744
+ if (route.kind === "mcp") return serveMcpRoute(route, request, deps);
745
+ return serveThreadRoute(route, request, deps);
647
746
  }
648
- async function serveMcpRoute(request, method, mcpName, deps) {
649
- if (method !== "POST") return null;
650
- const agent = deps.agents.find((a) => a.name === mcpName);
651
- if (!agent) return null;
747
+ async function serveThreadRoute(route, request, deps) {
748
+ const { agent, sessionId } = route;
749
+ if (route.kind === "thread-stream") {
750
+ const refusal2 = await admitAux(deps, agent, {
751
+ agent: agent.name,
752
+ endpoint: "thread-stream",
753
+ sessionId
754
+ });
755
+ return refusal2 ?? handleThreadStream(sessionId, request);
756
+ }
757
+ const refusal = await admitAux(deps, agent, {
758
+ agent: agent.name,
759
+ endpoint: "thread-message",
760
+ sessionId
761
+ });
762
+ if (refusal !== null) return refusal;
763
+ if (deps.resolveApiKey === void 0) {
764
+ return jsonError3(
765
+ 501,
766
+ "NOT_CONFIGURED",
767
+ "Thread follow-up requires a provider API key (resolveApiKey was not provided to serveMatchedAuxRoute)."
768
+ );
769
+ }
652
770
  const mod = await deps.loadModule(agent.filePath);
653
- if (!isMcpExposed(mod)) return null;
771
+ return handleThreadMessage({
772
+ mod,
773
+ // Passed unresolved: `makeThreadStartRun` calls it once the module is compiled and the
774
+ // model is known (theokit#328).
775
+ apiKey: deps.resolveApiKey,
776
+ sessionId,
777
+ request,
778
+ source: `agent "${agent.name}"`,
779
+ // usetheokit/theokit#406 — the label above reads well in an `AgentDefinitionError` and is not
780
+ // a name; the spans get the name, so the same agent is one series whichever route started it.
781
+ agentName: agent.name,
782
+ csrfMode: deps.csrfMode ?? "strict"
783
+ });
784
+ }
785
+ async function serveMcpRoute(route, request, deps) {
786
+ const { agent, mod } = route;
787
+ const mcpParams = { agent: agent.name, endpoint: "mcp" };
788
+ const mcpDecision = await admitAgentRequest(
789
+ readAgentPolicy(mod, agent.filePath),
790
+ deps.resolveSubject,
791
+ mcpParams
792
+ );
793
+ if (!mcpDecision.allowed) return agentAccessDenied(mcpDecision, mcpParams);
654
794
  const csrfMode = deps.csrfMode ?? "strict";
655
795
  if (csrfMode === "strict") {
656
796
  const csrf = validateCsrfRequest(request);
@@ -667,46 +807,64 @@ function isMcpExposed(mod) {
667
807
  return mod?.mcp === true;
668
808
  }
669
809
 
670
- // src/server/http/node-web-adapter.ts
671
- async function writeWebResponseToServerResponse(response, res) {
672
- const setCookies = response.headers.getSetCookie();
673
- if (setCookies.length > 0) {
674
- res.setHeader("Set-Cookie", setCookies);
675
- }
676
- const otherHeaders = {};
677
- for (const [key, value] of response.headers.entries()) {
678
- if (key.toLowerCase() === "set-cookie") continue;
679
- otherHeaders[key] = value;
680
- }
681
- res.writeHead(response.status, response.statusText, otherHeaders);
682
- if (response.body === null) {
683
- res.end();
810
+ // src/server/http/plugin-lifecycle.ts
811
+ function messageOf2(err, fallback) {
812
+ return err instanceof Error ? err.message : fallback;
813
+ }
814
+ async function serveThroughPluginLifecycle(target, serve) {
815
+ const { res, requestId, pluginRunner, failureMessage } = target;
816
+ let request;
817
+ try {
818
+ request = target.source.toRequest();
819
+ } catch (err) {
820
+ sendError(res, "INTERNAL", messageOf2(err, failureMessage), 500, void 0, requestId);
684
821
  return;
685
822
  }
686
- const reader = response.body.getReader();
823
+ const pluginCtx = { request, response: res, ctx: {}, requestId };
824
+ if (pluginRunner) {
825
+ pluginRunner.applyDecorations(pluginCtx.ctx);
826
+ const onRequest = await pluginRunner.runOnRequest(pluginCtx);
827
+ if (onRequest.shortCircuited) return;
828
+ }
687
829
  try {
688
- for (; ; ) {
689
- const { done, value } = await reader.read();
690
- if (done) break;
691
- res.write(value);
692
- }
693
- res.end();
694
- } finally {
695
- reader.releaseLock();
830
+ await serve(request, pluginCtx);
831
+ } catch (err) {
832
+ if (pluginRunner) await pluginRunner.runOnError(pluginCtx, err);
833
+ sendError(res, "INTERNAL", messageOf2(err, failureMessage), 500, void 0, requestId);
696
834
  }
835
+ if (pluginRunner) await pluginRunner.runOnResponse(pluginCtx);
836
+ }
837
+
838
+ // src/server/http/resolve-agent-subject.ts
839
+ function createAgentSubjectResolver(sources) {
840
+ let pending;
841
+ return () => {
842
+ pending ??= resolve3(sources);
843
+ return pending;
844
+ };
845
+ }
846
+ async function resolve3(sources) {
847
+ const { req, res, loadModule, serverDir, pluginRunner } = sources;
848
+ const produced = serverDir === void 0 ? {} : await createServerContext(req, res, loadModule, serverDir);
849
+ const ctx = produced ?? {};
850
+ pluginRunner?.applyDecorations(ctx);
851
+ return subjectFromContext(ctx);
697
852
  }
698
853
 
699
854
  export {
855
+ resolvePluginSpecifiers,
700
856
  resolveTransformer,
701
857
  isAgentCardPath,
858
+ parseApprovalAgentName,
702
859
  isApprovalPath,
703
860
  handleAgentApproval,
704
- isListApprovalsPath,
705
- serveAgentAuxRoute,
706
- writeWebResponseToServerResponse,
861
+ matchAgentAuxRoute,
862
+ serveMatchedAuxRoute,
863
+ serveThroughPluginLifecycle,
864
+ createAgentSubjectResolver,
707
865
  extractHeadTags,
708
866
  injectIntoHead,
709
867
  applyNonceToInlineScripts,
710
868
  setupSsrDevMiddleware
711
869
  };
712
- //# sourceMappingURL=chunk-GRI4XHBJ.js.map
870
+ //# sourceMappingURL=chunk-JWRCZIA4.js.map