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/hub.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Vigthoria CLI - Hub/Marketplace Commands
|
|
3
4
|
*
|
|
4
5
|
* In-flow marketplace discovery and module activation
|
|
5
6
|
* Enables pay-as-you-go module usage directly from the terminal
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.HubCommand = void 0;
|
|
13
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
14
|
const API_BASE = 'https://api.vigthoria.io';
|
|
9
|
-
|
|
15
|
+
class HubCommand {
|
|
10
16
|
config;
|
|
11
17
|
logger;
|
|
12
18
|
constructor(config, logger) {
|
|
@@ -17,7 +23,7 @@ export class HubCommand {
|
|
|
17
23
|
* Search for modules by natural language query
|
|
18
24
|
*/
|
|
19
25
|
async search(query) {
|
|
20
|
-
console.log(
|
|
26
|
+
console.log(chalk_1.default.cyan('\nš Searching Vigthoria Module Hub...\n'));
|
|
21
27
|
try {
|
|
22
28
|
const response = await fetch(`${API_BASE}/api/modules/search`, {
|
|
23
29
|
method: 'POST',
|
|
@@ -31,37 +37,37 @@ export class HubCommand {
|
|
|
31
37
|
}
|
|
32
38
|
const data = await response.json();
|
|
33
39
|
if (data.results.length === 0) {
|
|
34
|
-
console.log(
|
|
35
|
-
console.log(
|
|
40
|
+
console.log(chalk_1.default.yellow('No modules found matching your query.'));
|
|
41
|
+
console.log(chalk_1.default.gray('Try: vigthoria hub list to see all available modules\n'));
|
|
36
42
|
return;
|
|
37
43
|
}
|
|
38
|
-
console.log(
|
|
44
|
+
console.log(chalk_1.default.green(`Found ${data.results.length} module(s):\n`));
|
|
39
45
|
data.results.forEach((module, index) => {
|
|
40
|
-
const statusColor = module.status === 'active' ?
|
|
41
|
-
console.log(
|
|
42
|
-
console.log(
|
|
43
|
-
console.log(
|
|
46
|
+
const statusColor = module.status === 'active' ? chalk_1.default.green : chalk_1.default.gray;
|
|
47
|
+
console.log(chalk_1.default.bold.white(` ${index + 1}. ${module.name}`));
|
|
48
|
+
console.log(chalk_1.default.gray(` ${module.description.substring(0, 80)}...`));
|
|
49
|
+
console.log(chalk_1.default.cyan(` š° ${module.pricing.example}`));
|
|
44
50
|
console.log(statusColor(` š Status: ${module.status.toUpperCase()}`));
|
|
45
|
-
console.log(
|
|
51
|
+
console.log(chalk_1.default.gray(` š ${module.documentation}`));
|
|
46
52
|
console.log();
|
|
47
53
|
});
|
|
48
54
|
if (data.suggestion) {
|
|
49
|
-
console.log(
|
|
55
|
+
console.log(chalk_1.default.cyan(`š” ${data.suggestion}`));
|
|
50
56
|
}
|
|
51
|
-
console.log(
|
|
52
|
-
console.log(
|
|
57
|
+
console.log(chalk_1.default.gray('\nTo activate a module: vigthoria hub activate <module-name>'));
|
|
58
|
+
console.log(chalk_1.default.gray('Example: vigthoria hub activate music\n'));
|
|
53
59
|
}
|
|
54
60
|
catch (error) {
|
|
55
61
|
const errMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
56
|
-
console.log(
|
|
57
|
-
console.log(
|
|
62
|
+
console.log(chalk_1.default.red(`Error: ${errMsg}`));
|
|
63
|
+
console.log(chalk_1.default.gray('Make sure you have an active internet connection.'));
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
66
|
/**
|
|
61
67
|
* List all available modules
|
|
62
68
|
*/
|
|
63
69
|
async list(options) {
|
|
64
|
-
console.log(
|
|
70
|
+
console.log(chalk_1.default.cyan('\nš¦ Vigthoria Module Hub\n'));
|
|
65
71
|
try {
|
|
66
72
|
let url = `${API_BASE}/api/modules`;
|
|
67
73
|
if (options.category) {
|
|
@@ -69,7 +75,7 @@ export class HubCommand {
|
|
|
69
75
|
}
|
|
70
76
|
const response = await fetch(url);
|
|
71
77
|
const data = await response.json();
|
|
72
|
-
console.log(
|
|
78
|
+
console.log(chalk_1.default.bold.white('Available Modules:\n'));
|
|
73
79
|
// Group by category
|
|
74
80
|
const grouped = data.modules.reduce((acc, module) => {
|
|
75
81
|
if (!acc[module.category])
|
|
@@ -78,25 +84,25 @@ export class HubCommand {
|
|
|
78
84
|
return acc;
|
|
79
85
|
}, {});
|
|
80
86
|
Object.entries(grouped).forEach(([category, modules]) => {
|
|
81
|
-
console.log(
|
|
82
|
-
console.log(
|
|
87
|
+
console.log(chalk_1.default.cyan.bold(` ${category.toUpperCase()}`));
|
|
88
|
+
console.log(chalk_1.default.gray(' ' + 'ā'.repeat(50)));
|
|
83
89
|
modules.forEach((module) => {
|
|
84
|
-
console.log(
|
|
85
|
-
console.log(
|
|
86
|
-
console.log(
|
|
90
|
+
console.log(chalk_1.default.white(` š¦ ${module.name.padEnd(25)} ${chalk_1.default.gray(module.id)}`));
|
|
91
|
+
console.log(chalk_1.default.gray(` ${module.description.substring(0, 60)}...`));
|
|
92
|
+
console.log(chalk_1.default.yellow(` ${module.pricing.example}`));
|
|
87
93
|
console.log();
|
|
88
94
|
});
|
|
89
95
|
});
|
|
90
|
-
console.log(
|
|
91
|
-
console.log(
|
|
92
|
-
console.log(
|
|
93
|
-
console.log(
|
|
94
|
-
console.log(
|
|
95
|
-
console.log(
|
|
96
|
+
console.log(chalk_1.default.gray('ā'.repeat(60)));
|
|
97
|
+
console.log(chalk_1.default.cyan('\nCommands:'));
|
|
98
|
+
console.log(chalk_1.default.gray(' vigthoria hub search "generate music" - Semantic search'));
|
|
99
|
+
console.log(chalk_1.default.gray(' vigthoria hub activate <module> - Activate module'));
|
|
100
|
+
console.log(chalk_1.default.gray(' vigthoria hub active - Show active modules'));
|
|
101
|
+
console.log(chalk_1.default.gray(' vigthoria hub info <module> - Module details\n'));
|
|
96
102
|
}
|
|
97
103
|
catch (error) {
|
|
98
104
|
const errMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
99
|
-
console.log(
|
|
105
|
+
console.log(chalk_1.default.red(`Error: ${errMsg}`));
|
|
100
106
|
}
|
|
101
107
|
}
|
|
102
108
|
/**
|
|
@@ -105,10 +111,10 @@ export class HubCommand {
|
|
|
105
111
|
async activate(moduleId) {
|
|
106
112
|
const authToken = this.config.get('authToken');
|
|
107
113
|
if (!authToken) {
|
|
108
|
-
console.log(
|
|
114
|
+
console.log(chalk_1.default.red('\nā Not authenticated. Run: vigthoria login\n'));
|
|
109
115
|
return;
|
|
110
116
|
}
|
|
111
|
-
console.log(
|
|
117
|
+
console.log(chalk_1.default.cyan(`\nš Activating module: ${moduleId}...\n`));
|
|
112
118
|
try {
|
|
113
119
|
const response = await fetch(`${API_BASE}/api/modules/${moduleId}/activate`, {
|
|
114
120
|
method: 'POST',
|
|
@@ -122,27 +128,27 @@ export class HubCommand {
|
|
|
122
128
|
throw new Error(errorData.error || response.statusText);
|
|
123
129
|
}
|
|
124
130
|
const data = await response.json();
|
|
125
|
-
console.log(
|
|
131
|
+
console.log(chalk_1.default.green(`ā
${data.message}`));
|
|
126
132
|
console.log();
|
|
127
|
-
console.log(
|
|
128
|
-
console.log(
|
|
133
|
+
console.log(chalk_1.default.white('š Documentation:'));
|
|
134
|
+
console.log(chalk_1.default.gray(` ${data.documentation}`));
|
|
129
135
|
console.log();
|
|
130
|
-
console.log(
|
|
136
|
+
console.log(chalk_1.default.white('š Available Endpoints:'));
|
|
131
137
|
data.endpoints.forEach((ep) => {
|
|
132
|
-
console.log(
|
|
133
|
-
console.log(
|
|
138
|
+
console.log(chalk_1.default.gray(` ${ep.method.padEnd(6)} ${ep.path}`));
|
|
139
|
+
console.log(chalk_1.default.gray(` ${ep.description}`));
|
|
134
140
|
});
|
|
135
141
|
console.log();
|
|
136
|
-
console.log(
|
|
137
|
-
console.log(
|
|
138
|
-
console.log(
|
|
142
|
+
console.log(chalk_1.default.cyan('š” Quick Start:'));
|
|
143
|
+
console.log(chalk_1.default.gray(` Use your API key in requests:`));
|
|
144
|
+
console.log(chalk_1.default.gray(` Authorization: Bearer ${authToken.substring(0, 8)}...`));
|
|
139
145
|
console.log();
|
|
140
146
|
}
|
|
141
147
|
catch (error) {
|
|
142
148
|
const errMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
143
|
-
console.log(
|
|
144
|
-
console.log(
|
|
145
|
-
console.log(
|
|
149
|
+
console.log(chalk_1.default.red(`ā Activation failed: ${errMsg}`));
|
|
150
|
+
console.log(chalk_1.default.gray('\nMake sure the module ID is correct.'));
|
|
151
|
+
console.log(chalk_1.default.gray('Run: vigthoria hub list to see available modules.'));
|
|
146
152
|
}
|
|
147
153
|
}
|
|
148
154
|
/**
|
|
@@ -151,10 +157,10 @@ export class HubCommand {
|
|
|
151
157
|
async active() {
|
|
152
158
|
const authToken = this.config.get('authToken');
|
|
153
159
|
if (!authToken) {
|
|
154
|
-
console.log(
|
|
160
|
+
console.log(chalk_1.default.red('\nā Not authenticated. Run: vigthoria login\n'));
|
|
155
161
|
return;
|
|
156
162
|
}
|
|
157
|
-
console.log(
|
|
163
|
+
console.log(chalk_1.default.cyan('\nš¦ Your Active Modules\n'));
|
|
158
164
|
try {
|
|
159
165
|
const response = await fetch(`${API_BASE}/api/modules/active`, {
|
|
160
166
|
headers: {
|
|
@@ -166,116 +172,117 @@ export class HubCommand {
|
|
|
166
172
|
}
|
|
167
173
|
const data = await response.json();
|
|
168
174
|
if (data.allAccess) {
|
|
169
|
-
console.log(
|
|
175
|
+
console.log(chalk_1.default.green('š You have access to ALL modules!\n'));
|
|
170
176
|
}
|
|
171
|
-
console.log(
|
|
177
|
+
console.log(chalk_1.default.white(`Tier: ${chalk_1.default.cyan.bold(data.tier.toUpperCase())}`));
|
|
172
178
|
console.log();
|
|
173
179
|
if (data.activeModules.length === 0) {
|
|
174
|
-
console.log(
|
|
175
|
-
console.log(
|
|
180
|
+
console.log(chalk_1.default.yellow('No modules activated yet.'));
|
|
181
|
+
console.log(chalk_1.default.gray('\nActivate modules with: vigthoria hub activate <module>'));
|
|
176
182
|
}
|
|
177
183
|
else {
|
|
178
|
-
console.log(
|
|
184
|
+
console.log(chalk_1.default.white('Active modules:'));
|
|
179
185
|
data.activeModules.forEach((module) => {
|
|
180
|
-
console.log(
|
|
181
|
-
console.log(
|
|
182
|
-
console.log(
|
|
186
|
+
console.log(chalk_1.default.green(` ā
${module.name}`));
|
|
187
|
+
console.log(chalk_1.default.gray(` Endpoint: ${module.endpoint}`));
|
|
188
|
+
console.log(chalk_1.default.yellow(` Cost: ${module.pricing.example}`));
|
|
183
189
|
console.log();
|
|
184
190
|
});
|
|
185
191
|
}
|
|
186
192
|
}
|
|
187
193
|
catch (error) {
|
|
188
194
|
const errMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
189
|
-
console.log(
|
|
195
|
+
console.log(chalk_1.default.red(`Error: ${errMsg}`));
|
|
190
196
|
}
|
|
191
197
|
}
|
|
192
198
|
/**
|
|
193
199
|
* Get detailed info about a specific module
|
|
194
200
|
*/
|
|
195
201
|
async info(moduleId) {
|
|
196
|
-
console.log(
|
|
202
|
+
console.log(chalk_1.default.cyan(`\nš Module Info: ${moduleId}\n`));
|
|
197
203
|
try {
|
|
198
204
|
const response = await fetch(`${API_BASE}/api/modules/${moduleId}`);
|
|
199
205
|
if (!response.ok) {
|
|
200
206
|
throw new Error('Module not found');
|
|
201
207
|
}
|
|
202
208
|
const module = await response.json();
|
|
203
|
-
console.log(
|
|
204
|
-
console.log(
|
|
209
|
+
console.log(chalk_1.default.bold.white(`${module.name}`));
|
|
210
|
+
console.log(chalk_1.default.gray('ā'.repeat(50)));
|
|
205
211
|
console.log();
|
|
206
|
-
console.log(
|
|
207
|
-
console.log(
|
|
212
|
+
console.log(chalk_1.default.white('Description:'));
|
|
213
|
+
console.log(chalk_1.default.gray(` ${module.description}`));
|
|
208
214
|
console.log();
|
|
209
|
-
console.log(
|
|
210
|
-
console.log(
|
|
215
|
+
console.log(chalk_1.default.white('Category:'), chalk_1.default.cyan(module.category));
|
|
216
|
+
console.log(chalk_1.default.white('Tags:'), chalk_1.default.gray(module.tags.join(', ')));
|
|
211
217
|
console.log();
|
|
212
|
-
console.log(
|
|
213
|
-
console.log(
|
|
214
|
-
console.log(
|
|
218
|
+
console.log(chalk_1.default.white('š° Pricing:'));
|
|
219
|
+
console.log(chalk_1.default.yellow(` ${module.pricing.example}`));
|
|
220
|
+
console.log(chalk_1.default.gray(` Billed per ${module.pricing.unit}`));
|
|
215
221
|
console.log();
|
|
216
222
|
if (module.rateLimits) {
|
|
217
|
-
console.log(
|
|
223
|
+
console.log(chalk_1.default.white('š Rate Limits:'));
|
|
218
224
|
Object.entries(module.rateLimits).forEach(([tier, limit]) => {
|
|
219
|
-
console.log(
|
|
225
|
+
console.log(chalk_1.default.gray(` ${tier.padEnd(12)} ${limit} requests/minute`));
|
|
220
226
|
});
|
|
221
227
|
console.log();
|
|
222
228
|
}
|
|
223
229
|
if (module.endpoints) {
|
|
224
|
-
console.log(
|
|
230
|
+
console.log(chalk_1.default.white('š Endpoints:'));
|
|
225
231
|
module.endpoints.forEach((ep) => {
|
|
226
|
-
console.log(
|
|
227
|
-
console.log(
|
|
232
|
+
console.log(chalk_1.default.cyan(` ${ep.method.padEnd(6)} ${ep.path}`));
|
|
233
|
+
console.log(chalk_1.default.gray(` ${ep.description}`));
|
|
228
234
|
});
|
|
229
235
|
console.log();
|
|
230
236
|
}
|
|
231
237
|
// Show code examples if available
|
|
232
238
|
if (module.codeExamples && Object.keys(module.codeExamples).length > 0) {
|
|
233
|
-
console.log(
|
|
239
|
+
console.log(chalk_1.default.white('š Code Examples:'));
|
|
234
240
|
if (module.codeExamples.curl) {
|
|
235
|
-
console.log(
|
|
236
|
-
console.log(
|
|
241
|
+
console.log(chalk_1.default.cyan('\n cURL:'));
|
|
242
|
+
console.log(chalk_1.default.gray(' ' + module.codeExamples.curl.split('\n').join('\n ')));
|
|
237
243
|
}
|
|
238
244
|
if (module.codeExamples.node) {
|
|
239
|
-
console.log(
|
|
240
|
-
console.log(
|
|
245
|
+
console.log(chalk_1.default.cyan('\n Node.js:'));
|
|
246
|
+
console.log(chalk_1.default.gray(' ' + module.codeExamples.node.split('\n').join('\n ')));
|
|
241
247
|
}
|
|
242
248
|
}
|
|
243
249
|
console.log();
|
|
244
|
-
console.log(
|
|
250
|
+
console.log(chalk_1.default.gray(`Documentation: ${module.documentation}`));
|
|
245
251
|
if (module.external) {
|
|
246
|
-
console.log(
|
|
252
|
+
console.log(chalk_1.default.gray(`External URL: ${module.external}`));
|
|
247
253
|
}
|
|
248
254
|
console.log();
|
|
249
|
-
console.log(
|
|
255
|
+
console.log(chalk_1.default.cyan('To activate: ') + chalk_1.default.white(`vigthoria hub activate ${moduleId}`));
|
|
250
256
|
console.log();
|
|
251
257
|
}
|
|
252
258
|
catch (error) {
|
|
253
259
|
const errMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
254
|
-
console.log(
|
|
255
|
-
console.log(
|
|
260
|
+
console.log(chalk_1.default.red(`Error: ${errMsg}`));
|
|
261
|
+
console.log(chalk_1.default.gray('\nAvailable modules: pay, meet, llm, music, voice, images'));
|
|
256
262
|
}
|
|
257
263
|
}
|
|
258
264
|
/**
|
|
259
265
|
* Interactive discover mode - prompts user with suggestions
|
|
260
266
|
*/
|
|
261
267
|
async discover() {
|
|
262
|
-
console.log(
|
|
263
|
-
console.log(
|
|
268
|
+
console.log(chalk_1.default.cyan('\nš Vigthoria Module Discovery\n'));
|
|
269
|
+
console.log(chalk_1.default.white('What are you building? Describe your project:\n'));
|
|
264
270
|
// Show common use cases
|
|
265
|
-
console.log(
|
|
266
|
-
console.log(
|
|
267
|
-
console.log(
|
|
268
|
-
console.log(
|
|
269
|
-
console.log(
|
|
270
|
-
console.log(
|
|
271
|
-
console.log(
|
|
272
|
-
console.log(
|
|
271
|
+
console.log(chalk_1.default.gray('Examples of what you can build:'));
|
|
272
|
+
console.log(chalk_1.default.gray(' ⢠"I need background music for my app"'));
|
|
273
|
+
console.log(chalk_1.default.gray(' ⢠"voice narration for videos"'));
|
|
274
|
+
console.log(chalk_1.default.gray(' ⢠"AI chatbot for customer support"'));
|
|
275
|
+
console.log(chalk_1.default.gray(' ⢠"payment processing for my SaaS"'));
|
|
276
|
+
console.log(chalk_1.default.gray(' ⢠"image generation for social media"\n'));
|
|
277
|
+
console.log(chalk_1.default.cyan('Use: vigthoria hub search "<your use case>"'));
|
|
278
|
+
console.log(chalk_1.default.gray('The AI will find the best modules for your needs.\n'));
|
|
273
279
|
// Show pricing tiers
|
|
274
|
-
console.log(
|
|
275
|
-
console.log(
|
|
276
|
-
console.log(
|
|
277
|
-
console.log(
|
|
280
|
+
console.log(chalk_1.default.white('š³ Subscription Tiers:'));
|
|
281
|
+
console.log(chalk_1.default.gray(' Starter ā¬49/mo 50 credits'));
|
|
282
|
+
console.log(chalk_1.default.gray(' Business ā¬199/mo 500 credits'));
|
|
283
|
+
console.log(chalk_1.default.gray(' Enterprise ā¬499/mo 2000 credits'));
|
|
278
284
|
console.log();
|
|
279
|
-
console.log(
|
|
285
|
+
console.log(chalk_1.default.cyan('Get started: https://landing.vigthoria.io/api-keys.html\n'));
|
|
280
286
|
}
|
|
281
287
|
}
|
|
288
|
+
exports.HubCommand = HubCommand;
|
package/dist/commands/index.js
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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");
|
|
19
24
|
function isRegisterableCommand(value) {
|
|
20
25
|
return Boolean(value && typeof value === 'object');
|
|
21
26
|
}
|
|
@@ -66,75 +71,75 @@ function registerVersionInfoCommand(program) {
|
|
|
66
71
|
const commandRegistry = [
|
|
67
72
|
{
|
|
68
73
|
name: 'auth',
|
|
69
|
-
handler: registerAuthCommands,
|
|
74
|
+
handler: auth_js_1.registerAuthCommands,
|
|
70
75
|
},
|
|
71
76
|
{
|
|
72
77
|
name: 'chat',
|
|
73
|
-
handler: createClassRegistrar(ChatCommand),
|
|
78
|
+
handler: createClassRegistrar(chat_js_1.ChatCommand),
|
|
74
79
|
},
|
|
75
80
|
{
|
|
76
81
|
name: 'edit',
|
|
77
|
-
handler: createClassRegistrar(EditCommand),
|
|
82
|
+
handler: createClassRegistrar(edit_js_1.EditCommand),
|
|
78
83
|
},
|
|
79
84
|
{
|
|
80
85
|
name: 'generate',
|
|
81
|
-
handler: createClassRegistrar(GenerateCommand),
|
|
86
|
+
handler: createClassRegistrar(generate_js_1.GenerateCommand),
|
|
82
87
|
},
|
|
83
88
|
{
|
|
84
89
|
name: 'explain',
|
|
85
|
-
handler: createClassRegistrar(ExplainCommand),
|
|
90
|
+
handler: createClassRegistrar(explain_js_1.ExplainCommand),
|
|
86
91
|
},
|
|
87
92
|
{
|
|
88
93
|
name: 'config',
|
|
89
|
-
handler: createClassRegistrar(ConfigCommand),
|
|
94
|
+
handler: createClassRegistrar(config_js_1.ConfigCommand),
|
|
90
95
|
},
|
|
91
96
|
{
|
|
92
97
|
name: 'review',
|
|
93
|
-
handler: createClassRegistrar(ReviewCommand),
|
|
98
|
+
handler: createClassRegistrar(review_js_1.ReviewCommand),
|
|
94
99
|
},
|
|
95
100
|
{
|
|
96
101
|
name: 'hub',
|
|
97
|
-
handler: createClassRegistrar(HubCommand),
|
|
102
|
+
handler: createClassRegistrar(hub_js_1.HubCommand),
|
|
98
103
|
},
|
|
99
104
|
{
|
|
100
105
|
name: 'repo',
|
|
101
|
-
handler: createClassRegistrar(RepoCommand),
|
|
106
|
+
handler: createClassRegistrar(repo_js_1.RepoCommand),
|
|
102
107
|
},
|
|
103
108
|
{
|
|
104
109
|
name: 'deploy',
|
|
105
|
-
handler: createClassRegistrar(DeployCommand),
|
|
110
|
+
handler: createClassRegistrar(deploy_js_1.DeployCommand),
|
|
106
111
|
},
|
|
107
112
|
{
|
|
108
113
|
name: 'bridge',
|
|
109
|
-
handler: createClassRegistrar(BridgeCommand),
|
|
114
|
+
handler: createClassRegistrar(bridge_js_1.BridgeCommand),
|
|
110
115
|
},
|
|
111
116
|
{
|
|
112
117
|
name: 'workflow',
|
|
113
|
-
handler: createClassRegistrar(WorkflowCommand),
|
|
118
|
+
handler: createClassRegistrar(workflow_js_1.WorkflowCommand),
|
|
114
119
|
},
|
|
115
120
|
{
|
|
116
121
|
name: 'preview',
|
|
117
|
-
handler: createClassRegistrar(PreviewCommand),
|
|
122
|
+
handler: createClassRegistrar(preview_js_1.PreviewCommand),
|
|
118
123
|
},
|
|
119
124
|
{
|
|
120
125
|
name: 'legion',
|
|
121
|
-
handler: createClassRegistrar(LegionCommand),
|
|
126
|
+
handler: createClassRegistrar(legion_js_1.LegionCommand),
|
|
122
127
|
},
|
|
123
128
|
{
|
|
124
129
|
name: 'history',
|
|
125
|
-
handler: createClassRegistrar(HistoryCommand),
|
|
130
|
+
handler: createClassRegistrar(history_js_1.HistoryCommand),
|
|
126
131
|
},
|
|
127
132
|
{
|
|
128
133
|
name: 'replay',
|
|
129
|
-
handler: createClassRegistrar(ReplayCommand),
|
|
134
|
+
handler: createClassRegistrar(replay_js_1.ReplayCommand),
|
|
130
135
|
},
|
|
131
136
|
{
|
|
132
137
|
name: 'fork',
|
|
133
|
-
handler: createClassRegistrar(ForkCommand),
|
|
138
|
+
handler: createClassRegistrar(fork_js_1.ForkCommand),
|
|
134
139
|
},
|
|
135
140
|
{
|
|
136
141
|
name: 'cancel',
|
|
137
|
-
handler: createClassRegistrar(CancelCommand),
|
|
142
|
+
handler: createClassRegistrar(cancel_js_1.CancelCommand),
|
|
138
143
|
},
|
|
139
144
|
{
|
|
140
145
|
name: 'doctor',
|
|
@@ -155,7 +160,7 @@ function commandNameMatches(entry, requestedName) {
|
|
|
155
160
|
}
|
|
156
161
|
return Boolean(entry.aliases?.some((alias) => normalizeCommandName(alias) === requestedName));
|
|
157
162
|
}
|
|
158
|
-
|
|
163
|
+
function resolveCommand(name) {
|
|
159
164
|
const requestedName = normalizeCommandName(name);
|
|
160
165
|
if (!requestedName) {
|
|
161
166
|
return null;
|
|
@@ -163,7 +168,7 @@ export function resolveCommand(name) {
|
|
|
163
168
|
const entry = commandRegistry.find((candidate) => commandNameMatches(candidate, requestedName));
|
|
164
169
|
return entry?.handler ?? null;
|
|
165
170
|
}
|
|
166
|
-
|
|
171
|
+
function registerCommands(cli) {
|
|
167
172
|
if (!cli || typeof cli.command !== 'function') {
|
|
168
173
|
throw new Error('registerCommands requires a Commander-compatible CLI instance');
|
|
169
174
|
}
|
|
@@ -172,6 +177,6 @@ export function registerCommands(cli) {
|
|
|
172
177
|
entry.handler(program);
|
|
173
178
|
}
|
|
174
179
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
180
|
+
exports.setupCommands = registerCommands;
|
|
181
|
+
exports.configureCommands = registerCommands;
|
|
182
|
+
exports.default = registerCommands;
|