@rigstate/cli 0.7.37 → 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 +34 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +34 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/genesis.ts +41 -5
package/dist/index.cjs
CHANGED
|
@@ -511,7 +511,7 @@ __export(genesis_exports, {
|
|
|
511
511
|
triggerGenesis: () => triggerGenesis
|
|
512
512
|
});
|
|
513
513
|
function createGenesisCommand() {
|
|
514
|
-
return new import_commander4.Command("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) => {
|
|
514
|
+
return new import_commander4.Command("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) => {
|
|
515
515
|
const apiKey = getApiKey();
|
|
516
516
|
const apiUrl = getApiUrl();
|
|
517
517
|
const projectId = options.projectId || getProjectId();
|
|
@@ -526,7 +526,7 @@ function createGenesisCommand() {
|
|
|
526
526
|
if (options.status) {
|
|
527
527
|
await checkGenesisStatus(projectId, apiKey, apiUrl);
|
|
528
528
|
} else {
|
|
529
|
-
await triggerGenesis(projectId, apiKey, apiUrl, options.force ?? false);
|
|
529
|
+
await triggerGenesis(projectId, apiKey, apiUrl, options.force ?? false, options.simulate ?? false);
|
|
530
530
|
}
|
|
531
531
|
});
|
|
532
532
|
}
|
|
@@ -586,10 +586,15 @@ async function checkGenesisStatus(projectId, apiKey, apiUrl) {
|
|
|
586
586
|
return { complete: false, stepCount: 0 };
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
async function triggerGenesis(projectId, apiKey, apiUrl, force = false) {
|
|
589
|
+
async function triggerGenesis(projectId, apiKey, apiUrl, force = false, simulate = false) {
|
|
590
590
|
console.log("");
|
|
591
|
-
|
|
592
|
-
|
|
591
|
+
if (simulate) {
|
|
592
|
+
console.log(import_chalk5.default.bold.magenta("\u{1F52E} GENESIS SIMULATION"));
|
|
593
|
+
console.log(import_chalk5.default.dim("Dry-run: Calculating plan without executing changes..."));
|
|
594
|
+
} else {
|
|
595
|
+
console.log(import_chalk5.default.bold.blue("\u{1F3D7}\uFE0F GENESIS PROTOCOL"));
|
|
596
|
+
console.log(import_chalk5.default.dim("Initializing project foundation..."));
|
|
597
|
+
}
|
|
593
598
|
console.log("");
|
|
594
599
|
const spinner = (0, import_ora3.default)("Detecting tech stack...").start();
|
|
595
600
|
try {
|
|
@@ -618,7 +623,7 @@ async function triggerGenesis(projectId, apiKey, apiUrl, force = false) {
|
|
|
618
623
|
}
|
|
619
624
|
const response = await import_axios3.default.post(
|
|
620
625
|
`${apiUrl}/api/v1/genesis`,
|
|
621
|
-
{ project_id: projectId, force },
|
|
626
|
+
{ project_id: projectId, force, simulate },
|
|
622
627
|
{
|
|
623
628
|
headers: { Authorization: `Bearer ${apiKey}` },
|
|
624
629
|
timeout: 6e4
|
|
@@ -643,6 +648,28 @@ async function triggerGenesis(projectId, apiKey, apiUrl, force = false) {
|
|
|
643
648
|
return false;
|
|
644
649
|
}
|
|
645
650
|
const { data } = response.data;
|
|
651
|
+
if (response.data.simulation) {
|
|
652
|
+
console.log(import_chalk5.default.bold.magenta("\u{1F52E} SIMULATION RESULTS"));
|
|
653
|
+
console.log(import_chalk5.default.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"));
|
|
654
|
+
console.log(`${import_chalk5.default.bold("Project:")} ${import_chalk5.default.cyan(data.project_name)}`);
|
|
655
|
+
console.log(`${import_chalk5.default.bold("Stack:")} ${import_chalk5.default.magenta(data.template)}`);
|
|
656
|
+
console.log(`${import_chalk5.default.bold("Will Create:")} ${import_chalk5.default.white(data.steps_created)} foundation steps`);
|
|
657
|
+
if (data.existing_steps_shifted > 0) {
|
|
658
|
+
console.log(`${import_chalk5.default.bold("Will Shift:")} ${import_chalk5.default.yellow(`${data.existing_steps_shifted} existing steps down`)}`);
|
|
659
|
+
}
|
|
660
|
+
console.log("");
|
|
661
|
+
console.log(import_chalk5.default.bold("\u{1F4CB} Planner Preview:"));
|
|
662
|
+
data.steps.forEach((step) => {
|
|
663
|
+
const stepNum = step.step_number;
|
|
664
|
+
console.log(` ${step.icon || "\u{1F539}"} ${import_chalk5.default.bold(`T-${stepNum}`)}: ${step.title}`);
|
|
665
|
+
if (step.verification_path) {
|
|
666
|
+
console.log(` ${import_chalk5.default.dim(`Verify: ${step.verification_path}`)}`);
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
console.log("");
|
|
670
|
+
console.log(import_chalk5.default.dim("To execute this plan, run without --simulate."));
|
|
671
|
+
return true;
|
|
672
|
+
}
|
|
646
673
|
console.log(import_chalk5.default.bold.green("\u2705 GENESIS COMPLETE"));
|
|
647
674
|
console.log(import_chalk5.default.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"));
|
|
648
675
|
console.log(`${import_chalk5.default.bold("Project:")} ${import_chalk5.default.cyan(data.project_name)}`);
|
|
@@ -1132,7 +1159,7 @@ var require_package = __commonJS({
|
|
|
1132
1159
|
"package.json"(exports2, module2) {
|
|
1133
1160
|
module2.exports = {
|
|
1134
1161
|
name: "@rigstate/cli",
|
|
1135
|
-
version: "0.7.
|
|
1162
|
+
version: "0.7.38",
|
|
1136
1163
|
description: "Rigstate CLI - Code audit, sync and supervision tool",
|
|
1137
1164
|
type: "module",
|
|
1138
1165
|
main: "./dist/index.js",
|