@neovate/code 0.10.0 → 0.11.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 +2 -2
- package/dist/cli.mjs +4945 -1399
- package/dist/index.d.ts +77 -8
- package/dist/index.mjs +4945 -1399
- package/package.json +10 -13
package/dist/index.d.ts
CHANGED
|
@@ -148,6 +148,7 @@ declare type Config = {
|
|
|
148
148
|
commit?: CommitConfig;
|
|
149
149
|
outputStyle?: string;
|
|
150
150
|
outputFormat?: 'text' | 'stream-json' | 'json';
|
|
151
|
+
autoUpdate?: boolean;
|
|
151
152
|
};
|
|
152
153
|
|
|
153
154
|
export declare class _ConfigManager {
|
|
@@ -205,12 +206,34 @@ export declare function createTool<TSchema extends _zod.ZodTypeAny>(config: {
|
|
|
205
206
|
name: string;
|
|
206
207
|
description: string;
|
|
207
208
|
parameters: TSchema;
|
|
208
|
-
execute: (params: _zod.infer<TSchema>) => Promise<
|
|
209
|
+
execute: (params: _zod.infer<TSchema>) => Promise<ToolResult> | ToolResult;
|
|
209
210
|
approval?: ToolApprovalInfo;
|
|
211
|
+
getDescription?: ({ params, cwd, }: {
|
|
212
|
+
params: _zod.infer<TSchema>;
|
|
213
|
+
cwd: string;
|
|
214
|
+
}) => string;
|
|
210
215
|
}): Tool<_zod.infer<TSchema>>;
|
|
211
216
|
|
|
217
|
+
declare type DiffViewerReturnDisplay = {
|
|
218
|
+
type: 'diff_viewer';
|
|
219
|
+
originalContent: string | {
|
|
220
|
+
inputKey: string;
|
|
221
|
+
};
|
|
222
|
+
newContent: string | {
|
|
223
|
+
inputKey: string;
|
|
224
|
+
};
|
|
225
|
+
filePath: string;
|
|
226
|
+
[key: string]: any;
|
|
227
|
+
};
|
|
228
|
+
|
|
212
229
|
declare type Enforce = 'pre' | 'post';
|
|
213
230
|
|
|
231
|
+
declare type ImagePart = {
|
|
232
|
+
type: 'image';
|
|
233
|
+
data: string;
|
|
234
|
+
mimeType: string;
|
|
235
|
+
};
|
|
236
|
+
|
|
214
237
|
declare interface LocalCommand extends BaseSlashCommand {
|
|
215
238
|
type: 'local';
|
|
216
239
|
call(args: string, context: Context): Promise<string>;
|
|
@@ -218,7 +241,7 @@ declare interface LocalCommand extends BaseSlashCommand {
|
|
|
218
241
|
|
|
219
242
|
declare interface LocalJSXCommand extends BaseSlashCommand {
|
|
220
243
|
type: 'local-jsx';
|
|
221
|
-
call(onDone: (result: string) => void, context: Context): Promise<React.ReactNode>;
|
|
244
|
+
call(onDone: (result: string | null) => void, context: Context): Promise<React.ReactNode>;
|
|
222
245
|
}
|
|
223
246
|
|
|
224
247
|
declare type LoopResult = {
|
|
@@ -352,6 +375,7 @@ declare type NormalizedMessage = Message & {
|
|
|
352
375
|
timestamp: string;
|
|
353
376
|
uuid: string;
|
|
354
377
|
parentUuid: string | null;
|
|
378
|
+
uiContent?: string;
|
|
355
379
|
};
|
|
356
380
|
|
|
357
381
|
declare class OutputStyle {
|
|
@@ -408,6 +432,7 @@ declare type Plugin_2 = {
|
|
|
408
432
|
cwd: string;
|
|
409
433
|
quiet: boolean;
|
|
410
434
|
}) => Promise<void> | void;
|
|
435
|
+
destroy?: (this: PluginContext) => Promise<void> | void;
|
|
411
436
|
context?: (this: PluginContext, opts: {
|
|
412
437
|
userPrompt: string | null;
|
|
413
438
|
sessionId: string;
|
|
@@ -430,11 +455,11 @@ declare type Plugin_2 = {
|
|
|
430
455
|
toolUse?: (this: PluginContext, toolUse: ToolUse, opts: {
|
|
431
456
|
sessionId: string;
|
|
432
457
|
}) => Promise<ToolUse> | ToolUse;
|
|
433
|
-
toolResult?: (this: PluginContext, toolResult:
|
|
458
|
+
toolResult?: (this: PluginContext, toolResult: ToolResult, opts: {
|
|
434
459
|
toolUse: ToolUse;
|
|
435
460
|
approved: boolean;
|
|
436
461
|
sessionId: string;
|
|
437
|
-
}) => Promise<
|
|
462
|
+
}) => Promise<ToolResult> | ToolResult;
|
|
438
463
|
query?: (this: PluginContext, opts: {
|
|
439
464
|
usage: Usage;
|
|
440
465
|
startTime: Date;
|
|
@@ -509,6 +534,7 @@ declare interface Provider {
|
|
|
509
534
|
id: string;
|
|
510
535
|
env: string[];
|
|
511
536
|
name: string;
|
|
537
|
+
apiEnv?: string[];
|
|
512
538
|
api?: string;
|
|
513
539
|
doc: string;
|
|
514
540
|
models: Record<string, Omit<Model, 'id' | 'cost'>>;
|
|
@@ -562,10 +588,45 @@ declare type TextPart = {
|
|
|
562
588
|
text: string;
|
|
563
589
|
};
|
|
564
590
|
|
|
591
|
+
declare type TodoItem = _zod.infer<typeof TodoItemSchema>;
|
|
592
|
+
|
|
593
|
+
declare const TodoItemSchema: _zod.ZodObject<{
|
|
594
|
+
id: _zod.ZodString;
|
|
595
|
+
content: _zod.ZodString;
|
|
596
|
+
status: _zod.ZodEnum<["pending", "in_progress", "completed"]>;
|
|
597
|
+
priority: _zod.ZodEnum<["low", "medium", "high"]>;
|
|
598
|
+
}, "strip", _zod.ZodTypeAny, {
|
|
599
|
+
content: string;
|
|
600
|
+
status: "pending" | "in_progress" | "completed";
|
|
601
|
+
id: string;
|
|
602
|
+
priority: "low" | "medium" | "high";
|
|
603
|
+
}, {
|
|
604
|
+
content: string;
|
|
605
|
+
status: "pending" | "in_progress" | "completed";
|
|
606
|
+
id: string;
|
|
607
|
+
priority: "low" | "medium" | "high";
|
|
608
|
+
}>;
|
|
609
|
+
|
|
610
|
+
declare type TodoReadReturnDisplay = {
|
|
611
|
+
type: 'todo_read';
|
|
612
|
+
todos: TodoItem[];
|
|
613
|
+
};
|
|
614
|
+
|
|
615
|
+
declare type TodoWriteReturnDisplay = {
|
|
616
|
+
type: 'todo_write';
|
|
617
|
+
oldTodos: TodoItem[];
|
|
618
|
+
newTodos: TodoItem[];
|
|
619
|
+
};
|
|
620
|
+
|
|
565
621
|
declare interface Tool<T = any> {
|
|
566
622
|
name: string;
|
|
567
623
|
description: string;
|
|
568
|
-
|
|
624
|
+
getDescription?: ({ params, cwd }: {
|
|
625
|
+
params: T;
|
|
626
|
+
cwd: string;
|
|
627
|
+
}) => string;
|
|
628
|
+
displayName?: string;
|
|
629
|
+
execute: (params: T) => Promise<ToolResult> | ToolResult;
|
|
569
630
|
approval?: ToolApprovalInfo;
|
|
570
631
|
parameters: _zod.ZodSchema<T>;
|
|
571
632
|
}
|
|
@@ -582,13 +643,18 @@ declare type ToolMessage = {
|
|
|
582
643
|
content: ToolContent;
|
|
583
644
|
};
|
|
584
645
|
|
|
646
|
+
declare type ToolResult = {
|
|
647
|
+
llmContent: string | (TextPart | ImagePart)[];
|
|
648
|
+
returnDisplay?: string | DiffViewerReturnDisplay | TodoReadReturnDisplay | TodoWriteReturnDisplay;
|
|
649
|
+
isError?: boolean;
|
|
650
|
+
};
|
|
651
|
+
|
|
585
652
|
declare type ToolResultPart = {
|
|
586
653
|
type: 'tool_result';
|
|
587
654
|
id: string;
|
|
588
655
|
name: string;
|
|
589
656
|
input: Record<string, any>;
|
|
590
|
-
result:
|
|
591
|
-
isError?: boolean;
|
|
657
|
+
result: ToolResult;
|
|
592
658
|
};
|
|
593
659
|
|
|
594
660
|
declare type ToolUse = {
|
|
@@ -602,6 +668,8 @@ declare type ToolUsePart = {
|
|
|
602
668
|
id: string;
|
|
603
669
|
name: string;
|
|
604
670
|
input: Record<string, any>;
|
|
671
|
+
displayName?: string;
|
|
672
|
+
description?: string;
|
|
605
673
|
};
|
|
606
674
|
|
|
607
675
|
declare type UnknownContext = unknown;
|
|
@@ -623,13 +691,14 @@ declare class Usage {
|
|
|
623
691
|
constructor(init?: Partial<Usage>);
|
|
624
692
|
static empty(): Usage;
|
|
625
693
|
static fromEventUsage(eventUsage: any): Usage;
|
|
694
|
+
static fromAssistantMessage(message: AssistantMessage): Usage;
|
|
626
695
|
add(other: Usage): void;
|
|
627
696
|
reset(): void;
|
|
628
697
|
clone(): Usage;
|
|
629
698
|
isValid(): boolean;
|
|
630
699
|
}
|
|
631
700
|
|
|
632
|
-
declare type UserContent = string | Array<TextPart>;
|
|
701
|
+
declare type UserContent = string | Array<TextPart | ImagePart>;
|
|
633
702
|
|
|
634
703
|
declare type UserMessage = {
|
|
635
704
|
role: 'user';
|