zidane 1.6.0 → 1.6.4
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/README.md +97 -13
- package/dist/{agent-DVvuhEN-.d.ts → agent-CPOBJlcn.d.ts} +5 -6
- package/dist/{chunk-3K5D27BF.js → chunk-4C6Y56CC.js} +3 -4
- package/dist/{chunk-7V33E7LT.js → chunk-BDBQ5MIB.js} +1 -1
- package/dist/{chunk-VRAZJES3.js → chunk-KWNFSVVE.js} +60 -31
- package/dist/{chunk-YTZOORAP.js → chunk-NNMWWSBY.js} +1 -1
- package/dist/{chunk-LS57GDAV.js → chunk-UHCWNQGG.js} +1 -1
- package/dist/{chunk-XT7QBZ47.js → chunk-V4PBD7LE.js} +1 -1
- package/dist/harnesses.d.ts +2 -2
- package/dist/harnesses.js +4 -4
- package/dist/index.d.ts +7 -7
- package/dist/index.js +8 -6
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +1 -1
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +2 -2
- package/dist/{sandbox-C08DQPTu.d.ts → sandbox-DZn3ybp_.d.ts} +1 -1
- package/dist/session.d.ts +2 -2
- package/dist/session.js +2 -2
- package/dist/skills.d.ts +2 -2
- package/dist/skills.js +1 -1
- package/dist/{spawn-DJZZ9ZWw.d.ts → spawn-CK08YMPC.d.ts} +39 -2
- package/dist/tools.d.ts +4 -4
- package/dist/tools.js +5 -3
- package/dist/{types-CyRzBgm0.d.ts → types-CKXAp41h.d.ts} +2 -2
- package/dist/types.d.ts +5 -5
- package/dist/{validation-CwSuvOKf.d.ts → validation-DOY_k7lW.d.ts} +1 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -34,16 +34,16 @@ All options on `createAgent`:
|
|
|
34
34
|
```ts
|
|
35
35
|
createAgent({
|
|
36
36
|
provider, // required: LLM provider
|
|
37
|
+
session, // session for persistence
|
|
37
38
|
harness: basic, // tool set (default: noTools)
|
|
38
39
|
behavior: { // agent-level defaults
|
|
39
|
-
toolExecution: '
|
|
40
|
+
toolExecution: 'parallel', // or 'sequential' (default: parallel)
|
|
40
41
|
maxTurns: 50, // max loop iterations
|
|
41
|
-
maxTokens: 16384,
|
|
42
|
-
thinkingBudget: 10240,
|
|
42
|
+
maxTokens: 16384, // max tokens per LLM response
|
|
43
|
+
thinkingBudget: 10240, // exact thinking token budget
|
|
43
44
|
},
|
|
44
45
|
execution: createProcessContext(), // where tools run
|
|
45
46
|
mcpServers: [], // MCP tool servers
|
|
46
|
-
session, // session for persistence
|
|
47
47
|
skills: {}, // skills configuration
|
|
48
48
|
})
|
|
49
49
|
```
|
|
@@ -52,7 +52,7 @@ All options on `agent.run()`:
|
|
|
52
52
|
|
|
53
53
|
```ts
|
|
54
54
|
await agent.run({
|
|
55
|
-
prompt: 'your task', //
|
|
55
|
+
prompt: 'your task', // optional when session has existing turns
|
|
56
56
|
model: 'claude-opus-4-6',
|
|
57
57
|
system: 'be concise',
|
|
58
58
|
thinking: 'medium', // off | minimal | low | medium | high
|
|
@@ -67,6 +67,8 @@ await agent.run({
|
|
|
67
67
|
})
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
`prompt` is optional when a session with existing turns is provided — the agent resumes from the last turn. This supports apps where the user message is persisted to the session before the agent runs (e.g. WebSocket → session → queue → agent).
|
|
71
|
+
|
|
70
72
|
Precedence: `run.behavior` > `agent.behavior` > `harness.behavior` > hardcoded defaults.
|
|
71
73
|
|
|
72
74
|
## CLI
|
|
@@ -166,10 +168,10 @@ Extended reasoning with named levels or exact token budgets.
|
|
|
166
168
|
await agent.run({ prompt: 'solve this', thinking: 'high' })
|
|
167
169
|
|
|
168
170
|
// Exact budget (overrides level default)
|
|
169
|
-
await agent.run({ prompt: 'solve this', thinking: 'high', thinkingBudget: 50000 })
|
|
171
|
+
await agent.run({ prompt: 'solve this', thinking: 'high', behavior: { thinkingBudget: 50000 } })
|
|
170
172
|
|
|
171
173
|
// Agent-level default
|
|
172
|
-
const agent = createAgent({ provider, harness, thinkingBudget: 16384 })
|
|
174
|
+
const agent = createAgent({ provider, harness, behavior: { thinkingBudget: 16384 } })
|
|
173
175
|
```
|
|
174
176
|
|
|
175
177
|
## Hooks
|
|
@@ -184,12 +186,19 @@ agent.hooks.hook('turn:before', (ctx) => {
|
|
|
184
186
|
})
|
|
185
187
|
|
|
186
188
|
agent.hooks.hook('turn:after', (ctx) => {
|
|
187
|
-
// ctx.turn, ctx.turnId, ctx.usage
|
|
189
|
+
// ctx.turn, ctx.turnId, ctx.usage, ctx.message (full SessionTurn)
|
|
188
190
|
// Always fires — even if the provider throws mid-stream
|
|
191
|
+
// Turn is guaranteed to be in agent.turns before this fires
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
agent.hooks.hook('usage', (ctx) => {
|
|
195
|
+
// ctx.turn, ctx.turnId, ctx.usage (per-turn)
|
|
196
|
+
// ctx.totalIn, ctx.totalOut (running totals)
|
|
189
197
|
})
|
|
190
198
|
|
|
191
199
|
agent.hooks.hook('agent:done', (ctx) => {
|
|
192
200
|
// ctx.totalIn, ctx.totalOut, ctx.turns, ctx.elapsed, ctx.children?
|
|
201
|
+
// ctx.output — structured output (when behavior.schema is set)
|
|
193
202
|
// Fires on all exit paths: completion, maxTurns, and abort
|
|
194
203
|
})
|
|
195
204
|
```
|
|
@@ -198,11 +207,11 @@ agent.hooks.hook('agent:done', (ctx) => {
|
|
|
198
207
|
|
|
199
208
|
```ts
|
|
200
209
|
agent.hooks.hook('stream:text', (ctx) => {
|
|
201
|
-
// ctx.delta, ctx.text, ctx.turnId
|
|
210
|
+
// ctx.delta, ctx.text, ctx.turnId
|
|
202
211
|
})
|
|
203
212
|
|
|
204
213
|
agent.hooks.hook('stream:end', (ctx) => {
|
|
205
|
-
// ctx.text (final), ctx.turnId
|
|
214
|
+
// ctx.text (final), ctx.turnId
|
|
206
215
|
// Only fires when there is text content (not on tool-only turns)
|
|
207
216
|
})
|
|
208
217
|
```
|
|
@@ -290,6 +299,34 @@ const harness = defineHarness({
|
|
|
290
299
|
|
|
291
300
|
Children inherit the parent's harness and can spawn their own children.
|
|
292
301
|
|
|
302
|
+
## Interaction Tool
|
|
303
|
+
|
|
304
|
+
Let the agent pause and request structured input from the outside world. Not included in any harness by default.
|
|
305
|
+
|
|
306
|
+
```ts
|
|
307
|
+
import { createInteractionTool, defineHarness, basicTools } from 'zidane'
|
|
308
|
+
|
|
309
|
+
const askUser = createInteractionTool({
|
|
310
|
+
name: 'ask_user',
|
|
311
|
+
schema: {
|
|
312
|
+
type: 'object',
|
|
313
|
+
properties: { question: { type: 'string' } },
|
|
314
|
+
required: ['question'],
|
|
315
|
+
},
|
|
316
|
+
onRequest: async (payload) => {
|
|
317
|
+
const answer = await promptUser(payload.question)
|
|
318
|
+
return { answer }
|
|
319
|
+
},
|
|
320
|
+
})
|
|
321
|
+
|
|
322
|
+
const harness = defineHarness({
|
|
323
|
+
name: 'interactive',
|
|
324
|
+
tools: { ...basicTools, ask_user: askUser },
|
|
325
|
+
})
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
`onRequest` can be async — the agent waits for the response. Return a string or object (objects are JSON-stringified).
|
|
329
|
+
|
|
293
330
|
## Sessions
|
|
294
331
|
|
|
295
332
|
Sessions give an agent persistent turn history and run metadata across calls.
|
|
@@ -333,7 +370,7 @@ if (session) {
|
|
|
333
370
|
|
|
334
371
|
```ts
|
|
335
372
|
agent.hooks.hook('session:start', (ctx) => { /* ctx.sessionId, ctx.runId, ctx.prompt */ })
|
|
336
|
-
agent.hooks.hook('session:end', (ctx) => { /* ctx.sessionId, ctx.runId, ctx.status */ })
|
|
373
|
+
agent.hooks.hook('session:end', (ctx) => { /* ctx.sessionId, ctx.runId, ctx.status, ctx.turnRange */ })
|
|
337
374
|
agent.hooks.hook('session:turns', (ctx) => { /* ctx.sessionId, ctx.count */ })
|
|
338
375
|
```
|
|
339
376
|
|
|
@@ -453,7 +490,7 @@ const agent = createAgent({
|
|
|
453
490
|
|
|
454
491
|
```ts
|
|
455
492
|
agent.isRunning // is a run in progress?
|
|
456
|
-
agent.
|
|
493
|
+
agent.turns // conversation history (SessionTurn[])
|
|
457
494
|
agent.abort() // cancel the current run
|
|
458
495
|
agent.reset() // clear messages and queues
|
|
459
496
|
await agent.destroy() // clean up context + MCP connections
|
|
@@ -484,6 +521,45 @@ Converters for external interop:
|
|
|
484
521
|
import { fromAnthropic, toAnthropic, fromOpenAI, toOpenAI, autoDetectAndConvert } from 'zidane'
|
|
485
522
|
```
|
|
486
523
|
|
|
524
|
+
## Structured Output
|
|
525
|
+
|
|
526
|
+
Force the agent's final response to match a JSON Schema via provider-level tool forcing.
|
|
527
|
+
|
|
528
|
+
```ts
|
|
529
|
+
const stats = await agent.run({
|
|
530
|
+
prompt: 'Extract the entities',
|
|
531
|
+
behavior: {
|
|
532
|
+
schema: {
|
|
533
|
+
type: 'object',
|
|
534
|
+
properties: { name: { type: 'string' }, age: { type: 'number' } },
|
|
535
|
+
required: ['name', 'age'],
|
|
536
|
+
},
|
|
537
|
+
},
|
|
538
|
+
})
|
|
539
|
+
|
|
540
|
+
console.log(stats.output) // { name: 'Alice', age: 30 }
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
The `output` hook fires when structured output is extracted:
|
|
544
|
+
|
|
545
|
+
```ts
|
|
546
|
+
agent.hooks.hook('output', (ctx) => {
|
|
547
|
+
// ctx.output — the parsed JSON matching the schema
|
|
548
|
+
// ctx.schema — the schema that was enforced
|
|
549
|
+
})
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
### Zod v4 integration
|
|
553
|
+
|
|
554
|
+
Use `zodToJsonSchema` to normalize `z.toJsonSchema()` output for tool schemas:
|
|
555
|
+
|
|
556
|
+
```ts
|
|
557
|
+
import { z } from 'zod'
|
|
558
|
+
import { zodToJsonSchema } from 'zidane'
|
|
559
|
+
|
|
560
|
+
const schema = zodToJsonSchema(z.toJsonSchema(z.object({ name: z.string() })))
|
|
561
|
+
```
|
|
562
|
+
|
|
487
563
|
## Usage Tracking
|
|
488
564
|
|
|
489
565
|
```ts
|
|
@@ -492,13 +568,21 @@ stats.turnUsage // TurnUsage[] — per-turn { input, output, cacheCreation?, c
|
|
|
492
568
|
stats.cost // total USD cost (if reported by provider)
|
|
493
569
|
```
|
|
494
570
|
|
|
571
|
+
## Types
|
|
572
|
+
|
|
573
|
+
All types are available from `zidane/types`:
|
|
574
|
+
|
|
575
|
+
```ts
|
|
576
|
+
import type { Agent, SessionTurn, TurnUsage, Provider, ToolDef } from 'zidane/types'
|
|
577
|
+
```
|
|
578
|
+
|
|
495
579
|
## Testing
|
|
496
580
|
|
|
497
581
|
```bash
|
|
498
582
|
bun test
|
|
499
583
|
```
|
|
500
584
|
|
|
501
|
-
|
|
585
|
+
474+ tests with mock provider and execution context. No API keys or Docker needed.
|
|
502
586
|
|
|
503
587
|
## License
|
|
504
588
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Hookable } from 'hookable';
|
|
2
|
-
import { b as ExecutionContext, c as ExecutionHandle, e as SkillsConfig, S as SkillConfig } from './types-
|
|
2
|
+
import { b as ExecutionContext, c as ExecutionHandle, e as SkillsConfig, S as SkillConfig } from './types-CKXAp41h.js';
|
|
3
3
|
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -83,7 +83,8 @@ interface SessionTurn {
|
|
|
83
83
|
}
|
|
84
84
|
interface AgentRunOptions {
|
|
85
85
|
model?: string;
|
|
86
|
-
prompt
|
|
86
|
+
/** User prompt. Optional when resuming a session with existing turns. */
|
|
87
|
+
prompt?: string;
|
|
87
88
|
system?: string;
|
|
88
89
|
thinking?: ThinkingLevel;
|
|
89
90
|
images?: ImageContent[];
|
|
@@ -150,7 +151,7 @@ declare function openrouter(params?: OpenRouterParams): Provider;
|
|
|
150
151
|
interface ToolSpec {
|
|
151
152
|
name: string;
|
|
152
153
|
description: string;
|
|
153
|
-
|
|
154
|
+
inputSchema: Record<string, unknown>;
|
|
154
155
|
}
|
|
155
156
|
interface ToolCall {
|
|
156
157
|
id: string;
|
|
@@ -433,7 +434,7 @@ interface Session {
|
|
|
433
434
|
/** Arbitrary metadata */
|
|
434
435
|
readonly metadata: Record<string, unknown>;
|
|
435
436
|
/** Start tracking a new run */
|
|
436
|
-
startRun: (runId: string, prompt
|
|
437
|
+
startRun: (runId: string, prompt?: string) => void;
|
|
437
438
|
/** Mark a run as completed */
|
|
438
439
|
completeRun: (runId: string, stats: {
|
|
439
440
|
turns: number;
|
|
@@ -507,12 +508,10 @@ interface AgentHooks {
|
|
|
507
508
|
delta: string;
|
|
508
509
|
text: string;
|
|
509
510
|
turnId: string;
|
|
510
|
-
blockIndex: number;
|
|
511
511
|
}) => void;
|
|
512
512
|
'stream:end': (ctx: {
|
|
513
513
|
text: string;
|
|
514
514
|
turnId: string;
|
|
515
|
-
blockIndex: number;
|
|
516
515
|
}) => void;
|
|
517
516
|
'tool:before': (ctx: {
|
|
518
517
|
name: string;
|
|
@@ -229,10 +229,9 @@ async function parseSkillFile(filePath) {
|
|
|
229
229
|
config.allowedTools = frontmatter["allowed-tools"].split(WHITESPACE_SPLIT_RE);
|
|
230
230
|
if (frontmatter.model)
|
|
231
231
|
config.model = frontmatter.model;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
config.thinking = frontmatter.effort;
|
|
232
|
+
const thinkingValue = frontmatter.thinking ?? frontmatter.effort;
|
|
233
|
+
if (thinkingValue)
|
|
234
|
+
config.thinking = thinkingValue;
|
|
236
235
|
if (frontmatter.paths) {
|
|
237
236
|
const raw = frontmatter.paths;
|
|
238
237
|
config.paths = raw.split(COMMA_OR_SPACE_RE).filter(Boolean);
|
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
import {
|
|
2
2
|
connectMcpServers
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NNMWWSBY.js";
|
|
4
4
|
import {
|
|
5
5
|
buildCatalog,
|
|
6
6
|
interpolateShellCommands,
|
|
7
7
|
mergeSkillsConfig,
|
|
8
8
|
resolveSkills
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4C6Y56CC.js";
|
|
10
|
+
|
|
11
|
+
// src/tools/interaction.ts
|
|
12
|
+
function createInteractionTool(options) {
|
|
13
|
+
const name = options.name ?? "interaction";
|
|
14
|
+
const description = options.description ?? "Request structured input from the user or external system.";
|
|
15
|
+
return {
|
|
16
|
+
spec: {
|
|
17
|
+
name,
|
|
18
|
+
description,
|
|
19
|
+
inputSchema: options.schema
|
|
20
|
+
},
|
|
21
|
+
async execute(input) {
|
|
22
|
+
const result = await options.onRequest(input);
|
|
23
|
+
return typeof result === "string" ? result : JSON.stringify(result);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
10
27
|
|
|
11
28
|
// src/tools/list-files.ts
|
|
12
29
|
var listFiles = {
|
|
13
30
|
spec: {
|
|
14
31
|
name: "list_files",
|
|
15
32
|
description: "List files and directories at the given path (relative to project root).",
|
|
16
|
-
|
|
33
|
+
inputSchema: {
|
|
17
34
|
type: "object",
|
|
18
35
|
properties: {
|
|
19
36
|
path: { type: "string", description: 'Relative directory path (default: ".")' }
|
|
@@ -36,7 +53,7 @@ var readFile = {
|
|
|
36
53
|
spec: {
|
|
37
54
|
name: "read_file",
|
|
38
55
|
description: "Read the contents of a file at the given path (relative to project root).",
|
|
39
|
-
|
|
56
|
+
inputSchema: {
|
|
40
57
|
type: "object",
|
|
41
58
|
properties: {
|
|
42
59
|
path: { type: "string", description: "Relative file path" }
|
|
@@ -58,7 +75,7 @@ var shell = {
|
|
|
58
75
|
spec: {
|
|
59
76
|
name: "shell",
|
|
60
77
|
description: "Execute a shell command and return stdout+stderr. Runs in the project root.",
|
|
61
|
-
|
|
78
|
+
inputSchema: {
|
|
62
79
|
type: "object",
|
|
63
80
|
properties: {
|
|
64
81
|
command: { type: "string", description: "The shell command to run" }
|
|
@@ -403,7 +420,6 @@ async function executeTurn(ctx, turn) {
|
|
|
403
420
|
await ctx.hooks.callHook("context:transform", { messages });
|
|
404
421
|
await ctx.hooks.callHook("turn:before", { turn, turnId, options: streamOptions });
|
|
405
422
|
let currentText = "";
|
|
406
|
-
let blockIndex = 0;
|
|
407
423
|
let result;
|
|
408
424
|
try {
|
|
409
425
|
result = await ctx.provider.stream(
|
|
@@ -411,26 +427,26 @@ async function executeTurn(ctx, turn) {
|
|
|
411
427
|
{
|
|
412
428
|
onText(delta) {
|
|
413
429
|
currentText += delta;
|
|
414
|
-
ctx.hooks.callHook("stream:text", { delta, text: currentText, turnId
|
|
430
|
+
ctx.hooks.callHook("stream:text", { delta, text: currentText, turnId });
|
|
415
431
|
}
|
|
416
432
|
}
|
|
417
433
|
);
|
|
418
434
|
} catch (err) {
|
|
435
|
+
const errorUsage = { input: 0, output: 0 };
|
|
419
436
|
const errorTurn = {
|
|
420
437
|
id: turnId,
|
|
421
438
|
runId: ctx.runId,
|
|
422
439
|
role: "assistant",
|
|
423
440
|
content: currentText ? [{ type: "text", text: currentText }] : [],
|
|
424
|
-
usage:
|
|
441
|
+
usage: errorUsage,
|
|
425
442
|
createdAt: Date.now()
|
|
426
443
|
};
|
|
427
444
|
ctx.turns.push(errorTurn);
|
|
428
|
-
await ctx.hooks.callHook("turn:after", { turn, turnId, usage:
|
|
445
|
+
await ctx.hooks.callHook("turn:after", { turn, turnId, usage: errorUsage, message: errorTurn });
|
|
429
446
|
throw err;
|
|
430
447
|
}
|
|
431
448
|
if (currentText) {
|
|
432
|
-
await ctx.hooks.callHook("stream:end", { text: currentText, turnId
|
|
433
|
-
blockIndex++;
|
|
449
|
+
await ctx.hooks.callHook("stream:end", { text: currentText, turnId });
|
|
434
450
|
}
|
|
435
451
|
const assistantTurn = {
|
|
436
452
|
id: turnId,
|
|
@@ -447,7 +463,7 @@ async function executeTurn(ctx, turn) {
|
|
|
447
463
|
const outputSpec = {
|
|
448
464
|
name: "__output__",
|
|
449
465
|
description: "Return the final structured output matching the required schema.",
|
|
450
|
-
|
|
466
|
+
inputSchema: ctx.schema
|
|
451
467
|
};
|
|
452
468
|
const schemaResult = await ctx.provider.stream(
|
|
453
469
|
{
|
|
@@ -503,16 +519,16 @@ async function executeSingleTool(ctx, call) {
|
|
|
503
519
|
const gateCtx = { name: call.name, input: call.input, block: false, reason: "Tool execution was blocked" };
|
|
504
520
|
await ctx.hooks.callHook("tool:gate", gateCtx);
|
|
505
521
|
if (gateCtx.block) {
|
|
506
|
-
return { result: { id: call.id, content: `Blocked: ${gateCtx.reason}` }
|
|
522
|
+
return { result: { id: call.id, content: `Blocked: ${gateCtx.reason}` } };
|
|
507
523
|
}
|
|
508
524
|
if (!toolDef) {
|
|
509
525
|
const err = new Error(`Unknown tool: ${call.name}`);
|
|
510
526
|
await ctx.hooks.callHook("tool:error", { name: call.name, input: call.input, error: err });
|
|
511
|
-
return { result: { id: call.id, content: `Tool error: ${err.message}` }
|
|
527
|
+
return { result: { id: call.id, content: `Tool error: ${err.message}` } };
|
|
512
528
|
}
|
|
513
|
-
const validation = validateToolArgs(call.input, toolDef.spec.
|
|
529
|
+
const validation = validateToolArgs(call.input, toolDef.spec.inputSchema);
|
|
514
530
|
if (!validation.valid) {
|
|
515
|
-
return { result: { id: call.id, content: `Validation error: ${validation.error}` }
|
|
531
|
+
return { result: { id: call.id, content: `Validation error: ${validation.error}` } };
|
|
516
532
|
}
|
|
517
533
|
await ctx.hooks.callHook("tool:before", { name: call.name, input: call.input });
|
|
518
534
|
let output;
|
|
@@ -537,7 +553,7 @@ async function executeSingleTool(ctx, call) {
|
|
|
537
553
|
output = transformCtx.result;
|
|
538
554
|
isError = transformCtx.isError;
|
|
539
555
|
await ctx.hooks.callHook("tool:after", { name: call.name, input: call.input, result: output });
|
|
540
|
-
return { result: { id: call.id, content: output }
|
|
556
|
+
return { result: { id: call.id, content: output } };
|
|
541
557
|
}
|
|
542
558
|
async function executeToolsSequential(ctx, toolCalls) {
|
|
543
559
|
const results = [];
|
|
@@ -583,7 +599,7 @@ async function executeToolsParallel(ctx, toolCalls) {
|
|
|
583
599
|
var noTools = { name: "none", system: "You are a helpful assistant.", tools: {} };
|
|
584
600
|
function resolveBehavior(harnessBehavior, agentBehavior, runBehavior) {
|
|
585
601
|
return {
|
|
586
|
-
toolExecution: runBehavior?.toolExecution ?? agentBehavior?.toolExecution ?? harnessBehavior?.toolExecution ?? "
|
|
602
|
+
toolExecution: runBehavior?.toolExecution ?? agentBehavior?.toolExecution ?? harnessBehavior?.toolExecution ?? "parallel",
|
|
587
603
|
maxTurns: runBehavior?.maxTurns ?? agentBehavior?.maxTurns ?? harnessBehavior?.maxTurns,
|
|
588
604
|
maxTokens: runBehavior?.maxTokens ?? agentBehavior?.maxTokens ?? harnessBehavior?.maxTokens,
|
|
589
605
|
thinkingBudget: runBehavior?.thinkingBudget ?? agentBehavior?.thinkingBudget ?? harnessBehavior?.thinkingBudget,
|
|
@@ -614,13 +630,23 @@ function createAgent({ harness: harnessOption, provider, behavior: agentBehavior
|
|
|
614
630
|
if (running) {
|
|
615
631
|
throw new Error("Agent is already running. Use steer() or followUp() to queue messages, or waitForIdle().");
|
|
616
632
|
}
|
|
633
|
+
const hasSessionTurns = session && session.turns.length > 0;
|
|
634
|
+
if (!options.prompt && !hasSessionTurns) {
|
|
635
|
+
throw new Error("prompt is required when no session with existing turns is provided");
|
|
636
|
+
}
|
|
637
|
+
if (!options.prompt && hasSessionTurns) {
|
|
638
|
+
const lastTurn = session.turns.at(-1);
|
|
639
|
+
if (lastTurn && lastTurn.role !== "user") {
|
|
640
|
+
throw new Error("cannot resume without prompt: last session turn must be a user message");
|
|
641
|
+
}
|
|
642
|
+
}
|
|
617
643
|
running = true;
|
|
618
644
|
abortController = new AbortController();
|
|
619
645
|
const runId = `run_${++runCounter}`;
|
|
620
646
|
session?.startRun(runId, options.prompt);
|
|
621
647
|
if (session) {
|
|
622
648
|
await session.updateStatus("running");
|
|
623
|
-
await hooks.callHook("session:start", { sessionId: session.id, runId, prompt: options.prompt });
|
|
649
|
+
await hooks.callHook("session:start", { sessionId: session.id, runId, prompt: options.prompt ?? "" });
|
|
624
650
|
}
|
|
625
651
|
if (options.signal) {
|
|
626
652
|
if (options.signal.aborted) {
|
|
@@ -698,12 +724,12 @@ ${skillsCatalog}`;
|
|
|
698
724
|
(t) => ({
|
|
699
725
|
name: t.spec.name,
|
|
700
726
|
description: t.spec.description || "",
|
|
701
|
-
|
|
727
|
+
inputSchema: t.spec.inputSchema
|
|
702
728
|
})
|
|
703
729
|
);
|
|
704
730
|
const formattedTools = toolSpecs.length > 0 ? provider.formatTools(toolSpecs) : [];
|
|
705
731
|
const turns = [];
|
|
706
|
-
const isResume = session && session.turns.length > 0 && session.runs.length > 0;
|
|
732
|
+
const isResume = session && session.turns.length > 0 && (session.runs.length > 0 || !options.prompt);
|
|
707
733
|
if (isResume) {
|
|
708
734
|
turns.push(...session.turns);
|
|
709
735
|
}
|
|
@@ -727,14 +753,16 @@ ${skillsCatalog}`;
|
|
|
727
753
|
createdAt: Date.now()
|
|
728
754
|
});
|
|
729
755
|
}
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
756
|
+
if (options.prompt) {
|
|
757
|
+
const promptMsg = provider.userMessage(options.prompt, options.images);
|
|
758
|
+
turns.push({
|
|
759
|
+
id: crypto.randomUUID(),
|
|
760
|
+
runId,
|
|
761
|
+
role: promptMsg.role,
|
|
762
|
+
content: promptMsg.content,
|
|
763
|
+
createdAt: Date.now()
|
|
764
|
+
});
|
|
765
|
+
}
|
|
738
766
|
conversationTurns = turns;
|
|
739
767
|
let lastPersistedTurnCount = isResume ? session.turns.length : 0;
|
|
740
768
|
const unregisterSessionSync = session ? hooks.hook("turn:after", async () => {
|
|
@@ -945,7 +973,7 @@ function createSpawnTool(options = {}) {
|
|
|
945
973
|
spec: {
|
|
946
974
|
name: "spawn",
|
|
947
975
|
description: "Spawn a sub-agent to work on a specific task. The sub-agent runs independently with its own tool access and returns its final response. Use this to delegate work, parallelize tasks, or isolate concerns.",
|
|
948
|
-
|
|
976
|
+
inputSchema: {
|
|
949
977
|
type: "object",
|
|
950
978
|
properties: {
|
|
951
979
|
task: {
|
|
@@ -1020,7 +1048,7 @@ var writeFile2 = {
|
|
|
1020
1048
|
spec: {
|
|
1021
1049
|
name: "write_file",
|
|
1022
1050
|
description: "Write content to a file. Creates parent directories if needed.",
|
|
1023
|
-
|
|
1051
|
+
inputSchema: {
|
|
1024
1052
|
type: "object",
|
|
1025
1053
|
properties: {
|
|
1026
1054
|
path: { type: "string", description: "Relative file path" },
|
|
@@ -1041,6 +1069,7 @@ export {
|
|
|
1041
1069
|
createSandboxContext,
|
|
1042
1070
|
validateToolArgs,
|
|
1043
1071
|
createAgent,
|
|
1072
|
+
createInteractionTool,
|
|
1044
1073
|
listFiles,
|
|
1045
1074
|
readFile,
|
|
1046
1075
|
shell,
|
|
@@ -51,7 +51,7 @@ async function connectMcpServers(configs, _clientFactory, hooks) {
|
|
|
51
51
|
spec: {
|
|
52
52
|
name: namespacedName,
|
|
53
53
|
description: tool.description || "",
|
|
54
|
-
|
|
54
|
+
inputSchema: tool.inputSchema ?? { type: "object", properties: {} }
|
|
55
55
|
},
|
|
56
56
|
execute: async (input, _ctx) => {
|
|
57
57
|
await hooks?.callHook("mcp:tool:before", { server: config.name, tool: tool.name, input });
|
|
@@ -124,7 +124,7 @@ function toOAIMessages(system, messages) {
|
|
|
124
124
|
function formatTools(tools) {
|
|
125
125
|
return tools.map((t) => ({
|
|
126
126
|
type: "function",
|
|
127
|
-
function: { name: t.name, description: t.description, parameters: t.
|
|
127
|
+
function: { name: t.name, description: t.description, parameters: t.inputSchema }
|
|
128
128
|
}));
|
|
129
129
|
}
|
|
130
130
|
function userMessage(content, images) {
|
package/dist/harnesses.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'hookable';
|
|
2
|
-
export { H as Harness, i as HarnessConfig, u as ToolContext, v as ToolDef, x as ToolMap, a1 as basic, a2 as basicTools, Q as defineHarness, X as noTools } from './agent-
|
|
3
|
-
import './types-
|
|
2
|
+
export { H as Harness, i as HarnessConfig, u as ToolContext, v as ToolDef, x as ToolMap, a1 as basic, a2 as basicTools, Q as defineHarness, X as noTools } from './agent-CPOBJlcn.js';
|
|
3
|
+
import './types-CKXAp41h.js';
|
|
4
4
|
import '@modelcontextprotocol/sdk/client/index.js';
|
package/dist/harnesses.js
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
basic_default,
|
|
4
4
|
defineHarness,
|
|
5
5
|
noTools
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-BDBQ5MIB.js";
|
|
7
|
+
import "./chunk-KWNFSVVE.js";
|
|
8
|
+
import "./chunk-NNMWWSBY.js";
|
|
9
|
+
import "./chunk-4C6Y56CC.js";
|
|
10
10
|
export {
|
|
11
11
|
basic_default as basic,
|
|
12
12
|
basicTools,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { A as Agent, a as AgentBehavior, b as AgentHooks, c as AgentOptions, d as AgentRunOptions, e as AgentStats, h as CreateSessionOptions, H as Harness, i as HarnessConfig, I as ImageContent, M as McpConnection, j as McpServerConfig, R as RemoteStoreOptions, S as Session, k as SessionContentBlock, l as SessionData, m as SessionMessage, n as SessionRun, o as SessionStore, p as SessionTurn, q as SqliteStoreOptions, T as ThinkingLevel, u as ToolContext, v as ToolDef, w as ToolExecutionMode, x as ToolMap, D as TurnUsage, E as autoDetectAndConvert, F as connectMcpServers, G as createAgent, J as createMemoryStore, K as createRemoteStore, L as createSession, N as createSqliteStore, Q as defineHarness, U as fromAnthropic, V as fromOpenAI, W as loadSession, X as noTools, Y as toAnthropic, Z as toOpenAI } from './agent-
|
|
2
|
-
import { f as SpawnConfig, b as ExecutionContext } from './types-
|
|
3
|
-
export { C as ContextCapabilities, a as ContextType, E as ExecResult, c as ExecutionHandle, S as SkillConfig, d as SkillResource, e as SkillsConfig } from './types-
|
|
4
|
-
export { S as SandboxProvider, c as createSandboxContext } from './sandbox-
|
|
1
|
+
export { A as Agent, a as AgentBehavior, b as AgentHooks, c as AgentOptions, d as AgentRunOptions, e as AgentStats, h as CreateSessionOptions, H as Harness, i as HarnessConfig, I as ImageContent, M as McpConnection, j as McpServerConfig, R as RemoteStoreOptions, S as Session, k as SessionContentBlock, l as SessionData, m as SessionMessage, n as SessionRun, o as SessionStore, p as SessionTurn, q as SqliteStoreOptions, T as ThinkingLevel, u as ToolContext, v as ToolDef, w as ToolExecutionMode, x as ToolMap, D as TurnUsage, E as autoDetectAndConvert, F as connectMcpServers, G as createAgent, J as createMemoryStore, K as createRemoteStore, L as createSession, N as createSqliteStore, Q as defineHarness, U as fromAnthropic, V as fromOpenAI, W as loadSession, X as noTools, Y as toAnthropic, Z as toOpenAI } from './agent-CPOBJlcn.js';
|
|
2
|
+
import { f as SpawnConfig, b as ExecutionContext } from './types-CKXAp41h.js';
|
|
3
|
+
export { C as ContextCapabilities, a as ContextType, E as ExecResult, c as ExecutionHandle, S as SkillConfig, d as SkillResource, e as SkillsConfig } from './types-CKXAp41h.js';
|
|
4
|
+
export { S as SandboxProvider, c as createSandboxContext } from './sandbox-DZn3ybp_.js';
|
|
5
5
|
export { buildCatalog, defineSkill, discoverSkills, interpolateShellCommands, mergeSkillsConfig, parseSkillFile, resolveSkills, validateSkillName, writeSkillToDisk, writeSkillsToDisk } from './skills.js';
|
|
6
|
-
export { C as ChildAgent, S as SpawnToolOptions, a as SpawnToolState, c as createSpawnTool, s as spawn } from './spawn-
|
|
6
|
+
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, c as createInteractionTool, b as createSpawnTool, s as spawn } from './spawn-CK08YMPC.js';
|
|
7
7
|
import 'hookable';
|
|
8
8
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
9
9
|
|
|
@@ -30,7 +30,7 @@ declare function createProcessContext(config?: SpawnConfig): ExecutionContext;
|
|
|
30
30
|
/**
|
|
31
31
|
* Zod v4 integration helper.
|
|
32
32
|
*
|
|
33
|
-
* Normalizes the output of z.toJsonSchema() for use as ToolSpec.
|
|
33
|
+
* Normalizes the output of z.toJsonSchema() for use as ToolSpec.inputSchema.
|
|
34
34
|
* Zod is an optional peer dependency — consumers call z.toJsonSchema() themselves.
|
|
35
35
|
*
|
|
36
36
|
* Usage:
|
|
@@ -40,7 +40,7 @@ declare function createProcessContext(config?: SpawnConfig): ExecutionContext;
|
|
|
40
40
|
*/
|
|
41
41
|
/**
|
|
42
42
|
* Normalize a JSON Schema (e.g. from zod v4's z.toJsonSchema()) for use
|
|
43
|
-
* as a ToolSpec.
|
|
43
|
+
* as a ToolSpec.inputSchema.
|
|
44
44
|
*
|
|
45
45
|
* Strips the $schema key that some providers reject.
|
|
46
46
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineHarness,
|
|
3
3
|
noTools
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BDBQ5MIB.js";
|
|
5
5
|
import {
|
|
6
6
|
createAgent,
|
|
7
7
|
createDockerContext,
|
|
8
|
+
createInteractionTool,
|
|
8
9
|
createProcessContext,
|
|
9
10
|
createSandboxContext,
|
|
10
11
|
createSpawnTool,
|
|
11
12
|
spawn
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KWNFSVVE.js";
|
|
13
14
|
import {
|
|
14
15
|
connectMcpServers
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-NNMWWSBY.js";
|
|
16
17
|
import {
|
|
17
18
|
createMemoryStore,
|
|
18
19
|
createRemoteStore,
|
|
19
20
|
createSession,
|
|
20
21
|
createSqliteStore,
|
|
21
22
|
loadSession
|
|
22
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-V4PBD7LE.js";
|
|
23
24
|
import {
|
|
24
25
|
autoDetectAndConvert,
|
|
25
26
|
fromAnthropic,
|
|
26
27
|
fromOpenAI,
|
|
27
28
|
toAnthropic,
|
|
28
29
|
toOpenAI
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-UHCWNQGG.js";
|
|
30
31
|
import {
|
|
31
32
|
defineSkill
|
|
32
33
|
} from "./chunk-CFLC2I7D.js";
|
|
@@ -40,7 +41,7 @@ import {
|
|
|
40
41
|
validateSkillName,
|
|
41
42
|
writeSkillToDisk,
|
|
42
43
|
writeSkillsToDisk
|
|
43
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-4C6Y56CC.js";
|
|
44
45
|
|
|
45
46
|
// src/zod.ts
|
|
46
47
|
function zodToJsonSchema(jsonSchema) {
|
|
@@ -53,6 +54,7 @@ export {
|
|
|
53
54
|
connectMcpServers,
|
|
54
55
|
createAgent,
|
|
55
56
|
createDockerContext,
|
|
57
|
+
createInteractionTool,
|
|
56
58
|
createMemoryStore,
|
|
57
59
|
createProcessContext,
|
|
58
60
|
createRemoteStore,
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'hookable';
|
|
2
|
-
export { M as McpConnection, j as McpServerConfig, F as connectMcpServers, a3 as resultToString } from './agent-
|
|
2
|
+
export { M as McpConnection, j as McpServerConfig, F as connectMcpServers, a3 as resultToString } from './agent-CPOBJlcn.js';
|
|
3
3
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
4
|
-
import './types-
|
|
4
|
+
import './types-CKXAp41h.js';
|
package/dist/mcp.js
CHANGED
package/dist/providers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { f as AnthropicParams, C as CerebrasParams, O as OpenRouterParams, P as Provider, r as StreamCallbacks, s as StreamOptions, t as ToolCall, y as ToolResult, z as ToolSpec, B as TurnResult, _ as anthropic, $ as cerebras, a0 as openrouter } from './agent-
|
|
1
|
+
export { f as AnthropicParams, C as CerebrasParams, O as OpenRouterParams, P as Provider, r as StreamCallbacks, s as StreamOptions, t as ToolCall, y as ToolResult, z as ToolSpec, B as TurnResult, _ as anthropic, $ as cerebras, a0 as openrouter } from './agent-CPOBJlcn.js';
|
|
2
2
|
import 'hookable';
|
|
3
|
-
import './types-
|
|
3
|
+
import './types-CKXAp41h.js';
|
|
4
4
|
import '@modelcontextprotocol/sdk/client/index.js';
|
package/dist/providers.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
toOAIMessages,
|
|
9
9
|
toolResultsMessage,
|
|
10
10
|
userMessage
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UHCWNQGG.js";
|
|
12
12
|
|
|
13
13
|
// src/providers/anthropic.ts
|
|
14
14
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -59,7 +59,7 @@ function anthropic(anthropicParams) {
|
|
|
59
59
|
return tools.map((t) => ({
|
|
60
60
|
name: t.name,
|
|
61
61
|
description: t.description,
|
|
62
|
-
input_schema: t.
|
|
62
|
+
input_schema: t.inputSchema
|
|
63
63
|
}));
|
|
64
64
|
},
|
|
65
65
|
userMessage(content, images) {
|
package/dist/session.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { h as CreateSessionOptions, R as RemoteStoreOptions, S as Session, k as SessionContentBlock, l as SessionData, m as SessionMessage, n as SessionRun, o as SessionStore, p as SessionTurn, q as SqliteStoreOptions, E as autoDetectAndConvert, J as createMemoryStore, K as createRemoteStore, L as createSession, N as createSqliteStore, U as fromAnthropic, V as fromOpenAI, W as loadSession, Y as toAnthropic, Z as toOpenAI } from './agent-
|
|
1
|
+
export { h as CreateSessionOptions, R as RemoteStoreOptions, S as Session, k as SessionContentBlock, l as SessionData, m as SessionMessage, n as SessionRun, o as SessionStore, p as SessionTurn, q as SqliteStoreOptions, E as autoDetectAndConvert, J as createMemoryStore, K as createRemoteStore, L as createSession, N as createSqliteStore, U as fromAnthropic, V as fromOpenAI, W as loadSession, Y as toAnthropic, Z as toOpenAI } from './agent-CPOBJlcn.js';
|
|
2
2
|
import 'hookable';
|
|
3
|
-
import './types-
|
|
3
|
+
import './types-CKXAp41h.js';
|
|
4
4
|
import '@modelcontextprotocol/sdk/client/index.js';
|
package/dist/session.js
CHANGED
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
createSession,
|
|
5
5
|
createSqliteStore,
|
|
6
6
|
loadSession
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-V4PBD7LE.js";
|
|
8
8
|
import {
|
|
9
9
|
autoDetectAndConvert,
|
|
10
10
|
fromAnthropic,
|
|
11
11
|
fromOpenAI,
|
|
12
12
|
toAnthropic,
|
|
13
13
|
toOpenAI
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UHCWNQGG.js";
|
|
15
15
|
export {
|
|
16
16
|
autoDetectAndConvert,
|
|
17
17
|
createMemoryStore,
|
package/dist/skills.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SkillConfig, b as ExecutionContext, c as ExecutionHandle, e as SkillsConfig } from './types-
|
|
2
|
-
export { d as SkillResource } from './types-
|
|
1
|
+
import { S as SkillConfig, b as ExecutionContext, c as ExecutionHandle, e as SkillsConfig } from './types-CKXAp41h.js';
|
|
2
|
+
export { d as SkillResource } from './types-CKXAp41h.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Skill catalog generation.
|
package/dist/skills.js
CHANGED
|
@@ -1,4 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { v as ToolDef, i as HarnessConfig, e as AgentStats } from './agent-CPOBJlcn.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, returns data for the model. */
|
|
29
|
+
onRequest: (payload: Record<string, unknown>) => 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;
|
|
2
39
|
|
|
3
40
|
/**
|
|
4
41
|
* Spawn tool — create sub-agents from a parent agent.
|
|
@@ -59,4 +96,4 @@ declare function createSpawnTool(options?: SpawnToolOptions): ToolDef & SpawnToo
|
|
|
59
96
|
*/
|
|
60
97
|
declare const spawn: ToolDef & SpawnToolState;
|
|
61
98
|
|
|
62
|
-
export { type ChildAgent as C, type SpawnToolOptions as S, type SpawnToolState as a, createSpawnTool as c, spawn as s };
|
|
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 };
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { V as ValidationResult, v as validateToolArgs } from './validation-
|
|
1
|
+
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, c as createInteractionTool, b as createSpawnTool, s as spawn } from './spawn-CK08YMPC.js';
|
|
2
|
+
import { v as ToolDef } from './agent-CPOBJlcn.js';
|
|
3
|
+
export { V as ValidationResult, v as validateToolArgs } from './validation-DOY_k7lW.js';
|
|
4
4
|
import 'hookable';
|
|
5
|
-
import './types-
|
|
5
|
+
import './types-CKXAp41h.js';
|
|
6
6
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
7
7
|
|
|
8
8
|
declare const listFiles: ToolDef;
|
package/dist/tools.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
createInteractionTool,
|
|
2
3
|
createSpawnTool,
|
|
3
4
|
listFiles,
|
|
4
5
|
readFile,
|
|
@@ -6,10 +7,11 @@ import {
|
|
|
6
7
|
spawn,
|
|
7
8
|
validateToolArgs,
|
|
8
9
|
writeFile
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-KWNFSVVE.js";
|
|
11
|
+
import "./chunk-NNMWWSBY.js";
|
|
12
|
+
import "./chunk-4C6Y56CC.js";
|
|
12
13
|
export {
|
|
14
|
+
createInteractionTool,
|
|
13
15
|
createSpawnTool,
|
|
14
16
|
listFiles,
|
|
15
17
|
readFile,
|
|
@@ -113,8 +113,8 @@ interface SkillConfig {
|
|
|
113
113
|
thinking?: 'off' | 'minimal' | 'low' | 'medium' | 'high';
|
|
114
114
|
/**
|
|
115
115
|
* Glob patterns that limit when this skill auto-activates.
|
|
116
|
-
*
|
|
117
|
-
*
|
|
116
|
+
* Parsed and stored per the Agent Skills spec, but not yet
|
|
117
|
+
* enforced at runtime — all skills are included in the catalog.
|
|
118
118
|
*/
|
|
119
119
|
paths?: string[];
|
|
120
120
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { A as Agent, a as AgentBehavior, b as AgentHooks, c as AgentOptions, d as AgentRunOptions, e as AgentStats, f as AnthropicParams, C as CerebrasParams, g as ChildRunStats, h as CreateSessionOptions, H as Harness, i as HarnessConfig, I as ImageContent, M as McpConnection, j as McpServerConfig, O as OpenRouterParams, P as Provider, R as RemoteStoreOptions, S as Session, k as SessionContentBlock, l as SessionData, m as SessionMessage, n as SessionRun, o as SessionStore, p as SessionTurn, q as SqliteStoreOptions, r as StreamCallbacks, s as StreamOptions, T as ThinkingLevel, t as ToolCall, u as ToolContext, v as ToolDef, w as ToolExecutionMode, x as ToolMap, y as ToolResult, z as ToolSpec, B as TurnResult, D as TurnUsage } from './agent-
|
|
2
|
-
export { C as ContextCapabilities, a as ContextType, E as ExecResult, b as ExecutionContext, c as ExecutionHandle, S as SkillConfig, d as SkillResource, e as SkillsConfig, f as SpawnConfig } from './types-
|
|
3
|
-
export { S as SandboxProvider } from './sandbox-
|
|
4
|
-
export { C as ChildAgent, S as SpawnToolOptions, a as SpawnToolState } from './spawn-
|
|
5
|
-
export { V as ValidationResult } from './validation-
|
|
1
|
+
export { A as Agent, a as AgentBehavior, b as AgentHooks, c as AgentOptions, d as AgentRunOptions, e as AgentStats, f as AnthropicParams, C as CerebrasParams, g as ChildRunStats, h as CreateSessionOptions, H as Harness, i as HarnessConfig, I as ImageContent, M as McpConnection, j as McpServerConfig, O as OpenRouterParams, P as Provider, R as RemoteStoreOptions, S as Session, k as SessionContentBlock, l as SessionData, m as SessionMessage, n as SessionRun, o as SessionStore, p as SessionTurn, q as SqliteStoreOptions, r as StreamCallbacks, s as StreamOptions, T as ThinkingLevel, t as ToolCall, u as ToolContext, v as ToolDef, w as ToolExecutionMode, x as ToolMap, y as ToolResult, z as ToolSpec, B as TurnResult, D as TurnUsage } from './agent-CPOBJlcn.js';
|
|
2
|
+
export { C as ContextCapabilities, a as ContextType, E as ExecResult, b as ExecutionContext, c as ExecutionHandle, S as SkillConfig, d as SkillResource, e as SkillsConfig, f as SpawnConfig } from './types-CKXAp41h.js';
|
|
3
|
+
export { S as SandboxProvider } from './sandbox-DZn3ybp_.js';
|
|
4
|
+
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState } from './spawn-CK08YMPC.js';
|
|
5
|
+
export { V as ValidationResult } from './validation-DOY_k7lW.js';
|
|
6
6
|
import 'hookable';
|
|
7
7
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Simple tool argument validation against JSON Schema-style
|
|
2
|
+
* Simple tool argument validation against JSON Schema-style inputSchema.
|
|
3
3
|
* Checks required fields are present; type coercion is left to the tools themselves.
|
|
4
4
|
*/
|
|
5
5
|
interface ValidationResult {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zidane",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.4",
|
|
4
4
|
"description": "an agent that goes straight to the goal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -59,7 +59,8 @@
|
|
|
59
59
|
"lint": "eslint .",
|
|
60
60
|
"lint:fix": "eslint . --fix",
|
|
61
61
|
"test": "bun test",
|
|
62
|
-
"release": "bumpp"
|
|
62
|
+
"release": "bumpp",
|
|
63
|
+
"typecheck": "tsc --noEmit"
|
|
63
64
|
},
|
|
64
65
|
"dependencies": {
|
|
65
66
|
"@anthropic-ai/sdk": "^0.80.0",
|
|
@@ -84,6 +85,7 @@
|
|
|
84
85
|
"bumpp": "^11.0.1",
|
|
85
86
|
"eslint": "^10.0.3",
|
|
86
87
|
"jiti": "^2.6.1",
|
|
87
|
-
"tsup": "^8.5.1"
|
|
88
|
+
"tsup": "^8.5.1",
|
|
89
|
+
"typescript": "~5.9.3"
|
|
88
90
|
}
|
|
89
91
|
}
|