@theokit/sdk 2.18.0 → 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 +31 -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 +14 -14
|
@@ -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theokit/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0",
|
|
4
4
|
"description": "TypeScript SDK for the Theo agent harness — same surface, local or cloud.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/usetheo/theokit-sdk#readme",
|
|
@@ -308,15 +308,6 @@
|
|
|
308
308
|
"**/agent.js",
|
|
309
309
|
"**/agent.cjs"
|
|
310
310
|
],
|
|
311
|
-
"scripts": {
|
|
312
|
-
"build": "tsup && cp src/internal/providers/provider-catalog.json dist/provider-catalog.json",
|
|
313
|
-
"test": "vitest run --no-file-parallelism",
|
|
314
|
-
"test:watch": "vitest",
|
|
315
|
-
"typecheck": "tsc --noEmit",
|
|
316
|
-
"clean": "rm -rf dist",
|
|
317
|
-
"docs:json": "typedoc --options typedoc.json",
|
|
318
|
-
"docs:drift": "tsx scripts/check-docs-drift.ts"
|
|
319
|
-
},
|
|
320
311
|
"peerDependencies": {
|
|
321
312
|
"@lancedb/lancedb": "^0.30.0",
|
|
322
313
|
"@types/ws": ">=8.0.0",
|
|
@@ -374,8 +365,6 @@
|
|
|
374
365
|
"devDependencies": {
|
|
375
366
|
"@opentelemetry/api": "^1.9.1",
|
|
376
367
|
"@opentelemetry/sdk-trace-base": "^1.30.1",
|
|
377
|
-
"@theokit/sdk-handoff": "workspace:*",
|
|
378
|
-
"@theokit/sdk-memory": "workspace:*",
|
|
379
368
|
"@types/better-sqlite3": "^7.6.13",
|
|
380
369
|
"@types/proper-lockfile": "^4.1.4",
|
|
381
370
|
"@types/ws": "^8.18.0",
|
|
@@ -385,6 +374,17 @@
|
|
|
385
374
|
"sqlite-vec": "^0.1.9",
|
|
386
375
|
"typedoc": "^0.28.19",
|
|
387
376
|
"ws": "^8.18.0",
|
|
388
|
-
"zod": "^4.0.0"
|
|
377
|
+
"zod": "^4.0.0",
|
|
378
|
+
"@theokit/sdk-memory": "0.2.0",
|
|
379
|
+
"@theokit/sdk-handoff": "0.1.0"
|
|
380
|
+
},
|
|
381
|
+
"scripts": {
|
|
382
|
+
"build": "tsup && cp src/internal/providers/provider-catalog.json dist/provider-catalog.json",
|
|
383
|
+
"test": "vitest run --no-file-parallelism",
|
|
384
|
+
"test:watch": "vitest",
|
|
385
|
+
"typecheck": "tsc --noEmit",
|
|
386
|
+
"clean": "rm -rf dist",
|
|
387
|
+
"docs:json": "typedoc --options typedoc.json",
|
|
388
|
+
"docs:drift": "tsx scripts/check-docs-drift.ts"
|
|
389
389
|
}
|
|
390
|
-
}
|
|
390
|
+
}
|