@neovate/code 0.22.4 → 0.22.5

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/index.d.ts CHANGED
@@ -6,6 +6,22 @@ import type { OpenAIProvider } from '@ai-sdk/openai';
6
6
  import * as z from 'zod';
7
7
  import { z as _zod } from 'zod';
8
8
 
9
+ declare interface AddSkillOptions {
10
+ global?: boolean;
11
+ overwrite?: boolean;
12
+ name?: string;
13
+ targetDir?: string;
14
+ }
15
+
16
+ declare interface AddSkillResult {
17
+ installed: SkillMetadata[];
18
+ skipped: {
19
+ name: string;
20
+ reason: string;
21
+ }[];
22
+ errors: SkillError[];
23
+ }
24
+
9
25
  declare interface AgentDefinition {
10
26
  agentType: string;
11
27
  whenToUse: string;
@@ -16,6 +32,7 @@ declare interface AgentDefinition {
16
32
  disallowedTools?: string[];
17
33
  forkContext?: boolean;
18
34
  color?: string;
35
+ path?: string;
19
36
  }
20
37
 
21
38
  declare interface AgentExecutionResult {
@@ -30,9 +47,15 @@ declare interface AgentExecutionResult {
30
47
  };
31
48
  }
32
49
 
50
+ declare interface AgentLoadError {
51
+ path: string;
52
+ message: string;
53
+ }
54
+
33
55
  declare class AgentManager {
34
56
  private agents;
35
57
  private context;
58
+ private errors;
36
59
  constructor(opts: {
37
60
  context: Context;
38
61
  });
@@ -47,10 +70,38 @@ declare class AgentManager {
47
70
  signal?: AbortSignal;
48
71
  forkContextMessages?: NormalizedMessage[];
49
72
  onMessage?: (message: NormalizedMessage, agentId: string) => void | Promise<void>;
73
+ onToolApprove?: (opts: {
74
+ toolUse: ToolUse;
75
+ category?: ApprovalCategory;
76
+ }) => Promise<boolean | ToolApprovalResult>;
50
77
  }): Promise<AgentExecutionResult>;
51
78
  getAgentDescriptions(): string;
79
+ loadAgentsFromFiles(): Promise<void>;
80
+ getErrors(): AgentLoadError[];
81
+ private loadAgentsFromDirectory;
82
+ private loadAgentFile;
83
+ private convertToolNames;
84
+ private parseAgentFile;
52
85
  }
53
86
 
87
+ declare type AgentResultReturnDisplay = {
88
+ type: 'agent_result';
89
+ agentId: string;
90
+ agentType: string;
91
+ description: string;
92
+ prompt: string;
93
+ content: string;
94
+ stats: {
95
+ toolCalls: number;
96
+ duration: number;
97
+ tokens: {
98
+ input: number;
99
+ output: number;
100
+ };
101
+ };
102
+ status: 'completed' | 'failed';
103
+ };
104
+
54
105
  declare enum AgentSource {
55
106
  BuiltIn = "built-in",
56
107
  Plugin = "plugin",
@@ -154,7 +205,6 @@ declare type Config = {
154
205
  outputStyle?: string;
155
206
  outputFormat?: 'text' | 'stream-json' | 'json';
156
207
  autoUpdate?: boolean;
157
- browser?: boolean;
158
208
  temperature?: number;
159
209
  httpProxy?: string;
160
210
  desktop?: DesktopConfig;
@@ -366,6 +416,33 @@ declare type GitCreateBranchOutput = {
366
416
  error?: string;
367
417
  };
368
418
 
419
+ declare type GitCreatePRInput = {
420
+ cwd: string;
421
+ branchName: string;
422
+ body?: string;
423
+ };
424
+
425
+ declare type GitCreatePROutput = {
426
+ success: boolean;
427
+ data?: {
428
+ prUrl: string;
429
+ };
430
+ error?: string;
431
+ };
432
+
433
+ declare type GitDetectGitHubInput = {
434
+ cwd: string;
435
+ };
436
+
437
+ declare type GitDetectGitHubOutput = {
438
+ success: boolean;
439
+ data?: {
440
+ hasGhCli: boolean;
441
+ isGitHubRemote: boolean;
442
+ };
443
+ error?: string;
444
+ };
445
+
369
446
  declare type GitPushInput = {
370
447
  cwd: string;
371
448
  };
@@ -450,6 +527,14 @@ declare type HandlerMap = {
450
527
  input: GitCreateBranchInput;
451
528
  output: GitCreateBranchOutput;
452
529
  };
530
+ 'git.detectGitHub': {
531
+ input: GitDetectGitHubInput;
532
+ output: GitDetectGitHubOutput;
533
+ };
534
+ 'git.createPR': {
535
+ input: GitCreatePRInput;
536
+ output: GitCreatePROutput;
537
+ };
453
538
  'mcp.getStatus': {
454
539
  input: McpGetStatusInput;
455
540
  output: McpGetStatusOutput;
@@ -998,11 +1083,6 @@ declare class Paths {
998
1083
  summary: string;
999
1084
  }[];
1000
1085
  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;
1006
1086
  }
1007
1087
 
1008
1088
  declare type Plugin_2 = {
@@ -1292,10 +1372,11 @@ declare interface Provider {
1292
1372
  api?: string;
1293
1373
  doc: string;
1294
1374
  models: Record<string, string | Omit<Model, 'id' | 'cost'>>;
1295
- createModel(name: string, provider: Provider, options: {
1375
+ createModel?: (name: string, provider: Provider, options: {
1296
1376
  globalConfigDir: string;
1297
1377
  setGlobalConfig: (key: string, value: string, isGlobal: boolean) => void;
1298
- }): Promise<LanguageModelV2> | LanguageModelV2;
1378
+ }) => Promise<LanguageModelV2> | LanguageModelV2;
1379
+ createModelType?: 'anthropic';
1299
1380
  options?: {
1300
1381
  baseURL?: string;
1301
1382
  apiKey?: string;
@@ -1368,7 +1449,7 @@ declare type ResponseMessage = BaseMessage & {
1368
1449
 
1369
1450
  export declare function resumeSession(sessionId: string, options: SDKSessionOptions): Promise<SDKSession>;
1370
1451
 
1371
- declare type ReturnDisplay = string | DiffViewerReturnDisplay | TodoReadReturnDisplay | TodoWriteReturnDisplay;
1452
+ declare type ReturnDisplay = string | DiffViewerReturnDisplay | TodoReadReturnDisplay | TodoWriteReturnDisplay | AgentResultReturnDisplay;
1372
1453
 
1373
1454
  export declare function runNeovate(opts: {
1374
1455
  productName: string;
@@ -1649,6 +1730,16 @@ declare class SkillManager {
1649
1730
  private loadSkillsFromDirectory;
1650
1731
  private loadSkillFile;
1651
1732
  private parseSkillFile;
1733
+ addSkill(source: string, options?: AddSkillOptions): Promise<AddSkillResult>;
1734
+ private normalizeSource;
1735
+ private extractFolderName;
1736
+ private scanForSkills;
1737
+ private copyDirectory;
1738
+ private parseSkillFileForAdd;
1739
+ removeSkill(name: string, targetDir?: string): Promise<{
1740
+ success: boolean;
1741
+ error?: string;
1742
+ }>;
1652
1743
  }
1653
1744
 
1654
1745
  declare interface SkillManagerOpts {
@@ -1815,6 +1906,13 @@ declare type ToolApprovalInput = {
1815
1906
  declare type ToolApprovalOutput = {
1816
1907
  approved: boolean;
1817
1908
  params?: Record<string, unknown>;
1909
+ denyReason?: string;
1910
+ };
1911
+
1912
+ declare type ToolApprovalResult = boolean | {
1913
+ approved: boolean;
1914
+ params?: ToolParams;
1915
+ denyReason?: string;
1818
1916
  };
1819
1917
 
1820
1918
  declare type ToolContent = Array<ToolResultPart>;
@@ -1829,6 +1927,8 @@ declare type ToolMessage2 = {
1829
1927
  content: ToolResultPart2[];
1830
1928
  };
1831
1929
 
1930
+ declare type ToolParams = Record<string, unknown>;
1931
+
1832
1932
  declare type ToolResult = {
1833
1933
  llmContent: string | (TextPart | ImagePart)[];
1834
1934
  returnDisplay?: ReturnDisplay;