zidane 2.2.3 → 3.0.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/README.md +120 -16
- package/dist/{agent-CEO3IeZj.d.ts → agent-4zeSbdXy.d.ts} +97 -3
- package/dist/{chunk-MDVZX6GM.js → chunk-2VM47IBI.js} +5 -3
- package/dist/{chunk-ZSEMKVHP.js → chunk-D45PXTY2.js} +29 -15
- package/dist/chunk-JH6IAAFA.js +28 -0
- package/dist/{chunk-O2XZLJMG.js → chunk-QFHGWKK3.js} +746 -34
- package/dist/{chunk-DRAYZZ23.js → chunk-R74LQKAM.js} +11 -3
- package/dist/{chunk-CYWF2U62.js → chunk-VF4A7HAC.js} +2 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +19 -9
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +2 -1
- package/dist/presets.d.ts +12 -2
- package/dist/presets.js +4 -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-CvHmgpmO.d.ts → skills-use-DhxQaluD.d.ts} +16 -2
- package/dist/skills.d.ts +2 -2
- package/dist/tools.d.ts +19 -5
- package/dist/tools.js +9 -2
- package/dist/types.d.ts +2 -3
- package/dist/types.js +3 -1
- package/dist/{spawn-BJhCzli9.d.ts → validation-CYISGVTn.d.ts} +35 -2
- package/package.json +1 -1
- package/dist/chunk-MYWDHD7C.js +0 -14
- package/dist/validation-DOY_k7lW.d.ts +0 -11
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toolOutputByteLength
|
|
3
|
+
} from "./chunk-JH6IAAFA.js";
|
|
4
|
+
|
|
1
5
|
// src/mcp/index.ts
|
|
6
|
+
import { Buffer } from "buffer";
|
|
2
7
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
3
8
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
4
9
|
import { getDefaultEnvironment, StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
@@ -278,7 +283,8 @@ function buildMcpToolDef(config, client, tool, namespacedName, hooks) {
|
|
|
278
283
|
tool: tool.name,
|
|
279
284
|
displayName,
|
|
280
285
|
input: effectiveInput,
|
|
281
|
-
result: output
|
|
286
|
+
result: output,
|
|
287
|
+
outputBytes: toolOutputByteLength(output)
|
|
282
288
|
};
|
|
283
289
|
await hooks?.callHook("mcp:tool:transform", transformCtx);
|
|
284
290
|
output = transformCtx.result;
|
|
@@ -289,7 +295,8 @@ function buildMcpToolDef(config, client, tool, namespacedName, hooks) {
|
|
|
289
295
|
tool: tool.name,
|
|
290
296
|
displayName,
|
|
291
297
|
input: effectiveInput,
|
|
292
|
-
result: output
|
|
298
|
+
result: output,
|
|
299
|
+
outputBytes: toolOutputByteLength(output)
|
|
293
300
|
});
|
|
294
301
|
return output;
|
|
295
302
|
} catch (err) {
|
|
@@ -310,7 +317,8 @@ function buildMcpToolDef(config, client, tool, namespacedName, hooks) {
|
|
|
310
317
|
tool: tool.name,
|
|
311
318
|
displayName,
|
|
312
319
|
input: effectiveInput,
|
|
313
|
-
result: error.message
|
|
320
|
+
result: error.message,
|
|
321
|
+
outputBytes: Buffer.byteLength(error.message)
|
|
314
322
|
});
|
|
315
323
|
throw error;
|
|
316
324
|
}
|
|
@@ -433,6 +433,8 @@ function openaiCompat(params) {
|
|
|
433
433
|
usage: {
|
|
434
434
|
input: result.usage.input,
|
|
435
435
|
output: result.usage.output,
|
|
436
|
+
...result.usage.cacheRead !== void 0 ? { cacheRead: result.usage.cacheRead } : {},
|
|
437
|
+
...result.usage.cacheCreation !== void 0 ? { cacheCreation: result.usage.cacheCreation } : {},
|
|
436
438
|
...result.usage.cost !== void 0 ? { cost: result.usage.cost } : {},
|
|
437
439
|
...finishReason ? { finishReason } : {},
|
|
438
440
|
modelId
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { d as AgentHooks } from './agent-
|
|
2
|
-
export {
|
|
1
|
+
import { d as AgentHooks } from './agent-4zeSbdXy.js';
|
|
2
|
+
export { ac as ActivationVia, ad as ActiveSkill, A as Agent, a as AgentAbortedError, b as AgentBehavior, c as AgentContextExceededError, 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, m as ClassifiedError, n as ClassifiedErrorKind, o as CreateSessionOptions, ae as DeactivationReason, af as FileMapAdapter, ag as FileMapStoreOptions, I as ImageContent, M as McpConnection, p as McpServerConfig, q as McpToolHookContext, O as OAuthRefreshHookContext, ah as OpenAICompatAuthHeader, ai as OpenAICompatHttpError, aj as OpenAICompatParams, 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, J as SessionTurn, ak as SkillActivationState, al as SkillActivationStateOptions, K as SkillConfig, am as SkillDiagnostic, L as SkillResource, an as SkillSource, N as SkillsConfig, Q as SpawnHookContext, T as StreamCallbacks, U as StreamHookContext, V as StreamOptions, W as ThinkingLevel, X as ToolCall, Y as ToolContext, Z as ToolDef, _ as ToolExecutionMode, $ as ToolHookContext, a0 as ToolMap, a1 as ToolResult, a2 as ToolResultContent, a3 as ToolResultImageContent, a4 as ToolResultTextContent, a5 as ToolSpec, a6 as TurnFinishReason, a7 as TurnResult, a8 as TurnUsage, ao as anthropic, ap as autoDetectAndConvert, aq as cerebras, ar as classifyOpenAICompatError, as as connectMcpServers, at as createAgent, au as createFileMapStore, av as createMemoryStore, aw as createRemoteStore, ax as createSession, ay as createSkillActivationState, az as fromAnthropic, aA as fromOpenAI, aB as loadSession, aC as mapOAIFinishReason, a9 as matchesContextExceeded, aD as normalizeMcpBlocks, aE as normalizeMcpServers, aF as openai, aG as openaiCompat, aH as openrouter, aI as resultToString, aJ as toAnthropic, aK as toOpenAI, aL as toTypedError, aa as toolOutputByteLength, ab as toolResultToText } from './agent-4zeSbdXy.js';
|
|
3
3
|
export { createDockerContext, createProcessContext } from './contexts.js';
|
|
4
4
|
export { S as SandboxProvider, c as createSandboxContext } from './sandbox-CW72eLDP.js';
|
|
5
5
|
export { C as ContextCapabilities, a as ContextType, E as ExecResult, b as ExecutionContext, c as ExecutionHandle, S as SpawnConfig } from './types-BpvTmawk.js';
|
|
6
6
|
export { Preset, basic, basicTools, definePreset } from './presets.js';
|
|
7
7
|
export { IMPLICITLY_ALLOWED_SKILL_TOOLS, SkillValidationIssue, SkillValidationResult, SourcedScanPath, buildCatalog, defineSkill, discoverSkills, installAllowedToolsGate, interpolateShellCommands, isToolAllowedByUnion, matchesAllowedTool, parseAllowedToolPattern, parseSkillFile, resolveSkills, validateResourcePath, validateSkillForWrite, validateSkillName, writeSkillToDisk, writeSkillsToDisk } from './skills.js';
|
|
8
|
-
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-
|
|
9
|
-
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, c as createInteractionTool, b as createSpawnTool, s as spawn } from './
|
|
8
|
+
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-DhxQaluD.js';
|
|
9
|
+
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, V as ValidationResult, c as createInteractionTool, b as createSpawnTool, s as spawn, v as validateToolArgs } from './validation-CYISGVTn.js';
|
|
10
10
|
import { Hookable } from 'hookable';
|
|
11
11
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
12
12
|
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineSkill
|
|
3
3
|
} from "./chunk-BW3WTFIR.js";
|
|
4
|
-
import {
|
|
5
|
-
toolResultToText
|
|
6
|
-
} from "./chunk-MYWDHD7C.js";
|
|
7
4
|
import {
|
|
8
5
|
anthropic,
|
|
9
6
|
cerebras,
|
|
10
7
|
openai,
|
|
11
8
|
openrouter
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-D45PXTY2.js";
|
|
13
10
|
import {
|
|
14
11
|
basicTools,
|
|
15
12
|
basic_default,
|
|
16
13
|
definePreset
|
|
17
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2VM47IBI.js";
|
|
18
15
|
import {
|
|
19
16
|
createAgent,
|
|
20
17
|
createInteractionTool,
|
|
@@ -22,9 +19,13 @@ import {
|
|
|
22
19
|
createSkillsRunScriptTool,
|
|
23
20
|
createSkillsUseTool,
|
|
24
21
|
createSpawnTool,
|
|
22
|
+
edit,
|
|
25
23
|
glob,
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
grep,
|
|
25
|
+
multiEdit,
|
|
26
|
+
spawn,
|
|
27
|
+
validateToolArgs
|
|
28
|
+
} from "./chunk-QFHGWKK3.js";
|
|
28
29
|
import {
|
|
29
30
|
IMPLICITLY_ALLOWED_SKILL_TOOLS,
|
|
30
31
|
buildCatalog,
|
|
@@ -53,7 +54,11 @@ import {
|
|
|
53
54
|
normalizeMcpBlocks,
|
|
54
55
|
normalizeMcpServers,
|
|
55
56
|
resultToString
|
|
56
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-R74LQKAM.js";
|
|
58
|
+
import {
|
|
59
|
+
toolOutputByteLength,
|
|
60
|
+
toolResultToText
|
|
61
|
+
} from "./chunk-JH6IAAFA.js";
|
|
57
62
|
import {
|
|
58
63
|
createFileMapStore,
|
|
59
64
|
createMemoryStore,
|
|
@@ -71,7 +76,7 @@ import {
|
|
|
71
76
|
openaiCompat,
|
|
72
77
|
toAnthropic,
|
|
73
78
|
toOpenAI
|
|
74
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-VF4A7HAC.js";
|
|
75
80
|
import {
|
|
76
81
|
AgentAbortedError,
|
|
77
82
|
AgentContextExceededError,
|
|
@@ -228,9 +233,11 @@ export {
|
|
|
228
233
|
definePreset,
|
|
229
234
|
defineSkill,
|
|
230
235
|
discoverSkills,
|
|
236
|
+
edit,
|
|
231
237
|
fromAnthropic,
|
|
232
238
|
fromOpenAI,
|
|
233
239
|
glob,
|
|
240
|
+
grep,
|
|
234
241
|
installAllowedToolsGate,
|
|
235
242
|
interpolateShellCommands,
|
|
236
243
|
isToolAllowedByUnion,
|
|
@@ -238,6 +245,7 @@ export {
|
|
|
238
245
|
mapOAIFinishReason,
|
|
239
246
|
matchesAllowedTool,
|
|
240
247
|
matchesContextExceeded,
|
|
248
|
+
multiEdit,
|
|
241
249
|
normalizeMcpBlocks,
|
|
242
250
|
normalizeMcpServers,
|
|
243
251
|
openai,
|
|
@@ -251,10 +259,12 @@ export {
|
|
|
251
259
|
toAnthropic,
|
|
252
260
|
toOpenAI,
|
|
253
261
|
toTypedError,
|
|
262
|
+
toolOutputByteLength,
|
|
254
263
|
toolResultToText,
|
|
255
264
|
validateResourcePath,
|
|
256
265
|
validateSkillForWrite,
|
|
257
266
|
validateSkillName,
|
|
267
|
+
validateToolArgs,
|
|
258
268
|
writeSkillToDisk,
|
|
259
269
|
writeSkillsToDisk,
|
|
260
270
|
zodToJsonSchema
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'hookable';
|
|
2
|
-
export { M as McpConnection, p as McpServerConfig,
|
|
2
|
+
export { M as McpConnection, p as McpServerConfig, as as connectMcpServers, aD as normalizeMcpBlocks, aE as normalizeMcpServers, aI as resultToString } from './agent-4zeSbdXy.js';
|
|
3
3
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
4
4
|
import './types-BpvTmawk.js';
|
package/dist/mcp.js
CHANGED
package/dist/presets.d.ts
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import { Z as ToolDef, e as AgentOptions } from './agent-
|
|
1
|
+
import { Z as ToolDef, e as AgentOptions } from './agent-4zeSbdXy.js';
|
|
2
2
|
import 'hookable';
|
|
3
3
|
import './types-BpvTmawk.js';
|
|
4
4
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
5
5
|
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Core tools available in every basic preset (without spawn).
|
|
8
|
+
*
|
|
9
|
+
* `edit` and `multi_edit` ship in the basic set because surgical edits are the
|
|
10
|
+
* default modality for production agents — `write_file` is for full overwrites.
|
|
11
|
+
* `glob` and `grep` are exported but opt-in: not every agent needs codebase
|
|
12
|
+
* search, and shipping them by default would force `tool:gate` work onto
|
|
13
|
+
* consumers that prefer the model to use `shell` + classic Unix tools.
|
|
14
|
+
*/
|
|
7
15
|
declare const basicTools: {
|
|
8
16
|
shell: ToolDef;
|
|
9
17
|
readFile: ToolDef;
|
|
10
18
|
writeFile: ToolDef;
|
|
11
19
|
listFiles: ToolDef;
|
|
20
|
+
edit: ToolDef;
|
|
21
|
+
multiEdit: ToolDef;
|
|
12
22
|
};
|
|
13
23
|
declare const _default: Preset;
|
|
14
24
|
|
package/dist/presets.js
CHANGED
|
@@ -2,11 +2,12 @@ import {
|
|
|
2
2
|
basicTools,
|
|
3
3
|
basic_default,
|
|
4
4
|
definePreset
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-2VM47IBI.js";
|
|
6
|
+
import "./chunk-QFHGWKK3.js";
|
|
7
7
|
import "./chunk-TPXPVEH6.js";
|
|
8
8
|
import "./chunk-2EQT4EHD.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-R74LQKAM.js";
|
|
10
|
+
import "./chunk-JH6IAAFA.js";
|
|
10
11
|
import "./chunk-LNN5UTS2.js";
|
|
11
12
|
export {
|
|
12
13
|
basic_default as basic,
|
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, ah as OpenAICompatAuthHeader, ai as OpenAICompatHttpError, aj as OpenAICompatParams, r as OpenAIParams, s as OpenRouterParams, w as Provider, x as ProviderCapabilities, T as StreamCallbacks, V as StreamOptions, X as ToolCall, a1 as ToolResult, a5 as ToolSpec, a7 as TurnResult, ao as anthropic, aq as cerebras, ar as classifyOpenAICompatError, aC as mapOAIFinishReason, aF as openai, aG as openaiCompat, aH as openrouter } from './agent-4zeSbdXy.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,13 +3,13 @@ import {
|
|
|
3
3
|
cerebras,
|
|
4
4
|
openai,
|
|
5
5
|
openrouter
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-D45PXTY2.js";
|
|
7
7
|
import {
|
|
8
8
|
OpenAICompatHttpError,
|
|
9
9
|
classifyOpenAICompatError,
|
|
10
10
|
mapOAIFinishReason,
|
|
11
11
|
openaiCompat
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VF4A7HAC.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, af as FileMapAdapter, ag as FileMapStoreOptions, R as RemoteStoreOptions, S as Session, z as SessionContentBlock, B as SessionData, F as SessionMessage, G as SessionRun, H as SessionStore, J as SessionTurn, ap as autoDetectAndConvert, au as createFileMapStore, av as createMemoryStore, aw as createRemoteStore, ax as createSession, az as fromAnthropic, aA as fromOpenAI, aB as loadSession, aJ as toAnthropic, aK as toOpenAI } from './agent-4zeSbdXy.js';
|
|
2
2
|
import 'hookable';
|
|
3
3
|
import './types-BpvTmawk.js';
|
|
4
4
|
import '@modelcontextprotocol/sdk/client/index.js';
|
package/dist/session.js
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
import { Z as ToolDef, K as SkillConfig,
|
|
1
|
+
import { Z as ToolDef, K as SkillConfig, ak as SkillActivationState, d as AgentHooks } from './agent-4zeSbdXy.js';
|
|
2
2
|
import { Hookable } from 'hookable';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Surgical edit — replace `old_string` with `new_string` in a single file.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors Claude Code's `Edit` semantics so models post-trained on Anthropic's
|
|
8
|
+
* tool surface need no relearning. Fails clearly when `old_string` isn't unique
|
|
9
|
+
* (unless `replace_all: true`) and when not found, with a nearest-match preview
|
|
10
|
+
* so the model can recover without a separate `read_file` round-trip.
|
|
11
|
+
*/
|
|
12
|
+
declare const edit: ToolDef;
|
|
13
|
+
|
|
4
14
|
declare const glob: ToolDef;
|
|
5
15
|
|
|
16
|
+
declare const grep: ToolDef;
|
|
17
|
+
|
|
18
|
+
declare const multiEdit: ToolDef;
|
|
19
|
+
|
|
6
20
|
/**
|
|
7
21
|
* `skills_read` tool — reads a bundled resource file from an active skill.
|
|
8
22
|
*
|
|
@@ -63,4 +77,4 @@ interface SkillsUseToolOptions {
|
|
|
63
77
|
*/
|
|
64
78
|
declare function createSkillsUseTool(options: SkillsUseToolOptions): ToolDef;
|
|
65
79
|
|
|
66
|
-
export { type SkillsReadToolOptions as S, type SkillsRunScriptToolOptions as a, type SkillsUseToolOptions as b, createSkillsReadTool as c, createSkillsRunScriptTool as d, createSkillsUseTool as e, glob as g };
|
|
80
|
+
export { type SkillsReadToolOptions as S, type SkillsRunScriptToolOptions as a, type SkillsUseToolOptions as b, createSkillsReadTool as c, createSkillsRunScriptTool as d, createSkillsUseTool as e, edit as f, glob as g, grep as h, multiEdit as m };
|
package/dist/skills.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as AgentHooks,
|
|
2
|
-
export {
|
|
1
|
+
import { d as AgentHooks, ak as SkillActivationState, K as SkillConfig, an as SkillSource, am as SkillDiagnostic, N as SkillsConfig } from './agent-4zeSbdXy.js';
|
|
2
|
+
export { ac as ActivationVia, ad as ActiveSkill, ae as DeactivationReason, al as SkillActivationStateOptions, L as SkillResource, ay as createSkillActivationState } from './agent-4zeSbdXy.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/tools.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
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-
|
|
2
|
-
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, c as createInteractionTool, b as createSpawnTool, s as spawn } from './
|
|
3
|
-
import { Z as ToolDef } from './agent-
|
|
4
|
-
export { Y as ToolContext, a0 as ToolMap } from './agent-
|
|
5
|
-
export { V as ValidationResult, v as validateToolArgs } from './validation-DOY_k7lW.js';
|
|
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-DhxQaluD.js';
|
|
2
|
+
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, V as ValidationResult, c as createInteractionTool, b as createSpawnTool, s as spawn, v as validateToolArgs } from './validation-CYISGVTn.js';
|
|
3
|
+
import { Z as ToolDef } from './agent-4zeSbdXy.js';
|
|
4
|
+
export { Y as ToolContext, a0 as ToolMap } from './agent-4zeSbdXy.js';
|
|
6
5
|
import 'hookable';
|
|
7
6
|
import './presets.js';
|
|
8
7
|
import './types-BpvTmawk.js';
|
|
@@ -14,6 +13,21 @@ declare const readFile: ToolDef;
|
|
|
14
13
|
|
|
15
14
|
declare const shell: ToolDef;
|
|
16
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Write a file, with an idempotency signal when the content is unchanged.
|
|
18
|
+
*
|
|
19
|
+
* Three return shapes — chosen so the model can recognize a no-op without a
|
|
20
|
+
* separate read:
|
|
21
|
+
* - `Created path (N bytes)` — file did not exist
|
|
22
|
+
* - `Updated path (N bytes)` — content differed from on-disk
|
|
23
|
+
* - `No change needed: path already at target state (N bytes)` — equal
|
|
24
|
+
*
|
|
25
|
+
* Race window: in non-process execution contexts (docker, sandbox) shared by
|
|
26
|
+
* multiple agents, another writer can mutate the file between our read and
|
|
27
|
+
* our write. Local process context is single-writer per agent so the race is
|
|
28
|
+
* a non-issue there. Documented rather than locked because the cost of
|
|
29
|
+
* cross-context locking outweighs the cost of a stale "No change" message.
|
|
30
|
+
*/
|
|
17
31
|
declare const writeFile: ToolDef;
|
|
18
32
|
|
|
19
33
|
export { ToolDef, listFiles, readFile, shell, writeFile };
|
package/dist/tools.js
CHANGED
|
@@ -4,17 +4,21 @@ import {
|
|
|
4
4
|
createSkillsRunScriptTool,
|
|
5
5
|
createSkillsUseTool,
|
|
6
6
|
createSpawnTool,
|
|
7
|
+
edit,
|
|
7
8
|
glob,
|
|
9
|
+
grep,
|
|
8
10
|
listFiles,
|
|
11
|
+
multiEdit,
|
|
9
12
|
readFile,
|
|
10
13
|
shell,
|
|
11
14
|
spawn,
|
|
12
15
|
validateToolArgs,
|
|
13
16
|
writeFile
|
|
14
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QFHGWKK3.js";
|
|
15
18
|
import "./chunk-TPXPVEH6.js";
|
|
16
19
|
import "./chunk-2EQT4EHD.js";
|
|
17
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-R74LQKAM.js";
|
|
21
|
+
import "./chunk-JH6IAAFA.js";
|
|
18
22
|
import "./chunk-LNN5UTS2.js";
|
|
19
23
|
export {
|
|
20
24
|
createInteractionTool,
|
|
@@ -22,8 +26,11 @@ export {
|
|
|
22
26
|
createSkillsRunScriptTool,
|
|
23
27
|
createSkillsUseTool,
|
|
24
28
|
createSpawnTool,
|
|
29
|
+
edit,
|
|
25
30
|
glob,
|
|
31
|
+
grep,
|
|
26
32
|
listFiles,
|
|
33
|
+
multiEdit,
|
|
27
34
|
readFile,
|
|
28
35
|
shell,
|
|
29
36
|
spawn,
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +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, I as ImageContent, 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, J as SessionTurn, K as SkillConfig, L as SkillResource, N as SkillsConfig, Q as SpawnHookContext, T as StreamCallbacks, U as StreamHookContext, V as StreamOptions, W as ThinkingLevel, X as ToolCall, Y as ToolContext, Z as ToolDef, _ as ToolExecutionMode, $ as ToolHookContext, a0 as ToolMap, a1 as ToolResult, a2 as ToolResultContent, a3 as ToolResultImageContent, a4 as ToolResultTextContent, a5 as ToolSpec, a6 as TurnFinishReason, a7 as TurnResult, a8 as TurnUsage, a9 as matchesContextExceeded, aa as toolResultToText } from './agent-
|
|
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, I as ImageContent, 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, J as SessionTurn, K as SkillConfig, L as SkillResource, N as SkillsConfig, Q as SpawnHookContext, T as StreamCallbacks, U as StreamHookContext, V as StreamOptions, W as ThinkingLevel, X as ToolCall, Y as ToolContext, Z as ToolDef, _ as ToolExecutionMode, $ as ToolHookContext, a0 as ToolMap, a1 as ToolResult, a2 as ToolResultContent, a3 as ToolResultImageContent, a4 as ToolResultTextContent, a5 as ToolSpec, a6 as TurnFinishReason, a7 as TurnResult, a8 as TurnUsage, a9 as matchesContextExceeded, aa as toolOutputByteLength, ab as toolResultToText } from './agent-4zeSbdXy.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 { Preset } from './presets.js';
|
|
5
|
-
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState } from './
|
|
6
|
-
export { V as ValidationResult } from './validation-DOY_k7lW.js';
|
|
5
|
+
export { C as ChildAgent, I as InteractionToolOptions, S as SpawnToolOptions, a as SpawnToolState, V as ValidationResult } from './validation-CYISGVTn.js';
|
|
7
6
|
import 'hookable';
|
|
8
7
|
import '@modelcontextprotocol/sdk/client/index.js';
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
+
toolOutputByteLength,
|
|
2
3
|
toolResultToText
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JH6IAAFA.js";
|
|
4
5
|
import {
|
|
5
6
|
AgentAbortedError,
|
|
6
7
|
AgentContextExceededError,
|
|
@@ -16,5 +17,6 @@ export {
|
|
|
16
17
|
AgentToolNotAllowedError,
|
|
17
18
|
CONTEXT_EXCEEDED_MESSAGE_PATTERNS,
|
|
18
19
|
matchesContextExceeded,
|
|
20
|
+
toolOutputByteLength,
|
|
19
21
|
toolResultToText
|
|
20
22
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Y as ToolContext, Z as ToolDef, h as AgentStats, l as ChildRunStats } from './agent-
|
|
1
|
+
import { Y as ToolContext, Z as ToolDef, h as AgentStats, l as ChildRunStats } from './agent-4zeSbdXy.js';
|
|
2
2
|
import { Preset } from './presets.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -149,4 +149,37 @@ declare function createSpawnTool(options?: SpawnToolOptions): ToolDef & SpawnToo
|
|
|
149
149
|
*/
|
|
150
150
|
declare const spawn: ToolDef & SpawnToolState;
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
/**
|
|
153
|
+
* Tool argument validation against JSON Schema-style inputSchema.
|
|
154
|
+
*
|
|
155
|
+
* Two passes:
|
|
156
|
+
* 1. Required-field presence. Missing or null/undefined required fields fail.
|
|
157
|
+
* 2. Top-level type checks with **best-effort coercion**. Small/OSS models
|
|
158
|
+
* routinely send `"true"` for a `boolean` field or `"42"` for a `number`,
|
|
159
|
+
* and rejecting outright forces a confusing retry. Instead, we auto-heal
|
|
160
|
+
* coerce when the conversion is unambiguous, fail only when the value
|
|
161
|
+
* cannot be reasonably normalized to any of the declared types.
|
|
162
|
+
*
|
|
163
|
+
* Nested validation is intentionally out of scope — keep it cheap and let the
|
|
164
|
+
* tool's `execute` body assert deeper invariants.
|
|
165
|
+
*/
|
|
166
|
+
interface ValidationResult {
|
|
167
|
+
valid: boolean;
|
|
168
|
+
/** Human-readable reason. Present on failure only. */
|
|
169
|
+
error?: string;
|
|
170
|
+
/**
|
|
171
|
+
* Possibly-coerced input. Present iff `valid: true`. Tools should call
|
|
172
|
+
* `execute(coercedInput, ctx)` so auto-healed values reach the tool body.
|
|
173
|
+
* When no coercion was applied, this is reference-equal to the input.
|
|
174
|
+
*/
|
|
175
|
+
coercedInput?: Record<string, unknown>;
|
|
176
|
+
/**
|
|
177
|
+
* Names of fields whose values were coerced. Empty when nothing changed.
|
|
178
|
+
* Useful for telemetry (`validation:reject` on failure already carries the
|
|
179
|
+
* reason; this is the success-path equivalent).
|
|
180
|
+
*/
|
|
181
|
+
coercions?: readonly string[];
|
|
182
|
+
}
|
|
183
|
+
declare function validateToolArgs(input: Record<string, unknown>, schema: Record<string, unknown>): ValidationResult;
|
|
184
|
+
|
|
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, spawn as s, validateToolArgs as v };
|
package/package.json
CHANGED
package/dist/chunk-MYWDHD7C.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// src/types.ts
|
|
2
|
-
function toolResultToText(content) {
|
|
3
|
-
if (typeof content === "string")
|
|
4
|
-
return content;
|
|
5
|
-
return content.map((block) => {
|
|
6
|
-
if (block.type === "text")
|
|
7
|
-
return block.text;
|
|
8
|
-
return `[image: ${block.mediaType} \u2014 ${block.data.length} b64 bytes]`;
|
|
9
|
-
}).join("\n");
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
toolResultToText
|
|
14
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple tool argument validation against JSON Schema-style inputSchema.
|
|
3
|
-
* Checks required fields are present; type coercion is left to the tools themselves.
|
|
4
|
-
*/
|
|
5
|
-
interface ValidationResult {
|
|
6
|
-
valid: boolean;
|
|
7
|
-
error?: string;
|
|
8
|
-
}
|
|
9
|
-
declare function validateToolArgs(input: Record<string, unknown>, schema: Record<string, unknown>): ValidationResult;
|
|
10
|
-
|
|
11
|
-
export { type ValidationResult as V, validateToolArgs as v };
|