@theokit/sdk 2.18.1 → 2.20.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.
@@ -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
  }
@@ -178,6 +178,16 @@ export interface SkillsSettings {
178
178
  * skills itself.
179
179
  */
180
180
  autoInject?: boolean;
181
+ /**
182
+ * M22 — discover skills from a CUSTOM directory (containing `<name>/SKILL.md`) instead of the
183
+ * default `<cwd>/.theokit/skills`. Absent ⇒ the default root.
184
+ */
185
+ skillsDir?: string;
186
+ /**
187
+ * M22 — code-defined skills (from `createSkill`) merged with the discovered ones. An inline skill
188
+ * overrides a discovered file skill of the same name.
189
+ */
190
+ inline?: import("../create-skill.js").InlineSkill[];
181
191
  }
182
192
  /**
183
193
  * Memory configuration accepted by `Agent.create()` via {@link AgentOptions.memory}.
@@ -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.18.1",
3
+ "version": "2.20.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,6 +308,15 @@
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
+ },
311
320
  "peerDependencies": {
312
321
  "@lancedb/lancedb": "^0.30.0",
313
322
  "@types/ws": ">=8.0.0",
@@ -365,6 +374,8 @@
365
374
  "devDependencies": {
366
375
  "@opentelemetry/api": "^1.9.1",
367
376
  "@opentelemetry/sdk-trace-base": "^1.30.1",
377
+ "@theokit/sdk-handoff": "workspace:*",
378
+ "@theokit/sdk-memory": "workspace:*",
368
379
  "@types/better-sqlite3": "^7.6.13",
369
380
  "@types/proper-lockfile": "^4.1.4",
370
381
  "@types/ws": "^8.18.0",
@@ -374,17 +385,6 @@
374
385
  "sqlite-vec": "^0.1.9",
375
386
  "typedoc": "^0.28.19",
376
387
  "ws": "^8.18.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"
388
+ "zod": "^4.0.0"
389
389
  }
390
- }
390
+ }