vigthoria-cli 1.6.8 → 1.6.9
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/README.md +1 -1
- package/dist/commands/auth.d.ts +0 -1
- package/dist/commands/auth.js +34 -2
- package/dist/commands/bridge.d.ts +7 -0
- package/dist/commands/bridge.js +31 -0
- package/dist/commands/chat.d.ts +18 -1
- package/dist/commands/chat.js +375 -29
- package/dist/commands/config.d.ts +0 -1
- package/dist/commands/config.js +0 -1
- package/dist/commands/deploy.d.ts +0 -1
- package/dist/commands/deploy.js +0 -1
- package/dist/commands/edit.d.ts +0 -1
- package/dist/commands/edit.js +0 -1
- package/dist/commands/explain.d.ts +0 -1
- package/dist/commands/explain.js +0 -1
- package/dist/commands/generate.d.ts +0 -1
- package/dist/commands/generate.js +0 -1
- package/dist/commands/hub.d.ts +0 -1
- package/dist/commands/hub.js +0 -1
- package/dist/commands/repo.d.ts +0 -1
- package/dist/commands/repo.js +0 -1
- package/dist/commands/review.d.ts +0 -1
- package/dist/commands/review.js +0 -1
- package/dist/commands/workflow.d.ts +31 -0
- package/dist/commands/workflow.js +140 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +119 -11
- package/dist/utils/api.d.ts +160 -1
- package/dist/utils/api.js +1125 -52
- package/dist/utils/config.d.ts +13 -7
- package/dist/utils/config.js +20 -11
- package/dist/utils/files.d.ts +0 -1
- package/dist/utils/files.js +0 -1
- package/dist/utils/logger.d.ts +0 -1
- package/dist/utils/logger.js +0 -1
- package/dist/utils/session.d.ts +2 -2
- package/dist/utils/session.js +2 -2
- package/dist/utils/tools.d.ts +0 -1
- package/dist/utils/tools.js +0 -1
- package/package.json +20 -3
- package/dist/commands/auth.d.ts.map +0 -1
- package/dist/commands/auth.js.map +0 -1
- package/dist/commands/chat.d.ts.map +0 -1
- package/dist/commands/chat.js.map +0 -1
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/deploy.d.ts.map +0 -1
- package/dist/commands/deploy.js.map +0 -1
- package/dist/commands/edit.d.ts.map +0 -1
- package/dist/commands/edit.js.map +0 -1
- package/dist/commands/explain.d.ts.map +0 -1
- package/dist/commands/explain.js.map +0 -1
- package/dist/commands/generate.d.ts.map +0 -1
- package/dist/commands/generate.js.map +0 -1
- package/dist/commands/hub.d.ts.map +0 -1
- package/dist/commands/hub.js.map +0 -1
- package/dist/commands/repo.d.ts.map +0 -1
- package/dist/commands/repo.js.map +0 -1
- package/dist/commands/review.d.ts.map +0 -1
- package/dist/commands/review.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/utils/api.d.ts.map +0 -1
- package/dist/utils/api.js.map +0 -1
- package/dist/utils/config.d.ts.map +0 -1
- package/dist/utils/config.js.map +0 -1
- package/dist/utils/files.d.ts.map +0 -1
- package/dist/utils/files.js.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/session.d.ts.map +0 -1
- package/dist/utils/session.js.map +0 -1
- package/dist/utils/tools.d.ts.map +0 -1
- package/dist/utils/tools.js.map +0 -1
|
@@ -0,0 +1,140 @@
|
|
|
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
|
+
class WorkflowCommand {
|
|
10
|
+
config;
|
|
11
|
+
logger;
|
|
12
|
+
api;
|
|
13
|
+
constructor(config, logger) {
|
|
14
|
+
this.config = config;
|
|
15
|
+
this.logger = logger;
|
|
16
|
+
this.api = new api_js_1.APIClient(config, logger);
|
|
17
|
+
}
|
|
18
|
+
ensureAuthenticated(json = false) {
|
|
19
|
+
if (this.config.isAuthenticated()) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const message = 'Not authenticated. Run vigthoria login first.';
|
|
23
|
+
if (json) {
|
|
24
|
+
console.log(JSON.stringify({ success: false, error: message }, null, 2));
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
this.logger.error(message);
|
|
28
|
+
}
|
|
29
|
+
throw new Error(message);
|
|
30
|
+
}
|
|
31
|
+
parseJsonOption(rawValue, fieldName) {
|
|
32
|
+
if (!rawValue) {
|
|
33
|
+
return {};
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
const parsed = JSON.parse(rawValue);
|
|
37
|
+
if (!parsed || Array.isArray(parsed) || typeof parsed !== 'object') {
|
|
38
|
+
throw new Error(`${fieldName} must be a JSON object.`);
|
|
39
|
+
}
|
|
40
|
+
return parsed;
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
throw new Error(`Invalid ${fieldName} JSON: ${error.message}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
printJson(payload) {
|
|
47
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
48
|
+
}
|
|
49
|
+
async templates(options) {
|
|
50
|
+
this.ensureAuthenticated(Boolean(options.json));
|
|
51
|
+
const templates = await this.api.listVigFlowTemplates({
|
|
52
|
+
category: options.category,
|
|
53
|
+
search: options.search,
|
|
54
|
+
});
|
|
55
|
+
if (options.json) {
|
|
56
|
+
this.printJson({ success: true, templates });
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this.logger.section('Workflow Templates');
|
|
60
|
+
if (templates.length === 0) {
|
|
61
|
+
console.log(chalk_1.default.yellow('No templates matched your filters.'));
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
this.logger.table(['ID', 'Name', 'Category', 'Tags'], templates.map((template) => [
|
|
65
|
+
template.id,
|
|
66
|
+
template.name,
|
|
67
|
+
template.category,
|
|
68
|
+
(template.tags || []).slice(0, 3).join(', '),
|
|
69
|
+
]));
|
|
70
|
+
}
|
|
71
|
+
async list(options) {
|
|
72
|
+
this.ensureAuthenticated(Boolean(options.json));
|
|
73
|
+
const workflows = await this.api.listVigFlowWorkflows();
|
|
74
|
+
if (options.json) {
|
|
75
|
+
this.printJson({ success: true, workflows });
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
this.logger.section('Workflows');
|
|
79
|
+
if (workflows.length === 0) {
|
|
80
|
+
console.log(chalk_1.default.yellow('No workflows found for this account.'));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
this.logger.table(['ID', 'Name', 'Nodes', 'Runs', 'Updated'], workflows.map((workflow) => [
|
|
84
|
+
workflow.id,
|
|
85
|
+
workflow.name,
|
|
86
|
+
String(workflow.nodeCount),
|
|
87
|
+
String(workflow.executionCount),
|
|
88
|
+
workflow.updatedAt ? new Date(workflow.updatedAt).toLocaleString() : '-',
|
|
89
|
+
]));
|
|
90
|
+
}
|
|
91
|
+
async useTemplate(templateId, options) {
|
|
92
|
+
this.ensureAuthenticated(Boolean(options.json));
|
|
93
|
+
const variables = this.parseJsonOption(options.variables, 'variables');
|
|
94
|
+
const workflow = await this.api.useVigFlowTemplate(templateId, {
|
|
95
|
+
name: options.name,
|
|
96
|
+
variables,
|
|
97
|
+
});
|
|
98
|
+
if (options.json) {
|
|
99
|
+
this.printJson({ success: true, workflow });
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
this.logger.success(`Created workflow ${workflow.name}`);
|
|
103
|
+
console.log(chalk_1.default.gray(`Workflow ID: ${workflow.id}`));
|
|
104
|
+
if (workflow.fromTemplate) {
|
|
105
|
+
console.log(chalk_1.default.gray(`Template: ${workflow.fromTemplate}`));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async run(workflowId, options) {
|
|
109
|
+
this.ensureAuthenticated(Boolean(options.json));
|
|
110
|
+
const data = this.parseJsonOption(options.data, 'data');
|
|
111
|
+
const execution = await this.api.runVigFlowWorkflow(workflowId, { data });
|
|
112
|
+
if (options.json) {
|
|
113
|
+
this.printJson({ success: true, execution });
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
this.logger.success(`Workflow execution ${execution.status}`);
|
|
117
|
+
console.log(chalk_1.default.gray(`Execution ID: ${execution.executionId}`));
|
|
118
|
+
console.log(chalk_1.default.gray(`Nodes executed: ${execution.nodesExecuted ?? 0}`));
|
|
119
|
+
if (execution.error) {
|
|
120
|
+
console.log(chalk_1.default.red(execution.error));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
async status(executionId, options) {
|
|
124
|
+
this.ensureAuthenticated(Boolean(options.json));
|
|
125
|
+
const execution = await this.api.getVigFlowExecutionStatus(executionId);
|
|
126
|
+
if (options.json) {
|
|
127
|
+
this.printJson({ success: true, execution });
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
this.logger.box([
|
|
131
|
+
`Execution: ${execution.id}`,
|
|
132
|
+
`Workflow: ${execution.workflowId}`,
|
|
133
|
+
`Status: ${execution.status}`,
|
|
134
|
+
`Nodes: ${execution.nodesExecuted ?? 0}/${execution.totalNodes ?? '-'}`,
|
|
135
|
+
`Started: ${execution.startedAt || '-'}`,
|
|
136
|
+
`Completed: ${execution.completedAt || '-'}`,
|
|
137
|
+
].join('\n'), 'Workflow Status');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
exports.WorkflowCommand = WorkflowCommand;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* vigthoria login - Authenticate with Vigthoria
|
|
13
13
|
* vigthoria config - Configure settings
|
|
14
14
|
* vigthoria hub - Discover & activate API modules
|
|
15
|
+
* vigthoria workflow - Manage repeatable VigFlow workflows
|
|
16
|
+
* vigthoria operator - Start BMAD operator mode
|
|
15
17
|
*/
|
|
16
18
|
export {};
|
|
17
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* vigthoria login - Authenticate with Vigthoria
|
|
14
14
|
* vigthoria config - Configure settings
|
|
15
15
|
* vigthoria hub - Discover & activate API modules
|
|
16
|
+
* vigthoria workflow - Manage repeatable VigFlow workflows
|
|
17
|
+
* vigthoria operator - Start BMAD operator mode
|
|
16
18
|
*/
|
|
17
19
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
20
|
if (k2 === undefined) k2 = k;
|
|
@@ -62,6 +64,8 @@ const review_js_1 = require("./commands/review.js");
|
|
|
62
64
|
const hub_js_1 = require("./commands/hub.js");
|
|
63
65
|
const repo_js_1 = require("./commands/repo.js");
|
|
64
66
|
const deploy_js_1 = require("./commands/deploy.js");
|
|
67
|
+
const bridge_js_1 = require("./commands/bridge.js");
|
|
68
|
+
const workflow_js_1 = require("./commands/workflow.js");
|
|
65
69
|
const config_js_2 = require("./utils/config.js");
|
|
66
70
|
const logger_js_1 = require("./utils/logger.js");
|
|
67
71
|
const chalk_1 = __importDefault(require("chalk"));
|
|
@@ -94,7 +98,7 @@ function getVersion() {
|
|
|
94
98
|
catch (e) {
|
|
95
99
|
// Fallback to hardcoded version
|
|
96
100
|
}
|
|
97
|
-
return '1.6.
|
|
101
|
+
return '1.6.9';
|
|
98
102
|
}
|
|
99
103
|
const VERSION = getVersion();
|
|
100
104
|
/**
|
|
@@ -150,10 +154,11 @@ async function main() {
|
|
|
150
154
|
const logger = new logger_js_1.Logger();
|
|
151
155
|
const invokedBinaryName = getInvokedBinaryName();
|
|
152
156
|
const firstArg = process.argv[2];
|
|
157
|
+
const jsonOutputRequested = process.argv.includes('--json');
|
|
153
158
|
if (invokedBinaryName === 'vigthoria-chat') {
|
|
154
159
|
const knownCommands = new Set([
|
|
155
160
|
'chat', 'chat-resume', 'agent', 'edit', 'generate', 'explain', 'fix', 'review',
|
|
156
|
-
'hub', 'repo', 'deploy', 'login', 'logout', 'status', 'config', 'update',
|
|
161
|
+
'hub', 'repo', 'deploy', 'operator', 'workflow', 'flow', 'login', 'logout', 'status', 'config', 'update',
|
|
157
162
|
'--help', '-h', '--version', '-V', 'help', 'version',
|
|
158
163
|
]);
|
|
159
164
|
if (!firstArg || firstArg.startsWith('-') || !knownCommands.has(firstArg)) {
|
|
@@ -167,15 +172,19 @@ async function main() {
|
|
|
167
172
|
// Calculate padding for centering
|
|
168
173
|
const titlePad = Math.floor((boxWidth - 4 - titleText.length) / 2);
|
|
169
174
|
const versionPad = Math.floor((boxWidth - 4 - versionText.length) / 2);
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
if (process.env.VIGTHORIA_NO_BANNER !== '1' && !jsonOutputRequested) {
|
|
176
|
+
console.log(chalk_1.default.cyan('╔' + '═'.repeat(boxWidth) + '╗'));
|
|
177
|
+
console.log(chalk_1.default.cyan('║' + ' '.repeat(boxWidth) + '║'));
|
|
178
|
+
console.log(chalk_1.default.cyan('║') + ' '.repeat(titlePad) + chalk_1.default.bold.white('VIGTHORIA CLI') + chalk_1.default.cyan(' - AI-Powered Coding Assistant') + ' '.repeat(boxWidth - titlePad - titleText.length) + chalk_1.default.cyan('║'));
|
|
179
|
+
console.log(chalk_1.default.cyan('║') + ' '.repeat(versionPad) + chalk_1.default.gray(versionText) + ' '.repeat(boxWidth - versionPad - versionText.length) + chalk_1.default.cyan('║'));
|
|
180
|
+
console.log(chalk_1.default.cyan('║' + ' '.repeat(boxWidth) + '║'));
|
|
181
|
+
console.log(chalk_1.default.cyan('╚' + '═'.repeat(boxWidth) + '╝'));
|
|
182
|
+
console.log();
|
|
183
|
+
}
|
|
177
184
|
// Check for updates in background (don't wait)
|
|
178
|
-
|
|
185
|
+
if (process.env.VIGTHORIA_NO_UPDATE_CHECK !== '1' && !jsonOutputRequested) {
|
|
186
|
+
checkForUpdatesQuietly();
|
|
187
|
+
}
|
|
179
188
|
program
|
|
180
189
|
.name(invokedBinaryName === 'vigthoria-chat' ? 'vigthoria-chat' : 'vigthoria')
|
|
181
190
|
.description('AI-powered terminal coding assistant for Vigthoria Coder subscribers')
|
|
@@ -191,6 +200,8 @@ async function main() {
|
|
|
191
200
|
.option('--no-agent', 'Disable agentic mode (simple chat only)')
|
|
192
201
|
.option('-r, --resume', 'Resume last session for this project', false)
|
|
193
202
|
.option('--prompt <text>', 'Run a single prompt directly and exit')
|
|
203
|
+
.option('-w, --workflow <selector>', 'Route prompts through a named or explicit VigFlow workflow target')
|
|
204
|
+
.option('--json', 'Emit machine-readable JSON output for direct prompt runs', false)
|
|
194
205
|
.option('--auto-approve', 'Auto-approve agent actions (dangerous!)', false)
|
|
195
206
|
.action(async (options) => {
|
|
196
207
|
const chat = new chat_js_1.ChatCommand(config, logger);
|
|
@@ -198,6 +209,8 @@ async function main() {
|
|
|
198
209
|
model: options.model,
|
|
199
210
|
project: options.project,
|
|
200
211
|
agent: options.agent,
|
|
212
|
+
workflow: options.workflow,
|
|
213
|
+
json: options.json,
|
|
201
214
|
autoApprove: options.autoApprove,
|
|
202
215
|
resume: options.resume,
|
|
203
216
|
prompt: options.prompt,
|
|
@@ -211,6 +224,8 @@ async function main() {
|
|
|
211
224
|
.option('-a, --agent', 'Enable agentic mode (default: true for best quality)', true)
|
|
212
225
|
.option('--no-agent', 'Disable agentic mode (simple chat only)')
|
|
213
226
|
.option('--prompt <text>', 'Run a single prompt directly and exit after resuming context')
|
|
227
|
+
.option('-w, --workflow <selector>', 'Route prompts through a named or explicit VigFlow workflow target')
|
|
228
|
+
.option('--json', 'Emit machine-readable JSON output for direct prompt runs', false)
|
|
214
229
|
.option('--auto-approve', 'Auto-approve agent actions (dangerous!)', false)
|
|
215
230
|
.action(async (options) => {
|
|
216
231
|
const chat = new chat_js_1.ChatCommand(config, logger);
|
|
@@ -218,6 +233,8 @@ async function main() {
|
|
|
218
233
|
model: options.model,
|
|
219
234
|
project: options.project,
|
|
220
235
|
agent: options.agent,
|
|
236
|
+
workflow: options.workflow,
|
|
237
|
+
json: options.json,
|
|
221
238
|
autoApprove: options.autoApprove,
|
|
222
239
|
resume: true,
|
|
223
240
|
prompt: options.prompt,
|
|
@@ -232,6 +249,8 @@ async function main() {
|
|
|
232
249
|
.option('-m, --model <model>', 'Select AI model (agent, code, cloud, ultra)', 'agent')
|
|
233
250
|
.option('-p, --project <path>', 'Set project context path', process.cwd())
|
|
234
251
|
.option('--prompt <text>', 'Run a single agent prompt directly and exit')
|
|
252
|
+
.option('-w, --workflow <selector>', 'Run the prompt through a named or explicit VigFlow workflow target')
|
|
253
|
+
.option('--json', 'Emit machine-readable JSON output for direct prompt runs', false)
|
|
235
254
|
.option('--auto-approve', 'Auto-approve all actions (dangerous!)', false)
|
|
236
255
|
.action(async (options) => {
|
|
237
256
|
const chat = new chat_js_1.ChatCommand(config, logger);
|
|
@@ -239,10 +258,45 @@ async function main() {
|
|
|
239
258
|
model: options.model,
|
|
240
259
|
project: options.project,
|
|
241
260
|
agent: true,
|
|
261
|
+
operator: false,
|
|
262
|
+
workflow: options.workflow,
|
|
263
|
+
json: options.json,
|
|
242
264
|
autoApprove: options.autoApprove,
|
|
243
265
|
prompt: options.prompt,
|
|
244
266
|
});
|
|
245
267
|
});
|
|
268
|
+
program
|
|
269
|
+
.command('operator')
|
|
270
|
+
.alias('op')
|
|
271
|
+
.description('Start BMAD operator mode for infrastructure and system workflows')
|
|
272
|
+
.option('-m, --model <model>', 'Select operator model (code-8b, code, agent)', 'code-8b')
|
|
273
|
+
.option('-p, --project <path>', 'Set project context path', process.cwd())
|
|
274
|
+
.option('--prompt <text>', 'Run a single operator prompt directly and exit')
|
|
275
|
+
.option('-w, --workflow <selector>', 'Run the prompt through a named or explicit VigFlow workflow target')
|
|
276
|
+
.option('--save-plan', 'Save the completed BMAD plan into VigFlow for rerun and audit', false)
|
|
277
|
+
.option('--json', 'Emit machine-readable JSON output for direct prompt runs', false)
|
|
278
|
+
.action(async (options) => {
|
|
279
|
+
const chat = new chat_js_1.ChatCommand(config, logger);
|
|
280
|
+
await chat.run({
|
|
281
|
+
model: options.model,
|
|
282
|
+
project: options.project,
|
|
283
|
+
agent: false,
|
|
284
|
+
operator: true,
|
|
285
|
+
workflow: options.workflow,
|
|
286
|
+
savePlan: options.savePlan,
|
|
287
|
+
json: options.json,
|
|
288
|
+
prompt: options.prompt,
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
program
|
|
292
|
+
.command('bridge')
|
|
293
|
+
.description('Inspect local DevTools Bridge availability for browser debugging tasks')
|
|
294
|
+
.command('status')
|
|
295
|
+
.description('Show live DevTools Bridge status')
|
|
296
|
+
.action(async () => {
|
|
297
|
+
const bridge = new bridge_js_1.BridgeCommand(config, logger);
|
|
298
|
+
await bridge.status();
|
|
299
|
+
});
|
|
246
300
|
// Edit command - Edit files with AI
|
|
247
301
|
program
|
|
248
302
|
.command('edit <file>')
|
|
@@ -299,6 +353,61 @@ async function main() {
|
|
|
299
353
|
const review = new review_js_1.ReviewCommand(config, logger);
|
|
300
354
|
await review.run(file, options);
|
|
301
355
|
});
|
|
356
|
+
const workflowCommand = program
|
|
357
|
+
.command('workflow')
|
|
358
|
+
.alias('flow')
|
|
359
|
+
.description('List, instantiate, and run repeatable VigFlow workflows');
|
|
360
|
+
workflowCommand
|
|
361
|
+
.command('templates')
|
|
362
|
+
.alias('catalog')
|
|
363
|
+
.description('List available VigFlow templates')
|
|
364
|
+
.option('-c, --category <category>', 'Filter templates by category')
|
|
365
|
+
.option('-s, --search <query>', 'Search template names, descriptions, and tags')
|
|
366
|
+
.option('--json', 'Emit machine-readable JSON output', false)
|
|
367
|
+
.action(async (options) => {
|
|
368
|
+
const workflow = new workflow_js_1.WorkflowCommand(config, logger);
|
|
369
|
+
await workflow.templates(options);
|
|
370
|
+
});
|
|
371
|
+
workflowCommand
|
|
372
|
+
.command('list')
|
|
373
|
+
.alias('ls')
|
|
374
|
+
.description('List workflows created for the current account')
|
|
375
|
+
.option('--json', 'Emit machine-readable JSON output', false)
|
|
376
|
+
.action(async (options) => {
|
|
377
|
+
const workflow = new workflow_js_1.WorkflowCommand(config, logger);
|
|
378
|
+
await workflow.list(options);
|
|
379
|
+
});
|
|
380
|
+
workflowCommand
|
|
381
|
+
.command('use-template <templateId>')
|
|
382
|
+
.description('Create a workflow from a built-in or saved template')
|
|
383
|
+
.option('-n, --name <name>', 'Override the workflow name')
|
|
384
|
+
.option('-v, --variables <json>', 'Template variables as a JSON object')
|
|
385
|
+
.option('--json', 'Emit machine-readable JSON output', false)
|
|
386
|
+
.action(async (templateId, options) => {
|
|
387
|
+
const workflow = new workflow_js_1.WorkflowCommand(config, logger);
|
|
388
|
+
await workflow.useTemplate(templateId, options);
|
|
389
|
+
});
|
|
390
|
+
workflowCommand
|
|
391
|
+
.command('run <workflowId>')
|
|
392
|
+
.description('Run a workflow immediately')
|
|
393
|
+
.option('-d, --data <json>', 'Execution input data as a JSON object')
|
|
394
|
+
.option('--json', 'Emit machine-readable JSON output', false)
|
|
395
|
+
.action(async (workflowId, options) => {
|
|
396
|
+
const workflow = new workflow_js_1.WorkflowCommand(config, logger);
|
|
397
|
+
await workflow.run(workflowId, options);
|
|
398
|
+
});
|
|
399
|
+
workflowCommand
|
|
400
|
+
.command('status <executionId>')
|
|
401
|
+
.description('Get the current or final status of a workflow execution')
|
|
402
|
+
.option('--json', 'Emit machine-readable JSON output', false)
|
|
403
|
+
.action(async (executionId, options) => {
|
|
404
|
+
const workflow = new workflow_js_1.WorkflowCommand(config, logger);
|
|
405
|
+
await workflow.status(executionId, options);
|
|
406
|
+
});
|
|
407
|
+
workflowCommand.action(async () => {
|
|
408
|
+
const workflow = new workflow_js_1.WorkflowCommand(config, logger);
|
|
409
|
+
await workflow.templates({});
|
|
410
|
+
});
|
|
302
411
|
// ==================== HUB / MARKETPLACE COMMANDS ====================
|
|
303
412
|
// Hub command - Discover and activate API modules
|
|
304
413
|
const hubCommand = program
|
|
@@ -620,4 +729,3 @@ main().catch((err) => {
|
|
|
620
729
|
console.error(chalk_1.default.red('Error:'), err.message);
|
|
621
730
|
process.exit(1);
|
|
622
731
|
});
|
|
623
|
-
//# sourceMappingURL=index.js.map
|
package/dist/utils/api.d.ts
CHANGED
|
@@ -21,10 +21,59 @@ export interface ChatResponse {
|
|
|
21
21
|
export interface V3AgentWorkflowResponse {
|
|
22
22
|
content: string;
|
|
23
23
|
taskId: string | null;
|
|
24
|
+
contextId?: string | null;
|
|
24
25
|
backendUrl: string;
|
|
25
26
|
partial?: boolean;
|
|
26
27
|
metadata?: Record<string, unknown>;
|
|
27
28
|
}
|
|
29
|
+
export interface FrontendPreviewGateResult {
|
|
30
|
+
required: boolean;
|
|
31
|
+
passed: boolean;
|
|
32
|
+
backendUrl?: string;
|
|
33
|
+
entryPath?: string;
|
|
34
|
+
assetPaths?: {
|
|
35
|
+
css: string[];
|
|
36
|
+
js: string[];
|
|
37
|
+
};
|
|
38
|
+
artifacts?: {
|
|
39
|
+
manifestPath?: string;
|
|
40
|
+
screenshotPath?: string;
|
|
41
|
+
previewFileUrl?: string;
|
|
42
|
+
screenshotCaptured?: boolean;
|
|
43
|
+
screenshotError?: string;
|
|
44
|
+
};
|
|
45
|
+
modes?: {
|
|
46
|
+
design?: {
|
|
47
|
+
ready: boolean;
|
|
48
|
+
devices?: string[];
|
|
49
|
+
variantCount?: number;
|
|
50
|
+
};
|
|
51
|
+
live?: {
|
|
52
|
+
ready: boolean;
|
|
53
|
+
entryPoint?: string;
|
|
54
|
+
};
|
|
55
|
+
production?: {
|
|
56
|
+
ready: boolean;
|
|
57
|
+
deploymentTarget?: string;
|
|
58
|
+
recommendedCommand?: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
summary?: Record<string, unknown>;
|
|
62
|
+
processingTimeMs?: number;
|
|
63
|
+
error?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface OperatorWorkflowResponse {
|
|
66
|
+
content: string;
|
|
67
|
+
workflowId: string | null;
|
|
68
|
+
contextId?: string | null;
|
|
69
|
+
backendUrl: string;
|
|
70
|
+
savedWorkflow?: {
|
|
71
|
+
id: string;
|
|
72
|
+
name?: string | null;
|
|
73
|
+
sourceWorkflowId?: string | null;
|
|
74
|
+
} | null;
|
|
75
|
+
metadata?: Record<string, unknown>;
|
|
76
|
+
}
|
|
28
77
|
export interface StreamChunk {
|
|
29
78
|
type: 'content' | 'done' | 'error';
|
|
30
79
|
content?: string;
|
|
@@ -43,6 +92,68 @@ export interface APIHealthStatus {
|
|
|
43
92
|
models: EndpointHealthStatus;
|
|
44
93
|
selfHosted: EndpointHealthStatus | null;
|
|
45
94
|
}
|
|
95
|
+
export interface CapabilityTruthStatus {
|
|
96
|
+
overallOk: boolean;
|
|
97
|
+
v3Agent: EndpointHealthStatus;
|
|
98
|
+
hyperLoop: EndpointHealthStatus;
|
|
99
|
+
repoMemory: EndpointHealthStatus;
|
|
100
|
+
devtoolsBridge: EndpointHealthStatus;
|
|
101
|
+
}
|
|
102
|
+
export interface VigFlowTemplateSummary {
|
|
103
|
+
id: string;
|
|
104
|
+
name: string;
|
|
105
|
+
description: string;
|
|
106
|
+
category: string;
|
|
107
|
+
icon?: string;
|
|
108
|
+
tags: string[];
|
|
109
|
+
isBuiltin: boolean;
|
|
110
|
+
source: string;
|
|
111
|
+
createdAt?: string;
|
|
112
|
+
}
|
|
113
|
+
export interface VigFlowWorkflowSummary {
|
|
114
|
+
id: string;
|
|
115
|
+
name: string;
|
|
116
|
+
description: string;
|
|
117
|
+
isActive: boolean;
|
|
118
|
+
version: string;
|
|
119
|
+
tags: string[];
|
|
120
|
+
nodeCount: number;
|
|
121
|
+
executionCount: number;
|
|
122
|
+
lastExecutedAt?: string;
|
|
123
|
+
createdAt?: string;
|
|
124
|
+
updatedAt?: string;
|
|
125
|
+
}
|
|
126
|
+
export interface VigFlowWorkflowCreation {
|
|
127
|
+
id: string;
|
|
128
|
+
name: string;
|
|
129
|
+
fromTemplate?: string;
|
|
130
|
+
}
|
|
131
|
+
export interface ResolvedVigFlowWorkflowTarget {
|
|
132
|
+
id: string;
|
|
133
|
+
name: string;
|
|
134
|
+
selector: string;
|
|
135
|
+
matchedBy: 'id' | 'name' | 'search';
|
|
136
|
+
}
|
|
137
|
+
export interface VigFlowExecutionResult {
|
|
138
|
+
executionId: string;
|
|
139
|
+
status: string;
|
|
140
|
+
result?: unknown;
|
|
141
|
+
error?: string;
|
|
142
|
+
nodesExecuted?: number;
|
|
143
|
+
}
|
|
144
|
+
export interface VigFlowExecutionStatus {
|
|
145
|
+
id: string;
|
|
146
|
+
workflowId: string;
|
|
147
|
+
status: string;
|
|
148
|
+
startedAt?: string;
|
|
149
|
+
completedAt?: string;
|
|
150
|
+
nodesExecuted?: number;
|
|
151
|
+
totalNodes?: number;
|
|
152
|
+
result?: unknown;
|
|
153
|
+
error?: string;
|
|
154
|
+
progress?: Record<string, unknown>;
|
|
155
|
+
duration?: number;
|
|
156
|
+
}
|
|
46
157
|
export interface VigthoriUser {
|
|
47
158
|
id: string;
|
|
48
159
|
username: string;
|
|
@@ -66,6 +177,7 @@ export declare class APIClient {
|
|
|
66
177
|
private config;
|
|
67
178
|
private logger;
|
|
68
179
|
private ws;
|
|
180
|
+
private vigFlowTokens;
|
|
69
181
|
constructor(config: Config, logger: Logger);
|
|
70
182
|
private getSelfHostedModelsApiUrl;
|
|
71
183
|
login(email: string, password: string): Promise<boolean>;
|
|
@@ -76,8 +188,47 @@ export declare class APIClient {
|
|
|
76
188
|
private getAccessToken;
|
|
77
189
|
getV3AgentBaseUrls(): string[];
|
|
78
190
|
getV3AgentRunUrl(baseUrl: string): string;
|
|
191
|
+
getOperatorBaseUrls(): string[];
|
|
192
|
+
getOperatorStreamUrl(baseUrl: string): string;
|
|
193
|
+
getMcpBaseUrls(): string[];
|
|
194
|
+
getVigFlowBaseUrls(): string[];
|
|
195
|
+
getTemplateServiceBaseUrls(): string[];
|
|
196
|
+
private isFrontendTask;
|
|
197
|
+
private normalizeWorkspaceRelativePath;
|
|
198
|
+
private listFrontendWorkspaceFiles;
|
|
199
|
+
private chooseFrontendPreviewEntry;
|
|
200
|
+
private extractLinkedFrontendAssets;
|
|
201
|
+
private gatherFrontendPreviewArtifacts;
|
|
202
|
+
private captureFrontendPreviewScreenshot;
|
|
203
|
+
private evaluateFrontendVisualProof;
|
|
204
|
+
private persistFrontendPreviewArtifacts;
|
|
205
|
+
runTemplateServicePreviewGate(message?: string, context?: Record<string, any>): Promise<FrontendPreviewGateResult>;
|
|
206
|
+
private getMcpContextCreateUrl;
|
|
207
|
+
private getMcpContextUrl;
|
|
208
|
+
private getMcpHeaders;
|
|
79
209
|
getV3AgentHeaders(): Promise<Record<string, string>>;
|
|
210
|
+
private executeV3AgentRunRequest;
|
|
211
|
+
private getVigFlowAccessToken;
|
|
212
|
+
private getVigFlowHeaders;
|
|
213
|
+
private withVigFlow;
|
|
214
|
+
listVigFlowTemplates(options?: {
|
|
215
|
+
category?: string;
|
|
216
|
+
search?: string;
|
|
217
|
+
}): Promise<VigFlowTemplateSummary[]>;
|
|
218
|
+
listVigFlowWorkflows(): Promise<VigFlowWorkflowSummary[]>;
|
|
219
|
+
resolveVigFlowWorkflow(selector: string): Promise<ResolvedVigFlowWorkflowTarget>;
|
|
220
|
+
useVigFlowTemplate(templateId: string, options?: {
|
|
221
|
+
name?: string;
|
|
222
|
+
variables?: Record<string, unknown>;
|
|
223
|
+
}): Promise<VigFlowWorkflowCreation>;
|
|
224
|
+
runVigFlowWorkflow(workflowId: string, options?: {
|
|
225
|
+
data?: Record<string, unknown>;
|
|
226
|
+
executionOptions?: Record<string, unknown>;
|
|
227
|
+
}): Promise<VigFlowExecutionResult>;
|
|
228
|
+
getVigFlowExecutionStatus(executionId: string): Promise<VigFlowExecutionStatus>;
|
|
80
229
|
buildV3AgentContext(context?: Record<string, any>): string;
|
|
230
|
+
private ensureExecutionContext;
|
|
231
|
+
bindExecutionContext(context?: Record<string, any>): Promise<Record<string, any>>;
|
|
81
232
|
private resolveAgentTargetPath;
|
|
82
233
|
hasAgentWorkspaceOutput(context?: Record<string, any>): boolean;
|
|
83
234
|
getAgentWorkspaceSnapshot(rootPath: string): {
|
|
@@ -95,6 +246,8 @@ export declare class APIClient {
|
|
|
95
246
|
formatV3AgentResponse(data: any): string;
|
|
96
247
|
collectV3AgentStream(response: Response, context?: Record<string, any>): Promise<any>;
|
|
97
248
|
runV3AgentWorkflow(message: string, context?: Record<string, any>): Promise<V3AgentWorkflowResponse>;
|
|
249
|
+
private formatOperatorResponse;
|
|
250
|
+
runOperatorWorkflow(message: string, context?: Record<string, any>): Promise<OperatorWorkflowResponse>;
|
|
98
251
|
/**
|
|
99
252
|
* Chat API - Direct Vigthoria Models API Architecture
|
|
100
253
|
*
|
|
@@ -107,11 +260,13 @@ export declare class APIClient {
|
|
|
107
260
|
* NO localhost fallbacks - CLI is for external users, not server-side!
|
|
108
261
|
*/
|
|
109
262
|
chat(messages: ChatMessage[], model: string, useLocal?: boolean): Promise<ChatResponse>;
|
|
263
|
+
private shouldSkipCloudRoutes;
|
|
110
264
|
private tryChatWithModel;
|
|
111
265
|
private trySelfHostedChatWithModel;
|
|
112
266
|
private getFallbackModelId;
|
|
113
267
|
private isCloudModelId;
|
|
114
268
|
private canUseCloudModel;
|
|
269
|
+
private resolvePermittedModelId;
|
|
115
270
|
private shouldSimulateCloudFailure;
|
|
116
271
|
private shouldTrySelfHostedFallback;
|
|
117
272
|
private isSelfHostedPreferredModel;
|
|
@@ -158,7 +313,11 @@ export declare class APIClient {
|
|
|
158
313
|
private getCoderHealth;
|
|
159
314
|
private getModelsHealth;
|
|
160
315
|
private getSelfHostedHealth;
|
|
316
|
+
private getV3AgentHealth;
|
|
317
|
+
private getHyperLoopHealth;
|
|
318
|
+
private getRepoMemoryHealth;
|
|
319
|
+
getDevtoolsBridgeStatus(): Promise<EndpointHealthStatus>;
|
|
320
|
+
getCapabilityTruthStatus(context?: Record<string, any>): Promise<CapabilityTruthStatus>;
|
|
161
321
|
getHealthStatus(): Promise<APIHealthStatus>;
|
|
162
322
|
healthCheck(): Promise<boolean>;
|
|
163
323
|
}
|
|
164
|
-
//# sourceMappingURL=api.d.ts.map
|