zidane 3.2.0 → 3.3.2
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/{agent-CE2jhpNE.d.ts → agent-DqEkutk4.d.ts} +92 -25
- package/dist/{chunk-HPTCF3EX.js → chunk-3D5Q527Y.js} +3 -3
- package/dist/{chunk-QX7TDFD4.js → chunk-4ILGBQ23.js} +139 -35
- package/dist/{chunk-YPU6KVL6.js → chunk-LIVB5W4B.js} +1 -1
- package/dist/{chunk-AUBXCLUC.js → chunk-W57VY6DJ.js} +22 -20
- package/dist/{chunk-J4ZOSNSH.js → chunk-X3VOTPVM.js} +1 -7
- package/dist/{chunk-6JIVVEQQ.js → chunk-Z2E5QN5X.js} +198 -84
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -8
- package/dist/mcp.d.ts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +3 -3
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +2 -2
- package/dist/session/sqlite.d.ts +1 -1
- package/dist/session.d.ts +1 -1
- package/dist/session.js +1 -1
- package/dist/{skills-use-CqOKEN56.d.ts → skills-use-WbOh6TuS.d.ts} +1 -1
- package/dist/skills.d.ts +113 -105
- package/dist/skills.js +2 -2
- package/dist/tools.d.ts +4 -4
- package/dist/tools.js +2 -4
- package/dist/types.d.ts +2 -2
- package/dist/{validation-DlIURVGV.d.ts → validation-DTbkLXbd.d.ts} +12 -22
- package/package.json +2 -2
package/dist/providers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { j as AnthropicParams, k as CerebrasParams,
|
|
1
|
+
export { j as AnthropicParams, k as CerebrasParams, ag as OpenAICompatAuthHeader, ah as OpenAICompatHttpError, ai as OpenAICompatParams, r as OpenAIParams, s as OpenRouterParams, w as Provider, x as ProviderCapabilities, Q as StreamCallbacks, U as StreamOptions, W as ToolCall, a0 as ToolResult, a4 as ToolSpec, a6 as TurnResult, an as anthropic, ap as cerebras, aq as classifyOpenAICompatError, aB as mapOAIFinishReason, aE as openai, aF as openaiCompat, aG as openrouter } from './agent-DqEkutk4.js';
|
|
2
2
|
import 'hookable';
|
|
3
3
|
import './types-vA1a_ZX7.js';
|
|
4
4
|
import '@modelcontextprotocol/sdk/client/index.js';
|
package/dist/providers.js
CHANGED
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
cerebras,
|
|
4
4
|
openai,
|
|
5
5
|
openrouter
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-W57VY6DJ.js";
|
|
7
7
|
import {
|
|
8
8
|
OpenAICompatHttpError,
|
|
9
9
|
classifyOpenAICompatError,
|
|
10
10
|
mapOAIFinishReason,
|
|
11
11
|
openaiCompat
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4ILGBQ23.js";
|
|
13
13
|
import "./chunk-LNN5UTS2.js";
|
|
14
14
|
export {
|
|
15
15
|
OpenAICompatHttpError,
|
package/dist/session/sqlite.d.ts
CHANGED
package/dist/session.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { o as CreateSessionOptions,
|
|
1
|
+
export { o as CreateSessionOptions, ae as FileMapAdapter, af as FileMapStoreOptions, R as RemoteStoreOptions, S as Session, z as SessionContentBlock, B as SessionData, F as SessionMessage, G as SessionRun, H as SessionStore, I as SessionTurn, ao as autoDetectAndConvert, at as createFileMapStore, au as createMemoryStore, av as createRemoteStore, aw as createSession, ay as fromAnthropic, az as fromOpenAI, aA as loadSession, aI as toAnthropic, aJ as toOpenAI } from './agent-DqEkutk4.js';
|
|
2
2
|
import 'hookable';
|
|
3
3
|
import './types-vA1a_ZX7.js';
|
|
4
4
|
import '@modelcontextprotocol/sdk/client/index.js';
|
package/dist/session.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Y as ToolDef, J as SkillConfig, aj as SkillActivationState, d as AgentHooks } from './agent-DqEkutk4.js';
|
|
2
2
|
import { Hookable } from 'hookable';
|
|
3
3
|
|
|
4
4
|
/**
|
package/dist/skills.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as AgentHooks,
|
|
2
|
-
export {
|
|
1
|
+
import { d as AgentHooks, aj as SkillActivationState, J as SkillConfig, am as SkillSource, al as SkillDiagnostic, L as SkillsConfig } from './agent-DqEkutk4.js';
|
|
2
|
+
export { ab as ActivationVia, ac as ActiveSkill, ad as DeactivationReason, ak as SkillActivationStateOptions, K as SkillResource, ax as createSkillActivationState } from './agent-DqEkutk4.js';
|
|
3
3
|
import { Hookable } from 'hookable';
|
|
4
4
|
import { b as ExecutionContext, c as ExecutionHandle } from './types-vA1a_ZX7.js';
|
|
5
5
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
@@ -65,106 +65,8 @@ interface BuildCatalogOptions {
|
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Build the skill catalog XML and behavioral instructions for the system prompt.
|
|
68
|
-
*
|
|
69
|
-
* The second argument accepts either {@link BuildCatalogOptions} (preferred)
|
|
70
|
-
* or — for legacy callers — a bare string interpreted as `readToolName` with
|
|
71
|
-
* `skillsToolRegistered: false`. The string form is kept for backward
|
|
72
|
-
* compatibility and will be removed in a future major; pass an options
|
|
73
|
-
* object instead.
|
|
74
|
-
*/
|
|
75
|
-
declare function buildCatalog(skills: SkillConfig[], optionsOrReadToolName?: BuildCatalogOptions | string): string;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Strict validators for Agent Skills.
|
|
79
|
-
*
|
|
80
|
-
* Applied on the authoring path (`defineSkill`, `writeSkillToDisk`). Parser-time
|
|
81
|
-
* validation is intentionally lenient — see `parseSkillFile` for diagnostic collection.
|
|
82
68
|
*/
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* A single issue surfaced by skill-authoring validation.
|
|
86
|
-
* Distinct from `ValidationResult` in `tools/validation.ts` (tool-input JSON
|
|
87
|
-
* schema validation) — different domain, different module.
|
|
88
|
-
*/
|
|
89
|
-
interface SkillValidationIssue {
|
|
90
|
-
/** Stable machine-readable code for consumer matching. */
|
|
91
|
-
code: string;
|
|
92
|
-
/** Human-readable description. */
|
|
93
|
-
message: string;
|
|
94
|
-
/** Frontmatter field name the issue relates to, when applicable. */
|
|
95
|
-
field?: string;
|
|
96
|
-
}
|
|
97
|
-
interface SkillValidationResult {
|
|
98
|
-
valid: boolean;
|
|
99
|
-
errors: SkillValidationIssue[];
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Validate a skill name per the spec:
|
|
103
|
-
* - 1–64 characters
|
|
104
|
-
* - Lowercase alphanumeric + hyphens only
|
|
105
|
-
* - Must not start or end with a hyphen
|
|
106
|
-
* - Must not contain consecutive hyphens
|
|
107
|
-
*
|
|
108
|
-
* The parent-directory match is validated separately (it requires knowing the
|
|
109
|
-
* skill's `location`, which this function does not).
|
|
110
|
-
*/
|
|
111
|
-
declare function validateSkillName(name: string): boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Strict validation for a skill that is about to be authored / written to disk.
|
|
114
|
-
* Rejects anything that would violate the spec. Use the lenient parser path
|
|
115
|
-
* (`parseSkillFile`) for loading third-party skills.
|
|
116
|
-
*/
|
|
117
|
-
declare function validateSkillForWrite(skill: SkillConfig): SkillValidationResult;
|
|
118
|
-
/**
|
|
119
|
-
* Validate that `relPath` stays inside `baseDir` when resolved.
|
|
120
|
-
*
|
|
121
|
-
* Rejects:
|
|
122
|
-
* - Absolute paths (`/etc/passwd`, `C:\…`)
|
|
123
|
-
* - Parent traversal (`..` segments that escape baseDir)
|
|
124
|
-
* - Null-byte tricks
|
|
125
|
-
*
|
|
126
|
-
* Returns `{ valid: true, absolutePath }` on success or `{ valid: false, error }`
|
|
127
|
-
* with a human-readable reason.
|
|
128
|
-
*/
|
|
129
|
-
declare function validateResourcePath(relPath: string, baseDir: string): {
|
|
130
|
-
valid: true;
|
|
131
|
-
absolutePath: string;
|
|
132
|
-
} | {
|
|
133
|
-
valid: false;
|
|
134
|
-
error: string;
|
|
135
|
-
};
|
|
136
|
-
/**
|
|
137
|
-
* Parse a single `allowed-tools` entry into its tool name + optional argument pattern.
|
|
138
|
-
*
|
|
139
|
-
* Examples:
|
|
140
|
-
* - `Read` → `{ tool: 'Read' }`
|
|
141
|
-
* - `Bash(git:*)` → `{ tool: 'Bash', argPrefix: 'git' }`
|
|
142
|
-
*/
|
|
143
|
-
declare function parseAllowedToolPattern(entry: string): {
|
|
144
|
-
tool: string;
|
|
145
|
-
argPrefix?: string;
|
|
146
|
-
} | null;
|
|
147
|
-
/**
|
|
148
|
-
* Check whether a tool call (identified by its wire/displayName and argument input)
|
|
149
|
-
* matches a skill's allow-list entry.
|
|
150
|
-
*
|
|
151
|
-
* Matching rules (Zidane's interpretation of the spec's unspecified syntax):
|
|
152
|
-
* - Exact match: displayName === pattern (no parens).
|
|
153
|
-
* - Prefix match: for `Tool(arg:*)`, displayName === 'Tool' AND **any** string
|
|
154
|
-
* value in the input object starts with `arg`. This is intentionally
|
|
155
|
-
* permissive: it doesn't depend on a convention about which property carries
|
|
156
|
-
* the "command" (schemas vary across tools), and for the common
|
|
157
|
-
* `shell({ command: 'git …' })` shape it behaves identically to a "primary
|
|
158
|
-
* string" rule.
|
|
159
|
-
* - For tools whose inputs carry no string values, the arg-match returns false.
|
|
160
|
-
*/
|
|
161
|
-
declare function matchesAllowedTool(displayName: string, input: Record<string, unknown>, pattern: string): boolean;
|
|
162
|
-
/**
|
|
163
|
-
* Test whether a tool call is allowed by the union of `allowedTools` across a set
|
|
164
|
-
* of active skills. Returns `true` when the union is empty (permissive default)
|
|
165
|
-
* OR when any entry matches.
|
|
166
|
-
*/
|
|
167
|
-
declare function isToolAllowedByUnion(displayName: string, input: Record<string, unknown>, union: readonly string[]): boolean;
|
|
69
|
+
declare function buildCatalog(skills: SkillConfig[], options?: BuildCatalogOptions): string;
|
|
168
70
|
|
|
169
71
|
/**
|
|
170
72
|
* Skill discovery and parsing.
|
|
@@ -264,6 +166,19 @@ declare function interpolateShellCommands(instructions: string, execution: Execu
|
|
|
264
166
|
* merges everything, and applies filtering.
|
|
265
167
|
*/
|
|
266
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Resolved-skills bundle: the materialized list plus a `cleanup` fn that
|
|
171
|
+
* removes any temporary directory created for `config.write` skills.
|
|
172
|
+
*
|
|
173
|
+
* Inline skills must live on disk for the lifetime of the agent (the
|
|
174
|
+
* `skills_read` / `skills_run_script` tools resolve relative paths against
|
|
175
|
+
* `baseDir`), so cleanup is deferred to `agent.destroy()`. When no temp
|
|
176
|
+
* directory was created, `cleanup` is a no-op.
|
|
177
|
+
*/
|
|
178
|
+
interface ResolvedSkillsBundle {
|
|
179
|
+
skills: SkillConfig[];
|
|
180
|
+
cleanup: () => void;
|
|
181
|
+
}
|
|
267
182
|
/**
|
|
268
183
|
* Resolve all skills from a SkillsConfig:
|
|
269
184
|
*
|
|
@@ -272,11 +187,104 @@ declare function interpolateShellCommands(instructions: string, execution: Execu
|
|
|
272
187
|
* 3. Run lenient discovery
|
|
273
188
|
* 4. Apply filters: `exclude`, `enabled` allowlist, optional project-skill trust gate
|
|
274
189
|
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
190
|
+
* Returns `{ skills, cleanup }` — call `cleanup()` on agent destroy to remove
|
|
191
|
+
* the temp directory created for inline `config.write` skills. The agent
|
|
192
|
+
* factory wires this automatically; standalone callers must invoke it
|
|
193
|
+
* themselves to avoid leaking OS temp.
|
|
194
|
+
*/
|
|
195
|
+
declare function resolveSkills(config: SkillsConfig): Promise<ResolvedSkillsBundle>;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Strict validators for Agent Skills.
|
|
199
|
+
*
|
|
200
|
+
* Applied on the authoring path (`defineSkill`, `writeSkillToDisk`). Parser-time
|
|
201
|
+
* validation is intentionally lenient — see `parseSkillFile` for diagnostic collection.
|
|
202
|
+
*/
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* A single issue surfaced by skill-authoring validation.
|
|
206
|
+
* Distinct from `ValidationResult` in `tools/validation.ts` (tool-input JSON
|
|
207
|
+
* schema validation) — different domain, different module.
|
|
208
|
+
*/
|
|
209
|
+
interface SkillValidationIssue {
|
|
210
|
+
/** Stable machine-readable code for consumer matching. */
|
|
211
|
+
code: string;
|
|
212
|
+
/** Human-readable description. */
|
|
213
|
+
message: string;
|
|
214
|
+
/** Frontmatter field name the issue relates to, when applicable. */
|
|
215
|
+
field?: string;
|
|
216
|
+
}
|
|
217
|
+
interface SkillValidationResult {
|
|
218
|
+
valid: boolean;
|
|
219
|
+
errors: SkillValidationIssue[];
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Validate a skill name per the spec:
|
|
223
|
+
* - 1–64 characters
|
|
224
|
+
* - Lowercase alphanumeric + hyphens only
|
|
225
|
+
* - Must not start or end with a hyphen
|
|
226
|
+
* - Must not contain consecutive hyphens
|
|
227
|
+
*
|
|
228
|
+
* The parent-directory match is validated separately (it requires knowing the
|
|
229
|
+
* skill's `location`, which this function does not).
|
|
230
|
+
*/
|
|
231
|
+
declare function validateSkillName(name: string): boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Strict validation for a skill that is about to be authored / written to disk.
|
|
234
|
+
* Rejects anything that would violate the spec. Use the lenient parser path
|
|
235
|
+
* (`parseSkillFile`) for loading third-party skills.
|
|
236
|
+
*/
|
|
237
|
+
declare function validateSkillForWrite(skill: SkillConfig): SkillValidationResult;
|
|
238
|
+
/**
|
|
239
|
+
* Validate that `relPath` stays inside `baseDir` when resolved.
|
|
240
|
+
*
|
|
241
|
+
* Rejects:
|
|
242
|
+
* - Absolute paths (`/etc/passwd`, `C:\…`)
|
|
243
|
+
* - Parent traversal (`..` segments that escape baseDir)
|
|
244
|
+
* - Null-byte tricks
|
|
245
|
+
*
|
|
246
|
+
* Returns `{ valid: true, absolutePath }` on success or `{ valid: false, error }`
|
|
247
|
+
* with a human-readable reason.
|
|
248
|
+
*/
|
|
249
|
+
declare function validateResourcePath(relPath: string, baseDir: string): {
|
|
250
|
+
valid: true;
|
|
251
|
+
absolutePath: string;
|
|
252
|
+
} | {
|
|
253
|
+
valid: false;
|
|
254
|
+
error: string;
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Parse a single `allowed-tools` entry into its tool name + optional argument pattern.
|
|
258
|
+
*
|
|
259
|
+
* Examples:
|
|
260
|
+
* - `Read` → `{ tool: 'Read' }`
|
|
261
|
+
* - `Bash(git:*)` → `{ tool: 'Bash', argPrefix: 'git' }`
|
|
278
262
|
*/
|
|
279
|
-
declare function
|
|
263
|
+
declare function parseAllowedToolPattern(entry: string): {
|
|
264
|
+
tool: string;
|
|
265
|
+
argPrefix?: string;
|
|
266
|
+
} | null;
|
|
267
|
+
/**
|
|
268
|
+
* Check whether a tool call (identified by its wire/displayName and argument input)
|
|
269
|
+
* matches a skill's allow-list entry.
|
|
270
|
+
*
|
|
271
|
+
* Matching rules (Zidane's interpretation of the spec's unspecified syntax):
|
|
272
|
+
* - Exact match: displayName === pattern (no parens).
|
|
273
|
+
* - Prefix match: for `Tool(arg:*)`, displayName === 'Tool' AND **any** string
|
|
274
|
+
* value in the input object starts with `arg`. This is intentionally
|
|
275
|
+
* permissive: it doesn't depend on a convention about which property carries
|
|
276
|
+
* the "command" (schemas vary across tools), and for the common
|
|
277
|
+
* `shell({ command: 'git …' })` shape it behaves identically to a "primary
|
|
278
|
+
* string" rule.
|
|
279
|
+
* - For tools whose inputs carry no string values, the arg-match returns false.
|
|
280
|
+
*/
|
|
281
|
+
declare function matchesAllowedTool(displayName: string, input: Record<string, unknown>, pattern: string): boolean;
|
|
282
|
+
/**
|
|
283
|
+
* Test whether a tool call is allowed by the union of `allowedTools` across a set
|
|
284
|
+
* of active skills. Returns `true` when the union is empty (permissive default)
|
|
285
|
+
* OR when any entry matches.
|
|
286
|
+
*/
|
|
287
|
+
declare function isToolAllowedByUnion(displayName: string, input: Record<string, unknown>, union: readonly string[]): boolean;
|
|
280
288
|
|
|
281
289
|
/**
|
|
282
290
|
* Skill writer — materializes inline SkillConfig objects to disk as proper
|
package/dist/skills.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineSkill
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LIVB5W4B.js";
|
|
4
4
|
import {
|
|
5
5
|
IMPLICITLY_ALLOWED_SKILL_TOOLS,
|
|
6
6
|
buildCatalog,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
validateSkillName,
|
|
22
22
|
writeSkillToDisk,
|
|
23
23
|
writeSkillsToDisk
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-X3VOTPVM.js";
|
|
25
25
|
import "./chunk-LNN5UTS2.js";
|
|
26
26
|
export {
|
|
27
27
|
IMPLICITLY_ALLOWED_SKILL_TOOLS,
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { S as SkillsReadToolOptions, a as SkillsRunScriptToolOptions, b as SkillsUseToolOptions, c as createSkillsReadTool, d as createSkillsRunScriptTool, e as createSkillsUseTool, f as edit, g as glob, h as grep, m as multiEdit } from './skills-use-
|
|
2
|
-
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, V as ValidationResult, c as createInteractionTool, b as createSpawnTool,
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
1
|
+
export { S as SkillsReadToolOptions, a as SkillsRunScriptToolOptions, b as SkillsUseToolOptions, c as createSkillsReadTool, d as createSkillsRunScriptTool, e as createSkillsUseTool, f as edit, g as glob, h as grep, m as multiEdit } from './skills-use-WbOh6TuS.js';
|
|
2
|
+
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, V as ValidationResult, c as createInteractionTool, b as createSpawnTool, v as validateToolArgs } from './validation-DTbkLXbd.js';
|
|
3
|
+
import { Y as ToolDef } from './agent-DqEkutk4.js';
|
|
4
|
+
export { X as ToolContext, $ as ToolMap } from './agent-DqEkutk4.js';
|
|
5
5
|
import 'hookable';
|
|
6
6
|
import './presets.js';
|
|
7
7
|
import './types-vA1a_ZX7.js';
|
package/dist/tools.js
CHANGED
|
@@ -11,11 +11,10 @@ import {
|
|
|
11
11
|
multiEdit,
|
|
12
12
|
readFile,
|
|
13
13
|
shell,
|
|
14
|
-
spawn,
|
|
15
14
|
validateToolArgs,
|
|
16
15
|
writeFile
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-Z2E5QN5X.js";
|
|
17
|
+
import "./chunk-X3VOTPVM.js";
|
|
19
18
|
import "./chunk-UD25QF3H.js";
|
|
20
19
|
import "./chunk-7H34OFDA.js";
|
|
21
20
|
import "./chunk-JH6IAAFA.js";
|
|
@@ -33,7 +32,6 @@ export {
|
|
|
33
32
|
multiEdit,
|
|
34
33
|
readFile,
|
|
35
34
|
shell,
|
|
36
|
-
spawn,
|
|
37
35
|
validateToolArgs,
|
|
38
36
|
writeFile
|
|
39
37
|
};
|
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,
|
|
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, M as McpConnection, p as McpServerConfig, q as McpToolHookContext, O as OAuthRefreshHookContext, r as OpenAIParams, s as OpenRouterParams, P as PromptDocumentPart, t as PromptImagePart, u as PromptPart, v as PromptTextPart, w as Provider, x as ProviderCapabilities, R as RemoteStoreOptions, y as RunHookMap, S as Session, z as SessionContentBlock, B as SessionData, D as SessionEndStatus, E as SessionHookContext, F as SessionMessage, G as SessionRun, H as SessionStore, I as SessionTurn, J as SkillConfig, K as SkillResource, L as SkillsConfig, N as SpawnHookContext, Q as StreamCallbacks, T as StreamHookContext, U as StreamOptions, V as ThinkingLevel, W as ToolCall, X as ToolContext, Y as ToolDef, Z as ToolExecutionMode, _ as ToolHookContext, $ as ToolMap, a0 as ToolResult, a1 as ToolResultContent, a2 as ToolResultImageContent, a3 as ToolResultTextContent, a4 as ToolSpec, a5 as TurnFinishReason, a6 as TurnResult, a7 as TurnUsage, a8 as matchesContextExceeded, a9 as toolOutputByteLength, aa as toolResultToText } from './agent-DqEkutk4.js';
|
|
2
2
|
export { C as ContextCapabilities, a as ContextType, E as ExecResult, b as ExecutionContext, c as ExecutionHandle, S as SpawnConfig } from './types-vA1a_ZX7.js';
|
|
3
3
|
export { S as SandboxProvider } from './sandbox-CLghrTLi.js';
|
|
4
4
|
export { Preset } from './presets.js';
|
|
5
|
-
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, V as ValidationResult } from './validation-
|
|
5
|
+
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, V as ValidationResult } from './validation-DTbkLXbd.js';
|
|
6
6
|
import 'hookable';
|
|
7
7
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { X as ToolContext, Y as ToolDef, h as AgentStats, l as ChildRunStats } from './agent-DqEkutk4.js';
|
|
2
2
|
import { Preset } from './presets.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -43,18 +43,21 @@ declare function createInteractionTool(options: InteractionToolOptions): ToolDef
|
|
|
43
43
|
*
|
|
44
44
|
* A configurable factory that reads the parent's preset-y fields from ToolContext.
|
|
45
45
|
*
|
|
46
|
-
* Usage
|
|
46
|
+
* Usage:
|
|
47
47
|
* ```ts
|
|
48
|
-
* import {
|
|
48
|
+
* import { createSpawnTool } from 'zidane'
|
|
49
49
|
* import { definePreset, basicTools } from 'zidane/presets'
|
|
50
|
-
* const preset = definePreset({ name: 'orchestrator', tools: { ...basicTools, spawn } })
|
|
51
|
-
* ```
|
|
52
50
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
51
|
+
* const preset = definePreset({
|
|
52
|
+
* name: 'orchestrator',
|
|
53
|
+
* tools: { ...basicTools, spawn: createSpawnTool({ maxConcurrent: 5 }) },
|
|
54
|
+
* })
|
|
56
55
|
* ```
|
|
57
56
|
*
|
|
57
|
+
* Each `createSpawnTool()` call returns a fresh instance with its own
|
|
58
|
+
* concurrency counter, depth cap, and child-stats accumulator — never
|
|
59
|
+
* share an instance across unrelated parent agents.
|
|
60
|
+
*
|
|
58
61
|
* Key guarantees:
|
|
59
62
|
* - **Depth-capped** to `maxDepth` (default 3) to prevent infinite recursion.
|
|
60
63
|
* - **Concurrency slot is reserved synchronously** before any `await`, so a
|
|
@@ -135,19 +138,6 @@ interface SpawnToolOptions {
|
|
|
135
138
|
* agent (or use the stateless default `spawn`) to keep them isolated.
|
|
136
139
|
*/
|
|
137
140
|
declare function createSpawnTool(options?: SpawnToolOptions): ToolDef & SpawnToolState;
|
|
138
|
-
/**
|
|
139
|
-
* Default spawn tool.
|
|
140
|
-
*
|
|
141
|
-
* Historically this was a module-scoped `createSpawnTool()` instance shared
|
|
142
|
-
* across every agent using `basic` — which meant `maxConcurrent`, `children`,
|
|
143
|
-
* and `totalChildStats` leaked between unrelated runs. The shared-state
|
|
144
|
-
* surface is preserved for backward compat: the spec + execute still work
|
|
145
|
-
* standalone.
|
|
146
|
-
*
|
|
147
|
-
* Prefer calling `createSpawnTool()` explicitly when you care about
|
|
148
|
-
* telemetry isolation between agents.
|
|
149
|
-
*/
|
|
150
|
-
declare const spawn: ToolDef & SpawnToolState;
|
|
151
141
|
|
|
152
142
|
/**
|
|
153
143
|
* Tool argument validation against JSON Schema-style inputSchema.
|
|
@@ -182,4 +172,4 @@ interface ValidationResult {
|
|
|
182
172
|
}
|
|
183
173
|
declare function validateToolArgs(input: Record<string, unknown>, schema: Record<string, unknown>): ValidationResult;
|
|
184
174
|
|
|
185
|
-
export { type ChildAgent as C, type InteractionToolOptions as I, type SpawnToolOptions as S, type ValidationResult as V, type SpawnToolState as a, createSpawnTool as b, createInteractionTool as c,
|
|
175
|
+
export { type ChildAgent as C, type InteractionToolOptions as I, type SpawnToolOptions as S, type ValidationResult as V, type SpawnToolState as a, createSpawnTool as b, createInteractionTool as c, validateToolArgs as v };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zidane",
|
|
3
|
-
"version": "3.2
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "an agent that goes straight to the goal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"typecheck": "tsc --noEmit"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@
|
|
74
|
+
"@mariozechner/pi-ai": "0.70.5",
|
|
75
75
|
"chalk": "^5.6.2",
|
|
76
76
|
"hookable": "^6.1.1",
|
|
77
77
|
"md4x": "^0.0.25"
|