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

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-D11KxtW1.js';
1
+ import { C as ChatRequest, O as OpenAiResponsesRequest } from './types-Df0vlfj-.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-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';
1
+ import { G as AutoReasoningEffort, v as ReasoningConfig, H as AnthropicThinkingConfig, I as OpenAiReasoningConfig } from '../types-Df0vlfj-.js';
2
+ export { aQ as AgentAssistantChunkEvent, aP as AgentAssistantMessageEvent, bl as AgentDefinition, bk as AgentDefinitionFactoryContext, A as AgentEvent, aB as AgentEventContext, b3 as AgentEventHandler, aY as AgentFinalMessageEvent, b as AgentInput, a$ as AgentLifecycleEvent, aN as AgentModelRequestEvent, aO as AgentModelResponseEvent, a as AgentOptions, a_ as AgentProviderRetryEvent, aU as AgentReasoningChunkEvent, aT as AgentReasoningMessageEvent, c as AgentSendOptions, aV as AgentToolCallEvent, aW as AgentToolResultEvent, aX as AgentToolResultMessageEvent, aS as AgentToolUseChunkEvent, aR as AgentToolUseMessageEvent, aZ as AgentTurnCompleteEvent, aM as AgentUserMessageEvent, ad as AnthropicAdaptiveThinkingConfig, a7 as AnthropicAssistantContentBlock, ae as AnthropicDisabledThinkingConfig, ac as AnthropicEnabledThinkingConfig, a2 as AnthropicRedactedThinkingBlock, a6 as AnthropicRedactedThinkingWireBlock, aq as AnthropicSignatureDeltaChunk, a1 as AnthropicThinkingBlock, ap as AnthropicThinkingDeltaChunk, aa as AnthropicThinkingDisplay, ab as AnthropicThinkingEffort, a5 as AnthropicThinkingWireBlock, bj as AnyExtensionRegistration, b9 as AnyToolDefinition, aE as AskUserAnswers, aC as AskUserOption, aD as AskUserQuestion, aF as AskUserQuestionRequest, ai as AssistantContentBlock, a9 as AutoReasoningConfig, B as BaseChatModelOptions, aA as ChatModel, C as ChatRequest, n as ChatResponse, w as ChatResponseChunk, k as CompileRequestInput, g as ContentBlock, an as ContentDeltaChunk, i as ContentInput, bt as CreateManagedRunInput, au as DoneChunk, E as EngineChatModel, be as ExtensionContext, d as ExtensionRegistry, ak as IdentifiedMessage, _ as ImageBlock, Z as ImageMediaType, b5 as InferJsonSchema, K as JsonObject, J as JsonPrimitive, Y as JsonSchema, W as JsonSchemaArray, V as JsonSchemaBoolean, U as JsonSchemaNumber, X as JsonSchemaObject, Q as JsonSchemaString, N as JsonSchemaType, L as JsonValue, bo as ManagedAgentRun, bp as ManagedAgentRunHandle, bn as ManagedRunError, bq as ManagedRunEvent, br as ManagedRunEventHandler, bm as ManagedRunStatus, M as Message, j as MessageInput, ah as MessageProviderState, aj as MessageRole, x as ModelExecutionOptions, y as ModelInfo, z as ModelLimits, l as ModelRequest, m as ModelResponse, bg as Observer, bi as ObserverExtensionRegistration, bb as ObserverOnlyStage, bx as OpenAiFunctionCall, by as OpenAiFunctionCallOutput, bF as OpenAiFunctionTool, bv as OpenAiInputImage, bw as OpenAiInputMessage, bu as OpenAiInputText, bB as OpenAiOutputMessage, bz as OpenAiOutputTextPart, a4 as OpenAiReasoningBlock, ar as OpenAiReasoningDeltaChunk, af as OpenAiReasoningEffort, bC as OpenAiReasoningOutputItem, ag as OpenAiReasoningSummary, as as OpenAiReasoningSummaryDeltaChunk, a3 as OpenAiReasoningSummaryText, bA as OpenAiRefusalPart, bD as OpenAiResponsesOutputItem, bE as OpenAiResponsesReasoningParam, O as OpenAiResponsesRequest, bd as PayloadByStage, az as PrepareRequestInput, t as PreparedRequest, u as ProviderCredential, D as ProviderCredentialKind, F as ProviderEndpoints, s as ProviderRequestMutator, at as ProviderRetryChunk, P as ProviderSessionResolver, a8 as ReasoningVisibility, r as ResolvedProviderSession, R as RunTurnDeps, bs as RuntimeManagerOptions, bc as Stage, S as SystemInput, h as TextBlock, b8 as ToolDefinition, aG as ToolExecutionContext, b7 as ToolGenerator, ax as ToolOutputEnvelope, b6 as ToolOutputValue, q as ToolResult, p as ToolResultBlock, aw as ToolResultChunk, a0 as ToolResultContent, $ as ToolResultContentBlock, av as ToolResultMeta, b4 as ToolRuntime, aJ as ToolRuntimeCompletedEvent, b0 as ToolRuntimeDispatchDecision, aL as ToolRuntimeEvent, b2 as ToolRuntimeEventHandler, aI as ToolRuntimeOutputChunkEvent, aK as ToolRuntimeRejectedEvent, aH as ToolRuntimeStartedEvent, b1 as ToolRuntimeToolCallHandler, al as ToolSchema, o as ToolUseBlock, ao as ToolUseDeltaChunk, ba as TransformableStage, bf as Transformer, bh as TransformerExtensionRegistration, e as TurnInput, T as TurnResult, ay as TurnResultStatus, f as TurnState, am as Usage } from '../types-Df0vlfj-.js';
3
3
 
4
4
  declare class OperationAbortedError extends Error {
5
5
  readonly code = "ABORT_ERR";
@@ -1 +1 @@
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
+ (function(_0x2083f0,_0x12e3e5){var _0x1eb86d={_0xd4021e:0x6,_0x27bb98:0xda,_0x30aa28:0xd7,_0x10e261:0x5,_0x1d3bca:0x3,_0x34288e:0x3,_0x13c123:0xdf,_0x422370:0xdc,_0x44115e:0xdd,_0x4d95ae:0x4,_0x564eb2:0x1,_0x2e28b5:0xdb,_0x2ed302:0xd9,_0x564e15:0xd8,_0x94efde:0xd6,_0x46c4a3:0xe3,_0x35c6d1:0xe4,_0x5bfec4:0xe0,_0x5f21d2:0xe6},_0x18a69c={_0x18b339:0x16c},_0x48ec82=_0x2083f0();function _0x36cec1(_0x1a9aee,_0x89c1d9,_0xb23e85,_0x4641ee){return _0x4cc7(_0x89c1d9- -0x248,_0x4641ee);}function _0x55a672(_0x306065,_0x250c3f,_0x5b9010,_0x51bcb5){return _0x4cc7(_0x51bcb5- -_0x18a69c._0x18b339,_0x5b9010);}while(!![]){try{var _0x395ef5=-parseInt(_0x55a672(0x3,0x0,0xb,_0x1eb86d._0xd4021e))/0x1*(-parseInt(_0x36cec1(-_0x1eb86d._0x27bb98,-_0x1eb86d._0x30aa28,-0xdd,-0xd8))/0x2)+parseInt(_0x55a672(_0x1eb86d._0x10e261,-0x6,-_0x1eb86d._0x1d3bca,0x0))/0x3*(-parseInt(_0x55a672(-_0x1eb86d._0x34288e,0x7,0x7,0x2))/0x4)+parseInt(_0x36cec1(-0xe2,-_0x1eb86d._0x13c123,-0xde,-0xe5))/0x5*(-parseInt(_0x36cec1(-0xdd,-0xe1,-0xe3,-0xde))/0x6)+-parseInt(_0x36cec1(-_0x1eb86d._0x422370,-0xdd,-_0x1eb86d._0x44115e,-_0x1eb86d._0x13c123))/0x7+-parseInt(_0x55a672(0x0,-_0x1eb86d._0x4d95ae,0x2,_0x1eb86d._0x564eb2))/0x8*(parseInt(_0x36cec1(-_0x1eb86d._0x2e28b5,-_0x1eb86d._0x2ed302,-0xdb,-0xd4))/0x9)+parseInt(_0x36cec1(-0xdc,-_0x1eb86d._0x564e15,-0xd4,-_0x1eb86d._0x94efde))/0xa+parseInt(_0x36cec1(-_0x1eb86d._0x564e15,-0xde,-_0x1eb86d._0x46c4a3,-_0x1eb86d._0x13c123))/0xb*(parseInt(_0x36cec1(-_0x1eb86d._0x35c6d1,-_0x1eb86d._0x5bfec4,-0xe2,-_0x1eb86d._0x5f21d2))/0xc);if(_0x395ef5===_0x12e3e5)break;else _0x48ec82['push'](_0x48ec82['shift']());}catch(_0x50cce3){_0x48ec82['push'](_0x48ec82['shift']());}}}(_0x4a79,0xdffb1));import{mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig}from'../chunk-NYZR4XKO.js';function _0x4cc7(_0x5314ac,_0x345209){_0x5314ac=_0x5314ac-0x167;var _0x4a793a=_0x4a79();var _0x4cc78c=_0x4a793a[_0x5314ac];if(_0x4cc7['ilPWGW']===undefined){var _0x47ff64=function(_0x3b2409){var _0x380954='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x569e49='',_0x593e52='';for(var _0x21262e=0x0,_0x252a5f,_0x1e9692,_0x6ab5c9=0x0;_0x1e9692=_0x3b2409['charAt'](_0x6ab5c9++);~_0x1e9692&&(_0x252a5f=_0x21262e%0x4?_0x252a5f*0x40+_0x1e9692:_0x1e9692,_0x21262e++%0x4)?_0x569e49+=String['fromCharCode'](0xff&_0x252a5f>>(-0x2*_0x21262e&0x6)):0x0){_0x1e9692=_0x380954['indexOf'](_0x1e9692);}for(var _0x31beac=0x0,_0x42d9bf=_0x569e49['length'];_0x31beac<_0x42d9bf;_0x31beac++){_0x593e52+='%'+('00'+_0x569e49['charCodeAt'](_0x31beac)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x593e52);};_0x4cc7['CaRvNz']=_0x47ff64,_0x4cc7['ZaoFgB']={},_0x4cc7['ilPWGW']=!![];}var _0x51bf57=_0x4a793a[0x0],_0x55ee7a=_0x5314ac+_0x51bf57,_0x22ea93=_0x4cc7['ZaoFgB'][_0x55ee7a];return!_0x22ea93?(_0x4cc78c=_0x4cc7['CaRvNz'](_0x4cc78c),_0x4cc7['ZaoFgB'][_0x55ee7a]=_0x4cc78c):_0x4cc78c=_0x22ea93,_0x4cc78c;}function _0x4a79(){var _0xecb19=['ndj4BNz2AuS','mti2mJG0ntzeCevICvi','mtu5ody0senpC0fs','ourQz1nfBa','nZKXmZuWt0fXr1ze','mZe5odm1ohfnvuvrAa','mwnYthjXBG','mZbTtxHvz3q','mJe4mdrXshDhCwO','nda0otyWBwPxz2Tn','mtq3nZnzEuHhEg0','ndyWnJu1m0jWC0Lfuq'];_0x4a79=function(){return _0xecb19;};return _0x4a79();}import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';export{OperationAbortedError,addAbortListener,isAbortError,mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};
@@ -1,8 +1,95 @@
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';
1
+ import { Diagnostic, Location, Hover, DocumentSymbol, SymbolInformation, CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall } from 'vscode-languageserver-types';
2
+ import { b8 as ToolDefinition, ax as ToolOutputEnvelope, b9 as AnyToolDefinition, b2 as ToolRuntimeEventHandler, b1 as ToolRuntimeToolCallHandler, b4 as ToolRuntime, K as JsonObject, X as JsonSchemaObject, Y as JsonSchema, bk as AgentDefinitionFactoryContext, a as AgentOptions, q as ToolResult, b6 as ToolOutputValue, aw as ToolResultChunk, a0 as ToolResultContent, b5 as InferJsonSchema, aG as ToolExecutionContext, al as ToolSchema, L as JsonValue } from '../types-Df0vlfj-.js';
3
+ import { CommandDefinitionReference, SerializedCommandDefinition, MCPAuthConfig, MCPServerConfig } from '@nuvin/config';
2
4
  import { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';
3
- import { MCPAuthConfig, MCPServerConfig } from '@nuvin/config';
4
5
  import { CallToolResult, ListToolsResult } from '@modelcontextprotocol/sdk/types.js';
5
6
 
7
+ interface LspPosition {
8
+ file: string;
9
+ line: number;
10
+ character: number;
11
+ }
12
+ interface LspServiceConfig {
13
+ enabled?: boolean;
14
+ }
15
+
16
+ interface LspService {
17
+ isEnabled(): boolean;
18
+ hasClients(file: string): Promise<boolean>;
19
+ touchFile(filePath: string, waitDiagnostics?: boolean): Promise<void>;
20
+ diagnostics(): Promise<Record<string, Diagnostic[]>>;
21
+ diagnosticsForFile(filePath: string): Promise<Diagnostic[]>;
22
+ definition(pos: LspPosition): Promise<Location[]>;
23
+ references(pos: LspPosition): Promise<Location[]>;
24
+ hover(pos: LspPosition): Promise<Hover[]>;
25
+ documentSymbol(filePath: string): Promise<(DocumentSymbol | SymbolInformation)[]>;
26
+ workspaceSymbol(query: string): Promise<SymbolInformation[]>;
27
+ implementation(pos: LspPosition): Promise<Location[]>;
28
+ prepareCallHierarchy(pos: LspPosition): Promise<CallHierarchyItem[]>;
29
+ incomingCalls(pos: LspPosition): Promise<CallHierarchyIncomingCall[]>;
30
+ outgoingCalls(pos: LspPosition): Promise<CallHierarchyOutgoingCall[]>;
31
+ shutdown(): Promise<void>;
32
+ status(): {
33
+ connectedClients: number;
34
+ };
35
+ }
36
+ declare function createLspService(config?: LspServiceConfig): LspService;
37
+
38
+ declare function createAskUserTool(): ToolDefinition<{
39
+ answers: {};
40
+ questions: {
41
+ question: string;
42
+ header: string;
43
+ options: {
44
+ label: string;
45
+ description: string;
46
+ }[];
47
+ multiSelect: boolean;
48
+ }[];
49
+ }, ToolOutputEnvelope, ToolOutputEnvelope | undefined, {
50
+ type: "object";
51
+ properties: {
52
+ questions: {
53
+ type: "array";
54
+ items: {
55
+ type: "object";
56
+ properties: {
57
+ question: {
58
+ type: "string";
59
+ };
60
+ header: {
61
+ type: "string";
62
+ };
63
+ options: {
64
+ type: "array";
65
+ items: {
66
+ type: "object";
67
+ properties: {
68
+ label: {
69
+ type: "string";
70
+ };
71
+ description: {
72
+ type: "string";
73
+ };
74
+ };
75
+ required: string[];
76
+ };
77
+ };
78
+ multiSelect: {
79
+ type: "boolean";
80
+ };
81
+ };
82
+ required: string[];
83
+ };
84
+ };
85
+ answers: {
86
+ type: "object";
87
+ properties: {};
88
+ };
89
+ };
90
+ required: string[];
91
+ }>;
92
+
6
93
  interface BashToolInput {
7
94
  command: string;
8
95
  cwd?: string;
@@ -10,6 +97,7 @@ interface BashToolInput {
10
97
  ignoreOutput?: boolean;
11
98
  }
12
99
  interface BashToolOptions {
100
+ allowedDirs?: readonly string[];
13
101
  defaultCwd?: string;
14
102
  defaultTimeoutMs?: number;
15
103
  description?: string;
@@ -20,8 +108,8 @@ interface BashToolOptions {
20
108
  }
21
109
  declare function createBashTool(options?: BashToolOptions): ToolDefinition<{
22
110
  command: string;
23
- cwd?: string | undefined;
24
111
  timeoutMs?: number | undefined;
112
+ cwd?: string | undefined;
25
113
  ignoreOutput?: boolean | undefined;
26
114
  }, string, ToolOutputEnvelope, {
27
115
  type: "object";
@@ -43,8 +131,8 @@ declare function createBashTool(options?: BashToolOptions): ToolDefinition<{
43
131
  }>;
44
132
  declare function createShellExecTool(options?: BashToolOptions): ToolDefinition<{
45
133
  command: string;
46
- cwd?: string | undefined;
47
134
  timeoutMs?: number | undefined;
135
+ cwd?: string | undefined;
48
136
  ignoreOutput?: boolean | undefined;
49
137
  }, string, ToolOutputEnvelope, {
50
138
  type: "object";
@@ -65,22 +153,8 @@ declare function createShellExecTool(options?: BashToolOptions): ToolDefinition<
65
153
  required: readonly ["command"];
66
154
  }>;
67
155
 
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
- }
156
+ type CommandReference = CommandDefinitionReference;
157
+ type LoadedCommand = SerializedCommandDefinition;
84
158
  interface CommandToolOptions<TRef extends CommandReference = CommandReference> {
85
159
  commands: TRef[];
86
160
  loadCommand: (reference: TRef) => Promise<LoadedCommand>;
@@ -102,6 +176,7 @@ declare function createInvokeCommandTool<TRef extends CommandReference>(options:
102
176
  }>;
103
177
 
104
178
  interface FileEditToolOptions {
179
+ allowedDirs?: readonly string[];
105
180
  defaultCwd?: string;
106
181
  name?: string;
107
182
  }
@@ -130,12 +205,13 @@ declare function createFileEditTool(options?: FileEditToolOptions): ToolDefiniti
130
205
  }>;
131
206
 
132
207
  interface FileNewToolOptions {
208
+ allowedDirs?: readonly string[];
133
209
  defaultCwd?: string;
134
210
  name?: string;
135
211
  }
136
212
  declare function createFileNewTool(options?: FileNewToolOptions): ToolDefinition<{
137
- filePath: string;
138
213
  content: string;
214
+ filePath: string;
139
215
  }, ToolOutputEnvelope, undefined, {
140
216
  type: "object";
141
217
  properties: {
@@ -150,6 +226,7 @@ declare function createFileNewTool(options?: FileNewToolOptions): ToolDefinition
150
226
  }>;
151
227
 
152
228
  interface FileReadToolOptions {
229
+ allowedDirs?: readonly string[];
153
230
  defaultCwd?: string;
154
231
  name?: string;
155
232
  }
@@ -174,6 +251,7 @@ declare function createFileReadTool(options?: FileReadToolOptions): ToolDefiniti
174
251
  }>;
175
252
 
176
253
  interface GlobToolOptions {
254
+ allowedDirs?: readonly string[];
177
255
  defaultCwd?: string;
178
256
  limit?: number;
179
257
  name?: string;
@@ -199,6 +277,7 @@ declare function createGlobTool(options?: GlobToolOptions): ToolDefinition<{
199
277
  }>;
200
278
 
201
279
  interface GrepToolOptions {
280
+ allowedDirs?: readonly string[];
202
281
  defaultCwd?: string;
203
282
  limit?: number;
204
283
  name?: string;
@@ -238,6 +317,7 @@ interface InternalToolRuntimeOptions {
238
317
  declare function createInternalToolRuntime(tools?: AnyToolDefinition[], options?: InternalToolRuntimeOptions): ToolRuntime;
239
318
 
240
319
  interface LsToolOptions {
320
+ allowedDirs?: readonly string[];
241
321
  defaultCwd?: string;
242
322
  name?: string;
243
323
  }
@@ -256,6 +336,41 @@ declare function createLsTool(options?: LsToolOptions): ToolDefinition<{
256
336
  };
257
337
  }>;
258
338
 
339
+ interface LspToolOptions {
340
+ defaultCwd?: string;
341
+ allowedDirs?: readonly string[];
342
+ lspService?: LspService;
343
+ name?: string;
344
+ }
345
+ declare function createLspTool(options?: LspToolOptions): ToolDefinition<{
346
+ filePath: string;
347
+ line: number;
348
+ character: number;
349
+ operation: string;
350
+ query?: string | undefined;
351
+ }, ToolOutputEnvelope, undefined, {
352
+ type: "object";
353
+ properties: {
354
+ operation: {
355
+ type: "string";
356
+ enum: string[];
357
+ };
358
+ filePath: {
359
+ type: "string";
360
+ };
361
+ line: {
362
+ type: "number";
363
+ };
364
+ character: {
365
+ type: "number";
366
+ };
367
+ query: {
368
+ type: "string";
369
+ };
370
+ };
371
+ required: readonly ["operation", "filePath", "line", "character"];
372
+ }>;
373
+
259
374
  interface McpOAuthProviderOptions {
260
375
  serverName: string;
261
376
  callbackUrl: string;
@@ -379,14 +494,22 @@ interface CreateDelegationToolsOptions {
379
494
  agents?: Record<string, DelegatedAgentDefinition>;
380
495
  }
381
496
  declare function createAssignTaskTool(options: CreateDelegationToolsOptions): ToolDefinition<{
497
+ description: string;
382
498
  task: string;
383
499
  agentId: string;
500
+ nickname: string;
384
501
  }, ToolOutputEnvelope, ToolOutputEnvelope, {
385
502
  type: "object";
386
503
  properties: {
387
504
  agentId: {
388
505
  type: "string";
389
506
  };
507
+ description: {
508
+ type: "string";
509
+ };
510
+ nickname: {
511
+ type: "string";
512
+ };
390
513
  task: {
391
514
  type: "string";
392
515
  };
@@ -395,14 +518,22 @@ declare function createAssignTaskTool(options: CreateDelegationToolsOptions): To
395
518
  }>;
396
519
  declare const createDelegateToAgentTool: typeof createAssignTaskTool;
397
520
  declare function createDelegationTools(options: CreateDelegationToolsOptions): ToolDefinition<{
521
+ description: string;
398
522
  task: string;
399
523
  agentId: string;
524
+ nickname: string;
400
525
  }, ToolOutputEnvelope, ToolOutputEnvelope, {
401
526
  type: "object";
402
527
  properties: {
403
528
  agentId: {
404
529
  type: "string";
405
530
  };
531
+ description: {
532
+ type: "string";
533
+ };
534
+ nickname: {
535
+ type: "string";
536
+ };
406
537
  task: {
407
538
  type: "string";
408
539
  };
@@ -443,8 +574,84 @@ declare function createLoadSkillTool<TRef extends SkillReference>(options: Skill
443
574
  required: readonly ["name"];
444
575
  }>;
445
576
 
577
+ type TodoStatus = "pending" | "in_progress" | "completed";
578
+ type TodoPriority = "high" | "medium" | "low";
579
+ type TodoInputItem = {
580
+ id: string;
581
+ content: string;
582
+ status: TodoStatus;
583
+ priority: TodoPriority;
584
+ createdAt?: string;
585
+ };
586
+ type TodoItem = TodoInputItem & {
587
+ sessionId: string;
588
+ createdAt: string;
589
+ updatedAt: string;
590
+ };
591
+ type TodoStats = {
592
+ total: number;
593
+ pending: number;
594
+ inProgress: number;
595
+ completed: number;
596
+ };
597
+ declare class TodoStore {
598
+ private readonly todosBySession;
599
+ getTodos(sessionId: string): TodoItem[];
600
+ setTodos(sessionId: string, todos: TodoItem[]): void;
601
+ getStats(sessionId: string): TodoStats;
602
+ }
603
+ declare function createTodoWriteTool(store?: TodoStore): ToolDefinition<{
604
+ todos: {
605
+ content: string;
606
+ id: string;
607
+ priority: string;
608
+ status: string;
609
+ createdAt: string;
610
+ }[];
611
+ }, never, ToolOutputEnvelope, {
612
+ type: "object";
613
+ properties: {
614
+ todos: {
615
+ type: "array";
616
+ items: {
617
+ type: "object";
618
+ properties: {
619
+ content: {
620
+ type: "string";
621
+ };
622
+ status: {
623
+ type: "string";
624
+ };
625
+ priority: {
626
+ type: "string";
627
+ };
628
+ id: {
629
+ type: "string";
630
+ };
631
+ createdAt: {
632
+ type: "string";
633
+ };
634
+ };
635
+ required: string[];
636
+ };
637
+ };
638
+ };
639
+ required: string[];
640
+ }>;
641
+
642
+ interface ToolOutputOffloadOptions {
643
+ maxBytes: number;
644
+ sessionDir?: string;
645
+ }
646
+ /**
647
+ * Truncate a tool result's output if it exceeds `maxBytes`.
648
+ * Full output is written to `{sessionDir}/{toolName}_{sanitizedCallId}.log`.
649
+ * Returns the (possibly truncated) result. Mutates nothing.
650
+ */
651
+ declare function truncateToolOutput(result: ToolResult, options: ToolOutputOffloadOptions): Promise<ToolResult>;
652
+
446
653
  declare function normalizeToolOutputValue(output: ToolOutputValue): ToolResultChunk;
447
- declare function createToolOutput(output: string, structured?: JsonObject): ToolOutputEnvelope;
654
+ declare function createToolOutput(output: string, structured?: JsonObject, content?: ToolResultContent): ToolOutputEnvelope;
448
655
  declare class ToolExecutionError extends Error {
449
656
  readonly structured: JsonObject;
450
657
  constructor(message: string, structured?: JsonObject);
@@ -466,8 +673,111 @@ declare class ToolRegistry {
466
673
  declare function validateToolInput<TSchema extends JsonSchemaObject>(input: JsonValue, schema: TSchema): InferJsonSchema<TSchema>;
467
674
  declare function deriveFinalToolOutput(chunks: ToolResultChunk[]): ToolResultChunk;
468
675
 
676
+ interface ViewFileToolOptions {
677
+ allowedDirs?: readonly string[];
678
+ defaultCwd?: string;
679
+ maxBytes?: number;
680
+ name?: string;
681
+ }
682
+ declare function createViewFileTool(options?: ViewFileToolOptions): ToolDefinition<{
683
+ path: string;
684
+ detail?: string | undefined;
685
+ }, ToolOutputEnvelope, undefined, {
686
+ type: "object";
687
+ properties: {
688
+ path: {
689
+ type: "string";
690
+ };
691
+ detail: {
692
+ type: "string";
693
+ };
694
+ };
695
+ required: readonly ["path"];
696
+ }>;
697
+
698
+ interface WebFetchToolOptions {
699
+ timeoutMs?: number;
700
+ name?: string;
701
+ }
702
+ declare function createWebFetchTool(options?: WebFetchToolOptions): ToolDefinition<{
703
+ url: string;
704
+ description?: string | undefined;
705
+ }, ToolOutputEnvelope, undefined, {
706
+ type: "object";
707
+ properties: {
708
+ description: {
709
+ type: "string";
710
+ };
711
+ url: {
712
+ type: "string";
713
+ };
714
+ };
715
+ required: readonly ["url"];
716
+ }>;
717
+
718
+ interface WebSearchToolOptions {
719
+ googleCseKey: string;
720
+ googleCseCx: string;
721
+ name?: string;
722
+ }
723
+ declare function createWebSearchTool(options: WebSearchToolOptions): ToolDefinition<{
724
+ query: string;
725
+ type?: string | undefined;
726
+ description?: string | undefined;
727
+ count?: number | undefined;
728
+ offset?: number | undefined;
729
+ safe?: boolean | undefined;
730
+ domains?: string[] | undefined;
731
+ recencyDays?: number | undefined;
732
+ lang?: string | undefined;
733
+ region?: string | undefined;
734
+ hydrateMeta?: boolean | undefined;
735
+ }, ToolOutputEnvelope, undefined, {
736
+ type: "object";
737
+ properties: {
738
+ description: {
739
+ type: "string";
740
+ };
741
+ query: {
742
+ type: "string";
743
+ };
744
+ count: {
745
+ type: "number";
746
+ };
747
+ offset: {
748
+ type: "number";
749
+ };
750
+ domains: {
751
+ type: "array";
752
+ items: {
753
+ type: "string";
754
+ };
755
+ };
756
+ recencyDays: {
757
+ type: "number";
758
+ };
759
+ lang: {
760
+ type: "string";
761
+ };
762
+ region: {
763
+ type: "string";
764
+ };
765
+ safe: {
766
+ type: "boolean";
767
+ };
768
+ type: {
769
+ type: "string";
770
+ };
771
+ hydrateMeta: {
772
+ type: "boolean";
773
+ };
774
+ };
775
+ required: readonly ["query"];
776
+ }>;
777
+
469
778
  declare function resolveWorkspacePath(rootDir: string, inputPath: string): string;
779
+ declare function resolveAllowedPath(rootDir: string, allowedDirs: readonly string[], inputPath: string): string;
470
780
  declare function assertWorkspaceFile(filePath: string): Promise<void>;
471
781
  declare function isProbablyBinary(buffer: Buffer): boolean;
472
782
 
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 };
783
+ 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 LspService, type LspServiceConfig, type LspToolOptions, type McpConnectionOptions, type McpConnector, type McpOAuthProviderOptions, type McpServerConnectionStatus, type McpToolBundle, type McpToolClient, type McpToolDescriptor, type RipgrepMatch, type SkillReference, type SkillSource, type SkillToolOptions, ToolExecutionError, type ToolOutputOffloadOptions, ToolRegistry, type ViewFileToolOptions, type WebFetchToolOptions, type WebSearchToolOptions, assertWorkspaceFile, buildMcpHttpHeaders, connectMcpServer, createAskUserTool, createAssignTaskTool, createBashTool, createDelegateToAgentTool, createDelegationTools, createFileEditTool, createFileNewTool, createFileReadTool, createGlobTool, createGrepTool, createInternalToolRuntime, createInvokeCommandTool, createLoadSkillTool, createLsTool, createLspService, createLspTool, createMcpOAuthProvider, createMcpTool, createMcpToolName, createMcpToolsFromServers, createMockToolRuntime, createShellExecTool, createTodoWriteTool, createToolOutput, createViewFileTool, createWebFetchTool, createWebSearchTool, defineTool, deriveFinalToolOutput, filepath, files, isProbablyBinary, normalizeToolOutputValue, resolveAllowedPath, resolveWorkspacePath, search, toNuvinToolSchema, truncateToolOutput, validateToolInput };