@neovate/code 0.22.2 → 0.22.4
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 +842 -704
- package/dist/index.d.ts +92 -20
- package/dist/index.mjs +844 -706
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AnthropicProvider } from '@ai-sdk/anthropic';
|
|
1
2
|
import EventEmitter from 'events';
|
|
2
3
|
import { LanguageModelV2 } from '@openrouter/ai-sdk-provider';
|
|
3
4
|
import type { OpenAICompatibleProvider } from '@ai-sdk/openai-compatible';
|
|
@@ -5,6 +6,61 @@ import type { OpenAIProvider } from '@ai-sdk/openai';
|
|
|
5
6
|
import * as z from 'zod';
|
|
6
7
|
import { z as _zod } from 'zod';
|
|
7
8
|
|
|
9
|
+
declare interface AgentDefinition {
|
|
10
|
+
agentType: string;
|
|
11
|
+
whenToUse: string;
|
|
12
|
+
systemPrompt: string;
|
|
13
|
+
model: string;
|
|
14
|
+
source: AgentSource;
|
|
15
|
+
tools?: string[];
|
|
16
|
+
disallowedTools?: string[];
|
|
17
|
+
forkContext?: boolean;
|
|
18
|
+
color?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare interface AgentExecutionResult {
|
|
22
|
+
status: 'completed' | 'failed';
|
|
23
|
+
agentId: string;
|
|
24
|
+
content: string;
|
|
25
|
+
totalToolCalls: number;
|
|
26
|
+
totalDuration: number;
|
|
27
|
+
usage: {
|
|
28
|
+
inputTokens: number;
|
|
29
|
+
outputTokens: number;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare class AgentManager {
|
|
34
|
+
private agents;
|
|
35
|
+
private context;
|
|
36
|
+
constructor(opts: {
|
|
37
|
+
context: Context;
|
|
38
|
+
});
|
|
39
|
+
private registerBuiltinAgents;
|
|
40
|
+
registerAgent(definition: AgentDefinition): void;
|
|
41
|
+
getAgent(agentType: string): AgentDefinition | undefined;
|
|
42
|
+
getAllAgents(): AgentDefinition[];
|
|
43
|
+
getAgentTypes(): string[];
|
|
44
|
+
executeTask(input: TaskToolInput, context: {
|
|
45
|
+
tools: Tool[];
|
|
46
|
+
cwd: string;
|
|
47
|
+
signal?: AbortSignal;
|
|
48
|
+
forkContextMessages?: NormalizedMessage[];
|
|
49
|
+
onMessage?: (message: NormalizedMessage, agentId: string) => void | Promise<void>;
|
|
50
|
+
}): Promise<AgentExecutionResult>;
|
|
51
|
+
getAgentDescriptions(): string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare enum AgentSource {
|
|
55
|
+
BuiltIn = "built-in",
|
|
56
|
+
Plugin = "plugin",
|
|
57
|
+
User = "user",
|
|
58
|
+
ProjectClaude = "project-claude",
|
|
59
|
+
Project = "project",
|
|
60
|
+
GlobalClaude = "global-claude",
|
|
61
|
+
Global = "global"
|
|
62
|
+
}
|
|
63
|
+
|
|
8
64
|
/** Supported application types for open and detect operations */
|
|
9
65
|
declare type App = 'cursor' | 'vscode' | 'vscode-insiders' | 'zed' | 'windsurf' | 'iterm' | 'warp' | 'terminal' | 'antigravity' | 'finder' | 'sourcetree' | 'fork';
|
|
10
66
|
|
|
@@ -182,6 +238,7 @@ export declare class Context {
|
|
|
182
238
|
backgroundTaskManager: BackgroundTaskManager;
|
|
183
239
|
skillManager: SkillManager;
|
|
184
240
|
messageBus?: MessageBus;
|
|
241
|
+
agentManager?: AgentManager;
|
|
185
242
|
plugins: (string | Plugin_2)[];
|
|
186
243
|
constructor(opts: ContextOpts);
|
|
187
244
|
apply(applyOpts: Omit<PluginApplyOpts, 'pluginContext'>): Promise<any>;
|
|
@@ -212,6 +269,7 @@ declare type ContextOpts = {
|
|
|
212
269
|
backgroundTaskManager: BackgroundTaskManager;
|
|
213
270
|
skillManager: SkillManager;
|
|
214
271
|
messageBus?: MessageBus;
|
|
272
|
+
agentManager?: AgentManager;
|
|
215
273
|
plugins: (string | Plugin_2)[];
|
|
216
274
|
};
|
|
217
275
|
|
|
@@ -228,7 +286,7 @@ export declare function createTool<TSchema extends z.ZodTypeAny>(config: {
|
|
|
228
286
|
displayName?: string;
|
|
229
287
|
description: string;
|
|
230
288
|
parameters: TSchema;
|
|
231
|
-
execute: (params: z.output<TSchema
|
|
289
|
+
execute: (params: z.output<TSchema>, toolCallId?: string) => Promise<ToolResult> | ToolResult;
|
|
232
290
|
approval?: ToolApprovalInfo;
|
|
233
291
|
getDescription?: ({ params, cwd, }: {
|
|
234
292
|
params: z.output<TSchema>;
|
|
@@ -333,6 +391,10 @@ declare type GitStatusOutput = {
|
|
|
333
391
|
email: boolean;
|
|
334
392
|
};
|
|
335
393
|
isMerging: boolean;
|
|
394
|
+
unstagedFiles: Array<{
|
|
395
|
+
status: string;
|
|
396
|
+
file: string;
|
|
397
|
+
}>;
|
|
336
398
|
};
|
|
337
399
|
error?: string;
|
|
338
400
|
};
|
|
@@ -880,6 +942,11 @@ declare type NormalizedMessage = Message_2 & {
|
|
|
880
942
|
uuid: string;
|
|
881
943
|
parentUuid: string | null;
|
|
882
944
|
uiContent?: string;
|
|
945
|
+
metadata?: {
|
|
946
|
+
agentId?: string;
|
|
947
|
+
agentType?: string;
|
|
948
|
+
[key: string]: any;
|
|
949
|
+
};
|
|
883
950
|
};
|
|
884
951
|
|
|
885
952
|
declare class OutputStyle {
|
|
@@ -931,6 +998,11 @@ declare class Paths {
|
|
|
931
998
|
summary: string;
|
|
932
999
|
}[];
|
|
933
1000
|
getGlobalDataPath(): string;
|
|
1001
|
+
/**
|
|
1002
|
+
* Get the dedicated log path for a sub-agent.
|
|
1003
|
+
* Format: ~/.neovate/projects/{project}/agent-{agentId}.jsonl
|
|
1004
|
+
*/
|
|
1005
|
+
getAgentLogPath(agentId: string): string;
|
|
934
1006
|
}
|
|
935
1007
|
|
|
936
1008
|
declare type Plugin_2 = {
|
|
@@ -947,6 +1019,7 @@ declare type Plugin_2 = {
|
|
|
947
1019
|
defaultModelCreator: (name: string, provider: Provider) => LanguageModelV2;
|
|
948
1020
|
createOpenAI: (options: any) => OpenAIProvider;
|
|
949
1021
|
createOpenAICompatible: (options: any) => OpenAICompatibleProvider;
|
|
1022
|
+
createAnthropic: (options: any) => AnthropicProvider;
|
|
950
1023
|
}) => Promise<ProvidersMap> | ProvidersMap;
|
|
951
1024
|
modelAlias?: (this: PluginContext, modelAlias: ModelAlias) => Promise<ModelAlias> | ModelAlias;
|
|
952
1025
|
initialized?: (this: PluginContext, opts: {
|
|
@@ -999,24 +1072,6 @@ declare type Plugin_2 = {
|
|
|
999
1072
|
name: string;
|
|
1000
1073
|
payload: Record<string, any>;
|
|
1001
1074
|
}) => Promise<void> | void;
|
|
1002
|
-
_serverAppData?: (this: PluginContext, opts: {
|
|
1003
|
-
context: any;
|
|
1004
|
-
cwd: string;
|
|
1005
|
-
}) => Promise<any> | any;
|
|
1006
|
-
_serverRoutes?: (this: PluginContext, opts: {
|
|
1007
|
-
app: any;
|
|
1008
|
-
prefix: string;
|
|
1009
|
-
opts: any;
|
|
1010
|
-
}) => Promise<any> | any;
|
|
1011
|
-
_serverRouteCompletions?: (this: PluginContext, opts: {
|
|
1012
|
-
message: {
|
|
1013
|
-
role: 'user';
|
|
1014
|
-
content: string;
|
|
1015
|
-
attachedContexts: any[];
|
|
1016
|
-
contextContent: string;
|
|
1017
|
-
};
|
|
1018
|
-
attachedContexts: any[];
|
|
1019
|
-
}) => Promise<any> | any;
|
|
1020
1075
|
};
|
|
1021
1076
|
export { Plugin_2 as Plugin }
|
|
1022
1077
|
|
|
@@ -1683,6 +1738,14 @@ declare type SystemMessage = {
|
|
|
1683
1738
|
content: string;
|
|
1684
1739
|
};
|
|
1685
1740
|
|
|
1741
|
+
declare interface TaskToolInput {
|
|
1742
|
+
description: string;
|
|
1743
|
+
prompt: string;
|
|
1744
|
+
subagent_type: string;
|
|
1745
|
+
model?: string;
|
|
1746
|
+
resume?: string;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1686
1749
|
declare type TempPluginContext = ContextCreateOpts & {
|
|
1687
1750
|
pluginManager: PluginManager;
|
|
1688
1751
|
config: Config;
|
|
@@ -1734,7 +1797,7 @@ declare interface Tool<TSchema extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
|
1734
1797
|
cwd: string;
|
|
1735
1798
|
}) => string;
|
|
1736
1799
|
displayName?: string;
|
|
1737
|
-
execute: (params: z.output<TSchema
|
|
1800
|
+
execute: (params: z.output<TSchema>, toolCallId?: string) => Promise<ToolResult> | ToolResult;
|
|
1738
1801
|
approval?: ToolApprovalInfo;
|
|
1739
1802
|
parameters: TSchema;
|
|
1740
1803
|
}
|
|
@@ -1770,6 +1833,11 @@ declare type ToolResult = {
|
|
|
1770
1833
|
llmContent: string | (TextPart | ImagePart)[];
|
|
1771
1834
|
returnDisplay?: ReturnDisplay;
|
|
1772
1835
|
isError?: boolean;
|
|
1836
|
+
metadata?: {
|
|
1837
|
+
agentId?: string;
|
|
1838
|
+
agentType?: string;
|
|
1839
|
+
[key: string]: any;
|
|
1840
|
+
};
|
|
1773
1841
|
};
|
|
1774
1842
|
|
|
1775
1843
|
declare type ToolResultPart = {
|
|
@@ -1778,6 +1846,8 @@ declare type ToolResultPart = {
|
|
|
1778
1846
|
name: string;
|
|
1779
1847
|
input: Record<string, any>;
|
|
1780
1848
|
result: ToolResult;
|
|
1849
|
+
agentId?: string;
|
|
1850
|
+
agentType?: string;
|
|
1781
1851
|
};
|
|
1782
1852
|
|
|
1783
1853
|
declare type ToolResultPart2 = {
|
|
@@ -1786,6 +1856,8 @@ declare type ToolResultPart2 = {
|
|
|
1786
1856
|
toolName: string;
|
|
1787
1857
|
input: Record<string, any>;
|
|
1788
1858
|
result: ToolResult;
|
|
1859
|
+
agentId?: string;
|
|
1860
|
+
agentType?: string;
|
|
1789
1861
|
};
|
|
1790
1862
|
|
|
1791
1863
|
declare type ToolUse = {
|