@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.
- package/dist/VERSION +2 -2
- package/dist/agent/index.d.ts +53 -5
- package/dist/agent/index.js +1 -1
- package/dist/chunk-3OMYFJLN.js +1 -0
- package/dist/chunk-4DNIDCX7.js +1 -0
- package/dist/chunk-G2FR4UGO.js +1 -0
- package/dist/chunk-NYZR4XKO.js +1 -1
- package/dist/chunk-X7VAACWY.js +1 -1
- package/dist/formats/index.d.ts +6 -3
- package/dist/formats/index.js +1 -1
- package/dist/models/index.d.ts +15 -12
- package/dist/models/index.js +1 -1
- package/dist/{provider-adapters-F0kn75gb.d.ts → provider-adapters-CURkQPbY.d.ts} +1 -1
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.js +1 -1
- package/dist/tools/index.d.ts +333 -23
- package/dist/tools/index.js +1 -1
- package/dist/{types-D11KxtW1.d.ts → types-Df0vlfj-.d.ts} +75 -27
- package/package.json +14 -4
- package/dist/chunk-C6OLKGP6.js +0 -1
- package/dist/chunk-U2BLX7Y5.js +0 -1
- package/dist/chunk-WVVWOCQ5.js +0 -1
package/dist/shared/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
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";
|
package/dist/shared/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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};
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,8 +1,95 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
69
|
-
|
|
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
|
|
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 };
|