theokit 0.13.0 → 0.15.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-3CDQTWOC.js → actions-virtual-module-G4BANOLW.js} +5 -3
- package/dist/{actions-virtual-module-3CDQTWOC.js.map → actions-virtual-module-G4BANOLW.js.map} +1 -1
- package/dist/{actions-virtual-module-EIPXX4ZB.js → actions-virtual-module-RM7JRY5N.js} +7 -7
- package/dist/agent-MN7XGJR3.js +209 -0
- package/dist/agent-MN7XGJR3.js.map +1 -0
- package/dist/{app-typed-client-7PBFWZUE.js → app-typed-client-5VQE6DNF.js} +7 -7
- package/dist/{app-typed-client-CSOK7NPC.js → app-typed-client-Z6BHD4MF.js} +5 -3
- package/dist/{app-typed-client-CSOK7NPC.js.map → app-typed-client-Z6BHD4MF.js.map} +1 -1
- package/dist/boot/index.js +3 -3
- package/dist/{build-HXND27XG.js → build-QDAFSKKW.js} +11 -7
- package/dist/{build-HXND27XG.js.map → build-QDAFSKKW.js.map} +1 -1
- package/dist/chunk-34YQOXGM.js +37 -0
- package/dist/chunk-34YQOXGM.js.map +1 -0
- package/dist/{chunk-7YZHAQU7.js → chunk-567NA7Y6.js} +8 -99
- package/dist/chunk-567NA7Y6.js.map +1 -0
- package/dist/{chunk-3S3BNW5K.js → chunk-5UUOGAJH.js} +2 -2
- package/dist/{chunk-BQDGES7C.js → chunk-GBXLKYIA.js} +19 -43
- package/dist/chunk-GBXLKYIA.js.map +1 -0
- package/dist/chunk-GDN3PXFH.js +101 -0
- package/dist/chunk-GDN3PXFH.js.map +1 -0
- package/dist/{chunk-TGTNRUH3.js → chunk-H243MR3F.js} +2 -2
- package/dist/{chunk-NHJMZCAS.js → chunk-JZHT3LW7.js} +1 -1
- package/dist/chunk-JZHT3LW7.js.map +1 -0
- package/dist/chunk-KGFNWIMS.js +94 -0
- package/dist/chunk-KGFNWIMS.js.map +1 -0
- package/dist/{chunk-EXP56GFQ.js → chunk-NBWB4S46.js} +38 -9
- package/dist/chunk-NBWB4S46.js.map +1 -0
- package/dist/{chunk-F4YUPDJ2.js → chunk-NXTF5PPW.js} +15 -41
- package/dist/chunk-NXTF5PPW.js.map +1 -0
- package/dist/{chunk-UNLA45FY.js → chunk-OTFIRP6S.js} +76 -46
- package/dist/chunk-OTFIRP6S.js.map +1 -0
- package/dist/chunk-P37RZRFV.js +31 -0
- package/dist/chunk-P37RZRFV.js.map +1 -0
- package/dist/{chunk-RYTZYFSD.js → chunk-UOR6JTCI.js} +205 -33
- package/dist/chunk-UOR6JTCI.js.map +1 -0
- package/dist/{chunk-WFNLNIJX.js → chunk-Z5IGLBWE.js} +1 -1
- package/dist/{chunk-O62MW4MT.js → chunk-ZJDKAD3L.js} +55 -14
- package/dist/chunk-ZJDKAD3L.js.map +1 -0
- package/dist/cli/index.js +22 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/client/index.d.ts +3 -152
- package/dist/client/index.js +13 -236
- package/dist/client/index.js.map +1 -1
- package/dist/{dev-OWW4XVIH.js → dev-TEE4T6ZB.js} +13 -8
- package/dist/{dev-OWW4XVIH.js.map → dev-TEE4T6ZB.js.map} +1 -1
- package/dist/{dev-emit-5MDSBP5D.js → dev-emit-VJ5CFMPY.js} +5 -3
- package/dist/{dev-emit-5MDSBP5D.js.map → dev-emit-VJ5CFMPY.js.map} +1 -1
- package/dist/index.js +12 -13
- package/dist/index.js.map +1 -1
- package/dist/{info-OUEUZOT7.js → info-7PE2PZJI.js} +6 -5
- package/dist/{info-OUEUZOT7.js.map → info-7PE2PZJI.js.map} +1 -1
- package/dist/{internal-api-4YTJDITC.js → internal-api-5BDI6N5U.js} +20 -20
- package/dist/{internal-api-EFKZWIYZ.js → internal-api-J27TYE2I.js} +7 -4
- package/dist/load-config-JKYO5RFK.js +14 -0
- package/dist/{openapi-FHY6HC6I.js → openapi-MXMLZCXC.js} +7 -4
- package/dist/{openapi-FHY6HC6I.js.map → openapi-MXMLZCXC.js.map} +1 -1
- package/dist/{registry-34LL7NF4.js → registry-XJUYD2OU.js} +2 -2
- package/dist/{routes-EW7TP7NJ.js → routes-NNBEZSGN.js} +5 -3
- package/dist/{routes-EW7TP7NJ.js.map → routes-NNBEZSGN.js.map} +1 -1
- package/dist/server/auth/index.js +1 -1
- package/dist/server/define/index.d.ts +3 -70
- package/dist/server/define/index.js +2 -4
- package/dist/server/http/index.js +2 -2
- package/dist/server/index.d.ts +1 -3
- package/dist/server/index.js +90 -105
- package/dist/server/index.js.map +1 -1
- package/dist/server/jobs/index.js +4 -4
- package/dist/server/observability/index.js +1 -1
- package/dist/server/scan/index.js +1 -1
- package/dist/{start-KIQ5TTLR.js → start-7MQEEQH4.js} +68 -8
- package/dist/start-7MQEEQH4.js.map +1 -0
- package/dist/{static-55G3LX2I.js → static-7ARBVDJF.js} +4 -4
- package/dist/vite-plugin/index.js +12 -13
- package/dist/{vite-plugin-RK66K26Z.js → vite-plugin-GC6WCU4P.js} +11 -7
- package/package.json +2 -6
- package/dist/agent-events-DosDXkSV.d.ts +0 -94
- package/dist/chunk-2KZQPDYR.js +0 -226
- package/dist/chunk-2KZQPDYR.js.map +0 -1
- package/dist/chunk-7YZHAQU7.js.map +0 -1
- package/dist/chunk-BQDGES7C.js.map +0 -1
- package/dist/chunk-EXP56GFQ.js.map +0 -1
- package/dist/chunk-F4YUPDJ2.js.map +0 -1
- package/dist/chunk-NHJMZCAS.js.map +0 -1
- package/dist/chunk-O62MW4MT.js.map +0 -1
- package/dist/chunk-RYTZYFSD.js.map +0 -1
- package/dist/chunk-UNLA45FY.js.map +0 -1
- package/dist/chunk-ZSTZXR2D.js +0 -208
- package/dist/chunk-ZSTZXR2D.js.map +0 -1
- package/dist/server/agent/index.d.ts +0 -229
- package/dist/server/agent/index.js +0 -17
- package/dist/start-KIQ5TTLR.js.map +0 -1
- /package/dist/{actions-virtual-module-EIPXX4ZB.js.map → actions-virtual-module-RM7JRY5N.js.map} +0 -0
- /package/dist/{app-typed-client-7PBFWZUE.js.map → app-typed-client-5VQE6DNF.js.map} +0 -0
- /package/dist/{chunk-3S3BNW5K.js.map → chunk-5UUOGAJH.js.map} +0 -0
- /package/dist/{chunk-TGTNRUH3.js.map → chunk-H243MR3F.js.map} +0 -0
- /package/dist/{chunk-WFNLNIJX.js.map → chunk-Z5IGLBWE.js.map} +0 -0
- /package/dist/{internal-api-4YTJDITC.js.map → internal-api-5BDI6N5U.js.map} +0 -0
- /package/dist/{internal-api-EFKZWIYZ.js.map → internal-api-J27TYE2I.js.map} +0 -0
- /package/dist/{server/agent/index.js.map → load-config-JKYO5RFK.js.map} +0 -0
- /package/dist/{registry-34LL7NF4.js.map → registry-XJUYD2OU.js.map} +0 -0
- /package/dist/{static-55G3LX2I.js.map → static-7ARBVDJF.js.map} +0 -0
- /package/dist/{vite-plugin-RK66K26Z.js.map → vite-plugin-GC6WCU4P.js.map} +0 -0
|
@@ -24,16 +24,19 @@ import {
|
|
|
24
24
|
sendError
|
|
25
25
|
} from "./chunk-WR4F4EEZ.js";
|
|
26
26
|
import {
|
|
27
|
-
generateManifest
|
|
27
|
+
generateManifest
|
|
28
|
+
} from "./chunk-NXTF5PPW.js";
|
|
29
|
+
import {
|
|
28
30
|
scanAgents
|
|
29
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-34YQOXGM.js";
|
|
30
32
|
import {
|
|
31
33
|
matchRoute,
|
|
32
34
|
scanServerActions,
|
|
33
35
|
scanServerActionsEnriched,
|
|
34
36
|
scanServerRoutes,
|
|
35
37
|
scanWebSocketRoutes
|
|
36
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-GBXLKYIA.js";
|
|
39
|
+
import "./chunk-P37RZRFV.js";
|
|
37
40
|
import "./chunk-HGZL5EOI.js";
|
|
38
41
|
export {
|
|
39
42
|
BATCH_PATH,
|
|
@@ -63,4 +66,4 @@ export {
|
|
|
63
66
|
scanWebSocketRoutes,
|
|
64
67
|
sendError
|
|
65
68
|
};
|
|
66
|
-
//# sourceMappingURL=internal-api-
|
|
69
|
+
//# sourceMappingURL=internal-api-J27TYE2I.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import "tsx/esm";
|
|
3
|
+
import {
|
|
4
|
+
deepMerge,
|
|
5
|
+
loadConfig
|
|
6
|
+
} from "./chunk-567NA7Y6.js";
|
|
7
|
+
import "./chunk-GDN3PXFH.js";
|
|
8
|
+
import "./chunk-YJAUJXZS.js";
|
|
9
|
+
import "./chunk-45C3WUQ7.js";
|
|
10
|
+
export {
|
|
11
|
+
deepMerge,
|
|
12
|
+
loadConfig
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=load-config-JKYO5RFK.js.map
|
|
@@ -6,13 +6,16 @@ import {
|
|
|
6
6
|
} from "./chunk-JAIKGP3Q.js";
|
|
7
7
|
import {
|
|
8
8
|
loadConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-567NA7Y6.js";
|
|
10
|
+
import "./chunk-GDN3PXFH.js";
|
|
10
11
|
import "./chunk-YJAUJXZS.js";
|
|
11
12
|
import "./chunk-45C3WUQ7.js";
|
|
12
13
|
import {
|
|
13
14
|
generateManifest
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-NXTF5PPW.js";
|
|
16
|
+
import "./chunk-34YQOXGM.js";
|
|
17
|
+
import "./chunk-GBXLKYIA.js";
|
|
18
|
+
import "./chunk-P37RZRFV.js";
|
|
16
19
|
|
|
17
20
|
// src/cli/commands/openapi.ts
|
|
18
21
|
import { mkdtempSync, rmSync } from "fs";
|
|
@@ -79,4 +82,4 @@ function emitOpenApiInMemory(manifest, config) {
|
|
|
79
82
|
export {
|
|
80
83
|
openapiCommand
|
|
81
84
|
};
|
|
82
|
-
//# sourceMappingURL=openapi-
|
|
85
|
+
//# sourceMappingURL=openapi-MXMLZCXC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/commands/openapi.ts"],"sourcesContent":["/**\n * `theokit openapi` — regenerate `<distDir>/openapi.json` standalone.\n *\n * Mirrors trpc-openapi's `pnpm codegen` script. Useful in dev workflows\n * when only schemas changed and a full `theokit build` would be\n * overkill.\n *\n * Per G2 plan v1.1 T2.3. Single output (dev location only) — for the\n * dist artifact, run `theokit build`.\n *\n * Flags:\n * --dry-run Validate + print the document to stdout; skip the\n * filesystem write (EC-3 absorbed).\n */\nimport { mkdtempSync, rmSync } from 'node:fs'\nimport { tmpdir } from 'node:os'\nimport { join, resolve } from 'node:path'\n\nimport { loadConfig } from '../../config/load-config.js'\nimport { generateManifest } from '../../server/scan/manifest.js'\nimport { emitOpenApi } from '../../vite-plugin/openapi-emit/emit.js'\nimport { loadRoutesForOpenApi } from '../../vite-plugin/openapi-emit/load-routes.js'\n\nconst MIGRATION_GUIDE_URL = 'docs/concepts/openapi.md'\n\nexport interface OpenApiCommandOptions {\n /** Project root (defaults to `process.cwd()`). */\n cwd?: string\n /** Skip the filesystem write; print the document to stdout (EC-3). */\n dryRun?: boolean\n}\n\nexport async function openapiCommand(options: OpenApiCommandOptions = {}): Promise<void> {\n const cwd = options.cwd ?? process.cwd()\n const config = await loadConfig(cwd)\n\n if (config.openapi === undefined) {\n console.error(\n `\\n ✗ openapi: not configured in theo.config.ts\\n\\n` +\n ` Add the \\`openapi\\` block to opt in:\\n\\n` +\n ` export default defineConfig({\\n` +\n ` openapi: {\\n` +\n ` title: 'My App',\\n` +\n ` version: '1.0.0',\\n` +\n ` },\\n` +\n ` })\\n\\n` +\n ` See ${MIGRATION_GUIDE_URL} for the full reference.\\n`,\n )\n process.exit(1)\n return\n }\n\n const serverDir = resolve(cwd, config.serverDir)\n const manifest = generateManifest(serverDir)\n const hydrated = await loadRoutesForOpenApi({ serverDir, routes: manifest.routes })\n\n if (options.dryRun) {\n // Build the document without writing — for the dry-run we still want a\n // valid emit pass, but with an in-memory output dir we never touch disk.\n const result = emitOpenApiInMemory(hydrated, config.openapi)\n console.log(`\\n ✓ openapi.json (dry-run): ${String(hydrated.length)} ops`)\n console.log(JSON.stringify(result.document, null, 2))\n console.log(`\\n Docs: ${MIGRATION_GUIDE_URL}\\n`)\n return\n }\n\n const distDir = resolve(cwd, config.distDir)\n const result = emitOpenApi({\n manifest: hydrated,\n config: { ...config.openapi, outDir: distDir },\n })\n console.log(\n `\\n ✓ openapi.json: ${String(hydrated.length)} ops → ${result.path}\\n` +\n ` Docs: ${MIGRATION_GUIDE_URL}\\n`,\n )\n}\n\n/**\n * Dry-run helper: build the OpenAPI doc without writing. Routes through\n * the same `emitOpenApi` but discards the side-effecting write by\n * targeting a temp directory we immediately ignore.\n *\n * Honest tradeoff: this still calls `mkdirSync` (no-op on existing tmpdir)\n * + a synchronous write to a discardable tempfile. Cost is < 1ms and the\n * code stays the single transformation. A pure no-write helper would\n * duplicate the orchestration in `emit.ts` — KISS prefers reuse.\n */\nfunction emitOpenApiInMemory(\n manifest: Parameters<typeof emitOpenApi>[0]['manifest'],\n config: Omit<Parameters<typeof emitOpenApi>[0]['config'], 'outDir'>,\n): { document: unknown } {\n const tmp = mkdtempSync(join(tmpdir(), 'theokit-openapi-dryrun-'))\n try {\n const result = emitOpenApi({ manifest, config: { ...config, outDir: tmp } })\n return { document: result.document }\n } finally {\n rmSync(tmp, { recursive: true, force: true })\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/openapi.ts"],"sourcesContent":["/**\n * `theokit openapi` — regenerate `<distDir>/openapi.json` standalone.\n *\n * Mirrors trpc-openapi's `pnpm codegen` script. Useful in dev workflows\n * when only schemas changed and a full `theokit build` would be\n * overkill.\n *\n * Per G2 plan v1.1 T2.3. Single output (dev location only) — for the\n * dist artifact, run `theokit build`.\n *\n * Flags:\n * --dry-run Validate + print the document to stdout; skip the\n * filesystem write (EC-3 absorbed).\n */\nimport { mkdtempSync, rmSync } from 'node:fs'\nimport { tmpdir } from 'node:os'\nimport { join, resolve } from 'node:path'\n\nimport { loadConfig } from '../../config/load-config.js'\nimport { generateManifest } from '../../server/scan/manifest.js'\nimport { emitOpenApi } from '../../vite-plugin/openapi-emit/emit.js'\nimport { loadRoutesForOpenApi } from '../../vite-plugin/openapi-emit/load-routes.js'\n\nconst MIGRATION_GUIDE_URL = 'docs/concepts/openapi.md'\n\nexport interface OpenApiCommandOptions {\n /** Project root (defaults to `process.cwd()`). */\n cwd?: string\n /** Skip the filesystem write; print the document to stdout (EC-3). */\n dryRun?: boolean\n}\n\nexport async function openapiCommand(options: OpenApiCommandOptions = {}): Promise<void> {\n const cwd = options.cwd ?? process.cwd()\n const config = await loadConfig(cwd)\n\n if (config.openapi === undefined) {\n console.error(\n `\\n ✗ openapi: not configured in theo.config.ts\\n\\n` +\n ` Add the \\`openapi\\` block to opt in:\\n\\n` +\n ` export default defineConfig({\\n` +\n ` openapi: {\\n` +\n ` title: 'My App',\\n` +\n ` version: '1.0.0',\\n` +\n ` },\\n` +\n ` })\\n\\n` +\n ` See ${MIGRATION_GUIDE_URL} for the full reference.\\n`,\n )\n process.exit(1)\n return\n }\n\n const serverDir = resolve(cwd, config.serverDir)\n const manifest = generateManifest(serverDir)\n const hydrated = await loadRoutesForOpenApi({ serverDir, routes: manifest.routes })\n\n if (options.dryRun) {\n // Build the document without writing — for the dry-run we still want a\n // valid emit pass, but with an in-memory output dir we never touch disk.\n const result = emitOpenApiInMemory(hydrated, config.openapi)\n console.log(`\\n ✓ openapi.json (dry-run): ${String(hydrated.length)} ops`)\n console.log(JSON.stringify(result.document, null, 2))\n console.log(`\\n Docs: ${MIGRATION_GUIDE_URL}\\n`)\n return\n }\n\n const distDir = resolve(cwd, config.distDir)\n const result = emitOpenApi({\n manifest: hydrated,\n config: { ...config.openapi, outDir: distDir },\n })\n console.log(\n `\\n ✓ openapi.json: ${String(hydrated.length)} ops → ${result.path}\\n` +\n ` Docs: ${MIGRATION_GUIDE_URL}\\n`,\n )\n}\n\n/**\n * Dry-run helper: build the OpenAPI doc without writing. Routes through\n * the same `emitOpenApi` but discards the side-effecting write by\n * targeting a temp directory we immediately ignore.\n *\n * Honest tradeoff: this still calls `mkdirSync` (no-op on existing tmpdir)\n * + a synchronous write to a discardable tempfile. Cost is < 1ms and the\n * code stays the single transformation. A pure no-write helper would\n * duplicate the orchestration in `emit.ts` — KISS prefers reuse.\n */\nfunction emitOpenApiInMemory(\n manifest: Parameters<typeof emitOpenApi>[0]['manifest'],\n config: Omit<Parameters<typeof emitOpenApi>[0]['config'], 'outDir'>,\n): { document: unknown } {\n const tmp = mkdtempSync(join(tmpdir(), 'theokit-openapi-dryrun-'))\n try {\n const result = emitOpenApi({ manifest, config: { ...config, outDir: tmp } })\n return { document: result.document }\n } finally {\n rmSync(tmp, { recursive: true, force: true })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAcA,SAAS,aAAa,cAAc;AACpC,SAAS,cAAc;AACvB,SAAS,MAAM,eAAe;AAO9B,IAAM,sBAAsB;AAS5B,eAAsB,eAAe,UAAiC,CAAC,GAAkB;AACvF,QAAM,MAAM,QAAQ,OAAO,QAAQ,IAAI;AACvC,QAAM,SAAS,MAAM,WAAW,GAAG;AAEnC,MAAI,OAAO,YAAY,QAAW;AAChC,YAAQ;AAAA,MACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQW,mBAAmB;AAAA;AAAA,IAChC;AACA,YAAQ,KAAK,CAAC;AACd;AAAA,EACF;AAEA,QAAM,YAAY,QAAQ,KAAK,OAAO,SAAS;AAC/C,QAAM,WAAW,iBAAiB,SAAS;AAC3C,QAAM,WAAW,MAAM,qBAAqB,EAAE,WAAW,QAAQ,SAAS,OAAO,CAAC;AAElF,MAAI,QAAQ,QAAQ;AAGlB,UAAMA,UAAS,oBAAoB,UAAU,OAAO,OAAO;AAC3D,YAAQ,IAAI;AAAA,mCAAiC,OAAO,SAAS,MAAM,CAAC,MAAM;AAC1E,YAAQ,IAAI,KAAK,UAAUA,QAAO,UAAU,MAAM,CAAC,CAAC;AACpD,YAAQ,IAAI;AAAA,UAAa,mBAAmB;AAAA,CAAI;AAChD;AAAA,EACF;AAEA,QAAM,UAAU,QAAQ,KAAK,OAAO,OAAO;AAC3C,QAAM,SAAS,YAAY;AAAA,IACzB,UAAU;AAAA,IACV,QAAQ,EAAE,GAAG,OAAO,SAAS,QAAQ,QAAQ;AAAA,EAC/C,CAAC;AACD,UAAQ;AAAA,IACN;AAAA,yBAAuB,OAAO,SAAS,MAAM,CAAC,eAAU,OAAO,IAAI;AAAA,UACtD,mBAAmB;AAAA;AAAA,EAClC;AACF;AAYA,SAAS,oBACP,UACA,QACuB;AACvB,QAAM,MAAM,YAAY,KAAK,OAAO,GAAG,yBAAyB,CAAC;AACjE,MAAI;AACF,UAAM,SAAS,YAAY,EAAE,UAAU,QAAQ,EAAE,GAAG,QAAQ,QAAQ,IAAI,EAAE,CAAC;AAC3E,WAAO,EAAE,UAAU,OAAO,SAAS;AAAA,EACrC,UAAE;AACA,WAAO,KAAK,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,EAC9C;AACF;","names":["result"]}
|
|
@@ -6,7 +6,7 @@ var adapterRegistry = {
|
|
|
6
6
|
node: async () => (await import("./node-BPJ3Z4DT.js")).nodeAdapter,
|
|
7
7
|
vercel: async () => (await import("./vercel-J6G7ZHYQ.js")).vercelAdapter,
|
|
8
8
|
cloudflare: async () => (await import("./cloudflare-C6E5SPAE.js")).cloudflareAdapter,
|
|
9
|
-
static: async () => (await import("./static-
|
|
9
|
+
static: async () => (await import("./static-7ARBVDJF.js")).staticAdapter,
|
|
10
10
|
bun: async () => (await import("./bun-KP2KES6S.js")).bunAdapter,
|
|
11
11
|
"deno-deploy": async () => (await import("./deno-deploy-RFZN56X4.js")).denoDeployAdapter,
|
|
12
12
|
netlify: async () => (await import("./netlify-PMLHVPN4.js")).netlifyAdapter,
|
|
@@ -21,4 +21,4 @@ export {
|
|
|
21
21
|
adapterRegistry,
|
|
22
22
|
resolveAdapter
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=registry-
|
|
24
|
+
//# sourceMappingURL=registry-XJUYD2OU.js.map
|
|
@@ -5,14 +5,16 @@ import {
|
|
|
5
5
|
} from "./chunk-JQSFBJR5.js";
|
|
6
6
|
import {
|
|
7
7
|
loadConfig
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-567NA7Y6.js";
|
|
9
|
+
import "./chunk-GDN3PXFH.js";
|
|
9
10
|
import "./chunk-YJAUJXZS.js";
|
|
10
11
|
import "./chunk-45C3WUQ7.js";
|
|
11
12
|
import {
|
|
12
13
|
scanServerActions,
|
|
13
14
|
scanServerRoutes,
|
|
14
15
|
scanWebSocketRoutes
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GBXLKYIA.js";
|
|
17
|
+
import "./chunk-P37RZRFV.js";
|
|
16
18
|
|
|
17
19
|
// src/cli/commands/routes.ts
|
|
18
20
|
import { resolve, relative } from "path";
|
|
@@ -60,4 +62,4 @@ async function routesCommand() {
|
|
|
60
62
|
export {
|
|
61
63
|
routesCommand
|
|
62
64
|
};
|
|
63
|
-
//# sourceMappingURL=routes-
|
|
65
|
+
//# sourceMappingURL=routes-NNBEZSGN.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/commands/routes.ts"],"sourcesContent":["import { resolve, relative } from 'node:path'\n\nimport { loadConfig } from '../../config/load-config.js'\nimport { validateProjectStructure } from '../../config/validate-structure.js'\nimport { scanServerActions } from '../../server/scan/action-scan.js'\nimport { scanServerRoutes } from '../../server/scan/scan.js'\nimport { scanWebSocketRoutes } from '../../server/scan/ws-scan.js'\n\nexport async function routesCommand(): Promise<void> {\n const cwd = process.cwd()\n const config = await loadConfig(cwd)\n validateProjectStructure(cwd)\n\n const serverDir = resolve(cwd, config.serverDir)\n\n const apiRoutes = scanServerRoutes(serverDir)\n const actions = scanServerActions(serverDir)\n const wsRoutes = scanWebSocketRoutes(serverDir)\n\n const totalCount = apiRoutes.length + actions.length + wsRoutes.length\n\n if (totalCount === 0) {\n console.log('\\n No routes found.\\n')\n return\n }\n\n // API Routes\n if (apiRoutes.length > 0) {\n console.log('\\n API Routes')\n console.log(' ' + '─'.repeat(60))\n for (const route of apiRoutes) {\n const rel = relative(cwd, route.filePath)\n console.log(` GET/POST ${route.routePath.padEnd(30)} ${rel}`)\n }\n }\n\n // Actions\n if (actions.length > 0) {\n console.log('\\n Actions')\n console.log(' ' + '─'.repeat(60))\n for (const action of actions) {\n const rel = relative(cwd, action.filePath)\n console.log(` POST /api/__actions/${action.actionPath.padEnd(18)} ${rel}`)\n }\n }\n\n // WebSocket\n if (wsRoutes.length > 0) {\n console.log('\\n WebSocket')\n console.log(' ' + '─'.repeat(60))\n for (const route of wsRoutes) {\n const rel = relative(cwd, route.filePath)\n console.log(` WS ${route.wsPath.padEnd(30)} ${rel}`)\n }\n }\n\n console.log(`\\n Total: ${totalCount} endpoints\\n`)\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/routes.ts"],"sourcesContent":["import { resolve, relative } from 'node:path'\n\nimport { loadConfig } from '../../config/load-config.js'\nimport { validateProjectStructure } from '../../config/validate-structure.js'\nimport { scanServerActions } from '../../server/scan/action-scan.js'\nimport { scanServerRoutes } from '../../server/scan/scan.js'\nimport { scanWebSocketRoutes } from '../../server/scan/ws-scan.js'\n\nexport async function routesCommand(): Promise<void> {\n const cwd = process.cwd()\n const config = await loadConfig(cwd)\n validateProjectStructure(cwd)\n\n const serverDir = resolve(cwd, config.serverDir)\n\n const apiRoutes = scanServerRoutes(serverDir)\n const actions = scanServerActions(serverDir)\n const wsRoutes = scanWebSocketRoutes(serverDir)\n\n const totalCount = apiRoutes.length + actions.length + wsRoutes.length\n\n if (totalCount === 0) {\n console.log('\\n No routes found.\\n')\n return\n }\n\n // API Routes\n if (apiRoutes.length > 0) {\n console.log('\\n API Routes')\n console.log(' ' + '─'.repeat(60))\n for (const route of apiRoutes) {\n const rel = relative(cwd, route.filePath)\n console.log(` GET/POST ${route.routePath.padEnd(30)} ${rel}`)\n }\n }\n\n // Actions\n if (actions.length > 0) {\n console.log('\\n Actions')\n console.log(' ' + '─'.repeat(60))\n for (const action of actions) {\n const rel = relative(cwd, action.filePath)\n console.log(` POST /api/__actions/${action.actionPath.padEnd(18)} ${rel}`)\n }\n }\n\n // WebSocket\n if (wsRoutes.length > 0) {\n console.log('\\n WebSocket')\n console.log(' ' + '─'.repeat(60))\n for (const route of wsRoutes) {\n const rel = relative(cwd, route.filePath)\n console.log(` WS ${route.wsPath.padEnd(30)} ${rel}`)\n }\n }\n\n console.log(`\\n Total: ${totalCount} endpoints\\n`)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS,gBAAgB;AAQlC,eAAsB,gBAA+B;AACnD,QAAM,MAAM,QAAQ,IAAI;AACxB,QAAM,SAAS,MAAM,WAAW,GAAG;AACnC,2BAAyB,GAAG;AAE5B,QAAM,YAAY,QAAQ,KAAK,OAAO,SAAS;AAE/C,QAAM,YAAY,iBAAiB,SAAS;AAC5C,QAAM,UAAU,kBAAkB,SAAS;AAC3C,QAAM,WAAW,oBAAoB,SAAS;AAE9C,QAAM,aAAa,UAAU,SAAS,QAAQ,SAAS,SAAS;AAEhE,MAAI,eAAe,GAAG;AACpB,YAAQ,IAAI,wBAAwB;AACpC;AAAA,EACF;AAGA,MAAI,UAAU,SAAS,GAAG;AACxB,YAAQ,IAAI,gBAAgB;AAC5B,YAAQ,IAAI,OAAO,SAAI,OAAO,EAAE,CAAC;AACjC,eAAW,SAAS,WAAW;AAC7B,YAAM,MAAM,SAAS,KAAK,MAAM,QAAQ;AACxC,cAAQ,IAAI,eAAe,MAAM,UAAU,OAAO,EAAE,CAAC,IAAI,GAAG,EAAE;AAAA,IAChE;AAAA,EACF;AAGA,MAAI,QAAQ,SAAS,GAAG;AACtB,YAAQ,IAAI,aAAa;AACzB,YAAQ,IAAI,OAAO,SAAI,OAAO,EAAE,CAAC;AACjC,eAAW,UAAU,SAAS;AAC5B,YAAM,MAAM,SAAS,KAAK,OAAO,QAAQ;AACzC,cAAQ,IAAI,8BAA8B,OAAO,WAAW,OAAO,EAAE,CAAC,IAAI,GAAG,EAAE;AAAA,IACjF;AAAA,EACF;AAGA,MAAI,SAAS,SAAS,GAAG;AACvB,YAAQ,IAAI,eAAe;AAC3B,YAAQ,IAAI,OAAO,SAAI,OAAO,EAAE,CAAC;AACjC,eAAW,SAAS,UAAU;AAC5B,YAAM,MAAM,SAAS,KAAK,MAAM,QAAQ;AACxC,cAAQ,IAAI,eAAe,MAAM,OAAO,OAAO,EAAE,CAAC,IAAI,GAAG,EAAE;AAAA,IAC7D;AAAA,EACF;AAEA,UAAQ,IAAI;AAAA,WAAc,UAAU;AAAA,CAAc;AACpD;","names":[]}
|
|
@@ -24,10 +24,10 @@ import {
|
|
|
24
24
|
verifyOAuthState,
|
|
25
25
|
verifyTotp
|
|
26
26
|
} from "../../chunk-SJIRP73B.js";
|
|
27
|
-
import "../../chunk-ZJQ4O76G.js";
|
|
28
27
|
import {
|
|
29
28
|
generateNonce
|
|
30
29
|
} from "../../chunk-C3ZZ56YZ.js";
|
|
30
|
+
import "../../chunk-ZJQ4O76G.js";
|
|
31
31
|
import "../../chunk-DGUM43GV.js";
|
|
32
32
|
export {
|
|
33
33
|
AuthRequiredError,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { A as AgentEvent } from '../../agent-events-DosDXkSV.js';
|
|
3
2
|
import { UIMessageChunk } from 'ai';
|
|
4
3
|
import { b as WebSocketLike } from '../../define-websocket-CdK94O-D.js';
|
|
5
4
|
export { W as WebSocketHandler, a as WebSocketHandlerWeb, d as defineWebSocket, c as defineWebSocketWeb } from '../../define-websocket-CdK94O-D.js';
|
|
@@ -120,72 +119,6 @@ type MiddlewareHandler = (request: Request, next: (request: Request) => Promise<
|
|
|
120
119
|
*/
|
|
121
120
|
declare function defineMiddleware(handler: MiddlewareHandler): MiddlewareHandler;
|
|
122
121
|
|
|
123
|
-
/**
|
|
124
|
-
* T5.1 — defineAgentEndpoint
|
|
125
|
-
*
|
|
126
|
-
* Sugar over defineRoute (ADR D4). Accepts an async generator that yields
|
|
127
|
-
* AgentEvents and produces a RouteConfig whose handler returns a Response
|
|
128
|
-
* streaming Server-Sent Events (SSE).
|
|
129
|
-
*
|
|
130
|
-
* Wire format: `data: <JSON>\n\n` per event. Standards-compliant.
|
|
131
|
-
*
|
|
132
|
-
* The generator may throw — the wrapper catches and emits a final
|
|
133
|
-
* `{ type: 'error', message }` event before closing the stream.
|
|
134
|
-
*
|
|
135
|
-
* The wrapper observes `request.signal` (EC-7) — when aborted, the
|
|
136
|
-
* underlying generator is told to `return()` and the stream closes
|
|
137
|
-
* promptly.
|
|
138
|
-
*
|
|
139
|
-
* Note (EC-12, Out of Scope): SSE backpressure (slow consumer) is not
|
|
140
|
-
* handled here. For high-frequency token streaming consider a different
|
|
141
|
-
* transport (WS) or a buffer policy. This MVP enqueues each event
|
|
142
|
-
* immediately.
|
|
143
|
-
*/
|
|
144
|
-
interface AgentEndpointHandlerArgs<TCtx = unknown, TBody = unknown, TParams extends z.ZodType = z.ZodUndefined> {
|
|
145
|
-
query: undefined;
|
|
146
|
-
body: TBody;
|
|
147
|
-
params: z.infer<TParams>;
|
|
148
|
-
request: Request;
|
|
149
|
-
ctx: TCtx;
|
|
150
|
-
/**
|
|
151
|
-
* Mutable headers bag that the wrapper merges into the SSE response BEFORE
|
|
152
|
-
* the stream starts. Used by `createConversationHistory` to issue a
|
|
153
|
-
* conversation-id cookie on first request. Append entries via
|
|
154
|
-
* `cookieHeaders.append('set-cookie', '<cookie-string>')`.
|
|
155
|
-
*
|
|
156
|
-
* Cookies appended AFTER the first yield are NOT applied — the response
|
|
157
|
-
* headers commit when the wrapper constructs the Response, before the
|
|
158
|
-
* async generator runs. This is per HTTP semantics, not a wrapper choice.
|
|
159
|
-
*/
|
|
160
|
-
cookieHeaders: Headers;
|
|
161
|
-
/**
|
|
162
|
-
* Phase 3 (Production-Readiness #5) — request abort signal.
|
|
163
|
-
*
|
|
164
|
-
* Fires when the SSE client disconnects (browser closes tab, abort fetch,
|
|
165
|
-
* etc.). Thread this to `agent.send(msg, { signal })` so the SDK cancels
|
|
166
|
-
* the in-flight provider call — STOPS TOKENS FROM CHARGING for output
|
|
167
|
-
* the user will never receive.
|
|
168
|
-
*
|
|
169
|
-
* EC-1 (MUST FIX): the signal is derived via duck-type detection
|
|
170
|
-
* (`'aborted' in r.signal && typeof r.signal.addEventListener === 'function'`)
|
|
171
|
-
* to survive cross-realm scenarios (Node 18 polyfills, undici, Edge
|
|
172
|
-
* runtimes with their own AbortSignal globals). `instanceof AbortSignal`
|
|
173
|
-
* would fail in those cases.
|
|
174
|
-
*/
|
|
175
|
-
signal: AbortSignal;
|
|
176
|
-
}
|
|
177
|
-
interface AgentEndpointConfig<TCtx = unknown, TBody = unknown, TParams extends z.ZodType = z.ZodUndefined> {
|
|
178
|
-
/**
|
|
179
|
-
* Optional Zod schema for path params (e.g. `z.object({ id: z.string() })`).
|
|
180
|
-
* When present, the runner validates path params and returns 400 on mismatch
|
|
181
|
-
* BEFORE the generator runs; the validated params are threaded to the
|
|
182
|
-
* generator typed as `z.infer<TParams>` (D4).
|
|
183
|
-
*/
|
|
184
|
-
params?: TParams;
|
|
185
|
-
handler: (args: AgentEndpointHandlerArgs<TCtx, TBody, TParams>) => AsyncGenerator<AgentEvent, void, unknown>;
|
|
186
|
-
}
|
|
187
|
-
declare function defineAgentEndpoint<TBody = unknown, TCtx = unknown, TParams extends z.ZodType = z.ZodUndefined>(config: AgentEndpointConfig<TCtx, TBody, TParams>): RouteConfig<z.ZodUndefined, z.ZodUndefined, TParams, TCtx, Response>;
|
|
188
|
-
|
|
189
122
|
declare function uiMessageStreamResponse(chunks: AsyncIterable<UIMessageChunk>): Response;
|
|
190
123
|
|
|
191
124
|
/**
|
|
@@ -201,8 +134,8 @@ declare function uiMessageStreamResponse(chunks: AsyncIterable<UIMessageChunk>):
|
|
|
201
134
|
* Handler error propagation:
|
|
202
135
|
* `defineAgentTool` parses the input via the Zod schema BEFORE calling the
|
|
203
136
|
* user handler. Invalid input throws a `ZodError`, which the SDK's tool-
|
|
204
|
-
* dispatcher
|
|
205
|
-
*
|
|
137
|
+
* dispatcher treats as a tool failure and surfaces to the model as a tool
|
|
138
|
+
* error (the SDK owns the wire; ADR D3).
|
|
206
139
|
*/
|
|
207
140
|
/**
|
|
208
141
|
* Local mirror of the SDK's `CustomTool` interface. We don't `import type`
|
|
@@ -310,4 +243,4 @@ declare function defineWebChannel<TMessage = unknown>(handler: WebChannelHandler
|
|
|
310
243
|
*/
|
|
311
244
|
declare function defineTheoPlugin(plugin: TheoPlugin): TheoPlugin;
|
|
312
245
|
|
|
313
|
-
export { type ActionAccept, type ActionConfig, type
|
|
246
|
+
export { type ActionAccept, type ActionConfig, type ChannelHandler, type CustomTool, type DefineAgentToolSpec, type MiddlewareHandler, type RouteConfig, type WebChannelHandler, WebSocketLike, defineAction, defineAgentTool, defineChannel, defineMiddleware, defineRoute, defineTheoPlugin, defineWebChannel, uiMessageStreamResponse };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineAction,
|
|
3
|
-
defineAgentEndpoint,
|
|
4
3
|
defineAgentTool,
|
|
5
4
|
defineChannel,
|
|
6
5
|
defineMiddleware,
|
|
@@ -9,10 +8,10 @@ import {
|
|
|
9
8
|
defineWebChannel,
|
|
10
9
|
defineWebSocket,
|
|
11
10
|
defineWebSocketWeb
|
|
12
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-KGFNWIMS.js";
|
|
13
12
|
import {
|
|
14
13
|
uiMessageStreamResponse
|
|
15
|
-
} from "../../chunk-
|
|
14
|
+
} from "../../chunk-JZHT3LW7.js";
|
|
16
15
|
import {
|
|
17
16
|
HEALTH_PATH,
|
|
18
17
|
READY_PATH,
|
|
@@ -25,7 +24,6 @@ export {
|
|
|
25
24
|
HEALTH_PATH,
|
|
26
25
|
READY_PATH,
|
|
27
26
|
defineAction,
|
|
28
|
-
defineAgentEndpoint,
|
|
29
27
|
defineAgentTool,
|
|
30
28
|
defineChannel,
|
|
31
29
|
defineHealthRoute,
|
|
@@ -24,9 +24,9 @@ import {
|
|
|
24
24
|
runMiddlewareAndContext,
|
|
25
25
|
sendError,
|
|
26
26
|
sendJson
|
|
27
|
-
} from "../../chunk-
|
|
27
|
+
} from "../../chunk-H243MR3F.js";
|
|
28
28
|
import "../../chunk-GY5Q27BJ.js";
|
|
29
|
-
import "../../chunk-
|
|
29
|
+
import "../../chunk-Z5IGLBWE.js";
|
|
30
30
|
import "../../chunk-ZEGYW52B.js";
|
|
31
31
|
import "../../chunk-TSLSIRBR.js";
|
|
32
32
|
import "../../chunk-UD3LFGDL.js";
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { RouteConfig } from './define/index.js';
|
|
2
|
-
export { ActionAccept, ActionConfig,
|
|
2
|
+
export { ActionAccept, ActionConfig, ChannelHandler, CustomTool, DefineAgentToolSpec, MiddlewareHandler, WebChannelHandler, defineAction, defineAgentTool, defineChannel, defineMiddleware, defineRoute, defineTheoPlugin, defineWebChannel, uiMessageStreamResponse } from './define/index.js';
|
|
3
3
|
export { W as WebSocketHandler, a as WebSocketHandlerWeb, b as WebSocketLike, d as defineWebSocket, c as defineWebSocketWeb } from '../define-websocket-CdK94O-D.js';
|
|
4
4
|
export { H as HEALTH_PATH, a as HealthRouteConfig, b as READY_PATH, c as ReadyRouteConfig, d as ReservedResponse, R as ReservedRoutes, e as defineHealthRoute, f as defineReadyRoute, s as serveReservedRoute } from '../health-route-C0hk64_U.js';
|
|
5
5
|
export { B as BATCH_PATH, a as BatchExecuteFn, b as BatchPathConflictError, c as BatchPayload, d as BatchRequestItem, e as BatchResponse, f as BatchResultItem, C as CookieOptions, g as CorsConfig, h as CorsHandler, i as CorsOrigin, j as CorsWebHandler, k as CustomErrorPages, E as ExecuteActionOptions, l as ExecuteRouteContext, H as HandleBatchOptions, M as MAX_ERROR_HTML_BYTES, m as MiddlewareResult, N as NotFoundError, S as STRIPPED_HEADERS, n as SendErrorInput, o as SendErrorOptions, T as TRACE_HEADER, p as TRACE_PARENT_HEADER, q as TheoError, r as TheoTransformer, _ as _resetMiddlewareCacheForTests, s as appendCookieToHeaders, t as appendDeleteCookieToHeaders, u as createCorsHandler, v as createCorsWebHandler, w as deleteCookie, x as envelopeCodeToStatus, y as executeAction, z as executeRoute, A as extractTraceId, D as extractTraceIdFromRequest, F as fromUnknown, G as getCookie, I as getCookieFromRequest, J as handleBatchRequest, K as handleRequestError, L as handleWebRequestError, O as jsonTransformer, P as loadCustomErrorPages, Q as matchesOrigin, R as parseCookieHeader, U as parseTraceparent, V as resolveTransformer, W as runMiddlewareAndContext, X as sendError, Y as sendJson, Z as serializeCookie, $ as serveStaticFile, a0 as serverErrorToEnvelope, a1 as setCookie, a2 as superjsonTransformer } from '../index-B40qUSrQ.js';
|
|
6
6
|
export { ActionNode, ActionScanError, LoadedManifest, ManifestAction, ManifestAgent, ManifestRoute, ManifestWebSocket, TheoManifest, WebSocketRouteNode, generateManifest, loadManifest, scanMiddlewares, scanServerActions, scanServerActionsEnriched, scanServerRoutes, scanWebSocketRoutes, writeManifest } from './scan/index.js';
|
|
7
7
|
export { L as LoadModule, S as ServerRouteNode, c as compilePattern, a as createProductionLoader, b as createViteLoader, m as matchRoute } from '../match-CfbEFRG4.js';
|
|
8
8
|
import { T as TheoErrorEnvelope, a as TheoErrorCode, V as ValidationFieldsExt } from '../error-envelope-BsNzzAV5.js';
|
|
9
|
-
export { AgentRunLike, AgentRunResult, AgentRunStreamMessage, ConversationHistoryArgs, ConversationHistoryResult, ConversationStorageLike, SdkAgent, SdkAgentOptions, SdkRunLike, createConversationHistory, errorToEvent, streamAgentRun } from './agent/index.js';
|
|
10
|
-
export { a as AgentErrorEvent, A as AgentEvent, b as AgentMessageEvent, f as AgentRunErrorCode, c as AgentThinkingEvent, d as AgentToolCallEvent, e as AgentToolResultEvent } from '../agent-events-DosDXkSV.js';
|
|
11
9
|
export { AuthRequiredError, BackupCode, BackupCodeOptions, OidcMetadata, PkceChallenge, SessionConfig, SessionManager, SessionManagerWeb, SessionMeta, ThrottleOptions, ThrottleState, TotpAlgorithm, TotpOptions, TotpUriOptions, 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 } from './auth/index.js';
|
|
12
10
|
export { InMemoryUsageStorage, ToolHookEvent, ToolUsageRecord, TrackAgentRunInput, TrackAgentRunOptions, TrackAgentToolsHooks, TrackAgentToolsOptions, UsageQuery, UsageRecord, UsageResult, UsageStorageAdapter, trackAgentRun, trackAgentTools } from './cost/index.js';
|
|
13
11
|
export { CRON_MANIFEST_SCHEMA_VERSION, CronConcurrencyPolicy, CronContext, CronDefinition, CronManifest, CronManifestEntry, CronNode, CronOptions, CronScheduler, DuplicateCronNameError, ExistingConfigUnparseableError, buildCronManifest, convertToAwsCron, createCronScheduler, defineCron, scanCrons, translateCronToAws, translateCronToCloudflare, translateCronToDeno, translateCronToVercel, validateCronSchedule, writeCronManifest } from './cron/index.js';
|
package/dist/server/index.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
StorageManager,
|
|
3
|
-
getStorageManager,
|
|
4
|
-
useDatabase,
|
|
5
|
-
useUnstorage
|
|
6
|
-
} from "../chunk-ESC54TAK.js";
|
|
7
1
|
import {
|
|
8
2
|
BodyTooLargeError,
|
|
9
3
|
DEFAULT_MAX_BODY_BYTES,
|
|
@@ -12,11 +6,6 @@ import {
|
|
|
12
6
|
readRawBody,
|
|
13
7
|
timingSafeEqual
|
|
14
8
|
} from "../chunk-UUFYP2UM.js";
|
|
15
|
-
import {
|
|
16
|
-
MAX_ERROR_HTML_BYTES,
|
|
17
|
-
loadCustomErrorPages,
|
|
18
|
-
serveStaticFile
|
|
19
|
-
} from "../chunk-OPLICDUB.js";
|
|
20
9
|
import {
|
|
21
10
|
DuplicateJobNameError,
|
|
22
11
|
InMemoryJobBackend,
|
|
@@ -53,6 +42,12 @@ import {
|
|
|
53
42
|
} from "../chunk-NM4WF3XD.js";
|
|
54
43
|
import "../chunk-E3JH6YUM.js";
|
|
55
44
|
import "../chunk-JHEAWR3L.js";
|
|
45
|
+
import {
|
|
46
|
+
StorageManager,
|
|
47
|
+
getStorageManager,
|
|
48
|
+
useDatabase,
|
|
49
|
+
useUnstorage
|
|
50
|
+
} from "../chunk-ESC54TAK.js";
|
|
56
51
|
import {
|
|
57
52
|
_resetEnvCache,
|
|
58
53
|
executeWebRequest,
|
|
@@ -60,52 +55,11 @@ import {
|
|
|
60
55
|
loadEnv,
|
|
61
56
|
resolveTransformer,
|
|
62
57
|
superjsonTransformer
|
|
63
|
-
} from "../chunk-
|
|
64
|
-
import {
|
|
65
|
-
ActionError,
|
|
66
|
-
ActionInputError,
|
|
67
|
-
BATCH_PATH,
|
|
68
|
-
BatchPathConflictError,
|
|
69
|
-
STRIPPED_HEADERS,
|
|
70
|
-
TRACE_HEADER,
|
|
71
|
-
TRACE_PARENT_HEADER,
|
|
72
|
-
_resetMiddlewareCacheForTests,
|
|
73
|
-
createCorsHandler,
|
|
74
|
-
createCorsWebHandler,
|
|
75
|
-
executeAction,
|
|
76
|
-
executeRoute,
|
|
77
|
-
extractTraceId,
|
|
78
|
-
extractTraceIdFromRequest,
|
|
79
|
-
extractUniversalIssues,
|
|
80
|
-
handleBatchRequest,
|
|
81
|
-
handleRequestError,
|
|
82
|
-
handleWebRequestError,
|
|
83
|
-
isActionError,
|
|
84
|
-
isInputError,
|
|
85
|
-
matchesOrigin,
|
|
86
|
-
parseTraceparent,
|
|
87
|
-
runMiddlewareAndContext,
|
|
88
|
-
sendError,
|
|
89
|
-
sendJson
|
|
90
|
-
} from "../chunk-TGTNRUH3.js";
|
|
91
|
-
import {
|
|
92
|
-
DuplicateContextKeyError,
|
|
93
|
-
createOutbox,
|
|
94
|
-
createOutboxDispatcher,
|
|
95
|
-
createQueueClient
|
|
96
|
-
} from "../chunk-GY5Q27BJ.js";
|
|
58
|
+
} from "../chunk-5UUOGAJH.js";
|
|
97
59
|
import {
|
|
98
60
|
findSuggestion,
|
|
99
61
|
levenshtein
|
|
100
62
|
} from "../chunk-5QW7IQQU.js";
|
|
101
|
-
import {
|
|
102
|
-
FileTooLargeError,
|
|
103
|
-
_resetWarnOnceForTests,
|
|
104
|
-
createLogger,
|
|
105
|
-
logRequest,
|
|
106
|
-
parseRequestBody,
|
|
107
|
-
warnOnce
|
|
108
|
-
} from "../chunk-WFNLNIJX.js";
|
|
109
63
|
import {
|
|
110
64
|
DuplicateDecorationError,
|
|
111
65
|
DuplicatePluginError,
|
|
@@ -135,9 +89,6 @@ import {
|
|
|
135
89
|
writeManifest
|
|
136
90
|
} from "../chunk-2J7XU3PW.js";
|
|
137
91
|
import "../chunk-WSJKACWB.js";
|
|
138
|
-
import {
|
|
139
|
-
scanMiddlewares
|
|
140
|
-
} from "../chunk-ZEGYW52B.js";
|
|
141
92
|
import {
|
|
142
93
|
CSP_REPORT_PATH,
|
|
143
94
|
CSRF_READINESS_PATH,
|
|
@@ -154,36 +105,6 @@ import {
|
|
|
154
105
|
normalizeLegacy,
|
|
155
106
|
normalizeNew
|
|
156
107
|
} from "../chunk-JBCHWRKF.js";
|
|
157
|
-
import {
|
|
158
|
-
CSRF_WARN_CODE,
|
|
159
|
-
CSRF_WARN_DOCS_URL,
|
|
160
|
-
enforceCsrf,
|
|
161
|
-
matchDisallowed,
|
|
162
|
-
validateCsrf,
|
|
163
|
-
validateCsrfRequest
|
|
164
|
-
} from "../chunk-TSLSIRBR.js";
|
|
165
|
-
import {
|
|
166
|
-
JsonStdoutSink,
|
|
167
|
-
createNoOpLogger,
|
|
168
|
-
safeAudit
|
|
169
|
-
} from "../chunk-UD3LFGDL.js";
|
|
170
|
-
import {
|
|
171
|
-
envelopeCodeToStatus
|
|
172
|
-
} from "../chunk-X32XEJXR.js";
|
|
173
|
-
import {
|
|
174
|
-
NotFoundError,
|
|
175
|
-
TheoError,
|
|
176
|
-
fromUnknown,
|
|
177
|
-
serverErrorToEnvelope
|
|
178
|
-
} from "../chunk-UVXB2ER7.js";
|
|
179
|
-
import {
|
|
180
|
-
__resetSdkForTests,
|
|
181
|
-
__setSdkForTests,
|
|
182
|
-
createConversationHistory,
|
|
183
|
-
errorToEvent,
|
|
184
|
-
streamAgentRun
|
|
185
|
-
} from "../chunk-2KZQPDYR.js";
|
|
186
|
-
import "../chunk-EXP56GFQ.js";
|
|
187
108
|
import {
|
|
188
109
|
AuthRequiredError,
|
|
189
110
|
_resetKeyCacheForTests,
|
|
@@ -210,16 +131,6 @@ import {
|
|
|
210
131
|
verifyOAuthState,
|
|
211
132
|
verifyTotp
|
|
212
133
|
} from "../chunk-SJIRP73B.js";
|
|
213
|
-
import {
|
|
214
|
-
appendCookieToHeaders,
|
|
215
|
-
appendDeleteCookieToHeaders,
|
|
216
|
-
deleteCookie,
|
|
217
|
-
getCookie,
|
|
218
|
-
getCookieFromRequest,
|
|
219
|
-
parseCookieHeader,
|
|
220
|
-
serializeCookie,
|
|
221
|
-
setCookie
|
|
222
|
-
} from "../chunk-ZJQ4O76G.js";
|
|
223
134
|
import {
|
|
224
135
|
generateNonce
|
|
225
136
|
} from "../chunk-C3ZZ56YZ.js";
|
|
@@ -250,7 +161,6 @@ import "../chunk-7MQOHNHE.js";
|
|
|
250
161
|
import "../chunk-X2VVCJ4V.js";
|
|
251
162
|
import {
|
|
252
163
|
defineAction,
|
|
253
|
-
defineAgentEndpoint,
|
|
254
164
|
defineAgentTool,
|
|
255
165
|
defineChannel,
|
|
256
166
|
defineMiddleware,
|
|
@@ -259,10 +169,10 @@ import {
|
|
|
259
169
|
defineWebChannel,
|
|
260
170
|
defineWebSocket,
|
|
261
171
|
defineWebSocketWeb
|
|
262
|
-
} from "../chunk-
|
|
172
|
+
} from "../chunk-KGFNWIMS.js";
|
|
263
173
|
import {
|
|
264
174
|
uiMessageStreamResponse
|
|
265
|
-
} from "../chunk-
|
|
175
|
+
} from "../chunk-JZHT3LW7.js";
|
|
266
176
|
import {
|
|
267
177
|
HEALTH_PATH,
|
|
268
178
|
READY_PATH,
|
|
@@ -270,6 +180,87 @@ import {
|
|
|
270
180
|
defineReadyRoute,
|
|
271
181
|
serveReservedRoute
|
|
272
182
|
} from "../chunk-V3LJN2GS.js";
|
|
183
|
+
import {
|
|
184
|
+
MAX_ERROR_HTML_BYTES,
|
|
185
|
+
loadCustomErrorPages,
|
|
186
|
+
serveStaticFile
|
|
187
|
+
} from "../chunk-OPLICDUB.js";
|
|
188
|
+
import {
|
|
189
|
+
ActionError,
|
|
190
|
+
ActionInputError,
|
|
191
|
+
BATCH_PATH,
|
|
192
|
+
BatchPathConflictError,
|
|
193
|
+
STRIPPED_HEADERS,
|
|
194
|
+
TRACE_HEADER,
|
|
195
|
+
TRACE_PARENT_HEADER,
|
|
196
|
+
_resetMiddlewareCacheForTests,
|
|
197
|
+
createCorsHandler,
|
|
198
|
+
createCorsWebHandler,
|
|
199
|
+
executeAction,
|
|
200
|
+
executeRoute,
|
|
201
|
+
extractTraceId,
|
|
202
|
+
extractTraceIdFromRequest,
|
|
203
|
+
extractUniversalIssues,
|
|
204
|
+
handleBatchRequest,
|
|
205
|
+
handleRequestError,
|
|
206
|
+
handleWebRequestError,
|
|
207
|
+
isActionError,
|
|
208
|
+
isInputError,
|
|
209
|
+
matchesOrigin,
|
|
210
|
+
parseTraceparent,
|
|
211
|
+
runMiddlewareAndContext,
|
|
212
|
+
sendError,
|
|
213
|
+
sendJson
|
|
214
|
+
} from "../chunk-H243MR3F.js";
|
|
215
|
+
import {
|
|
216
|
+
DuplicateContextKeyError,
|
|
217
|
+
createOutbox,
|
|
218
|
+
createOutboxDispatcher,
|
|
219
|
+
createQueueClient
|
|
220
|
+
} from "../chunk-GY5Q27BJ.js";
|
|
221
|
+
import {
|
|
222
|
+
FileTooLargeError,
|
|
223
|
+
_resetWarnOnceForTests,
|
|
224
|
+
createLogger,
|
|
225
|
+
logRequest,
|
|
226
|
+
parseRequestBody,
|
|
227
|
+
warnOnce
|
|
228
|
+
} from "../chunk-Z5IGLBWE.js";
|
|
229
|
+
import {
|
|
230
|
+
scanMiddlewares
|
|
231
|
+
} from "../chunk-ZEGYW52B.js";
|
|
232
|
+
import {
|
|
233
|
+
CSRF_WARN_CODE,
|
|
234
|
+
CSRF_WARN_DOCS_URL,
|
|
235
|
+
enforceCsrf,
|
|
236
|
+
matchDisallowed,
|
|
237
|
+
validateCsrf,
|
|
238
|
+
validateCsrfRequest
|
|
239
|
+
} from "../chunk-TSLSIRBR.js";
|
|
240
|
+
import {
|
|
241
|
+
JsonStdoutSink,
|
|
242
|
+
createNoOpLogger,
|
|
243
|
+
safeAudit
|
|
244
|
+
} from "../chunk-UD3LFGDL.js";
|
|
245
|
+
import {
|
|
246
|
+
envelopeCodeToStatus
|
|
247
|
+
} from "../chunk-X32XEJXR.js";
|
|
248
|
+
import {
|
|
249
|
+
NotFoundError,
|
|
250
|
+
TheoError,
|
|
251
|
+
fromUnknown,
|
|
252
|
+
serverErrorToEnvelope
|
|
253
|
+
} from "../chunk-UVXB2ER7.js";
|
|
254
|
+
import {
|
|
255
|
+
appendCookieToHeaders,
|
|
256
|
+
appendDeleteCookieToHeaders,
|
|
257
|
+
deleteCookie,
|
|
258
|
+
getCookie,
|
|
259
|
+
getCookieFromRequest,
|
|
260
|
+
parseCookieHeader,
|
|
261
|
+
serializeCookie,
|
|
262
|
+
setCookie
|
|
263
|
+
} from "../chunk-ZJQ4O76G.js";
|
|
273
264
|
import "../chunk-DGUM43GV.js";
|
|
274
265
|
|
|
275
266
|
// src/server/openapi/serve-docs.ts
|
|
@@ -1186,8 +1177,6 @@ export {
|
|
|
1186
1177
|
TRACE_PARENT_HEADER,
|
|
1187
1178
|
TheoCloudObservabilityAdapter,
|
|
1188
1179
|
TheoError,
|
|
1189
|
-
__resetSdkForTests,
|
|
1190
|
-
__setSdkForTests,
|
|
1191
1180
|
_resetCacheEngine,
|
|
1192
1181
|
_resetEnvCache,
|
|
1193
1182
|
_resetKeyCacheForTests,
|
|
@@ -1206,7 +1195,6 @@ export {
|
|
|
1206
1195
|
compileRouteRules,
|
|
1207
1196
|
convertToAwsCron,
|
|
1208
1197
|
createCacheEngine,
|
|
1209
|
-
createConversationHistory,
|
|
1210
1198
|
createCorsHandler,
|
|
1211
1199
|
createCorsWebHandler,
|
|
1212
1200
|
createCronScheduler,
|
|
@@ -1229,7 +1217,6 @@ export {
|
|
|
1229
1217
|
createViteLoader,
|
|
1230
1218
|
decrypt,
|
|
1231
1219
|
defineAction,
|
|
1232
|
-
defineAgentEndpoint,
|
|
1233
1220
|
defineAgentTool,
|
|
1234
1221
|
defineCachedFunction,
|
|
1235
1222
|
defineCachedRoute,
|
|
@@ -1257,7 +1244,6 @@ export {
|
|
|
1257
1244
|
encrypt,
|
|
1258
1245
|
enforceCsrf,
|
|
1259
1246
|
envelopeCodeToStatus,
|
|
1260
|
-
errorToEvent,
|
|
1261
1247
|
executeAction,
|
|
1262
1248
|
executeRoute,
|
|
1263
1249
|
executeWebRequest,
|
|
@@ -1332,7 +1318,6 @@ export {
|
|
|
1332
1318
|
serveStaticFile,
|
|
1333
1319
|
serverErrorToEnvelope,
|
|
1334
1320
|
setCookie,
|
|
1335
|
-
streamAgentRun,
|
|
1336
1321
|
superjsonTransformer,
|
|
1337
1322
|
timingSafeEqual,
|
|
1338
1323
|
totpUri,
|