@nuvin/agent-core 0.0.0-rc.3 → 0.0.0-rc.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/dist/VERSION +2 -2
- package/dist/agent/index.d.ts +27 -525
- package/dist/agent/index.js +1 -1
- package/dist/chunk-G2FR4UGO.js +1 -1
- package/dist/chunk-LXQDGX4K.js +1 -1
- package/dist/chunk-NYZR4XKO.js +1 -1
- package/dist/chunk-VFTQW5WK.js +1 -1
- package/dist/chunk-X7VAACWY.js +1 -1
- package/dist/formats/index.d.ts +23 -319
- package/dist/formats/index.js +1 -1
- package/dist/models/index.d.ts +330 -634
- package/dist/models/index.js +1 -1
- package/dist/shared/index.d.ts +14 -709
- package/dist/shared/index.js +1 -1
- package/dist/tools/index.d.ts +518 -969
- package/dist/tools/index.js +1 -1
- package/package.json +4 -1
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,1021 +1,570 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { b1 as ToolDefinition, au as ToolOutputEnvelope, b2 as AnyToolDefinition, aX as ToolRuntimeEventHandler, aW as ToolRuntimeToolCallHandler, aZ as ToolRuntime, H as JsonObject, V as JsonSchemaObject, W as JsonSchema, bc as AgentDefinitionFactoryContext, A as AgentOptions, a$ as ToolOutputValue, at as ToolResultChunk, _ as ToolResultContent, a_ as InferJsonSchema, az as ToolExecutionContext, aj as ToolSchema, I as JsonValue } from '../types-QPBW5jHO.js';
|
|
2
|
+
import { CommandDefinitionReference, SerializedCommandDefinition, MCPAuthConfig, MCPServerConfig } from '@nuvin/config';
|
|
3
3
|
import { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';
|
|
4
4
|
import { CallToolResult, ListToolsResult } from '@modelcontextprotocol/sdk/types.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
required?: TRequired;
|
|
28
|
-
}
|
|
29
|
-
export type JsonSchema = JsonSchemaArray | JsonSchemaBoolean | JsonSchemaNumber | JsonSchemaObject | JsonSchemaString;
|
|
30
|
-
export interface TextBlock {
|
|
31
|
-
type: "text";
|
|
32
|
-
text: string;
|
|
33
|
-
}
|
|
34
|
-
export type ImageMediaType = "image/gif" | "image/jpeg" | "image/png" | "image/webp";
|
|
35
|
-
export interface ImageBlock {
|
|
36
|
-
type: "image";
|
|
37
|
-
source: {
|
|
38
|
-
type: "base64";
|
|
39
|
-
media_type: ImageMediaType;
|
|
40
|
-
data: string;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
export type ToolResultContentBlock = ImageBlock | TextBlock;
|
|
44
|
-
export type ToolResultContent = string | ToolResultContentBlock[];
|
|
45
|
-
export interface AnthropicThinkingBlock {
|
|
46
|
-
type: "anthropic_thinking";
|
|
47
|
-
thinking: string;
|
|
48
|
-
signature: string;
|
|
49
|
-
}
|
|
50
|
-
export interface AnthropicRedactedThinkingBlock {
|
|
51
|
-
type: "anthropic_redacted_thinking";
|
|
52
|
-
data: string;
|
|
53
|
-
}
|
|
54
|
-
export interface OpenAiReasoningSummaryText {
|
|
55
|
-
type: "summary_text";
|
|
56
|
-
text: string;
|
|
57
|
-
}
|
|
58
|
-
export interface OpenAiReasoningBlock {
|
|
59
|
-
type: "openai_reasoning";
|
|
60
|
-
encryptedContent?: string;
|
|
61
|
-
id?: string;
|
|
62
|
-
summary: OpenAiReasoningSummaryText[];
|
|
63
|
-
text?: string;
|
|
64
|
-
}
|
|
65
|
-
export interface ToolUseBlock {
|
|
66
|
-
type: "tool_use";
|
|
67
|
-
id: string;
|
|
68
|
-
name: string;
|
|
69
|
-
input: JsonValue;
|
|
70
|
-
}
|
|
71
|
-
export interface ToolResultBlock {
|
|
72
|
-
type: "tool_result";
|
|
73
|
-
tool_use_id: string;
|
|
74
|
-
content: ToolResultContent;
|
|
75
|
-
is_error: boolean;
|
|
76
|
-
}
|
|
77
|
-
export interface AnthropicThinkingWireBlock {
|
|
78
|
-
type: "thinking";
|
|
79
|
-
thinking: string;
|
|
80
|
-
signature: string;
|
|
81
|
-
}
|
|
82
|
-
export interface AnthropicRedactedThinkingWireBlock {
|
|
83
|
-
type: "redacted_thinking";
|
|
84
|
-
data: string;
|
|
85
|
-
}
|
|
86
|
-
export type AnthropicAssistantContentBlock = AnthropicRedactedThinkingWireBlock | AnthropicThinkingWireBlock | TextBlock | ToolUseBlock;
|
|
87
|
-
export type ReasoningVisibility = "continuity-only" | "user-visible";
|
|
88
|
-
export type AutoReasoningEffort = "low" | "medium" | "high";
|
|
89
|
-
export interface AutoReasoningConfig {
|
|
90
|
-
effort: AutoReasoningEffort;
|
|
91
|
-
}
|
|
92
|
-
export type AnthropicThinkingDisplay = "omitted" | "summarized";
|
|
93
|
-
export type AnthropicThinkingEffort = "low" | "medium" | "high";
|
|
94
|
-
export interface AnthropicEnabledThinkingConfig {
|
|
95
|
-
type: "enabled";
|
|
96
|
-
budgetTokens: number;
|
|
97
|
-
display?: AnthropicThinkingDisplay;
|
|
98
|
-
interleaved?: boolean;
|
|
99
|
-
}
|
|
100
|
-
export interface AnthropicAdaptiveThinkingConfig {
|
|
101
|
-
type: "adaptive";
|
|
102
|
-
display?: AnthropicThinkingDisplay;
|
|
103
|
-
effort?: AnthropicThinkingEffort;
|
|
104
|
-
interleaved?: boolean;
|
|
105
|
-
}
|
|
106
|
-
export interface AnthropicDisabledThinkingConfig {
|
|
107
|
-
type: "disabled";
|
|
108
|
-
}
|
|
109
|
-
export type AnthropicThinkingConfig = AnthropicAdaptiveThinkingConfig | AnthropicDisabledThinkingConfig | AnthropicEnabledThinkingConfig;
|
|
110
|
-
export type OpenAiReasoningEffort = "high" | "low" | "medium" | "minimal" | "none" | "xhigh";
|
|
111
|
-
export type OpenAiReasoningSummary = "auto" | "concise" | "detailed";
|
|
112
|
-
export interface OpenAiReasoningConfig {
|
|
113
|
-
effort?: OpenAiReasoningEffort;
|
|
114
|
-
includeEncryptedContent?: boolean;
|
|
115
|
-
summary?: OpenAiReasoningSummary;
|
|
116
|
-
}
|
|
117
|
-
export interface ReasoningConfig {
|
|
118
|
-
auto?: AutoReasoningConfig;
|
|
119
|
-
anthropic?: AnthropicThinkingConfig;
|
|
120
|
-
openai?: OpenAiReasoningConfig;
|
|
121
|
-
visibility?: ReasoningVisibility;
|
|
122
|
-
}
|
|
123
|
-
export interface MessageProviderState {
|
|
124
|
-
anthropicAssistantContent?: AnthropicAssistantContentBlock[];
|
|
125
|
-
openaiResponsesOutput?: OpenAiResponsesOutputItem[];
|
|
126
|
-
openaiResponsesResponseId?: string;
|
|
127
|
-
}
|
|
128
|
-
export type AssistantContentBlock = AnthropicRedactedThinkingBlock | AnthropicThinkingBlock | OpenAiReasoningBlock | TextBlock | ToolUseBlock;
|
|
129
|
-
export type ContentBlock = AssistantContentBlock | ToolResultBlock;
|
|
130
|
-
export type ContentInput = ContentBlock[] | string | null | undefined;
|
|
131
|
-
export type MessageRole = "assistant" | "user";
|
|
132
|
-
export interface Message {
|
|
133
|
-
id?: string;
|
|
134
|
-
role: MessageRole;
|
|
135
|
-
content: ContentBlock[];
|
|
136
|
-
providerState?: MessageProviderState;
|
|
137
|
-
}
|
|
138
|
-
export interface IdentifiedMessage extends Message {
|
|
139
|
-
id: string;
|
|
140
|
-
}
|
|
141
|
-
export interface MessageInput {
|
|
142
|
-
id?: string;
|
|
143
|
-
role: MessageRole;
|
|
144
|
-
content?: ContentInput;
|
|
145
|
-
providerState?: MessageProviderState;
|
|
146
|
-
}
|
|
147
|
-
export interface ToolSchema {
|
|
148
|
-
name: string;
|
|
149
|
-
description: string;
|
|
150
|
-
input_schema: JsonSchemaObject;
|
|
151
|
-
}
|
|
152
|
-
export interface ChatRequest {
|
|
153
|
-
model: string;
|
|
154
|
-
maxTokens: number;
|
|
155
|
-
reasoning?: ReasoningConfig;
|
|
156
|
-
system: TextBlock[];
|
|
157
|
-
messages: Message[];
|
|
158
|
-
tools: ToolSchema[];
|
|
159
|
-
metadata: {
|
|
160
|
-
sessionId: string;
|
|
161
|
-
turnId: string;
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
export interface ChatResponse {
|
|
165
|
-
id: string;
|
|
166
|
-
content: AssistantContentBlock[];
|
|
167
|
-
stopReason: "end_turn" | "tool_use";
|
|
168
|
-
usage: {
|
|
169
|
-
inputTokens: number;
|
|
170
|
-
outputTokens: number;
|
|
171
|
-
reasoningTokens?: number;
|
|
172
|
-
};
|
|
173
|
-
providerState?: MessageProviderState;
|
|
174
|
-
}
|
|
175
|
-
export interface ContentDeltaChunk {
|
|
176
|
-
type: "content_delta";
|
|
177
|
-
index?: number;
|
|
178
|
-
text?: string;
|
|
179
|
-
}
|
|
180
|
-
export interface ToolUseDeltaChunk {
|
|
181
|
-
type: "tool_use_delta";
|
|
182
|
-
id: string;
|
|
183
|
-
index: number;
|
|
184
|
-
inputDelta?: string;
|
|
185
|
-
name?: string;
|
|
186
|
-
}
|
|
187
|
-
export interface AnthropicThinkingDeltaChunk {
|
|
188
|
-
type: "anthropic_thinking_delta";
|
|
189
|
-
index: number;
|
|
190
|
-
thinking: string;
|
|
191
|
-
}
|
|
192
|
-
export interface OpenAiReasoningDeltaChunk {
|
|
193
|
-
type: "openai_reasoning_delta";
|
|
194
|
-
contentIndex: number;
|
|
195
|
-
delta: string;
|
|
196
|
-
itemId: string;
|
|
197
|
-
outputIndex: number;
|
|
198
|
-
}
|
|
199
|
-
export interface OpenAiReasoningSummaryDeltaChunk {
|
|
200
|
-
type: "openai_reasoning_summary_delta";
|
|
201
|
-
delta: string;
|
|
202
|
-
itemId: string;
|
|
203
|
-
outputIndex: number;
|
|
204
|
-
summaryIndex: number;
|
|
205
|
-
}
|
|
206
|
-
export interface ChatResponseChunk {
|
|
207
|
-
type: "anthropic_signature_delta" | "anthropic_thinking_delta" | "content_delta" | "done" | "openai_reasoning_delta" | "openai_reasoning_summary_delta" | "tool_use_delta";
|
|
208
|
-
contentIndex?: number;
|
|
209
|
-
delta?: string;
|
|
210
|
-
index?: number;
|
|
211
|
-
itemId?: string;
|
|
212
|
-
outputIndex?: number;
|
|
213
|
-
signature?: string;
|
|
214
|
-
summaryIndex?: number;
|
|
215
|
-
text?: string;
|
|
216
|
-
thinking?: string;
|
|
217
|
-
inputDelta?: string;
|
|
218
|
-
name?: string;
|
|
219
|
-
id?: string;
|
|
220
|
-
response?: ChatResponse;
|
|
221
|
-
}
|
|
222
|
-
export interface ModelLimits {
|
|
223
|
-
contextWindow?: number;
|
|
224
|
-
maxOutput?: number;
|
|
225
|
-
}
|
|
226
|
-
export interface ModelInfo {
|
|
227
|
-
id: string;
|
|
228
|
-
name: string;
|
|
229
|
-
limits?: ModelLimits;
|
|
230
|
-
supportedEndpoints?: string[];
|
|
231
|
-
}
|
|
232
|
-
export interface ToolResultMeta {
|
|
233
|
-
truncated?: boolean;
|
|
234
|
-
originalBytes?: number;
|
|
235
|
-
transforms: string[];
|
|
236
|
-
}
|
|
237
|
-
export interface ToolResultChunk {
|
|
238
|
-
output: string;
|
|
239
|
-
structured: JsonObject;
|
|
240
|
-
content?: ToolResultContent;
|
|
241
|
-
}
|
|
242
|
-
export interface ToolOutputEnvelope {
|
|
243
|
-
output: string;
|
|
244
|
-
structured?: JsonObject;
|
|
245
|
-
content?: ToolResultContent;
|
|
246
|
-
}
|
|
247
|
-
export interface ToolResult {
|
|
248
|
-
callId: string;
|
|
249
|
-
toolName: string;
|
|
250
|
-
status: "error" | "ok";
|
|
251
|
-
output: string;
|
|
252
|
-
structured: JsonObject;
|
|
253
|
-
content?: ToolResultContent;
|
|
254
|
-
chunks: ToolResultChunk[];
|
|
255
|
-
meta: ToolResultMeta;
|
|
256
|
-
}
|
|
257
|
-
export interface TurnState {
|
|
258
|
-
sessionId: string;
|
|
259
|
-
turnId: string;
|
|
260
|
-
system: TextBlock[];
|
|
261
|
-
messages: Message[];
|
|
262
|
-
lastResponse?: ChatResponse;
|
|
263
|
-
toolResults: ToolResult[];
|
|
264
|
-
finalMessage?: IdentifiedMessage;
|
|
265
|
-
}
|
|
266
|
-
export interface ModelExecutionOptions {
|
|
267
|
-
signal?: AbortSignal;
|
|
268
|
-
}
|
|
269
|
-
export interface EngineChatModel {
|
|
270
|
-
model: string;
|
|
271
|
-
maxTokens?: number;
|
|
272
|
-
complete(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
273
|
-
stream?(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
274
|
-
getModels?(signal?: AbortSignal): Promise<ModelInfo[]>;
|
|
275
|
-
}
|
|
276
|
-
export interface AgentEventContext {
|
|
277
|
-
sessionId: string;
|
|
278
|
-
turnId: string;
|
|
279
|
-
state: TurnState;
|
|
280
|
-
}
|
|
281
|
-
export interface ToolExecutionContext extends AgentEventContext {
|
|
282
|
-
signal: AbortSignal;
|
|
283
|
-
toolCallId?: string;
|
|
284
|
-
}
|
|
285
|
-
export interface ToolRuntimeStartedEvent {
|
|
286
|
-
type: "tool_started";
|
|
287
|
-
toolCall: ToolUseBlock;
|
|
288
|
-
}
|
|
289
|
-
export interface ToolRuntimeOutputChunkEvent {
|
|
290
|
-
type: "tool_output_chunk";
|
|
291
|
-
toolCall: ToolUseBlock;
|
|
292
|
-
chunk: ToolResultChunk;
|
|
293
|
-
}
|
|
294
|
-
export interface ToolRuntimeCompletedEvent {
|
|
295
|
-
type: "tool_completed";
|
|
296
|
-
toolCall: ToolUseBlock;
|
|
297
|
-
result: ToolResult;
|
|
298
|
-
}
|
|
299
|
-
export interface ToolRuntimeRejectedEvent {
|
|
300
|
-
type: "tool_rejected";
|
|
301
|
-
toolCall: ToolUseBlock;
|
|
302
|
-
result: ToolResult;
|
|
303
|
-
}
|
|
304
|
-
export type ToolRuntimeEvent = ToolRuntimeOutputChunkEvent | ToolRuntimeCompletedEvent | ToolRuntimeRejectedEvent | ToolRuntimeStartedEvent;
|
|
305
|
-
export interface AgentUserMessageEvent {
|
|
306
|
-
type: "user_message";
|
|
307
|
-
message: Message;
|
|
308
|
-
}
|
|
309
|
-
export interface AgentModelRequestEvent {
|
|
310
|
-
type: "model_request";
|
|
311
|
-
request: ChatRequest;
|
|
312
|
-
}
|
|
313
|
-
export interface AgentModelResponseEvent {
|
|
314
|
-
type: "model_response";
|
|
315
|
-
response: ChatResponse;
|
|
316
|
-
}
|
|
317
|
-
export interface AgentAssistantMessageEvent {
|
|
318
|
-
type: "assistant_message";
|
|
319
|
-
message: IdentifiedMessage;
|
|
320
|
-
}
|
|
321
|
-
export interface AgentAssistantChunkEvent {
|
|
322
|
-
type: "assistant_chunk";
|
|
323
|
-
index: number;
|
|
324
|
-
messageId: string;
|
|
325
|
-
chunk: ContentDeltaChunk;
|
|
326
|
-
}
|
|
327
|
-
export interface AgentToolUseMessageEvent {
|
|
328
|
-
type: "tool_use_message";
|
|
329
|
-
message: IdentifiedMessage;
|
|
330
|
-
}
|
|
331
|
-
export interface AgentToolUseChunkEvent {
|
|
332
|
-
type: "tool_use_chunk";
|
|
333
|
-
index: number;
|
|
334
|
-
messageId: string;
|
|
335
|
-
chunk: ToolUseDeltaChunk;
|
|
336
|
-
}
|
|
337
|
-
export interface AgentReasoningMessageEvent {
|
|
338
|
-
type: "reasoning_message";
|
|
339
|
-
message: IdentifiedMessage;
|
|
340
|
-
}
|
|
341
|
-
export interface AgentReasoningChunkEvent {
|
|
342
|
-
type: "reasoning_chunk";
|
|
343
|
-
index: number;
|
|
344
|
-
messageId: string;
|
|
345
|
-
chunk: AnthropicThinkingDeltaChunk | OpenAiReasoningDeltaChunk | OpenAiReasoningSummaryDeltaChunk;
|
|
346
|
-
text: string;
|
|
347
|
-
}
|
|
348
|
-
export interface AgentToolCallEvent {
|
|
349
|
-
type: "tool_call";
|
|
350
|
-
toolCall: ToolUseBlock;
|
|
351
|
-
}
|
|
352
|
-
export interface AgentToolResultEvent {
|
|
353
|
-
type: "tool_result";
|
|
354
|
-
result: ToolResult;
|
|
355
|
-
}
|
|
356
|
-
export interface AgentToolResultMessageEvent {
|
|
357
|
-
type: "tool_result_message";
|
|
358
|
-
message: Message;
|
|
359
|
-
}
|
|
360
|
-
export interface AgentFinalMessageEvent {
|
|
361
|
-
type: "final_message";
|
|
362
|
-
message: IdentifiedMessage;
|
|
363
|
-
}
|
|
364
|
-
export interface AgentTurnCompleteEvent {
|
|
365
|
-
type: "turn_complete";
|
|
366
|
-
state: TurnState;
|
|
367
|
-
}
|
|
368
|
-
export type AgentLifecycleEvent = AgentAssistantChunkEvent | AgentAssistantMessageEvent | AgentFinalMessageEvent | AgentModelRequestEvent | AgentModelResponseEvent | AgentReasoningChunkEvent | AgentReasoningMessageEvent | AgentToolCallEvent | AgentToolUseChunkEvent | AgentToolUseMessageEvent | AgentToolResultEvent | AgentToolResultMessageEvent | AgentTurnCompleteEvent | AgentUserMessageEvent;
|
|
369
|
-
export type AgentEvent = AgentLifecycleEvent | ToolRuntimeEvent;
|
|
370
|
-
export type ToolRuntimeDispatchDecision = {
|
|
371
|
-
action: "reject";
|
|
372
|
-
reason?: string;
|
|
373
|
-
} | {
|
|
374
|
-
action: "run";
|
|
375
|
-
};
|
|
376
|
-
export type ToolRuntimeToolCallHandler = (toolCall: ToolUseBlock, ctx: ToolExecutionContext) => Promise<ToolRuntimeDispatchDecision | undefined> | ToolRuntimeDispatchDecision | undefined;
|
|
377
|
-
export type ToolRuntimeEventHandler = (event: ToolRuntimeEvent, ctx: ToolExecutionContext) => Promise<void> | void;
|
|
378
|
-
export type AgentEventHandler = (event: AgentEvent, ctx: AgentEventContext) => Promise<void> | void;
|
|
379
|
-
export interface ToolRuntime {
|
|
380
|
-
listToolSchemas(): ToolSchema[];
|
|
381
|
-
setTools(tools: AnyToolDefinition[]): void;
|
|
382
|
-
executeCalls(toolCalls: ToolUseBlock[], ctx: ToolExecutionContext): Promise<ToolResult[]>;
|
|
383
|
-
execute(toolCall: ToolUseBlock, ctx: ToolExecutionContext): Promise<ToolResult>;
|
|
384
|
-
}
|
|
385
|
-
export type InferJsonSchema<TSchema extends JsonSchema> = TSchema extends JsonSchemaString ? string : TSchema extends JsonSchemaNumber ? number : TSchema extends JsonSchemaBoolean ? boolean : TSchema extends JsonSchemaArray<infer TItem> ? InferJsonSchema<TItem>[] : TSchema extends JsonSchemaObject<infer TProperties, infer TRequired> ? Expand<RequiredProperties<TProperties, TRequired> & OptionalProperties<TProperties, TRequired>> : never;
|
|
386
|
-
export type Expand<TValue> = TValue extends infer TObject ? {
|
|
387
|
-
[TKey in keyof TObject]: TObject[TKey];
|
|
388
|
-
} : never;
|
|
389
|
-
export type RequiredKeyUnion<TRequired extends readonly string[] | undefined> = TRequired extends readonly string[] ? TRequired[number] : never;
|
|
390
|
-
export type OptionalKeyUnion<TProperties extends Record<string, JsonSchema>, TRequired extends readonly string[] | undefined> = Exclude<keyof TProperties, RequiredKeyUnion<TRequired>>;
|
|
391
|
-
export type RequiredProperties<TProperties extends Record<string, JsonSchema>, TRequired extends readonly string[] | undefined> = {
|
|
392
|
-
[TKey in Extract<keyof TProperties, RequiredKeyUnion<TRequired>>]: InferJsonSchema<TProperties[TKey]>;
|
|
393
|
-
};
|
|
394
|
-
export type OptionalProperties<TProperties extends Record<string, JsonSchema>, TRequired extends readonly string[] | undefined> = {
|
|
395
|
-
[TKey in OptionalKeyUnion<TProperties, TRequired>]?: InferJsonSchema<TProperties[TKey]>;
|
|
396
|
-
};
|
|
397
|
-
export type ToolOutputValue = JsonValue | ToolOutputEnvelope;
|
|
398
|
-
export type ToolGenerator<TYield extends ToolOutputValue = ToolOutputValue, TReturn extends ToolOutputValue | undefined = ToolOutputValue | undefined> = AsyncGenerator<TYield, TReturn, void>;
|
|
399
|
-
export interface ToolDefinition<TInput extends JsonObject = JsonObject, TYield extends ToolOutputValue = ToolOutputValue, TReturn extends ToolOutputValue | undefined = ToolOutputValue | undefined, TSchema extends JsonSchemaObject = JsonSchemaObject> {
|
|
400
|
-
name: string;
|
|
401
|
-
description: string;
|
|
402
|
-
inputSchema: TSchema;
|
|
403
|
-
execute(input: TInput, ctx: ToolExecutionContext): ToolGenerator<TYield, TReturn>;
|
|
404
|
-
}
|
|
405
|
-
export type AnyToolDefinition = ToolDefinition<JsonObject, ToolOutputValue, ToolOutputValue | undefined, JsonSchemaObject>;
|
|
406
|
-
export type Stage = "afterModelResponse" | "afterToolResult" | "afterTurnComplete" | "beforeAssistantAppend" | "beforeFinalOutput" | "beforeModelRequest" | "beforeToolExecution" | "beforeToolResultAppend" | "onUserMessage";
|
|
407
|
-
export interface PayloadByStage {
|
|
408
|
-
onUserMessage: Message;
|
|
409
|
-
beforeModelRequest: ChatRequest;
|
|
410
|
-
afterModelResponse: ChatResponse;
|
|
411
|
-
beforeToolExecution: ToolUseBlock;
|
|
412
|
-
afterToolResult: ToolResult;
|
|
413
|
-
beforeAssistantAppend: Message;
|
|
414
|
-
beforeFinalOutput: Message;
|
|
415
|
-
beforeToolResultAppend: Message;
|
|
416
|
-
afterTurnComplete: TurnState;
|
|
417
|
-
}
|
|
418
|
-
export interface ExtensionContext {
|
|
419
|
-
state: TurnState;
|
|
420
|
-
}
|
|
421
|
-
type Transformer$1<S extends Stage> = (payload: PayloadByStage[S], ctx: ExtensionContext) => PayloadByStage[S] | Promise<PayloadByStage[S]>;
|
|
422
|
-
export type Observer<S extends Stage> = (payload: PayloadByStage[S], ctx: ExtensionContext) => Promise<void> | void;
|
|
423
|
-
export interface TransformerExtensionRegistration<S extends Stage = Stage> {
|
|
424
|
-
id: string;
|
|
425
|
-
stage: S;
|
|
426
|
-
kind: "transformer";
|
|
427
|
-
order: number;
|
|
428
|
-
enabled: boolean;
|
|
429
|
-
run: Transformer$1<S>;
|
|
430
|
-
}
|
|
431
|
-
export interface ObserverExtensionRegistration<S extends Stage = Stage> {
|
|
432
|
-
id: string;
|
|
433
|
-
stage: S;
|
|
434
|
-
kind: "observer";
|
|
435
|
-
order: number;
|
|
436
|
-
enabled: boolean;
|
|
437
|
-
run: Observer<S>;
|
|
438
|
-
}
|
|
439
|
-
export type ExtensionRegistration<S extends Stage = Stage> = ObserverExtensionRegistration<S> | TransformerExtensionRegistration<S>;
|
|
440
|
-
export type AnyExtensionRegistration = {
|
|
441
|
-
[S in Stage]: ExtensionRegistration<S>;
|
|
442
|
-
}[Stage];
|
|
443
|
-
export interface ExtensionRegistry {
|
|
444
|
-
register(extension: AnyExtensionRegistration): void;
|
|
445
|
-
runTransformers<S extends Stage>(stage: S, payload: PayloadByStage[S], ctx: ExtensionContext): Promise<PayloadByStage[S]>;
|
|
446
|
-
runObservers<S extends Stage>(stage: S, payload: PayloadByStage[S], ctx: ExtensionContext): Promise<void>;
|
|
447
|
-
}
|
|
448
|
-
export type AgentInput = MessageInput | string;
|
|
449
|
-
export interface AgentOptions {
|
|
450
|
-
sessionId?: string;
|
|
451
|
-
systemPrompt?: string;
|
|
452
|
-
messages?: MessageInput[];
|
|
453
|
-
message?: AgentInput;
|
|
454
|
-
onEvent?: AgentEventHandler;
|
|
455
|
-
onToolCall?: ToolRuntimeToolCallHandler;
|
|
456
|
-
registry?: ExtensionRegistry;
|
|
457
|
-
extensions?: AnyExtensionRegistration[];
|
|
458
|
-
chatModel?: EngineChatModel;
|
|
459
|
-
tools?: AnyToolDefinition[];
|
|
460
|
-
}
|
|
461
|
-
export interface AgentDefinitionFactoryContext {
|
|
462
|
-
agentId: string;
|
|
463
|
-
parentSessionId?: string;
|
|
464
|
-
runId?: string;
|
|
465
|
-
toolCallId?: string;
|
|
466
|
-
}
|
|
467
|
-
export interface OpenAiFunctionCall {
|
|
468
|
-
type: "function_call";
|
|
469
|
-
call_id: string;
|
|
470
|
-
name: string;
|
|
471
|
-
arguments: string;
|
|
472
|
-
}
|
|
473
|
-
export interface OpenAiOutputTextPart {
|
|
474
|
-
type: "output_text";
|
|
475
|
-
text: string;
|
|
476
|
-
}
|
|
477
|
-
export interface OpenAiRefusalPart {
|
|
478
|
-
type: "refusal";
|
|
479
|
-
refusal: string;
|
|
480
|
-
}
|
|
481
|
-
export interface OpenAiOutputMessage {
|
|
482
|
-
type: "message";
|
|
483
|
-
content?: Array<OpenAiOutputTextPart | OpenAiRefusalPart>;
|
|
484
|
-
role?: string;
|
|
485
|
-
status?: string;
|
|
486
|
-
}
|
|
487
|
-
export interface OpenAiReasoningOutputItem {
|
|
488
|
-
type: "reasoning";
|
|
489
|
-
content?: Array<{
|
|
490
|
-
text?: string;
|
|
491
|
-
type?: string;
|
|
492
|
-
}>;
|
|
493
|
-
encrypted_content?: string;
|
|
494
|
-
id?: string;
|
|
495
|
-
status?: string;
|
|
496
|
-
summary?: OpenAiReasoningSummaryText[];
|
|
497
|
-
text?: string;
|
|
498
|
-
}
|
|
499
|
-
export type OpenAiResponsesOutputItem = JsonObject | OpenAiFunctionCall | OpenAiOutputMessage | OpenAiReasoningOutputItem;
|
|
500
|
-
export interface BashToolInput {
|
|
501
|
-
command: string;
|
|
502
|
-
cwd?: string;
|
|
503
|
-
timeoutMs?: number;
|
|
504
|
-
ignoreOutput?: boolean;
|
|
505
|
-
}
|
|
506
|
-
export interface BashToolOptions {
|
|
507
|
-
defaultCwd?: string;
|
|
508
|
-
defaultTimeoutMs?: number;
|
|
509
|
-
description?: string;
|
|
510
|
-
env?: NodeJS.ProcessEnv;
|
|
511
|
-
name?: string;
|
|
512
|
-
shellPath?: string;
|
|
513
|
-
stripAnsi?: boolean;
|
|
514
|
-
}
|
|
515
|
-
export declare function createBashTool(options?: BashToolOptions): ToolDefinition<{
|
|
516
|
-
command: string;
|
|
517
|
-
cwd?: string | undefined;
|
|
518
|
-
timeoutMs?: number | undefined;
|
|
519
|
-
ignoreOutput?: boolean | undefined;
|
|
6
|
+
interface BashToolInput {
|
|
7
|
+
command: string;
|
|
8
|
+
cwd?: string;
|
|
9
|
+
timeoutMs?: number;
|
|
10
|
+
ignoreOutput?: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface BashToolOptions {
|
|
13
|
+
allowedDirs?: readonly string[];
|
|
14
|
+
defaultCwd?: string;
|
|
15
|
+
defaultTimeoutMs?: number;
|
|
16
|
+
description?: string;
|
|
17
|
+
env?: NodeJS.ProcessEnv;
|
|
18
|
+
name?: string;
|
|
19
|
+
shellPath?: string;
|
|
20
|
+
stripAnsi?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare function createBashTool(options?: BashToolOptions): ToolDefinition<{
|
|
23
|
+
command: string;
|
|
24
|
+
cwd?: string | undefined;
|
|
25
|
+
timeoutMs?: number | undefined;
|
|
26
|
+
ignoreOutput?: boolean | undefined;
|
|
520
27
|
}, string, ToolOutputEnvelope, {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
"command"
|
|
538
|
-
];
|
|
28
|
+
type: "object";
|
|
29
|
+
properties: {
|
|
30
|
+
command: {
|
|
31
|
+
type: "string";
|
|
32
|
+
};
|
|
33
|
+
cwd: {
|
|
34
|
+
type: "string";
|
|
35
|
+
};
|
|
36
|
+
timeoutMs: {
|
|
37
|
+
type: "number";
|
|
38
|
+
};
|
|
39
|
+
ignoreOutput: {
|
|
40
|
+
type: "boolean";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
required: readonly ["command"];
|
|
539
44
|
}>;
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
45
|
+
declare function createShellExecTool(options?: BashToolOptions): ToolDefinition<{
|
|
46
|
+
command: string;
|
|
47
|
+
cwd?: string | undefined;
|
|
48
|
+
timeoutMs?: number | undefined;
|
|
49
|
+
ignoreOutput?: boolean | undefined;
|
|
545
50
|
}, string, ToolOutputEnvelope, {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
"command"
|
|
563
|
-
];
|
|
51
|
+
type: "object";
|
|
52
|
+
properties: {
|
|
53
|
+
command: {
|
|
54
|
+
type: "string";
|
|
55
|
+
};
|
|
56
|
+
cwd: {
|
|
57
|
+
type: "string";
|
|
58
|
+
};
|
|
59
|
+
timeoutMs: {
|
|
60
|
+
type: "number";
|
|
61
|
+
};
|
|
62
|
+
ignoreOutput: {
|
|
63
|
+
type: "boolean";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
required: readonly ["command"];
|
|
564
67
|
}>;
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
oauth?: MCPOAuthConfig;
|
|
576
|
-
}
|
|
577
|
-
export interface MCPServerConfig {
|
|
578
|
-
command?: string;
|
|
579
|
-
args?: string[];
|
|
580
|
-
env?: Record<string, string>;
|
|
581
|
-
transport?: "stdio" | "http";
|
|
582
|
-
url?: string;
|
|
583
|
-
headers?: Record<string, string>;
|
|
584
|
-
prefix?: string;
|
|
585
|
-
timeoutMs?: number;
|
|
586
|
-
enabled?: boolean;
|
|
587
|
-
auth?: MCPAuthConfig;
|
|
588
|
-
}
|
|
589
|
-
export interface CommandDefinitionSource {
|
|
590
|
-
scope: AgentDefinitionSourceScope;
|
|
591
|
-
path: string;
|
|
592
|
-
directory?: string;
|
|
593
|
-
kind?: "custom" | "default";
|
|
594
|
-
}
|
|
595
|
-
export interface CommandDefinitionReference {
|
|
596
|
-
id: string;
|
|
597
|
-
name: string;
|
|
598
|
-
description: string;
|
|
599
|
-
argumentHint?: string;
|
|
600
|
-
arguments?: string[];
|
|
601
|
-
source: CommandDefinitionSource;
|
|
602
|
-
}
|
|
603
|
-
export interface SerializedCommandDefinition extends CommandDefinitionReference {
|
|
604
|
-
instructions: string;
|
|
605
|
-
}
|
|
606
|
-
export type AgentDefinitionSourceScope = "builtin" | "direct" | "env" | "explicit" | "global" | "local" | "profile";
|
|
607
|
-
export type CommandReference = CommandDefinitionReference;
|
|
608
|
-
export type LoadedCommand = SerializedCommandDefinition;
|
|
609
|
-
export interface CommandToolOptions<TRef extends CommandReference = CommandReference> {
|
|
610
|
-
commands: TRef[];
|
|
611
|
-
loadCommand: (reference: TRef) => Promise<LoadedCommand>;
|
|
612
|
-
}
|
|
613
|
-
export declare function createInvokeCommandTool<TRef extends CommandReference>(options: CommandToolOptions<TRef>): ToolDefinition<{
|
|
614
|
-
name: string;
|
|
615
|
-
args?: string | undefined;
|
|
68
|
+
|
|
69
|
+
type CommandReference = CommandDefinitionReference;
|
|
70
|
+
type LoadedCommand = SerializedCommandDefinition;
|
|
71
|
+
interface CommandToolOptions<TRef extends CommandReference = CommandReference> {
|
|
72
|
+
commands: TRef[];
|
|
73
|
+
loadCommand: (reference: TRef) => Promise<LoadedCommand>;
|
|
74
|
+
}
|
|
75
|
+
declare function createInvokeCommandTool<TRef extends CommandReference>(options: CommandToolOptions<TRef>): ToolDefinition<{
|
|
76
|
+
name: string;
|
|
77
|
+
args?: string | undefined;
|
|
616
78
|
}, ToolOutputEnvelope, undefined, {
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
"name"
|
|
628
|
-
];
|
|
79
|
+
type: "object";
|
|
80
|
+
properties: {
|
|
81
|
+
name: {
|
|
82
|
+
type: "string";
|
|
83
|
+
};
|
|
84
|
+
args: {
|
|
85
|
+
type: "string";
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
required: readonly ["name"];
|
|
629
89
|
}>;
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
90
|
+
|
|
91
|
+
interface FileEditToolOptions {
|
|
92
|
+
allowedDirs?: readonly string[];
|
|
93
|
+
defaultCwd?: string;
|
|
94
|
+
name?: string;
|
|
95
|
+
}
|
|
96
|
+
declare function createFileEditTool(options?: FileEditToolOptions): ToolDefinition<{
|
|
97
|
+
filePath: string;
|
|
98
|
+
oldText: string;
|
|
99
|
+
newText: string;
|
|
100
|
+
dryRun?: boolean | undefined;
|
|
639
101
|
}, ToolOutputEnvelope, undefined, {
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
"filePath",
|
|
657
|
-
"oldText",
|
|
658
|
-
"newText"
|
|
659
|
-
];
|
|
102
|
+
type: "object";
|
|
103
|
+
properties: {
|
|
104
|
+
filePath: {
|
|
105
|
+
type: "string";
|
|
106
|
+
};
|
|
107
|
+
oldText: {
|
|
108
|
+
type: "string";
|
|
109
|
+
};
|
|
110
|
+
newText: {
|
|
111
|
+
type: "string";
|
|
112
|
+
};
|
|
113
|
+
dryRun: {
|
|
114
|
+
type: "boolean";
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
required: readonly ["filePath", "oldText", "newText"];
|
|
660
118
|
}>;
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
119
|
+
|
|
120
|
+
interface FileNewToolOptions {
|
|
121
|
+
allowedDirs?: readonly string[];
|
|
122
|
+
defaultCwd?: string;
|
|
123
|
+
name?: string;
|
|
124
|
+
}
|
|
125
|
+
declare function createFileNewTool(options?: FileNewToolOptions): ToolDefinition<{
|
|
126
|
+
content: string;
|
|
127
|
+
filePath: string;
|
|
668
128
|
}, ToolOutputEnvelope, undefined, {
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
"filePath",
|
|
680
|
-
"content"
|
|
681
|
-
];
|
|
129
|
+
type: "object";
|
|
130
|
+
properties: {
|
|
131
|
+
filePath: {
|
|
132
|
+
type: "string";
|
|
133
|
+
};
|
|
134
|
+
content: {
|
|
135
|
+
type: "string";
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
required: readonly ["filePath", "content"];
|
|
682
139
|
}>;
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
140
|
+
|
|
141
|
+
interface FileReadToolOptions {
|
|
142
|
+
allowedDirs?: readonly string[];
|
|
143
|
+
defaultCwd?: string;
|
|
144
|
+
name?: string;
|
|
145
|
+
}
|
|
146
|
+
declare function createFileReadTool(options?: FileReadToolOptions): ToolDefinition<{
|
|
147
|
+
path: string;
|
|
148
|
+
lineStart?: number | undefined;
|
|
149
|
+
lineEnd?: number | undefined;
|
|
691
150
|
}, ToolOutputEnvelope, undefined, {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
"path"
|
|
706
|
-
];
|
|
151
|
+
type: "object";
|
|
152
|
+
properties: {
|
|
153
|
+
path: {
|
|
154
|
+
type: "string";
|
|
155
|
+
};
|
|
156
|
+
lineStart: {
|
|
157
|
+
type: "number";
|
|
158
|
+
};
|
|
159
|
+
lineEnd: {
|
|
160
|
+
type: "number";
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
required: readonly ["path"];
|
|
707
164
|
}>;
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
165
|
+
|
|
166
|
+
interface GlobToolOptions {
|
|
167
|
+
allowedDirs?: readonly string[];
|
|
168
|
+
defaultCwd?: string;
|
|
169
|
+
limit?: number;
|
|
170
|
+
name?: string;
|
|
171
|
+
}
|
|
172
|
+
declare function createGlobTool(options?: GlobToolOptions): ToolDefinition<{
|
|
173
|
+
pattern: string;
|
|
174
|
+
path?: string | undefined;
|
|
175
|
+
limit?: number | undefined;
|
|
717
176
|
}, ToolOutputEnvelope, undefined, {
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
"pattern"
|
|
732
|
-
];
|
|
177
|
+
type: "object";
|
|
178
|
+
properties: {
|
|
179
|
+
pattern: {
|
|
180
|
+
type: "string";
|
|
181
|
+
};
|
|
182
|
+
path: {
|
|
183
|
+
type: "string";
|
|
184
|
+
};
|
|
185
|
+
limit: {
|
|
186
|
+
type: "number";
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
required: readonly ["pattern"];
|
|
733
190
|
}>;
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
191
|
+
|
|
192
|
+
interface GrepToolOptions {
|
|
193
|
+
allowedDirs?: readonly string[];
|
|
194
|
+
defaultCwd?: string;
|
|
195
|
+
limit?: number;
|
|
196
|
+
name?: string;
|
|
197
|
+
}
|
|
198
|
+
declare function createGrepTool(options?: GrepToolOptions): ToolDefinition<{
|
|
199
|
+
pattern: string;
|
|
200
|
+
path?: string | undefined;
|
|
201
|
+
limit?: number | undefined;
|
|
202
|
+
include?: string | undefined;
|
|
203
|
+
context?: number | undefined;
|
|
745
204
|
}, ToolOutputEnvelope, undefined, {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
"pattern"
|
|
766
|
-
];
|
|
205
|
+
type: "object";
|
|
206
|
+
properties: {
|
|
207
|
+
pattern: {
|
|
208
|
+
type: "string";
|
|
209
|
+
};
|
|
210
|
+
path: {
|
|
211
|
+
type: "string";
|
|
212
|
+
};
|
|
213
|
+
include: {
|
|
214
|
+
type: "string";
|
|
215
|
+
};
|
|
216
|
+
limit: {
|
|
217
|
+
type: "number";
|
|
218
|
+
};
|
|
219
|
+
context: {
|
|
220
|
+
type: "number";
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
required: readonly ["pattern"];
|
|
767
224
|
}>;
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
export declare function createInternalToolRuntime(tools?: AnyToolDefinition[], options?: InternalToolRuntimeOptions): ToolRuntime;
|
|
773
|
-
export interface LsToolOptions {
|
|
774
|
-
defaultCwd?: string;
|
|
775
|
-
name?: string;
|
|
225
|
+
|
|
226
|
+
interface InternalToolRuntimeOptions {
|
|
227
|
+
onEvent?: ToolRuntimeEventHandler;
|
|
228
|
+
onToolCall?: ToolRuntimeToolCallHandler;
|
|
776
229
|
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
230
|
+
declare function createInternalToolRuntime(tools?: AnyToolDefinition[], options?: InternalToolRuntimeOptions): ToolRuntime;
|
|
231
|
+
|
|
232
|
+
interface LsToolOptions {
|
|
233
|
+
allowedDirs?: readonly string[];
|
|
234
|
+
defaultCwd?: string;
|
|
235
|
+
name?: string;
|
|
236
|
+
}
|
|
237
|
+
declare function createLsTool(options?: LsToolOptions): ToolDefinition<{
|
|
238
|
+
path: string;
|
|
239
|
+
limit: number;
|
|
780
240
|
}, ToolOutputEnvelope, undefined, {
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
241
|
+
type: "object";
|
|
242
|
+
properties: {
|
|
243
|
+
path: {
|
|
244
|
+
type: "string";
|
|
245
|
+
};
|
|
246
|
+
limit: {
|
|
247
|
+
type: "number";
|
|
248
|
+
};
|
|
249
|
+
};
|
|
790
250
|
}>;
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
251
|
+
|
|
252
|
+
interface McpOAuthProviderOptions {
|
|
253
|
+
serverName: string;
|
|
254
|
+
callbackUrl: string;
|
|
255
|
+
storageDir: string;
|
|
256
|
+
config: MCPAuthConfig;
|
|
257
|
+
onRedirect(url: URL): void | Promise<void>;
|
|
258
|
+
}
|
|
259
|
+
declare function createMcpOAuthProvider(options: McpOAuthProviderOptions): OAuthClientProvider;
|
|
260
|
+
|
|
261
|
+
interface McpToolDescriptor {
|
|
262
|
+
name: string;
|
|
263
|
+
description?: string;
|
|
264
|
+
inputSchema?: unknown;
|
|
265
|
+
}
|
|
266
|
+
interface McpToolClient {
|
|
267
|
+
callTool(input: {
|
|
268
|
+
name: string;
|
|
269
|
+
arguments?: JsonObject;
|
|
270
|
+
}): Promise<CallToolResult>;
|
|
271
|
+
}
|
|
272
|
+
declare function createMcpToolName(serverName: string, toolName: string): string;
|
|
273
|
+
declare function toNuvinToolSchema(inputSchema: unknown): JsonSchemaObject;
|
|
274
|
+
declare function createMcpTool(options: {
|
|
275
|
+
serverName: string;
|
|
276
|
+
tool: McpToolDescriptor;
|
|
277
|
+
client: McpToolClient;
|
|
816
278
|
}): ToolDefinition<{
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
279
|
+
[x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
280
|
+
[x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any;
|
|
281
|
+
})[] | {
|
|
282
|
+
[x: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any;
|
|
283
|
+
})[] | {
|
|
284
|
+
[x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
|
|
285
|
+
})[] | {
|
|
286
|
+
[x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
|
|
287
|
+
})[] | {
|
|
288
|
+
[x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
|
|
289
|
+
})[] | {
|
|
290
|
+
[x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
|
|
291
|
+
})[] | {
|
|
292
|
+
[x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
|
|
293
|
+
})[] | {
|
|
294
|
+
[x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
|
|
295
|
+
})[] | {
|
|
296
|
+
[x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
|
|
297
|
+
})[] | {
|
|
298
|
+
[x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
|
|
299
|
+
})[] | {
|
|
300
|
+
[x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
|
|
301
|
+
})[] | {
|
|
302
|
+
[x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
|
|
303
|
+
};
|
|
842
304
|
}, ToolOutputEnvelope, undefined, JsonSchemaObject<Record<string, JsonSchema>, readonly string[] | undefined>>;
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
305
|
+
|
|
306
|
+
interface ConnectedMcpClient extends McpToolClient {
|
|
307
|
+
listTools(): Promise<ListToolsResult>;
|
|
308
|
+
close(): Promise<void>;
|
|
846
309
|
}
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
310
|
+
type McpServerConnectionStatus = {
|
|
311
|
+
status: "connected";
|
|
312
|
+
toolCount: number;
|
|
850
313
|
} | {
|
|
851
|
-
|
|
314
|
+
status: "disabled";
|
|
852
315
|
} | {
|
|
853
|
-
|
|
854
|
-
|
|
316
|
+
status: "authRequired";
|
|
317
|
+
message: string;
|
|
855
318
|
} | {
|
|
856
|
-
|
|
857
|
-
|
|
319
|
+
status: "error";
|
|
320
|
+
message: string;
|
|
858
321
|
};
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
322
|
+
interface McpToolBundle {
|
|
323
|
+
tools: AnyToolDefinition[];
|
|
324
|
+
servers: Record<string, McpServerConnectionStatus>;
|
|
325
|
+
close(): Promise<void>;
|
|
326
|
+
}
|
|
327
|
+
interface McpConnectionOptions {
|
|
328
|
+
oauth?: {
|
|
329
|
+
storageDir: string;
|
|
330
|
+
callbackUrl: string;
|
|
331
|
+
onRedirect(serverName: string, url: URL): void | Promise<void>;
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
type McpConnector = (serverName: string, config: MCPServerConfig, options?: McpConnectionOptions) => Promise<ConnectedMcpClient>;
|
|
335
|
+
declare function buildMcpHttpHeaders(config: MCPServerConfig): Record<string, string> | undefined;
|
|
336
|
+
declare function connectMcpServer(serverName: string, config: MCPServerConfig, options?: McpConnectionOptions): Promise<ConnectedMcpClient>;
|
|
337
|
+
declare function createMcpToolsFromServers(options: {
|
|
338
|
+
servers?: Record<string, MCPServerConfig>;
|
|
339
|
+
allowedTools?: Record<string, Record<string, boolean>>;
|
|
340
|
+
connection?: McpConnectionOptions;
|
|
341
|
+
connect?: McpConnector;
|
|
879
342
|
}): Promise<McpToolBundle>;
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
343
|
+
|
|
344
|
+
declare function createMockToolRuntime(): ToolRuntime;
|
|
345
|
+
|
|
346
|
+
type RipgrepMatch = {
|
|
347
|
+
filePath: string;
|
|
348
|
+
isContext?: boolean;
|
|
349
|
+
lineNum: number;
|
|
350
|
+
lineText: string;
|
|
886
351
|
};
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
352
|
+
declare function filepath(): Promise<string>;
|
|
353
|
+
declare function files(opts: {
|
|
354
|
+
cwd: string;
|
|
355
|
+
glob?: string[];
|
|
891
356
|
}): AsyncGenerator<string>;
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
357
|
+
declare function search(opts: {
|
|
358
|
+
context?: number;
|
|
359
|
+
cwd: string;
|
|
360
|
+
file?: string;
|
|
361
|
+
glob?: string;
|
|
362
|
+
limit?: number;
|
|
363
|
+
pattern: string;
|
|
899
364
|
}): Promise<RipgrepMatch[]>;
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
365
|
+
|
|
366
|
+
interface DelegatedAgentFactoryContext extends AgentDefinitionFactoryContext {
|
|
367
|
+
parentSessionId: string;
|
|
368
|
+
runId: string;
|
|
903
369
|
}
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
370
|
+
type DelegatedAgentDefinition = AgentOptions | ((ctx: DelegatedAgentFactoryContext) => AgentOptions | Promise<AgentOptions>);
|
|
371
|
+
interface CreateDelegationToolsOptions {
|
|
372
|
+
agents?: Record<string, DelegatedAgentDefinition>;
|
|
907
373
|
}
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
374
|
+
declare function createAssignTaskTool(options: CreateDelegationToolsOptions): ToolDefinition<{
|
|
375
|
+
task: string;
|
|
376
|
+
agentId: string;
|
|
911
377
|
}, ToolOutputEnvelope, ToolOutputEnvelope, {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
378
|
+
type: "object";
|
|
379
|
+
properties: {
|
|
380
|
+
agentId: {
|
|
381
|
+
type: "string";
|
|
382
|
+
};
|
|
383
|
+
task: {
|
|
384
|
+
type: "string";
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
required: string[];
|
|
922
388
|
}>;
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
389
|
+
declare const createDelegateToAgentTool: typeof createAssignTaskTool;
|
|
390
|
+
declare function createDelegationTools(options: CreateDelegationToolsOptions): ToolDefinition<{
|
|
391
|
+
task: string;
|
|
392
|
+
agentId: string;
|
|
927
393
|
}, ToolOutputEnvelope, ToolOutputEnvelope, {
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
394
|
+
type: "object";
|
|
395
|
+
properties: {
|
|
396
|
+
agentId: {
|
|
397
|
+
type: "string";
|
|
398
|
+
};
|
|
399
|
+
task: {
|
|
400
|
+
type: "string";
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
required: string[];
|
|
938
404
|
}>[];
|
|
405
|
+
|
|
939
406
|
/** Minimal shape of a skill source reference — matches @nuvin/config SkillDefinitionSource */
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
407
|
+
interface SkillSource {
|
|
408
|
+
path: string;
|
|
409
|
+
directory?: string;
|
|
410
|
+
scope?: string;
|
|
944
411
|
}
|
|
945
412
|
/** Minimal shape of a skill reference — matches @nuvin/config SkillDefinitionReference */
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
413
|
+
interface SkillReference {
|
|
414
|
+
id: string;
|
|
415
|
+
name: string;
|
|
416
|
+
description: string;
|
|
417
|
+
source: SkillSource;
|
|
951
418
|
}
|
|
952
419
|
/** Minimal shape of a loaded skill — matches @nuvin/config SerializedSkillDefinition */
|
|
953
|
-
|
|
954
|
-
|
|
420
|
+
interface LoadedSkill extends SkillReference {
|
|
421
|
+
instructions: string;
|
|
955
422
|
}
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
423
|
+
interface SkillToolOptions<TRef extends SkillReference = SkillReference> {
|
|
424
|
+
skills: TRef[];
|
|
425
|
+
loadSkill: (reference: TRef) => Promise<LoadedSkill>;
|
|
959
426
|
}
|
|
960
|
-
|
|
961
|
-
|
|
427
|
+
declare function createLoadSkillTool<TRef extends SkillReference>(options: SkillToolOptions<TRef>): ToolDefinition<{
|
|
428
|
+
name: string;
|
|
962
429
|
}, ToolOutputEnvelope, undefined, {
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
"name"
|
|
971
|
-
];
|
|
430
|
+
type: "object";
|
|
431
|
+
properties: {
|
|
432
|
+
name: {
|
|
433
|
+
type: "string";
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
required: readonly ["name"];
|
|
972
437
|
}>;
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
438
|
+
|
|
439
|
+
declare function normalizeToolOutputValue(output: ToolOutputValue): ToolResultChunk;
|
|
440
|
+
declare function createToolOutput(output: string, structured?: JsonObject, content?: ToolResultContent): ToolOutputEnvelope;
|
|
441
|
+
declare class ToolExecutionError extends Error {
|
|
442
|
+
readonly structured: JsonObject;
|
|
443
|
+
constructor(message: string, structured?: JsonObject);
|
|
444
|
+
}
|
|
445
|
+
declare function defineTool<TSchema extends JsonSchemaObject, TYield extends ToolOutputValue = ToolOutputValue, TReturn extends ToolOutputValue | undefined = ToolOutputValue | undefined>(definition: {
|
|
446
|
+
name: string;
|
|
447
|
+
description: string;
|
|
448
|
+
inputSchema: TSchema;
|
|
449
|
+
execute(input: InferJsonSchema<TSchema>, ctx: ToolExecutionContext): AsyncGenerator<TYield, TReturn, void>;
|
|
984
450
|
}): ToolDefinition<InferJsonSchema<TSchema>, TYield, TReturn, TSchema>;
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
451
|
+
declare class ToolRegistry {
|
|
452
|
+
private readonly toolsByName;
|
|
453
|
+
constructor(tools?: AnyToolDefinition[]);
|
|
454
|
+
register(tool: AnyToolDefinition): void;
|
|
455
|
+
get(name: string): AnyToolDefinition | undefined;
|
|
456
|
+
list(): AnyToolDefinition[];
|
|
457
|
+
listToolSchemas(): ToolSchema[];
|
|
458
|
+
}
|
|
459
|
+
declare function validateToolInput<TSchema extends JsonSchemaObject>(input: JsonValue, schema: TSchema): InferJsonSchema<TSchema>;
|
|
460
|
+
declare function deriveFinalToolOutput(chunks: ToolResultChunk[]): ToolResultChunk;
|
|
461
|
+
|
|
462
|
+
interface ViewFileToolOptions {
|
|
463
|
+
allowedDirs?: readonly string[];
|
|
464
|
+
defaultCwd?: string;
|
|
465
|
+
maxBytes?: number;
|
|
466
|
+
name?: string;
|
|
467
|
+
}
|
|
468
|
+
declare function createViewFileTool(options?: ViewFileToolOptions): ToolDefinition<{
|
|
469
|
+
path: string;
|
|
470
|
+
detail?: string | undefined;
|
|
471
|
+
}, ToolOutputEnvelope, undefined, {
|
|
472
|
+
type: "object";
|
|
473
|
+
properties: {
|
|
474
|
+
path: {
|
|
475
|
+
type: "string";
|
|
476
|
+
};
|
|
477
|
+
detail: {
|
|
478
|
+
type: "string";
|
|
479
|
+
};
|
|
480
|
+
};
|
|
481
|
+
required: readonly ["path"];
|
|
482
|
+
}>;
|
|
483
|
+
|
|
484
|
+
interface WebFetchToolOptions {
|
|
485
|
+
maxBytes?: number;
|
|
486
|
+
timeoutMs?: number;
|
|
487
|
+
name?: string;
|
|
488
|
+
}
|
|
489
|
+
declare function createWebFetchTool(options?: WebFetchToolOptions): ToolDefinition<{
|
|
490
|
+
url: string;
|
|
491
|
+
description?: string | undefined;
|
|
1003
492
|
}, ToolOutputEnvelope, undefined, {
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
"path"
|
|
1015
|
-
];
|
|
493
|
+
type: "object";
|
|
494
|
+
properties: {
|
|
495
|
+
description: {
|
|
496
|
+
type: "string";
|
|
497
|
+
};
|
|
498
|
+
url: {
|
|
499
|
+
type: "string";
|
|
500
|
+
};
|
|
501
|
+
};
|
|
502
|
+
required: readonly ["url"];
|
|
1016
503
|
}>;
|
|
1017
|
-
export declare function resolveWorkspacePath(rootDir: string, inputPath: string): string;
|
|
1018
|
-
export declare function assertWorkspaceFile(filePath: string): Promise<void>;
|
|
1019
|
-
export declare function isProbablyBinary(buffer: Buffer): boolean;
|
|
1020
504
|
|
|
1021
|
-
|
|
505
|
+
interface WebSearchToolOptions {
|
|
506
|
+
googleCseKey: string;
|
|
507
|
+
googleCseCx: string;
|
|
508
|
+
name?: string;
|
|
509
|
+
}
|
|
510
|
+
declare function createWebSearchTool(options: WebSearchToolOptions): ToolDefinition<{
|
|
511
|
+
query: string;
|
|
512
|
+
type?: string | undefined;
|
|
513
|
+
count?: number | undefined;
|
|
514
|
+
description?: string | undefined;
|
|
515
|
+
offset?: number | undefined;
|
|
516
|
+
safe?: boolean | undefined;
|
|
517
|
+
domains?: string[] | undefined;
|
|
518
|
+
recencyDays?: number | undefined;
|
|
519
|
+
lang?: string | undefined;
|
|
520
|
+
region?: string | undefined;
|
|
521
|
+
hydrateMeta?: boolean | undefined;
|
|
522
|
+
}, ToolOutputEnvelope, undefined, {
|
|
523
|
+
type: "object";
|
|
524
|
+
properties: {
|
|
525
|
+
description: {
|
|
526
|
+
type: "string";
|
|
527
|
+
};
|
|
528
|
+
query: {
|
|
529
|
+
type: "string";
|
|
530
|
+
};
|
|
531
|
+
count: {
|
|
532
|
+
type: "number";
|
|
533
|
+
};
|
|
534
|
+
offset: {
|
|
535
|
+
type: "number";
|
|
536
|
+
};
|
|
537
|
+
domains: {
|
|
538
|
+
type: "array";
|
|
539
|
+
items: {
|
|
540
|
+
type: "string";
|
|
541
|
+
};
|
|
542
|
+
};
|
|
543
|
+
recencyDays: {
|
|
544
|
+
type: "number";
|
|
545
|
+
};
|
|
546
|
+
lang: {
|
|
547
|
+
type: "string";
|
|
548
|
+
};
|
|
549
|
+
region: {
|
|
550
|
+
type: "string";
|
|
551
|
+
};
|
|
552
|
+
safe: {
|
|
553
|
+
type: "boolean";
|
|
554
|
+
};
|
|
555
|
+
type: {
|
|
556
|
+
type: "string";
|
|
557
|
+
};
|
|
558
|
+
hydrateMeta: {
|
|
559
|
+
type: "boolean";
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
required: readonly ["query"];
|
|
563
|
+
}>;
|
|
564
|
+
|
|
565
|
+
declare function resolveWorkspacePath(rootDir: string, inputPath: string): string;
|
|
566
|
+
declare function resolveAllowedPath(rootDir: string, allowedDirs: readonly string[], inputPath: string): string;
|
|
567
|
+
declare function assertWorkspaceFile(filePath: string): Promise<void>;
|
|
568
|
+
declare function isProbablyBinary(buffer: Buffer): boolean;
|
|
569
|
+
|
|
570
|
+
export { type BashToolInput, type BashToolOptions, type CommandReference, type CommandToolOptions, type CreateDelegationToolsOptions, type DelegatedAgentDefinition, type DelegatedAgentFactoryContext, type FileEditToolOptions, type FileNewToolOptions, type FileReadToolOptions, type GlobToolOptions, type GrepToolOptions, type LoadedCommand, type LoadedSkill, type LsToolOptions, type McpConnectionOptions, type McpConnector, type McpOAuthProviderOptions, type McpServerConnectionStatus, type McpToolBundle, type McpToolClient, type McpToolDescriptor, type RipgrepMatch, type SkillReference, type SkillSource, type SkillToolOptions, ToolExecutionError, ToolRegistry, type ViewFileToolOptions, type WebFetchToolOptions, type WebSearchToolOptions, assertWorkspaceFile, buildMcpHttpHeaders, connectMcpServer, createAssignTaskTool, createBashTool, createDelegateToAgentTool, createDelegationTools, createFileEditTool, createFileNewTool, createFileReadTool, createGlobTool, createGrepTool, createInternalToolRuntime, createInvokeCommandTool, createLoadSkillTool, createLsTool, createMcpOAuthProvider, createMcpTool, createMcpToolName, createMcpToolsFromServers, createMockToolRuntime, createShellExecTool, createToolOutput, createViewFileTool, createWebFetchTool, createWebSearchTool, defineTool, deriveFinalToolOutput, filepath, files, isProbablyBinary, normalizeToolOutputValue, resolveAllowedPath, resolveWorkspacePath, search, toNuvinToolSchema, validateToolInput };
|