@nuvin/agent-core 0.0.0-rc.2 → 0.0.0-rc.3

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.
@@ -1,480 +1,1021 @@
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';
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
3
  import { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';
4
4
  import { CallToolResult, ListToolsResult } from '@modelcontextprotocol/sdk/types.js';
5
5
 
6
- interface BashToolInput {
7
- command: string;
8
- cwd?: string;
9
- timeoutMs?: number;
10
- ignoreOutput?: boolean;
11
- }
12
- interface BashToolOptions {
13
- defaultCwd?: string;
14
- defaultTimeoutMs?: number;
15
- description?: string;
16
- env?: NodeJS.ProcessEnv;
17
- name?: string;
18
- shellPath?: string;
19
- stripAnsi?: boolean;
20
- }
21
- declare function createBashTool(options?: BashToolOptions): ToolDefinition<{
22
- command: string;
23
- cwd?: string | undefined;
24
- timeoutMs?: number | undefined;
25
- ignoreOutput?: boolean | undefined;
6
+ export type JsonPrimitive = boolean | number | string | null;
7
+ export interface JsonObject {
8
+ [key: string]: JsonValue;
9
+ }
10
+ export type JsonValue = JsonObject | JsonPrimitive | JsonValue[];
11
+ export interface JsonSchemaString {
12
+ type: "string";
13
+ }
14
+ export interface JsonSchemaNumber {
15
+ type: "number";
16
+ }
17
+ export interface JsonSchemaBoolean {
18
+ type: "boolean";
19
+ }
20
+ export interface JsonSchemaArray<TItem extends JsonSchema = JsonSchema> {
21
+ type: "array";
22
+ items: TItem;
23
+ }
24
+ export interface JsonSchemaObject<TProperties extends Record<string, JsonSchema> = Record<string, JsonSchema>, TRequired extends readonly string[] | undefined = readonly string[] | undefined> {
25
+ type: "object";
26
+ properties: TProperties;
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;
26
520
  }, string, ToolOutputEnvelope, {
27
- type: "object";
28
- properties: {
29
- command: {
30
- type: "string";
31
- };
32
- cwd: {
33
- type: "string";
34
- };
35
- timeoutMs: {
36
- type: "number";
37
- };
38
- ignoreOutput: {
39
- type: "boolean";
40
- };
41
- };
42
- required: readonly ["command"];
521
+ type: "object";
522
+ properties: {
523
+ command: {
524
+ type: "string";
525
+ };
526
+ cwd: {
527
+ type: "string";
528
+ };
529
+ timeoutMs: {
530
+ type: "number";
531
+ };
532
+ ignoreOutput: {
533
+ type: "boolean";
534
+ };
535
+ };
536
+ required: readonly [
537
+ "command"
538
+ ];
43
539
  }>;
44
- declare function createShellExecTool(options?: BashToolOptions): ToolDefinition<{
45
- command: string;
46
- cwd?: string | undefined;
47
- timeoutMs?: number | undefined;
48
- ignoreOutput?: boolean | undefined;
540
+ export declare function createShellExecTool(options?: BashToolOptions): ToolDefinition<{
541
+ command: string;
542
+ cwd?: string | undefined;
543
+ timeoutMs?: number | undefined;
544
+ ignoreOutput?: boolean | undefined;
49
545
  }, string, ToolOutputEnvelope, {
50
- type: "object";
51
- properties: {
52
- command: {
53
- type: "string";
54
- };
55
- cwd: {
56
- type: "string";
57
- };
58
- timeoutMs: {
59
- type: "number";
60
- };
61
- ignoreOutput: {
62
- type: "boolean";
63
- };
64
- };
65
- required: readonly ["command"];
546
+ type: "object";
547
+ properties: {
548
+ command: {
549
+ type: "string";
550
+ };
551
+ cwd: {
552
+ type: "string";
553
+ };
554
+ timeoutMs: {
555
+ type: "number";
556
+ };
557
+ ignoreOutput: {
558
+ type: "boolean";
559
+ };
560
+ };
561
+ required: readonly [
562
+ "command"
563
+ ];
66
564
  }>;
67
-
68
- type CommandReference = CommandDefinitionReference;
69
- type LoadedCommand = SerializedCommandDefinition;
70
- interface CommandToolOptions<TRef extends CommandReference = CommandReference> {
71
- commands: TRef[];
72
- loadCommand: (reference: TRef) => Promise<LoadedCommand>;
73
- }
74
- declare function createInvokeCommandTool<TRef extends CommandReference>(options: CommandToolOptions<TRef>): ToolDefinition<{
75
- name: string;
76
- args?: string | undefined;
565
+ export interface MCPOAuthConfig {
566
+ clientId?: string;
567
+ clientMetadataUrl?: string;
568
+ authorizationServer?: string;
569
+ scopes?: string[];
570
+ tokenStorageKey?: string;
571
+ }
572
+ export interface MCPAuthConfig {
573
+ type: "none" | "bearer" | "oauth";
574
+ token?: string;
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;
77
616
  }, ToolOutputEnvelope, undefined, {
78
- type: "object";
79
- properties: {
80
- name: {
81
- type: "string";
82
- };
83
- args: {
84
- type: "string";
85
- };
86
- };
87
- required: readonly ["name"];
617
+ type: "object";
618
+ properties: {
619
+ name: {
620
+ type: "string";
621
+ };
622
+ args: {
623
+ type: "string";
624
+ };
625
+ };
626
+ required: readonly [
627
+ "name"
628
+ ];
88
629
  }>;
89
-
90
- interface FileEditToolOptions {
91
- defaultCwd?: string;
92
- name?: string;
93
- }
94
- declare function createFileEditTool(options?: FileEditToolOptions): ToolDefinition<{
95
- filePath: string;
96
- oldText: string;
97
- newText: string;
98
- dryRun?: boolean | undefined;
630
+ export interface FileEditToolOptions {
631
+ defaultCwd?: string;
632
+ name?: string;
633
+ }
634
+ export declare function createFileEditTool(options?: FileEditToolOptions): ToolDefinition<{
635
+ filePath: string;
636
+ oldText: string;
637
+ newText: string;
638
+ dryRun?: boolean | undefined;
99
639
  }, ToolOutputEnvelope, undefined, {
100
- type: "object";
101
- properties: {
102
- filePath: {
103
- type: "string";
104
- };
105
- oldText: {
106
- type: "string";
107
- };
108
- newText: {
109
- type: "string";
110
- };
111
- dryRun: {
112
- type: "boolean";
113
- };
114
- };
115
- required: readonly ["filePath", "oldText", "newText"];
640
+ type: "object";
641
+ properties: {
642
+ filePath: {
643
+ type: "string";
644
+ };
645
+ oldText: {
646
+ type: "string";
647
+ };
648
+ newText: {
649
+ type: "string";
650
+ };
651
+ dryRun: {
652
+ type: "boolean";
653
+ };
654
+ };
655
+ required: readonly [
656
+ "filePath",
657
+ "oldText",
658
+ "newText"
659
+ ];
116
660
  }>;
117
-
118
- interface FileNewToolOptions {
119
- defaultCwd?: string;
120
- name?: string;
661
+ export interface FileNewToolOptions {
662
+ defaultCwd?: string;
663
+ name?: string;
121
664
  }
122
- declare function createFileNewTool(options?: FileNewToolOptions): ToolDefinition<{
123
- content: string;
124
- filePath: string;
665
+ export declare function createFileNewTool(options?: FileNewToolOptions): ToolDefinition<{
666
+ content: string;
667
+ filePath: string;
125
668
  }, ToolOutputEnvelope, undefined, {
126
- type: "object";
127
- properties: {
128
- filePath: {
129
- type: "string";
130
- };
131
- content: {
132
- type: "string";
133
- };
134
- };
135
- required: readonly ["filePath", "content"];
669
+ type: "object";
670
+ properties: {
671
+ filePath: {
672
+ type: "string";
673
+ };
674
+ content: {
675
+ type: "string";
676
+ };
677
+ };
678
+ required: readonly [
679
+ "filePath",
680
+ "content"
681
+ ];
136
682
  }>;
137
-
138
- interface FileReadToolOptions {
139
- defaultCwd?: string;
140
- name?: string;
141
- }
142
- declare function createFileReadTool(options?: FileReadToolOptions): ToolDefinition<{
143
- path: string;
144
- lineStart?: number | undefined;
145
- lineEnd?: number | undefined;
683
+ export interface FileReadToolOptions {
684
+ defaultCwd?: string;
685
+ name?: string;
686
+ }
687
+ export declare function createFileReadTool(options?: FileReadToolOptions): ToolDefinition<{
688
+ path: string;
689
+ lineStart?: number | undefined;
690
+ lineEnd?: number | undefined;
146
691
  }, ToolOutputEnvelope, undefined, {
147
- type: "object";
148
- properties: {
149
- path: {
150
- type: "string";
151
- };
152
- lineStart: {
153
- type: "number";
154
- };
155
- lineEnd: {
156
- type: "number";
157
- };
158
- };
159
- required: readonly ["path"];
692
+ type: "object";
693
+ properties: {
694
+ path: {
695
+ type: "string";
696
+ };
697
+ lineStart: {
698
+ type: "number";
699
+ };
700
+ lineEnd: {
701
+ type: "number";
702
+ };
703
+ };
704
+ required: readonly [
705
+ "path"
706
+ ];
160
707
  }>;
161
-
162
- interface GlobToolOptions {
163
- defaultCwd?: string;
164
- limit?: number;
165
- name?: string;
166
- }
167
- declare function createGlobTool(options?: GlobToolOptions): ToolDefinition<{
168
- pattern: string;
169
- path?: string | undefined;
170
- limit?: number | undefined;
708
+ export interface GlobToolOptions {
709
+ defaultCwd?: string;
710
+ limit?: number;
711
+ name?: string;
712
+ }
713
+ export declare function createGlobTool(options?: GlobToolOptions): ToolDefinition<{
714
+ pattern: string;
715
+ path?: string | undefined;
716
+ limit?: number | undefined;
171
717
  }, ToolOutputEnvelope, undefined, {
172
- type: "object";
173
- properties: {
174
- pattern: {
175
- type: "string";
176
- };
177
- path: {
178
- type: "string";
179
- };
180
- limit: {
181
- type: "number";
182
- };
183
- };
184
- required: readonly ["pattern"];
718
+ type: "object";
719
+ properties: {
720
+ pattern: {
721
+ type: "string";
722
+ };
723
+ path: {
724
+ type: "string";
725
+ };
726
+ limit: {
727
+ type: "number";
728
+ };
729
+ };
730
+ required: readonly [
731
+ "pattern"
732
+ ];
185
733
  }>;
186
-
187
- interface GrepToolOptions {
188
- defaultCwd?: string;
189
- limit?: number;
190
- name?: string;
191
- }
192
- declare function createGrepTool(options?: GrepToolOptions): ToolDefinition<{
193
- pattern: string;
194
- path?: string | undefined;
195
- limit?: number | undefined;
196
- include?: string | undefined;
197
- context?: number | undefined;
734
+ export interface GrepToolOptions {
735
+ defaultCwd?: string;
736
+ limit?: number;
737
+ name?: string;
738
+ }
739
+ export declare function createGrepTool(options?: GrepToolOptions): ToolDefinition<{
740
+ pattern: string;
741
+ path?: string | undefined;
742
+ limit?: number | undefined;
743
+ include?: string | undefined;
744
+ context?: number | undefined;
198
745
  }, ToolOutputEnvelope, undefined, {
199
- type: "object";
200
- properties: {
201
- pattern: {
202
- type: "string";
203
- };
204
- path: {
205
- type: "string";
206
- };
207
- include: {
208
- type: "string";
209
- };
210
- limit: {
211
- type: "number";
212
- };
213
- context: {
214
- type: "number";
215
- };
216
- };
217
- required: readonly ["pattern"];
746
+ type: "object";
747
+ properties: {
748
+ pattern: {
749
+ type: "string";
750
+ };
751
+ path: {
752
+ type: "string";
753
+ };
754
+ include: {
755
+ type: "string";
756
+ };
757
+ limit: {
758
+ type: "number";
759
+ };
760
+ context: {
761
+ type: "number";
762
+ };
763
+ };
764
+ required: readonly [
765
+ "pattern"
766
+ ];
218
767
  }>;
219
-
220
- interface InternalToolRuntimeOptions {
221
- onEvent?: ToolRuntimeEventHandler;
222
- onToolCall?: ToolRuntimeToolCallHandler;
768
+ export interface InternalToolRuntimeOptions {
769
+ onEvent?: ToolRuntimeEventHandler;
770
+ onToolCall?: ToolRuntimeToolCallHandler;
223
771
  }
224
- declare function createInternalToolRuntime(tools?: AnyToolDefinition[], options?: InternalToolRuntimeOptions): ToolRuntime;
225
-
226
- interface LsToolOptions {
227
- defaultCwd?: string;
228
- name?: string;
772
+ export declare function createInternalToolRuntime(tools?: AnyToolDefinition[], options?: InternalToolRuntimeOptions): ToolRuntime;
773
+ export interface LsToolOptions {
774
+ defaultCwd?: string;
775
+ name?: string;
229
776
  }
230
- declare function createLsTool(options?: LsToolOptions): ToolDefinition<{
231
- path: string;
232
- limit: number;
777
+ export declare function createLsTool(options?: LsToolOptions): ToolDefinition<{
778
+ path: string;
779
+ limit: number;
233
780
  }, ToolOutputEnvelope, undefined, {
234
- type: "object";
235
- properties: {
236
- path: {
237
- type: "string";
238
- };
239
- limit: {
240
- type: "number";
241
- };
242
- };
781
+ type: "object";
782
+ properties: {
783
+ path: {
784
+ type: "string";
785
+ };
786
+ limit: {
787
+ type: "number";
788
+ };
789
+ };
243
790
  }>;
244
-
245
- interface McpOAuthProviderOptions {
246
- serverName: string;
247
- callbackUrl: string;
248
- storageDir: string;
249
- config: MCPAuthConfig;
250
- onRedirect(url: URL): void | Promise<void>;
251
- }
252
- declare function createMcpOAuthProvider(options: McpOAuthProviderOptions): OAuthClientProvider;
253
-
254
- interface McpToolDescriptor {
255
- name: string;
256
- description?: string;
257
- inputSchema?: unknown;
258
- }
259
- interface McpToolClient {
260
- callTool(input: {
261
- name: string;
262
- arguments?: JsonObject;
263
- }): Promise<CallToolResult>;
264
- }
265
- declare function createMcpToolName(serverName: string, toolName: string): string;
266
- declare function toNuvinToolSchema(inputSchema: unknown): JsonSchemaObject;
267
- declare function createMcpTool(options: {
268
- serverName: string;
269
- tool: McpToolDescriptor;
270
- client: McpToolClient;
791
+ export interface McpOAuthProviderOptions {
792
+ serverName: string;
793
+ callbackUrl: string;
794
+ storageDir: string;
795
+ config: MCPAuthConfig;
796
+ onRedirect(url: URL): void | Promise<void>;
797
+ }
798
+ export declare function createMcpOAuthProvider(options: McpOAuthProviderOptions): OAuthClientProvider;
799
+ export interface McpToolDescriptor {
800
+ name: string;
801
+ description?: string;
802
+ inputSchema?: unknown;
803
+ }
804
+ export interface McpToolClient {
805
+ callTool(input: {
806
+ name: string;
807
+ arguments?: JsonObject;
808
+ }): Promise<CallToolResult>;
809
+ }
810
+ export declare function createMcpToolName(serverName: string, toolName: string): string;
811
+ export declare function toNuvinToolSchema(inputSchema: unknown): JsonSchemaObject;
812
+ export declare function createMcpTool(options: {
813
+ serverName: string;
814
+ tool: McpToolDescriptor;
815
+ client: McpToolClient;
271
816
  }): ToolDefinition<{
272
- [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 | {
273
- [x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any;
274
- })[] | {
275
- [x: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any;
276
- })[] | {
277
- [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
278
- })[] | {
279
- [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
280
- })[] | {
281
- [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;
282
- })[] | {
283
- [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;
284
- })[] | {
285
- [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;
286
- })[] | {
287
- [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;
288
- })[] | {
289
- [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;
290
- })[] | {
291
- [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;
292
- })[] | {
293
- [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;
294
- })[] | {
295
- [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;
296
- };
817
+ [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 | {
818
+ [x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any;
819
+ })[] | {
820
+ [x: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any;
821
+ })[] | {
822
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
823
+ })[] | {
824
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
825
+ })[] | {
826
+ [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;
827
+ })[] | {
828
+ [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;
829
+ })[] | {
830
+ [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;
831
+ })[] | {
832
+ [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;
833
+ })[] | {
834
+ [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;
835
+ })[] | {
836
+ [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;
837
+ })[] | {
838
+ [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;
839
+ })[] | {
840
+ [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;
841
+ };
297
842
  }, ToolOutputEnvelope, undefined, JsonSchemaObject<Record<string, JsonSchema>, readonly string[] | undefined>>;
298
-
299
- interface ConnectedMcpClient extends McpToolClient {
300
- listTools(): Promise<ListToolsResult>;
301
- close(): Promise<void>;
843
+ export interface ConnectedMcpClient extends McpToolClient {
844
+ listTools(): Promise<ListToolsResult>;
845
+ close(): Promise<void>;
302
846
  }
303
- type McpServerConnectionStatus = {
304
- status: "connected";
305
- toolCount: number;
847
+ export type McpServerConnectionStatus = {
848
+ status: "connected";
849
+ toolCount: number;
306
850
  } | {
307
- status: "disabled";
851
+ status: "disabled";
308
852
  } | {
309
- status: "authRequired";
310
- message: string;
853
+ status: "authRequired";
854
+ message: string;
311
855
  } | {
312
- status: "error";
313
- message: string;
856
+ status: "error";
857
+ message: string;
314
858
  };
315
- interface McpToolBundle {
316
- tools: AnyToolDefinition[];
317
- servers: Record<string, McpServerConnectionStatus>;
318
- close(): Promise<void>;
319
- }
320
- interface McpConnectionOptions {
321
- oauth?: {
322
- storageDir: string;
323
- callbackUrl: string;
324
- onRedirect(serverName: string, url: URL): void | Promise<void>;
325
- };
326
- }
327
- type McpConnector = (serverName: string, config: MCPServerConfig, options?: McpConnectionOptions) => Promise<ConnectedMcpClient>;
328
- declare function buildMcpHttpHeaders(config: MCPServerConfig): Record<string, string> | undefined;
329
- declare function connectMcpServer(serverName: string, config: MCPServerConfig, options?: McpConnectionOptions): Promise<ConnectedMcpClient>;
330
- declare function createMcpToolsFromServers(options: {
331
- servers?: Record<string, MCPServerConfig>;
332
- allowedTools?: Record<string, Record<string, boolean>>;
333
- connection?: McpConnectionOptions;
334
- connect?: McpConnector;
859
+ export interface McpToolBundle {
860
+ tools: AnyToolDefinition[];
861
+ servers: Record<string, McpServerConnectionStatus>;
862
+ close(): Promise<void>;
863
+ }
864
+ export interface McpConnectionOptions {
865
+ oauth?: {
866
+ storageDir: string;
867
+ callbackUrl: string;
868
+ onRedirect(serverName: string, url: URL): void | Promise<void>;
869
+ };
870
+ }
871
+ export type McpConnector = (serverName: string, config: MCPServerConfig, options?: McpConnectionOptions) => Promise<ConnectedMcpClient>;
872
+ export declare function buildMcpHttpHeaders(config: MCPServerConfig): Record<string, string> | undefined;
873
+ export declare function connectMcpServer(serverName: string, config: MCPServerConfig, options?: McpConnectionOptions): Promise<ConnectedMcpClient>;
874
+ export declare function createMcpToolsFromServers(options: {
875
+ servers?: Record<string, MCPServerConfig>;
876
+ allowedTools?: Record<string, Record<string, boolean>>;
877
+ connection?: McpConnectionOptions;
878
+ connect?: McpConnector;
335
879
  }): Promise<McpToolBundle>;
336
-
337
- declare function createMockToolRuntime(): ToolRuntime;
338
-
339
- type RipgrepMatch = {
340
- filePath: string;
341
- isContext?: boolean;
342
- lineNum: number;
343
- lineText: string;
880
+ export declare function createMockToolRuntime(): ToolRuntime;
881
+ export type RipgrepMatch = {
882
+ filePath: string;
883
+ isContext?: boolean;
884
+ lineNum: number;
885
+ lineText: string;
344
886
  };
345
- declare function filepath(): Promise<string>;
346
- declare function files(opts: {
347
- cwd: string;
348
- glob?: string[];
887
+ export declare function filepath(): Promise<string>;
888
+ export declare function files(opts: {
889
+ cwd: string;
890
+ glob?: string[];
349
891
  }): AsyncGenerator<string>;
350
- declare function search(opts: {
351
- context?: number;
352
- cwd: string;
353
- file?: string;
354
- glob?: string;
355
- limit?: number;
356
- pattern: string;
892
+ export declare function search(opts: {
893
+ context?: number;
894
+ cwd: string;
895
+ file?: string;
896
+ glob?: string;
897
+ limit?: number;
898
+ pattern: string;
357
899
  }): Promise<RipgrepMatch[]>;
358
-
359
- interface DelegatedAgentFactoryContext extends AgentDefinitionFactoryContext {
360
- parentSessionId: string;
361
- runId: string;
900
+ export interface DelegatedAgentFactoryContext extends AgentDefinitionFactoryContext {
901
+ parentSessionId: string;
902
+ runId: string;
362
903
  }
363
- type DelegatedAgentDefinition = AgentOptions | ((ctx: DelegatedAgentFactoryContext) => AgentOptions | Promise<AgentOptions>);
364
- interface CreateDelegationToolsOptions {
365
- agents?: Record<string, DelegatedAgentDefinition>;
904
+ export type DelegatedAgentDefinition = AgentOptions | ((ctx: DelegatedAgentFactoryContext) => AgentOptions | Promise<AgentOptions>);
905
+ export interface CreateDelegationToolsOptions {
906
+ agents?: Record<string, DelegatedAgentDefinition>;
366
907
  }
367
- declare function createAssignTaskTool(options: CreateDelegationToolsOptions): ToolDefinition<{
368
- task: string;
369
- agentId: string;
908
+ export declare function createAssignTaskTool(options: CreateDelegationToolsOptions): ToolDefinition<{
909
+ task: string;
910
+ agentId: string;
370
911
  }, ToolOutputEnvelope, ToolOutputEnvelope, {
371
- type: "object";
372
- properties: {
373
- agentId: {
374
- type: "string";
375
- };
376
- task: {
377
- type: "string";
378
- };
379
- };
380
- required: string[];
912
+ type: "object";
913
+ properties: {
914
+ agentId: {
915
+ type: "string";
916
+ };
917
+ task: {
918
+ type: "string";
919
+ };
920
+ };
921
+ required: string[];
381
922
  }>;
382
- declare const createDelegateToAgentTool: typeof createAssignTaskTool;
383
- declare function createDelegationTools(options: CreateDelegationToolsOptions): ToolDefinition<{
384
- task: string;
385
- agentId: string;
923
+ export declare const createDelegateToAgentTool: typeof createAssignTaskTool;
924
+ export declare function createDelegationTools(options: CreateDelegationToolsOptions): ToolDefinition<{
925
+ task: string;
926
+ agentId: string;
386
927
  }, ToolOutputEnvelope, ToolOutputEnvelope, {
387
- type: "object";
388
- properties: {
389
- agentId: {
390
- type: "string";
391
- };
392
- task: {
393
- type: "string";
394
- };
395
- };
396
- required: string[];
928
+ type: "object";
929
+ properties: {
930
+ agentId: {
931
+ type: "string";
932
+ };
933
+ task: {
934
+ type: "string";
935
+ };
936
+ };
937
+ required: string[];
397
938
  }>[];
398
-
399
939
  /** Minimal shape of a skill source reference — matches @nuvin/config SkillDefinitionSource */
400
- interface SkillSource {
401
- path: string;
402
- directory?: string;
403
- scope?: string;
940
+ export interface SkillSource {
941
+ path: string;
942
+ directory?: string;
943
+ scope?: string;
404
944
  }
405
945
  /** Minimal shape of a skill reference — matches @nuvin/config SkillDefinitionReference */
406
- interface SkillReference {
407
- id: string;
408
- name: string;
409
- description: string;
410
- source: SkillSource;
946
+ export interface SkillReference {
947
+ id: string;
948
+ name: string;
949
+ description: string;
950
+ source: SkillSource;
411
951
  }
412
952
  /** Minimal shape of a loaded skill — matches @nuvin/config SerializedSkillDefinition */
413
- interface LoadedSkill extends SkillReference {
414
- instructions: string;
953
+ export interface LoadedSkill extends SkillReference {
954
+ instructions: string;
415
955
  }
416
- interface SkillToolOptions<TRef extends SkillReference = SkillReference> {
417
- skills: TRef[];
418
- loadSkill: (reference: TRef) => Promise<LoadedSkill>;
956
+ export interface SkillToolOptions<TRef extends SkillReference = SkillReference> {
957
+ skills: TRef[];
958
+ loadSkill: (reference: TRef) => Promise<LoadedSkill>;
419
959
  }
420
- declare function createLoadSkillTool<TRef extends SkillReference>(options: SkillToolOptions<TRef>): ToolDefinition<{
421
- name: string;
960
+ export declare function createLoadSkillTool<TRef extends SkillReference>(options: SkillToolOptions<TRef>): ToolDefinition<{
961
+ name: string;
422
962
  }, ToolOutputEnvelope, undefined, {
423
- type: "object";
424
- properties: {
425
- name: {
426
- type: "string";
427
- };
428
- };
429
- required: readonly ["name"];
963
+ type: "object";
964
+ properties: {
965
+ name: {
966
+ type: "string";
967
+ };
968
+ };
969
+ required: readonly [
970
+ "name"
971
+ ];
430
972
  }>;
431
-
432
- declare function normalizeToolOutputValue(output: ToolOutputValue): ToolResultChunk;
433
- declare function createToolOutput(output: string, structured?: JsonObject, content?: ToolResultContent): ToolOutputEnvelope;
434
- declare class ToolExecutionError extends Error {
435
- readonly structured: JsonObject;
436
- constructor(message: string, structured?: JsonObject);
437
- }
438
- declare function defineTool<TSchema extends JsonSchemaObject, TYield extends ToolOutputValue = ToolOutputValue, TReturn extends ToolOutputValue | undefined = ToolOutputValue | undefined>(definition: {
439
- name: string;
440
- description: string;
441
- inputSchema: TSchema;
442
- execute(input: InferJsonSchema<TSchema>, ctx: ToolExecutionContext): AsyncGenerator<TYield, TReturn, void>;
973
+ export declare function normalizeToolOutputValue(output: ToolOutputValue): ToolResultChunk;
974
+ export declare function createToolOutput(output: string, structured?: JsonObject, content?: ToolResultContent): ToolOutputEnvelope;
975
+ export declare class ToolExecutionError extends Error {
976
+ readonly structured: JsonObject;
977
+ constructor(message: string, structured?: JsonObject);
978
+ }
979
+ export declare function defineTool<TSchema extends JsonSchemaObject, TYield extends ToolOutputValue = ToolOutputValue, TReturn extends ToolOutputValue | undefined = ToolOutputValue | undefined>(definition: {
980
+ name: string;
981
+ description: string;
982
+ inputSchema: TSchema;
983
+ execute(input: InferJsonSchema<TSchema>, ctx: ToolExecutionContext): AsyncGenerator<TYield, TReturn, void>;
443
984
  }): ToolDefinition<InferJsonSchema<TSchema>, TYield, TReturn, TSchema>;
444
- declare class ToolRegistry {
445
- private readonly toolsByName;
446
- constructor(tools?: AnyToolDefinition[]);
447
- register(tool: AnyToolDefinition): void;
448
- get(name: string): AnyToolDefinition | undefined;
449
- list(): AnyToolDefinition[];
450
- listToolSchemas(): ToolSchema[];
451
- }
452
- declare function validateToolInput<TSchema extends JsonSchemaObject>(input: JsonValue, schema: TSchema): InferJsonSchema<TSchema>;
453
- declare function deriveFinalToolOutput(chunks: ToolResultChunk[]): ToolResultChunk;
454
-
455
- interface ViewFileToolOptions {
456
- defaultCwd?: string;
457
- maxBytes?: number;
458
- name?: string;
459
- }
460
- declare function createViewFileTool(options?: ViewFileToolOptions): ToolDefinition<{
461
- path: string;
462
- detail?: string | undefined;
985
+ export declare class ToolRegistry {
986
+ private readonly toolsByName;
987
+ constructor(tools?: AnyToolDefinition[]);
988
+ register(tool: AnyToolDefinition): void;
989
+ get(name: string): AnyToolDefinition | undefined;
990
+ list(): AnyToolDefinition[];
991
+ listToolSchemas(): ToolSchema[];
992
+ }
993
+ export declare function validateToolInput<TSchema extends JsonSchemaObject>(input: JsonValue, schema: TSchema): InferJsonSchema<TSchema>;
994
+ export declare function deriveFinalToolOutput(chunks: ToolResultChunk[]): ToolResultChunk;
995
+ export interface ViewFileToolOptions {
996
+ defaultCwd?: string;
997
+ maxBytes?: number;
998
+ name?: string;
999
+ }
1000
+ export declare function createViewFileTool(options?: ViewFileToolOptions): ToolDefinition<{
1001
+ path: string;
1002
+ detail?: string | undefined;
463
1003
  }, ToolOutputEnvelope, undefined, {
464
- type: "object";
465
- properties: {
466
- path: {
467
- type: "string";
468
- };
469
- detail: {
470
- type: "string";
471
- };
472
- };
473
- required: readonly ["path"];
1004
+ type: "object";
1005
+ properties: {
1006
+ path: {
1007
+ type: "string";
1008
+ };
1009
+ detail: {
1010
+ type: "string";
1011
+ };
1012
+ };
1013
+ required: readonly [
1014
+ "path"
1015
+ ];
474
1016
  }>;
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;
475
1020
 
476
- declare function resolveWorkspacePath(rootDir: string, inputPath: string): string;
477
- declare function assertWorkspaceFile(filePath: string): Promise<void>;
478
- declare function isProbablyBinary(buffer: Buffer): boolean;
479
-
480
- 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, assertWorkspaceFile, buildMcpHttpHeaders, connectMcpServer, createAssignTaskTool, createBashTool, createDelegateToAgentTool, createDelegationTools, createFileEditTool, createFileNewTool, createFileReadTool, createGlobTool, createGrepTool, createInternalToolRuntime, createInvokeCommandTool, createLoadSkillTool, createLsTool, createMcpOAuthProvider, createMcpTool, createMcpToolName, createMcpToolsFromServers, createMockToolRuntime, createShellExecTool, createToolOutput, createViewFileTool, defineTool, deriveFinalToolOutput, filepath, files, isProbablyBinary, normalizeToolOutputValue, resolveWorkspacePath, search, toNuvinToolSchema, validateToolInput };
1021
+ export {};