@neovate/code 0.22.7 → 0.22.9
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 +683 -590
- package/dist/index.d.ts +32 -11
- package/dist/index.mjs +696 -603
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,10 @@ declare interface AddSkillResult {
|
|
|
22
22
|
errors: SkillError[];
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
declare type AgentConfig = {
|
|
26
|
+
model?: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
25
29
|
declare interface AgentDefinition {
|
|
26
30
|
agentType: string;
|
|
27
31
|
whenToUse: string;
|
|
@@ -33,6 +37,12 @@ declare interface AgentDefinition {
|
|
|
33
37
|
forkContext?: boolean;
|
|
34
38
|
color?: string;
|
|
35
39
|
path?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Controls whether the agent is available for use.
|
|
42
|
+
* - boolean: Static toggle (default: true)
|
|
43
|
+
* - function: Dynamic check based on context
|
|
44
|
+
*/
|
|
45
|
+
isEnabled?: boolean | ((context: Context) => boolean);
|
|
36
46
|
}
|
|
37
47
|
|
|
38
48
|
declare interface AgentExecutionResult {
|
|
@@ -41,6 +51,7 @@ declare interface AgentExecutionResult {
|
|
|
41
51
|
content: string;
|
|
42
52
|
totalToolCalls: number;
|
|
43
53
|
totalDuration: number;
|
|
54
|
+
model?: string;
|
|
44
55
|
usage: {
|
|
45
56
|
inputTokens: number;
|
|
46
57
|
outputTokens: number;
|
|
@@ -61,6 +72,7 @@ declare class AgentManager {
|
|
|
61
72
|
});
|
|
62
73
|
private registerBuiltinAgents;
|
|
63
74
|
registerAgent(definition: AgentDefinition): void;
|
|
75
|
+
isAgentEnabled(agent: AgentDefinition): boolean;
|
|
64
76
|
getAgent(agentType: string): AgentDefinition | undefined;
|
|
65
77
|
getAllAgents(): AgentDefinition[];
|
|
66
78
|
getAgentTypes(): string[];
|
|
@@ -69,14 +81,15 @@ declare class AgentManager {
|
|
|
69
81
|
cwd: string;
|
|
70
82
|
signal?: AbortSignal;
|
|
71
83
|
forkContextMessages?: NormalizedMessage[];
|
|
72
|
-
onMessage?: (message: NormalizedMessage, agentId: string) => void | Promise<void>;
|
|
84
|
+
onMessage?: (message: NormalizedMessage, agentId: string, model: string) => void | Promise<void>;
|
|
73
85
|
onToolApprove?: (opts: {
|
|
74
86
|
toolUse: ToolUse;
|
|
75
87
|
category?: ApprovalCategory;
|
|
76
88
|
}) => Promise<boolean | ToolApprovalResult>;
|
|
77
89
|
}): Promise<AgentExecutionResult>;
|
|
78
90
|
getAgentDescriptions(): string;
|
|
79
|
-
|
|
91
|
+
loadAgents(): Promise<void>;
|
|
92
|
+
private loadAgentsFromPlugins;
|
|
80
93
|
getErrors(): AgentLoadError[];
|
|
81
94
|
private loadAgentsFromDirectory;
|
|
82
95
|
private loadAgentFile;
|
|
@@ -218,6 +231,11 @@ declare type Config = {
|
|
|
218
231
|
* Key is the tool name, value is boolean (false to disable).
|
|
219
232
|
*/
|
|
220
233
|
tools?: Record<string, boolean>;
|
|
234
|
+
/**
|
|
235
|
+
* Agent configuration for customizing agent behavior per agent type.
|
|
236
|
+
* Example: { explore: { model: "anthropic/claude-haiku-4" } }
|
|
237
|
+
*/
|
|
238
|
+
agent?: Record<string, AgentConfig>;
|
|
221
239
|
};
|
|
222
240
|
|
|
223
241
|
declare type ConfigGetInput = {
|
|
@@ -286,7 +304,7 @@ export declare class Context {
|
|
|
286
304
|
argvConfig: Record<string, any>;
|
|
287
305
|
mcpManager: MCPManager;
|
|
288
306
|
backgroundTaskManager: BackgroundTaskManager;
|
|
289
|
-
skillManager
|
|
307
|
+
skillManager?: SkillManager;
|
|
290
308
|
messageBus?: MessageBus;
|
|
291
309
|
agentManager?: AgentManager;
|
|
292
310
|
plugins: (string | Plugin_2)[];
|
|
@@ -317,7 +335,7 @@ declare type ContextOpts = {
|
|
|
317
335
|
argvConfig: Record<string, any>;
|
|
318
336
|
mcpManager: MCPManager;
|
|
319
337
|
backgroundTaskManager: BackgroundTaskManager;
|
|
320
|
-
skillManager
|
|
338
|
+
skillManager?: SkillManager;
|
|
321
339
|
messageBus?: MessageBus;
|
|
322
340
|
agentManager?: AgentManager;
|
|
323
341
|
plugins: (string | Plugin_2)[];
|
|
@@ -1093,6 +1111,7 @@ declare type Plugin_2 = {
|
|
|
1093
1111
|
argvConfig: Record<string, any>;
|
|
1094
1112
|
}) => Partial<Config> | Promise<Partial<Config>>;
|
|
1095
1113
|
slashCommand?: (this: PluginContext) => Promise<SlashCommand[]> | SlashCommand[];
|
|
1114
|
+
skill?: (this: PluginContext) => Promise<string[]> | string[];
|
|
1096
1115
|
outputStyle?: (this: PluginContext) => Promise<OutputStyle[]> | OutputStyle[];
|
|
1097
1116
|
provider?: (this: PluginContext, providers: ProvidersMap, opts: {
|
|
1098
1117
|
models: ModelMap;
|
|
@@ -1148,6 +1167,7 @@ declare type Plugin_2 = {
|
|
|
1148
1167
|
sessionId: string;
|
|
1149
1168
|
}) => Promise<void> | void;
|
|
1150
1169
|
status?: (this: PluginContext) => Promise<Status> | Status;
|
|
1170
|
+
agent?: (this: PluginContext) => Promise<PluginAgentDefinition[]> | PluginAgentDefinition[];
|
|
1151
1171
|
telemetry?: (this: PluginContext, opts: {
|
|
1152
1172
|
name: string;
|
|
1153
1173
|
payload: Record<string, any>;
|
|
@@ -1155,6 +1175,10 @@ declare type Plugin_2 = {
|
|
|
1155
1175
|
};
|
|
1156
1176
|
export { Plugin_2 as Plugin }
|
|
1157
1177
|
|
|
1178
|
+
declare type PluginAgentDefinition = Omit<AgentDefinition, 'source' | 'model'> & {
|
|
1179
|
+
model?: string;
|
|
1180
|
+
};
|
|
1181
|
+
|
|
1158
1182
|
declare type PluginApplyOpts = {
|
|
1159
1183
|
hook: keyof Plugin_2;
|
|
1160
1184
|
args: any[];
|
|
@@ -1449,7 +1473,7 @@ declare type ResponseMessage = BaseMessage & {
|
|
|
1449
1473
|
|
|
1450
1474
|
export declare function resumeSession(sessionId: string, options: SDKSessionOptions): Promise<SDKSession>;
|
|
1451
1475
|
|
|
1452
|
-
declare type ReturnDisplay = string | DiffViewerReturnDisplay |
|
|
1476
|
+
declare type ReturnDisplay = string | DiffViewerReturnDisplay | TodoWriteReturnDisplay | AgentResultReturnDisplay;
|
|
1453
1477
|
|
|
1454
1478
|
export declare function runNeovate(opts: {
|
|
1455
1479
|
productName: string;
|
|
@@ -1721,6 +1745,7 @@ declare class SkillManager {
|
|
|
1721
1745
|
private skillsMap;
|
|
1722
1746
|
private errors;
|
|
1723
1747
|
private paths;
|
|
1748
|
+
private context;
|
|
1724
1749
|
constructor(opts: SkillManagerOpts);
|
|
1725
1750
|
getSkills(): SkillMetadata[];
|
|
1726
1751
|
getSkill(name: string): SkillMetadata | undefined;
|
|
@@ -1743,7 +1768,7 @@ declare class SkillManager {
|
|
|
1743
1768
|
}
|
|
1744
1769
|
|
|
1745
1770
|
declare interface SkillManagerOpts {
|
|
1746
|
-
|
|
1771
|
+
context: Context;
|
|
1747
1772
|
}
|
|
1748
1773
|
|
|
1749
1774
|
declare interface SkillMetadata {
|
|
@@ -1754,6 +1779,7 @@ declare interface SkillMetadata {
|
|
|
1754
1779
|
}
|
|
1755
1780
|
|
|
1756
1781
|
declare enum SkillSource {
|
|
1782
|
+
Plugin = "plugin",
|
|
1757
1783
|
GlobalClaude = "global-claude",
|
|
1758
1784
|
Global = "global",
|
|
1759
1785
|
ProjectClaude = "project-claude",
|
|
@@ -1869,11 +1895,6 @@ declare const TodoItemSchema: _zod.ZodObject<{
|
|
|
1869
1895
|
}>;
|
|
1870
1896
|
}, _zod.core.$strip>;
|
|
1871
1897
|
|
|
1872
|
-
declare type TodoReadReturnDisplay = {
|
|
1873
|
-
type: 'todo_read';
|
|
1874
|
-
todos: TodoItem[];
|
|
1875
|
-
};
|
|
1876
|
-
|
|
1877
1898
|
declare type TodoWriteReturnDisplay = {
|
|
1878
1899
|
type: 'todo_write';
|
|
1879
1900
|
oldTodos: TodoItem[];
|