theokit 0.75.1 → 0.76.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/README.md +80 -1
- package/dist/{actions-virtual-module-MIQPBAZW.js → actions-virtual-module-34PJIOI6.js} +11 -9
- package/dist/actions-virtual-module-34PJIOI6.js.map +1 -0
- package/dist/{actions-virtual-module-QEI6QPK4.js → actions-virtual-module-HS4W7HQU.js} +6 -5
- package/dist/{actions-virtual-module-QEI6QPK4.js.map → actions-virtual-module-HS4W7HQU.js.map} +1 -1
- package/dist/adapters/agent-mount.js +9 -7
- package/dist/{agent-N4OV5MDY.js → agent-HCK5RHH7.js} +4 -3
- package/dist/{app-typed-client-CHSITA46.js → app-typed-client-BWITJLJA.js} +6 -5
- package/dist/{app-typed-client-CHSITA46.js.map → app-typed-client-BWITJLJA.js.map} +1 -1
- package/dist/{app-typed-client-XQJXF646.js → app-typed-client-FR4M4VND.js} +11 -9
- package/dist/app-typed-client-FR4M4VND.js.map +1 -0
- package/dist/{aws-lambda-K5Y6XS5V.js → aws-lambda-XT7ZDJ6B.js} +3 -3
- package/dist/{build-GNKTCEES.js → build-Y3CWTWP6.js} +24 -92
- package/dist/build-Y3CWTWP6.js.map +1 -0
- package/dist/{bun-VPXMWFBA.js → bun-PJLDELDT.js} +5 -5
- package/dist/{chunk-D7STTNQN.js → chunk-2FZYZHZM.js} +3 -3
- package/dist/{chunk-J2KYVTPD.js → chunk-2SGNODVJ.js} +30 -16
- package/dist/chunk-2SGNODVJ.js.map +1 -0
- package/dist/chunk-2SQ7YAU3.js +85 -0
- package/dist/chunk-2SQ7YAU3.js.map +1 -0
- package/dist/{chunk-SYIQV4UH.js → chunk-33DGAR6Q.js} +2 -2
- package/dist/{chunk-CLSYYO5F.js → chunk-3HRANFEN.js} +2 -2
- package/dist/{chunk-EW5IG7GA.js → chunk-42TYMRBG.js} +1 -1
- package/dist/{chunk-EW5IG7GA.js.map → chunk-42TYMRBG.js.map} +1 -1
- package/dist/{chunk-BINRCILF.js → chunk-4JRXZTVQ.js} +4 -13
- package/dist/chunk-4JRXZTVQ.js.map +1 -0
- package/dist/{chunk-ICXXHV4V.js → chunk-54BIQFP4.js} +4 -13
- package/dist/chunk-54BIQFP4.js.map +1 -0
- package/dist/{chunk-NX3P5MLH.js → chunk-C2BRSL4W.js} +50 -6
- package/dist/chunk-C2BRSL4W.js.map +1 -0
- package/dist/{chunk-E5QTCOKC.js → chunk-C5FBN5LO.js} +87 -23
- package/dist/chunk-C5FBN5LO.js.map +1 -0
- package/dist/{chunk-NLHAYGQQ.js → chunk-G3DDIEYE.js} +4 -2
- package/dist/chunk-G3DDIEYE.js.map +1 -0
- package/dist/{chunk-R4AMIBZL.js → chunk-GLD7UXOG.js} +5 -5
- package/dist/chunk-GLD7UXOG.js.map +1 -0
- package/dist/{chunk-3MKRDJQ2.js → chunk-I27DTFV4.js} +273 -75
- package/dist/chunk-I27DTFV4.js.map +1 -0
- package/dist/chunk-ISTKIQNY.js +67 -0
- package/dist/chunk-ISTKIQNY.js.map +1 -0
- package/dist/chunk-IXXZBZF7.js +70 -0
- package/dist/chunk-IXXZBZF7.js.map +1 -0
- package/dist/{chunk-PVNMLZ5G.js → chunk-JO462JZM.js} +2 -2
- package/dist/chunk-KKLXKR2B.js +469 -0
- package/dist/chunk-KKLXKR2B.js.map +1 -0
- package/dist/{chunk-RY6D4EXL.js → chunk-LCP5FT55.js} +25 -4
- package/dist/{chunk-RY6D4EXL.js.map → chunk-LCP5FT55.js.map} +1 -1
- package/dist/{chunk-D2R5SJEL.js → chunk-MAJZ2L3A.js} +2 -2
- package/dist/{chunk-D2R5SJEL.js.map → chunk-MAJZ2L3A.js.map} +1 -1
- package/dist/chunk-NF7LXSXZ.js +19 -0
- package/dist/chunk-NF7LXSXZ.js.map +1 -0
- package/dist/{chunk-VPK7ABMB.js → chunk-NWUZMJN2.js} +3 -3
- package/dist/{chunk-EVKNHQWG.js → chunk-OO3PHTRT.js} +45 -4
- package/dist/chunk-OO3PHTRT.js.map +1 -0
- package/dist/{chunk-2Z7TANA4.js → chunk-PVI6HM6E.js} +3 -3
- package/dist/{chunk-4X43VTST.js → chunk-TODO6J42.js} +1 -1
- package/dist/chunk-TODO6J42.js.map +1 -0
- package/dist/{chunk-ZDCCILMP.js → chunk-TQTEKNOL.js} +2 -69
- package/dist/chunk-TQTEKNOL.js.map +1 -0
- package/dist/{chunk-MX63AWEK.js → chunk-VXDTQO3S.js} +22 -6
- package/dist/{chunk-MX63AWEK.js.map → chunk-VXDTQO3S.js.map} +1 -1
- package/dist/{chunk-OZB2TKGJ.js → chunk-W2I6L4IJ.js} +2 -2
- package/dist/{chunk-UWV3B3RY.js → chunk-XDLFOATW.js} +5 -5
- package/dist/{chunk-RQKMY3JW.js → chunk-XI4FALFZ.js} +3 -3
- package/dist/chunk-XI4FALFZ.js.map +1 -0
- package/dist/{chunk-2FHNJ7LI.js → chunk-Z76QQR7I.js} +2 -2
- package/dist/chunk-ZICY2CD7.js +16 -0
- package/dist/chunk-ZICY2CD7.js.map +1 -0
- package/dist/{chunk-I5PDEWZZ.js → chunk-ZQJORKBM.js} +9 -3
- package/dist/chunk-ZQJORKBM.js.map +1 -0
- package/dist/cli/index.js +21 -15
- package/dist/cli/index.js.map +1 -1
- package/dist/{cloudflare-7EZQE4UV.js → cloudflare-F7KLBOU4.js} +6 -6
- package/dist/{config-support-HUZ4DXR7.js → config-support-2TER2BYD.js} +28 -21
- package/dist/config-support-2TER2BYD.js.map +1 -0
- package/dist/cron-lock-C3YpKDz2.d.ts +33 -0
- package/dist/db-ZWDKD57T.js +86 -0
- package/dist/db-ZWDKD57T.js.map +1 -0
- package/dist/{deno-deploy-M5V3PYWU.js → deno-deploy-LJ5JQQVR.js} +5 -5
- package/dist/{dev-7PMNIIOF.js → dev-R6U3JOYM.js} +60 -11
- package/dist/dev-R6U3JOYM.js.map +1 -0
- package/dist/{engine-singleton-X4R7AZBJ.js → engine-singleton-BQ5QOMTC.js} +15 -9
- package/dist/{engine-singleton-X4R7AZBJ.js.map → engine-singleton-BQ5QOMTC.js.map} +1 -1
- package/dist/{generate-RW3NO3NR.js → generate-2VAWEL7X.js} +205 -65
- package/dist/generate-2VAWEL7X.js.map +1 -0
- package/dist/{index-CmkWlIDO.d.ts → index-DfsJ3Qhk.d.ts} +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +12 -10
- package/dist/index.js.map +1 -1
- package/dist/{info-6NAUW5XY.js → info-IPMW56PI.js} +4 -4
- package/dist/{internal-api-R7TTYMCY.js → internal-api-6RAOYIET.js} +6 -5
- package/dist/{internal-api-A5HA7TYF.js → internal-api-LJOFLJSS.js} +13 -10
- package/dist/job-backend-WvUs5rO1.d.ts +119 -0
- package/dist/{load-config-CLFWJOXN.js → load-config-USRR4GXP.js} +4 -4
- package/dist/{mcp-3NRZAQKY.js → mcp-FBXEX45H.js} +5 -4
- package/dist/{mcp-3NRZAQKY.js.map → mcp-FBXEX45H.js.map} +1 -1
- package/dist/{netlify-NI4HYDKN.js → netlify-ZPQNREFH.js} +2 -2
- package/dist/{node-LORYECWI.js → node-3EV3CVWB.js} +2 -2
- package/dist/{observability-bootstrap-DOWRMADT.js → observability-bootstrap-DMJ7R6WA.js} +3 -3
- package/dist/{openapi-ZHKJB3XL.js → openapi-CA3E3LZH.js} +4 -4
- package/dist/{preview-SNS7VJWH.js → preview-AX2TMD26.js} +3 -3
- package/dist/registry-3D2KR7UE.js +34 -0
- package/dist/{routes-SMNSI2ZX.js → routes-BJ7GGRCV.js} +4 -4
- package/dist/{schema-DJH3IOVR.js → schema-FBM2UH72.js} +3 -3
- package/dist/{schemas-2R2J64ZH.js → schemas-BUR6PWSA.js} +2 -2
- package/dist/server/agent/index.d.ts +1 -1
- package/dist/server/agent/index.js +2 -1
- package/dist/server/cost/index.d.ts +2 -2
- package/dist/server/cost/index.js +1 -1
- package/dist/server/cost/sqlite/index.d.ts +2 -2
- package/dist/server/cost/sqlite/index.js +1 -1
- package/dist/server/cron/index.d.ts +20 -7
- package/dist/server/cron/index.js +5 -2
- package/dist/server/http/index.d.ts +2 -2
- package/dist/server/http/index.js +9 -7
- package/dist/server/index.d.ts +8 -7
- package/dist/server/index.js +42 -27
- package/dist/server/index.js.map +1 -1
- package/dist/server/jobs/index.d.ts +85 -44
- package/dist/server/jobs/index.js +8 -2
- package/dist/server/observability/index.js +8 -7
- package/dist/server/storage/index.d.ts +2 -2
- package/dist/server/storage/index.js +4 -1
- package/dist/server/webhook/index.d.ts +4 -5
- package/dist/server/webhook/index.js +1 -1
- package/dist/{server-boundary-ZT6HN7ON.js → server-boundary-EKIGYL7B.js} +6 -5
- package/dist/{server-boundary-ZT6HN7ON.js.map → server-boundary-EKIGYL7B.js.map} +1 -1
- package/dist/{server-boundary-HYLYGFZY.js → server-boundary-WSGVQAXP.js} +11 -9
- package/dist/server-boundary-WSGVQAXP.js.map +1 -0
- package/dist/{start-L5TGWGLU.js → start-4FY3TLM7.js} +118 -185
- package/dist/start-4FY3TLM7.js.map +1 -0
- package/dist/{static-O2RZ5NLR.js → static-VNN4HYRN.js} +2 -2
- package/dist/{storage-manager-BtG38jYl.d.ts → storage-manager-Clu2RBpH.d.ts} +15 -3
- package/dist/{storage-manager-3O5PDO6O.js → storage-manager-O3APCXYX.js} +46 -5
- package/dist/storage-manager-O3APCXYX.js.map +1 -0
- package/dist/{storage-types-CFGPFIdB.d.ts → storage-types-ndO0ZZqH.d.ts} +2 -2
- package/dist/{theo-cloud-B4R7GCWK.js → theo-cloud-243SPOIA.js} +2 -2
- package/dist/{vercel-INHLOCSZ.js → vercel-EXKSZ2OQ.js} +5 -5
- package/dist/vite-plugin/index.js +12 -10
- package/dist/{vite-plugin-UXEXT7GX.js → vite-plugin-LE42ZIGV.js} +10 -9
- package/dist/{whatsapp-D_Fnl1LX.d.ts → whatsapp-4W2eK2ij.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/actions-virtual-module-MIQPBAZW.js.map +0 -1
- package/dist/app-typed-client-XQJXF646.js.map +0 -1
- package/dist/build-GNKTCEES.js.map +0 -1
- package/dist/chunk-3MKRDJQ2.js.map +0 -1
- package/dist/chunk-4X43VTST.js.map +0 -1
- package/dist/chunk-BINRCILF.js.map +0 -1
- package/dist/chunk-E5QTCOKC.js.map +0 -1
- package/dist/chunk-EVKNHQWG.js.map +0 -1
- package/dist/chunk-I5PDEWZZ.js.map +0 -1
- package/dist/chunk-ICXXHV4V.js.map +0 -1
- package/dist/chunk-IDEZ7FU2.js +0 -18
- package/dist/chunk-IDEZ7FU2.js.map +0 -1
- package/dist/chunk-J2KYVTPD.js.map +0 -1
- package/dist/chunk-NLHAYGQQ.js.map +0 -1
- package/dist/chunk-NX3P5MLH.js.map +0 -1
- package/dist/chunk-R4AMIBZL.js.map +0 -1
- package/dist/chunk-RQKMY3JW.js.map +0 -1
- package/dist/chunk-YCF3N4JS.js +0 -26
- package/dist/chunk-YCF3N4JS.js.map +0 -1
- package/dist/chunk-ZDCCILMP.js.map +0 -1
- package/dist/config-support-HUZ4DXR7.js.map +0 -1
- package/dist/db-IVVCQE5Z.js +0 -76
- package/dist/db-IVVCQE5Z.js.map +0 -1
- package/dist/dev-7PMNIIOF.js.map +0 -1
- package/dist/generate-RW3NO3NR.js.map +0 -1
- package/dist/job-backend-CgC8Xf33.d.ts +0 -68
- package/dist/registry-3SVWZVIJ.js +0 -34
- package/dist/server-boundary-HYLYGFZY.js.map +0 -1
- package/dist/start-L5TGWGLU.js.map +0 -1
- package/dist/storage-manager-3O5PDO6O.js.map +0 -1
- /package/dist/{agent-N4OV5MDY.js.map → agent-HCK5RHH7.js.map} +0 -0
- /package/dist/{aws-lambda-K5Y6XS5V.js.map → aws-lambda-XT7ZDJ6B.js.map} +0 -0
- /package/dist/{bun-VPXMWFBA.js.map → bun-PJLDELDT.js.map} +0 -0
- /package/dist/{chunk-D7STTNQN.js.map → chunk-2FZYZHZM.js.map} +0 -0
- /package/dist/{chunk-SYIQV4UH.js.map → chunk-33DGAR6Q.js.map} +0 -0
- /package/dist/{chunk-CLSYYO5F.js.map → chunk-3HRANFEN.js.map} +0 -0
- /package/dist/{chunk-PVNMLZ5G.js.map → chunk-JO462JZM.js.map} +0 -0
- /package/dist/{chunk-VPK7ABMB.js.map → chunk-NWUZMJN2.js.map} +0 -0
- /package/dist/{chunk-2Z7TANA4.js.map → chunk-PVI6HM6E.js.map} +0 -0
- /package/dist/{chunk-OZB2TKGJ.js.map → chunk-W2I6L4IJ.js.map} +0 -0
- /package/dist/{chunk-UWV3B3RY.js.map → chunk-XDLFOATW.js.map} +0 -0
- /package/dist/{chunk-2FHNJ7LI.js.map → chunk-Z76QQR7I.js.map} +0 -0
- /package/dist/{cloudflare-7EZQE4UV.js.map → cloudflare-F7KLBOU4.js.map} +0 -0
- /package/dist/{deno-deploy-M5V3PYWU.js.map → deno-deploy-LJ5JQQVR.js.map} +0 -0
- /package/dist/{info-6NAUW5XY.js.map → info-IPMW56PI.js.map} +0 -0
- /package/dist/{internal-api-R7TTYMCY.js.map → internal-api-6RAOYIET.js.map} +0 -0
- /package/dist/{internal-api-A5HA7TYF.js.map → internal-api-LJOFLJSS.js.map} +0 -0
- /package/dist/{load-config-CLFWJOXN.js.map → load-config-USRR4GXP.js.map} +0 -0
- /package/dist/{netlify-NI4HYDKN.js.map → netlify-ZPQNREFH.js.map} +0 -0
- /package/dist/{node-LORYECWI.js.map → node-3EV3CVWB.js.map} +0 -0
- /package/dist/{observability-bootstrap-DOWRMADT.js.map → observability-bootstrap-DMJ7R6WA.js.map} +0 -0
- /package/dist/{openapi-ZHKJB3XL.js.map → openapi-CA3E3LZH.js.map} +0 -0
- /package/dist/{preview-SNS7VJWH.js.map → preview-AX2TMD26.js.map} +0 -0
- /package/dist/{registry-3SVWZVIJ.js.map → registry-3D2KR7UE.js.map} +0 -0
- /package/dist/{routes-SMNSI2ZX.js.map → routes-BJ7GGRCV.js.map} +0 -0
- /package/dist/{schema-DJH3IOVR.js.map → schema-FBM2UH72.js.map} +0 -0
- /package/dist/{schemas-2R2J64ZH.js.map → schemas-BUR6PWSA.js.map} +0 -0
- /package/dist/{static-O2RZ5NLR.js.map → static-VNN4HYRN.js.map} +0 -0
- /package/dist/{theo-cloud-B4R7GCWK.js.map → theo-cloud-243SPOIA.js.map} +0 -0
- /package/dist/{vercel-INHLOCSZ.js.map → vercel-EXKSZ2OQ.js.map} +0 -0
- /package/dist/{vite-plugin-UXEXT7GX.js.map → vite-plugin-LE42ZIGV.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -215,7 +215,13 @@ declare const theoConfigSchema: z.ZodObject<{
|
|
|
215
215
|
adapters: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
216
216
|
viteOptimizeDeps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
217
217
|
jobs: z.ZodOptional<z.ZodObject<{
|
|
218
|
-
backend: z.ZodCustom<
|
|
218
|
+
backend: z.ZodCustom<object, object>;
|
|
219
|
+
worker: z.ZodPrefault<z.ZodObject<{
|
|
220
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
221
|
+
pollIntervalMs: z.ZodDefault<z.ZodNumber>;
|
|
222
|
+
batchSize: z.ZodDefault<z.ZodNumber>;
|
|
223
|
+
lockSeconds: z.ZodDefault<z.ZodNumber>;
|
|
224
|
+
}, z.core.$strip>>;
|
|
219
225
|
}, z.core.$strip>>;
|
|
220
226
|
storage: z.ZodOptional<z.ZodObject<{
|
|
221
227
|
servers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -254,6 +260,9 @@ declare const theoConfigSchema: z.ZodObject<{
|
|
|
254
260
|
db: z.ZodOptional<z.ZodNumber>;
|
|
255
261
|
maxRetriesPerRequest: z.ZodOptional<z.ZodNumber>;
|
|
256
262
|
}, z.core.$strip>>>;
|
|
263
|
+
}, z.core.$strict>>;
|
|
264
|
+
cron: z.ZodOptional<z.ZodObject<{
|
|
265
|
+
lock: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodCustom<object, object>]>>;
|
|
257
266
|
}, z.core.$strip>>;
|
|
258
267
|
services: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
259
268
|
runtime: z.ZodEnum<{
|
package/dist/index.js
CHANGED
|
@@ -8,28 +8,29 @@ import {
|
|
|
8
8
|
scanRoutes,
|
|
9
9
|
theoConfigSchema,
|
|
10
10
|
theoPlugin
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-C5FBN5LO.js";
|
|
12
12
|
import "./chunk-7NRFZBAL.js";
|
|
13
13
|
import "./chunk-SSYDEKWF.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-2FZYZHZM.js";
|
|
15
|
+
import "./chunk-NWUZMJN2.js";
|
|
16
|
+
import "./chunk-GLD7UXOG.js";
|
|
17
17
|
import "./chunk-OIGJOYX6.js";
|
|
18
18
|
import "./chunk-U3SPBLJF.js";
|
|
19
19
|
import "./chunk-WSOAN4KN.js";
|
|
20
20
|
import "./chunk-ENSFCKP6.js";
|
|
21
21
|
import "./chunk-OGLS76RN.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-PVI6HM6E.js";
|
|
23
|
+
import "./chunk-33DGAR6Q.js";
|
|
24
24
|
import "./chunk-P6OS7652.js";
|
|
25
25
|
import "./chunk-ZDUO4IYN.js";
|
|
26
26
|
import "./chunk-IDWN2OSG.js";
|
|
27
27
|
import "./chunk-47FFT43U.js";
|
|
28
28
|
import "./chunk-NTDN54XO.js";
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-CHTAWXC2.js";
|
|
29
|
+
import "./chunk-JO462JZM.js";
|
|
30
|
+
import "./chunk-IXXZBZF7.js";
|
|
32
31
|
import "./chunk-AVQU5CQF.js";
|
|
32
|
+
import "./chunk-TQTEKNOL.js";
|
|
33
|
+
import "./chunk-CHTAWXC2.js";
|
|
33
34
|
import "./chunk-VSLTKX5L.js";
|
|
34
35
|
import "./chunk-SFGGRC35.js";
|
|
35
36
|
import "./chunk-4Z5XO4O4.js";
|
|
@@ -40,7 +41,8 @@ import "./chunk-V6Y2SMRG.js";
|
|
|
40
41
|
import "./chunk-ACKBVBUI.js";
|
|
41
42
|
import "./chunk-IZ3TIL6K.js";
|
|
42
43
|
import "./chunk-TQEE36VD.js";
|
|
43
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-54BIQFP4.js";
|
|
45
|
+
import "./chunk-ZICY2CD7.js";
|
|
44
46
|
import "./chunk-YSJOZEI6.js";
|
|
45
47
|
import "./chunk-Z4PJMZLM.js";
|
|
46
48
|
import "./chunk-UMNXCU3K.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config/define-config.ts","../src/config/config-builder.ts","../src/config/validate-structure.ts","../src/core/errors.ts"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/config/define-config.ts","../src/config/config-builder.ts","../src/config/validate-structure.ts","../src/core/errors.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOO,SAAS,aAAaA,SAAkD;AAC7E,SAAOA;AACT;;;ACuCA,SAAS,kBAAkB,MAA0C;AACnE,QAAM,QAAQ,CAAC,UACb,kBAAkB,EAAE,GAAG,MAAM,GAAG,MAAM,CAAC;AACzC,SAAO;AAAA,IACL,MAAM,CAAC,UAAU,MAAM,EAAE,MAAM,MAAM,CAAC;AAAA,IACtC,WAAW,CAAC,UAAU,MAAM,EAAE,WAAW,MAAM,CAAC;AAAA,IAChD,QAAQ,CAAC,UAAU,MAAM,EAAE,QAAQ,MAAM,CAAC;AAAA,IAC1C,WAAW,CAAC,UAAU,MAAM,EAAE,WAAW,MAAM,CAAC;AAAA,IAChD,SAAS,CAAC,UAAU,MAAM,EAAE,SAAS,MAAM,CAAC;AAAA,IAC5C,MAAM,CAAC,UAAU,MAAM,EAAE,MAAM,MAAM,CAAC;AAAA,IACtC,MAAM,CAAC,UAAU,MAAM,EAAE,MAAM,MAAM,CAAC;AAAA,IACtC,cAAc,CAAC,UAAU,MAAM,EAAE,cAAc,MAAM,CAAC;AAAA,IACtD,KAAK,CAAC,UAAU,MAAM,EAAE,KAAK,MAAM,CAAC;AAAA,IACpC,KAAK,CAAC,YAAY,MAAM,OAAO;AAAA,IAC/B,OAAO,MAAM,aAAa,IAAI;AAAA,EAChC;AACF;AAKO,SAAS,SAAwB;AACtC,SAAO,kBAAkB,CAAC,CAAC;AAC7B;;;ACnEA,SAAS,kBAAkB;AAC3B,SAAS,YAAY;;;ACLd,IAAM,mBAAN,cAA+B,MAAM;AAAA,EAC1B;AAAA,EACA;AAAA,EAEhB,YAAY,QAAkB,SAAiB;AAC7C,UAAM,aAAa,OAAO,IAAI,CAAC,MAAM,OAAO,CAAC,EAAE,EAAE,KAAK,IAAI;AAE1D;AAAA,MACE;AAAA;AAAA,UACa,OAAO;AAAA;AAAA,KACjB,aAAa;AAAA,EAAc,UAAU;AAAA,IAAO;AAAA,IACjD;AAEA,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,UAAU;AAAA,EACjB;AACF;;;ADHA,IAAM,iBAAmC;AAAA,EACvC;AAAA,IACE,MAAM;AAAA,IACN,cAAc;AAAA,EAChB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,cAAc;AAAA,EAChB;AACF;AAIO,SAAS,yBAAyB,SAAiB,SAAS,OAAa;AAC9E,MAAI,CAAC,WAAW,OAAO,GAAG;AACxB,UAAM,IAAI,iBAAiB,CAAC,qCAAqC,OAAO,EAAE,GAAG,OAAO;AAAA,EACtF;AAEA,QAAM,SAAmB,CAAC;AAE1B,QAAM,eAAiC;AAAA,IACrC,EAAE,MAAM,QAAQ,cAAc,+BAA+B,MAAM,IAAI;AAAA,EACzE;AAEA,aAAW,QAAQ,cAAc;AAC/B,QAAI,CAAC,WAAW,KAAK,SAAS,KAAK,IAAI,CAAC,GAAG;AACzC,aAAO,KAAK,KAAK,YAAY;AAAA,IAC/B;AAAA,EACF;AAEA,aAAW,QAAQ,gBAAgB;AACjC,QAAI,CAAC,WAAW,KAAK,SAAS,KAAK,IAAI,CAAC,GAAG;AACzC,aAAO,KAAK,KAAK,YAAY;AAAA,IAC/B;AAAA,EACF;AAEA,MAAI,OAAO,SAAS,GAAG;AACrB,UAAM,IAAI,iBAAiB,QAAQ,OAAO;AAAA,EAC5C;AACF;","names":["config"]}
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
} from "./chunk-47MM2JUK.js";
|
|
6
6
|
import {
|
|
7
7
|
loadConfig
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-W2I6L4IJ.js";
|
|
9
9
|
import "./chunk-3QPVEJ7D.js";
|
|
10
10
|
import "./chunk-O5JZ6ROY.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-C2BRSL4W.js";
|
|
12
12
|
import "./chunk-L4V5V2TI.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-MAJZ2L3A.js";
|
|
14
14
|
|
|
15
15
|
// src/cli/commands/info.ts
|
|
16
16
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -103,4 +103,4 @@ export {
|
|
|
103
103
|
buildInfo,
|
|
104
104
|
infoCommand
|
|
105
105
|
};
|
|
106
|
-
//# sourceMappingURL=info-
|
|
106
|
+
//# sourceMappingURL=info-IPMW56PI.js.map
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
handleCspReport,
|
|
17
17
|
handleCsrfReadiness,
|
|
18
18
|
mountAgent
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-XI4FALFZ.js";
|
|
20
20
|
import {
|
|
21
21
|
resolveProvider
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-4JRXZTVQ.js";
|
|
23
23
|
import {
|
|
24
24
|
dispatchControllerRequest,
|
|
25
25
|
incomingMessageToHandlerRequest,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
import {
|
|
32
32
|
TRACE_HEADER,
|
|
33
33
|
extractTraceId
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-VXDTQO3S.js";
|
|
35
35
|
import {
|
|
36
36
|
logRequest
|
|
37
37
|
} from "./chunk-C27VRUVN.js";
|
|
@@ -52,7 +52,8 @@ import {
|
|
|
52
52
|
} from "./chunk-4WP7A7RX.js";
|
|
53
53
|
import "./chunk-Z7CJHDLS.js";
|
|
54
54
|
import "./chunk-O5JZ6ROY.js";
|
|
55
|
-
import "./chunk-
|
|
55
|
+
import "./chunk-MAJZ2L3A.js";
|
|
56
|
+
import "./chunk-NF7LXSXZ.js";
|
|
56
57
|
import "./chunk-VQIUTCK2.js";
|
|
57
58
|
export {
|
|
58
59
|
ACTION_SCHEMAS_DIR,
|
|
@@ -87,4 +88,4 @@ export {
|
|
|
87
88
|
scanWebSocketRoutes,
|
|
88
89
|
sendError
|
|
89
90
|
};
|
|
90
|
-
//# sourceMappingURL=internal-api-
|
|
91
|
+
//# sourceMappingURL=internal-api-6RAOYIET.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
dispatchControllerRequest
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2FZYZHZM.js";
|
|
4
4
|
import {
|
|
5
5
|
mountAgent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GLD7UXOG.js";
|
|
7
7
|
import {
|
|
8
8
|
CSP_REPORT_PATH,
|
|
9
9
|
CsrfReadinessStore,
|
|
@@ -18,11 +18,11 @@ import {
|
|
|
18
18
|
executeAction,
|
|
19
19
|
executeRoute,
|
|
20
20
|
handleBatchRequest
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-PVI6HM6E.js";
|
|
22
22
|
import {
|
|
23
23
|
incomingMessageToHandlerRequest,
|
|
24
24
|
sendError
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-33DGAR6Q.js";
|
|
26
26
|
import "./chunk-P6OS7652.js";
|
|
27
27
|
import "./chunk-ZDUO4IYN.js";
|
|
28
28
|
import "./chunk-IDWN2OSG.js";
|
|
@@ -30,14 +30,16 @@ import "./chunk-47FFT43U.js";
|
|
|
30
30
|
import {
|
|
31
31
|
findSuggestion
|
|
32
32
|
} from "./chunk-NTDN54XO.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-JO462JZM.js";
|
|
34
34
|
import {
|
|
35
35
|
TRACE_HEADER,
|
|
36
|
-
extractTraceId
|
|
36
|
+
extractTraceId
|
|
37
|
+
} from "./chunk-IXXZBZF7.js";
|
|
38
|
+
import "./chunk-AVQU5CQF.js";
|
|
39
|
+
import {
|
|
37
40
|
logRequest
|
|
38
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-TQTEKNOL.js";
|
|
39
42
|
import "./chunk-CHTAWXC2.js";
|
|
40
|
-
import "./chunk-AVQU5CQF.js";
|
|
41
43
|
import {
|
|
42
44
|
createPluginRunnerFromConfig
|
|
43
45
|
} from "./chunk-VSLTKX5L.js";
|
|
@@ -65,7 +67,8 @@ import "./chunk-ACKBVBUI.js";
|
|
|
65
67
|
import "./chunk-IZ3TIL6K.js";
|
|
66
68
|
import {
|
|
67
69
|
resolveProvider
|
|
68
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-54BIQFP4.js";
|
|
71
|
+
import "./chunk-ZICY2CD7.js";
|
|
69
72
|
import "./chunk-YSJOZEI6.js";
|
|
70
73
|
import {
|
|
71
74
|
generateNonce
|
|
@@ -108,4 +111,4 @@ export {
|
|
|
108
111
|
scanWebSocketRoutes,
|
|
109
112
|
sendError
|
|
110
113
|
};
|
|
111
|
-
//# sourceMappingURL=internal-api-
|
|
114
|
+
//# sourceMappingURL=internal-api-LJOFLJSS.js.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Neutral `JobBackend` interface.
|
|
3
|
+
*
|
|
4
|
+
* Implementations ship in core:
|
|
5
|
+
* - `InMemoryJobBackend` (T2.2) — dev + tests; no external deps
|
|
6
|
+
* - `PostgresJobBackend` (T3.1) — production; requires `pg` peer dep
|
|
7
|
+
*
|
|
8
|
+
* Community packages (`@theokit/jobs-redis`, `@theokit/jobs-sqs`, etc.)
|
|
9
|
+
* implement this same interface to plug in alternate substrates without
|
|
10
|
+
* modifying TheoKit core.
|
|
11
|
+
*/
|
|
12
|
+
interface JobEnqueueInput {
|
|
13
|
+
/** The job name (matches a `defineJob` declaration). */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Validated input (already passed through Zod or equivalent at the queue-client layer). */
|
|
16
|
+
input: unknown;
|
|
17
|
+
/**
|
|
18
|
+
* Optional idempotency key, scoped to `name`: a second enqueue of the same (name, key) returns the
|
|
19
|
+
* first job's id instead of creating a job, including when the two calls race. The window is
|
|
20
|
+
* backend-specific: `PostgresJobBackend` holds the key while the row exists (until `ack`, or for
|
|
21
|
+
* good once the job has failed); `InMemoryJobBackend` holds it for 60 seconds.
|
|
22
|
+
*/
|
|
23
|
+
idempotencyKey?: string;
|
|
24
|
+
/** Optional delay before the job becomes available for dispatch. */
|
|
25
|
+
delaySeconds?: number;
|
|
26
|
+
/** W3C Trace Context propagation per ADR/R0.5.9. */
|
|
27
|
+
traceparent?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Maximum dispatch attempts stored with the job (default 1). The queue client has no access to
|
|
30
|
+
* the job definitions and leaves it unset; `createJobRunner` passes the definition's
|
|
31
|
+
* `maxAttempts` to `nack`, which takes precedence over this stored value.
|
|
32
|
+
*/
|
|
33
|
+
maxAttempts?: number;
|
|
34
|
+
}
|
|
35
|
+
interface JobLease {
|
|
36
|
+
readonly jobId: string;
|
|
37
|
+
readonly name: string;
|
|
38
|
+
readonly input: unknown;
|
|
39
|
+
readonly attempts: number;
|
|
40
|
+
readonly maxAttempts: number;
|
|
41
|
+
readonly traceparent?: string;
|
|
42
|
+
readonly lockExpiresAt: Date;
|
|
43
|
+
/**
|
|
44
|
+
* Identifies THIS lease. Pass it back to `ack`/`nack` so a worker whose lease expired, and was
|
|
45
|
+
* handed to another worker, cannot finish the job on the new holder's behalf. Both first-party
|
|
46
|
+
* backends set it; optional so a backend written against the earlier contract still compiles.
|
|
47
|
+
*/
|
|
48
|
+
readonly leaseToken?: string;
|
|
49
|
+
}
|
|
50
|
+
/** What `nack` is told about the failure. */
|
|
51
|
+
interface JobNackOptions extends JobLeaseFence {
|
|
52
|
+
/** The failure message. */
|
|
53
|
+
error: string;
|
|
54
|
+
/** The handler threw `NonRetryableError`: no retry, whatever the attempts left. */
|
|
55
|
+
nonRetryable?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The retry ceiling from the job's definition. Takes precedence over the value stored at
|
|
58
|
+
* enqueue, which is 1 for every job enqueued through the queue client.
|
|
59
|
+
*/
|
|
60
|
+
maxAttempts?: number;
|
|
61
|
+
}
|
|
62
|
+
/** Fences `ack`/`nack` to the lease that is finishing the job. */
|
|
63
|
+
interface JobLeaseFence {
|
|
64
|
+
/** The `leaseToken` of the `JobLease` being finished. Omitted, the call is not fenced. */
|
|
65
|
+
leaseToken?: string;
|
|
66
|
+
}
|
|
67
|
+
interface JobBackend {
|
|
68
|
+
/** Human-readable name for logging (e.g., "memory", "postgres"). */
|
|
69
|
+
readonly name: string;
|
|
70
|
+
/** Persist a job for later dispatch. Returns the generated jobId. */
|
|
71
|
+
enqueue(input: JobEnqueueInput): Promise<{
|
|
72
|
+
jobId: string;
|
|
73
|
+
}>;
|
|
74
|
+
/** Worker loop polls for the next available leases. */
|
|
75
|
+
dequeue(opts: {
|
|
76
|
+
batchSize?: number;
|
|
77
|
+
lockSeconds?: number;
|
|
78
|
+
}): Promise<JobLease[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Mark a job complete (success). With `leaseToken`, rejects with `JobLeaseLostError` and leaves
|
|
81
|
+
* the job alone when that lease no longer holds it.
|
|
82
|
+
*/
|
|
83
|
+
ack(jobId: string, fence?: JobLeaseFence): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Mark a job failed; backend decides retry vs DLQ via attempts. With `leaseToken`, rejects with
|
|
86
|
+
* `JobLeaseLostError` and leaves the job alone when that lease no longer holds it.
|
|
87
|
+
*/
|
|
88
|
+
nack(jobId: string, opts: JobNackOptions): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Optional: return the existing jobId if `key` was enqueued within `ttlSeconds`. Pass `name` to
|
|
91
|
+
* scope the lookup to one job type, as `enqueue` deduplicates on (name, key); without it, a key
|
|
92
|
+
* shared by two job types may return either job.
|
|
93
|
+
*/
|
|
94
|
+
idempotency?(key: string, ttlSeconds: number, name?: string): Promise<{
|
|
95
|
+
jobId: string;
|
|
96
|
+
} | null>;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Thrown from a job handler to opt out of retry policy. The runner nacks with
|
|
100
|
+
* `nonRetryable: true` and the backend never retries the job: `PostgresJobBackend`
|
|
101
|
+
* keeps it as failed with the error, `InMemoryJobBackend` drops it with a warning.
|
|
102
|
+
*/
|
|
103
|
+
declare class NonRetryableError extends Error {
|
|
104
|
+
readonly code = "NON_RETRYABLE";
|
|
105
|
+
constructor(message: string);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* `ack`/`nack` was called with a lease token that no longer holds the job: the lease expired and
|
|
109
|
+
* another worker leased the job again (or the job is gone). The job is left untouched, because the
|
|
110
|
+
* current holder owns its outcome. The runner logs it and moves on; a direct caller decides.
|
|
111
|
+
*/
|
|
112
|
+
declare class JobLeaseLostError extends Error {
|
|
113
|
+
readonly code = "JOB_LEASE_LOST";
|
|
114
|
+
readonly jobId: string;
|
|
115
|
+
readonly operation: 'ack' | 'nack';
|
|
116
|
+
constructor(jobId: string, operation: 'ack' | 'nack');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export { type JobBackend as J, NonRetryableError as N, type JobEnqueueInput as a, type JobLease as b, type JobLeaseFence as c, JobLeaseLostError as d, type JobNackOptions as e };
|
|
@@ -3,14 +3,14 @@ import "tsx/esm";
|
|
|
3
3
|
import {
|
|
4
4
|
deepMerge,
|
|
5
5
|
loadConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-W2I6L4IJ.js";
|
|
7
7
|
import "./chunk-3QPVEJ7D.js";
|
|
8
8
|
import "./chunk-O5JZ6ROY.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-C2BRSL4W.js";
|
|
10
10
|
import "./chunk-L4V5V2TI.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-MAJZ2L3A.js";
|
|
12
12
|
export {
|
|
13
13
|
deepMerge,
|
|
14
14
|
loadConfig
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=load-config-
|
|
16
|
+
//# sourceMappingURL=load-config-USRR4GXP.js.map
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
import "tsx/esm";
|
|
3
3
|
import {
|
|
4
4
|
createAgentSsrLoader
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XDLFOATW.js";
|
|
6
6
|
import {
|
|
7
7
|
extractAppResources,
|
|
8
8
|
handleMcpJsonRpc
|
|
9
9
|
} from "./chunk-BDH5GKFZ.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-4JRXZTVQ.js";
|
|
11
11
|
import {
|
|
12
12
|
scanAgents
|
|
13
13
|
} from "./chunk-FU3LEX2I.js";
|
|
14
14
|
import "./chunk-Z7CJHDLS.js";
|
|
15
15
|
import "./chunk-3QPVEJ7D.js";
|
|
16
|
+
import "./chunk-NF7LXSXZ.js";
|
|
16
17
|
|
|
17
18
|
// src/cli/commands/mcp.ts
|
|
18
19
|
import { createInterface } from "readline";
|
|
@@ -46,7 +47,7 @@ async function serveMcpStdio(mod, name, appResources, streams) {
|
|
|
46
47
|
// src/cli/commands/mcp.ts
|
|
47
48
|
async function mcpCommand(name, deps = {}) {
|
|
48
49
|
const projectRoot = deps.projectRoot ?? process.cwd();
|
|
49
|
-
const agentsDir = deps.agentsDir ?? (await (await import("./load-config-
|
|
50
|
+
const agentsDir = deps.agentsDir ?? (await (await import("./load-config-USRR4GXP.js")).loadConfig(projectRoot)).agentsDir;
|
|
50
51
|
const agent = scanAgents(projectRoot, agentsDir).find((a) => a.name === name);
|
|
51
52
|
if (!agent) {
|
|
52
53
|
const names = scanAgents(projectRoot, agentsDir).map((a) => a.name).join(", ");
|
|
@@ -75,4 +76,4 @@ async function mcpCommand(name, deps = {}) {
|
|
|
75
76
|
export {
|
|
76
77
|
mcpCommand
|
|
77
78
|
};
|
|
78
|
-
//# sourceMappingURL=mcp-
|
|
79
|
+
//# sourceMappingURL=mcp-FBXEX45H.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/commands/mcp.ts","../src/server/agent/mcp-stdio.ts"],"sourcesContent":["/**\n * `theokit mcp <agent>` — expose a scanned agent as an MCP server over stdio.\n *\n * The stdio sibling of the M16 HTTP route (`POST /api/agents/<name>/mcp`): a desktop MCP client\n * (e.g. Claude Desktop) spawns this command and speaks newline-delimited JSON-RPC over the pipe.\n * It reuses the framework's OWN `serveMcpStdio` / `handleMcpJsonRpc` (no LLM call, no runtime — a\n * TRANSPORT, like the HTTP route). `deps` is injectable so the routing is tested without Vite/stdin.\n */\nimport { createInterface } from 'node:readline'\n\nimport { extractAppResources } from '../../server/agent/mcp-app-resources.js'\nimport { type StdioStreams, serveMcpStdio } from '../../server/agent/mcp-stdio.js'\nimport { scanAgents } from '../../server/scan/agent-scan.js'\n\nimport { createAgentSsrLoader } from './agent.js'\n\ninterface McpCommandDeps {\n projectRoot?: string\n /** Load a TS agent module; defaults to the framework's Vite SSR loader (same transpile as dev). */\n loadModule?: (filePath: string) => Promise<Record<string, unknown>>\n /** stdio streams; defaults to `readline(process.stdin)` + `process.stdout`. Injected in tests. */\n streams?: StdioStreams\n /** Agents dir name (config `agentsDir`); defaults to the loaded config's value (\"agents\"). Tests inject it. */\n agentsDir?: string\n}\n\nexport async function mcpCommand(name: string, deps: McpCommandDeps = {}): Promise<void> {\n const projectRoot = deps.projectRoot ?? process.cwd()\n // #95 follow-up — resolve agents dir from config (default \"agents\") so `agentsDir` is honored here too.\n const agentsDir =\n deps.agentsDir ??\n (await (await import('../../config/load-config.js')).loadConfig(projectRoot)).agentsDir\n const agent = scanAgents(projectRoot, agentsDir).find((a) => a.name === name)\n if (!agent) {\n const names = scanAgents(projectRoot, agentsDir)\n .map((a) => a.name)\n .join(', ')\n throw new Error(\n `theokit mcp: agent '${name}' not found. Available: ${names || '(none in agents/)'}`,\n )\n }\n\n let loadModule = deps.loadModule\n let dispose: (() => Promise<void>) | undefined\n if (!loadModule) {\n const loader = await createAgentSsrLoader(projectRoot)\n loadModule = loader.load\n dispose = loader.dispose\n }\n\n const streams =\n deps.streams ??\n ({\n lines: createInterface({ input: process.stdin }),\n write: (line: string) => process.stdout.write(line),\n } satisfies StdioStreams)\n\n try {\n const mod = await loadModule(agent.filePath)\n await serveMcpStdio(mod, agent.name, extractAppResources(mod), streams)\n } finally {\n if (dispose) await dispose()\n }\n}\n","/**\n * MCP stdio transport (M16 follow-up) — expose a TheoKit agent as an MCP server over stdin/stdout,\n * the sibling of the M16 HTTP route (`POST /api/agents/<name>/mcp`). A desktop MCP client (e.g.\n * Claude Desktop) spawns `theokit mcp <agent>` and speaks newline-delimited JSON-RPC over the pipe.\n *\n * This is a TRANSPORT over the framework's OWN {@link handleMcpJsonRpc} — it reuses the exact handler\n * the HTTP route uses; it calls no LLM, spawns no MCP client, and reimplements no runtime (G2 /\n * sdk-runtime.md). Distinct from the SDK's MCP CLIENT stdio (which spawns external MCP servers via\n * `mcpServers` command/args) — that stays SDK-side. Here TheoKit is the SERVER. The framework-side\n * placement of this server-exposure transport is recorded in ADR-0042 (refining ADR-0040's M16 note).\n */\nimport type { AppResource } from './mcp-app-resources.js'\nimport { handleMcpJsonRpc } from './mcp-handler.js'\n\n/**\n * Handle one newline-delimited JSON-RPC line. Returns the response line to write to stdout, or\n * `null` for a blank line (nothing to emit). A malformed JSON line yields a `-32700` (Parse error)\n * envelope — never throws, so the stdio loop never dies on bad input.\n */\nexport async function handleMcpStdioLine(\n line: string,\n mod: unknown,\n name: string,\n appResources: readonly AppResource[] = [],\n): Promise<string | null> {\n const trimmed = line.trim()\n if (trimmed.length === 0) return null\n let body: unknown\n try {\n body = JSON.parse(trimmed)\n } catch {\n return JSON.stringify({\n jsonrpc: '2.0',\n id: null,\n error: { code: -32700, message: 'Parse error' },\n })\n }\n const response = await handleMcpJsonRpc(mod, name, body, appResources)\n const payload: unknown = await response.json()\n return JSON.stringify(payload)\n}\n\n/** A minimal readable line source (an async iterable of lines) + a writable sink. */\nexport interface StdioStreams {\n /** Async iterable of newline-delimited input lines (e.g. `readline.createInterface({ input })`). */\n lines: AsyncIterable<string>\n /** Write a response line (the caller appends no newline). */\n write: (line: string) => void\n}\n\n/**\n * Drive the MCP stdio server loop: for each input line, dispatch via {@link handleMcpStdioLine} and\n * write the response line (with a trailing `\\n`). Returns when the input stream ends (EOF).\n */\nexport async function serveMcpStdio(\n mod: unknown,\n name: string,\n appResources: readonly AppResource[],\n streams: StdioStreams,\n): Promise<void> {\n for await (const line of streams.lines) {\n const out = await handleMcpStdioLine(line, mod, name, appResources)\n if (out !== null) streams.write(`${out}\\n`)\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/mcp.ts","../src/server/agent/mcp-stdio.ts"],"sourcesContent":["/**\n * `theokit mcp <agent>` — expose a scanned agent as an MCP server over stdio.\n *\n * The stdio sibling of the M16 HTTP route (`POST /api/agents/<name>/mcp`): a desktop MCP client\n * (e.g. Claude Desktop) spawns this command and speaks newline-delimited JSON-RPC over the pipe.\n * It reuses the framework's OWN `serveMcpStdio` / `handleMcpJsonRpc` (no LLM call, no runtime — a\n * TRANSPORT, like the HTTP route). `deps` is injectable so the routing is tested without Vite/stdin.\n */\nimport { createInterface } from 'node:readline'\n\nimport { extractAppResources } from '../../server/agent/mcp-app-resources.js'\nimport { type StdioStreams, serveMcpStdio } from '../../server/agent/mcp-stdio.js'\nimport { scanAgents } from '../../server/scan/agent-scan.js'\n\nimport { createAgentSsrLoader } from './agent.js'\n\ninterface McpCommandDeps {\n projectRoot?: string\n /** Load a TS agent module; defaults to the framework's Vite SSR loader (same transpile as dev). */\n loadModule?: (filePath: string) => Promise<Record<string, unknown>>\n /** stdio streams; defaults to `readline(process.stdin)` + `process.stdout`. Injected in tests. */\n streams?: StdioStreams\n /** Agents dir name (config `agentsDir`); defaults to the loaded config's value (\"agents\"). Tests inject it. */\n agentsDir?: string\n}\n\nexport async function mcpCommand(name: string, deps: McpCommandDeps = {}): Promise<void> {\n const projectRoot = deps.projectRoot ?? process.cwd()\n // #95 follow-up — resolve agents dir from config (default \"agents\") so `agentsDir` is honored here too.\n const agentsDir =\n deps.agentsDir ??\n (await (await import('../../config/load-config.js')).loadConfig(projectRoot)).agentsDir\n const agent = scanAgents(projectRoot, agentsDir).find((a) => a.name === name)\n if (!agent) {\n const names = scanAgents(projectRoot, agentsDir)\n .map((a) => a.name)\n .join(', ')\n throw new Error(\n `theokit mcp: agent '${name}' not found. Available: ${names || '(none in agents/)'}`,\n )\n }\n\n let loadModule = deps.loadModule\n let dispose: (() => Promise<void>) | undefined\n if (!loadModule) {\n const loader = await createAgentSsrLoader(projectRoot)\n loadModule = loader.load\n dispose = loader.dispose\n }\n\n const streams =\n deps.streams ??\n ({\n lines: createInterface({ input: process.stdin }),\n write: (line: string) => process.stdout.write(line),\n } satisfies StdioStreams)\n\n try {\n const mod = await loadModule(agent.filePath)\n await serveMcpStdio(mod, agent.name, extractAppResources(mod), streams)\n } finally {\n if (dispose) await dispose()\n }\n}\n","/**\n * MCP stdio transport (M16 follow-up) — expose a TheoKit agent as an MCP server over stdin/stdout,\n * the sibling of the M16 HTTP route (`POST /api/agents/<name>/mcp`). A desktop MCP client (e.g.\n * Claude Desktop) spawns `theokit mcp <agent>` and speaks newline-delimited JSON-RPC over the pipe.\n *\n * This is a TRANSPORT over the framework's OWN {@link handleMcpJsonRpc} — it reuses the exact handler\n * the HTTP route uses; it calls no LLM, spawns no MCP client, and reimplements no runtime (G2 /\n * sdk-runtime.md). Distinct from the SDK's MCP CLIENT stdio (which spawns external MCP servers via\n * `mcpServers` command/args) — that stays SDK-side. Here TheoKit is the SERVER. The framework-side\n * placement of this server-exposure transport is recorded in ADR-0042 (refining ADR-0040's M16 note).\n */\nimport type { AppResource } from './mcp-app-resources.js'\nimport { handleMcpJsonRpc } from './mcp-handler.js'\n\n/**\n * Handle one newline-delimited JSON-RPC line. Returns the response line to write to stdout, or\n * `null` for a blank line (nothing to emit). A malformed JSON line yields a `-32700` (Parse error)\n * envelope — never throws, so the stdio loop never dies on bad input.\n */\nexport async function handleMcpStdioLine(\n line: string,\n mod: unknown,\n name: string,\n appResources: readonly AppResource[] = [],\n): Promise<string | null> {\n const trimmed = line.trim()\n if (trimmed.length === 0) return null\n let body: unknown\n try {\n body = JSON.parse(trimmed)\n } catch {\n return JSON.stringify({\n jsonrpc: '2.0',\n id: null,\n error: { code: -32700, message: 'Parse error' },\n })\n }\n const response = await handleMcpJsonRpc(mod, name, body, appResources)\n const payload: unknown = await response.json()\n return JSON.stringify(payload)\n}\n\n/** A minimal readable line source (an async iterable of lines) + a writable sink. */\nexport interface StdioStreams {\n /** Async iterable of newline-delimited input lines (e.g. `readline.createInterface({ input })`). */\n lines: AsyncIterable<string>\n /** Write a response line (the caller appends no newline). */\n write: (line: string) => void\n}\n\n/**\n * Drive the MCP stdio server loop: for each input line, dispatch via {@link handleMcpStdioLine} and\n * write the response line (with a trailing `\\n`). Returns when the input stream ends (EOF).\n */\nexport async function serveMcpStdio(\n mod: unknown,\n name: string,\n appResources: readonly AppResource[],\n streams: StdioStreams,\n): Promise<void> {\n for await (const line of streams.lines) {\n const out = await handleMcpStdioLine(line, mod, name, appResources)\n if (out !== null) streams.write(`${out}\\n`)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAQA,SAAS,uBAAuB;;;ACWhC,eAAsB,mBACpB,MACA,KACA,MACA,eAAuC,CAAC,GAChB;AACxB,QAAM,UAAU,KAAK,KAAK;AAC1B,MAAI,QAAQ,WAAW,EAAG,QAAO;AACjC,MAAI;AACJ,MAAI;AACF,WAAO,KAAK,MAAM,OAAO;AAAA,EAC3B,QAAQ;AACN,WAAO,KAAK,UAAU;AAAA,MACpB,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,OAAO,EAAE,MAAM,QAAQ,SAAS,cAAc;AAAA,IAChD,CAAC;AAAA,EACH;AACA,QAAM,WAAW,MAAM,iBAAiB,KAAK,MAAM,MAAM,YAAY;AACrE,QAAM,UAAmB,MAAM,SAAS,KAAK;AAC7C,SAAO,KAAK,UAAU,OAAO;AAC/B;AAcA,eAAsB,cACpB,KACA,MACA,cACA,SACe;AACf,mBAAiB,QAAQ,QAAQ,OAAO;AACtC,UAAM,MAAM,MAAM,mBAAmB,MAAM,KAAK,MAAM,YAAY;AAClE,QAAI,QAAQ,KAAM,SAAQ,MAAM,GAAG,GAAG;AAAA,CAAI;AAAA,EAC5C;AACF;;;ADtCA,eAAsB,WAAW,MAAc,OAAuB,CAAC,GAAkB;AACvF,QAAM,cAAc,KAAK,eAAe,QAAQ,IAAI;AAEpD,QAAM,YACJ,KAAK,cACJ,OAAO,MAAM,OAAO,2BAA6B,GAAG,WAAW,WAAW,GAAG;AAChF,QAAM,QAAQ,WAAW,aAAa,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,SAAS,IAAI;AAC5E,MAAI,CAAC,OAAO;AACV,UAAM,QAAQ,WAAW,aAAa,SAAS,EAC5C,IAAI,CAAC,MAAM,EAAE,IAAI,EACjB,KAAK,IAAI;AACZ,UAAM,IAAI;AAAA,MACR,uBAAuB,IAAI,2BAA2B,SAAS,mBAAmB;AAAA,IACpF;AAAA,EACF;AAEA,MAAI,aAAa,KAAK;AACtB,MAAI;AACJ,MAAI,CAAC,YAAY;AACf,UAAM,SAAS,MAAM,qBAAqB,WAAW;AACrD,iBAAa,OAAO;AACpB,cAAU,OAAO;AAAA,EACnB;AAEA,QAAM,UACJ,KAAK,WACJ;AAAA,IACC,OAAO,gBAAgB,EAAE,OAAO,QAAQ,MAAM,CAAC;AAAA,IAC/C,OAAO,CAAC,SAAiB,QAAQ,OAAO,MAAM,IAAI;AAAA,EACpD;AAEF,MAAI;AACF,UAAM,MAAM,MAAM,WAAW,MAAM,QAAQ;AAC3C,UAAM,cAAc,KAAK,MAAM,MAAM,oBAAoB,GAAG,GAAG,OAAO;AAAA,EACxE,UAAE;AACA,QAAI,QAAS,OAAM,QAAQ;AAAA,EAC7B;AACF;","names":[]}
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./chunk-EQJF2EH5.js";
|
|
23
23
|
import {
|
|
24
24
|
nodeAdapter
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-G3DDIEYE.js";
|
|
26
26
|
import {
|
|
27
27
|
buildSecurityHeaders
|
|
28
28
|
} from "./chunk-WSMLSIS5.js";
|
|
@@ -398,4 +398,4 @@ export {
|
|
|
398
398
|
netlifyAdapter,
|
|
399
399
|
renderNetlifyFunction
|
|
400
400
|
};
|
|
401
|
-
//# sourceMappingURL=netlify-
|
|
401
|
+
//# sourceMappingURL=netlify-ZPQNREFH.js.map
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
_resetObservabilityAdapter,
|
|
5
5
|
createObservabilityPluginFromConfig,
|
|
6
6
|
getObservabilityAdapter
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VXDTQO3S.js";
|
|
8
8
|
import "./chunk-C27VRUVN.js";
|
|
9
9
|
import "./chunk-7UZZHCRN.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-MAJZ2L3A.js";
|
|
11
11
|
export {
|
|
12
12
|
_resetObservabilityAdapter,
|
|
13
13
|
createObservabilityPluginFromConfig,
|
|
14
14
|
getObservabilityAdapter
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=observability-bootstrap-
|
|
16
|
+
//# sourceMappingURL=observability-bootstrap-DMJ7R6WA.js.map
|
|
@@ -12,12 +12,12 @@ import "./chunk-4WP7A7RX.js";
|
|
|
12
12
|
import "./chunk-Z7CJHDLS.js";
|
|
13
13
|
import {
|
|
14
14
|
loadConfig
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-W2I6L4IJ.js";
|
|
16
16
|
import "./chunk-3QPVEJ7D.js";
|
|
17
17
|
import "./chunk-O5JZ6ROY.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-C2BRSL4W.js";
|
|
19
19
|
import "./chunk-L4V5V2TI.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-MAJZ2L3A.js";
|
|
21
21
|
|
|
22
22
|
// src/cli/commands/openapi.ts
|
|
23
23
|
import { mkdtempSync, rmSync } from "fs";
|
|
@@ -84,4 +84,4 @@ function emitOpenApiInMemory(manifest, config) {
|
|
|
84
84
|
export {
|
|
85
85
|
openapiCommand
|
|
86
86
|
};
|
|
87
|
-
//# sourceMappingURL=openapi-
|
|
87
|
+
//# sourceMappingURL=openapi-CA3E3LZH.js.map
|
|
@@ -4,8 +4,8 @@ import "tsx/esm";
|
|
|
4
4
|
// src/cli/commands/preview.ts
|
|
5
5
|
async function defaultSteps() {
|
|
6
6
|
const [{ buildCommand }, { startCommand }] = await Promise.all([
|
|
7
|
-
import("./build-
|
|
8
|
-
import("./start-
|
|
7
|
+
import("./build-Y3CWTWP6.js"),
|
|
8
|
+
import("./start-4FY3TLM7.js")
|
|
9
9
|
]);
|
|
10
10
|
return {
|
|
11
11
|
build: (opts) => buildCommand(opts),
|
|
@@ -20,4 +20,4 @@ async function previewCommand(options = {}, steps) {
|
|
|
20
20
|
export {
|
|
21
21
|
previewCommand
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=preview-
|
|
23
|
+
//# sourceMappingURL=preview-AX2TMD26.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import "tsx/esm";
|
|
3
|
+
import {
|
|
4
|
+
VALID_TARGETS
|
|
5
|
+
} from "./chunk-TODO6J42.js";
|
|
6
|
+
|
|
7
|
+
// src/adapters/registry.ts
|
|
8
|
+
var adapterRegistry = {
|
|
9
|
+
node: async () => (await import("./node-3EV3CVWB.js")).nodeAdapter,
|
|
10
|
+
vercel: async () => (await import("./vercel-EXKSZ2OQ.js")).vercelAdapter,
|
|
11
|
+
cloudflare: async () => (await import("./cloudflare-F7KLBOU4.js")).cloudflareAdapter,
|
|
12
|
+
static: async () => (await import("./static-VNN4HYRN.js")).staticAdapter,
|
|
13
|
+
bun: async () => (await import("./bun-PJLDELDT.js")).bunAdapter,
|
|
14
|
+
"deno-deploy": async () => (await import("./deno-deploy-LJ5JQQVR.js")).denoDeployAdapter,
|
|
15
|
+
netlify: async () => (await import("./netlify-ZPQNREFH.js")).netlifyAdapter,
|
|
16
|
+
"aws-lambda": async () => (await import("./aws-lambda-XT7ZDJ6B.js")).awsLambdaAdapter,
|
|
17
|
+
"theo-cloud": async () => (await import("./theo-cloud-243SPOIA.js")).theoCloudAdapter
|
|
18
|
+
};
|
|
19
|
+
async function resolveAdapter(target) {
|
|
20
|
+
const factory = adapterRegistry[target];
|
|
21
|
+
return factory();
|
|
22
|
+
}
|
|
23
|
+
async function streamingTargets() {
|
|
24
|
+
const out = [];
|
|
25
|
+
for (const target of VALID_TARGETS) {
|
|
26
|
+
if ((await resolveAdapter(target)).streamsResponses === true) out.push(target);
|
|
27
|
+
}
|
|
28
|
+
return out;
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
resolveAdapter,
|
|
32
|
+
streamingTargets
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=registry-3D2KR7UE.js.map
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
import "./chunk-Z7CJHDLS.js";
|
|
12
12
|
import {
|
|
13
13
|
loadConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-W2I6L4IJ.js";
|
|
15
15
|
import "./chunk-3QPVEJ7D.js";
|
|
16
16
|
import "./chunk-O5JZ6ROY.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-C2BRSL4W.js";
|
|
18
18
|
import "./chunk-L4V5V2TI.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-MAJZ2L3A.js";
|
|
20
20
|
|
|
21
21
|
// src/cli/commands/routes.ts
|
|
22
22
|
import { resolve, relative } from "path";
|
|
@@ -64,4 +64,4 @@ async function routesCommand() {
|
|
|
64
64
|
export {
|
|
65
65
|
routesCommand
|
|
66
66
|
};
|
|
67
|
-
//# sourceMappingURL=routes-
|
|
67
|
+
//# sourceMappingURL=routes-BJ7GGRCV.js.map
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import "tsx/esm";
|
|
3
3
|
import {
|
|
4
4
|
theoConfigSchema
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-C2BRSL4W.js";
|
|
6
6
|
import "./chunk-L4V5V2TI.js";
|
|
7
7
|
import {
|
|
8
8
|
cacheSchema,
|
|
9
9
|
corsSchema,
|
|
10
10
|
securityHeadersSchema,
|
|
11
11
|
storageSchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MAJZ2L3A.js";
|
|
13
13
|
export {
|
|
14
14
|
cacheSchema,
|
|
15
15
|
corsSchema,
|
|
@@ -17,4 +17,4 @@ export {
|
|
|
17
17
|
storageSchema,
|
|
18
18
|
theoConfigSchema
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=schema-
|
|
20
|
+
//# sourceMappingURL=schema-FBM2UH72.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
securitySchema,
|
|
11
11
|
storageSchema,
|
|
12
12
|
uploadSchema
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-MAJZ2L3A.js";
|
|
14
14
|
export {
|
|
15
15
|
cacheSchema,
|
|
16
16
|
corsSchema,
|
|
@@ -22,4 +22,4 @@ export {
|
|
|
22
22
|
storageSchema,
|
|
23
23
|
uploadSchema
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=schemas-
|
|
25
|
+
//# sourceMappingURL=schemas-BUR6PWSA.js.map
|
|
@@ -3,7 +3,7 @@ import { C as CustomTool } from '../../define-agent-tool-aYYLpMeo.js';
|
|
|
3
3
|
import { CustomTool as CustomTool$1 } from '@theokit/sdk';
|
|
4
4
|
import { AcpTransport } from '@theokit/agents';
|
|
5
5
|
export { AgentModule, InProcessApprovalRequest, InProcessApprovalRequiredError, InProcessAwaitApproval, StreamAgentTurnDeps, StreamAgentTurnInProcessInput, streamAgentTurnInProcess } from '@theokit/agents';
|
|
6
|
-
import { V as VerifyFn, S as SubscribeFn } from '../../whatsapp-
|
|
6
|
+
import { V as VerifyFn, S as SubscribeFn } from '../../whatsapp-4W2eK2ij.js';
|
|
7
7
|
export { P as ProviderDescriptor, R as ResolvedProvider, l as listProviders, a as registerProvider, b as resetProviderRegistry, r as resolveProvider, t as tryResolveProvider } from '../../provider-resolver-Cc9C3-Rb.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -30,7 +30,8 @@ import {
|
|
|
30
30
|
resetProviderRegistry,
|
|
31
31
|
resolveProvider,
|
|
32
32
|
tryResolveProvider
|
|
33
|
-
} from "../../chunk-
|
|
33
|
+
} from "../../chunk-54BIQFP4.js";
|
|
34
|
+
import "../../chunk-ZICY2CD7.js";
|
|
34
35
|
import "../../chunk-XTHN6JBX.js";
|
|
35
36
|
export {
|
|
36
37
|
AcpRequestTimeoutError,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { U as UsageStorageAdapter, a as UsageRecord, T as ToolUsageRecord, b as UsageQuery, c as UsageResult } from '../../cost-types-BALTuBpG.js';
|
|
2
|
-
import { S as StorageAdapter } from '../../storage-types-
|
|
2
|
+
import { S as StorageAdapter } from '../../storage-types-ndO0ZZqH.js';
|
|
3
3
|
export { InMemoryUsageStorage as NeutralUsageStorage } from '@theokit/agents/usage';
|
|
4
4
|
|
|
5
5
|
interface TrackAgentRunInput {
|
|
@@ -70,7 +70,7 @@ declare class InMemoryUsageStorage implements UsageStorageAdapter, StorageAdapte
|
|
|
70
70
|
#private;
|
|
71
71
|
readonly name = "memory";
|
|
72
72
|
/**
|
|
73
|
-
* T2.3 — `StorageAdapter` lifecycle hook
|
|
73
|
+
* T2.3 — `StorageAdapter` lifecycle hook. In-memory storage
|
|
74
74
|
* has no real cleanup to perform — this is intentionally a noop so the
|
|
75
75
|
* adapter can be registered with `StorageManager.register()` and
|
|
76
76
|
* participate in graceful shutdown without changing behavior.
|