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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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-D11KxtW1.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-D11KxtW1.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-D11KxtW1.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(_0x4f8c74,_0x5e96f9){var _0x305a91={_0x426cb3:0x51e,_0x26eb00:0x15e,_0x296111:0x522,_0xbbf22d:0x520,_0x5550b0:0x526,_0xbaa38d:0x155,_0x4bbc6a:0x523,_0xbe0cea:0x51d,_0x35f559:0x158,_0x26c315:0x157,_0x49c468:0x154,_0x4534ad:0x156,_0x2f4b47:0x524,_0x2f4594:0x528,_0x3a880c:0x524,_0x3f00e2:0x51a},_0x14a2e3={_0x1e6565:0x38f},_0x31f357=_0x4f8c74();function _0x555ee0(_0x5315fc,_0x571acd,_0x227e3e,_0x48436c){return _0x4c6b(_0x48436c- -0x2eb,_0x571acd);}function _0x2c82b2(_0x59264c,_0x2f9410,_0xe6dd1a,_0x481923){return _0x4c6b(_0xe6dd1a-_0x14a2e3._0x1e6565,_0x59264c);}while(!![]){try{var _0x4be6ee=-parseInt(_0x2c82b2(0x51b,0x51a,_0x305a91._0x426cb3,0x523))/0x1*(-parseInt(_0x555ee0(-0x15c,-_0x305a91._0x26eb00,-0x15b,-0x15b))/0x2)+parseInt(_0x2c82b2(_0x305a91._0x296111,_0x305a91._0xbbf22d,0x51c,0x51b))/0x3+-parseInt(_0x2c82b2(0x51b,0x523,0x521,_0x305a91._0x5550b0))/0x4+parseInt(_0x555ee0(-_0x305a91._0xbaa38d,-0x158,-0x157,-0x157))/0x5*(parseInt(_0x2c82b2(_0x305a91._0x4bbc6a,0x522,0x522,_0x305a91._0xbe0cea))/0x6)+-parseInt(_0x555ee0(-_0x305a91._0x35f559,-0x15b,-_0x305a91._0x26c315,-_0x305a91._0xbaa38d))/0x7+parseInt(_0x555ee0(-_0x305a91._0x49c468,-_0x305a91._0x4534ad,-_0x305a91._0x35f559,-0x154))/0x8*(-parseInt(_0x2c82b2(0x529,_0x305a91._0x5550b0,_0x305a91._0x2f4b47,_0x305a91._0x2f4594))/0x9)+-parseInt(_0x2c82b2(0x523,0x522,_0x305a91._0xbbf22d,_0x305a91._0x3a880c))/0xa*(-parseInt(_0x2c82b2(0x518,_0x305a91._0x3f00e2,0x51d,0x51e))/0xb);if(_0x4be6ee===_0x5e96f9)break;else _0x31f357['push'](_0x31f357['shift']());}catch(_0x3d4aad){_0x31f357['push'](_0x31f357['shift']());}}}(_0x3b48,0xb93dc));function _0x3b48(){var _0x4b214c=['mZy4odiWnLDSBenjrq','nu9Izfnbsa','mZeYmZGXAw5Yv2rj','mZGWnJmXm2H5r0XcrG','mJaWBervteHt','mtG4nJCZmfDgt2DStq','odHbuKLhD1G','odDHtw1qDNi','mJqYmLHMz25IsG','mJi2otu3mg1Is2DuyG','mZK3nZu2ofr1tNHTqG'];_0x3b48=function(){return _0x4b214c;};return _0x3b48();}import{mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig}from'../chunk-NYZR4XKO.js';function _0x4c6b(_0x1f9cee,_0x45a96a){_0x1f9cee=_0x1f9cee-0x18d;var _0x3b488a=_0x3b48();var _0x4c6b0e=_0x3b488a[_0x1f9cee];if(_0x4c6b['gouSjh']===undefined){var _0x174420=function(_0x35247f){var _0x45a821='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x45ce53='',_0x32ffad='';for(var _0x4372d0=0x0,_0x1071f9,_0x430087,_0x1e9a96=0x0;_0x430087=_0x35247f['charAt'](_0x1e9a96++);~_0x430087&&(_0x1071f9=_0x4372d0%0x4?_0x1071f9*0x40+_0x430087:_0x430087,_0x4372d0++%0x4)?_0x45ce53+=String['fromCharCode'](0xff&_0x1071f9>>(-0x2*_0x4372d0&0x6)):0x0){_0x430087=_0x45a821['indexOf'](_0x430087);}for(var _0x146cce=0x0,_0x5cb6d1=_0x45ce53['length'];_0x146cce<_0x5cb6d1;_0x146cce++){_0x32ffad+='%'+('00'+_0x45ce53['charCodeAt'](_0x146cce)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x32ffad);};_0x4c6b['ylaSnc']=_0x174420,_0x4c6b['LcedZS']={},_0x4c6b['gouSjh']=!![];}var _0x43166c=_0x3b488a[0x0],_0x3813fd=_0x1f9cee+_0x43166c,_0x29d25c=_0x4c6b['LcedZS'][_0x3813fd];return!_0x29d25c?(_0x4c6b0e=_0x4c6b['ylaSnc'](_0x4c6b0e),_0x4c6b['LcedZS'][_0x3813fd]=_0x4c6b0e):_0x4c6b0e=_0x29d25c,_0x4c6b0e;}import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';export{OperationAbortedError,addAbortListener,isAbortError,mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};
@@ -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 { aZ as ToolDefinition, aq as ToolOutputEnvelope, a_ as AnyToolDefinition, aT as ToolRuntimeEventHandler, aS as ToolRuntimeToolCallHandler, aV as ToolRuntime, H as JsonObject, V as JsonSchemaObject, W as JsonSchema, b8 as AgentDefinitionFactoryContext, A as AgentOptions, aX as ToolOutputValue, ap as ToolResultChunk, aW as InferJsonSchema, av as ToolExecutionContext, af as ToolSchema, I as JsonValue } from '../types-D11KxtW1.js';
2
+ import { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';
3
+ import { MCPAuthConfig, MCPServerConfig } from '@nuvin/config';
4
+ import { CallToolResult, ListToolsResult } from '@modelcontextprotocol/sdk/types.js';
2
5
 
3
6
  interface BashToolInput {
4
7
  command: string;
@@ -62,6 +65,42 @@ declare function createShellExecTool(options?: BashToolOptions): ToolDefinition<
62
65
  required: readonly ["command"];
63
66
  }>;
64
67
 
68
+ interface CommandSource {
69
+ path: string;
70
+ directory?: string;
71
+ scope?: string;
72
+ }
73
+ interface CommandReference {
74
+ id: string;
75
+ name: string;
76
+ description: string;
77
+ argumentHint?: string;
78
+ arguments?: string[];
79
+ source: CommandSource;
80
+ }
81
+ interface LoadedCommand extends CommandReference {
82
+ instructions: string;
83
+ }
84
+ interface CommandToolOptions<TRef extends CommandReference = CommandReference> {
85
+ commands: TRef[];
86
+ loadCommand: (reference: TRef) => Promise<LoadedCommand>;
87
+ }
88
+ declare function createInvokeCommandTool<TRef extends CommandReference>(options: CommandToolOptions<TRef>): ToolDefinition<{
89
+ name: string;
90
+ args?: string | undefined;
91
+ }, ToolOutputEnvelope, undefined, {
92
+ type: "object";
93
+ properties: {
94
+ name: {
95
+ type: "string";
96
+ };
97
+ args: {
98
+ type: "string";
99
+ };
100
+ };
101
+ required: readonly ["name"];
102
+ }>;
103
+
65
104
  interface FileEditToolOptions {
66
105
  defaultCwd?: string;
67
106
  name?: string;
@@ -217,6 +256,98 @@ declare function createLsTool(options?: LsToolOptions): ToolDefinition<{
217
256
  };
218
257
  }>;
219
258
 
259
+ interface McpOAuthProviderOptions {
260
+ serverName: string;
261
+ callbackUrl: string;
262
+ storageDir: string;
263
+ config: MCPAuthConfig;
264
+ onRedirect(url: URL): void | Promise<void>;
265
+ }
266
+ declare function createMcpOAuthProvider(options: McpOAuthProviderOptions): OAuthClientProvider;
267
+
268
+ interface McpToolDescriptor {
269
+ name: string;
270
+ description?: string;
271
+ inputSchema?: unknown;
272
+ }
273
+ interface McpToolClient {
274
+ callTool(input: {
275
+ name: string;
276
+ arguments?: JsonObject;
277
+ }): Promise<CallToolResult>;
278
+ }
279
+ declare function createMcpToolName(serverName: string, toolName: string): string;
280
+ declare function toNuvinToolSchema(inputSchema: unknown): JsonSchemaObject;
281
+ declare function createMcpTool(options: {
282
+ serverName: string;
283
+ tool: McpToolDescriptor;
284
+ client: McpToolClient;
285
+ }): ToolDefinition<{
286
+ [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 | {
287
+ [x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any;
288
+ })[] | {
289
+ [x: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any;
290
+ })[] | {
291
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
292
+ })[] | {
293
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*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 | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
296
+ })[] | {
297
+ [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;
298
+ })[] | {
299
+ [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;
300
+ })[] | {
301
+ [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;
302
+ })[] | {
303
+ [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;
304
+ })[] | {
305
+ [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;
306
+ })[] | {
307
+ [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;
308
+ })[] | {
309
+ [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;
310
+ };
311
+ }, ToolOutputEnvelope, undefined, JsonSchemaObject<Record<string, JsonSchema>, readonly string[] | undefined>>;
312
+
313
+ interface ConnectedMcpClient extends McpToolClient {
314
+ listTools(): Promise<ListToolsResult>;
315
+ close(): Promise<void>;
316
+ }
317
+ type McpServerConnectionStatus = {
318
+ status: "connected";
319
+ toolCount: number;
320
+ } | {
321
+ status: "disabled";
322
+ } | {
323
+ status: "authRequired";
324
+ message: string;
325
+ } | {
326
+ status: "error";
327
+ message: string;
328
+ };
329
+ interface McpToolBundle {
330
+ tools: AnyToolDefinition[];
331
+ servers: Record<string, McpServerConnectionStatus>;
332
+ close(): Promise<void>;
333
+ }
334
+ interface McpConnectionOptions {
335
+ oauth?: {
336
+ storageDir: string;
337
+ callbackUrl: string;
338
+ onRedirect(serverName: string, url: URL): void | Promise<void>;
339
+ };
340
+ }
341
+ type McpConnector = (serverName: string, config: MCPServerConfig, options?: McpConnectionOptions) => Promise<ConnectedMcpClient>;
342
+ declare function buildMcpHttpHeaders(config: MCPServerConfig): Record<string, string> | undefined;
343
+ declare function connectMcpServer(serverName: string, config: MCPServerConfig, options?: McpConnectionOptions): Promise<ConnectedMcpClient>;
344
+ declare function createMcpToolsFromServers(options: {
345
+ servers?: Record<string, MCPServerConfig>;
346
+ allowedTools?: Record<string, Record<string, boolean>>;
347
+ connection?: McpConnectionOptions;
348
+ connect?: McpConnector;
349
+ }): Promise<McpToolBundle>;
350
+
220
351
  declare function createMockToolRuntime(): ToolRuntime;
221
352
 
222
353
  type RipgrepMatch = {
@@ -248,8 +379,8 @@ interface CreateDelegationToolsOptions {
248
379
  agents?: Record<string, DelegatedAgentDefinition>;
249
380
  }
250
381
  declare function createAssignTaskTool(options: CreateDelegationToolsOptions): ToolDefinition<{
251
- agentId: string;
252
382
  task: string;
383
+ agentId: string;
253
384
  }, ToolOutputEnvelope, ToolOutputEnvelope, {
254
385
  type: "object";
255
386
  properties: {
@@ -264,8 +395,8 @@ declare function createAssignTaskTool(options: CreateDelegationToolsOptions): To
264
395
  }>;
265
396
  declare const createDelegateToAgentTool: typeof createAssignTaskTool;
266
397
  declare function createDelegationTools(options: CreateDelegationToolsOptions): ToolDefinition<{
267
- agentId: string;
268
398
  task: string;
399
+ agentId: string;
269
400
  }, ToolOutputEnvelope, ToolOutputEnvelope, {
270
401
  type: "object";
271
402
  properties: {
@@ -279,6 +410,39 @@ declare function createDelegationTools(options: CreateDelegationToolsOptions): T
279
410
  required: string[];
280
411
  }>[];
281
412
 
413
+ /** Minimal shape of a skill source reference — matches @nuvin/config SkillDefinitionSource */
414
+ interface SkillSource {
415
+ path: string;
416
+ directory?: string;
417
+ scope?: string;
418
+ }
419
+ /** Minimal shape of a skill reference — matches @nuvin/config SkillDefinitionReference */
420
+ interface SkillReference {
421
+ id: string;
422
+ name: string;
423
+ description: string;
424
+ source: SkillSource;
425
+ }
426
+ /** Minimal shape of a loaded skill — matches @nuvin/config SerializedSkillDefinition */
427
+ interface LoadedSkill extends SkillReference {
428
+ instructions: string;
429
+ }
430
+ interface SkillToolOptions<TRef extends SkillReference = SkillReference> {
431
+ skills: TRef[];
432
+ loadSkill: (reference: TRef) => Promise<LoadedSkill>;
433
+ }
434
+ declare function createLoadSkillTool<TRef extends SkillReference>(options: SkillToolOptions<TRef>): ToolDefinition<{
435
+ name: string;
436
+ }, ToolOutputEnvelope, undefined, {
437
+ type: "object";
438
+ properties: {
439
+ name: {
440
+ type: "string";
441
+ };
442
+ };
443
+ required: readonly ["name"];
444
+ }>;
445
+
282
446
  declare function normalizeToolOutputValue(output: ToolOutputValue): ToolResultChunk;
283
447
  declare function createToolOutput(output: string, structured?: JsonObject): ToolOutputEnvelope;
284
448
  declare class ToolExecutionError extends Error {
@@ -306,4 +470,4 @@ declare function resolveWorkspacePath(rootDir: string, inputPath: string): strin
306
470
  declare function assertWorkspaceFile(filePath: string): Promise<void>;
307
471
  declare function isProbablyBinary(buffer: Buffer): boolean;
308
472
 
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 };
473
+ export { type BashToolInput, type BashToolOptions, type CommandReference, type CommandSource, 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, assertWorkspaceFile, buildMcpHttpHeaders, connectMcpServer, createAssignTaskTool, createBashTool, createDelegateToAgentTool, createDelegationTools, createFileEditTool, createFileNewTool, createFileReadTool, createGlobTool, createGrepTool, createInternalToolRuntime, createInvokeCommandTool, createLoadSkillTool, createLsTool, createMcpOAuthProvider, createMcpTool, createMcpToolName, createMcpToolsFromServers, createMockToolRuntime, createShellExecTool, createToolOutput, defineTool, deriveFinalToolOutput, filepath, files, isProbablyBinary, normalizeToolOutputValue, resolveWorkspacePath, search, toNuvinToolSchema, validateToolInput };