vigthoria-cli 1.8.19 → 1.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -100,20 +100,14 @@ class ConfigCommand {
100
100
  message: 'Default AI model:',
101
101
  choices: [
102
102
  { name: '═══ Code Models ═══', disabled: true },
103
- { name: 'Vigthoria Code V2 (8B) - Best for coding', value: 'code-v2-8b' },
104
- { name: 'Vigthoria Code V3 (8B) - Next gen coding', value: 'code-v3-8b' },
105
- { name: 'Vigthoria Code V3 (32B) - Large scale coding', value: 'code-v3-32b' },
103
+ { name: 'Vigthoria v3 Code 35B - Flagship coding model', value: 'code' },
104
+ { name: 'Vigthoria v3 Code 35B - Explicit 35B selection', value: 'code-35b' },
105
+ { name: 'Vigthoria C1 Code 9B - Fast coding specialist', value: 'code-9b' },
106
106
  { name: '═══ General Models ═══', disabled: true },
107
- { name: 'Vigthoria Fast (1.7B) - Quick responses', value: 'fast' },
108
- { name: 'Vigthoria Mini (0.6B) - Ultra lightweight', value: 'mini' },
109
- { name: 'Vigthoria Balanced (4B) - All-purpose', value: 'balanced' },
110
- { name: '═══ Creative Models ═══', disabled: true },
111
- { name: 'Vigthoria Creative V4 (9B) - Creative tasks', value: 'creative-v4' },
112
- { name: 'Vigthoria Creative V3 (9B) - Legacy creative', value: 'creative-v3' },
113
- { name: '═══ Specialized Models ═══', disabled: true },
114
- { name: 'Vigthoria Music Master (4B) - Music AI', value: 'music' },
107
+ { name: 'Vigthoria Master 7.6B - Balanced general model', value: 'balanced' },
108
+ { name: 'Vigthoria v3 Balanced 4B - Efficient general purpose', value: 'balanced-4b' },
115
109
  ],
116
- default: 'code-v2-8b',
110
+ default: 'code',
117
111
  },
118
112
  {
119
113
  type: 'input',
@@ -172,13 +166,39 @@ class ConfigCommand {
172
166
  };
173
167
  if (configMap[key]) {
174
168
  configMap[key](value);
175
- this.logger.success(`Set ${key} = ${value}`);
169
+ this.logger.success(`Set ${key} = ${this.formatConfigValueForDisplay(key, value)}`);
176
170
  }
177
171
  else {
178
172
  this.logger.error(`Unknown config key: ${key}`);
179
173
  console.log(chalk_1.default.gray('Available keys: model, theme, autoApply, showDiffs, maxTokens, apiUrl, modelsApiUrl, wsUrl, selfHostedModelsApiUrl'));
180
174
  }
181
175
  }
176
+ formatConfigValueForDisplay(key, value) {
177
+ if (key === 'apiUrl' || key === 'modelsApiUrl' || key === 'wsUrl' || key === 'selfHostedModelsApiUrl') {
178
+ return this.redactConfigUrl(value);
179
+ }
180
+ return value;
181
+ }
182
+ redactConfigUrl(url) {
183
+ const text = String(url || '').trim();
184
+ if (!text)
185
+ return text;
186
+ try {
187
+ const parsed = new URL(text);
188
+ const host = parsed.hostname.toLowerCase();
189
+ const isLocal = host === 'localhost' || host === '127.0.0.1';
190
+ const isPrivate = /^10\./.test(host)
191
+ || /^192\.168\./.test(host)
192
+ || /^172\.(1[6-9]|2[0-9]|3[0-1])\./.test(host);
193
+ if (isLocal || isPrivate) {
194
+ return '[redacted-host]';
195
+ }
196
+ return text;
197
+ }
198
+ catch {
199
+ return text.replace(/\b(?:localhost|127\.0\.0\.1)(?::\d+)?\b/gi, '[redacted-host]');
200
+ }
201
+ }
182
202
  getConfig(key) {
183
203
  const all = this.config.getAll();
184
204
  const flatConfig = {
@@ -207,9 +227,9 @@ class ConfigCommand {
207
227
  console.log(chalk_1.default.cyan('═══ Vigthoria CLI Configuration ═══'));
208
228
  console.log();
209
229
  console.log(chalk_1.default.white('API:'));
210
- console.log(chalk_1.default.gray(' URL: ') + chalk_1.default.cyan(all.apiUrl));
211
- console.log(chalk_1.default.gray(' Models API: ') + chalk_1.default.cyan(all.modelsApiUrl));
212
- console.log(chalk_1.default.gray(' WebSocket: ') + chalk_1.default.cyan(all.wsUrl));
230
+ console.log(chalk_1.default.gray(' URL: ') + chalk_1.default.cyan(this.redactConfigUrl(all.apiUrl)));
231
+ console.log(chalk_1.default.gray(' Models API: ') + chalk_1.default.cyan(this.redactConfigUrl(all.modelsApiUrl)));
232
+ console.log(chalk_1.default.gray(' WebSocket: ') + chalk_1.default.cyan(this.redactConfigUrl(all.wsUrl)));
213
233
  console.log(chalk_1.default.gray(' Self-hosted Models: ') + chalk_1.default.cyan(all.selfHostedModelsApiUrl || 'disabled'));
214
234
  console.log();
215
235
  console.log(chalk_1.default.white('Preferences:'));
@@ -264,10 +284,10 @@ class ConfigCommand {
264
284
  name: 'defaultModel',
265
285
  message: 'Default AI model:',
266
286
  choices: [
267
- { name: 'Vigthoria Code (8B)', value: 'vigthoria-code' },
268
- { name: 'Vigthoria Fast (1.1B)', value: 'vigthoria-fast' },
269
- { name: 'Vigthoria Mini (3.8B)', value: 'vigthoria-mini' },
270
- { name: 'Vigthoria Creative (9B)', value: 'vigthoria-creative' },
287
+ { name: 'Vigthoria v3 Code 35B', value: 'code' },
288
+ { name: 'Vigthoria C1 Code 9B', value: 'code-9b' },
289
+ { name: 'Vigthoria Master 7.6B', value: 'balanced' },
290
+ { name: 'Vigthoria v3 Balanced 4B', value: 'balanced-4b' },
271
291
  ],
272
292
  default: current.preferences.defaultModel,
273
293
  },
@@ -0,0 +1,12 @@
1
+ import { Command } from 'commander';
2
+ export interface CommandRegistrationResult {
3
+ name: string;
4
+ registered: boolean;
5
+ error?: Error;
6
+ }
7
+ export type CommandRegistrar = (program: Command) => void;
8
+ export declare function resolveCommand(name: string): CommandRegistrar | null;
9
+ export declare function registerCommands(cli: any): void;
10
+ export declare const setupCommands: typeof registerCommands;
11
+ export declare const configureCommands: typeof registerCommands;
12
+ export default registerCommands;
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.configureCommands = exports.setupCommands = void 0;
4
+ exports.resolveCommand = resolveCommand;
5
+ exports.registerCommands = registerCommands;
6
+ const auth_js_1 = require("./auth.js");
7
+ const bridge_js_1 = require("./bridge.js");
8
+ const cancel_js_1 = require("./cancel.js");
9
+ const chat_js_1 = require("./chat.js");
10
+ const config_js_1 = require("./config.js");
11
+ const deploy_js_1 = require("./deploy.js");
12
+ const edit_js_1 = require("./edit.js");
13
+ const explain_js_1 = require("./explain.js");
14
+ const fork_js_1 = require("./fork.js");
15
+ const generate_js_1 = require("./generate.js");
16
+ const history_js_1 = require("./history.js");
17
+ const hub_js_1 = require("./hub.js");
18
+ const legion_js_1 = require("./legion.js");
19
+ const preview_js_1 = require("./preview.js");
20
+ const replay_js_1 = require("./replay.js");
21
+ const repo_js_1 = require("./repo.js");
22
+ const review_js_1 = require("./review.js");
23
+ const workflow_js_1 = require("./workflow.js");
24
+ function isRegisterableCommand(value) {
25
+ return Boolean(value && typeof value === 'object');
26
+ }
27
+ function invokeRegistrar(instance, program) {
28
+ if (!isRegisterableCommand(instance)) {
29
+ throw new Error('Command instance is not registerable');
30
+ }
31
+ const registrar = instance.register ?? instance.setup ?? instance.configure;
32
+ if (typeof registrar !== 'function') {
33
+ throw new Error('Command does not expose register(), setup(), or configure()');
34
+ }
35
+ registrar.call(instance, program);
36
+ }
37
+ function createClassRegistrar(CommandClass) {
38
+ return (program) => {
39
+ invokeRegistrar(new CommandClass(), program);
40
+ };
41
+ }
42
+ function registerDoctorCommand(program) {
43
+ program
44
+ .command('doctor')
45
+ .description('Run local Vigthoria CLI diagnostics')
46
+ .action(() => {
47
+ const checks = [
48
+ ['Node.js', process.version],
49
+ ['Platform', `${process.platform} ${process.arch}`],
50
+ ['Working directory', process.cwd()],
51
+ ];
52
+ console.log('Vigthoria CLI diagnostics');
53
+ for (const [label, value] of checks) {
54
+ console.log(`- ${label}: ${value}`);
55
+ }
56
+ });
57
+ }
58
+ function registerVersionInfoCommand(program) {
59
+ program
60
+ .command('version-info')
61
+ .description('Show runtime version information')
62
+ .action(() => {
63
+ console.log(JSON.stringify({
64
+ node: process.version,
65
+ platform: process.platform,
66
+ arch: process.arch,
67
+ argv0: process.argv0,
68
+ }, null, 2));
69
+ });
70
+ }
71
+ const commandRegistry = [
72
+ {
73
+ name: 'auth',
74
+ handler: auth_js_1.registerAuthCommands,
75
+ },
76
+ {
77
+ name: 'chat',
78
+ handler: createClassRegistrar(chat_js_1.ChatCommand),
79
+ },
80
+ {
81
+ name: 'edit',
82
+ handler: createClassRegistrar(edit_js_1.EditCommand),
83
+ },
84
+ {
85
+ name: 'generate',
86
+ handler: createClassRegistrar(generate_js_1.GenerateCommand),
87
+ },
88
+ {
89
+ name: 'explain',
90
+ handler: createClassRegistrar(explain_js_1.ExplainCommand),
91
+ },
92
+ {
93
+ name: 'config',
94
+ handler: createClassRegistrar(config_js_1.ConfigCommand),
95
+ },
96
+ {
97
+ name: 'review',
98
+ handler: createClassRegistrar(review_js_1.ReviewCommand),
99
+ },
100
+ {
101
+ name: 'hub',
102
+ handler: createClassRegistrar(hub_js_1.HubCommand),
103
+ },
104
+ {
105
+ name: 'repo',
106
+ handler: createClassRegistrar(repo_js_1.RepoCommand),
107
+ },
108
+ {
109
+ name: 'deploy',
110
+ handler: createClassRegistrar(deploy_js_1.DeployCommand),
111
+ },
112
+ {
113
+ name: 'bridge',
114
+ handler: createClassRegistrar(bridge_js_1.BridgeCommand),
115
+ },
116
+ {
117
+ name: 'workflow',
118
+ handler: createClassRegistrar(workflow_js_1.WorkflowCommand),
119
+ },
120
+ {
121
+ name: 'preview',
122
+ handler: createClassRegistrar(preview_js_1.PreviewCommand),
123
+ },
124
+ {
125
+ name: 'legion',
126
+ handler: createClassRegistrar(legion_js_1.LegionCommand),
127
+ },
128
+ {
129
+ name: 'history',
130
+ handler: createClassRegistrar(history_js_1.HistoryCommand),
131
+ },
132
+ {
133
+ name: 'replay',
134
+ handler: createClassRegistrar(replay_js_1.ReplayCommand),
135
+ },
136
+ {
137
+ name: 'fork',
138
+ handler: createClassRegistrar(fork_js_1.ForkCommand),
139
+ },
140
+ {
141
+ name: 'cancel',
142
+ handler: createClassRegistrar(cancel_js_1.CancelCommand),
143
+ },
144
+ {
145
+ name: 'doctor',
146
+ handler: registerDoctorCommand,
147
+ },
148
+ {
149
+ name: 'version-info',
150
+ aliases: ['versionInfo'],
151
+ handler: registerVersionInfoCommand,
152
+ },
153
+ ];
154
+ function normalizeCommandName(name) {
155
+ return name.trim().toLowerCase();
156
+ }
157
+ function commandNameMatches(entry, requestedName) {
158
+ if (normalizeCommandName(entry.name) === requestedName) {
159
+ return true;
160
+ }
161
+ return Boolean(entry.aliases?.some((alias) => normalizeCommandName(alias) === requestedName));
162
+ }
163
+ function resolveCommand(name) {
164
+ const requestedName = normalizeCommandName(name);
165
+ if (!requestedName) {
166
+ return null;
167
+ }
168
+ const entry = commandRegistry.find((candidate) => commandNameMatches(candidate, requestedName));
169
+ return entry?.handler ?? null;
170
+ }
171
+ function registerCommands(cli) {
172
+ if (!cli || typeof cli.command !== 'function') {
173
+ throw new Error('registerCommands requires a Commander-compatible CLI instance');
174
+ }
175
+ const program = cli;
176
+ for (const entry of commandRegistry) {
177
+ entry.handler(program);
178
+ }
179
+ }
180
+ exports.setupCommands = registerCommands;
181
+ exports.configureCommands = registerCommands;
182
+ exports.default = registerCommands;
@@ -10,20 +10,62 @@
10
10
  */
11
11
  import { Config } from '../utils/config.js';
12
12
  import { Logger } from '../utils/logger.js';
13
- interface LegionOptions {
14
- workers?: boolean;
15
- status?: boolean;
16
- worker?: string;
17
- project?: string;
18
- }
13
+ export type LegionOptions = {
14
+ /** Enables Vigthoria Cortex maximum-intelligence execution when --cortex is supplied. */
15
+ cortex?: boolean;
16
+ /** Model tier: 'heavy' (default — strongest LLMs) or 'lite' (cost-efficient, high quality). */
17
+ tier?: 'heavy' | 'lite';
18
+ email?: string;
19
+ password?: string;
20
+ [key: string]: any;
21
+ };
19
22
  export declare class LegionCommand {
20
23
  private config;
21
24
  private logger;
22
25
  constructor(config: Config, logger: Logger);
26
+ private getHyperloopUrls;
23
27
  private getHeaders;
28
+ private readJsonResponse;
29
+ private propagateLegionApiError;
24
30
  run(request: string | undefined, options: LegionOptions): Promise<void>;
31
+ private runCortex;
32
+ private isCriticalRoleFailure;
33
+ private isOptionalRepairRoleFailure;
34
+ private estimateAdditionalLoopQuote;
35
+ private confirmAdditionalLoopCharge;
36
+ private runMandatoryPreflight;
37
+ private scanProject;
38
+ private resolveModelProfiles;
39
+ private buildRoleQuote;
40
+ private buildCortexExplicitSteps;
41
+ private buildBillingQuote;
42
+ private evaluateBillingGate;
43
+ private parseBooleanCandidate;
44
+ private fetchCortexEntitlement;
45
+ private isMasterAdminFree;
46
+ private getBillingBaseUrl;
47
+ private parseNumericCandidate;
48
+ private extractVigcoinBalance;
49
+ private getPurchaseUrlFromPayload;
50
+ private fetchWalletState;
51
+ private attemptDirectCharge;
52
+ private collectExecutionCharge;
53
+ private resolveBillingInsufficientFunds;
54
+ private printBillingGateSummary;
55
+ private printCortexQuote;
56
+ private confirmExecution;
57
+ /**
58
+ * SSE streaming URL for the Legion execution endpoint.
59
+ * Always hits Hyper Loop directly (port 8020) with the service key to avoid
60
+ * gateway JWT expiry killing long-running Cortex jobs.
61
+ */
62
+ private getLegionStreamUrl;
63
+ private getLegionServiceKey;
25
64
  private planAndExecute;
65
+ private buildCortexRunReport;
66
+ private extractModifiedFiles;
67
+ private writeCortexSummaryReport;
68
+ private formatLegionError;
26
69
  private showWorkers;
27
70
  private showStatus;
28
71
  }
29
- export {};