zidane 2.0.1 → 2.1.1

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/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  defineSkill
3
- } from "./chunk-LVC7NQUZ.js";
3
+ } from "./chunk-HJUB63VE.js";
4
4
  import {
5
5
  toolResultToText
6
6
  } from "./chunk-MYWDHD7C.js";
@@ -9,11 +9,11 @@ import {
9
9
  cerebras,
10
10
  openai,
11
11
  openrouter
12
- } from "./chunk-FRNFVKWW.js";
12
+ } from "./chunk-CDRXC7A7.js";
13
13
  import {
14
14
  defineHarness,
15
15
  noTools
16
- } from "./chunk-OVQ4N64O.js";
16
+ } from "./chunk-VUVLOTEY.js";
17
17
  import {
18
18
  createAgent,
19
19
  createInteractionTool,
@@ -23,7 +23,7 @@ import {
23
23
  createSpawnTool,
24
24
  glob,
25
25
  spawn
26
- } from "./chunk-PASFWG7S.js";
26
+ } from "./chunk-AWDWJ2YJ.js";
27
27
  import {
28
28
  IMPLICITLY_ALLOWED_SKILL_TOOLS,
29
29
  buildCatalog,
@@ -42,25 +42,25 @@ import {
42
42
  validateSkillName,
43
43
  writeSkillToDisk,
44
44
  writeSkillsToDisk
45
- } from "./chunk-BCXXXJ3G.js";
45
+ } from "./chunk-DCYJYM3E.js";
46
46
  import {
47
47
  createDockerContext,
48
48
  createProcessContext,
49
49
  createSandboxContext
50
- } from "./chunk-SZA4FKW5.js";
50
+ } from "./chunk-2EQT4EHD.js";
51
51
  import {
52
52
  connectMcpServers,
53
53
  normalizeMcpBlocks,
54
54
  normalizeMcpServers,
55
55
  resultToString
56
- } from "./chunk-PJUUYBKF.js";
56
+ } from "./chunk-IJORSHFI.js";
57
57
  import {
58
58
  createFileMapStore,
59
59
  createMemoryStore,
60
60
  createRemoteStore,
61
61
  createSession,
62
62
  loadSession
63
- } from "./chunk-VG2E6YK3.js";
63
+ } from "./chunk-PMCQOMV4.js";
64
64
  import {
65
65
  OpenAICompatHttpError,
66
66
  autoDetectAndConvert,
@@ -71,7 +71,7 @@ import {
71
71
  openaiCompat,
72
72
  toAnthropic,
73
73
  toOpenAI
74
- } from "./chunk-LN4LLLHA.js";
74
+ } from "./chunk-S3FCOMRI.js";
75
75
  import {
76
76
  AgentAbortedError,
77
77
  AgentContextExceededError,
@@ -80,7 +80,7 @@ import {
80
80
  CONTEXT_EXCEEDED_MESSAGE_PATTERNS,
81
81
  matchesContextExceeded,
82
82
  toTypedError
83
- } from "./chunk-7JTBBZ2U.js";
83
+ } from "./chunk-LNN5UTS2.js";
84
84
 
85
85
  // src/tracing.ts
86
86
  function createTracingHooks(options) {
package/dist/mcp.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import 'hookable';
2
- export { M as McpConnection, q as McpServerConfig, at as connectMcpServers, aG as normalizeMcpBlocks, aH as normalizeMcpServers, aL as resultToString } from './agent-D-ZFMbSd.js';
2
+ export { M as McpConnection, q as McpServerConfig, at as connectMcpServers, aG as normalizeMcpBlocks, aH as normalizeMcpServers, aL as resultToString } from './agent-DFkSTVKm.js';
3
3
  import '@modelcontextprotocol/sdk/client/index.js';
4
4
  import './types-BpvTmawk.js';
package/dist/mcp.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  normalizeMcpBlocks,
4
4
  normalizeMcpServers,
5
5
  resultToString
6
- } from "./chunk-PJUUYBKF.js";
6
+ } from "./chunk-IJORSHFI.js";
7
7
  export {
8
8
  connectMcpServers,
9
9
  normalizeMcpBlocks,
@@ -1,4 +1,4 @@
1
- export { j as AnthropicParams, k as CerebrasParams, ai as OpenAICompatAuthHeader, aj as OpenAICompatHttpError, ak as OpenAICompatParams, s as OpenAIParams, t as OpenRouterParams, x as Provider, y as ProviderCapabilities, V as StreamCallbacks, X as StreamOptions, Z as ToolCall, a3 as ToolResult, a7 as ToolSpec, a9 as TurnResult, ap as anthropic, ar as cerebras, as as classifyOpenAICompatError, aE as mapOAIFinishReason, aI as openai, aJ as openaiCompat, aK as openrouter } from './agent-D-ZFMbSd.js';
1
+ export { j as AnthropicParams, k as CerebrasParams, ai as OpenAICompatAuthHeader, aj as OpenAICompatHttpError, ak as OpenAICompatParams, s as OpenAIParams, t as OpenRouterParams, x as Provider, y as ProviderCapabilities, V as StreamCallbacks, X as StreamOptions, Z as ToolCall, a3 as ToolResult, a7 as ToolSpec, a9 as TurnResult, ap as anthropic, ar as cerebras, as as classifyOpenAICompatError, aE as mapOAIFinishReason, aI as openai, aJ as openaiCompat, aK as openrouter } from './agent-DFkSTVKm.js';
2
2
  import 'hookable';
3
3
  import './types-BpvTmawk.js';
4
4
  import '@modelcontextprotocol/sdk/client/index.js';
package/dist/providers.js CHANGED
@@ -3,14 +3,14 @@ import {
3
3
  cerebras,
4
4
  openai,
5
5
  openrouter
6
- } from "./chunk-FRNFVKWW.js";
6
+ } from "./chunk-CDRXC7A7.js";
7
7
  import {
8
8
  OpenAICompatHttpError,
9
9
  classifyOpenAICompatError,
10
10
  mapOAIFinishReason,
11
11
  openaiCompat
12
- } from "./chunk-LN4LLLHA.js";
13
- import "./chunk-7JTBBZ2U.js";
12
+ } from "./chunk-S3FCOMRI.js";
13
+ import "./chunk-LNN5UTS2.js";
14
14
  export {
15
15
  OpenAICompatHttpError,
16
16
  anthropic,
@@ -1,4 +1,4 @@
1
- import { K as SessionStore } from '../agent-D-ZFMbSd.js';
1
+ import { K as SessionStore } from '../agent-DFkSTVKm.js';
2
2
  import 'hookable';
3
3
  import '../types-BpvTmawk.js';
4
4
  import '@modelcontextprotocol/sdk/client/index.js';
package/dist/session.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { o as CreateSessionOptions, ag as FileMapAdapter, ah as FileMapStoreOptions, R as RemoteStoreOptions, S as Session, B as SessionContentBlock, D as SessionData, G as SessionMessage, J as SessionRun, K as SessionStore, L as SessionTurn, aq as autoDetectAndConvert, av as createFileMapStore, aw as createMemoryStore, ax as createRemoteStore, ay as createSession, aB as fromAnthropic, aC as fromOpenAI, aD as loadSession, aM as toAnthropic, aN as toOpenAI } from './agent-D-ZFMbSd.js';
1
+ export { o as CreateSessionOptions, ag as FileMapAdapter, ah as FileMapStoreOptions, R as RemoteStoreOptions, S as Session, B as SessionContentBlock, D as SessionData, G as SessionMessage, J as SessionRun, K as SessionStore, L as SessionTurn, aq as autoDetectAndConvert, av as createFileMapStore, aw as createMemoryStore, ax as createRemoteStore, ay as createSession, aB as fromAnthropic, aC as fromOpenAI, aD as loadSession, aM as toAnthropic, aN as toOpenAI } from './agent-DFkSTVKm.js';
2
2
  import 'hookable';
3
3
  import './types-BpvTmawk.js';
4
4
  import '@modelcontextprotocol/sdk/client/index.js';
package/dist/session.js CHANGED
@@ -4,15 +4,15 @@ import {
4
4
  createRemoteStore,
5
5
  createSession,
6
6
  loadSession
7
- } from "./chunk-VG2E6YK3.js";
7
+ } from "./chunk-PMCQOMV4.js";
8
8
  import {
9
9
  autoDetectAndConvert,
10
10
  fromAnthropic,
11
11
  fromOpenAI,
12
12
  toAnthropic,
13
13
  toOpenAI
14
- } from "./chunk-LN4LLLHA.js";
15
- import "./chunk-7JTBBZ2U.js";
14
+ } from "./chunk-S3FCOMRI.js";
15
+ import "./chunk-LNN5UTS2.js";
16
16
  export {
17
17
  autoDetectAndConvert,
18
18
  createFileMapStore,
@@ -1,4 +1,4 @@
1
- import { $ as ToolDef, N as SkillConfig, al as SkillActivationState, d as AgentHooks } from './agent-D-ZFMbSd.js';
1
+ import { $ as ToolDef, N as SkillConfig, al as SkillActivationState, d as AgentHooks } from './agent-DFkSTVKm.js';
2
2
  import { Hookable } from 'hookable';
3
3
 
4
4
  declare const glob: ToolDef;
package/dist/skills.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { d as AgentHooks, al as SkillActivationState, N as SkillConfig, ao as SkillSource, an as SkillDiagnostic, T as SkillsConfig } from './agent-D-ZFMbSd.js';
2
- export { ad as ActivationVia, ae as ActiveSkill, af as DeactivationReason, am as SkillActivationStateOptions, Q as SkillResource, az as createSkillActivationState } from './agent-D-ZFMbSd.js';
1
+ import { d as AgentHooks, al as SkillActivationState, N as SkillConfig, ao as SkillSource, an as SkillDiagnostic, T as SkillsConfig } from './agent-DFkSTVKm.js';
2
+ export { ad as ActivationVia, ae as ActiveSkill, af as DeactivationReason, am as SkillActivationStateOptions, Q as SkillResource, az as createSkillActivationState } from './agent-DFkSTVKm.js';
3
3
  import { Hookable } from 'hookable';
4
4
  import { b as ExecutionContext, c as ExecutionHandle } from './types-BpvTmawk.js';
5
5
  import '@modelcontextprotocol/sdk/client/index.js';
package/dist/skills.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  defineSkill
3
- } from "./chunk-LVC7NQUZ.js";
3
+ } from "./chunk-HJUB63VE.js";
4
4
  import {
5
5
  IMPLICITLY_ALLOWED_SKILL_TOOLS,
6
6
  buildCatalog,
@@ -22,8 +22,8 @@ import {
22
22
  validateSkillName,
23
23
  writeSkillToDisk,
24
24
  writeSkillsToDisk
25
- } from "./chunk-BCXXXJ3G.js";
26
- import "./chunk-7JTBBZ2U.js";
25
+ } from "./chunk-DCYJYM3E.js";
26
+ import "./chunk-LNN5UTS2.js";
27
27
  export {
28
28
  IMPLICITLY_ALLOWED_SKILL_TOOLS,
29
29
  buildCatalog,
@@ -0,0 +1,150 @@
1
+ import { _ as ToolContext, $ as ToolDef, p as HarnessConfig, h as AgentStats, l as ChildRunStats } from './agent-DFkSTVKm.js';
2
+
3
+ /**
4
+ * Interaction tool — lets the agent request structured input from the outside world.
5
+ *
6
+ * Not included in any harness by default. Add it explicitly:
7
+ *
8
+ * import { createInteractionTool } from 'zidane'
9
+ *
10
+ * const askUser = createInteractionTool({
11
+ * schema: { type: 'object', properties: { question: { type: 'string' } }, required: ['question'] },
12
+ * onRequest: async (payload) => {
13
+ * const answer = await promptUser(payload.question)
14
+ * return { answer }
15
+ * },
16
+ * })
17
+ *
18
+ * const harness = defineHarness({ name: 'interactive', tools: { ...basicTools, ask_user: askUser } })
19
+ */
20
+
21
+ interface InteractionToolOptions {
22
+ /** JSON Schema for the request payload the model sends */
23
+ schema: Record<string, unknown>;
24
+ /** Tool name (default: 'interaction') */
25
+ name?: string;
26
+ /** Tool description shown to the model */
27
+ description?: string;
28
+ /** Called when the model invokes this tool. Receives the validated payload and tool context, returns data for the model. */
29
+ onRequest: (payload: Record<string, unknown>, ctx: ToolContext) => Promise<Record<string, unknown> | string>;
30
+ }
31
+ /**
32
+ * Create an interaction tool that lets the agent request structured input.
33
+ *
34
+ * The model calls this tool with a payload matching the schema.
35
+ * `onRequest` is called with the payload and should return the response
36
+ * (string or object) that gets sent back to the model as the tool result.
37
+ */
38
+ declare function createInteractionTool(options: InteractionToolOptions): ToolDef;
39
+
40
+ /**
41
+ * Spawn tool — create sub-agents from a parent agent.
42
+ *
43
+ * A configurable factory that reads provider + harness from ToolContext.
44
+ *
45
+ * Usage — default (stateless, safe across parent agents):
46
+ * ```ts
47
+ * import { spawn } from 'zidane'
48
+ * const harness = defineHarness({ name: 'orchestrator', tools: { ...basicTools, spawn } })
49
+ * ```
50
+ *
51
+ * Usage — with shared state (telemetry, lifecycle callbacks):
52
+ * ```ts
53
+ * const tool = createSpawnTool({ maxConcurrent: 5, onComplete })
54
+ * ```
55
+ *
56
+ * Key guarantees:
57
+ * - **Depth-capped** to `maxDepth` (default 3) to prevent infinite recursion.
58
+ * - **Concurrency slot is reserved synchronously** before any `await`, so a
59
+ * parent running tools in parallel cannot exceed `maxConcurrent`.
60
+ * - **Pre-aborted signals short-circuit** without paying agent-spawn cost.
61
+ * - **Abort / timeout / error are surfaced distinctly** in the returned text
62
+ * and via `ChildRunStats.status` on `spawn:complete`.
63
+ * - **`agent.destroy()` errors never mask the original run error** (captured
64
+ * and emitted via `spawn:error` but the primary error wins).
65
+ * - **Child hooks bubble** to the parent as `child:*` events when
66
+ * `forwardHooks` is set (default `true`).
67
+ * - **Persistence** via `persist: true` — child runs get appended to the
68
+ * parent's session with `parentRunId` wired, so the run tree is
69
+ * reconstructible from a stored `SessionData`.
70
+ */
71
+
72
+ interface ChildAgent {
73
+ id: string;
74
+ task: string;
75
+ startedAt: number;
76
+ /** Subagent depth — 1 for a direct child of a top-level agent. */
77
+ depth: number;
78
+ }
79
+ interface SpawnToolState {
80
+ /** Currently running children. */
81
+ readonly children: ReadonlyMap<string, ChildAgent>;
82
+ /** Aggregated stats from all completed children (returns a copy). */
83
+ readonly totalChildStats: Readonly<AgentStats>;
84
+ }
85
+ interface SpawnToolOptions {
86
+ /** Maximum concurrent sub-agents (default: 3). */
87
+ maxConcurrent?: number;
88
+ /**
89
+ * Maximum subagent depth. 0 disables spawning entirely; 1 allows top-level
90
+ * spawns but forbids grandchildren; 3 (default) allows three levels of
91
+ * recursion — enough for most orchestration patterns, a sharp ceiling
92
+ * against runaway loops.
93
+ */
94
+ maxDepth?: number;
95
+ /** Child model override. */
96
+ model?: string;
97
+ /** Child system prompt override. Per-spawn `input.system` takes precedence. */
98
+ system?: string;
99
+ /** Child thinking level. */
100
+ thinking?: 'off' | 'minimal' | 'low' | 'medium' | 'high';
101
+ /** Harness override for children. Defaults to the parent's harness. */
102
+ harness?: HarnessConfig;
103
+ /**
104
+ * Per-child timeout, in milliseconds. When the child exceeds it the spawn
105
+ * tool returns a timeout marker, fires `spawn:error`, and destroys the
106
+ * child agent. Default: none.
107
+ */
108
+ timeoutMs?: number;
109
+ /**
110
+ * When `true` and the parent has a session, the child reuses the parent's
111
+ * session — child turns are appended with the child's own `runId`, and the
112
+ * resulting `SessionRun` carries `parentRunId` so the tree is
113
+ * reconstructible. Default: `false` (child is in-memory only).
114
+ */
115
+ persist?: boolean;
116
+ /**
117
+ * Forward a curated subset of child hook events (`stream:*`, `tool:*`,
118
+ * `turn:after`) onto the parent's hook bus as `child:*` events. Default:
119
+ * `true`. Grandchildren bubble through their child transparently.
120
+ */
121
+ forwardHooks?: boolean;
122
+ /** Called when a child agent starts. */
123
+ onSpawn?: (child: ChildAgent) => void;
124
+ /** Called when a child agent completes (success, abort, timeout, or error). */
125
+ onComplete?: (child: ChildAgent, stats: AgentStats, status: NonNullable<ChildRunStats['status']>) => void;
126
+ }
127
+ /**
128
+ * Create a configured spawn tool.
129
+ *
130
+ * State (`children`, `totalChildStats`, counters, active count) is scoped to
131
+ * the returned instance. Multiple parent agents using the same instance will
132
+ * share counters + stats + concurrency slots — call `createSpawnTool()` per
133
+ * agent (or use the stateless default `spawn`) to keep them isolated.
134
+ */
135
+ declare function createSpawnTool(options?: SpawnToolOptions): ToolDef & SpawnToolState;
136
+ /**
137
+ * Default spawn tool.
138
+ *
139
+ * Historically this was a module-scoped `createSpawnTool()` instance shared
140
+ * across every agent using `basic` — which meant `maxConcurrent`, `children`,
141
+ * and `totalChildStats` leaked between unrelated runs. The shared-state
142
+ * surface is preserved for backward compat: the spec + execute still work
143
+ * standalone.
144
+ *
145
+ * Prefer calling `createSpawnTool()` explicitly when you care about
146
+ * telemetry isolation between agents.
147
+ */
148
+ declare const spawn: ToolDef & SpawnToolState;
149
+
150
+ export { type ChildAgent as C, type InteractionToolOptions as I, type SpawnToolOptions as S, type SpawnToolState as a, createSpawnTool as b, createInteractionTool as c, spawn as s };
package/dist/tools.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { S as SkillsReadToolOptions, a as SkillsRunScriptToolOptions, b as SkillsUseToolOptions, c as createSkillsReadTool, d as createSkillsRunScriptTool, e as createSkillsUseTool, g as glob } from './skills-use-C4KFVla0.js';
2
- export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, c as createInteractionTool, b as createSpawnTool, s as spawn } from './spawn-RoqpjYLZ.js';
3
- import { $ as ToolDef } from './agent-D-ZFMbSd.js';
1
+ export { S as SkillsReadToolOptions, a as SkillsRunScriptToolOptions, b as SkillsUseToolOptions, c as createSkillsReadTool, d as createSkillsRunScriptTool, e as createSkillsUseTool, g as glob } from './skills-use-DWprxufr.js';
2
+ export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, c as createInteractionTool, b as createSpawnTool, s as spawn } from './spawn-CW5GEK-T.js';
3
+ import { $ as ToolDef } from './agent-DFkSTVKm.js';
4
4
  export { V as ValidationResult, v as validateToolArgs } from './validation-DOY_k7lW.js';
5
5
  import 'hookable';
6
6
  import './types-BpvTmawk.js';
package/dist/tools.js CHANGED
@@ -11,11 +11,11 @@ import {
11
11
  spawn,
12
12
  validateToolArgs,
13
13
  writeFile
14
- } from "./chunk-PASFWG7S.js";
15
- import "./chunk-BCXXXJ3G.js";
16
- import "./chunk-SZA4FKW5.js";
17
- import "./chunk-PJUUYBKF.js";
18
- import "./chunk-7JTBBZ2U.js";
14
+ } from "./chunk-AWDWJ2YJ.js";
15
+ import "./chunk-DCYJYM3E.js";
16
+ import "./chunk-2EQT4EHD.js";
17
+ import "./chunk-IJORSHFI.js";
18
+ import "./chunk-LNN5UTS2.js";
19
19
  export {
20
20
  createInteractionTool,
21
21
  createSkillsReadTool,
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { A as Agent, a as AgentAbortedError, b as AgentBehavior, c as AgentContextExceededError, d as AgentHooks, e as AgentOptions, f as AgentProviderError, g as AgentRunOptions, h as AgentStats, i as AgentToolNotAllowedError, j as AnthropicParams, C as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, k as CerebrasParams, l as ChildRunStats, m as ClassifiedError, n as ClassifiedErrorKind, o as CreateSessionOptions, H as Harness, p as HarnessConfig, I as ImageContent, M as McpConnection, q as McpServerConfig, r as McpToolHookContext, O as OAuthRefreshHookContext, s as OpenAIParams, t as OpenRouterParams, P as PromptDocumentPart, u as PromptImagePart, v as PromptPart, w as PromptTextPart, x as Provider, y as ProviderCapabilities, R as RemoteStoreOptions, z as RunHookMap, S as Session, B as SessionContentBlock, D as SessionData, E as SessionEndStatus, F as SessionHookContext, G as SessionMessage, J as SessionRun, K as SessionStore, L as SessionTurn, N as SkillConfig, Q as SkillResource, T as SkillsConfig, U as SpawnHookContext, V as StreamCallbacks, W as StreamHookContext, X as StreamOptions, Y as ThinkingLevel, Z as ToolCall, _ as ToolContext, $ as ToolDef, a0 as ToolExecutionMode, a1 as ToolHookContext, a2 as ToolMap, a3 as ToolResult, a4 as ToolResultContent, a5 as ToolResultImageContent, a6 as ToolResultTextContent, a7 as ToolSpec, a8 as TurnFinishReason, a9 as TurnResult, aa as TurnUsage, ab as matchesContextExceeded, ac as toolResultToText } from './agent-D-ZFMbSd.js';
1
+ export { A as Agent, a as AgentAbortedError, b as AgentBehavior, c as AgentContextExceededError, d as AgentHooks, e as AgentOptions, f as AgentProviderError, g as AgentRunOptions, h as AgentStats, i as AgentToolNotAllowedError, j as AnthropicParams, C as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, k as CerebrasParams, l as ChildRunStats, m as ClassifiedError, n as ClassifiedErrorKind, o as CreateSessionOptions, H as Harness, p as HarnessConfig, I as ImageContent, M as McpConnection, q as McpServerConfig, r as McpToolHookContext, O as OAuthRefreshHookContext, s as OpenAIParams, t as OpenRouterParams, P as PromptDocumentPart, u as PromptImagePart, v as PromptPart, w as PromptTextPart, x as Provider, y as ProviderCapabilities, R as RemoteStoreOptions, z as RunHookMap, S as Session, B as SessionContentBlock, D as SessionData, E as SessionEndStatus, F as SessionHookContext, G as SessionMessage, J as SessionRun, K as SessionStore, L as SessionTurn, N as SkillConfig, Q as SkillResource, T as SkillsConfig, U as SpawnHookContext, V as StreamCallbacks, W as StreamHookContext, X as StreamOptions, Y as ThinkingLevel, Z as ToolCall, _ as ToolContext, $ as ToolDef, a0 as ToolExecutionMode, a1 as ToolHookContext, a2 as ToolMap, a3 as ToolResult, a4 as ToolResultContent, a5 as ToolResultImageContent, a6 as ToolResultTextContent, a7 as ToolSpec, a8 as TurnFinishReason, a9 as TurnResult, aa as TurnUsage, ab as matchesContextExceeded, ac as toolResultToText } from './agent-DFkSTVKm.js';
2
2
  export { C as ContextCapabilities, a as ContextType, E as ExecResult, b as ExecutionContext, c as ExecutionHandle, S as SpawnConfig } from './types-BpvTmawk.js';
3
3
  export { S as SandboxProvider } from './sandbox-CW72eLDP.js';
4
- export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState } from './spawn-RoqpjYLZ.js';
4
+ export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState } from './spawn-CW5GEK-T.js';
5
5
  export { V as ValidationResult } from './validation-DOY_k7lW.js';
6
6
  import 'hookable';
7
7
  import '@modelcontextprotocol/sdk/client/index.js';
package/dist/types.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  AgentToolNotAllowedError,
9
9
  CONTEXT_EXCEEDED_MESSAGE_PATTERNS,
10
10
  matchesContextExceeded
11
- } from "./chunk-7JTBBZ2U.js";
11
+ } from "./chunk-LNN5UTS2.js";
12
12
  export {
13
13
  AgentAbortedError,
14
14
  AgentContextExceededError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zidane",
3
- "version": "2.0.1",
3
+ "version": "2.1.1",
4
4
  "description": "an agent that goes straight to the goal",
5
5
  "type": "module",
6
6
  "private": false,
@@ -90,8 +90,8 @@
90
90
  }
91
91
  },
92
92
  "devDependencies": {
93
- "@anthropic-ai/sdk": "^0.88.0",
94
93
  "@antfu/eslint-config": "^8.1.1",
94
+ "@anthropic-ai/sdk": "^0.88.0",
95
95
  "@modelcontextprotocol/sdk": "^1.29.0",
96
96
  "@types/bun": "^1.3.12",
97
97
  "@types/dockerode": "^4.0.1",
@@ -1,99 +0,0 @@
1
- import { _ as ToolContext, $ as ToolDef, p as HarnessConfig, h as AgentStats } from './agent-D-ZFMbSd.js';
2
-
3
- /**
4
- * Interaction tool — lets the agent request structured input from the outside world.
5
- *
6
- * Not included in any harness by default. Add it explicitly:
7
- *
8
- * import { createInteractionTool } from 'zidane'
9
- *
10
- * const askUser = createInteractionTool({
11
- * schema: { type: 'object', properties: { question: { type: 'string' } }, required: ['question'] },
12
- * onRequest: async (payload) => {
13
- * const answer = await promptUser(payload.question)
14
- * return { answer }
15
- * },
16
- * })
17
- *
18
- * const harness = defineHarness({ name: 'interactive', tools: { ...basicTools, ask_user: askUser } })
19
- */
20
-
21
- interface InteractionToolOptions {
22
- /** JSON Schema for the request payload the model sends */
23
- schema: Record<string, unknown>;
24
- /** Tool name (default: 'interaction') */
25
- name?: string;
26
- /** Tool description shown to the model */
27
- description?: string;
28
- /** Called when the model invokes this tool. Receives the validated payload and tool context, returns data for the model. */
29
- onRequest: (payload: Record<string, unknown>, ctx: ToolContext) => Promise<Record<string, unknown> | string>;
30
- }
31
- /**
32
- * Create an interaction tool that lets the agent request structured input.
33
- *
34
- * The model calls this tool with a payload matching the schema.
35
- * `onRequest` is called with the payload and should return the response
36
- * (string or object) that gets sent back to the model as the tool result.
37
- */
38
- declare function createInteractionTool(options: InteractionToolOptions): ToolDef;
39
-
40
- /**
41
- * Spawn tool — create sub-agents from a parent agent.
42
- *
43
- * A static tool that reads provider and harness from ToolContext.
44
- * Just add it to any harness's tools — no factory needed.
45
- *
46
- * Usage:
47
- * import { spawn } from 'zidane'
48
- *
49
- * const harness = defineHarness({
50
- * name: 'orchestrator',
51
- * tools: { ...basicTools, spawn },
52
- * })
53
- */
54
-
55
- interface ChildAgent {
56
- id: string;
57
- task: string;
58
- startedAt: number;
59
- }
60
- interface SpawnToolState {
61
- /** Currently running children */
62
- readonly children: ReadonlyMap<string, ChildAgent>;
63
- /** Aggregated stats from all completed children (returns a copy) */
64
- readonly totalChildStats: Readonly<AgentStats>;
65
- }
66
- interface SpawnToolOptions {
67
- /** Maximum concurrent sub-agents (default: 3) */
68
- maxConcurrent?: number;
69
- /** Model override for child agents */
70
- model?: string;
71
- /** System prompt for child agents */
72
- system?: string;
73
- /** Thinking level for child agents */
74
- thinking?: 'off' | 'minimal' | 'low' | 'medium' | 'high';
75
- /** Override harness for children (defaults to parent's harness from ToolContext) */
76
- harness?: HarnessConfig;
77
- /** Called when a child agent starts */
78
- onSpawn?: (child: ChildAgent) => void;
79
- /** Called when a child agent completes */
80
- onComplete?: (child: ChildAgent, stats: AgentStats) => void;
81
- }
82
- /**
83
- * Create a configured spawn tool with custom options.
84
- *
85
- * For most cases, use the static `spawn` export directly.
86
- * Use this factory when you need custom concurrency limits,
87
- * model overrides, or lifecycle callbacks.
88
- */
89
- declare function createSpawnTool(options?: SpawnToolOptions): ToolDef & SpawnToolState;
90
- /**
91
- * Static spawn tool — add directly to any harness.
92
- *
93
- * Reads provider and harness from ToolContext at execution time.
94
- * Children get the same harness as the parent (including spawn),
95
- * so sub-agents can spawn their own children.
96
- */
97
- declare const spawn: ToolDef & SpawnToolState;
98
-
99
- export { type ChildAgent as C, type InteractionToolOptions as I, type SpawnToolOptions as S, type SpawnToolState as a, createSpawnTool as b, createInteractionTool as c, spawn as s };