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.
Files changed (52) hide show
  1. package/README.md +4 -4
  2. package/dist/commands/auth.js +48 -65
  3. package/dist/commands/bridge.js +12 -19
  4. package/dist/commands/cancel.js +15 -22
  5. package/dist/commands/chat.d.ts +11 -0
  6. package/dist/commands/chat.js +404 -248
  7. package/dist/commands/config.js +31 -71
  8. package/dist/commands/deploy.js +83 -123
  9. package/dist/commands/device.d.ts +35 -0
  10. package/dist/commands/device.js +239 -0
  11. package/dist/commands/edit.js +32 -39
  12. package/dist/commands/explain.js +18 -25
  13. package/dist/commands/fork.js +22 -27
  14. package/dist/commands/generate.js +37 -44
  15. package/dist/commands/history.js +20 -25
  16. package/dist/commands/hub.js +95 -102
  17. package/dist/commands/index.js +41 -46
  18. package/dist/commands/legion.d.ts +1 -0
  19. package/dist/commands/legion.js +162 -209
  20. package/dist/commands/preview.js +60 -98
  21. package/dist/commands/replay.js +27 -32
  22. package/dist/commands/repo.js +103 -141
  23. package/dist/commands/review.js +29 -36
  24. package/dist/commands/security.js +5 -12
  25. package/dist/commands/update.js +15 -49
  26. package/dist/commands/workflow.d.ts +8 -1
  27. package/dist/commands/workflow.js +53 -19
  28. package/dist/index.js +409 -234
  29. package/dist/utils/api.d.ts +5 -0
  30. package/dist/utils/api.js +373 -166
  31. package/dist/utils/bridge-client.js +11 -52
  32. package/dist/utils/cli-state.d.ts +54 -0
  33. package/dist/utils/cli-state.js +185 -0
  34. package/dist/utils/config.d.ts +5 -0
  35. package/dist/utils/config.js +35 -14
  36. package/dist/utils/context-ranker.js +15 -21
  37. package/dist/utils/files.js +5 -42
  38. package/dist/utils/logger.js +42 -50
  39. package/dist/utils/post-write-validator.js +22 -29
  40. package/dist/utils/project-memory.d.ts +56 -0
  41. package/dist/utils/project-memory.js +289 -0
  42. package/dist/utils/session.d.ts +29 -3
  43. package/dist/utils/session.js +137 -85
  44. package/dist/utils/task-display.js +13 -20
  45. package/dist/utils/tools.d.ts +19 -0
  46. package/dist/utils/tools.js +84 -87
  47. package/dist/utils/workspace-cache.js +18 -26
  48. package/dist/utils/workspace-stream.js +26 -64
  49. package/install.ps1 +14 -0
  50. package/package.json +5 -3
  51. package/scripts/release/LOCAL_MACHINE_USER_VERIFICATION.md +1 -1
  52. package/scripts/release/validate-no-go-gates.sh +2 -2
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /**
3
2
  * Vigthoria CLI - Preview Command
4
3
  *
@@ -10,51 +9,15 @@
10
9
  * vigthoria preview --proof - Run Template Service preview gate
11
10
  * vigthoria preview -p /path/to/project - Preview specific project
12
11
  */
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || (function () {
30
- var ownKeys = function(o) {
31
- ownKeys = Object.getOwnPropertyNames || function (o) {
32
- var ar = [];
33
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
- return ar;
35
- };
36
- return ownKeys(o);
37
- };
38
- return function (mod) {
39
- if (mod && mod.__esModule) return mod;
40
- var result = {};
41
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
- __setModuleDefault(result, mod);
43
- return result;
44
- };
45
- })();
46
- var __importDefault = (this && this.__importDefault) || function (mod) {
47
- return (mod && mod.__esModule) ? mod : { "default": mod };
48
- };
49
- Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.PreviewCommand = void 0;
51
- const chalk_1 = __importDefault(require("chalk"));
52
- const fs = __importStar(require("fs"));
53
- const path = __importStar(require("path"));
54
- const http = __importStar(require("http"));
55
- const diff_1 = require("diff");
56
- const logger_js_1 = require("../utils/logger.js");
57
- const api_js_1 = require("../utils/api.js");
12
+ import chalk from 'chalk';
13
+ import * as fs from 'fs';
14
+ import * as path from 'path';
15
+ import * as http from 'http';
16
+ import { createRequire } from 'node:module';
17
+ import { structuredPatch } from 'diff';
18
+ import { createSpinner, CH } from '../utils/logger.js';
19
+ import { APIClient } from '../utils/api.js';
20
+ const require = createRequire(import.meta.url);
58
21
  // Common MIME types for static file serving
59
22
  const MIME_TYPES = {
60
23
  '.html': 'text/html',
@@ -83,7 +46,7 @@ const MIME_TYPES = {
83
46
  '.txt': 'text/plain',
84
47
  '.map': 'application/json',
85
48
  };
86
- class PreviewCommand {
49
+ export class PreviewCommand {
87
50
  config;
88
51
  logger;
89
52
  api;
@@ -91,7 +54,7 @@ class PreviewCommand {
91
54
  constructor(config, logger) {
92
55
  this.config = config;
93
56
  this.logger = logger;
94
- this.api = new api_js_1.APIClient(config, logger);
57
+ this.api = new APIClient(config, logger);
95
58
  }
96
59
  async run(options) {
97
60
  const projectPath = path.resolve(options.project || process.cwd());
@@ -101,8 +64,8 @@ class PreviewCommand {
101
64
  return;
102
65
  }
103
66
  console.log();
104
- console.log(chalk_1.default.bold.white(` ${logger_js_1.CH.hLine.repeat(3)} Vigthoria Preview ${logger_js_1.CH.hLine.repeat(40)}`));
105
- console.log(chalk_1.default.gray(` Project: ${projectPath}`));
67
+ console.log(chalk.bold.white(` ${CH.hLine.repeat(3)} Vigthoria Preview ${CH.hLine.repeat(40)}`));
68
+ console.log(chalk.gray(` Project: ${projectPath}`));
106
69
  console.log();
107
70
  // Show consolidated diff of recent agent changes
108
71
  if (options.diff) {
@@ -230,10 +193,10 @@ class PreviewCommand {
230
193
  });
231
194
  this.server.listen(port, () => {
232
195
  const url = `http://localhost:${port}/${entryFile}`;
233
- console.log(chalk_1.default.green(` ${logger_js_1.CH.success} Preview server running`));
234
- console.log(chalk_1.default.gray(` URL: `) + chalk_1.default.cyan.underline(url));
235
- console.log(chalk_1.default.gray(` Entry: ${entryFile}`));
236
- console.log(chalk_1.default.gray(` Press Ctrl+C to stop`));
196
+ console.log(chalk.green(` ${CH.success} Preview server running`));
197
+ console.log(chalk.gray(` URL: `) + chalk.cyan.underline(url));
198
+ console.log(chalk.gray(` Entry: ${entryFile}`));
199
+ console.log(chalk.gray(` Press Ctrl+C to stop`));
237
200
  console.log();
238
201
  if (autoOpen) {
239
202
  this.openBrowser(url);
@@ -241,7 +204,7 @@ class PreviewCommand {
241
204
  });
242
205
  // Handle graceful shutdown
243
206
  const shutdown = () => {
244
- console.log(chalk_1.default.gray('\n Stopping preview server...'));
207
+ console.log(chalk.gray('\n Stopping preview server...'));
245
208
  this.server?.close();
246
209
  this.api.destroy();
247
210
  resolve();
@@ -289,7 +252,7 @@ class PreviewCommand {
289
252
  * Show consolidated diff of recent agent changes using git
290
253
  */
291
254
  async showConsolidatedDiff(projectPath) {
292
- console.log(chalk_1.default.bold.white(` ${logger_js_1.CH.hLine.repeat(3)} Change Summary ${logger_js_1.CH.hLine.repeat(43)}`));
255
+ console.log(chalk.bold.white(` ${CH.hLine.repeat(3)} Change Summary ${CH.hLine.repeat(43)}`));
293
256
  console.log();
294
257
  const proofDir = path.join(projectPath, '.vigthoria', 'proof', 'preview');
295
258
  const hasProof = fs.existsSync(proofDir);
@@ -301,7 +264,7 @@ class PreviewCommand {
301
264
  // Get list of changed files (unstaged + staged)
302
265
  const statusOutput = execSync('git status --porcelain', { cwd: projectPath, encoding: 'utf-8' }).trim();
303
266
  if (!statusOutput) {
304
- console.log(chalk_1.default.gray(' No changes detected (working tree clean).'));
267
+ console.log(chalk.gray(' No changes detected (working tree clean).'));
305
268
  console.log();
306
269
  return;
307
270
  }
@@ -321,13 +284,13 @@ class PreviewCommand {
321
284
  }
322
285
  // Summary header
323
286
  const total = created.length + modified.length + deleted.length;
324
- console.log(chalk_1.default.white(` ${total} file${total !== 1 ? 's' : ''} changed:`));
287
+ console.log(chalk.white(` ${total} file${total !== 1 ? 's' : ''} changed:`));
325
288
  for (const f of created)
326
- console.log(chalk_1.default.green(` + ${f}`));
289
+ console.log(chalk.green(` + ${f}`));
327
290
  for (const f of modified)
328
- console.log(chalk_1.default.yellow(` ~ ${f}`));
291
+ console.log(chalk.yellow(` ~ ${f}`));
329
292
  for (const f of deleted)
330
- console.log(chalk_1.default.red(` - ${f}`));
293
+ console.log(chalk.red(` - ${f}`));
331
294
  console.log();
332
295
  // Show unified diffs for modified and created files (limit to keep terminal manageable)
333
296
  const diffTargets = [...modified, ...created].slice(0, 20);
@@ -353,23 +316,23 @@ class PreviewCommand {
353
316
  // File is new or not tracked
354
317
  }
355
318
  }
356
- const patch = (0, diff_1.structuredPatch)(relPath, relPath, oldContent, newContent, 'before', 'after', { context: 3 });
319
+ const patch = structuredPatch(relPath, relPath, oldContent, newContent, 'before', 'after', { context: 3 });
357
320
  if (patch.hunks.length === 0)
358
321
  continue;
359
- console.log(chalk_1.default.bold.white(` ${logger_js_1.CH.hLine.repeat(3)} ${relPath} ${logger_js_1.CH.hLine.repeat(Math.max(1, 50 - relPath.length))}`));
360
- console.log(chalk_1.default.gray(` --- a/${relPath}`));
361
- console.log(chalk_1.default.gray(` +++ b/${relPath}`));
322
+ console.log(chalk.bold.white(` ${CH.hLine.repeat(3)} ${relPath} ${CH.hLine.repeat(Math.max(1, 50 - relPath.length))}`));
323
+ console.log(chalk.gray(` --- a/${relPath}`));
324
+ console.log(chalk.gray(` +++ b/${relPath}`));
362
325
  for (const hunk of patch.hunks) {
363
- console.log(chalk_1.default.cyan(` @@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`));
326
+ console.log(chalk.cyan(` @@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`));
364
327
  for (const line of hunk.lines) {
365
328
  if (line.startsWith('+')) {
366
- console.log(chalk_1.default.green(` ${line}`));
329
+ console.log(chalk.green(` ${line}`));
367
330
  }
368
331
  else if (line.startsWith('-')) {
369
- console.log(chalk_1.default.red(` ${line}`));
332
+ console.log(chalk.red(` ${line}`));
370
333
  }
371
334
  else {
372
- console.log(chalk_1.default.gray(` ${line}`));
335
+ console.log(chalk.gray(` ${line}`));
373
336
  }
374
337
  }
375
338
  }
@@ -380,7 +343,7 @@ class PreviewCommand {
380
343
  }
381
344
  }
382
345
  if (diffTargets.length < modified.length + created.length) {
383
- console.log(chalk_1.default.gray(` ... and ${modified.length + created.length - diffTargets.length} more files`));
346
+ console.log(chalk.gray(` ... and ${modified.length + created.length - diffTargets.length} more files`));
384
347
  console.log();
385
348
  }
386
349
  return;
@@ -397,23 +360,23 @@ class PreviewCommand {
397
360
  .reverse()
398
361
  .slice(0, 5);
399
362
  if (manifests.length > 0) {
400
- console.log(chalk_1.default.white(' Recent proof bundles:'));
363
+ console.log(chalk.white(' Recent proof bundles:'));
401
364
  for (const m of manifests) {
402
365
  try {
403
366
  const manifest = JSON.parse(fs.readFileSync(path.join(proofDir, m), 'utf-8'));
404
- const passed = manifest.previewGate?.passed ? chalk_1.default.green('passed') : chalk_1.default.red('failed');
405
- console.log(chalk_1.default.gray(` ${manifest.createdAt || m} `) + passed + chalk_1.default.gray(` ${manifest.entryPath || '-'}`));
367
+ const passed = manifest.previewGate?.passed ? chalk.green('passed') : chalk.red('failed');
368
+ console.log(chalk.gray(` ${manifest.createdAt || m} `) + passed + chalk.gray(` ${manifest.entryPath || '-'}`));
406
369
  }
407
370
  catch {
408
- console.log(chalk_1.default.gray(` ${m}`));
371
+ console.log(chalk.gray(` ${m}`));
409
372
  }
410
373
  }
411
374
  console.log();
412
375
  }
413
376
  }
414
377
  else {
415
- console.log(chalk_1.default.gray(' No git history or proof bundles found.'));
416
- console.log(chalk_1.default.gray(' Run an agent task first to generate changes.'));
378
+ console.log(chalk.gray(' No git history or proof bundles found.'));
379
+ console.log(chalk.gray(' Run an agent task first to generate changes.'));
417
380
  console.log();
418
381
  }
419
382
  }
@@ -421,7 +384,7 @@ class PreviewCommand {
421
384
  * Run Template Service preview gate and persist proof bundle
422
385
  */
423
386
  async runProofGate(projectPath, captureScreenshot) {
424
- const spinner = (0, logger_js_1.createSpinner)('Running preview proof gate...').start();
387
+ const spinner = createSpinner('Running preview proof gate...').start();
425
388
  try {
426
389
  const result = await this.api.runTemplateServicePreviewGate('', {
427
390
  workspacePath: projectPath,
@@ -429,39 +392,39 @@ class PreviewCommand {
429
392
  targetPath: projectPath,
430
393
  });
431
394
  spinner.stop();
432
- console.log(chalk_1.default.bold.white(` ${logger_js_1.CH.hLine.repeat(3)} Preview Proof Gate ${logger_js_1.CH.hLine.repeat(39)}`));
395
+ console.log(chalk.bold.white(` ${CH.hLine.repeat(3)} Preview Proof Gate ${CH.hLine.repeat(39)}`));
433
396
  console.log();
434
397
  if (!result.required) {
435
- console.log(chalk_1.default.gray(' Preview gate: not required (no frontend artifacts detected)'));
398
+ console.log(chalk.gray(' Preview gate: not required (no frontend artifacts detected)'));
436
399
  console.log();
437
400
  return;
438
401
  }
439
- const statusIcon = result.passed ? chalk_1.default.green(logger_js_1.CH.success) : chalk_1.default.red(logger_js_1.CH.error);
440
- console.log(` ${statusIcon} Preview gate: ${result.passed ? chalk_1.default.green('PASSED') : chalk_1.default.red('FAILED')}`);
402
+ const statusIcon = result.passed ? chalk.green(CH.success) : chalk.red(CH.error);
403
+ console.log(` ${statusIcon} Preview gate: ${result.passed ? chalk.green('PASSED') : chalk.red('FAILED')}`);
441
404
  if (result.error) {
442
- console.log(chalk_1.default.yellow(` Error: ${result.error}`));
405
+ console.log(chalk.yellow(` Error: ${result.error}`));
443
406
  }
444
407
  // Show modes
445
408
  if (result.modes) {
446
409
  const modes = result.modes;
447
410
  console.log();
448
411
  if (modes.design) {
449
- const designStatus = modes.design.ready ? chalk_1.default.green('ready') : chalk_1.default.gray('not ready');
450
- console.log(chalk_1.default.gray(` Design mode: `) + designStatus);
412
+ const designStatus = modes.design.ready ? chalk.green('ready') : chalk.gray('not ready');
413
+ console.log(chalk.gray(` Design mode: `) + designStatus);
451
414
  if (modes.design.devices) {
452
- console.log(chalk_1.default.gray(` Devices: ${modes.design.devices.join(', ')}`));
415
+ console.log(chalk.gray(` Devices: ${modes.design.devices.join(', ')}`));
453
416
  }
454
417
  }
455
418
  if (modes.live) {
456
- const liveStatus = modes.live.ready ? chalk_1.default.green('ready') : chalk_1.default.gray('not ready');
457
- console.log(chalk_1.default.gray(` Live mode: `) + liveStatus);
419
+ const liveStatus = modes.live.ready ? chalk.green('ready') : chalk.gray('not ready');
420
+ console.log(chalk.gray(` Live mode: `) + liveStatus);
458
421
  if (modes.live.entryPoint) {
459
- console.log(chalk_1.default.gray(` Entry: ${modes.live.entryPoint}`));
422
+ console.log(chalk.gray(` Entry: ${modes.live.entryPoint}`));
460
423
  }
461
424
  }
462
425
  if (modes.production) {
463
- const prodStatus = modes.production.ready ? chalk_1.default.green('ready') : chalk_1.default.gray('not ready');
464
- console.log(chalk_1.default.gray(` Production mode: `) + prodStatus);
426
+ const prodStatus = modes.production.ready ? chalk.green('ready') : chalk.gray('not ready');
427
+ console.log(chalk.gray(` Production mode: `) + prodStatus);
465
428
  }
466
429
  }
467
430
  // Show summary
@@ -469,29 +432,29 @@ class PreviewCommand {
469
432
  console.log();
470
433
  const summary = result.summary;
471
434
  if (summary.hasViewportMeta !== undefined) {
472
- console.log(chalk_1.default.gray(` Viewport meta: `) + (summary.hasViewportMeta ? chalk_1.default.green('yes') : chalk_1.default.yellow('missing')));
435
+ console.log(chalk.gray(` Viewport meta: `) + (summary.hasViewportMeta ? chalk.green('yes') : chalk.yellow('missing')));
473
436
  }
474
437
  if (summary.hasResponsiveSignals !== undefined) {
475
- console.log(chalk_1.default.gray(` Responsive CSS: `) + (summary.hasResponsiveSignals ? chalk_1.default.green('yes') : chalk_1.default.gray('no')));
438
+ console.log(chalk.gray(` Responsive CSS: `) + (summary.hasResponsiveSignals ? chalk.green('yes') : chalk.gray('no')));
476
439
  }
477
440
  if (summary.hasInteractiveSignals !== undefined) {
478
- console.log(chalk_1.default.gray(` Interactive JS: `) + (summary.hasInteractiveSignals ? chalk_1.default.green('yes') : chalk_1.default.gray('no')));
441
+ console.log(chalk.gray(` Interactive JS: `) + (summary.hasInteractiveSignals ? chalk.green('yes') : chalk.gray('no')));
479
442
  }
480
443
  if (typeof summary.sectionCount === 'number') {
481
- console.log(chalk_1.default.gray(` Section count: ${summary.sectionCount}`));
444
+ console.log(chalk.gray(` Section count: ${summary.sectionCount}`));
482
445
  }
483
446
  }
484
447
  // Show artifacts
485
448
  if (result.artifacts) {
486
449
  console.log();
487
450
  if (result.artifacts.manifestPath) {
488
- console.log(chalk_1.default.gray(` Manifest: ${result.artifacts.manifestPath}`));
451
+ console.log(chalk.gray(` Manifest: ${result.artifacts.manifestPath}`));
489
452
  }
490
453
  if (result.artifacts.screenshotCaptured && result.artifacts.screenshotPath) {
491
- console.log(chalk_1.default.gray(` Screenshot: ${result.artifacts.screenshotPath}`));
454
+ console.log(chalk.gray(` Screenshot: ${result.artifacts.screenshotPath}`));
492
455
  }
493
456
  if (result.artifacts.previewFileUrl) {
494
- console.log(chalk_1.default.gray(` File URL: `) + chalk_1.default.cyan.underline(result.artifacts.previewFileUrl));
457
+ console.log(chalk.gray(` File URL: `) + chalk.cyan.underline(result.artifacts.previewFileUrl));
495
458
  }
496
459
  }
497
460
  console.log();
@@ -502,4 +465,3 @@ class PreviewCommand {
502
465
  }
503
466
  }
504
467
  }
505
- exports.PreviewCommand = PreviewCommand;
@@ -1,16 +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.ReplayCommand = void 0;
7
- const api_js_1 = require("../utils/api.js");
1
+ import { isServerRuntime } from '../utils/api.js';
8
2
  /**
9
3
  * replay.ts — Replay events from a V3 agent run step-by-step.
10
4
  */
11
- const chalk_1 = __importDefault(require("chalk"));
12
- const logger_js_1 = require("../utils/logger.js");
13
- class ReplayCommand {
5
+ import chalk from 'chalk';
6
+ import { createRequire } from 'node:module';
7
+ import { createSpinner, CH } from '../utils/logger.js';
8
+ const require = createRequire(import.meta.url);
9
+ export class ReplayCommand {
14
10
  config;
15
11
  logger;
16
12
  constructor(config, logger) {
@@ -33,7 +29,7 @@ class ReplayCommand {
33
29
  }
34
30
  getBaseUrl() {
35
31
  const configuredApiUrl = String(this.config.get('apiUrl') || 'https://coder.vigthoria.io').replace(/\/$/, '');
36
- const allowLocal = (0, api_js_1.isServerRuntime)() && process.env.VIGTHORIA_ALLOW_LOCAL_V3_AGENT === '1';
32
+ const allowLocal = isServerRuntime() && process.env.VIGTHORIA_ALLOW_LOCAL_V3_AGENT === '1';
37
33
  return (process.env.VIGTHORIA_V3_AGENT_URL ||
38
34
  process.env.V3_AGENT_URL ||
39
35
  (allowLocal ? 'http://127.0.0.1:8030' : null) ||
@@ -59,7 +55,7 @@ class ReplayCommand {
59
55
  const speed = options.speed || 200;
60
56
  const project = options.project || process.cwd();
61
57
  const workspace = this.resolveWorkspaceRoot(project);
62
- const spinner = (0, logger_js_1.createSpinner)(`Loading events for run ${runId}...`).start();
58
+ const spinner = createSpinner(`Loading events for run ${runId}...`).start();
63
59
  try {
64
60
  const baseUrl = this.getBaseUrl();
65
61
  const params = new URLSearchParams({ workspace_root: workspace });
@@ -85,72 +81,72 @@ class ReplayCommand {
85
81
  console.log(JSON.stringify(data, null, 2));
86
82
  return;
87
83
  }
88
- console.log(chalk_1.default.bold(`\n${logger_js_1.CH.success} Replaying run ${chalk_1.default.cyan(runId)} (${data.count} events)\n`));
84
+ console.log(chalk.bold(`\n${CH.success} Replaying run ${chalk.cyan(runId)} (${data.count} events)\n`));
89
85
  let toolCallNum = 0;
90
86
  for (let i = 0; i < data.events.length; i++) {
91
87
  const evt = data.events[i];
92
88
  const type = evt.type || 'unknown';
93
- const idx = chalk_1.default.dim(`[${String(i + 1).padStart(3)}/${data.count}]`);
89
+ const idx = chalk.dim(`[${String(i + 1).padStart(3)}/${data.count}]`);
94
90
  switch (type) {
95
91
  case 'context':
96
- console.log(`${idx} ${chalk_1.default.blue('context')} workspace=${evt.workspace_root || '?'}`);
92
+ console.log(`${idx} ${chalk.blue('context')} workspace=${evt.workspace_root || '?'}`);
97
93
  break;
98
94
  case 'start':
99
- console.log(`${idx} ${chalk_1.default.green('▶ START')} task=${evt.task_id || '?'} ${evt.continuation ? chalk_1.default.dim(`(continuation #${evt.continuation})`) : ''}`);
95
+ console.log(`${idx} ${chalk.green('▶ START')} task=${evt.task_id || '?'} ${evt.continuation ? chalk.dim(`(continuation #${evt.continuation})`) : ''}`);
100
96
  break;
101
97
  case 'thinking':
102
- console.log(`${idx} ${chalk_1.default.dim('💭 thinking')} ${(evt.content || '').substring(0, 100)}`);
98
+ console.log(`${idx} ${chalk.dim('💭 thinking')} ${(evt.content || '').substring(0, 100)}`);
103
99
  break;
104
100
  case 'plan':
105
101
  const taskCount = evt.tasks?.length || 0;
106
- console.log(`${idx} ${chalk_1.default.magenta('📋 PLAN')} ${taskCount} tasks`);
102
+ console.log(`${idx} ${chalk.magenta('📋 PLAN')} ${taskCount} tasks`);
107
103
  if (evt.tasks) {
108
104
  for (const t of evt.tasks.slice(0, 5)) {
109
- console.log(` ${chalk_1.default.dim('├')} ${t.id || '?'}: ${(t.title || '').substring(0, 60)}`);
105
+ console.log(` ${chalk.dim('├')} ${t.id || '?'}: ${(t.title || '').substring(0, 60)}`);
110
106
  }
111
107
  if (taskCount > 5)
112
- console.log(` ${chalk_1.default.dim('└')} ...and ${taskCount - 5} more`);
108
+ console.log(` ${chalk.dim('└')} ...and ${taskCount - 5} more`);
113
109
  }
114
110
  break;
115
111
  case 'tool_call':
116
112
  toolCallNum++;
117
- console.log(`${idx} ${chalk_1.default.yellow(`🔧 tool_call #${toolCallNum}`)} ${chalk_1.default.bold(evt.name || '?')}(${JSON.stringify(evt.arguments || {}).substring(0, 80)})`);
113
+ console.log(`${idx} ${chalk.yellow(`🔧 tool_call #${toolCallNum}`)} ${chalk.bold(evt.name || '?')}(${JSON.stringify(evt.arguments || {}).substring(0, 80)})`);
118
114
  break;
119
115
  case 'tool_result': {
120
116
  const success = evt.success !== false;
121
- const icon = success ? chalk_1.default.green('✓') : chalk_1.default.red('✗');
117
+ const icon = success ? chalk.green('✓') : chalk.red('✗');
122
118
  const output = (evt.output || '').substring(0, 120);
123
- console.log(`${idx} ${icon} ${evt.name || '?'}: ${chalk_1.default.dim(output)}`);
119
+ console.log(`${idx} ${icon} ${evt.name || '?'}: ${chalk.dim(output)}`);
124
120
  break;
125
121
  }
126
122
  case 'message':
127
- console.log(`${idx} ${chalk_1.default.cyan('💬 message')} ${(evt.content || '').substring(0, 120)}`);
123
+ console.log(`${idx} ${chalk.cyan('💬 message')} ${(evt.content || '').substring(0, 120)}`);
128
124
  break;
129
125
  case 'complete': {
130
126
  const summary = (evt.summary || '').substring(0, 200);
131
127
  const seal = evt.seal_score ? ` [${evt.seal_score.tier} ${evt.seal_score.overall}]` : '';
132
- console.log(`${idx} ${chalk_1.default.green(`✅ COMPLETE`)}${chalk_1.default.yellow(seal)} ${evt.iterations || '?'} iterations, ${evt.tool_calls || '?'} tool calls`);
128
+ console.log(`${idx} ${chalk.green(`✅ COMPLETE`)}${chalk.yellow(seal)} ${evt.iterations || '?'} iterations, ${evt.tool_calls || '?'} tool calls`);
133
129
  if (summary)
134
- console.log(` ${chalk_1.default.dim(summary)}`);
130
+ console.log(` ${chalk.dim(summary)}`);
135
131
  break;
136
132
  }
137
133
  case 'error':
138
- console.log(`${idx} ${chalk_1.default.red('❌ ERROR')} ${(evt.message || '').substring(0, 200)}`);
134
+ console.log(`${idx} ${chalk.red('❌ ERROR')} ${(evt.message || '').substring(0, 200)}`);
139
135
  if (evt.checkpointed)
140
- console.log(` ${chalk_1.default.yellow('Checkpointed — can be continued or forked')}`);
136
+ console.log(` ${chalk.yellow('Checkpointed — can be continued or forked')}`);
141
137
  break;
142
138
  case 'file_mutation':
143
- console.log(`${idx} ${chalk_1.default.blue('📁 file_mutation')} ${evt.kind || '?'} ${evt.path || '?'}`);
139
+ console.log(`${idx} ${chalk.blue('📁 file_mutation')} ${evt.kind || '?'} ${evt.path || '?'}`);
144
140
  break;
145
141
  default:
146
- console.log(`${idx} ${chalk_1.default.dim(type)} ${JSON.stringify(evt).substring(0, 100)}`);
142
+ console.log(`${idx} ${chalk.dim(type)} ${JSON.stringify(evt).substring(0, 100)}`);
147
143
  }
148
144
  // Delay between events for replay effect
149
145
  if (i < data.events.length - 1) {
150
146
  await this.sleep(speed);
151
147
  }
152
148
  }
153
- console.log(chalk_1.default.bold(`\n${logger_js_1.CH.success} Replay complete (${data.count} events)\n`));
149
+ console.log(chalk.bold(`\n${CH.success} Replay complete (${data.count} events)\n`));
154
150
  }
155
151
  catch (err) {
156
152
  spinner.stop();
@@ -158,4 +154,3 @@ class ReplayCommand {
158
154
  }
159
155
  }
160
156
  }
161
- exports.ReplayCommand = ReplayCommand;