@theokit/agents 16.3.0 → 16.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/a2a.d.ts +33 -1
  3. package/dist/a2a.js +353 -3
  4. package/dist/a2a.js.map +1 -1
  5. package/dist/{agent-compiler-JSYkHpa7.d.ts → agent-compiler-C-4X_vKz.d.ts} +1 -51
  6. package/dist/{agent-orchestrator-BFWg2URC.d.ts → agent-orchestrator-BHF1bS6k.d.ts} +1 -1
  7. package/dist/{agent-runner-BUJKNNuI.d.ts → agent-runner-BoMoOnHV.d.ts} +2 -2
  8. package/dist/auth.d.ts +5 -4
  9. package/dist/auth.js.map +1 -1
  10. package/dist/{bridge-entry-BNWDrPzg.d.ts → bridge-entry-DO1LjHkc.d.ts} +215 -8
  11. package/dist/bridge.d.ts +6 -6
  12. package/dist/bridge.js +25 -9
  13. package/dist/{chunk-A7RXWJZE.js → chunk-AZ2FOUSN.js} +450 -476
  14. package/dist/chunk-AZ2FOUSN.js.map +1 -0
  15. package/dist/{chunk-MB23MSOK.js → chunk-K4MY4CV7.js} +45 -22
  16. package/dist/chunk-K4MY4CV7.js.map +1 -0
  17. package/dist/{chunk-CJMYZKUL.js → chunk-RZWD73QG.js} +429 -14
  18. package/dist/chunk-RZWD73QG.js.map +1 -0
  19. package/dist/{chunk-SAKSZKVK.js → chunk-ZLKZOSWR.js} +39 -17
  20. package/dist/chunk-ZLKZOSWR.js.map +1 -0
  21. package/dist/code-mode-quickjs.d.ts +33 -0
  22. package/dist/code-mode-quickjs.js +353 -0
  23. package/dist/code-mode-quickjs.js.map +1 -0
  24. package/dist/code-mode.d.ts +110 -0
  25. package/dist/code-mode.js +165 -0
  26. package/dist/code-mode.js.map +1 -0
  27. package/dist/{delegation-scoring-Cn5eM4lQ.d.ts → delegation-scoring-BBPJ9eug.d.ts} +8 -2
  28. package/dist/evals.d.ts +2 -2
  29. package/dist/evals.js +3 -1
  30. package/dist/evals.js.map +1 -1
  31. package/dist/handoff.d.ts +3 -3
  32. package/dist/handoff.js +2 -2
  33. package/dist/index.d.ts +25 -10
  34. package/dist/index.js +31 -9
  35. package/dist/index.js.map +1 -1
  36. package/dist/persistence.d.ts +1 -1
  37. package/dist/persistence.js +2 -1
  38. package/dist/persistence.js.map +1 -1
  39. package/dist/sandbox.d.ts +1 -1
  40. package/dist/sandbox.js +2 -0
  41. package/dist/sandbox.js.map +1 -1
  42. package/dist/{sdk-adapter-DQnKx7bA.d.ts → sdk-adapter-C57SpmLH.d.ts} +3 -1
  43. package/dist/testing.d.ts +1 -1
  44. package/dist/tools.d.ts +140 -5
  45. package/dist/tools.js +591 -29
  46. package/dist/tools.js.map +1 -1
  47. package/docs/capability-map.md +80 -6
  48. package/package.json +23 -5
  49. package/dist/chunk-A7RXWJZE.js.map +0 -1
  50. package/dist/chunk-CJMYZKUL.js.map +0 -1
  51. package/dist/chunk-MB23MSOK.js.map +0 -1
  52. package/dist/chunk-SAKSZKVK.js.map +0 -1
@@ -0,0 +1,165 @@
1
+ import {
2
+ __name
3
+ } from "./chunk-Z4QWC7IK.js";
4
+
5
+ // src/code-mode/code-mode.ts
6
+ import { TheokitAgentError } from "@theokit/sdk/errors";
7
+ var CodeModePermissionDeniedError = class extends TheokitAgentError {
8
+ static {
9
+ __name(this, "CodeModePermissionDeniedError");
10
+ }
11
+ name = "CodeModePermissionDeniedError";
12
+ constructor(tool, reason) {
13
+ const suffix = reason ? `: ${reason}` : "";
14
+ super(`code-mode: tool '${tool}' denied by permission gate${suffix}`, {
15
+ code: "CODE_MODE_PERMISSION_DENIED",
16
+ isRetryable: false
17
+ });
18
+ }
19
+ };
20
+ var CodeModeInvalidArgumentsError = class extends TheokitAgentError {
21
+ static {
22
+ __name(this, "CodeModeInvalidArgumentsError");
23
+ }
24
+ tool;
25
+ property;
26
+ name = "CodeModeInvalidArgumentsError";
27
+ constructor(tool, property, reason) {
28
+ const at = property === void 0 ? "" : ` ${property}`;
29
+ super(`code-mode: tool '${tool}' refused its arguments:${at} ${reason}`, {
30
+ code: "CODE_MODE_INVALID_ARGUMENTS",
31
+ isRetryable: false
32
+ }), this.tool = tool, this.property = property;
33
+ }
34
+ };
35
+ var PRIMITIVE_CHECKS = {
36
+ string: /* @__PURE__ */ __name((value) => typeof value === "string", "string"),
37
+ number: /* @__PURE__ */ __name((value) => typeof value === "number", "number"),
38
+ integer: /* @__PURE__ */ __name((value) => Number.isInteger(value), "integer"),
39
+ boolean: /* @__PURE__ */ __name((value) => typeof value === "boolean", "boolean")
40
+ };
41
+ function declaredTypeOf(inputSchema, key) {
42
+ const properties = inputSchema.properties;
43
+ const type = properties?.[key]?.type;
44
+ return typeof type === "string" ? type : void 0;
45
+ }
46
+ __name(declaredTypeOf, "declaredTypeOf");
47
+ function checkArguments(tool, args) {
48
+ if (typeof args !== "object" || args === null || Array.isArray(args)) {
49
+ throw new CodeModeInvalidArgumentsError(tool.name, void 0, "expected an object");
50
+ }
51
+ const input = args;
52
+ checkRequiredArguments(tool, input);
53
+ checkArgumentTypes(tool, input);
54
+ return input;
55
+ }
56
+ __name(checkArguments, "checkArguments");
57
+ function checkRequiredArguments(tool, input) {
58
+ const required = tool.inputSchema.required;
59
+ for (const name of Array.isArray(required) ? required : []) {
60
+ if (typeof name === "string" && !Object.hasOwn(input, name)) {
61
+ throw new CodeModeInvalidArgumentsError(tool.name, name, "is required");
62
+ }
63
+ }
64
+ }
65
+ __name(checkRequiredArguments, "checkRequiredArguments");
66
+ function checkArgumentTypes(tool, input) {
67
+ for (const [key, value] of Object.entries(input)) {
68
+ const type = declaredTypeOf(tool.inputSchema, key);
69
+ const matches = primitiveCheckFor(type);
70
+ if (matches !== void 0 && !matches(value)) {
71
+ throw new CodeModeInvalidArgumentsError(tool.name, key, `expected ${type}`);
72
+ }
73
+ }
74
+ }
75
+ __name(checkArgumentTypes, "checkArgumentTypes");
76
+ function primitiveCheckFor(type) {
77
+ return type !== void 0 && Object.hasOwn(PRIMITIVE_CHECKS, type) ? PRIMITIVE_CHECKS[type] : void 0;
78
+ }
79
+ __name(primitiveCheckFor, "primitiveCheckFor");
80
+ function jsonTextOf(result) {
81
+ const text = JSON.stringify(result);
82
+ return typeof text === "string" ? text : "null";
83
+ }
84
+ __name(jsonTextOf, "jsonTextOf");
85
+ function describeToolInput(inputSchema) {
86
+ const props = inputSchema.properties ?? {};
87
+ const required = new Set(inputSchema.required ?? []);
88
+ const entries = Object.entries(props).map(([key, spec]) => {
89
+ const type = typeof spec.type === "string" ? spec.type : "unknown";
90
+ return `${key}${required.has(key) ? "" : "?"}: ${type}`;
91
+ });
92
+ return entries.length > 0 ? `{ ${entries.join(", ")} }` : "{}";
93
+ }
94
+ __name(describeToolInput, "describeToolInput");
95
+ function generateCodeModeInstructions(tools, toolName) {
96
+ const calls = tools.map((t) => `- \`await api.${t.name}(${describeToolInput(t.inputSchema)})\` \u2014 ${t.description}`).join("\n");
97
+ return [
98
+ `The \`${toolName}\` tool runs your code in a sandbox. Your code may call ONLY these functions (each bridges to a real, validated tool on the host):`,
99
+ calls,
100
+ "Write an async function body that composes these calls and return exactly ONE structured result. Prefer `Promise.all` for independent calls; do arithmetic and aggregation in code, not in prose."
101
+ ].join("\n\n");
102
+ }
103
+ __name(generateCodeModeInstructions, "generateCodeModeInstructions");
104
+ function createCodeMode(config) {
105
+ if (typeof config.onPermissionRequest !== "function") {
106
+ throw new Error("createCodeMode requires onPermissionRequest (security by default \u2014 no default-allow for any tool).");
107
+ }
108
+ const sandboxRun = config.sandbox?.run;
109
+ if (typeof sandboxRun !== "function") {
110
+ throw new Error("createCodeMode requires an injected `sandbox` with a run() method (a vetted isolation boundary \u2014 never node:vm).");
111
+ }
112
+ if (config.tools.length === 0) {
113
+ throw new Error("createCodeMode requires a non-empty tools[] \u2014 the restricted API would be empty.");
114
+ }
115
+ const api = {};
116
+ for (const tool2 of config.tools) {
117
+ api[tool2.name] = async (args, options) => {
118
+ const input = checkArguments(tool2, args);
119
+ const decision = await config.onPermissionRequest({
120
+ tool: tool2.name,
121
+ args
122
+ });
123
+ if (!decision.granted) throw new CodeModePermissionDeniedError(tool2.name, decision.reason);
124
+ return options?.signal === void 0 ? tool2.handler(input) : tool2.handler(input, {
125
+ signal: options.signal
126
+ });
127
+ };
128
+ }
129
+ const name = config.name ?? "run_code";
130
+ const tool = {
131
+ name,
132
+ description: config.description ?? "Run code that composes the available tools. Only the declared tools are callable.",
133
+ inputSchema: {
134
+ type: "object",
135
+ properties: {
136
+ code: {
137
+ type: "string",
138
+ description: "The code to run in the sandbox."
139
+ }
140
+ },
141
+ required: [
142
+ "code"
143
+ ]
144
+ },
145
+ handler: /* @__PURE__ */ __name(async (input, ctx) => {
146
+ const code = typeof input.code === "string" ? input.code : "";
147
+ const result = ctx?.signal === void 0 ? await config.sandbox.run(code, api) : await config.sandbox.run(code, api, {
148
+ signal: ctx.signal
149
+ });
150
+ if (typeof result === "string") return result;
151
+ return jsonTextOf(result);
152
+ }, "handler")
153
+ };
154
+ return {
155
+ tool,
156
+ instructions: generateCodeModeInstructions(config.tools, name)
157
+ };
158
+ }
159
+ __name(createCodeMode, "createCodeMode");
160
+ export {
161
+ CodeModeInvalidArgumentsError,
162
+ CodeModePermissionDeniedError,
163
+ createCodeMode
164
+ };
165
+ //# sourceMappingURL=code-mode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/code-mode/code-mode.ts"],"mappings":";;;;;AAyBA,SAASA,yBAAyB;AAiE3B,IAAMC,gCAAN,cAA4CC,kBAAAA;EA1FnD,OA0FmDA;;;EAC/BC,OAAO;EAEzB,YAAYC,MAAcC,QAAiB;AACzC,UAAMC,SAASD,SAAS,KAAKA,MAAAA,KAAW;AACxC,UAAM,oBAAoBD,IAAAA,8BAAkCE,MAAAA,IAAU;MACpEC,MAAM;MACNC,aAAa;IACf,CAAA;EACF;AACF;AAOO,IAAMC,gCAAN,cAA4CP,kBAAAA;EA3GnD,OA2GmD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F,WAAWzD,SACZ,MAAM+C,OAAOI,QAAQC,IAAIzD,MAAM0D,GAAAA,IAC/B,MAAMN,OAAOI,QAAQC,IAAIzD,MAAM0D,KAAK;QAAEI,QAAQE,IAAIF;MAAO,CAAA;AAE/D,UAAI,OAAO7B,WAAW,SAAU,QAAOA;AACvC,aAAOD,WAAWC,MAAAA;IACpB,GATS;EAUX;AACA,SAAO;IAAEpC;IAAMoE,cAAcpB,6BAA6BO,OAAON,OAAOlD,IAAAA;EAAM;AAChF;AA3DgBuD;","names":["TheokitAgentError","CodeModePermissionDeniedError","TheokitAgentError","name","tool","reason","suffix","code","isRetryable","CodeModeInvalidArgumentsError","property","at","undefined","PRIMITIVE_CHECKS","string","value","number","integer","Number","isInteger","boolean","declaredTypeOf","inputSchema","key","properties","type","checkArguments","args","Array","isArray","input","checkRequiredArguments","checkArgumentTypes","required","Object","hasOwn","entries","matches","primitiveCheckFor","jsonTextOf","result","text","JSON","stringify","describeToolInput","props","Set","map","spec","has","length","join","generateCodeModeInstructions","tools","toolName","calls","t","description","createCodeMode","config","onPermissionRequest","Error","sandboxRun","sandbox","run","api","options","decision","granted","signal","handler","ctx","instructions"]}
@@ -1,4 +1,4 @@
1
- import { D as DelegationResult, S as SubAgentSpec, a as DelegateOptions } from './agent-orchestrator-BFWg2URC.js';
1
+ import { D as DelegationResult, S as SubAgentSpec, a as DelegateOptions } from './agent-orchestrator-BHF1bS6k.js';
2
2
 
3
3
  /**
4
4
  * M25 (theokit-ai-first) — background delegation + task-completion scoring.
@@ -23,7 +23,13 @@ import { D as DelegationResult, S as SubAgentSpec, a as DelegateOptions } from '
23
23
  * the loop is now testable without a compiler, a class or an LLM.
24
24
  */
25
25
  interface DelegationPort {
26
- run(message: string): Promise<DelegationResult>;
26
+ /**
27
+ * Run one delegated task. `options.signal` is the delegating run's `AbortSignal` when the caller
28
+ * has one (`delegate_all` hands it over): a port that honours it stops its sub-agent on abort.
29
+ */
30
+ run(message: string, options?: {
31
+ readonly signal?: AbortSignal;
32
+ }): Promise<DelegationResult>;
27
33
  }
28
34
  /** What both wrappers accept: the compiled spec (unchanged) or the port (M81, additive). */
29
35
  type DelegationTarget = SubAgentSpec | DelegationPort;
package/dist/evals.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { TheokitAgentError } from '@theokit/sdk/errors';
2
2
  import { Scorer, NamedScorer } from '@theokit/sdk/eval';
3
3
  export { EvalAlreadyRunningError, NamedScorer, Scorer, Scorers } from '@theokit/sdk/eval';
4
- import { D as DefinitionOrThunk, A as ApprovalPosture, R as RuntimeOverrides } from './sdk-adapter-DQnKx7bA.js';
4
+ import { D as DefinitionOrThunk, A as ApprovalPosture, R as RuntimeOverrides } from './sdk-adapter-C57SpmLH.js';
5
5
  import '@theokit/sdk';
6
6
  import '@theokit/sdk/retry';
7
7
  import './types-D5cHmSLi.js';
8
8
  import 'zod';
9
- import './agent-compiler-JSYkHpa7.js';
9
+ import './agent-compiler-C-4X_vKz.js';
10
10
  import '@theokit/sdk/subagents-loader';
11
11
  import './setting-sources-gate-BJJiKq33.js';
12
12
  import './hook-handlers-Cw2FsnE5.js';
package/dist/evals.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  toAgentFactory
3
- } from "./chunk-A7RXWJZE.js";
3
+ } from "./chunk-AZ2FOUSN.js";
4
4
  import "./chunk-M5J3Q6YC.js";
5
5
  import "./chunk-Q65ZIFNK.js";
6
6
  import "./chunk-NIQJ4GZX.js";
@@ -33,6 +33,8 @@ async function runAgentEvals(opts) {
33
33
  const factory = toAgentFactory(opts.agent, {
34
34
  apiKey: opts.apiKey,
35
35
  approvals: opts.approvals,
36
+ // An unattended eval must not hold the SDK's default shell: approvals do not gate it.
37
+ withholdBuiltinShell: true,
36
38
  ...opts.overrides === void 0 ? {} : {
37
39
  overrides: opts.overrides
38
40
  }
package/dist/evals.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/evals/run-agent-evals.ts","../src/evals-entry.ts"],"mappings":";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X,QAAQY,WAAWjD,WAAAA,MAAiB,OAClC;IAAE,GAAGgD;IAAGX,QAAQW,EAAEX,OAAOa,MAAMlD,YAAYyB,MAAM;EAAE,IACnDuB,CAAAA;AAEN,QAAMG,UAAUhC,IAAI4B,OAAOK,KAAK,CAACJ,MAAMA,EAAEX,QAAQY,WAAWjD,WAAAA,MAAiB,IAAA;AAC7E,QAAMqD,QAAQlC,IAAIkC,SAASF,SAASd,QAAQa,MAAMlD,YAAYyB,MAAM;AACpE,SAAO;IACLrB,OAAOe,IAAIf;IACX0B,OAAOX,IAAIW;IACX,GAAIX,IAAIoB,aAAa/C,SAAY,CAAC,IAAI;MAAE+C,UAAUpB,IAAIoB;IAAS;IAC/DD,QAAQnB,IAAImB;IACZgB,SAASC,UAAUF,OAAOlC,IAAIqC,WAAWvE,SAAAA;IACzCuE,WAAWrC,IAAIqC;IACfT;IACA,GAAIM,UAAU7D,SAAY,CAAC,IAAI;MAAE6D;IAAM;IACvCI,YAAYtC,IAAIsC;EAClB;AACF;AAvBSrC;AAyBT,SAASmC,UACPF,OACAG,WACAvE,WAAiB;AAEjB,MAAIoE,UAAU7D,OAAW,QAAO;AAChC,SAAOgE,aAAavE,YAAY,SAAS;AAC3C;AAPSsE;AAST,SAASjC,cAAcX,OAAqC;AAC1D,QAAMU,SAAS;IAAEqC,MAAM;IAAGC,MAAM;IAAGN,OAAO;EAAE;AAC5C,aAAW1B,KAAKhB,MAAOU,QAAOM,EAAE2B,OAAO,KAAK;AAC5C,SAAOjC;AACT;AAJSC;;;AC1PT,SAASsC,yBAAyBC,eAAe;","names":["TheokitAgentError","Eval","EvalConfigError","TheokitAgentError","name","message","code","isRetryable","DEFAULT_THRESHOLD","runAgentEvals","opts","validate","crypto","randomUUID","threshold","factory","toAgentFactory","agent","apiKey","approvals","overrides","undefined","runId","handles","caseNumber","agentFor","handle","String","push","failureMark","scorers","map","scorer","index","strictScorer","rows","run","Eval","create","dataset","cases","asEvalAgentFactory","runError","Promise","allSettled","h","dispose","all","row","toCaseResult","counts","countVerdicts","Array","isArray","length","forEach","c","i","entry","input","t","Number","isFinite","score","failed","why","reason","output","expected","result","scorerError","Error","describe","isUnitScore","describeScore","value","scores","s","startsWith","slice","failure","find","error","verdict","verdictOf","meanScore","durationMs","pass","fail","EvalAlreadyRunningError","Scorers"]}
1
+ {"version":3,"sources":["../src/evals/run-agent-evals.ts","../src/evals-entry.ts"],"mappings":";;;;;;;;;;;;;AAaA,SAASA,yBAAyB;AAClC,SACEC,YAMK;AAuDA,IAAMC,kBAAN,cAA8BC,kBAAAA;EA5ErC,OA4EqCA;;;EACjBC,OAAO;EAEzB,YAAYC,SAAiB;AAE3B,UAAM,qBAAqBA,OAAAA,IAAW;MAAEC,MAAM;MAAuBC,aAAa;IAAM,CAAA;EAC1F;AACF;AAEA,IAAMC,oBAAoB;AAE1B,eAAsBC,cAAcC,MAA0B;AAC5DC,WAASD,IAAAA;AACT,QAAMN,OAAOM,KAAKN,QAAQ,uBAAuBQ,OAAOC,WAAU,CAAA;AAClE,QAAMC,YAAYJ,KAAKI,aAAaN;AACpC,QAAMO,UAAUC,eAAeN,KAAKO,OAAO;IACzCC,QAAQR,KAAKQ;IACbC,WAAWT,KAAKS;;IAEhBC,sBAAsB;IACtB,GAAIV,KAAKW,cAAcC,SAAY,CAAC,IAAI;MAAED,WAAWX,KAAKW;IAAU;EACtE,CAAA;AAGA,QAAME,QAAQX,OAAOC,WAAU;AAC/B,QAAMW,UAA4B,CAAA;AAClC,MAAIC,aAAa;AACjB,QAAMC,WAAW,mCAAA;AAEfD,kBAAc;AACd,UAAME,SAAS,MAAMZ,QAAQ,GAAGX,IAAAA,IAAQmB,KAAAA,SAAcK,OAAOH,UAAAA,CAAAA,EAAa;AAC1ED,YAAQK,KAAKF,MAAAA;AACb,WAAOA;EACT,GANiB;AASjB,QAAMG,cAAc,yBAAyBP,KAAAA;AAC7C,QAAMQ,UAAUrB,KAAKqB,QAAQC,IAAI,CAACC,QAAQC,UAAUC,aA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;;;AC5PT,SAASsC,yBAAyBC,eAAe;","names":["TheokitAgentError","Eval","EvalConfigError","TheokitAgentError","name","message","code","isRetryable","DEFAULT_THRESHOLD","runAgentEvals","opts","validate","crypto","randomUUID","threshold","factory","toAgentFactory","agent","apiKey","approvals","withholdBuiltinShell","overrides","undefined","runId","handles","caseNumber","agentFor","handle","String","push","failureMark","scorers","map","scorer","index","strictScorer","rows","run","Eval","create","dataset","cases","asEvalAgentFactory","runError","Promise","allSettled","h","dispose","all","row","toCaseResult","counts","countVerdicts","Array","isArray","length","forEach","c","i","entry","input","t","Number","isFinite","score","failed","why","reason","output","expected","result","scorerError","Error","describe","isUnitScore","describeScore","value","scores","s","startsWith","slice","failure","find","error","verdict","verdictOf","meanScore","durationMs","pass","fail","EvalAlreadyRunningError","Scorers"]}
package/dist/handoff.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { TheokitAgentError } from '@theokit/sdk/errors';
2
- import { S as SubAgentSpec, D as DelegationResult } from './agent-orchestrator-BFWg2URC.js';
3
- import { A as AgentRunnerRunOptions } from './agent-runner-BUJKNNuI.js';
2
+ import { S as SubAgentSpec, D as DelegationResult } from './agent-orchestrator-BHF1bS6k.js';
3
+ import { A as AgentRunnerRunOptions } from './agent-runner-BoMoOnHV.js';
4
4
  import '@theokit/sdk';
5
5
  import '@theokit/sdk/retry';
6
- import './agent-compiler-JSYkHpa7.js';
6
+ import './agent-compiler-C-4X_vKz.js';
7
7
  import '@theokit/sdk/subagents-loader';
8
8
  import './types-D5cHmSLi.js';
9
9
  import 'zod';
package/dist/handoff.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  AgentRunner
3
- } from "./chunk-SAKSZKVK.js";
4
- import "./chunk-A7RXWJZE.js";
3
+ } from "./chunk-ZLKZOSWR.js";
4
+ import "./chunk-AZ2FOUSN.js";
5
5
  import "./chunk-M5J3Q6YC.js";
6
6
  import "./chunk-Q65ZIFNK.js";
7
7
  import "./chunk-NIQJ4GZX.js";
package/dist/index.d.ts CHANGED
@@ -2,22 +2,22 @@ import { GoalLoopAgent, GoalOptions, runGoalLoop, GoalEvent, GoalResult, InlineS
2
2
  export { BudgetTracker, CustomTool, DiagnosticsSink, GenerateObjectError, GoalEvent, GoalLoopAgent, GoalOptions, GoalResult, InlineSkill, JudgeCredentialError, JudgeResult, LayerOrderError, McpAuthConfig, McpHttpServerConfig, McpOAuthConfig, McpServerConfig, McpStdioServerConfig, Plugin, PluginsSettings, Provider, ProviderRoutingSettings, RunEvent, SDKAgent, SessionRecord, SessionStore, Squad, StreamObjectError, Tool, ToolError, ToolResultContentBlock, TrustLevel, TrustPosture, TrustPostureInput, TrustSource, UngatedCapabilityError, Verdict, WiredEntity, applySecurityFloor, auditEnvReachability, foldLayers, recordWiring, resolveTrustPosture, setDiagnosticsSink, verifyLayerOrdering } from '@theokit/sdk';
3
3
  import { R as ReasoningEffort, T as ToolOptions, A as ApprovalOptions, H as HumanInTheLoopOptions } from './types-D5cHmSLi.js';
4
4
  export { c as AgentOptions, B as BudgetOptions, M as MainLoopMeta, d as MainLoopOptions, a as McpServersMap, e as PolicyHandler, f as TimeoutAction, g as ToolboxOptions } from './types-D5cHmSLi.js';
5
- import { H as HitlDecision, A as ApprovalPosture } from './sdk-adapter-DQnKx7bA.js';
6
- export { a as ApprovalRequest, D as DefinitionOrThunk, R as RuntimeOverrides, S as SdkAgentHandle, b as SdkSendOptions, c as SdkTurnHandle, d as applyPosture, e as createSdkAgentStream, t as toAgentFactory } from './sdk-adapter-DQnKx7bA.js';
5
+ import { H as HitlDecision, A as ApprovalPosture } from './sdk-adapter-C57SpmLH.js';
6
+ export { a as ApprovalRequest, D as DefinitionOrThunk, R as RuntimeOverrides, S as SdkAgentHandle, b as SdkSendOptions, c as SdkTurnHandle, d as applyPosture, e as createSdkAgentStream, t as toAgentFactory } from './sdk-adapter-C57SpmLH.js';
7
7
  import { TheokitAgentError } from '@theokit/sdk/errors';
8
8
  export * from '@theokit/sdk/errors';
9
9
  export { ConfigurationError, BudgetExceededError as WindowBudgetExceededError } from '@theokit/sdk/errors';
10
- import { G as Guardrail, a as CompiledAgentOptions, C as CompiledTool } from './agent-compiler-JSYkHpa7.js';
11
- export { b as AGENT_BRAND, A as AgentDefinition, c as CompatImportUnsupportedError, d as CostBudgetExceededError, D as DefineAgentConfig, e as GuardrailAction, f as GuardrailError, g as GuardrailPhase, h as GuardrailResult, i as GuardrailViolationError, H as HookApprovalGate, j as HookApprovalRequest, k as HookGateUnsupportedError, I as InferAgentInput, l as InferAgentToolNames, M as MalformedGuardrailResultError, S as SkillsRequestContext, m as SkillsSelection, T as ToolWalkResult, n as ToolboxWalkResult, U as UnreadableTextPayloadError, o as compileAgentDefinition, p as compileTools, q as isAgentDefinition, r as resolveEnabledSkills } from './agent-compiler-JSYkHpa7.js';
12
- import { C as ContextWindowOptions, S as SkillsOptions, A as AgentManifestEntry, s as streamAgentUIMessages, a as AgentModule } from './bridge-entry-BNWDrPzg.js';
13
- export { b as APPROVAL_MODES, c as AfterToolCallContext, d as AgentBuilder, e as AgentDefinitionError, f as AgentExecutionContext, g as AgentManifest, h as AgentManifestSource, i as AgentManifestTool, j as AgentRoute, k as AgentRouteContext, l as AgentRunInfo, m as AgentsPluginOptions, n as ApiErrorContext, o as ApiErrorDecision, p as ApiErrorPolicy, q as ApprovalMode, B as BeforeToolCallContext, r as CompiledContextWindow, t as ContextualTool, D as DelegationTimeoutError, E as EphemeralAgent, L as LLMCallContext, M as McpApprovalSpec, u as McpFileError, v as McpRegistryConfig, w as McpRequestContext, x as McpSelection, P as PermissionsPluginOptions, y as ProcessInputContext, z as SdkMessage, F as Segment, G as ShouldAutoApproveOptions, T as ToolCallVeto, H as ToolHooks, I as ToolHooksPlugin, W as WRITE_SCOPED_TOOLS, J as agentsPlugin, K as buildModelSelection, N as compileAgentModule, O as compileContextWindow, Q as compileLoadedAgentModule, R as compileProjectContext, U as compileSkills, V as createAgentExecutionContext, X as createApiErrorHandler, Y as createPermissionsPlugin, Z as createThinkTagExtractor, _ as createToolHooksPlugin, $ as extractThinkTagStream, a0 as generateAgentManifest, a1 as generateAgentRoutes, a2 as isAgentContext, a3 as loadMcpJson, a4 as loadPersonalMcpServers, a5 as mcpRegistry, a6 as mcpToolApprovals, a7 as projectContextMetadataOnlyKnobs, a8 as reasoningEffortOf, a9 as resolveMcpServers, aa as runWithApiErrorHandling, ab as shouldAutoApprove, ac as translateSdkEvent, ad as withClockCap, ae as withEphemeralAgent } from './bridge-entry-BNWDrPzg.js';
10
+ import { G as Guardrail, a as CompiledAgentOptions, C as CompiledTool } from './agent-compiler-C-4X_vKz.js';
11
+ export { b as AGENT_BRAND, A as AgentDefinition, c as CostBudgetExceededError, D as DefineAgentConfig, d as GuardrailAction, e as GuardrailError, f as GuardrailPhase, g as GuardrailResult, h as GuardrailViolationError, H as HookApprovalGate, i as HookApprovalRequest, I as InferAgentInput, j as InferAgentToolNames, M as MalformedGuardrailResultError, S as SkillsRequestContext, k as SkillsSelection, T as ToolWalkResult, l as ToolboxWalkResult, U as UnreadableTextPayloadError, m as compileAgentDefinition, n as compileTools, o as isAgentDefinition, r as resolveEnabledSkills } from './agent-compiler-C-4X_vKz.js';
12
+ import { C as ContextWindowOptions, S as SkillsOptions, A as AgentManifestEntry, s as streamAgentUIMessages, a as AgentModule } from './bridge-entry-DO1LjHkc.js';
13
+ export { b as APPROVAL_MODES, c as AfterToolCallContext, d as AgentBuilder, e as AgentDefinitionError, f as AgentExecutionContext, g as AgentManifest, h as AgentManifestSource, i as AgentManifestTool, j as AgentRoute, k as AgentRouteContext, l as AgentRunInfo, m as AgentsPluginOptions, n as ApiErrorContext, o as ApiErrorDecision, p as ApiErrorPolicy, q as ApprovalMode, B as BeforeToolCallContext, r as BodyTooLargeError, t as CompiledContextWindow, u as ContextualTool, D as DelegationTimeoutError, E as EphemeralAgent, L as LLMCallContext, M as MAX_REQUEST_BODY_BYTES, v as McpApprovalSpec, w as McpFileError, x as McpRegistryConfig, y as McpRequestContext, z as McpSelection, O as OpenAIChatMessage, F as OpenAIChatRequest, G as OpenAICompatibleRoutesOptions, H as OpenAICompletion, I as OpenAITextPart, P as PermissionsPluginOptions, J as ProcessInputContext, K as SdkMessage, N as SdkTimelineEvent, Q as Segment, R as ShouldAutoApproveOptions, T as ToolArgsValidator, U as ToolCallVeto, V as ToolCallVetoPort, W as ToolHooks, X as ToolHooksPlugin, Y as ToolInvokeRouteOptions, Z as WRITE_SCOPED_TOOLS, _ as agentsPlugin, $ as buildModelSelection, a0 as compileAgentModule, a1 as compileContextWindow, a2 as compileLoadedAgentModule, a3 as compileProjectContext, a4 as compileSkills, a5 as createAgentExecutionContext, a6 as createApiErrorHandler, a7 as createOpenAICompatibleRoutes, a8 as createPermissionsPlugin, a9 as createThinkTagExtractor, aa as createToolHooksPlugin, ab as createToolInvokeRoute, ac as createToolSeen, ad as extractThinkTagStream, ae as flushPendingToolResults, af as generateAgentManifest, ag as generateAgentRoutes, ah as isAgentContext, ai as loadMcpJson, aj as loadPersonalMcpServers, ak as mcpRegistry, al as mcpToolApprovals, am as projectContextMetadataOnlyKnobs, an as readCappedBody, ao as reasoningEffortOf, ap as renderTranscript, aq as resolveMcpServers, ar as runWithApiErrorHandling, as as shouldAutoApprove, at as translateInteractionUpdate, au as translateSdkEvent, av as translateTimelineEvent, aw as withClockCap, ax as withEphemeralAgent } from './bridge-entry-DO1LjHkc.js';
14
14
  import { S as SettingSourcesSelection } from './setting-sources-gate-BJJiKq33.js';
15
15
  export { C as CompatSurface, a as GatedCompatSource, G as GatedSettingSource, P as ProjectSettingsGrant, R as ResolvedCompatSource, b as SettingSourceCapability, U as UntrustedSettingSourceError, r as resolveCompatSources, c as resolveSettingSources } from './setting-sources-gate-BJJiKq33.js';
16
16
  export { a as AgentStopReason, b as AgentStreamEvent, c as AgentTurnMetadata, A as ApprovalRequiredEvent, d as ArtifactChunkEvent, e as ArtifactStartEvent, C as CheckpointSavedEvent, D as DoneEvent, E as ErrorEvent, F as FileEditEvent, I as IterationEvent, P as PartialToolCallEvent, R as RunStartedEvent, f as StateUpdateEvent, S as StreamEvent, T as TextDeltaEvent, g as ThinkingEvent, h as ToolCallEvent, i as ToolResultEvent, j as isApprovalRequired, k as isDone, l as isError, m as isPartialToolCall, n as isTextDelta, o as isToolCall, p as isToolResult, q as presentUIMessageStream, s as streamAgentResponse } from './agent-sse-handler-BRp9vHrb.js';
17
- export { B as BudgetExceededError, c as DEFAULT_MAX_ITERATIONS, a as DelegateOptions, d as DelegationBudgetCostUnknownError, e as DelegationBudgetExceededError, f as DelegationError, D as DelegationResult, g as LoopFinishReason, h as LoopOutcome, L as LoopStrategy, i as LoopStrategyConfig, j as ReflectionContext, k as ReflectionResult, b as ReflectionStrategy, l as ReflectionStrategyConfig, R as RoundStreamFactory, m as delegate, n as ladderReflectionStrategy, o as loopStrategyConfigSchema, p as noopReflectionStrategy, r as reflectionStrategyConfigSchema, q as resolveLoopStrategy } from './agent-orchestrator-BFWg2URC.js';
18
- export { B as BackgroundDelegation, a as DelegateFn, b as DelegationPort, D as DelegationTarget, S as ScoreVerdict, c as ScoredDelegation, d as Scorer, e as delegateBackground, f as delegateWithScoring } from './delegation-scoring-Cn5eM4lQ.js';
19
- import { T as TranscriptCompactionStrategy } from './agent-runner-BUJKNNuI.js';
20
- export { a as AgentRunner, b as AgentRunnerBuilder, A as AgentRunnerRunOptions, C as CompactionCallOptions, c as CompactionStrategyConfig, D as DEFAULT_KEEP_TOKENS, S as Summarize, d as compactionStrategyConfigSchema, r as resolveCompactionStrategy, t as tokenBudgetCompactionStrategy } from './agent-runner-BUJKNNuI.js';
17
+ export { B as BudgetExceededError, c as DEFAULT_MAX_ITERATIONS, a as DelegateOptions, d as DelegationBudgetCostUnknownError, e as DelegationBudgetExceededError, f as DelegationError, D as DelegationResult, g as LoopFinishReason, h as LoopOutcome, L as LoopStrategy, i as LoopStrategyConfig, j as ReflectionContext, k as ReflectionResult, b as ReflectionStrategy, l as ReflectionStrategyConfig, R as RoundStreamFactory, m as delegate, n as ladderReflectionStrategy, o as loopStrategyConfigSchema, p as noopReflectionStrategy, r as reflectionStrategyConfigSchema, q as resolveLoopStrategy } from './agent-orchestrator-BHF1bS6k.js';
18
+ export { B as BackgroundDelegation, a as DelegateFn, b as DelegationPort, D as DelegationTarget, S as ScoreVerdict, c as ScoredDelegation, d as Scorer, e as delegateBackground, f as delegateWithScoring } from './delegation-scoring-BBPJ9eug.js';
19
+ import { T as TranscriptCompactionStrategy } from './agent-runner-BoMoOnHV.js';
20
+ export { a as AgentRunner, b as AgentRunnerBuilder, A as AgentRunnerRunOptions, C as CompactionCallOptions, c as CompactionStrategyConfig, D as DEFAULT_KEEP_TOKENS, S as Summarize, d as compactionStrategyConfigSchema, r as resolveCompactionStrategy, t as tokenBudgetCompactionStrategy } from './agent-runner-BoMoOnHV.js';
21
21
  import { CompressibleMessage } from '@theokit/sdk/compaction';
22
22
  export { CONTEXT_WINDOW_FLOOR, CONTEXT_WINDOW_MARGIN, CompressibleMessage, ContextWindowMarginError, ContextWindowSource, EffectiveContextWindow, resolveEffectiveContextWindow } from '@theokit/sdk/compaction';
23
23
  export { SubAgent } from '@theokit/sdk/a2a';
@@ -984,12 +984,27 @@ interface AgentCard {
984
984
  defaultInputModes: string[];
985
985
  defaultOutputModes: string[];
986
986
  skills: A2ASkill[];
987
+ /** How a caller authenticates, by scheme name (A2A `securitySchemes`). Absent when not given. */
988
+ securitySchemes?: Record<string, {
989
+ type: 'http';
990
+ scheme: 'bearer';
991
+ } | {
992
+ type: 'apiKey';
993
+ in: 'header';
994
+ name: string;
995
+ }>;
996
+ /** Which schemes a call must satisfy (A2A `security`). Absent when not given. */
997
+ security?: Record<string, string[]>[];
987
998
  }
988
999
  interface BuildAgentCardOptions {
989
1000
  /** Absolute base URL of the deployment (e.g. `https://app.example.com`). A trailing slash is trimmed. */
990
1001
  baseUrl: string;
991
1002
  /** Human description of the agent. Defaults to a generated sentence when omitted (spec requires non-empty). */
992
1003
  description?: string;
1004
+ /** Copied onto the card when given; a card built without it is unchanged. */
1005
+ securitySchemes?: AgentCard['securitySchemes'];
1006
+ /** Copied onto the card when given; a card built without it is unchanged. */
1007
+ security?: AgentCard['security'];
993
1008
  }
994
1009
  /** Build an A2A agent card from a manifest entry. */
995
1010
  declare function buildAgentCard(entry: AgentManifestEntry, options: BuildAgentCardOptions): AgentCard;
package/dist/index.js CHANGED
@@ -1,7 +1,9 @@
1
1
  import {
2
2
  AgentBuilder,
3
3
  AgentDefinitionError,
4
+ BodyTooLargeError,
4
5
  ContextualTool,
6
+ MAX_REQUEST_BODY_BYTES,
5
7
  McpFileError,
6
8
  agentsPlugin,
7
9
  compileAgentModule,
@@ -12,7 +14,9 @@ import {
12
14
  compileTools,
13
15
  createAgentExecutionContext,
14
16
  createApiErrorHandler,
17
+ createOpenAICompatibleRoutes,
15
18
  createPermissionsPlugin,
19
+ createToolInvokeRoute,
16
20
  generateAgentManifest,
17
21
  generateAgentRoutes,
18
22
  isAgentContext,
@@ -28,12 +32,14 @@ import {
28
32
  mcpRegistry,
29
33
  mcpToolApprovals,
30
34
  presentUIMessageStream,
35
+ readCappedBody,
36
+ renderTranscript,
31
37
  resolveMcpServers,
32
38
  runWithApiErrorHandling,
33
39
  streamAgentResponse,
34
40
  streamAgentUIMessages,
35
41
  toolRuntimeName
36
- } from "./chunk-CJMYZKUL.js";
42
+ } from "./chunk-RZWD73QG.js";
37
43
  import {
38
44
  DEFAULT_HANDLER_TIMEOUT_MS,
39
45
  DelegationTimeoutError,
@@ -48,7 +54,7 @@ import {
48
54
  withClockCap,
49
55
  withEphemeralAgent,
50
56
  withPreCompaction
51
- } from "./chunk-MB23MSOK.js";
57
+ } from "./chunk-K4MY4CV7.js";
52
58
  import "./chunk-MJ6FRILJ.js";
53
59
  import {
54
60
  AgentRunner,
@@ -67,14 +73,12 @@ import {
67
73
  resolveCompactionStrategy,
68
74
  resolveLoopStrategy,
69
75
  tokenBudgetCompactionStrategy
70
- } from "./chunk-SAKSZKVK.js";
76
+ } from "./chunk-ZLKZOSWR.js";
71
77
  import {
72
78
  APPROVAL_MODES,
73
- CompatImportUnsupportedError,
74
79
  CostBudgetExceededError,
75
80
  GuardrailError,
76
81
  GuardrailViolationError,
77
- HookGateUnsupportedError,
78
82
  MalformedGuardrailResultError,
79
83
  UnreadableTextPayloadError,
80
84
  WRITE_SCOPED_TOOLS,
@@ -85,8 +89,10 @@ import {
85
89
  createSdkAgentStream,
86
90
  createThinkTagExtractor,
87
91
  createToolHooksPlugin,
92
+ createToolSeen,
88
93
  estimateTokens,
89
94
  extractThinkTagStream,
95
+ flushPendingToolResults,
90
96
  moderateOutputStream,
91
97
  outputModeration,
92
98
  piiDetector,
@@ -98,9 +104,11 @@ import {
98
104
  shouldAutoApprove,
99
105
  textPayloadExtractor,
100
106
  toAgentFactory,
107
+ translateInteractionUpdate,
101
108
  translateSdkEvent,
109
+ translateTimelineEvent,
102
110
  unicodeNormalizer
103
- } from "./chunk-A7RXWJZE.js";
111
+ } from "./chunk-AZ2FOUSN.js";
104
112
  import "./chunk-M5J3Q6YC.js";
105
113
  import {
106
114
  ConfigurationError
@@ -808,7 +816,13 @@ function buildAgentCard(entry, options) {
808
816
  id: t.name,
809
817
  name: t.name,
810
818
  description: t.description
811
- }))
819
+ })),
820
+ ...options.securitySchemes ? {
821
+ securitySchemes: options.securitySchemes
822
+ } : {},
823
+ ...options.security ? {
824
+ security: options.security
825
+ } : {}
812
826
  };
813
827
  }
814
828
  __name(buildAgentCard, "buildAgentCard");
@@ -1213,6 +1227,7 @@ export {
1213
1227
  AgentDefinitionError,
1214
1228
  AgentRunner,
1215
1229
  AgentRunnerBuilder,
1230
+ BodyTooLargeError,
1216
1231
  BudgetExceededError,
1217
1232
  CONTEXT_WINDOW_FLOOR,
1218
1233
  CONTEXT_WINDOW_MARGIN,
@@ -1221,7 +1236,6 @@ export {
1221
1236
  CapabilityPreset,
1222
1237
  CapabilityRegistry,
1223
1238
  CheckpointCapability,
1224
- CompatImportUnsupportedError,
1225
1239
  ConfigurationError,
1226
1240
  ContextWindowCapability,
1227
1241
  ContextWindowMarginError,
@@ -1241,11 +1255,11 @@ export {
1241
1255
  GuardrailViolationError,
1242
1256
  GuardrailsCapability,
1243
1257
  HookApprovalCapability,
1244
- HookGateUnsupportedError,
1245
1258
  HumanInTheLoopCapability,
1246
1259
  InProcessApprovalRequiredError,
1247
1260
  JudgeCredentialError,
1248
1261
  LayerOrderError,
1262
+ MAX_REQUEST_BODY_BYTES,
1249
1263
  MCP_PROTOCOL_VERSION,
1250
1264
  MainLoopCapability,
1251
1265
  MalformedGuardrailResultError,
@@ -1302,10 +1316,13 @@ export {
1302
1316
  createAgentExecutionContext,
1303
1317
  createApiErrorHandler,
1304
1318
  createDraft,
1319
+ createOpenAICompatibleRoutes,
1305
1320
  createPermissionsPlugin,
1306
1321
  createSdkAgentStream,
1307
1322
  createThinkTagExtractor,
1308
1323
  createToolHooksPlugin,
1324
+ createToolInvokeRoute,
1325
+ createToolSeen,
1309
1326
  declareAgentShape,
1310
1327
  delegate,
1311
1328
  delegateBackground,
@@ -1315,6 +1332,7 @@ export {
1315
1332
  encodeAcpMessage,
1316
1333
  estimateTokens,
1317
1334
  extractThinkTagStream,
1335
+ flushPendingToolResults,
1318
1336
  foldLayers,
1319
1337
  foldTurnLifecycle,
1320
1338
  formatGoalEvent,
@@ -1347,9 +1365,11 @@ export {
1347
1365
  presentUIMessageStream,
1348
1366
  projectContextMetadataOnlyKnobs,
1349
1367
  promptInjectionDetector,
1368
+ readCappedBody,
1350
1369
  reasoningEffortOf,
1351
1370
  recordWiring,
1352
1371
  reflectionStrategyConfigSchema,
1372
+ renderTranscript,
1353
1373
  resolveCompactionStrategy,
1354
1374
  resolveCompatSources,
1355
1375
  resolveDecomposition,
@@ -1372,7 +1392,9 @@ export {
1372
1392
  textPayloadExtractor,
1373
1393
  toAgentFactory,
1374
1394
  tokenBudgetCompactionStrategy,
1395
+ translateInteractionUpdate,
1375
1396
  translateSdkEvent,
1397
+ translateTimelineEvent,
1376
1398
  unicodeNormalizer,
1377
1399
  verifyLayerOrdering,
1378
1400
  wellKnownCardPath,