@rigstate/cli 0.7.36 → 0.7.38
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/index.cjs +40 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -10
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/commands/genesis.ts +41 -5
- package/src/commands/roadmap.ts +15 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rigstate/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.38",
|
|
4
4
|
"description": "Rigstate CLI - Code audit, sync and supervision tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -51,4 +51,4 @@
|
|
|
51
51
|
],
|
|
52
52
|
"author": "Rigstate",
|
|
53
53
|
"license": "MIT"
|
|
54
|
-
}
|
|
54
|
+
}
|
package/src/commands/genesis.ts
CHANGED
|
@@ -32,6 +32,7 @@ interface GenesisStatusResponse {
|
|
|
32
32
|
|
|
33
33
|
interface GenesisTriggerResponse {
|
|
34
34
|
success: boolean;
|
|
35
|
+
simulation?: boolean;
|
|
35
36
|
data: {
|
|
36
37
|
project_name: string;
|
|
37
38
|
template: string;
|
|
@@ -51,6 +52,7 @@ export function createGenesisCommand(): Command {
|
|
|
51
52
|
return new Command('genesis')
|
|
52
53
|
.description('Initialize project foundation (Phase 0). Detects stack and injects foundation steps.')
|
|
53
54
|
.option('--force', 'Re-run genesis even if already initialized (use with caution)')
|
|
55
|
+
.option('--simulate', 'Dry-run: Calculate plan without modifying database')
|
|
54
56
|
.option('--status', 'Check genesis status without triggering')
|
|
55
57
|
.option('--project-id <id>', 'Override project ID (defaults to linked project)')
|
|
56
58
|
.action(async (options) => {
|
|
@@ -71,7 +73,7 @@ export function createGenesisCommand(): Command {
|
|
|
71
73
|
if (options.status) {
|
|
72
74
|
await checkGenesisStatus(projectId, apiKey, apiUrl);
|
|
73
75
|
} else {
|
|
74
|
-
await triggerGenesis(projectId, apiKey, apiUrl, options.force ?? false);
|
|
76
|
+
await triggerGenesis(projectId, apiKey, apiUrl, options.force ?? false, options.simulate ?? false);
|
|
75
77
|
}
|
|
76
78
|
});
|
|
77
79
|
}
|
|
@@ -161,11 +163,17 @@ export async function triggerGenesis(
|
|
|
161
163
|
projectId: string,
|
|
162
164
|
apiKey: string,
|
|
163
165
|
apiUrl: string,
|
|
164
|
-
force = false
|
|
166
|
+
force = false,
|
|
167
|
+
simulate = false
|
|
165
168
|
): Promise<boolean> {
|
|
166
169
|
console.log('');
|
|
167
|
-
|
|
168
|
-
|
|
170
|
+
if (simulate) {
|
|
171
|
+
console.log(chalk.bold.magenta('🔮 GENESIS SIMULATION'));
|
|
172
|
+
console.log(chalk.dim('Dry-run: Calculating plan without executing changes...'));
|
|
173
|
+
} else {
|
|
174
|
+
console.log(chalk.bold.blue('🏗️ GENESIS PROTOCOL'));
|
|
175
|
+
console.log(chalk.dim('Initializing project foundation...'));
|
|
176
|
+
}
|
|
169
177
|
console.log('');
|
|
170
178
|
|
|
171
179
|
const spinner = ora('Detecting tech stack...').start();
|
|
@@ -201,7 +209,7 @@ export async function triggerGenesis(
|
|
|
201
209
|
// Step 2: Trigger Genesis
|
|
202
210
|
const response = await axios.post<GenesisTriggerResponse>(
|
|
203
211
|
`${apiUrl}/api/v1/genesis`,
|
|
204
|
-
{ project_id: projectId, force },
|
|
212
|
+
{ project_id: projectId, force, simulate },
|
|
205
213
|
{
|
|
206
214
|
headers: { Authorization: `Bearer ${apiKey}` },
|
|
207
215
|
timeout: 60000 // AI enrichment can take time
|
|
@@ -230,6 +238,34 @@ export async function triggerGenesis(
|
|
|
230
238
|
|
|
231
239
|
const { data } = response.data;
|
|
232
240
|
|
|
241
|
+
// ── Simulation Output ─────────────────────────────────────────────────
|
|
242
|
+
if (response.data.simulation) {
|
|
243
|
+
console.log(chalk.bold.magenta('🔮 SIMULATION RESULTS'));
|
|
244
|
+
console.log(chalk.dim('────────────────────────────────────────'));
|
|
245
|
+
console.log(`${chalk.bold('Project:')} ${chalk.cyan(data.project_name)}`);
|
|
246
|
+
console.log(`${chalk.bold('Stack:')} ${chalk.magenta(data.template)}`);
|
|
247
|
+
console.log(`${chalk.bold('Will Create:')} ${chalk.white(data.steps_created)} foundation steps`);
|
|
248
|
+
|
|
249
|
+
if (data.existing_steps_shifted > 0) {
|
|
250
|
+
console.log(`${chalk.bold('Will Shift:')} ${chalk.yellow(`${data.existing_steps_shifted} existing steps down`)}`);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
console.log('');
|
|
254
|
+
console.log(chalk.bold('📋 Planner Preview:'));
|
|
255
|
+
data.steps.forEach(step => {
|
|
256
|
+
const stepNum = step.step_number;
|
|
257
|
+
// In simulation, step numbers returned might be 1-based index relative to insert,
|
|
258
|
+
// but usually the AI/Builder assigns them relative to start.
|
|
259
|
+
console.log(` ${step.icon || '🔹'} ${chalk.bold(`T-${stepNum}`)}: ${step.title}`);
|
|
260
|
+
if (step.verification_path) {
|
|
261
|
+
console.log(` ${chalk.dim(`Verify: ${step.verification_path}`)}`);
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
console.log('');
|
|
265
|
+
console.log(chalk.dim('To execute this plan, run without --simulate.'));
|
|
266
|
+
return true;
|
|
267
|
+
}
|
|
268
|
+
|
|
233
269
|
// ── Success Output ────────────────────────────────────────────────────
|
|
234
270
|
console.log(chalk.bold.green('✅ GENESIS COMPLETE'));
|
|
235
271
|
console.log(chalk.dim('────────────────────────────────────────'));
|
package/src/commands/roadmap.ts
CHANGED
|
@@ -4,6 +4,7 @@ import chalk from 'chalk';
|
|
|
4
4
|
import ora from 'ora';
|
|
5
5
|
import axios from 'axios';
|
|
6
6
|
import { getApiKey, getApiUrl, getProjectId } from '../utils/config.js';
|
|
7
|
+
import { RoadmapChunk, ROADMAP_STATUS } from '@rigstate/shared';
|
|
7
8
|
|
|
8
9
|
export function createRoadmapCommand(): Command {
|
|
9
10
|
return new Command('roadmap')
|
|
@@ -30,7 +31,8 @@ export function createRoadmapCommand(): Command {
|
|
|
30
31
|
throw new Error(response.data.error || 'Failed to fetch roadmap');
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
|
|
35
|
+
const tasks: RoadmapChunk[] = response.data.data.roadmap || [];
|
|
34
36
|
spinner.stop();
|
|
35
37
|
|
|
36
38
|
if (tasks.length === 0) {
|
|
@@ -41,16 +43,20 @@ export function createRoadmapCommand(): Command {
|
|
|
41
43
|
console.log('\n' + chalk.bold.underline('🛰️ TACTICAL OVERVIEW: PROJECT ROADMAP'));
|
|
42
44
|
console.log(chalk.dim('──────────────────────────────────────────────'));
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
'
|
|
47
|
-
'
|
|
48
|
-
'
|
|
46
|
+
// Initialize columns based on shared status definitions (or subset used here)
|
|
47
|
+
const columns: Record<string, RoadmapChunk[]> = {
|
|
48
|
+
'IN_PROGRESS': [],
|
|
49
|
+
'ACTIVE': [],
|
|
50
|
+
'LOCKED': [],
|
|
51
|
+
'PENDING': [],
|
|
52
|
+
'TODO': [],
|
|
53
|
+
'COMPLETED': []
|
|
49
54
|
};
|
|
50
55
|
|
|
51
|
-
tasks.forEach((t
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
tasks.forEach((t) => {
|
|
57
|
+
const status = t.status as string; // until API returns exact enum
|
|
58
|
+
if (columns[status]) {
|
|
59
|
+
columns[status].push(t);
|
|
54
60
|
}
|
|
55
61
|
});
|
|
56
62
|
|