vigthoria-cli 1.8.19 → 1.9.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/README.md +16 -10
- package/dist/commands/auth.d.ts +36 -18
- package/dist/commands/auth.js +440 -329
- package/dist/commands/chat.d.ts +12 -0
- package/dist/commands/chat.js +287 -48
- package/dist/commands/config.d.ts +2 -0
- package/dist/commands/config.js +40 -20
- package/dist/commands/index.d.ts +12 -0
- package/dist/commands/index.js +182 -0
- package/dist/commands/legion.d.ts +49 -7
- package/dist/commands/legion.js +1418 -72
- package/dist/commands/preview.js +32 -7
- package/dist/commands/repo.js +19 -13
- package/dist/commands/update.d.ts +9 -0
- package/dist/commands/update.js +235 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +472 -51
- package/dist/utils/api.d.ts +24 -9
- package/dist/utils/api.js +720 -159
- package/dist/utils/config.js +9 -10
- package/dist/utils/context-ranker.d.ts +24 -0
- package/dist/utils/context-ranker.js +147 -0
- package/dist/utils/post-write-validator.d.ts +25 -0
- package/dist/utils/post-write-validator.js +138 -0
- package/dist/utils/session.d.ts +19 -0
- package/dist/utils/session.js +91 -6
- package/dist/utils/task-display.d.ts +31 -0
- package/dist/utils/task-display.js +115 -0
- package/dist/utils/tools.d.ts +26 -0
- package/dist/utils/tools.js +563 -58
- package/dist/utils/workspace-cache.d.ts +31 -0
- package/dist/utils/workspace-cache.js +96 -0
- package/package.json +13 -3
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Vigthoria CLI — Multi-Step Terminal Task Display
|
|
4
|
+
*
|
|
5
|
+
* Renders a live, updating task progress list in the terminal using ANSI
|
|
6
|
+
* escape codes and chalk — no external UI framework required.
|
|
7
|
+
*
|
|
8
|
+
* Only activates when stderr is a real TTY; JSON mode and piped output stay clean.
|
|
9
|
+
*/
|
|
10
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.TaskDisplay = void 0;
|
|
15
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
16
|
+
const ICONS = {
|
|
17
|
+
pending: chalk_1.default.gray('○'),
|
|
18
|
+
running: chalk_1.default.cyan('⟳'),
|
|
19
|
+
done: chalk_1.default.green('✓'),
|
|
20
|
+
error: chalk_1.default.red('✗'),
|
|
21
|
+
skipped: chalk_1.default.gray('\u2013'),
|
|
22
|
+
};
|
|
23
|
+
const LABEL_FN = {
|
|
24
|
+
pending: (s) => chalk_1.default.gray(s),
|
|
25
|
+
running: (s) => chalk_1.default.cyan.bold(s),
|
|
26
|
+
done: (s) => chalk_1.default.gray(s),
|
|
27
|
+
error: (s) => chalk_1.default.red(s),
|
|
28
|
+
skipped: (s) => chalk_1.default.gray(s),
|
|
29
|
+
};
|
|
30
|
+
class TaskDisplay {
|
|
31
|
+
tasks = [];
|
|
32
|
+
linesRendered = 0;
|
|
33
|
+
enabled;
|
|
34
|
+
constructor(labels, enabled = true) {
|
|
35
|
+
this.enabled = enabled && process.stderr.isTTY === true;
|
|
36
|
+
this.tasks = labels.map((label) => ({ label, status: 'pending' }));
|
|
37
|
+
}
|
|
38
|
+
clearLines() {
|
|
39
|
+
if (this.linesRendered > 0) {
|
|
40
|
+
process.stderr.write(`\u001b[${this.linesRendered}A\u001b[0J`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
renderLines() {
|
|
44
|
+
return this.tasks.map((t) => {
|
|
45
|
+
const icon = ICONS[t.status];
|
|
46
|
+
const label = LABEL_FN[t.status](t.label);
|
|
47
|
+
const detail = t.detail ? chalk_1.default.gray(` \u2014 ${t.detail.slice(0, 60)}`) : '';
|
|
48
|
+
return ` ${icon} ${label}${detail}`;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
if (!this.enabled)
|
|
53
|
+
return;
|
|
54
|
+
this.clearLines();
|
|
55
|
+
const lines = this.renderLines();
|
|
56
|
+
process.stderr.write(lines.join('\n') + '\n');
|
|
57
|
+
this.linesRendered = lines.length;
|
|
58
|
+
}
|
|
59
|
+
start(index, detail) {
|
|
60
|
+
if (!this.enabled || index < 0 || index >= this.tasks.length)
|
|
61
|
+
return;
|
|
62
|
+
this.tasks[index].status = 'running';
|
|
63
|
+
if (detail !== undefined)
|
|
64
|
+
this.tasks[index].detail = detail;
|
|
65
|
+
this.render();
|
|
66
|
+
}
|
|
67
|
+
complete(index, detail) {
|
|
68
|
+
if (!this.enabled || index < 0 || index >= this.tasks.length)
|
|
69
|
+
return;
|
|
70
|
+
this.tasks[index].status = 'done';
|
|
71
|
+
if (detail !== undefined)
|
|
72
|
+
this.tasks[index].detail = detail;
|
|
73
|
+
this.render();
|
|
74
|
+
}
|
|
75
|
+
fail(index, detail) {
|
|
76
|
+
if (!this.enabled || index < 0 || index >= this.tasks.length)
|
|
77
|
+
return;
|
|
78
|
+
this.tasks[index].status = 'error';
|
|
79
|
+
if (detail !== undefined)
|
|
80
|
+
this.tasks[index].detail = detail;
|
|
81
|
+
this.render();
|
|
82
|
+
}
|
|
83
|
+
skip(index, detail) {
|
|
84
|
+
if (!this.enabled || index < 0 || index >= this.tasks.length)
|
|
85
|
+
return;
|
|
86
|
+
this.tasks[index].status = 'skipped';
|
|
87
|
+
if (detail !== undefined)
|
|
88
|
+
this.tasks[index].detail = detail;
|
|
89
|
+
this.render();
|
|
90
|
+
}
|
|
91
|
+
setDetail(index, detail) {
|
|
92
|
+
if (!this.enabled || index < 0 || index >= this.tasks.length)
|
|
93
|
+
return;
|
|
94
|
+
this.tasks[index].detail = detail;
|
|
95
|
+
this.render();
|
|
96
|
+
}
|
|
97
|
+
clear() {
|
|
98
|
+
if (!this.enabled)
|
|
99
|
+
return;
|
|
100
|
+
this.clearLines();
|
|
101
|
+
this.linesRendered = 0;
|
|
102
|
+
}
|
|
103
|
+
finalize() {
|
|
104
|
+
if (!this.enabled)
|
|
105
|
+
return;
|
|
106
|
+
this.clearLines();
|
|
107
|
+
const lines = this.renderLines();
|
|
108
|
+
process.stderr.write(lines.join('\n') + '\n');
|
|
109
|
+
this.linesRendered = 0;
|
|
110
|
+
}
|
|
111
|
+
get isEnabled() {
|
|
112
|
+
return this.enabled;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.TaskDisplay = TaskDisplay;
|
package/dist/utils/tools.d.ts
CHANGED
|
@@ -14,6 +14,17 @@
|
|
|
14
14
|
* @author Vigthoria Labs
|
|
15
15
|
*/
|
|
16
16
|
import { Logger } from './logger.js';
|
|
17
|
+
export type StreamChunk = {
|
|
18
|
+
type: 'text' | 'delta' | 'error';
|
|
19
|
+
content: string;
|
|
20
|
+
};
|
|
21
|
+
export type UpdateInstallerResult = {
|
|
22
|
+
success: boolean;
|
|
23
|
+
platform: string;
|
|
24
|
+
error?: string;
|
|
25
|
+
};
|
|
26
|
+
export declare function installUpdateWindows(): Promise<UpdateInstallerResult>;
|
|
27
|
+
export declare function robustifyStreamResponse(res: any): AsyncIterable<StreamChunk>;
|
|
17
28
|
export type RiskLevel = 'low' | 'medium' | 'high' | 'critical';
|
|
18
29
|
export type SearchStatus = 'search_matches_found' | 'search_no_matches' | 'search_failed';
|
|
19
30
|
export interface ToolResult {
|
|
@@ -70,11 +81,22 @@ export declare class AgenticTools {
|
|
|
70
81
|
private undoStack;
|
|
71
82
|
private maxUndoStack;
|
|
72
83
|
private retryConfig;
|
|
84
|
+
private formatExternalToolError;
|
|
85
|
+
private externalToolFailure;
|
|
86
|
+
private cleanupAfterToolError;
|
|
87
|
+
private runExternalCommand;
|
|
88
|
+
private isNonEmptyString;
|
|
89
|
+
private describeInvalidValue;
|
|
90
|
+
private assertStringRecord;
|
|
91
|
+
private requireNonEmptyString;
|
|
92
|
+
private requireArgsObject;
|
|
73
93
|
private sessionApprovedTools;
|
|
74
94
|
private static permissionsFile;
|
|
75
95
|
constructor(logger: Logger, cwd: string, permissionCallback: (action: string, options?: {
|
|
76
96
|
batchApproval?: boolean;
|
|
77
97
|
}) => Promise<boolean | 'batch' | 'persist'>, autoApprove?: boolean);
|
|
98
|
+
private getErrorMessage;
|
|
99
|
+
private assertToolCall;
|
|
78
100
|
/**
|
|
79
101
|
* Load persistent permissions for the current project
|
|
80
102
|
*/
|
|
@@ -125,6 +147,10 @@ export declare class AgenticTools {
|
|
|
125
147
|
* Check if an error is retryable
|
|
126
148
|
*/
|
|
127
149
|
private isRetryableError;
|
|
150
|
+
/**
|
|
151
|
+
* Safely stringify tool arguments without dumping very large payloads into logs.
|
|
152
|
+
*/
|
|
153
|
+
private safeStringifyArgs;
|
|
128
154
|
/**
|
|
129
155
|
* Validate tool parameters
|
|
130
156
|
*/
|