@rigstate/cli 0.7.8 → 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 +251 -206
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +251 -206
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/daemon/core.ts +1 -0
- package/src/daemon/factory.ts +4 -2
- package/src/daemon/guardian-monitor.ts +9 -1
- package/src/utils/config.ts +63 -1
package/dist/index.js
CHANGED
|
@@ -55,6 +55,7 @@ var config_exports = {};
|
|
|
55
55
|
__export(config_exports, {
|
|
56
56
|
clearConfig: () => clearConfig,
|
|
57
57
|
config: () => config,
|
|
58
|
+
discoverApiUrl: () => discoverApiUrl,
|
|
58
59
|
getApiKey: () => getApiKey,
|
|
59
60
|
getApiUrl: () => getApiUrl,
|
|
60
61
|
getProjectId: () => getProjectId,
|
|
@@ -91,6 +92,43 @@ function getApiUrl() {
|
|
|
91
92
|
}
|
|
92
93
|
return "https://app.rigstate.com";
|
|
93
94
|
}
|
|
95
|
+
async function discoverApiUrl() {
|
|
96
|
+
const configuredUrl = getApiUrl();
|
|
97
|
+
const { default: axios22 } = await import("axios");
|
|
98
|
+
const { default: chalk34 } = await import("chalk");
|
|
99
|
+
console.log(chalk34.gray(`\u{1F50D} Discovering local Rigstate API URL... Configured: ${configuredUrl}`));
|
|
100
|
+
if (!configuredUrl.includes("localhost") && !configuredUrl.includes("127.0.0.1")) {
|
|
101
|
+
console.log(chalk34.gray(` Configured URL is not localhost, trusting: ${configuredUrl}`));
|
|
102
|
+
return configuredUrl;
|
|
103
|
+
}
|
|
104
|
+
const ports = [3e3, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010];
|
|
105
|
+
for (const port of ports) {
|
|
106
|
+
const url = `http://localhost:${port}`;
|
|
107
|
+
try {
|
|
108
|
+
console.log(chalk34.gray(` Attempting to connect to ${url}/api/v1/system/health...`));
|
|
109
|
+
await axios22.get(`${url}/api/v1/system/health`, { timeout: 800 });
|
|
110
|
+
console.log(chalk34.green(` \u2705 Found Rigstate API at ${url}`));
|
|
111
|
+
if (url !== configuredUrl) {
|
|
112
|
+
console.log(chalk34.gray(` Updating stored API URL from ${configuredUrl} to ${url}`));
|
|
113
|
+
setApiUrl(url);
|
|
114
|
+
}
|
|
115
|
+
return url;
|
|
116
|
+
} catch (e) {
|
|
117
|
+
if (axios22.isAxiosError(e) && e.response && e.response.status === 404) {
|
|
118
|
+
console.log(chalk34.yellow(` \u26A0\uFE0F ${url} responded with 404, but might still be a Rigstate server. Skipping for now.`));
|
|
119
|
+
} else if (axios22.isAxiosError(e) && e.code === "ECONNABORTED") {
|
|
120
|
+
console.log(chalk34.gray(` Connection to ${url} timed out.`));
|
|
121
|
+
} else if (axios22.isAxiosError(e) && e.code === "ECONNREFUSED") {
|
|
122
|
+
console.log(chalk34.gray(` Connection to ${url} refused.`));
|
|
123
|
+
} else {
|
|
124
|
+
console.log(chalk34.gray(` Failed to connect to ${url}: ${e.message}`));
|
|
125
|
+
}
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
console.log(chalk34.yellow(` \u274C No local Rigstate API found on scanned ports. Falling back to configured URL: ${configuredUrl}`));
|
|
130
|
+
return configuredUrl;
|
|
131
|
+
}
|
|
94
132
|
function setApiUrl(url) {
|
|
95
133
|
config.set("apiUrl", url);
|
|
96
134
|
}
|
|
@@ -1755,7 +1793,7 @@ var require_dist2 = __commonJS({
|
|
|
1755
1793
|
// src/index.ts
|
|
1756
1794
|
init_esm_shims();
|
|
1757
1795
|
import { Command as Command23 } from "commander";
|
|
1758
|
-
import
|
|
1796
|
+
import chalk33 from "chalk";
|
|
1759
1797
|
|
|
1760
1798
|
// src/commands/login.ts
|
|
1761
1799
|
init_esm_shims();
|
|
@@ -1843,9 +1881,9 @@ function createLinkCommand() {
|
|
|
1843
1881
|
console.log("");
|
|
1844
1882
|
console.log(chalk6.bold("\u{1F916} Rigstate Automation Detected"));
|
|
1845
1883
|
console.log("");
|
|
1846
|
-
const { getApiKey: getApiKey2, getApiUrl:
|
|
1884
|
+
const { getApiKey: getApiKey2, getApiUrl: getApiUrl3 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
1847
1885
|
const apiKey = getApiKey2();
|
|
1848
|
-
const apiUrl =
|
|
1886
|
+
const apiUrl = getApiUrl3();
|
|
1849
1887
|
if (apiKey) {
|
|
1850
1888
|
console.log(chalk6.blue("\u{1F510} Checking Vault for secrets..."));
|
|
1851
1889
|
const { syncEnv: syncEnv2 } = await Promise.resolve().then(() => (init_env(), env_exports));
|
|
@@ -3175,7 +3213,7 @@ init_hooks();
|
|
|
3175
3213
|
// src/commands/daemon.ts
|
|
3176
3214
|
init_esm_shims();
|
|
3177
3215
|
import { Command as Command11 } from "commander";
|
|
3178
|
-
import
|
|
3216
|
+
import chalk19 from "chalk";
|
|
3179
3217
|
import ora8 from "ora";
|
|
3180
3218
|
import fs18 from "fs/promises";
|
|
3181
3219
|
import path20 from "path";
|
|
@@ -3187,7 +3225,7 @@ init_esm_shims();
|
|
|
3187
3225
|
|
|
3188
3226
|
// src/daemon/core.ts
|
|
3189
3227
|
init_esm_shims();
|
|
3190
|
-
import
|
|
3228
|
+
import chalk18 from "chalk";
|
|
3191
3229
|
import * as fs17 from "fs/promises";
|
|
3192
3230
|
import { EventEmitter as EventEmitter3 } from "events";
|
|
3193
3231
|
|
|
@@ -3523,6 +3561,7 @@ function createInterventionProtocol() {
|
|
|
3523
3561
|
// src/daemon/guardian-monitor.ts
|
|
3524
3562
|
init_esm_shims();
|
|
3525
3563
|
import axios12 from "axios";
|
|
3564
|
+
import chalk17 from "chalk";
|
|
3526
3565
|
import fs16 from "fs/promises";
|
|
3527
3566
|
import path19 from "path";
|
|
3528
3567
|
var CACHE_FILE3 = ".rigstate/rules-cache.json";
|
|
@@ -3547,8 +3586,13 @@ function createGuardianMonitor(projectId, apiUrl, apiKey) {
|
|
|
3547
3586
|
return;
|
|
3548
3587
|
}
|
|
3549
3588
|
} catch (error) {
|
|
3589
|
+
console.error(chalk17.red(` \u26A0\uFE0F Failed to fetch rules from API: ${error.message}`));
|
|
3590
|
+
if (error.response) {
|
|
3591
|
+
console.error(chalk17.red(` Status: ${error.response.status} - ${JSON.stringify(error.response.data)}`));
|
|
3592
|
+
}
|
|
3550
3593
|
const cached = await loadCachedRules2(projectId);
|
|
3551
3594
|
if (cached) {
|
|
3595
|
+
console.log(chalk17.yellow(" \u2139\uFE0F Using cached rules as fallback"));
|
|
3552
3596
|
rules = cached.rules;
|
|
3553
3597
|
lastFetch = Date.now();
|
|
3554
3598
|
return;
|
|
@@ -3719,7 +3763,7 @@ var GuardianDaemon = class extends EventEmitter3 {
|
|
|
3719
3763
|
}
|
|
3720
3764
|
async start() {
|
|
3721
3765
|
if (this.state.isRunning) {
|
|
3722
|
-
console.log(
|
|
3766
|
+
console.log(chalk18.yellow("Daemon is already running."));
|
|
3723
3767
|
return;
|
|
3724
3768
|
}
|
|
3725
3769
|
this.printWelcome();
|
|
@@ -3729,7 +3773,7 @@ var GuardianDaemon = class extends EventEmitter3 {
|
|
|
3729
3773
|
this.interventionProtocol = createInterventionProtocol();
|
|
3730
3774
|
this.guardianMonitor = createGuardianMonitor(this.config.projectId, this.config.apiUrl, this.config.apiKey);
|
|
3731
3775
|
await this.guardianMonitor.loadRules();
|
|
3732
|
-
console.log(
|
|
3776
|
+
console.log(chalk18.green(` \u2713 Loaded ${this.guardianMonitor.getRuleCount()} rules`));
|
|
3733
3777
|
await this.syncHeuristics();
|
|
3734
3778
|
if (this.config.checkOnChange) {
|
|
3735
3779
|
this.setupFileWatcher();
|
|
@@ -3741,31 +3785,32 @@ var GuardianDaemon = class extends EventEmitter3 {
|
|
|
3741
3785
|
this.emit("started", this.state);
|
|
3742
3786
|
}
|
|
3743
3787
|
printWelcome() {
|
|
3744
|
-
console.log(
|
|
3745
|
-
console.log(
|
|
3746
|
-
console.log(
|
|
3747
|
-
console.log(
|
|
3788
|
+
console.log(chalk18.bold.blue("\n\u{1F6E1}\uFE0F Guardian Daemon Starting..."));
|
|
3789
|
+
console.log(chalk18.dim(`Project: ${this.config.projectId}`));
|
|
3790
|
+
console.log(chalk18.dim(`API URL: ${this.config.apiUrl}`));
|
|
3791
|
+
console.log(chalk18.dim(`Watch Path: ${this.config.watchPath}`));
|
|
3792
|
+
console.log(chalk18.dim("\u2500".repeat(50)));
|
|
3748
3793
|
}
|
|
3749
3794
|
printActive() {
|
|
3750
|
-
console.log(
|
|
3751
|
-
console.log(
|
|
3752
|
-
console.log(
|
|
3795
|
+
console.log(chalk18.dim("\u2500".repeat(50)));
|
|
3796
|
+
console.log(chalk18.green.bold("\u2705 Guardian Daemon is now active"));
|
|
3797
|
+
console.log(chalk18.dim("Press Ctrl+C to stop\n"));
|
|
3753
3798
|
}
|
|
3754
3799
|
async syncHeuristics() {
|
|
3755
3800
|
if (!this.heuristicEngine) return;
|
|
3756
3801
|
const synced = await this.heuristicEngine.refreshRules(this.config.projectId, this.config.apiUrl, this.config.apiKey);
|
|
3757
|
-
if (synced) console.log(
|
|
3802
|
+
if (synced) console.log(chalk18.green(" \u2713 Synced heuristic rules"));
|
|
3758
3803
|
}
|
|
3759
3804
|
setupFileWatcher() {
|
|
3760
|
-
console.log(
|
|
3805
|
+
console.log(chalk18.dim("\u{1F4C2} Starting file watcher..."));
|
|
3761
3806
|
this.fileWatcher = createFileWatcher(this.config.watchPath);
|
|
3762
3807
|
this.fileWatcher.on("change", (path25) => this.handleFileChange(path25));
|
|
3763
3808
|
this.fileWatcher.start();
|
|
3764
|
-
console.log(
|
|
3809
|
+
console.log(chalk18.green(" \u2713 File watcher active"));
|
|
3765
3810
|
}
|
|
3766
3811
|
async handleFileChange(filePath) {
|
|
3767
3812
|
this.state.lastActivity = (/* @__PURE__ */ new Date()).toISOString();
|
|
3768
|
-
if (this.config.verbose) console.log(
|
|
3813
|
+
if (this.config.verbose) console.log(chalk18.dim(` \u{1F4DD} File changed: ${filePath}`));
|
|
3769
3814
|
let lineCount = 0;
|
|
3770
3815
|
try {
|
|
3771
3816
|
const content = await fs17.readFile(filePath, "utf-8");
|
|
@@ -3778,8 +3823,8 @@ var GuardianDaemon = class extends EventEmitter3 {
|
|
|
3778
3823
|
rules: this.guardianMonitor.getRules()
|
|
3779
3824
|
});
|
|
3780
3825
|
for (const match of matches) {
|
|
3781
|
-
console.log(
|
|
3782
|
-
console.log(
|
|
3826
|
+
console.log(chalk18.magenta(` \u{1F4A1} PREDICTIVE ACTIVATION: ${match.skillId}`));
|
|
3827
|
+
console.log(chalk18.dim(` Reason: ${match.reason}`));
|
|
3783
3828
|
const decision = this.interventionProtocol.evaluateTrigger(match.skillId, match.confidence);
|
|
3784
3829
|
this.interventionProtocol.enforce(decision);
|
|
3785
3830
|
await jitProvisionSkill(match.skillId, this.config.apiUrl, this.config.apiKey, this.config.projectId, process.cwd());
|
|
@@ -3795,7 +3840,7 @@ var GuardianDaemon = class extends EventEmitter3 {
|
|
|
3795
3840
|
this.state.violationsFound += result.violations.length;
|
|
3796
3841
|
this.emit("violation", { file: filePath, violations: result.violations });
|
|
3797
3842
|
for (const v of result.violations) {
|
|
3798
|
-
const color = v.severity === "critical" ?
|
|
3843
|
+
const color = v.severity === "critical" ? chalk18.red : v.severity === "warning" ? chalk18.yellow : chalk18.blue;
|
|
3799
3844
|
console.log(color(` [${v.severity.toUpperCase()}] ${filePath}: ${v.message}`));
|
|
3800
3845
|
if (this.interventionProtocol) {
|
|
3801
3846
|
const decision = this.interventionProtocol.evaluateViolation(v.message, v.severity);
|
|
@@ -3807,25 +3852,25 @@ var GuardianDaemon = class extends EventEmitter3 {
|
|
|
3807
3852
|
}
|
|
3808
3853
|
}
|
|
3809
3854
|
async setupBridge() {
|
|
3810
|
-
console.log(
|
|
3855
|
+
console.log(chalk18.dim("\u{1F309} Connecting to Agent Bridge..."));
|
|
3811
3856
|
this.bridgeListener = createBridgeListener(this.config.projectId, this.config.apiUrl, this.config.apiKey);
|
|
3812
3857
|
this.bridgeListener.on("task", (task) => {
|
|
3813
3858
|
this.state.lastActivity = (/* @__PURE__ */ new Date()).toISOString();
|
|
3814
3859
|
this.state.tasksProcessed++;
|
|
3815
|
-
console.log(
|
|
3860
|
+
console.log(chalk18.cyan(`
|
|
3816
3861
|
\u{1F4E5} New task received: ${task.id}`));
|
|
3817
3862
|
this.emit("task", task);
|
|
3818
3863
|
});
|
|
3819
3864
|
await this.bridgeListener.connect();
|
|
3820
|
-
console.log(
|
|
3865
|
+
console.log(chalk18.green(" \u2713 Agent Bridge connected"));
|
|
3821
3866
|
}
|
|
3822
3867
|
async stop() {
|
|
3823
3868
|
if (!this.state.isRunning) return;
|
|
3824
|
-
console.log(
|
|
3869
|
+
console.log(chalk18.dim("\n\u{1F6D1} Stopping Guardian Daemon..."));
|
|
3825
3870
|
if (this.fileWatcher) await this.fileWatcher.stop();
|
|
3826
3871
|
if (this.bridgeListener) await this.bridgeListener.disconnect();
|
|
3827
3872
|
this.state.isRunning = false;
|
|
3828
|
-
console.log(
|
|
3873
|
+
console.log(chalk18.green("\u2713 Daemon stopped."));
|
|
3829
3874
|
this.emit("stopped", this.state);
|
|
3830
3875
|
}
|
|
3831
3876
|
getState() {
|
|
@@ -3836,7 +3881,7 @@ var GuardianDaemon = class extends EventEmitter3 {
|
|
|
3836
3881
|
// src/daemon/factory.ts
|
|
3837
3882
|
init_config();
|
|
3838
3883
|
async function createDaemon(options) {
|
|
3839
|
-
const apiUrl =
|
|
3884
|
+
const apiUrl = await discoverApiUrl();
|
|
3840
3885
|
let projectId = options.project;
|
|
3841
3886
|
if (!projectId) {
|
|
3842
3887
|
const manifest = await loadManifest();
|
|
@@ -3883,9 +3928,9 @@ function createDaemonCommand() {
|
|
|
3883
3928
|
const spinner = ora8();
|
|
3884
3929
|
try {
|
|
3885
3930
|
if (await isRunning()) {
|
|
3886
|
-
console.log(
|
|
3887
|
-
console.log(
|
|
3888
|
-
console.log(
|
|
3931
|
+
console.log(chalk19.yellow("\u26A0 Another daemon instance may be running."));
|
|
3932
|
+
console.log(chalk19.dim(` Check ${PID_FILE} or run "rigstate daemon status"`));
|
|
3933
|
+
console.log(chalk19.dim(" Use Ctrl+C to stop the running daemon first.\n"));
|
|
3889
3934
|
}
|
|
3890
3935
|
spinner.start("Initializing Guardian Daemon...");
|
|
3891
3936
|
const daemonInstance = await createDaemon({
|
|
@@ -3897,7 +3942,7 @@ function createDaemonCommand() {
|
|
|
3897
3942
|
spinner.stop();
|
|
3898
3943
|
await writePidFile();
|
|
3899
3944
|
process.on("SIGINT", async () => {
|
|
3900
|
-
console.log(
|
|
3945
|
+
console.log(chalk19.dim("\n\nShutting down..."));
|
|
3901
3946
|
await daemonInstance.stop();
|
|
3902
3947
|
await cleanupPidFile();
|
|
3903
3948
|
process.exit(0);
|
|
@@ -3917,8 +3962,8 @@ function createDaemonCommand() {
|
|
|
3917
3962
|
await new Promise(() => {
|
|
3918
3963
|
});
|
|
3919
3964
|
} catch (error) {
|
|
3920
|
-
spinner.fail(
|
|
3921
|
-
console.error(
|
|
3965
|
+
spinner.fail(chalk19.red("Failed to start daemon"));
|
|
3966
|
+
console.error(chalk19.red("Error:"), error.message);
|
|
3922
3967
|
process.exit(1);
|
|
3923
3968
|
}
|
|
3924
3969
|
});
|
|
@@ -3967,46 +4012,46 @@ async function writeStateFile(state) {
|
|
|
3967
4012
|
}
|
|
3968
4013
|
}
|
|
3969
4014
|
async function showStatus() {
|
|
3970
|
-
console.log(
|
|
4015
|
+
console.log(chalk19.bold("\n\u{1F6E1}\uFE0F Guardian Daemon Status\n"));
|
|
3971
4016
|
const running = await isRunning();
|
|
3972
4017
|
if (!running) {
|
|
3973
|
-
console.log(
|
|
3974
|
-
console.log(
|
|
4018
|
+
console.log(chalk19.yellow("Status: Not running"));
|
|
4019
|
+
console.log(chalk19.dim('Use "rigstate daemon" to start.\n'));
|
|
3975
4020
|
return;
|
|
3976
4021
|
}
|
|
3977
|
-
console.log(
|
|
4022
|
+
console.log(chalk19.green("Status: Running"));
|
|
3978
4023
|
try {
|
|
3979
4024
|
const statePath = path20.join(process.cwd(), STATE_FILE);
|
|
3980
4025
|
const content = await fs18.readFile(statePath, "utf-8");
|
|
3981
4026
|
const state = JSON.parse(content);
|
|
3982
|
-
console.log(
|
|
4027
|
+
console.log(chalk19.dim("\u2500".repeat(40)));
|
|
3983
4028
|
console.log(`Started at: ${state.startedAt || "Unknown"}`);
|
|
3984
4029
|
console.log(`Files checked: ${state.filesChecked || 0}`);
|
|
3985
4030
|
console.log(`Violations: ${state.violationsFound || 0}`);
|
|
3986
4031
|
console.log(`Tasks processed: ${state.tasksProcessed || 0}`);
|
|
3987
4032
|
console.log(`Last activity: ${state.lastActivity || "None"}`);
|
|
3988
|
-
console.log(
|
|
4033
|
+
console.log(chalk19.dim("\u2500".repeat(40)));
|
|
3989
4034
|
} catch {
|
|
3990
|
-
console.log(
|
|
4035
|
+
console.log(chalk19.dim("(State file not found)"));
|
|
3991
4036
|
}
|
|
3992
4037
|
try {
|
|
3993
4038
|
const pidPath = path20.join(process.cwd(), PID_FILE);
|
|
3994
4039
|
const pid = await fs18.readFile(pidPath, "utf-8");
|
|
3995
|
-
console.log(
|
|
4040
|
+
console.log(chalk19.dim(`PID: ${pid.trim()}`));
|
|
3996
4041
|
} catch {
|
|
3997
4042
|
}
|
|
3998
4043
|
console.log("");
|
|
3999
4044
|
}
|
|
4000
4045
|
async function enableDaemon() {
|
|
4001
|
-
console.log(
|
|
4046
|
+
console.log(chalk19.bold("\n\u2699\uFE0F Enabling Rigstate Background Service (macOS)\n"));
|
|
4002
4047
|
if (process.platform !== "darwin") {
|
|
4003
|
-
console.error(
|
|
4004
|
-
console.error(
|
|
4048
|
+
console.error(chalk19.red("\u274C Currently only macOS is supported for auto-start."));
|
|
4049
|
+
console.error(chalk19.yellow("PRs welcome for Linux/Windows support!"));
|
|
4005
4050
|
return;
|
|
4006
4051
|
}
|
|
4007
4052
|
const homeDir = process.env.HOME || "";
|
|
4008
4053
|
if (!homeDir) {
|
|
4009
|
-
console.error(
|
|
4054
|
+
console.error(chalk19.red("\u274C Could not determine HOME directory."));
|
|
4010
4055
|
return;
|
|
4011
4056
|
}
|
|
4012
4057
|
const agentsDir = path20.join(homeDir, "Library/LaunchAgents");
|
|
@@ -4048,32 +4093,32 @@ async function enableDaemon() {
|
|
|
4048
4093
|
</plist>`;
|
|
4049
4094
|
try {
|
|
4050
4095
|
await fs18.writeFile(plistPath, plistContent);
|
|
4051
|
-
console.log(
|
|
4096
|
+
console.log(chalk19.dim(`Created plist at: ${plistPath}`));
|
|
4052
4097
|
try {
|
|
4053
4098
|
await execShellCommand(`launchctl unload ${plistPath}`);
|
|
4054
4099
|
} catch (e) {
|
|
4055
4100
|
}
|
|
4056
4101
|
await execShellCommand(`launchctl load ${plistPath}`);
|
|
4057
|
-
console.log(
|
|
4058
|
-
console.log(
|
|
4059
|
-
console.log(
|
|
4102
|
+
console.log(chalk19.green("\u2705 Successfully enabled background daemon!"));
|
|
4103
|
+
console.log(chalk19.dim(`Logs: ${logDir}`));
|
|
4104
|
+
console.log(chalk19.dim("The daemon will now restart automatically if it crashes or on reboot."));
|
|
4060
4105
|
} catch (error) {
|
|
4061
|
-
console.error(
|
|
4106
|
+
console.error(chalk19.red("\u274C Failed to enable daemon:"), error.message);
|
|
4062
4107
|
}
|
|
4063
4108
|
}
|
|
4064
4109
|
async function disableDaemon() {
|
|
4065
|
-
console.log(
|
|
4110
|
+
console.log(chalk19.bold("\n\u2699\uFE0F Disabling Rigstate Background Service\n"));
|
|
4066
4111
|
const homeDir = process.env.HOME || "";
|
|
4067
4112
|
const plistPath = path20.join(homeDir, "Library/LaunchAgents/com.rigstate.daemon.plist");
|
|
4068
4113
|
try {
|
|
4069
4114
|
await execShellCommand(`launchctl unload ${plistPath}`);
|
|
4070
4115
|
await fs18.unlink(plistPath);
|
|
4071
|
-
console.log(
|
|
4116
|
+
console.log(chalk19.green("\u2705 Successfully disabled background daemon."));
|
|
4072
4117
|
} catch (error) {
|
|
4073
4118
|
if (error.code === "ENOENT") {
|
|
4074
|
-
console.log(
|
|
4119
|
+
console.log(chalk19.green("\u2705 Daemon was not enabled."));
|
|
4075
4120
|
} else {
|
|
4076
|
-
console.error(
|
|
4121
|
+
console.error(chalk19.red("\u274C Failed to disable daemon:"), error.message);
|
|
4077
4122
|
}
|
|
4078
4123
|
}
|
|
4079
4124
|
}
|
|
@@ -4091,7 +4136,7 @@ init_esm_shims();
|
|
|
4091
4136
|
init_config();
|
|
4092
4137
|
init_suggest();
|
|
4093
4138
|
import { Command as Command12 } from "commander";
|
|
4094
|
-
import
|
|
4139
|
+
import chalk20 from "chalk";
|
|
4095
4140
|
import ora9 from "ora";
|
|
4096
4141
|
import axios15 from "axios";
|
|
4097
4142
|
import inquirer2 from "inquirer";
|
|
@@ -4126,7 +4171,7 @@ async function listInteractive() {
|
|
|
4126
4171
|
});
|
|
4127
4172
|
spinner.stop();
|
|
4128
4173
|
if (actionableTasks.length === 0) {
|
|
4129
|
-
console.log(
|
|
4174
|
+
console.log(chalk20.yellow("Roadmap clear. No actionable tasks found."));
|
|
4130
4175
|
return;
|
|
4131
4176
|
}
|
|
4132
4177
|
const choices = actionableTasks.map((t) => {
|
|
@@ -4135,7 +4180,7 @@ async function listInteractive() {
|
|
|
4135
4180
|
if (t.status === "IN_PROGRESS") icon = "\u{1F525}";
|
|
4136
4181
|
if (t.status === "ACTIVE") icon = "\u25B6\uFE0F";
|
|
4137
4182
|
return {
|
|
4138
|
-
name: `${icon} ${
|
|
4183
|
+
name: `${icon} ${chalk20.bold(id)}: ${t.title} [${t.status}]`,
|
|
4139
4184
|
value: t.id
|
|
4140
4185
|
};
|
|
4141
4186
|
});
|
|
@@ -4178,25 +4223,25 @@ async function setTaskStatus(taskId, status) {
|
|
|
4178
4223
|
{ step_id: realId, status, project_id: projectId },
|
|
4179
4224
|
{ headers: { "Authorization": `Bearer ${apiKey}` } }
|
|
4180
4225
|
);
|
|
4181
|
-
spinner.succeed(
|
|
4226
|
+
spinner.succeed(chalk20.green(`Task updated to ${status}.`));
|
|
4182
4227
|
if (status === "IN_PROGRESS") {
|
|
4183
|
-
console.log(
|
|
4228
|
+
console.log(chalk20.blue(`
|
|
4184
4229
|
\u{1F4A1} Tip: Provide 'Frank' with context by mentioning @.cursorrules in your chat.`));
|
|
4185
4230
|
}
|
|
4186
4231
|
} catch (e) {
|
|
4187
|
-
spinner.fail(
|
|
4232
|
+
spinner.fail(chalk20.red(`Failed: ${e.message}`));
|
|
4188
4233
|
}
|
|
4189
4234
|
}
|
|
4190
4235
|
async function finishTask(taskId) {
|
|
4191
4236
|
console.log("");
|
|
4192
|
-
console.log(
|
|
4193
|
-
console.log(
|
|
4237
|
+
console.log(chalk20.bold.yellow("\u{1F6E1}\uFE0F FRANK'S QUALITY GATE"));
|
|
4238
|
+
console.log(chalk20.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"));
|
|
4194
4239
|
const auditSpinner = ora9(" Analyzing architectural integrity...").start();
|
|
4195
4240
|
await new Promise((r) => setTimeout(r, 1500));
|
|
4196
4241
|
auditSpinner.succeed("Architecture: VALIDATED (SEC-ARCH-01 Pass)");
|
|
4197
4242
|
await setTaskStatus(taskId, "COMPLETED");
|
|
4198
4243
|
console.log("");
|
|
4199
|
-
console.log(
|
|
4244
|
+
console.log(chalk20.bold.green("\u{1F389} TASK COMPLETE! Momentum Preserved."));
|
|
4200
4245
|
const { projectId, apiKey, apiUrl } = getContext();
|
|
4201
4246
|
await suggestNextMove(projectId, apiKey, apiUrl);
|
|
4202
4247
|
}
|
|
@@ -4214,7 +4259,7 @@ function getContext() {
|
|
|
4214
4259
|
init_esm_shims();
|
|
4215
4260
|
init_config();
|
|
4216
4261
|
import { Command as Command13 } from "commander";
|
|
4217
|
-
import
|
|
4262
|
+
import chalk21 from "chalk";
|
|
4218
4263
|
import ora10 from "ora";
|
|
4219
4264
|
import chokidar2 from "chokidar";
|
|
4220
4265
|
import fs19 from "fs/promises";
|
|
@@ -4224,15 +4269,15 @@ import axios16 from "axios";
|
|
|
4224
4269
|
function createWatchCommand() {
|
|
4225
4270
|
const watch2 = new Command13("watch");
|
|
4226
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) => {
|
|
4227
|
-
console.log(
|
|
4228
|
-
console.log(
|
|
4272
|
+
console.log(chalk21.bold.blue("\u{1F52D} Rigstate Watch Mode"));
|
|
4273
|
+
console.log(chalk21.dim("Monitoring for task completion..."));
|
|
4229
4274
|
console.log("");
|
|
4230
4275
|
let apiKey;
|
|
4231
4276
|
let projectId;
|
|
4232
4277
|
try {
|
|
4233
4278
|
apiKey = getApiKey();
|
|
4234
4279
|
} catch (e) {
|
|
4235
|
-
console.log(
|
|
4280
|
+
console.log(chalk21.red('Not authenticated. Run "rigstate login" first.'));
|
|
4236
4281
|
return;
|
|
4237
4282
|
}
|
|
4238
4283
|
projectId = getProjectId();
|
|
@@ -4246,7 +4291,7 @@ function createWatchCommand() {
|
|
|
4246
4291
|
}
|
|
4247
4292
|
}
|
|
4248
4293
|
if (!projectId) {
|
|
4249
|
-
console.log(
|
|
4294
|
+
console.log(chalk21.red('No project context. Run "rigstate link" or "rigstate sync --project <id>" first.'));
|
|
4250
4295
|
return;
|
|
4251
4296
|
}
|
|
4252
4297
|
const apiUrl = getApiUrl();
|
|
@@ -4256,8 +4301,8 @@ function createWatchCommand() {
|
|
|
4256
4301
|
runTests: options.runTests || false,
|
|
4257
4302
|
testCommand: options.testCommand || "npm test"
|
|
4258
4303
|
};
|
|
4259
|
-
console.log(
|
|
4260
|
-
console.log(
|
|
4304
|
+
console.log(chalk21.dim(`Auto-commit: ${config2.autoCommit ? "ON" : "OFF"}`));
|
|
4305
|
+
console.log(chalk21.dim(`Auto-push: ${config2.autoPush ? "ON" : "OFF"}`));
|
|
4261
4306
|
console.log("");
|
|
4262
4307
|
const fetchActiveTask = async () => {
|
|
4263
4308
|
try {
|
|
@@ -4324,7 +4369,7 @@ function createWatchCommand() {
|
|
|
4324
4369
|
}, {
|
|
4325
4370
|
headers: { Authorization: `Bearer ${apiKey}` }
|
|
4326
4371
|
});
|
|
4327
|
-
spinner.succeed(
|
|
4372
|
+
spinner.succeed(chalk21.green(`\u2705 Task #${task.step_number} completed: ${task.title}`));
|
|
4328
4373
|
if (config2.autoCommit) {
|
|
4329
4374
|
spinner.start("Committing changes...");
|
|
4330
4375
|
try {
|
|
@@ -4346,7 +4391,7 @@ function createWatchCommand() {
|
|
|
4346
4391
|
}
|
|
4347
4392
|
}
|
|
4348
4393
|
console.log("");
|
|
4349
|
-
console.log(
|
|
4394
|
+
console.log(chalk21.blue("Watching for next task..."));
|
|
4350
4395
|
} catch (e) {
|
|
4351
4396
|
spinner.fail(`Failed to complete task: ${e.message}`);
|
|
4352
4397
|
}
|
|
@@ -4359,7 +4404,7 @@ function createWatchCommand() {
|
|
|
4359
4404
|
const task = await fetchActiveTask();
|
|
4360
4405
|
if (!task) {
|
|
4361
4406
|
if (currentTask) {
|
|
4362
|
-
console.log(
|
|
4407
|
+
console.log(chalk21.green("\u{1F389} All tasks completed! Watching for new tasks..."));
|
|
4363
4408
|
currentTask = null;
|
|
4364
4409
|
}
|
|
4365
4410
|
isProcessing = false;
|
|
@@ -4368,10 +4413,10 @@ function createWatchCommand() {
|
|
|
4368
4413
|
if (!currentTask || currentTask.id !== task.id) {
|
|
4369
4414
|
currentTask = task;
|
|
4370
4415
|
console.log("");
|
|
4371
|
-
console.log(
|
|
4372
|
-
console.log(
|
|
4416
|
+
console.log(chalk21.bold.yellow(`\u{1F4CC} Active Task #${task.step_number}: ${task.title}`));
|
|
4417
|
+
console.log(chalk21.dim(`Status: ${task.status}`));
|
|
4373
4418
|
if (task.verification_criteria) {
|
|
4374
|
-
console.log(
|
|
4419
|
+
console.log(chalk21.dim("Verification: Auto-checking criteria..."));
|
|
4375
4420
|
}
|
|
4376
4421
|
}
|
|
4377
4422
|
if (task.verification_criteria && Array.isArray(task.verification_criteria)) {
|
|
@@ -4384,7 +4429,7 @@ function createWatchCommand() {
|
|
|
4384
4429
|
}
|
|
4385
4430
|
}
|
|
4386
4431
|
if (allPassed) {
|
|
4387
|
-
console.log(
|
|
4432
|
+
console.log(chalk21.green("\u2713 All verification criteria passed!"));
|
|
4388
4433
|
await completeTask(task.id, task);
|
|
4389
4434
|
currentTask = null;
|
|
4390
4435
|
}
|
|
@@ -4409,11 +4454,11 @@ function createWatchCommand() {
|
|
|
4409
4454
|
setTimeout(() => processActiveTask(), 500);
|
|
4410
4455
|
}
|
|
4411
4456
|
});
|
|
4412
|
-
console.log(
|
|
4457
|
+
console.log(chalk21.dim("Watching for file changes... (Ctrl+C to exit)"));
|
|
4413
4458
|
setInterval(() => processActiveTask(), 3e4);
|
|
4414
4459
|
process.on("SIGINT", () => {
|
|
4415
4460
|
console.log("");
|
|
4416
|
-
console.log(
|
|
4461
|
+
console.log(chalk21.dim("Watch mode stopped."));
|
|
4417
4462
|
watcher.close();
|
|
4418
4463
|
process.exit(0);
|
|
4419
4464
|
});
|
|
@@ -4425,7 +4470,7 @@ function createWatchCommand() {
|
|
|
4425
4470
|
init_esm_shims();
|
|
4426
4471
|
init_config();
|
|
4427
4472
|
import { Command as Command14 } from "commander";
|
|
4428
|
-
import
|
|
4473
|
+
import chalk22 from "chalk";
|
|
4429
4474
|
import ora11 from "ora";
|
|
4430
4475
|
import axios17 from "axios";
|
|
4431
4476
|
import { execSync as execSync5 } from "child_process";
|
|
@@ -4440,7 +4485,7 @@ function createFocusCommand() {
|
|
|
4440
4485
|
try {
|
|
4441
4486
|
apiKey = getApiKey();
|
|
4442
4487
|
} catch (e) {
|
|
4443
|
-
spinner.fail(
|
|
4488
|
+
spinner.fail(chalk22.red('Not authenticated. Run "rigstate login" first.'));
|
|
4444
4489
|
return;
|
|
4445
4490
|
}
|
|
4446
4491
|
projectId = getProjectId();
|
|
@@ -4454,7 +4499,7 @@ function createFocusCommand() {
|
|
|
4454
4499
|
}
|
|
4455
4500
|
}
|
|
4456
4501
|
if (!projectId) {
|
|
4457
|
-
spinner.fail(
|
|
4502
|
+
spinner.fail(chalk22.red('No project context. Run "rigstate link" first.'));
|
|
4458
4503
|
return;
|
|
4459
4504
|
}
|
|
4460
4505
|
const apiUrl = getApiUrl();
|
|
@@ -4485,41 +4530,41 @@ function createFocusCommand() {
|
|
|
4485
4530
|
const nextTask = activeTasks[0];
|
|
4486
4531
|
spinner.stop();
|
|
4487
4532
|
console.log("");
|
|
4488
|
-
console.log(
|
|
4489
|
-
const statusColor = nextTask.status === "IN_PROGRESS" ?
|
|
4490
|
-
console.log(
|
|
4491
|
-
console.log(
|
|
4533
|
+
console.log(chalk22.bold.blue(`\u{1F4CC} Task #${nextTask.step_number || "?"}: ${nextTask.title}`));
|
|
4534
|
+
const statusColor = nextTask.status === "IN_PROGRESS" ? chalk22.yellow : nextTask.status === "ACTIVE" ? chalk22.green : chalk22.dim;
|
|
4535
|
+
console.log(chalk22.dim("Status: ") + statusColor(nextTask.status));
|
|
4536
|
+
console.log(chalk22.dim("\u2500".repeat(60)));
|
|
4492
4537
|
if (nextTask.prompt_content) {
|
|
4493
|
-
console.log(
|
|
4494
|
-
console.log(
|
|
4538
|
+
console.log(chalk22.white(nextTask.prompt_content));
|
|
4539
|
+
console.log(chalk22.dim("\u2500".repeat(60)));
|
|
4495
4540
|
if (options.copy !== false) {
|
|
4496
4541
|
try {
|
|
4497
4542
|
if (process.platform === "darwin") {
|
|
4498
4543
|
execSync5("pbcopy", { input: nextTask.prompt_content });
|
|
4499
|
-
console.log(
|
|
4544
|
+
console.log(chalk22.green("\u2705 Prompt copied to clipboard! Ready to paste (Cmd+V)."));
|
|
4500
4545
|
} else if (process.platform === "linux") {
|
|
4501
4546
|
try {
|
|
4502
4547
|
execSync5("xclip -selection clipboard", { input: nextTask.prompt_content });
|
|
4503
|
-
console.log(
|
|
4548
|
+
console.log(chalk22.green("\u2705 Prompt copied to clipboard!"));
|
|
4504
4549
|
} catch (e) {
|
|
4505
|
-
console.log(
|
|
4550
|
+
console.log(chalk22.yellow("\u2139\uFE0F Copy prompt manually (xclip not available)"));
|
|
4506
4551
|
}
|
|
4507
4552
|
} else {
|
|
4508
|
-
console.log(
|
|
4553
|
+
console.log(chalk22.yellow("\u2139\uFE0F Copy prompt manually (Auto-copy not supported on this OS)"));
|
|
4509
4554
|
}
|
|
4510
4555
|
} catch (e) {
|
|
4511
4556
|
}
|
|
4512
4557
|
}
|
|
4513
4558
|
} else {
|
|
4514
|
-
console.log(
|
|
4559
|
+
console.log(chalk22.yellow("No prompt instructions available."));
|
|
4515
4560
|
if (nextTask.architectural_brief) {
|
|
4516
|
-
console.log(
|
|
4561
|
+
console.log(chalk22.bold("Brief:"));
|
|
4517
4562
|
console.log(nextTask.architectural_brief);
|
|
4518
4563
|
}
|
|
4519
4564
|
}
|
|
4520
4565
|
console.log("");
|
|
4521
4566
|
} catch (e) {
|
|
4522
|
-
spinner.fail(
|
|
4567
|
+
spinner.fail(chalk22.red(`Failed to fetch task: ${e.message}`));
|
|
4523
4568
|
}
|
|
4524
4569
|
});
|
|
4525
4570
|
return focus;
|
|
@@ -4532,25 +4577,25 @@ init_env();
|
|
|
4532
4577
|
init_esm_shims();
|
|
4533
4578
|
init_config();
|
|
4534
4579
|
import { Command as Command15 } from "commander";
|
|
4535
|
-
import
|
|
4580
|
+
import chalk23 from "chalk";
|
|
4536
4581
|
function createConfigCommand() {
|
|
4537
4582
|
const config2 = new Command15("config");
|
|
4538
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) => {
|
|
4539
4584
|
if (!key) {
|
|
4540
|
-
console.log(
|
|
4541
|
-
console.log(
|
|
4585
|
+
console.log(chalk23.bold("Rigstate Configuration"));
|
|
4586
|
+
console.log(chalk23.dim("\u2500".repeat(40)));
|
|
4542
4587
|
try {
|
|
4543
4588
|
const apiKey = getApiKey();
|
|
4544
|
-
console.log(`${
|
|
4589
|
+
console.log(`${chalk23.cyan("api_key")}: ${apiKey.substring(0, 20)}...`);
|
|
4545
4590
|
} catch (e) {
|
|
4546
|
-
console.log(`${
|
|
4591
|
+
console.log(`${chalk23.cyan("api_key")}: ${chalk23.dim("(not set)")}`);
|
|
4547
4592
|
}
|
|
4548
4593
|
const projectId = getProjectId();
|
|
4549
|
-
console.log(`${
|
|
4594
|
+
console.log(`${chalk23.cyan("project_id")}: ${projectId || chalk23.dim("(not set)")}`);
|
|
4550
4595
|
const apiUrl = getApiUrl();
|
|
4551
|
-
console.log(`${
|
|
4596
|
+
console.log(`${chalk23.cyan("api_url")}: ${apiUrl}`);
|
|
4552
4597
|
console.log("");
|
|
4553
|
-
console.log(
|
|
4598
|
+
console.log(chalk23.dim('Use "rigstate config <key> <value>" to set a value.'));
|
|
4554
4599
|
return;
|
|
4555
4600
|
}
|
|
4556
4601
|
if (!value) {
|
|
@@ -4560,36 +4605,36 @@ function createConfigCommand() {
|
|
|
4560
4605
|
const apiKey = getApiKey();
|
|
4561
4606
|
console.log(apiKey);
|
|
4562
4607
|
} catch (e) {
|
|
4563
|
-
console.log(
|
|
4608
|
+
console.log(chalk23.dim("(not set)"));
|
|
4564
4609
|
}
|
|
4565
4610
|
break;
|
|
4566
4611
|
case "project_id":
|
|
4567
|
-
console.log(getProjectId() ||
|
|
4612
|
+
console.log(getProjectId() || chalk23.dim("(not set)"));
|
|
4568
4613
|
break;
|
|
4569
4614
|
case "api_url":
|
|
4570
4615
|
console.log(getApiUrl());
|
|
4571
4616
|
break;
|
|
4572
4617
|
default:
|
|
4573
|
-
console.log(
|
|
4574
|
-
console.log(
|
|
4618
|
+
console.log(chalk23.red(`Unknown config key: ${key}`));
|
|
4619
|
+
console.log(chalk23.dim("Valid keys: api_key, project_id, api_url"));
|
|
4575
4620
|
}
|
|
4576
4621
|
return;
|
|
4577
4622
|
}
|
|
4578
4623
|
switch (key) {
|
|
4579
4624
|
case "api_key":
|
|
4580
4625
|
setApiKey(value);
|
|
4581
|
-
console.log(
|
|
4626
|
+
console.log(chalk23.green(`\u2705 api_key updated`));
|
|
4582
4627
|
break;
|
|
4583
4628
|
case "project_id":
|
|
4584
4629
|
setProjectId(value);
|
|
4585
|
-
console.log(
|
|
4630
|
+
console.log(chalk23.green(`\u2705 project_id updated`));
|
|
4586
4631
|
break;
|
|
4587
4632
|
case "api_url":
|
|
4588
|
-
console.log(
|
|
4633
|
+
console.log(chalk23.yellow("api_url is set via RIGSTATE_API_URL environment variable"));
|
|
4589
4634
|
break;
|
|
4590
4635
|
default:
|
|
4591
|
-
console.log(
|
|
4592
|
-
console.log(
|
|
4636
|
+
console.log(chalk23.red(`Unknown config key: ${key}`));
|
|
4637
|
+
console.log(chalk23.dim("Valid keys: api_key, project_id"));
|
|
4593
4638
|
}
|
|
4594
4639
|
});
|
|
4595
4640
|
return config2;
|
|
@@ -4598,7 +4643,7 @@ function createConfigCommand() {
|
|
|
4598
4643
|
// src/commands/mcp.ts
|
|
4599
4644
|
init_esm_shims();
|
|
4600
4645
|
import { Command as Command16 } from "commander";
|
|
4601
|
-
import
|
|
4646
|
+
import chalk24 from "chalk";
|
|
4602
4647
|
import { spawn } from "child_process";
|
|
4603
4648
|
import path23 from "path";
|
|
4604
4649
|
import fs21 from "fs";
|
|
@@ -4624,15 +4669,15 @@ function createMcpCommand() {
|
|
|
4624
4669
|
}
|
|
4625
4670
|
}
|
|
4626
4671
|
if (!serverPath) {
|
|
4627
|
-
console.error(
|
|
4628
|
-
console.error(
|
|
4629
|
-
console.error(
|
|
4672
|
+
console.error(chalk24.red("\u274C Error: Rigstate MCP Server binary not found."));
|
|
4673
|
+
console.error(chalk24.yellow("Please ensure that the mcp package is built:"));
|
|
4674
|
+
console.error(chalk24.white(" cd packages/mcp && npm run build"));
|
|
4630
4675
|
console.error("");
|
|
4631
|
-
console.error(
|
|
4632
|
-
console.error(
|
|
4676
|
+
console.error(chalk24.dim("Or run directly with:"));
|
|
4677
|
+
console.error(chalk24.white(" npx @rigstate/mcp"));
|
|
4633
4678
|
process.exit(1);
|
|
4634
4679
|
}
|
|
4635
|
-
console.log(
|
|
4680
|
+
console.log(chalk24.dim(`Starting MCP server from: ${serverPath}`));
|
|
4636
4681
|
if (process.env.VIBE_API_KEY && !process.env.RIGSTATE_API_KEY) {
|
|
4637
4682
|
process.env.RIGSTATE_API_KEY = process.env.VIBE_API_KEY;
|
|
4638
4683
|
}
|
|
@@ -4641,7 +4686,7 @@ function createMcpCommand() {
|
|
|
4641
4686
|
stdio: ["inherit", "inherit", "inherit"]
|
|
4642
4687
|
});
|
|
4643
4688
|
worker.on("error", (err) => {
|
|
4644
|
-
console.error(
|
|
4689
|
+
console.error(chalk24.red(`\u274C Failed to start MCP server: ${err.message}`));
|
|
4645
4690
|
process.exit(1);
|
|
4646
4691
|
});
|
|
4647
4692
|
worker.on("exit", (code) => {
|
|
@@ -4656,7 +4701,7 @@ function createMcpCommand() {
|
|
|
4656
4701
|
// src/commands/nexus.ts
|
|
4657
4702
|
init_esm_shims();
|
|
4658
4703
|
import { Command as Command17 } from "commander";
|
|
4659
|
-
import
|
|
4704
|
+
import chalk27 from "chalk";
|
|
4660
4705
|
|
|
4661
4706
|
// src/nexus/dispatcher.ts
|
|
4662
4707
|
init_esm_shims();
|
|
@@ -4724,7 +4769,7 @@ var HiveScrubber = class {
|
|
|
4724
4769
|
};
|
|
4725
4770
|
|
|
4726
4771
|
// src/hive/gateway.ts
|
|
4727
|
-
import
|
|
4772
|
+
import chalk25 from "chalk";
|
|
4728
4773
|
var HiveGateway = class {
|
|
4729
4774
|
client;
|
|
4730
4775
|
enabled;
|
|
@@ -4734,7 +4779,7 @@ var HiveGateway = class {
|
|
|
4734
4779
|
constructor(baseUrl, token) {
|
|
4735
4780
|
this.enabled = !!token;
|
|
4736
4781
|
if (!this.enabled) {
|
|
4737
|
-
console.log(
|
|
4782
|
+
console.log(chalk25.dim("\u26A0\uFE0F Hive Gateway disabled (No Token provided). Running in localized mode."));
|
|
4738
4783
|
}
|
|
4739
4784
|
this.client = axios18.create({
|
|
4740
4785
|
baseURL: baseUrl,
|
|
@@ -4754,23 +4799,23 @@ var HiveGateway = class {
|
|
|
4754
4799
|
if (!this.enabled) return false;
|
|
4755
4800
|
const now = Date.now();
|
|
4756
4801
|
if (now - this.lastSignalTime < this.MIN_INTERVAL_MS) {
|
|
4757
|
-
console.warn(
|
|
4802
|
+
console.warn(chalk25.yellow("\u23F3 Hive Gateway Throttled. Signal dropped to preventing spam."));
|
|
4758
4803
|
return false;
|
|
4759
4804
|
}
|
|
4760
4805
|
const scrubResult = HiveScrubber.scrub(signal.ruleContent);
|
|
4761
4806
|
if (scrubResult.riskScore > 20) {
|
|
4762
|
-
console.error(
|
|
4807
|
+
console.error(chalk25.red(`\u{1F6D1} HIVE BLOCKED: Signal contains sensitive data (Risk: ${scrubResult.riskScore})`));
|
|
4763
4808
|
return false;
|
|
4764
4809
|
}
|
|
4765
4810
|
try {
|
|
4766
|
-
console.log(
|
|
4811
|
+
console.log(chalk25.blue(`\u{1F4E1} Uplinking to Hive... [${signal.vector}]`));
|
|
4767
4812
|
const payload = { ...signal, ruleContent: scrubResult.sanitizedContent };
|
|
4768
4813
|
await this.client.post("/signal", payload);
|
|
4769
4814
|
this.lastSignalTime = now;
|
|
4770
|
-
console.log(
|
|
4815
|
+
console.log(chalk25.green("\u2705 Signal Received by Hive Core. Knowledge Shared."));
|
|
4771
4816
|
return true;
|
|
4772
4817
|
} catch (error) {
|
|
4773
|
-
console.error(
|
|
4818
|
+
console.error(chalk25.red(`\u274C Hive Transmission Failed: ${error.message}`));
|
|
4774
4819
|
return false;
|
|
4775
4820
|
}
|
|
4776
4821
|
}
|
|
@@ -4778,37 +4823,37 @@ var HiveGateway = class {
|
|
|
4778
4823
|
|
|
4779
4824
|
// src/utils/logger.ts
|
|
4780
4825
|
init_esm_shims();
|
|
4781
|
-
import
|
|
4826
|
+
import chalk26 from "chalk";
|
|
4782
4827
|
var Logger = class {
|
|
4783
4828
|
static formatMessage(level, message, context) {
|
|
4784
4829
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
4785
4830
|
let prefix = "";
|
|
4786
4831
|
switch (level) {
|
|
4787
4832
|
case "INFO" /* INFO */:
|
|
4788
|
-
prefix =
|
|
4833
|
+
prefix = chalk26.blue(`[${"INFO" /* INFO */}]`);
|
|
4789
4834
|
break;
|
|
4790
4835
|
case "WARN" /* WARN */:
|
|
4791
|
-
prefix =
|
|
4836
|
+
prefix = chalk26.yellow(`[${"WARN" /* WARN */}]`);
|
|
4792
4837
|
break;
|
|
4793
4838
|
case "ERROR" /* ERROR */:
|
|
4794
|
-
prefix =
|
|
4839
|
+
prefix = chalk26.red(`[${"ERROR" /* ERROR */}]`);
|
|
4795
4840
|
break;
|
|
4796
4841
|
case "DEBUG" /* DEBUG */:
|
|
4797
|
-
prefix =
|
|
4842
|
+
prefix = chalk26.gray(`[${"DEBUG" /* DEBUG */}]`);
|
|
4798
4843
|
break;
|
|
4799
4844
|
}
|
|
4800
|
-
let output = `${
|
|
4845
|
+
let output = `${chalk26.gray(timestamp)} ${prefix} ${message}`;
|
|
4801
4846
|
if (context) {
|
|
4802
4847
|
if (context instanceof Error) {
|
|
4803
4848
|
output += `
|
|
4804
|
-
${
|
|
4849
|
+
${chalk26.red(context.stack || context.message)}`;
|
|
4805
4850
|
} else if (typeof context === "object") {
|
|
4806
4851
|
try {
|
|
4807
4852
|
output += `
|
|
4808
|
-
${
|
|
4853
|
+
${chalk26.gray(JSON.stringify(context, null, 2))}`;
|
|
4809
4854
|
} catch (e) {
|
|
4810
4855
|
output += `
|
|
4811
|
-
${
|
|
4856
|
+
${chalk26.gray("[Circular or invalid object]")}`;
|
|
4812
4857
|
}
|
|
4813
4858
|
} else {
|
|
4814
4859
|
output += ` ${String(context)}`;
|
|
@@ -4928,10 +4973,10 @@ import inquirer3 from "inquirer";
|
|
|
4928
4973
|
function createNexusCommand() {
|
|
4929
4974
|
const command = new Command17("nexus");
|
|
4930
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) => {
|
|
4931
|
-
console.log(
|
|
4976
|
+
console.log(chalk27.bold.magenta("\n\u{1F981} Welcome to The Nexus (Phase 8)\n"));
|
|
4932
4977
|
const dryRun = !options.force;
|
|
4933
4978
|
if (!dryRun) {
|
|
4934
|
-
console.log(
|
|
4979
|
+
console.log(chalk27.black.bgYellow(" WARNING ") + chalk27.yellow(" Dry-Run disabled! Eitri is authorized to write code."));
|
|
4935
4980
|
const { confirm } = await inquirer3.prompt([{
|
|
4936
4981
|
type: "confirm",
|
|
4937
4982
|
name: "confirm",
|
|
@@ -4952,26 +4997,26 @@ function createNexusCommand() {
|
|
|
4952
4997
|
};
|
|
4953
4998
|
const dispatcher = new NexusDispatcher(context);
|
|
4954
4999
|
dispatcher.on("order:created", (o) => {
|
|
4955
|
-
console.log(
|
|
5000
|
+
console.log(chalk27.blue(`\u{1F195} [${o.id.slice(0, 6)}] Order Created: `) + o.intent);
|
|
4956
5001
|
});
|
|
4957
5002
|
dispatcher.on("order:started", (o) => {
|
|
4958
|
-
console.log(
|
|
5003
|
+
console.log(chalk27.yellow(`\u23F3 [${o.id.slice(0, 6)}] Processing...`));
|
|
4959
5004
|
});
|
|
4960
5005
|
dispatcher.on("order:blocked", (o) => {
|
|
4961
|
-
console.log(
|
|
4962
|
-
console.log(
|
|
4963
|
-
console.log(
|
|
5006
|
+
console.log(chalk27.red(`\u{1F6D1} [${o.id.slice(0, 6)}] BLOCKED by Kill-Switch`));
|
|
5007
|
+
console.log(chalk27.dim(` Target: ${o.targetAgent} | Action: ${o.action}`));
|
|
5008
|
+
console.log(chalk27.dim(" Run with --force to execute automatically (NOT RECOMMENDED)."));
|
|
4964
5009
|
});
|
|
4965
|
-
dispatcher.on("agent:SINDRE", (o) => console.log(
|
|
4966
|
-
dispatcher.on("agent:EITRI", (o) => console.log(
|
|
4967
|
-
console.log(
|
|
5010
|
+
dispatcher.on("agent:SINDRE", (o) => console.log(chalk27.cyan(`\u{1F916} Sindre (Vault): I'm on it! (${o.action})`)));
|
|
5011
|
+
dispatcher.on("agent:EITRI", (o) => console.log(chalk27.green(`\u{1F477} Eitri (Smith): Ready to build! (${o.action})`)));
|
|
5012
|
+
console.log(chalk27.dim("\u{1F9E0} Frank is analyzing your intent..."));
|
|
4968
5013
|
await new Promise((r) => setTimeout(r, 800));
|
|
4969
5014
|
if (intent.toLowerCase().includes("db") || intent.toLowerCase().includes("database")) {
|
|
4970
5015
|
await dispatcher.dispatch("FRANK", "SINDRE", intent, "db.analyze", { raw: intent });
|
|
4971
5016
|
} else if (intent.toLowerCase().includes("create") || intent.toLowerCase().includes("code")) {
|
|
4972
5017
|
await dispatcher.dispatch("FRANK", "EITRI", intent, "fs.write", { path: "src/demo.ts", content: "// demo" });
|
|
4973
5018
|
} else {
|
|
4974
|
-
console.log(
|
|
5019
|
+
console.log(chalk27.gray("Frank didn't understand. Try 'create file' or 'check database'."));
|
|
4975
5020
|
}
|
|
4976
5021
|
});
|
|
4977
5022
|
return command;
|
|
@@ -4985,25 +5030,25 @@ init_esm_shims();
|
|
|
4985
5030
|
init_governance();
|
|
4986
5031
|
init_config();
|
|
4987
5032
|
import { Command as Command18 } from "commander";
|
|
4988
|
-
import
|
|
5033
|
+
import chalk28 from "chalk";
|
|
4989
5034
|
import axios19 from "axios";
|
|
4990
5035
|
function createOverrideCommand() {
|
|
4991
5036
|
const override = new Command18("override");
|
|
4992
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) => {
|
|
4993
5038
|
const { reason } = options;
|
|
4994
|
-
console.log(
|
|
5039
|
+
console.log(chalk28.bold(`
|
|
4995
5040
|
\u{1F513} Initiating Governance Override Protocol...`));
|
|
4996
5041
|
const session = await getSessionState(process.cwd());
|
|
4997
5042
|
if (session.status !== "SOFT_LOCK") {
|
|
4998
|
-
console.log(
|
|
5043
|
+
console.log(chalk28.yellow(" Info: Session is not currently locked."));
|
|
4999
5044
|
return;
|
|
5000
5045
|
}
|
|
5001
|
-
console.log(
|
|
5002
|
-
console.log(
|
|
5046
|
+
console.log(chalk28.dim(` Active Violation: ${session.active_violation}`));
|
|
5047
|
+
console.log(chalk28.dim(` Reason Provided: "${reason}"`));
|
|
5003
5048
|
const success = await performOverride(violationId, reason, process.cwd());
|
|
5004
5049
|
if (success) {
|
|
5005
|
-
console.log(
|
|
5006
|
-
console.log(
|
|
5050
|
+
console.log(chalk28.green(` \u2705 Session UNLOCKED.`));
|
|
5051
|
+
console.log(chalk28.dim(` This event has been logged to the Mission Report.`));
|
|
5007
5052
|
try {
|
|
5008
5053
|
const projectId = getProjectId();
|
|
5009
5054
|
if (projectId) {
|
|
@@ -5020,13 +5065,13 @@ function createOverrideCommand() {
|
|
|
5020
5065
|
}, {
|
|
5021
5066
|
headers: { Authorization: `Bearer ${apiKey}` }
|
|
5022
5067
|
});
|
|
5023
|
-
console.log(
|
|
5068
|
+
console.log(chalk28.dim(` \u2601 Audit log synced to Cloud.`));
|
|
5024
5069
|
}
|
|
5025
5070
|
} catch (e) {
|
|
5026
|
-
console.log(
|
|
5071
|
+
console.log(chalk28.dim(` (Cloud audit sync failed: ${e.message})`));
|
|
5027
5072
|
}
|
|
5028
5073
|
} else {
|
|
5029
|
-
console.log(
|
|
5074
|
+
console.log(chalk28.red(` \u{1F6D1} Override Failed. Check project configuration.`));
|
|
5030
5075
|
}
|
|
5031
5076
|
});
|
|
5032
5077
|
return override;
|
|
@@ -5036,7 +5081,7 @@ function createOverrideCommand() {
|
|
|
5036
5081
|
init_esm_shims();
|
|
5037
5082
|
init_config();
|
|
5038
5083
|
import { Command as Command19 } from "commander";
|
|
5039
|
-
import
|
|
5084
|
+
import chalk29 from "chalk";
|
|
5040
5085
|
import ora12 from "ora";
|
|
5041
5086
|
import axios20 from "axios";
|
|
5042
5087
|
import inquirer4 from "inquirer";
|
|
@@ -5047,7 +5092,7 @@ function createIdeaCommand() {
|
|
|
5047
5092
|
const apiUrl = getApiUrl();
|
|
5048
5093
|
const projectId = getProjectId();
|
|
5049
5094
|
if (!projectId) {
|
|
5050
|
-
console.error(
|
|
5095
|
+
console.error(chalk29.red("Project context missing. Run rigstate link."));
|
|
5051
5096
|
process.exit(1);
|
|
5052
5097
|
}
|
|
5053
5098
|
let ideaTitle = title;
|
|
@@ -5083,14 +5128,14 @@ function createIdeaCommand() {
|
|
|
5083
5128
|
{ headers: { Authorization: `Bearer ${apiKey}` } }
|
|
5084
5129
|
);
|
|
5085
5130
|
if (response.data.success) {
|
|
5086
|
-
spinner.succeed(
|
|
5087
|
-
console.log(
|
|
5131
|
+
spinner.succeed(chalk29.green("Idea Captured! \u{1F4A1}"));
|
|
5132
|
+
console.log(chalk29.dim(`ID: ${response.data.data?.id || "Saved"}`));
|
|
5088
5133
|
} else {
|
|
5089
5134
|
throw new Error(response.data.error);
|
|
5090
5135
|
}
|
|
5091
5136
|
} catch (e) {
|
|
5092
5137
|
const errorDetail = e.response?.data?.error || e.message;
|
|
5093
|
-
console.error(
|
|
5138
|
+
console.error(chalk29.red(`
|
|
5094
5139
|
Failed to capture idea: ${errorDetail}`));
|
|
5095
5140
|
}
|
|
5096
5141
|
});
|
|
@@ -5100,7 +5145,7 @@ Failed to capture idea: ${errorDetail}`));
|
|
|
5100
5145
|
init_esm_shims();
|
|
5101
5146
|
init_config();
|
|
5102
5147
|
import { Command as Command20 } from "commander";
|
|
5103
|
-
import
|
|
5148
|
+
import chalk30 from "chalk";
|
|
5104
5149
|
import ora13 from "ora";
|
|
5105
5150
|
import inquirer5 from "inquirer";
|
|
5106
5151
|
import fs22 from "fs/promises";
|
|
@@ -9676,7 +9721,7 @@ function createReleaseCommand() {
|
|
|
9676
9721
|
if (type === "major") newVersion = `${major + 1}.0.0`;
|
|
9677
9722
|
if (type === "minor") newVersion = `${major}.${minor + 1}.0`;
|
|
9678
9723
|
if (type === "patch") newVersion = `${major}.${minor}.${patch + 1}`;
|
|
9679
|
-
spinner.succeed(`Bumping ${pkg.name} from ${
|
|
9724
|
+
spinner.succeed(`Bumping ${pkg.name} from ${chalk30.dim(currentVersion)} to ${chalk30.green(newVersion)}`);
|
|
9680
9725
|
const { confirm } = await inquirer5.prompt([{
|
|
9681
9726
|
type: "confirm",
|
|
9682
9727
|
name: "confirm",
|
|
@@ -9706,7 +9751,7 @@ function createReleaseCommand() {
|
|
|
9706
9751
|
await git.addTag(`v${newVersion}`);
|
|
9707
9752
|
await git.push();
|
|
9708
9753
|
await git.pushTags();
|
|
9709
|
-
spinner.succeed(
|
|
9754
|
+
spinner.succeed(chalk30.bold.green(`\u{1F680} Release v${newVersion} shipped!`));
|
|
9710
9755
|
} catch (e) {
|
|
9711
9756
|
spinner.fail(e.message);
|
|
9712
9757
|
}
|
|
@@ -9724,7 +9769,7 @@ function getContext2() {
|
|
|
9724
9769
|
init_esm_shims();
|
|
9725
9770
|
init_config();
|
|
9726
9771
|
import { Command as Command21 } from "commander";
|
|
9727
|
-
import
|
|
9772
|
+
import chalk31 from "chalk";
|
|
9728
9773
|
import ora14 from "ora";
|
|
9729
9774
|
import axios21 from "axios";
|
|
9730
9775
|
function createRoadmapCommand() {
|
|
@@ -9735,7 +9780,7 @@ function createRoadmapCommand() {
|
|
|
9735
9780
|
const apiUrl = getApiUrl();
|
|
9736
9781
|
const projectId = getProjectId();
|
|
9737
9782
|
if (!projectId) {
|
|
9738
|
-
spinner.fail(
|
|
9783
|
+
spinner.fail(chalk31.red('Project context missing. Run "rigstate link".'));
|
|
9739
9784
|
return;
|
|
9740
9785
|
}
|
|
9741
9786
|
const response = await axios21.get(
|
|
@@ -9748,11 +9793,11 @@ function createRoadmapCommand() {
|
|
|
9748
9793
|
const tasks = response.data.data.roadmap || [];
|
|
9749
9794
|
spinner.stop();
|
|
9750
9795
|
if (tasks.length === 0) {
|
|
9751
|
-
console.log(
|
|
9796
|
+
console.log(chalk31.yellow("\nRoadmap is empty. Use the web UI to define your journey."));
|
|
9752
9797
|
return;
|
|
9753
9798
|
}
|
|
9754
|
-
console.log("\n" +
|
|
9755
|
-
console.log(
|
|
9799
|
+
console.log("\n" + chalk31.bold.underline("\u{1F6F0}\uFE0F TACTICAL OVERVIEW: PROJECT ROADMAP"));
|
|
9800
|
+
console.log(chalk31.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"));
|
|
9756
9801
|
const columns = {
|
|
9757
9802
|
"IN_PROGRESS": [],
|
|
9758
9803
|
"ACTIVE": [],
|
|
@@ -9764,14 +9809,14 @@ function createRoadmapCommand() {
|
|
|
9764
9809
|
columns[t.status].push(t);
|
|
9765
9810
|
}
|
|
9766
9811
|
});
|
|
9767
|
-
displayColumn("\u{1F525} IN PROGRESS", columns.IN_PROGRESS,
|
|
9768
|
-
displayColumn("\u25B6\uFE0F ACTIVE / NEXT", columns.ACTIVE,
|
|
9769
|
-
displayColumn("\u{1F512} LOCKED", columns.LOCKED,
|
|
9770
|
-
displayColumn("\u23F3 PENDING", columns.PENDING,
|
|
9771
|
-
console.log(
|
|
9772
|
-
console.log(
|
|
9812
|
+
displayColumn("\u{1F525} IN PROGRESS", columns.IN_PROGRESS, chalk31.yellow);
|
|
9813
|
+
displayColumn("\u25B6\uFE0F ACTIVE / NEXT", columns.ACTIVE, chalk31.green);
|
|
9814
|
+
displayColumn("\u{1F512} LOCKED", columns.LOCKED, chalk31.blue);
|
|
9815
|
+
displayColumn("\u23F3 PENDING", columns.PENDING, chalk31.gray);
|
|
9816
|
+
console.log(chalk31.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(chalk31.dim(`Total: ${tasks.length} tasks | Run "rigstate work" to start coding.`));
|
|
9773
9818
|
} catch (e) {
|
|
9774
|
-
spinner.fail(
|
|
9819
|
+
spinner.fail(chalk31.red(`
|
|
9775
9820
|
Failed to fetch roadmap: ${e.message}`));
|
|
9776
9821
|
}
|
|
9777
9822
|
});
|
|
@@ -9782,8 +9827,8 @@ function displayColumn(title, items, color) {
|
|
|
9782
9827
|
${color.bold(title)}`);
|
|
9783
9828
|
items.sort((a, b) => a.step_number - b.step_number).forEach((item) => {
|
|
9784
9829
|
const id = `T-${item.step_number}`.padEnd(8);
|
|
9785
|
-
const priority = item.priority === "MVP" ?
|
|
9786
|
-
console.log(` ${color("\u2022")} ${
|
|
9830
|
+
const priority = item.priority === "MVP" ? chalk31.magenta(" [MVP]") : "";
|
|
9831
|
+
console.log(` ${color("\u2022")} ${chalk31.bold(id)} ${item.title}${priority}`);
|
|
9787
9832
|
});
|
|
9788
9833
|
}
|
|
9789
9834
|
|
|
@@ -9791,7 +9836,7 @@ ${color.bold(title)}`);
|
|
|
9791
9836
|
init_esm_shims();
|
|
9792
9837
|
init_config();
|
|
9793
9838
|
import { Command as Command22 } from "commander";
|
|
9794
|
-
import
|
|
9839
|
+
import chalk32 from "chalk";
|
|
9795
9840
|
import ora15 from "ora";
|
|
9796
9841
|
import inquirer6 from "inquirer";
|
|
9797
9842
|
function createCouncilCommand() {
|
|
@@ -9802,7 +9847,7 @@ function createCouncilCommand() {
|
|
|
9802
9847
|
const apiUrl = getApiUrl();
|
|
9803
9848
|
const projectId = getProjectId();
|
|
9804
9849
|
if (!projectId) {
|
|
9805
|
-
console.error(
|
|
9850
|
+
console.error(chalk32.red('Project context missing. Run "rigstate link".'));
|
|
9806
9851
|
return;
|
|
9807
9852
|
}
|
|
9808
9853
|
let sessionTopic = topic;
|
|
@@ -9814,25 +9859,25 @@ function createCouncilCommand() {
|
|
|
9814
9859
|
}]);
|
|
9815
9860
|
sessionTopic = ans.topic;
|
|
9816
9861
|
}
|
|
9817
|
-
console.log(
|
|
9818
|
-
console.log(
|
|
9819
|
-
console.log(
|
|
9820
|
-
console.log(
|
|
9862
|
+
console.log(chalk32.bold.magenta("\n\u2696\uFE0F CONVENING THE COUNCIL OF SOVEREIGNTY\n"));
|
|
9863
|
+
console.log(chalk32.dim(`Topic: ${sessionTopic}`));
|
|
9864
|
+
console.log(chalk32.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(chalk32.yellow("\n\u{1F9E0} Frank (Architect): Analyzing alignment with Project DNA..."));
|
|
9821
9866
|
await sleep(1500);
|
|
9822
|
-
console.log(
|
|
9823
|
-
console.log(
|
|
9867
|
+
console.log(chalk32.gray(' "This decision affects our backend scalability. I recommend caution."'));
|
|
9868
|
+
console.log(chalk32.blue("\n\u{1F6E1}\uFE0F Sigrid (Curator): Checking historical precedents..."));
|
|
9824
9869
|
await sleep(1500);
|
|
9825
|
-
console.log(
|
|
9826
|
-
console.log(
|
|
9870
|
+
console.log(chalk32.gray(` "Similar patterns in other projects led to technical debt. Let's review RLS."`));
|
|
9871
|
+
console.log(chalk32.green("\n\u{1F4D0} Einar (Analyst): Scanning dependency impact..."));
|
|
9827
9872
|
await sleep(1500);
|
|
9828
|
-
console.log(
|
|
9829
|
-
console.log(
|
|
9830
|
-
console.log(
|
|
9831
|
-
console.log(
|
|
9832
|
-
console.log(
|
|
9833
|
-
console.log(
|
|
9873
|
+
console.log(chalk32.gray(' "Implementation will require updating 3 core services."'));
|
|
9874
|
+
console.log(chalk32.bold.white("\n\u{1F4CB} [FINAL DECISION RECORD]"));
|
|
9875
|
+
console.log(chalk32.white(" Status: Approved with conditions"));
|
|
9876
|
+
console.log(chalk32.white(" Rationale: Value outweighs migration cost. Ensure SEC-SQL-01 compliance."));
|
|
9877
|
+
console.log(chalk32.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(chalk32.green("\u2705 Decision saved to Project Brain (ADR-102)"));
|
|
9834
9879
|
} catch (e) {
|
|
9835
|
-
console.error(
|
|
9880
|
+
console.error(chalk32.red(`
|
|
9836
9881
|
Council session aborted: ${e.message}`));
|
|
9837
9882
|
}
|
|
9838
9883
|
});
|
|
@@ -9878,19 +9923,19 @@ program.hook("preAction", async () => {
|
|
|
9878
9923
|
});
|
|
9879
9924
|
program.on("--help", () => {
|
|
9880
9925
|
console.log("");
|
|
9881
|
-
console.log(
|
|
9926
|
+
console.log(chalk33.bold("Examples:"));
|
|
9882
9927
|
console.log("");
|
|
9883
|
-
console.log(
|
|
9884
|
-
console.log(
|
|
9928
|
+
console.log(chalk33.cyan(" $ rigstate login sk_rigstate_your_api_key"));
|
|
9929
|
+
console.log(chalk33.dim(" Authenticate with your Rigstate API key"));
|
|
9885
9930
|
console.log("");
|
|
9886
|
-
console.log(
|
|
9887
|
-
console.log(
|
|
9931
|
+
console.log(chalk33.cyan(" $ rigstate scan"));
|
|
9932
|
+
console.log(chalk33.dim(" Scan the current directory"));
|
|
9888
9933
|
console.log("");
|
|
9889
|
-
console.log(
|
|
9890
|
-
console.log(
|
|
9934
|
+
console.log(chalk33.cyan(" $ rigstate scan ./src --project abc123"));
|
|
9935
|
+
console.log(chalk33.dim(" Scan a specific directory with project ID"));
|
|
9891
9936
|
console.log("");
|
|
9892
|
-
console.log(
|
|
9893
|
-
console.log(
|
|
9937
|
+
console.log(chalk33.cyan(" $ rigstate scan --json"));
|
|
9938
|
+
console.log(chalk33.dim(" Output results in JSON format (useful for IDE extensions)"));
|
|
9894
9939
|
console.log("");
|
|
9895
9940
|
});
|
|
9896
9941
|
program.parse(process.argv);
|