theokit 0.48.14 → 0.50.1
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.
- package/README.md +1 -0
- package/dist/{actions-virtual-module-YZRZMHAX.js → actions-virtual-module-DSIVNGK7.js} +14 -8
- package/dist/{actions-virtual-module-YZRZMHAX.js.map → actions-virtual-module-DSIVNGK7.js.map} +1 -1
- package/dist/{actions-virtual-module-E4PISKMB.js → actions-virtual-module-RXL2RJTW.js} +23 -12
- package/dist/actions-virtual-module-RXL2RJTW.js.map +1 -0
- package/dist/adapters/agent-mount.d.ts +127 -0
- package/dist/adapters/agent-mount.js +25 -0
- package/dist/adapters/security-headers.d.ts +132 -0
- package/dist/adapters/security-headers.js +64 -0
- package/dist/adapters/security-headers.js.map +1 -0
- package/dist/adapters/web-shim.d.ts +100 -13
- package/dist/adapters/web-shim.js +158 -54
- package/dist/adapters/web-shim.js.map +1 -1
- package/dist/agent-7IPEVCAY.js +15 -0
- package/dist/agent-scan-BZa-pagG.d.ts +16 -0
- package/dist/{app-typed-client-I4X2UJWW.js → app-typed-client-UTBMJZOE.js} +15 -9
- package/dist/app-typed-client-UTBMJZOE.js.map +1 -0
- package/dist/{app-typed-client-HLP26EYM.js → app-typed-client-XGDZKH73.js} +24 -13
- package/dist/app-typed-client-XGDZKH73.js.map +1 -0
- package/dist/aws-lambda-VKMYUMP2.js +261 -0
- package/dist/aws-lambda-VKMYUMP2.js.map +1 -0
- package/dist/{body-parser-web-4Z2QTPDU.js → body-parser-web-ON5CUTEL.js} +5 -2
- package/dist/body-parser-web-ON5CUTEL.js.map +1 -0
- package/dist/{body-parser-web-TIOTXPDW.js → body-parser-web-RV2SSAI3.js} +5 -2
- package/dist/body-parser-web-RV2SSAI3.js.map +1 -0
- package/dist/{build-F2Q5QTSC.js → build-VZODSYIQ.js} +72 -26
- package/dist/build-VZODSYIQ.js.map +1 -0
- package/dist/{bun-A5B2MJMO.js → bun-L7PP6ID5.js} +105 -13
- package/dist/bun-L7PP6ID5.js.map +1 -0
- package/dist/{check-45NKUVSQ.js → check-GIPZBFTX.js} +2 -2
- package/dist/{chunk-WYHYOYRH.js → chunk-2COPDKIG.js} +468 -203
- package/dist/chunk-2COPDKIG.js.map +1 -0
- package/dist/chunk-3PBAN2YE.js +146 -0
- package/dist/chunk-3PBAN2YE.js.map +1 -0
- package/dist/{chunk-HBU2GIMZ.js → chunk-3QPVEJ7D.js} +15 -9
- package/dist/chunk-3QPVEJ7D.js.map +1 -0
- package/dist/{chunk-IEES3CHD.js → chunk-47MM2JUK.js} +8 -2
- package/dist/chunk-47MM2JUK.js.map +1 -0
- package/dist/chunk-4X6H2BXP.js +108 -0
- package/dist/chunk-4X6H2BXP.js.map +1 -0
- package/dist/{chunk-A7JBF5FO.js → chunk-5K4TDLRG.js} +8 -5
- package/dist/chunk-5K4TDLRG.js.map +1 -0
- package/dist/chunk-5YPXXSYY.js +181 -0
- package/dist/chunk-5YPXXSYY.js.map +1 -0
- package/dist/{chunk-YGAXV5HR.js → chunk-6J4JWHDJ.js} +191 -112
- package/dist/chunk-6J4JWHDJ.js.map +1 -0
- package/dist/{chunk-FTFN4MYN.js → chunk-7AEBH52I.js} +639 -516
- package/dist/chunk-7AEBH52I.js.map +1 -0
- package/dist/chunk-7UZZHCRN.js +21 -0
- package/dist/chunk-7UZZHCRN.js.map +1 -0
- package/dist/{chunk-MTEWLGVY.js → chunk-BPYMC7SU.js} +4 -48
- package/dist/chunk-BPYMC7SU.js.map +1 -0
- package/dist/chunk-BU6RJPPJ.js +421 -0
- package/dist/chunk-BU6RJPPJ.js.map +1 -0
- package/dist/{chunk-FB2HBNIC.js → chunk-BX6EUYHU.js} +6 -2
- package/dist/chunk-BX6EUYHU.js.map +1 -0
- package/dist/chunk-CHTAWXC2.js +18 -0
- package/dist/chunk-CHTAWXC2.js.map +1 -0
- package/dist/chunk-D4VP2QPR.js +16 -0
- package/dist/chunk-D4VP2QPR.js.map +1 -0
- package/dist/{chunk-YXG2SGQ3.js → chunk-DHAD2O3S.js} +6 -6
- package/dist/chunk-DHAD2O3S.js.map +1 -0
- package/dist/chunk-DOI4G4X3.js +428 -0
- package/dist/chunk-DOI4G4X3.js.map +1 -0
- package/dist/chunk-E43VJ3E5.js +188 -0
- package/dist/chunk-E43VJ3E5.js.map +1 -0
- package/dist/{chunk-47CINLWF.js → chunk-EDWEYQRG.js} +2 -2
- package/dist/chunk-EVZKNA2W.js +110 -0
- package/dist/chunk-EVZKNA2W.js.map +1 -0
- package/dist/chunk-FD4ZDTQ6.js +181 -0
- package/dist/chunk-FD4ZDTQ6.js.map +1 -0
- package/dist/chunk-FDOOBTXJ.js +17 -0
- package/dist/chunk-FDOOBTXJ.js.map +1 -0
- package/dist/chunk-FH3SQR6P.js +275 -0
- package/dist/chunk-FH3SQR6P.js.map +1 -0
- package/dist/{chunk-T5C46IIU.js → chunk-FMTRNQQ7.js} +28 -269
- package/dist/chunk-FMTRNQQ7.js.map +1 -0
- package/dist/chunk-H53KNS6Q.js +513 -0
- package/dist/chunk-H53KNS6Q.js.map +1 -0
- package/dist/chunk-HJHGTFEJ.js +23 -0
- package/dist/chunk-HJHGTFEJ.js.map +1 -0
- package/dist/{chunk-LXAESF4Y.js → chunk-HK4AZBKX.js} +7 -4
- package/dist/chunk-HK4AZBKX.js.map +1 -0
- package/dist/chunk-IRQGAC4L.js +52 -0
- package/dist/chunk-IRQGAC4L.js.map +1 -0
- package/dist/{chunk-FNTLKHZ7.js → chunk-JDN5SAAD.js} +7 -4
- package/dist/chunk-JDN5SAAD.js.map +1 -0
- package/dist/{chunk-XALU5LCU.js → chunk-JKF25N73.js} +555 -147
- package/dist/chunk-JKF25N73.js.map +1 -0
- package/dist/{chunk-BHOTGS7N.js → chunk-KI4DOTN4.js} +25 -2
- package/dist/chunk-KI4DOTN4.js.map +1 -0
- package/dist/chunk-KOS567NB.js +790 -0
- package/dist/chunk-KOS567NB.js.map +1 -0
- package/dist/{chunk-OOBYPCZC.js → chunk-KTS6G26H.js} +304 -195
- package/dist/chunk-KTS6G26H.js.map +1 -0
- package/dist/{chunk-ZB7D62OA.js → chunk-KUZVRJ7M.js} +3 -3
- package/dist/chunk-L4VFNFDL.js +248 -0
- package/dist/chunk-L4VFNFDL.js.map +1 -0
- package/dist/chunk-M2WC5MF7.js +127 -0
- package/dist/chunk-M2WC5MF7.js.map +1 -0
- package/dist/chunk-N42ZWWOW.js +273 -0
- package/dist/chunk-N42ZWWOW.js.map +1 -0
- package/dist/chunk-OGLS76RN.js +43 -0
- package/dist/chunk-OGLS76RN.js.map +1 -0
- package/dist/{chunk-7LVM22VG.js → chunk-OQCRCXCP.js} +6 -6
- package/dist/chunk-OQCRCXCP.js.map +1 -0
- package/dist/{chunk-OLGPYOLO.js → chunk-P6OS7652.js} +5 -2
- package/dist/chunk-P6OS7652.js.map +1 -0
- package/dist/{chunk-O3JIAU3V.js → chunk-PF3YM6NY.js} +157 -103
- package/dist/chunk-PF3YM6NY.js.map +1 -0
- package/dist/{chunk-NTWNO24W.js → chunk-PLUHPNGA.js} +266 -110
- package/dist/chunk-PLUHPNGA.js.map +1 -0
- package/dist/chunk-Q5L5EGWZ.js +26 -0
- package/dist/chunk-Q5L5EGWZ.js.map +1 -0
- package/dist/{chunk-AATSV4UV.js → chunk-QTHVHNJJ.js} +6 -36
- package/dist/chunk-QTHVHNJJ.js.map +1 -0
- package/dist/{chunk-KD5G3YXI.js → chunk-RARK7JBR.js} +39 -10
- package/dist/chunk-RARK7JBR.js.map +1 -0
- package/dist/chunk-RJJF457I.js +111 -0
- package/dist/chunk-RJJF457I.js.map +1 -0
- package/dist/chunk-RPET332G.js +84 -0
- package/dist/chunk-RPET332G.js.map +1 -0
- package/dist/{chunk-646CA6RV.js → chunk-RQW5YMH7.js} +12 -4
- package/dist/chunk-RQW5YMH7.js.map +1 -0
- package/dist/chunk-U5PWXS3J.js +39 -0
- package/dist/chunk-U5PWXS3J.js.map +1 -0
- package/dist/{chunk-RWNSW4FM.js → chunk-UMNXCU3K.js} +12 -6
- package/dist/{chunk-RWNSW4FM.js.map → chunk-UMNXCU3K.js.map} +1 -1
- package/dist/{chunk-DS5MCU2X.js → chunk-URCXSUI3.js} +9 -9
- package/dist/chunk-VI7ZANB3.js +193 -0
- package/dist/chunk-VI7ZANB3.js.map +1 -0
- package/dist/chunk-VQPHPQ5L.js +14 -0
- package/dist/chunk-VQPHPQ5L.js.map +1 -0
- package/dist/chunk-WNJTJRM6.js +147 -0
- package/dist/chunk-WNJTJRM6.js.map +1 -0
- package/dist/{chunk-BMHS4WAN.js → chunk-XS7EX55U.js} +156 -42
- package/dist/chunk-XS7EX55U.js.map +1 -0
- package/dist/chunk-YN4W7LCX.js +31 -0
- package/dist/chunk-YN4W7LCX.js.map +1 -0
- package/dist/chunk-YSJOZEI6.js +1 -0
- package/dist/{chunk-JA2ZAT5Q.js → chunk-Z4PJMZLM.js} +2 -2
- package/dist/chunk-Z4PJMZLM.js.map +1 -0
- package/dist/{chunk-WSXNGF7X.js → chunk-ZNZISJDZ.js} +6 -2
- package/dist/chunk-ZNZISJDZ.js.map +1 -0
- package/dist/chunk-ZWN3AODA.js +11 -0
- package/dist/chunk-ZWN3AODA.js.map +1 -0
- package/dist/cli/index.js +25 -10
- package/dist/cli/index.js.map +1 -1
- package/dist/client/core.d.ts +1 -1
- package/dist/client/core.js +2 -0
- package/dist/client/core.js.map +1 -1
- package/dist/client/index.d.ts +44 -10
- package/dist/client/index.js +35 -0
- package/dist/client/index.js.map +1 -1
- package/dist/cloudflare-SIG42OIW.js +335 -0
- package/dist/cloudflare-SIG42OIW.js.map +1 -0
- package/dist/config-support-WQHQIJTA.js +104 -0
- package/dist/config-support-WQHQIJTA.js.map +1 -0
- package/dist/{csrf-BBrEZSBW.d.ts → csrf-Dgot9qSM.d.ts} +1 -1
- package/dist/deno-deploy-LQAYOOPW.js +196 -0
- package/dist/deno-deploy-LQAYOOPW.js.map +1 -0
- package/dist/{dev-CDFPXISP.js → dev-3UQVD2W6.js} +29 -18
- package/dist/dev-3UQVD2W6.js.map +1 -0
- package/dist/{dev-emit-GWD6IXV7.js → dev-emit-BFNMDCPB.js} +5 -5
- package/dist/{dev-emit-NBT6JD7R.js → dev-emit-MVAJAFGX.js} +5 -3
- package/dist/dev-emit-MVAJAFGX.js.map +1 -0
- package/dist/engine-singleton-X4R7AZBJ.js +315 -0
- package/dist/engine-singleton-X4R7AZBJ.js.map +1 -0
- package/dist/{generate-Y3GWM57K.js → generate-EN6EDITF.js} +43 -4
- package/dist/generate-EN6EDITF.js.map +1 -0
- package/dist/index-DctfHtv-.d.ts +1058 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.js +25 -13
- package/dist/index.js.map +1 -1
- package/dist/{info-QXZW722N.js → info-Y55RWS42.js} +8 -6
- package/dist/{info-QXZW722N.js.map → info-Y55RWS42.js.map} +1 -1
- package/dist/{internal-api-FBK2YXSI.js → internal-api-4X6NDS2F.js} +23 -12
- package/dist/{internal-api-ZCJWJ5EC.js → internal-api-XQHU5JKY.js} +31 -16
- package/dist/internal-api-XQHU5JKY.js.map +1 -0
- package/dist/load-config-4ATXQUN3.js +16 -0
- package/dist/match-DmGgxjIU.d.ts +44 -0
- package/dist/{mcp-KTYP4ZON.js → mcp-IQRHFP3Y.js} +7 -7
- package/dist/netlify-C2IRCZKI.js +245 -0
- package/dist/netlify-C2IRCZKI.js.map +1 -0
- package/dist/node-OSVPYQ3D.js +10 -0
- package/dist/nonce-BXt7Qu_C.d.ts +31 -0
- package/dist/observability-bootstrap-LERYDHKY.js +16 -0
- package/dist/{openapi-OUXNB2F2.js → openapi-VFPEZSRI.js} +13 -11
- package/dist/{openapi-OUXNB2F2.js.map → openapi-VFPEZSRI.js.map} +1 -1
- package/dist/{plugin-runner-DHVr1cC5.d.ts → plugin-runner-BVMOSxvb.d.ts} +1 -1
- package/dist/{plugin-types-4VN1GMqV.d.ts → plugin-types-BUVfUQ0V.d.ts} +1 -1
- package/dist/preview-BT47VMIB.js +23 -0
- package/dist/preview-BT47VMIB.js.map +1 -0
- package/dist/provider-resolver-Dx6QuWrw.d.ts +128 -0
- package/dist/registry-KBZDCFVQ.js +23 -0
- package/dist/route-config-Cm_ZMA1C.d.ts +72 -0
- package/dist/route-policy-BxOycCDq.d.ts +65 -0
- package/dist/router/element-scroll-restoration.d.ts +28 -0
- package/dist/router/element-scroll-restoration.js +96 -0
- package/dist/router/element-scroll-restoration.js.map +1 -0
- package/dist/{routes-NJR4ISCT.js → routes-BPLU3ISV.js} +11 -9
- package/dist/{routes-NJR4ISCT.js.map → routes-BPLU3ISV.js.map} +1 -1
- package/dist/{scan-7MJC6PYU.js → scan-YJEE4KQK.js} +2 -2
- package/dist/{schema-DNIT7JQX.js → schema-SOAD43RQ.js} +7 -5
- package/dist/schemas-4AXHQMV3.js +25 -0
- package/dist/schemas-4AXHQMV3.js.map +1 -0
- package/dist/security-headers-Ccj7ncNx.d.ts +129 -0
- package/dist/server/agent/index.d.ts +2 -105
- package/dist/server/agent/index.js +1 -1
- package/dist/server/auth/index.d.ts +2 -21
- package/dist/server/auth/index.js +3 -2
- package/dist/server/cron/index.js +4 -3
- package/dist/server/define/index.d.ts +43 -57
- package/dist/server/define/index.js +10 -1
- package/dist/server/http/index.d.ts +7 -5
- package/dist/server/http/index.js +57 -12
- package/dist/server/index.d.ts +47 -439
- package/dist/server/index.js +120 -201
- package/dist/server/index.js.map +1 -1
- package/dist/server/jobs/index.js +4 -3
- package/dist/server/observability/index.d.ts +109 -35
- package/dist/server/observability/index.js +11 -7
- package/dist/server/plugins/index.d.ts +3 -3
- package/dist/server/scan/index.d.ts +47 -12
- package/dist/server/scan/index.js +13 -4
- package/dist/server/security/index.d.ts +61 -103
- package/dist/server/security/index.js +15 -6
- package/dist/server/webhook/index.d.ts +90 -3
- package/dist/server/webhook/index.js +12 -2
- package/dist/server-boundary-2WFT546S.js +149 -0
- package/dist/server-boundary-2WFT546S.js.map +1 -0
- package/dist/server-boundary-A67OPRKO.js +134 -0
- package/dist/server-boundary-A67OPRKO.js.map +1 -0
- package/dist/{services-typed-client-P4JERLBL.js → services-typed-client-XGT5SUUN.js} +2 -2
- package/dist/{start-25OV2CAK.js → start-3K3C4Z2X.js} +224 -161
- package/dist/start-3K3C4Z2X.js.map +1 -0
- package/dist/{static-RTO637XW.js → static-SVDWIOXJ.js} +24 -13
- package/dist/static-SVDWIOXJ.js.map +1 -0
- package/dist/{theo-cloud-UZ3GINRU.js → theo-cloud-3ET4G5T6.js} +9 -2
- package/dist/theo-cloud-3ET4G5T6.js.map +1 -0
- package/dist/vercel-BMCQKCWE.js +277 -0
- package/dist/vercel-BMCQKCWE.js.map +1 -0
- package/dist/vite-plugin/index.js +25 -13
- package/dist/vite-plugin-USXUIV3H.js +43 -0
- package/dist/vite-plugin-USXUIV3H.js.map +1 -0
- package/package.json +19 -6
- package/dist/actions-virtual-module-E4PISKMB.js.map +0 -1
- package/dist/agent-XAQCUQNB.js +0 -15
- package/dist/app-typed-client-HLP26EYM.js.map +0 -1
- package/dist/app-typed-client-I4X2UJWW.js.map +0 -1
- package/dist/aws-lambda-KES4MFJV.js +0 -172
- package/dist/aws-lambda-KES4MFJV.js.map +0 -1
- package/dist/body-parser-web-4Z2QTPDU.js.map +0 -1
- package/dist/body-parser-web-TIOTXPDW.js.map +0 -1
- package/dist/build-F2Q5QTSC.js.map +0 -1
- package/dist/bun-A5B2MJMO.js.map +0 -1
- package/dist/chunk-646CA6RV.js.map +0 -1
- package/dist/chunk-7LVM22VG.js.map +0 -1
- package/dist/chunk-A7JBF5FO.js.map +0 -1
- package/dist/chunk-AATSV4UV.js.map +0 -1
- package/dist/chunk-AM3QABW5.js +0 -161
- package/dist/chunk-AM3QABW5.js.map +0 -1
- package/dist/chunk-AXKUA57G.js +0 -94
- package/dist/chunk-AXKUA57G.js.map +0 -1
- package/dist/chunk-BHOTGS7N.js.map +0 -1
- package/dist/chunk-BMHS4WAN.js.map +0 -1
- package/dist/chunk-CMYSHZFT.js +0 -422
- package/dist/chunk-CMYSHZFT.js.map +0 -1
- package/dist/chunk-DQIPV7L5.js +0 -118
- package/dist/chunk-DQIPV7L5.js.map +0 -1
- package/dist/chunk-FB2HBNIC.js.map +0 -1
- package/dist/chunk-FNTLKHZ7.js.map +0 -1
- package/dist/chunk-FTFN4MYN.js.map +0 -1
- package/dist/chunk-HBU2GIMZ.js.map +0 -1
- package/dist/chunk-IEES3CHD.js.map +0 -1
- package/dist/chunk-JA2ZAT5Q.js.map +0 -1
- package/dist/chunk-KD5G3YXI.js.map +0 -1
- package/dist/chunk-KTKTHIUF.js +0 -405
- package/dist/chunk-KTKTHIUF.js.map +0 -1
- package/dist/chunk-LNVMHQ2Z.js +0 -54
- package/dist/chunk-LNVMHQ2Z.js.map +0 -1
- package/dist/chunk-LXAESF4Y.js.map +0 -1
- package/dist/chunk-MTEWLGVY.js.map +0 -1
- package/dist/chunk-NTWNO24W.js.map +0 -1
- package/dist/chunk-O3JIAU3V.js.map +0 -1
- package/dist/chunk-OLGPYOLO.js.map +0 -1
- package/dist/chunk-OOBYPCZC.js.map +0 -1
- package/dist/chunk-T5C46IIU.js.map +0 -1
- package/dist/chunk-U267AOWS.js +0 -28
- package/dist/chunk-U267AOWS.js.map +0 -1
- package/dist/chunk-UW2TEAGR.js +0 -77
- package/dist/chunk-UW2TEAGR.js.map +0 -1
- package/dist/chunk-WPJOTQA5.js +0 -1
- package/dist/chunk-WSXNGF7X.js.map +0 -1
- package/dist/chunk-WYHYOYRH.js.map +0 -1
- package/dist/chunk-XALU5LCU.js.map +0 -1
- package/dist/chunk-XR74JD4M.js +0 -457
- package/dist/chunk-XR74JD4M.js.map +0 -1
- package/dist/chunk-YGAXV5HR.js.map +0 -1
- package/dist/chunk-YXG2SGQ3.js.map +0 -1
- package/dist/cloudflare-IN2WB7FZ.js +0 -122
- package/dist/cloudflare-IN2WB7FZ.js.map +0 -1
- package/dist/deno-deploy-LYXQEJ6A.js +0 -107
- package/dist/deno-deploy-LYXQEJ6A.js.map +0 -1
- package/dist/dev-CDFPXISP.js.map +0 -1
- package/dist/dev-emit-NBT6JD7R.js.map +0 -1
- package/dist/generate-Y3GWM57K.js.map +0 -1
- package/dist/index-D_PxPXgQ.d.ts +0 -575
- package/dist/load-config-FIWNKOJO.js +0 -14
- package/dist/match-CfbEFRG4.d.ts +0 -26
- package/dist/netlify-DLEOCFAD.js +0 -150
- package/dist/netlify-DLEOCFAD.js.map +0 -1
- package/dist/node-QXYSUWQ4.js +0 -10
- package/dist/registry-S7OMF3OS.js +0 -23
- package/dist/start-25OV2CAK.js.map +0 -1
- package/dist/static-RTO637XW.js.map +0 -1
- package/dist/theo-cloud-UZ3GINRU.js.map +0 -1
- package/dist/vercel-6D6EZUVD.js +0 -133
- package/dist/vercel-6D6EZUVD.js.map +0 -1
- package/dist/vite-plugin-RJFKLF2U.js +0 -36
- /package/dist/{chunk-WPJOTQA5.js.map → adapters/agent-mount.js.map} +0 -0
- /package/dist/{agent-XAQCUQNB.js.map → agent-7IPEVCAY.js.map} +0 -0
- /package/dist/{check-45NKUVSQ.js.map → check-GIPZBFTX.js.map} +0 -0
- /package/dist/{chunk-47CINLWF.js.map → chunk-EDWEYQRG.js.map} +0 -0
- /package/dist/{chunk-ZB7D62OA.js.map → chunk-KUZVRJ7M.js.map} +0 -0
- /package/dist/{chunk-DS5MCU2X.js.map → chunk-URCXSUI3.js.map} +0 -0
- /package/dist/{internal-api-ZCJWJ5EC.js.map → chunk-YSJOZEI6.js.map} +0 -0
- /package/dist/{dev-emit-GWD6IXV7.js.map → dev-emit-BFNMDCPB.js.map} +0 -0
- /package/dist/{internal-api-FBK2YXSI.js.map → internal-api-4X6NDS2F.js.map} +0 -0
- /package/dist/{load-config-FIWNKOJO.js.map → load-config-4ATXQUN3.js.map} +0 -0
- /package/dist/{mcp-KTYP4ZON.js.map → mcp-IQRHFP3Y.js.map} +0 -0
- /package/dist/{node-QXYSUWQ4.js.map → node-OSVPYQ3D.js.map} +0 -0
- /package/dist/{scan-7MJC6PYU.js.map → observability-bootstrap-LERYDHKY.js.map} +0 -0
- /package/dist/{registry-S7OMF3OS.js.map → registry-KBZDCFVQ.js.map} +0 -0
- /package/dist/{schema-DNIT7JQX.js.map → scan-YJEE4KQK.js.map} +0 -0
- /package/dist/{vite-plugin-RJFKLF2U.js.map → schema-SOAD43RQ.js.map} +0 -0
- /package/dist/{services-typed-client-P4JERLBL.js.map → services-typed-client-XGT5SUUN.js.map} +0 -0
package/dist/server/index.js
CHANGED
|
@@ -8,15 +8,24 @@ import {
|
|
|
8
8
|
BodyTooLargeError,
|
|
9
9
|
DEFAULT_MAX_BODY_BYTES,
|
|
10
10
|
defineWebhook,
|
|
11
|
+
discord,
|
|
11
12
|
dispatchWebhook,
|
|
13
|
+
github,
|
|
12
14
|
readRawBody,
|
|
15
|
+
slack,
|
|
16
|
+
stripe,
|
|
17
|
+
telegram,
|
|
13
18
|
timingSafeEqual
|
|
14
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-BU6RJPPJ.js";
|
|
15
20
|
import {
|
|
16
21
|
MAX_ERROR_HTML_BYTES,
|
|
22
|
+
ProcedureInputError,
|
|
23
|
+
ProcedureOutputError,
|
|
24
|
+
callProcedure,
|
|
25
|
+
createOpenApiHandler,
|
|
17
26
|
loadCustomErrorPages,
|
|
18
27
|
serveStaticFile
|
|
19
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-N42ZWWOW.js";
|
|
20
29
|
import {
|
|
21
30
|
DuplicateJobNameError,
|
|
22
31
|
InMemoryJobBackend,
|
|
@@ -28,18 +37,10 @@ import {
|
|
|
28
37
|
defineJob,
|
|
29
38
|
scanJobs,
|
|
30
39
|
writeJobManifest
|
|
31
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-JDN5SAAD.js";
|
|
32
41
|
import {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
NoopSpan,
|
|
36
|
-
SpanImpl,
|
|
37
|
-
TheoCloudObservabilityAdapter,
|
|
38
|
-
createObservabilityPlugin,
|
|
39
|
-
defineObservabilityAdapter,
|
|
40
|
-
resolveAdapter,
|
|
41
|
-
serializeSpansToOtlp
|
|
42
|
-
} from "../chunk-O3JIAU3V.js";
|
|
42
|
+
defineObservabilityAdapter
|
|
43
|
+
} from "../chunk-HJHGTFEJ.js";
|
|
43
44
|
import "../chunk-GUBN5UTT.js";
|
|
44
45
|
import {
|
|
45
46
|
createRouteRateLimiter,
|
|
@@ -52,31 +53,33 @@ import {
|
|
|
52
53
|
ChannelManager
|
|
53
54
|
} from "../chunk-4PBJ266F.js";
|
|
54
55
|
import "../chunk-7IHWXDJJ.js";
|
|
55
|
-
import
|
|
56
|
+
import {
|
|
57
|
+
evaluateCsrfMultiHeaderRequest,
|
|
58
|
+
isCsrfOriginAllowed,
|
|
59
|
+
matchWildcardDomain
|
|
60
|
+
} from "../chunk-WNJTJRM6.js";
|
|
56
61
|
import {
|
|
57
62
|
_resetEnvCache,
|
|
58
|
-
|
|
63
|
+
loadEnv
|
|
64
|
+
} from "../chunk-4X6H2BXP.js";
|
|
65
|
+
import {
|
|
59
66
|
jsonTransformer,
|
|
60
|
-
loadEnv,
|
|
61
67
|
resolveTransformer,
|
|
62
|
-
superjsonTransformer
|
|
63
|
-
|
|
64
|
-
} from "../chunk-XR74JD4M.js";
|
|
68
|
+
superjsonTransformer
|
|
69
|
+
} from "../chunk-OGLS76RN.js";
|
|
65
70
|
import {
|
|
66
71
|
ActionError,
|
|
67
72
|
ActionInputError,
|
|
68
73
|
BATCH_PATH,
|
|
69
74
|
BatchPathConflictError,
|
|
70
75
|
STRIPPED_HEADERS,
|
|
71
|
-
TRACE_HEADER,
|
|
72
|
-
TRACE_PARENT_HEADER,
|
|
73
76
|
_resetMiddlewareCacheForTests,
|
|
74
77
|
createCorsHandler,
|
|
75
78
|
createCorsWebHandler,
|
|
79
|
+
createServerContext,
|
|
76
80
|
executeAction,
|
|
77
81
|
executeRoute,
|
|
78
|
-
|
|
79
|
-
extractTraceIdFromRequest,
|
|
82
|
+
executeWebRequest,
|
|
80
83
|
extractUniversalIssues,
|
|
81
84
|
handleBatchRequest,
|
|
82
85
|
handleRequestError,
|
|
@@ -84,11 +87,11 @@ import {
|
|
|
84
87
|
isActionError,
|
|
85
88
|
isInputError,
|
|
86
89
|
matchesOrigin,
|
|
87
|
-
parseTraceparent,
|
|
88
90
|
runMiddlewareAndContext,
|
|
89
91
|
sendError,
|
|
90
|
-
sendJson
|
|
91
|
-
|
|
92
|
+
sendJson,
|
|
93
|
+
validateRouteInput
|
|
94
|
+
} from "../chunk-JKF25N73.js";
|
|
92
95
|
import {
|
|
93
96
|
DuplicateContextKeyError,
|
|
94
97
|
createOutbox,
|
|
@@ -99,14 +102,32 @@ import {
|
|
|
99
102
|
findSuggestion,
|
|
100
103
|
levenshtein
|
|
101
104
|
} from "../chunk-NTDN54XO.js";
|
|
105
|
+
import {
|
|
106
|
+
ConsoleObservabilityAdapter,
|
|
107
|
+
NoopObservabilityAdapter,
|
|
108
|
+
NoopSpan,
|
|
109
|
+
SpanImpl,
|
|
110
|
+
TheoCloudObservabilityAdapter,
|
|
111
|
+
createObservabilityPlugin,
|
|
112
|
+
resolveAdapter,
|
|
113
|
+
serializeSpansToOtlp
|
|
114
|
+
} from "../chunk-PF3YM6NY.js";
|
|
102
115
|
import {
|
|
103
116
|
FileTooLargeError,
|
|
117
|
+
TRACE_HEADER,
|
|
118
|
+
TRACE_PARENT_HEADER,
|
|
104
119
|
_resetWarnOnceForTests,
|
|
105
120
|
createLogger,
|
|
121
|
+
extractTraceId,
|
|
122
|
+
extractTraceIdFromRequest,
|
|
123
|
+
extractW3CTraceContext,
|
|
106
124
|
logRequest,
|
|
107
125
|
parseRequestBody,
|
|
126
|
+
parseTraceparent,
|
|
127
|
+
parseTraceparentContext,
|
|
108
128
|
warnOnce
|
|
109
|
-
} from "../chunk-
|
|
129
|
+
} from "../chunk-DOI4G4X3.js";
|
|
130
|
+
import "../chunk-CHTAWXC2.js";
|
|
110
131
|
import {
|
|
111
132
|
DuplicateDecorationError,
|
|
112
133
|
DuplicatePluginError,
|
|
@@ -122,9 +143,12 @@ import {
|
|
|
122
143
|
import {
|
|
123
144
|
createProductionLoader,
|
|
124
145
|
createViteLoader
|
|
125
|
-
} from "../chunk-
|
|
146
|
+
} from "../chunk-OQCRCXCP.js";
|
|
126
147
|
import {
|
|
148
|
+
ACTION_SCHEMAS_DIR,
|
|
127
149
|
ActionScanError,
|
|
150
|
+
_resetRouteScanCacheForTests,
|
|
151
|
+
compareRouteSpecificity,
|
|
128
152
|
compilePattern,
|
|
129
153
|
generateManifest,
|
|
130
154
|
loadManifest,
|
|
@@ -134,27 +158,30 @@ import {
|
|
|
134
158
|
scanServerRoutes,
|
|
135
159
|
scanWebSocketRoutes,
|
|
136
160
|
writeManifest
|
|
137
|
-
} from "../chunk-
|
|
161
|
+
} from "../chunk-6J4JWHDJ.js";
|
|
138
162
|
import "../chunk-DV34VG3N.js";
|
|
163
|
+
import "../chunk-L4VFNFDL.js";
|
|
139
164
|
import {
|
|
140
165
|
scanMiddlewares
|
|
141
|
-
} from "../chunk-
|
|
166
|
+
} from "../chunk-BX6EUYHU.js";
|
|
142
167
|
import {
|
|
143
168
|
CSP_REPORT_PATH,
|
|
144
169
|
CSRF_READINESS_PATH,
|
|
145
170
|
CSRF_READINESS_RESET_PATH,
|
|
146
171
|
CsrfReadinessStore,
|
|
147
|
-
DEFAULT_CSP,
|
|
148
|
-
DEFAULT_PERMISSIONS_POLICY,
|
|
149
172
|
applySecurityHeaders,
|
|
150
|
-
buildSecurityHeaders,
|
|
151
173
|
handleCspReport,
|
|
152
174
|
handleCspReportRequest,
|
|
153
175
|
handleCsrfReadiness,
|
|
154
176
|
handleCsrfReadinessRequest,
|
|
155
177
|
normalizeLegacy,
|
|
156
178
|
normalizeNew
|
|
157
|
-
} from "../chunk-
|
|
179
|
+
} from "../chunk-BPYMC7SU.js";
|
|
180
|
+
import {
|
|
181
|
+
DEFAULT_CSP,
|
|
182
|
+
DEFAULT_PERMISSIONS_POLICY,
|
|
183
|
+
buildSecurityHeaders
|
|
184
|
+
} from "../chunk-IRQGAC4L.js";
|
|
158
185
|
import {
|
|
159
186
|
CSRF_WARN_CODE,
|
|
160
187
|
CSRF_WARN_DOCS_URL,
|
|
@@ -162,7 +189,7 @@ import {
|
|
|
162
189
|
matchDisallowed,
|
|
163
190
|
validateCsrf,
|
|
164
191
|
validateCsrfRequest
|
|
165
|
-
} from "../chunk-
|
|
192
|
+
} from "../chunk-P6OS7652.js";
|
|
166
193
|
import {
|
|
167
194
|
JsonStdoutSink,
|
|
168
195
|
createNoOpLogger,
|
|
@@ -204,7 +231,7 @@ import {
|
|
|
204
231
|
resetProviderRegistry,
|
|
205
232
|
resolveProvider,
|
|
206
233
|
tryResolveProvider
|
|
207
|
-
} from "../chunk-
|
|
234
|
+
} from "../chunk-3PBAN2YE.js";
|
|
208
235
|
import {
|
|
209
236
|
AuthRequiredError,
|
|
210
237
|
_resetKeyCacheForTests,
|
|
@@ -230,7 +257,7 @@ import {
|
|
|
230
257
|
verifyBackupCode,
|
|
231
258
|
verifyOAuthState,
|
|
232
259
|
verifyTotp
|
|
233
|
-
} from "../chunk-
|
|
260
|
+
} from "../chunk-RQW5YMH7.js";
|
|
234
261
|
import {
|
|
235
262
|
appendCookieToHeaders,
|
|
236
263
|
appendDeleteCookieToHeaders,
|
|
@@ -241,9 +268,10 @@ import {
|
|
|
241
268
|
serializeCookie,
|
|
242
269
|
setCookie
|
|
243
270
|
} from "../chunk-4FWBKX6G.js";
|
|
271
|
+
import "../chunk-YSJOZEI6.js";
|
|
244
272
|
import {
|
|
245
273
|
generateNonce
|
|
246
|
-
} from "../chunk-
|
|
274
|
+
} from "../chunk-Z4PJMZLM.js";
|
|
247
275
|
import {
|
|
248
276
|
InMemoryUsageStorage,
|
|
249
277
|
InMemoryUsageStorage2,
|
|
@@ -266,11 +294,12 @@ import {
|
|
|
266
294
|
translateCronToVercel,
|
|
267
295
|
validateCronSchedule,
|
|
268
296
|
writeCronManifest
|
|
269
|
-
} from "../chunk-
|
|
297
|
+
} from "../chunk-HK4AZBKX.js";
|
|
270
298
|
import "../chunk-VZTYCAO6.js";
|
|
271
|
-
import "../chunk-
|
|
299
|
+
import "../chunk-UMNXCU3K.js";
|
|
272
300
|
import "../chunk-52PDWL5S.js";
|
|
273
|
-
import "../chunk-
|
|
301
|
+
import "../chunk-5K4TDLRG.js";
|
|
302
|
+
import "../chunk-ZWN3AODA.js";
|
|
274
303
|
import {
|
|
275
304
|
action,
|
|
276
305
|
defineChannel,
|
|
@@ -281,7 +310,13 @@ import {
|
|
|
281
310
|
tool,
|
|
282
311
|
uiMessageStreamResponse,
|
|
283
312
|
websocket
|
|
284
|
-
} from "../chunk-
|
|
313
|
+
} from "../chunk-DHAD2O3S.js";
|
|
314
|
+
import "../chunk-D4VP2QPR.js";
|
|
315
|
+
import {
|
|
316
|
+
evaluateRoutePolicy,
|
|
317
|
+
requireOwner,
|
|
318
|
+
subjectFromContext
|
|
319
|
+
} from "../chunk-YN4W7LCX.js";
|
|
285
320
|
import {
|
|
286
321
|
HEALTH_PATH,
|
|
287
322
|
READY_PATH,
|
|
@@ -294,98 +329,6 @@ import {
|
|
|
294
329
|
} from "../chunk-SAFGDIPQ.js";
|
|
295
330
|
import "../chunk-XTHN6JBX.js";
|
|
296
331
|
|
|
297
|
-
// src/server/openapi/serve-docs.ts
|
|
298
|
-
import { existsSync, readFileSync, statSync } from "fs";
|
|
299
|
-
import { resolve } from "path";
|
|
300
|
-
var MAX_SPEC_BYTES = 10 * 1024 * 1024;
|
|
301
|
-
var DEFAULT_CDN = "https://cdn.jsdelivr.net/npm/@scalar/api-reference";
|
|
302
|
-
function createOpenApiHandler(opts = {}) {
|
|
303
|
-
const docsPath = opts.docsPath ?? "/api/docs";
|
|
304
|
-
const jsonPath = opts.openapiJsonPath ?? "/api/docs/openapi.json";
|
|
305
|
-
const rawSpecFile = opts.specFilePath ?? ".theokit/openapi.json";
|
|
306
|
-
const title = opts.pageTitle ?? "API Reference";
|
|
307
|
-
const cdn = opts.cdnUrl ?? DEFAULT_CDN;
|
|
308
|
-
if (hasDotDotSegment(rawSpecFile)) {
|
|
309
|
-
throw new Error(`[theokit:openapi] specFilePath must not contain ".." segments: ${rawSpecFile}`);
|
|
310
|
-
}
|
|
311
|
-
const specFile = resolve(rawSpecFile);
|
|
312
|
-
return (request) => {
|
|
313
|
-
if (request.method !== "GET") return null;
|
|
314
|
-
const url = new URL(request.url);
|
|
315
|
-
if (url.pathname === docsPath) {
|
|
316
|
-
const cdnHost = new URL(cdn).host;
|
|
317
|
-
return new Response(renderScalarHtml(title, jsonPath, cdn), {
|
|
318
|
-
status: 200,
|
|
319
|
-
headers: {
|
|
320
|
-
"content-type": "text/html; charset=utf-8",
|
|
321
|
-
"content-security-policy": `script-src 'self' 'unsafe-eval' ${cdnHost}; style-src 'self' 'unsafe-inline'; img-src 'self' data: ${cdnHost}; font-src 'self' data: ${cdnHost}; connect-src 'self' ${cdnHost}`
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
if (url.pathname === jsonPath) {
|
|
326
|
-
return serveSpecFile(specFile);
|
|
327
|
-
}
|
|
328
|
-
return null;
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
function hasDotDotSegment(p) {
|
|
332
|
-
return p.split(/[/\\]/).includes("..");
|
|
333
|
-
}
|
|
334
|
-
function escapeHtml(s) {
|
|
335
|
-
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
336
|
-
}
|
|
337
|
-
function renderScalarHtml(title, specUrl, cdnUrl) {
|
|
338
|
-
return `<!DOCTYPE html>
|
|
339
|
-
<html>
|
|
340
|
-
<head>
|
|
341
|
-
<meta charset="utf-8">
|
|
342
|
-
<title>${escapeHtml(title)}</title>
|
|
343
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
344
|
-
</head>
|
|
345
|
-
<body>
|
|
346
|
-
<script id="api-reference" data-url="${escapeHtml(specUrl)}"></script>
|
|
347
|
-
<script src="${escapeHtml(cdnUrl)}"></script>
|
|
348
|
-
</body>
|
|
349
|
-
</html>`;
|
|
350
|
-
}
|
|
351
|
-
function serveSpecFile(filePath) {
|
|
352
|
-
if (!existsSync(filePath)) {
|
|
353
|
-
return jsonResponse(503, {
|
|
354
|
-
error: {
|
|
355
|
-
code: "OPENAPI_NOT_EMITTED",
|
|
356
|
-
message: "OpenAPI spec not generated yet. Start the dev server and visit a route first."
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
try {
|
|
361
|
-
const stat = statSync(filePath);
|
|
362
|
-
if (stat.size > MAX_SPEC_BYTES) {
|
|
363
|
-
return jsonResponse(413, {
|
|
364
|
-
error: {
|
|
365
|
-
code: "OPENAPI_TOO_LARGE",
|
|
366
|
-
message: `Spec file exceeds ${MAX_SPEC_BYTES / 1024 / 1024}MB limit`
|
|
367
|
-
}
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
const content = readFileSync(filePath, "utf-8");
|
|
371
|
-
return new Response(content, {
|
|
372
|
-
status: 200,
|
|
373
|
-
headers: { "content-type": "application/json", "cache-control": "no-cache" }
|
|
374
|
-
});
|
|
375
|
-
} catch (err) {
|
|
376
|
-
const message = err instanceof Error ? err.message : "Failed to read OpenAPI spec file";
|
|
377
|
-
return jsonResponse(500, {
|
|
378
|
-
error: { code: "OPENAPI_READ_FAILED", message }
|
|
379
|
-
});
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
function jsonResponse(status, body) {
|
|
383
|
-
return new Response(JSON.stringify(body), {
|
|
384
|
-
status,
|
|
385
|
-
headers: { "content-type": "application/json" }
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
|
|
389
332
|
// src/cache/constants.ts
|
|
390
333
|
var CACHE_TAG_MAX_LENGTH = 256;
|
|
391
334
|
var CACHE_TAG_MAX_ITEMS = 128;
|
|
@@ -592,9 +535,12 @@ var variesCookieWarnedRoutes = /* @__PURE__ */ new WeakSet();
|
|
|
592
535
|
var oversizedWarnedRoutes = /* @__PURE__ */ new WeakSet();
|
|
593
536
|
function defineCachedRoute(engine, config) {
|
|
594
537
|
const { cache, handler, ...rest } = config;
|
|
595
|
-
const
|
|
596
|
-
const
|
|
597
|
-
|
|
538
|
+
const defaults = engine.defaults;
|
|
539
|
+
const maxAge = validateMaxAge(cache.maxAge ?? defaults.maxAge, "defineCachedRoute");
|
|
540
|
+
const swr = validateExpire(cache.swr ?? defaults.swr, maxAge, "defineCachedRoute");
|
|
541
|
+
const cacheVersion = cache.cacheVersion ?? defaults.cacheVersion;
|
|
542
|
+
const cacheErrors = cache.cacheErrors ?? defaults.cacheErrors ?? false;
|
|
543
|
+
if (cacheVersion === "") {
|
|
598
544
|
throw new Error("defineCachedRoute: cacheVersion must be non-empty if provided");
|
|
599
545
|
}
|
|
600
546
|
const maxEntrySize = cache.maxEntrySize ?? DEFAULT_MAX_ENTRY_SIZE;
|
|
@@ -632,7 +578,7 @@ function defineCachedRoute(engine, config) {
|
|
|
632
578
|
getKey: cache.getKey
|
|
633
579
|
});
|
|
634
580
|
const cached = await engine.tryReadCached(key, {
|
|
635
|
-
cacheVersion
|
|
581
|
+
cacheVersion
|
|
636
582
|
});
|
|
637
583
|
const routeCacheCtx = {
|
|
638
584
|
engine,
|
|
@@ -642,6 +588,8 @@ function defineCachedRoute(engine, config) {
|
|
|
642
588
|
maxEntrySize,
|
|
643
589
|
maxAge,
|
|
644
590
|
swr,
|
|
591
|
+
cacheVersion,
|
|
592
|
+
cacheErrors,
|
|
645
593
|
baseTags,
|
|
646
594
|
webRequest
|
|
647
595
|
};
|
|
@@ -670,16 +618,11 @@ function buildRouteCacheEntry(value, ctx) {
|
|
|
670
618
|
maxAge: ctx.maxAge,
|
|
671
619
|
swr: ctx.swr ?? ctx.maxAge * 60,
|
|
672
620
|
tags: [...ctx.baseTags, pathTag],
|
|
673
|
-
cacheVersion: ctx.
|
|
621
|
+
cacheVersion: ctx.cacheVersion
|
|
674
622
|
};
|
|
675
623
|
}
|
|
676
624
|
async function persistAndReturn(ctx, response) {
|
|
677
|
-
const cacheableResult = await tryCacheResponse(
|
|
678
|
-
response,
|
|
679
|
-
ctx.cache,
|
|
680
|
-
ctx.routeConfig,
|
|
681
|
-
ctx.maxEntrySize
|
|
682
|
-
);
|
|
625
|
+
const cacheableResult = await tryCacheResponse(response, ctx);
|
|
683
626
|
if (!cacheableResult) {
|
|
684
627
|
return response;
|
|
685
628
|
}
|
|
@@ -690,7 +633,7 @@ function scheduleRouteRevalidate(ctx, handler, handlerCtx) {
|
|
|
690
633
|
void (async () => {
|
|
691
634
|
try {
|
|
692
635
|
const response = await invokeHandlerAsResponse(handler, handlerCtx);
|
|
693
|
-
const result = await tryCacheResponse(response, ctx
|
|
636
|
+
const result = await tryCacheResponse(response, ctx);
|
|
694
637
|
if (!result) return;
|
|
695
638
|
await ctx.engine.set(ctx.key, buildRouteCacheEntry(result, ctx));
|
|
696
639
|
} catch {
|
|
@@ -724,7 +667,8 @@ async function invokeHandlerAsResponse(handler, ctx) {
|
|
|
724
667
|
if (raw instanceof Response) return raw;
|
|
725
668
|
return Response.json(raw);
|
|
726
669
|
}
|
|
727
|
-
async function tryCacheResponse(response,
|
|
670
|
+
async function tryCacheResponse(response, ctx) {
|
|
671
|
+
const { cache, routeConfig, maxEntrySize } = ctx;
|
|
728
672
|
if (response.headers.has("set-cookie")) {
|
|
729
673
|
if (!setCookieWarnedRoutes.has(routeConfig)) {
|
|
730
674
|
setCookieWarnedRoutes.add(routeConfig);
|
|
@@ -737,7 +681,7 @@ async function tryCacheResponse(response, cache, routeConfig, maxEntrySize) {
|
|
|
737
681
|
if (response.headers.get("transfer-encoding")?.toLowerCase() === "chunked") {
|
|
738
682
|
return void 0;
|
|
739
683
|
}
|
|
740
|
-
if (response.status >= 400 && !
|
|
684
|
+
if (response.status >= 400 && !ctx.cacheErrors) return void 0;
|
|
741
685
|
if (cache.cacheable && !cache.cacheable(response)) return void 0;
|
|
742
686
|
const text = await response.clone().text();
|
|
743
687
|
if (text.length > maxEntrySize) {
|
|
@@ -756,23 +700,23 @@ async function tryCacheResponse(response, cache, routeConfig, maxEntrySize) {
|
|
|
756
700
|
});
|
|
757
701
|
return { body: text, status: response.status, headers };
|
|
758
702
|
}
|
|
703
|
+
function toCacheStatusHeader(status) {
|
|
704
|
+
if (status === "hit") return "HIT";
|
|
705
|
+
if (status === "stale") return "STALE";
|
|
706
|
+
return "MISS";
|
|
707
|
+
}
|
|
759
708
|
function buildResponseFromCache(value, status, maxAge, swr) {
|
|
760
709
|
const headers = new Headers(value.headers);
|
|
761
710
|
if (!headers.has("cache-control")) {
|
|
762
711
|
headers.set("cache-control", getCacheControlHeader({ maxAge, swr: swr ?? maxAge * 60 }));
|
|
763
712
|
}
|
|
764
|
-
|
|
765
|
-
let cacheStatusHeader = "MISS";
|
|
766
|
-
if (status === "hit") cacheStatusHeader = "HIT";
|
|
767
|
-
else if (status === "stale") cacheStatusHeader = "STALE";
|
|
768
|
-
headers.set("X-Theo-Cache", cacheStatusHeader);
|
|
769
|
-
}
|
|
713
|
+
headers.set("X-Theo-Cache", toCacheStatusHeader(status));
|
|
770
714
|
return new Response(value.body, { status: value.status, headers });
|
|
771
715
|
}
|
|
772
716
|
|
|
773
717
|
// src/cache/cache-engine.ts
|
|
774
718
|
function createCacheEngine(opts) {
|
|
775
|
-
const { storage, onError } = opts;
|
|
719
|
+
const { storage, defaults = {}, onError } = opts;
|
|
776
720
|
const inFlight = /* @__PURE__ */ new Map();
|
|
777
721
|
const bgInFlight = /* @__PURE__ */ new Set();
|
|
778
722
|
const undefinedLoaderWarned = /* @__PURE__ */ new Set();
|
|
@@ -796,8 +740,8 @@ function createCacheEngine(opts) {
|
|
|
796
740
|
function claimAndRun(key, fn, options, skipWrite) {
|
|
797
741
|
let resolveOuter;
|
|
798
742
|
let rejectOuter;
|
|
799
|
-
const outerPromise = new Promise((
|
|
800
|
-
resolveOuter =
|
|
743
|
+
const outerPromise = new Promise((resolve, reject) => {
|
|
744
|
+
resolveOuter = resolve;
|
|
801
745
|
rejectOuter = reject;
|
|
802
746
|
});
|
|
803
747
|
void outerPromise.catch(() => {
|
|
@@ -872,14 +816,12 @@ function createCacheEngine(opts) {
|
|
|
872
816
|
if (skipWrite) return value;
|
|
873
817
|
if (options.skipCacheWhen?.(value)) return value;
|
|
874
818
|
if (options.validate) {
|
|
875
|
-
let isValid = true;
|
|
876
819
|
try {
|
|
877
|
-
|
|
820
|
+
if (!options.validate(value)) return value;
|
|
878
821
|
} catch (err) {
|
|
879
822
|
onError?.(err, { phase: "set", key });
|
|
880
823
|
return value;
|
|
881
824
|
}
|
|
882
|
-
if (!isValid) return value;
|
|
883
825
|
}
|
|
884
826
|
if (value === void 0) {
|
|
885
827
|
if (!undefinedLoaderWarned.has(key)) {
|
|
@@ -916,6 +858,7 @@ function createCacheEngine(opts) {
|
|
|
916
858
|
}
|
|
917
859
|
return {
|
|
918
860
|
storage,
|
|
861
|
+
defaults,
|
|
919
862
|
getOrCompute,
|
|
920
863
|
async tryReadCached(key, opts2) {
|
|
921
864
|
const result = await tryReadCached(key, {
|
|
@@ -1135,47 +1078,6 @@ function deserializeResponse(serialized) {
|
|
|
1135
1078
|
return superjson.deserialize(serialized);
|
|
1136
1079
|
}
|
|
1137
1080
|
|
|
1138
|
-
// src/server/http/in-process-caller.ts
|
|
1139
|
-
var ProcedureInputError = class extends Error {
|
|
1140
|
-
channel;
|
|
1141
|
-
issues;
|
|
1142
|
-
constructor(channel, error) {
|
|
1143
|
-
super(`Invalid ${channel} for in-process procedure call: ${error.message}`);
|
|
1144
|
-
this.name = "ProcedureInputError";
|
|
1145
|
-
this.channel = channel;
|
|
1146
|
-
this.issues = error.issues;
|
|
1147
|
-
}
|
|
1148
|
-
};
|
|
1149
|
-
var ProcedureOutputError = class extends Error {
|
|
1150
|
-
issues;
|
|
1151
|
-
constructor(error) {
|
|
1152
|
-
super(`In-process procedure output failed its response schema: ${error.message}`);
|
|
1153
|
-
this.name = "ProcedureOutputError";
|
|
1154
|
-
this.issues = error.issues;
|
|
1155
|
-
}
|
|
1156
|
-
};
|
|
1157
|
-
function inProcessRequest() {
|
|
1158
|
-
return new Request("theo://in-process/procedure", { method: "POST" });
|
|
1159
|
-
}
|
|
1160
|
-
async function callProcedure(config, input = {}, ctx) {
|
|
1161
|
-
const validated = validateRouteInput(config, input);
|
|
1162
|
-
if (!validated.ok) throw new ProcedureInputError(validated.channel, validated.error);
|
|
1163
|
-
const result = await config.handler({
|
|
1164
|
-
query: validated.query,
|
|
1165
|
-
body: validated.body,
|
|
1166
|
-
params: validated.params,
|
|
1167
|
-
request: inProcessRequest(),
|
|
1168
|
-
ctx
|
|
1169
|
-
});
|
|
1170
|
-
const responseSchema = config.response;
|
|
1171
|
-
if (responseSchema !== void 0 && !(result instanceof Response)) {
|
|
1172
|
-
const parsed = responseSchema.safeParse(result);
|
|
1173
|
-
if (!parsed.success) throw new ProcedureOutputError(parsed.error);
|
|
1174
|
-
return parsed.data;
|
|
1175
|
-
}
|
|
1176
|
-
return result;
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
1081
|
// src/server/http/ctx-reconciliation.ts
|
|
1180
1082
|
var CTX_WRITERS = {
|
|
1181
1083
|
/** Writer 1 — user `context.ts` factory. THE typed surface (`TCtx`). execute.ts:131 */
|
|
@@ -1210,6 +1112,7 @@ if (typeof globalThis !== "undefined") {
|
|
|
1210
1112
|
}
|
|
1211
1113
|
}
|
|
1212
1114
|
export {
|
|
1115
|
+
ACTION_SCHEMAS_DIR,
|
|
1213
1116
|
ActionError,
|
|
1214
1117
|
ActionInputError,
|
|
1215
1118
|
ActionScanError,
|
|
@@ -1283,6 +1186,7 @@ export {
|
|
|
1283
1186
|
_resetEnvCache,
|
|
1284
1187
|
_resetKeyCacheForTests,
|
|
1285
1188
|
_resetMiddlewareCacheForTests,
|
|
1189
|
+
_resetRouteScanCacheForTests,
|
|
1286
1190
|
_resetWarnOnceForTests,
|
|
1287
1191
|
action,
|
|
1288
1192
|
appendCookieToHeaders,
|
|
@@ -1297,6 +1201,7 @@ export {
|
|
|
1297
1201
|
callProcedure,
|
|
1298
1202
|
checkThrottle,
|
|
1299
1203
|
clearOidcCache,
|
|
1204
|
+
compareRouteSpecificity,
|
|
1300
1205
|
compilePattern,
|
|
1301
1206
|
compileRouteRules,
|
|
1302
1207
|
composeInstructions,
|
|
@@ -1322,6 +1227,7 @@ export {
|
|
|
1322
1227
|
createRateLimiterWeb,
|
|
1323
1228
|
createRouteRateLimiter,
|
|
1324
1229
|
createRouteRateLimiterWeb,
|
|
1230
|
+
createServerContext,
|
|
1325
1231
|
createSessionManager,
|
|
1326
1232
|
createSessionManagerWeb,
|
|
1327
1233
|
createVendorAgentTool,
|
|
@@ -1344,12 +1250,15 @@ export {
|
|
|
1344
1250
|
deriveKey,
|
|
1345
1251
|
deriveKeyFromRequest,
|
|
1346
1252
|
deserializeResponse,
|
|
1253
|
+
discord,
|
|
1347
1254
|
discoverOidcProvider,
|
|
1348
1255
|
dispatchWebhook,
|
|
1349
1256
|
effectiveContextWindow,
|
|
1350
1257
|
encrypt,
|
|
1351
1258
|
enforceCsrf,
|
|
1352
1259
|
envelopeCodeToStatus,
|
|
1260
|
+
evaluateCsrfMultiHeaderRequest,
|
|
1261
|
+
evaluateRoutePolicy,
|
|
1353
1262
|
executeAction,
|
|
1354
1263
|
executeRoute,
|
|
1355
1264
|
executeWebRequest,
|
|
@@ -1357,6 +1266,7 @@ export {
|
|
|
1357
1266
|
extractTraceId,
|
|
1358
1267
|
extractTraceIdFromRequest,
|
|
1359
1268
|
extractUniversalIssues,
|
|
1269
|
+
extractW3CTraceContext,
|
|
1360
1270
|
findSuggestion,
|
|
1361
1271
|
fromUnknown,
|
|
1362
1272
|
frontmatterValue,
|
|
@@ -1372,6 +1282,7 @@ export {
|
|
|
1372
1282
|
getCookie,
|
|
1373
1283
|
getCookieFromRequest,
|
|
1374
1284
|
getStorageManager,
|
|
1285
|
+
github,
|
|
1375
1286
|
handleBatchRequest,
|
|
1376
1287
|
handleChannelWebhook,
|
|
1377
1288
|
handleCspReport,
|
|
@@ -1384,6 +1295,7 @@ export {
|
|
|
1384
1295
|
initCacheEngine,
|
|
1385
1296
|
isActionError,
|
|
1386
1297
|
isChannelPath,
|
|
1298
|
+
isCsrfOriginAllowed,
|
|
1387
1299
|
isInputError,
|
|
1388
1300
|
jsonTransformer,
|
|
1389
1301
|
levenshtein,
|
|
@@ -1397,6 +1309,7 @@ export {
|
|
|
1397
1309
|
matchDisallowed,
|
|
1398
1310
|
matchRoute,
|
|
1399
1311
|
matchRoutePattern,
|
|
1312
|
+
matchWildcardDomain,
|
|
1400
1313
|
matchesOrigin,
|
|
1401
1314
|
middleware,
|
|
1402
1315
|
normalizeLegacy,
|
|
@@ -1405,6 +1318,7 @@ export {
|
|
|
1405
1318
|
parseCookieHeader,
|
|
1406
1319
|
parseRequestBody,
|
|
1407
1320
|
parseTraceparent,
|
|
1321
|
+
parseTraceparentContext,
|
|
1408
1322
|
pkceChallengeFromVerifier,
|
|
1409
1323
|
plugin,
|
|
1410
1324
|
readAppResource,
|
|
@@ -1412,6 +1326,7 @@ export {
|
|
|
1412
1326
|
recordAttempt,
|
|
1413
1327
|
registerProvider,
|
|
1414
1328
|
requireAuth,
|
|
1329
|
+
requireOwner,
|
|
1415
1330
|
resetProviderRegistry,
|
|
1416
1331
|
resolveAdapter,
|
|
1417
1332
|
resolveProvider,
|
|
@@ -1442,9 +1357,13 @@ export {
|
|
|
1442
1357
|
serveStaticFile,
|
|
1443
1358
|
serverErrorToEnvelope,
|
|
1444
1359
|
setCookie,
|
|
1360
|
+
slack,
|
|
1445
1361
|
splitFrontmatter,
|
|
1446
1362
|
streamAgentTurnInProcess,
|
|
1363
|
+
stripe,
|
|
1364
|
+
subjectFromContext,
|
|
1447
1365
|
superjsonTransformer,
|
|
1366
|
+
telegram,
|
|
1448
1367
|
timingSafeEqual,
|
|
1449
1368
|
tool,
|
|
1450
1369
|
totpUri,
|