vigthoria-cli 1.10.37 → 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 -28
- package/dist/commands/chat.js +407 -1254
- 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.js +5 -1
- package/dist/utils/bridge-client.js +52 -11
- package/dist/utils/codebase-indexer.js +41 -4
- 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.js +45 -8
- package/dist/utils/workspace-cache.js +26 -18
- package/dist/utils/workspace-stream.js +63 -21
- package/package.json +3 -6
- 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 -276
- package/dist/utils/tools.js +0 -3516
package/dist/commands/review.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Review Command - Code review with AI
|
|
3
4
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ReviewCommand = void 0;
|
|
10
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
11
|
+
const marked_1 = require("marked");
|
|
12
|
+
const marked_terminal_1 = require("marked-terminal");
|
|
13
|
+
const logger_js_1 = require("../utils/logger.js");
|
|
14
|
+
const api_js_1 = require("../utils/api.js");
|
|
15
|
+
const files_js_1 = require("../utils/files.js");
|
|
16
|
+
class ReviewCommand {
|
|
11
17
|
config;
|
|
12
18
|
logger;
|
|
13
19
|
api;
|
|
@@ -16,10 +22,10 @@ export class ReviewCommand {
|
|
|
16
22
|
constructor(config, logger) {
|
|
17
23
|
this.config = config;
|
|
18
24
|
this.logger = logger;
|
|
19
|
-
this.api = new APIClient(config, logger);
|
|
20
|
-
this.fileUtils = new FileUtils(process.cwd(), config.get('project').ignorePatterns);
|
|
21
|
-
this.marked = new Marked();
|
|
22
|
-
this.marked.use(markedTerminal({
|
|
25
|
+
this.api = new api_js_1.APIClient(config, logger);
|
|
26
|
+
this.fileUtils = new files_js_1.FileUtils(process.cwd(), config.get('project').ignorePatterns);
|
|
27
|
+
this.marked = new marked_1.Marked();
|
|
28
|
+
this.marked.use((0, marked_terminal_1.markedTerminal)({
|
|
23
29
|
showSectionPrefix: false,
|
|
24
30
|
tab: 2,
|
|
25
31
|
width: 80,
|
|
@@ -45,9 +51,9 @@ export class ReviewCommand {
|
|
|
45
51
|
return;
|
|
46
52
|
}
|
|
47
53
|
this.logger.section(`Reviewing: ${file.relativePath}`);
|
|
48
|
-
console.log(
|
|
54
|
+
console.log(chalk_1.default.gray(`Language: ${file.language} | Lines: ${file.lines}`));
|
|
49
55
|
console.log();
|
|
50
|
-
const spinner = createSpinner({
|
|
56
|
+
const spinner = (0, logger_js_1.createSpinner)({
|
|
51
57
|
text: 'Analyzing code quality...',
|
|
52
58
|
spinner: 'dots',
|
|
53
59
|
}).start();
|
|
@@ -70,15 +76,15 @@ export class ReviewCommand {
|
|
|
70
76
|
}
|
|
71
77
|
catch (error) {
|
|
72
78
|
spinner.stop();
|
|
73
|
-
const cliErr = error instanceof CLIError ? error : classifyError(error);
|
|
74
|
-
this.logger.error(formatCLIError(cliErr));
|
|
79
|
+
const cliErr = error instanceof api_js_1.CLIError ? error : (0, api_js_1.classifyError)(error);
|
|
80
|
+
this.logger.error((0, api_js_1.formatCLIError)(cliErr));
|
|
75
81
|
}
|
|
76
82
|
}
|
|
77
83
|
printTextReview(review) {
|
|
78
84
|
// Score
|
|
79
|
-
const scoreColor = review.score >= 80 ?
|
|
85
|
+
const scoreColor = review.score >= 80 ? chalk_1.default.green : review.score >= 60 ? chalk_1.default.yellow : chalk_1.default.red;
|
|
80
86
|
console.log();
|
|
81
|
-
console.log(
|
|
87
|
+
console.log(chalk_1.default.bold('Quality Score: ') + scoreColor(`${review.score}/100`));
|
|
82
88
|
console.log(this.renderScoreBar(review.score));
|
|
83
89
|
console.log();
|
|
84
90
|
// Issues
|
|
@@ -88,7 +94,7 @@ export class ReviewCommand {
|
|
|
88
94
|
const severityIcon = this.getSeverityIcon(issue.severity);
|
|
89
95
|
const severityColor = this.getSeverityColor(issue.severity);
|
|
90
96
|
console.log(severityColor(`${severityIcon} [${issue.type}]`) +
|
|
91
|
-
|
|
97
|
+
chalk_1.default.gray(` Line ${issue.line}:`) +
|
|
92
98
|
` ${issue.message}`);
|
|
93
99
|
});
|
|
94
100
|
console.log();
|
|
@@ -100,7 +106,7 @@ export class ReviewCommand {
|
|
|
100
106
|
if (review.suggestions.length > 0) {
|
|
101
107
|
this.logger.section('Suggestions');
|
|
102
108
|
review.suggestions.forEach((suggestion, i) => {
|
|
103
|
-
console.log(
|
|
109
|
+
console.log(chalk_1.default.cyan(`${i + 1}.`) + ` ${suggestion}`);
|
|
104
110
|
});
|
|
105
111
|
console.log();
|
|
106
112
|
}
|
|
@@ -127,10 +133,10 @@ export class ReviewCommand {
|
|
|
127
133
|
const width = 30;
|
|
128
134
|
const filled = Math.round((score / 100) * width);
|
|
129
135
|
const empty = width - filled;
|
|
130
|
-
const color = score >= 80 ?
|
|
136
|
+
const color = score >= 80 ? chalk_1.default.green : score >= 60 ? chalk_1.default.yellow : chalk_1.default.red;
|
|
131
137
|
const filledChar = process.platform === 'win32' ? '#' : '\u2588';
|
|
132
138
|
const emptyChar = process.platform === 'win32' ? '.' : '\u2591';
|
|
133
|
-
return color(filledChar.repeat(filled)) +
|
|
139
|
+
return color(filledChar.repeat(filled)) + chalk_1.default.gray(emptyChar.repeat(empty));
|
|
134
140
|
}
|
|
135
141
|
/**
|
|
136
142
|
* Clean marked-terminal output for release-grade CLI presentation.
|
|
@@ -151,25 +157,26 @@ export class ReviewCommand {
|
|
|
151
157
|
getSeverityIcon(severity) {
|
|
152
158
|
switch (severity.toLowerCase()) {
|
|
153
159
|
case 'error':
|
|
154
|
-
return CH.error;
|
|
160
|
+
return logger_js_1.CH.error;
|
|
155
161
|
case 'warning':
|
|
156
|
-
return CH.warn;
|
|
162
|
+
return logger_js_1.CH.warn;
|
|
157
163
|
case 'info':
|
|
158
|
-
return CH.info;
|
|
164
|
+
return logger_js_1.CH.info;
|
|
159
165
|
default:
|
|
160
|
-
return CH.bullet;
|
|
166
|
+
return logger_js_1.CH.bullet;
|
|
161
167
|
}
|
|
162
168
|
}
|
|
163
169
|
getSeverityColor(severity) {
|
|
164
170
|
switch (severity.toLowerCase()) {
|
|
165
171
|
case 'error':
|
|
166
|
-
return
|
|
172
|
+
return chalk_1.default.red;
|
|
167
173
|
case 'warning':
|
|
168
|
-
return
|
|
174
|
+
return chalk_1.default.yellow;
|
|
169
175
|
case 'info':
|
|
170
|
-
return
|
|
176
|
+
return chalk_1.default.blue;
|
|
171
177
|
default:
|
|
172
|
-
return
|
|
178
|
+
return chalk_1.default.white;
|
|
173
179
|
}
|
|
174
180
|
}
|
|
175
181
|
}
|
|
182
|
+
exports.ReviewCommand = ReviewCommand;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SecurityCommand = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
class SecurityCommand {
|
|
4
10
|
config;
|
|
5
11
|
logger;
|
|
6
12
|
constructor(config, logger) {
|
|
@@ -15,11 +21,11 @@ export class SecurityCommand {
|
|
|
15
21
|
return 'http://127.0.0.1:4008';
|
|
16
22
|
}
|
|
17
23
|
resolveDir(dir) {
|
|
18
|
-
return
|
|
24
|
+
return path_1.default.resolve(dir || process.cwd());
|
|
19
25
|
}
|
|
20
26
|
async execute(tool, parameters) {
|
|
21
27
|
const baseUrl = this.getMcpBaseUrl();
|
|
22
|
-
const response = await
|
|
28
|
+
const response = await axios_1.default.post(`${baseUrl}/mcp/execute`, {
|
|
23
29
|
tool,
|
|
24
30
|
parameters,
|
|
25
31
|
context: {
|
|
@@ -89,3 +95,4 @@ export class SecurityCommand {
|
|
|
89
95
|
}
|
|
90
96
|
}
|
|
91
97
|
}
|
|
98
|
+
exports.SecurityCommand = SecurityCommand;
|
package/dist/commands/wallet.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* wallet.ts — VigCoin wallet management for Vigthoria CLI.
|
|
3
4
|
*
|
|
@@ -5,15 +6,20 @@
|
|
|
5
6
|
* vigthoria wallet history [--n 20] — recent transactions
|
|
6
7
|
* vigthoria wallet cloud-status — show cloud access and model pricing
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.WalletCommand = void 0;
|
|
14
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
15
|
+
const config_js_1 = require("../utils/config.js");
|
|
16
|
+
const logger_js_1 = require("../utils/logger.js");
|
|
17
|
+
class WalletCommand {
|
|
12
18
|
config;
|
|
13
19
|
logger;
|
|
14
20
|
constructor() {
|
|
15
|
-
this.config = new Config();
|
|
16
|
-
this.logger = new Logger();
|
|
21
|
+
this.config = new config_js_1.Config();
|
|
22
|
+
this.logger = new logger_js_1.Logger();
|
|
17
23
|
}
|
|
18
24
|
getBaseUrl() {
|
|
19
25
|
return String(this.config.get('apiUrl') || 'https://coder.vigthoria.io').replace(/\/$/, '');
|
|
@@ -99,16 +105,16 @@ export class WalletCommand {
|
|
|
99
105
|
return;
|
|
100
106
|
}
|
|
101
107
|
console.log('');
|
|
102
|
-
console.log(
|
|
103
|
-
console.log(
|
|
104
|
-
console.log(` Balance: ${
|
|
105
|
-
console.log(` Lifetime earned: ${
|
|
106
|
-
console.log(` Lifetime spent: ${
|
|
108
|
+
console.log(chalk_1.default.bold.cyan(' VigCoin Wallet'));
|
|
109
|
+
console.log(chalk_1.default.gray(' ─────────────────────────────'));
|
|
110
|
+
console.log(` Balance: ${chalk_1.default.bold.yellow(data.balance.toLocaleString())} ⓥ`);
|
|
111
|
+
console.log(` Lifetime earned: ${chalk_1.default.green(data.lifetimeEarned.toLocaleString())} ⓥ`);
|
|
112
|
+
console.log(` Lifetime spent: ${chalk_1.default.red(data.lifetimeSpent.toLocaleString())} ⓥ`);
|
|
107
113
|
if (data.lastUpdated) {
|
|
108
|
-
console.log(` Last updated: ${
|
|
114
|
+
console.log(` Last updated: ${chalk_1.default.gray(new Date(data.lastUpdated).toLocaleString())}`);
|
|
109
115
|
}
|
|
110
116
|
console.log('');
|
|
111
|
-
console.log(
|
|
117
|
+
console.log(chalk_1.default.gray(' Top up at: https://hub.vigthoria.io/credits'));
|
|
112
118
|
console.log('');
|
|
113
119
|
}
|
|
114
120
|
catch (err) {
|
|
@@ -126,17 +132,17 @@ export class WalletCommand {
|
|
|
126
132
|
}
|
|
127
133
|
const txs = data.transactions || [];
|
|
128
134
|
console.log('');
|
|
129
|
-
console.log(
|
|
130
|
-
console.log(
|
|
135
|
+
console.log(chalk_1.default.bold.cyan(` VigCoin Transaction History (last ${txs.length})`));
|
|
136
|
+
console.log(chalk_1.default.gray(' ──────────────────────────────────────────────────────────'));
|
|
131
137
|
if (txs.length === 0) {
|
|
132
|
-
console.log(
|
|
138
|
+
console.log(chalk_1.default.gray(' No transactions found.'));
|
|
133
139
|
}
|
|
134
140
|
else {
|
|
135
141
|
for (const tx of txs) {
|
|
136
|
-
const sign = tx.amount >= 0 ?
|
|
142
|
+
const sign = tx.amount >= 0 ? chalk_1.default.green(`+${tx.amount}`) : chalk_1.default.red(String(tx.amount));
|
|
137
143
|
const date = new Date(tx.created_at).toLocaleString();
|
|
138
144
|
const desc = tx.description || tx.action || tx.type;
|
|
139
|
-
console.log(` ${
|
|
145
|
+
console.log(` ${chalk_1.default.gray(date)} ${sign.padStart(8)} ⓥ ${chalk_1.default.gray(`→`)} ${chalk_1.default.yellow(tx.balance_after)} ⓥ ${desc}`);
|
|
140
146
|
}
|
|
141
147
|
}
|
|
142
148
|
console.log('');
|
|
@@ -154,32 +160,32 @@ export class WalletCommand {
|
|
|
154
160
|
return;
|
|
155
161
|
}
|
|
156
162
|
console.log('');
|
|
157
|
-
console.log(
|
|
158
|
-
console.log(
|
|
163
|
+
console.log(chalk_1.default.bold.cyan(' Cloud Access Status'));
|
|
164
|
+
console.log(chalk_1.default.gray(' ─────────────────────────────'));
|
|
159
165
|
if (data.isMasterAdmin) {
|
|
160
|
-
console.log(` Access: ${
|
|
166
|
+
console.log(` Access: ${chalk_1.default.bold.green('Master Admin — unlimited cloud access')}`);
|
|
161
167
|
}
|
|
162
168
|
else if (data.hasGrant) {
|
|
163
169
|
const models = data.grantDetails?.allowedModels === '*' ? 'All models' : data.grantDetails?.allowedModels;
|
|
164
170
|
const exp = data.grantDetails?.expiresAt ? ` (expires ${new Date(data.grantDetails.expiresAt).toLocaleDateString()})` : '';
|
|
165
|
-
console.log(` Access: ${
|
|
171
|
+
console.log(` Access: ${chalk_1.default.green(`Granted — ${models}${exp}`)}`);
|
|
166
172
|
}
|
|
167
173
|
else if (data.cloudAccessAllowed) {
|
|
168
|
-
console.log(` Access: ${
|
|
174
|
+
console.log(` Access: ${chalk_1.default.yellow('Enabled — pay per request with VigCoins')}`);
|
|
169
175
|
}
|
|
170
176
|
else {
|
|
171
|
-
console.log(` Access: ${
|
|
177
|
+
console.log(` Access: ${chalk_1.default.red('Not enabled — contact admin to request cloud access')}`);
|
|
172
178
|
}
|
|
173
179
|
console.log('');
|
|
174
180
|
if (data.cloudModels) {
|
|
175
|
-
console.log(
|
|
176
|
-
console.log(
|
|
181
|
+
console.log(chalk_1.default.bold(' Cloud Model Pricing'));
|
|
182
|
+
console.log(chalk_1.default.gray(' ─────────────────────────────'));
|
|
177
183
|
for (const [alias, cost] of Object.entries(data.cloudModels)) {
|
|
178
184
|
const displayName = alias.replace('vigthoria-cloud-', '').replace(/\b\w/g, c => c.toUpperCase());
|
|
179
|
-
console.log(` ${
|
|
185
|
+
console.log(` ${chalk_1.default.cyan(`vigthoria-cloud-${displayName.toLowerCase()}`).padEnd(36)} ${chalk_1.default.yellow(String(cost))} credits minimum reserve, then token-priced`);
|
|
180
186
|
}
|
|
181
187
|
console.log('');
|
|
182
|
-
console.log(
|
|
188
|
+
console.log(chalk_1.default.gray(' Use --model vigthoria-cloud-fast|balanced|code|power|maximum in vigthoria chat'));
|
|
183
189
|
}
|
|
184
190
|
console.log('');
|
|
185
191
|
}
|
|
@@ -189,3 +195,4 @@ export class WalletCommand {
|
|
|
189
195
|
}
|
|
190
196
|
}
|
|
191
197
|
}
|
|
198
|
+
exports.WalletCommand = WalletCommand;
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WorkflowCommand = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const api_js_1 = require("../utils/api.js");
|
|
9
|
+
const project_memory_js_1 = require("../utils/project-memory.js");
|
|
10
|
+
class WorkflowCommand {
|
|
5
11
|
config;
|
|
6
12
|
logger;
|
|
7
13
|
api;
|
|
8
14
|
constructor(config, logger) {
|
|
9
15
|
this.config = config;
|
|
10
16
|
this.logger = logger;
|
|
11
|
-
this.api = new APIClient(config, logger);
|
|
17
|
+
this.api = new api_js_1.APIClient(config, logger);
|
|
12
18
|
}
|
|
13
19
|
ensureAuthenticated(json = false) {
|
|
14
20
|
if (this.config.isAuthenticated()) {
|
|
@@ -42,7 +48,7 @@ export class WorkflowCommand {
|
|
|
42
48
|
console.log(JSON.stringify(payload, null, 2));
|
|
43
49
|
}
|
|
44
50
|
createProjectMemory() {
|
|
45
|
-
return new ProjectMemoryService(process.cwd());
|
|
51
|
+
return new project_memory_js_1.ProjectMemoryService(process.cwd());
|
|
46
52
|
}
|
|
47
53
|
buildBrainPayload(workflowId, data) {
|
|
48
54
|
const memory = this.createProjectMemory();
|
|
@@ -97,7 +103,7 @@ export class WorkflowCommand {
|
|
|
97
103
|
}
|
|
98
104
|
this.logger.section('Workflow Templates');
|
|
99
105
|
if (templates.length === 0) {
|
|
100
|
-
console.log(
|
|
106
|
+
console.log(chalk_1.default.yellow('No templates matched your filters.'));
|
|
101
107
|
return;
|
|
102
108
|
}
|
|
103
109
|
this.logger.table(['ID', 'Name', 'Category', 'Tags'], templates.map((template) => [
|
|
@@ -132,7 +138,7 @@ export class WorkflowCommand {
|
|
|
132
138
|
}
|
|
133
139
|
this.logger.section('Workflows');
|
|
134
140
|
if (workflows.length === 0) {
|
|
135
|
-
console.log(
|
|
141
|
+
console.log(chalk_1.default.yellow('No workflows found for this account.'));
|
|
136
142
|
return;
|
|
137
143
|
}
|
|
138
144
|
this.logger.table(['ID', 'Name', 'Nodes', 'Runs', 'Updated'], workflows.map((workflow) => [
|
|
@@ -155,9 +161,9 @@ export class WorkflowCommand {
|
|
|
155
161
|
return;
|
|
156
162
|
}
|
|
157
163
|
this.logger.success(`Created workflow ${workflow.name}`);
|
|
158
|
-
console.log(
|
|
164
|
+
console.log(chalk_1.default.gray(`Workflow ID: ${workflow.id}`));
|
|
159
165
|
if (workflow.fromTemplate) {
|
|
160
|
-
console.log(
|
|
166
|
+
console.log(chalk_1.default.gray(`Template: ${workflow.fromTemplate}`));
|
|
161
167
|
}
|
|
162
168
|
}
|
|
163
169
|
async run(workflowId, options) {
|
|
@@ -178,10 +184,10 @@ export class WorkflowCommand {
|
|
|
178
184
|
return;
|
|
179
185
|
}
|
|
180
186
|
this.logger.success(`Workflow execution ${execution.status}`);
|
|
181
|
-
console.log(
|
|
182
|
-
console.log(
|
|
187
|
+
console.log(chalk_1.default.gray(`Execution ID: ${execution.executionId}`));
|
|
188
|
+
console.log(chalk_1.default.gray(`Nodes executed: ${execution.nodesExecuted ?? 0}`));
|
|
183
189
|
if (execution.error) {
|
|
184
|
-
console.log(
|
|
190
|
+
console.log(chalk_1.default.red(execution.error));
|
|
185
191
|
}
|
|
186
192
|
}
|
|
187
193
|
async status(executionId, options) {
|
|
@@ -204,3 +210,4 @@ export class WorkflowCommand {
|
|
|
204
210
|
].join('\n'), 'Workflow Status');
|
|
205
211
|
}
|
|
206
212
|
}
|
|
213
|
+
exports.WorkflowCommand = WorkflowCommand;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Brain Hub client — sync workspace index + fetch account brain context
|
|
3
4
|
* via coder.vigthoria.io (JWT-authenticated).
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.BrainHubClient = void 0;
|
|
8
|
+
class BrainHubClient {
|
|
6
9
|
apiBase;
|
|
7
10
|
getAuthToken;
|
|
8
11
|
constructor(options) {
|
|
@@ -46,3 +49,4 @@ export class BrainHubClient {
|
|
|
46
49
|
return data;
|
|
47
50
|
}
|
|
48
51
|
}
|
|
52
|
+
exports.BrainHubClient = BrainHubClient;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Vigthoria CLI → DevTools Bridge Telemetry Client
|
|
3
4
|
*
|
|
@@ -11,18 +12,57 @@
|
|
|
11
12
|
* - Opt-in via --bridge <url> flag
|
|
12
13
|
* - Sensitive data (API keys, tokens) is never transmitted
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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.BridgeClient = void 0;
|
|
53
|
+
exports.getBridgeClient = getBridgeClient;
|
|
54
|
+
const ws_1 = __importDefault(require("ws"));
|
|
55
|
+
const os = __importStar(require("os"));
|
|
56
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
57
|
+
const logger_js_1 = require("./logger.js");
|
|
18
58
|
// ── Singleton accessor ───────────────────────────────────────────────
|
|
19
59
|
let _instance = null;
|
|
20
60
|
/** Get the active bridge client (may be null if --bridge was not used). */
|
|
21
|
-
|
|
61
|
+
function getBridgeClient() {
|
|
22
62
|
return _instance;
|
|
23
63
|
}
|
|
24
64
|
// ── BridgeClient ─────────────────────────────────────────────────────
|
|
25
|
-
|
|
65
|
+
class BridgeClient {
|
|
26
66
|
ws = null;
|
|
27
67
|
url;
|
|
28
68
|
apiKey;
|
|
@@ -53,7 +93,7 @@ export class BridgeClient {
|
|
|
53
93
|
return;
|
|
54
94
|
return new Promise((resolve) => {
|
|
55
95
|
try {
|
|
56
|
-
this.ws = new
|
|
96
|
+
this.ws = new ws_1.default(this.url, { handshakeTimeout: 8000 });
|
|
57
97
|
this.ws.on('open', () => {
|
|
58
98
|
this.connected = true;
|
|
59
99
|
this.reconnectDelay = 2000;
|
|
@@ -97,7 +137,7 @@ export class BridgeClient {
|
|
|
97
137
|
this.stopHeartbeat();
|
|
98
138
|
this.scheduleReconnect();
|
|
99
139
|
if (process.env.DEBUG || process.env.VIGTHORIA_DEBUG) {
|
|
100
|
-
console.log(
|
|
140
|
+
console.log(chalk_1.default.yellow(`${logger_js_1.CH.warn} Bridge: connection failed, will retry in background.`));
|
|
101
141
|
}
|
|
102
142
|
resolve(); // resolve even on failure – must never block CLI
|
|
103
143
|
});
|
|
@@ -185,7 +225,7 @@ export class BridgeClient {
|
|
|
185
225
|
clientId: this.clientId,
|
|
186
226
|
};
|
|
187
227
|
const json = JSON.stringify(event);
|
|
188
|
-
if (this.connected && this.ws?.readyState ===
|
|
228
|
+
if (this.connected && this.ws?.readyState === ws_1.default.OPEN) {
|
|
189
229
|
try {
|
|
190
230
|
this.ws.send(json);
|
|
191
231
|
}
|
|
@@ -198,7 +238,7 @@ export class BridgeClient {
|
|
|
198
238
|
}
|
|
199
239
|
}
|
|
200
240
|
sendRaw(obj) {
|
|
201
|
-
if (this.ws?.readyState ===
|
|
241
|
+
if (this.ws?.readyState === ws_1.default.OPEN) {
|
|
202
242
|
this.ws.send(JSON.stringify(obj));
|
|
203
243
|
}
|
|
204
244
|
}
|
|
@@ -209,7 +249,7 @@ export class BridgeClient {
|
|
|
209
249
|
this.queue.push(json);
|
|
210
250
|
}
|
|
211
251
|
flushQueue() {
|
|
212
|
-
while (this.queue.length > 0 && this.ws?.readyState ===
|
|
252
|
+
while (this.queue.length > 0 && this.ws?.readyState === ws_1.default.OPEN) {
|
|
213
253
|
const msg = this.queue.shift();
|
|
214
254
|
try {
|
|
215
255
|
this.ws.send(msg);
|
|
@@ -240,3 +280,4 @@ export class BridgeClient {
|
|
|
240
280
|
}
|
|
241
281
|
}
|
|
242
282
|
}
|
|
283
|
+
exports.BridgeClient = BridgeClient;
|
|
@@ -1,10 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Local TF-IDF codebase indexer for CLI (mirrors Vigthoria Code extension indexer).
|
|
3
4
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.CodebaseIndexer = void 0;
|
|
40
|
+
const crypto = __importStar(require("crypto"));
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
42
|
+
const path = __importStar(require("path"));
|
|
43
|
+
class CodebaseIndexer {
|
|
8
44
|
workspaceRoot;
|
|
9
45
|
index = new Map();
|
|
10
46
|
invertedIndex = new Map();
|
|
@@ -312,3 +348,4 @@ export class CodebaseIndexer {
|
|
|
312
348
|
return this.ignorePatterns.some((pattern) => lowerPath.includes(pattern));
|
|
313
349
|
}
|
|
314
350
|
}
|
|
351
|
+
exports.CodebaseIndexer = CodebaseIndexer;
|