@theokit/sdk 2.18.1 → 2.19.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/CHANGELOG.md +6 -0
- package/dist/a2a/index.cjs +41 -8
- package/dist/a2a/index.cjs.map +1 -1
- package/dist/a2a/index.js +41 -8
- package/dist/a2a/index.js.map +1 -1
- package/dist/{cron-Bbg0mBOv.d.ts → cron-Cep07kTz.d.ts} +1 -1
- package/dist/{cron-ZLSKbDbB.d.cts → cron-D_wK1S-0.d.cts} +1 -1
- package/dist/cron.cjs +41 -8
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.d.cts +2 -2
- package/dist/cron.d.ts +2 -2
- package/dist/cron.js +41 -8
- package/dist/cron.js.map +1 -1
- package/dist/define-tool.d.ts +1 -0
- package/dist/{errors-qyVYfk9H.d.ts → errors-5lj1EWgs.d.ts} +1 -1
- package/dist/{errors-1tVcX3Fq.d.cts → errors-CE-lMBi2.d.cts} +1 -1
- package/dist/errors.d.cts +2 -2
- package/dist/eval.cjs +41 -8
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +41 -8
- package/dist/eval.js.map +1 -1
- package/dist/generate-object.d.ts +11 -0
- package/dist/index.cjs +41 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -6
- package/dist/index.d.ts +18 -6
- package/dist/index.js +41 -8
- package/dist/index.js.map +1 -1
- package/dist/{run-pE-34AAo.d.cts → run-BgfBWX-z.d.cts} +13 -1
- package/dist/{run-pE-34AAo.d.ts → run-BgfBWX-z.d.ts} +13 -1
- package/dist/types/agent-prims.d.ts +4 -1
- package/dist/types/run.d.ts +9 -0
- package/package.json +1 -1
|
@@ -77,10 +77,13 @@ interface CustomTool {
|
|
|
77
77
|
* model). Throws → SDK converts to `tool_result` with `isError: true` and
|
|
78
78
|
* the error `message` as content. #65 — an optional 2nd `ToolContext`
|
|
79
79
|
* argument carries the run's `AbortSignal`; single-argument handlers are
|
|
80
|
-
* unaffected.
|
|
80
|
+
* unaffected. M7 — the same `ctx` also carries an optional user `context`
|
|
81
|
+
* (provided once via `SendOptions.context`), so shared config like a
|
|
82
|
+
* `projectRoot` is read by every tool instead of baked into each factory.
|
|
81
83
|
*/
|
|
82
84
|
handler: (input: Record<string, unknown>, ctx?: {
|
|
83
85
|
signal?: AbortSignal;
|
|
86
|
+
context?: unknown;
|
|
84
87
|
}) => string | Promise<string>;
|
|
85
88
|
}
|
|
86
89
|
|
|
@@ -918,6 +921,15 @@ interface SendOptions {
|
|
|
918
921
|
* @public
|
|
919
922
|
*/
|
|
920
923
|
signal?: AbortSignal;
|
|
924
|
+
/**
|
|
925
|
+
* M7 — an opaque user `context` forwarded to every tool handler's `ctx.context`
|
|
926
|
+
* for this run. Set shared config (e.g. `projectRoot`) once here instead of
|
|
927
|
+
* baking it into each tool factory (mirrors ai-sdk `experimental_context`,
|
|
928
|
+
* mastra `RuntimeContext`, openai-agents-js `RunContext`).
|
|
929
|
+
*
|
|
930
|
+
* @public
|
|
931
|
+
*/
|
|
932
|
+
context?: unknown;
|
|
921
933
|
/**
|
|
922
934
|
* #58 — per-tool execution timeout in ms. Each tool call is bounded by this
|
|
923
935
|
* deadline (merged with `signal`); a hung tool yields a typed timeout result
|
|
@@ -77,10 +77,13 @@ interface CustomTool {
|
|
|
77
77
|
* model). Throws → SDK converts to `tool_result` with `isError: true` and
|
|
78
78
|
* the error `message` as content. #65 — an optional 2nd `ToolContext`
|
|
79
79
|
* argument carries the run's `AbortSignal`; single-argument handlers are
|
|
80
|
-
* unaffected.
|
|
80
|
+
* unaffected. M7 — the same `ctx` also carries an optional user `context`
|
|
81
|
+
* (provided once via `SendOptions.context`), so shared config like a
|
|
82
|
+
* `projectRoot` is read by every tool instead of baked into each factory.
|
|
81
83
|
*/
|
|
82
84
|
handler: (input: Record<string, unknown>, ctx?: {
|
|
83
85
|
signal?: AbortSignal;
|
|
86
|
+
context?: unknown;
|
|
84
87
|
}) => string | Promise<string>;
|
|
85
88
|
}
|
|
86
89
|
|
|
@@ -918,6 +921,15 @@ interface SendOptions {
|
|
|
918
921
|
* @public
|
|
919
922
|
*/
|
|
920
923
|
signal?: AbortSignal;
|
|
924
|
+
/**
|
|
925
|
+
* M7 — an opaque user `context` forwarded to every tool handler's `ctx.context`
|
|
926
|
+
* for this run. Set shared config (e.g. `projectRoot`) once here instead of
|
|
927
|
+
* baking it into each tool factory (mirrors ai-sdk `experimental_context`,
|
|
928
|
+
* mastra `RuntimeContext`, openai-agents-js `RunContext`).
|
|
929
|
+
*
|
|
930
|
+
* @public
|
|
931
|
+
*/
|
|
932
|
+
context?: unknown;
|
|
921
933
|
/**
|
|
922
934
|
* #58 — per-tool execution timeout in ms. Each tool call is bounded by this
|
|
923
935
|
* deadline (merged with `signal`); a hung tool yields a typed timeout result
|
|
@@ -57,9 +57,12 @@ export interface CustomTool {
|
|
|
57
57
|
* model). Throws → SDK converts to `tool_result` with `isError: true` and
|
|
58
58
|
* the error `message` as content. #65 — an optional 2nd `ToolContext`
|
|
59
59
|
* argument carries the run's `AbortSignal`; single-argument handlers are
|
|
60
|
-
* unaffected.
|
|
60
|
+
* unaffected. M7 — the same `ctx` also carries an optional user `context`
|
|
61
|
+
* (provided once via `SendOptions.context`), so shared config like a
|
|
62
|
+
* `projectRoot` is read by every tool instead of baked into each factory.
|
|
61
63
|
*/
|
|
62
64
|
handler: (input: Record<string, unknown>, ctx?: {
|
|
63
65
|
signal?: AbortSignal;
|
|
66
|
+
context?: unknown;
|
|
64
67
|
}) => string | Promise<string>;
|
|
65
68
|
}
|
package/dist/types/run.d.ts
CHANGED
|
@@ -268,6 +268,15 @@ export interface SendOptions {
|
|
|
268
268
|
* @public
|
|
269
269
|
*/
|
|
270
270
|
signal?: AbortSignal;
|
|
271
|
+
/**
|
|
272
|
+
* M7 — an opaque user `context` forwarded to every tool handler's `ctx.context`
|
|
273
|
+
* for this run. Set shared config (e.g. `projectRoot`) once here instead of
|
|
274
|
+
* baking it into each tool factory (mirrors ai-sdk `experimental_context`,
|
|
275
|
+
* mastra `RuntimeContext`, openai-agents-js `RunContext`).
|
|
276
|
+
*
|
|
277
|
+
* @public
|
|
278
|
+
*/
|
|
279
|
+
context?: unknown;
|
|
271
280
|
/**
|
|
272
281
|
* #58 — per-tool execution timeout in ms. Each tool call is bounded by this
|
|
273
282
|
* deadline (merged with `signal`); a hung tool yields a typed timeout result
|
package/package.json
CHANGED