@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.js CHANGED
@@ -490,7 +490,7 @@ import chalk5 from "chalk";
490
490
  import ora3 from "ora";
491
491
  import axios3 from "axios";
492
492
  function createGenesisCommand() {
493
- return new Command4("genesis").description("Initialize project foundation (Phase 0). Detects stack and injects foundation steps.").option("--force", "Re-run genesis even if already initialized (use with caution)").option("--status", "Check genesis status without triggering").option("--project-id <id>", "Override project ID (defaults to linked project)").action(async (options) => {
493
+ return new Command4("genesis").description("Initialize project foundation (Phase 0). Detects stack and injects foundation steps.").option("--force", "Re-run genesis even if already initialized (use with caution)").option("--simulate", "Dry-run: Calculate plan without modifying database").option("--status", "Check genesis status without triggering").option("--project-id <id>", "Override project ID (defaults to linked project)").action(async (options) => {
494
494
  const apiKey = getApiKey();
495
495
  const apiUrl = getApiUrl();
496
496
  const projectId = options.projectId || getProjectId();
@@ -505,7 +505,7 @@ function createGenesisCommand() {
505
505
  if (options.status) {
506
506
  await checkGenesisStatus(projectId, apiKey, apiUrl);
507
507
  } else {
508
- await triggerGenesis(projectId, apiKey, apiUrl, options.force ?? false);
508
+ await triggerGenesis(projectId, apiKey, apiUrl, options.force ?? false, options.simulate ?? false);
509
509
  }
510
510
  });
511
511
  }
@@ -565,10 +565,15 @@ async function checkGenesisStatus(projectId, apiKey, apiUrl) {
565
565
  return { complete: false, stepCount: 0 };
566
566
  }
567
567
  }
568
- async function triggerGenesis(projectId, apiKey, apiUrl, force = false) {
568
+ async function triggerGenesis(projectId, apiKey, apiUrl, force = false, simulate = false) {
569
569
  console.log("");
570
- console.log(chalk5.bold.blue("\u{1F3D7}\uFE0F GENESIS PROTOCOL"));
571
- console.log(chalk5.dim("Initializing project foundation..."));
570
+ if (simulate) {
571
+ console.log(chalk5.bold.magenta("\u{1F52E} GENESIS SIMULATION"));
572
+ console.log(chalk5.dim("Dry-run: Calculating plan without executing changes..."));
573
+ } else {
574
+ console.log(chalk5.bold.blue("\u{1F3D7}\uFE0F GENESIS PROTOCOL"));
575
+ console.log(chalk5.dim("Initializing project foundation..."));
576
+ }
572
577
  console.log("");
573
578
  const spinner = ora3("Detecting tech stack...").start();
574
579
  try {
@@ -597,7 +602,7 @@ async function triggerGenesis(projectId, apiKey, apiUrl, force = false) {
597
602
  }
598
603
  const response = await axios3.post(
599
604
  `${apiUrl}/api/v1/genesis`,
600
- { project_id: projectId, force },
605
+ { project_id: projectId, force, simulate },
601
606
  {
602
607
  headers: { Authorization: `Bearer ${apiKey}` },
603
608
  timeout: 6e4
@@ -622,6 +627,28 @@ async function triggerGenesis(projectId, apiKey, apiUrl, force = false) {
622
627
  return false;
623
628
  }
624
629
  const { data } = response.data;
630
+ if (response.data.simulation) {
631
+ console.log(chalk5.bold.magenta("\u{1F52E} SIMULATION RESULTS"));
632
+ console.log(chalk5.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
633
+ console.log(`${chalk5.bold("Project:")} ${chalk5.cyan(data.project_name)}`);
634
+ console.log(`${chalk5.bold("Stack:")} ${chalk5.magenta(data.template)}`);
635
+ console.log(`${chalk5.bold("Will Create:")} ${chalk5.white(data.steps_created)} foundation steps`);
636
+ if (data.existing_steps_shifted > 0) {
637
+ console.log(`${chalk5.bold("Will Shift:")} ${chalk5.yellow(`${data.existing_steps_shifted} existing steps down`)}`);
638
+ }
639
+ console.log("");
640
+ console.log(chalk5.bold("\u{1F4CB} Planner Preview:"));
641
+ data.steps.forEach((step) => {
642
+ const stepNum = step.step_number;
643
+ console.log(` ${step.icon || "\u{1F539}"} ${chalk5.bold(`T-${stepNum}`)}: ${step.title}`);
644
+ if (step.verification_path) {
645
+ console.log(` ${chalk5.dim(`Verify: ${step.verification_path}`)}`);
646
+ }
647
+ });
648
+ console.log("");
649
+ console.log(chalk5.dim("To execute this plan, run without --simulate."));
650
+ return true;
651
+ }
625
652
  console.log(chalk5.bold.green("\u2705 GENESIS COMPLETE"));
626
653
  console.log(chalk5.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
627
654
  console.log(`${chalk5.bold("Project:")} ${chalk5.cyan(data.project_name)}`);
@@ -1104,7 +1131,7 @@ var require_package = __commonJS({
1104
1131
  "package.json"(exports, module) {
1105
1132
  module.exports = {
1106
1133
  name: "@rigstate/cli",
1107
- version: "0.7.36",
1134
+ version: "0.7.38",
1108
1135
  description: "Rigstate CLI - Code audit, sync and supervision tool",
1109
1136
  type: "module",
1110
1137
  main: "./dist/index.js",
@@ -5280,11 +5307,14 @@ function createRoadmapCommand() {
5280
5307
  "IN_PROGRESS": [],
5281
5308
  "ACTIVE": [],
5282
5309
  "LOCKED": [],
5283
- "PENDING": []
5310
+ "PENDING": [],
5311
+ "TODO": [],
5312
+ "COMPLETED": []
5284
5313
  };
5285
5314
  tasks.forEach((t) => {
5286
- if (columns[t.status]) {
5287
- columns[t.status].push(t);
5315
+ const status = t.status;
5316
+ if (columns[status]) {
5317
+ columns[status].push(t);
5288
5318
  }
5289
5319
  });
5290
5320
  displayColumn("\u{1F525} IN PROGRESS", columns.IN_PROGRESS, chalk35.yellow);