theokit 0.47.0 → 0.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{actions-virtual-module-PUYSUA5O.js → actions-virtual-module-2VVLVXHY.js} +3 -3
- package/dist/{actions-virtual-module-Z76RNOJC.js → actions-virtual-module-Z5LXAX7E.js} +5 -4
- package/dist/actions-virtual-module-Z5LXAX7E.js.map +1 -0
- package/dist/{agent-3VDG5XK5.js → agent-Y3JKRROD.js} +2 -2
- package/dist/{app-typed-client-QYMZWXAW.js → app-typed-client-N4I4RBLT.js} +3 -3
- package/dist/{app-typed-client-VLT4FBKE.js → app-typed-client-NI3CM2FA.js} +5 -4
- package/dist/app-typed-client-NI3CM2FA.js.map +1 -0
- package/dist/boot/index.js +1 -1
- package/dist/{build-6KKFX33J.js → build-SJQDRD2B.js} +2 -2
- package/dist/chunk-6E5WKMDS.js +67 -0
- package/dist/chunk-6E5WKMDS.js.map +1 -0
- package/dist/{chunk-FZG3JYB3.js → chunk-7ZOQN7UH.js} +1 -1
- package/dist/{chunk-U3H53IIN.js → chunk-FO55VGMQ.js} +3 -3
- package/dist/{chunk-ELDTTO6P.js → chunk-GEHX6CAE.js} +2 -2
- package/dist/{chunk-7SABX4DJ.js → chunk-IZ3TIL6K.js} +28 -2
- package/dist/{chunk-7SABX4DJ.js.map → chunk-IZ3TIL6K.js.map} +1 -1
- package/dist/{chunk-B7XHGEDH.js → chunk-O5W7XSUX.js} +36 -36
- package/dist/chunk-O5W7XSUX.js.map +1 -0
- package/dist/{chunk-EIRQM55C.js → chunk-OJLL4YD6.js} +5 -46
- package/dist/chunk-OJLL4YD6.js.map +1 -0
- package/dist/{chunk-XTM32FF6.js → chunk-VQIUTCK2.js} +28 -2
- package/dist/{chunk-XTM32FF6.js.map → chunk-VQIUTCK2.js.map} +1 -1
- package/dist/{chunk-VPV7WABO.js → chunk-VTJMND23.js} +2 -2
- package/dist/{chunk-37ZO643S.js → chunk-XALU5LCU.js} +3 -3
- package/dist/{chunk-SEELKQUM.js → chunk-Y2KHTD2W.js} +6 -2
- package/dist/chunk-Y2KHTD2W.js.map +1 -0
- package/dist/{chunk-4TLLWXWH.js → chunk-YRRWQDKK.js} +11 -9
- package/dist/chunk-YRRWQDKK.js.map +1 -0
- package/dist/{chunk-OGU2MIHC.js → chunk-ZALJIZH2.js} +6 -6
- package/dist/cli/index.js +27 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/{dev-4NLBCCLU.js → dev-6TWDBX6G.js} +5 -5
- package/dist/doctor-Y53QTUSP.js +56 -0
- package/dist/doctor-Y53QTUSP.js.map +1 -0
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/{internal-api-C5UJG3E2.js → internal-api-REGN3WMX.js} +8 -6
- package/dist/{internal-api-XAQ7H73N.js → internal-api-XQA2L663.js} +3 -3
- package/dist/{mcp-TJIUDFY2.js → mcp-CO4AGAXV.js} +2 -2
- package/dist/server/agent/index.d.ts +90 -1
- package/dist/server/agent/index.js +14 -2
- package/dist/server/cost/index.d.ts +1 -0
- package/dist/server/cost/index.js +3 -1
- package/dist/server/http/index.js +2 -2
- package/dist/server/index.d.ts +4 -2
- package/dist/server/index.js +44 -5
- package/dist/server/index.js.map +1 -1
- package/dist/{server-error-to-envelope-UM7DEVM4.js → server-error-to-envelope-2MQOME5Q.js} +2 -2
- package/dist/{server-error-to-envelope-J5NFZGCQ.js → server-error-to-envelope-4TGCDQ2S.js} +2 -2
- package/dist/sessions-gc-H4WC4IXB.js +38 -0
- package/dist/sessions-gc-H4WC4IXB.js.map +1 -0
- package/dist/{start-XPQ4EJ6J.js → start-IO3ZYGEX.js} +4 -4
- package/dist/vite-plugin/index.js +6 -5
- package/dist/{vite-plugin-CD67YAD5.js → vite-plugin-NQ6F7FGV.js} +5 -5
- package/package.json +5 -5
- package/dist/actions-virtual-module-Z76RNOJC.js.map +0 -1
- package/dist/app-typed-client-VLT4FBKE.js.map +0 -1
- package/dist/chunk-4TLLWXWH.js.map +0 -1
- package/dist/chunk-B7XHGEDH.js.map +0 -1
- package/dist/chunk-EIRQM55C.js.map +0 -1
- package/dist/chunk-SEELKQUM.js.map +0 -1
- /package/dist/{actions-virtual-module-PUYSUA5O.js.map → actions-virtual-module-2VVLVXHY.js.map} +0 -0
- /package/dist/{agent-3VDG5XK5.js.map → agent-Y3JKRROD.js.map} +0 -0
- /package/dist/{app-typed-client-QYMZWXAW.js.map → app-typed-client-N4I4RBLT.js.map} +0 -0
- /package/dist/{build-6KKFX33J.js.map → build-SJQDRD2B.js.map} +0 -0
- /package/dist/{chunk-FZG3JYB3.js.map → chunk-7ZOQN7UH.js.map} +0 -0
- /package/dist/{chunk-U3H53IIN.js.map → chunk-FO55VGMQ.js.map} +0 -0
- /package/dist/{chunk-ELDTTO6P.js.map → chunk-GEHX6CAE.js.map} +0 -0
- /package/dist/{chunk-VPV7WABO.js.map → chunk-VTJMND23.js.map} +0 -0
- /package/dist/{chunk-37ZO643S.js.map → chunk-XALU5LCU.js.map} +0 -0
- /package/dist/{chunk-OGU2MIHC.js.map → chunk-ZALJIZH2.js.map} +0 -0
- /package/dist/{dev-4NLBCCLU.js.map → dev-6TWDBX6G.js.map} +0 -0
- /package/dist/{internal-api-C5UJG3E2.js.map → internal-api-REGN3WMX.js.map} +0 -0
- /package/dist/{internal-api-XAQ7H73N.js.map → internal-api-XQA2L663.js.map} +0 -0
- /package/dist/{mcp-TJIUDFY2.js.map → mcp-CO4AGAXV.js.map} +0 -0
- /package/dist/{server-error-to-envelope-UM7DEVM4.js.map → server-error-to-envelope-2MQOME5Q.js.map} +0 -0
- /package/dist/{server-error-to-envelope-J5NFZGCQ.js.map → server-error-to-envelope-4TGCDQ2S.js.map} +0 -0
- /package/dist/{start-XPQ4EJ6J.js.map → start-IO3ZYGEX.js.map} +0 -0
- /package/dist/{vite-plugin-CD67YAD5.js.map → vite-plugin-NQ6F7FGV.js.map} +0 -0
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
} from "./chunk-GEQJAFSV.js";
|
|
9
9
|
import {
|
|
10
10
|
theoPluginAsync
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-ZALJIZH2.js";
|
|
12
|
+
import "./chunk-GEHX6CAE.js";
|
|
13
13
|
import "./chunk-2CVV6CNN.js";
|
|
14
14
|
import "./chunk-IEES3CHD.js";
|
|
15
15
|
import {
|
|
@@ -24,14 +24,14 @@ import {
|
|
|
24
24
|
} from "./chunk-CUYEA62B.js";
|
|
25
25
|
import "./chunk-5ODOE6EF.js";
|
|
26
26
|
import "./chunk-HRCNHWLP.js";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-VTJMND23.js";
|
|
28
28
|
import "./chunk-6GGWS7J3.js";
|
|
29
29
|
import "./chunk-FXZZS7YW.js";
|
|
30
30
|
import "./chunk-D3425YDV.js";
|
|
31
31
|
import "./chunk-LNVMHQ2Z.js";
|
|
32
32
|
import "./chunk-MNIQ5F3Y.js";
|
|
33
33
|
import "./chunk-A7JBF5FO.js";
|
|
34
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-VQIUTCK2.js";
|
|
35
35
|
|
|
36
36
|
// src/cli/commands/dev.ts
|
|
37
37
|
import react from "@vitejs/plugin-react";
|
|
@@ -112,4 +112,4 @@ export {
|
|
|
112
112
|
devCommand,
|
|
113
113
|
startDevServer
|
|
114
114
|
};
|
|
115
|
-
//# sourceMappingURL=dev-
|
|
115
|
+
//# sourceMappingURL=dev-6TWDBX6G.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import "tsx/esm";
|
|
3
|
+
|
|
4
|
+
// src/cli/commands/doctor.ts
|
|
5
|
+
import { diagnose, renderDiagnosis, secretPresence } from "@theokit/agents/doctor";
|
|
6
|
+
function credentialCheck(env) {
|
|
7
|
+
const candidates = ["OPENROUTER_API_KEY", "OPENAI_API_KEY", "ANTHROPIC_API_KEY"];
|
|
8
|
+
const found = candidates.find((name) => secretPresence(env[name]) === "present");
|
|
9
|
+
return found === void 0 ? {
|
|
10
|
+
name: "credential",
|
|
11
|
+
status: "fail",
|
|
12
|
+
detail: "absent \u2014 set one of OPENROUTER_API_KEY, OPENAI_API_KEY or ANTHROPIC_API_KEY, or run `theokit auth login`"
|
|
13
|
+
} : { name: "credential", status: "ok", detail: `${found}: ${secretPresence(env[found])}` };
|
|
14
|
+
}
|
|
15
|
+
async function mcpCheck(projectRoot) {
|
|
16
|
+
const { readFile } = await import("fs/promises");
|
|
17
|
+
const { join } = await import("path");
|
|
18
|
+
try {
|
|
19
|
+
const raw = await readFile(join(projectRoot, ".mcp.json"), "utf8");
|
|
20
|
+
const parsed = JSON.parse(raw);
|
|
21
|
+
const count = Object.keys(parsed.mcpServers ?? {}).length;
|
|
22
|
+
return { name: "mcp", status: "ok", detail: `${String(count)} server(s) configured` };
|
|
23
|
+
} catch (error) {
|
|
24
|
+
return error.code === "ENOENT" ? { name: "mcp", status: "warn", detail: "no .mcp.json \u2014 no MCP servers will start" } : {
|
|
25
|
+
name: "mcp",
|
|
26
|
+
status: "fail",
|
|
27
|
+
detail: `.mcp.json is unreadable: ${error.message}`
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async function subagentCheck(projectRoot) {
|
|
32
|
+
const { listSubagentNames } = await import("@theokit/agents");
|
|
33
|
+
const names = await listSubagentNames(projectRoot);
|
|
34
|
+
return names.length === 0 ? { name: "subagents", status: "warn", detail: "none defined in .theokit/agents/" } : { name: "subagents", status: "ok", detail: names.join(", ") };
|
|
35
|
+
}
|
|
36
|
+
async function doctorCommand(deps = {}) {
|
|
37
|
+
const projectRoot = deps.projectRoot ?? process.cwd();
|
|
38
|
+
const env = deps.env ?? process.env;
|
|
39
|
+
const write = deps.write ?? ((text) => {
|
|
40
|
+
process.stdout.write(`${text}
|
|
41
|
+
`);
|
|
42
|
+
});
|
|
43
|
+
const checks = [
|
|
44
|
+
credentialCheck(env),
|
|
45
|
+
await mcpCheck(projectRoot),
|
|
46
|
+
await subagentCheck(projectRoot),
|
|
47
|
+
...deps.extraChecks ?? []
|
|
48
|
+
];
|
|
49
|
+
const diagnosis = diagnose(checks);
|
|
50
|
+
write(renderDiagnosis(diagnosis));
|
|
51
|
+
return diagnosis.exitCode;
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
doctorCommand
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=doctor-Y53QTUSP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/doctor.ts"],"sourcesContent":["import { diagnose, renderDiagnosis, secretPresence, type Check } from '@theokit/agents/doctor'\n\n/**\n * M84 — `theokit doctor`: what will this installation actually DO?\n *\n * `theokit info` answers \"does my project parse?\". That is not the question an agent product has.\n * The question is which credential will be used, which MCP servers will start, which skills exist —\n * the RESOLVED state, not the declared one.\n *\n * ## Never prints a secret\n *\n * Enforced by `secretPresence` from the primitive: present / absent / unreadable, never a value, a\n * prefix, a truncation or a length. A doctor that printed secrets would be the one command built for\n * support that you must not paste into a support request.\n *\n * ## The list lives here, the mechanism does not\n *\n * `diagnose` / `renderDiagnosis` / `Check` come from `@theokit/agents/doctor`, because every product\n * re-derives them identically. WHICH checks to run is what differs per product — so this file holds\n * the framework's own list, and a product composes its own on top.\n */\n\n/**\n * The injection surface of {@link doctorCommand}.\n *\n * Exported because a product composing its own checks on top needs to name this shape — and because\n * Knip caught it exported from the module and reachable from nothing, which is the same\n * published-but-unreachable failure M67, M73 and M79 each closed one instance of.\n */\nexport interface DoctorDeps {\n readonly projectRoot?: string\n readonly env?: Readonly<Record<string, string | undefined>>\n /** Where the report goes. Injected so the suite never writes to the real stdout. */\n readonly write?: (text: string) => void\n /** Extra checks a product contributes. Appended after the framework's own. */\n readonly extraChecks?: readonly Check[]\n}\n\n/** The credential the run will use, reported WITHOUT its value. */\nfunction credentialCheck(env: Readonly<Record<string, string | undefined>>): Check {\n const candidates = ['OPENROUTER_API_KEY', 'OPENAI_API_KEY', 'ANTHROPIC_API_KEY'] as const\n const found = candidates.find((name) => secretPresence(env[name]) === 'present')\n return found === undefined\n ? {\n name: 'credential',\n status: 'fail',\n detail:\n 'absent — set one of OPENROUTER_API_KEY, OPENAI_API_KEY or ANTHROPIC_API_KEY, or run `theokit auth login`',\n }\n : { name: 'credential', status: 'ok', detail: `${found}: ${secretPresence(env[found])}` }\n}\n\n/** Whether an `.mcp.json` is present, and whether it parses. */\nasync function mcpCheck(projectRoot: string): Promise<Check> {\n const { readFile } = await import('node:fs/promises')\n const { join } = await import('node:path')\n try {\n const raw = await readFile(join(projectRoot, '.mcp.json'), 'utf8')\n const parsed: unknown = JSON.parse(raw)\n const count = Object.keys((parsed as { mcpServers?: object }).mcpServers ?? {}).length\n return { name: 'mcp', status: 'ok', detail: `${String(count)} server(s) configured` }\n } catch (error) {\n // An absent file is the common case and NOT a failure — most projects use no MCP server. A file\n // that exists and does not parse IS a failure, because the operator believes it is in effect.\n return (error as NodeJS.ErrnoException).code === 'ENOENT'\n ? { name: 'mcp', status: 'warn', detail: 'no .mcp.json — no MCP servers will start' }\n : {\n name: 'mcp',\n status: 'fail',\n detail: `.mcp.json is unreadable: ${(error as Error).message}`,\n }\n }\n}\n\n/** Whether `.theokit/agents/*.md` defines any subagent. */\nasync function subagentCheck(projectRoot: string): Promise<Check> {\n const { listSubagentNames } = await import('@theokit/agents')\n const names = await listSubagentNames(projectRoot)\n return names.length === 0\n ? { name: 'subagents', status: 'warn', detail: 'none defined in .theokit/agents/' }\n : { name: 'subagents', status: 'ok', detail: names.join(', ') }\n}\n\n/**\n * Run the framework's checks and report.\n *\n * Returns the exit code rather than calling `process.exit`: a command that exits cannot be tested,\n * and a doctor nobody ran is the one thing worse than no doctor.\n */\nexport async function doctorCommand(deps: DoctorDeps = {}): Promise<number> {\n const projectRoot = deps.projectRoot ?? process.cwd()\n const env = deps.env ?? process.env\n const write =\n deps.write ??\n ((text: string) => {\n process.stdout.write(`${text}\\n`)\n })\n\n const checks: Check[] = [\n credentialCheck(env),\n await mcpCheck(projectRoot),\n await subagentCheck(projectRoot),\n ...(deps.extraChecks ?? []),\n ]\n\n const diagnosis = diagnose(checks)\n write(renderDiagnosis(diagnosis))\n return diagnosis.exitCode\n}\n"],"mappings":";;;;AAAA,SAAS,UAAU,iBAAiB,sBAAkC;AAuCtE,SAAS,gBAAgB,KAA0D;AACjF,QAAM,aAAa,CAAC,sBAAsB,kBAAkB,mBAAmB;AAC/E,QAAM,QAAQ,WAAW,KAAK,CAAC,SAAS,eAAe,IAAI,IAAI,CAAC,MAAM,SAAS;AAC/E,SAAO,UAAU,SACb;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,QACE;AAAA,EACJ,IACA,EAAE,MAAM,cAAc,QAAQ,MAAM,QAAQ,GAAG,KAAK,KAAK,eAAe,IAAI,KAAK,CAAC,CAAC,GAAG;AAC5F;AAGA,eAAe,SAAS,aAAqC;AAC3D,QAAM,EAAE,SAAS,IAAI,MAAM,OAAO,aAAkB;AACpD,QAAM,EAAE,KAAK,IAAI,MAAM,OAAO,MAAW;AACzC,MAAI;AACF,UAAM,MAAM,MAAM,SAAS,KAAK,aAAa,WAAW,GAAG,MAAM;AACjE,UAAM,SAAkB,KAAK,MAAM,GAAG;AACtC,UAAM,QAAQ,OAAO,KAAM,OAAmC,cAAc,CAAC,CAAC,EAAE;AAChF,WAAO,EAAE,MAAM,OAAO,QAAQ,MAAM,QAAQ,GAAG,OAAO,KAAK,CAAC,wBAAwB;AAAA,EACtF,SAAS,OAAO;AAGd,WAAQ,MAAgC,SAAS,WAC7C,EAAE,MAAM,OAAO,QAAQ,QAAQ,QAAQ,gDAA2C,IAClF;AAAA,MACE,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,QAAQ,4BAA6B,MAAgB,OAAO;AAAA,IAC9D;AAAA,EACN;AACF;AAGA,eAAe,cAAc,aAAqC;AAChE,QAAM,EAAE,kBAAkB,IAAI,MAAM,OAAO,iBAAiB;AAC5D,QAAM,QAAQ,MAAM,kBAAkB,WAAW;AACjD,SAAO,MAAM,WAAW,IACpB,EAAE,MAAM,aAAa,QAAQ,QAAQ,QAAQ,mCAAmC,IAChF,EAAE,MAAM,aAAa,QAAQ,MAAM,QAAQ,MAAM,KAAK,IAAI,EAAE;AAClE;AAQA,eAAsB,cAAc,OAAmB,CAAC,GAAoB;AAC1E,QAAM,cAAc,KAAK,eAAe,QAAQ,IAAI;AACpD,QAAM,MAAM,KAAK,OAAO,QAAQ;AAChC,QAAM,QACJ,KAAK,UACJ,CAAC,SAAiB;AACjB,YAAQ,OAAO,MAAM,GAAG,IAAI;AAAA,CAAI;AAAA,EAClC;AAEF,QAAM,SAAkB;AAAA,IACtB,gBAAgB,GAAG;AAAA,IACnB,MAAM,SAAS,WAAW;AAAA,IAC1B,MAAM,cAAc,WAAW;AAAA,IAC/B,GAAI,KAAK,eAAe,CAAC;AAAA,EAC3B;AAEA,QAAM,YAAY,SAAS,MAAM;AACjC,QAAM,gBAAgB,SAAS,CAAC;AAChC,SAAO,UAAU;AACnB;","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
scanRoutes,
|
|
9
9
|
theoConfigSchema,
|
|
10
10
|
theoPlugin
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YRRWQDKK.js";
|
|
12
12
|
import "./chunk-SSYDEKWF.js";
|
|
13
13
|
import "./chunk-OIGJOYX6.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-OJLL4YD6.js";
|
|
15
|
+
import "./chunk-FO55VGMQ.js";
|
|
16
|
+
import "./chunk-XALU5LCU.js";
|
|
17
17
|
import "./chunk-47FFT43U.js";
|
|
18
18
|
import "./chunk-NTDN54XO.js";
|
|
19
19
|
import "./chunk-KD5G3YXI.js";
|
|
@@ -27,8 +27,9 @@ import "./chunk-MTEWLGVY.js";
|
|
|
27
27
|
import "./chunk-OLGPYOLO.js";
|
|
28
28
|
import "./chunk-AVQU5CQF.js";
|
|
29
29
|
import "./chunk-ACKBVBUI.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-IZ3TIL6K.js";
|
|
31
31
|
import "./chunk-YOIVCCZT.js";
|
|
32
|
+
import "./chunk-6E5WKMDS.js";
|
|
32
33
|
import "./chunk-JA2ZAT5Q.js";
|
|
33
34
|
import "./chunk-52PDWL5S.js";
|
|
34
35
|
import "./chunk-U267AOWS.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;;;ACiCA,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,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;;;AC5DA,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"]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
dispatchControllerRequest,
|
|
3
|
-
mountAgent
|
|
4
|
-
|
|
5
|
-
} from "./chunk-EIRQM55C.js";
|
|
3
|
+
mountAgent
|
|
4
|
+
} from "./chunk-OJLL4YD6.js";
|
|
6
5
|
import {
|
|
7
6
|
BATCH_PATH,
|
|
8
7
|
TRACE_HEADER,
|
|
@@ -13,7 +12,7 @@ import {
|
|
|
13
12
|
handleBatchRequest,
|
|
14
13
|
incomingMessageToHandlerRequest,
|
|
15
14
|
sendError
|
|
16
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-XALU5LCU.js";
|
|
17
16
|
import "./chunk-47FFT43U.js";
|
|
18
17
|
import {
|
|
19
18
|
findSuggestion
|
|
@@ -51,7 +50,10 @@ import {
|
|
|
51
50
|
import "./chunk-OLGPYOLO.js";
|
|
52
51
|
import "./chunk-AVQU5CQF.js";
|
|
53
52
|
import "./chunk-ACKBVBUI.js";
|
|
54
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-IZ3TIL6K.js";
|
|
54
|
+
import {
|
|
55
|
+
resolveProvider
|
|
56
|
+
} from "./chunk-6E5WKMDS.js";
|
|
55
57
|
import {
|
|
56
58
|
generateNonce
|
|
57
59
|
} from "./chunk-JA2ZAT5Q.js";
|
|
@@ -89,4 +91,4 @@ export {
|
|
|
89
91
|
scanWebSocketRoutes,
|
|
90
92
|
sendError
|
|
91
93
|
};
|
|
92
|
-
//# sourceMappingURL=internal-api-
|
|
94
|
+
//# sourceMappingURL=internal-api-REGN3WMX.js.map
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
findSuggestion,
|
|
22
22
|
generateNonce,
|
|
23
23
|
mountAgent
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-VTJMND23.js";
|
|
25
25
|
import {
|
|
26
26
|
resolveProvider
|
|
27
27
|
} from "./chunk-6GGWS7J3.js";
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
scanWebSocketRoutes
|
|
46
46
|
} from "./chunk-MNIQ5F3Y.js";
|
|
47
47
|
import "./chunk-A7JBF5FO.js";
|
|
48
|
-
import "./chunk-
|
|
48
|
+
import "./chunk-VQIUTCK2.js";
|
|
49
49
|
export {
|
|
50
50
|
BATCH_PATH,
|
|
51
51
|
CSP_REPORT_PATH,
|
|
@@ -78,4 +78,4 @@ export {
|
|
|
78
78
|
scanWebSocketRoutes,
|
|
79
79
|
sendError
|
|
80
80
|
};
|
|
81
|
-
//# sourceMappingURL=internal-api-
|
|
81
|
+
//# sourceMappingURL=internal-api-XQA2L663.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "tsx/esm";
|
|
3
3
|
import {
|
|
4
4
|
createAgentSsrLoader
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-O5W7XSUX.js";
|
|
6
6
|
import {
|
|
7
7
|
extractAppResources,
|
|
8
8
|
handleMcpJsonRpc
|
|
@@ -75,4 +75,4 @@ async function mcpCommand(name, deps = {}) {
|
|
|
75
75
|
export {
|
|
76
76
|
mcpCommand
|
|
77
77
|
};
|
|
78
|
-
//# sourceMappingURL=mcp-
|
|
78
|
+
//# sourceMappingURL=mcp-CO4AGAXV.js.map
|
|
@@ -5,6 +5,95 @@ export { InProcessApprovalRequest, InProcessApprovalRequiredError, InProcessAwai
|
|
|
5
5
|
import { CustomTool as CustomTool$1 } from '@theokit/sdk';
|
|
6
6
|
import { V as VerifyFn } from '../../webhook-types-CNUZY7o1.js';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Provider Resolver — Strategy + Registry pattern (FAANG-grade).
|
|
10
|
+
*
|
|
11
|
+
* Inspiration: Dapr Conversation Registry (`dapr/pkg/components/conversation/registry.go`)
|
|
12
|
+
* + Encore Manager provider array (`encore/runtimes/go/pubsub/manager_internal.go`).
|
|
13
|
+
*
|
|
14
|
+
* Principle: provider routing is the FRAMEWORK's responsibility, not the consumer's.
|
|
15
|
+
* The consumer template uses a plain `model: { id: 'gpt-4o-mini' }` — no conditionals.
|
|
16
|
+
*
|
|
17
|
+
* Wire protocol: OpenAI Chat Completions (universal — implemented by every
|
|
18
|
+
* os providers: OpenRouter, Groq, Mistral, Together, Anthropic via proxy, etc).
|
|
19
|
+
*
|
|
20
|
+
* Resolution by priority (FIRST match wins):
|
|
21
|
+
* 1. OPENROUTER_API_KEY → baseUrl=openrouter.ai (multi-model gateway)
|
|
22
|
+
* 2. OPENAI_API_KEY → baseUrl=api.openai.com
|
|
23
|
+
* 3. ANTHROPIC_API_KEY → direct Anthropic (Messages API, not OpenAI-compat)
|
|
24
|
+
*
|
|
25
|
+
* Escape hatch: an explicit `options.apiKey` OVERRIDES auto-resolution
|
|
26
|
+
* (the consumer can force a specific provider if it wants to).
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Provider configuration descriptor — Registry entry shape.
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
interface ProviderDescriptor {
|
|
34
|
+
/** Stable name used internally — not exposed on the wire. */
|
|
35
|
+
name: string;
|
|
36
|
+
/** Environment variable that holds the API key for this provider. */
|
|
37
|
+
envKey: string;
|
|
38
|
+
/** Base URL for the provider's OpenAI-compatible (or native) API. */
|
|
39
|
+
baseUrl: string;
|
|
40
|
+
/** Resolution priority (lower = higher priority). FIRST match wins. */
|
|
41
|
+
priority: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Resolved provider configuration — output of `resolveProvider()`.
|
|
45
|
+
*
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
48
|
+
interface ResolvedProvider {
|
|
49
|
+
name: string;
|
|
50
|
+
apiKey: string;
|
|
51
|
+
baseUrl: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Register a new provider (Registry pattern — runtime extension point).
|
|
55
|
+
* Useful for self-hosted endpoints or custom providers without touching theokit src.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* registerProvider({
|
|
59
|
+
* name: 'self-hosted',
|
|
60
|
+
* envKey: 'SELF_HOSTED_API_KEY',
|
|
61
|
+
* baseUrl: 'https://llm.internal.acme.com/v1',
|
|
62
|
+
* priority: 0, // highest priority
|
|
63
|
+
* })
|
|
64
|
+
*
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
67
|
+
declare function registerProvider(descriptor: ProviderDescriptor): void;
|
|
68
|
+
/**
|
|
69
|
+
* Reset registry to DEFAULT_REGISTRY (test-only / dev escape hatch).
|
|
70
|
+
*
|
|
71
|
+
* @public
|
|
72
|
+
*/
|
|
73
|
+
declare function resetProviderRegistry(): void;
|
|
74
|
+
/**
|
|
75
|
+
* Get current registry snapshot (read-only — inspection).
|
|
76
|
+
*
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
declare function listProviders(): readonly ProviderDescriptor[];
|
|
80
|
+
/**
|
|
81
|
+
* Resolve provider from env vars by priority. FIRST env var found wins.
|
|
82
|
+
*
|
|
83
|
+
* @returns ResolvedProvider with apiKey + baseUrl + name
|
|
84
|
+
* @throws Error if NO provider env var is set (actionable message)
|
|
85
|
+
*
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
declare function resolveProvider(): ResolvedProvider;
|
|
89
|
+
/**
|
|
90
|
+
* Try to resolve — does NOT throw. Returns null if no provider available.
|
|
91
|
+
* Useful for graceful degradation (e.g., mock mode).
|
|
92
|
+
*
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
declare function tryResolveProvider(): ResolvedProvider | null;
|
|
96
|
+
|
|
8
97
|
/**
|
|
9
98
|
* M26 (ADR-0041) — `createWorkflowTool`: wrap an SDK `Workflow` as a `CustomTool`.
|
|
10
99
|
*
|
|
@@ -320,4 +409,4 @@ interface StdioStreams {
|
|
|
320
409
|
*/
|
|
321
410
|
declare function serveMcpStdio(mod: unknown, name: string, appResources: readonly AppResource[], streams: StdioStreams): Promise<void>;
|
|
322
411
|
|
|
323
|
-
export { type AcpToolConfig, type AppResource, type AppResourceInput, type ChannelMessage, type ChannelWebhookConfig, type CodeModeApi, type CodeModeConfig, type CodeModePermission, CodeModePermissionDeniedError, type McpResourceContents, type McpResourceDescriptor, NodeAcpTransport, type Sandbox, type StdioStreams, type VendorAgentClient, type VendorAgentToolConfig, type WorkflowLike, type WorkflowToolConfig, buildResourceDescriptors, createACPTool, createCodeMode, createVendorAgentTool, createWorkflowTool, defineAppResource, extractAppResources, handleChannelWebhook, handleMcpStdioLine, isChannelPath, parseChannelPath, readAppResource, serveMcpStdio };
|
|
412
|
+
export { type AcpToolConfig, type AppResource, type AppResourceInput, type ChannelMessage, type ChannelWebhookConfig, type CodeModeApi, type CodeModeConfig, type CodeModePermission, CodeModePermissionDeniedError, type McpResourceContents, type McpResourceDescriptor, NodeAcpTransport, type ProviderDescriptor, type ResolvedProvider, type Sandbox, type StdioStreams, type VendorAgentClient, type VendorAgentToolConfig, type WorkflowLike, type WorkflowToolConfig, buildResourceDescriptors, createACPTool, createCodeMode, createVendorAgentTool, createWorkflowTool, defineAppResource, extractAppResources, handleChannelWebhook, handleMcpStdioLine, isChannelPath, listProviders, parseChannelPath, readAppResource, registerProvider, resetProviderRegistry, resolveProvider, serveMcpStdio, tryResolveProvider };
|
|
@@ -12,13 +12,20 @@ import {
|
|
|
12
12
|
parseChannelPath,
|
|
13
13
|
serveMcpStdio,
|
|
14
14
|
streamAgentTurnInProcess
|
|
15
|
-
} from "../../chunk-
|
|
15
|
+
} from "../../chunk-7ZOQN7UH.js";
|
|
16
16
|
import {
|
|
17
17
|
buildResourceDescriptors,
|
|
18
18
|
defineAppResource,
|
|
19
19
|
extractAppResources,
|
|
20
20
|
readAppResource
|
|
21
21
|
} from "../../chunk-YOIVCCZT.js";
|
|
22
|
+
import {
|
|
23
|
+
listProviders,
|
|
24
|
+
registerProvider,
|
|
25
|
+
resetProviderRegistry,
|
|
26
|
+
resolveProvider,
|
|
27
|
+
tryResolveProvider
|
|
28
|
+
} from "../../chunk-6E5WKMDS.js";
|
|
22
29
|
import "../../chunk-SAFGDIPQ.js";
|
|
23
30
|
import "../../chunk-XTHN6JBX.js";
|
|
24
31
|
export {
|
|
@@ -35,9 +42,14 @@ export {
|
|
|
35
42
|
handleChannelWebhook,
|
|
36
43
|
handleMcpStdioLine,
|
|
37
44
|
isChannelPath,
|
|
45
|
+
listProviders,
|
|
38
46
|
parseChannelPath,
|
|
39
47
|
readAppResource,
|
|
48
|
+
registerProvider,
|
|
49
|
+
resetProviderRegistry,
|
|
50
|
+
resolveProvider,
|
|
40
51
|
serveMcpStdio,
|
|
41
|
-
streamAgentTurnInProcess
|
|
52
|
+
streamAgentTurnInProcess,
|
|
53
|
+
tryResolveProvider
|
|
42
54
|
};
|
|
43
55
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
InMemoryUsageStorage,
|
|
3
|
+
InMemoryUsageStorage2,
|
|
3
4
|
trackAgentRun,
|
|
4
5
|
trackAgentTools
|
|
5
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-Y2KHTD2W.js";
|
|
6
7
|
import "../../chunk-XTHN6JBX.js";
|
|
7
8
|
export {
|
|
8
9
|
InMemoryUsageStorage,
|
|
10
|
+
InMemoryUsageStorage2 as NeutralUsageStorage,
|
|
9
11
|
trackAgentRun,
|
|
10
12
|
trackAgentTools
|
|
11
13
|
};
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
runMiddlewareAndContext,
|
|
25
25
|
sendError,
|
|
26
26
|
sendJson
|
|
27
|
-
} from "../../chunk-
|
|
27
|
+
} from "../../chunk-XALU5LCU.js";
|
|
28
28
|
import "../../chunk-47FFT43U.js";
|
|
29
29
|
import "../../chunk-KD5G3YXI.js";
|
|
30
30
|
import "../../chunk-FB2HBNIC.js";
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
TheoError,
|
|
39
39
|
fromUnknown,
|
|
40
40
|
serverErrorToEnvelope
|
|
41
|
-
} from "../../chunk-
|
|
41
|
+
} from "../../chunk-IZ3TIL6K.js";
|
|
42
42
|
import {
|
|
43
43
|
appendCookieToHeaders,
|
|
44
44
|
appendDeleteCookieToHeaders,
|
package/dist/server/index.d.ts
CHANGED
|
@@ -7,8 +7,11 @@ export { B as BATCH_PATH, a as BatchExecuteFn, b as BatchPathConflictError, c as
|
|
|
7
7
|
export { ActionNode, ActionScanError, LoadedManifest, ManifestAction, ManifestAgent, ManifestRoute, ManifestWebSocket, TheoManifest, WebSocketRouteNode, generateManifest, loadManifest, scanMiddlewares, scanServerActions, scanServerActionsEnriched, scanServerRoutes, scanWebSocketRoutes, writeManifest } from './scan/index.js';
|
|
8
8
|
export { L as LoadModule, S as ServerRouteNode, c as compilePattern, a as createProductionLoader, b as createViteLoader, m as matchRoute } from '../match-CfbEFRG4.js';
|
|
9
9
|
import { T as TheoErrorEnvelope, a as TheoErrorCode, V as ValidationFieldsExt } from '../error-envelope-DG47lt8E.js';
|
|
10
|
+
export { AcpToolConfig, AppResource, AppResourceInput, ChannelMessage, ChannelWebhookConfig, CodeModeApi, CodeModeConfig, CodeModePermission, CodeModePermissionDeniedError, McpResourceContents, McpResourceDescriptor, NodeAcpTransport, ProviderDescriptor, ResolvedProvider, Sandbox, StdioStreams, VendorAgentClient, VendorAgentToolConfig, WorkflowLike, WorkflowToolConfig, buildResourceDescriptors, createACPTool, createCodeMode, createVendorAgentTool, createWorkflowTool, defineAppResource, extractAppResources, handleChannelWebhook, handleMcpStdioLine, isChannelPath, listProviders, parseChannelPath, readAppResource, registerProvider, resetProviderRegistry, resolveProvider, serveMcpStdio, tryResolveProvider } from './agent/index.js';
|
|
11
|
+
export { InProcessApprovalRequest, InProcessApprovalRequiredError, InProcessAwaitApproval, StreamAgentTurnDeps, StreamAgentTurnInProcessInput, streamAgentTurnInProcess } from '@theokit/agents';
|
|
10
12
|
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';
|
|
11
13
|
export { InMemoryUsageStorage, ToolHookEvent, ToolUsageRecord, TrackAgentRunInput, TrackAgentRunOptions, TrackAgentToolsHooks, TrackAgentToolsOptions, UsageQuery, UsageRecord, UsageResult, UsageStorageAdapter, trackAgentRun, trackAgentTools } from './cost/index.js';
|
|
14
|
+
export { InMemoryUsageStorage as NeutralUsageStorage } from '@theokit/agents/usage';
|
|
12
15
|
export { CRON_MANIFEST_SCHEMA_VERSION, CronConcurrencyPolicy, CronContext, CronDefinition, CronManifest, CronManifestEntry, CronNode, CronOptions, CronScheduler, DuplicateCronNameError, ExistingConfigUnparseableError, buildCronManifest, convertToAwsCron, createCronScheduler, defineCron, scanCronDirs, scanCrons, translateCronToAws, translateCronToCloudflare, translateCronToDeno, translateCronToVercel, validateCronSchedule, writeCronManifest } from './cron/index.js';
|
|
13
16
|
export { DuplicateContextKeyError, DuplicateJobNameError, EnqueueOptions, InMemoryJobBackend, InMemoryJobBackendOptions, JOB_MANIFEST_SCHEMA_VERSION, JobContext, JobDefinition, JobManifest, JobManifestEntry, JobNode, JobOptions, JobRegistry, JobRunner, Outbox, OutboxFlushOptions, PostgresJobBackend, PostgresJobBackendOptions, QueueClient, buildJobManifest, createJobRunner, createOutbox, createOutboxDispatcher, createQueueClient, defineJob, scanJobs, writeJobManifest } from './jobs/index.js';
|
|
14
17
|
export { J as JobBackend, a as JobEnqueueInput, b as JobLease, N as NonRetryableError } from '../job-backend-CgC8Xf33.js';
|
|
@@ -29,11 +32,10 @@ export { G as GenericFactory, a as PoolLike, P as PostgresDatabaseConfig, c as R
|
|
|
29
32
|
export { BodyTooLargeError, DEFAULT_MAX_BODY_BYTES, RawBodyResult, ReadRawBodyOptions, defineWebhook, dispatchWebhook, readRawBody, timingSafeEqual } from './webhook/index.js';
|
|
30
33
|
export { D as DefineWebhookOptions, V as VerifyFn, a as VerifyResult, W as WebhookContext, b as WebhookDefinition } from '../webhook-types-CNUZY7o1.js';
|
|
31
34
|
import { z } from 'zod';
|
|
32
|
-
export { AcpToolConfig, AppResource, AppResourceInput, ChannelMessage, ChannelWebhookConfig, CodeModeApi, CodeModeConfig, CodeModePermission, CodeModePermissionDeniedError, McpResourceContents, McpResourceDescriptor, NodeAcpTransport, Sandbox, StdioStreams, VendorAgentClient, VendorAgentToolConfig, WorkflowLike, WorkflowToolConfig, buildResourceDescriptors, createACPTool, createCodeMode, createVendorAgentTool, createWorkflowTool, defineAppResource, extractAppResources, handleChannelWebhook, handleMcpStdioLine, isChannelPath, parseChannelPath, readAppResource, serveMcpStdio } from './agent/index.js';
|
|
33
|
-
export { InProcessApprovalRequest, InProcessApprovalRequiredError, InProcessAwaitApproval, StreamAgentTurnDeps, StreamAgentTurnInProcessInput, streamAgentTurnInProcess } from '@theokit/agents';
|
|
34
35
|
import { IncomingMessage } from 'node:http';
|
|
35
36
|
import { W as WebOnRequestHook, b as WebPreHandlerHook, c as WebOnResponseHook, d as WebOnErrorHook } from '../plugin-types-D69-lJZ9.js';
|
|
36
37
|
export { e as HookName, H as HookResult, O as OnErrorHook, f as OnRequestHook, g as OnResponseHook, P as PluginContext, h as PluginErrorContext, i as PreHandlerHook, R as RunHookOptions, a as TheoApp, T as TheoPlugin } from '../plugin-types-D69-lJZ9.js';
|
|
38
|
+
export { ComposeInstructionsOptions, ComposedInstructions, ConfigLayer, ContextPressure, ContextPressureThresholdError, ContextPressureThresholds, CustomCommand, CustomCommandsResult, DEFAULT_CONTEXT_PRESSURE_THRESHOLDS, InstructionBlock, InstructionSource, InstructionTree, InstructionTreeBudget, LayerOutOfOrderError, LayeredConfig, LayeredConfigInput, LayeredConfigResult, LoadCustomCommandsInput, LoadInstructionTreeInput, ParsedFrontmatter, PrecedenceReport, ProvenancePerKey, TrustRecord, TrustStore, TrustStorePermissionsError, composeInstructions, contextPressure, effectiveContextWindow, frontmatterValue, loadCustomCommands, loadInstructionTree, splitFrontmatter } from '@theokit/agents/config';
|
|
37
39
|
export { a as ServiceDefinition, S as ServicesConfig, b as ServicesConfigInput, c as ServicesConfigOutput } from '../schema-BpH6ivDY.js';
|
|
38
40
|
import '@theokit/presenter/wire';
|
|
39
41
|
import 'vite';
|
package/dist/server/index.js
CHANGED
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
resolveTransformer,
|
|
62
62
|
superjsonTransformer,
|
|
63
63
|
validateRouteInput
|
|
64
|
-
} from "../chunk-
|
|
64
|
+
} from "../chunk-FO55VGMQ.js";
|
|
65
65
|
import {
|
|
66
66
|
ActionError,
|
|
67
67
|
ActionInputError,
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
runMiddlewareAndContext,
|
|
89
89
|
sendError,
|
|
90
90
|
sendJson
|
|
91
|
-
} from "../chunk-
|
|
91
|
+
} from "../chunk-XALU5LCU.js";
|
|
92
92
|
import {
|
|
93
93
|
DuplicateContextKeyError,
|
|
94
94
|
createOutbox,
|
|
@@ -176,7 +176,7 @@ import {
|
|
|
176
176
|
TheoError,
|
|
177
177
|
fromUnknown,
|
|
178
178
|
serverErrorToEnvelope
|
|
179
|
-
} from "../chunk-
|
|
179
|
+
} from "../chunk-IZ3TIL6K.js";
|
|
180
180
|
import {
|
|
181
181
|
CodeModePermissionDeniedError,
|
|
182
182
|
InProcessApprovalRequiredError,
|
|
@@ -191,13 +191,20 @@ import {
|
|
|
191
191
|
parseChannelPath,
|
|
192
192
|
serveMcpStdio,
|
|
193
193
|
streamAgentTurnInProcess
|
|
194
|
-
} from "../chunk-
|
|
194
|
+
} from "../chunk-7ZOQN7UH.js";
|
|
195
195
|
import {
|
|
196
196
|
buildResourceDescriptors,
|
|
197
197
|
defineAppResource,
|
|
198
198
|
extractAppResources,
|
|
199
199
|
readAppResource
|
|
200
200
|
} from "../chunk-YOIVCCZT.js";
|
|
201
|
+
import {
|
|
202
|
+
listProviders,
|
|
203
|
+
registerProvider,
|
|
204
|
+
resetProviderRegistry,
|
|
205
|
+
resolveProvider,
|
|
206
|
+
tryResolveProvider
|
|
207
|
+
} from "../chunk-6E5WKMDS.js";
|
|
201
208
|
import {
|
|
202
209
|
AuthRequiredError,
|
|
203
210
|
_resetKeyCacheForTests,
|
|
@@ -239,9 +246,10 @@ import {
|
|
|
239
246
|
} from "../chunk-JA2ZAT5Q.js";
|
|
240
247
|
import {
|
|
241
248
|
InMemoryUsageStorage,
|
|
249
|
+
InMemoryUsageStorage2,
|
|
242
250
|
trackAgentRun,
|
|
243
251
|
trackAgentTools
|
|
244
|
-
} from "../chunk-
|
|
252
|
+
} from "../chunk-Y2KHTD2W.js";
|
|
245
253
|
import {
|
|
246
254
|
CRON_MANIFEST_SCHEMA_VERSION,
|
|
247
255
|
DuplicateCronNameError,
|
|
@@ -1179,6 +1187,18 @@ var CTX_WRITERS = {
|
|
|
1179
1187
|
};
|
|
1180
1188
|
|
|
1181
1189
|
// src/server/index.ts
|
|
1190
|
+
import { LayeredConfig, LayerOutOfOrderError } from "@theokit/agents/config";
|
|
1191
|
+
import { TrustStore, TrustStorePermissionsError } from "@theokit/agents/config";
|
|
1192
|
+
import { loadCustomCommands } from "@theokit/agents/config";
|
|
1193
|
+
import { frontmatterValue, splitFrontmatter } from "@theokit/agents/config";
|
|
1194
|
+
import { loadInstructionTree } from "@theokit/agents/config";
|
|
1195
|
+
import { composeInstructions } from "@theokit/agents/config";
|
|
1196
|
+
import {
|
|
1197
|
+
DEFAULT_CONTEXT_PRESSURE_THRESHOLDS,
|
|
1198
|
+
ContextPressureThresholdError,
|
|
1199
|
+
contextPressure,
|
|
1200
|
+
effectiveContextWindow
|
|
1201
|
+
} from "@theokit/agents/config";
|
|
1182
1202
|
if (typeof globalThis !== "undefined") {
|
|
1183
1203
|
const WARN_KEY = "__theokit_server_umbrella_warn_emitted__";
|
|
1184
1204
|
const g = globalThis;
|
|
@@ -1212,7 +1232,9 @@ export {
|
|
|
1212
1232
|
ChannelManager,
|
|
1213
1233
|
CodeModePermissionDeniedError,
|
|
1214
1234
|
ConsoleObservabilityAdapter,
|
|
1235
|
+
ContextPressureThresholdError,
|
|
1215
1236
|
CsrfReadinessStore,
|
|
1237
|
+
DEFAULT_CONTEXT_PRESSURE_THRESHOLDS,
|
|
1216
1238
|
DEFAULT_CSP,
|
|
1217
1239
|
DEFAULT_EXCLUDED_QUERY_PARAMS,
|
|
1218
1240
|
DEFAULT_MAX_BODY_BYTES,
|
|
@@ -1233,7 +1255,10 @@ export {
|
|
|
1233
1255
|
InvalidPluginShapeError,
|
|
1234
1256
|
JOB_MANIFEST_SCHEMA_VERSION,
|
|
1235
1257
|
JsonStdoutSink,
|
|
1258
|
+
LayerOutOfOrderError,
|
|
1259
|
+
LayeredConfig,
|
|
1236
1260
|
MAX_ERROR_HTML_BYTES,
|
|
1261
|
+
InMemoryUsageStorage2 as NeutralUsageStorage,
|
|
1237
1262
|
NodeAcpTransport,
|
|
1238
1263
|
NonRetryableError,
|
|
1239
1264
|
NoopObservabilityAdapter,
|
|
@@ -1252,6 +1277,8 @@ export {
|
|
|
1252
1277
|
TRACE_PARENT_HEADER,
|
|
1253
1278
|
TheoCloudObservabilityAdapter,
|
|
1254
1279
|
TheoError,
|
|
1280
|
+
TrustStore,
|
|
1281
|
+
TrustStorePermissionsError,
|
|
1255
1282
|
_resetCacheEngine,
|
|
1256
1283
|
_resetEnvCache,
|
|
1257
1284
|
_resetKeyCacheForTests,
|
|
@@ -1272,6 +1299,8 @@ export {
|
|
|
1272
1299
|
clearOidcCache,
|
|
1273
1300
|
compilePattern,
|
|
1274
1301
|
compileRouteRules,
|
|
1302
|
+
composeInstructions,
|
|
1303
|
+
contextPressure,
|
|
1275
1304
|
convertToAwsCron,
|
|
1276
1305
|
createACPTool,
|
|
1277
1306
|
createCacheEngine,
|
|
@@ -1317,6 +1346,7 @@ export {
|
|
|
1317
1346
|
deserializeResponse,
|
|
1318
1347
|
discoverOidcProvider,
|
|
1319
1348
|
dispatchWebhook,
|
|
1349
|
+
effectiveContextWindow,
|
|
1320
1350
|
encrypt,
|
|
1321
1351
|
enforceCsrf,
|
|
1322
1352
|
envelopeCodeToStatus,
|
|
@@ -1329,6 +1359,7 @@ export {
|
|
|
1329
1359
|
extractUniversalIssues,
|
|
1330
1360
|
findSuggestion,
|
|
1331
1361
|
fromUnknown,
|
|
1362
|
+
frontmatterValue,
|
|
1332
1363
|
generateBackupCodes,
|
|
1333
1364
|
generateManifest,
|
|
1334
1365
|
generateNonce,
|
|
@@ -1356,8 +1387,11 @@ export {
|
|
|
1356
1387
|
isInputError,
|
|
1357
1388
|
jsonTransformer,
|
|
1358
1389
|
levenshtein,
|
|
1390
|
+
listProviders,
|
|
1391
|
+
loadCustomCommands,
|
|
1359
1392
|
loadCustomErrorPages,
|
|
1360
1393
|
loadEnv,
|
|
1394
|
+
loadInstructionTree,
|
|
1361
1395
|
loadManifest,
|
|
1362
1396
|
logRequest,
|
|
1363
1397
|
matchDisallowed,
|
|
@@ -1376,8 +1410,11 @@ export {
|
|
|
1376
1410
|
readAppResource,
|
|
1377
1411
|
readRawBody,
|
|
1378
1412
|
recordAttempt,
|
|
1413
|
+
registerProvider,
|
|
1379
1414
|
requireAuth,
|
|
1415
|
+
resetProviderRegistry,
|
|
1380
1416
|
resolveAdapter,
|
|
1417
|
+
resolveProvider,
|
|
1381
1418
|
resolveRouteRule,
|
|
1382
1419
|
resolveTransformer,
|
|
1383
1420
|
revalidatePath,
|
|
@@ -1405,6 +1442,7 @@ export {
|
|
|
1405
1442
|
serveStaticFile,
|
|
1406
1443
|
serverErrorToEnvelope,
|
|
1407
1444
|
setCookie,
|
|
1445
|
+
splitFrontmatter,
|
|
1408
1446
|
streamAgentTurnInProcess,
|
|
1409
1447
|
superjsonTransformer,
|
|
1410
1448
|
timingSafeEqual,
|
|
@@ -1416,6 +1454,7 @@ export {
|
|
|
1416
1454
|
translateCronToCloudflare,
|
|
1417
1455
|
translateCronToDeno,
|
|
1418
1456
|
translateCronToVercel,
|
|
1457
|
+
tryResolveProvider,
|
|
1419
1458
|
uiMessageStreamResponse,
|
|
1420
1459
|
updateTag,
|
|
1421
1460
|
useDatabase,
|