@neovate/code 0.13.0 → 0.15.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/dist/cli.mjs +1308 -1372
- package/dist/index.d.ts +79 -125
- package/dist/index.mjs +1308 -1372
- package/dist/mcps/chrome-devtools-mcp.mjs +196 -195
- package/package.json +43 -46
package/dist/index.d.ts
CHANGED
|
@@ -1,98 +1,8 @@
|
|
|
1
|
-
import {
|
|
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';
|
|
1
|
+
import { LanguageModelV2 } from '@openrouter/ai-sdk-provider';
|
|
15
2
|
import type { OpenAIProvider } from '@ai-sdk/openai';
|
|
16
|
-
import
|
|
17
|
-
import { Usage as Usage_2 } from '@openai/agents';
|
|
3
|
+
import * as z from 'zod';
|
|
18
4
|
import { z as _zod } from 'zod';
|
|
19
5
|
|
|
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
6
|
declare type ApprovalCategory = 'read' | 'write' | 'command' | 'network';
|
|
97
7
|
|
|
98
8
|
declare type ApprovalContext = {
|
|
@@ -119,6 +29,29 @@ declare type AssistantMessage = {
|
|
|
119
29
|
};
|
|
120
30
|
};
|
|
121
31
|
|
|
32
|
+
declare interface BackgroundTask {
|
|
33
|
+
id: string;
|
|
34
|
+
command: string;
|
|
35
|
+
pid: number;
|
|
36
|
+
pgid?: number;
|
|
37
|
+
status: 'running' | 'completed' | 'killed' | 'failed';
|
|
38
|
+
createdAt: number;
|
|
39
|
+
output: string;
|
|
40
|
+
exitCode: number | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare class BackgroundTaskManager {
|
|
44
|
+
private tasks;
|
|
45
|
+
createTask(input: CreateTaskInput): string;
|
|
46
|
+
getTask(id: string): BackgroundTask | null;
|
|
47
|
+
getAllTasks(): BackgroundTask[];
|
|
48
|
+
appendOutput(id: string, output: string): void;
|
|
49
|
+
updateTaskStatus(id: string, status: BackgroundTask['status'], exitCode?: number | null): void;
|
|
50
|
+
deleteTask(id: string): void;
|
|
51
|
+
private isProcessAlive;
|
|
52
|
+
killTask(id: string): Promise<boolean>;
|
|
53
|
+
}
|
|
54
|
+
|
|
122
55
|
declare interface BaseSlashCommand {
|
|
123
56
|
name: string;
|
|
124
57
|
description: string;
|
|
@@ -127,11 +60,13 @@ declare interface BaseSlashCommand {
|
|
|
127
60
|
|
|
128
61
|
declare type CommitConfig = {
|
|
129
62
|
language: string;
|
|
63
|
+
systemPrompt?: string;
|
|
130
64
|
};
|
|
131
65
|
|
|
132
66
|
declare type Config = {
|
|
133
67
|
model: string;
|
|
134
68
|
planModel: string;
|
|
69
|
+
smallModel?: string;
|
|
135
70
|
language: string;
|
|
136
71
|
quiet: boolean;
|
|
137
72
|
approvalMode: ApprovalMode;
|
|
@@ -179,6 +114,7 @@ export declare class Context {
|
|
|
179
114
|
paths: Paths;
|
|
180
115
|
argvConfig: Record<string, any>;
|
|
181
116
|
mcpManager: MCPManager;
|
|
117
|
+
backgroundTaskManager: BackgroundTaskManager;
|
|
182
118
|
constructor(opts: ContextOpts);
|
|
183
119
|
apply(applyOpts: Omit<PluginApplyOpts, 'pluginContext'>): Promise<any>;
|
|
184
120
|
destroy(): Promise<void>;
|
|
@@ -204,19 +140,26 @@ declare type ContextOpts = {
|
|
|
204
140
|
paths: Paths;
|
|
205
141
|
argvConfig: Record<string, any>;
|
|
206
142
|
mcpManager: MCPManager;
|
|
143
|
+
backgroundTaskManager: BackgroundTaskManager;
|
|
207
144
|
};
|
|
208
145
|
|
|
209
|
-
|
|
146
|
+
declare interface CreateTaskInput {
|
|
147
|
+
command: string;
|
|
148
|
+
pid: number;
|
|
149
|
+
pgid?: number;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export declare function createTool<TSchema extends z.ZodTypeAny>(config: {
|
|
210
153
|
name: string;
|
|
211
154
|
description: string;
|
|
212
155
|
parameters: TSchema;
|
|
213
|
-
execute: (params:
|
|
156
|
+
execute: (params: z.output<TSchema>) => Promise<ToolResult> | ToolResult;
|
|
214
157
|
approval?: ToolApprovalInfo;
|
|
215
158
|
getDescription?: ({ params, cwd, }: {
|
|
216
|
-
params:
|
|
159
|
+
params: z.output<TSchema>;
|
|
217
160
|
cwd: string;
|
|
218
161
|
}) => string;
|
|
219
|
-
}): Tool<
|
|
162
|
+
}): Tool<TSchema>;
|
|
220
163
|
|
|
221
164
|
declare type DiffViewerReturnDisplay = {
|
|
222
165
|
type: 'diff_viewer';
|
|
@@ -312,8 +255,8 @@ declare class MCPManager {
|
|
|
312
255
|
isReady(): boolean;
|
|
313
256
|
isLoading(): boolean;
|
|
314
257
|
retryConnection(serverName: string): Promise<void>;
|
|
315
|
-
|
|
316
|
-
|
|
258
|
+
private _createClient;
|
|
259
|
+
private _testConnectionAndFetchTools;
|
|
317
260
|
private _isTemporaryError;
|
|
318
261
|
}
|
|
319
262
|
|
|
@@ -336,7 +279,7 @@ declare type McpStdioServerConfig = {
|
|
|
336
279
|
disable?: boolean;
|
|
337
280
|
};
|
|
338
281
|
|
|
339
|
-
declare type Message = SystemMessage | UserMessage | AssistantMessage | ToolMessage;
|
|
282
|
+
declare type Message = SystemMessage | UserMessage | AssistantMessage | ToolMessage | ToolMessage2;
|
|
340
283
|
|
|
341
284
|
declare interface Model {
|
|
342
285
|
id: string;
|
|
@@ -367,7 +310,7 @@ declare interface ModelCost {
|
|
|
367
310
|
declare type ModelInfo = {
|
|
368
311
|
provider: Provider;
|
|
369
312
|
model: Omit<Model, 'cost'>;
|
|
370
|
-
|
|
313
|
+
m: LanguageModelV2;
|
|
371
314
|
};
|
|
372
315
|
|
|
373
316
|
declare interface ModelLimit {
|
|
@@ -415,7 +358,7 @@ declare class Paths {
|
|
|
415
358
|
cwd: string;
|
|
416
359
|
});
|
|
417
360
|
getSessionLogPath(sessionId: string): string;
|
|
418
|
-
getLatestSessionId(): string;
|
|
361
|
+
getLatestSessionId(): string | undefined;
|
|
419
362
|
getAllSessions(): {
|
|
420
363
|
sessionId: string;
|
|
421
364
|
modified: Date;
|
|
@@ -437,7 +380,7 @@ declare type Plugin_2 = {
|
|
|
437
380
|
outputStyle?: (this: PluginContext) => Promise<OutputStyle[]> | OutputStyle[];
|
|
438
381
|
provider?: (this: PluginContext, providers: ProvidersMap, opts: {
|
|
439
382
|
models: ModelMap;
|
|
440
|
-
defaultModelCreator: (name: string, provider: Provider) =>
|
|
383
|
+
defaultModelCreator: (name: string, provider: Provider) => LanguageModelV2;
|
|
441
384
|
createOpenAI: (options: any) => OpenAIProvider;
|
|
442
385
|
}) => Promise<ProvidersMap> | ProvidersMap;
|
|
443
386
|
modelAlias?: (this: PluginContext, modelAlias: ModelAlias) => Promise<ModelAlias> | ModelAlias;
|
|
@@ -554,7 +497,7 @@ declare interface Provider {
|
|
|
554
497
|
api?: string;
|
|
555
498
|
doc: string;
|
|
556
499
|
models: Record<string, string | Omit<Model, 'id' | 'cost'>>;
|
|
557
|
-
createModel(name: string, provider: Provider, globalConfigDir: string): Promise<
|
|
500
|
+
createModel(name: string, provider: Provider, globalConfigDir: string): Promise<LanguageModelV2> | LanguageModelV2;
|
|
558
501
|
options?: {
|
|
559
502
|
baseURL?: string;
|
|
560
503
|
apiKey?: string;
|
|
@@ -573,13 +516,15 @@ export declare function _query(opts: {
|
|
|
573
516
|
model?: ModelInfo;
|
|
574
517
|
systemPrompt?: string;
|
|
575
518
|
onMessage?: (message: NormalizedMessage) => Promise<void>;
|
|
576
|
-
}): Promise<
|
|
519
|
+
}): Promise<LoopResult>;
|
|
577
520
|
|
|
578
521
|
declare type ReasoningPart = {
|
|
579
522
|
type: 'reasoning';
|
|
580
523
|
text: string;
|
|
581
524
|
};
|
|
582
525
|
|
|
526
|
+
declare type ReturnDisplay = string | DiffViewerReturnDisplay | TodoReadReturnDisplay | TodoWriteReturnDisplay;
|
|
527
|
+
|
|
583
528
|
export declare function runNeovate(opts: {
|
|
584
529
|
productName: string;
|
|
585
530
|
productASCIIArt?: string;
|
|
@@ -616,19 +561,17 @@ declare type TodoItem = _zod.infer<typeof TodoItemSchema>;
|
|
|
616
561
|
declare const TodoItemSchema: _zod.ZodObject<{
|
|
617
562
|
id: _zod.ZodString;
|
|
618
563
|
content: _zod.ZodString;
|
|
619
|
-
status: _zod.ZodEnum<
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
priority: "low" | "medium" | "high";
|
|
631
|
-
}>;
|
|
564
|
+
status: _zod.ZodEnum<{
|
|
565
|
+
completed: "completed";
|
|
566
|
+
pending: "pending";
|
|
567
|
+
in_progress: "in_progress";
|
|
568
|
+
}>;
|
|
569
|
+
priority: _zod.ZodEnum<{
|
|
570
|
+
low: "low";
|
|
571
|
+
medium: "medium";
|
|
572
|
+
high: "high";
|
|
573
|
+
}>;
|
|
574
|
+
}, _zod.core.$strip>;
|
|
632
575
|
|
|
633
576
|
declare type TodoReadReturnDisplay = {
|
|
634
577
|
type: 'todo_read';
|
|
@@ -641,17 +584,17 @@ declare type TodoWriteReturnDisplay = {
|
|
|
641
584
|
newTodos: TodoItem[];
|
|
642
585
|
};
|
|
643
586
|
|
|
644
|
-
declare interface Tool<
|
|
587
|
+
declare interface Tool<TSchema extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
645
588
|
name: string;
|
|
646
589
|
description: string;
|
|
647
|
-
getDescription?: ({ params, cwd }: {
|
|
648
|
-
params:
|
|
590
|
+
getDescription?: ({ params, cwd, }: {
|
|
591
|
+
params: z.output<TSchema>;
|
|
649
592
|
cwd: string;
|
|
650
593
|
}) => string;
|
|
651
594
|
displayName?: string;
|
|
652
|
-
execute: (params:
|
|
595
|
+
execute: (params: z.output<TSchema>) => Promise<ToolResult> | ToolResult;
|
|
653
596
|
approval?: ToolApprovalInfo;
|
|
654
|
-
parameters:
|
|
597
|
+
parameters: TSchema;
|
|
655
598
|
}
|
|
656
599
|
|
|
657
600
|
declare type ToolApprovalInfo = {
|
|
@@ -666,9 +609,14 @@ declare type ToolMessage = {
|
|
|
666
609
|
content: ToolContent;
|
|
667
610
|
};
|
|
668
611
|
|
|
612
|
+
declare type ToolMessage2 = {
|
|
613
|
+
role: 'tool';
|
|
614
|
+
content: ToolResultPart2[];
|
|
615
|
+
};
|
|
616
|
+
|
|
669
617
|
declare type ToolResult = {
|
|
670
618
|
llmContent: string | (TextPart | ImagePart)[];
|
|
671
|
-
returnDisplay?:
|
|
619
|
+
returnDisplay?: ReturnDisplay;
|
|
672
620
|
isError?: boolean;
|
|
673
621
|
};
|
|
674
622
|
|
|
@@ -680,6 +628,14 @@ declare type ToolResultPart = {
|
|
|
680
628
|
result: ToolResult;
|
|
681
629
|
};
|
|
682
630
|
|
|
631
|
+
declare type ToolResultPart2 = {
|
|
632
|
+
type: 'tool-result';
|
|
633
|
+
toolCallId: string;
|
|
634
|
+
toolName: string;
|
|
635
|
+
input: Record<string, any>;
|
|
636
|
+
result: ToolResult;
|
|
637
|
+
};
|
|
638
|
+
|
|
683
639
|
declare type ToolUse = {
|
|
684
640
|
name: string;
|
|
685
641
|
params: Record<string, any>;
|
|
@@ -695,8 +651,6 @@ declare type ToolUsePart = {
|
|
|
695
651
|
description?: string;
|
|
696
652
|
};
|
|
697
653
|
|
|
698
|
-
declare type UnknownContext = unknown;
|
|
699
|
-
|
|
700
654
|
declare type UpgradeOptions = {
|
|
701
655
|
registryBase: string;
|
|
702
656
|
name: string;
|