theokit 0.4.0-beta.0 → 0.5.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.
- package/dist/{actions-virtual-module-HWNTIEPI.js → actions-virtual-module-IY46EEEX.js} +2 -2
- package/dist/{actions-virtual-module-SEIPACG5.js → actions-virtual-module-XNHDNCZ6.js} +2 -2
- package/dist/add-2ZFFGGE4.js +0 -0
- package/dist/{app-typed-client-ITIYTBXO.js → app-typed-client-OUJO3V5J.js} +10 -5
- package/dist/{app-typed-client-62FYBLVJ.js.map → app-typed-client-OUJO3V5J.js.map} +1 -1
- package/dist/{app-typed-client-62FYBLVJ.js → app-typed-client-YOMWSA3F.js} +11 -6
- package/dist/{app-typed-client-ITIYTBXO.js.map → app-typed-client-YOMWSA3F.js.map} +1 -1
- package/dist/audit-log-BQWM5YLG.d.ts +60 -0
- package/dist/{aws-lambda-XYCGZH3I.js → aws-lambda-GKSTX6HD.js} +3 -3
- package/dist/body-parser-web-MUWBKZ3F.js +70 -0
- package/dist/body-parser-web-MUWBKZ3F.js.map +1 -0
- package/dist/broadcast-QOQGUNNK.js +0 -0
- package/dist/{build-HIGHJQQV.js → build-D4J7XECU.js} +31 -22
- package/dist/build-D4J7XECU.js.map +1 -0
- package/dist/build-request-body-preview-II2235E6.js +0 -0
- package/dist/{bun-K73TQEWC.js → bun-ISHSNFIO.js} +3 -3
- package/dist/{check-PZR67OY5.js → check-NXYPLM6M.js} +2 -2
- package/dist/{chunk-WZ7CPVQB.js → chunk-27LWMYNK.js} +28 -24
- package/dist/chunk-27LWMYNK.js.map +1 -0
- package/dist/{chunk-BIGBFZSU.js → chunk-2F4FROEQ.js} +1689 -1521
- package/dist/chunk-2F4FROEQ.js.map +1 -0
- package/dist/chunk-4HBI7DHP.js +20 -0
- package/dist/chunk-4HBI7DHP.js.map +1 -0
- package/dist/{chunk-X4JAX2U3.js → chunk-4S2UCILN.js} +180 -125
- package/dist/chunk-4S2UCILN.js.map +1 -0
- package/dist/{chunk-C52GSJPF.js → chunk-4S6YHNG2.js} +11 -8
- package/dist/chunk-4S6YHNG2.js.map +1 -0
- package/dist/chunk-5ODOE6EF.js +0 -0
- package/dist/{chunk-KJVEJILQ.js → chunk-5PU65T5W.js} +9 -3
- package/dist/chunk-5PU65T5W.js.map +1 -0
- package/dist/chunk-5QW7IQQU.js +36 -0
- package/dist/chunk-5QW7IQQU.js.map +1 -0
- package/dist/chunk-5Z2727GV.js +1324 -0
- package/dist/chunk-5Z2727GV.js.map +1 -0
- package/dist/{chunk-YLBSSEHX.js → chunk-6NEXVBPY.js} +5 -15
- package/dist/chunk-6NEXVBPY.js.map +1 -0
- package/dist/chunk-7MQOHNHE.js +36 -0
- package/dist/chunk-7MQOHNHE.js.map +1 -0
- package/dist/{chunk-TPCT3MXV.js → chunk-ABVITXFH.js} +405 -272
- package/dist/chunk-ABVITXFH.js.map +1 -0
- package/dist/chunk-ASDXVRJD.js +185 -0
- package/dist/chunk-ASDXVRJD.js.map +1 -0
- package/dist/chunk-B3L3TJVF.js +406 -0
- package/dist/chunk-B3L3TJVF.js.map +1 -0
- package/dist/{chunk-PB4GR7EP.js → chunk-C3ZZ56YZ.js} +1 -18
- package/dist/chunk-C3ZZ56YZ.js.map +1 -0
- package/dist/{chunk-O7335ZGH.js → chunk-CG563V5M.js} +5 -3
- package/dist/chunk-CG563V5M.js.map +1 -0
- package/dist/{chunk-5OFPQK6N.js → chunk-COXLEZCN.js} +2 -1
- package/dist/chunk-COXLEZCN.js.map +1 -0
- package/dist/{chunk-O4BLVPML.js → chunk-DNMSV3R3.js} +22 -28
- package/dist/chunk-DNMSV3R3.js.map +1 -0
- package/dist/chunk-E3JH6YUM.js +1 -0
- package/dist/chunk-ESC54TAK.js +220 -0
- package/dist/chunk-ESC54TAK.js.map +1 -0
- package/dist/chunk-FI7MPTJW.js +77 -0
- package/dist/chunk-FI7MPTJW.js.map +1 -0
- package/dist/chunk-H4J2LECY.js +201 -0
- package/dist/chunk-H4J2LECY.js.map +1 -0
- package/dist/chunk-IAJ2JVEH.js +256 -0
- package/dist/chunk-IAJ2JVEH.js.map +1 -0
- package/dist/{chunk-F3TG5FJV.js → chunk-IEZCAT2I.js} +7 -1
- package/dist/{chunk-F3TG5FJV.js.map → chunk-IEZCAT2I.js.map} +1 -1
- package/dist/chunk-JHEAWR3L.js +1 -0
- package/dist/chunk-JQSKBMXP.js +17 -0
- package/dist/chunk-JQSKBMXP.js.map +1 -0
- package/dist/{chunk-4QTKSLTO.js → chunk-K4M64WD6.js} +9 -5
- package/dist/{chunk-4QTKSLTO.js.map → chunk-K4M64WD6.js.map} +1 -1
- package/dist/chunk-KI7OWQUX.js +293 -0
- package/dist/chunk-KI7OWQUX.js.map +1 -0
- package/dist/chunk-KT3MWNZG.js +0 -0
- package/dist/{chunk-ZJW5FFYJ.js → chunk-LC5PYNJP.js} +2 -2
- package/dist/{chunk-JAAHOGKI.js → chunk-M2EY7KDR.js} +1223 -1124
- package/dist/chunk-M2EY7KDR.js.map +1 -0
- package/dist/{chunk-2VQKDRVF.js → chunk-MR7OLIC6.js} +3 -3
- package/dist/chunk-NM4WF3XD.js +63 -0
- package/dist/chunk-NM4WF3XD.js.map +1 -0
- package/dist/chunk-NPMCKOX4.js +1 -0
- package/dist/{chunk-VRHXOKRP.js → chunk-NZXH2LQQ.js} +86 -83
- package/dist/chunk-NZXH2LQQ.js.map +1 -0
- package/dist/{chunk-B6RP57M3.js → chunk-OLPB36O2.js} +4 -4
- package/dist/chunk-PIVX3DYW.js +142 -0
- package/dist/chunk-PIVX3DYW.js.map +1 -0
- package/dist/{chunk-7TOMTMHT.js → chunk-R7OC6UDK.js} +2 -1
- package/dist/chunk-R7OC6UDK.js.map +1 -0
- package/dist/chunk-RESN62GB.js +269 -0
- package/dist/chunk-RESN62GB.js.map +1 -0
- package/dist/{chunk-64JI5LTO.js → chunk-RMU7EBRO.js} +2 -2
- package/dist/chunk-RMU7EBRO.js.map +1 -0
- package/dist/chunk-TQYSPYKU.js +131 -0
- package/dist/chunk-TQYSPYKU.js.map +1 -0
- package/dist/chunk-TSLSIRBR.js +107 -0
- package/dist/chunk-TSLSIRBR.js.map +1 -0
- package/dist/{chunk-XP7YXRHO.js → chunk-U6TPSW4L.js} +37 -5
- package/dist/chunk-U6TPSW4L.js.map +1 -0
- package/dist/chunk-UD3LFGDL.js +45 -0
- package/dist/chunk-UD3LFGDL.js.map +1 -0
- package/dist/chunk-UUFYP2UM.js +161 -0
- package/dist/chunk-UUFYP2UM.js.map +1 -0
- package/dist/{chunk-OXIQI2XZ.js → chunk-VBZCVFSA.js} +2 -2
- package/dist/chunk-VMEWD57H.js +137 -0
- package/dist/chunk-VMEWD57H.js.map +1 -0
- package/dist/{chunk-TRH2L3FI.js → chunk-WEGALZEU.js} +3 -3
- package/dist/{chunk-ZOXNJV2O.js → chunk-WGHJD6I7.js} +35 -138
- package/dist/chunk-WGHJD6I7.js.map +1 -0
- package/dist/chunk-XMS5VRIK.js +0 -0
- package/dist/chunk-Y4H3JNVK.js +18 -0
- package/dist/chunk-Y4H3JNVK.js.map +1 -0
- package/dist/chunk-Z5IGLBWE.js +329 -0
- package/dist/chunk-Z5IGLBWE.js.map +1 -0
- package/dist/chunk-ZEGYW52B.js +26 -0
- package/dist/chunk-ZEGYW52B.js.map +1 -0
- package/dist/chunk-ZJQ4O76G.js +87 -0
- package/dist/chunk-ZJQ4O76G.js.map +1 -0
- package/dist/cli/index.js +32 -21
- package/dist/cli/index.js.map +1 -1
- package/dist/client/index.d.ts +107 -1
- package/dist/client/index.js +152 -6
- package/dist/client/index.js.map +1 -1
- package/dist/{cloudflare-LCAOTRYZ.js → cloudflare-OJGJ7R2D.js} +3 -3
- package/dist/configure-agent-registry-6YGTJYBC.js +0 -0
- package/dist/cookies-MJKMGJ7N.js +22 -0
- package/dist/csrf-BBrEZSBW.d.ts +107 -0
- package/dist/csrf-readiness-store-CjIoub3U.d.ts +43 -0
- package/dist/define-websocket-CdK94O-D.d.ts +64 -0
- package/dist/{deno-deploy-ZN4RE5HF.js → deno-deploy-BHWKFTOW.js} +3 -3
- package/dist/{dev-266MVCVA.js → dev-MJVSRZGF.js} +11 -11
- package/dist/{dev-emit-RBSFZZNO.js → dev-emit-5VPRCHOD.js} +39 -142
- package/dist/dev-emit-5VPRCHOD.js.map +1 -0
- package/dist/{dev-emit-NO6OZJOQ.js → dev-emit-HHP2XJXE.js} +5 -5
- package/dist/devtools/entry.js +185 -131
- package/dist/devtools/entry.js.map +1 -1
- package/dist/{dispatcher-AQJGI3HU.js → dispatcher-63LBXYLE.js} +2 -2
- package/dist/{dispatcher-E6QV32BO.js → dispatcher-EJME6C6M.js} +5 -2
- package/dist/dispatcher-EJME6C6M.js.map +1 -0
- package/dist/{dist-5V77Z223.js → dist-KRW6OVD4.js} +7 -7
- package/dist/dist-KRW6OVD4.js.map +1 -0
- package/dist/docker-EZDA5FT7.js +0 -0
- package/dist/error-envelope-BsNzzAV5.d.ts +62 -0
- package/dist/{generate-DT4IIAHF.js → generate-AZ2K6Z2Z.js} +75 -2
- package/dist/generate-AZ2K6Z2Z.js.map +1 -0
- package/dist/index-DWWEdFh5.d.ts +399 -0
- package/dist/index.d.ts +161 -1391
- package/dist/index.js +20 -8
- package/dist/index.js.map +1 -1
- package/dist/{info-FJ4NXKTB.js → info-47VB62MV.js} +5 -5
- package/dist/job-backend-CgC8Xf33.d.ts +68 -0
- package/dist/{lib-NL5JXGEB.js → lib-NST3PNZX.js} +31 -31
- package/dist/lib-NST3PNZX.js.map +1 -0
- package/dist/module-loader-Cfz7dgCP.d.ts +26 -0
- package/dist/{netlify-5VQ22Z2P.js → netlify-GSNSJGMN.js} +3 -3
- package/dist/{node-3APTLGWB.js → node-6I5B6RL3.js} +3 -3
- package/dist/node-6I5B6RL3.js.map +1 -0
- package/dist/{openapi-FNVSWZOL.js → openapi-NFLSNNVQ.js} +10 -10
- package/dist/plugin-runner-BGBkzgi0.d.ts +95 -0
- package/dist/plugin-types-DNJGxr4Z.d.ts +79 -0
- package/dist/{proper-lockfile-4Y3DP3RP.js → proper-lockfile-MVKMQGFK.js} +27 -27
- package/dist/proper-lockfile-MVKMQGFK.js.map +1 -0
- package/dist/rate-limit-BdNDZ3vt.d.ts +58 -0
- package/dist/registry-QHEZ3BWB.js +25 -0
- package/dist/router-RGZFX75G.js +0 -0
- package/dist/{routes-H4SPLFHJ.js → routes-3A4XGIEJ.js} +6 -6
- package/dist/{scan-C2BOKLSY.js → scan-NQFI5S7P.js} +2 -2
- package/dist/scan-NQFI5S7P.js.map +1 -0
- package/dist/schema-D3v8VB7o.d.ts +76 -0
- package/dist/{schema-VR6YNVLQ.js → schema-KZVOV333.js} +5 -3
- package/dist/schema-KZVOV333.js.map +1 -0
- package/dist/server/agent/index.d.ts +229 -0
- package/dist/server/agent/index.js +16 -0
- package/dist/server/agent/index.js.map +1 -0
- package/dist/server/auth/index.d.ts +46 -1
- package/dist/server/auth/index.js +10 -3
- package/dist/server/cost/index.d.ts +1 -3
- package/dist/server/cost/index.js +1 -1
- package/dist/server/cron/index.js +4 -2
- package/dist/server/define/index.d.ts +281 -0
- package/dist/server/define/index.js +26 -0
- package/dist/server/define/index.js.map +1 -0
- package/dist/server/http/index.d.ts +10 -0
- package/dist/server/http/index.js +74 -0
- package/dist/server/http/index.js.map +1 -0
- package/dist/server/index.d.ts +151 -1677
- package/dist/server/index.js +558 -1102
- package/dist/server/index.js.map +1 -1
- package/dist/server/jobs/index.d.ts +348 -2
- package/dist/server/jobs/index.js +5 -3
- package/dist/server/observability/index.d.ts +324 -0
- package/dist/server/observability/index.js +48 -0
- package/dist/server/observability/index.js.map +1 -0
- package/dist/server/plugins/index.d.ts +17 -0
- package/dist/server/plugins/index.js +17 -0
- package/dist/server/plugins/index.js.map +1 -0
- package/dist/server/rate-limit/index.d.ts +105 -0
- package/dist/server/rate-limit/index.js +25 -0
- package/dist/server/rate-limit/index.js.map +1 -0
- package/dist/server/realtime/index.d.ts +15 -0
- package/dist/server/realtime/index.js +8 -0
- package/dist/server/realtime/index.js.map +1 -0
- package/dist/server/scan/index.d.ts +106 -0
- package/dist/server/scan/index.js +43 -0
- package/dist/server/scan/index.js.map +1 -0
- package/dist/server/security/index.d.ts +193 -0
- package/dist/server/security/index.js +50 -0
- package/dist/server/security/index.js.map +1 -0
- package/dist/server/storage/index.d.ts +22 -0
- package/dist/server/storage/index.js +14 -0
- package/dist/server/storage/index.js.map +1 -0
- package/dist/server/webhook/index.d.ts +148 -0
- package/dist/server/webhook/index.js +19 -0
- package/dist/server/webhook/index.js.map +1 -0
- package/dist/server-error-to-envelope-NO4CCAFQ.js +8 -0
- package/dist/server-error-to-envelope-NO4CCAFQ.js.map +1 -0
- package/dist/server-error-to-envelope-UJK6OWDJ.js +134 -0
- package/dist/server-error-to-envelope-UJK6OWDJ.js.map +1 -0
- package/dist/server-routes-hmr-GZJGPWMS.js +0 -0
- package/dist/services-json-Z2QNGVPW.js +142 -0
- package/dist/services-json-Z2QNGVPW.js.map +1 -0
- package/dist/{services-typed-client-XWYYBWGW.js → services-typed-client-KK6RHRDG.js} +2 -2
- package/dist/{services-typed-client-ZX5JUHH3.js → services-typed-client-T7M5VPBP.js} +2 -2
- package/dist/{sqlite-vec-ARPNUBWT.js → sqlite-vec-54KB4RD3.js} +2 -2
- package/dist/sqlite-vec-54KB4RD3.js.map +1 -0
- package/dist/{start-HX3QUSOS.js → start-CGSZPBAG.js} +23 -23
- package/dist/start-CGSZPBAG.js.map +1 -0
- package/dist/{static-TZBVBDTB.js → static-QI5NQT2X.js} +6 -6
- package/dist/storage-manager-C4jsO0Tp.d.ts +89 -0
- package/dist/storage-manager-D5KBXXKB.js +0 -0
- package/dist/{storage-types-DtIVejC1.d.ts → storage-types-DsDTCPbp.d.ts} +1 -1
- package/dist/{theo-cloud-3K4DGB3S.js → theo-cloud-RSQCBNXL.js} +4 -4
- package/dist/theo-cloud-RSQCBNXL.js.map +1 -0
- package/dist/upgrade-readiness-GUJBCJIS.js +0 -0
- package/dist/{vercel-MWW24ABC.js → vercel-TKPZK62A.js} +3 -3
- package/dist/vite-plugin/index.d.ts +3 -1
- package/dist/vite-plugin/index.js +20 -8
- package/dist/{vite-plugin-IK3NOWXS.js → vite-plugin-CR4JDFUQ.js} +9 -9
- package/dist/vite-plugin-CR4JDFUQ.js.map +1 -0
- package/package.json +61 -9
- package/LICENSE +0 -201
- package/dist/build-HIGHJQQV.js.map +0 -1
- package/dist/chunk-5OFPQK6N.js.map +0 -1
- package/dist/chunk-64JI5LTO.js.map +0 -1
- package/dist/chunk-7TOMTMHT.js.map +0 -1
- package/dist/chunk-BIGBFZSU.js.map +0 -1
- package/dist/chunk-C52GSJPF.js.map +0 -1
- package/dist/chunk-CZM6WWWS.js +0 -2450
- package/dist/chunk-CZM6WWWS.js.map +0 -1
- package/dist/chunk-JAAHOGKI.js.map +0 -1
- package/dist/chunk-KJVEJILQ.js.map +0 -1
- package/dist/chunk-O4BLVPML.js.map +0 -1
- package/dist/chunk-O7335ZGH.js.map +0 -1
- package/dist/chunk-PB4GR7EP.js.map +0 -1
- package/dist/chunk-TPCT3MXV.js.map +0 -1
- package/dist/chunk-VRHXOKRP.js.map +0 -1
- package/dist/chunk-WZ7CPVQB.js.map +0 -1
- package/dist/chunk-X4JAX2U3.js.map +0 -1
- package/dist/chunk-XP7YXRHO.js.map +0 -1
- package/dist/chunk-YLBSSEHX.js.map +0 -1
- package/dist/chunk-ZOXNJV2O.js.map +0 -1
- package/dist/dev-emit-RBSFZZNO.js.map +0 -1
- package/dist/dispatcher-E6QV32BO.js.map +0 -1
- package/dist/dist-5V77Z223.js.map +0 -1
- package/dist/generate-DT4IIAHF.js.map +0 -1
- package/dist/index-li83Swxa.d.ts +0 -506
- package/dist/lib-NL5JXGEB.js.map +0 -1
- package/dist/proper-lockfile-4Y3DP3RP.js.map +0 -1
- package/dist/registry-4MZ26TZD.js +0 -25
- package/dist/schema-CjVly9c_.d.ts +0 -274
- package/dist/sqlite-vec-ARPNUBWT.js.map +0 -1
- package/dist/start-HX3QUSOS.js.map +0 -1
- package/dist/theo-cloud-3K4DGB3S.js.map +0 -1
- /package/dist/{actions-virtual-module-HWNTIEPI.js.map → actions-virtual-module-IY46EEEX.js.map} +0 -0
- /package/dist/{actions-virtual-module-SEIPACG5.js.map → actions-virtual-module-XNHDNCZ6.js.map} +0 -0
- /package/dist/{aws-lambda-XYCGZH3I.js.map → aws-lambda-GKSTX6HD.js.map} +0 -0
- /package/dist/{bun-K73TQEWC.js.map → bun-ISHSNFIO.js.map} +0 -0
- /package/dist/{check-PZR67OY5.js.map → check-NXYPLM6M.js.map} +0 -0
- /package/dist/{dispatcher-AQJGI3HU.js.map → chunk-E3JH6YUM.js.map} +0 -0
- /package/dist/{node-3APTLGWB.js.map → chunk-JHEAWR3L.js.map} +0 -0
- /package/dist/{chunk-ZJW5FFYJ.js.map → chunk-LC5PYNJP.js.map} +0 -0
- /package/dist/{chunk-2VQKDRVF.js.map → chunk-MR7OLIC6.js.map} +0 -0
- /package/dist/{scan-C2BOKLSY.js.map → chunk-NPMCKOX4.js.map} +0 -0
- /package/dist/{chunk-B6RP57M3.js.map → chunk-OLPB36O2.js.map} +0 -0
- /package/dist/{chunk-OXIQI2XZ.js.map → chunk-VBZCVFSA.js.map} +0 -0
- /package/dist/{chunk-TRH2L3FI.js.map → chunk-WEGALZEU.js.map} +0 -0
- /package/dist/{cloudflare-LCAOTRYZ.js.map → cloudflare-OJGJ7R2D.js.map} +0 -0
- /package/dist/{schema-VR6YNVLQ.js.map → cookies-MJKMGJ7N.js.map} +0 -0
- /package/dist/{deno-deploy-ZN4RE5HF.js.map → deno-deploy-BHWKFTOW.js.map} +0 -0
- /package/dist/{dev-266MVCVA.js.map → dev-MJVSRZGF.js.map} +0 -0
- /package/dist/{dev-emit-NO6OZJOQ.js.map → dev-emit-HHP2XJXE.js.map} +0 -0
- /package/dist/{vite-plugin-IK3NOWXS.js.map → dispatcher-63LBXYLE.js.map} +0 -0
- /package/dist/{info-FJ4NXKTB.js.map → info-47VB62MV.js.map} +0 -0
- /package/dist/{netlify-5VQ22Z2P.js.map → netlify-GSNSJGMN.js.map} +0 -0
- /package/dist/{openapi-FNVSWZOL.js.map → openapi-NFLSNNVQ.js.map} +0 -0
- /package/dist/{registry-4MZ26TZD.js.map → registry-QHEZ3BWB.js.map} +0 -0
- /package/dist/{routes-H4SPLFHJ.js.map → routes-3A4XGIEJ.js.map} +0 -0
- /package/dist/{services-typed-client-XWYYBWGW.js.map → services-typed-client-KK6RHRDG.js.map} +0 -0
- /package/dist/{services-typed-client-ZX5JUHH3.js.map → services-typed-client-T7M5VPBP.js.map} +0 -0
- /package/dist/{static-TZBVBDTB.js.map → static-QI5NQT2X.js.map} +0 -0
- /package/dist/{vercel-MWW24ABC.js.map → vercel-TKPZK62A.js.map} +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import "tsx/esm";
|
|
3
|
+
import "./chunk-KT3MWNZG.js";
|
|
4
|
+
|
|
5
|
+
// src/adapters/registry.ts
|
|
6
|
+
var adapterRegistry = {
|
|
7
|
+
node: async () => (await import("./node-6I5B6RL3.js")).nodeAdapter,
|
|
8
|
+
vercel: async () => (await import("./vercel-TKPZK62A.js")).vercelAdapter,
|
|
9
|
+
cloudflare: async () => (await import("./cloudflare-OJGJ7R2D.js")).cloudflareAdapter,
|
|
10
|
+
static: async () => (await import("./static-QI5NQT2X.js")).staticAdapter,
|
|
11
|
+
bun: async () => (await import("./bun-ISHSNFIO.js")).bunAdapter,
|
|
12
|
+
"deno-deploy": async () => (await import("./deno-deploy-BHWKFTOW.js")).denoDeployAdapter,
|
|
13
|
+
netlify: async () => (await import("./netlify-GSNSJGMN.js")).netlifyAdapter,
|
|
14
|
+
"aws-lambda": async () => (await import("./aws-lambda-GKSTX6HD.js")).awsLambdaAdapter,
|
|
15
|
+
"theo-cloud": async () => (await import("./theo-cloud-RSQCBNXL.js")).theoCloudAdapter
|
|
16
|
+
};
|
|
17
|
+
async function resolveAdapter(target) {
|
|
18
|
+
const factory = adapterRegistry[target];
|
|
19
|
+
return factory();
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
adapterRegistry,
|
|
23
|
+
resolveAdapter
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=registry-QHEZ3BWB.js.map
|
package/dist/router-RGZFX75G.js
CHANGED
|
File without changes
|
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
} from "./chunk-XMS5VRIK.js";
|
|
6
6
|
import {
|
|
7
7
|
loadConfig
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-U6TPSW4L.js";
|
|
9
|
+
import "./chunk-4S2UCILN.js";
|
|
10
|
+
import "./chunk-27LWMYNK.js";
|
|
11
11
|
import {
|
|
12
12
|
scanServerRoutes,
|
|
13
13
|
scanWebSocketRoutes
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VBZCVFSA.js";
|
|
15
15
|
import {
|
|
16
16
|
scanServerActions
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-COXLEZCN.js";
|
|
18
18
|
import "./chunk-KT3MWNZG.js";
|
|
19
19
|
|
|
20
20
|
// src/cli/commands/routes.ts
|
|
@@ -63,4 +63,4 @@ async function routesCommand() {
|
|
|
63
63
|
export {
|
|
64
64
|
routesCommand
|
|
65
65
|
};
|
|
66
|
-
//# sourceMappingURL=routes-
|
|
66
|
+
//# sourceMappingURL=routes-3A4XGIEJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Wave 2 — Polyglot Services Orchestration (T1.1).
|
|
5
|
+
*
|
|
6
|
+
* Declarative `services: {}` primitive for `theo.config.ts`. Each entry
|
|
7
|
+
* declares an external sidecar process (Python FastAPI / Node Hono) that
|
|
8
|
+
* boots alongside the TheoKit TS app. Empty `services: {}` is the default
|
|
9
|
+
* and preserves Wave 1 behavior (no impact on TS-only apps).
|
|
10
|
+
*
|
|
11
|
+
* See ADRs 0012-0015 + plan: docs/plans/wave-2-polyglot-services-plan.md
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Single service definition. All commands run from `services/<name>/` cwd.
|
|
16
|
+
*
|
|
17
|
+
* EC-4 fix: `proxy` regex requires NON-EMPTY path after `/` (the `+` quantifier)
|
|
18
|
+
* to reject `/` which would catch-all and conflict with TheoKit's own routing.
|
|
19
|
+
*/
|
|
20
|
+
declare const ServiceDefinitionSchema: z.ZodObject<{
|
|
21
|
+
runtime: z.ZodEnum<{
|
|
22
|
+
python: "python";
|
|
23
|
+
node: "node";
|
|
24
|
+
}>;
|
|
25
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
26
|
+
server: "server";
|
|
27
|
+
worker: "worker";
|
|
28
|
+
frontend: "frontend";
|
|
29
|
+
}>>;
|
|
30
|
+
port: z.ZodNumber;
|
|
31
|
+
proxy: z.ZodString;
|
|
32
|
+
dev: z.ZodString;
|
|
33
|
+
build: z.ZodOptional<z.ZodString>;
|
|
34
|
+
start: z.ZodString;
|
|
35
|
+
openapi: z.ZodOptional<z.ZodString>;
|
|
36
|
+
healthcheck: z.ZodDefault<z.ZodString>;
|
|
37
|
+
cors: z.ZodDefault<z.ZodBoolean>;
|
|
38
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
39
|
+
dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
40
|
+
passSetCookie: z.ZodDefault<z.ZodBoolean>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
type ServiceDefinition = z.infer<typeof ServiceDefinitionSchema>;
|
|
43
|
+
type ServicesConfig = Record<string, ServiceDefinition>;
|
|
44
|
+
/**
|
|
45
|
+
* Full services config schema with cross-service refines.
|
|
46
|
+
*
|
|
47
|
+
* EC-1 fix: detect duplicate ports across services.
|
|
48
|
+
* EC-13: empty `dependsOn: []` accepted as no-deps.
|
|
49
|
+
* Self-dep, missing-ref, and cycles rejected via topological check.
|
|
50
|
+
*/
|
|
51
|
+
declare const servicesConfigSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
52
|
+
runtime: z.ZodEnum<{
|
|
53
|
+
python: "python";
|
|
54
|
+
node: "node";
|
|
55
|
+
}>;
|
|
56
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
57
|
+
server: "server";
|
|
58
|
+
worker: "worker";
|
|
59
|
+
frontend: "frontend";
|
|
60
|
+
}>>;
|
|
61
|
+
port: z.ZodNumber;
|
|
62
|
+
proxy: z.ZodString;
|
|
63
|
+
dev: z.ZodString;
|
|
64
|
+
build: z.ZodOptional<z.ZodString>;
|
|
65
|
+
start: z.ZodString;
|
|
66
|
+
openapi: z.ZodOptional<z.ZodString>;
|
|
67
|
+
healthcheck: z.ZodDefault<z.ZodString>;
|
|
68
|
+
cors: z.ZodDefault<z.ZodBoolean>;
|
|
69
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
70
|
+
dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
71
|
+
passSetCookie: z.ZodDefault<z.ZodBoolean>;
|
|
72
|
+
}, z.core.$strip>>>;
|
|
73
|
+
type ServicesConfigInput = z.input<typeof servicesConfigSchema>;
|
|
74
|
+
type ServicesConfigOutput = z.output<typeof servicesConfigSchema>;
|
|
75
|
+
|
|
76
|
+
export type { ServicesConfig as S, ServiceDefinition as a, ServicesConfigInput as b, ServicesConfigOutput as c };
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
cacheSchema,
|
|
5
5
|
corsSchema,
|
|
6
6
|
disallowedConfigSchema,
|
|
7
|
+
headerSafeString,
|
|
7
8
|
loggingSchema,
|
|
8
9
|
rateLimitSchema,
|
|
9
10
|
securityHeadersSchema,
|
|
@@ -11,13 +12,14 @@ import {
|
|
|
11
12
|
storageSchema,
|
|
12
13
|
theoConfigSchema,
|
|
13
14
|
uploadSchema
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-4S2UCILN.js";
|
|
16
|
+
import "./chunk-27LWMYNK.js";
|
|
16
17
|
import "./chunk-KT3MWNZG.js";
|
|
17
18
|
export {
|
|
18
19
|
cacheSchema,
|
|
19
20
|
corsSchema,
|
|
20
21
|
disallowedConfigSchema,
|
|
22
|
+
headerSafeString,
|
|
21
23
|
loggingSchema,
|
|
22
24
|
rateLimitSchema,
|
|
23
25
|
securityHeadersSchema,
|
|
@@ -26,4 +28,4 @@ export {
|
|
|
26
28
|
theoConfigSchema,
|
|
27
29
|
uploadSchema
|
|
28
30
|
};
|
|
29
|
-
//# sourceMappingURL=schema-
|
|
31
|
+
//# sourceMappingURL=schema-KZVOV333.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { a as AgentErrorEvent, A as AgentEvent } from '../../agent-events-B3KNV9ER.js';
|
|
2
|
+
export { b as AgentMessageEvent, e as AgentRunErrorCode, c as AgentToolCallEvent, d as AgentToolResultEvent } from '../../agent-events-B3KNV9ER.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Item #4 — `streamAgentRun`
|
|
6
|
+
*
|
|
7
|
+
* Adapter that consumes the `@theokit/sdk` `Run.stream()` async generator
|
|
8
|
+
* (SDKMessage variants) and yields TheoKit `AgentEvent`s suitable for SSE
|
|
9
|
+
* via `defineAgentEndpoint`. One line at the consumer side:
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* const run = await agent.send(message)
|
|
13
|
+
* yield* streamAgentRun(run)
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Mapping table (SDK → AgentEvent):
|
|
17
|
+
*
|
|
18
|
+
* | SDK message | AgentEvent yielded |
|
|
19
|
+
* |---|---|
|
|
20
|
+
* | assistant.content[].type==='text' | { type: 'message', content } |
|
|
21
|
+
* | assistant.content[].type==='tool_use'| (none — covered by tool_call below) |
|
|
22
|
+
* | tool_call(status='running') | { type: 'tool_call', name, args, id } |
|
|
23
|
+
* | tool_call(status='completed') | { type: 'tool_result', name, data, id }|
|
|
24
|
+
* | tool_call(status='error') | { type: 'error', message, id } |
|
|
25
|
+
* | run.wait() status==='error' | { type: 'error', message } |
|
|
26
|
+
* | run.wait() status==='cancelled' | (none — cancel ≠ error) |
|
|
27
|
+
* | system / user / thinking / status / | (none — internal SDK telemetry) |
|
|
28
|
+
* | task / request / object_delta | |
|
|
29
|
+
*
|
|
30
|
+
* Abort semantics: when the consumer calls `generator.return()` on the
|
|
31
|
+
* outer `defineAgentEndpoint` generator, `streamAgentRun` exits the
|
|
32
|
+
* `for await` loop and does NOT call `run.wait()`. Cleanup of in-flight
|
|
33
|
+
* SDK resources is the SDK consumer's responsibility (`run.cancel()`).
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Local mirror of the SDK's `Run` interface — only the surfaces we consume.
|
|
37
|
+
* The message contract is minimal (just `{ type: string }`) so the SDK's
|
|
38
|
+
* `SDKMessage` discriminated union IS structurally assignable without any
|
|
39
|
+
* cast at the consumer site (covariant — TS accepts the SDK's typed message
|
|
40
|
+
* as the wider `{ type: string }`). Property access inside `streamAgentRun`
|
|
41
|
+
* narrows via runtime type guards.
|
|
42
|
+
*
|
|
43
|
+
* `import type` from `@theokit/sdk` would couple TheoKit to the SDK at type-
|
|
44
|
+
* resolution time even for consumers who never use the agent surface.
|
|
45
|
+
*/
|
|
46
|
+
interface AgentRunLike {
|
|
47
|
+
stream: () => AsyncIterable<{
|
|
48
|
+
type: string;
|
|
49
|
+
}>;
|
|
50
|
+
wait: () => Promise<AgentRunResult>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Re-exported as a convenience for test fixtures. Production code typically
|
|
54
|
+
* passes an SDK `Run` directly (structural match via `{ type: string }`).
|
|
55
|
+
*/
|
|
56
|
+
type AgentRunStreamMessage = {
|
|
57
|
+
type: 'assistant';
|
|
58
|
+
message: {
|
|
59
|
+
role: 'assistant';
|
|
60
|
+
content: {
|
|
61
|
+
type: string;
|
|
62
|
+
text?: string;
|
|
63
|
+
}[];
|
|
64
|
+
};
|
|
65
|
+
} | {
|
|
66
|
+
type: 'tool_call';
|
|
67
|
+
name: string;
|
|
68
|
+
status: 'running' | 'completed' | 'error';
|
|
69
|
+
args?: unknown;
|
|
70
|
+
result?: unknown;
|
|
71
|
+
call_id: string;
|
|
72
|
+
} | {
|
|
73
|
+
type: string;
|
|
74
|
+
[k: string]: unknown;
|
|
75
|
+
};
|
|
76
|
+
/** Subset of the SDK `RunResult` we consume. */
|
|
77
|
+
interface AgentRunResult {
|
|
78
|
+
status: 'finished' | 'error' | 'cancelled';
|
|
79
|
+
error?: {
|
|
80
|
+
message: string;
|
|
81
|
+
code?: string;
|
|
82
|
+
cause?: unknown;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Map an SDK error to the AgentErrorEvent shape. Pure function — easy to test.
|
|
87
|
+
*
|
|
88
|
+
* Backward compat (D4): non-AgentRunError throws yield only `message` field
|
|
89
|
+
* (legacy shape); discriminated fields stay `undefined`.
|
|
90
|
+
*
|
|
91
|
+
* Return type is the specific `AgentErrorEvent` (not the union) for ergonomic
|
|
92
|
+
* call-site access — `errorToEvent(err).code` works without narrowing.
|
|
93
|
+
*/
|
|
94
|
+
declare function errorToEvent(err: unknown, id?: string): AgentErrorEvent;
|
|
95
|
+
declare function streamAgentRun(run: AgentRunLike): AsyncGenerator<AgentEvent, void, unknown>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Item #5 — `createConversationHistory`
|
|
99
|
+
*
|
|
100
|
+
* Orchestrator that resolves a stable `agentId` from (explicit → session →
|
|
101
|
+
* cookie → fresh UUID), then returns an `@theokit/sdk` `Agent` via
|
|
102
|
+
* `Agent.getOrCreate(agentId, options)`. Conversation turns auto-persist in
|
|
103
|
+
* `<cwd>/.theokit/agents/<agentId>/messages.jsonl` — SDK owns the storage
|
|
104
|
+
* (ADR D1). `MemorySettings` (facts recall layer) is opt-in passthrough via
|
|
105
|
+
* `options.memory` (ADR D2).
|
|
106
|
+
*
|
|
107
|
+
* Security: agentId from cookie/explicit is attacker-controlled. The SDK
|
|
108
|
+
* uses it as a filesystem path component AND we serialize it into Set-Cookie.
|
|
109
|
+
* EC-1 enforces a strict regex `^[a-zA-Z0-9_-]{1,128}$` at every entry point;
|
|
110
|
+
* invalid values fall through (treated as "missing") rather than throw.
|
|
111
|
+
*/
|
|
112
|
+
/**
|
|
113
|
+
* Minimum surface of an SDK Agent that consumers care about post-creation.
|
|
114
|
+
* Structural match — any object with `send` + `dispose` of compatible
|
|
115
|
+
* shape works. `send` returns a `SdkRunLike` (a Run-shaped object) that
|
|
116
|
+
* `streamAgentRun` can consume. Permissive `unknown` for now; consumers
|
|
117
|
+
* who want stricter types can cast to the SDK's own types.
|
|
118
|
+
*
|
|
119
|
+
* **T5.2 (architecture-cleanup) — DP-7 decision: KEEP (Opt B).** The 5 duck-typed
|
|
120
|
+
* mirrors below were flagged as "over-engineered" by the 2026-05-27 architecture
|
|
121
|
+
* review. Decision: KEEP them because `@theokit/sdk` is `devDependency` (not
|
|
122
|
+
* required at runtime for consumers that don't use agent features). Removing
|
|
123
|
+
* the mirrors would force a hard runtime dep on the SDK, breaking consumers
|
|
124
|
+
* who build TheoKit apps without the agent layer.
|
|
125
|
+
*
|
|
126
|
+
* @kept Defensive duck-type. Do NOT replace with direct SDK type imports unless
|
|
127
|
+
* `@theokit/sdk` is promoted from devDependency to dependency. If promoting,
|
|
128
|
+
* ALSO drop the mirrors (Opt A from the architecture-cleanup plan T5.2).
|
|
129
|
+
*/
|
|
130
|
+
interface SdkRunLike {
|
|
131
|
+
stream: () => AsyncIterable<{
|
|
132
|
+
type: string;
|
|
133
|
+
}>;
|
|
134
|
+
wait: () => Promise<{
|
|
135
|
+
status: 'finished' | 'error' | 'cancelled';
|
|
136
|
+
error?: {
|
|
137
|
+
message: string;
|
|
138
|
+
};
|
|
139
|
+
}>;
|
|
140
|
+
}
|
|
141
|
+
interface SdkAgent {
|
|
142
|
+
send: (message: string, options?: unknown) => Promise<SdkRunLike>;
|
|
143
|
+
dispose: () => Promise<void>;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Phase 2 — structural duck-type of `@theokit/sdk`'s `ConversationStorageAdapter`.
|
|
147
|
+
*
|
|
148
|
+
* D2 (decoupling): we mirror the SDK's shape locally rather than hard-import
|
|
149
|
+
* the SDK type. This lets consumers pass any object matching the structural
|
|
150
|
+
* contract (own implementation, SDK's `FileSystemConversationStorage`,
|
|
151
|
+
* `InMemoryConversationStorage`, or a Postgres/Redis recipe).
|
|
152
|
+
*
|
|
153
|
+
* EC-5 (SHOULD TEST — sync drift detection): the SDK type MUST be assignable
|
|
154
|
+
* to this interface AND vice-versa. A contract test asserts both directions.
|
|
155
|
+
*
|
|
156
|
+
* `unknown` for the message payload avoids coupling to the SDK's `SDKMessage`
|
|
157
|
+
* shape. Real consumers cast at the call site if they need stricter types.
|
|
158
|
+
*/
|
|
159
|
+
interface ConversationStorageLike {
|
|
160
|
+
getMessages(conversationId: string): Promise<readonly unknown[]>;
|
|
161
|
+
appendMessage(conversationId: string, message: unknown): Promise<void>;
|
|
162
|
+
deleteConversation(conversationId: string): Promise<void>;
|
|
163
|
+
listConversationIds?(opts?: {
|
|
164
|
+
limit?: number;
|
|
165
|
+
}): Promise<readonly string[] | undefined>;
|
|
166
|
+
dispose?(): Promise<void>;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Minimum surface of `AgentOptions` accepted by `Agent.getOrCreate`. Forward-
|
|
170
|
+
* compatible: callers pass whatever the SDK supports (memory, tools, etc.).
|
|
171
|
+
*
|
|
172
|
+
* Phase 2 adds typed `conversationStorage` slot. The index signature still
|
|
173
|
+
* passes everything else opaquely.
|
|
174
|
+
*/
|
|
175
|
+
interface SdkAgentOptions {
|
|
176
|
+
apiKey?: string;
|
|
177
|
+
model?: {
|
|
178
|
+
id: string;
|
|
179
|
+
};
|
|
180
|
+
tools?: readonly unknown[];
|
|
181
|
+
memory?: Record<string, unknown>;
|
|
182
|
+
/**
|
|
183
|
+
* Phase 2 (Production-Readiness #1) — pluggable conversation persistence.
|
|
184
|
+
* Default (when omitted): SDK falls back to `FileSystemConversationStorage`.
|
|
185
|
+
* Required for serverless / multi-host deploys.
|
|
186
|
+
*/
|
|
187
|
+
conversationStorage?: ConversationStorageLike;
|
|
188
|
+
[key: string]: unknown;
|
|
189
|
+
}
|
|
190
|
+
interface ConversationHistoryArgs {
|
|
191
|
+
/** Request — for reading the conversation cookie. */
|
|
192
|
+
request: Request | {
|
|
193
|
+
headers?: {
|
|
194
|
+
cookie?: string;
|
|
195
|
+
} | Headers;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Response-like surface that accepts a `Set-Cookie` header. The primitive
|
|
199
|
+
* appends a Set-Cookie line when issuing a new conversation id. If absent,
|
|
200
|
+
* the primitive still reads the existing cookie but cannot issue a new
|
|
201
|
+
* one — useful for read-only contexts.
|
|
202
|
+
*/
|
|
203
|
+
response?: {
|
|
204
|
+
headers: Headers;
|
|
205
|
+
};
|
|
206
|
+
/** Explicit override — wins over session/cookie/uuid (ADR D3 step 1). */
|
|
207
|
+
agentId?: string;
|
|
208
|
+
/** Auth session containing a `conversationId` field — ADR D3 step 2. */
|
|
209
|
+
session?: {
|
|
210
|
+
conversationId?: string;
|
|
211
|
+
} | null;
|
|
212
|
+
/** SDK AgentOptions forwarded to Agent.getOrCreate. apiKey + model required. */
|
|
213
|
+
options: SdkAgentOptions;
|
|
214
|
+
/** Cookie name override. Default: 'theo_conversation'. */
|
|
215
|
+
cookieName?: string;
|
|
216
|
+
/** Cookie max-age in seconds. Default + min: 30 days. Non-positive coerced to default (EC-4). */
|
|
217
|
+
cookieMaxAge?: number;
|
|
218
|
+
}
|
|
219
|
+
interface ConversationHistoryResult {
|
|
220
|
+
/** The SDK Agent, ready to receive `agent.send(message)`. */
|
|
221
|
+
agent: SdkAgent;
|
|
222
|
+
/** The resolved conversation id (useful for logging / debugging). */
|
|
223
|
+
conversationId: string;
|
|
224
|
+
/** True when the id was newly generated (no prior cookie / session). */
|
|
225
|
+
isNew: boolean;
|
|
226
|
+
}
|
|
227
|
+
declare function createConversationHistory(args: ConversationHistoryArgs): Promise<ConversationHistoryResult>;
|
|
228
|
+
|
|
229
|
+
export { AgentErrorEvent, AgentEvent, type AgentRunLike, type AgentRunResult, type AgentRunStreamMessage, type ConversationHistoryArgs, type ConversationHistoryResult, type ConversationStorageLike, type SdkAgent, type SdkAgentOptions, type SdkRunLike, createConversationHistory, errorToEvent, streamAgentRun };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__resetSdkForTests,
|
|
3
|
+
__setSdkForTests,
|
|
4
|
+
createConversationHistory,
|
|
5
|
+
errorToEvent,
|
|
6
|
+
streamAgentRun
|
|
7
|
+
} from "../../chunk-RESN62GB.js";
|
|
8
|
+
import "../../chunk-DGUM43GV.js";
|
|
9
|
+
export {
|
|
10
|
+
__resetSdkForTests,
|
|
11
|
+
__setSdkForTests,
|
|
12
|
+
createConversationHistory,
|
|
13
|
+
errorToEvent,
|
|
14
|
+
streamAgentRun
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -49,6 +49,51 @@ interface SessionManager<TSession> {
|
|
|
49
49
|
rotateSession(req: IncomingMessage, res: ServerResponse): Promise<TSession | null>;
|
|
50
50
|
}
|
|
51
51
|
declare function createSessionManager<TSession>(config: SessionConfig): SessionManager<TSession>;
|
|
52
|
+
/**
|
|
53
|
+
* T5a.2 Phase D slice 3/3 — Web-Standards session manager.
|
|
54
|
+
*
|
|
55
|
+
* Mirror of `SessionManager<TSession>` for the Web `Request` + `Headers`
|
|
56
|
+
* shape. Same `SessionConfig`, same encryption (`encrypt`/`decrypt` from
|
|
57
|
+
* `./crypto.js`), same dual-key rotation logic (CR-002 constant-time
|
|
58
|
+
* decrypt fallback walk + transparent re-encrypt), same OWASP A07
|
|
59
|
+
* `rotateSession` invariant.
|
|
60
|
+
*
|
|
61
|
+
* **Signature differences vs `SessionManager`:**
|
|
62
|
+
* - Read methods take `Request` (instead of `IncomingMessage`).
|
|
63
|
+
* - Write methods take a `Headers` instance to mutate (instead of
|
|
64
|
+
* `ServerResponse`) — caller passes the headers they're building
|
|
65
|
+
* for their `Response` constructor.
|
|
66
|
+
*
|
|
67
|
+
* Uses `getCookieFromRequest` / `appendCookieToHeaders` /
|
|
68
|
+
* `appendDeleteCookieToHeaders` from Phase B slice 6/6.
|
|
69
|
+
*/
|
|
70
|
+
interface SessionManagerWeb<TSession> {
|
|
71
|
+
getSession(request: Request): Promise<TSession | null>;
|
|
72
|
+
getSessionWithMeta(request: Request): Promise<{
|
|
73
|
+
data: TSession | null;
|
|
74
|
+
meta: SessionMeta;
|
|
75
|
+
}>;
|
|
76
|
+
createSession(target: Headers, data: TSession): Promise<void>;
|
|
77
|
+
destroySession(target: Headers): void;
|
|
78
|
+
rotateSession(request: Request, target: Headers): Promise<TSession | null>;
|
|
79
|
+
}
|
|
80
|
+
declare function createSessionManagerWeb<TSession>(config: SessionConfig): SessionManagerWeb<TSession>;
|
|
81
|
+
/**
|
|
82
|
+
* T5a.2 Phase D slice 3/3 — Web-Standards transparent re-encrypt helper.
|
|
83
|
+
*
|
|
84
|
+
* Mirror of `rotateIfNeeded(sm, req, res)` for the Web Request + Headers
|
|
85
|
+
* shape. Reads session via `getSessionWithMeta`; if the cookie was
|
|
86
|
+
* decrypted with a legacy secret (index > 0), re-issues the cookie with
|
|
87
|
+
* the newest secret via `createSession(target, data)`.
|
|
88
|
+
*
|
|
89
|
+
* **EC-4 honest framing:** unlike the IncomingMessage path where the
|
|
90
|
+
* timing constraint is "before `res.writeHead` fires", the Web Request
|
|
91
|
+
* path's constraint is "before the `Response` object is constructed and
|
|
92
|
+
* returned to the runtime". Caller MUST invoke `rotateIfNeededWeb`
|
|
93
|
+
* BEFORE building the final `Response(body, { headers: target })` so the
|
|
94
|
+
* re-encrypted Set-Cookie lands on the wire.
|
|
95
|
+
*/
|
|
96
|
+
declare function rotateIfNeededWeb<TSession>(sm: SessionManagerWeb<TSession>, request: Request, target: Headers): Promise<TSession | null>;
|
|
52
97
|
/**
|
|
53
98
|
* T3.2 — Transparent re-encrypt helper (EC-4 timing-safe wrapper).
|
|
54
99
|
*
|
|
@@ -371,4 +416,4 @@ declare function clearOidcCache(): void;
|
|
|
371
416
|
*/
|
|
372
417
|
declare function discoverOidcProvider(issuer: string | URL): Promise<OidcMetadata>;
|
|
373
418
|
|
|
374
|
-
export { AuthRequiredError, type BackupCode, type BackupCodeOptions, type OidcMetadata, type PkceChallenge, type SessionConfig, type SessionManager, type SessionMeta, type ThrottleOptions, type ThrottleState, type TotpAlgorithm, type TotpOptions, type TotpUriOptions, type VerifyTotpOptions, _resetKeyCacheForTests, assertProductionSecret, checkThrottle, clearOidcCache, createSessionManager, decrypt, discoverOidcProvider, encrypt, generateBackupCodes, generateNonce, generateOAuthState, generatePkceChallenge, generateTotp, generateTotpSecret, pkceChallengeFromVerifier, recordAttempt, requireAuth, rotateIfNeeded, totpUri, verifyBackupCode, verifyOAuthState, verifyTotp };
|
|
419
|
+
export { AuthRequiredError, type BackupCode, type BackupCodeOptions, type OidcMetadata, type PkceChallenge, type SessionConfig, type SessionManager, type SessionManagerWeb, type SessionMeta, type ThrottleOptions, type ThrottleState, type TotpAlgorithm, type TotpOptions, type TotpUriOptions, type VerifyTotpOptions, _resetKeyCacheForTests, assertProductionSecret, checkThrottle, clearOidcCache, createSessionManager, createSessionManagerWeb, decrypt, discoverOidcProvider, encrypt, generateBackupCodes, generateNonce, generateOAuthState, generatePkceChallenge, generateTotp, generateTotpSecret, pkceChallengeFromVerifier, recordAttempt, requireAuth, rotateIfNeeded, rotateIfNeededWeb, totpUri, verifyBackupCode, verifyOAuthState, verifyTotp };
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
checkThrottle,
|
|
5
5
|
clearOidcCache,
|
|
6
6
|
createSessionManager,
|
|
7
|
+
createSessionManagerWeb,
|
|
7
8
|
decrypt,
|
|
8
9
|
discoverOidcProvider,
|
|
9
10
|
encrypt,
|
|
@@ -15,16 +16,20 @@ import {
|
|
|
15
16
|
pkceChallengeFromVerifier,
|
|
16
17
|
recordAttempt,
|
|
17
18
|
rotateIfNeeded,
|
|
19
|
+
rotateIfNeededWeb,
|
|
18
20
|
totpUri,
|
|
19
21
|
verifyBackupCode,
|
|
20
22
|
verifyOAuthState,
|
|
21
23
|
verifyTotp
|
|
22
|
-
} from "../../chunk-
|
|
24
|
+
} from "../../chunk-NZXH2LQQ.js";
|
|
25
|
+
import {
|
|
26
|
+
generateNonce
|
|
27
|
+
} from "../../chunk-C3ZZ56YZ.js";
|
|
28
|
+
import "../../chunk-ZJQ4O76G.js";
|
|
23
29
|
import {
|
|
24
30
|
AuthRequiredError,
|
|
25
|
-
generateNonce,
|
|
26
31
|
requireAuth
|
|
27
|
-
} from "../../chunk-
|
|
32
|
+
} from "../../chunk-4HBI7DHP.js";
|
|
28
33
|
import "../../chunk-DGUM43GV.js";
|
|
29
34
|
export {
|
|
30
35
|
AuthRequiredError,
|
|
@@ -33,6 +38,7 @@ export {
|
|
|
33
38
|
checkThrottle,
|
|
34
39
|
clearOidcCache,
|
|
35
40
|
createSessionManager,
|
|
41
|
+
createSessionManagerWeb,
|
|
36
42
|
decrypt,
|
|
37
43
|
discoverOidcProvider,
|
|
38
44
|
encrypt,
|
|
@@ -46,6 +52,7 @@ export {
|
|
|
46
52
|
recordAttempt,
|
|
47
53
|
requireAuth,
|
|
48
54
|
rotateIfNeeded,
|
|
55
|
+
rotateIfNeededWeb,
|
|
49
56
|
totpUri,
|
|
50
57
|
verifyBackupCode,
|
|
51
58
|
verifyOAuthState,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as StorageAdapter } from '../../storage-types-DsDTCPbp.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Cost tracking types (R0.5.11).
|
|
@@ -147,8 +147,6 @@ declare class InMemoryUsageStorage implements UsageStorageAdapter, StorageAdapte
|
|
|
147
147
|
dispose(): Promise<void>;
|
|
148
148
|
record(input: UsageRecord | ToolUsageRecord): Promise<void>;
|
|
149
149
|
getUsage(query: UsageQuery): Promise<UsageResult>;
|
|
150
|
-
/** @internal — test helper to inspect raw record stream */
|
|
151
|
-
__getRecords(): readonly (UsageRecord | ToolUsageRecord)[];
|
|
152
150
|
}
|
|
153
151
|
|
|
154
152
|
interface TrackAgentToolsOptions {
|
|
@@ -13,8 +13,10 @@ import {
|
|
|
13
13
|
translateCronToVercel,
|
|
14
14
|
validateCronSchedule,
|
|
15
15
|
writeCronManifest
|
|
16
|
-
} from "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
16
|
+
} from "../../chunk-K4M64WD6.js";
|
|
17
|
+
import "../../chunk-Y4H3JNVK.js";
|
|
18
|
+
import "../../chunk-6NEXVBPY.js";
|
|
19
|
+
import "../../chunk-7MQOHNHE.js";
|
|
18
20
|
import "../../chunk-X2VVCJ4V.js";
|
|
19
21
|
import "../../chunk-DGUM43GV.js";
|
|
20
22
|
export {
|