vigthoria-cli 1.9.10 → 1.9.19
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 +4 -4
- package/dist/commands/auth.js +48 -65
- package/dist/commands/bridge.js +12 -19
- package/dist/commands/cancel.js +15 -22
- package/dist/commands/chat.d.ts +11 -0
- package/dist/commands/chat.js +404 -248
- package/dist/commands/config.js +31 -71
- package/dist/commands/deploy.js +83 -123
- package/dist/commands/device.d.ts +35 -0
- package/dist/commands/device.js +239 -0
- package/dist/commands/edit.js +32 -39
- package/dist/commands/explain.js +18 -25
- package/dist/commands/fork.js +22 -27
- package/dist/commands/generate.js +37 -44
- package/dist/commands/history.js +20 -25
- package/dist/commands/hub.js +95 -102
- package/dist/commands/index.js +41 -46
- package/dist/commands/legion.d.ts +1 -0
- package/dist/commands/legion.js +162 -209
- package/dist/commands/preview.js +60 -98
- package/dist/commands/replay.js +27 -32
- package/dist/commands/repo.js +103 -141
- package/dist/commands/review.js +29 -36
- package/dist/commands/security.js +5 -12
- package/dist/commands/update.js +15 -49
- package/dist/commands/workflow.d.ts +8 -1
- package/dist/commands/workflow.js +53 -19
- package/dist/index.js +409 -234
- package/dist/utils/api.d.ts +5 -0
- package/dist/utils/api.js +373 -166
- package/dist/utils/bridge-client.js +11 -52
- package/dist/utils/cli-state.d.ts +54 -0
- package/dist/utils/cli-state.js +185 -0
- package/dist/utils/config.d.ts +5 -0
- package/dist/utils/config.js +35 -14
- package/dist/utils/context-ranker.js +15 -21
- package/dist/utils/files.js +5 -42
- package/dist/utils/logger.js +42 -50
- package/dist/utils/post-write-validator.js +22 -29
- package/dist/utils/project-memory.d.ts +56 -0
- package/dist/utils/project-memory.js +289 -0
- package/dist/utils/session.d.ts +29 -3
- package/dist/utils/session.js +137 -85
- package/dist/utils/task-display.js +13 -20
- package/dist/utils/tools.d.ts +19 -0
- package/dist/utils/tools.js +84 -87
- package/dist/utils/workspace-cache.js +18 -26
- package/dist/utils/workspace-stream.js +26 -64
- package/install.ps1 +14 -0
- package/package.json +5 -3
- package/scripts/release/LOCAL_MACHINE_USER_VERIFICATION.md +1 -1
- package/scripts/release/validate-no-go-gates.sh +2 -2
package/README.md
CHANGED
|
@@ -430,10 +430,10 @@ vigthoria repo clone 123
|
|
|
430
430
|
|
|
431
431
|
| Short Name | Full Model ID | Size | Best For |
|
|
432
432
|
|------------|---------------|------|----------|
|
|
433
|
-
| `balanced` | `vigthoria-balanced-4b` | 4B | All-purpose tasks |
|
|
433
|
+
| `balanced` / `balanced-4b` | `vigthoria-v3-balanced-4b` | 4B | All-purpose tasks |
|
|
434
434
|
| `code` / `code-v2` | `vigthoria-v2-code-8b` | 8B | Code generation & editing |
|
|
435
|
-
| `code-
|
|
436
|
-
| `code
|
|
435
|
+
| `code-9b` | `vigthoria-v3-code-9b` | 9B | Fast coding specialist |
|
|
436
|
+
| `code` / `code-35b` | `vigthoria-v3-code-35b` | 35B | Large-scale code projects |
|
|
437
437
|
| `music` | `vigthoria-music-master-4b` | 4B | Music AI generation |
|
|
438
438
|
|
|
439
439
|
### External Models (Ollama Fallback)
|
|
@@ -453,7 +453,7 @@ vigthoria repo clone 123
|
|
|
453
453
|
vigthoria chat -m code-v2
|
|
454
454
|
|
|
455
455
|
# Use full model ID directly
|
|
456
|
-
vigthoria chat -m vigthoria-v3-code-
|
|
456
|
+
vigthoria chat -m vigthoria-v3-code-35b
|
|
457
457
|
|
|
458
458
|
# Force specific version
|
|
459
459
|
vigthoria chat -m vigthoria-v2-code-8b
|
package/dist/commands/auth.js
CHANGED
|
@@ -1,29 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.saveAuthConfig = saveAuthConfig;
|
|
8
|
-
exports.clearAuthConfig = clearAuthConfig;
|
|
9
|
-
exports.getAuthToken = getAuthToken;
|
|
10
|
-
exports.login = login;
|
|
11
|
-
exports.logout = logout;
|
|
12
|
-
exports.whoami = whoami;
|
|
13
|
-
exports.doctor = doctor;
|
|
14
|
-
exports.handleLogin = handleLogin;
|
|
15
|
-
exports.handleLogout = handleLogout;
|
|
16
|
-
exports.statusAction = statusAction;
|
|
17
|
-
exports.registerAuthCommands = registerAuthCommands;
|
|
18
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
19
|
-
const fs_1 = require("fs");
|
|
20
|
-
const os_1 = require("os");
|
|
21
|
-
const path_1 = __importDefault(require("path"));
|
|
22
|
-
const readline_1 = __importDefault(require("readline"));
|
|
23
|
-
const config_js_1 = require("../utils/config.js");
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'fs';
|
|
3
|
+
import { homedir } from 'os';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import readline from 'readline';
|
|
6
|
+
import { Config } from '../utils/config.js';
|
|
24
7
|
const DEFAULT_API_URL = 'https://coder.vigthoria.io';
|
|
25
|
-
const CONFIG_DIR =
|
|
26
|
-
const CONFIG_FILE =
|
|
8
|
+
const CONFIG_DIR = path.join(homedir(), '.vigthoria');
|
|
9
|
+
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
27
10
|
const KNOWN_AUTH_BASE_URLS = ['https://coder.vigthoria.io', 'https://api.vigthoria.io'];
|
|
28
11
|
class HttpError extends Error {
|
|
29
12
|
status;
|
|
@@ -56,11 +39,11 @@ function getAuthBaseCandidates(seedBaseUrl) {
|
|
|
56
39
|
return uniqueStrings([seed, ...(peer ? [peer] : []), ...KNOWN_AUTH_BASE_URLS]).map(trimTrailingSlash);
|
|
57
40
|
}
|
|
58
41
|
function ensureConfigDir() {
|
|
59
|
-
if (!
|
|
60
|
-
|
|
42
|
+
if (!existsSync(CONFIG_DIR)) {
|
|
43
|
+
mkdirSync(CONFIG_DIR, { recursive: true, mode: 0o700 });
|
|
61
44
|
}
|
|
62
45
|
try {
|
|
63
|
-
|
|
46
|
+
chmodSync(CONFIG_DIR, 0o700);
|
|
64
47
|
}
|
|
65
48
|
catch {
|
|
66
49
|
// Best-effort on non-POSIX filesystems.
|
|
@@ -68,7 +51,7 @@ function ensureConfigDir() {
|
|
|
68
51
|
}
|
|
69
52
|
function syncSharedConfig(config) {
|
|
70
53
|
try {
|
|
71
|
-
const shared = new
|
|
54
|
+
const shared = new Config();
|
|
72
55
|
shared.set('apiUrl', trimTrailingSlash(config.apiUrl || getApiUrl()));
|
|
73
56
|
if (config.token) {
|
|
74
57
|
shared.set('authToken', config.token);
|
|
@@ -86,7 +69,7 @@ function syncSharedConfig(config) {
|
|
|
86
69
|
}
|
|
87
70
|
function clearSharedConfigAuth() {
|
|
88
71
|
try {
|
|
89
|
-
const shared = new
|
|
72
|
+
const shared = new Config();
|
|
90
73
|
shared.set('authToken', null);
|
|
91
74
|
shared.set('refreshToken', null);
|
|
92
75
|
shared.set('userId', null);
|
|
@@ -133,12 +116,12 @@ function extractAuthUser(payload, fallbackEmail) {
|
|
|
133
116
|
}
|
|
134
117
|
return fallbackEmail ? { email: fallbackEmail } : undefined;
|
|
135
118
|
}
|
|
136
|
-
function loadAuthConfig() {
|
|
137
|
-
if (!
|
|
119
|
+
export function loadAuthConfig() {
|
|
120
|
+
if (!existsSync(CONFIG_FILE)) {
|
|
138
121
|
return { apiUrl: getApiUrl() };
|
|
139
122
|
}
|
|
140
123
|
try {
|
|
141
|
-
const parsed = JSON.parse(
|
|
124
|
+
const parsed = JSON.parse(readFileSync(CONFIG_FILE, 'utf8'));
|
|
142
125
|
return {
|
|
143
126
|
apiUrl: trimTrailingSlash(parsed.apiUrl || getApiUrl()),
|
|
144
127
|
token: parsed.token || parsed.authToken,
|
|
@@ -146,28 +129,28 @@ function loadAuthConfig() {
|
|
|
146
129
|
};
|
|
147
130
|
}
|
|
148
131
|
catch (error) {
|
|
149
|
-
console.warn(
|
|
132
|
+
console.warn(chalk.yellow(`Warning: could not read auth config: ${humanMessage(error)}`));
|
|
150
133
|
return { apiUrl: getApiUrl() };
|
|
151
134
|
}
|
|
152
135
|
}
|
|
153
|
-
function saveAuthConfig(config) {
|
|
136
|
+
export function saveAuthConfig(config) {
|
|
154
137
|
ensureConfigDir();
|
|
155
|
-
|
|
138
|
+
writeFileSync(CONFIG_FILE, `${JSON.stringify(config, null, 2)}\n`, 'utf8');
|
|
156
139
|
try {
|
|
157
|
-
|
|
140
|
+
chmodSync(CONFIG_FILE, 0o600);
|
|
158
141
|
}
|
|
159
142
|
catch {
|
|
160
143
|
// Best-effort on non-POSIX filesystems.
|
|
161
144
|
}
|
|
162
145
|
syncSharedConfig(config);
|
|
163
146
|
}
|
|
164
|
-
function clearAuthConfig() {
|
|
165
|
-
if (
|
|
166
|
-
|
|
147
|
+
export function clearAuthConfig() {
|
|
148
|
+
if (existsSync(CONFIG_FILE)) {
|
|
149
|
+
rmSync(CONFIG_FILE, { force: true });
|
|
167
150
|
}
|
|
168
151
|
clearSharedConfigAuth();
|
|
169
152
|
}
|
|
170
|
-
function getAuthToken() {
|
|
153
|
+
export function getAuthToken() {
|
|
171
154
|
return process.env.VIGTHORIA_TOKEN || loadAuthConfig().token;
|
|
172
155
|
}
|
|
173
156
|
async function requestJson(url, init) {
|
|
@@ -221,7 +204,7 @@ async function requestJson(url, init) {
|
|
|
221
204
|
return body;
|
|
222
205
|
}
|
|
223
206
|
async function ask(question, hidden = false) {
|
|
224
|
-
const rl =
|
|
207
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
225
208
|
if (!hidden) {
|
|
226
209
|
try {
|
|
227
210
|
return await new Promise((resolve) => rl.question(question, resolve));
|
|
@@ -258,7 +241,7 @@ function markSuccessExit() {
|
|
|
258
241
|
function markErrorExit() {
|
|
259
242
|
process.exitCode = 1;
|
|
260
243
|
}
|
|
261
|
-
async function login(email, password) {
|
|
244
|
+
export async function login(email, password) {
|
|
262
245
|
try {
|
|
263
246
|
const resolvedEmail = (email || '').trim();
|
|
264
247
|
const resolvedPassword = password || '';
|
|
@@ -316,7 +299,7 @@ async function login(email, password) {
|
|
|
316
299
|
throw new Error(message);
|
|
317
300
|
}
|
|
318
301
|
}
|
|
319
|
-
async function logout() {
|
|
302
|
+
export async function logout() {
|
|
320
303
|
const config = loadAuthConfig();
|
|
321
304
|
if (config.token) {
|
|
322
305
|
const bases = getAuthBaseCandidates(config.apiUrl || getApiUrl());
|
|
@@ -341,13 +324,13 @@ async function logout() {
|
|
|
341
324
|
}
|
|
342
325
|
}
|
|
343
326
|
if (!remoteLogoutDone) {
|
|
344
|
-
console.warn(
|
|
327
|
+
console.warn(chalk.yellow('Remote logout endpoint not reachable; local credentials were still cleared.'));
|
|
345
328
|
}
|
|
346
329
|
}
|
|
347
330
|
clearAuthConfig();
|
|
348
331
|
process.exitCode = 0;
|
|
349
332
|
}
|
|
350
|
-
async function whoami() {
|
|
333
|
+
export async function whoami() {
|
|
351
334
|
const config = loadAuthConfig();
|
|
352
335
|
if (!config.token) {
|
|
353
336
|
return undefined;
|
|
@@ -395,7 +378,7 @@ async function whoami() {
|
|
|
395
378
|
}
|
|
396
379
|
throw new Error(`Unable to verify account on known auth endpoints. Tried ${attempted.join(', ')}`);
|
|
397
380
|
}
|
|
398
|
-
async function doctor() {
|
|
381
|
+
export async function doctor() {
|
|
399
382
|
const config = loadAuthConfig();
|
|
400
383
|
const report = {
|
|
401
384
|
nodeVersion: process.version,
|
|
@@ -408,7 +391,7 @@ async function doctor() {
|
|
|
408
391
|
process.exitCode = 0;
|
|
409
392
|
return report;
|
|
410
393
|
}
|
|
411
|
-
async function handleLogin(options = {}) {
|
|
394
|
+
export async function handleLogin(options = {}) {
|
|
412
395
|
try {
|
|
413
396
|
if (options.token) {
|
|
414
397
|
const config = {
|
|
@@ -417,14 +400,14 @@ async function handleLogin(options = {}) {
|
|
|
417
400
|
success: true,
|
|
418
401
|
};
|
|
419
402
|
saveAuthConfig(config);
|
|
420
|
-
console.log(
|
|
403
|
+
console.log(chalk.green('Logged in successfully with API token.'));
|
|
421
404
|
process.exitCode = 0;
|
|
422
405
|
return config;
|
|
423
406
|
}
|
|
424
407
|
let email = options.email?.trim();
|
|
425
408
|
let password = options.password;
|
|
426
409
|
if (options.device) {
|
|
427
|
-
console.log(
|
|
410
|
+
console.log(chalk.yellow('Device-code login is not enabled by this Vigthoria service. Falling back to email and password authentication.'));
|
|
428
411
|
}
|
|
429
412
|
if (!email) {
|
|
430
413
|
email = (await ask('Email: ')).trim();
|
|
@@ -436,7 +419,7 @@ async function handleLogin(options = {}) {
|
|
|
436
419
|
throw new Error('Email and password are required. Use --email and --password, or run vigthoria login interactively.');
|
|
437
420
|
}
|
|
438
421
|
const config = await login(email, password);
|
|
439
|
-
console.log(
|
|
422
|
+
console.log(chalk.green('Logged in successfully.'));
|
|
440
423
|
if (config.user?.email) {
|
|
441
424
|
console.log(`Account: ${config.user.email}`);
|
|
442
425
|
}
|
|
@@ -445,27 +428,27 @@ async function handleLogin(options = {}) {
|
|
|
445
428
|
return config;
|
|
446
429
|
}
|
|
447
430
|
catch (error) {
|
|
448
|
-
console.error(
|
|
431
|
+
console.error(chalk.red(`Login failed: ${humanMessage(error)}`));
|
|
449
432
|
process.exitCode = 1;
|
|
450
433
|
return undefined;
|
|
451
434
|
}
|
|
452
435
|
}
|
|
453
|
-
async function handleLogout(_options) {
|
|
436
|
+
export async function handleLogout(_options) {
|
|
454
437
|
try {
|
|
455
438
|
await logout();
|
|
456
|
-
console.log(
|
|
439
|
+
console.log(chalk.green('Logged out successfully.'));
|
|
457
440
|
process.exitCode = 0;
|
|
458
441
|
}
|
|
459
442
|
catch (error) {
|
|
460
|
-
console.error(
|
|
443
|
+
console.error(chalk.red(`Logout failed: ${humanMessage(error)}`));
|
|
461
444
|
process.exitCode = 1;
|
|
462
445
|
}
|
|
463
446
|
}
|
|
464
|
-
async function statusAction() {
|
|
447
|
+
export async function statusAction() {
|
|
465
448
|
try {
|
|
466
449
|
const config = loadAuthConfig();
|
|
467
450
|
if (!config.token) {
|
|
468
|
-
console.log(
|
|
451
|
+
console.log(chalk.yellow('Not logged in.'));
|
|
469
452
|
process.exitCode = 0;
|
|
470
453
|
return;
|
|
471
454
|
}
|
|
@@ -476,7 +459,7 @@ async function statusAction() {
|
|
|
476
459
|
catch {
|
|
477
460
|
// Keep local status available even if remote whoami endpoint is down.
|
|
478
461
|
}
|
|
479
|
-
const sharedConfig = new
|
|
462
|
+
const sharedConfig = new Config();
|
|
480
463
|
let overallStatus = 'Unknown';
|
|
481
464
|
let coderStatus = 'Unknown';
|
|
482
465
|
let modelsStatus = 'Unknown';
|
|
@@ -497,8 +480,8 @@ async function statusAction() {
|
|
|
497
480
|
// Status should still render even if health probes fail.
|
|
498
481
|
}
|
|
499
482
|
const plan = String(sharedConfig.get('subscription')?.plan || '').trim();
|
|
500
|
-
console.log(
|
|
501
|
-
console.log(
|
|
483
|
+
console.log(chalk.white('Account Status'));
|
|
484
|
+
console.log(chalk.green('Logged in.'));
|
|
502
485
|
if (user?.email) {
|
|
503
486
|
console.log(`Account: ${user.email}`);
|
|
504
487
|
}
|
|
@@ -512,11 +495,11 @@ async function statusAction() {
|
|
|
512
495
|
process.exitCode = 0;
|
|
513
496
|
}
|
|
514
497
|
catch (error) {
|
|
515
|
-
console.error(
|
|
498
|
+
console.error(chalk.red(`Unable to read status: ${humanMessage(error)}`));
|
|
516
499
|
process.exitCode = 1;
|
|
517
500
|
}
|
|
518
501
|
}
|
|
519
|
-
function registerAuthCommands(program) {
|
|
502
|
+
export function registerAuthCommands(program) {
|
|
520
503
|
const auth = program.command('auth').description('Manage Vigthoria CLI authentication');
|
|
521
504
|
auth
|
|
522
505
|
.command('login')
|
|
@@ -541,16 +524,16 @@ function registerAuthCommands(program) {
|
|
|
541
524
|
try {
|
|
542
525
|
const user = await whoami();
|
|
543
526
|
if (!user) {
|
|
544
|
-
console.log(
|
|
527
|
+
console.log(chalk.yellow('Not logged in.'));
|
|
545
528
|
process.exitCode = 0;
|
|
546
529
|
return;
|
|
547
530
|
}
|
|
548
|
-
console.log(
|
|
531
|
+
console.log(chalk.green('Logged in.'));
|
|
549
532
|
console.log(user.email || user.name || user.id || 'Authenticated user');
|
|
550
533
|
process.exitCode = 0;
|
|
551
534
|
}
|
|
552
535
|
catch (error) {
|
|
553
|
-
console.error(
|
|
536
|
+
console.error(chalk.red(`Unable to fetch account: ${humanMessage(error)}`));
|
|
554
537
|
process.exitCode = 1;
|
|
555
538
|
}
|
|
556
539
|
});
|
package/dist/commands/bridge.js
CHANGED
|
@@ -1,34 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BridgeCommand = void 0;
|
|
7
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
-
const logger_js_1 = require("../utils/logger.js");
|
|
9
|
-
const api_js_1 = require("../utils/api.js");
|
|
10
|
-
class BridgeCommand {
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { createSpinner } from '../utils/logger.js';
|
|
3
|
+
import { APIClient } from '../utils/api.js';
|
|
4
|
+
export class BridgeCommand {
|
|
11
5
|
api;
|
|
12
6
|
constructor(config, logger) {
|
|
13
|
-
this.api = new
|
|
7
|
+
this.api = new APIClient(config, logger);
|
|
14
8
|
}
|
|
15
9
|
async status() {
|
|
16
|
-
const spinner =
|
|
10
|
+
const spinner = createSpinner('Checking DevTools Bridge...').start();
|
|
17
11
|
const bridge = await this.api.getDevtoolsBridgeStatus();
|
|
18
12
|
spinner.stop();
|
|
19
13
|
console.log();
|
|
20
|
-
console.log(
|
|
21
|
-
console.log(
|
|
14
|
+
console.log(chalk.white('DevTools Bridge:'));
|
|
15
|
+
console.log(chalk.gray(' Status: ') + (bridge.ok ? chalk.green('Reachable') : chalk.yellow('Not running')));
|
|
22
16
|
if (!bridge.ok) {
|
|
23
17
|
const detail = String(bridge.error || 'Connection refused').trim() || 'Connection refused';
|
|
24
|
-
console.log(
|
|
18
|
+
console.log(chalk.gray(' Error: ') + chalk.yellow(detail));
|
|
25
19
|
}
|
|
26
|
-
console.log(
|
|
27
|
-
?
|
|
28
|
-
:
|
|
20
|
+
console.log(chalk.gray(' Browser tasks: ') + (bridge.ok
|
|
21
|
+
? chalk.green('Local browser observability is available for debugging flows.')
|
|
22
|
+
: chalk.gray('Start the DevTools Bridge to enable local browser observability.')));
|
|
29
23
|
console.log();
|
|
30
24
|
this.api.destroy();
|
|
31
25
|
process.exitCode = 0;
|
|
32
26
|
}
|
|
33
27
|
}
|
|
34
|
-
exports.BridgeCommand = BridgeCommand;
|
package/dist/commands/cancel.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CancelCommand = void 0;
|
|
7
|
-
const api_js_1 = require("../utils/api.js");
|
|
1
|
+
import { isServerRuntime } from '../utils/api.js';
|
|
8
2
|
/**
|
|
9
3
|
* cancel.ts — Cancel an in-flight V3 agent run, or cancel all active runs.
|
|
10
4
|
*
|
|
@@ -13,9 +7,9 @@ const api_js_1 = require("../utils/api.js");
|
|
|
13
7
|
* vig cancel --all Cancel every currently-active run
|
|
14
8
|
* vig cancel --list Just list active runs (no cancellation)
|
|
15
9
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class CancelCommand {
|
|
10
|
+
import chalk from 'chalk';
|
|
11
|
+
import { createSpinner, CH } from '../utils/logger.js';
|
|
12
|
+
export class CancelCommand {
|
|
19
13
|
config;
|
|
20
14
|
logger;
|
|
21
15
|
constructor(config, logger) {
|
|
@@ -38,7 +32,7 @@ class CancelCommand {
|
|
|
38
32
|
}
|
|
39
33
|
getBaseUrl() {
|
|
40
34
|
const configuredApiUrl = String(this.config.get('apiUrl') || 'https://coder.vigthoria.io').replace(/\/$/, '');
|
|
41
|
-
const allowLocal =
|
|
35
|
+
const allowLocal = isServerRuntime() && process.env.VIGTHORIA_ALLOW_LOCAL_V3_AGENT === '1';
|
|
42
36
|
return (process.env.VIGTHORIA_V3_AGENT_URL ||
|
|
43
37
|
process.env.V3_AGENT_URL ||
|
|
44
38
|
(allowLocal ? 'http://127.0.0.1:8030' : null) ||
|
|
@@ -80,7 +74,7 @@ class CancelCommand {
|
|
|
80
74
|
async run(contextId, options) {
|
|
81
75
|
const baseUrl = this.getBaseUrl();
|
|
82
76
|
if (options.list) {
|
|
83
|
-
const spinner =
|
|
77
|
+
const spinner = createSpinner('Loading active runs...').start();
|
|
84
78
|
const active = await this.listActive(baseUrl);
|
|
85
79
|
spinner.stop();
|
|
86
80
|
if (!active)
|
|
@@ -90,34 +84,34 @@ class CancelCommand {
|
|
|
90
84
|
return;
|
|
91
85
|
}
|
|
92
86
|
if (active.active_count === 0) {
|
|
93
|
-
this.logger.info(
|
|
87
|
+
this.logger.info(chalk.dim('No active runs.'));
|
|
94
88
|
return;
|
|
95
89
|
}
|
|
96
|
-
console.log(
|
|
90
|
+
console.log(chalk.bold(`\n${CH.success} Active Runs (${active.active_count}/${active.max_concurrent_runs})\n`));
|
|
97
91
|
for (const cid of active.active_context_ids) {
|
|
98
|
-
console.log(` ${
|
|
92
|
+
console.log(` ${chalk.cyan(cid)}`);
|
|
99
93
|
}
|
|
100
94
|
console.log();
|
|
101
95
|
return;
|
|
102
96
|
}
|
|
103
97
|
if (options.all) {
|
|
104
|
-
const spinner =
|
|
98
|
+
const spinner = createSpinner('Loading active runs...').start();
|
|
105
99
|
const active = await this.listActive(baseUrl);
|
|
106
100
|
spinner.stop();
|
|
107
101
|
if (!active)
|
|
108
102
|
return;
|
|
109
103
|
if (active.active_count === 0) {
|
|
110
|
-
this.logger.info(
|
|
104
|
+
this.logger.info(chalk.dim('No active runs to cancel.'));
|
|
111
105
|
return;
|
|
112
106
|
}
|
|
113
107
|
const results = [];
|
|
114
108
|
for (const cid of active.active_context_ids) {
|
|
115
|
-
const sp =
|
|
109
|
+
const sp = createSpinner(`Cancelling ${cid}...`).start();
|
|
116
110
|
const r = await this.cancelOne(baseUrl, cid);
|
|
117
111
|
sp.stop();
|
|
118
112
|
if (r) {
|
|
119
113
|
results.push(r);
|
|
120
|
-
this.logger.success(`Cancelled ${
|
|
114
|
+
this.logger.success(`Cancelled ${chalk.cyan(cid)} (asyncio_cancelled=${r.asyncio_cancelled})`);
|
|
121
115
|
}
|
|
122
116
|
}
|
|
123
117
|
if (options.json)
|
|
@@ -128,7 +122,7 @@ class CancelCommand {
|
|
|
128
122
|
this.logger.error('Usage: vig cancel <context_id> | --all | --list');
|
|
129
123
|
return;
|
|
130
124
|
}
|
|
131
|
-
const spinner =
|
|
125
|
+
const spinner = createSpinner(`Cancelling ${contextId}...`).start();
|
|
132
126
|
const r = await this.cancelOne(baseUrl, contextId);
|
|
133
127
|
spinner.stop();
|
|
134
128
|
if (!r)
|
|
@@ -137,8 +131,7 @@ class CancelCommand {
|
|
|
137
131
|
console.log(JSON.stringify(r, null, 2));
|
|
138
132
|
return;
|
|
139
133
|
}
|
|
140
|
-
this.logger.success(`Cancelled ${
|
|
134
|
+
this.logger.success(`Cancelled ${chalk.cyan(contextId)} ` +
|
|
141
135
|
`(asyncio_cancelled=${r.asyncio_cancelled}, active_runs_after=${r.active_runs_after})`);
|
|
142
136
|
}
|
|
143
137
|
}
|
|
144
|
-
exports.CancelCommand = CancelCommand;
|
package/dist/commands/chat.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare class ChatCommand {
|
|
|
24
24
|
private messages;
|
|
25
25
|
private tools;
|
|
26
26
|
private sessionManager;
|
|
27
|
+
private projectMemory;
|
|
27
28
|
private currentSession;
|
|
28
29
|
private agentMode;
|
|
29
30
|
private currentProjectPath;
|
|
@@ -79,6 +80,9 @@ export declare class ChatCommand {
|
|
|
79
80
|
private inferAgentTaskType;
|
|
80
81
|
private buildTaskShapingInstructions;
|
|
81
82
|
private buildExecutionPrompt;
|
|
83
|
+
private isProjectBrainRuntimeDisabled;
|
|
84
|
+
private buildProjectBrainRuntimeContext;
|
|
85
|
+
private rememberBrainEvent;
|
|
82
86
|
private getPromptRuntimeContext;
|
|
83
87
|
private v3IterationCount;
|
|
84
88
|
private v3ToolCallCount;
|
|
@@ -129,11 +133,15 @@ export declare class ChatCommand {
|
|
|
129
133
|
private runAgentTurn;
|
|
130
134
|
private runLocalAgentLoop;
|
|
131
135
|
private tryDirectSingleFileFlow;
|
|
136
|
+
private isConfirmationFollowUp;
|
|
137
|
+
private getPreviousActionablePrompt;
|
|
138
|
+
private buildContextualAgentPrompt;
|
|
132
139
|
private tryV3AgentWorkflow;
|
|
133
140
|
private tryRecoverV3ServiceAndRetry;
|
|
134
141
|
private startInteractiveChat;
|
|
135
142
|
private showHelp;
|
|
136
143
|
private showContext;
|
|
144
|
+
private showProjectMemory;
|
|
137
145
|
private compactCurrentSession;
|
|
138
146
|
private ensureAgentSystemPrompt;
|
|
139
147
|
private buildAgentSystemPrompt;
|
|
@@ -155,6 +163,8 @@ export declare class ChatCommand {
|
|
|
155
163
|
*/
|
|
156
164
|
private computeCrossFileKeyEvidence;
|
|
157
165
|
private extractToolCalls;
|
|
166
|
+
private normalizeCliToolName;
|
|
167
|
+
private parseLegacyFunctionToolCalls;
|
|
158
168
|
private parseToolPayload;
|
|
159
169
|
private stripToolPayloads;
|
|
160
170
|
private extractFinalFileContent;
|
|
@@ -179,6 +189,7 @@ export declare class ChatCommand {
|
|
|
179
189
|
private executeToolCalls;
|
|
180
190
|
private formatToolResult;
|
|
181
191
|
private truncateText;
|
|
192
|
+
private getLastUserPrompt;
|
|
182
193
|
private saveSession;
|
|
183
194
|
private requestPermission;
|
|
184
195
|
getCurrentSessionInfo(): string;
|