vigthoria-cli 1.10.47 → 1.10.49

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.
Files changed (60) hide show
  1. package/dist/commands/agent-session-menu.js +2 -8
  2. package/dist/commands/auth.js +51 -68
  3. package/dist/commands/bridge.js +42 -22
  4. package/dist/commands/cancel.js +15 -22
  5. package/dist/commands/chat.d.ts +3 -0
  6. package/dist/commands/chat.js +326 -295
  7. package/dist/commands/config.js +33 -73
  8. package/dist/commands/deploy.js +83 -123
  9. package/dist/commands/device.js +21 -61
  10. package/dist/commands/edit.js +32 -39
  11. package/dist/commands/explain.js +18 -25
  12. package/dist/commands/fork.d.ts +17 -0
  13. package/dist/commands/fork.js +164 -0
  14. package/dist/commands/generate.js +37 -44
  15. package/dist/commands/history.d.ts +17 -0
  16. package/dist/commands/history.js +113 -0
  17. package/dist/commands/hub.js +95 -102
  18. package/dist/commands/index.js +41 -46
  19. package/dist/commands/legion.js +146 -186
  20. package/dist/commands/preview.d.ts +55 -0
  21. package/dist/commands/preview.js +467 -0
  22. package/dist/commands/replay.d.ts +18 -0
  23. package/dist/commands/replay.js +156 -0
  24. package/dist/commands/repo.d.ts +97 -0
  25. package/dist/commands/repo.js +773 -0
  26. package/dist/commands/review.js +29 -36
  27. package/dist/commands/security.js +5 -12
  28. package/dist/commands/update.d.ts +9 -0
  29. package/dist/commands/update.js +201 -0
  30. package/dist/commands/wallet.js +28 -35
  31. package/dist/commands/workflow.js +13 -20
  32. package/dist/index.d.ts +21 -0
  33. package/dist/index.js +1652 -0
  34. package/dist/utils/api.d.ts +544 -0
  35. package/dist/utils/api.js +5486 -0
  36. package/dist/utils/brain-hub-client.js +1 -5
  37. package/dist/utils/bridge-client.js +11 -52
  38. package/dist/utils/cli-state.d.ts +54 -0
  39. package/dist/utils/cli-state.js +185 -0
  40. package/dist/utils/codebase-indexer.js +4 -41
  41. package/dist/utils/config.d.ts +82 -0
  42. package/dist/utils/config.js +269 -0
  43. package/dist/utils/context-ranker.js +15 -21
  44. package/dist/utils/desktop-bridge-client.d.ts +12 -0
  45. package/dist/utils/desktop-bridge-client.js +30 -0
  46. package/dist/utils/files.js +5 -42
  47. package/dist/utils/logger.js +42 -50
  48. package/dist/utils/persona.js +3 -8
  49. package/dist/utils/post-write-validator.js +26 -33
  50. package/dist/utils/project-memory.js +16 -23
  51. package/dist/utils/session.d.ts +118 -0
  52. package/dist/utils/session.js +423 -0
  53. package/dist/utils/task-display.js +13 -20
  54. package/dist/utils/tools.d.ts +269 -0
  55. package/dist/utils/tools.js +3450 -0
  56. package/dist/utils/workspace-brain-service.js +8 -45
  57. package/dist/utils/workspace-cache.js +18 -26
  58. package/dist/utils/workspace-stream.js +21 -63
  59. package/package.json +2 -1
  60. package/scripts/release/validate-no-go-gates.sh +7 -4
@@ -6,7 +6,6 @@ import inquirer from 'inquirer';
6
6
  import * as fs from 'fs';
7
7
  import * as os from 'os';
8
8
  import * as path from 'path';
9
-
10
9
  function validateExistingDirectory(input) {
11
10
  const trimmed = String(input || '').trim().replace(/^['"]|['"]$/g, '');
12
11
  if (!trimmed) {
@@ -22,11 +21,11 @@ function validateExistingDirectory(input) {
22
21
  }
23
22
  }
24
23
  catch (error) {
25
- return `Cannot access path: ${error?.message || error}`;
24
+ const message = error instanceof Error ? error.message : String(error);
25
+ return `Cannot access path: ${message}`;
26
26
  }
27
27
  return true;
28
28
  }
29
-
30
29
  export function shouldShowAgentSessionMenu(options = {}) {
31
30
  if (options.prompt) {
32
31
  return false;
@@ -42,7 +41,6 @@ export function shouldShowAgentSessionMenu(options = {}) {
42
41
  }
43
42
  return Boolean(process.stdout.isTTY && process.stdin.isTTY);
44
43
  }
45
-
46
44
  export async function runAgentSessionMenu(defaults = {}) {
47
45
  const session = {
48
46
  workspacePath: path.resolve(String(defaults.workspacePath || process.cwd())),
@@ -50,7 +48,6 @@ export async function runAgentSessionMenu(defaults = {}) {
50
48
  autoApprove: defaults.autoApprove === true,
51
49
  autoSave: defaults.autoSave !== false,
52
50
  };
53
- const recentHint = String(defaults.configuredRoot || '').trim();
54
51
  let done = false;
55
52
  let menuPass = 0;
56
53
  while (!done) {
@@ -64,9 +61,6 @@ export async function runAgentSessionMenu(defaults = {}) {
64
61
  }
65
62
  menuPass += 1;
66
63
  console.log(chalk.gray(`Workspace: ${session.workspacePath}`));
67
- if (recentHint && recentHint !== session.workspacePath) {
68
- console.log(chalk.gray(`Configured default: ${recentHint}`));
69
- }
70
64
  console.log(chalk.gray(`Debug: ${session.debugMode ? 'on' : 'off'} | Auto-approve: ${session.autoApprove ? 'on' : 'off'} | Auto-save: ${session.autoSave ? 'on' : 'off'}`));
71
65
  console.log();
72
66
  const { action } = await inquirer.prompt([
@@ -1,29 +1,12 @@
1
- "use strict";
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.loadAuthConfig = loadAuthConfig;
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 = path_1.default.join((0, os_1.homedir)(), '.vigthoria');
26
- const CONFIG_FILE = path_1.default.join(CONFIG_DIR, 'config.json');
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'];
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 (!(0, fs_1.existsSync)(CONFIG_DIR)) {
60
- (0, fs_1.mkdirSync)(CONFIG_DIR, { recursive: true, mode: 0o700 });
42
+ if (!existsSync(CONFIG_DIR)) {
43
+ mkdirSync(CONFIG_DIR, { recursive: true, mode: 0o700 });
61
44
  }
62
45
  try {
63
- (0, fs_1.chmodSync)(CONFIG_DIR, 0o700);
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 config_js_1.Config();
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);
@@ -89,7 +72,7 @@ function syncSharedConfig(config) {
89
72
  }
90
73
  function clearSharedConfigAuth() {
91
74
  try {
92
- const shared = new config_js_1.Config();
75
+ const shared = new Config();
93
76
  shared.set('authToken', null);
94
77
  shared.set('refreshToken', null);
95
78
  shared.set('userId', null);
@@ -137,12 +120,12 @@ function extractAuthUser(payload, fallbackEmail) {
137
120
  }
138
121
  return fallbackEmail ? { email: fallbackEmail } : undefined;
139
122
  }
140
- function loadAuthConfig() {
141
- if (!(0, fs_1.existsSync)(CONFIG_FILE)) {
123
+ export function loadAuthConfig() {
124
+ if (!existsSync(CONFIG_FILE)) {
142
125
  return { apiUrl: getApiUrl() };
143
126
  }
144
127
  try {
145
- const parsed = JSON.parse((0, fs_1.readFileSync)(CONFIG_FILE, 'utf8'));
128
+ const parsed = JSON.parse(readFileSync(CONFIG_FILE, 'utf8'));
146
129
  return {
147
130
  apiUrl: trimTrailingSlash(parsed.apiUrl || getApiUrl()),
148
131
  token: parsed.token || parsed.authToken,
@@ -151,28 +134,28 @@ function loadAuthConfig() {
151
134
  };
152
135
  }
153
136
  catch (error) {
154
- console.warn(chalk_1.default.yellow(`Warning: could not read auth config: ${humanMessage(error)}`));
137
+ console.warn(chalk.yellow(`Warning: could not read auth config: ${humanMessage(error)}`));
155
138
  return { apiUrl: getApiUrl() };
156
139
  }
157
140
  }
158
- function saveAuthConfig(config) {
141
+ export function saveAuthConfig(config) {
159
142
  ensureConfigDir();
160
- (0, fs_1.writeFileSync)(CONFIG_FILE, `${JSON.stringify(config, null, 2)}\n`, 'utf8');
143
+ writeFileSync(CONFIG_FILE, `${JSON.stringify(config, null, 2)}\n`, 'utf8');
161
144
  try {
162
- (0, fs_1.chmodSync)(CONFIG_FILE, 0o600);
145
+ chmodSync(CONFIG_FILE, 0o600);
163
146
  }
164
147
  catch {
165
148
  // Best-effort on non-POSIX filesystems.
166
149
  }
167
150
  syncSharedConfig(config);
168
151
  }
169
- function clearAuthConfig() {
170
- if ((0, fs_1.existsSync)(CONFIG_FILE)) {
171
- (0, fs_1.rmSync)(CONFIG_FILE, { force: true });
152
+ export function clearAuthConfig() {
153
+ if (existsSync(CONFIG_FILE)) {
154
+ rmSync(CONFIG_FILE, { force: true });
172
155
  }
173
156
  clearSharedConfigAuth();
174
157
  }
175
- function getAuthToken() {
158
+ export function getAuthToken() {
176
159
  return process.env.VIGTHORIA_TOKEN || loadAuthConfig().token;
177
160
  }
178
161
  async function requestJson(url, init) {
@@ -243,7 +226,7 @@ async function fetchV3ServiceKey(apiBase, token) {
243
226
  return undefined;
244
227
  }
245
228
  async function ask(question, hidden = false) {
246
- const rl = readline_1.default.createInterface({ input: process.stdin, output: process.stdout });
229
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
247
230
  if (!hidden) {
248
231
  try {
249
232
  return await new Promise((resolve) => rl.question(question, resolve));
@@ -282,7 +265,7 @@ function markSuccessExit() {
282
265
  function markErrorExit() {
283
266
  process.exitCode = 1;
284
267
  }
285
- async function login(email, password) {
268
+ export async function login(email, password) {
286
269
  try {
287
270
  const resolvedEmail = (email || '').trim();
288
271
  const resolvedPassword = password || '';
@@ -339,7 +322,7 @@ async function login(email, password) {
339
322
  throw new Error(message);
340
323
  }
341
324
  }
342
- async function logout() {
325
+ export async function logout() {
343
326
  const config = loadAuthConfig();
344
327
  if (config.token) {
345
328
  const bases = getAuthBaseCandidates(config.apiUrl || getApiUrl());
@@ -364,13 +347,13 @@ async function logout() {
364
347
  }
365
348
  }
366
349
  if (!remoteLogoutDone) {
367
- console.warn(chalk_1.default.yellow('Remote logout endpoint not reachable; local credentials were still cleared.'));
350
+ console.warn(chalk.yellow('Remote logout endpoint not reachable; local credentials were still cleared.'));
368
351
  }
369
352
  }
370
353
  clearAuthConfig();
371
354
  process.exitCode = 0;
372
355
  }
373
- async function whoami() {
356
+ export async function whoami() {
374
357
  const config = loadAuthConfig();
375
358
  if (!config.token) {
376
359
  return undefined;
@@ -418,7 +401,7 @@ async function whoami() {
418
401
  }
419
402
  throw new Error(`Unable to verify account on known auth endpoints. Tried ${attempted.join(', ')}`);
420
403
  }
421
- async function doctor() {
404
+ export async function doctor() {
422
405
  const config = loadAuthConfig();
423
406
  const report = {
424
407
  nodeVersion: process.version,
@@ -431,7 +414,7 @@ async function doctor() {
431
414
  process.exitCode = 0;
432
415
  return report;
433
416
  }
434
- async function handleLogin(options = {}) {
417
+ export async function handleLogin(options = {}) {
435
418
  try {
436
419
  if (options.token) {
437
420
  const config = {
@@ -444,14 +427,14 @@ async function handleLogin(options = {}) {
444
427
  config.v3ServiceKey = v3ServiceKey;
445
428
  }
446
429
  saveAuthConfig(config);
447
- console.log(chalk_1.default.green('Logged in successfully with API token.'));
430
+ console.log(chalk.green('Logged in successfully with API token.'));
448
431
  process.exitCode = 0;
449
432
  return config;
450
433
  }
451
434
  let email = options.email?.trim();
452
435
  let password = options.password;
453
436
  if (options.device) {
454
- console.log(chalk_1.default.yellow('Device-code login is not enabled by this Vigthoria service. Falling back to email and password authentication.'));
437
+ console.log(chalk.yellow('Device-code login is not enabled by this Vigthoria service. Falling back to email and password authentication.'));
455
438
  }
456
439
  if (!email) {
457
440
  email = (await ask('Email: ')).trim();
@@ -463,7 +446,7 @@ async function handleLogin(options = {}) {
463
446
  throw new Error('Email and password are required. Use --email and --password, or run vigthoria login interactively.');
464
447
  }
465
448
  const config = await login(email, password);
466
- console.log(chalk_1.default.green('Logged in successfully.'));
449
+ console.log(chalk.green('Logged in successfully.'));
467
450
  if (config.user?.email) {
468
451
  console.log(`Account: ${config.user.email}`);
469
452
  }
@@ -489,7 +472,7 @@ async function handleLogin(options = {}) {
489
472
  }
490
473
  catch { /* non-fatal — login already succeeded */ }
491
474
  try {
492
- const sharedConfig = new config_js_1.Config();
475
+ const sharedConfig = new Config();
493
476
  await sharedConfig.refreshHubModelPreferences();
494
477
  const hubPrefs = sharedConfig.get('hubModelPrefs');
495
478
  if (hubPrefs?.balance !== undefined) {
@@ -502,32 +485,32 @@ async function handleLogin(options = {}) {
502
485
  return config;
503
486
  }
504
487
  catch (error) {
505
- console.error(chalk_1.default.red(`Login failed: ${humanMessage(error)}`));
488
+ console.error(chalk.red(`Login failed: ${humanMessage(error)}`));
506
489
  process.exitCode = 1;
507
490
  return undefined;
508
491
  }
509
492
  }
510
- async function handleLogout(_options) {
493
+ export async function handleLogout(_options) {
511
494
  try {
512
495
  await logout();
513
- console.log(chalk_1.default.green('Logged out successfully.'));
496
+ console.log(chalk.green('Logged out successfully.'));
514
497
  process.exitCode = 0;
515
498
  }
516
499
  catch (error) {
517
- console.error(chalk_1.default.red(`Logout failed: ${humanMessage(error)}`));
500
+ console.error(chalk.red(`Logout failed: ${humanMessage(error)}`));
518
501
  process.exitCode = 1;
519
502
  }
520
503
  }
521
- async function statusAction() {
504
+ export async function statusAction() {
522
505
  try {
523
506
  const legacyConfig = loadAuthConfig();
524
- const sharedConfig = new config_js_1.Config();
507
+ const sharedConfig = new Config();
525
508
  const sharedApiUrl = String(sharedConfig.get('apiUrl') || '').trim();
526
509
  const sharedToken = String(sharedConfig.get('authToken') || '').trim();
527
510
  const effectiveApiUrl = trimTrailingSlash(sharedApiUrl || legacyConfig.apiUrl || getApiUrl());
528
511
  const effectiveToken = sharedToken || legacyConfig.token || '';
529
512
  if (!effectiveToken) {
530
- console.log(chalk_1.default.yellow('Not logged in.'));
513
+ console.log(chalk.yellow('Not logged in.'));
531
514
  process.exitCode = 0;
532
515
  return;
533
516
  }
@@ -546,8 +529,8 @@ async function statusAction() {
546
529
  // Network failures should not force logout status.
547
530
  }
548
531
  if (!authLooksValid) {
549
- console.log(chalk_1.default.yellow('Not logged in. Session expired or invalid.'));
550
- console.log(chalk_1.default.gray('Run: vigthoria login'));
532
+ console.log(chalk.yellow('Not logged in. Session expired or invalid.'));
533
+ console.log(chalk.gray('Run: vigthoria login'));
551
534
  process.exitCode = 1;
552
535
  return;
553
536
  }
@@ -579,8 +562,8 @@ async function statusAction() {
579
562
  // Status should still render even if health probes fail.
580
563
  }
581
564
  const plan = String(sharedConfig.get('subscription')?.plan || '').trim();
582
- console.log(chalk_1.default.white('Account Status'));
583
- console.log(chalk_1.default.green('Logged in.'));
565
+ console.log(chalk.white('Account Status'));
566
+ console.log(chalk.green('Logged in.'));
584
567
  if (user?.email) {
585
568
  console.log(`Account: ${user.email}`);
586
569
  }
@@ -594,11 +577,11 @@ async function statusAction() {
594
577
  process.exitCode = 0;
595
578
  }
596
579
  catch (error) {
597
- console.error(chalk_1.default.red(`Unable to read status: ${humanMessage(error)}`));
580
+ console.error(chalk.red(`Unable to read status: ${humanMessage(error)}`));
598
581
  process.exitCode = 1;
599
582
  }
600
583
  }
601
- function registerAuthCommands(program) {
584
+ export function registerAuthCommands(program) {
602
585
  const auth = program.command('auth').description('Manage Vigthoria CLI authentication');
603
586
  auth
604
587
  .command('login')
@@ -623,16 +606,16 @@ function registerAuthCommands(program) {
623
606
  try {
624
607
  const user = await whoami();
625
608
  if (!user) {
626
- console.log(chalk_1.default.yellow('Not logged in.'));
609
+ console.log(chalk.yellow('Not logged in.'));
627
610
  process.exitCode = 0;
628
611
  return;
629
612
  }
630
- console.log(chalk_1.default.green('Logged in.'));
613
+ console.log(chalk.green('Logged in.'));
631
614
  console.log(user.email || user.name || user.id || 'Authenticated user');
632
615
  process.exitCode = 0;
633
616
  }
634
617
  catch (error) {
635
- console.error(chalk_1.default.red(`Unable to fetch account: ${humanMessage(error)}`));
618
+ console.error(chalk.red(`Unable to fetch account: ${humanMessage(error)}`));
636
619
  process.exitCode = 1;
637
620
  }
638
621
  });
@@ -1,34 +1,54 @@
1
- "use strict";
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.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
+ import { getDesktopBridgeStatus } from '../utils/desktop-bridge-client.js';
5
+ export class BridgeCommand {
11
6
  api;
12
7
  constructor(config, logger) {
13
- this.api = new api_js_1.APIClient(config, logger);
8
+ this.api = new APIClient(config, logger);
14
9
  }
15
10
  async status() {
16
- const spinner = (0, logger_js_1.createSpinner)('Checking DevTools Bridge...').start();
17
- const bridge = await this.api.getDevtoolsBridgeStatus();
11
+ const spinner = createSpinner('Checking bridges...').start();
12
+ const [devtoolsBridge, desktopBridge] = await Promise.all([
13
+ this.api.getDevtoolsBridgeStatus(),
14
+ getDesktopBridgeStatus(),
15
+ ]);
18
16
  spinner.stop();
19
17
  console.log();
20
- console.log(chalk_1.default.white('DevTools Bridge:'));
21
- console.log(chalk_1.default.gray(' Status: ') + (bridge.ok ? chalk_1.default.green('Reachable') : chalk_1.default.yellow('Not running')));
22
- if (!bridge.ok) {
23
- const detail = String(bridge.error || 'Connection refused').trim() || 'Connection refused';
24
- console.log(chalk_1.default.gray(' Error: ') + chalk_1.default.yellow(detail));
18
+ console.log(chalk.white('DevTools Bridge (browser, port 4016):'));
19
+ console.log(chalk.gray(' Status: ') + (devtoolsBridge.ok ? chalk.green('Reachable') : chalk.yellow('Not running')));
20
+ if (devtoolsBridge.ok) {
21
+ console.log(chalk.gray(' Endpoint: ') + devtoolsBridge.endpoint);
25
22
  }
26
- console.log(chalk_1.default.gray(' Browser tasks: ') + (bridge.ok
27
- ? chalk_1.default.green('Local browser observability is available for debugging flows.')
28
- : chalk_1.default.gray('Start the DevTools Bridge to enable local browser observability.')));
23
+ else {
24
+ const detail = String(devtoolsBridge.error || 'Connection refused').trim() || 'Connection refused';
25
+ console.log(chalk.gray(' Error: ') + chalk.yellow(detail));
26
+ }
27
+ console.log(chalk.gray(' Use for: ') + (devtoolsBridge.ok
28
+ ? chalk.green('Local browser observability in CLI chat flows.')
29
+ : chalk.gray('Start vigthoria-devtools-bridge on port 4016.')));
30
+ console.log();
31
+ console.log(chalk.white('Desktop Bridge (Windows desktop, port 49160):'));
32
+ console.log(chalk.gray(' Status: ') + (desktopBridge.ok ? chalk.green('Reachable') : chalk.yellow('Not running')));
33
+ if (desktopBridge.ok) {
34
+ console.log(chalk.gray(' Endpoint: ') + desktopBridge.endpoint);
35
+ if (desktopBridge.service)
36
+ console.log(chalk.gray(' Service: ') + desktopBridge.service);
37
+ if (desktopBridge.version)
38
+ console.log(chalk.gray(' Version: ') + desktopBridge.version);
39
+ console.log(chalk.gray(' Control: ') + (desktopBridge.controlEnabled ? chalk.green('enabled') : chalk.yellow('disabled')));
40
+ }
41
+ else {
42
+ const detail = String(desktopBridge.error || 'Connection refused').trim() || 'Connection refused';
43
+ console.log(chalk.gray(' Error: ') + chalk.yellow(detail));
44
+ console.log(chalk.gray(' Windows setup: ') + 'Run extension.vigthoria.io/downloads/vigthoria-desktop-bridge-bringup.ps1');
45
+ console.log(chalk.gray(' Tunnel: ') + 'ssh -N -R 127.0.0.1:49160:127.0.0.1:49160 root@78.46.154.201');
46
+ }
47
+ console.log(chalk.gray(' Use for: ') + (desktopBridge.ok
48
+ ? chalk.green('Remote Vigthoria Code screenshots, input, and Electron DevTools (9229).')
49
+ : chalk.gray('Start local-desktop-bridge.js on Windows, then open the SSH reverse tunnel.')));
29
50
  console.log();
30
51
  this.api.destroy();
31
52
  process.exitCode = 0;
32
53
  }
33
54
  }
34
- exports.BridgeCommand = BridgeCommand;
@@ -1,10 +1,4 @@
1
- "use strict";
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
- const chalk_1 = __importDefault(require("chalk"));
17
- const logger_js_1 = require("../utils/logger.js");
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 = !(0, api_js_1.isServerRuntime)() || process.env.VIGTHORIA_ALLOW_LOCAL_V3_AGENT === '1';
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 = (0, logger_js_1.createSpinner)('Loading active runs...').start();
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(chalk_1.default.dim('No active runs.'));
87
+ this.logger.info(chalk.dim('No active runs.'));
94
88
  return;
95
89
  }
96
- console.log(chalk_1.default.bold(`\n${logger_js_1.CH.success} Active Runs (${active.active_count}/${active.max_concurrent_runs})\n`));
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(` ${chalk_1.default.cyan(cid)}`);
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 = (0, logger_js_1.createSpinner)('Loading active runs...').start();
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(chalk_1.default.dim('No active runs to cancel.'));
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 = (0, logger_js_1.createSpinner)(`Cancelling ${cid}...`).start();
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 ${chalk_1.default.cyan(cid)} (asyncio_cancelled=${r.asyncio_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 = (0, logger_js_1.createSpinner)(`Cancelling ${contextId}...`).start();
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 ${chalk_1.default.cyan(contextId)} ` +
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;
@@ -44,6 +44,7 @@ export declare class ChatCommand {
44
44
  private modelGovernanceFallback;
45
45
  private retryPromptSignature;
46
46
  private retryPromptStreak;
47
+ private v3SuppressThinkingStream;
47
48
  private lastAgentRunOutcome;
48
49
  private isJwtExpirationError;
49
50
  private isNetworkError;
@@ -110,6 +111,7 @@ export declare class ChatCommand {
110
111
  private isRawV3StreamPayload;
111
112
  private consumeV3StreamPayload;
112
113
  private writeV3StreamText;
114
+ private sanitizeV3VisibleStreamText;
113
115
  private updateV3AgentSpinner;
114
116
  private updateOperatorSpinner;
115
117
  constructor(config: Config, logger: Logger);
@@ -149,6 +151,7 @@ export declare class ChatCommand {
149
151
  private primeBypassedTargetFileContext;
150
152
  private tryDirectSingleFileFlow;
151
153
  private isConfirmationFollowUp;
154
+ private taskRequiresWorkspaceChanges;
152
155
  private getPreviousActionablePrompt;
153
156
  private buildContextualAgentPrompt;
154
157
  private tryV3AgentWorkflow;