theokit 0.43.12 → 0.44.3

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 (302) hide show
  1. package/dist/{actions-virtual-module-RSFRPJQZ.js → actions-virtual-module-67K4POQ2.js} +20 -20
  2. package/dist/actions-virtual-module-67K4POQ2.js.map +1 -0
  3. package/dist/{actions-virtual-module-HG66SZ7T.js → actions-virtual-module-IK2SDIZ3.js} +4 -3
  4. package/dist/{actions-virtual-module-HG66SZ7T.js.map → actions-virtual-module-IK2SDIZ3.js.map} +1 -1
  5. package/dist/adapters/web-shim.js +1 -1
  6. package/dist/adapters/web-shim.js.map +1 -1
  7. package/dist/adapters/ws-shim.js +1 -1
  8. package/dist/adapters/ws-shim.js.map +1 -1
  9. package/dist/{agent-OXRRKB55.js → agent-OCCL5RUY.js} +2 -2
  10. package/dist/{agents-typed-client-ZP7BKJB3.js → agents-typed-client-TNHCUU7Q.js} +2 -2
  11. package/dist/agents-typed-client-TNHCUU7Q.js.map +1 -0
  12. package/dist/{app-typed-client-GDF2OMJ2.js → app-typed-client-4OH3JREB.js} +47 -8
  13. package/dist/app-typed-client-4OH3JREB.js.map +1 -0
  14. package/dist/{app-typed-client-USLAMN7X.js → app-typed-client-N5WUE2CP.js} +62 -24
  15. package/dist/app-typed-client-N5WUE2CP.js.map +1 -0
  16. package/dist/{body-parser-web-NNEJGX6Y.js → body-parser-web-4Z2QTPDU.js} +2 -2
  17. package/dist/body-parser-web-4Z2QTPDU.js.map +1 -0
  18. package/dist/boot/index.js +4 -4
  19. package/dist/boot/index.js.map +1 -1
  20. package/dist/{broadcast-4SX7R5XE.js → broadcast-H64DJRBE.js} +3 -3
  21. package/dist/broadcast-H64DJRBE.js.map +1 -0
  22. package/dist/{build-MQHIJROR.js → build-25RSFP22.js} +13 -4
  23. package/dist/build-25RSFP22.js.map +1 -0
  24. package/dist/{build-request-body-preview-FVBQ7LCE.js → build-request-body-preview-CKWWBF2M.js} +2 -2
  25. package/dist/build-request-body-preview-CKWWBF2M.js.map +1 -0
  26. package/dist/{chunk-26ECIX74.js → chunk-2ADKT37V.js} +5 -5
  27. package/dist/chunk-2ADKT37V.js.map +1 -0
  28. package/dist/{chunk-JIL74SFK.js → chunk-37ZO643S.js} +9 -9
  29. package/dist/chunk-37ZO643S.js.map +1 -0
  30. package/dist/{chunk-ESC54TAK.js → chunk-3DGIANAN.js} +1 -1
  31. package/dist/chunk-3DGIANAN.js.map +1 -0
  32. package/dist/{chunk-6FK7FKY6.js → chunk-47FFT43U.js} +1 -1
  33. package/dist/chunk-47FFT43U.js.map +1 -0
  34. package/dist/{chunk-ZJQ4O76G.js → chunk-4FWBKX6G.js} +1 -1
  35. package/dist/chunk-4FWBKX6G.js.map +1 -0
  36. package/dist/{chunk-NM4WF3XD.js → chunk-4PBJ266F.js} +1 -1
  37. package/dist/chunk-4PBJ266F.js.map +1 -0
  38. package/dist/{chunk-7MQOHNHE.js → chunk-52PDWL5S.js} +1 -1
  39. package/dist/chunk-52PDWL5S.js.map +1 -0
  40. package/dist/{chunk-JQJN6LFK.js → chunk-62EU2BVZ.js} +2 -2
  41. package/dist/chunk-62EU2BVZ.js.map +1 -0
  42. package/dist/{chunk-SJIRP73B.js → chunk-646CA6RV.js} +2 -2
  43. package/dist/chunk-646CA6RV.js.map +1 -0
  44. package/dist/{chunk-ASDXVRJD.js → chunk-6KDXP472.js} +4 -4
  45. package/dist/chunk-6KDXP472.js.map +1 -0
  46. package/dist/chunk-6LNIGF5P.js +46 -0
  47. package/dist/chunk-6LNIGF5P.js.map +1 -0
  48. package/dist/chunk-7IHWXDJJ.js +1 -0
  49. package/dist/chunk-7IHWXDJJ.js.map +1 -0
  50. package/dist/{chunk-JQSKBMXP.js → chunk-7LVM22VG.js} +1 -1
  51. package/dist/chunk-7LVM22VG.js.map +1 -0
  52. package/dist/{chunk-UVXB2ER7.js → chunk-7SABX4DJ.js} +1 -1
  53. package/dist/chunk-7SABX4DJ.js.map +1 -0
  54. package/dist/{chunk-X32XEJXR.js → chunk-ACKBVBUI.js} +1 -1
  55. package/dist/chunk-ACKBVBUI.js.map +1 -0
  56. package/dist/{chunk-UUFYP2UM.js → chunk-AM3QABW5.js} +3 -3
  57. package/dist/chunk-AM3QABW5.js.map +1 -0
  58. package/dist/{chunk-FH3DYBAN.js → chunk-ANS4ELRH.js} +1 -1
  59. package/dist/chunk-ANS4ELRH.js.map +1 -0
  60. package/dist/{chunk-UD3LFGDL.js → chunk-AVQU5CQF.js} +1 -1
  61. package/dist/chunk-AVQU5CQF.js.map +1 -0
  62. package/dist/{chunk-CJNMJUHE.js → chunk-B7ONQ4QJ.js} +2 -2
  63. package/dist/{chunk-WSJKACWB.js → chunk-C34PMLSN.js} +1 -1
  64. package/dist/chunk-C34PMLSN.js.map +1 -0
  65. package/dist/{chunk-2WH6SD3C.js → chunk-DSOBIXXR.js} +4 -4
  66. package/dist/{chunk-DJFMAWH5.js → chunk-EIRQM55C.js} +6 -5
  67. package/dist/chunk-EIRQM55C.js.map +1 -0
  68. package/dist/{chunk-ZEGYW52B.js → chunk-FB2HBNIC.js} +1 -1
  69. package/dist/chunk-FB2HBNIC.js.map +1 -0
  70. package/dist/chunk-FXZZS7YW.js +605 -0
  71. package/dist/chunk-FXZZS7YW.js.map +1 -0
  72. package/dist/{chunk-HGUZWG2C.js → chunk-FZG3JYB3.js} +8 -47
  73. package/dist/chunk-FZG3JYB3.js.map +1 -0
  74. package/dist/{chunk-V3LJN2GS.js → chunk-GAPBPRPP.js} +1 -1
  75. package/dist/chunk-GAPBPRPP.js.map +1 -0
  76. package/dist/chunk-GUBN5UTT.js +1 -0
  77. package/dist/chunk-GUBN5UTT.js.map +1 -0
  78. package/dist/{chunk-6OXCZMW3.js → chunk-HEK4SET7.js} +5 -5
  79. package/dist/chunk-HEK4SET7.js.map +1 -0
  80. package/dist/{chunk-N2D5AVRR.js → chunk-HRCNHWLP.js} +7 -109
  81. package/dist/chunk-HRCNHWLP.js.map +1 -0
  82. package/dist/{chunk-C3ZZ56YZ.js → chunk-JA2ZAT5Q.js} +1 -1
  83. package/dist/chunk-JA2ZAT5Q.js.map +1 -0
  84. package/dist/{chunk-L2S2R3TI.js → chunk-KBGGQK4I.js} +25 -8
  85. package/dist/chunk-KBGGQK4I.js.map +1 -0
  86. package/dist/{chunk-VPISAMXU.js → chunk-KD5G3YXI.js} +4 -4
  87. package/dist/chunk-KD5G3YXI.js.map +1 -0
  88. package/dist/{chunk-VMEWD57H.js → chunk-KPKLIUUL.js} +1 -1
  89. package/dist/chunk-KPKLIUUL.js.map +1 -0
  90. package/dist/{chunk-4HAU7AJM.js → chunk-L4Y6RJ4E.js} +3 -3
  91. package/dist/chunk-L4Y6RJ4E.js.map +1 -0
  92. package/dist/{chunk-OVHW23YC.js → chunk-L5Z6IY5U.js} +5 -5
  93. package/dist/chunk-L5Z6IY5U.js.map +1 -0
  94. package/dist/{chunk-JBCHWRKF.js → chunk-MTEWLGVY.js} +2 -2
  95. package/dist/chunk-MTEWLGVY.js.map +1 -0
  96. package/dist/{chunk-XZ6B2Y2R.js → chunk-MWP4YXWJ.js} +1 -1
  97. package/dist/chunk-MWP4YXWJ.js.map +1 -0
  98. package/dist/{chunk-575PAX5L.js → chunk-NGEBYCOZ.js} +62 -38
  99. package/dist/chunk-NGEBYCOZ.js.map +1 -0
  100. package/dist/{chunk-5QW7IQQU.js → chunk-NTDN54XO.js} +1 -1
  101. package/dist/chunk-NTDN54XO.js.map +1 -0
  102. package/dist/{chunk-7BIM27LV.js → chunk-OIGJOYX6.js} +1 -1
  103. package/dist/chunk-OIGJOYX6.js.map +1 -0
  104. package/dist/{chunk-TSLSIRBR.js → chunk-OLGPYOLO.js} +2 -2
  105. package/dist/chunk-OLGPYOLO.js.map +1 -0
  106. package/dist/{chunk-IE6C4KZX.js → chunk-Q5OT7LZG.js} +11 -496
  107. package/dist/chunk-Q5OT7LZG.js.map +1 -0
  108. package/dist/{chunk-6NEXVBPY.js → chunk-RWNSW4FM.js} +1 -1
  109. package/dist/chunk-RWNSW4FM.js.map +1 -0
  110. package/dist/{chunk-E25FBYJP.js → chunk-SAFGDIPQ.js} +1 -1
  111. package/dist/chunk-SAFGDIPQ.js.map +1 -0
  112. package/dist/{chunk-OP7QCTR5.js → chunk-SEELKQUM.js} +2 -2
  113. package/dist/chunk-SEELKQUM.js.map +1 -0
  114. package/dist/{chunk-4B2ZMX45.js → chunk-SSYDEKWF.js} +1 -1
  115. package/dist/chunk-SSYDEKWF.js.map +1 -0
  116. package/dist/{chunk-DQVBL2G4.js → chunk-SZU6BOMV.js} +75 -53
  117. package/dist/chunk-SZU6BOMV.js.map +1 -0
  118. package/dist/{chunk-65EFIUDD.js → chunk-U267AOWS.js} +1 -1
  119. package/dist/chunk-U267AOWS.js.map +1 -0
  120. package/dist/{chunk-FX72VHAE.js → chunk-U3H53IIN.js} +6 -6
  121. package/dist/chunk-U3H53IIN.js.map +1 -0
  122. package/dist/{chunk-OPLICDUB.js → chunk-UW2TEAGR.js} +1 -1
  123. package/dist/chunk-UW2TEAGR.js.map +1 -0
  124. package/dist/{chunk-IAJ2JVEH.js → chunk-VSLTKX5L.js} +1 -1
  125. package/dist/chunk-VSLTKX5L.js.map +1 -0
  126. package/dist/{chunk-YB5DJJ4U.js → chunk-VZTYCAO6.js} +1 -1
  127. package/dist/chunk-VZTYCAO6.js.map +1 -0
  128. package/dist/chunk-WDGYCBNI.js +65 -0
  129. package/dist/chunk-WDGYCBNI.js.map +1 -0
  130. package/dist/chunk-WPJOTQA5.js +1 -0
  131. package/dist/chunk-WPJOTQA5.js.map +1 -0
  132. package/dist/{chunk-DGUM43GV.js → chunk-XTHN6JBX.js} +1 -1
  133. package/dist/chunk-XTHN6JBX.js.map +1 -0
  134. package/dist/{chunk-HZ6USUHC.js → chunk-YOIVCCZT.js} +1 -1
  135. package/dist/chunk-YOIVCCZT.js.map +1 -0
  136. package/dist/{chunk-OI6DK6ZJ.js → chunk-ZC2UESE4.js} +6 -4
  137. package/dist/{chunk-OI6DK6ZJ.js.map → chunk-ZC2UESE4.js.map} +1 -1
  138. package/dist/cli/index.js +8 -8
  139. package/dist/client/core.d.ts +4 -258
  140. package/dist/client/core.js +13 -9
  141. package/dist/client/core.js.map +1 -1
  142. package/dist/client/index.d.ts +7 -96
  143. package/dist/client/index.js +19 -67
  144. package/dist/client/index.js.map +1 -1
  145. package/dist/{controller-swc-transform-JJRMTSDY.js → controller-swc-transform-T7ZTD55V.js} +2 -2
  146. package/dist/controller-swc-transform-T7ZTD55V.js.map +1 -0
  147. package/dist/{cookies-MJKMGJ7N.js → cookies-SOXUQJXG.js} +3 -3
  148. package/dist/cookies-SOXUQJXG.js.map +1 -0
  149. package/dist/{dev-WQ4LWCAW.js → dev-V6UBM2OL.js} +8 -7
  150. package/dist/{dev-WQ4LWCAW.js.map → dev-V6UBM2OL.js.map} +1 -1
  151. package/dist/{dev-emit-HLGJK3PP.js → dev-emit-F54Y5TIU.js} +5 -5
  152. package/dist/dev-emit-F54Y5TIU.js.map +1 -0
  153. package/dist/devtools/entry.js +61 -53
  154. package/dist/devtools/entry.js.map +1 -1
  155. package/dist/dispatcher-MXKF3CRH.js +8 -0
  156. package/dist/dispatcher-MXKF3CRH.js.map +1 -0
  157. package/dist/index.js +25 -25
  158. package/dist/index.js.map +1 -1
  159. package/dist/{info-75U6GCMD.js → info-ICDTPJDC.js} +3 -3
  160. package/dist/{internal-api-JFORKYLR.js → internal-api-ALXVBL56.js} +10 -8
  161. package/dist/{internal-api-DV3H5NNV.js → internal-api-S7WK2WCY.js} +20 -20
  162. package/dist/internal-api-S7WK2WCY.js.map +1 -0
  163. package/dist/{load-config-XP7NSSA7.js → load-config-ICCNMO74.js} +3 -3
  164. package/dist/{mcp-FF3NTCHB.js → mcp-4JFODA5U.js} +3 -3
  165. package/dist/{openapi-ZPXYRAM2.js → openapi-NIYA2VBG.js} +3 -3
  166. package/dist/react-query/index.js +2 -2
  167. package/dist/react-query/index.js.map +1 -1
  168. package/dist/{routes-ZVDKABXZ.js → routes-2RD4S5PZ.js} +3 -3
  169. package/dist/{schema-FBOTN46F.js → schema-S553QCAU.js} +2 -2
  170. package/dist/server/agent/index.d.ts +3 -72
  171. package/dist/server/agent/index.js +4 -4
  172. package/dist/server/agent/index.js.map +1 -1
  173. package/dist/server/auth/index.js +4 -4
  174. package/dist/server/auth/index.js.map +1 -1
  175. package/dist/server/cost/index.js +2 -2
  176. package/dist/server/cost/index.js.map +1 -1
  177. package/dist/server/cron/index.js +6 -6
  178. package/dist/server/cron/index.js.map +1 -1
  179. package/dist/server/define/index.js +4 -4
  180. package/dist/server/define/index.js.map +1 -1
  181. package/dist/server/http/index.js +11 -11
  182. package/dist/server/http/index.js.map +1 -1
  183. package/dist/server/index.d.ts +2 -2
  184. package/dist/server/index.js +41 -41
  185. package/dist/server/index.js.map +1 -1
  186. package/dist/server/jobs/index.js +7 -7
  187. package/dist/server/jobs/index.js.map +1 -1
  188. package/dist/server/observability/index.d.ts +8 -1
  189. package/dist/server/observability/index.js +5 -5
  190. package/dist/server/observability/index.js.map +1 -1
  191. package/dist/server/plugins/index.js +3 -3
  192. package/dist/server/plugins/index.js.map +1 -1
  193. package/dist/server/rate-limit/index.js +4 -4
  194. package/dist/server/rate-limit/index.js.map +1 -1
  195. package/dist/server/realtime/index.js +2 -2
  196. package/dist/server/realtime/index.js.map +1 -1
  197. package/dist/server/scan/index.js +7 -7
  198. package/dist/server/scan/index.js.map +1 -1
  199. package/dist/server/security/index.js +5 -5
  200. package/dist/server/security/index.js.map +1 -1
  201. package/dist/server/storage/index.js +2 -2
  202. package/dist/server/storage/index.js.map +1 -1
  203. package/dist/server/webhook/index.js +3 -3
  204. package/dist/server/webhook/index.js.map +1 -1
  205. package/dist/server-error-to-envelope-UM7DEVM4.js +8 -0
  206. package/dist/server-error-to-envelope-UM7DEVM4.js.map +1 -0
  207. package/dist/{server-routes-hmr-RI7SYNT2.js → server-routes-hmr-6CRNSEWF.js} +2 -2
  208. package/dist/server-routes-hmr-6CRNSEWF.js.map +1 -0
  209. package/dist/{services-typed-client-AU6DKXAO.js → services-typed-client-IXNOPVZA.js} +3 -3
  210. package/dist/services-typed-client-IXNOPVZA.js.map +1 -0
  211. package/dist/{start-2U3FUCJX.js → start-2LNPPG74.js} +35 -11
  212. package/dist/start-2LNPPG74.js.map +1 -0
  213. package/dist/vite-plugin/index.js +25 -25
  214. package/dist/vite-plugin/index.js.map +1 -1
  215. package/dist/{vite-plugin-D2NTPZNC.js → vite-plugin-X6YO3OUH.js} +8 -7
  216. package/package.json +9 -5
  217. package/dist/actions-virtual-module-RSFRPJQZ.js.map +0 -1
  218. package/dist/agents-typed-client-ZP7BKJB3.js.map +0 -1
  219. package/dist/app-typed-client-GDF2OMJ2.js.map +0 -1
  220. package/dist/app-typed-client-USLAMN7X.js.map +0 -1
  221. package/dist/body-parser-web-NNEJGX6Y.js.map +0 -1
  222. package/dist/build-MQHIJROR.js.map +0 -1
  223. package/dist/build-request-body-preview-FVBQ7LCE.js.map +0 -1
  224. package/dist/chunk-26ECIX74.js.map +0 -1
  225. package/dist/chunk-4B2ZMX45.js.map +0 -1
  226. package/dist/chunk-4HAU7AJM.js.map +0 -1
  227. package/dist/chunk-575PAX5L.js.map +0 -1
  228. package/dist/chunk-5QW7IQQU.js.map +0 -1
  229. package/dist/chunk-65EFIUDD.js.map +0 -1
  230. package/dist/chunk-6FK7FKY6.js.map +0 -1
  231. package/dist/chunk-6NEXVBPY.js.map +0 -1
  232. package/dist/chunk-6OXCZMW3.js.map +0 -1
  233. package/dist/chunk-7BIM27LV.js.map +0 -1
  234. package/dist/chunk-7MQOHNHE.js.map +0 -1
  235. package/dist/chunk-ASDXVRJD.js.map +0 -1
  236. package/dist/chunk-C3ZZ56YZ.js.map +0 -1
  237. package/dist/chunk-DJFMAWH5.js.map +0 -1
  238. package/dist/chunk-DQVBL2G4.js.map +0 -1
  239. package/dist/chunk-E25FBYJP.js.map +0 -1
  240. package/dist/chunk-E3JH6YUM.js +0 -1
  241. package/dist/chunk-ESC54TAK.js.map +0 -1
  242. package/dist/chunk-FH3DYBAN.js.map +0 -1
  243. package/dist/chunk-FX72VHAE.js.map +0 -1
  244. package/dist/chunk-HGUZWG2C.js.map +0 -1
  245. package/dist/chunk-HZ6USUHC.js.map +0 -1
  246. package/dist/chunk-IAJ2JVEH.js.map +0 -1
  247. package/dist/chunk-IE6C4KZX.js.map +0 -1
  248. package/dist/chunk-JBCHWRKF.js.map +0 -1
  249. package/dist/chunk-JHEAWR3L.js +0 -1
  250. package/dist/chunk-JIL74SFK.js.map +0 -1
  251. package/dist/chunk-JQJN6LFK.js.map +0 -1
  252. package/dist/chunk-JQSKBMXP.js.map +0 -1
  253. package/dist/chunk-KPRJS3II.js +0 -505
  254. package/dist/chunk-KPRJS3II.js.map +0 -1
  255. package/dist/chunk-L2S2R3TI.js.map +0 -1
  256. package/dist/chunk-N2D5AVRR.js.map +0 -1
  257. package/dist/chunk-NM4WF3XD.js.map +0 -1
  258. package/dist/chunk-NPMCKOX4.js +0 -1
  259. package/dist/chunk-NPMCKOX4.js.map +0 -1
  260. package/dist/chunk-OP7QCTR5.js.map +0 -1
  261. package/dist/chunk-OPLICDUB.js.map +0 -1
  262. package/dist/chunk-OVHW23YC.js.map +0 -1
  263. package/dist/chunk-SJIRP73B.js.map +0 -1
  264. package/dist/chunk-TSLSIRBR.js.map +0 -1
  265. package/dist/chunk-UD3LFGDL.js.map +0 -1
  266. package/dist/chunk-UUFYP2UM.js.map +0 -1
  267. package/dist/chunk-UVXB2ER7.js.map +0 -1
  268. package/dist/chunk-V3LJN2GS.js.map +0 -1
  269. package/dist/chunk-VMEWD57H.js.map +0 -1
  270. package/dist/chunk-VPISAMXU.js.map +0 -1
  271. package/dist/chunk-WSJKACWB.js.map +0 -1
  272. package/dist/chunk-X32XEJXR.js.map +0 -1
  273. package/dist/chunk-XZ6B2Y2R.js.map +0 -1
  274. package/dist/chunk-YB5DJJ4U.js.map +0 -1
  275. package/dist/chunk-ZEGYW52B.js.map +0 -1
  276. package/dist/chunk-ZJQ4O76G.js.map +0 -1
  277. package/dist/controller-swc-transform-JJRMTSDY.js.map +0 -1
  278. package/dist/cookies-MJKMGJ7N.js.map +0 -1
  279. package/dist/dev-emit-HLGJK3PP.js.map +0 -1
  280. package/dist/dispatcher-DLKIXYNO.js +0 -8
  281. package/dist/dispatcher-DLKIXYNO.js.map +0 -1
  282. package/dist/internal-api-DV3H5NNV.js.map +0 -1
  283. package/dist/internal-api-JFORKYLR.js.map +0 -1
  284. package/dist/load-config-XP7NSSA7.js.map +0 -1
  285. package/dist/schema-FBOTN46F.js.map +0 -1
  286. package/dist/server-error-to-envelope-EOFUIUNB.js +0 -8
  287. package/dist/server-error-to-envelope-EOFUIUNB.js.map +0 -1
  288. package/dist/server-routes-hmr-RI7SYNT2.js.map +0 -1
  289. package/dist/services-typed-client-AU6DKXAO.js.map +0 -1
  290. package/dist/start-2U3FUCJX.js.map +0 -1
  291. package/dist/vite-plugin-D2NTPZNC.js.map +0 -1
  292. /package/dist/{agent-OXRRKB55.js.map → agent-OCCL5RUY.js.map} +0 -0
  293. /package/dist/{chunk-CJNMJUHE.js.map → chunk-B7ONQ4QJ.js.map} +0 -0
  294. /package/dist/{chunk-2WH6SD3C.js.map → chunk-DSOBIXXR.js.map} +0 -0
  295. /package/dist/{info-75U6GCMD.js.map → info-ICDTPJDC.js.map} +0 -0
  296. /package/dist/{broadcast-4SX7R5XE.js.map → internal-api-ALXVBL56.js.map} +0 -0
  297. /package/dist/{chunk-DGUM43GV.js.map → load-config-ICCNMO74.js.map} +0 -0
  298. /package/dist/{mcp-FF3NTCHB.js.map → mcp-4JFODA5U.js.map} +0 -0
  299. /package/dist/{openapi-ZPXYRAM2.js.map → openapi-NIYA2VBG.js.map} +0 -0
  300. /package/dist/{routes-ZVDKABXZ.js.map → routes-2RD4S5PZ.js.map} +0 -0
  301. /package/dist/{chunk-E3JH6YUM.js.map → schema-S553QCAU.js.map} +0 -0
  302. /package/dist/{chunk-JHEAWR3L.js.map → vite-plugin-X6YO3OUH.js.map} +0 -0
@@ -0,0 +1,605 @@
1
+ #!/usr/bin/env node
2
+ import "tsx/esm";
3
+
4
+ // src/server/body-parser.ts
5
+ import { basename } from "path";
6
+ import Busboy from "busboy";
7
+ var METHODS_WITH_BODY = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH"]);
8
+ var DEFAULT_MAX_FILE_SIZE = 10 * 1024 * 1024;
9
+ var DEFAULT_MAX_FILES = 10;
10
+ var DEFAULT_MAX_FIELD_SIZE = 1 * 1024 * 1024;
11
+ var FileTooLargeError = class extends Error {
12
+ constructor(message, truncatedFilenames, maxFileSize) {
13
+ super(message);
14
+ this.truncatedFilenames = truncatedFilenames;
15
+ this.maxFileSize = maxFileSize;
16
+ this.name = "FileTooLargeError";
17
+ }
18
+ truncatedFilenames;
19
+ maxFileSize;
20
+ code = "FILE_TOO_LARGE";
21
+ status = 413;
22
+ };
23
+ function stashBodyPreview(req, body) {
24
+ try {
25
+ ;
26
+ req[DEVTOOLS_BODY_PREVIEW] = body;
27
+ } catch {
28
+ }
29
+ }
30
+ function parseJsonBody(req) {
31
+ return new Promise((resolve, reject) => {
32
+ const chunks = [];
33
+ req.on("data", (chunk) => chunks.push(chunk));
34
+ req.on("end", () => {
35
+ const raw = Buffer.concat(chunks).toString();
36
+ if (!raw) {
37
+ resolve(void 0);
38
+ return;
39
+ }
40
+ try {
41
+ resolve(JSON.parse(raw));
42
+ } catch {
43
+ reject(new Error("Invalid JSON body"));
44
+ }
45
+ });
46
+ req.on("error", reject);
47
+ });
48
+ }
49
+ function parseMultipartBody(req, contentType, options) {
50
+ if (!contentType.includes("boundary=")) {
51
+ return Promise.reject(new Error("Missing multipart boundary"));
52
+ }
53
+ return new Promise((resolve, reject) => {
54
+ const fields = {};
55
+ const files = [];
56
+ const truncatedFilenames = [];
57
+ let fileCount = 0;
58
+ const bb = Busboy({
59
+ headers: req.headers,
60
+ limits: {
61
+ fileSize: options.maxFileSize,
62
+ files: options.maxFiles,
63
+ fieldSize: options.maxFieldSize
64
+ }
65
+ });
66
+ bb.on("field", (name, value) => {
67
+ fields[name] = value;
68
+ });
69
+ bb.on(
70
+ "file",
71
+ (fieldname, stream, info) => {
72
+ fileCount++;
73
+ if (fileCount > options.maxFiles) {
74
+ stream.resume();
75
+ return;
76
+ }
77
+ const safeName = basename(info.filename || "unnamed");
78
+ const chunks = [];
79
+ let size = 0;
80
+ let truncated = false;
81
+ stream.on("data", (chunk) => {
82
+ size += chunk.length;
83
+ if (size > options.maxFileSize) {
84
+ truncated = true;
85
+ stream.resume();
86
+ return;
87
+ }
88
+ chunks.push(chunk);
89
+ });
90
+ stream.on("end", () => {
91
+ if (truncated) {
92
+ truncatedFilenames.push(safeName);
93
+ return;
94
+ }
95
+ const buffer = Buffer.concat(chunks);
96
+ files.push({
97
+ fieldname,
98
+ filename: safeName,
99
+ encoding: info.encoding,
100
+ mimeType: info.mimeType,
101
+ buffer,
102
+ size: buffer.length
103
+ });
104
+ });
105
+ }
106
+ );
107
+ bb.on("filesLimit", () => {
108
+ reject(new Error(`Too many files. Maximum: ${options.maxFiles}`));
109
+ });
110
+ bb.on("error", (err) => {
111
+ reject(err);
112
+ });
113
+ bb.on("close", () => {
114
+ if (truncatedFilenames.length > 0) {
115
+ reject(
116
+ new FileTooLargeError(
117
+ `File too large (max ${options.maxFileSize} bytes): ${truncatedFilenames.join(", ")}`,
118
+ truncatedFilenames,
119
+ options.maxFileSize
120
+ )
121
+ );
122
+ return;
123
+ }
124
+ resolve({ fields, files });
125
+ });
126
+ req.pipe(bb);
127
+ });
128
+ }
129
+ var DEVTOOLS_BODY_PREVIEW = /* @__PURE__ */ Symbol("theo:devtools:bodyPreview");
130
+ async function parseRequestBody(req, options) {
131
+ const method = req.method?.toUpperCase() ?? "GET";
132
+ if (!METHODS_WITH_BODY.has(method)) {
133
+ return { fields: {}, files: [], json: void 0 };
134
+ }
135
+ const contentType = req.headers["content-type"] ?? "";
136
+ if (contentType.includes("application/json")) {
137
+ const json = await parseJsonBody(req);
138
+ stashBodyPreview(req, json);
139
+ return { fields: {}, files: [], json };
140
+ }
141
+ if (contentType.includes("multipart/form-data")) {
142
+ const limits = {
143
+ maxFileSize: options?.maxFileSize ?? DEFAULT_MAX_FILE_SIZE,
144
+ maxFiles: options?.maxFiles ?? DEFAULT_MAX_FILES,
145
+ maxFieldSize: options?.maxFieldSize ?? DEFAULT_MAX_FIELD_SIZE
146
+ };
147
+ const { fields, files } = await parseMultipartBody(req, contentType, limits);
148
+ stashBodyPreview(req, {
149
+ fields,
150
+ files: files.map((f) => ({
151
+ fieldname: f.fieldname,
152
+ filename: f.filename,
153
+ mimeType: f.mimeType,
154
+ size: f.size
155
+ }))
156
+ });
157
+ return { fields, files };
158
+ }
159
+ if (!contentType) {
160
+ return { fields: {}, files: [] };
161
+ }
162
+ throw new Error(`Unsupported Content-Type: ${contentType}`);
163
+ }
164
+
165
+ // src/server/observability/request-log.ts
166
+ var defaultLoggerFn = (log) => {
167
+ console.log(JSON.stringify(log));
168
+ };
169
+ function logRequest(info, customLogger, req) {
170
+ const log = {
171
+ level: "info",
172
+ ...info,
173
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
174
+ };
175
+ const logger = customLogger ?? defaultLoggerFn;
176
+ logger(log);
177
+ broadcastRequestToDevtools(info, req);
178
+ }
179
+ function randomRequestId() {
180
+ return `req-${String(Date.now())}-${Math.random().toString(36).slice(2, 8)}`;
181
+ }
182
+ function broadcastToDevtoolsCore(info, headers, stashedBody) {
183
+ void Promise.all([
184
+ import("./broadcast-LUMOJIJT.js"),
185
+ import("./build-request-body-preview-XPZ2GYMG.js")
186
+ ]).then(([{ broadcastRequest }, { buildRequestBodyPreview }]) => {
187
+ const bodyInfo = buildRequestBodyPreview(stashedBody);
188
+ broadcastRequest({
189
+ id: randomRequestId(),
190
+ traceId: info.requestId,
191
+ method: info.method,
192
+ path: info.url,
193
+ status: info.status,
194
+ durationMs: info.duration,
195
+ startedAt: Date.now() - info.duration,
196
+ ...headers ? { headers } : {},
197
+ ...bodyInfo ? {
198
+ bodyPreview: bodyInfo.preview,
199
+ bodyLength: bodyInfo.length,
200
+ bodyTruncated: bodyInfo.truncated
201
+ } : {}
202
+ });
203
+ }).catch(() => {
204
+ });
205
+ }
206
+ function broadcastRequestToDevtools(info, req) {
207
+ const headers = req?.headers ? Object.fromEntries(
208
+ Object.entries(req.headers).map(([k, v]) => [
209
+ k,
210
+ Array.isArray(v) ? v.join(", ") : v ?? ""
211
+ ])
212
+ ) : void 0;
213
+ const stashedBody = req ? req[DEVTOOLS_BODY_PREVIEW] : void 0;
214
+ broadcastToDevtoolsCore(info, headers, stashedBody);
215
+ }
216
+
217
+ // src/server/observability/logger.ts
218
+ var _warnOnceSeen = /* @__PURE__ */ new Set();
219
+ var MAX_SEEN = 1024;
220
+ function warnOnce(key, payload) {
221
+ if (_warnOnceSeen.has(key)) return;
222
+ if (_warnOnceSeen.size >= MAX_SEEN) {
223
+ const oldest = _warnOnceSeen.values().next().value;
224
+ if (oldest !== void 0) _warnOnceSeen.delete(oldest);
225
+ }
226
+ _warnOnceSeen.add(key);
227
+ let line;
228
+ try {
229
+ line = JSON.stringify({ ...payload, warnOnce: true });
230
+ } catch {
231
+ line = `[warnOnce] ${key} \u2014 (payload could not be serialized)`;
232
+ }
233
+ console.warn(line);
234
+ broadcastWarnOnceToDevtools(key, payload);
235
+ }
236
+ function payloadField(payload, key, fallback = "") {
237
+ const value = payload[key];
238
+ if (typeof value === "string") return value;
239
+ if (typeof value === "number" || typeof value === "boolean") return String(value);
240
+ return fallback;
241
+ }
242
+ function randomDevtoolsId() {
243
+ return `warn-${String(Date.now())}-${Math.random().toString(36).slice(2, 8)}`;
244
+ }
245
+ function broadcastWarnOnceToDevtools(key, payload) {
246
+ void import("./broadcast-LUMOJIJT.js").then(({ broadcastCsrfWarn, broadcastError }) => {
247
+ if (payload.event === "csrf.warn" && typeof payload.code === "string" && typeof payload.docsUrl === "string") {
248
+ broadcastCsrfWarn({
249
+ event: "csrf.warn",
250
+ code: payload.code,
251
+ docsUrl: payload.docsUrl,
252
+ method: payloadField(payload, "method"),
253
+ path: payloadField(payload, "path"),
254
+ reason: payloadField(payload, "reason")
255
+ });
256
+ } else {
257
+ broadcastError({
258
+ id: randomDevtoolsId(),
259
+ type: "console",
260
+ message: payloadField(payload, "event", key),
261
+ timestamp: Date.now()
262
+ });
263
+ }
264
+ }).catch(() => {
265
+ });
266
+ }
267
+
268
+ // src/server/http/send-response.ts
269
+ function sendJson(res, data, status = 200, transformer) {
270
+ const body = transformer ? transformer.serialize(data) : JSON.stringify(data);
271
+ res.writeHead(status, {
272
+ "Content-Type": "application/json",
273
+ "Content-Length": Buffer.byteLength(body)
274
+ });
275
+ res.end(body);
276
+ }
277
+ function sendError(res, codeOrInput, message, status, issues, requestId, options) {
278
+ let code;
279
+ if (typeof codeOrInput === "string") {
280
+ code = codeOrInput;
281
+ message = message ?? "";
282
+ status = status ?? 500;
283
+ } else {
284
+ code = codeOrInput.code;
285
+ message = codeOrInput.message;
286
+ status = codeOrInput.status;
287
+ issues = codeOrInput.issues;
288
+ requestId = codeOrInput.requestId;
289
+ options = codeOrInput.options;
290
+ }
291
+ const errorMessage = code === "INTERNAL_ERROR" && process.env.NODE_ENV === "production" ? "Internal server error" : message;
292
+ if (code === "INTERNAL_ERROR") {
293
+ console.error(`[${requestId ?? "no-id"}] ${message}`);
294
+ }
295
+ if (status === 404 && options?.custom404Html) {
296
+ const body = options.custom404Html;
297
+ res.writeHead(404, {
298
+ "Content-Type": "text/html; charset=utf-8",
299
+ "Content-Length": Buffer.byteLength(body)
300
+ });
301
+ res.end(body);
302
+ return;
303
+ }
304
+ if (status === 500 && options?.custom500Html) {
305
+ const body = options.custom500Html;
306
+ res.writeHead(500, {
307
+ "Content-Type": "text/html; charset=utf-8",
308
+ "Content-Length": Buffer.byteLength(body)
309
+ });
310
+ res.end(body);
311
+ return;
312
+ }
313
+ sendJson(
314
+ res,
315
+ {
316
+ error: {
317
+ code,
318
+ message: errorMessage,
319
+ ...requestId ? { requestId } : {},
320
+ ...issues ? { issues } : {}
321
+ }
322
+ },
323
+ status
324
+ );
325
+ }
326
+
327
+ // src/server/http/node-request.ts
328
+ import { Readable } from "stream";
329
+ function pickHeaderString(value) {
330
+ if (typeof value === "string") return value;
331
+ if (Array.isArray(value)) {
332
+ for (const v of value) if (typeof v === "string" && v.length > 0) return v;
333
+ }
334
+ return void 0;
335
+ }
336
+ function synthesizeAbsoluteUrl(req) {
337
+ const host = pickHeaderString(req.headers.host) ?? "localhost";
338
+ return `http://${host}${req.url ?? "/"}`;
339
+ }
340
+ function nodeHeadersToWeb(req) {
341
+ const headers = new Headers();
342
+ for (const [key, value] of Object.entries(req.headers)) {
343
+ if (value === void 0) continue;
344
+ if (Array.isArray(value)) {
345
+ headers.set(key, value.join(", "));
346
+ } else {
347
+ headers.set(key, value);
348
+ }
349
+ }
350
+ return headers;
351
+ }
352
+ function incomingMessageToWebRequest(req) {
353
+ const url = synthesizeAbsoluteUrl(req);
354
+ const headers = nodeHeadersToWeb(req);
355
+ const method = (req.method ?? "GET").toUpperCase();
356
+ const hasBody = method !== "GET" && method !== "HEAD";
357
+ if (!hasBody) {
358
+ return new Request(url, { method, headers });
359
+ }
360
+ const webStream = Readable.toWeb(req);
361
+ return new Request(url, {
362
+ method,
363
+ headers,
364
+ body: webStream,
365
+ // EC-2: Node 18+ requires `duplex: 'half'` when body is a stream.
366
+ // The `RequestInit` type omits it (Web spec gap); cast accordingly.
367
+ ...{ duplex: "half" }
368
+ });
369
+ }
370
+ function incomingMessageToHandlerRequest(req) {
371
+ return new Request(synthesizeAbsoluteUrl(req), {
372
+ method: (req.method ?? "GET").toUpperCase(),
373
+ headers: nodeHeadersToWeb(req)
374
+ });
375
+ }
376
+
377
+ // src/server/http/controller-dispatch.ts
378
+ import { readdirSync } from "fs";
379
+ import { join } from "path";
380
+ import { createDecoratorHandler, isControllerClass } from "@theokit/http";
381
+
382
+ // src/server/security/csrf-warn-dispatch.ts
383
+ function dispatchCsrfWarn(payload) {
384
+ const key = `${payload.event}:${payload.method}:${payload.path ?? ""}`;
385
+ warnOnce(key, payload);
386
+ }
387
+
388
+ // src/server/observability/audit-log.ts
389
+ function safeAudit(logger, event) {
390
+ if (!logger) return;
391
+ try {
392
+ const r = logger.log(event);
393
+ if (r && typeof r.then === "function") {
394
+ r.catch(() => {
395
+ });
396
+ }
397
+ } catch {
398
+ }
399
+ }
400
+
401
+ // src/server/security/csrf.ts
402
+ function matchDisallowed(path, patterns) {
403
+ for (const p of patterns) {
404
+ if (typeof p === "string") {
405
+ if (path === p) return true;
406
+ } else if (p instanceof RegExp) {
407
+ p.lastIndex = 0;
408
+ if (p.test(path)) return true;
409
+ }
410
+ }
411
+ return false;
412
+ }
413
+ var CSRF_WARN_CODE = "CSRF_STRICT_CUTOVER";
414
+ var CSRF_WARN_DOCS_URL = "https://theokit.dev/upgrade/csrf-strict-cutover";
415
+ function pickHeader(value) {
416
+ if (typeof value === "string") return value;
417
+ if (Array.isArray(value) && value.length > 0) return value[0];
418
+ return "";
419
+ }
420
+ function isCsrfValidFromHeaders(opts) {
421
+ if (opts.csrfActionHeader !== "1") {
422
+ return { valid: false, reason: "Missing X-Theo-Action header" };
423
+ }
424
+ if (opts.origin === null || opts.origin === "") {
425
+ return { valid: true };
426
+ }
427
+ if (opts.host === null || opts.host === "") {
428
+ return { valid: true };
429
+ }
430
+ try {
431
+ const originHost = new URL(opts.origin).host;
432
+ if (originHost !== opts.host) {
433
+ return { valid: false, reason: `Origin ${opts.origin} does not match host ${opts.host}` };
434
+ }
435
+ } catch {
436
+ return { valid: false, reason: `Invalid origin: ${opts.origin}` };
437
+ }
438
+ return { valid: true };
439
+ }
440
+ function validateCsrf(req) {
441
+ const action = req.headers["x-theo-action"];
442
+ const origin = req.headers.origin;
443
+ const host = req.headers.host;
444
+ return isCsrfValidFromHeaders({
445
+ csrfActionHeader: typeof action === "string" ? action : null,
446
+ origin: origin !== void 0 ? pickHeader(origin) || null : null,
447
+ host: host !== void 0 ? pickHeader(host) || null : null
448
+ });
449
+ }
450
+ function validateCsrfRequest(request) {
451
+ return isCsrfValidFromHeaders({
452
+ csrfActionHeader: request.headers.get("x-theo-action"),
453
+ origin: request.headers.get("origin"),
454
+ host: request.headers.get("host")
455
+ });
456
+ }
457
+ function dispatchCsrfWarn2(req, reason, logger, auditLogger, pathFallback = "") {
458
+ const payload = {
459
+ event: "csrf.warn",
460
+ method: req.method ?? "UNKNOWN",
461
+ path: logger?.path ?? pathFallback,
462
+ reason,
463
+ code: CSRF_WARN_CODE,
464
+ docsUrl: CSRF_WARN_DOCS_URL
465
+ };
466
+ logger?.warn(payload);
467
+ safeAudit(auditLogger, {
468
+ action: "csrf.warn",
469
+ actor: { type: "anonymous" },
470
+ metadata: { ...payload }
471
+ });
472
+ }
473
+ function enforceCsrf(req, mode, logger, disallowed, auditLogger) {
474
+ if (mode === "off") {
475
+ return { allow: true };
476
+ }
477
+ const check = validateCsrf(req);
478
+ if (check.valid) {
479
+ return { allow: true };
480
+ }
481
+ if (disallowed?.behavior === "raise") {
482
+ const path = logger?.path ?? req.url ?? "";
483
+ if (matchDisallowed(path, disallowed.routes)) {
484
+ return { allow: false, reason: check.reason };
485
+ }
486
+ }
487
+ if (mode === "warn") {
488
+ dispatchCsrfWarn2(req, check.reason, logger, auditLogger);
489
+ return { allow: true, reason: check.reason };
490
+ }
491
+ dispatchCsrfWarn2(req, check.reason, logger, auditLogger);
492
+ return { allow: false, reason: check.reason };
493
+ }
494
+
495
+ // src/server/http/controller-dispatch.ts
496
+ var CSRF_PROTECTED_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
497
+ function findControllerFiles(dir) {
498
+ const found = [];
499
+ const walk = (current) => {
500
+ let entries;
501
+ try {
502
+ entries = readdirSync(current, { withFileTypes: true });
503
+ } catch {
504
+ return;
505
+ }
506
+ for (const entry of entries) {
507
+ const full = join(current, entry.name);
508
+ if (entry.isDirectory()) walk(full);
509
+ else if (entry.name.endsWith(".controller.ts") || entry.name.endsWith(".controller.mjs"))
510
+ found.push(full);
511
+ }
512
+ };
513
+ walk(dir);
514
+ return found;
515
+ }
516
+ async function scanControllerModules(controllersDir, loadModule) {
517
+ const files = findControllerFiles(controllersDir);
518
+ const modules = [];
519
+ for (const filePath of files) {
520
+ const mod = await loadModule(filePath);
521
+ for (const exported of Object.values(mod)) {
522
+ if (typeof exported === "function" && isControllerClass(exported)) {
523
+ modules.push({ filePath, cls: exported, exports: mod });
524
+ }
525
+ }
526
+ }
527
+ return modules;
528
+ }
529
+ async function scanControllers(controllersDir, loadModule) {
530
+ const modules = await scanControllerModules(controllersDir, loadModule);
531
+ return modules.map((m) => m.cls);
532
+ }
533
+ async function createControllerDispatcher(opts) {
534
+ const classes = await scanControllers(opts.controllersDir, opts.loadModule);
535
+ if (classes.length === 0) return null;
536
+ const handle = createDecoratorHandler({ controllers: classes, serveAgent: opts.serveAgent });
537
+ return {
538
+ dispatch: (request) => handle(request),
539
+ matches: (method, pathname) => handle.matches(method, pathname)
540
+ };
541
+ }
542
+ async function writeControllerResponse(res, response) {
543
+ const headersBag = {};
544
+ for (const [k, v] of response.headers) {
545
+ if (k.toLowerCase() !== "set-cookie") headersBag[k] = v;
546
+ }
547
+ const setCookies = response.headers.getSetCookie();
548
+ if (setCookies.length > 0) res.setHeader("Set-Cookie", setCookies);
549
+ res.writeHead(response.status, headersBag);
550
+ const body = response.body ? await response.text() : "";
551
+ res.end(body || void 0);
552
+ }
553
+ async function dispatchControllerRequest(args) {
554
+ const { req, res, csrfMode, disallowed, requestId } = args;
555
+ const dispatcher = await createControllerDispatcher({
556
+ controllersDir: args.controllersDir,
557
+ loadModule: args.loadModule,
558
+ serveAgent: args.serveAgent
559
+ });
560
+ if (!dispatcher) return false;
561
+ const method = (req.method ?? "GET").toUpperCase();
562
+ const webRequest = incomingMessageToWebRequest(req);
563
+ const pathname = new URL(webRequest.url).pathname;
564
+ if (CSRF_PROTECTED_METHODS.has(method) && dispatcher.matches(method, pathname)) {
565
+ const decision = enforceCsrf(
566
+ req,
567
+ csrfMode,
568
+ { warn: dispatchCsrfWarn, path: req.url },
569
+ disallowed
570
+ );
571
+ if (!decision.allow) {
572
+ sendError(
573
+ res,
574
+ "CSRF_INVALID",
575
+ decision.reason ?? "CSRF check failed",
576
+ 403,
577
+ void 0,
578
+ requestId
579
+ );
580
+ return true;
581
+ }
582
+ }
583
+ const response = await dispatcher.dispatch(webRequest);
584
+ if (response === null) return false;
585
+ await writeControllerResponse(res, response);
586
+ return true;
587
+ }
588
+
589
+ export {
590
+ parseRequestBody,
591
+ logRequest,
592
+ warnOnce,
593
+ dispatchCsrfWarn,
594
+ safeAudit,
595
+ validateCsrfRequest,
596
+ enforceCsrf,
597
+ sendJson,
598
+ sendError,
599
+ incomingMessageToWebRequest,
600
+ incomingMessageToHandlerRequest,
601
+ findControllerFiles,
602
+ scanControllerModules,
603
+ dispatchControllerRequest
604
+ };
605
+ //# sourceMappingURL=chunk-FXZZS7YW.js.map