@nuvin/agent-core 0.0.0-rc.4 → 0.0.0-rc.5

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 +1 @@
1
- (function(_0xf1cb47,_0x1a6554){var _0x268885={_0x522873:0x26d,_0x26dace:0x26c,_0x340b04:0x6e,_0xec400:0x69,_0x1b77bb:0x6a,_0x1ce657:0x67,_0x3e16f8:0x69,_0x6b692e:0x6e,_0x3f09bc:0x274,_0x3ed230:0x270,_0x2a3651:0x271,_0x37ee7e:0x26e,_0x16bef8:0x276,_0x58c100:0x61,_0x1dc5d9:0x67,_0x1e9e35:0x267,_0x3f5661:0x26f,_0x40bfff:0x65,_0x11733c:0x64,_0x77b87a:0x68,_0x4d5675:0x66},_0x16e783={_0x2dad43:0x1df},_0x353aa9=_0xf1cb47();function _0x2adb8a(_0x17db90,_0x4810d3,_0x4eb8f9,_0x211719){return _0x28e0(_0x4eb8f9- -_0x16e783._0x2dad43,_0x4810d3);}function _0x11f82c(_0x110b03,_0x29f82a,_0x34cdb1,_0x4edfe8){return _0x28e0(_0x29f82a-0xf8,_0x110b03);}while(!![]){try{var _0x23d773=parseInt(_0x11f82c(_0x268885._0x522873,_0x268885._0x26dace,0x267,0x267))/0x1*(parseInt(_0x2adb8a(-_0x268885._0x340b04,-_0x268885._0xec400,-_0x268885._0x1b77bb,-0x66))/0x2)+-parseInt(_0x2adb8a(-_0x268885._0x1ce657,-_0x268885._0xec400,-_0x268885._0x3e16f8,-_0x268885._0x6b692e))/0x3*(-parseInt(_0x11f82c(0x275,_0x268885._0x3f09bc,0x276,_0x268885._0x3ed230))/0x4)+-parseInt(_0x11f82c(0x273,0x270,_0x268885._0x2a3651,_0x268885._0x37ee7e))/0x5*(-parseInt(_0x11f82c(_0x268885._0x2a3651,_0x268885._0x2a3651,_0x268885._0x16bef8,_0x268885._0x2a3651))/0x6)+parseInt(_0x2adb8a(-0x66,-_0x268885._0x58c100,-0x65,-_0x268885._0x1dc5d9))/0x7+-parseInt(_0x11f82c(0x26f,0x26b,_0x268885._0x1e9e35,_0x268885._0x3f5661))/0x8+-parseInt(_0x2adb8a(-_0x268885._0x40bfff,-0x5f,-0x64,-_0x268885._0x11733c))/0x9+-parseInt(_0x2adb8a(-0x69,-_0x268885._0x1ce657,-_0x268885._0x77b87a,-_0x268885._0x4d5675))/0xa;if(_0x23d773===_0x1a6554)break;else _0x353aa9['push'](_0x353aa9['shift']());}catch(_0x21181d){_0x353aa9['push'](_0x353aa9['shift']());}}}(_0x200d,0x82177));import{mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig}from'../chunk-NYZR4XKO.js';function _0x28e0(_0x30d916,_0x540bf6){_0x30d916=_0x30d916-0x173;var _0x200dfb=_0x200d();var _0x28e020=_0x200dfb[_0x30d916];if(_0x28e0['HFpcBq']===undefined){var _0x1e7c18=function(_0x18b6ca){var _0x34d948='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x2ddf38='',_0x4a2d01='';for(var _0x557517=0x0,_0x4ea231,_0x49e452,_0xeec0bb=0x0;_0x49e452=_0x18b6ca['charAt'](_0xeec0bb++);~_0x49e452&&(_0x4ea231=_0x557517%0x4?_0x4ea231*0x40+_0x49e452:_0x49e452,_0x557517++%0x4)?_0x2ddf38+=String['fromCharCode'](0xff&_0x4ea231>>(-0x2*_0x557517&0x6)):0x0){_0x49e452=_0x34d948['indexOf'](_0x49e452);}for(var _0x1ff41d=0x0,_0x4204b2=_0x2ddf38['length'];_0x1ff41d<_0x4204b2;_0x1ff41d++){_0x4a2d01+='%'+('00'+_0x2ddf38['charCodeAt'](_0x1ff41d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4a2d01);};_0x28e0['tCnECQ']=_0x1e7c18,_0x28e0['zZWbDT']={},_0x28e0['HFpcBq']=!![];}var _0x41b070=_0x200dfb[0x0],_0x1db519=_0x30d916+_0x41b070,_0x4e8622=_0x28e0['zZWbDT'][_0x1db519];return!_0x4e8622?(_0x28e020=_0x28e0['tCnECQ'](_0x28e020),_0x28e0['zZWbDT'][_0x1db519]=_0x28e020):_0x28e020=_0x4e8622,_0x28e020;}function _0x200d(){var _0x3c51fd=['mJaZog9xuw5rDW','ntfsuvjrrwC','mta5nJy2ntbgt0reDwG','mtCYote5nuXyA0npBG','mtjHqwPOwfa','nda5otG1mw1tsfLizW','mZe2ntmZnMDHC0nOBa','mtK4nJm2whrrC2zt','ntG1oteXmLbQv3PttG','ntGXs1bMBMzA'];_0x200d=function(){return _0x3c51fd;};return _0x200d();}import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';export{OperationAbortedError,addAbortListener,isAbortError,mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};
1
+ function _0x1ead(_0x29a891,_0x3db51c){_0x29a891=_0x29a891-0x133;var _0x383cb8=_0x383c();var _0x1eadec=_0x383cb8[_0x29a891];if(_0x1ead['pmaacz']===undefined){var _0x36bcd4=function(_0x48060d){var _0x108c9d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x5813aa='',_0x3bc88e='';for(var _0x24f177=0x0,_0x5d7316,_0x269b3b,_0x295272=0x0;_0x269b3b=_0x48060d['charAt'](_0x295272++);~_0x269b3b&&(_0x5d7316=_0x24f177%0x4?_0x5d7316*0x40+_0x269b3b:_0x269b3b,_0x24f177++%0x4)?_0x5813aa+=String['fromCharCode'](0xff&_0x5d7316>>(-0x2*_0x24f177&0x6)):0x0){_0x269b3b=_0x108c9d['indexOf'](_0x269b3b);}for(var _0x42c76e=0x0,_0x57bedc=_0x5813aa['length'];_0x42c76e<_0x57bedc;_0x42c76e++){_0x3bc88e+='%'+('00'+_0x5813aa['charCodeAt'](_0x42c76e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3bc88e);};_0x1ead['qpKrzf']=_0x36bcd4,_0x1ead['RXmCmd']={},_0x1ead['pmaacz']=!![];}var _0x53a817=_0x383cb8[0x0],_0x13a990=_0x29a891+_0x53a817,_0x1a5b9a=_0x1ead['RXmCmd'][_0x13a990];return!_0x1a5b9a?(_0x1eadec=_0x1ead['qpKrzf'](_0x1eadec),_0x1ead['RXmCmd'][_0x13a990]=_0x1eadec):_0x1eadec=_0x1a5b9a,_0x1eadec;}(function(_0x4b1bbe,_0x1a9f54){var _0x43a7bd={_0x1d7b2e:0x142,_0x156a90:0x144,_0x33058e:0x192,_0x445974:0x190,_0x490c8b:0x18e,_0x41e77a:0x142,_0x3f0d9b:0x149,_0x2d8a5e:0x195,_0x2c117f:0x14a,_0x244c4e:0x191,_0x59646f:0x192,_0x1776d8:0x143,_0x501c2c:0x13e,_0x18ea90:0x199,_0x38b2ba:0x18e,_0x4ecb26:0x145},_0x1938b9={_0x33b3d3:0x58},_0xc90991=_0x4b1bbe();function _0xbb026b(_0x429e12,_0x977d5a,_0x3fa0f6,_0x527c79){return _0x1ead(_0x429e12-_0x1938b9._0x33b3d3,_0x527c79);}function _0x2f1565(_0x36b22c,_0x5aa7ab,_0x423990,_0x3893d6){return _0x1ead(_0x36b22c-0x10,_0x3893d6);}while(!![]){try{var _0x92237e=parseInt(_0x2f1565(0x147,0x143,_0x43a7bd._0x1d7b2e,_0x43a7bd._0x156a90))/0x1*(-parseInt(_0x2f1565(0x14d,0x14a,0x152,0x14d))/0x2)+-parseInt(_0xbb026b(0x18d,_0x43a7bd._0x33058e,_0x43a7bd._0x445974,_0x43a7bd._0x490c8b))/0x3+parseInt(_0x2f1565(_0x43a7bd._0x156a90,_0x43a7bd._0x1d7b2e,_0x43a7bd._0x41e77a,_0x43a7bd._0x3f0d9b))/0x4+-parseInt(_0xbb026b(_0x43a7bd._0x33058e,0x192,0x197,_0x43a7bd._0x2d8a5e))/0x5*(parseInt(_0x2f1565(0x14b,_0x43a7bd._0x2c117f,0x14f,0x14c))/0x6)+-parseInt(_0xbb026b(_0x43a7bd._0x445974,0x190,_0x43a7bd._0x244c4e,_0x43a7bd._0x59646f))/0x7+-parseInt(_0x2f1565(_0x43a7bd._0x1776d8,0x140,0x143,_0x43a7bd._0x501c2c))/0x8*(-parseInt(_0xbb026b(0x194,0x19a,_0x43a7bd._0x18ea90,0x191))/0x9)+-parseInt(_0xbb026b(_0x43a7bd._0x38b2ba,0x188,_0x43a7bd._0x445974,0x18a))/0xa*(-parseInt(_0x2f1565(0x149,0x14b,0x148,_0x43a7bd._0x4ecb26))/0xb);if(_0x92237e===_0x1a9f54)break;else _0xc90991['push'](_0xc90991['shift']());}catch(_0xecebf1){_0xc90991['push'](_0xc90991['shift']());}}}(_0x383c,0xe3577));import{mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig}from'../chunk-NYZR4XKO.js';import{OperationAbortedError,addAbortListener,isAbortError,throwIfAborted,toAbortError}from'../chunk-X7VAACWY.js';function _0x383c(){var _0xaf5ca0=['mti1ote1n0LLCNL5Bq','ndi3nJeWteX4zhfp','mu9lDgrdrW','mtiZmZmXmJvusvjwsKC','nJGYrw5urxrR','mJvZzhnzBLi','ndi1nZa2wuDrANvA','ovPprgvguG','mZqZmZyXmejrDg5bvG','ntK2ntu1mNjoEeziEG','nZe0otG3nLjyz1rzBG'];_0x383c=function(){return _0xaf5ca0;};return _0x383c();}export{OperationAbortedError,addAbortListener,isAbortError,mapAutoReasoningEffortToBudgetTokens,resolveAnthropicThinkingConfig,resolveOpenAiReasoningConfig,throwIfAborted,toAbortError};
@@ -1,8 +1,40 @@
1
+ import { Diagnostic, Location, Hover, DocumentSymbol, SymbolInformation, CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall } from 'vscode-languageserver-types';
1
2
  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
3
  import { CommandDefinitionReference, SerializedCommandDefinition, MCPAuthConfig, MCPServerConfig } from '@nuvin/config';
3
4
  import { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';
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
+
6
38
  interface BashToolInput {
7
39
  command: string;
8
40
  cwd?: string;
@@ -21,8 +53,8 @@ interface BashToolOptions {
21
53
  }
22
54
  declare function createBashTool(options?: BashToolOptions): ToolDefinition<{
23
55
  command: string;
24
- cwd?: string | undefined;
25
56
  timeoutMs?: number | undefined;
57
+ cwd?: string | undefined;
26
58
  ignoreOutput?: boolean | undefined;
27
59
  }, string, ToolOutputEnvelope, {
28
60
  type: "object";
@@ -44,8 +76,8 @@ declare function createBashTool(options?: BashToolOptions): ToolDefinition<{
44
76
  }>;
45
77
  declare function createShellExecTool(options?: BashToolOptions): ToolDefinition<{
46
78
  command: string;
47
- cwd?: string | undefined;
48
79
  timeoutMs?: number | undefined;
80
+ cwd?: string | undefined;
49
81
  ignoreOutput?: boolean | undefined;
50
82
  }, string, ToolOutputEnvelope, {
51
83
  type: "object";
@@ -249,6 +281,41 @@ declare function createLsTool(options?: LsToolOptions): ToolDefinition<{
249
281
  };
250
282
  }>;
251
283
 
284
+ interface LspToolOptions {
285
+ defaultCwd?: string;
286
+ allowedDirs?: readonly string[];
287
+ lspService?: LspService;
288
+ name?: string;
289
+ }
290
+ declare function createLspTool(options?: LspToolOptions): ToolDefinition<{
291
+ filePath: string;
292
+ line: number;
293
+ character: number;
294
+ operation: string;
295
+ query?: string | undefined;
296
+ }, ToolOutputEnvelope, undefined, {
297
+ type: "object";
298
+ properties: {
299
+ operation: {
300
+ type: "string";
301
+ enum: string[];
302
+ };
303
+ filePath: {
304
+ type: "string";
305
+ };
306
+ line: {
307
+ type: "number";
308
+ };
309
+ character: {
310
+ type: "number";
311
+ };
312
+ query: {
313
+ type: "string";
314
+ };
315
+ };
316
+ required: readonly ["operation", "filePath", "line", "character"];
317
+ }>;
318
+
252
319
  interface McpOAuthProviderOptions {
253
320
  serverName: string;
254
321
  callbackUrl: string;
@@ -567,4 +634,4 @@ declare function resolveAllowedPath(rootDir: string, allowedDirs: readonly strin
567
634
  declare function assertWorkspaceFile(filePath: string): Promise<void>;
568
635
  declare function isProbablyBinary(buffer: Buffer): boolean;
569
636
 
570
- export { type BashToolInput, type BashToolOptions, type CommandReference, type CommandToolOptions, type CreateDelegationToolsOptions, type DelegatedAgentDefinition, type DelegatedAgentFactoryContext, type FileEditToolOptions, type FileNewToolOptions, type FileReadToolOptions, type GlobToolOptions, type GrepToolOptions, type LoadedCommand, type LoadedSkill, type LsToolOptions, type McpConnectionOptions, type McpConnector, type McpOAuthProviderOptions, type McpServerConnectionStatus, type McpToolBundle, type McpToolClient, type McpToolDescriptor, type RipgrepMatch, type SkillReference, type SkillSource, type SkillToolOptions, ToolExecutionError, ToolRegistry, type ViewFileToolOptions, type WebFetchToolOptions, type WebSearchToolOptions, assertWorkspaceFile, buildMcpHttpHeaders, connectMcpServer, createAssignTaskTool, createBashTool, createDelegateToAgentTool, createDelegationTools, createFileEditTool, createFileNewTool, createFileReadTool, createGlobTool, createGrepTool, createInternalToolRuntime, createInvokeCommandTool, createLoadSkillTool, createLsTool, createMcpOAuthProvider, createMcpTool, createMcpToolName, createMcpToolsFromServers, createMockToolRuntime, createShellExecTool, createToolOutput, createViewFileTool, createWebFetchTool, createWebSearchTool, defineTool, deriveFinalToolOutput, filepath, files, isProbablyBinary, normalizeToolOutputValue, resolveAllowedPath, resolveWorkspacePath, search, toNuvinToolSchema, validateToolInput };
637
+ 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, ToolRegistry, type ViewFileToolOptions, type WebFetchToolOptions, type WebSearchToolOptions, assertWorkspaceFile, buildMcpHttpHeaders, connectMcpServer, createAssignTaskTool, createBashTool, createDelegateToAgentTool, createDelegationTools, createFileEditTool, createFileNewTool, createFileReadTool, createGlobTool, createGrepTool, createInternalToolRuntime, createInvokeCommandTool, createLoadSkillTool, createLsTool, createLspService, createLspTool, createMcpOAuthProvider, createMcpTool, createMcpToolName, createMcpToolsFromServers, createMockToolRuntime, createShellExecTool, createToolOutput, createViewFileTool, createWebFetchTool, createWebSearchTool, defineTool, deriveFinalToolOutput, filepath, files, isProbablyBinary, normalizeToolOutputValue, resolveAllowedPath, resolveWorkspacePath, search, toNuvinToolSchema, validateToolInput };