vigthoria-cli 1.10.36 → 1.10.47

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 (62) hide show
  1. package/dist/commands/agent-session-menu.d.ts +19 -0
  2. package/dist/commands/agent-session-menu.js +155 -0
  3. package/dist/commands/auth.js +68 -51
  4. package/dist/commands/bridge.js +19 -12
  5. package/dist/commands/cancel.js +22 -15
  6. package/dist/commands/chat.d.ts +0 -22
  7. package/dist/commands/chat.js +402 -1084
  8. package/dist/commands/config.js +73 -33
  9. package/dist/commands/deploy.js +123 -83
  10. package/dist/commands/device.js +61 -21
  11. package/dist/commands/edit.js +39 -32
  12. package/dist/commands/explain.js +25 -18
  13. package/dist/commands/generate.js +44 -37
  14. package/dist/commands/hub.js +102 -95
  15. package/dist/commands/index.js +46 -41
  16. package/dist/commands/legion.js +186 -146
  17. package/dist/commands/review.js +36 -29
  18. package/dist/commands/security.js +12 -5
  19. package/dist/commands/wallet.js +35 -28
  20. package/dist/commands/workflow.js +20 -13
  21. package/dist/utils/brain-hub-client.d.ts +32 -0
  22. package/dist/utils/brain-hub-client.js +52 -0
  23. package/dist/utils/bridge-client.js +52 -11
  24. package/dist/utils/codebase-indexer.d.ts +59 -0
  25. package/dist/utils/codebase-indexer.js +351 -0
  26. package/dist/utils/context-ranker.js +21 -15
  27. package/dist/utils/files.js +42 -5
  28. package/dist/utils/logger.js +50 -42
  29. package/dist/utils/persona.js +8 -3
  30. package/dist/utils/post-write-validator.js +29 -22
  31. package/dist/utils/project-memory.js +23 -16
  32. package/dist/utils/task-display.js +20 -13
  33. package/dist/utils/workspace-brain-service.d.ts +43 -0
  34. package/dist/utils/workspace-brain-service.js +158 -0
  35. package/dist/utils/workspace-cache.js +26 -18
  36. package/dist/utils/workspace-stream.js +63 -21
  37. package/package.json +3 -6
  38. package/scripts/release/validate-no-go-gates.sh +1 -1
  39. package/dist/commands/fork.d.ts +0 -17
  40. package/dist/commands/fork.js +0 -164
  41. package/dist/commands/history.d.ts +0 -17
  42. package/dist/commands/history.js +0 -113
  43. package/dist/commands/preview.d.ts +0 -55
  44. package/dist/commands/preview.js +0 -467
  45. package/dist/commands/replay.d.ts +0 -18
  46. package/dist/commands/replay.js +0 -156
  47. package/dist/commands/repo.d.ts +0 -97
  48. package/dist/commands/repo.js +0 -773
  49. package/dist/commands/update.d.ts +0 -9
  50. package/dist/commands/update.js +0 -201
  51. package/dist/index.d.ts +0 -21
  52. package/dist/index.js +0 -1823
  53. package/dist/utils/api.d.ts +0 -572
  54. package/dist/utils/api.js +0 -6548
  55. package/dist/utils/cli-state.d.ts +0 -54
  56. package/dist/utils/cli-state.js +0 -185
  57. package/dist/utils/config.d.ts +0 -85
  58. package/dist/utils/config.js +0 -267
  59. package/dist/utils/session.d.ts +0 -118
  60. package/dist/utils/session.js +0 -423
  61. package/dist/utils/tools.d.ts +0 -274
  62. package/dist/utils/tools.js +0 -3502
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  /**
2
3
  * Vigthoria CLI - Legion Parallel Orchestration
3
4
  *
@@ -8,14 +9,52 @@
8
9
  * vigthoria legion --workers List available Legion workers
9
10
  * vigthoria legion --status Show Legion infrastructure status
10
11
  */
11
- import chalk from 'chalk';
12
- import * as fs from 'fs';
13
- import * as path from 'path';
14
- import * as readline from 'readline/promises';
15
- import { exec as execCallback } from 'node:child_process';
16
- import { promisify } from 'node:util';
17
- import { createSpinner, CH } from '../utils/logger.js';
18
- import { describeUpstreamStatus, isServerRuntime, propagateError } from '../utils/api.js';
12
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ var desc = Object.getOwnPropertyDescriptor(m, k);
15
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
16
+ desc = { enumerable: true, get: function() { return m[k]; } };
17
+ }
18
+ Object.defineProperty(o, k2, desc);
19
+ }) : (function(o, m, k, k2) {
20
+ if (k2 === undefined) k2 = k;
21
+ o[k2] = m[k];
22
+ }));
23
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
24
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
25
+ }) : function(o, v) {
26
+ o["default"] = v;
27
+ });
28
+ var __importStar = (this && this.__importStar) || (function () {
29
+ var ownKeys = function(o) {
30
+ ownKeys = Object.getOwnPropertyNames || function (o) {
31
+ var ar = [];
32
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
33
+ return ar;
34
+ };
35
+ return ownKeys(o);
36
+ };
37
+ return function (mod) {
38
+ if (mod && mod.__esModule) return mod;
39
+ var result = {};
40
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
41
+ __setModuleDefault(result, mod);
42
+ return result;
43
+ };
44
+ })();
45
+ var __importDefault = (this && this.__importDefault) || function (mod) {
46
+ return (mod && mod.__esModule) ? mod : { "default": mod };
47
+ };
48
+ Object.defineProperty(exports, "__esModule", { value: true });
49
+ exports.LegionCommand = void 0;
50
+ const chalk_1 = __importDefault(require("chalk"));
51
+ const fs = __importStar(require("fs"));
52
+ const path = __importStar(require("path"));
53
+ const readline = __importStar(require("readline/promises"));
54
+ const node_child_process_1 = require("node:child_process");
55
+ const node_util_1 = require("node:util");
56
+ const logger_js_1 = require("../utils/logger.js");
57
+ const api_js_1 = require("../utils/api.js");
19
58
  // Hyper Loop / Legion runs on the Vigthoria backend only. Local user installs
20
59
  // must never even attempt these endpoints, because fetch errors include the
21
60
  // URL we tried (would leak internal infra to the user's terminal).
@@ -31,15 +70,15 @@ function buildServerHyperloopUrls() {
31
70
  `http://${internalHost}:${port}${apiPath}`,
32
71
  ];
33
72
  }
34
- const HYPERLOOP_URLS = isServerRuntime()
73
+ const HYPERLOOP_URLS = (0, api_js_1.isServerRuntime)()
35
74
  ? buildServerHyperloopUrls()
36
75
  : (process.env.VIGTHORIA_HYPERLOOP_URL ? [process.env.VIGTHORIA_HYPERLOOP_URL] : []);
37
76
  const CORTEX_WARN_BUDGET_USD = 3.5;
38
77
  const CORTEX_HARD_BUDGET_USD = 5.0;
39
78
  const CORTEX_MAX_ROUNDS = 2;
40
79
  const CORTEX_PLATFORM_FEE_PCT = 10;
41
- const execAsync = promisify(execCallback);
42
- export class LegionCommand {
80
+ const execAsync = (0, node_util_1.promisify)(node_child_process_1.exec);
81
+ class LegionCommand {
43
82
  config;
44
83
  logger;
45
84
  constructor(config, logger) {
@@ -56,7 +95,7 @@ export class LegionCommand {
56
95
  if (envUrl) {
57
96
  urls.add(envUrl);
58
97
  }
59
- if (isServerRuntime()) {
98
+ if ((0, api_js_1.isServerRuntime)()) {
60
99
  for (const internal of buildServerHyperloopUrls()) {
61
100
  urls.add(internal.replace(/\/$/, ''));
62
101
  }
@@ -81,7 +120,7 @@ export class LegionCommand {
81
120
  return await response.json();
82
121
  }
83
122
  catch (err) {
84
- propagateError({
123
+ (0, api_js_1.propagateError)({
85
124
  ...((err && typeof err === 'object') ? err : { message: String(err) }),
86
125
  message: `${context} returned invalid JSON: ${err?.message || String(err)}`,
87
126
  statusCode: response.status,
@@ -99,7 +138,7 @@ export class LegionCommand {
99
138
  }
100
139
  propagateLegionApiError(context, endpoint, err) {
101
140
  const original = err && typeof err === 'object' ? err : { message: String(err) };
102
- propagateError({
141
+ (0, api_js_1.propagateError)({
103
142
  ...original,
104
143
  commandName: 'legion',
105
144
  endpoint: original.endpoint || original?.config?.url || original?.details?.endpoint || endpoint || context,
@@ -125,27 +164,27 @@ export class LegionCommand {
125
164
  return;
126
165
  }
127
166
  if (!request) {
128
- console.log(chalk.yellow('Usage: vigthoria legion "<task description>"'));
129
- console.log(chalk.gray(' --workers List available Legion workers'));
130
- console.log(chalk.gray(' --status Show Legion infrastructure status'));
131
- console.log(chalk.gray(' --cortex Vigthoria Cortex: maximum intelligence execution'));
167
+ console.log(chalk_1.default.yellow('Usage: vigthoria legion "<task description>"'));
168
+ console.log(chalk_1.default.gray(' --workers List available Legion workers'));
169
+ console.log(chalk_1.default.gray(' --status Show Legion infrastructure status'));
170
+ console.log(chalk_1.default.gray(' --cortex Vigthoria Cortex: maximum intelligence execution'));
132
171
  return;
133
172
  }
134
173
  await this.planAndExecute(request, options);
135
174
  }
136
175
  async runCortex(request, options) {
137
176
  if (!request) {
138
- console.log(chalk.yellow('Usage: vigthoria legion --cortex "<task description>"'));
139
- console.log(chalk.gray(' --plan-only Run calculator only (no execution)'));
140
- console.log(chalk.gray(' --force-budget Allow execution above hard safe-stop budget'));
141
- console.log(chalk.gray(' --ignore-preflight Bypass mandatory preflight checks (no warranty)'));
142
- console.log(chalk.gray(' --speed Speed mode: optional role skip on convergence'));
143
- console.log(chalk.gray(' --tier heavy|lite Model tier: heavy=strongest LLMs (default), lite=efficient+affordable'));
144
- console.log(chalk.gray(' --repro-cmd <cmd> Run a local reproducibility command before spend'));
145
- console.log(chalk.gray(' --expect-repro-fail Require repro command to fail before execution'));
146
- console.log(chalk.gray(' --approve Skip initial confirmation prompt and execute'));
147
- console.log(chalk.gray(' --auto-charge Attempt direct VigCoin top-up when balance is low'));
148
- console.log(chalk.gray(' --timeout <sec> Abort remote execution if no result within timeout (default: 120)'));
177
+ console.log(chalk_1.default.yellow('Usage: vigthoria legion --cortex "<task description>"'));
178
+ console.log(chalk_1.default.gray(' --plan-only Run calculator only (no execution)'));
179
+ console.log(chalk_1.default.gray(' --force-budget Allow execution above hard safe-stop budget'));
180
+ console.log(chalk_1.default.gray(' --ignore-preflight Bypass mandatory preflight checks (no warranty)'));
181
+ console.log(chalk_1.default.gray(' --speed Speed mode: optional role skip on convergence'));
182
+ console.log(chalk_1.default.gray(' --tier heavy|lite Model tier: heavy=strongest LLMs (default), lite=efficient+affordable'));
183
+ console.log(chalk_1.default.gray(' --repro-cmd <cmd> Run a local reproducibility command before spend'));
184
+ console.log(chalk_1.default.gray(' --expect-repro-fail Require repro command to fail before execution'));
185
+ console.log(chalk_1.default.gray(' --approve Skip initial confirmation prompt and execute'));
186
+ console.log(chalk_1.default.gray(' --auto-charge Attempt direct VigCoin top-up when balance is low'));
187
+ console.log(chalk_1.default.gray(' --timeout <sec> Abort remote execution if no result within timeout (default: 120)'));
149
188
  return;
150
189
  }
151
190
  const workspace = options.project || process.cwd();
@@ -153,38 +192,38 @@ export class LegionCommand {
153
192
  if (!options.ignorePreflight) {
154
193
  const preflight = await this.runMandatoryPreflight(workspace, options.reproCmd, options.expectReproFail === true);
155
194
  if (!preflight.ok) {
156
- console.log(chalk.red('Cortex preflight failed.'));
157
- console.log(chalk.red(` ${preflight.reason}`));
158
- console.log(chalk.yellow('Execution halted before any cloud spend. Use --ignore-preflight to override (no warranty).'));
195
+ console.log(chalk_1.default.red('Cortex preflight failed.'));
196
+ console.log(chalk_1.default.red(` ${preflight.reason}`));
197
+ console.log(chalk_1.default.yellow('Execution halted before any cloud spend. Use --ignore-preflight to override (no warranty).'));
159
198
  return;
160
199
  }
161
- console.log(chalk.green('Preflight passed.'));
200
+ console.log(chalk_1.default.green('Preflight passed.'));
162
201
  }
163
202
  else {
164
- console.log(chalk.yellow('Preflight bypassed by --ignore-preflight (no warranty).'));
203
+ console.log(chalk_1.default.yellow('Preflight bypassed by --ignore-preflight (no warranty).'));
165
204
  }
166
205
  const tier = (options.tier === 'lite') ? 'lite' : 'heavy';
167
206
  const selectedModels = this.resolveModelProfiles(options.models, tier);
168
207
  const quote = this.buildRoleQuote(scan, selectedModels, tier);
169
208
  const billingQuote = this.buildBillingQuote(quote, tier);
170
209
  if (billingQuote.retryAdjustedUsd > CORTEX_WARN_BUDGET_USD) {
171
- console.log(chalk.yellow(`Estimated spend exceeds warning threshold ($${CORTEX_WARN_BUDGET_USD.toFixed(2)}).`));
210
+ console.log(chalk_1.default.yellow(`Estimated spend exceeds warning threshold ($${CORTEX_WARN_BUDGET_USD.toFixed(2)}).`));
172
211
  }
173
212
  let billingGate = await this.evaluateBillingGate(billingQuote);
174
213
  this.printCortexQuote(workspace, scan, quote, billingQuote, billingGate);
175
214
  if (billingQuote.retryAdjustedUsd > CORTEX_HARD_BUDGET_USD && !options.forceBudget && !billingGate.masterAdminFree) {
176
- console.log(chalk.red(`Estimated spend exceeds hard budget ceiling (${CORTEX_HARD_BUDGET_USD.toFixed(2)}).`));
177
- console.log(chalk.yellow('Re-run with --force-budget to continue.'));
215
+ console.log(chalk_1.default.red(`Estimated spend exceeds hard budget ceiling (${CORTEX_HARD_BUDGET_USD.toFixed(2)}).`));
216
+ console.log(chalk_1.default.yellow('Re-run with --force-budget to continue.'));
178
217
  return;
179
218
  }
180
219
  if (options.planOnly) {
181
- console.log(chalk.green('Cortex estimator complete (plan-only).'));
220
+ console.log(chalk_1.default.green('Cortex estimator complete (plan-only).'));
182
221
  return;
183
222
  }
184
223
  const autoApprove = options.approve === true && options.noApprove !== true;
185
224
  const approved = autoApprove ? true : await this.confirmExecution();
186
225
  if (!approved) {
187
- console.log(chalk.yellow('Cortex cancelled by user.'));
226
+ console.log(chalk_1.default.yellow('Cortex cancelled by user.'));
188
227
  return;
189
228
  }
190
229
  let round = 1;
@@ -195,19 +234,19 @@ export class LegionCommand {
195
234
  if (!billingGate.canProceed) {
196
235
  const resolved = await this.resolveBillingInsufficientFunds(currentQuote, billingGate, options);
197
236
  if (!resolved) {
198
- console.log(chalk.yellow('Cortex cancelled due to insufficient VigCoin balance.'));
237
+ console.log(chalk_1.default.yellow('Cortex cancelled due to insufficient VigCoin balance.'));
199
238
  return;
200
239
  }
201
240
  billingGate = await this.evaluateBillingGate(currentQuote);
202
241
  if (!billingGate.canProceed) {
203
242
  this.printBillingGateSummary(currentQuote, billingGate);
204
- console.log(chalk.red('Billing gate still blocked after charge attempt.'));
243
+ console.log(chalk_1.default.red('Billing gate still blocked after charge attempt.'));
205
244
  return;
206
245
  }
207
246
  }
208
247
  const charged = await this.collectExecutionCharge(currentQuote, billingGate);
209
248
  if (!charged) {
210
- console.log(chalk.yellow('Cortex cancelled because wallet charge was not completed.'));
249
+ console.log(chalk_1.default.yellow('Cortex cancelled because wallet charge was not completed.'));
211
250
  return;
212
251
  }
213
252
  cumulativeUsd += currentQuote.finalUsd;
@@ -234,27 +273,27 @@ export class LegionCommand {
234
273
  }
235
274
  const failedRole = String(execution.failedStepId || '').toLowerCase();
236
275
  if (this.isCriticalRoleFailure(failedRole)) {
237
- console.log(chalk.red(`Fail-fast: critical role '${failedRole || 'unknown'}' failed. Manual correction required.`));
276
+ console.log(chalk_1.default.red(`Fail-fast: critical role '${failedRole || 'unknown'}' failed. Manual correction required.`));
238
277
  return;
239
278
  }
240
279
  if (!this.isOptionalRepairRoleFailure(failedRole)) {
241
- console.log(chalk.red('Execution failed and is not eligible for automatic optional-role repair.'));
280
+ console.log(chalk_1.default.red('Execution failed and is not eligible for automatic optional-role repair.'));
242
281
  return;
243
282
  }
244
283
  if (round >= CORTEX_MAX_ROUNDS) {
245
- console.log(chalk.red('Optional-role auto-repair budget exhausted.'));
284
+ console.log(chalk_1.default.red('Optional-role auto-repair budget exhausted.'));
246
285
  return;
247
286
  }
248
287
  const nextQuote = this.estimateAdditionalLoopQuote(currentQuote, execution);
249
288
  const projectedTotal = cumulativeUsd + nextQuote.retryAdjustedUsd;
250
289
  if (projectedTotal > CORTEX_HARD_BUDGET_USD && !options.forceBudget) {
251
- console.log(chalk.red(`Additional loop would exceed hard budget ceiling ($${CORTEX_HARD_BUDGET_USD.toFixed(2)}).`));
252
- console.log(chalk.yellow('Re-run with --force-budget to allow paid continuation.'));
290
+ console.log(chalk_1.default.red(`Additional loop would exceed hard budget ceiling ($${CORTEX_HARD_BUDGET_USD.toFixed(2)}).`));
291
+ console.log(chalk_1.default.yellow('Re-run with --force-budget to allow paid continuation.'));
253
292
  return;
254
293
  }
255
294
  const continueApproved = await this.confirmAdditionalLoopCharge(nextQuote, round + 1, execution);
256
295
  if (!continueApproved) {
257
- console.log(chalk.yellow('Termination: user declined additional budget for next round.'));
296
+ console.log(chalk_1.default.yellow('Termination: user declined additional budget for next round.'));
258
297
  return;
259
298
  }
260
299
  currentQuote = nextQuote;
@@ -297,10 +336,10 @@ export class LegionCommand {
297
336
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
298
337
  try {
299
338
  console.log();
300
- console.log(chalk.yellow('Budget depleted for current round. Additional paid loop required.'));
301
- console.log(chalk.gray(` Next round: ${nextRound}`));
302
- console.log(chalk.gray(` Failed step: ${execution.failedStepId || 'unknown'} (${execution.failedWorker || 'unknown'})`));
303
- console.log(chalk.gray(` Additional estimate: $${nextQuote.finalUsd.toFixed(4)} / ${nextQuote.vigcoinRequired.toFixed(3)} VIG`));
339
+ console.log(chalk_1.default.yellow('Budget depleted for current round. Additional paid loop required.'));
340
+ console.log(chalk_1.default.gray(` Next round: ${nextRound}`));
341
+ console.log(chalk_1.default.gray(` Failed step: ${execution.failedStepId || 'unknown'} (${execution.failedWorker || 'unknown'})`));
342
+ console.log(chalk_1.default.gray(` Additional estimate: $${nextQuote.finalUsd.toFixed(4)} / ${nextQuote.vigcoinRequired.toFixed(3)} VIG`));
304
343
  const answer = (await rl.question('Confirm additional VigCoin deduction and continue? (y/N): ')).trim().toLowerCase();
305
344
  return answer === 'y' || answer === 'yes';
306
345
  }
@@ -962,42 +1001,42 @@ export class LegionCommand {
962
1001
  if (gate.masterAdminFree) {
963
1002
  return true;
964
1003
  }
965
- const spinner = createSpinner('Charging VigCoin wallet for Cortex execution...').start();
1004
+ const spinner = (0, logger_js_1.createSpinner)('Charging VigCoin wallet for Cortex execution...').start();
966
1005
  const result = await this.attemptDirectCharge(billingQuote.vigcoinRequired);
967
1006
  spinner.stop();
968
1007
  if (!result.ok) {
969
- console.log(chalk.red(result.note || 'Wallet charge failed.'));
970
- console.log(chalk.yellow(`Complete purchase first: ${result.checkoutUrl || `${this.getBillingBaseUrl()}/music/store#vigcoins`}`));
1008
+ console.log(chalk_1.default.red(result.note || 'Wallet charge failed.'));
1009
+ console.log(chalk_1.default.yellow(`Complete purchase first: ${result.checkoutUrl || `${this.getBillingBaseUrl()}/music/store#vigcoins`}`));
971
1010
  return false;
972
1011
  }
973
- console.log(chalk.green('Wallet charged for Cortex execution.'));
1012
+ console.log(chalk_1.default.green('Wallet charged for Cortex execution.'));
974
1013
  return true;
975
1014
  }
976
1015
  async resolveBillingInsufficientFunds(billingQuote, gate, options) {
977
1016
  this.printBillingGateSummary(billingQuote, gate);
978
1017
  if (!gate.wallet.available) {
979
- console.log(chalk.red('Unable to verify wallet balance from server. Execution is blocked.'));
1018
+ console.log(chalk_1.default.red('Unable to verify wallet balance from server. Execution is blocked.'));
980
1019
  if (gate.wallet.purchaseUrl) {
981
- console.log(chalk.gray(`Open billing portal: ${gate.wallet.purchaseUrl}`));
1020
+ console.log(chalk_1.default.gray(`Open billing portal: ${gate.wallet.purchaseUrl}`));
982
1021
  }
983
1022
  return false;
984
1023
  }
985
1024
  if (options.autoCharge) {
986
- const spinner = createSpinner('Attempting direct wallet charge...').start();
1025
+ const spinner = (0, logger_js_1.createSpinner)('Attempting direct wallet charge...').start();
987
1026
  const result = await this.attemptDirectCharge(billingQuote.vigcoinRequired - (gate.wallet.vigcoinBalance || 0));
988
1027
  spinner.stop();
989
1028
  if (result.ok) {
990
- console.log(chalk.green('Direct charge succeeded. Re-checking wallet balance...'));
1029
+ console.log(chalk_1.default.green('Direct charge succeeded. Re-checking wallet balance...'));
991
1030
  return true;
992
1031
  }
993
- console.log(chalk.yellow(result.note || 'Direct charge did not complete.'));
994
- console.log(chalk.yellow(`Complete purchase first: ${result.checkoutUrl || gate.wallet.purchaseUrl || `${this.getBillingBaseUrl()}/billing`}`));
1032
+ console.log(chalk_1.default.yellow(result.note || 'Direct charge did not complete.'));
1033
+ console.log(chalk_1.default.yellow(`Complete purchase first: ${result.checkoutUrl || gate.wallet.purchaseUrl || `${this.getBillingBaseUrl()}/billing`}`));
995
1034
  return false;
996
1035
  }
997
1036
  if (!process.stdin.isTTY || !process.stdout.isTTY) {
998
- console.log(chalk.yellow('Low balance detected in non-interactive mode. Re-run with --auto-charge or top up first.'));
1037
+ console.log(chalk_1.default.yellow('Low balance detected in non-interactive mode. Re-run with --auto-charge or top up first.'));
999
1038
  if (gate.wallet.purchaseUrl) {
1000
- console.log(chalk.gray(`Billing portal: ${gate.wallet.purchaseUrl}`));
1039
+ console.log(chalk_1.default.gray(`Billing portal: ${gate.wallet.purchaseUrl}`));
1001
1040
  }
1002
1041
  return false;
1003
1042
  }
@@ -1005,19 +1044,19 @@ export class LegionCommand {
1005
1044
  try {
1006
1045
  const answer = (await rl.question('VigCoin low. Choose action: [c]harge now, [p]urchase first, [n] cancel: ')).trim().toLowerCase();
1007
1046
  if (answer === 'c' || answer === 'charge') {
1008
- const spinner = createSpinner('Attempting direct wallet charge...').start();
1047
+ const spinner = (0, logger_js_1.createSpinner)('Attempting direct wallet charge...').start();
1009
1048
  const result = await this.attemptDirectCharge(billingQuote.vigcoinRequired - (gate.wallet.vigcoinBalance || 0));
1010
1049
  spinner.stop();
1011
1050
  if (result.ok) {
1012
- console.log(chalk.green('Direct charge succeeded. Re-checking wallet balance...'));
1051
+ console.log(chalk_1.default.green('Direct charge succeeded. Re-checking wallet balance...'));
1013
1052
  return true;
1014
1053
  }
1015
- console.log(chalk.yellow(result.note || 'Direct charge did not complete.'));
1016
- console.log(chalk.yellow(`Complete purchase first: ${result.checkoutUrl || gate.wallet.purchaseUrl || `${this.getBillingBaseUrl()}/billing`}`));
1054
+ console.log(chalk_1.default.yellow(result.note || 'Direct charge did not complete.'));
1055
+ console.log(chalk_1.default.yellow(`Complete purchase first: ${result.checkoutUrl || gate.wallet.purchaseUrl || `${this.getBillingBaseUrl()}/billing`}`));
1017
1056
  return false;
1018
1057
  }
1019
1058
  if (answer === 'p' || answer === 'purchase') {
1020
- console.log(chalk.yellow(`Purchase VigCoin first: ${gate.wallet.purchaseUrl || `${this.getBillingBaseUrl()}/billing`}`));
1059
+ console.log(chalk_1.default.yellow(`Purchase VigCoin first: ${gate.wallet.purchaseUrl || `${this.getBillingBaseUrl()}/billing`}`));
1021
1060
  return false;
1022
1061
  }
1023
1062
  return false;
@@ -1027,68 +1066,68 @@ export class LegionCommand {
1027
1066
  }
1028
1067
  }
1029
1068
  printBillingGateSummary(billingQuote, gate) {
1030
- console.log(chalk.white(' Billing gate:'));
1031
- console.log(chalk.gray(` Plan: ${gate.plan}`));
1069
+ console.log(chalk_1.default.white(' Billing gate:'));
1070
+ console.log(chalk_1.default.gray(` Plan: ${gate.plan}`));
1032
1071
  if (gate.masterAdminFree) {
1033
- console.log(chalk.green(' Free tier override applied (Master Admin).'));
1072
+ console.log(chalk_1.default.green(' Free tier override applied (Master Admin).'));
1034
1073
  return;
1035
1074
  }
1036
- console.log(chalk.gray(` Estimated total (USD): $${billingQuote.retryAdjustedUsd.toFixed(4)}`) + chalk.gray(' (retry-adjusted expected)'));
1037
- console.log(chalk.gray(` Platform fee: +${billingQuote.platformFeePct.toFixed(0)}% (already included in all estimates)`));
1038
- console.log(chalk.gray(` VigCoin rate: 1 VIG = $${billingQuote.vigcoinRateUsd.toFixed(4)}`));
1039
- console.log(chalk.gray(` VigCoin required: ${billingQuote.vigcoinRequired.toFixed(3)}`));
1075
+ console.log(chalk_1.default.gray(` Estimated total (USD): $${billingQuote.retryAdjustedUsd.toFixed(4)}`) + chalk_1.default.gray(' (retry-adjusted expected)'));
1076
+ console.log(chalk_1.default.gray(` Platform fee: +${billingQuote.platformFeePct.toFixed(0)}% (already included in all estimates)`));
1077
+ console.log(chalk_1.default.gray(` VigCoin rate: 1 VIG = $${billingQuote.vigcoinRateUsd.toFixed(4)}`));
1078
+ console.log(chalk_1.default.gray(` VigCoin required: ${billingQuote.vigcoinRequired.toFixed(3)}`));
1040
1079
  if (gate.wallet.vigcoinBalance !== null) {
1041
- const color = gate.wallet.vigcoinBalance >= billingQuote.vigcoinRequired ? chalk.green : chalk.red;
1042
- console.log(chalk.gray(' Wallet balance: ') + color(gate.wallet.vigcoinBalance.toFixed(3)) + (gate.wallet.source ? chalk.gray(` (source: ${gate.wallet.source})`) : ''));
1080
+ const color = gate.wallet.vigcoinBalance >= billingQuote.vigcoinRequired ? chalk_1.default.green : chalk_1.default.red;
1081
+ console.log(chalk_1.default.gray(' Wallet balance: ') + color(gate.wallet.vigcoinBalance.toFixed(3)) + (gate.wallet.source ? chalk_1.default.gray(` (source: ${gate.wallet.source})`) : ''));
1043
1082
  }
1044
1083
  else {
1045
- console.log(chalk.red(` Wallet balance: unavailable${gate.wallet.error ? ` (${gate.wallet.error})` : ''}`));
1084
+ console.log(chalk_1.default.red(` Wallet balance: unavailable${gate.wallet.error ? ` (${gate.wallet.error})` : ''}`));
1046
1085
  }
1047
1086
  if (gate.wallet.purchaseUrl) {
1048
- console.log(chalk.gray(` Purchase URL: ${gate.wallet.purchaseUrl}`));
1087
+ console.log(chalk_1.default.gray(` Purchase URL: ${gate.wallet.purchaseUrl}`));
1049
1088
  }
1050
1089
  }
1051
1090
  printCortexQuote(workspace, scan, quote, billingQuote, gate) {
1052
1091
  const tierLabel = billingQuote.tier === 'lite'
1053
- ? chalk.cyan('LITE') + chalk.gray(' — efficient (claude-sonnet/haiku, o4-mini, gemini-flash, deepseek-v3)')
1054
- : chalk.magenta('HEAVY') + chalk.gray(' — strongest LLMs (gpt-5.5, opus-4.7, o3, gemini-2.5-pro)');
1092
+ ? chalk_1.default.cyan('LITE') + chalk_1.default.gray(' — efficient (claude-sonnet/haiku, o4-mini, gemini-flash, deepseek-v3)')
1093
+ : chalk_1.default.magenta('HEAVY') + chalk_1.default.gray(' — strongest LLMs (gpt-5.5, opus-4.7, o3, gemini-2.5-pro)');
1055
1094
  console.log();
1056
- console.log(chalk.bold.white(` ${CH.hLine.repeat(3)} Vigthoria Cortex Estimator ${CH.hLine.repeat(31)}`));
1095
+ console.log(chalk_1.default.bold.white(` ${logger_js_1.CH.hLine.repeat(3)} Vigthoria Cortex Estimator ${logger_js_1.CH.hLine.repeat(31)}`));
1057
1096
  console.log();
1058
- console.log(chalk.gray(' Workspace: ') + chalk.white(workspace));
1059
- console.log(chalk.gray(' Tier: ') + tierLabel);
1060
- console.log(chalk.gray(' Files scanned: ') + chalk.white(String(scan.files)));
1061
- console.log(chalk.gray(' Lines scanned: ') + chalk.white(String(scan.lines)));
1062
- console.log(chalk.gray(' Dependency edges: ') + chalk.white(String(scan.importEdges)));
1097
+ console.log(chalk_1.default.gray(' Workspace: ') + chalk_1.default.white(workspace));
1098
+ console.log(chalk_1.default.gray(' Tier: ') + tierLabel);
1099
+ console.log(chalk_1.default.gray(' Files scanned: ') + chalk_1.default.white(String(scan.files)));
1100
+ console.log(chalk_1.default.gray(' Lines scanned: ') + chalk_1.default.white(String(scan.lines)));
1101
+ console.log(chalk_1.default.gray(' Dependency edges: ') + chalk_1.default.white(String(scan.importEdges)));
1063
1102
  if (scan.topFiles.length > 0) {
1064
1103
  console.log();
1065
- console.log(chalk.white(' Top context files:'));
1104
+ console.log(chalk_1.default.white(' Top context files:'));
1066
1105
  for (const f of scan.topFiles) {
1067
- console.log(chalk.gray(` ${CH.bullet} ${f.file} (${f.lines} lines, ${f.imports} imports)`));
1106
+ console.log(chalk_1.default.gray(` ${logger_js_1.CH.bullet} ${f.file} (${f.lines} lines, ${f.imports} imports)`));
1068
1107
  }
1069
1108
  }
1070
1109
  console.log();
1071
- console.log(chalk.white(' Role assignment and estimated cost:'));
1110
+ console.log(chalk_1.default.white(' Role assignment and estimated cost:'));
1072
1111
  for (const row of quote) {
1073
1112
  const publicModelLabel = row.requestedModel || row.model.replace(/^openrouter:/i, '').split('/').pop() || 'managed-model';
1074
1113
  const roleEstWithFee = row.estCostUsd * (1 + (billingQuote.platformFeePct / 100));
1075
- console.log(chalk.gray(` ${CH.bullet} ${row.role.padEnd(11)} ${publicModelLabel} $${roleEstWithFee.toFixed(4)}`));
1114
+ console.log(chalk_1.default.gray(` ${logger_js_1.CH.bullet} ${row.role.padEnd(11)} ${publicModelLabel} $${roleEstWithFee.toFixed(4)}`));
1076
1115
  }
1077
1116
  console.log();
1078
- console.log(chalk.yellow(` Cost range (single-pass best case): $${billingQuote.rangeMinUsd.toFixed(4)}`));
1079
- console.log(chalk.yellow(` Cost range (expected with retries): $${billingQuote.retryAdjustedUsd.toFixed(4)}`) + chalk.gray(' ← use this for budget planning'));
1080
- console.log(chalk.yellow(` Cost range (worst case, all retries): $${billingQuote.rangeMaxUsd.toFixed(4)}`));
1081
- console.log(chalk.gray(' Retry model: 45% chance per critical role triggers quality-gate (+40% iterations per retry).'));
1082
- console.log(chalk.gray(' A mid-run checkpoint will appear when 70% of the expected estimate is consumed.'));
1083
- console.log(chalk.gray(' Flow: Estimate -> Isolation -> Parallel Attack -> Synthesis'));
1084
- console.log(chalk.gray(` All displayed costs include platform fee (+${billingQuote.platformFeePct.toFixed(0)}%).`));
1117
+ console.log(chalk_1.default.yellow(` Cost range (single-pass best case): $${billingQuote.rangeMinUsd.toFixed(4)}`));
1118
+ console.log(chalk_1.default.yellow(` Cost range (expected with retries): $${billingQuote.retryAdjustedUsd.toFixed(4)}`) + chalk_1.default.gray(' ← use this for budget planning'));
1119
+ console.log(chalk_1.default.yellow(` Cost range (worst case, all retries): $${billingQuote.rangeMaxUsd.toFixed(4)}`));
1120
+ console.log(chalk_1.default.gray(' Retry model: 45% chance per critical role triggers quality-gate (+40% iterations per retry).'));
1121
+ console.log(chalk_1.default.gray(' A mid-run checkpoint will appear when 70% of the expected estimate is consumed.'));
1122
+ console.log(chalk_1.default.gray(' Flow: Estimate -> Isolation -> Parallel Attack -> Synthesis'));
1123
+ console.log(chalk_1.default.gray(` All displayed costs include platform fee (+${billingQuote.platformFeePct.toFixed(0)}%).`));
1085
1124
  console.log();
1086
1125
  this.printBillingGateSummary(billingQuote, gate);
1087
1126
  console.log();
1088
1127
  }
1089
1128
  async confirmExecution() {
1090
1129
  if (!process.stdin.isTTY || !process.stdout.isTTY) {
1091
- console.log(chalk.yellow('Non-interactive terminal detected. Re-run with --approve to continue execution.'));
1130
+ console.log(chalk_1.default.yellow('Non-interactive terminal detected. Re-run with --approve to continue execution.'));
1092
1131
  return false;
1093
1132
  }
1094
1133
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
@@ -1147,7 +1186,7 @@ export class LegionCommand {
1147
1186
  headers['Cookie'] = `vigthoria-auth-token=${token}`;
1148
1187
  }
1149
1188
  }
1150
- const spinner = createSpinner('Connecting to Legion SSE stream...').start();
1189
+ const spinner = (0, logger_js_1.createSpinner)('Connecting to Legion SSE stream...').start();
1151
1190
  const startTime = Date.now();
1152
1191
  let response;
1153
1192
  try {
@@ -1165,7 +1204,7 @@ export class LegionCommand {
1165
1204
  if (!response.ok) {
1166
1205
  spinner.stop();
1167
1206
  const errBody = await response.text().catch(() => '');
1168
- this.logger.error(`Legion stream ${response.status}: ${describeUpstreamStatus(response.status)} — ${errBody.slice(0, 200)}`);
1207
+ this.logger.error(`Legion stream ${response.status}: ${(0, api_js_1.describeUpstreamStatus)(response.status)} — ${errBody.slice(0, 200)}`);
1169
1208
  return { status: 'failed', plannedSteps: 0, completedSteps: 0 };
1170
1209
  }
1171
1210
  if (!response.body) {
@@ -1175,7 +1214,7 @@ export class LegionCommand {
1175
1214
  }
1176
1215
  spinner.stop();
1177
1216
  console.log();
1178
- console.log(chalk.bold.white(` ${CH.hLine.repeat(3)} Legion Execution Report ${CH.hLine.repeat(34)}`));
1217
+ console.log(chalk_1.default.bold.white(` ${logger_js_1.CH.hLine.repeat(3)} Legion Execution Report ${logger_js_1.CH.hLine.repeat(34)}`));
1179
1218
  console.log();
1180
1219
  const decoder = new TextDecoder();
1181
1220
  let buffer = '';
@@ -1225,18 +1264,18 @@ export class LegionCommand {
1225
1264
  switch (evt.event) {
1226
1265
  case 'plan':
1227
1266
  stepsTotal = evt.steps_total || 0;
1228
- console.log(chalk.gray(` Planned workers: ${stepsTotal} steps queued`));
1267
+ console.log(chalk_1.default.gray(` Planned workers: ${stepsTotal} steps queued`));
1229
1268
  console.log();
1230
1269
  break;
1231
1270
  case 'batch_start':
1232
- console.log(chalk.gray(` ▶ Running: ${evt.workers.join(', ')} (${evt.steps_done}/${evt.steps_total})`));
1271
+ console.log(chalk_1.default.gray(` ▶ Running: ${evt.workers.join(', ')} (${evt.steps_done}/${evt.steps_total})`));
1233
1272
  break;
1234
1273
  case 'step_complete': {
1235
1274
  stepsDone = Number(evt.steps_done) || 0;
1236
- const icon = evt.status === 'completed' ? chalk.green(CH.success) : chalk.red(CH.error);
1275
+ const icon = evt.status === 'completed' ? chalk_1.default.green(logger_js_1.CH.success) : chalk_1.default.red(logger_js_1.CH.error);
1237
1276
  const stepSummaryRaw = String(evt.summary || '');
1238
- const summarySnip = stepSummaryRaw ? chalk.gray(` — ${stepSummaryRaw.slice(0, 120)}`) : '';
1239
- console.log(` ${icon} ${chalk.white(String(evt.step_id))} ${chalk.gray('[' + evt.worker + ']')}${summarySnip}`);
1277
+ const summarySnip = stepSummaryRaw ? chalk_1.default.gray(` — ${stepSummaryRaw.slice(0, 120)}`) : '';
1278
+ console.log(` ${icon} ${chalk_1.default.white(String(evt.step_id))} ${chalk_1.default.gray('[' + evt.worker + ']')}${summarySnip}`);
1240
1279
  if (evt.status !== 'completed' && !failedStepId) {
1241
1280
  failedStepId = String(evt.step_id || '');
1242
1281
  failedWorker = String(evt.worker || '');
@@ -1259,18 +1298,18 @@ export class LegionCommand {
1259
1298
  .filter((q) => remainingRoles.includes(q.role))
1260
1299
  .reduce((s, q) => s + (q.estCostUsd * (1 + CORTEX_PLATFORM_FEE_PCT / 100)), 0);
1261
1300
  console.log();
1262
- console.log(chalk.bold.yellow(' ━━━ Mid-Run Budget Checkpoint ━━━'));
1263
- console.log(chalk.gray(` Consumed so far (estimated): $${accumulatedEstUsd.toFixed(4)}`));
1264
- console.log(chalk.gray(` Estimated remaining: $${remainingEstUsd.toFixed(4)}`));
1301
+ console.log(chalk_1.default.bold.yellow(' ━━━ Mid-Run Budget Checkpoint ━━━'));
1302
+ console.log(chalk_1.default.gray(` Consumed so far (estimated): $${accumulatedEstUsd.toFixed(4)}`));
1303
+ console.log(chalk_1.default.gray(` Estimated remaining: $${remainingEstUsd.toFixed(4)}`));
1265
1304
  console.log();
1266
- console.log(chalk.white(' Roles completed:'));
1305
+ console.log(chalk_1.default.white(' Roles completed:'));
1267
1306
  for (const c of completedRoleSummaries) {
1268
- const roleIcon = c.status === 'completed' ? chalk.green('✔') : chalk.red('✘');
1307
+ const roleIcon = c.status === 'completed' ? chalk_1.default.green('✔') : chalk_1.default.red('✘');
1269
1308
  const roleSumSnip = c.summary ? ` — ${c.summary.slice(0, 100)}` : '';
1270
- console.log(chalk.gray(` ${roleIcon} ${c.role.padEnd(11)}${roleSumSnip}`));
1309
+ console.log(chalk_1.default.gray(` ${roleIcon} ${c.role.padEnd(11)}${roleSumSnip}`));
1271
1310
  }
1272
1311
  console.log();
1273
- console.log(chalk.white(' Remaining roles: ') + chalk.gray(remainingRoles.join(', ') || 'none'));
1312
+ console.log(chalk_1.default.white(' Remaining roles: ') + chalk_1.default.gray(remainingRoles.join(', ') || 'none'));
1274
1313
  console.log();
1275
1314
  const checkpointRl = readline.createInterface({ input: process.stdin, output: process.stdout });
1276
1315
  let continueRun = false;
@@ -1282,14 +1321,14 @@ export class LegionCommand {
1282
1321
  checkpointRl.close();
1283
1322
  }
1284
1323
  if (!continueRun) {
1285
- console.log(chalk.yellow(' Cortex stopped by user at budget checkpoint.'));
1286
- console.log(chalk.gray(` State: ${stepsDone} of ${stepsTotal} steps completed.`));
1324
+ console.log(chalk_1.default.yellow(' Cortex stopped by user at budget checkpoint.'));
1325
+ console.log(chalk_1.default.gray(` State: ${stepsDone} of ${stepsTotal} steps completed.`));
1287
1326
  finalStatus = 'failed';
1288
1327
  failedStepId = failedStepId || 'user_checkpoint_stop';
1289
1328
  // Break out of the for-of lines loop; the outer while(true) will end when reader.read() drains.
1290
1329
  break;
1291
1330
  }
1292
- console.log(chalk.green(' Continuing execution…'));
1331
+ console.log(chalk_1.default.green(' Continuing execution…'));
1293
1332
  console.log();
1294
1333
  }
1295
1334
  break;
@@ -1311,19 +1350,19 @@ export class LegionCommand {
1311
1350
  if (evt.status === 'completed') {
1312
1351
  finalStatus = 'completed';
1313
1352
  console.log();
1314
- console.log(chalk.green(` ${CH.success} Legion completed successfully`));
1353
+ console.log(chalk_1.default.green(` ${logger_js_1.CH.success} Legion completed successfully`));
1315
1354
  }
1316
1355
  else if (evt.status === 'failed') {
1317
1356
  finalStatus = 'failed';
1318
1357
  console.log();
1319
- console.log(chalk.red(` ${CH.error} Legion execution failed`));
1358
+ console.log(chalk_1.default.red(` ${logger_js_1.CH.error} Legion execution failed`));
1320
1359
  if (evt.error)
1321
- console.log(chalk.red(` Error: ${String(evt.error).slice(0, 300)}`));
1360
+ console.log(chalk_1.default.red(` Error: ${String(evt.error).slice(0, 300)}`));
1322
1361
  }
1323
1362
  break;
1324
1363
  case 'error':
1325
1364
  finalStatus = 'failed';
1326
- console.log(chalk.red(` ${CH.error} Stream error: ${String(evt.error).slice(0, 300)}`));
1365
+ console.log(chalk_1.default.red(` ${logger_js_1.CH.error} Stream error: ${String(evt.error).slice(0, 300)}`));
1327
1366
  break;
1328
1367
  }
1329
1368
  }
@@ -1335,16 +1374,16 @@ export class LegionCommand {
1335
1374
  }
1336
1375
  const elapsedSec = ((Date.now() - startTime) / 1000).toFixed(1);
1337
1376
  if (stepsTotal > 0 && stepsDone < stepsTotal) {
1338
- console.log(chalk.yellow(` ${CH.warn} Legion stream ended after ${stepsDone}/${stepsTotal} steps`));
1377
+ console.log(chalk_1.default.yellow(` ${logger_js_1.CH.warn} Legion stream ended after ${stepsDone}/${stepsTotal} steps`));
1339
1378
  }
1340
1379
  console.log();
1341
- console.log(chalk.gray(` Time: ${elapsedSec}s`));
1380
+ console.log(chalk_1.default.gray(` Time: ${elapsedSec}s`));
1342
1381
  const lastStepResult = finalResult?.final_output;
1343
1382
  const summary = String(lastStepResult?.result?.summary || lastStepResult?.summary || '');
1344
1383
  if (summary) {
1345
1384
  console.log();
1346
- console.log(chalk.white(' Final output:'));
1347
- console.log(chalk.gray(` ${summary.slice(0, 600)}`));
1385
+ console.log(chalk_1.default.white(' Final output:'));
1386
+ console.log(chalk_1.default.gray(` ${summary.slice(0, 600)}`));
1348
1387
  }
1349
1388
  if (cortexExecution) {
1350
1389
  const report = this.buildCortexRunReport({
@@ -1360,8 +1399,8 @@ export class LegionCommand {
1360
1399
  finalSummary: summary,
1361
1400
  }, streamEvents);
1362
1401
  const files = this.writeCortexSummaryReport(report);
1363
- console.log(chalk.gray(' Cortex summary: ' + files.markdownPath));
1364
- console.log(chalk.gray(' Cortex report JSON: ' + files.jsonPath));
1402
+ console.log(chalk_1.default.gray(' Cortex summary: ' + files.markdownPath));
1403
+ console.log(chalk_1.default.gray(' Cortex report JSON: ' + files.jsonPath));
1365
1404
  }
1366
1405
  console.log();
1367
1406
  return {
@@ -1447,7 +1486,7 @@ export class LegionCommand {
1447
1486
  return `${context} failed: ${message}${cause}`;
1448
1487
  }
1449
1488
  async showWorkers() {
1450
- const spinner = createSpinner('Fetching Legion worker catalog...').start();
1489
+ const spinner = (0, logger_js_1.createSpinner)('Fetching Legion worker catalog...').start();
1451
1490
  let lastError = null;
1452
1491
  for (const baseUrl of this.getHyperloopUrls()) {
1453
1492
  try {
@@ -1460,34 +1499,34 @@ export class LegionCommand {
1460
1499
  this.logger.warn(this.formatLegionError(`worker catalog error body at ${baseUrl}`, err));
1461
1500
  return '';
1462
1501
  });
1463
- lastError = `Legion worker catalog request at ${baseUrl} failed: ${response.status} ${describeUpstreamStatus(response.status)}${errBody ? ` — ${errBody.slice(0, 200)}` : ''}`;
1502
+ lastError = `Legion worker catalog request at ${baseUrl} failed: ${response.status} ${(0, api_js_1.describeUpstreamStatus)(response.status)}${errBody ? ` — ${errBody.slice(0, 200)}` : ''}`;
1464
1503
  continue;
1465
1504
  }
1466
1505
  const data = await this.readJsonResponse(response, `worker catalog request at ${baseUrl}`);
1467
1506
  spinner.stop();
1468
1507
  console.log();
1469
- console.log(chalk.bold.white(` ${CH.hLine.repeat(3)} Legion Worker Catalog ${CH.hLine.repeat(37)}`));
1508
+ console.log(chalk_1.default.bold.white(` ${logger_js_1.CH.hLine.repeat(3)} Legion Worker Catalog ${logger_js_1.CH.hLine.repeat(37)}`));
1470
1509
  console.log();
1471
1510
  const workers = data.workers || data.catalog || data;
1472
1511
  if (Array.isArray(workers)) {
1473
1512
  for (const w of workers) {
1474
1513
  const wObj = w;
1475
- const statusColor = wObj.status === 'active' ? chalk.green : chalk.yellow;
1476
- console.log(` ${statusColor(CH.bullet)} ${chalk.white(wObj.name || wObj.worker || 'unknown')} ${chalk.gray(wObj.description || '')}`);
1514
+ const statusColor = wObj.status === 'active' ? chalk_1.default.green : chalk_1.default.yellow;
1515
+ console.log(` ${statusColor(logger_js_1.CH.bullet)} ${chalk_1.default.white(wObj.name || wObj.worker || 'unknown')} ${chalk_1.default.gray(wObj.description || '')}`);
1477
1516
  if (wObj.status) {
1478
- console.log(chalk.gray(` Status: ${wObj.status}`));
1517
+ console.log(chalk_1.default.gray(` Status: ${wObj.status}`));
1479
1518
  }
1480
1519
  }
1481
1520
  }
1482
1521
  else if (typeof workers === 'object') {
1483
1522
  for (const [name, info] of Object.entries(workers)) {
1484
1523
  const infoObj = info;
1485
- const statusColor = infoObj.maturity === 'active' ? chalk.green : chalk.yellow;
1486
- console.log(` ${statusColor(CH.bullet)} ${chalk.white(name)} ${chalk.gray(infoObj.description || '')}`);
1524
+ const statusColor = infoObj.maturity === 'active' ? chalk_1.default.green : chalk_1.default.yellow;
1525
+ console.log(` ${statusColor(logger_js_1.CH.bullet)} ${chalk_1.default.white(name)} ${chalk_1.default.gray(infoObj.description || '')}`);
1487
1526
  if (infoObj.maturity)
1488
- console.log(chalk.gray(` Maturity: ${infoObj.maturity}`));
1527
+ console.log(chalk_1.default.gray(` Maturity: ${infoObj.maturity}`));
1489
1528
  if (infoObj.domains)
1490
- console.log(chalk.gray(` Domains: ${Array.isArray(infoObj.domains) ? infoObj.domains.join(', ') : infoObj.domains}`));
1529
+ console.log(chalk_1.default.gray(` Domains: ${Array.isArray(infoObj.domains) ? infoObj.domains.join(', ') : infoObj.domains}`));
1491
1530
  }
1492
1531
  }
1493
1532
  console.log();
@@ -1502,7 +1541,7 @@ export class LegionCommand {
1502
1541
  this.logger.error(lastError || 'Could not reach Hyper Loop. Is vigthoria-hyper-loop running?');
1503
1542
  }
1504
1543
  async showStatus() {
1505
- const spinner = createSpinner('Checking Legion infrastructure...').start();
1544
+ const spinner = (0, logger_js_1.createSpinner)('Checking Legion infrastructure...').start();
1506
1545
  let lastError = null;
1507
1546
  for (const baseUrl of this.getHyperloopUrls()) {
1508
1547
  try {
@@ -1511,25 +1550,25 @@ export class LegionCommand {
1511
1550
  headers: this.getHeaders(),
1512
1551
  });
1513
1552
  if (!response.ok) {
1514
- lastError = `Legion status check at ${baseUrl} failed: ${response.status} ${describeUpstreamStatus(response.status)}`;
1553
+ lastError = `Legion status check at ${baseUrl} failed: ${response.status} ${(0, api_js_1.describeUpstreamStatus)(response.status)}`;
1515
1554
  continue;
1516
1555
  }
1517
1556
  const data = await this.readJsonResponse(response, `status check at ${baseUrl}`);
1518
1557
  spinner.stop();
1519
1558
  console.log();
1520
- console.log(chalk.bold.white(` ${CH.hLine.repeat(3)} Legion Infrastructure ${CH.hLine.repeat(37)}`));
1559
+ console.log(chalk_1.default.bold.white(` ${logger_js_1.CH.hLine.repeat(3)} Legion Infrastructure ${logger_js_1.CH.hLine.repeat(37)}`));
1521
1560
  console.log();
1522
- console.log(chalk.gray(` Hyper Loop: `) + chalk.green('online'));
1561
+ console.log(chalk_1.default.gray(` Hyper Loop: `) + chalk_1.default.green('online'));
1523
1562
  if (data.workers || data.active_workers) {
1524
1563
  const count = data.workers || data.active_workers;
1525
- console.log(chalk.gray(` Active workers: `) + chalk.white(String(typeof count === 'number' ? count : Object.keys(count).length)));
1564
+ console.log(chalk_1.default.gray(` Active workers: `) + chalk_1.default.white(String(typeof count === 'number' ? count : Object.keys(count).length)));
1526
1565
  }
1527
1566
  if (data.remotes || data.infrastructure) {
1528
1567
  const remotes = data.remotes || data.infrastructure;
1529
1568
  if (typeof remotes === 'object') {
1530
1569
  for (const [name, status] of Object.entries(remotes)) {
1531
- const icon = status?.reachable ? chalk.green(CH.success) : chalk.red(CH.error);
1532
- console.log(` ${icon} ${chalk.white(name)}`);
1570
+ const icon = status?.reachable ? chalk_1.default.green(logger_js_1.CH.success) : chalk_1.default.red(logger_js_1.CH.error);
1571
+ console.log(` ${icon} ${chalk_1.default.white(name)}`);
1533
1572
  }
1534
1573
  }
1535
1574
  }
@@ -1543,10 +1582,11 @@ export class LegionCommand {
1543
1582
  }
1544
1583
  spinner.stop();
1545
1584
  console.log();
1546
- console.log(chalk.gray(' Hyper Loop: ') + chalk.red('offline'));
1585
+ console.log(chalk_1.default.gray(' Hyper Loop: ') + chalk_1.default.red('offline'));
1547
1586
  if (lastError) {
1548
1587
  this.logger.error(lastError);
1549
1588
  }
1550
1589
  console.log();
1551
1590
  }
1552
1591
  }
1592
+ exports.LegionCommand = LegionCommand;