@rigstate/cli 0.7.9 → 0.7.10
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 +229 -206
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +229 -206
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/daemon/core.ts +1 -0
- package/src/daemon/guardian-monitor.ts +9 -1
- package/src/utils/config.ts +28 -11
package/dist/index.cjs
CHANGED
|
@@ -89,23 +89,39 @@ function getApiUrl() {
|
|
|
89
89
|
}
|
|
90
90
|
async function discoverApiUrl() {
|
|
91
91
|
const configuredUrl = getApiUrl();
|
|
92
|
+
const { default: axios22 } = await import("axios");
|
|
93
|
+
const { default: chalk34 } = await import("chalk");
|
|
94
|
+
console.log(chalk34.gray(`\u{1F50D} Discovering local Rigstate API URL... Configured: ${configuredUrl}`));
|
|
92
95
|
if (!configuredUrl.includes("localhost") && !configuredUrl.includes("127.0.0.1")) {
|
|
96
|
+
console.log(chalk34.gray(` Configured URL is not localhost, trusting: ${configuredUrl}`));
|
|
93
97
|
return configuredUrl;
|
|
94
98
|
}
|
|
95
99
|
const ports = [3e3, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010];
|
|
96
|
-
const { default: axios22 } = await import("axios");
|
|
97
100
|
for (const port of ports) {
|
|
101
|
+
const url = `http://localhost:${port}`;
|
|
98
102
|
try {
|
|
99
|
-
|
|
100
|
-
await axios22.get(`${url}/api/v1/system/health`, { timeout:
|
|
103
|
+
console.log(chalk34.gray(` Attempting to connect to ${url}/api/v1/system/health...`));
|
|
104
|
+
await axios22.get(`${url}/api/v1/system/health`, { timeout: 800 });
|
|
105
|
+
console.log(chalk34.green(` \u2705 Found Rigstate API at ${url}`));
|
|
101
106
|
if (url !== configuredUrl) {
|
|
107
|
+
console.log(chalk34.gray(` Updating stored API URL from ${configuredUrl} to ${url}`));
|
|
102
108
|
setApiUrl(url);
|
|
103
109
|
}
|
|
104
110
|
return url;
|
|
105
111
|
} catch (e) {
|
|
112
|
+
if (axios22.isAxiosError(e) && e.response && e.response.status === 404) {
|
|
113
|
+
console.log(chalk34.yellow(` \u26A0\uFE0F ${url} responded with 404, but might still be a Rigstate server. Skipping for now.`));
|
|
114
|
+
} else if (axios22.isAxiosError(e) && e.code === "ECONNABORTED") {
|
|
115
|
+
console.log(chalk34.gray(` Connection to ${url} timed out.`));
|
|
116
|
+
} else if (axios22.isAxiosError(e) && e.code === "ECONNREFUSED") {
|
|
117
|
+
console.log(chalk34.gray(` Connection to ${url} refused.`));
|
|
118
|
+
} else {
|
|
119
|
+
console.log(chalk34.gray(` Failed to connect to ${url}: ${e.message}`));
|
|
120
|
+
}
|
|
106
121
|
continue;
|
|
107
122
|
}
|
|
108
123
|
}
|
|
124
|
+
console.log(chalk34.yellow(` \u274C No local Rigstate API found on scanned ports. Falling back to configured URL: ${configuredUrl}`));
|
|
109
125
|
return configuredUrl;
|
|
110
126
|
}
|
|
111
127
|
function setApiUrl(url) {
|
|
@@ -1777,7 +1793,7 @@ var require_dist2 = __commonJS({
|
|
|
1777
1793
|
// src/index.ts
|
|
1778
1794
|
init_cjs_shims();
|
|
1779
1795
|
var import_commander23 = require("commander");
|
|
1780
|
-
var
|
|
1796
|
+
var import_chalk33 = __toESM(require("chalk"), 1);
|
|
1781
1797
|
|
|
1782
1798
|
// src/commands/login.ts
|
|
1783
1799
|
init_cjs_shims();
|
|
@@ -3197,7 +3213,7 @@ init_hooks();
|
|
|
3197
3213
|
// src/commands/daemon.ts
|
|
3198
3214
|
init_cjs_shims();
|
|
3199
3215
|
var import_commander11 = require("commander");
|
|
3200
|
-
var
|
|
3216
|
+
var import_chalk19 = __toESM(require("chalk"), 1);
|
|
3201
3217
|
var import_ora8 = __toESM(require("ora"), 1);
|
|
3202
3218
|
var import_promises17 = __toESM(require("fs/promises"), 1);
|
|
3203
3219
|
var import_path19 = __toESM(require("path"), 1);
|
|
@@ -3209,7 +3225,7 @@ init_cjs_shims();
|
|
|
3209
3225
|
|
|
3210
3226
|
// src/daemon/core.ts
|
|
3211
3227
|
init_cjs_shims();
|
|
3212
|
-
var
|
|
3228
|
+
var import_chalk18 = __toESM(require("chalk"), 1);
|
|
3213
3229
|
var fs17 = __toESM(require("fs/promises"), 1);
|
|
3214
3230
|
var import_events3 = require("events");
|
|
3215
3231
|
|
|
@@ -3545,6 +3561,7 @@ function createInterventionProtocol() {
|
|
|
3545
3561
|
// src/daemon/guardian-monitor.ts
|
|
3546
3562
|
init_cjs_shims();
|
|
3547
3563
|
var import_axios12 = __toESM(require("axios"), 1);
|
|
3564
|
+
var import_chalk17 = __toESM(require("chalk"), 1);
|
|
3548
3565
|
var import_promises16 = __toESM(require("fs/promises"), 1);
|
|
3549
3566
|
var import_path18 = __toESM(require("path"), 1);
|
|
3550
3567
|
var CACHE_FILE3 = ".rigstate/rules-cache.json";
|
|
@@ -3569,8 +3586,13 @@ function createGuardianMonitor(projectId, apiUrl, apiKey) {
|
|
|
3569
3586
|
return;
|
|
3570
3587
|
}
|
|
3571
3588
|
} catch (error) {
|
|
3589
|
+
console.error(import_chalk17.default.red(` \u26A0\uFE0F Failed to fetch rules from API: ${error.message}`));
|
|
3590
|
+
if (error.response) {
|
|
3591
|
+
console.error(import_chalk17.default.red(` Status: ${error.response.status} - ${JSON.stringify(error.response.data)}`));
|
|
3592
|
+
}
|
|
3572
3593
|
const cached = await loadCachedRules2(projectId);
|
|
3573
3594
|
if (cached) {
|
|
3595
|
+
console.log(import_chalk17.default.yellow(" \u2139\uFE0F Using cached rules as fallback"));
|
|
3574
3596
|
rules = cached.rules;
|
|
3575
3597
|
lastFetch = Date.now();
|
|
3576
3598
|
return;
|
|
@@ -3741,7 +3763,7 @@ var GuardianDaemon = class extends import_events3.EventEmitter {
|
|
|
3741
3763
|
}
|
|
3742
3764
|
async start() {
|
|
3743
3765
|
if (this.state.isRunning) {
|
|
3744
|
-
console.log(
|
|
3766
|
+
console.log(import_chalk18.default.yellow("Daemon is already running."));
|
|
3745
3767
|
return;
|
|
3746
3768
|
}
|
|
3747
3769
|
this.printWelcome();
|
|
@@ -3751,7 +3773,7 @@ var GuardianDaemon = class extends import_events3.EventEmitter {
|
|
|
3751
3773
|
this.interventionProtocol = createInterventionProtocol();
|
|
3752
3774
|
this.guardianMonitor = createGuardianMonitor(this.config.projectId, this.config.apiUrl, this.config.apiKey);
|
|
3753
3775
|
await this.guardianMonitor.loadRules();
|
|
3754
|
-
console.log(
|
|
3776
|
+
console.log(import_chalk18.default.green(` \u2713 Loaded ${this.guardianMonitor.getRuleCount()} rules`));
|
|
3755
3777
|
await this.syncHeuristics();
|
|
3756
3778
|
if (this.config.checkOnChange) {
|
|
3757
3779
|
this.setupFileWatcher();
|
|
@@ -3763,31 +3785,32 @@ var GuardianDaemon = class extends import_events3.EventEmitter {
|
|
|
3763
3785
|
this.emit("started", this.state);
|
|
3764
3786
|
}
|
|
3765
3787
|
printWelcome() {
|
|
3766
|
-
console.log(
|
|
3767
|
-
console.log(
|
|
3768
|
-
console.log(
|
|
3769
|
-
console.log(
|
|
3788
|
+
console.log(import_chalk18.default.bold.blue("\n\u{1F6E1}\uFE0F Guardian Daemon Starting..."));
|
|
3789
|
+
console.log(import_chalk18.default.dim(`Project: ${this.config.projectId}`));
|
|
3790
|
+
console.log(import_chalk18.default.dim(`API URL: ${this.config.apiUrl}`));
|
|
3791
|
+
console.log(import_chalk18.default.dim(`Watch Path: ${this.config.watchPath}`));
|
|
3792
|
+
console.log(import_chalk18.default.dim("\u2500".repeat(50)));
|
|
3770
3793
|
}
|
|
3771
3794
|
printActive() {
|
|
3772
|
-
console.log(
|
|
3773
|
-
console.log(
|
|
3774
|
-
console.log(
|
|
3795
|
+
console.log(import_chalk18.default.dim("\u2500".repeat(50)));
|
|
3796
|
+
console.log(import_chalk18.default.green.bold("\u2705 Guardian Daemon is now active"));
|
|
3797
|
+
console.log(import_chalk18.default.dim("Press Ctrl+C to stop\n"));
|
|
3775
3798
|
}
|
|
3776
3799
|
async syncHeuristics() {
|
|
3777
3800
|
if (!this.heuristicEngine) return;
|
|
3778
3801
|
const synced = await this.heuristicEngine.refreshRules(this.config.projectId, this.config.apiUrl, this.config.apiKey);
|
|
3779
|
-
if (synced) console.log(
|
|
3802
|
+
if (synced) console.log(import_chalk18.default.green(" \u2713 Synced heuristic rules"));
|
|
3780
3803
|
}
|
|
3781
3804
|
setupFileWatcher() {
|
|
3782
|
-
console.log(
|
|
3805
|
+
console.log(import_chalk18.default.dim("\u{1F4C2} Starting file watcher..."));
|
|
3783
3806
|
this.fileWatcher = createFileWatcher(this.config.watchPath);
|
|
3784
3807
|
this.fileWatcher.on("change", (path24) => this.handleFileChange(path24));
|
|
3785
3808
|
this.fileWatcher.start();
|
|
3786
|
-
console.log(
|
|
3809
|
+
console.log(import_chalk18.default.green(" \u2713 File watcher active"));
|
|
3787
3810
|
}
|
|
3788
3811
|
async handleFileChange(filePath) {
|
|
3789
3812
|
this.state.lastActivity = (/* @__PURE__ */ new Date()).toISOString();
|
|
3790
|
-
if (this.config.verbose) console.log(
|
|
3813
|
+
if (this.config.verbose) console.log(import_chalk18.default.dim(` \u{1F4DD} File changed: ${filePath}`));
|
|
3791
3814
|
let lineCount = 0;
|
|
3792
3815
|
try {
|
|
3793
3816
|
const content = await fs17.readFile(filePath, "utf-8");
|
|
@@ -3800,8 +3823,8 @@ var GuardianDaemon = class extends import_events3.EventEmitter {
|
|
|
3800
3823
|
rules: this.guardianMonitor.getRules()
|
|
3801
3824
|
});
|
|
3802
3825
|
for (const match of matches) {
|
|
3803
|
-
console.log(
|
|
3804
|
-
console.log(
|
|
3826
|
+
console.log(import_chalk18.default.magenta(` \u{1F4A1} PREDICTIVE ACTIVATION: ${match.skillId}`));
|
|
3827
|
+
console.log(import_chalk18.default.dim(` Reason: ${match.reason}`));
|
|
3805
3828
|
const decision = this.interventionProtocol.evaluateTrigger(match.skillId, match.confidence);
|
|
3806
3829
|
this.interventionProtocol.enforce(decision);
|
|
3807
3830
|
await jitProvisionSkill(match.skillId, this.config.apiUrl, this.config.apiKey, this.config.projectId, process.cwd());
|
|
@@ -3817,7 +3840,7 @@ var GuardianDaemon = class extends import_events3.EventEmitter {
|
|
|
3817
3840
|
this.state.violationsFound += result.violations.length;
|
|
3818
3841
|
this.emit("violation", { file: filePath, violations: result.violations });
|
|
3819
3842
|
for (const v of result.violations) {
|
|
3820
|
-
const color = v.severity === "critical" ?
|
|
3843
|
+
const color = v.severity === "critical" ? import_chalk18.default.red : v.severity === "warning" ? import_chalk18.default.yellow : import_chalk18.default.blue;
|
|
3821
3844
|
console.log(color(` [${v.severity.toUpperCase()}] ${filePath}: ${v.message}`));
|
|
3822
3845
|
if (this.interventionProtocol) {
|
|
3823
3846
|
const decision = this.interventionProtocol.evaluateViolation(v.message, v.severity);
|
|
@@ -3829,25 +3852,25 @@ var GuardianDaemon = class extends import_events3.EventEmitter {
|
|
|
3829
3852
|
}
|
|
3830
3853
|
}
|
|
3831
3854
|
async setupBridge() {
|
|
3832
|
-
console.log(
|
|
3855
|
+
console.log(import_chalk18.default.dim("\u{1F309} Connecting to Agent Bridge..."));
|
|
3833
3856
|
this.bridgeListener = createBridgeListener(this.config.projectId, this.config.apiUrl, this.config.apiKey);
|
|
3834
3857
|
this.bridgeListener.on("task", (task) => {
|
|
3835
3858
|
this.state.lastActivity = (/* @__PURE__ */ new Date()).toISOString();
|
|
3836
3859
|
this.state.tasksProcessed++;
|
|
3837
|
-
console.log(
|
|
3860
|
+
console.log(import_chalk18.default.cyan(`
|
|
3838
3861
|
\u{1F4E5} New task received: ${task.id}`));
|
|
3839
3862
|
this.emit("task", task);
|
|
3840
3863
|
});
|
|
3841
3864
|
await this.bridgeListener.connect();
|
|
3842
|
-
console.log(
|
|
3865
|
+
console.log(import_chalk18.default.green(" \u2713 Agent Bridge connected"));
|
|
3843
3866
|
}
|
|
3844
3867
|
async stop() {
|
|
3845
3868
|
if (!this.state.isRunning) return;
|
|
3846
|
-
console.log(
|
|
3869
|
+
console.log(import_chalk18.default.dim("\n\u{1F6D1} Stopping Guardian Daemon..."));
|
|
3847
3870
|
if (this.fileWatcher) await this.fileWatcher.stop();
|
|
3848
3871
|
if (this.bridgeListener) await this.bridgeListener.disconnect();
|
|
3849
3872
|
this.state.isRunning = false;
|
|
3850
|
-
console.log(
|
|
3873
|
+
console.log(import_chalk18.default.green("\u2713 Daemon stopped."));
|
|
3851
3874
|
this.emit("stopped", this.state);
|
|
3852
3875
|
}
|
|
3853
3876
|
getState() {
|
|
@@ -3905,9 +3928,9 @@ function createDaemonCommand() {
|
|
|
3905
3928
|
const spinner = (0, import_ora8.default)();
|
|
3906
3929
|
try {
|
|
3907
3930
|
if (await isRunning()) {
|
|
3908
|
-
console.log(
|
|
3909
|
-
console.log(
|
|
3910
|
-
console.log(
|
|
3931
|
+
console.log(import_chalk19.default.yellow("\u26A0 Another daemon instance may be running."));
|
|
3932
|
+
console.log(import_chalk19.default.dim(` Check ${PID_FILE} or run "rigstate daemon status"`));
|
|
3933
|
+
console.log(import_chalk19.default.dim(" Use Ctrl+C to stop the running daemon first.\n"));
|
|
3911
3934
|
}
|
|
3912
3935
|
spinner.start("Initializing Guardian Daemon...");
|
|
3913
3936
|
const daemonInstance = await createDaemon({
|
|
@@ -3919,7 +3942,7 @@ function createDaemonCommand() {
|
|
|
3919
3942
|
spinner.stop();
|
|
3920
3943
|
await writePidFile();
|
|
3921
3944
|
process.on("SIGINT", async () => {
|
|
3922
|
-
console.log(
|
|
3945
|
+
console.log(import_chalk19.default.dim("\n\nShutting down..."));
|
|
3923
3946
|
await daemonInstance.stop();
|
|
3924
3947
|
await cleanupPidFile();
|
|
3925
3948
|
process.exit(0);
|
|
@@ -3939,8 +3962,8 @@ function createDaemonCommand() {
|
|
|
3939
3962
|
await new Promise(() => {
|
|
3940
3963
|
});
|
|
3941
3964
|
} catch (error) {
|
|
3942
|
-
spinner.fail(
|
|
3943
|
-
console.error(
|
|
3965
|
+
spinner.fail(import_chalk19.default.red("Failed to start daemon"));
|
|
3966
|
+
console.error(import_chalk19.default.red("Error:"), error.message);
|
|
3944
3967
|
process.exit(1);
|
|
3945
3968
|
}
|
|
3946
3969
|
});
|
|
@@ -3989,46 +4012,46 @@ async function writeStateFile(state) {
|
|
|
3989
4012
|
}
|
|
3990
4013
|
}
|
|
3991
4014
|
async function showStatus() {
|
|
3992
|
-
console.log(
|
|
4015
|
+
console.log(import_chalk19.default.bold("\n\u{1F6E1}\uFE0F Guardian Daemon Status\n"));
|
|
3993
4016
|
const running = await isRunning();
|
|
3994
4017
|
if (!running) {
|
|
3995
|
-
console.log(
|
|
3996
|
-
console.log(
|
|
4018
|
+
console.log(import_chalk19.default.yellow("Status: Not running"));
|
|
4019
|
+
console.log(import_chalk19.default.dim('Use "rigstate daemon" to start.\n'));
|
|
3997
4020
|
return;
|
|
3998
4021
|
}
|
|
3999
|
-
console.log(
|
|
4022
|
+
console.log(import_chalk19.default.green("Status: Running"));
|
|
4000
4023
|
try {
|
|
4001
4024
|
const statePath = import_path19.default.join(process.cwd(), STATE_FILE);
|
|
4002
4025
|
const content = await import_promises17.default.readFile(statePath, "utf-8");
|
|
4003
4026
|
const state = JSON.parse(content);
|
|
4004
|
-
console.log(
|
|
4027
|
+
console.log(import_chalk19.default.dim("\u2500".repeat(40)));
|
|
4005
4028
|
console.log(`Started at: ${state.startedAt || "Unknown"}`);
|
|
4006
4029
|
console.log(`Files checked: ${state.filesChecked || 0}`);
|
|
4007
4030
|
console.log(`Violations: ${state.violationsFound || 0}`);
|
|
4008
4031
|
console.log(`Tasks processed: ${state.tasksProcessed || 0}`);
|
|
4009
4032
|
console.log(`Last activity: ${state.lastActivity || "None"}`);
|
|
4010
|
-
console.log(
|
|
4033
|
+
console.log(import_chalk19.default.dim("\u2500".repeat(40)));
|
|
4011
4034
|
} catch {
|
|
4012
|
-
console.log(
|
|
4035
|
+
console.log(import_chalk19.default.dim("(State file not found)"));
|
|
4013
4036
|
}
|
|
4014
4037
|
try {
|
|
4015
4038
|
const pidPath = import_path19.default.join(process.cwd(), PID_FILE);
|
|
4016
4039
|
const pid = await import_promises17.default.readFile(pidPath, "utf-8");
|
|
4017
|
-
console.log(
|
|
4040
|
+
console.log(import_chalk19.default.dim(`PID: ${pid.trim()}`));
|
|
4018
4041
|
} catch {
|
|
4019
4042
|
}
|
|
4020
4043
|
console.log("");
|
|
4021
4044
|
}
|
|
4022
4045
|
async function enableDaemon() {
|
|
4023
|
-
console.log(
|
|
4046
|
+
console.log(import_chalk19.default.bold("\n\u2699\uFE0F Enabling Rigstate Background Service (macOS)\n"));
|
|
4024
4047
|
if (process.platform !== "darwin") {
|
|
4025
|
-
console.error(
|
|
4026
|
-
console.error(
|
|
4048
|
+
console.error(import_chalk19.default.red("\u274C Currently only macOS is supported for auto-start."));
|
|
4049
|
+
console.error(import_chalk19.default.yellow("PRs welcome for Linux/Windows support!"));
|
|
4027
4050
|
return;
|
|
4028
4051
|
}
|
|
4029
4052
|
const homeDir = process.env.HOME || "";
|
|
4030
4053
|
if (!homeDir) {
|
|
4031
|
-
console.error(
|
|
4054
|
+
console.error(import_chalk19.default.red("\u274C Could not determine HOME directory."));
|
|
4032
4055
|
return;
|
|
4033
4056
|
}
|
|
4034
4057
|
const agentsDir = import_path19.default.join(homeDir, "Library/LaunchAgents");
|
|
@@ -4070,32 +4093,32 @@ async function enableDaemon() {
|
|
|
4070
4093
|
</plist>`;
|
|
4071
4094
|
try {
|
|
4072
4095
|
await import_promises17.default.writeFile(plistPath, plistContent);
|
|
4073
|
-
console.log(
|
|
4096
|
+
console.log(import_chalk19.default.dim(`Created plist at: ${plistPath}`));
|
|
4074
4097
|
try {
|
|
4075
4098
|
await execShellCommand(`launchctl unload ${plistPath}`);
|
|
4076
4099
|
} catch (e) {
|
|
4077
4100
|
}
|
|
4078
4101
|
await execShellCommand(`launchctl load ${plistPath}`);
|
|
4079
|
-
console.log(
|
|
4080
|
-
console.log(
|
|
4081
|
-
console.log(
|
|
4102
|
+
console.log(import_chalk19.default.green("\u2705 Successfully enabled background daemon!"));
|
|
4103
|
+
console.log(import_chalk19.default.dim(`Logs: ${logDir}`));
|
|
4104
|
+
console.log(import_chalk19.default.dim("The daemon will now restart automatically if it crashes or on reboot."));
|
|
4082
4105
|
} catch (error) {
|
|
4083
|
-
console.error(
|
|
4106
|
+
console.error(import_chalk19.default.red("\u274C Failed to enable daemon:"), error.message);
|
|
4084
4107
|
}
|
|
4085
4108
|
}
|
|
4086
4109
|
async function disableDaemon() {
|
|
4087
|
-
console.log(
|
|
4110
|
+
console.log(import_chalk19.default.bold("\n\u2699\uFE0F Disabling Rigstate Background Service\n"));
|
|
4088
4111
|
const homeDir = process.env.HOME || "";
|
|
4089
4112
|
const plistPath = import_path19.default.join(homeDir, "Library/LaunchAgents/com.rigstate.daemon.plist");
|
|
4090
4113
|
try {
|
|
4091
4114
|
await execShellCommand(`launchctl unload ${plistPath}`);
|
|
4092
4115
|
await import_promises17.default.unlink(plistPath);
|
|
4093
|
-
console.log(
|
|
4116
|
+
console.log(import_chalk19.default.green("\u2705 Successfully disabled background daemon."));
|
|
4094
4117
|
} catch (error) {
|
|
4095
4118
|
if (error.code === "ENOENT") {
|
|
4096
|
-
console.log(
|
|
4119
|
+
console.log(import_chalk19.default.green("\u2705 Daemon was not enabled."));
|
|
4097
4120
|
} else {
|
|
4098
|
-
console.error(
|
|
4121
|
+
console.error(import_chalk19.default.red("\u274C Failed to disable daemon:"), error.message);
|
|
4099
4122
|
}
|
|
4100
4123
|
}
|
|
4101
4124
|
}
|
|
@@ -4111,7 +4134,7 @@ async function execShellCommand(cmd) {
|
|
|
4111
4134
|
// src/commands/work.ts
|
|
4112
4135
|
init_cjs_shims();
|
|
4113
4136
|
var import_commander12 = require("commander");
|
|
4114
|
-
var
|
|
4137
|
+
var import_chalk20 = __toESM(require("chalk"), 1);
|
|
4115
4138
|
var import_ora9 = __toESM(require("ora"), 1);
|
|
4116
4139
|
var import_axios15 = __toESM(require("axios"), 1);
|
|
4117
4140
|
var import_inquirer2 = __toESM(require("inquirer"), 1);
|
|
@@ -4148,7 +4171,7 @@ async function listInteractive() {
|
|
|
4148
4171
|
});
|
|
4149
4172
|
spinner.stop();
|
|
4150
4173
|
if (actionableTasks.length === 0) {
|
|
4151
|
-
console.log(
|
|
4174
|
+
console.log(import_chalk20.default.yellow("Roadmap clear. No actionable tasks found."));
|
|
4152
4175
|
return;
|
|
4153
4176
|
}
|
|
4154
4177
|
const choices = actionableTasks.map((t) => {
|
|
@@ -4157,7 +4180,7 @@ async function listInteractive() {
|
|
|
4157
4180
|
if (t.status === "IN_PROGRESS") icon = "\u{1F525}";
|
|
4158
4181
|
if (t.status === "ACTIVE") icon = "\u25B6\uFE0F";
|
|
4159
4182
|
return {
|
|
4160
|
-
name: `${icon} ${
|
|
4183
|
+
name: `${icon} ${import_chalk20.default.bold(id)}: ${t.title} [${t.status}]`,
|
|
4161
4184
|
value: t.id
|
|
4162
4185
|
};
|
|
4163
4186
|
});
|
|
@@ -4200,25 +4223,25 @@ async function setTaskStatus(taskId, status) {
|
|
|
4200
4223
|
{ step_id: realId, status, project_id: projectId },
|
|
4201
4224
|
{ headers: { "Authorization": `Bearer ${apiKey}` } }
|
|
4202
4225
|
);
|
|
4203
|
-
spinner.succeed(
|
|
4226
|
+
spinner.succeed(import_chalk20.default.green(`Task updated to ${status}.`));
|
|
4204
4227
|
if (status === "IN_PROGRESS") {
|
|
4205
|
-
console.log(
|
|
4228
|
+
console.log(import_chalk20.default.blue(`
|
|
4206
4229
|
\u{1F4A1} Tip: Provide 'Frank' with context by mentioning @.cursorrules in your chat.`));
|
|
4207
4230
|
}
|
|
4208
4231
|
} catch (e) {
|
|
4209
|
-
spinner.fail(
|
|
4232
|
+
spinner.fail(import_chalk20.default.red(`Failed: ${e.message}`));
|
|
4210
4233
|
}
|
|
4211
4234
|
}
|
|
4212
4235
|
async function finishTask(taskId) {
|
|
4213
4236
|
console.log("");
|
|
4214
|
-
console.log(
|
|
4215
|
-
console.log(
|
|
4237
|
+
console.log(import_chalk20.default.bold.yellow("\u{1F6E1}\uFE0F FRANK'S QUALITY GATE"));
|
|
4238
|
+
console.log(import_chalk20.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"));
|
|
4216
4239
|
const auditSpinner = (0, import_ora9.default)(" Analyzing architectural integrity...").start();
|
|
4217
4240
|
await new Promise((r) => setTimeout(r, 1500));
|
|
4218
4241
|
auditSpinner.succeed("Architecture: VALIDATED (SEC-ARCH-01 Pass)");
|
|
4219
4242
|
await setTaskStatus(taskId, "COMPLETED");
|
|
4220
4243
|
console.log("");
|
|
4221
|
-
console.log(
|
|
4244
|
+
console.log(import_chalk20.default.bold.green("\u{1F389} TASK COMPLETE! Momentum Preserved."));
|
|
4222
4245
|
const { projectId, apiKey, apiUrl } = getContext();
|
|
4223
4246
|
await suggestNextMove(projectId, apiKey, apiUrl);
|
|
4224
4247
|
}
|
|
@@ -4235,7 +4258,7 @@ function getContext() {
|
|
|
4235
4258
|
// src/commands/watch.ts
|
|
4236
4259
|
init_cjs_shims();
|
|
4237
4260
|
var import_commander13 = require("commander");
|
|
4238
|
-
var
|
|
4261
|
+
var import_chalk21 = __toESM(require("chalk"), 1);
|
|
4239
4262
|
var import_ora10 = __toESM(require("ora"), 1);
|
|
4240
4263
|
var import_chokidar = __toESM(require("chokidar"), 1);
|
|
4241
4264
|
var import_promises18 = __toESM(require("fs/promises"), 1);
|
|
@@ -4246,15 +4269,15 @@ var import_axios16 = __toESM(require("axios"), 1);
|
|
|
4246
4269
|
function createWatchCommand() {
|
|
4247
4270
|
const watch2 = new import_commander13.Command("watch");
|
|
4248
4271
|
watch2.description("Watch for changes and auto-verify roadmap tasks").option("--no-auto-commit", "Disable auto-commit on verification").option("--no-auto-push", "Disable auto-push after commit").option("--run-tests", "Run tests before committing").option("--test-command <cmd>", "Custom test command (default: npm test)").action(async (options) => {
|
|
4249
|
-
console.log(
|
|
4250
|
-
console.log(
|
|
4272
|
+
console.log(import_chalk21.default.bold.blue("\u{1F52D} Rigstate Watch Mode"));
|
|
4273
|
+
console.log(import_chalk21.default.dim("Monitoring for task completion..."));
|
|
4251
4274
|
console.log("");
|
|
4252
4275
|
let apiKey;
|
|
4253
4276
|
let projectId;
|
|
4254
4277
|
try {
|
|
4255
4278
|
apiKey = getApiKey();
|
|
4256
4279
|
} catch (e) {
|
|
4257
|
-
console.log(
|
|
4280
|
+
console.log(import_chalk21.default.red('Not authenticated. Run "rigstate login" first.'));
|
|
4258
4281
|
return;
|
|
4259
4282
|
}
|
|
4260
4283
|
projectId = getProjectId();
|
|
@@ -4268,7 +4291,7 @@ function createWatchCommand() {
|
|
|
4268
4291
|
}
|
|
4269
4292
|
}
|
|
4270
4293
|
if (!projectId) {
|
|
4271
|
-
console.log(
|
|
4294
|
+
console.log(import_chalk21.default.red('No project context. Run "rigstate link" or "rigstate sync --project <id>" first.'));
|
|
4272
4295
|
return;
|
|
4273
4296
|
}
|
|
4274
4297
|
const apiUrl = getApiUrl();
|
|
@@ -4278,8 +4301,8 @@ function createWatchCommand() {
|
|
|
4278
4301
|
runTests: options.runTests || false,
|
|
4279
4302
|
testCommand: options.testCommand || "npm test"
|
|
4280
4303
|
};
|
|
4281
|
-
console.log(
|
|
4282
|
-
console.log(
|
|
4304
|
+
console.log(import_chalk21.default.dim(`Auto-commit: ${config2.autoCommit ? "ON" : "OFF"}`));
|
|
4305
|
+
console.log(import_chalk21.default.dim(`Auto-push: ${config2.autoPush ? "ON" : "OFF"}`));
|
|
4283
4306
|
console.log("");
|
|
4284
4307
|
const fetchActiveTask = async () => {
|
|
4285
4308
|
try {
|
|
@@ -4346,7 +4369,7 @@ function createWatchCommand() {
|
|
|
4346
4369
|
}, {
|
|
4347
4370
|
headers: { Authorization: `Bearer ${apiKey}` }
|
|
4348
4371
|
});
|
|
4349
|
-
spinner.succeed(
|
|
4372
|
+
spinner.succeed(import_chalk21.default.green(`\u2705 Task #${task.step_number} completed: ${task.title}`));
|
|
4350
4373
|
if (config2.autoCommit) {
|
|
4351
4374
|
spinner.start("Committing changes...");
|
|
4352
4375
|
try {
|
|
@@ -4368,7 +4391,7 @@ function createWatchCommand() {
|
|
|
4368
4391
|
}
|
|
4369
4392
|
}
|
|
4370
4393
|
console.log("");
|
|
4371
|
-
console.log(
|
|
4394
|
+
console.log(import_chalk21.default.blue("Watching for next task..."));
|
|
4372
4395
|
} catch (e) {
|
|
4373
4396
|
spinner.fail(`Failed to complete task: ${e.message}`);
|
|
4374
4397
|
}
|
|
@@ -4381,7 +4404,7 @@ function createWatchCommand() {
|
|
|
4381
4404
|
const task = await fetchActiveTask();
|
|
4382
4405
|
if (!task) {
|
|
4383
4406
|
if (currentTask) {
|
|
4384
|
-
console.log(
|
|
4407
|
+
console.log(import_chalk21.default.green("\u{1F389} All tasks completed! Watching for new tasks..."));
|
|
4385
4408
|
currentTask = null;
|
|
4386
4409
|
}
|
|
4387
4410
|
isProcessing = false;
|
|
@@ -4390,10 +4413,10 @@ function createWatchCommand() {
|
|
|
4390
4413
|
if (!currentTask || currentTask.id !== task.id) {
|
|
4391
4414
|
currentTask = task;
|
|
4392
4415
|
console.log("");
|
|
4393
|
-
console.log(
|
|
4394
|
-
console.log(
|
|
4416
|
+
console.log(import_chalk21.default.bold.yellow(`\u{1F4CC} Active Task #${task.step_number}: ${task.title}`));
|
|
4417
|
+
console.log(import_chalk21.default.dim(`Status: ${task.status}`));
|
|
4395
4418
|
if (task.verification_criteria) {
|
|
4396
|
-
console.log(
|
|
4419
|
+
console.log(import_chalk21.default.dim("Verification: Auto-checking criteria..."));
|
|
4397
4420
|
}
|
|
4398
4421
|
}
|
|
4399
4422
|
if (task.verification_criteria && Array.isArray(task.verification_criteria)) {
|
|
@@ -4406,7 +4429,7 @@ function createWatchCommand() {
|
|
|
4406
4429
|
}
|
|
4407
4430
|
}
|
|
4408
4431
|
if (allPassed) {
|
|
4409
|
-
console.log(
|
|
4432
|
+
console.log(import_chalk21.default.green("\u2713 All verification criteria passed!"));
|
|
4410
4433
|
await completeTask(task.id, task);
|
|
4411
4434
|
currentTask = null;
|
|
4412
4435
|
}
|
|
@@ -4431,11 +4454,11 @@ function createWatchCommand() {
|
|
|
4431
4454
|
setTimeout(() => processActiveTask(), 500);
|
|
4432
4455
|
}
|
|
4433
4456
|
});
|
|
4434
|
-
console.log(
|
|
4457
|
+
console.log(import_chalk21.default.dim("Watching for file changes... (Ctrl+C to exit)"));
|
|
4435
4458
|
setInterval(() => processActiveTask(), 3e4);
|
|
4436
4459
|
process.on("SIGINT", () => {
|
|
4437
4460
|
console.log("");
|
|
4438
|
-
console.log(
|
|
4461
|
+
console.log(import_chalk21.default.dim("Watch mode stopped."));
|
|
4439
4462
|
watcher.close();
|
|
4440
4463
|
process.exit(0);
|
|
4441
4464
|
});
|
|
@@ -4446,7 +4469,7 @@ function createWatchCommand() {
|
|
|
4446
4469
|
// src/commands/focus.ts
|
|
4447
4470
|
init_cjs_shims();
|
|
4448
4471
|
var import_commander14 = require("commander");
|
|
4449
|
-
var
|
|
4472
|
+
var import_chalk22 = __toESM(require("chalk"), 1);
|
|
4450
4473
|
var import_ora11 = __toESM(require("ora"), 1);
|
|
4451
4474
|
init_config();
|
|
4452
4475
|
var import_axios17 = __toESM(require("axios"), 1);
|
|
@@ -4462,7 +4485,7 @@ function createFocusCommand() {
|
|
|
4462
4485
|
try {
|
|
4463
4486
|
apiKey = getApiKey();
|
|
4464
4487
|
} catch (e) {
|
|
4465
|
-
spinner.fail(
|
|
4488
|
+
spinner.fail(import_chalk22.default.red('Not authenticated. Run "rigstate login" first.'));
|
|
4466
4489
|
return;
|
|
4467
4490
|
}
|
|
4468
4491
|
projectId = getProjectId();
|
|
@@ -4476,7 +4499,7 @@ function createFocusCommand() {
|
|
|
4476
4499
|
}
|
|
4477
4500
|
}
|
|
4478
4501
|
if (!projectId) {
|
|
4479
|
-
spinner.fail(
|
|
4502
|
+
spinner.fail(import_chalk22.default.red('No project context. Run "rigstate link" first.'));
|
|
4480
4503
|
return;
|
|
4481
4504
|
}
|
|
4482
4505
|
const apiUrl = getApiUrl();
|
|
@@ -4507,41 +4530,41 @@ function createFocusCommand() {
|
|
|
4507
4530
|
const nextTask = activeTasks[0];
|
|
4508
4531
|
spinner.stop();
|
|
4509
4532
|
console.log("");
|
|
4510
|
-
console.log(
|
|
4511
|
-
const statusColor = nextTask.status === "IN_PROGRESS" ?
|
|
4512
|
-
console.log(
|
|
4513
|
-
console.log(
|
|
4533
|
+
console.log(import_chalk22.default.bold.blue(`\u{1F4CC} Task #${nextTask.step_number || "?"}: ${nextTask.title}`));
|
|
4534
|
+
const statusColor = nextTask.status === "IN_PROGRESS" ? import_chalk22.default.yellow : nextTask.status === "ACTIVE" ? import_chalk22.default.green : import_chalk22.default.dim;
|
|
4535
|
+
console.log(import_chalk22.default.dim("Status: ") + statusColor(nextTask.status));
|
|
4536
|
+
console.log(import_chalk22.default.dim("\u2500".repeat(60)));
|
|
4514
4537
|
if (nextTask.prompt_content) {
|
|
4515
|
-
console.log(
|
|
4516
|
-
console.log(
|
|
4538
|
+
console.log(import_chalk22.default.white(nextTask.prompt_content));
|
|
4539
|
+
console.log(import_chalk22.default.dim("\u2500".repeat(60)));
|
|
4517
4540
|
if (options.copy !== false) {
|
|
4518
4541
|
try {
|
|
4519
4542
|
if (process.platform === "darwin") {
|
|
4520
4543
|
(0, import_child_process5.execSync)("pbcopy", { input: nextTask.prompt_content });
|
|
4521
|
-
console.log(
|
|
4544
|
+
console.log(import_chalk22.default.green("\u2705 Prompt copied to clipboard! Ready to paste (Cmd+V)."));
|
|
4522
4545
|
} else if (process.platform === "linux") {
|
|
4523
4546
|
try {
|
|
4524
4547
|
(0, import_child_process5.execSync)("xclip -selection clipboard", { input: nextTask.prompt_content });
|
|
4525
|
-
console.log(
|
|
4548
|
+
console.log(import_chalk22.default.green("\u2705 Prompt copied to clipboard!"));
|
|
4526
4549
|
} catch (e) {
|
|
4527
|
-
console.log(
|
|
4550
|
+
console.log(import_chalk22.default.yellow("\u2139\uFE0F Copy prompt manually (xclip not available)"));
|
|
4528
4551
|
}
|
|
4529
4552
|
} else {
|
|
4530
|
-
console.log(
|
|
4553
|
+
console.log(import_chalk22.default.yellow("\u2139\uFE0F Copy prompt manually (Auto-copy not supported on this OS)"));
|
|
4531
4554
|
}
|
|
4532
4555
|
} catch (e) {
|
|
4533
4556
|
}
|
|
4534
4557
|
}
|
|
4535
4558
|
} else {
|
|
4536
|
-
console.log(
|
|
4559
|
+
console.log(import_chalk22.default.yellow("No prompt instructions available."));
|
|
4537
4560
|
if (nextTask.architectural_brief) {
|
|
4538
|
-
console.log(
|
|
4561
|
+
console.log(import_chalk22.default.bold("Brief:"));
|
|
4539
4562
|
console.log(nextTask.architectural_brief);
|
|
4540
4563
|
}
|
|
4541
4564
|
}
|
|
4542
4565
|
console.log("");
|
|
4543
4566
|
} catch (e) {
|
|
4544
|
-
spinner.fail(
|
|
4567
|
+
spinner.fail(import_chalk22.default.red(`Failed to fetch task: ${e.message}`));
|
|
4545
4568
|
}
|
|
4546
4569
|
});
|
|
4547
4570
|
return focus;
|
|
@@ -4553,26 +4576,26 @@ init_env();
|
|
|
4553
4576
|
// src/commands/config.ts
|
|
4554
4577
|
init_cjs_shims();
|
|
4555
4578
|
var import_commander15 = require("commander");
|
|
4556
|
-
var
|
|
4579
|
+
var import_chalk23 = __toESM(require("chalk"), 1);
|
|
4557
4580
|
init_config();
|
|
4558
4581
|
function createConfigCommand() {
|
|
4559
4582
|
const config2 = new import_commander15.Command("config");
|
|
4560
4583
|
config2.description("View or modify Rigstate configuration").argument("[key]", "Configuration key to view/set (api_key, project_id, api_url)").argument("[value]", "Value to set").action(async (key, value) => {
|
|
4561
4584
|
if (!key) {
|
|
4562
|
-
console.log(
|
|
4563
|
-
console.log(
|
|
4585
|
+
console.log(import_chalk23.default.bold("Rigstate Configuration"));
|
|
4586
|
+
console.log(import_chalk23.default.dim("\u2500".repeat(40)));
|
|
4564
4587
|
try {
|
|
4565
4588
|
const apiKey = getApiKey();
|
|
4566
|
-
console.log(`${
|
|
4589
|
+
console.log(`${import_chalk23.default.cyan("api_key")}: ${apiKey.substring(0, 20)}...`);
|
|
4567
4590
|
} catch (e) {
|
|
4568
|
-
console.log(`${
|
|
4591
|
+
console.log(`${import_chalk23.default.cyan("api_key")}: ${import_chalk23.default.dim("(not set)")}`);
|
|
4569
4592
|
}
|
|
4570
4593
|
const projectId = getProjectId();
|
|
4571
|
-
console.log(`${
|
|
4594
|
+
console.log(`${import_chalk23.default.cyan("project_id")}: ${projectId || import_chalk23.default.dim("(not set)")}`);
|
|
4572
4595
|
const apiUrl = getApiUrl();
|
|
4573
|
-
console.log(`${
|
|
4596
|
+
console.log(`${import_chalk23.default.cyan("api_url")}: ${apiUrl}`);
|
|
4574
4597
|
console.log("");
|
|
4575
|
-
console.log(
|
|
4598
|
+
console.log(import_chalk23.default.dim('Use "rigstate config <key> <value>" to set a value.'));
|
|
4576
4599
|
return;
|
|
4577
4600
|
}
|
|
4578
4601
|
if (!value) {
|
|
@@ -4582,36 +4605,36 @@ function createConfigCommand() {
|
|
|
4582
4605
|
const apiKey = getApiKey();
|
|
4583
4606
|
console.log(apiKey);
|
|
4584
4607
|
} catch (e) {
|
|
4585
|
-
console.log(
|
|
4608
|
+
console.log(import_chalk23.default.dim("(not set)"));
|
|
4586
4609
|
}
|
|
4587
4610
|
break;
|
|
4588
4611
|
case "project_id":
|
|
4589
|
-
console.log(getProjectId() ||
|
|
4612
|
+
console.log(getProjectId() || import_chalk23.default.dim("(not set)"));
|
|
4590
4613
|
break;
|
|
4591
4614
|
case "api_url":
|
|
4592
4615
|
console.log(getApiUrl());
|
|
4593
4616
|
break;
|
|
4594
4617
|
default:
|
|
4595
|
-
console.log(
|
|
4596
|
-
console.log(
|
|
4618
|
+
console.log(import_chalk23.default.red(`Unknown config key: ${key}`));
|
|
4619
|
+
console.log(import_chalk23.default.dim("Valid keys: api_key, project_id, api_url"));
|
|
4597
4620
|
}
|
|
4598
4621
|
return;
|
|
4599
4622
|
}
|
|
4600
4623
|
switch (key) {
|
|
4601
4624
|
case "api_key":
|
|
4602
4625
|
setApiKey(value);
|
|
4603
|
-
console.log(
|
|
4626
|
+
console.log(import_chalk23.default.green(`\u2705 api_key updated`));
|
|
4604
4627
|
break;
|
|
4605
4628
|
case "project_id":
|
|
4606
4629
|
setProjectId(value);
|
|
4607
|
-
console.log(
|
|
4630
|
+
console.log(import_chalk23.default.green(`\u2705 project_id updated`));
|
|
4608
4631
|
break;
|
|
4609
4632
|
case "api_url":
|
|
4610
|
-
console.log(
|
|
4633
|
+
console.log(import_chalk23.default.yellow("api_url is set via RIGSTATE_API_URL environment variable"));
|
|
4611
4634
|
break;
|
|
4612
4635
|
default:
|
|
4613
|
-
console.log(
|
|
4614
|
-
console.log(
|
|
4636
|
+
console.log(import_chalk23.default.red(`Unknown config key: ${key}`));
|
|
4637
|
+
console.log(import_chalk23.default.dim("Valid keys: api_key, project_id"));
|
|
4615
4638
|
}
|
|
4616
4639
|
});
|
|
4617
4640
|
return config2;
|
|
@@ -4620,7 +4643,7 @@ function createConfigCommand() {
|
|
|
4620
4643
|
// src/commands/mcp.ts
|
|
4621
4644
|
init_cjs_shims();
|
|
4622
4645
|
var import_commander16 = require("commander");
|
|
4623
|
-
var
|
|
4646
|
+
var import_chalk24 = __toESM(require("chalk"), 1);
|
|
4624
4647
|
var import_child_process6 = require("child_process");
|
|
4625
4648
|
var import_path22 = __toESM(require("path"), 1);
|
|
4626
4649
|
var import_fs = __toESM(require("fs"), 1);
|
|
@@ -4646,15 +4669,15 @@ function createMcpCommand() {
|
|
|
4646
4669
|
}
|
|
4647
4670
|
}
|
|
4648
4671
|
if (!serverPath) {
|
|
4649
|
-
console.error(
|
|
4650
|
-
console.error(
|
|
4651
|
-
console.error(
|
|
4672
|
+
console.error(import_chalk24.default.red("\u274C Error: Rigstate MCP Server binary not found."));
|
|
4673
|
+
console.error(import_chalk24.default.yellow("Please ensure that the mcp package is built:"));
|
|
4674
|
+
console.error(import_chalk24.default.white(" cd packages/mcp && npm run build"));
|
|
4652
4675
|
console.error("");
|
|
4653
|
-
console.error(
|
|
4654
|
-
console.error(
|
|
4676
|
+
console.error(import_chalk24.default.dim("Or run directly with:"));
|
|
4677
|
+
console.error(import_chalk24.default.white(" npx @rigstate/mcp"));
|
|
4655
4678
|
process.exit(1);
|
|
4656
4679
|
}
|
|
4657
|
-
console.log(
|
|
4680
|
+
console.log(import_chalk24.default.dim(`Starting MCP server from: ${serverPath}`));
|
|
4658
4681
|
if (process.env.VIBE_API_KEY && !process.env.RIGSTATE_API_KEY) {
|
|
4659
4682
|
process.env.RIGSTATE_API_KEY = process.env.VIBE_API_KEY;
|
|
4660
4683
|
}
|
|
@@ -4663,7 +4686,7 @@ function createMcpCommand() {
|
|
|
4663
4686
|
stdio: ["inherit", "inherit", "inherit"]
|
|
4664
4687
|
});
|
|
4665
4688
|
worker.on("error", (err) => {
|
|
4666
|
-
console.error(
|
|
4689
|
+
console.error(import_chalk24.default.red(`\u274C Failed to start MCP server: ${err.message}`));
|
|
4667
4690
|
process.exit(1);
|
|
4668
4691
|
});
|
|
4669
4692
|
worker.on("exit", (code) => {
|
|
@@ -4678,7 +4701,7 @@ function createMcpCommand() {
|
|
|
4678
4701
|
// src/commands/nexus.ts
|
|
4679
4702
|
init_cjs_shims();
|
|
4680
4703
|
var import_commander17 = require("commander");
|
|
4681
|
-
var
|
|
4704
|
+
var import_chalk27 = __toESM(require("chalk"), 1);
|
|
4682
4705
|
|
|
4683
4706
|
// src/nexus/dispatcher.ts
|
|
4684
4707
|
init_cjs_shims();
|
|
@@ -4746,7 +4769,7 @@ var HiveScrubber = class {
|
|
|
4746
4769
|
};
|
|
4747
4770
|
|
|
4748
4771
|
// src/hive/gateway.ts
|
|
4749
|
-
var
|
|
4772
|
+
var import_chalk25 = __toESM(require("chalk"), 1);
|
|
4750
4773
|
var HiveGateway = class {
|
|
4751
4774
|
client;
|
|
4752
4775
|
enabled;
|
|
@@ -4756,7 +4779,7 @@ var HiveGateway = class {
|
|
|
4756
4779
|
constructor(baseUrl, token) {
|
|
4757
4780
|
this.enabled = !!token;
|
|
4758
4781
|
if (!this.enabled) {
|
|
4759
|
-
console.log(
|
|
4782
|
+
console.log(import_chalk25.default.dim("\u26A0\uFE0F Hive Gateway disabled (No Token provided). Running in localized mode."));
|
|
4760
4783
|
}
|
|
4761
4784
|
this.client = import_axios18.default.create({
|
|
4762
4785
|
baseURL: baseUrl,
|
|
@@ -4776,23 +4799,23 @@ var HiveGateway = class {
|
|
|
4776
4799
|
if (!this.enabled) return false;
|
|
4777
4800
|
const now = Date.now();
|
|
4778
4801
|
if (now - this.lastSignalTime < this.MIN_INTERVAL_MS) {
|
|
4779
|
-
console.warn(
|
|
4802
|
+
console.warn(import_chalk25.default.yellow("\u23F3 Hive Gateway Throttled. Signal dropped to preventing spam."));
|
|
4780
4803
|
return false;
|
|
4781
4804
|
}
|
|
4782
4805
|
const scrubResult = HiveScrubber.scrub(signal.ruleContent);
|
|
4783
4806
|
if (scrubResult.riskScore > 20) {
|
|
4784
|
-
console.error(
|
|
4807
|
+
console.error(import_chalk25.default.red(`\u{1F6D1} HIVE BLOCKED: Signal contains sensitive data (Risk: ${scrubResult.riskScore})`));
|
|
4785
4808
|
return false;
|
|
4786
4809
|
}
|
|
4787
4810
|
try {
|
|
4788
|
-
console.log(
|
|
4811
|
+
console.log(import_chalk25.default.blue(`\u{1F4E1} Uplinking to Hive... [${signal.vector}]`));
|
|
4789
4812
|
const payload = { ...signal, ruleContent: scrubResult.sanitizedContent };
|
|
4790
4813
|
await this.client.post("/signal", payload);
|
|
4791
4814
|
this.lastSignalTime = now;
|
|
4792
|
-
console.log(
|
|
4815
|
+
console.log(import_chalk25.default.green("\u2705 Signal Received by Hive Core. Knowledge Shared."));
|
|
4793
4816
|
return true;
|
|
4794
4817
|
} catch (error) {
|
|
4795
|
-
console.error(
|
|
4818
|
+
console.error(import_chalk25.default.red(`\u274C Hive Transmission Failed: ${error.message}`));
|
|
4796
4819
|
return false;
|
|
4797
4820
|
}
|
|
4798
4821
|
}
|
|
@@ -4800,37 +4823,37 @@ var HiveGateway = class {
|
|
|
4800
4823
|
|
|
4801
4824
|
// src/utils/logger.ts
|
|
4802
4825
|
init_cjs_shims();
|
|
4803
|
-
var
|
|
4826
|
+
var import_chalk26 = __toESM(require("chalk"), 1);
|
|
4804
4827
|
var Logger = class {
|
|
4805
4828
|
static formatMessage(level, message, context) {
|
|
4806
4829
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
4807
4830
|
let prefix = "";
|
|
4808
4831
|
switch (level) {
|
|
4809
4832
|
case "INFO" /* INFO */:
|
|
4810
|
-
prefix =
|
|
4833
|
+
prefix = import_chalk26.default.blue(`[${"INFO" /* INFO */}]`);
|
|
4811
4834
|
break;
|
|
4812
4835
|
case "WARN" /* WARN */:
|
|
4813
|
-
prefix =
|
|
4836
|
+
prefix = import_chalk26.default.yellow(`[${"WARN" /* WARN */}]`);
|
|
4814
4837
|
break;
|
|
4815
4838
|
case "ERROR" /* ERROR */:
|
|
4816
|
-
prefix =
|
|
4839
|
+
prefix = import_chalk26.default.red(`[${"ERROR" /* ERROR */}]`);
|
|
4817
4840
|
break;
|
|
4818
4841
|
case "DEBUG" /* DEBUG */:
|
|
4819
|
-
prefix =
|
|
4842
|
+
prefix = import_chalk26.default.gray(`[${"DEBUG" /* DEBUG */}]`);
|
|
4820
4843
|
break;
|
|
4821
4844
|
}
|
|
4822
|
-
let output = `${
|
|
4845
|
+
let output = `${import_chalk26.default.gray(timestamp)} ${prefix} ${message}`;
|
|
4823
4846
|
if (context) {
|
|
4824
4847
|
if (context instanceof Error) {
|
|
4825
4848
|
output += `
|
|
4826
|
-
${
|
|
4849
|
+
${import_chalk26.default.red(context.stack || context.message)}`;
|
|
4827
4850
|
} else if (typeof context === "object") {
|
|
4828
4851
|
try {
|
|
4829
4852
|
output += `
|
|
4830
|
-
${
|
|
4853
|
+
${import_chalk26.default.gray(JSON.stringify(context, null, 2))}`;
|
|
4831
4854
|
} catch (e) {
|
|
4832
4855
|
output += `
|
|
4833
|
-
${
|
|
4856
|
+
${import_chalk26.default.gray("[Circular or invalid object]")}`;
|
|
4834
4857
|
}
|
|
4835
4858
|
} else {
|
|
4836
4859
|
output += ` ${String(context)}`;
|
|
@@ -4950,10 +4973,10 @@ var import_inquirer3 = __toESM(require("inquirer"), 1);
|
|
|
4950
4973
|
function createNexusCommand() {
|
|
4951
4974
|
const command = new import_commander17.Command("nexus");
|
|
4952
4975
|
command.description("Interact with The Multi-Agent Nexus (Phase 8)").argument("<intent>", "The natural language instruction for the swarm").option("--dry-run", "Enable Dry-Run mode (Kill-Switch Active)", true).option("--force", "Disable Dry-Run mode (DANGEROUS)", false).action(async (intent, options) => {
|
|
4953
|
-
console.log(
|
|
4976
|
+
console.log(import_chalk27.default.bold.magenta("\n\u{1F981} Welcome to The Nexus (Phase 8)\n"));
|
|
4954
4977
|
const dryRun = !options.force;
|
|
4955
4978
|
if (!dryRun) {
|
|
4956
|
-
console.log(
|
|
4979
|
+
console.log(import_chalk27.default.black.bgYellow(" WARNING ") + import_chalk27.default.yellow(" Dry-Run disabled! Eitri is authorized to write code."));
|
|
4957
4980
|
const { confirm } = await import_inquirer3.default.prompt([{
|
|
4958
4981
|
type: "confirm",
|
|
4959
4982
|
name: "confirm",
|
|
@@ -4974,26 +4997,26 @@ function createNexusCommand() {
|
|
|
4974
4997
|
};
|
|
4975
4998
|
const dispatcher = new NexusDispatcher(context);
|
|
4976
4999
|
dispatcher.on("order:created", (o) => {
|
|
4977
|
-
console.log(
|
|
5000
|
+
console.log(import_chalk27.default.blue(`\u{1F195} [${o.id.slice(0, 6)}] Order Created: `) + o.intent);
|
|
4978
5001
|
});
|
|
4979
5002
|
dispatcher.on("order:started", (o) => {
|
|
4980
|
-
console.log(
|
|
5003
|
+
console.log(import_chalk27.default.yellow(`\u23F3 [${o.id.slice(0, 6)}] Processing...`));
|
|
4981
5004
|
});
|
|
4982
5005
|
dispatcher.on("order:blocked", (o) => {
|
|
4983
|
-
console.log(
|
|
4984
|
-
console.log(
|
|
4985
|
-
console.log(
|
|
5006
|
+
console.log(import_chalk27.default.red(`\u{1F6D1} [${o.id.slice(0, 6)}] BLOCKED by Kill-Switch`));
|
|
5007
|
+
console.log(import_chalk27.default.dim(` Target: ${o.targetAgent} | Action: ${o.action}`));
|
|
5008
|
+
console.log(import_chalk27.default.dim(" Run with --force to execute automatically (NOT RECOMMENDED)."));
|
|
4986
5009
|
});
|
|
4987
|
-
dispatcher.on("agent:SINDRE", (o) => console.log(
|
|
4988
|
-
dispatcher.on("agent:EITRI", (o) => console.log(
|
|
4989
|
-
console.log(
|
|
5010
|
+
dispatcher.on("agent:SINDRE", (o) => console.log(import_chalk27.default.cyan(`\u{1F916} Sindre (Vault): I'm on it! (${o.action})`)));
|
|
5011
|
+
dispatcher.on("agent:EITRI", (o) => console.log(import_chalk27.default.green(`\u{1F477} Eitri (Smith): Ready to build! (${o.action})`)));
|
|
5012
|
+
console.log(import_chalk27.default.dim("\u{1F9E0} Frank is analyzing your intent..."));
|
|
4990
5013
|
await new Promise((r) => setTimeout(r, 800));
|
|
4991
5014
|
if (intent.toLowerCase().includes("db") || intent.toLowerCase().includes("database")) {
|
|
4992
5015
|
await dispatcher.dispatch("FRANK", "SINDRE", intent, "db.analyze", { raw: intent });
|
|
4993
5016
|
} else if (intent.toLowerCase().includes("create") || intent.toLowerCase().includes("code")) {
|
|
4994
5017
|
await dispatcher.dispatch("FRANK", "EITRI", intent, "fs.write", { path: "src/demo.ts", content: "// demo" });
|
|
4995
5018
|
} else {
|
|
4996
|
-
console.log(
|
|
5019
|
+
console.log(import_chalk27.default.gray("Frank didn't understand. Try 'create file' or 'check database'."));
|
|
4997
5020
|
}
|
|
4998
5021
|
});
|
|
4999
5022
|
return command;
|
|
@@ -5005,7 +5028,7 @@ init_sync_rules();
|
|
|
5005
5028
|
// src/commands/override.ts
|
|
5006
5029
|
init_cjs_shims();
|
|
5007
5030
|
var import_commander18 = require("commander");
|
|
5008
|
-
var
|
|
5031
|
+
var import_chalk28 = __toESM(require("chalk"), 1);
|
|
5009
5032
|
init_governance();
|
|
5010
5033
|
init_config();
|
|
5011
5034
|
var import_axios19 = __toESM(require("axios"), 1);
|
|
@@ -5013,19 +5036,19 @@ function createOverrideCommand() {
|
|
|
5013
5036
|
const override = new import_commander18.Command("override");
|
|
5014
5037
|
override.description("Emergency Override for Governance Soft Locks").argument("<violationId>", 'ID of the violation to override (or "all")').requiredOption("-r, --reason <reason>", "Description of why this override is necessary").action(async (violationId, options) => {
|
|
5015
5038
|
const { reason } = options;
|
|
5016
|
-
console.log(
|
|
5039
|
+
console.log(import_chalk28.default.bold(`
|
|
5017
5040
|
\u{1F513} Initiating Governance Override Protocol...`));
|
|
5018
5041
|
const session = await getSessionState(process.cwd());
|
|
5019
5042
|
if (session.status !== "SOFT_LOCK") {
|
|
5020
|
-
console.log(
|
|
5043
|
+
console.log(import_chalk28.default.yellow(" Info: Session is not currently locked."));
|
|
5021
5044
|
return;
|
|
5022
5045
|
}
|
|
5023
|
-
console.log(
|
|
5024
|
-
console.log(
|
|
5046
|
+
console.log(import_chalk28.default.dim(` Active Violation: ${session.active_violation}`));
|
|
5047
|
+
console.log(import_chalk28.default.dim(` Reason Provided: "${reason}"`));
|
|
5025
5048
|
const success = await performOverride(violationId, reason, process.cwd());
|
|
5026
5049
|
if (success) {
|
|
5027
|
-
console.log(
|
|
5028
|
-
console.log(
|
|
5050
|
+
console.log(import_chalk28.default.green(` \u2705 Session UNLOCKED.`));
|
|
5051
|
+
console.log(import_chalk28.default.dim(` This event has been logged to the Mission Report.`));
|
|
5029
5052
|
try {
|
|
5030
5053
|
const projectId = getProjectId();
|
|
5031
5054
|
if (projectId) {
|
|
@@ -5042,13 +5065,13 @@ function createOverrideCommand() {
|
|
|
5042
5065
|
}, {
|
|
5043
5066
|
headers: { Authorization: `Bearer ${apiKey}` }
|
|
5044
5067
|
});
|
|
5045
|
-
console.log(
|
|
5068
|
+
console.log(import_chalk28.default.dim(` \u2601 Audit log synced to Cloud.`));
|
|
5046
5069
|
}
|
|
5047
5070
|
} catch (e) {
|
|
5048
|
-
console.log(
|
|
5071
|
+
console.log(import_chalk28.default.dim(` (Cloud audit sync failed: ${e.message})`));
|
|
5049
5072
|
}
|
|
5050
5073
|
} else {
|
|
5051
|
-
console.log(
|
|
5074
|
+
console.log(import_chalk28.default.red(` \u{1F6D1} Override Failed. Check project configuration.`));
|
|
5052
5075
|
}
|
|
5053
5076
|
});
|
|
5054
5077
|
return override;
|
|
@@ -5057,7 +5080,7 @@ function createOverrideCommand() {
|
|
|
5057
5080
|
// src/commands/idea.ts
|
|
5058
5081
|
init_cjs_shims();
|
|
5059
5082
|
var import_commander19 = require("commander");
|
|
5060
|
-
var
|
|
5083
|
+
var import_chalk29 = __toESM(require("chalk"), 1);
|
|
5061
5084
|
var import_ora12 = __toESM(require("ora"), 1);
|
|
5062
5085
|
var import_axios20 = __toESM(require("axios"), 1);
|
|
5063
5086
|
var import_inquirer4 = __toESM(require("inquirer"), 1);
|
|
@@ -5069,7 +5092,7 @@ function createIdeaCommand() {
|
|
|
5069
5092
|
const apiUrl = getApiUrl();
|
|
5070
5093
|
const projectId = getProjectId();
|
|
5071
5094
|
if (!projectId) {
|
|
5072
|
-
console.error(
|
|
5095
|
+
console.error(import_chalk29.default.red("Project context missing. Run rigstate link."));
|
|
5073
5096
|
process.exit(1);
|
|
5074
5097
|
}
|
|
5075
5098
|
let ideaTitle = title;
|
|
@@ -5105,14 +5128,14 @@ function createIdeaCommand() {
|
|
|
5105
5128
|
{ headers: { Authorization: `Bearer ${apiKey}` } }
|
|
5106
5129
|
);
|
|
5107
5130
|
if (response.data.success) {
|
|
5108
|
-
spinner.succeed(
|
|
5109
|
-
console.log(
|
|
5131
|
+
spinner.succeed(import_chalk29.default.green("Idea Captured! \u{1F4A1}"));
|
|
5132
|
+
console.log(import_chalk29.default.dim(`ID: ${response.data.data?.id || "Saved"}`));
|
|
5110
5133
|
} else {
|
|
5111
5134
|
throw new Error(response.data.error);
|
|
5112
5135
|
}
|
|
5113
5136
|
} catch (e) {
|
|
5114
5137
|
const errorDetail = e.response?.data?.error || e.message;
|
|
5115
|
-
console.error(
|
|
5138
|
+
console.error(import_chalk29.default.red(`
|
|
5116
5139
|
Failed to capture idea: ${errorDetail}`));
|
|
5117
5140
|
}
|
|
5118
5141
|
});
|
|
@@ -5121,7 +5144,7 @@ Failed to capture idea: ${errorDetail}`));
|
|
|
5121
5144
|
// src/commands/release.ts
|
|
5122
5145
|
init_cjs_shims();
|
|
5123
5146
|
var import_commander20 = require("commander");
|
|
5124
|
-
var
|
|
5147
|
+
var import_chalk30 = __toESM(require("chalk"), 1);
|
|
5125
5148
|
var import_ora13 = __toESM(require("ora"), 1);
|
|
5126
5149
|
var import_inquirer5 = __toESM(require("inquirer"), 1);
|
|
5127
5150
|
var import_promises20 = __toESM(require("fs/promises"), 1);
|
|
@@ -9698,7 +9721,7 @@ function createReleaseCommand() {
|
|
|
9698
9721
|
if (type === "major") newVersion = `${major + 1}.0.0`;
|
|
9699
9722
|
if (type === "minor") newVersion = `${major}.${minor + 1}.0`;
|
|
9700
9723
|
if (type === "patch") newVersion = `${major}.${minor}.${patch + 1}`;
|
|
9701
|
-
spinner.succeed(`Bumping ${pkg.name} from ${
|
|
9724
|
+
spinner.succeed(`Bumping ${pkg.name} from ${import_chalk30.default.dim(currentVersion)} to ${import_chalk30.default.green(newVersion)}`);
|
|
9702
9725
|
const { confirm } = await import_inquirer5.default.prompt([{
|
|
9703
9726
|
type: "confirm",
|
|
9704
9727
|
name: "confirm",
|
|
@@ -9728,7 +9751,7 @@ function createReleaseCommand() {
|
|
|
9728
9751
|
await git.addTag(`v${newVersion}`);
|
|
9729
9752
|
await git.push();
|
|
9730
9753
|
await git.pushTags();
|
|
9731
|
-
spinner.succeed(
|
|
9754
|
+
spinner.succeed(import_chalk30.default.bold.green(`\u{1F680} Release v${newVersion} shipped!`));
|
|
9732
9755
|
} catch (e) {
|
|
9733
9756
|
spinner.fail(e.message);
|
|
9734
9757
|
}
|
|
@@ -9745,7 +9768,7 @@ function getContext2() {
|
|
|
9745
9768
|
// src/commands/roadmap.ts
|
|
9746
9769
|
init_cjs_shims();
|
|
9747
9770
|
var import_commander21 = require("commander");
|
|
9748
|
-
var
|
|
9771
|
+
var import_chalk31 = __toESM(require("chalk"), 1);
|
|
9749
9772
|
var import_ora14 = __toESM(require("ora"), 1);
|
|
9750
9773
|
var import_axios21 = __toESM(require("axios"), 1);
|
|
9751
9774
|
init_config();
|
|
@@ -9757,7 +9780,7 @@ function createRoadmapCommand() {
|
|
|
9757
9780
|
const apiUrl = getApiUrl();
|
|
9758
9781
|
const projectId = getProjectId();
|
|
9759
9782
|
if (!projectId) {
|
|
9760
|
-
spinner.fail(
|
|
9783
|
+
spinner.fail(import_chalk31.default.red('Project context missing. Run "rigstate link".'));
|
|
9761
9784
|
return;
|
|
9762
9785
|
}
|
|
9763
9786
|
const response = await import_axios21.default.get(
|
|
@@ -9770,11 +9793,11 @@ function createRoadmapCommand() {
|
|
|
9770
9793
|
const tasks = response.data.data.roadmap || [];
|
|
9771
9794
|
spinner.stop();
|
|
9772
9795
|
if (tasks.length === 0) {
|
|
9773
|
-
console.log(
|
|
9796
|
+
console.log(import_chalk31.default.yellow("\nRoadmap is empty. Use the web UI to define your journey."));
|
|
9774
9797
|
return;
|
|
9775
9798
|
}
|
|
9776
|
-
console.log("\n" +
|
|
9777
|
-
console.log(
|
|
9799
|
+
console.log("\n" + import_chalk31.default.bold.underline("\u{1F6F0}\uFE0F TACTICAL OVERVIEW: PROJECT ROADMAP"));
|
|
9800
|
+
console.log(import_chalk31.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\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
9778
9801
|
const columns = {
|
|
9779
9802
|
"IN_PROGRESS": [],
|
|
9780
9803
|
"ACTIVE": [],
|
|
@@ -9786,14 +9809,14 @@ function createRoadmapCommand() {
|
|
|
9786
9809
|
columns[t.status].push(t);
|
|
9787
9810
|
}
|
|
9788
9811
|
});
|
|
9789
|
-
displayColumn("\u{1F525} IN PROGRESS", columns.IN_PROGRESS,
|
|
9790
|
-
displayColumn("\u25B6\uFE0F ACTIVE / NEXT", columns.ACTIVE,
|
|
9791
|
-
displayColumn("\u{1F512} LOCKED", columns.LOCKED,
|
|
9792
|
-
displayColumn("\u23F3 PENDING", columns.PENDING,
|
|
9793
|
-
console.log(
|
|
9794
|
-
console.log(
|
|
9812
|
+
displayColumn("\u{1F525} IN PROGRESS", columns.IN_PROGRESS, import_chalk31.default.yellow);
|
|
9813
|
+
displayColumn("\u25B6\uFE0F ACTIVE / NEXT", columns.ACTIVE, import_chalk31.default.green);
|
|
9814
|
+
displayColumn("\u{1F512} LOCKED", columns.LOCKED, import_chalk31.default.blue);
|
|
9815
|
+
displayColumn("\u23F3 PENDING", columns.PENDING, import_chalk31.default.gray);
|
|
9816
|
+
console.log(import_chalk31.default.dim("\n\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\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
9817
|
+
console.log(import_chalk31.default.dim(`Total: ${tasks.length} tasks | Run "rigstate work" to start coding.`));
|
|
9795
9818
|
} catch (e) {
|
|
9796
|
-
spinner.fail(
|
|
9819
|
+
spinner.fail(import_chalk31.default.red(`
|
|
9797
9820
|
Failed to fetch roadmap: ${e.message}`));
|
|
9798
9821
|
}
|
|
9799
9822
|
});
|
|
@@ -9804,15 +9827,15 @@ function displayColumn(title, items, color) {
|
|
|
9804
9827
|
${color.bold(title)}`);
|
|
9805
9828
|
items.sort((a, b) => a.step_number - b.step_number).forEach((item) => {
|
|
9806
9829
|
const id = `T-${item.step_number}`.padEnd(8);
|
|
9807
|
-
const priority = item.priority === "MVP" ?
|
|
9808
|
-
console.log(` ${color("\u2022")} ${
|
|
9830
|
+
const priority = item.priority === "MVP" ? import_chalk31.default.magenta(" [MVP]") : "";
|
|
9831
|
+
console.log(` ${color("\u2022")} ${import_chalk31.default.bold(id)} ${item.title}${priority}`);
|
|
9809
9832
|
});
|
|
9810
9833
|
}
|
|
9811
9834
|
|
|
9812
9835
|
// src/commands/council.ts
|
|
9813
9836
|
init_cjs_shims();
|
|
9814
9837
|
var import_commander22 = require("commander");
|
|
9815
|
-
var
|
|
9838
|
+
var import_chalk32 = __toESM(require("chalk"), 1);
|
|
9816
9839
|
var import_ora15 = __toESM(require("ora"), 1);
|
|
9817
9840
|
var import_inquirer6 = __toESM(require("inquirer"), 1);
|
|
9818
9841
|
init_config();
|
|
@@ -9824,7 +9847,7 @@ function createCouncilCommand() {
|
|
|
9824
9847
|
const apiUrl = getApiUrl();
|
|
9825
9848
|
const projectId = getProjectId();
|
|
9826
9849
|
if (!projectId) {
|
|
9827
|
-
console.error(
|
|
9850
|
+
console.error(import_chalk32.default.red('Project context missing. Run "rigstate link".'));
|
|
9828
9851
|
return;
|
|
9829
9852
|
}
|
|
9830
9853
|
let sessionTopic = topic;
|
|
@@ -9836,25 +9859,25 @@ function createCouncilCommand() {
|
|
|
9836
9859
|
}]);
|
|
9837
9860
|
sessionTopic = ans.topic;
|
|
9838
9861
|
}
|
|
9839
|
-
console.log(
|
|
9840
|
-
console.log(
|
|
9841
|
-
console.log(
|
|
9842
|
-
console.log(
|
|
9862
|
+
console.log(import_chalk32.default.bold.magenta("\n\u2696\uFE0F CONVENING THE COUNCIL OF SOVEREIGNTY\n"));
|
|
9863
|
+
console.log(import_chalk32.default.dim(`Topic: ${sessionTopic}`));
|
|
9864
|
+
console.log(import_chalk32.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\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
9865
|
+
console.log(import_chalk32.default.yellow("\n\u{1F9E0} Frank (Architect): Analyzing alignment with Project DNA..."));
|
|
9843
9866
|
await sleep(1500);
|
|
9844
|
-
console.log(
|
|
9845
|
-
console.log(
|
|
9867
|
+
console.log(import_chalk32.default.gray(' "This decision affects our backend scalability. I recommend caution."'));
|
|
9868
|
+
console.log(import_chalk32.default.blue("\n\u{1F6E1}\uFE0F Sigrid (Curator): Checking historical precedents..."));
|
|
9846
9869
|
await sleep(1500);
|
|
9847
|
-
console.log(
|
|
9848
|
-
console.log(
|
|
9870
|
+
console.log(import_chalk32.default.gray(` "Similar patterns in other projects led to technical debt. Let's review RLS."`));
|
|
9871
|
+
console.log(import_chalk32.default.green("\n\u{1F4D0} Einar (Analyst): Scanning dependency impact..."));
|
|
9849
9872
|
await sleep(1500);
|
|
9850
|
-
console.log(
|
|
9851
|
-
console.log(
|
|
9852
|
-
console.log(
|
|
9853
|
-
console.log(
|
|
9854
|
-
console.log(
|
|
9855
|
-
console.log(
|
|
9873
|
+
console.log(import_chalk32.default.gray(' "Implementation will require updating 3 core services."'));
|
|
9874
|
+
console.log(import_chalk32.default.bold.white("\n\u{1F4CB} [FINAL DECISION RECORD]"));
|
|
9875
|
+
console.log(import_chalk32.default.white(" Status: Approved with conditions"));
|
|
9876
|
+
console.log(import_chalk32.default.white(" Rationale: Value outweighs migration cost. Ensure SEC-SQL-01 compliance."));
|
|
9877
|
+
console.log(import_chalk32.default.dim("\n\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\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
9878
|
+
console.log(import_chalk32.default.green("\u2705 Decision saved to Project Brain (ADR-102)"));
|
|
9856
9879
|
} catch (e) {
|
|
9857
|
-
console.error(
|
|
9880
|
+
console.error(import_chalk32.default.red(`
|
|
9858
9881
|
Council session aborted: ${e.message}`));
|
|
9859
9882
|
}
|
|
9860
9883
|
});
|
|
@@ -9900,19 +9923,19 @@ program.hook("preAction", async () => {
|
|
|
9900
9923
|
});
|
|
9901
9924
|
program.on("--help", () => {
|
|
9902
9925
|
console.log("");
|
|
9903
|
-
console.log(
|
|
9926
|
+
console.log(import_chalk33.default.bold("Examples:"));
|
|
9904
9927
|
console.log("");
|
|
9905
|
-
console.log(
|
|
9906
|
-
console.log(
|
|
9928
|
+
console.log(import_chalk33.default.cyan(" $ rigstate login sk_rigstate_your_api_key"));
|
|
9929
|
+
console.log(import_chalk33.default.dim(" Authenticate with your Rigstate API key"));
|
|
9907
9930
|
console.log("");
|
|
9908
|
-
console.log(
|
|
9909
|
-
console.log(
|
|
9931
|
+
console.log(import_chalk33.default.cyan(" $ rigstate scan"));
|
|
9932
|
+
console.log(import_chalk33.default.dim(" Scan the current directory"));
|
|
9910
9933
|
console.log("");
|
|
9911
|
-
console.log(
|
|
9912
|
-
console.log(
|
|
9934
|
+
console.log(import_chalk33.default.cyan(" $ rigstate scan ./src --project abc123"));
|
|
9935
|
+
console.log(import_chalk33.default.dim(" Scan a specific directory with project ID"));
|
|
9913
9936
|
console.log("");
|
|
9914
|
-
console.log(
|
|
9915
|
-
console.log(
|
|
9937
|
+
console.log(import_chalk33.default.cyan(" $ rigstate scan --json"));
|
|
9938
|
+
console.log(import_chalk33.default.dim(" Output results in JSON format (useful for IDE extensions)"));
|
|
9916
9939
|
console.log("");
|
|
9917
9940
|
});
|
|
9918
9941
|
program.parse(process.argv);
|