@nuvin/agent-core 0.0.0-rc.17 → 0.0.0-rc.19

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.
Files changed (90) hide show
  1. package/dist/VERSION +2 -2
  2. package/dist/agent/agent.d.ts +28 -0
  3. package/dist/agent/context-compactor.d.ts +8 -0
  4. package/dist/agent/extension-registry.d.ts +3 -0
  5. package/dist/agent/index.d.ts +8 -99
  6. package/dist/agent/index.js +1 -1
  7. package/dist/agent/messages-to-text.d.ts +3 -0
  8. package/dist/agent/metrics.d.ts +30 -0
  9. package/dist/agent/topic-reminder-extension.d.ts +32 -0
  10. package/dist/agent/turn-engine.d.ts +3 -0
  11. package/dist/chunk-FFIZ6TKW.js +1 -1
  12. package/dist/chunk-HRU363DY.js +1 -0
  13. package/dist/chunk-NHBKADBW.js +1 -0
  14. package/dist/chunk-NYZR4XKO.js +1 -1
  15. package/dist/chunk-QDOE7NWO.js +1 -0
  16. package/dist/chunk-X7VAACWY.js +1 -1
  17. package/dist/formats/base64-image-content.d.ts +4 -0
  18. package/dist/formats/index.d.ts +4 -39
  19. package/dist/formats/index.js +1 -1
  20. package/dist/formats/message-format.d.ts +33 -0
  21. package/dist/formats/provider-adapters.d.ts +3 -0
  22. package/dist/hooks/executor.d.ts +3 -0
  23. package/dist/hooks/extensions.d.ts +28 -0
  24. package/dist/hooks/index.d.ts +7 -76
  25. package/dist/hooks/index.js +1 -1
  26. package/dist/hooks/registry.d.ts +8 -0
  27. package/dist/hooks/types.d.ts +40 -0
  28. package/dist/lsp/client.d.ts +11 -0
  29. package/dist/lsp/index.d.ts +24 -0
  30. package/dist/lsp/installer.d.ts +11 -0
  31. package/dist/lsp/language.d.ts +2 -0
  32. package/dist/lsp/server.d.ts +6 -0
  33. package/dist/lsp/types.d.ts +68 -0
  34. package/dist/models/anthropic-model.d.ts +27 -0
  35. package/dist/models/anthropic-surface.d.ts +5 -0
  36. package/dist/models/chat-model.d.ts +31 -0
  37. package/dist/models/github-model.d.ts +32 -0
  38. package/dist/models/http-transport.d.ts +10 -0
  39. package/dist/models/index.d.ts +16 -390
  40. package/dist/models/index.js +1 -1
  41. package/dist/models/mock-model.d.ts +15 -0
  42. package/dist/models/model-errors.d.ts +16 -0
  43. package/dist/models/model-limits.d.ts +7 -0
  44. package/dist/models/model-registry.d.ts +44 -0
  45. package/dist/models/model-surface-router.d.ts +19 -0
  46. package/dist/models/model-transports.d.ts +17 -0
  47. package/dist/models/openai-model.d.ts +60 -0
  48. package/dist/models/openai-surfaces.d.ts +74 -0
  49. package/dist/models/provider-adapter.d.ts +23 -0
  50. package/dist/models/provider-session.d.ts +16 -0
  51. package/dist/models/routed-model.d.ts +90 -0
  52. package/dist/shared/abort.d.ts +9 -0
  53. package/dist/shared/index.d.ts +5 -22
  54. package/dist/shared/index.js +1 -1
  55. package/dist/shared/reasoning-config.d.ts +5 -0
  56. package/dist/shared/turn-failed.d.ts +6 -0
  57. package/dist/{types-3UUDPpJs.d.ts → shared/types.d.ts} +172 -162
  58. package/dist/tools/ask-user-tool.d.ts +55 -0
  59. package/dist/tools/bash-tool.d.ts +63 -0
  60. package/dist/tools/command-tool.d.ts +23 -0
  61. package/dist/tools/file-edit-tool.d.ts +29 -0
  62. package/dist/tools/file-new-tool.d.ts +21 -0
  63. package/dist/tools/file-read-tool.d.ts +27 -0
  64. package/dist/tools/glob-tool.d.ts +26 -0
  65. package/dist/tools/grep-tool.d.ts +34 -0
  66. package/dist/tools/index.d.ts +28 -809
  67. package/dist/tools/index.js +1 -1
  68. package/dist/tools/internal-tool-runtime.d.ts +8 -0
  69. package/dist/tools/ls-tool.d.ts +20 -0
  70. package/dist/tools/lsp-tool.d.ts +36 -0
  71. package/dist/tools/mcp-oauth-provider.d.ts +11 -0
  72. package/dist/tools/mcp-server-manager.d.ts +43 -0
  73. package/dist/tools/mcp-tool-adapter.d.ts +47 -0
  74. package/dist/tools/mock-tool-runtime.d.ts +3 -0
  75. package/dist/tools/ripgrep.d.ts +20 -0
  76. package/dist/tools/runtime-manager-tools.d.ts +58 -0
  77. package/dist/tools/skill-tool.d.ts +33 -0
  78. package/dist/tools/todo-write-tool.d.ts +66 -0
  79. package/dist/tools/tool-output-offload.d.ts +12 -0
  80. package/dist/tools/tools.d.ts +24 -0
  81. package/dist/tools/update-topic-tool.d.ts +12 -0
  82. package/dist/tools/view-file-tool.d.ts +22 -0
  83. package/dist/tools/web-fetch-tool.d.ts +20 -0
  84. package/dist/tools/web-search-tool.d.ts +72 -0
  85. package/dist/tools/workspace-paths.d.ts +5 -0
  86. package/package.json +2 -2
  87. package/dist/chunk-SEP4YYY3.js +0 -1
  88. package/dist/chunk-T7UKN6FZ.js +0 -1
  89. package/dist/chunk-WHYFEBOU.js +0 -1
  90. package/dist/provider-adapters-Bupd2RBH.d.ts +0 -5
@@ -1,809 +1,28 @@
1
- import { Diagnostic, Location, Hover, DocumentSymbol, SymbolInformation, CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall } from 'vscode-languageserver-types';
2
- import { b9 as ToolDefinition, ay as ToolOutputEnvelope, ba as AnyToolDefinition, b3 as ToolRuntimeEventHandler, b2 as ToolRuntimeToolCallHandler, b5 as ToolRuntime, L as JsonObject, Y as JsonSchemaObject, Z as JsonSchema, bk as AgentDefinitionFactoryContext, a as AgentOptions, r as ToolResult, b7 as ToolOutputValue, ax as ToolResultChunk, a1 as ToolResultContent, b6 as InferJsonSchema, aH as ToolExecutionContext, am as ToolSchema, N as JsonValue } from '../types-3UUDPpJs.js';
3
- import { CommandDefinitionReference, SerializedCommandDefinition, MCPAuthConfig, MCPServerConfig } from '@nuvin/config';
4
- import { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';
5
- import { CallToolResult, ListToolsResult } from '@modelcontextprotocol/sdk/types.js';
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
- topic: 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
- topic: {
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
-
93
- interface BashToolInput {
94
- command: string;
95
- cwd?: string;
96
- timeoutMs?: number;
97
- ignoreOutput?: boolean;
98
- }
99
- interface BashToolOptions {
100
- allowedDirs?: readonly string[];
101
- defaultCwd?: string;
102
- defaultTimeoutMs?: number;
103
- description?: string;
104
- env?: NodeJS.ProcessEnv;
105
- name?: string;
106
- shellPath?: string;
107
- stripAnsi?: boolean;
108
- }
109
- declare function createBashTool(options?: BashToolOptions): ToolDefinition<{
110
- command: string;
111
- timeoutMs?: number | undefined;
112
- cwd?: string | undefined;
113
- ignoreOutput?: boolean | undefined;
114
- }, string, ToolOutputEnvelope, {
115
- type: "object";
116
- properties: {
117
- command: {
118
- type: "string";
119
- };
120
- cwd: {
121
- type: "string";
122
- };
123
- timeoutMs: {
124
- type: "number";
125
- };
126
- ignoreOutput: {
127
- type: "boolean";
128
- };
129
- };
130
- required: readonly ["command"];
131
- }>;
132
- declare function createShellExecTool(options?: BashToolOptions): ToolDefinition<{
133
- command: string;
134
- timeoutMs?: number | undefined;
135
- cwd?: string | undefined;
136
- ignoreOutput?: boolean | undefined;
137
- }, string, ToolOutputEnvelope, {
138
- type: "object";
139
- properties: {
140
- command: {
141
- type: "string";
142
- };
143
- cwd: {
144
- type: "string";
145
- };
146
- timeoutMs: {
147
- type: "number";
148
- };
149
- ignoreOutput: {
150
- type: "boolean";
151
- };
152
- };
153
- required: readonly ["command"];
154
- }>;
155
-
156
- type CommandReference = CommandDefinitionReference;
157
- type LoadedCommand = SerializedCommandDefinition;
158
- interface CommandToolOptions<TRef extends CommandReference = CommandReference> {
159
- commands: TRef[];
160
- loadCommand: (reference: TRef) => Promise<LoadedCommand>;
161
- }
162
- declare function createInvokeCommandTool<TRef extends CommandReference>(options: CommandToolOptions<TRef>): ToolDefinition<{
163
- name: string;
164
- args?: string | undefined;
165
- }, ToolOutputEnvelope, undefined, {
166
- type: "object";
167
- properties: {
168
- name: {
169
- type: "string";
170
- };
171
- args: {
172
- type: "string";
173
- };
174
- };
175
- required: readonly ["name"];
176
- }>;
177
-
178
- interface FileEditToolOptions {
179
- allowedDirs?: readonly string[];
180
- defaultCwd?: string;
181
- name?: string;
182
- }
183
- declare function createFileEditTool(options?: FileEditToolOptions): ToolDefinition<{
184
- filePath: string;
185
- oldText: string;
186
- newText: string;
187
- dryRun?: boolean | undefined;
188
- }, ToolOutputEnvelope, undefined, {
189
- type: "object";
190
- properties: {
191
- filePath: {
192
- type: "string";
193
- };
194
- oldText: {
195
- type: "string";
196
- };
197
- newText: {
198
- type: "string";
199
- };
200
- dryRun: {
201
- type: "boolean";
202
- };
203
- };
204
- required: readonly ["filePath", "oldText", "newText"];
205
- }>;
206
-
207
- interface FileNewToolOptions {
208
- allowedDirs?: readonly string[];
209
- defaultCwd?: string;
210
- name?: string;
211
- }
212
- declare function createFileNewTool(options?: FileNewToolOptions): ToolDefinition<{
213
- content: string;
214
- filePath: string;
215
- }, ToolOutputEnvelope, undefined, {
216
- type: "object";
217
- properties: {
218
- filePath: {
219
- type: "string";
220
- };
221
- content: {
222
- type: "string";
223
- };
224
- };
225
- required: readonly ["filePath", "content"];
226
- }>;
227
-
228
- interface FileReadToolOptions {
229
- allowedDirs?: readonly string[];
230
- defaultCwd?: string;
231
- name?: string;
232
- }
233
- declare function createFileReadTool(options?: FileReadToolOptions): ToolDefinition<{
234
- path: string;
235
- lineStart?: number | undefined;
236
- lineEnd?: number | undefined;
237
- }, ToolOutputEnvelope, undefined, {
238
- type: "object";
239
- properties: {
240
- path: {
241
- type: "string";
242
- };
243
- lineStart: {
244
- type: "number";
245
- description: string;
246
- };
247
- lineEnd: {
248
- type: "number";
249
- description: string;
250
- };
251
- };
252
- required: readonly ["path"];
253
- }>;
254
-
255
- interface GlobToolOptions {
256
- allowedDirs?: readonly string[];
257
- defaultCwd?: string;
258
- limit?: number;
259
- name?: string;
260
- }
261
- declare function createGlobTool(options?: GlobToolOptions): ToolDefinition<{
262
- pattern: string;
263
- path?: string | undefined;
264
- limit?: number | undefined;
265
- }, ToolOutputEnvelope, undefined, {
266
- type: "object";
267
- properties: {
268
- pattern: {
269
- type: "string";
270
- };
271
- path: {
272
- type: "string";
273
- };
274
- limit: {
275
- type: "number";
276
- };
277
- };
278
- required: readonly ["pattern"];
279
- }>;
280
-
281
- interface GrepToolOptions {
282
- allowedDirs?: readonly string[];
283
- defaultCwd?: string;
284
- limit?: number;
285
- name?: string;
286
- }
287
- declare function createGrepTool(options?: GrepToolOptions): ToolDefinition<{
288
- pattern: string;
289
- path?: string | undefined;
290
- limit?: number | undefined;
291
- include?: string | undefined;
292
- context?: number | undefined;
293
- }, ToolOutputEnvelope, undefined, {
294
- type: "object";
295
- properties: {
296
- pattern: {
297
- type: "string";
298
- };
299
- path: {
300
- type: "string";
301
- };
302
- include: {
303
- type: "string";
304
- };
305
- limit: {
306
- type: "number";
307
- };
308
- context: {
309
- type: "number";
310
- };
311
- };
312
- required: readonly ["pattern"];
313
- }>;
314
-
315
- interface InternalToolRuntimeOptions {
316
- onEvent?: ToolRuntimeEventHandler;
317
- onToolCall?: ToolRuntimeToolCallHandler;
318
- }
319
- declare function createInternalToolRuntime(tools?: AnyToolDefinition[], options?: InternalToolRuntimeOptions): ToolRuntime;
320
-
321
- interface LsToolOptions {
322
- allowedDirs?: readonly string[];
323
- defaultCwd?: string;
324
- name?: string;
325
- }
326
- declare function createLsTool(options?: LsToolOptions): ToolDefinition<{
327
- path: string;
328
- limit: number;
329
- }, ToolOutputEnvelope, undefined, {
330
- type: "object";
331
- properties: {
332
- path: {
333
- type: "string";
334
- };
335
- limit: {
336
- type: "number";
337
- };
338
- };
339
- }>;
340
-
341
- interface LspToolOptions {
342
- defaultCwd?: string;
343
- allowedDirs?: readonly string[];
344
- lspService?: LspService;
345
- name?: string;
346
- }
347
- declare function createLspTool(options?: LspToolOptions): ToolDefinition<{
348
- filePath: string;
349
- line: number;
350
- character: number;
351
- operation: string;
352
- query?: string | undefined;
353
- }, ToolOutputEnvelope, undefined, {
354
- type: "object";
355
- properties: {
356
- operation: {
357
- type: "string";
358
- enum: string[];
359
- };
360
- filePath: {
361
- type: "string";
362
- };
363
- line: {
364
- type: "number";
365
- };
366
- character: {
367
- type: "number";
368
- };
369
- query: {
370
- type: "string";
371
- };
372
- };
373
- required: readonly ["operation", "filePath", "line", "character"];
374
- }>;
375
-
376
- interface McpOAuthProviderOptions {
377
- serverName: string;
378
- callbackUrl: string;
379
- storageDir: string;
380
- config: MCPAuthConfig;
381
- onRedirect(url: URL): void | Promise<void>;
382
- }
383
- declare function createMcpOAuthProvider(options: McpOAuthProviderOptions): OAuthClientProvider;
384
-
385
- interface McpToolDescriptor {
386
- name: string;
387
- description?: string;
388
- inputSchema?: unknown;
389
- }
390
- interface McpToolClient {
391
- callTool(input: {
392
- name: string;
393
- arguments?: JsonObject;
394
- }): Promise<CallToolResult>;
395
- }
396
- declare function createMcpToolName(serverName: string, toolName: string): string;
397
- declare function toNuvinToolSchema(inputSchema: unknown): JsonSchemaObject;
398
- declare function createMcpTool(options: {
399
- serverName: string;
400
- tool: McpToolDescriptor;
401
- client: McpToolClient;
402
- }): ToolDefinition<{
403
- [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 | {
404
- [x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any;
405
- })[] | {
406
- [x: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any;
407
- })[] | {
408
- [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
409
- })[] | {
410
- [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
411
- })[] | {
412
- [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;
413
- })[] | {
414
- [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;
415
- })[] | {
416
- [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;
417
- })[] | {
418
- [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;
419
- })[] | {
420
- [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;
421
- })[] | {
422
- [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;
423
- })[] | {
424
- [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;
425
- })[] | {
426
- [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;
427
- };
428
- }, ToolOutputEnvelope, undefined, JsonSchemaObject<Record<string, JsonSchema>, readonly string[] | undefined>>;
429
-
430
- interface ConnectedMcpClient extends McpToolClient {
431
- listTools(): Promise<ListToolsResult>;
432
- close(): Promise<void>;
433
- }
434
- type McpServerConnectionStatus = {
435
- status: "connected";
436
- toolCount: number;
437
- } | {
438
- status: "disabled";
439
- } | {
440
- status: "authRequired";
441
- message: string;
442
- } | {
443
- status: "error";
444
- message: string;
445
- };
446
- interface McpToolBundle {
447
- tools: AnyToolDefinition[];
448
- servers: Record<string, McpServerConnectionStatus>;
449
- close(): Promise<void>;
450
- }
451
- interface McpConnectionOptions {
452
- oauth?: {
453
- storageDir: string;
454
- callbackUrl: string;
455
- onRedirect(serverName: string, url: URL): void | Promise<void>;
456
- };
457
- }
458
- type McpConnector = (serverName: string, config: MCPServerConfig, options?: McpConnectionOptions) => Promise<ConnectedMcpClient>;
459
- declare function buildMcpHttpHeaders(config: MCPServerConfig): Record<string, string> | undefined;
460
- declare function connectMcpServer(serverName: string, config: MCPServerConfig, options?: McpConnectionOptions): Promise<ConnectedMcpClient>;
461
- declare function createMcpToolsFromServers(options: {
462
- servers?: Record<string, MCPServerConfig>;
463
- allowedTools?: Record<string, Record<string, boolean>>;
464
- connection?: McpConnectionOptions;
465
- connect?: McpConnector;
466
- }): Promise<McpToolBundle>;
467
-
468
- declare function createMockToolRuntime(): ToolRuntime;
469
-
470
- type RipgrepMatch = {
471
- filePath: string;
472
- isContext?: boolean;
473
- lineNum: number;
474
- lineText: string;
475
- };
476
- declare function filepath(): Promise<string>;
477
- declare function files(opts: {
478
- cwd: string;
479
- glob?: string[];
480
- }): AsyncGenerator<string>;
481
- declare function search(opts: {
482
- context?: number;
483
- cwd: string;
484
- file?: string;
485
- glob?: string;
486
- limit?: number;
487
- pattern: string;
488
- }): Promise<RipgrepMatch[]>;
489
-
490
- interface DelegatedAgentFactoryContext extends AgentDefinitionFactoryContext {
491
- parentSessionId: string;
492
- runId: string;
493
- }
494
- type DelegatedAgentDefinition = AgentOptions | ((ctx: DelegatedAgentFactoryContext) => AgentOptions | Promise<AgentOptions>);
495
- interface CreateDelegationToolsOptions {
496
- agents?: Record<string, DelegatedAgentDefinition>;
497
- }
498
- declare function createAssignTaskTool(options: CreateDelegationToolsOptions): ToolDefinition<{
499
- description: string;
500
- task: string;
501
- agentId: string;
502
- nickname: string;
503
- }, ToolOutputEnvelope, ToolOutputEnvelope, {
504
- type: "object";
505
- properties: {
506
- agentId: {
507
- type: "string";
508
- };
509
- description: {
510
- type: "string";
511
- };
512
- nickname: {
513
- type: "string";
514
- };
515
- task: {
516
- type: "string";
517
- };
518
- };
519
- required: string[];
520
- }>;
521
- declare const createDelegateToAgentTool: typeof createAssignTaskTool;
522
- declare function createDelegationTools(options: CreateDelegationToolsOptions): ToolDefinition<{
523
- description: string;
524
- task: string;
525
- agentId: string;
526
- nickname: string;
527
- }, ToolOutputEnvelope, ToolOutputEnvelope, {
528
- type: "object";
529
- properties: {
530
- agentId: {
531
- type: "string";
532
- };
533
- description: {
534
- type: "string";
535
- };
536
- nickname: {
537
- type: "string";
538
- };
539
- task: {
540
- type: "string";
541
- };
542
- };
543
- required: string[];
544
- }>[];
545
-
546
- /** Minimal shape of a skill source reference — matches @nuvin/config SkillDefinitionSource */
547
- interface SkillSource {
548
- path: string;
549
- directory?: string;
550
- scope?: string;
551
- }
552
- /** Minimal shape of a skill reference — matches @nuvin/config SkillDefinitionReference */
553
- interface SkillReference {
554
- id: string;
555
- name: string;
556
- description: string;
557
- source: SkillSource;
558
- }
559
- /** Minimal shape of a loaded skill — matches @nuvin/config SerializedSkillDefinition */
560
- interface LoadedSkill extends SkillReference {
561
- instructions: string;
562
- }
563
- interface SkillToolOptions<TRef extends SkillReference = SkillReference> {
564
- skills: TRef[];
565
- loadSkill: (reference: TRef) => Promise<LoadedSkill>;
566
- }
567
- declare function createLoadSkillTool<TRef extends SkillReference>(options: SkillToolOptions<TRef>): ToolDefinition<{
568
- name: string;
569
- }, ToolOutputEnvelope, undefined, {
570
- type: "object";
571
- properties: {
572
- name: {
573
- type: "string";
574
- };
575
- };
576
- required: readonly ["name"];
577
- }>;
578
-
579
- type TodoStatus = "pending" | "in_progress" | "completed";
580
- type TodoPriority = "high" | "medium" | "low";
581
- type TodoInputItem = {
582
- id: string;
583
- content: string;
584
- status: TodoStatus;
585
- priority: TodoPriority;
586
- createdAt?: string;
587
- };
588
- type TodoItem = TodoInputItem & {
589
- sessionId: string;
590
- createdAt: string;
591
- updatedAt: string;
592
- };
593
- type TodoStats = {
594
- total: number;
595
- pending: number;
596
- inProgress: number;
597
- completed: number;
598
- };
599
- declare class TodoStore {
600
- private readonly todosBySession;
601
- getTodos(sessionId: string): TodoItem[];
602
- setTodos(sessionId: string, todos: TodoItem[]): void;
603
- getStats(sessionId: string): TodoStats;
604
- }
605
- declare function createTodoWriteTool(store?: TodoStore): ToolDefinition<{
606
- todos: {
607
- content: string;
608
- id: string;
609
- priority: string;
610
- status: string;
611
- createdAt: string;
612
- }[];
613
- }, never, ToolOutputEnvelope, {
614
- type: "object";
615
- properties: {
616
- todos: {
617
- type: "array";
618
- items: {
619
- type: "object";
620
- properties: {
621
- content: {
622
- type: "string";
623
- };
624
- status: {
625
- type: "string";
626
- };
627
- priority: {
628
- type: "string";
629
- };
630
- id: {
631
- type: "string";
632
- };
633
- createdAt: {
634
- type: "string";
635
- };
636
- };
637
- required: string[];
638
- };
639
- };
640
- };
641
- required: string[];
642
- }>;
643
-
644
- interface ToolOutputOffloadOptions {
645
- maxBytes: number;
646
- sessionDir?: string;
647
- }
648
- /**
649
- * Truncate a tool result's output if it exceeds `maxBytes`.
650
- * Full output is written to `{sessionDir}/{toolName}_{sanitizedCallId}.log`.
651
- * Returns the (possibly truncated) result. Mutates nothing.
652
- */
653
- declare function truncateToolOutput(result: ToolResult, options: ToolOutputOffloadOptions): Promise<ToolResult>;
654
-
655
- declare function normalizeToolOutputValue(output: ToolOutputValue): ToolResultChunk;
656
- declare function createToolOutput(output: string, structured?: JsonObject, content?: ToolResultContent): ToolOutputEnvelope;
657
- declare class ToolExecutionError extends Error {
658
- readonly structured: JsonObject;
659
- constructor(message: string, structured?: JsonObject);
660
- }
661
- declare function defineTool<TSchema extends JsonSchemaObject, TYield extends ToolOutputValue = ToolOutputValue, TReturn extends ToolOutputValue | undefined = ToolOutputValue | undefined>(definition: {
662
- name: string;
663
- description: string;
664
- inputSchema: TSchema;
665
- execute(input: InferJsonSchema<TSchema>, ctx: ToolExecutionContext): AsyncGenerator<TYield, TReturn, void>;
666
- }): ToolDefinition<InferJsonSchema<TSchema>, TYield, TReturn, TSchema>;
667
- declare class ToolRegistry {
668
- private readonly toolsByName;
669
- constructor(tools?: AnyToolDefinition[]);
670
- register(tool: AnyToolDefinition): void;
671
- get(name: string): AnyToolDefinition | undefined;
672
- list(): AnyToolDefinition[];
673
- listToolSchemas(): ToolSchema[];
674
- }
675
- declare function validateToolInput<TSchema extends JsonSchemaObject>(input: JsonValue, schema: TSchema): InferJsonSchema<TSchema>;
676
- declare function deriveFinalToolOutput(chunks: ToolResultChunk[]): ToolResultChunk;
677
-
678
- declare function createUpdateTopicTool(): ToolDefinition<{
679
- topic: string;
680
- }, ToolOutputEnvelope, undefined, {
681
- readonly type: "object";
682
- readonly properties: {
683
- readonly topic: {
684
- readonly type: "string";
685
- };
686
- };
687
- readonly required: readonly ["topic"];
688
- }>;
689
-
690
- interface ViewFileToolOptions {
691
- allowedDirs?: readonly string[];
692
- defaultCwd?: string;
693
- maxBytes?: number;
694
- name?: string;
695
- }
696
- declare function createViewFileTool(options?: ViewFileToolOptions): ToolDefinition<{
697
- path: string;
698
- detail?: string | undefined;
699
- }, ToolOutputEnvelope, undefined, {
700
- type: "object";
701
- properties: {
702
- path: {
703
- type: "string";
704
- };
705
- detail: {
706
- type: "string";
707
- };
708
- };
709
- required: readonly ["path"];
710
- }>;
711
-
712
- interface WebFetchToolOptions {
713
- timeoutMs?: number;
714
- name?: string;
715
- }
716
- declare function createWebFetchTool(options?: WebFetchToolOptions): ToolDefinition<{
717
- url: string;
718
- description?: string | undefined;
719
- }, ToolOutputEnvelope, undefined, {
720
- type: "object";
721
- properties: {
722
- description: {
723
- type: "string";
724
- };
725
- url: {
726
- type: "string";
727
- };
728
- };
729
- required: readonly ["url"];
730
- }>;
731
-
732
- interface GoogleCseEngineOptions {
733
- googleCseKey: string;
734
- googleCseCx: string;
735
- }
736
- interface OllamaEngineOptions {
737
- apiKey: string;
738
- }
739
- interface TavilyEngineOptions {
740
- tavilyApiKey: string;
741
- searchDepth?: "basic" | "advanced";
742
- topic?: "general" | "news" | "finance";
743
- }
744
- type WebSearchEngine = GoogleCseEngineOptions | OllamaEngineOptions | TavilyEngineOptions;
745
- interface WebSearchToolOptions {
746
- engines: WebSearchEngine[];
747
- name?: string;
748
- }
749
- declare function createWebSearchTool(options: WebSearchToolOptions): ToolDefinition<{
750
- query: string;
751
- type?: string | undefined;
752
- description?: string | undefined;
753
- count?: number | undefined;
754
- offset?: number | undefined;
755
- safe?: boolean | undefined;
756
- domains?: string[] | undefined;
757
- recencyDays?: number | undefined;
758
- lang?: string | undefined;
759
- region?: string | undefined;
760
- hydrateMeta?: boolean | undefined;
761
- }, ToolOutputEnvelope, undefined, {
762
- type: "object";
763
- properties: {
764
- description: {
765
- type: "string";
766
- };
767
- query: {
768
- type: "string";
769
- };
770
- count: {
771
- type: "number";
772
- };
773
- offset: {
774
- type: "number";
775
- };
776
- domains: {
777
- type: "array";
778
- items: {
779
- type: "string";
780
- };
781
- };
782
- recencyDays: {
783
- type: "number";
784
- };
785
- lang: {
786
- type: "string";
787
- };
788
- region: {
789
- type: "string";
790
- };
791
- safe: {
792
- type: "boolean";
793
- };
794
- type: {
795
- type: "string";
796
- };
797
- hydrateMeta: {
798
- type: "boolean";
799
- };
800
- };
801
- required: readonly ["query"];
802
- }>;
803
-
804
- declare function resolveWorkspacePath(rootDir: string, inputPath: string): string;
805
- declare function resolveAllowedPath(rootDir: string, allowedDirs: readonly string[], inputPath: string): string;
806
- declare function assertWorkspaceFile(filePath: string): Promise<void>;
807
- declare function isProbablyBinary(buffer: Buffer): boolean;
808
-
809
- export { type BashToolInput, type BashToolOptions, type CommandReference, type CommandToolOptions, type CreateDelegationToolsOptions, type DelegatedAgentDefinition, type DelegatedAgentFactoryContext, type FileEditToolOptions, type FileNewToolOptions, type FileReadToolOptions, type GlobToolOptions, type GoogleCseEngineOptions, 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 OllamaEngineOptions, type RipgrepMatch, type SkillReference, type SkillSource, type SkillToolOptions, type TavilyEngineOptions, ToolExecutionError, type ToolOutputOffloadOptions, ToolRegistry, type ViewFileToolOptions, type WebFetchToolOptions, type WebSearchEngine, 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, createUpdateTopicTool, createViewFileTool, createWebFetchTool, createWebSearchTool, defineTool, deriveFinalToolOutput, filepath, files, isProbablyBinary, normalizeToolOutputValue, resolveAllowedPath, resolveWorkspacePath, search, toNuvinToolSchema, truncateToolOutput, validateToolInput };
1
+ export * from "../lsp/index.ts";
2
+ export * from "./ask-user-tool.ts";
3
+ export * from "./bash-tool.ts";
4
+ export * from "./command-tool.ts";
5
+ export * from "./file-edit-tool.ts";
6
+ export * from "./file-new-tool.ts";
7
+ export * from "./file-read-tool.ts";
8
+ export * from "./glob-tool.ts";
9
+ export * from "./grep-tool.ts";
10
+ export * from "./internal-tool-runtime.ts";
11
+ export * from "./ls-tool.ts";
12
+ export * from "./lsp-tool.ts";
13
+ export * from "./mcp-oauth-provider.ts";
14
+ export * from "./mcp-server-manager.ts";
15
+ export * from "./mcp-tool-adapter.ts";
16
+ export * from "./mock-tool-runtime.ts";
17
+ export * from "./ripgrep.ts";
18
+ export * from "./runtime-manager-tools.ts";
19
+ export * from "./skill-tool.ts";
20
+ export * from "./todo-write-tool.ts";
21
+ export * from "./tool-output-offload.ts";
22
+ export * from "./tools.ts";
23
+ export * from "./update-topic-tool.ts";
24
+ export * from "./view-file-tool.ts";
25
+ export * from "./web-fetch-tool.ts";
26
+ export * from "./web-search-tool.ts";
27
+ export * from "./workspace-paths.ts";
28
+ //# sourceMappingURL=index.d.ts.map