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.
- package/dist/commands/agent-session-menu.d.ts +19 -0
- package/dist/commands/agent-session-menu.js +155 -0
- package/dist/commands/auth.js +68 -51
- package/dist/commands/bridge.js +19 -12
- package/dist/commands/cancel.js +22 -15
- package/dist/commands/chat.d.ts +0 -22
- package/dist/commands/chat.js +402 -1084
- package/dist/commands/config.js +73 -33
- package/dist/commands/deploy.js +123 -83
- package/dist/commands/device.js +61 -21
- package/dist/commands/edit.js +39 -32
- package/dist/commands/explain.js +25 -18
- package/dist/commands/generate.js +44 -37
- package/dist/commands/hub.js +102 -95
- package/dist/commands/index.js +46 -41
- package/dist/commands/legion.js +186 -146
- package/dist/commands/review.js +36 -29
- package/dist/commands/security.js +12 -5
- package/dist/commands/wallet.js +35 -28
- package/dist/commands/workflow.js +20 -13
- package/dist/utils/brain-hub-client.d.ts +32 -0
- package/dist/utils/brain-hub-client.js +52 -0
- package/dist/utils/bridge-client.js +52 -11
- package/dist/utils/codebase-indexer.d.ts +59 -0
- package/dist/utils/codebase-indexer.js +351 -0
- package/dist/utils/context-ranker.js +21 -15
- package/dist/utils/files.js +42 -5
- package/dist/utils/logger.js +50 -42
- package/dist/utils/persona.js +8 -3
- package/dist/utils/post-write-validator.js +29 -22
- package/dist/utils/project-memory.js +23 -16
- package/dist/utils/task-display.js +20 -13
- package/dist/utils/workspace-brain-service.d.ts +43 -0
- package/dist/utils/workspace-brain-service.js +158 -0
- package/dist/utils/workspace-cache.js +26 -18
- package/dist/utils/workspace-stream.js +63 -21
- package/package.json +3 -6
- package/scripts/release/validate-no-go-gates.sh +1 -1
- package/dist/commands/fork.d.ts +0 -17
- package/dist/commands/fork.js +0 -164
- package/dist/commands/history.d.ts +0 -17
- package/dist/commands/history.js +0 -113
- package/dist/commands/preview.d.ts +0 -55
- package/dist/commands/preview.js +0 -467
- package/dist/commands/replay.d.ts +0 -18
- package/dist/commands/replay.js +0 -156
- package/dist/commands/repo.d.ts +0 -97
- package/dist/commands/repo.js +0 -773
- package/dist/commands/update.d.ts +0 -9
- package/dist/commands/update.js +0 -201
- package/dist/index.d.ts +0 -21
- package/dist/index.js +0 -1823
- package/dist/utils/api.d.ts +0 -572
- package/dist/utils/api.js +0 -6548
- package/dist/utils/cli-state.d.ts +0 -54
- package/dist/utils/cli-state.js +0 -185
- package/dist/utils/config.d.ts +0 -85
- package/dist/utils/config.js +0 -267
- package/dist/utils/session.d.ts +0 -118
- package/dist/utils/session.js +0 -423
- package/dist/utils/tools.d.ts +0 -274
- package/dist/utils/tools.js +0 -3502
package/dist/commands/config.js
CHANGED
|
@@ -1,13 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Config Command - CLI configuration management
|
|
3
4
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.ConfigCommand = void 0;
|
|
43
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
44
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
45
|
+
const fs = __importStar(require("fs"));
|
|
46
|
+
const path = __importStar(require("path"));
|
|
47
|
+
const persona_js_1 = require("../utils/persona.js");
|
|
48
|
+
const logger_js_1 = require("../utils/logger.js");
|
|
49
|
+
class ConfigCommand {
|
|
11
50
|
config;
|
|
12
51
|
logger;
|
|
13
52
|
constructor(config, logger) {
|
|
@@ -36,7 +75,7 @@ export class ConfigCommand {
|
|
|
36
75
|
}
|
|
37
76
|
async init(options = {}) {
|
|
38
77
|
console.log();
|
|
39
|
-
console.log(
|
|
78
|
+
console.log(chalk_1.default.cyan(`${logger_js_1.CH.hDouble.repeat(3)} Initialize Vigthoria in Project ${logger_js_1.CH.hDouble.repeat(3)}`));
|
|
40
79
|
console.log();
|
|
41
80
|
const cwd = process.cwd();
|
|
42
81
|
const configFile = path.join(cwd, '.vigthoria.json');
|
|
@@ -54,7 +93,7 @@ export class ConfigCommand {
|
|
|
54
93
|
}
|
|
55
94
|
}
|
|
56
95
|
else {
|
|
57
|
-
const { overwrite } = await
|
|
96
|
+
const { overwrite } = await inquirer_1.default.prompt([
|
|
58
97
|
{
|
|
59
98
|
type: 'confirm',
|
|
60
99
|
name: 'overwrite',
|
|
@@ -91,7 +130,7 @@ export class ConfigCommand {
|
|
|
91
130
|
}
|
|
92
131
|
else {
|
|
93
132
|
// Gather project settings interactively
|
|
94
|
-
settings = await
|
|
133
|
+
settings = await inquirer_1.default.prompt([
|
|
95
134
|
{
|
|
96
135
|
type: 'list',
|
|
97
136
|
name: 'defaultModel',
|
|
@@ -143,9 +182,9 @@ export class ConfigCommand {
|
|
|
143
182
|
}
|
|
144
183
|
console.log();
|
|
145
184
|
if (nonInteractive) {
|
|
146
|
-
console.log(
|
|
185
|
+
console.log(chalk_1.default.gray('Project initialized in non-interactive mode.'));
|
|
147
186
|
}
|
|
148
|
-
console.log(
|
|
187
|
+
console.log(chalk_1.default.gray('Project initialized! Run vigthoria start for a beginner guide or vigthoria chat to begin.'));
|
|
149
188
|
console.log();
|
|
150
189
|
}
|
|
151
190
|
setConfig(keyValue) {
|
|
@@ -166,7 +205,7 @@ export class ConfigCommand {
|
|
|
166
205
|
'wsUrl': (v) => this.config.set('wsUrl', v),
|
|
167
206
|
'selfHostedModelsApiUrl': (v) => this.config.set('selfHostedModelsApiUrl', v === 'null' || v === 'off' ? null : v),
|
|
168
207
|
'persona': (v) => {
|
|
169
|
-
const mode = normalizePersonaMode(v);
|
|
208
|
+
const mode = (0, persona_js_1.normalizePersonaMode)(v);
|
|
170
209
|
if (!mode)
|
|
171
210
|
throw new Error('Invalid persona. Use: default or wiener_grant');
|
|
172
211
|
this.config.set('persona', mode);
|
|
@@ -178,7 +217,7 @@ export class ConfigCommand {
|
|
|
178
217
|
}
|
|
179
218
|
else {
|
|
180
219
|
this.logger.error(`Unknown config key: ${key}`);
|
|
181
|
-
console.log(
|
|
220
|
+
console.log(chalk_1.default.gray('Available keys: model, theme, autoApply, showDiffs, maxTokens, persona, apiUrl, modelsApiUrl, wsUrl, selfHostedModelsApiUrl'));
|
|
182
221
|
}
|
|
183
222
|
}
|
|
184
223
|
formatConfigValueForDisplay(key, value) {
|
|
@@ -233,30 +272,30 @@ export class ConfigCommand {
|
|
|
233
272
|
listConfig() {
|
|
234
273
|
const all = this.config.getAll();
|
|
235
274
|
console.log();
|
|
236
|
-
console.log(
|
|
275
|
+
console.log(chalk_1.default.cyan('āāā Vigthoria CLI Configuration āāā'));
|
|
237
276
|
console.log();
|
|
238
|
-
console.log(
|
|
239
|
-
console.log(
|
|
240
|
-
console.log(
|
|
241
|
-
console.log(
|
|
242
|
-
console.log(
|
|
277
|
+
console.log(chalk_1.default.white('API:'));
|
|
278
|
+
console.log(chalk_1.default.gray(' URL: ') + chalk_1.default.cyan(this.redactConfigUrl(all.apiUrl)));
|
|
279
|
+
console.log(chalk_1.default.gray(' Models API: ') + chalk_1.default.cyan(this.redactConfigUrl(all.modelsApiUrl)));
|
|
280
|
+
console.log(chalk_1.default.gray(' WebSocket: ') + chalk_1.default.cyan(this.redactConfigUrl(all.wsUrl)));
|
|
281
|
+
console.log(chalk_1.default.gray(' Vigthoria Model Endpoint: ') + chalk_1.default.cyan(all.selfHostedModelsApiUrl || 'default'));
|
|
243
282
|
console.log();
|
|
244
|
-
console.log(
|
|
245
|
-
console.log(
|
|
246
|
-
console.log(
|
|
247
|
-
console.log(
|
|
248
|
-
console.log(
|
|
249
|
-
console.log(
|
|
250
|
-
console.log(
|
|
283
|
+
console.log(chalk_1.default.white('Preferences:'));
|
|
284
|
+
console.log(chalk_1.default.gray(' Default Model: ') + chalk_1.default.cyan(all.preferences.defaultModel));
|
|
285
|
+
console.log(chalk_1.default.gray(' Theme: ') + chalk_1.default.cyan(all.preferences.theme));
|
|
286
|
+
console.log(chalk_1.default.gray(' Auto Apply Fixes: ') + chalk_1.default.cyan(all.preferences.autoApplyFixes));
|
|
287
|
+
console.log(chalk_1.default.gray(' Show Diffs: ') + chalk_1.default.cyan(all.preferences.showDiffs));
|
|
288
|
+
console.log(chalk_1.default.gray(' Max Tokens: ') + chalk_1.default.cyan(all.preferences.maxTokens));
|
|
289
|
+
console.log(chalk_1.default.gray(' Persona: ') + chalk_1.default.cyan(all.persona));
|
|
251
290
|
console.log();
|
|
252
|
-
console.log(
|
|
253
|
-
console.log(
|
|
291
|
+
console.log(chalk_1.default.white('Project:'));
|
|
292
|
+
console.log(chalk_1.default.gray(' Ignore Patterns: ') + chalk_1.default.gray(all.project.ignorePatterns.join(', ')));
|
|
254
293
|
console.log();
|
|
255
|
-
console.log(
|
|
294
|
+
console.log(chalk_1.default.gray(`Config file: ${this.config.getConfigPath()}`));
|
|
256
295
|
console.log();
|
|
257
296
|
}
|
|
258
297
|
async resetConfig() {
|
|
259
|
-
const { confirm } = await
|
|
298
|
+
const { confirm } = await inquirer_1.default.prompt([
|
|
260
299
|
{
|
|
261
300
|
type: 'confirm',
|
|
262
301
|
name: 'confirm',
|
|
@@ -286,9 +325,9 @@ export class ConfigCommand {
|
|
|
286
325
|
async interactiveConfig() {
|
|
287
326
|
const current = this.config.getAll();
|
|
288
327
|
console.log();
|
|
289
|
-
console.log(
|
|
328
|
+
console.log(chalk_1.default.cyan('āāā Configure Vigthoria CLI āāā'));
|
|
290
329
|
console.log();
|
|
291
|
-
const settings = await
|
|
330
|
+
const settings = await inquirer_1.default.prompt([
|
|
292
331
|
{
|
|
293
332
|
type: 'list',
|
|
294
333
|
name: 'defaultModel',
|
|
@@ -335,3 +374,4 @@ export class ConfigCommand {
|
|
|
335
374
|
console.log();
|
|
336
375
|
}
|
|
337
376
|
}
|
|
377
|
+
exports.ConfigCommand = ConfigCommand;
|
package/dist/commands/deploy.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Vigthoria CLI - Deploy Commands
|
|
3
4
|
*
|
|
@@ -11,12 +12,50 @@
|
|
|
11
12
|
* vig deploy list - List all deployments
|
|
12
13
|
* vig deploy remove <domain> - Remove a deployment
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(o, k2, desc);
|
|
22
|
+
}) : (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
o[k2] = m[k];
|
|
25
|
+
}));
|
|
26
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
+
}) : function(o, v) {
|
|
29
|
+
o["default"] = v;
|
|
30
|
+
});
|
|
31
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
32
|
+
var ownKeys = function(o) {
|
|
33
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
34
|
+
var ar = [];
|
|
35
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
36
|
+
return ar;
|
|
37
|
+
};
|
|
38
|
+
return ownKeys(o);
|
|
39
|
+
};
|
|
40
|
+
return function (mod) {
|
|
41
|
+
if (mod && mod.__esModule) return mod;
|
|
42
|
+
var result = {};
|
|
43
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
44
|
+
__setModuleDefault(result, mod);
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
49
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
50
|
+
};
|
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
+
exports.DeployCommand = void 0;
|
|
53
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
54
|
+
const fs = __importStar(require("fs"));
|
|
55
|
+
const path = __importStar(require("path"));
|
|
56
|
+
const logger_js_1 = require("../utils/logger.js");
|
|
57
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
58
|
+
class DeployCommand {
|
|
20
59
|
config;
|
|
21
60
|
logger;
|
|
22
61
|
apiBase;
|
|
@@ -37,8 +76,8 @@ export class DeployCommand {
|
|
|
37
76
|
}
|
|
38
77
|
requireAuth() {
|
|
39
78
|
if (!this.isAuthenticated()) {
|
|
40
|
-
console.log(
|
|
41
|
-
console.log(
|
|
79
|
+
console.log(chalk_1.default.red('\nā Authentication required'));
|
|
80
|
+
console.log(chalk_1.default.gray(' Run `vig login` to authenticate first.\n'));
|
|
42
81
|
process.exit(1);
|
|
43
82
|
}
|
|
44
83
|
}
|
|
@@ -47,7 +86,7 @@ export class DeployCommand {
|
|
|
47
86
|
*/
|
|
48
87
|
async deploy(options = {}) {
|
|
49
88
|
this.requireAuth();
|
|
50
|
-
console.log(
|
|
89
|
+
console.log(chalk_1.default.cyan('\nš Vigthoria Deploy - Host Your Project\n'));
|
|
51
90
|
// If subdomain or domain specified, deploy directly
|
|
52
91
|
if (options.subdomain) {
|
|
53
92
|
await this.deployToSubdomain(options.subdomain, options.project);
|
|
@@ -58,7 +97,7 @@ export class DeployCommand {
|
|
|
58
97
|
return;
|
|
59
98
|
}
|
|
60
99
|
// Interactive wizard
|
|
61
|
-
const { deployType } = await
|
|
100
|
+
const { deployType } = await inquirer_1.default.prompt([{
|
|
62
101
|
type: 'list',
|
|
63
102
|
name: 'deployType',
|
|
64
103
|
message: 'How would you like to deploy?',
|
|
@@ -89,7 +128,7 @@ export class DeployCommand {
|
|
|
89
128
|
*/
|
|
90
129
|
async deployToPreview(projectPath) {
|
|
91
130
|
this.requireAuth();
|
|
92
|
-
const spinner = createSpinner('Deploying to preview...').start();
|
|
131
|
+
const spinner = (0, logger_js_1.createSpinner)('Deploying to preview...').start();
|
|
93
132
|
try {
|
|
94
133
|
const projectDir = projectPath || process.cwd();
|
|
95
134
|
const projectInfo = this.detectProjectInfo(projectDir);
|
|
@@ -106,17 +145,17 @@ export class DeployCommand {
|
|
|
106
145
|
throw new Error(error.error || 'Failed to deploy');
|
|
107
146
|
}
|
|
108
147
|
const data = await response.json();
|
|
109
|
-
spinner.succeed(
|
|
110
|
-
console.log(
|
|
111
|
-
console.log(
|
|
112
|
-
console.log(
|
|
113
|
-
console.log(
|
|
148
|
+
spinner.succeed(chalk_1.default.green('Deployed to preview!'));
|
|
149
|
+
console.log(chalk_1.default.cyan('\nš Preview URL:'));
|
|
150
|
+
console.log(chalk_1.default.white(` ${data.url}`));
|
|
151
|
+
console.log(chalk_1.default.gray('\n Note: Preview URLs may expire after 7 days of inactivity.'));
|
|
152
|
+
console.log(chalk_1.default.gray(' Upgrade to a subdomain for permanent hosting.\n'));
|
|
114
153
|
}
|
|
115
154
|
catch (error) {
|
|
116
155
|
spinner.stop();
|
|
117
156
|
this.logger.error('Deploy failed');
|
|
118
157
|
const errMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
119
|
-
console.log(
|
|
158
|
+
console.log(chalk_1.default.red(`\nā Error: ${errMsg}\n`));
|
|
120
159
|
process.exitCode = 1;
|
|
121
160
|
}
|
|
122
161
|
}
|
|
@@ -124,7 +163,7 @@ export class DeployCommand {
|
|
|
124
163
|
* Deploy to Vigthoria subdomain
|
|
125
164
|
*/
|
|
126
165
|
async deployToSubdomain(subdomain, projectPath) {
|
|
127
|
-
const spinner = createSpinner(`Deploying to ${subdomain}.vigthoria.io...`).start();
|
|
166
|
+
const spinner = (0, logger_js_1.createSpinner)(`Deploying to ${subdomain}.vigthoria.io...`).start();
|
|
128
167
|
try {
|
|
129
168
|
// Validate subdomain format
|
|
130
169
|
if (!/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(subdomain) || subdomain.length < 3) {
|
|
@@ -145,40 +184,40 @@ export class DeployCommand {
|
|
|
145
184
|
if (!response.ok || !data.success) {
|
|
146
185
|
if (data.requiresSubscription) {
|
|
147
186
|
spinner.stop();
|
|
148
|
-
console.log(
|
|
149
|
-
const { proceed } = await
|
|
187
|
+
console.log(chalk_1.default.yellow(`\n${logger_js_1.CH.warnEmoji} Subdomain hosting requires a subscription (ā¬4.99/mo)`));
|
|
188
|
+
const { proceed } = await inquirer_1.default.prompt([{
|
|
150
189
|
type: 'confirm',
|
|
151
190
|
name: 'proceed',
|
|
152
191
|
message: 'Would you like to subscribe now?',
|
|
153
192
|
default: true
|
|
154
193
|
}]);
|
|
155
194
|
if (proceed && data.checkoutUrl) {
|
|
156
|
-
console.log(
|
|
157
|
-
console.log(
|
|
195
|
+
console.log(chalk_1.default.cyan(`\nš Opening checkout: ${data.checkoutUrl}`));
|
|
196
|
+
console.log(chalk_1.default.gray('Please open this URL in your browser to subscribe.\n'));
|
|
158
197
|
}
|
|
159
198
|
return;
|
|
160
199
|
}
|
|
161
200
|
throw new Error(data.error || 'Failed to deploy');
|
|
162
201
|
}
|
|
163
|
-
spinner.succeed(
|
|
164
|
-
console.log(
|
|
165
|
-
console.log(
|
|
166
|
-
console.log(
|
|
167
|
-
console.log(
|
|
168
|
-
console.log(
|
|
202
|
+
spinner.succeed(chalk_1.default.green(`Deployed to ${subdomain}.vigthoria.io!`));
|
|
203
|
+
console.log(chalk_1.default.cyan('\nš Your Site is Live:'));
|
|
204
|
+
console.log(chalk_1.default.bold.white(` https://${subdomain}.vigthoria.io`));
|
|
205
|
+
console.log(chalk_1.default.gray('\n ā SSL certificate auto-configured'));
|
|
206
|
+
console.log(chalk_1.default.gray(' ā Global CDN enabled'));
|
|
207
|
+
console.log(chalk_1.default.gray(' ā Unlimited traffic included\n'));
|
|
169
208
|
}
|
|
170
209
|
catch (error) {
|
|
171
210
|
spinner.stop();
|
|
172
211
|
this.logger.error('Deploy failed');
|
|
173
212
|
const errMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
174
|
-
console.log(
|
|
213
|
+
console.log(chalk_1.default.red(`\nā Error: ${errMsg}\n`));
|
|
175
214
|
}
|
|
176
215
|
}
|
|
177
216
|
/**
|
|
178
217
|
* Deploy to custom domain
|
|
179
218
|
*/
|
|
180
219
|
async deployToCustomDomain(domain, projectPath) {
|
|
181
|
-
const spinner = createSpinner(`Setting up ${domain}...`).start();
|
|
220
|
+
const spinner = (0, logger_js_1.createSpinner)(`Setting up ${domain}...`).start();
|
|
182
221
|
try {
|
|
183
222
|
const projectDir = projectPath || process.cwd();
|
|
184
223
|
const projectInfo = this.detectProjectInfo(projectDir);
|
|
@@ -195,49 +234,49 @@ export class DeployCommand {
|
|
|
195
234
|
if (!response.ok || !data.success) {
|
|
196
235
|
if (data.requiresSubscription) {
|
|
197
236
|
spinner.stop();
|
|
198
|
-
console.log(
|
|
199
|
-
const { proceed } = await
|
|
237
|
+
console.log(chalk_1.default.yellow(`\n${logger_js_1.CH.warnEmoji} Custom domain hosting requires a subscription (ā¬9.99/mo)`));
|
|
238
|
+
const { proceed } = await inquirer_1.default.prompt([{
|
|
200
239
|
type: 'confirm',
|
|
201
240
|
name: 'proceed',
|
|
202
241
|
message: 'Would you like to subscribe now?',
|
|
203
242
|
default: true
|
|
204
243
|
}]);
|
|
205
244
|
if (proceed && data.checkoutUrl) {
|
|
206
|
-
console.log(
|
|
207
|
-
console.log(
|
|
245
|
+
console.log(chalk_1.default.cyan(`\nš Checkout URL: ${data.checkoutUrl}`));
|
|
246
|
+
console.log(chalk_1.default.gray('Please open this URL in your browser to subscribe.\n'));
|
|
208
247
|
}
|
|
209
248
|
return;
|
|
210
249
|
}
|
|
211
250
|
throw new Error(data.error || 'Failed to deploy');
|
|
212
251
|
}
|
|
213
|
-
spinner.succeed(
|
|
252
|
+
spinner.succeed(chalk_1.default.green('Domain registered!'));
|
|
214
253
|
if (data.dnsRecords) {
|
|
215
|
-
console.log(
|
|
216
|
-
console.log(
|
|
254
|
+
console.log(chalk_1.default.cyan('\nš Configure your DNS records:'));
|
|
255
|
+
console.log(chalk_1.default.gray('ā'.repeat(60)));
|
|
217
256
|
for (const record of data.dnsRecords) {
|
|
218
|
-
console.log(
|
|
257
|
+
console.log(chalk_1.default.white(` Type: ${record.type.padEnd(6)} Name: ${record.name.padEnd(20)} Value: ${record.value}`));
|
|
219
258
|
}
|
|
220
|
-
console.log(
|
|
221
|
-
console.log(
|
|
222
|
-
console.log(
|
|
259
|
+
console.log(chalk_1.default.gray('ā'.repeat(60)));
|
|
260
|
+
console.log(chalk_1.default.yellow('\nā³ After adding DNS records, run:'));
|
|
261
|
+
console.log(chalk_1.default.white(` vig deploy verify ${domain}\n`));
|
|
223
262
|
}
|
|
224
263
|
}
|
|
225
264
|
catch (error) {
|
|
226
265
|
spinner.stop();
|
|
227
266
|
this.logger.error('Deploy failed');
|
|
228
267
|
const errMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
229
|
-
console.log(
|
|
268
|
+
console.log(chalk_1.default.red(`\nā Error: ${errMsg}\n`));
|
|
230
269
|
}
|
|
231
270
|
}
|
|
232
271
|
/**
|
|
233
272
|
* Interactive subdomain prompt
|
|
234
273
|
*/
|
|
235
274
|
async promptSubdomainDeploy(projectPath) {
|
|
236
|
-
const { subdomain } = await
|
|
275
|
+
const { subdomain } = await inquirer_1.default.prompt([{
|
|
237
276
|
type: 'input',
|
|
238
277
|
name: 'subdomain',
|
|
239
278
|
message: 'Enter your desired subdomain:',
|
|
240
|
-
suffix:
|
|
279
|
+
suffix: chalk_1.default.gray('.vigthoria.io'),
|
|
241
280
|
validate: (input) => {
|
|
242
281
|
if (!/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(input) || input.length < 3) {
|
|
243
282
|
return 'Subdomain must be 3+ chars, lowercase alphanumeric with hyphens';
|
|
@@ -251,11 +290,11 @@ export class DeployCommand {
|
|
|
251
290
|
* Interactive custom domain prompt
|
|
252
291
|
*/
|
|
253
292
|
async promptCustomDomainDeploy(projectPath) {
|
|
254
|
-
const { domain } = await
|
|
293
|
+
const { domain } = await inquirer_1.default.prompt([{
|
|
255
294
|
type: 'input',
|
|
256
295
|
name: 'domain',
|
|
257
296
|
message: 'Enter your domain:',
|
|
258
|
-
suffix:
|
|
297
|
+
suffix: chalk_1.default.gray(' (e.g., myapp.com)'),
|
|
259
298
|
validate: (input) => {
|
|
260
299
|
if (!/^[a-z0-9][a-z0-9.-]+\.[a-z]{2,}$/i.test(input)) {
|
|
261
300
|
return 'Please enter a valid domain name';
|
|
@@ -269,7 +308,7 @@ export class DeployCommand {
|
|
|
269
308
|
* Show hosting plans
|
|
270
309
|
*/
|
|
271
310
|
async showPlans() {
|
|
272
|
-
const spinner = createSpinner('Fetching hosting plans...').start();
|
|
311
|
+
const spinner = (0, logger_js_1.createSpinner)('Fetching hosting plans...').start();
|
|
273
312
|
try {
|
|
274
313
|
const response = await fetch(`${this.apiBase}/api/hosting/plans`, {
|
|
275
314
|
headers: this.getAuthHeaders()
|
|
@@ -279,14 +318,14 @@ export class DeployCommand {
|
|
|
279
318
|
}
|
|
280
319
|
const data = await response.json();
|
|
281
320
|
spinner.stop();
|
|
282
|
-
console.log(
|
|
283
|
-
console.log(
|
|
321
|
+
console.log(chalk_1.default.cyan('\nš Vigthoria Hosting Plans\n'));
|
|
322
|
+
console.log(chalk_1.default.gray('ā'.repeat(70)));
|
|
284
323
|
for (const plan of data.plans) {
|
|
285
324
|
const price = plan.price_monthly === 0
|
|
286
|
-
?
|
|
287
|
-
:
|
|
288
|
-
console.log(
|
|
289
|
-
console.log(
|
|
325
|
+
? chalk_1.default.green('FREE')
|
|
326
|
+
: chalk_1.default.yellow(`ā¬${plan.price_monthly.toFixed(2)}/mo`);
|
|
327
|
+
console.log(chalk_1.default.bold.white(`\n ${plan.display_name} - ${price}`));
|
|
328
|
+
console.log(chalk_1.default.gray(' ' + 'ā'.repeat(50)));
|
|
290
329
|
const features = [];
|
|
291
330
|
if (plan.subdomain_allowed)
|
|
292
331
|
features.push('ā Vigthoria subdomain');
|
|
@@ -294,16 +333,16 @@ export class DeployCommand {
|
|
|
294
333
|
features.push('ā Custom domain');
|
|
295
334
|
features.push(`ā ${plan.max_projects === -1 ? 'Unlimited' : plan.max_projects} project(s)`);
|
|
296
335
|
features.push(`ā ${plan.storage_mb >= 1024 ? (plan.storage_mb / 1024) + 'GB' : plan.storage_mb + 'MB'} storage`);
|
|
297
|
-
features.forEach(f => console.log(
|
|
336
|
+
features.forEach(f => console.log(chalk_1.default.gray(` ${f}`)));
|
|
298
337
|
}
|
|
299
|
-
console.log(
|
|
300
|
-
console.log(
|
|
338
|
+
console.log(chalk_1.default.gray('\n' + 'ā'.repeat(70)));
|
|
339
|
+
console.log(chalk_1.default.cyan('\n Subscribe: vig deploy --subdomain myapp\n'));
|
|
301
340
|
}
|
|
302
341
|
catch (error) {
|
|
303
342
|
spinner.stop();
|
|
304
343
|
this.logger.error('Failed to fetch plans');
|
|
305
344
|
const errMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
306
|
-
console.log(
|
|
345
|
+
console.log(chalk_1.default.red(`\nā Error: ${errMsg}\n`));
|
|
307
346
|
}
|
|
308
347
|
}
|
|
309
348
|
/**
|
|
@@ -311,7 +350,7 @@ export class DeployCommand {
|
|
|
311
350
|
*/
|
|
312
351
|
async list() {
|
|
313
352
|
this.requireAuth();
|
|
314
|
-
const spinner = createSpinner('Fetching deployments...').start();
|
|
353
|
+
const spinner = (0, logger_js_1.createSpinner)('Fetching deployments...').start();
|
|
315
354
|
try {
|
|
316
355
|
const response = await fetch(`${this.apiBase}/api/hosting/domains`, {
|
|
317
356
|
headers: this.getAuthHeaders()
|
|
@@ -322,21 +361,21 @@ export class DeployCommand {
|
|
|
322
361
|
const data = await response.json();
|
|
323
362
|
spinner.stop();
|
|
324
363
|
if (data.domains.length === 0) {
|
|
325
|
-
console.log(
|
|
326
|
-
console.log(
|
|
364
|
+
console.log(chalk_1.default.yellow('\nš¦ No deployments yet.\n'));
|
|
365
|
+
console.log(chalk_1.default.gray(' Run `vig deploy` to deploy your first project.\n'));
|
|
327
366
|
return;
|
|
328
367
|
}
|
|
329
|
-
console.log(
|
|
368
|
+
console.log(chalk_1.default.cyan(`\nš Your Deployments (${data.domains.length})\n`));
|
|
330
369
|
for (const domain of data.domains) {
|
|
331
370
|
const statusIcon = domain.is_active ? 'š¢' : 'š“';
|
|
332
|
-
const sslIcon = domain.ssl_status === 'active' ? CH.lock : CH.warnEmoji;
|
|
371
|
+
const sslIcon = domain.ssl_status === 'active' ? logger_js_1.CH.lock : logger_js_1.CH.warnEmoji;
|
|
333
372
|
const url = domain.domain_type === 'subdomain'
|
|
334
373
|
? `${domain.subdomain}.vigthoria.io`
|
|
335
374
|
: domain.domain_type === 'custom'
|
|
336
375
|
? domain.custom_domain
|
|
337
376
|
: domain.url;
|
|
338
|
-
console.log(
|
|
339
|
-
console.log(
|
|
377
|
+
console.log(chalk_1.default.white(` ${statusIcon} ${url}`));
|
|
378
|
+
console.log(chalk_1.default.gray(` Project: ${domain.project_name} | SSL: ${sslIcon} ${domain.ssl_status} | Tier: ${domain.hosting_tier}`));
|
|
340
379
|
console.log();
|
|
341
380
|
}
|
|
342
381
|
}
|
|
@@ -344,7 +383,7 @@ export class DeployCommand {
|
|
|
344
383
|
spinner.stop();
|
|
345
384
|
this.logger.error('List failed');
|
|
346
385
|
const errMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
347
|
-
console.log(
|
|
386
|
+
console.log(chalk_1.default.red(`\nā Error: ${errMsg}\n`));
|
|
348
387
|
}
|
|
349
388
|
}
|
|
350
389
|
/**
|
|
@@ -352,7 +391,7 @@ export class DeployCommand {
|
|
|
352
391
|
*/
|
|
353
392
|
async status(domain) {
|
|
354
393
|
this.requireAuth();
|
|
355
|
-
const spinner = createSpinner('Checking status...').start();
|
|
394
|
+
const spinner = (0, logger_js_1.createSpinner)('Checking status...').start();
|
|
356
395
|
try {
|
|
357
396
|
const endpoint = domain
|
|
358
397
|
? `${this.apiBase}/api/hosting/domain/${encodeURIComponent(domain)}/status`
|
|
@@ -365,14 +404,14 @@ export class DeployCommand {
|
|
|
365
404
|
}
|
|
366
405
|
const data = await response.json();
|
|
367
406
|
spinner.stop();
|
|
368
|
-
console.log(
|
|
407
|
+
console.log(chalk_1.default.cyan('\nš Deployment Status\n'));
|
|
369
408
|
console.log(JSON.stringify(data, null, 2));
|
|
370
409
|
}
|
|
371
410
|
catch (error) {
|
|
372
411
|
spinner.stop();
|
|
373
412
|
this.logger.error('Status check failed');
|
|
374
413
|
const errMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
375
|
-
console.log(
|
|
414
|
+
console.log(chalk_1.default.red(`\nā Error: ${errMsg}\n`));
|
|
376
415
|
}
|
|
377
416
|
}
|
|
378
417
|
/**
|
|
@@ -380,7 +419,7 @@ export class DeployCommand {
|
|
|
380
419
|
*/
|
|
381
420
|
async verify(domain) {
|
|
382
421
|
this.requireAuth();
|
|
383
|
-
const spinner = createSpinner(`Verifying DNS for ${domain}...`).start();
|
|
422
|
+
const spinner = (0, logger_js_1.createSpinner)(`Verifying DNS for ${domain}...`).start();
|
|
384
423
|
try {
|
|
385
424
|
const response = await fetch(`${this.apiBase}/api/hosting/domain/verify`, {
|
|
386
425
|
method: 'POST',
|
|
@@ -392,21 +431,21 @@ export class DeployCommand {
|
|
|
392
431
|
throw new Error(data.error || 'Verification failed');
|
|
393
432
|
}
|
|
394
433
|
if (data.verified) {
|
|
395
|
-
spinner.succeed(
|
|
396
|
-
console.log(
|
|
397
|
-
console.log(
|
|
434
|
+
spinner.succeed(chalk_1.default.green('Domain verified!'));
|
|
435
|
+
console.log(chalk_1.default.cyan(`\nš Your site is now live at: https://${domain}`));
|
|
436
|
+
console.log(chalk_1.default.gray(` SSL Status: ${data.sslStatus || 'Provisioning...'}\n`));
|
|
398
437
|
}
|
|
399
438
|
else {
|
|
400
|
-
spinner.warn(
|
|
401
|
-
console.log(
|
|
402
|
-
console.log(
|
|
439
|
+
spinner.warn(chalk_1.default.yellow('DNS not propagated yet'));
|
|
440
|
+
console.log(chalk_1.default.gray('\n DNS changes can take up to 48 hours to propagate.'));
|
|
441
|
+
console.log(chalk_1.default.gray(' Try again later with: vig deploy verify ' + domain + '\n'));
|
|
403
442
|
}
|
|
404
443
|
}
|
|
405
444
|
catch (error) {
|
|
406
445
|
spinner.stop();
|
|
407
446
|
this.logger.error('Verification failed');
|
|
408
447
|
const errMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
409
|
-
console.log(
|
|
448
|
+
console.log(chalk_1.default.red(`\nā Error: ${errMsg}\n`));
|
|
410
449
|
}
|
|
411
450
|
}
|
|
412
451
|
/**
|
|
@@ -414,17 +453,17 @@ export class DeployCommand {
|
|
|
414
453
|
*/
|
|
415
454
|
async remove(domain) {
|
|
416
455
|
this.requireAuth();
|
|
417
|
-
const { confirm } = await
|
|
456
|
+
const { confirm } = await inquirer_1.default.prompt([{
|
|
418
457
|
type: 'confirm',
|
|
419
458
|
name: 'confirm',
|
|
420
|
-
message:
|
|
459
|
+
message: chalk_1.default.red(`Are you sure you want to remove ${domain}?`),
|
|
421
460
|
default: false
|
|
422
461
|
}]);
|
|
423
462
|
if (!confirm) {
|
|
424
|
-
console.log(
|
|
463
|
+
console.log(chalk_1.default.yellow(`\n${logger_js_1.CH.warnEmoji} Removal cancelled.\n`));
|
|
425
464
|
return;
|
|
426
465
|
}
|
|
427
|
-
const spinner = createSpinner(`Removing ${domain}...`).start();
|
|
466
|
+
const spinner = (0, logger_js_1.createSpinner)(`Removing ${domain}...`).start();
|
|
428
467
|
try {
|
|
429
468
|
const response = await fetch(`${this.apiBase}/api/hosting/domain/${encodeURIComponent(domain)}`, {
|
|
430
469
|
method: 'DELETE',
|
|
@@ -434,14 +473,14 @@ export class DeployCommand {
|
|
|
434
473
|
const error = await response.json();
|
|
435
474
|
throw new Error(error.error || 'Failed to remove');
|
|
436
475
|
}
|
|
437
|
-
spinner.succeed(
|
|
438
|
-
console.log(
|
|
476
|
+
spinner.succeed(chalk_1.default.green('Domain removed'));
|
|
477
|
+
console.log(chalk_1.default.gray('\n Your project files are still in your repository.\n'));
|
|
439
478
|
}
|
|
440
479
|
catch (error) {
|
|
441
480
|
spinner.stop();
|
|
442
481
|
this.logger.error('Remove failed');
|
|
443
482
|
const errMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
444
|
-
console.log(
|
|
483
|
+
console.log(chalk_1.default.red(`\nā Error: ${errMsg}\n`));
|
|
445
484
|
}
|
|
446
485
|
}
|
|
447
486
|
/**
|
|
@@ -481,3 +520,4 @@ export class DeployCommand {
|
|
|
481
520
|
return { name, techStack };
|
|
482
521
|
}
|
|
483
522
|
}
|
|
523
|
+
exports.DeployCommand = DeployCommand;
|