zidane 1.6.14 → 1.6.16
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-CUKZMA-_.d.ts → agent-CtGvwTdo.d.ts} +2 -0
- package/dist/{chunk-474ILKQA.js → chunk-FKG35KT3.js} +10 -19
- package/dist/{chunk-7SMBCRUX.js → chunk-MUX6RBUV.js} +1 -1
- package/dist/{chunk-5LOHDFK3.js → chunk-WDBO3JCO.js} +9 -1
- package/dist/harnesses.d.ts +1 -1
- package/dist/harnesses.js +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +1 -1
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +6 -4
- package/dist/session.d.ts +1 -1
- package/dist/{spawn-B7AtyfuG.d.ts → spawn-xwRhPoH7.d.ts} +1 -1
- package/dist/tools.d.ts +2 -2
- package/dist/tools.js +2 -2
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
|
@@ -23,6 +23,8 @@ interface McpServerConfig {
|
|
|
23
23
|
url?: string;
|
|
24
24
|
/** Optional headers for HTTP transports */
|
|
25
25
|
headers?: Record<string, string>;
|
|
26
|
+
/** Timeout in milliseconds for MCP tool calls (default: 30000) */
|
|
27
|
+
toolTimeout?: number;
|
|
26
28
|
}
|
|
27
29
|
type ToolExecutionMode = 'sequential' | 'parallel';
|
|
28
30
|
interface AgentBehavior {
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-SZA4FKW5.js";
|
|
10
10
|
import {
|
|
11
11
|
connectMcpServers
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WDBO3JCO.js";
|
|
13
13
|
|
|
14
14
|
// src/tools/interaction.ts
|
|
15
15
|
function createInteractionTool(options) {
|
|
@@ -362,8 +362,15 @@ async function executeToolsSequential(ctx, toolCalls, turnId) {
|
|
|
362
362
|
}
|
|
363
363
|
async function executeToolsParallel(ctx, toolCalls, turnId) {
|
|
364
364
|
const executions = toolCalls.map((call) => executeSingleTool(ctx, call, turnId));
|
|
365
|
-
const settled = await Promise.
|
|
366
|
-
return settled.map((s) =>
|
|
365
|
+
const settled = await Promise.allSettled(executions);
|
|
366
|
+
return settled.map((s, i) => {
|
|
367
|
+
if (s.status === "fulfilled")
|
|
368
|
+
return s.value.result;
|
|
369
|
+
return {
|
|
370
|
+
id: toolCalls[i].id,
|
|
371
|
+
content: `Error: ${s.reason instanceof Error ? s.reason.message : String(s.reason)}`
|
|
372
|
+
};
|
|
373
|
+
});
|
|
367
374
|
}
|
|
368
375
|
|
|
369
376
|
// src/agent.ts
|
|
@@ -507,22 +514,6 @@ ${skillsCatalog}`;
|
|
|
507
514
|
const runTurnStart = turns.length;
|
|
508
515
|
if (options.system) {
|
|
509
516
|
await hooks.callHook("system:before", { system: options.system });
|
|
510
|
-
const systemUserMsg = provider.userMessage(options.system);
|
|
511
|
-
turns.push({
|
|
512
|
-
id: crypto.randomUUID(),
|
|
513
|
-
runId,
|
|
514
|
-
role: systemUserMsg.role,
|
|
515
|
-
content: systemUserMsg.content,
|
|
516
|
-
createdAt: Date.now()
|
|
517
|
-
});
|
|
518
|
-
const systemAckMsg = provider.assistantMessage("Understood. I will proceed with these instructions above the rest of my system prompt.");
|
|
519
|
-
turns.push({
|
|
520
|
-
id: crypto.randomUUID(),
|
|
521
|
-
runId,
|
|
522
|
-
role: systemAckMsg.role,
|
|
523
|
-
content: systemAckMsg.content,
|
|
524
|
-
createdAt: Date.now()
|
|
525
|
-
});
|
|
526
517
|
}
|
|
527
518
|
if (options.prompt) {
|
|
528
519
|
const promptMsg = provider.userMessage(options.prompt, options.images);
|
|
@@ -60,8 +60,15 @@ async function connectMcpServers(configs, _clientFactory, hooks) {
|
|
|
60
60
|
if (gateCtx.block)
|
|
61
61
|
return `Blocked: ${gateCtx.reason}`;
|
|
62
62
|
await hooks?.callHook("mcp:tool:before", { turnId, callId, server: config.name, tool: tool.name, input });
|
|
63
|
+
const timeout = config.toolTimeout ?? 3e4;
|
|
63
64
|
try {
|
|
64
|
-
|
|
65
|
+
let timer;
|
|
66
|
+
const result = await Promise.race([
|
|
67
|
+
client.callTool({ name: tool.name, arguments: input }),
|
|
68
|
+
new Promise((_, reject) => {
|
|
69
|
+
timer = setTimeout(() => reject(new Error(`MCP tool "${tool.name}" on server "${config.name}" timed out after ${timeout}ms`)), timeout);
|
|
70
|
+
})
|
|
71
|
+
]).finally(() => clearTimeout(timer));
|
|
65
72
|
let output = resultToString(result.content);
|
|
66
73
|
const transformCtx = { turnId, callId, server: config.name, tool: tool.name, input, result: output };
|
|
67
74
|
await hooks?.callHook("mcp:tool:transform", transformCtx);
|
|
@@ -70,6 +77,7 @@ async function connectMcpServers(configs, _clientFactory, hooks) {
|
|
|
70
77
|
return output;
|
|
71
78
|
} catch (err) {
|
|
72
79
|
await hooks?.callHook("mcp:tool:error", { turnId, callId, server: config.name, tool: tool.name, input, error: err });
|
|
80
|
+
await hooks?.callHook("mcp:tool:after", { turnId, callId, server: config.name, tool: tool.name, input, result: err.message ?? String(err) });
|
|
73
81
|
throw err;
|
|
74
82
|
}
|
|
75
83
|
}
|
package/dist/harnesses.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'hookable';
|
|
2
|
-
export { H as Harness, i as HarnessConfig, z as ToolContext, B as ToolDef, F as ToolMap, a7 as basic, a8 as basicTools, Z as defineHarness, a1 as noTools } from './agent-
|
|
2
|
+
export { H as Harness, i as HarnessConfig, z as ToolContext, B as ToolDef, F as ToolMap, a7 as basic, a8 as basicTools, Z as defineHarness, a1 as noTools } from './agent-CtGvwTdo.js';
|
|
3
3
|
import './types-BpvTmawk.js';
|
|
4
4
|
import './types-CDI8Kmve.js';
|
|
5
5
|
import '@modelcontextprotocol/sdk/client/index.js';
|
package/dist/harnesses.js
CHANGED
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
basic_default,
|
|
4
4
|
defineHarness,
|
|
5
5
|
noTools
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-MUX6RBUV.js";
|
|
7
|
+
import "./chunk-FKG35KT3.js";
|
|
8
8
|
import "./chunk-4C6Y56CC.js";
|
|
9
9
|
import "./chunk-SZA4FKW5.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-WDBO3JCO.js";
|
|
11
11
|
export {
|
|
12
12
|
basic_default as basic,
|
|
13
13
|
basicTools,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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, k as McpToolHookContext, R as RemoteStoreOptions, S as Session, l as SessionContentBlock, m as SessionData, n as SessionEndStatus, o as SessionHookContext, p as SessionMessage, q as SessionRun, r as SessionStore, s as SessionTurn, t as SpawnHookContext, u as SqliteStoreOptions, w as StreamHookContext, T as ThinkingLevel, z as ToolContext, B as ToolDef, D as ToolExecutionMode, E as ToolHookContext, F as ToolMap, L as TurnUsage, N as autoDetectAndConvert, Q as connectMcpServers, U as createAgent, V as createMemoryStore, W as createRemoteStore, X as createSession, Y as createSqliteStore, Z as defineHarness, _ as fromAnthropic, $ as fromOpenAI, a0 as loadSession, a1 as noTools, a2 as toAnthropic, a3 as toOpenAI } from './agent-
|
|
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, k as McpToolHookContext, R as RemoteStoreOptions, S as Session, l as SessionContentBlock, m as SessionData, n as SessionEndStatus, o as SessionHookContext, p as SessionMessage, q as SessionRun, r as SessionStore, s as SessionTurn, t as SpawnHookContext, u as SqliteStoreOptions, w as StreamHookContext, T as ThinkingLevel, z as ToolContext, B as ToolDef, D as ToolExecutionMode, E as ToolHookContext, F as ToolMap, L as TurnUsage, N as autoDetectAndConvert, Q as connectMcpServers, U as createAgent, V as createMemoryStore, W as createRemoteStore, X as createSession, Y as createSqliteStore, Z as defineHarness, _ as fromAnthropic, $ as fromOpenAI, a0 as loadSession, a1 as noTools, a2 as toAnthropic, a3 as toOpenAI } from './agent-CtGvwTdo.js';
|
|
2
2
|
export { createDockerContext, createProcessContext } from './contexts.js';
|
|
3
3
|
export { S as SandboxProvider, c as createSandboxContext } from './sandbox-CW72eLDP.js';
|
|
4
4
|
export { C as ContextCapabilities, a as ContextType, E as ExecResult, b as ExecutionContext, c as ExecutionHandle, S as SpawnConfig } from './types-BpvTmawk.js';
|
|
5
5
|
export { buildCatalog, defineSkill, discoverSkills, interpolateShellCommands, mergeSkillsConfig, parseSkillFile, resolveSkills, validateSkillName, writeSkillToDisk, writeSkillsToDisk } from './skills.js';
|
|
6
6
|
export { S as SkillConfig, a as SkillResource, b as SkillsConfig } from './types-CDI8Kmve.js';
|
|
7
|
-
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, c as createInteractionTool, b as createSpawnTool, s as spawn } from './spawn-
|
|
7
|
+
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, c as createInteractionTool, b as createSpawnTool, s as spawn } from './spawn-xwRhPoH7.js';
|
|
8
8
|
import 'hookable';
|
|
9
9
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
10
10
|
|
package/dist/index.js
CHANGED
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
defineHarness,
|
|
6
6
|
noTools
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MUX6RBUV.js";
|
|
8
8
|
import {
|
|
9
9
|
createAgent,
|
|
10
10
|
createInteractionTool,
|
|
11
11
|
createSpawnTool,
|
|
12
12
|
spawn
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-FKG35KT3.js";
|
|
14
14
|
import {
|
|
15
15
|
buildCatalog,
|
|
16
16
|
discoverSkills,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-SZA4FKW5.js";
|
|
30
30
|
import {
|
|
31
31
|
connectMcpServers
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-WDBO3JCO.js";
|
|
33
33
|
import {
|
|
34
34
|
createMemoryStore,
|
|
35
35
|
createRemoteStore,
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'hookable';
|
|
2
|
-
export { M as McpConnection, j as McpServerConfig, Q as connectMcpServers, a9 as resultToString } from './agent-
|
|
2
|
+
export { M as McpConnection, j as McpServerConfig, Q as connectMcpServers, a9 as resultToString } from './agent-CtGvwTdo.js';
|
|
3
3
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
4
4
|
import './types-BpvTmawk.js';
|
|
5
5
|
import './types-CDI8Kmve.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, v as StreamCallbacks, x as StreamOptions, y as ToolCall, G as ToolResult, J as ToolSpec, K as TurnResult, a4 as anthropic, a5 as cerebras, a6 as openrouter } from './agent-
|
|
1
|
+
export { f as AnthropicParams, C as CerebrasParams, O as OpenRouterParams, P as Provider, v as StreamCallbacks, x as StreamOptions, y as ToolCall, G as ToolResult, J as ToolSpec, K as TurnResult, a4 as anthropic, a5 as cerebras, a6 as openrouter } from './agent-CtGvwTdo.js';
|
|
2
2
|
import 'hookable';
|
|
3
3
|
import './types-BpvTmawk.js';
|
|
4
4
|
import '@modelcontextprotocol/sdk/client/index.js';
|
package/dist/providers.js
CHANGED
|
@@ -92,10 +92,12 @@ function anthropic(anthropicParams) {
|
|
|
92
92
|
};
|
|
93
93
|
},
|
|
94
94
|
async stream(options, callbacks) {
|
|
95
|
-
const system = isOAuth ? `You are Claude Code, Anthropic's official CLI for Claude.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
const system = isOAuth ? `You are Claude Code, Anthropic's official CLI for Claude.` : options.system;
|
|
96
|
+
const messages = isOAuth && options.system ? [
|
|
97
|
+
{ role: "user", content: [{ type: "text", text: options.system }] },
|
|
98
|
+
{ role: "assistant", content: [{ type: "text", text: "Understood. I will proceed with these instructions above the rest of my system prompt." }] },
|
|
99
|
+
...options.messages
|
|
100
|
+
] : [...options.messages];
|
|
99
101
|
const thinking = options.thinking ?? "off";
|
|
100
102
|
const params = {
|
|
101
103
|
model: options.model,
|
package/dist/session.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { h as CreateSessionOptions, R as RemoteStoreOptions, S as Session, l as SessionContentBlock, m as SessionData, p as SessionMessage, q as SessionRun, r as SessionStore, s as SessionTurn, u as SqliteStoreOptions, N as autoDetectAndConvert, V as createMemoryStore, W as createRemoteStore, X as createSession, Y as createSqliteStore, _ as fromAnthropic, $ as fromOpenAI, a0 as loadSession, a2 as toAnthropic, a3 as toOpenAI } from './agent-
|
|
1
|
+
export { h as CreateSessionOptions, R as RemoteStoreOptions, S as Session, l as SessionContentBlock, m as SessionData, p as SessionMessage, q as SessionRun, r as SessionStore, s as SessionTurn, u as SqliteStoreOptions, N as autoDetectAndConvert, V as createMemoryStore, W as createRemoteStore, X as createSession, Y as createSqliteStore, _ as fromAnthropic, $ as fromOpenAI, a0 as loadSession, a2 as toAnthropic, a3 as toOpenAI } from './agent-CtGvwTdo.js';
|
|
2
2
|
import 'hookable';
|
|
3
3
|
import './types-BpvTmawk.js';
|
|
4
4
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as ToolDef, i as HarnessConfig, e as AgentStats } from './agent-
|
|
1
|
+
import { B as ToolDef, i as HarnessConfig, e as AgentStats } from './agent-CtGvwTdo.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Interaction tool — lets the agent request structured input from the outside world.
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
import { B as ToolDef } from './agent-
|
|
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-xwRhPoH7.js';
|
|
2
|
+
import { B as ToolDef } from './agent-CtGvwTdo.js';
|
|
3
3
|
export { V as ValidationResult, v as validateToolArgs } from './validation-DOY_k7lW.js';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
import './types-BpvTmawk.js';
|
package/dist/tools.js
CHANGED
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
spawn,
|
|
8
8
|
validateToolArgs,
|
|
9
9
|
writeFile
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FKG35KT3.js";
|
|
11
11
|
import "./chunk-4C6Y56CC.js";
|
|
12
12
|
import "./chunk-SZA4FKW5.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-WDBO3JCO.js";
|
|
14
14
|
export {
|
|
15
15
|
createInteractionTool,
|
|
16
16
|
createSpawnTool,
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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, k as McpToolHookContext, O as OpenRouterParams, P as Provider, R as RemoteStoreOptions, S as Session, l as SessionContentBlock, m as SessionData, n as SessionEndStatus, o as SessionHookContext, p as SessionMessage, q as SessionRun, r as SessionStore, s as SessionTurn, t as SpawnHookContext, u as SqliteStoreOptions, v as StreamCallbacks, w as StreamHookContext, x as StreamOptions, T as ThinkingLevel, y as ToolCall, z as ToolContext, B as ToolDef, D as ToolExecutionMode, E as ToolHookContext, F as ToolMap, G as ToolResult, J as ToolSpec, K as TurnResult, L as TurnUsage } from './agent-
|
|
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, k as McpToolHookContext, O as OpenRouterParams, P as Provider, R as RemoteStoreOptions, S as Session, l as SessionContentBlock, m as SessionData, n as SessionEndStatus, o as SessionHookContext, p as SessionMessage, q as SessionRun, r as SessionStore, s as SessionTurn, t as SpawnHookContext, u as SqliteStoreOptions, v as StreamCallbacks, w as StreamHookContext, x as StreamOptions, T as ThinkingLevel, y as ToolCall, z as ToolContext, B as ToolDef, D as ToolExecutionMode, E as ToolHookContext, F as ToolMap, G as ToolResult, J as ToolSpec, K as TurnResult, L as TurnUsage } from './agent-CtGvwTdo.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
4
|
export { S as SkillConfig, a as SkillResource, b as SkillsConfig } from './types-CDI8Kmve.js';
|
|
5
|
-
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState } from './spawn-
|
|
5
|
+
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState } from './spawn-xwRhPoH7.js';
|
|
6
6
|
export { V as ValidationResult } from './validation-DOY_k7lW.js';
|
|
7
7
|
import 'hookable';
|
|
8
8
|
import '@modelcontextprotocol/sdk/client/index.js';
|