@pixerate/editor 0.140.4 → 0.142.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/canvasPlayback.d.cts +15 -0
- package/dist/agent/canvasPlayback.d.ts +15 -0
- package/dist/agent/index.cjs +173 -33
- package/dist/agent/index.d.cts +1 -0
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/index.js +147 -7
- package/dist/agent/providers.d.cts +12 -1
- package/dist/agent/providers.d.ts +12 -1
- package/dist/agent/types.d.cts +3 -0
- package/dist/agent/types.d.ts +3 -0
- package/dist/animation/index.cjs +2 -2
- package/dist/animation/index.js +1 -1
- package/dist/animation/presence.d.cts +1 -75
- package/dist/animation/presence.d.ts +1 -75
- package/dist/animation-editor/index.cjs +69 -19
- package/dist/animation-editor/index.d.cts +1 -0
- package/dist/animation-editor/index.d.ts +1 -0
- package/dist/animation-editor/index.js +54 -4
- package/dist/animation-editor/playback.d.cts +10 -0
- package/dist/animation-editor/playback.d.ts +10 -0
- package/dist/bridge/cli.cjs +3 -3
- package/dist/bridge/cli.js +2 -2
- package/dist/bridge/index.cjs +3 -3
- package/dist/bridge/index.js +2 -2
- package/dist/canvas/index.cjs +336 -646
- package/dist/canvas/index.d.cts +1 -0
- package/dist/canvas/index.d.ts +1 -0
- package/dist/canvas/index.js +44 -354
- package/dist/canvas/playback.d.cts +14 -0
- package/dist/canvas/playback.d.ts +14 -0
- package/dist/chart/index.cjs +255 -171
- package/dist/chart/index.d.cts +1 -0
- package/dist/chart/index.d.ts +1 -0
- package/dist/chart/index.js +244 -160
- package/dist/chart/playback.d.cts +22 -0
- package/dist/chart/playback.d.ts +22 -0
- package/dist/chunk-54GVEVXS.js +408 -0
- package/dist/{chunk-E747F3D5.js → chunk-CC6WKVIH.js} +86 -5
- package/dist/chunk-DW4CV5H4.js +591 -0
- package/dist/{chunk-UMS6YFA6.js → chunk-EAQ4BGNS.js} +1 -1
- package/dist/{chunk-AGCD3EHB.cjs → chunk-ENIZYNEF.cjs} +7 -7
- package/dist/{chunk-BSGPXPTW.js → chunk-PEEP2YR7.js} +1 -1
- package/dist/{chunk-VTY64I6H.cjs → chunk-QSM3MDDJ.cjs} +85 -85
- package/dist/{chunk-2RUNJYOX.cjs → chunk-QZFEX2N4.cjs} +86 -5
- package/dist/{chunk-RB62U6MS.js → chunk-RFBFTLVN.js} +27 -5
- package/dist/chunk-UBRYHNRU.cjs +591 -0
- package/dist/{chunk-GEY73RUW.cjs → chunk-UJGAA6AK.cjs} +1 -1
- package/dist/{chunk-LMSFXRAJ.js → chunk-VGJTUCWM.js} +1 -1
- package/dist/chunk-X2HQP7DF.cjs +408 -0
- package/dist/chunk-XH32BATE.cjs +68 -0
- package/dist/{chunk-HDK3T2QS.cjs → chunk-Y4BWZB6J.cjs} +29 -7
- package/dist/chunk-Y6SGC6KO.js +68 -0
- package/dist/commands/index.cjs +37 -1
- package/dist/commands/index.js +36 -0
- package/dist/commands/registry.d.cts +11 -0
- package/dist/commands/registry.d.ts +11 -0
- package/dist/diagram/index.cjs +7 -7
- package/dist/diagram/index.js +1 -1
- package/dist/image-editor/index.cjs +108 -16
- package/dist/image-editor/index.d.cts +1 -0
- package/dist/image-editor/index.d.ts +1 -0
- package/dist/image-editor/index.js +107 -15
- package/dist/image-editor/playback.d.cts +22 -0
- package/dist/image-editor/playback.d.ts +22 -0
- package/dist/index.cjs +7 -3
- package/dist/index.js +6 -2
- package/dist/paint-editor/index.cjs +73 -25
- package/dist/paint-editor/index.d.cts +1 -0
- package/dist/paint-editor/index.d.ts +1 -0
- package/dist/paint-editor/index.js +68 -20
- package/dist/paint-editor/playback.d.cts +16 -0
- package/dist/paint-editor/playback.d.ts +16 -0
- package/dist/parameters/index.cjs +32 -8
- package/dist/parameters/index.d.cts +1 -0
- package/dist/parameters/index.d.ts +1 -0
- package/dist/parameters/index.js +28 -4
- package/dist/parameters/playback.d.cts +10 -0
- package/dist/parameters/playback.d.ts +10 -0
- package/dist/spreadsheet/index.cjs +7 -3
- package/dist/spreadsheet/index.d.cts +1 -0
- package/dist/spreadsheet/index.d.ts +1 -0
- package/dist/spreadsheet/index.js +6 -2
- package/dist/spreadsheet/playback.d.cts +15 -0
- package/dist/spreadsheet/playback.d.ts +15 -0
- package/dist/tools/index.cjs +40 -3
- package/dist/tools/index.d.cts +3 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.js +39 -2
- package/dist/tools/playback.d.cts +205 -0
- package/dist/tools/playback.d.ts +205 -0
- package/dist/tools/presence.d.cts +82 -0
- package/dist/tools/presence.d.ts +82 -0
- package/dist/tools/registry.d.cts +45 -6
- package/dist/tools/registry.d.ts +45 -6
- package/dist/tools/script.d.cts +77 -0
- package/dist/tools/script.d.ts +77 -0
- package/dist/tools/view.d.cts +2 -4
- package/dist/tools/view.d.ts +2 -4
- package/dist/vector/index.cjs +217 -100
- package/dist/vector/index.d.cts +1 -0
- package/dist/vector/index.d.ts +1 -0
- package/dist/vector/index.js +140 -23
- package/dist/vector/playback.d.cts +13 -0
- package/dist/vector/playback.d.ts +13 -0
- package/dist/video-editor/index.cjs +81 -28
- package/dist/video-editor/index.d.cts +1 -0
- package/dist/video-editor/index.d.ts +1 -0
- package/dist/video-editor/index.js +58 -5
- package/dist/video-editor/playback.d.cts +20 -0
- package/dist/video-editor/playback.d.ts +20 -0
- package/package.json +1 -1
- package/skills/pixerate-agent-tools/SKILL.md +13 -0
- package/skills/pixerate-animation-editor/SKILL.md +1 -0
- package/skills/pixerate-canvas/SKILL.md +3 -0
- package/skills/pixerate-chart/SKILL.md +1 -0
- package/skills/pixerate-image-editor/SKILL.md +2 -2
- package/skills/pixerate-paint-editor/SKILL.md +1 -0
- package/skills/pixerate-parameters/SKILL.md +1 -0
- package/skills/pixerate-spreadsheet/SKILL.md +1 -0
- package/skills/pixerate-vector/SKILL.md +5 -0
- package/skills/pixerate-video-editor/SKILL.md +1 -0
- package/dist/chunk-BTZS3KZY.js +0 -221
- package/dist/chunk-K73HMKQP.js +0 -0
- package/dist/chunk-LACYURUW.cjs +0 -1
- package/dist/chunk-MRD3NXKR.cjs +0 -221
package/dist/tools/registry.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type JsonSchema, type SchemaValidationError } from './schema.js';
|
|
2
2
|
import { ToolRegistryView, type ToolViewOptions } from './view.js';
|
|
3
|
+
import type { ToolPlanner } from './playback.js';
|
|
4
|
+
import type { PresenceActorInfo } from './presence.js';
|
|
3
5
|
/**
|
|
4
6
|
* MCP-shaped tool definition, as returned by `tools/list`.
|
|
5
7
|
*/
|
|
@@ -47,6 +49,14 @@ export interface ToolCallContext {
|
|
|
47
49
|
/** Id of the provider that owns the tool. */
|
|
48
50
|
providerId: string;
|
|
49
51
|
signal?: AbortSignal;
|
|
52
|
+
/** Who is calling (an MCP client, a scripted agent), for agent playback's cursors and queues. */
|
|
53
|
+
actor?: PresenceActorInfo;
|
|
54
|
+
}
|
|
55
|
+
/** Options for `callTool`. */
|
|
56
|
+
export interface ToolCallOptions {
|
|
57
|
+
signal?: AbortSignal;
|
|
58
|
+
/** Who is calling; agent playback gives each actor its own cursor and queue. */
|
|
59
|
+
actor?: PresenceActorInfo;
|
|
50
60
|
}
|
|
51
61
|
/**
|
|
52
62
|
* Handler return values are normalized into an {@link McpToolResult}: a full
|
|
@@ -57,6 +67,17 @@ export interface ToolCallContext {
|
|
|
57
67
|
export type AgentToolHandler = (args: Record<string, any>, context: ToolCallContext) => unknown | Promise<unknown>;
|
|
58
68
|
export interface AgentTool extends McpToolDefinition {
|
|
59
69
|
handler: AgentToolHandler;
|
|
70
|
+
/**
|
|
71
|
+
* How agent playback acts this tool out (see `createAgentPlayback`): `'self'` when the
|
|
72
|
+
* handler drives its own cursor (a director), `false` to never play it. Default: play it
|
|
73
|
+
* from `plan`, or from the ids in its arguments and result.
|
|
74
|
+
*/
|
|
75
|
+
playback?: 'self' | false;
|
|
76
|
+
/**
|
|
77
|
+
* Pure planner for agent playback: the cursor steps (surface coordinates) that act out a
|
|
78
|
+
* call with these arguments, given the state before the call. Not sent to clients.
|
|
79
|
+
*/
|
|
80
|
+
plan?: ToolPlanner;
|
|
60
81
|
}
|
|
61
82
|
/**
|
|
62
83
|
* A source of tools, typically one per mounted editor, spreadsheet or canvas.
|
|
@@ -83,7 +104,23 @@ export interface AgentToolProvider {
|
|
|
83
104
|
tools: readonly AgentTool[] | (() => readonly AgentTool[]);
|
|
84
105
|
/** Lets the provider signal that its tool list changed; returns an unsubscribe function. */
|
|
85
106
|
subscribe?: (notify: () => void) => () => void;
|
|
107
|
+
/** The playback surface its calls are acted out on (default: the provider id). */
|
|
108
|
+
playbackSurface?: string;
|
|
86
109
|
}
|
|
110
|
+
/** A tool call as a {@link ToolMiddleware} sees it (arguments already validated). */
|
|
111
|
+
export interface ToolMiddlewareCall {
|
|
112
|
+
/** The exposed (possibly namespaced) name. */
|
|
113
|
+
name: string;
|
|
114
|
+
tool: AgentTool;
|
|
115
|
+
provider: AgentToolProvider;
|
|
116
|
+
args: Record<string, any>;
|
|
117
|
+
context: ToolCallContext;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Wraps every tool call of a registry (`registry.use`): call `next()` to run the handler (or
|
|
121
|
+
* the next middleware) and return its value. A throw becomes an `isError` result.
|
|
122
|
+
*/
|
|
123
|
+
export type ToolMiddleware = (call: ToolMiddlewareCall, next: () => Promise<unknown>) => Promise<unknown>;
|
|
87
124
|
export type ToolErrorCode = 'unknown_tool' | 'invalid_arguments' | 'tool_failed';
|
|
88
125
|
/** Structured error carried in `structuredContent.error` of a failed call. */
|
|
89
126
|
export interface ToolCallError {
|
|
@@ -152,9 +189,7 @@ export interface ToolSource {
|
|
|
152
189
|
listTools(): McpListToolsResult;
|
|
153
190
|
hasTool(name: string): boolean;
|
|
154
191
|
getTool(name: string): McpToolDefinition | undefined;
|
|
155
|
-
callTool(name: string, args?: Record<string, unknown>, options?:
|
|
156
|
-
signal?: AbortSignal;
|
|
157
|
-
}): Promise<McpToolResult>;
|
|
192
|
+
callTool(name: string, args?: Record<string, unknown>, options?: ToolCallOptions): Promise<McpToolResult>;
|
|
158
193
|
onListChanged(listener: (tools: McpToolDefinition[]) => void): () => void;
|
|
159
194
|
/** The toolsets behind `listTools()`, in listing order. */
|
|
160
195
|
toolsets(): ToolsetInfo[];
|
|
@@ -182,6 +217,7 @@ export declare class ToolRegistry implements ToolSource {
|
|
|
182
217
|
};
|
|
183
218
|
private readonly entries;
|
|
184
219
|
private readonly listeners;
|
|
220
|
+
private readonly middleware;
|
|
185
221
|
private readonly options;
|
|
186
222
|
private timer;
|
|
187
223
|
private lastSignature;
|
|
@@ -194,6 +230,11 @@ export declare class ToolRegistry implements ToolSource {
|
|
|
194
230
|
register(provider: AgentToolProvider): () => void;
|
|
195
231
|
/** Removes a provider by id or instance. Returns whether it was registered. */
|
|
196
232
|
unregister(providerOrId: string | AgentToolProvider): boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Adds a middleware that wraps every tool call (first added runs outermost), e.g. agent
|
|
235
|
+
* playback's `playback.middleware`. Returns a function that removes it.
|
|
236
|
+
*/
|
|
237
|
+
use(middleware: ToolMiddleware): () => void;
|
|
197
238
|
/** Registered provider ids in registration order. */
|
|
198
239
|
providerIds(): string[];
|
|
199
240
|
/**
|
|
@@ -222,9 +263,7 @@ export declare class ToolRegistry implements ToolSource {
|
|
|
222
263
|
* `structuredContent.error` (MCP transports may map `unknown_tool` to a
|
|
223
264
|
* JSON-RPC `-32602` error instead).
|
|
224
265
|
*/
|
|
225
|
-
callTool(name: string, args?: Record<string, unknown>, options?:
|
|
226
|
-
signal?: AbortSignal;
|
|
227
|
-
}): Promise<McpToolResult>;
|
|
266
|
+
callTool(name: string, args?: Record<string, unknown>, options?: ToolCallOptions): Promise<McpToolResult>;
|
|
228
267
|
/**
|
|
229
268
|
* Subscribes to tool-list changes. Notifications are coalesced: many
|
|
230
269
|
* registrations or provider signals within the delay window produce one
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { AgentPlayback } from './playback.cjs';
|
|
2
|
+
import type { PresenceActorInfo } from './presence.cjs';
|
|
3
|
+
import type { McpToolResult, ToolSource } from './registry.cjs';
|
|
4
|
+
/** What earlier steps returned, for the arguments of later ones. */
|
|
5
|
+
export interface ToolScriptContext {
|
|
6
|
+
/** Results kept with `as`, by name (a tool's `structuredContent`, or its JSON text). */
|
|
7
|
+
results: Record<string, any>;
|
|
8
|
+
/** The result of the step before. */
|
|
9
|
+
last: any;
|
|
10
|
+
}
|
|
11
|
+
export interface ToolScriptStep {
|
|
12
|
+
/** What the agent tells the user before it acts (the transcript and the cursor's bubble). */
|
|
13
|
+
say?: string;
|
|
14
|
+
/** Tool to call (an exposed registry name such as `sheet__set_range`). */
|
|
15
|
+
tool?: string;
|
|
16
|
+
/** The tool's arguments, or a function of earlier results that returns them. */
|
|
17
|
+
args?: Record<string, unknown> | ((ctx: ToolScriptContext) => Record<string, unknown>);
|
|
18
|
+
/** Keep the result under this name in `ctx.results`. */
|
|
19
|
+
as?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ToolScript {
|
|
22
|
+
id: string;
|
|
23
|
+
/** The user's request, as they would type it. */
|
|
24
|
+
prompt: string;
|
|
25
|
+
steps: ToolScriptStep[];
|
|
26
|
+
}
|
|
27
|
+
export type ToolScriptEvent = {
|
|
28
|
+
type: 'say';
|
|
29
|
+
step: number;
|
|
30
|
+
text: string;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'call';
|
|
33
|
+
step: number;
|
|
34
|
+
tool: string;
|
|
35
|
+
args: Record<string, unknown>;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'result';
|
|
38
|
+
step: number;
|
|
39
|
+
tool: string;
|
|
40
|
+
result: McpToolResult;
|
|
41
|
+
} | {
|
|
42
|
+
type: 'error';
|
|
43
|
+
step: number;
|
|
44
|
+
message: string;
|
|
45
|
+
} | {
|
|
46
|
+
type: 'done';
|
|
47
|
+
ok: boolean;
|
|
48
|
+
stopped: boolean;
|
|
49
|
+
};
|
|
50
|
+
/** Speed and stop for a run in progress (`speed: Infinity` finishes without pauses). */
|
|
51
|
+
export interface ToolScriptControl {
|
|
52
|
+
speed: number;
|
|
53
|
+
stopped: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface RunToolScriptOptions {
|
|
56
|
+
/** Shows each note on the agent's cursor (`playback.say`) and stops its performance on stop. */
|
|
57
|
+
playback?: AgentPlayback | null;
|
|
58
|
+
/** The actor the calls are made as (its own cursor and queue). */
|
|
59
|
+
actor?: PresenceActorInfo;
|
|
60
|
+
onEvent?: (event: ToolScriptEvent) => void;
|
|
61
|
+
control?: ToolScriptControl;
|
|
62
|
+
/** Waits `ms` (already scaled by the speed); real timers by default. */
|
|
63
|
+
wait?: (ms: number) => Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
/** A tool result as a plain value: its `structuredContent`, else its first text block (parsed when JSON). */
|
|
66
|
+
export declare function toolResultValue(result: McpToolResult): any;
|
|
67
|
+
/** The error message of a failed tool result. */
|
|
68
|
+
export declare function toolResultError(result: McpToolResult): string;
|
|
69
|
+
/**
|
|
70
|
+
* Plays `script` against `source` (a `ToolRegistry` or a view of one): each step's note, then its
|
|
71
|
+
* tool call. Stops at the first failure (a tool error or arguments that cannot be built), like an
|
|
72
|
+
* agent that has to rethink, and resolves with the results kept so far.
|
|
73
|
+
*/
|
|
74
|
+
export declare function runToolScript(source: ToolSource, script: ToolScript, options?: RunToolScriptOptions): Promise<{
|
|
75
|
+
ok: boolean;
|
|
76
|
+
ctx: ToolScriptContext;
|
|
77
|
+
}>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { AgentPlayback } from './playback.js';
|
|
2
|
+
import type { PresenceActorInfo } from './presence.js';
|
|
3
|
+
import type { McpToolResult, ToolSource } from './registry.js';
|
|
4
|
+
/** What earlier steps returned, for the arguments of later ones. */
|
|
5
|
+
export interface ToolScriptContext {
|
|
6
|
+
/** Results kept with `as`, by name (a tool's `structuredContent`, or its JSON text). */
|
|
7
|
+
results: Record<string, any>;
|
|
8
|
+
/** The result of the step before. */
|
|
9
|
+
last: any;
|
|
10
|
+
}
|
|
11
|
+
export interface ToolScriptStep {
|
|
12
|
+
/** What the agent tells the user before it acts (the transcript and the cursor's bubble). */
|
|
13
|
+
say?: string;
|
|
14
|
+
/** Tool to call (an exposed registry name such as `sheet__set_range`). */
|
|
15
|
+
tool?: string;
|
|
16
|
+
/** The tool's arguments, or a function of earlier results that returns them. */
|
|
17
|
+
args?: Record<string, unknown> | ((ctx: ToolScriptContext) => Record<string, unknown>);
|
|
18
|
+
/** Keep the result under this name in `ctx.results`. */
|
|
19
|
+
as?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ToolScript {
|
|
22
|
+
id: string;
|
|
23
|
+
/** The user's request, as they would type it. */
|
|
24
|
+
prompt: string;
|
|
25
|
+
steps: ToolScriptStep[];
|
|
26
|
+
}
|
|
27
|
+
export type ToolScriptEvent = {
|
|
28
|
+
type: 'say';
|
|
29
|
+
step: number;
|
|
30
|
+
text: string;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'call';
|
|
33
|
+
step: number;
|
|
34
|
+
tool: string;
|
|
35
|
+
args: Record<string, unknown>;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'result';
|
|
38
|
+
step: number;
|
|
39
|
+
tool: string;
|
|
40
|
+
result: McpToolResult;
|
|
41
|
+
} | {
|
|
42
|
+
type: 'error';
|
|
43
|
+
step: number;
|
|
44
|
+
message: string;
|
|
45
|
+
} | {
|
|
46
|
+
type: 'done';
|
|
47
|
+
ok: boolean;
|
|
48
|
+
stopped: boolean;
|
|
49
|
+
};
|
|
50
|
+
/** Speed and stop for a run in progress (`speed: Infinity` finishes without pauses). */
|
|
51
|
+
export interface ToolScriptControl {
|
|
52
|
+
speed: number;
|
|
53
|
+
stopped: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface RunToolScriptOptions {
|
|
56
|
+
/** Shows each note on the agent's cursor (`playback.say`) and stops its performance on stop. */
|
|
57
|
+
playback?: AgentPlayback | null;
|
|
58
|
+
/** The actor the calls are made as (its own cursor and queue). */
|
|
59
|
+
actor?: PresenceActorInfo;
|
|
60
|
+
onEvent?: (event: ToolScriptEvent) => void;
|
|
61
|
+
control?: ToolScriptControl;
|
|
62
|
+
/** Waits `ms` (already scaled by the speed); real timers by default. */
|
|
63
|
+
wait?: (ms: number) => Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
/** A tool result as a plain value: its `structuredContent`, else its first text block (parsed when JSON). */
|
|
66
|
+
export declare function toolResultValue(result: McpToolResult): any;
|
|
67
|
+
/** The error message of a failed tool result. */
|
|
68
|
+
export declare function toolResultError(result: McpToolResult): string;
|
|
69
|
+
/**
|
|
70
|
+
* Plays `script` against `source` (a `ToolRegistry` or a view of one): each step's note, then its
|
|
71
|
+
* tool call. Stops at the first failure (a tool error or arguments that cannot be built), like an
|
|
72
|
+
* agent that has to rethink, and resolves with the results kept so far.
|
|
73
|
+
*/
|
|
74
|
+
export declare function runToolScript(source: ToolSource, script: ToolScript, options?: RunToolScriptOptions): Promise<{
|
|
75
|
+
ok: boolean;
|
|
76
|
+
ctx: ToolScriptContext;
|
|
77
|
+
}>;
|
package/dist/tools/view.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { McpListToolsResult, McpToolDefinition, McpToolResult, ToolSource, ToolsetInfo } from './registry.cjs';
|
|
1
|
+
import type { McpListToolsResult, McpToolDefinition, McpToolResult, ToolCallOptions, ToolSource, ToolsetInfo } from './registry.cjs';
|
|
2
2
|
import { type SkillFiles } from './skills.cjs';
|
|
3
3
|
export interface ToolDiscoveryOptions {
|
|
4
4
|
/** Toolsets listed from the start (default none: the agent enables what it needs). */
|
|
@@ -76,9 +76,7 @@ export declare class ToolRegistryView implements ToolSource {
|
|
|
76
76
|
listTools(): McpListToolsResult;
|
|
77
77
|
hasTool(name: string): boolean;
|
|
78
78
|
getTool(name: string): McpToolDefinition | undefined;
|
|
79
|
-
callTool(name: string, args?: Record<string, unknown>, options?:
|
|
80
|
-
signal?: AbortSignal;
|
|
81
|
-
}): Promise<McpToolResult>;
|
|
79
|
+
callTool(name: string, args?: Record<string, unknown>, options?: ToolCallOptions): Promise<McpToolResult>;
|
|
82
80
|
onListChanged(listener: (tools: McpToolDefinition[]) => void): () => void;
|
|
83
81
|
/** Stops following the source and drops every listener. */
|
|
84
82
|
dispose(): void;
|
package/dist/tools/view.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { McpListToolsResult, McpToolDefinition, McpToolResult, ToolSource, ToolsetInfo } from './registry.js';
|
|
1
|
+
import type { McpListToolsResult, McpToolDefinition, McpToolResult, ToolCallOptions, ToolSource, ToolsetInfo } from './registry.js';
|
|
2
2
|
import { type SkillFiles } from './skills.js';
|
|
3
3
|
export interface ToolDiscoveryOptions {
|
|
4
4
|
/** Toolsets listed from the start (default none: the agent enables what it needs). */
|
|
@@ -76,9 +76,7 @@ export declare class ToolRegistryView implements ToolSource {
|
|
|
76
76
|
listTools(): McpListToolsResult;
|
|
77
77
|
hasTool(name: string): boolean;
|
|
78
78
|
getTool(name: string): McpToolDefinition | undefined;
|
|
79
|
-
callTool(name: string, args?: Record<string, unknown>, options?:
|
|
80
|
-
signal?: AbortSignal;
|
|
81
|
-
}): Promise<McpToolResult>;
|
|
79
|
+
callTool(name: string, args?: Record<string, unknown>, options?: ToolCallOptions): Promise<McpToolResult>;
|
|
82
80
|
onListChanged(listener: (tools: McpToolDefinition[]) => void): () => void;
|
|
83
81
|
/** Stops following the source and drops every listener. */
|
|
84
82
|
dispose(): void;
|