@nuvin/agent-core 0.0.0-rc.9 → 0.0.0

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 (91) 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 -68
  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 -0
  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 -28
  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 -0
  25. package/dist/hooks/index.js +1 -0
  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 -347
  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 +67 -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 -17
  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-Bb2eVtsy.d.ts → shared/types.d.ts} +180 -164
  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 -773
  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/safe-fetch.d.ts +36 -0
  78. package/dist/tools/skill-tool.d.ts +33 -0
  79. package/dist/tools/todo-write-tool.d.ts +66 -0
  80. package/dist/tools/tool-output-offload.d.ts +12 -0
  81. package/dist/tools/tools.d.ts +24 -0
  82. package/dist/tools/update-topic-tool.d.ts +12 -0
  83. package/dist/tools/view-file-tool.d.ts +22 -0
  84. package/dist/tools/web-fetch-tool.d.ts +23 -0
  85. package/dist/tools/web-search-tool.d.ts +75 -0
  86. package/dist/tools/workspace-paths.d.ts +5 -0
  87. package/package.json +6 -2
  88. package/dist/chunk-3QLMAAJY.js +0 -1
  89. package/dist/chunk-4DNIDCX7.js +0 -1
  90. package/dist/chunk-G2FR4UGO.js +0 -1
  91. package/dist/provider-adapters-NxiNWlxu.d.ts +0 -5
@@ -1,773 +1,28 @@
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, b6 as ToolOutputValue, aw as ToolResultChunk, a0 as ToolResultContent, b5 as InferJsonSchema, aG as ToolExecutionContext, al as ToolSchema, L as JsonValue } from '../types-Bb2eVtsy.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
- 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
-
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
- };
246
- lineEnd: {
247
- type: "number";
248
- };
249
- };
250
- required: readonly ["path"];
251
- }>;
252
-
253
- interface GlobToolOptions {
254
- allowedDirs?: readonly string[];
255
- defaultCwd?: string;
256
- limit?: number;
257
- name?: string;
258
- }
259
- declare function createGlobTool(options?: GlobToolOptions): ToolDefinition<{
260
- pattern: string;
261
- path?: string | undefined;
262
- limit?: number | undefined;
263
- }, ToolOutputEnvelope, undefined, {
264
- type: "object";
265
- properties: {
266
- pattern: {
267
- type: "string";
268
- };
269
- path: {
270
- type: "string";
271
- };
272
- limit: {
273
- type: "number";
274
- };
275
- };
276
- required: readonly ["pattern"];
277
- }>;
278
-
279
- interface GrepToolOptions {
280
- allowedDirs?: readonly string[];
281
- defaultCwd?: string;
282
- limit?: number;
283
- name?: string;
284
- }
285
- declare function createGrepTool(options?: GrepToolOptions): ToolDefinition<{
286
- pattern: string;
287
- path?: string | undefined;
288
- limit?: number | undefined;
289
- include?: string | undefined;
290
- context?: number | undefined;
291
- }, ToolOutputEnvelope, undefined, {
292
- type: "object";
293
- properties: {
294
- pattern: {
295
- type: "string";
296
- };
297
- path: {
298
- type: "string";
299
- };
300
- include: {
301
- type: "string";
302
- };
303
- limit: {
304
- type: "number";
305
- };
306
- context: {
307
- type: "number";
308
- };
309
- };
310
- required: readonly ["pattern"];
311
- }>;
312
-
313
- interface InternalToolRuntimeOptions {
314
- onEvent?: ToolRuntimeEventHandler;
315
- onToolCall?: ToolRuntimeToolCallHandler;
316
- }
317
- declare function createInternalToolRuntime(tools?: AnyToolDefinition[], options?: InternalToolRuntimeOptions): ToolRuntime;
318
-
319
- interface LsToolOptions {
320
- allowedDirs?: readonly string[];
321
- defaultCwd?: string;
322
- name?: string;
323
- }
324
- declare function createLsTool(options?: LsToolOptions): ToolDefinition<{
325
- path: string;
326
- limit: number;
327
- }, ToolOutputEnvelope, undefined, {
328
- type: "object";
329
- properties: {
330
- path: {
331
- type: "string";
332
- };
333
- limit: {
334
- type: "number";
335
- };
336
- };
337
- }>;
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
-
374
- interface McpOAuthProviderOptions {
375
- serverName: string;
376
- callbackUrl: string;
377
- storageDir: string;
378
- config: MCPAuthConfig;
379
- onRedirect(url: URL): void | Promise<void>;
380
- }
381
- declare function createMcpOAuthProvider(options: McpOAuthProviderOptions): OAuthClientProvider;
382
-
383
- interface McpToolDescriptor {
384
- name: string;
385
- description?: string;
386
- inputSchema?: unknown;
387
- }
388
- interface McpToolClient {
389
- callTool(input: {
390
- name: string;
391
- arguments?: JsonObject;
392
- }): Promise<CallToolResult>;
393
- }
394
- declare function createMcpToolName(serverName: string, toolName: string): string;
395
- declare function toNuvinToolSchema(inputSchema: unknown): JsonSchemaObject;
396
- declare function createMcpTool(options: {
397
- serverName: string;
398
- tool: McpToolDescriptor;
399
- client: McpToolClient;
400
- }): ToolDefinition<{
401
- [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 | {
402
- [x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any;
403
- })[] | {
404
- [x: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any;
405
- })[] | {
406
- [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
407
- })[] | {
408
- [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any)[] | /*elided*/ any;
409
- })[] | {
410
- [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;
411
- })[] | {
412
- [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;
413
- })[] | {
414
- [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;
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 | (string | number | boolean | /*elided*/ any | /*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 | (string | number | boolean | /*elided*/ any | /*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 | (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;
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 | (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;
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 | (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;
425
- };
426
- }, ToolOutputEnvelope, undefined, JsonSchemaObject<Record<string, JsonSchema>, readonly string[] | undefined>>;
427
-
428
- interface ConnectedMcpClient extends McpToolClient {
429
- listTools(): Promise<ListToolsResult>;
430
- close(): Promise<void>;
431
- }
432
- type McpServerConnectionStatus = {
433
- status: "connected";
434
- toolCount: number;
435
- } | {
436
- status: "disabled";
437
- } | {
438
- status: "authRequired";
439
- message: string;
440
- } | {
441
- status: "error";
442
- message: string;
443
- };
444
- interface McpToolBundle {
445
- tools: AnyToolDefinition[];
446
- servers: Record<string, McpServerConnectionStatus>;
447
- close(): Promise<void>;
448
- }
449
- interface McpConnectionOptions {
450
- oauth?: {
451
- storageDir: string;
452
- callbackUrl: string;
453
- onRedirect(serverName: string, url: URL): void | Promise<void>;
454
- };
455
- }
456
- type McpConnector = (serverName: string, config: MCPServerConfig, options?: McpConnectionOptions) => Promise<ConnectedMcpClient>;
457
- declare function buildMcpHttpHeaders(config: MCPServerConfig): Record<string, string> | undefined;
458
- declare function connectMcpServer(serverName: string, config: MCPServerConfig, options?: McpConnectionOptions): Promise<ConnectedMcpClient>;
459
- declare function createMcpToolsFromServers(options: {
460
- servers?: Record<string, MCPServerConfig>;
461
- allowedTools?: Record<string, Record<string, boolean>>;
462
- connection?: McpConnectionOptions;
463
- connect?: McpConnector;
464
- }): Promise<McpToolBundle>;
465
-
466
- declare function createMockToolRuntime(): ToolRuntime;
467
-
468
- type RipgrepMatch = {
469
- filePath: string;
470
- isContext?: boolean;
471
- lineNum: number;
472
- lineText: string;
473
- };
474
- declare function filepath(): Promise<string>;
475
- declare function files(opts: {
476
- cwd: string;
477
- glob?: string[];
478
- }): AsyncGenerator<string>;
479
- declare function search(opts: {
480
- context?: number;
481
- cwd: string;
482
- file?: string;
483
- glob?: string;
484
- limit?: number;
485
- pattern: string;
486
- }): Promise<RipgrepMatch[]>;
487
-
488
- interface DelegatedAgentFactoryContext extends AgentDefinitionFactoryContext {
489
- parentSessionId: string;
490
- runId: string;
491
- }
492
- type DelegatedAgentDefinition = AgentOptions | ((ctx: DelegatedAgentFactoryContext) => AgentOptions | Promise<AgentOptions>);
493
- interface CreateDelegationToolsOptions {
494
- agents?: Record<string, DelegatedAgentDefinition>;
495
- }
496
- declare function createAssignTaskTool(options: CreateDelegationToolsOptions): ToolDefinition<{
497
- description: string;
498
- task: string;
499
- agentId: string;
500
- nickname: string;
501
- }, ToolOutputEnvelope, ToolOutputEnvelope, {
502
- type: "object";
503
- properties: {
504
- agentId: {
505
- type: "string";
506
- };
507
- description: {
508
- type: "string";
509
- };
510
- nickname: {
511
- type: "string";
512
- };
513
- task: {
514
- type: "string";
515
- };
516
- };
517
- required: string[];
518
- }>;
519
- declare const createDelegateToAgentTool: typeof createAssignTaskTool;
520
- declare function createDelegationTools(options: CreateDelegationToolsOptions): ToolDefinition<{
521
- description: string;
522
- task: string;
523
- agentId: string;
524
- nickname: string;
525
- }, ToolOutputEnvelope, ToolOutputEnvelope, {
526
- type: "object";
527
- properties: {
528
- agentId: {
529
- type: "string";
530
- };
531
- description: {
532
- type: "string";
533
- };
534
- nickname: {
535
- type: "string";
536
- };
537
- task: {
538
- type: "string";
539
- };
540
- };
541
- required: string[];
542
- }>[];
543
-
544
- /** Minimal shape of a skill source reference — matches @nuvin/config SkillDefinitionSource */
545
- interface SkillSource {
546
- path: string;
547
- directory?: string;
548
- scope?: string;
549
- }
550
- /** Minimal shape of a skill reference — matches @nuvin/config SkillDefinitionReference */
551
- interface SkillReference {
552
- id: string;
553
- name: string;
554
- description: string;
555
- source: SkillSource;
556
- }
557
- /** Minimal shape of a loaded skill — matches @nuvin/config SerializedSkillDefinition */
558
- interface LoadedSkill extends SkillReference {
559
- instructions: string;
560
- }
561
- interface SkillToolOptions<TRef extends SkillReference = SkillReference> {
562
- skills: TRef[];
563
- loadSkill: (reference: TRef) => Promise<LoadedSkill>;
564
- }
565
- declare function createLoadSkillTool<TRef extends SkillReference>(options: SkillToolOptions<TRef>): ToolDefinition<{
566
- name: string;
567
- }, ToolOutputEnvelope, undefined, {
568
- type: "object";
569
- properties: {
570
- name: {
571
- type: "string";
572
- };
573
- };
574
- required: readonly ["name"];
575
- }>;
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
- declare function normalizeToolOutputValue(output: ToolOutputValue): ToolResultChunk;
643
- declare function createToolOutput(output: string, structured?: JsonObject, content?: ToolResultContent): ToolOutputEnvelope;
644
- declare class ToolExecutionError extends Error {
645
- readonly structured: JsonObject;
646
- constructor(message: string, structured?: JsonObject);
647
- }
648
- declare function defineTool<TSchema extends JsonSchemaObject, TYield extends ToolOutputValue = ToolOutputValue, TReturn extends ToolOutputValue | undefined = ToolOutputValue | undefined>(definition: {
649
- name: string;
650
- description: string;
651
- inputSchema: TSchema;
652
- execute(input: InferJsonSchema<TSchema>, ctx: ToolExecutionContext): AsyncGenerator<TYield, TReturn, void>;
653
- }): ToolDefinition<InferJsonSchema<TSchema>, TYield, TReturn, TSchema>;
654
- declare class ToolRegistry {
655
- private readonly toolsByName;
656
- constructor(tools?: AnyToolDefinition[]);
657
- register(tool: AnyToolDefinition): void;
658
- get(name: string): AnyToolDefinition | undefined;
659
- list(): AnyToolDefinition[];
660
- listToolSchemas(): ToolSchema[];
661
- }
662
- declare function validateToolInput<TSchema extends JsonSchemaObject>(input: JsonValue, schema: TSchema): InferJsonSchema<TSchema>;
663
- declare function deriveFinalToolOutput(chunks: ToolResultChunk[]): ToolResultChunk;
664
-
665
- interface ViewFileToolOptions {
666
- allowedDirs?: readonly string[];
667
- defaultCwd?: string;
668
- maxBytes?: number;
669
- name?: string;
670
- }
671
- declare function createViewFileTool(options?: ViewFileToolOptions): ToolDefinition<{
672
- path: string;
673
- detail?: string | undefined;
674
- }, ToolOutputEnvelope, undefined, {
675
- type: "object";
676
- properties: {
677
- path: {
678
- type: "string";
679
- };
680
- detail: {
681
- type: "string";
682
- };
683
- };
684
- required: readonly ["path"];
685
- }>;
686
-
687
- interface WebFetchToolOptions {
688
- maxBytes?: number;
689
- timeoutMs?: number;
690
- name?: string;
691
- }
692
- declare function createWebFetchTool(options?: WebFetchToolOptions): ToolDefinition<{
693
- url: string;
694
- description?: string | undefined;
695
- }, ToolOutputEnvelope, undefined, {
696
- type: "object";
697
- properties: {
698
- description: {
699
- type: "string";
700
- };
701
- url: {
702
- type: "string";
703
- };
704
- };
705
- required: readonly ["url"];
706
- }>;
707
-
708
- interface WebSearchToolOptions {
709
- googleCseKey: string;
710
- googleCseCx: string;
711
- name?: string;
712
- }
713
- declare function createWebSearchTool(options: WebSearchToolOptions): ToolDefinition<{
714
- query: string;
715
- type?: string | undefined;
716
- description?: string | undefined;
717
- count?: number | undefined;
718
- offset?: number | undefined;
719
- safe?: boolean | undefined;
720
- domains?: string[] | undefined;
721
- recencyDays?: number | undefined;
722
- lang?: string | undefined;
723
- region?: string | undefined;
724
- hydrateMeta?: boolean | undefined;
725
- }, ToolOutputEnvelope, undefined, {
726
- type: "object";
727
- properties: {
728
- description: {
729
- type: "string";
730
- };
731
- query: {
732
- type: "string";
733
- };
734
- count: {
735
- type: "number";
736
- };
737
- offset: {
738
- type: "number";
739
- };
740
- domains: {
741
- type: "array";
742
- items: {
743
- type: "string";
744
- };
745
- };
746
- recencyDays: {
747
- type: "number";
748
- };
749
- lang: {
750
- type: "string";
751
- };
752
- region: {
753
- type: "string";
754
- };
755
- safe: {
756
- type: "boolean";
757
- };
758
- type: {
759
- type: "string";
760
- };
761
- hydrateMeta: {
762
- type: "boolean";
763
- };
764
- };
765
- required: readonly ["query"];
766
- }>;
767
-
768
- declare function resolveWorkspacePath(rootDir: string, inputPath: string): string;
769
- declare function resolveAllowedPath(rootDir: string, allowedDirs: readonly string[], inputPath: string): string;
770
- declare function assertWorkspaceFile(filePath: string): Promise<void>;
771
- declare function isProbablyBinary(buffer: Buffer): boolean;
772
-
773
- 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, 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, 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