@neovate/code 0.9.0 → 0.10.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.
- package/README.md +1 -1
- package/dist/cli.mjs +712 -727
- package/dist/index.d.ts +412 -77
- package/dist/index.mjs +711 -726
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,129 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AgentOutputItem } from '@openai/agents';
|
|
2
|
+
import { FunctionTool } from '@openai/agents';
|
|
3
|
+
import { LanguageModelV1 } from '@openrouter/ai-sdk-provider';
|
|
4
|
+
import type { LanguageModelV1 as LanguageModelV1_2 } from '@ai-sdk/provider';
|
|
5
|
+
import { LanguageModelV1CallWarning } from '@ai-sdk/provider';
|
|
6
|
+
import { LanguageModelV1FinishReason } from '@ai-sdk/provider';
|
|
7
|
+
import { LanguageModelV1FunctionToolCall } from '@ai-sdk/provider';
|
|
8
|
+
import { LanguageModelV1LogProbs } from '@ai-sdk/provider';
|
|
9
|
+
import { LanguageModelV1ProviderMetadata } from '@ai-sdk/provider';
|
|
10
|
+
import { LanguageModelV1Source } from '@ai-sdk/provider';
|
|
11
|
+
import { LoopResult as LoopResult_2 } from './loop';
|
|
12
|
+
import { MCPServer } from '@openai/agents';
|
|
13
|
+
import { Model as Model_2 } from '@openai/agents';
|
|
14
|
+
import { ModelRequest } from '@openai/agents';
|
|
15
|
+
import type { OpenAIProvider } from '@ai-sdk/openai';
|
|
16
|
+
import { ResponseStreamEvent } from '@openai/agents';
|
|
17
|
+
import { Usage as Usage_2 } from '@openai/agents';
|
|
18
|
+
import { z as _zod } from 'zod';
|
|
2
19
|
|
|
3
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Wraps a model from the AI SDK that adheres to the LanguageModelV1 spec to be used used as a model
|
|
22
|
+
* in the OpenAI Agents SDK to use other models.
|
|
23
|
+
*
|
|
24
|
+
* While you can use this with the OpenAI models, it is recommended to use the default OpenAI model
|
|
25
|
+
* provider instead.
|
|
26
|
+
*
|
|
27
|
+
* If tracing is enabled, the model will send generation spans to your traces processor.
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { aisdk } from '@openai/agents-extensions';
|
|
31
|
+
* import { openai } from '@ai-sdk/openai';
|
|
32
|
+
*
|
|
33
|
+
* const model = aisdk(openai('gpt-4o'));
|
|
34
|
+
*
|
|
35
|
+
* const agent = new Agent({
|
|
36
|
+
* name: 'My Agent',
|
|
37
|
+
* model
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @param model - The Vercel AI SDK model to wrap.
|
|
42
|
+
* @returns The wrapped model.
|
|
43
|
+
*/
|
|
44
|
+
declare class AiSdkModel implements Model_2 {
|
|
45
|
+
#private;
|
|
46
|
+
constructor(model: LanguageModelV1_2);
|
|
47
|
+
getResponse(request: ModelRequest): Promise<{
|
|
48
|
+
responseId: string;
|
|
49
|
+
usage: Usage_2;
|
|
50
|
+
output: AgentOutputItem[];
|
|
51
|
+
providerData: {
|
|
52
|
+
text?: string;
|
|
53
|
+
reasoning?: string | Array<{
|
|
54
|
+
type: "text";
|
|
55
|
+
text: string;
|
|
56
|
+
signature?: string;
|
|
57
|
+
} | {
|
|
58
|
+
type: "redacted";
|
|
59
|
+
data: string;
|
|
60
|
+
}>;
|
|
61
|
+
files?: Array<{
|
|
62
|
+
data: string | Uint8Array;
|
|
63
|
+
mimeType: string;
|
|
64
|
+
}>;
|
|
65
|
+
toolCalls?: Array<LanguageModelV1FunctionToolCall>;
|
|
66
|
+
finishReason: LanguageModelV1FinishReason;
|
|
67
|
+
usage: {
|
|
68
|
+
promptTokens: number;
|
|
69
|
+
completionTokens: number;
|
|
70
|
+
};
|
|
71
|
+
rawCall: {
|
|
72
|
+
rawPrompt: unknown;
|
|
73
|
+
rawSettings: Record<string, unknown>;
|
|
74
|
+
};
|
|
75
|
+
rawResponse?: {
|
|
76
|
+
headers?: Record<string, string>;
|
|
77
|
+
body?: unknown;
|
|
78
|
+
};
|
|
79
|
+
request?: {
|
|
80
|
+
body?: string;
|
|
81
|
+
};
|
|
82
|
+
response?: {
|
|
83
|
+
id?: string;
|
|
84
|
+
timestamp?: Date;
|
|
85
|
+
modelId?: string;
|
|
86
|
+
};
|
|
87
|
+
warnings?: LanguageModelV1CallWarning[];
|
|
88
|
+
providerMetadata?: LanguageModelV1ProviderMetadata;
|
|
89
|
+
sources?: LanguageModelV1Source[];
|
|
90
|
+
logprobs?: LanguageModelV1LogProbs;
|
|
91
|
+
};
|
|
92
|
+
}>;
|
|
93
|
+
getStreamedResponse(request: ModelRequest): AsyncIterable<ResponseStreamEvent>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare type ApprovalCategory = 'read' | 'write' | 'command' | 'network';
|
|
97
|
+
|
|
98
|
+
declare type ApprovalContext = {
|
|
99
|
+
toolName: string;
|
|
100
|
+
params: Record<string, any>;
|
|
101
|
+
approvalMode: string;
|
|
102
|
+
context: any;
|
|
103
|
+
};
|
|
4
104
|
|
|
5
105
|
declare type ApprovalMode = 'default' | 'autoEdit' | 'yolo';
|
|
6
106
|
|
|
107
|
+
declare type AssistantContent = string | Array<TextPart | ReasoningPart | ToolUsePart>;
|
|
108
|
+
|
|
109
|
+
declare type AssistantMessage = {
|
|
110
|
+
role: 'assistant';
|
|
111
|
+
content: AssistantContent;
|
|
112
|
+
text: string;
|
|
113
|
+
model: string;
|
|
114
|
+
usage: {
|
|
115
|
+
input_tokens: number;
|
|
116
|
+
output_tokens: number;
|
|
117
|
+
cache_read_input_tokens?: number;
|
|
118
|
+
cache_creation_input_tokens?: number;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
declare interface BaseSlashCommand {
|
|
123
|
+
name: string;
|
|
124
|
+
description: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
7
127
|
declare type CommitConfig = {
|
|
8
128
|
language: string;
|
|
9
129
|
};
|
|
@@ -30,6 +150,21 @@ declare type Config = {
|
|
|
30
150
|
outputFormat?: 'text' | 'stream-json' | 'json';
|
|
31
151
|
};
|
|
32
152
|
|
|
153
|
+
export declare class _ConfigManager {
|
|
154
|
+
globalConfig: Partial<Config>;
|
|
155
|
+
projectConfig: Partial<Config>;
|
|
156
|
+
argvConfig: Partial<Config>;
|
|
157
|
+
globalConfigPath: string;
|
|
158
|
+
projectConfigPath: string;
|
|
159
|
+
constructor(cwd: string, productName: string, argvConfig: Partial<Config>);
|
|
160
|
+
get config(): Config;
|
|
161
|
+
removeConfig(global: boolean, key: string, values?: string[]): void;
|
|
162
|
+
addConfig(global: boolean, key: string, values: string[]): void;
|
|
163
|
+
getConfig(global: boolean, key: string): any;
|
|
164
|
+
setConfig(global: boolean, key: string, value: string): void;
|
|
165
|
+
updateConfig(global: boolean, newConfig: Partial<Config>): void;
|
|
166
|
+
}
|
|
167
|
+
|
|
33
168
|
export declare class Context {
|
|
34
169
|
#private;
|
|
35
170
|
cwd: string;
|
|
@@ -38,6 +173,7 @@ export declare class Context {
|
|
|
38
173
|
version: string;
|
|
39
174
|
config: Config;
|
|
40
175
|
paths: Paths;
|
|
176
|
+
mcpManager: MCPManager;
|
|
41
177
|
constructor(opts: ContextOpts);
|
|
42
178
|
apply(applyOpts: Omit<PluginApplyOpts, 'pluginContext'>): Promise<any>;
|
|
43
179
|
destroy(): Promise<void>;
|
|
@@ -62,17 +198,95 @@ declare type ContextOpts = {
|
|
|
62
198
|
pluginManager: PluginManager;
|
|
63
199
|
paths: Paths;
|
|
64
200
|
argvConfig: Record<string, any>;
|
|
201
|
+
mcpManager: MCPManager;
|
|
65
202
|
};
|
|
66
203
|
|
|
204
|
+
export declare function createTool<TSchema extends _zod.ZodTypeAny>(config: {
|
|
205
|
+
name: string;
|
|
206
|
+
description: string;
|
|
207
|
+
parameters: TSchema;
|
|
208
|
+
execute: (params: _zod.infer<TSchema>) => Promise<any> | any;
|
|
209
|
+
approval?: ToolApprovalInfo;
|
|
210
|
+
}): Tool<_zod.infer<TSchema>>;
|
|
211
|
+
|
|
67
212
|
declare type Enforce = 'pre' | 'post';
|
|
68
213
|
|
|
69
|
-
declare
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
214
|
+
declare interface LocalCommand extends BaseSlashCommand {
|
|
215
|
+
type: 'local';
|
|
216
|
+
call(args: string, context: Context): Promise<string>;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
declare interface LocalJSXCommand extends BaseSlashCommand {
|
|
220
|
+
type: 'local-jsx';
|
|
221
|
+
call(onDone: (result: string) => void, context: Context): Promise<React.ReactNode>;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
declare type LoopResult = {
|
|
225
|
+
success: true;
|
|
226
|
+
data: Record<string, any>;
|
|
227
|
+
metadata: {
|
|
228
|
+
turnsCount: number;
|
|
229
|
+
toolCallsCount: number;
|
|
230
|
+
duration: number;
|
|
231
|
+
};
|
|
232
|
+
} | {
|
|
233
|
+
success: false;
|
|
234
|
+
error: {
|
|
235
|
+
type: 'tool_denied' | 'max_turns_exceeded' | 'api_error' | 'canceled';
|
|
236
|
+
message: string;
|
|
237
|
+
details?: Record<string, any>;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
declare interface MCPConfig {
|
|
242
|
+
type?: 'stdio' | 'sse' | 'http';
|
|
243
|
+
command?: string;
|
|
244
|
+
args?: string[];
|
|
245
|
+
env?: Record<string, string>;
|
|
246
|
+
url?: string;
|
|
247
|
+
disable?: boolean;
|
|
248
|
+
/**
|
|
249
|
+
* The timeout for tool calls in milliseconds.
|
|
250
|
+
*/
|
|
251
|
+
timeout?: number;
|
|
252
|
+
headers?: Record<string, string>;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
declare class MCPManager {
|
|
256
|
+
#private;
|
|
257
|
+
private servers;
|
|
258
|
+
private configs;
|
|
259
|
+
private isInitialized;
|
|
260
|
+
private initPromise?;
|
|
261
|
+
private initLock;
|
|
262
|
+
static create(mcpServers: Record<string, MCPConfig>): MCPManager;
|
|
263
|
+
initAsync(): Promise<void>;
|
|
264
|
+
private _performInit;
|
|
265
|
+
private _connectServer;
|
|
266
|
+
getAllTools(): Promise<Tool[]>;
|
|
267
|
+
getTools(keys: string[]): Promise<Tool[]>;
|
|
268
|
+
destroy(): Promise<void>;
|
|
269
|
+
getServerNames(): string[];
|
|
270
|
+
hasServer(name: string): boolean;
|
|
271
|
+
getServerStatus(name: string): MCPServerStatus | undefined;
|
|
272
|
+
getServerError(name: string): string | undefined;
|
|
273
|
+
getAllServerStatus(): Promise<Record<string, {
|
|
274
|
+
status: MCPServerStatus;
|
|
275
|
+
error?: string;
|
|
276
|
+
toolCount: number;
|
|
277
|
+
}>>;
|
|
278
|
+
isReady(): boolean;
|
|
279
|
+
isLoading(): boolean;
|
|
280
|
+
retryConnection(serverName: string): Promise<void>;
|
|
281
|
+
getAllMcpTools(mcpServers: MCPServer[], convertSchemasToStrict?: boolean): Promise<Tool[]>;
|
|
282
|
+
getFunctionToolsFromServer<TContext = UnknownContext>(server: MCPServer, convertSchemasToStrict: boolean): Promise<FunctionTool<TContext, any, string>[]>;
|
|
283
|
+
private _isTemporaryError;
|
|
284
|
+
}
|
|
73
285
|
|
|
74
286
|
declare type McpServerConfig = McpStdioServerConfig | McpSSEServerConfig;
|
|
75
287
|
|
|
288
|
+
declare type MCPServerStatus = 'pending' | 'connecting' | 'connected' | 'failed' | 'disconnected';
|
|
289
|
+
|
|
76
290
|
declare type McpSSEServerConfig = {
|
|
77
291
|
type: 'sse';
|
|
78
292
|
url: string;
|
|
@@ -87,11 +301,12 @@ declare type McpStdioServerConfig = {
|
|
|
87
301
|
disable?: boolean;
|
|
88
302
|
};
|
|
89
303
|
|
|
90
|
-
declare type
|
|
304
|
+
declare type Message = SystemMessage | UserMessage | AssistantMessage | ToolMessage;
|
|
91
305
|
|
|
92
306
|
declare interface Model {
|
|
93
307
|
id: string;
|
|
94
308
|
name: string;
|
|
309
|
+
shortName?: string;
|
|
95
310
|
attachment: boolean;
|
|
96
311
|
reasoning: boolean;
|
|
97
312
|
temperature: boolean;
|
|
@@ -105,6 +320,8 @@ declare interface Model {
|
|
|
105
320
|
limit: ModelLimit;
|
|
106
321
|
}
|
|
107
322
|
|
|
323
|
+
declare type ModelAlias = Record<string, string>;
|
|
324
|
+
|
|
108
325
|
declare interface ModelCost {
|
|
109
326
|
input: number;
|
|
110
327
|
output: number;
|
|
@@ -112,6 +329,12 @@ declare interface ModelCost {
|
|
|
112
329
|
cache_write?: number;
|
|
113
330
|
}
|
|
114
331
|
|
|
332
|
+
declare type ModelInfo = {
|
|
333
|
+
provider: Provider;
|
|
334
|
+
model: Omit<Model, 'cost'>;
|
|
335
|
+
aisdk: AiSdkModel;
|
|
336
|
+
};
|
|
337
|
+
|
|
115
338
|
declare interface ModelLimit {
|
|
116
339
|
context: number;
|
|
117
340
|
output: number;
|
|
@@ -124,6 +347,29 @@ declare interface ModelModalities {
|
|
|
124
347
|
output: ('text' | 'audio' | 'image')[];
|
|
125
348
|
}
|
|
126
349
|
|
|
350
|
+
declare type NormalizedMessage = Message & {
|
|
351
|
+
type: 'message';
|
|
352
|
+
timestamp: string;
|
|
353
|
+
uuid: string;
|
|
354
|
+
parentUuid: string | null;
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
declare class OutputStyle {
|
|
358
|
+
name: string;
|
|
359
|
+
description: string;
|
|
360
|
+
isCodingRelated: boolean;
|
|
361
|
+
prompt: string;
|
|
362
|
+
constructor(opts: OutputStyleOpts);
|
|
363
|
+
isDefault(): boolean;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
declare type OutputStyleOpts = {
|
|
367
|
+
name: string;
|
|
368
|
+
description: string;
|
|
369
|
+
isCodingRelated: boolean;
|
|
370
|
+
prompt: string;
|
|
371
|
+
};
|
|
372
|
+
|
|
127
373
|
declare class Paths {
|
|
128
374
|
globalConfigDir: string;
|
|
129
375
|
globalProjectDir: string;
|
|
@@ -149,61 +395,70 @@ declare type Plugin_2 = {
|
|
|
149
395
|
config?: (this: TempPluginContext, opts: {
|
|
150
396
|
config: Config;
|
|
151
397
|
argvConfig: Record<string, any>;
|
|
152
|
-
}) =>
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}) => Promise<any> | any;
|
|
398
|
+
}) => Partial<Config> | Promise<Partial<Config>>;
|
|
399
|
+
slashCommand?: (this: PluginContext) => Promise<SlashCommand[]> | SlashCommand[];
|
|
400
|
+
outputStyle?: (this: PluginContext) => Promise<OutputStyle[]> | OutputStyle[];
|
|
401
|
+
provider?: (this: PluginContext, providers: ProvidersMap, opts: {
|
|
402
|
+
models: ModelMap;
|
|
403
|
+
defaultModelCreator: (name: string, provider: Provider) => LanguageModelV1;
|
|
404
|
+
createOpenAI: (options: any) => OpenAIProvider;
|
|
405
|
+
}) => Promise<ProvidersMap> | ProvidersMap;
|
|
406
|
+
modelAlias?: (this: PluginContext, modelAlias: ModelAlias) => Promise<ModelAlias> | ModelAlias;
|
|
407
|
+
initialized?: (this: PluginContext, opts: {
|
|
408
|
+
cwd: string;
|
|
409
|
+
quiet: boolean;
|
|
410
|
+
}) => Promise<void> | void;
|
|
166
411
|
context?: (this: PluginContext, opts: {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
412
|
+
userPrompt: string | null;
|
|
413
|
+
sessionId: string;
|
|
414
|
+
}) => Promise<Record<string, string> | {}> | Record<string, string> | {};
|
|
415
|
+
env?: (this: PluginContext, opts: {
|
|
416
|
+
userPrompt: string | null;
|
|
417
|
+
sessionId: string;
|
|
418
|
+
}) => Promise<Record<string, string> | {}> | Record<string, string> | {};
|
|
419
|
+
userPrompt?: (this: PluginContext, userPrompt: string, opts: {
|
|
420
|
+
sessionId: string;
|
|
421
|
+
}) => Promise<string> | string;
|
|
422
|
+
systemPrompt?: (this: PluginContext, systemPrompt: string, opts: {
|
|
423
|
+
isPlan?: boolean;
|
|
171
424
|
sessionId: string;
|
|
172
|
-
}) => Promise<any> | any;
|
|
173
|
-
systemPrompt?: (this: PluginContext, memo: string[], opts: {
|
|
174
|
-
prompt: string | undefined;
|
|
175
425
|
}) => Promise<string> | string;
|
|
176
|
-
|
|
177
|
-
|
|
426
|
+
tool?: (this: PluginContext, opts: {
|
|
427
|
+
isPlan?: boolean;
|
|
428
|
+
sessionId: string;
|
|
429
|
+
}) => Promise<Tool[]> | Tool[];
|
|
430
|
+
toolUse?: (this: PluginContext, toolUse: ToolUse, opts: {
|
|
431
|
+
sessionId: string;
|
|
432
|
+
}) => Promise<ToolUse> | ToolUse;
|
|
433
|
+
toolResult?: (this: PluginContext, toolResult: any, opts: {
|
|
434
|
+
toolUse: ToolUse;
|
|
435
|
+
approved: boolean;
|
|
178
436
|
sessionId: string;
|
|
179
437
|
}) => Promise<any> | any;
|
|
180
438
|
query?: (this: PluginContext, opts: {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
model: string;
|
|
185
|
-
usage: any;
|
|
439
|
+
usage: Usage;
|
|
440
|
+
startTime: Date;
|
|
441
|
+
endTime: Date;
|
|
186
442
|
sessionId: string;
|
|
187
|
-
}) => Promise<
|
|
443
|
+
}) => Promise<void> | void;
|
|
188
444
|
conversation?: (this: PluginContext, opts: {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}) => Promise<
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
serverAppData?: (this: PluginContext, opts: {
|
|
445
|
+
userPrompt: string | null;
|
|
446
|
+
result: LoopResult;
|
|
447
|
+
startTime: Date;
|
|
448
|
+
endTime: Date;
|
|
449
|
+
sessionId: string;
|
|
450
|
+
}) => Promise<void> | void;
|
|
451
|
+
status?: (this: PluginContext) => Promise<Status> | Status;
|
|
452
|
+
_serverAppData?: (this: PluginContext, opts: {
|
|
198
453
|
context: any;
|
|
199
454
|
cwd: string;
|
|
200
455
|
}) => Promise<any> | any;
|
|
201
|
-
|
|
456
|
+
_serverRoutes?: (this: PluginContext, opts: {
|
|
202
457
|
app: any;
|
|
203
458
|
prefix: string;
|
|
204
459
|
opts: any;
|
|
205
460
|
}) => Promise<any> | any;
|
|
206
|
-
|
|
461
|
+
_serverRouteCompletions?: (this: PluginContext, opts: {
|
|
207
462
|
message: {
|
|
208
463
|
role: 'user';
|
|
209
464
|
content: string;
|
|
@@ -212,28 +467,6 @@ declare type Plugin_2 = {
|
|
|
212
467
|
};
|
|
213
468
|
attachedContexts: any[];
|
|
214
469
|
}) => Promise<any> | any;
|
|
215
|
-
command?: (this: PluginContext) => Promise<any[]> | any[];
|
|
216
|
-
outputStyle?: (this: PluginContext) => Promise<any> | any;
|
|
217
|
-
argvConfig?: (this: PluginContext) => Promise<any> | any;
|
|
218
|
-
status?: (this: PluginContext) => Promise<Status> | Status;
|
|
219
|
-
tool?: (this: PluginContext, opts: {
|
|
220
|
-
agentType: AgentType;
|
|
221
|
-
}) => Promise<any>;
|
|
222
|
-
toolUse?: (this: PluginContext, opts: {
|
|
223
|
-
toolUse: any;
|
|
224
|
-
sessionId: string;
|
|
225
|
-
}) => Promise<any> | any;
|
|
226
|
-
toolUseResult?: (this: PluginContext, opts: {
|
|
227
|
-
toolUse: any;
|
|
228
|
-
result: any;
|
|
229
|
-
sessionId: string;
|
|
230
|
-
}) => Promise<any> | any;
|
|
231
|
-
provider?: (this: PluginContext, opts: {
|
|
232
|
-
models: ModelMap;
|
|
233
|
-
defaultModelCreator: any;
|
|
234
|
-
createOpenAI: any;
|
|
235
|
-
}) => Promise<any> | any;
|
|
236
|
-
modelAlias?: (this: PluginContext) => Promise<any> | any;
|
|
237
470
|
};
|
|
238
471
|
export { Plugin_2 as Plugin }
|
|
239
472
|
|
|
@@ -261,6 +494,43 @@ declare class PluginManager {
|
|
|
261
494
|
apply({ hook, args, memo, type, pluginContext, }: PluginApplyOpts): Promise<any>;
|
|
262
495
|
}
|
|
263
496
|
|
|
497
|
+
declare interface PromptCommand extends BaseSlashCommand {
|
|
498
|
+
type: 'prompt';
|
|
499
|
+
argNames?: string[];
|
|
500
|
+
progressMessage: string;
|
|
501
|
+
model?: string;
|
|
502
|
+
getPromptForCommand(args: string): Promise<Array<{
|
|
503
|
+
role: string;
|
|
504
|
+
content: string;
|
|
505
|
+
}>>;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
declare interface Provider {
|
|
509
|
+
id: string;
|
|
510
|
+
env: string[];
|
|
511
|
+
name: string;
|
|
512
|
+
api?: string;
|
|
513
|
+
doc: string;
|
|
514
|
+
models: Record<string, Omit<Model, 'id' | 'cost'>>;
|
|
515
|
+
createModel(name: string, provider: Provider): LanguageModelV1;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
declare type ProvidersMap = Record<string, Provider>;
|
|
519
|
+
|
|
520
|
+
export declare function _query(opts: {
|
|
521
|
+
userPrompt: string;
|
|
522
|
+
messages?: NormalizedMessage[];
|
|
523
|
+
context?: Context;
|
|
524
|
+
model?: ModelInfo;
|
|
525
|
+
systemPrompt?: string;
|
|
526
|
+
onMessage?: (message: NormalizedMessage) => Promise<void>;
|
|
527
|
+
}): Promise<LoopResult_2>;
|
|
528
|
+
|
|
529
|
+
declare type ReasoningPart = {
|
|
530
|
+
type: 'reasoning';
|
|
531
|
+
text: string;
|
|
532
|
+
};
|
|
533
|
+
|
|
264
534
|
export declare function runNeovate(opts: {
|
|
265
535
|
productName: string;
|
|
266
536
|
productASCIIArt?: string;
|
|
@@ -269,30 +539,72 @@ export declare function runNeovate(opts: {
|
|
|
269
539
|
upgrade?: UpgradeOptions;
|
|
270
540
|
}): Promise<void>;
|
|
271
541
|
|
|
542
|
+
declare type SlashCommand = LocalCommand | LocalJSXCommand | PromptCommand;
|
|
543
|
+
|
|
272
544
|
declare type Status = Record<string, {
|
|
273
545
|
description?: string;
|
|
274
546
|
items: string[];
|
|
275
547
|
}>;
|
|
276
548
|
|
|
549
|
+
declare type SystemMessage = {
|
|
550
|
+
role: 'system';
|
|
551
|
+
content: string;
|
|
552
|
+
};
|
|
553
|
+
|
|
277
554
|
declare type TempPluginContext = ContextCreateOpts & {
|
|
278
555
|
pluginManager: PluginManager;
|
|
279
556
|
config: Config;
|
|
280
557
|
apply: (opts: PluginApplyOpts) => Promise<any> | any;
|
|
281
558
|
};
|
|
282
559
|
|
|
283
|
-
declare
|
|
560
|
+
declare type TextPart = {
|
|
284
561
|
type: 'text';
|
|
285
|
-
|
|
286
|
-
|
|
562
|
+
text: string;
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
declare interface Tool<T = any> {
|
|
566
|
+
name: string;
|
|
567
|
+
description: string;
|
|
568
|
+
execute: (params: T) => Promise<any> | any;
|
|
569
|
+
approval?: ToolApprovalInfo;
|
|
570
|
+
parameters: _zod.ZodSchema<T>;
|
|
287
571
|
}
|
|
288
572
|
|
|
289
|
-
declare
|
|
573
|
+
declare type ToolApprovalInfo = {
|
|
574
|
+
needsApproval?: (context: ApprovalContext) => Promise<boolean> | boolean;
|
|
575
|
+
category?: ApprovalCategory;
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
declare type ToolContent = Array<ToolResultPart>;
|
|
579
|
+
|
|
580
|
+
declare type ToolMessage = {
|
|
581
|
+
role: 'user';
|
|
582
|
+
content: ToolContent;
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
declare type ToolResultPart = {
|
|
586
|
+
type: 'tool_result';
|
|
587
|
+
id: string;
|
|
588
|
+
name: string;
|
|
589
|
+
input: Record<string, any>;
|
|
590
|
+
result: any;
|
|
591
|
+
isError?: boolean;
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
declare type ToolUse = {
|
|
595
|
+
name: string;
|
|
596
|
+
params: Record<string, any>;
|
|
597
|
+
callId: string;
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
declare type ToolUsePart = {
|
|
290
601
|
type: 'tool_use';
|
|
602
|
+
id: string;
|
|
291
603
|
name: string;
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
604
|
+
input: Record<string, any>;
|
|
605
|
+
};
|
|
606
|
+
|
|
607
|
+
declare type UnknownContext = unknown;
|
|
296
608
|
|
|
297
609
|
declare type UpgradeOptions = {
|
|
298
610
|
registryBase: string;
|
|
@@ -304,4 +616,27 @@ declare type UpgradeOptions = {
|
|
|
304
616
|
changelogUrl?: string;
|
|
305
617
|
};
|
|
306
618
|
|
|
619
|
+
declare class Usage {
|
|
620
|
+
promptTokens: number;
|
|
621
|
+
completionTokens: number;
|
|
622
|
+
totalTokens: number;
|
|
623
|
+
constructor(init?: Partial<Usage>);
|
|
624
|
+
static empty(): Usage;
|
|
625
|
+
static fromEventUsage(eventUsage: any): Usage;
|
|
626
|
+
add(other: Usage): void;
|
|
627
|
+
reset(): void;
|
|
628
|
+
clone(): Usage;
|
|
629
|
+
isValid(): boolean;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
declare type UserContent = string | Array<TextPart>;
|
|
633
|
+
|
|
634
|
+
declare type UserMessage = {
|
|
635
|
+
role: 'user';
|
|
636
|
+
content: UserContent;
|
|
637
|
+
hidden?: boolean;
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
export { _zod }
|
|
641
|
+
|
|
307
642
|
export { }
|