@theokit/sdk 4.29.0 → 4.30.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 (36) hide show
  1. package/dist/{agent-FBTLZI6V.js → agent-7YUGJJTU.js} +3 -3
  2. package/dist/{agent-FBTLZI6V.js.map → agent-7YUGJJTU.js.map} +1 -1
  3. package/dist/{agent-CdjSCbYz.d.cts → agent-Bzg2_uGr.d.cts} +55 -1
  4. package/dist/{agent-BZz4X8ZM.d.ts → agent-Ekv8y7_c.d.ts} +55 -1
  5. package/dist/{agent-LBCEK6VH.cjs → agent-LD76RI74.cjs} +4 -4
  6. package/dist/{agent-LBCEK6VH.cjs.map → agent-LD76RI74.cjs.map} +1 -1
  7. package/dist/{chunk-EULKRTB5.js → chunk-5YCAR23S.js} +3 -3
  8. package/dist/{chunk-EULKRTB5.js.map → chunk-5YCAR23S.js.map} +1 -1
  9. package/dist/{chunk-YQAPEYUV.cjs → chunk-GWMQ5CS3.cjs} +15 -7
  10. package/dist/chunk-GWMQ5CS3.cjs.map +1 -0
  11. package/dist/{chunk-VUJ3NVDC.js → chunk-ISZ3MBUD.js} +13 -5
  12. package/dist/chunk-ISZ3MBUD.js.map +1 -0
  13. package/dist/{chunk-54YLX4Q6.cjs → chunk-NG6B2PMA.cjs} +5 -5
  14. package/dist/{chunk-54YLX4Q6.cjs.map → chunk-NG6B2PMA.cjs.map} +1 -1
  15. package/dist/{cron-CIIshMs3.d.cts → cron-CjzvXGT2.d.cts} +1 -1
  16. package/dist/{cron-dElBjDaL.d.ts → cron-D0Z29gI-.d.ts} +1 -1
  17. package/dist/cron.cjs +3 -3
  18. package/dist/cron.d.cts +2 -2
  19. package/dist/cron.d.ts +2 -2
  20. package/dist/cron.js +2 -2
  21. package/dist/eval.cjs +2 -2
  22. package/dist/eval.js +1 -1
  23. package/dist/index.cjs +21 -21
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +4 -4
  26. package/dist/index.d.ts +4 -4
  27. package/dist/index.js +4 -4
  28. package/dist/index.js.map +1 -1
  29. package/dist/internal/plugins/types.d.cts +1 -1
  30. package/dist/internal/plugins/types.d.ts +1 -1
  31. package/dist/subagents-loader.d.cts +1 -1
  32. package/dist/subagents-loader.d.ts +1 -1
  33. package/dist/types/plugin.d.ts +32 -0
  34. package/package.json +1 -1
  35. package/dist/chunk-VUJ3NVDC.js.map +0 -1
  36. package/dist/chunk-YQAPEYUV.cjs.map +0 -1
@@ -11,7 +11,7 @@
11
11
  * @public
12
12
  */
13
13
  import type { Plugin as PluginType } from "../../types/plugin.js";
14
- export type { CommandHandler, CommandOptions, HookHandler, HookName, LlmCallContext, PluginContext, PostAssistantReplyContext, PostToolCallContext, PreToolCallContext, PreToolCallDecision, PreUserSendContext, PreUserSendResult, SessionLifecycleContext, ToolContext, TransformContext, } from "../../types/plugin.js";
14
+ export type { CommandHandler, CommandOptions, HookHandler, HookName, LlmCallContext, PluginContext, PostAssistantReplyContext, PostToolCallContext, PreToolCallContext, PreToolCallDecision, PreUserSendContext, PreUserSendResult, SessionLifecycleContext, ToolCallSummary, ToolContext, ToolResultTransformContext, TransformContext, } from "../../types/plugin.js";
15
15
  export type Plugin = PluginType;
16
16
  /**
17
17
  * Identity helper for plugin authors. TS-only convenience — preserves
@@ -11,7 +11,7 @@
11
11
  * @public
12
12
  */
13
13
  import type { Plugin as PluginType } from "../../types/plugin.js";
14
- export type { CommandHandler, CommandOptions, HookHandler, HookName, LlmCallContext, PluginContext, PostAssistantReplyContext, PostToolCallContext, PreToolCallContext, PreToolCallDecision, PreUserSendContext, PreUserSendResult, SessionLifecycleContext, ToolContext, TransformContext, } from "../../types/plugin.js";
14
+ export type { CommandHandler, CommandOptions, HookHandler, HookName, LlmCallContext, PluginContext, PostAssistantReplyContext, PostToolCallContext, PreToolCallContext, PreToolCallDecision, PreUserSendContext, PreUserSendResult, SessionLifecycleContext, ToolCallSummary, ToolContext, ToolResultTransformContext, TransformContext, } from "../../types/plugin.js";
15
15
  export type Plugin = PluginType;
16
16
  /**
17
17
  * Identity helper for plugin authors. TS-only convenience — preserves
@@ -1,4 +1,4 @@
1
- import { a as AgentDefinition } from './agent-CdjSCbYz.cjs';
1
+ import { a as AgentDefinition } from './agent-Bzg2_uGr.cjs';
2
2
  import './run-OJbGyweZ.cjs';
3
3
  import 'zod';
4
4
 
@@ -1,4 +1,4 @@
1
- import { a as AgentDefinition } from './agent-BZz4X8ZM.js';
1
+ import { a as AgentDefinition } from './agent-Ekv8y7_c.js';
2
2
  import './run-OJbGyweZ.js';
3
3
  import 'zod';
4
4
 
@@ -77,6 +77,38 @@ export interface TransformContext {
77
77
  agentId: string;
78
78
  runId: string;
79
79
  }
80
+ /**
81
+ * M82 — one tool call of the turn, as seen by `transform_tool_result`. `id` is the correlation key
82
+ * back into the batch: it equals the `toolUseId` of the matching `tool_result` part.
83
+ *
84
+ * @public
85
+ */
86
+ export interface ToolCallSummary {
87
+ id: string;
88
+ name: string;
89
+ args: Record<string, unknown>;
90
+ }
91
+ /**
92
+ * M82 — context for `transform_tool_result`, the only tool-stage hook whose return value the SDK
93
+ * actually applies (`#runTransform` folds it; `#runFireAndForget` discards `post_tool_call`'s).
94
+ *
95
+ * Before M82 this seam knew only `{agentId, runId}`, so a hook could transform results but could not
96
+ * tell WHICH tool produced which one. A policy scoped to a tool name — the common case — therefore
97
+ * had to live on `post_tool_call`, whose return is discarded, and silently degraded to observation.
98
+ *
99
+ * `toolCalls` is PLURAL because the seam is batch-shaped: `dispatchTools` runs every tool call of the
100
+ * turn and the hook receives all results together. A singular `name` would have to lie in any
101
+ * multi-tool turn. Correlate with `LlmToolResultPart.toolUseId === ToolCallSummary.id`.
102
+ *
103
+ * Kept separate from {@link TransformContext} on purpose: that type is shared with
104
+ * `transform_llm_output`, which has no tool call at all, and an optional field there would be
105
+ * permanently `undefined` for half its consumers.
106
+ *
107
+ * @public
108
+ */
109
+ export interface ToolResultTransformContext extends TransformContext {
110
+ toolCalls: readonly ToolCallSummary[];
111
+ }
80
112
  /**
81
113
  * Context passed to `pre_user_send` hook handlers (ADR D145).
82
114
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theokit/sdk",
3
- "version": "4.29.0",
3
+ "version": "4.30.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/usetheodev/theokit-sdk#readme",