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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { j as ChatRequest, O as OpenAiResponsesRequest } from './types-BueDJWnx.js';
1
+ import { j as ChatRequest, O as OpenAiResponsesRequest } from './types-QPBW5jHO.js';
2
2
 
3
3
  declare function toOpenAiResponsesRequest(request: ChatRequest): OpenAiResponsesRequest;
4
4
 
@@ -1,5 +1,5 @@
1
- import { D as AutoReasoningEffort, u as ReasoningConfig, F as AnthropicThinkingConfig, G as OpenAiReasoningConfig } from '../types-BueDJWnx.js';
2
- export { aF as AgentAssistantChunkEvent, aE as AgentAssistantMessageEvent, b9 as AgentDefinition, b8 as AgentDefinitionFactoryContext, aQ as AgentEvent, au as AgentEventContext, aU as AgentEventHandler, aN as AgentFinalMessageEvent, a as AgentInput, aP as AgentLifecycleEvent, aC as AgentModelRequestEvent, aD as AgentModelResponseEvent, A as AgentOptions, aJ as AgentReasoningChunkEvent, aI as AgentReasoningMessageEvent, b as AgentSendOptions, aK as AgentToolCallEvent, aL as AgentToolResultEvent, aM as AgentToolResultMessageEvent, aH as AgentToolUseChunkEvent, aG as AgentToolUseMessageEvent, aO as AgentTurnCompleteEvent, aB as AgentUserMessageEvent, a7 as AnthropicAdaptiveThinkingConfig, a1 as AnthropicAssistantContentBlock, a8 as AnthropicDisabledThinkingConfig, a6 as AnthropicEnabledThinkingConfig, Y as AnthropicRedactedThinkingBlock, a0 as AnthropicRedactedThinkingWireBlock, ak as AnthropicSignatureDeltaChunk, X as AnthropicThinkingBlock, aj as AnthropicThinkingDeltaChunk, a4 as AnthropicThinkingDisplay, a5 as AnthropicThinkingEffort, $ as AnthropicThinkingWireBlock, b7 as AnyExtensionRegistration, a_ as AnyToolDefinition, ac as AssistantContentBlock, a3 as AutoReasoningConfig, B as BaseChatModelOptions, at as ChatModel, j as ChatRequest, l as ChatResponse, v as ChatResponseChunk, h as CompileRequestInput, f as ContentBlock, ah as ContentDeltaChunk, C as ContentInput, bh as CreateManagedRunInput, t as EngineChatModel, b1 as ExtensionContext, b6 as ExtensionRegistration, E as ExtensionRegistry, ae as IdentifiedMessage, aW as InferJsonSchema, H as JsonObject, J as JsonPrimitive, W as JsonSchema, U as JsonSchemaArray, Q as JsonSchemaBoolean, N as JsonSchemaNumber, V as JsonSchemaObject, L as JsonSchemaString, K as JsonSchemaType, I as JsonValue, bc as ManagedAgentRun, bd as ManagedAgentRunHandle, bb as ManagedRunError, be as ManagedRunEvent, bf as ManagedRunEventHandler, ba as ManagedRunStatus, M as Message, g as MessageInput, ab as MessageProviderState, ad as MessageRole, w as ModelExecutionOptions, x as ModelInfo, an as ModelLimits, i as ModelRequest, k as ModelResponse, b3 as Observer, b5 as ObserverExtensionRegistration, bk as OpenAiFunctionCall, bl as OpenAiFunctionCallOutput, bs as OpenAiFunctionTool, bj as OpenAiInputMessage, bi as OpenAiInputText, bo as OpenAiOutputMessage, bm as OpenAiOutputTextPart, _ as OpenAiReasoningBlock, al as OpenAiReasoningDeltaChunk, a9 as OpenAiReasoningEffort, bp as OpenAiReasoningOutputItem, aa as OpenAiReasoningSummary, am as OpenAiReasoningSummaryDeltaChunk, Z as OpenAiReasoningSummaryText, bn as OpenAiRefusalPart, bq as OpenAiResponsesOutputItem, br as OpenAiResponsesReasoningParam, O as OpenAiResponsesRequest, b0 as PayloadByStage, as as PrepareRequestInput, r as PreparedRequest, s as ProviderCredential, y as ProviderCredentialKind, z as ProviderEndpoints, q as ProviderRequestMutator, P as ProviderSessionResolver, a2 as ReasoningVisibility, p as ResolvedProviderSession, R as RunTurnDeps, bg as RuntimeManagerOptions, a$ as Stage, S as SystemInput, e as TextBlock, aZ as ToolDefinition, av as ToolExecutionContext, aY as ToolGenerator, aq as ToolOutputEnvelope, aX as ToolOutputValue, o as ToolResult, n as ToolResultBlock, ap as ToolResultChunk, ao as ToolResultMeta, aV as ToolRuntime, ay as ToolRuntimeCompletedEvent, aR as ToolRuntimeDispatchDecision, aA as ToolRuntimeEvent, aT as ToolRuntimeEventHandler, ax as ToolRuntimeOutputChunkEvent, az as ToolRuntimeRejectedEvent, aw as ToolRuntimeStartedEvent, aS as ToolRuntimeToolCallHandler, af as ToolSchema, m as ToolUseBlock, ai as ToolUseDeltaChunk, b2 as Transformer, b4 as TransformerExtensionRegistration, c as TurnInput, T as TurnResult, ar as TurnResultStatus, d as TurnState, ag as Usage } from '../types-BueDJWnx.js';
1
+ import { D as AutoReasoningEffort, u as ReasoningConfig, F as AnthropicThinkingConfig, G as OpenAiReasoningConfig } from '../types-QPBW5jHO.js';
2
+ export { aJ as AgentAssistantChunkEvent, aI as AgentAssistantMessageEvent, bd as AgentDefinition, bc as AgentDefinitionFactoryContext, aU as AgentEvent, ay as AgentEventContext, aY as AgentEventHandler, aR as AgentFinalMessageEvent, a as AgentInput, aT as AgentLifecycleEvent, aG as AgentModelRequestEvent, aH as AgentModelResponseEvent, A as AgentOptions, aN as AgentReasoningChunkEvent, aM as AgentReasoningMessageEvent, b as AgentSendOptions, aO as AgentToolCallEvent, aP as AgentToolResultEvent, aQ as AgentToolResultMessageEvent, aL as AgentToolUseChunkEvent, aK as AgentToolUseMessageEvent, aS as AgentTurnCompleteEvent, aF as AgentUserMessageEvent, ab as AnthropicAdaptiveThinkingConfig, a5 as AnthropicAssistantContentBlock, ac as AnthropicDisabledThinkingConfig, aa as AnthropicEnabledThinkingConfig, a0 as AnthropicRedactedThinkingBlock, a4 as AnthropicRedactedThinkingWireBlock, ao as AnthropicSignatureDeltaChunk, $ as AnthropicThinkingBlock, an as AnthropicThinkingDeltaChunk, a8 as AnthropicThinkingDisplay, a9 as AnthropicThinkingEffort, a3 as AnthropicThinkingWireBlock, bb as AnyExtensionRegistration, b2 as AnyToolDefinition, ag as AssistantContentBlock, a7 as AutoReasoningConfig, B as BaseChatModelOptions, ax as ChatModel, j as ChatRequest, l as ChatResponse, v as ChatResponseChunk, h as CompileRequestInput, f as ContentBlock, al as ContentDeltaChunk, C as ContentInput, bl as CreateManagedRunInput, t as EngineChatModel, b5 as ExtensionContext, ba as ExtensionRegistration, E as ExtensionRegistry, ai as IdentifiedMessage, Y as ImageBlock, X as ImageMediaType, a_ as InferJsonSchema, H as JsonObject, J as JsonPrimitive, W as JsonSchema, U as JsonSchemaArray, Q as JsonSchemaBoolean, N as JsonSchemaNumber, V as JsonSchemaObject, L as JsonSchemaString, K as JsonSchemaType, I as JsonValue, bg as ManagedAgentRun, bh as ManagedAgentRunHandle, bf as ManagedRunError, bi as ManagedRunEvent, bj as ManagedRunEventHandler, be as ManagedRunStatus, M as Message, g as MessageInput, af as MessageProviderState, ah as MessageRole, w as ModelExecutionOptions, x as ModelInfo, ar as ModelLimits, i as ModelRequest, k as ModelResponse, b7 as Observer, b9 as ObserverExtensionRegistration, bp as OpenAiFunctionCall, bq as OpenAiFunctionCallOutput, bx as OpenAiFunctionTool, bn as OpenAiInputImage, bo as OpenAiInputMessage, bm as OpenAiInputText, bt as OpenAiOutputMessage, br as OpenAiOutputTextPart, a2 as OpenAiReasoningBlock, ap as OpenAiReasoningDeltaChunk, ad as OpenAiReasoningEffort, bu as OpenAiReasoningOutputItem, ae as OpenAiReasoningSummary, aq as OpenAiReasoningSummaryDeltaChunk, a1 as OpenAiReasoningSummaryText, bs as OpenAiRefusalPart, bv as OpenAiResponsesOutputItem, bw as OpenAiResponsesReasoningParam, O as OpenAiResponsesRequest, b4 as PayloadByStage, aw as PrepareRequestInput, r as PreparedRequest, s as ProviderCredential, y as ProviderCredentialKind, z as ProviderEndpoints, q as ProviderRequestMutator, P as ProviderSessionResolver, a6 as ReasoningVisibility, p as ResolvedProviderSession, R as RunTurnDeps, bk as RuntimeManagerOptions, b3 as Stage, S as SystemInput, e as TextBlock, b1 as ToolDefinition, az as ToolExecutionContext, b0 as ToolGenerator, au as ToolOutputEnvelope, a$ as ToolOutputValue, o as ToolResult, n as ToolResultBlock, at as ToolResultChunk, _ as ToolResultContent, Z as ToolResultContentBlock, as as ToolResultMeta, aZ as ToolRuntime, aC as ToolRuntimeCompletedEvent, aV as ToolRuntimeDispatchDecision, aE as ToolRuntimeEvent, aX as ToolRuntimeEventHandler, aB as ToolRuntimeOutputChunkEvent, aD as ToolRuntimeRejectedEvent, aA as ToolRuntimeStartedEvent, aW as ToolRuntimeToolCallHandler, aj as ToolSchema, m as ToolUseBlock, am as ToolUseDeltaChunk, b6 as Transformer, b8 as TransformerExtensionRegistration, c as TurnInput, T as TurnResult, av as TurnResultStatus, d as TurnState, ak as Usage } from '../types-QPBW5jHO.js';
3
3
 
4
4
  declare class OperationAbortedError extends Error {
5
5
  readonly code = "ABORT_ERR";
@@ -1 +1 @@
1
- function _0x12e2(){var _0x54425a=['nduZmtG0ofvMu1HlvG','mtG1nJGWnhP1zKnrzW','mJy1mJfUDLnYD1u','mujYANzbzG','mJeZotuXnKj4Bg5bsq','nJm5v1vRwvfQ','ndq2mde5yuzODgD0','nZKWohvtCvPnCW','mJruqMXkz2m','nxPKrMLfvG','mtmYntCWtgLIy3LX','mZyYmtiYEwjdBhDy'];_0x12e2=function(){return _0x54425a;};return _0x12e2();}(function(_0x2d5569,_0x216f6e){var _0x1c4ec1={_0x1b7536:0x283,_0x5566d9:0x287,_0x195e12:0x4ff,_0x3d82ef:0x503,_0x4a19fc:0x502,_0x28e319:0x4f8,_0x292e7b:0x4f4,_0x457404:0x4f3,_0x21d2e6:0x4fb,_0x3f699:0x280,_0x2cece4:0x281,_0x3a0fdb:0x27c,_0x73f0c4:0x289,_0x2f75d5:0x287,_0x29b8af:0x4fa,_0x572f77:0x4fd,_0x572c98:0x4fd,_0x2cc88b:0x28c,_0x5531c9:0x282},_0x52265a={_0x451f6e:0x336};function _0x1f401f(_0x573741,_0xf5a9cd,_0x5754ef,_0x3be0a7){return _0xdcb4(_0x573741-_0x52265a._0x451f6e,_0xf5a9cd);}var _0x163090=_0x2d5569();function _0x39f551(_0x4971a6,_0x1ce819,_0x13bc23,_0x31d60a){return _0xdcb4(_0x1ce819-0xc2,_0x4971a6);}while(!![]){try{var _0x37afca=parseInt(_0x39f551(0x282,_0x1c4ec1._0x1b7536,_0x1c4ec1._0x5566d9,0x288))/0x1*(parseInt(_0x1f401f(_0x1c4ec1._0x195e12,0x504,_0x1c4ec1._0x3d82ef,_0x1c4ec1._0x4a19fc))/0x2)+-parseInt(_0x1f401f(_0x1c4ec1._0x28e319,_0x1c4ec1._0x292e7b,_0x1c4ec1._0x457404,_0x1c4ec1._0x21d2e6))/0x3+parseInt(_0x39f551(_0x1c4ec1._0x3f699,_0x1c4ec1._0x2cece4,_0x1c4ec1._0x3a0fdb,0x27b))/0x4*(-parseInt(_0x39f551(0x28d,_0x1c4ec1._0x73f0c4,0x28c,_0x1c4ec1._0x2f75d5))/0x5)+-parseInt(_0x1f401f(0x4fc,_0x1c4ec1._0x29b8af,0x501,0x4f6))/0x6*(-parseInt(_0x1f401f(0x4fa,_0x1c4ec1._0x572f77,_0x1c4ec1._0x572c98,0x4f6))/0x7)+parseInt(_0x39f551(0x28a,_0x1c4ec1._0x2cc88b,0x288,0x286))/0x8+-parseInt(_0x39f551(_0x1c4ec1._0x73f0c4,0x285,_0x1c4ec1._0x3f699,0x283))/0x9*(parseInt(_0x39f551(0x286,0x28a,0x286,_0x1c4ec1._0x2f75d5))/0xa)+-parseInt(_0x39f551(0x288,_0x1c4ec1._0x5531c9,0x27e,0x27f))/0xb*(-parseInt(_0x39f551(0x28b,0x287,0x284,0x281))/0xc);if(_0x37afca===_0x216f6e)break;else _0x163090['push'](_0x163090['shift']());}catch(_0x2dfa54){_0x163090['push'](_0x163090['shift']());}}}(_0x12e2,0x7363f));function _0xdcb4(_0x227c97,_0x5adee4){_0x227c97=_0x227c97-0x1bf;var _0x12e277=_0x12e2();var _0xdcb404=_0x12e277[_0x227c97];if(_0xdcb4['RHJFZA']===undefined){var _0x1adb61=function(_0x461385){var _0x47618c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x277de7='',_0x38d230='';for(var _0xbb77c8=0x0,_0x18464c,_0x3c8b35,_0x4c42e0=0x0;_0x3c8b35=_0x461385['charAt'](_0x4c42e0++);~_0x3c8b35&&(_0x18464c=_0xbb77c8%0x4?_0x18464c*0x40+_0x3c8b35:_0x3c8b35,_0xbb77c8++%0x4)?_0x277de7+=String['fromCharCode'](0xff&_0x18464c>>(-0x2*_0xbb77c8&0x6)):0x0){_0x3c8b35=_0x47618c['indexOf'](_0x3c8b35);}for(var _0x3680c=0x0,_0x38226f=_0x277de7['length'];_0x3680c<_0x38226f;_0x3680c++){_0x38d230+='%'+('00'+_0x277de7['charCodeAt'](_0x3680c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x38d230);};_0xdcb4['FGeYrZ']=_0x1adb61,_0xdcb4['WuxcAL']={},_0xdcb4['RHJFZA']=!![];}var _0x3213ce=_0x12e277[0x0],_0x446830=_0x227c97+_0x3213ce,_0xb311cf=_0xdcb4['WuxcAL'][_0x446830];return!_0xb311cf?(_0xdcb404=_0xdcb4['FGeYrZ'](_0xdcb404),_0xdcb4['WuxcAL'][_0x446830]=_0xdcb404):_0xdcb404=_0xb311cf,_0xdcb404;}import{mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig}from'../chunk-NYZR4XKO.js';import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';export{OperationAbortedError,addAbortListener,isAbortError,mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};
1
+ (function(_0x45bda9,_0x34f9be){var _0x286c51={_0x24b4cb:0xd8,_0x2de504:0xd4,_0xe75a21:0xd3,_0x541c02:0xd8,_0x56a0df:0xde,_0xb47cd5:0xd9,_0x10ec4e:0xd7,_0x31b4ac:0xd5,_0x583cd7:0x21d,_0x5d044a:0x221,_0x5c9d09:0x21a,_0x10e2a2:0x214,_0x184b11:0x219,_0x3a3cf1:0x215,_0x1ba193:0x222,_0x779ce3:0x21f,_0x5ce91f:0xd8,_0x412100:0xce},_0x44c47e={_0x4e7008:0x3c},_0x40edbc=_0x45bda9();function _0x241699(_0x48667c,_0xba3c4e,_0x5f5951,_0x2415b7){return _0x4b68(_0x2415b7- -0x2b4,_0xba3c4e);}function _0x2632bf(_0x438478,_0x481dd3,_0x116e4b,_0xfd1a1c){return _0x4b68(_0xfd1a1c-_0x44c47e._0x4e7008,_0x438478);}while(!![]){try{var _0x382f92=parseInt(_0x241699(-_0x286c51._0x24b4cb,-_0x286c51._0x2de504,-_0x286c51._0xe75a21,-0xd7))/0x1*(-parseInt(_0x241699(-0xd5,-_0x286c51._0x541c02,-_0x286c51._0x56a0df,-_0x286c51._0xb47cd5))/0x2)+-parseInt(_0x241699(-_0x286c51._0x10ec4e,-0xce,-0xce,-0xd3))/0x3*(-parseInt(_0x241699(-_0x286c51._0x24b4cb,-0xd3,-0xd5,-0xd8))/0x4)+-parseInt(_0x241699(-_0x286c51._0xe75a21,-0xd5,-0xd3,-_0x286c51._0x31b4ac))/0x5*(-parseInt(_0x2632bf(_0x286c51._0x583cd7,0x21c,_0x286c51._0x5d044a,0x21e))/0x6)+-parseInt(_0x2632bf(0x21c,0x217,0x21b,_0x286c51._0x5c9d09))/0x7+parseInt(_0x2632bf(_0x286c51._0x10e2a2,_0x286c51._0x184b11,_0x286c51._0x3a3cf1,0x216))/0x8+-parseInt(_0x2632bf(0x21a,_0x286c51._0x1ba193,0x222,_0x286c51._0x779ce3))/0x9+parseInt(_0x241699(-0xdf,-_0x286c51._0x56a0df,-_0x286c51._0x5ce91f,-0xdb))/0xa*(-parseInt(_0x241699(-0xd6,-0xd9,-_0x286c51._0x412100,-0xd4))/0xb);if(_0x382f92===_0x34f9be)break;else _0x40edbc['push'](_0x40edbc['shift']());}catch(_0xf39296){_0x40edbc['push'](_0x40edbc['shift']());}}}(_0x1002,0x6e122));import{mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig}from'../chunk-NYZR4XKO.js';import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';function _0x4b68(_0x492945,_0x3865c9){_0x492945=_0x492945-0x1d9;var _0x1002db=_0x1002();var _0x4b68df=_0x1002db[_0x492945];if(_0x4b68['kZcJsm']===undefined){var _0x353924=function(_0x770c2){var _0x1beb2a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x252ee5='',_0x14ef2e='';for(var _0x580345=0x0,_0x36ac06,_0x2e9d2c,_0x4a9f24=0x0;_0x2e9d2c=_0x770c2['charAt'](_0x4a9f24++);~_0x2e9d2c&&(_0x36ac06=_0x580345%0x4?_0x36ac06*0x40+_0x2e9d2c:_0x2e9d2c,_0x580345++%0x4)?_0x252ee5+=String['fromCharCode'](0xff&_0x36ac06>>(-0x2*_0x580345&0x6)):0x0){_0x2e9d2c=_0x1beb2a['indexOf'](_0x2e9d2c);}for(var _0x204eff=0x0,_0x4bc1f9=_0x252ee5['length'];_0x204eff<_0x4bc1f9;_0x204eff++){_0x14ef2e+='%'+('00'+_0x252ee5['charCodeAt'](_0x204eff)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x14ef2e);};_0x4b68['dbxWPb']=_0x353924,_0x4b68['IGHNCb']={},_0x4b68['kZcJsm']=!![];}var _0x3db008=_0x1002db[0x0],_0x4ee899=_0x492945+_0x3db008,_0x2a2e19=_0x4b68['IGHNCb'][_0x4ee899];return!_0x2a2e19?(_0x4b68df=_0x4b68['dbxWPb'](_0x4b68df),_0x4b68['IGHNCb'][_0x4ee899]=_0x4b68df):_0x4b68df=_0x2a2e19,_0x4b68df;}export{OperationAbortedError,addAbortListener,isAbortError,mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};function _0x1002(){var _0x59995e=['nda3ndG2ne9swufXra','nZC4ndjQCxHMEwG','nhrxBMfJsq','mtnxthvxthi','mtqYmJq3ueXzy1LK','nw1PB0T3AW','mJy0yLzHAw1u','mJi4nZGZmeH3uvjtEa','nZKYndi2B0Pfz2nw','mJyXnZC2n29nAerTwG','nty2odbfC0zSCe0'];_0x1002=function(){return _0x59995e;};return _0x1002();}
@@ -1,4 +1,7 @@
1
- import { aZ as ToolDefinition, aq as ToolOutputEnvelope, a_ as AnyToolDefinition, aT as ToolRuntimeEventHandler, aS as ToolRuntimeToolCallHandler, aV as ToolRuntime, b8 as AgentDefinitionFactoryContext, A as AgentOptions, aX as ToolOutputValue, ap as ToolResultChunk, H as JsonObject, V as JsonSchemaObject, aW as InferJsonSchema, av as ToolExecutionContext, af as ToolSchema, I as JsonValue } from '../types-BueDJWnx.js';
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
+ import { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';
4
+ import { CallToolResult, ListToolsResult } from '@modelcontextprotocol/sdk/types.js';
2
5
 
3
6
  interface BashToolInput {
4
7
  command: string;
@@ -62,6 +65,28 @@ declare function createShellExecTool(options?: BashToolOptions): ToolDefinition<
62
65
  required: readonly ["command"];
63
66
  }>;
64
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;
77
+ }, ToolOutputEnvelope, undefined, {
78
+ type: "object";
79
+ properties: {
80
+ name: {
81
+ type: "string";
82
+ };
83
+ args: {
84
+ type: "string";
85
+ };
86
+ };
87
+ required: readonly ["name"];
88
+ }>;
89
+
65
90
  interface FileEditToolOptions {
66
91
  defaultCwd?: string;
67
92
  name?: string;
@@ -95,8 +120,8 @@ interface FileNewToolOptions {
95
120
  name?: string;
96
121
  }
97
122
  declare function createFileNewTool(options?: FileNewToolOptions): ToolDefinition<{
98
- filePath: string;
99
123
  content: string;
124
+ filePath: string;
100
125
  }, ToolOutputEnvelope, undefined, {
101
126
  type: "object";
102
127
  properties: {
@@ -217,6 +242,98 @@ declare function createLsTool(options?: LsToolOptions): ToolDefinition<{
217
242
  };
218
243
  }>;
219
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;
271
+ }): 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
+ };
297
+ }, ToolOutputEnvelope, undefined, JsonSchemaObject<Record<string, JsonSchema>, readonly string[] | undefined>>;
298
+
299
+ interface ConnectedMcpClient extends McpToolClient {
300
+ listTools(): Promise<ListToolsResult>;
301
+ close(): Promise<void>;
302
+ }
303
+ type McpServerConnectionStatus = {
304
+ status: "connected";
305
+ toolCount: number;
306
+ } | {
307
+ status: "disabled";
308
+ } | {
309
+ status: "authRequired";
310
+ message: string;
311
+ } | {
312
+ status: "error";
313
+ message: string;
314
+ };
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;
335
+ }): Promise<McpToolBundle>;
336
+
220
337
  declare function createMockToolRuntime(): ToolRuntime;
221
338
 
222
339
  type RipgrepMatch = {
@@ -248,8 +365,8 @@ interface CreateDelegationToolsOptions {
248
365
  agents?: Record<string, DelegatedAgentDefinition>;
249
366
  }
250
367
  declare function createAssignTaskTool(options: CreateDelegationToolsOptions): ToolDefinition<{
251
- agentId: string;
252
368
  task: string;
369
+ agentId: string;
253
370
  }, ToolOutputEnvelope, ToolOutputEnvelope, {
254
371
  type: "object";
255
372
  properties: {
@@ -264,8 +381,8 @@ declare function createAssignTaskTool(options: CreateDelegationToolsOptions): To
264
381
  }>;
265
382
  declare const createDelegateToAgentTool: typeof createAssignTaskTool;
266
383
  declare function createDelegationTools(options: CreateDelegationToolsOptions): ToolDefinition<{
267
- agentId: string;
268
384
  task: string;
385
+ agentId: string;
269
386
  }, ToolOutputEnvelope, ToolOutputEnvelope, {
270
387
  type: "object";
271
388
  properties: {
@@ -279,8 +396,41 @@ declare function createDelegationTools(options: CreateDelegationToolsOptions): T
279
396
  required: string[];
280
397
  }>[];
281
398
 
399
+ /** Minimal shape of a skill source reference — matches @nuvin/config SkillDefinitionSource */
400
+ interface SkillSource {
401
+ path: string;
402
+ directory?: string;
403
+ scope?: string;
404
+ }
405
+ /** 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;
411
+ }
412
+ /** Minimal shape of a loaded skill — matches @nuvin/config SerializedSkillDefinition */
413
+ interface LoadedSkill extends SkillReference {
414
+ instructions: string;
415
+ }
416
+ interface SkillToolOptions<TRef extends SkillReference = SkillReference> {
417
+ skills: TRef[];
418
+ loadSkill: (reference: TRef) => Promise<LoadedSkill>;
419
+ }
420
+ declare function createLoadSkillTool<TRef extends SkillReference>(options: SkillToolOptions<TRef>): ToolDefinition<{
421
+ name: string;
422
+ }, ToolOutputEnvelope, undefined, {
423
+ type: "object";
424
+ properties: {
425
+ name: {
426
+ type: "string";
427
+ };
428
+ };
429
+ required: readonly ["name"];
430
+ }>;
431
+
282
432
  declare function normalizeToolOutputValue(output: ToolOutputValue): ToolResultChunk;
283
- declare function createToolOutput(output: string, structured?: JsonObject): ToolOutputEnvelope;
433
+ declare function createToolOutput(output: string, structured?: JsonObject, content?: ToolResultContent): ToolOutputEnvelope;
284
434
  declare class ToolExecutionError extends Error {
285
435
  readonly structured: JsonObject;
286
436
  constructor(message: string, structured?: JsonObject);
@@ -302,8 +452,29 @@ declare class ToolRegistry {
302
452
  declare function validateToolInput<TSchema extends JsonSchemaObject>(input: JsonValue, schema: TSchema): InferJsonSchema<TSchema>;
303
453
  declare function deriveFinalToolOutput(chunks: ToolResultChunk[]): ToolResultChunk;
304
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;
463
+ }, ToolOutputEnvelope, undefined, {
464
+ type: "object";
465
+ properties: {
466
+ path: {
467
+ type: "string";
468
+ };
469
+ detail: {
470
+ type: "string";
471
+ };
472
+ };
473
+ required: readonly ["path"];
474
+ }>;
475
+
305
476
  declare function resolveWorkspacePath(rootDir: string, inputPath: string): string;
306
477
  declare function assertWorkspaceFile(filePath: string): Promise<void>;
307
478
  declare function isProbablyBinary(buffer: Buffer): boolean;
308
479
 
309
- export { type BashToolInput, type BashToolOptions, type CreateDelegationToolsOptions, type DelegatedAgentDefinition, type DelegatedAgentFactoryContext, type FileEditToolOptions, type FileNewToolOptions, type FileReadToolOptions, type GlobToolOptions, type GrepToolOptions, type LsToolOptions, type RipgrepMatch, ToolExecutionError, ToolRegistry, assertWorkspaceFile, createAssignTaskTool, createBashTool, createDelegateToAgentTool, createDelegationTools, createFileEditTool, createFileNewTool, createFileReadTool, createGlobTool, createGrepTool, createInternalToolRuntime, createLsTool, createMockToolRuntime, createShellExecTool, createToolOutput, defineTool, deriveFinalToolOutput, filepath, files, isProbablyBinary, normalizeToolOutputValue, resolveWorkspacePath, search, validateToolInput };
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 };