@rigstate/cli 0.7.9 → 0.7.11

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 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
- const url = `http://localhost:${port}`;
100
- await axios22.get(`${url}/api/v1/system/health`, { timeout: 500 });
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 import_chalk32 = __toESM(require("chalk"), 1);
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 import_chalk18 = __toESM(require("chalk"), 1);
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 import_chalk17 = __toESM(require("chalk"), 1);
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,33 @@ function createGuardianMonitor(projectId, apiUrl, apiKey) {
3569
3586
  return;
3570
3587
  }
3571
3588
  } catch (error) {
3589
+ if (apiUrl.includes("localhost") || apiUrl.includes("127.0.0.1")) {
3590
+ const cloudUrl = "https://app.rigstate.com";
3591
+ console.log(import_chalk17.default.blue(` \u2601\uFE0F Local API not found. Attempting Cloud Fallback (${cloudUrl})...`));
3592
+ try {
3593
+ const cloudResponse = await import_axios12.default.get(`${cloudUrl}/api/v1/guardian/rules`, {
3594
+ params: { project_id: projectId },
3595
+ headers: { Authorization: `Bearer ${apiKey}` },
3596
+ timeout: 5e3
3597
+ });
3598
+ if (cloudResponse.data.success && cloudResponse.data.data.rules) {
3599
+ rules = cloudResponse.data.data.rules;
3600
+ console.log(import_chalk17.default.green(` \u2705 Successfully loaded rules from Rigstate Cloud!`));
3601
+ lastFetch = Date.now();
3602
+ await saveCachedRules2(projectId, rules);
3603
+ return;
3604
+ }
3605
+ } catch (cloudError) {
3606
+ console.error(import_chalk17.default.red(` \u274C Cloud Fallback failed: ${cloudError.message}`));
3607
+ }
3608
+ }
3609
+ console.error(import_chalk17.default.red(` \u26A0\uFE0F Failed to fetch rules from API: ${error.message}`));
3610
+ if (error.response) {
3611
+ console.error(import_chalk17.default.red(` Status: ${error.response.status} - ${JSON.stringify(error.response.data)}`));
3612
+ }
3572
3613
  const cached = await loadCachedRules2(projectId);
3573
3614
  if (cached) {
3615
+ console.log(import_chalk17.default.yellow(" \u2139\uFE0F Using cached rules as fallback"));
3574
3616
  rules = cached.rules;
3575
3617
  lastFetch = Date.now();
3576
3618
  return;
@@ -3741,7 +3783,7 @@ var GuardianDaemon = class extends import_events3.EventEmitter {
3741
3783
  }
3742
3784
  async start() {
3743
3785
  if (this.state.isRunning) {
3744
- console.log(import_chalk17.default.yellow("Daemon is already running."));
3786
+ console.log(import_chalk18.default.yellow("Daemon is already running."));
3745
3787
  return;
3746
3788
  }
3747
3789
  this.printWelcome();
@@ -3751,7 +3793,7 @@ var GuardianDaemon = class extends import_events3.EventEmitter {
3751
3793
  this.interventionProtocol = createInterventionProtocol();
3752
3794
  this.guardianMonitor = createGuardianMonitor(this.config.projectId, this.config.apiUrl, this.config.apiKey);
3753
3795
  await this.guardianMonitor.loadRules();
3754
- console.log(import_chalk17.default.green(` \u2713 Loaded ${this.guardianMonitor.getRuleCount()} rules`));
3796
+ console.log(import_chalk18.default.green(` \u2713 Loaded ${this.guardianMonitor.getRuleCount()} rules`));
3755
3797
  await this.syncHeuristics();
3756
3798
  if (this.config.checkOnChange) {
3757
3799
  this.setupFileWatcher();
@@ -3763,31 +3805,32 @@ var GuardianDaemon = class extends import_events3.EventEmitter {
3763
3805
  this.emit("started", this.state);
3764
3806
  }
3765
3807
  printWelcome() {
3766
- console.log(import_chalk17.default.bold.blue("\n\u{1F6E1}\uFE0F Guardian Daemon Starting..."));
3767
- console.log(import_chalk17.default.dim(`Project: ${this.config.projectId}`));
3768
- console.log(import_chalk17.default.dim(`Watch Path: ${this.config.watchPath}`));
3769
- console.log(import_chalk17.default.dim("\u2500".repeat(50)));
3808
+ console.log(import_chalk18.default.bold.blue("\n\u{1F6E1}\uFE0F Guardian Daemon Starting..."));
3809
+ console.log(import_chalk18.default.dim(`Project: ${this.config.projectId}`));
3810
+ console.log(import_chalk18.default.dim(`API URL: ${this.config.apiUrl}`));
3811
+ console.log(import_chalk18.default.dim(`Watch Path: ${this.config.watchPath}`));
3812
+ console.log(import_chalk18.default.dim("\u2500".repeat(50)));
3770
3813
  }
3771
3814
  printActive() {
3772
- console.log(import_chalk17.default.dim("\u2500".repeat(50)));
3773
- console.log(import_chalk17.default.green.bold("\u2705 Guardian Daemon is now active"));
3774
- console.log(import_chalk17.default.dim("Press Ctrl+C to stop\n"));
3815
+ console.log(import_chalk18.default.dim("\u2500".repeat(50)));
3816
+ console.log(import_chalk18.default.green.bold("\u2705 Guardian Daemon is now active"));
3817
+ console.log(import_chalk18.default.dim("Press Ctrl+C to stop\n"));
3775
3818
  }
3776
3819
  async syncHeuristics() {
3777
3820
  if (!this.heuristicEngine) return;
3778
3821
  const synced = await this.heuristicEngine.refreshRules(this.config.projectId, this.config.apiUrl, this.config.apiKey);
3779
- if (synced) console.log(import_chalk17.default.green(" \u2713 Synced heuristic rules"));
3822
+ if (synced) console.log(import_chalk18.default.green(" \u2713 Synced heuristic rules"));
3780
3823
  }
3781
3824
  setupFileWatcher() {
3782
- console.log(import_chalk17.default.dim("\u{1F4C2} Starting file watcher..."));
3825
+ console.log(import_chalk18.default.dim("\u{1F4C2} Starting file watcher..."));
3783
3826
  this.fileWatcher = createFileWatcher(this.config.watchPath);
3784
3827
  this.fileWatcher.on("change", (path24) => this.handleFileChange(path24));
3785
3828
  this.fileWatcher.start();
3786
- console.log(import_chalk17.default.green(" \u2713 File watcher active"));
3829
+ console.log(import_chalk18.default.green(" \u2713 File watcher active"));
3787
3830
  }
3788
3831
  async handleFileChange(filePath) {
3789
3832
  this.state.lastActivity = (/* @__PURE__ */ new Date()).toISOString();
3790
- if (this.config.verbose) console.log(import_chalk17.default.dim(` \u{1F4DD} File changed: ${filePath}`));
3833
+ if (this.config.verbose) console.log(import_chalk18.default.dim(` \u{1F4DD} File changed: ${filePath}`));
3791
3834
  let lineCount = 0;
3792
3835
  try {
3793
3836
  const content = await fs17.readFile(filePath, "utf-8");
@@ -3800,8 +3843,8 @@ var GuardianDaemon = class extends import_events3.EventEmitter {
3800
3843
  rules: this.guardianMonitor.getRules()
3801
3844
  });
3802
3845
  for (const match of matches) {
3803
- console.log(import_chalk17.default.magenta(` \u{1F4A1} PREDICTIVE ACTIVATION: ${match.skillId}`));
3804
- console.log(import_chalk17.default.dim(` Reason: ${match.reason}`));
3846
+ console.log(import_chalk18.default.magenta(` \u{1F4A1} PREDICTIVE ACTIVATION: ${match.skillId}`));
3847
+ console.log(import_chalk18.default.dim(` Reason: ${match.reason}`));
3805
3848
  const decision = this.interventionProtocol.evaluateTrigger(match.skillId, match.confidence);
3806
3849
  this.interventionProtocol.enforce(decision);
3807
3850
  await jitProvisionSkill(match.skillId, this.config.apiUrl, this.config.apiKey, this.config.projectId, process.cwd());
@@ -3817,7 +3860,7 @@ var GuardianDaemon = class extends import_events3.EventEmitter {
3817
3860
  this.state.violationsFound += result.violations.length;
3818
3861
  this.emit("violation", { file: filePath, violations: result.violations });
3819
3862
  for (const v of result.violations) {
3820
- const color = v.severity === "critical" ? import_chalk17.default.red : v.severity === "warning" ? import_chalk17.default.yellow : import_chalk17.default.blue;
3863
+ const color = v.severity === "critical" ? import_chalk18.default.red : v.severity === "warning" ? import_chalk18.default.yellow : import_chalk18.default.blue;
3821
3864
  console.log(color(` [${v.severity.toUpperCase()}] ${filePath}: ${v.message}`));
3822
3865
  if (this.interventionProtocol) {
3823
3866
  const decision = this.interventionProtocol.evaluateViolation(v.message, v.severity);
@@ -3829,25 +3872,25 @@ var GuardianDaemon = class extends import_events3.EventEmitter {
3829
3872
  }
3830
3873
  }
3831
3874
  async setupBridge() {
3832
- console.log(import_chalk17.default.dim("\u{1F309} Connecting to Agent Bridge..."));
3875
+ console.log(import_chalk18.default.dim("\u{1F309} Connecting to Agent Bridge..."));
3833
3876
  this.bridgeListener = createBridgeListener(this.config.projectId, this.config.apiUrl, this.config.apiKey);
3834
3877
  this.bridgeListener.on("task", (task) => {
3835
3878
  this.state.lastActivity = (/* @__PURE__ */ new Date()).toISOString();
3836
3879
  this.state.tasksProcessed++;
3837
- console.log(import_chalk17.default.cyan(`
3880
+ console.log(import_chalk18.default.cyan(`
3838
3881
  \u{1F4E5} New task received: ${task.id}`));
3839
3882
  this.emit("task", task);
3840
3883
  });
3841
3884
  await this.bridgeListener.connect();
3842
- console.log(import_chalk17.default.green(" \u2713 Agent Bridge connected"));
3885
+ console.log(import_chalk18.default.green(" \u2713 Agent Bridge connected"));
3843
3886
  }
3844
3887
  async stop() {
3845
3888
  if (!this.state.isRunning) return;
3846
- console.log(import_chalk17.default.dim("\n\u{1F6D1} Stopping Guardian Daemon..."));
3889
+ console.log(import_chalk18.default.dim("\n\u{1F6D1} Stopping Guardian Daemon..."));
3847
3890
  if (this.fileWatcher) await this.fileWatcher.stop();
3848
3891
  if (this.bridgeListener) await this.bridgeListener.disconnect();
3849
3892
  this.state.isRunning = false;
3850
- console.log(import_chalk17.default.green("\u2713 Daemon stopped."));
3893
+ console.log(import_chalk18.default.green("\u2713 Daemon stopped."));
3851
3894
  this.emit("stopped", this.state);
3852
3895
  }
3853
3896
  getState() {
@@ -3905,9 +3948,9 @@ function createDaemonCommand() {
3905
3948
  const spinner = (0, import_ora8.default)();
3906
3949
  try {
3907
3950
  if (await isRunning()) {
3908
- console.log(import_chalk18.default.yellow("\u26A0 Another daemon instance may be running."));
3909
- console.log(import_chalk18.default.dim(` Check ${PID_FILE} or run "rigstate daemon status"`));
3910
- console.log(import_chalk18.default.dim(" Use Ctrl+C to stop the running daemon first.\n"));
3951
+ console.log(import_chalk19.default.yellow("\u26A0 Another daemon instance may be running."));
3952
+ console.log(import_chalk19.default.dim(` Check ${PID_FILE} or run "rigstate daemon status"`));
3953
+ console.log(import_chalk19.default.dim(" Use Ctrl+C to stop the running daemon first.\n"));
3911
3954
  }
3912
3955
  spinner.start("Initializing Guardian Daemon...");
3913
3956
  const daemonInstance = await createDaemon({
@@ -3919,7 +3962,7 @@ function createDaemonCommand() {
3919
3962
  spinner.stop();
3920
3963
  await writePidFile();
3921
3964
  process.on("SIGINT", async () => {
3922
- console.log(import_chalk18.default.dim("\n\nShutting down..."));
3965
+ console.log(import_chalk19.default.dim("\n\nShutting down..."));
3923
3966
  await daemonInstance.stop();
3924
3967
  await cleanupPidFile();
3925
3968
  process.exit(0);
@@ -3939,8 +3982,8 @@ function createDaemonCommand() {
3939
3982
  await new Promise(() => {
3940
3983
  });
3941
3984
  } catch (error) {
3942
- spinner.fail(import_chalk18.default.red("Failed to start daemon"));
3943
- console.error(import_chalk18.default.red("Error:"), error.message);
3985
+ spinner.fail(import_chalk19.default.red("Failed to start daemon"));
3986
+ console.error(import_chalk19.default.red("Error:"), error.message);
3944
3987
  process.exit(1);
3945
3988
  }
3946
3989
  });
@@ -3989,46 +4032,46 @@ async function writeStateFile(state) {
3989
4032
  }
3990
4033
  }
3991
4034
  async function showStatus() {
3992
- console.log(import_chalk18.default.bold("\n\u{1F6E1}\uFE0F Guardian Daemon Status\n"));
4035
+ console.log(import_chalk19.default.bold("\n\u{1F6E1}\uFE0F Guardian Daemon Status\n"));
3993
4036
  const running = await isRunning();
3994
4037
  if (!running) {
3995
- console.log(import_chalk18.default.yellow("Status: Not running"));
3996
- console.log(import_chalk18.default.dim('Use "rigstate daemon" to start.\n'));
4038
+ console.log(import_chalk19.default.yellow("Status: Not running"));
4039
+ console.log(import_chalk19.default.dim('Use "rigstate daemon" to start.\n'));
3997
4040
  return;
3998
4041
  }
3999
- console.log(import_chalk18.default.green("Status: Running"));
4042
+ console.log(import_chalk19.default.green("Status: Running"));
4000
4043
  try {
4001
4044
  const statePath = import_path19.default.join(process.cwd(), STATE_FILE);
4002
4045
  const content = await import_promises17.default.readFile(statePath, "utf-8");
4003
4046
  const state = JSON.parse(content);
4004
- console.log(import_chalk18.default.dim("\u2500".repeat(40)));
4047
+ console.log(import_chalk19.default.dim("\u2500".repeat(40)));
4005
4048
  console.log(`Started at: ${state.startedAt || "Unknown"}`);
4006
4049
  console.log(`Files checked: ${state.filesChecked || 0}`);
4007
4050
  console.log(`Violations: ${state.violationsFound || 0}`);
4008
4051
  console.log(`Tasks processed: ${state.tasksProcessed || 0}`);
4009
4052
  console.log(`Last activity: ${state.lastActivity || "None"}`);
4010
- console.log(import_chalk18.default.dim("\u2500".repeat(40)));
4053
+ console.log(import_chalk19.default.dim("\u2500".repeat(40)));
4011
4054
  } catch {
4012
- console.log(import_chalk18.default.dim("(State file not found)"));
4055
+ console.log(import_chalk19.default.dim("(State file not found)"));
4013
4056
  }
4014
4057
  try {
4015
4058
  const pidPath = import_path19.default.join(process.cwd(), PID_FILE);
4016
4059
  const pid = await import_promises17.default.readFile(pidPath, "utf-8");
4017
- console.log(import_chalk18.default.dim(`PID: ${pid.trim()}`));
4060
+ console.log(import_chalk19.default.dim(`PID: ${pid.trim()}`));
4018
4061
  } catch {
4019
4062
  }
4020
4063
  console.log("");
4021
4064
  }
4022
4065
  async function enableDaemon() {
4023
- console.log(import_chalk18.default.bold("\n\u2699\uFE0F Enabling Rigstate Background Service (macOS)\n"));
4066
+ console.log(import_chalk19.default.bold("\n\u2699\uFE0F Enabling Rigstate Background Service (macOS)\n"));
4024
4067
  if (process.platform !== "darwin") {
4025
- console.error(import_chalk18.default.red("\u274C Currently only macOS is supported for auto-start."));
4026
- console.error(import_chalk18.default.yellow("PRs welcome for Linux/Windows support!"));
4068
+ console.error(import_chalk19.default.red("\u274C Currently only macOS is supported for auto-start."));
4069
+ console.error(import_chalk19.default.yellow("PRs welcome for Linux/Windows support!"));
4027
4070
  return;
4028
4071
  }
4029
4072
  const homeDir = process.env.HOME || "";
4030
4073
  if (!homeDir) {
4031
- console.error(import_chalk18.default.red("\u274C Could not determine HOME directory."));
4074
+ console.error(import_chalk19.default.red("\u274C Could not determine HOME directory."));
4032
4075
  return;
4033
4076
  }
4034
4077
  const agentsDir = import_path19.default.join(homeDir, "Library/LaunchAgents");
@@ -4070,32 +4113,32 @@ async function enableDaemon() {
4070
4113
  </plist>`;
4071
4114
  try {
4072
4115
  await import_promises17.default.writeFile(plistPath, plistContent);
4073
- console.log(import_chalk18.default.dim(`Created plist at: ${plistPath}`));
4116
+ console.log(import_chalk19.default.dim(`Created plist at: ${plistPath}`));
4074
4117
  try {
4075
4118
  await execShellCommand(`launchctl unload ${plistPath}`);
4076
4119
  } catch (e) {
4077
4120
  }
4078
4121
  await execShellCommand(`launchctl load ${plistPath}`);
4079
- console.log(import_chalk18.default.green("\u2705 Successfully enabled background daemon!"));
4080
- console.log(import_chalk18.default.dim(`Logs: ${logDir}`));
4081
- console.log(import_chalk18.default.dim("The daemon will now restart automatically if it crashes or on reboot."));
4122
+ console.log(import_chalk19.default.green("\u2705 Successfully enabled background daemon!"));
4123
+ console.log(import_chalk19.default.dim(`Logs: ${logDir}`));
4124
+ console.log(import_chalk19.default.dim("The daemon will now restart automatically if it crashes or on reboot."));
4082
4125
  } catch (error) {
4083
- console.error(import_chalk18.default.red("\u274C Failed to enable daemon:"), error.message);
4126
+ console.error(import_chalk19.default.red("\u274C Failed to enable daemon:"), error.message);
4084
4127
  }
4085
4128
  }
4086
4129
  async function disableDaemon() {
4087
- console.log(import_chalk18.default.bold("\n\u2699\uFE0F Disabling Rigstate Background Service\n"));
4130
+ console.log(import_chalk19.default.bold("\n\u2699\uFE0F Disabling Rigstate Background Service\n"));
4088
4131
  const homeDir = process.env.HOME || "";
4089
4132
  const plistPath = import_path19.default.join(homeDir, "Library/LaunchAgents/com.rigstate.daemon.plist");
4090
4133
  try {
4091
4134
  await execShellCommand(`launchctl unload ${plistPath}`);
4092
4135
  await import_promises17.default.unlink(plistPath);
4093
- console.log(import_chalk18.default.green("\u2705 Successfully disabled background daemon."));
4136
+ console.log(import_chalk19.default.green("\u2705 Successfully disabled background daemon."));
4094
4137
  } catch (error) {
4095
4138
  if (error.code === "ENOENT") {
4096
- console.log(import_chalk18.default.green("\u2705 Daemon was not enabled."));
4139
+ console.log(import_chalk19.default.green("\u2705 Daemon was not enabled."));
4097
4140
  } else {
4098
- console.error(import_chalk18.default.red("\u274C Failed to disable daemon:"), error.message);
4141
+ console.error(import_chalk19.default.red("\u274C Failed to disable daemon:"), error.message);
4099
4142
  }
4100
4143
  }
4101
4144
  }
@@ -4111,7 +4154,7 @@ async function execShellCommand(cmd) {
4111
4154
  // src/commands/work.ts
4112
4155
  init_cjs_shims();
4113
4156
  var import_commander12 = require("commander");
4114
- var import_chalk19 = __toESM(require("chalk"), 1);
4157
+ var import_chalk20 = __toESM(require("chalk"), 1);
4115
4158
  var import_ora9 = __toESM(require("ora"), 1);
4116
4159
  var import_axios15 = __toESM(require("axios"), 1);
4117
4160
  var import_inquirer2 = __toESM(require("inquirer"), 1);
@@ -4148,7 +4191,7 @@ async function listInteractive() {
4148
4191
  });
4149
4192
  spinner.stop();
4150
4193
  if (actionableTasks.length === 0) {
4151
- console.log(import_chalk19.default.yellow("Roadmap clear. No actionable tasks found."));
4194
+ console.log(import_chalk20.default.yellow("Roadmap clear. No actionable tasks found."));
4152
4195
  return;
4153
4196
  }
4154
4197
  const choices = actionableTasks.map((t) => {
@@ -4157,7 +4200,7 @@ async function listInteractive() {
4157
4200
  if (t.status === "IN_PROGRESS") icon = "\u{1F525}";
4158
4201
  if (t.status === "ACTIVE") icon = "\u25B6\uFE0F";
4159
4202
  return {
4160
- name: `${icon} ${import_chalk19.default.bold(id)}: ${t.title} [${t.status}]`,
4203
+ name: `${icon} ${import_chalk20.default.bold(id)}: ${t.title} [${t.status}]`,
4161
4204
  value: t.id
4162
4205
  };
4163
4206
  });
@@ -4200,25 +4243,25 @@ async function setTaskStatus(taskId, status) {
4200
4243
  { step_id: realId, status, project_id: projectId },
4201
4244
  { headers: { "Authorization": `Bearer ${apiKey}` } }
4202
4245
  );
4203
- spinner.succeed(import_chalk19.default.green(`Task updated to ${status}.`));
4246
+ spinner.succeed(import_chalk20.default.green(`Task updated to ${status}.`));
4204
4247
  if (status === "IN_PROGRESS") {
4205
- console.log(import_chalk19.default.blue(`
4248
+ console.log(import_chalk20.default.blue(`
4206
4249
  \u{1F4A1} Tip: Provide 'Frank' with context by mentioning @.cursorrules in your chat.`));
4207
4250
  }
4208
4251
  } catch (e) {
4209
- spinner.fail(import_chalk19.default.red(`Failed: ${e.message}`));
4252
+ spinner.fail(import_chalk20.default.red(`Failed: ${e.message}`));
4210
4253
  }
4211
4254
  }
4212
4255
  async function finishTask(taskId) {
4213
4256
  console.log("");
4214
- console.log(import_chalk19.default.bold.yellow("\u{1F6E1}\uFE0F FRANK'S QUALITY GATE"));
4215
- console.log(import_chalk19.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"));
4257
+ console.log(import_chalk20.default.bold.yellow("\u{1F6E1}\uFE0F FRANK'S QUALITY GATE"));
4258
+ 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
4259
  const auditSpinner = (0, import_ora9.default)(" Analyzing architectural integrity...").start();
4217
4260
  await new Promise((r) => setTimeout(r, 1500));
4218
4261
  auditSpinner.succeed("Architecture: VALIDATED (SEC-ARCH-01 Pass)");
4219
4262
  await setTaskStatus(taskId, "COMPLETED");
4220
4263
  console.log("");
4221
- console.log(import_chalk19.default.bold.green("\u{1F389} TASK COMPLETE! Momentum Preserved."));
4264
+ console.log(import_chalk20.default.bold.green("\u{1F389} TASK COMPLETE! Momentum Preserved."));
4222
4265
  const { projectId, apiKey, apiUrl } = getContext();
4223
4266
  await suggestNextMove(projectId, apiKey, apiUrl);
4224
4267
  }
@@ -4235,7 +4278,7 @@ function getContext() {
4235
4278
  // src/commands/watch.ts
4236
4279
  init_cjs_shims();
4237
4280
  var import_commander13 = require("commander");
4238
- var import_chalk20 = __toESM(require("chalk"), 1);
4281
+ var import_chalk21 = __toESM(require("chalk"), 1);
4239
4282
  var import_ora10 = __toESM(require("ora"), 1);
4240
4283
  var import_chokidar = __toESM(require("chokidar"), 1);
4241
4284
  var import_promises18 = __toESM(require("fs/promises"), 1);
@@ -4246,15 +4289,15 @@ var import_axios16 = __toESM(require("axios"), 1);
4246
4289
  function createWatchCommand() {
4247
4290
  const watch2 = new import_commander13.Command("watch");
4248
4291
  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(import_chalk20.default.bold.blue("\u{1F52D} Rigstate Watch Mode"));
4250
- console.log(import_chalk20.default.dim("Monitoring for task completion..."));
4292
+ console.log(import_chalk21.default.bold.blue("\u{1F52D} Rigstate Watch Mode"));
4293
+ console.log(import_chalk21.default.dim("Monitoring for task completion..."));
4251
4294
  console.log("");
4252
4295
  let apiKey;
4253
4296
  let projectId;
4254
4297
  try {
4255
4298
  apiKey = getApiKey();
4256
4299
  } catch (e) {
4257
- console.log(import_chalk20.default.red('Not authenticated. Run "rigstate login" first.'));
4300
+ console.log(import_chalk21.default.red('Not authenticated. Run "rigstate login" first.'));
4258
4301
  return;
4259
4302
  }
4260
4303
  projectId = getProjectId();
@@ -4268,7 +4311,7 @@ function createWatchCommand() {
4268
4311
  }
4269
4312
  }
4270
4313
  if (!projectId) {
4271
- console.log(import_chalk20.default.red('No project context. Run "rigstate link" or "rigstate sync --project <id>" first.'));
4314
+ console.log(import_chalk21.default.red('No project context. Run "rigstate link" or "rigstate sync --project <id>" first.'));
4272
4315
  return;
4273
4316
  }
4274
4317
  const apiUrl = getApiUrl();
@@ -4278,8 +4321,8 @@ function createWatchCommand() {
4278
4321
  runTests: options.runTests || false,
4279
4322
  testCommand: options.testCommand || "npm test"
4280
4323
  };
4281
- console.log(import_chalk20.default.dim(`Auto-commit: ${config2.autoCommit ? "ON" : "OFF"}`));
4282
- console.log(import_chalk20.default.dim(`Auto-push: ${config2.autoPush ? "ON" : "OFF"}`));
4324
+ console.log(import_chalk21.default.dim(`Auto-commit: ${config2.autoCommit ? "ON" : "OFF"}`));
4325
+ console.log(import_chalk21.default.dim(`Auto-push: ${config2.autoPush ? "ON" : "OFF"}`));
4283
4326
  console.log("");
4284
4327
  const fetchActiveTask = async () => {
4285
4328
  try {
@@ -4346,7 +4389,7 @@ function createWatchCommand() {
4346
4389
  }, {
4347
4390
  headers: { Authorization: `Bearer ${apiKey}` }
4348
4391
  });
4349
- spinner.succeed(import_chalk20.default.green(`\u2705 Task #${task.step_number} completed: ${task.title}`));
4392
+ spinner.succeed(import_chalk21.default.green(`\u2705 Task #${task.step_number} completed: ${task.title}`));
4350
4393
  if (config2.autoCommit) {
4351
4394
  spinner.start("Committing changes...");
4352
4395
  try {
@@ -4368,7 +4411,7 @@ function createWatchCommand() {
4368
4411
  }
4369
4412
  }
4370
4413
  console.log("");
4371
- console.log(import_chalk20.default.blue("Watching for next task..."));
4414
+ console.log(import_chalk21.default.blue("Watching for next task..."));
4372
4415
  } catch (e) {
4373
4416
  spinner.fail(`Failed to complete task: ${e.message}`);
4374
4417
  }
@@ -4381,7 +4424,7 @@ function createWatchCommand() {
4381
4424
  const task = await fetchActiveTask();
4382
4425
  if (!task) {
4383
4426
  if (currentTask) {
4384
- console.log(import_chalk20.default.green("\u{1F389} All tasks completed! Watching for new tasks..."));
4427
+ console.log(import_chalk21.default.green("\u{1F389} All tasks completed! Watching for new tasks..."));
4385
4428
  currentTask = null;
4386
4429
  }
4387
4430
  isProcessing = false;
@@ -4390,10 +4433,10 @@ function createWatchCommand() {
4390
4433
  if (!currentTask || currentTask.id !== task.id) {
4391
4434
  currentTask = task;
4392
4435
  console.log("");
4393
- console.log(import_chalk20.default.bold.yellow(`\u{1F4CC} Active Task #${task.step_number}: ${task.title}`));
4394
- console.log(import_chalk20.default.dim(`Status: ${task.status}`));
4436
+ console.log(import_chalk21.default.bold.yellow(`\u{1F4CC} Active Task #${task.step_number}: ${task.title}`));
4437
+ console.log(import_chalk21.default.dim(`Status: ${task.status}`));
4395
4438
  if (task.verification_criteria) {
4396
- console.log(import_chalk20.default.dim("Verification: Auto-checking criteria..."));
4439
+ console.log(import_chalk21.default.dim("Verification: Auto-checking criteria..."));
4397
4440
  }
4398
4441
  }
4399
4442
  if (task.verification_criteria && Array.isArray(task.verification_criteria)) {
@@ -4406,7 +4449,7 @@ function createWatchCommand() {
4406
4449
  }
4407
4450
  }
4408
4451
  if (allPassed) {
4409
- console.log(import_chalk20.default.green("\u2713 All verification criteria passed!"));
4452
+ console.log(import_chalk21.default.green("\u2713 All verification criteria passed!"));
4410
4453
  await completeTask(task.id, task);
4411
4454
  currentTask = null;
4412
4455
  }
@@ -4431,11 +4474,11 @@ function createWatchCommand() {
4431
4474
  setTimeout(() => processActiveTask(), 500);
4432
4475
  }
4433
4476
  });
4434
- console.log(import_chalk20.default.dim("Watching for file changes... (Ctrl+C to exit)"));
4477
+ console.log(import_chalk21.default.dim("Watching for file changes... (Ctrl+C to exit)"));
4435
4478
  setInterval(() => processActiveTask(), 3e4);
4436
4479
  process.on("SIGINT", () => {
4437
4480
  console.log("");
4438
- console.log(import_chalk20.default.dim("Watch mode stopped."));
4481
+ console.log(import_chalk21.default.dim("Watch mode stopped."));
4439
4482
  watcher.close();
4440
4483
  process.exit(0);
4441
4484
  });
@@ -4446,7 +4489,7 @@ function createWatchCommand() {
4446
4489
  // src/commands/focus.ts
4447
4490
  init_cjs_shims();
4448
4491
  var import_commander14 = require("commander");
4449
- var import_chalk21 = __toESM(require("chalk"), 1);
4492
+ var import_chalk22 = __toESM(require("chalk"), 1);
4450
4493
  var import_ora11 = __toESM(require("ora"), 1);
4451
4494
  init_config();
4452
4495
  var import_axios17 = __toESM(require("axios"), 1);
@@ -4462,7 +4505,7 @@ function createFocusCommand() {
4462
4505
  try {
4463
4506
  apiKey = getApiKey();
4464
4507
  } catch (e) {
4465
- spinner.fail(import_chalk21.default.red('Not authenticated. Run "rigstate login" first.'));
4508
+ spinner.fail(import_chalk22.default.red('Not authenticated. Run "rigstate login" first.'));
4466
4509
  return;
4467
4510
  }
4468
4511
  projectId = getProjectId();
@@ -4476,7 +4519,7 @@ function createFocusCommand() {
4476
4519
  }
4477
4520
  }
4478
4521
  if (!projectId) {
4479
- spinner.fail(import_chalk21.default.red('No project context. Run "rigstate link" first.'));
4522
+ spinner.fail(import_chalk22.default.red('No project context. Run "rigstate link" first.'));
4480
4523
  return;
4481
4524
  }
4482
4525
  const apiUrl = getApiUrl();
@@ -4507,41 +4550,41 @@ function createFocusCommand() {
4507
4550
  const nextTask = activeTasks[0];
4508
4551
  spinner.stop();
4509
4552
  console.log("");
4510
- console.log(import_chalk21.default.bold.blue(`\u{1F4CC} Task #${nextTask.step_number || "?"}: ${nextTask.title}`));
4511
- const statusColor = nextTask.status === "IN_PROGRESS" ? import_chalk21.default.yellow : nextTask.status === "ACTIVE" ? import_chalk21.default.green : import_chalk21.default.dim;
4512
- console.log(import_chalk21.default.dim("Status: ") + statusColor(nextTask.status));
4513
- console.log(import_chalk21.default.dim("\u2500".repeat(60)));
4553
+ console.log(import_chalk22.default.bold.blue(`\u{1F4CC} Task #${nextTask.step_number || "?"}: ${nextTask.title}`));
4554
+ const statusColor = nextTask.status === "IN_PROGRESS" ? import_chalk22.default.yellow : nextTask.status === "ACTIVE" ? import_chalk22.default.green : import_chalk22.default.dim;
4555
+ console.log(import_chalk22.default.dim("Status: ") + statusColor(nextTask.status));
4556
+ console.log(import_chalk22.default.dim("\u2500".repeat(60)));
4514
4557
  if (nextTask.prompt_content) {
4515
- console.log(import_chalk21.default.white(nextTask.prompt_content));
4516
- console.log(import_chalk21.default.dim("\u2500".repeat(60)));
4558
+ console.log(import_chalk22.default.white(nextTask.prompt_content));
4559
+ console.log(import_chalk22.default.dim("\u2500".repeat(60)));
4517
4560
  if (options.copy !== false) {
4518
4561
  try {
4519
4562
  if (process.platform === "darwin") {
4520
4563
  (0, import_child_process5.execSync)("pbcopy", { input: nextTask.prompt_content });
4521
- console.log(import_chalk21.default.green("\u2705 Prompt copied to clipboard! Ready to paste (Cmd+V)."));
4564
+ console.log(import_chalk22.default.green("\u2705 Prompt copied to clipboard! Ready to paste (Cmd+V)."));
4522
4565
  } else if (process.platform === "linux") {
4523
4566
  try {
4524
4567
  (0, import_child_process5.execSync)("xclip -selection clipboard", { input: nextTask.prompt_content });
4525
- console.log(import_chalk21.default.green("\u2705 Prompt copied to clipboard!"));
4568
+ console.log(import_chalk22.default.green("\u2705 Prompt copied to clipboard!"));
4526
4569
  } catch (e) {
4527
- console.log(import_chalk21.default.yellow("\u2139\uFE0F Copy prompt manually (xclip not available)"));
4570
+ console.log(import_chalk22.default.yellow("\u2139\uFE0F Copy prompt manually (xclip not available)"));
4528
4571
  }
4529
4572
  } else {
4530
- console.log(import_chalk21.default.yellow("\u2139\uFE0F Copy prompt manually (Auto-copy not supported on this OS)"));
4573
+ console.log(import_chalk22.default.yellow("\u2139\uFE0F Copy prompt manually (Auto-copy not supported on this OS)"));
4531
4574
  }
4532
4575
  } catch (e) {
4533
4576
  }
4534
4577
  }
4535
4578
  } else {
4536
- console.log(import_chalk21.default.yellow("No prompt instructions available."));
4579
+ console.log(import_chalk22.default.yellow("No prompt instructions available."));
4537
4580
  if (nextTask.architectural_brief) {
4538
- console.log(import_chalk21.default.bold("Brief:"));
4581
+ console.log(import_chalk22.default.bold("Brief:"));
4539
4582
  console.log(nextTask.architectural_brief);
4540
4583
  }
4541
4584
  }
4542
4585
  console.log("");
4543
4586
  } catch (e) {
4544
- spinner.fail(import_chalk21.default.red(`Failed to fetch task: ${e.message}`));
4587
+ spinner.fail(import_chalk22.default.red(`Failed to fetch task: ${e.message}`));
4545
4588
  }
4546
4589
  });
4547
4590
  return focus;
@@ -4553,26 +4596,26 @@ init_env();
4553
4596
  // src/commands/config.ts
4554
4597
  init_cjs_shims();
4555
4598
  var import_commander15 = require("commander");
4556
- var import_chalk22 = __toESM(require("chalk"), 1);
4599
+ var import_chalk23 = __toESM(require("chalk"), 1);
4557
4600
  init_config();
4558
4601
  function createConfigCommand() {
4559
4602
  const config2 = new import_commander15.Command("config");
4560
4603
  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
4604
  if (!key) {
4562
- console.log(import_chalk22.default.bold("Rigstate Configuration"));
4563
- console.log(import_chalk22.default.dim("\u2500".repeat(40)));
4605
+ console.log(import_chalk23.default.bold("Rigstate Configuration"));
4606
+ console.log(import_chalk23.default.dim("\u2500".repeat(40)));
4564
4607
  try {
4565
4608
  const apiKey = getApiKey();
4566
- console.log(`${import_chalk22.default.cyan("api_key")}: ${apiKey.substring(0, 20)}...`);
4609
+ console.log(`${import_chalk23.default.cyan("api_key")}: ${apiKey.substring(0, 20)}...`);
4567
4610
  } catch (e) {
4568
- console.log(`${import_chalk22.default.cyan("api_key")}: ${import_chalk22.default.dim("(not set)")}`);
4611
+ console.log(`${import_chalk23.default.cyan("api_key")}: ${import_chalk23.default.dim("(not set)")}`);
4569
4612
  }
4570
4613
  const projectId = getProjectId();
4571
- console.log(`${import_chalk22.default.cyan("project_id")}: ${projectId || import_chalk22.default.dim("(not set)")}`);
4614
+ console.log(`${import_chalk23.default.cyan("project_id")}: ${projectId || import_chalk23.default.dim("(not set)")}`);
4572
4615
  const apiUrl = getApiUrl();
4573
- console.log(`${import_chalk22.default.cyan("api_url")}: ${apiUrl}`);
4616
+ console.log(`${import_chalk23.default.cyan("api_url")}: ${apiUrl}`);
4574
4617
  console.log("");
4575
- console.log(import_chalk22.default.dim('Use "rigstate config <key> <value>" to set a value.'));
4618
+ console.log(import_chalk23.default.dim('Use "rigstate config <key> <value>" to set a value.'));
4576
4619
  return;
4577
4620
  }
4578
4621
  if (!value) {
@@ -4582,36 +4625,36 @@ function createConfigCommand() {
4582
4625
  const apiKey = getApiKey();
4583
4626
  console.log(apiKey);
4584
4627
  } catch (e) {
4585
- console.log(import_chalk22.default.dim("(not set)"));
4628
+ console.log(import_chalk23.default.dim("(not set)"));
4586
4629
  }
4587
4630
  break;
4588
4631
  case "project_id":
4589
- console.log(getProjectId() || import_chalk22.default.dim("(not set)"));
4632
+ console.log(getProjectId() || import_chalk23.default.dim("(not set)"));
4590
4633
  break;
4591
4634
  case "api_url":
4592
4635
  console.log(getApiUrl());
4593
4636
  break;
4594
4637
  default:
4595
- console.log(import_chalk22.default.red(`Unknown config key: ${key}`));
4596
- console.log(import_chalk22.default.dim("Valid keys: api_key, project_id, api_url"));
4638
+ console.log(import_chalk23.default.red(`Unknown config key: ${key}`));
4639
+ console.log(import_chalk23.default.dim("Valid keys: api_key, project_id, api_url"));
4597
4640
  }
4598
4641
  return;
4599
4642
  }
4600
4643
  switch (key) {
4601
4644
  case "api_key":
4602
4645
  setApiKey(value);
4603
- console.log(import_chalk22.default.green(`\u2705 api_key updated`));
4646
+ console.log(import_chalk23.default.green(`\u2705 api_key updated`));
4604
4647
  break;
4605
4648
  case "project_id":
4606
4649
  setProjectId(value);
4607
- console.log(import_chalk22.default.green(`\u2705 project_id updated`));
4650
+ console.log(import_chalk23.default.green(`\u2705 project_id updated`));
4608
4651
  break;
4609
4652
  case "api_url":
4610
- console.log(import_chalk22.default.yellow("api_url is set via RIGSTATE_API_URL environment variable"));
4653
+ console.log(import_chalk23.default.yellow("api_url is set via RIGSTATE_API_URL environment variable"));
4611
4654
  break;
4612
4655
  default:
4613
- console.log(import_chalk22.default.red(`Unknown config key: ${key}`));
4614
- console.log(import_chalk22.default.dim("Valid keys: api_key, project_id"));
4656
+ console.log(import_chalk23.default.red(`Unknown config key: ${key}`));
4657
+ console.log(import_chalk23.default.dim("Valid keys: api_key, project_id"));
4615
4658
  }
4616
4659
  });
4617
4660
  return config2;
@@ -4620,7 +4663,7 @@ function createConfigCommand() {
4620
4663
  // src/commands/mcp.ts
4621
4664
  init_cjs_shims();
4622
4665
  var import_commander16 = require("commander");
4623
- var import_chalk23 = __toESM(require("chalk"), 1);
4666
+ var import_chalk24 = __toESM(require("chalk"), 1);
4624
4667
  var import_child_process6 = require("child_process");
4625
4668
  var import_path22 = __toESM(require("path"), 1);
4626
4669
  var import_fs = __toESM(require("fs"), 1);
@@ -4646,15 +4689,15 @@ function createMcpCommand() {
4646
4689
  }
4647
4690
  }
4648
4691
  if (!serverPath) {
4649
- console.error(import_chalk23.default.red("\u274C Error: Rigstate MCP Server binary not found."));
4650
- console.error(import_chalk23.default.yellow("Please ensure that the mcp package is built:"));
4651
- console.error(import_chalk23.default.white(" cd packages/mcp && npm run build"));
4692
+ console.error(import_chalk24.default.red("\u274C Error: Rigstate MCP Server binary not found."));
4693
+ console.error(import_chalk24.default.yellow("Please ensure that the mcp package is built:"));
4694
+ console.error(import_chalk24.default.white(" cd packages/mcp && npm run build"));
4652
4695
  console.error("");
4653
- console.error(import_chalk23.default.dim("Or run directly with:"));
4654
- console.error(import_chalk23.default.white(" npx @rigstate/mcp"));
4696
+ console.error(import_chalk24.default.dim("Or run directly with:"));
4697
+ console.error(import_chalk24.default.white(" npx @rigstate/mcp"));
4655
4698
  process.exit(1);
4656
4699
  }
4657
- console.log(import_chalk23.default.dim(`Starting MCP server from: ${serverPath}`));
4700
+ console.log(import_chalk24.default.dim(`Starting MCP server from: ${serverPath}`));
4658
4701
  if (process.env.VIBE_API_KEY && !process.env.RIGSTATE_API_KEY) {
4659
4702
  process.env.RIGSTATE_API_KEY = process.env.VIBE_API_KEY;
4660
4703
  }
@@ -4663,7 +4706,7 @@ function createMcpCommand() {
4663
4706
  stdio: ["inherit", "inherit", "inherit"]
4664
4707
  });
4665
4708
  worker.on("error", (err) => {
4666
- console.error(import_chalk23.default.red(`\u274C Failed to start MCP server: ${err.message}`));
4709
+ console.error(import_chalk24.default.red(`\u274C Failed to start MCP server: ${err.message}`));
4667
4710
  process.exit(1);
4668
4711
  });
4669
4712
  worker.on("exit", (code) => {
@@ -4678,7 +4721,7 @@ function createMcpCommand() {
4678
4721
  // src/commands/nexus.ts
4679
4722
  init_cjs_shims();
4680
4723
  var import_commander17 = require("commander");
4681
- var import_chalk26 = __toESM(require("chalk"), 1);
4724
+ var import_chalk27 = __toESM(require("chalk"), 1);
4682
4725
 
4683
4726
  // src/nexus/dispatcher.ts
4684
4727
  init_cjs_shims();
@@ -4746,7 +4789,7 @@ var HiveScrubber = class {
4746
4789
  };
4747
4790
 
4748
4791
  // src/hive/gateway.ts
4749
- var import_chalk24 = __toESM(require("chalk"), 1);
4792
+ var import_chalk25 = __toESM(require("chalk"), 1);
4750
4793
  var HiveGateway = class {
4751
4794
  client;
4752
4795
  enabled;
@@ -4756,7 +4799,7 @@ var HiveGateway = class {
4756
4799
  constructor(baseUrl, token) {
4757
4800
  this.enabled = !!token;
4758
4801
  if (!this.enabled) {
4759
- console.log(import_chalk24.default.dim("\u26A0\uFE0F Hive Gateway disabled (No Token provided). Running in localized mode."));
4802
+ console.log(import_chalk25.default.dim("\u26A0\uFE0F Hive Gateway disabled (No Token provided). Running in localized mode."));
4760
4803
  }
4761
4804
  this.client = import_axios18.default.create({
4762
4805
  baseURL: baseUrl,
@@ -4776,23 +4819,23 @@ var HiveGateway = class {
4776
4819
  if (!this.enabled) return false;
4777
4820
  const now = Date.now();
4778
4821
  if (now - this.lastSignalTime < this.MIN_INTERVAL_MS) {
4779
- console.warn(import_chalk24.default.yellow("\u23F3 Hive Gateway Throttled. Signal dropped to preventing spam."));
4822
+ console.warn(import_chalk25.default.yellow("\u23F3 Hive Gateway Throttled. Signal dropped to preventing spam."));
4780
4823
  return false;
4781
4824
  }
4782
4825
  const scrubResult = HiveScrubber.scrub(signal.ruleContent);
4783
4826
  if (scrubResult.riskScore > 20) {
4784
- console.error(import_chalk24.default.red(`\u{1F6D1} HIVE BLOCKED: Signal contains sensitive data (Risk: ${scrubResult.riskScore})`));
4827
+ console.error(import_chalk25.default.red(`\u{1F6D1} HIVE BLOCKED: Signal contains sensitive data (Risk: ${scrubResult.riskScore})`));
4785
4828
  return false;
4786
4829
  }
4787
4830
  try {
4788
- console.log(import_chalk24.default.blue(`\u{1F4E1} Uplinking to Hive... [${signal.vector}]`));
4831
+ console.log(import_chalk25.default.blue(`\u{1F4E1} Uplinking to Hive... [${signal.vector}]`));
4789
4832
  const payload = { ...signal, ruleContent: scrubResult.sanitizedContent };
4790
4833
  await this.client.post("/signal", payload);
4791
4834
  this.lastSignalTime = now;
4792
- console.log(import_chalk24.default.green("\u2705 Signal Received by Hive Core. Knowledge Shared."));
4835
+ console.log(import_chalk25.default.green("\u2705 Signal Received by Hive Core. Knowledge Shared."));
4793
4836
  return true;
4794
4837
  } catch (error) {
4795
- console.error(import_chalk24.default.red(`\u274C Hive Transmission Failed: ${error.message}`));
4838
+ console.error(import_chalk25.default.red(`\u274C Hive Transmission Failed: ${error.message}`));
4796
4839
  return false;
4797
4840
  }
4798
4841
  }
@@ -4800,37 +4843,37 @@ var HiveGateway = class {
4800
4843
 
4801
4844
  // src/utils/logger.ts
4802
4845
  init_cjs_shims();
4803
- var import_chalk25 = __toESM(require("chalk"), 1);
4846
+ var import_chalk26 = __toESM(require("chalk"), 1);
4804
4847
  var Logger = class {
4805
4848
  static formatMessage(level, message, context) {
4806
4849
  const timestamp = (/* @__PURE__ */ new Date()).toISOString();
4807
4850
  let prefix = "";
4808
4851
  switch (level) {
4809
4852
  case "INFO" /* INFO */:
4810
- prefix = import_chalk25.default.blue(`[${"INFO" /* INFO */}]`);
4853
+ prefix = import_chalk26.default.blue(`[${"INFO" /* INFO */}]`);
4811
4854
  break;
4812
4855
  case "WARN" /* WARN */:
4813
- prefix = import_chalk25.default.yellow(`[${"WARN" /* WARN */}]`);
4856
+ prefix = import_chalk26.default.yellow(`[${"WARN" /* WARN */}]`);
4814
4857
  break;
4815
4858
  case "ERROR" /* ERROR */:
4816
- prefix = import_chalk25.default.red(`[${"ERROR" /* ERROR */}]`);
4859
+ prefix = import_chalk26.default.red(`[${"ERROR" /* ERROR */}]`);
4817
4860
  break;
4818
4861
  case "DEBUG" /* DEBUG */:
4819
- prefix = import_chalk25.default.gray(`[${"DEBUG" /* DEBUG */}]`);
4862
+ prefix = import_chalk26.default.gray(`[${"DEBUG" /* DEBUG */}]`);
4820
4863
  break;
4821
4864
  }
4822
- let output = `${import_chalk25.default.gray(timestamp)} ${prefix} ${message}`;
4865
+ let output = `${import_chalk26.default.gray(timestamp)} ${prefix} ${message}`;
4823
4866
  if (context) {
4824
4867
  if (context instanceof Error) {
4825
4868
  output += `
4826
- ${import_chalk25.default.red(context.stack || context.message)}`;
4869
+ ${import_chalk26.default.red(context.stack || context.message)}`;
4827
4870
  } else if (typeof context === "object") {
4828
4871
  try {
4829
4872
  output += `
4830
- ${import_chalk25.default.gray(JSON.stringify(context, null, 2))}`;
4873
+ ${import_chalk26.default.gray(JSON.stringify(context, null, 2))}`;
4831
4874
  } catch (e) {
4832
4875
  output += `
4833
- ${import_chalk25.default.gray("[Circular or invalid object]")}`;
4876
+ ${import_chalk26.default.gray("[Circular or invalid object]")}`;
4834
4877
  }
4835
4878
  } else {
4836
4879
  output += ` ${String(context)}`;
@@ -4950,10 +4993,10 @@ var import_inquirer3 = __toESM(require("inquirer"), 1);
4950
4993
  function createNexusCommand() {
4951
4994
  const command = new import_commander17.Command("nexus");
4952
4995
  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(import_chalk26.default.bold.magenta("\n\u{1F981} Welcome to The Nexus (Phase 8)\n"));
4996
+ console.log(import_chalk27.default.bold.magenta("\n\u{1F981} Welcome to The Nexus (Phase 8)\n"));
4954
4997
  const dryRun = !options.force;
4955
4998
  if (!dryRun) {
4956
- console.log(import_chalk26.default.black.bgYellow(" WARNING ") + import_chalk26.default.yellow(" Dry-Run disabled! Eitri is authorized to write code."));
4999
+ console.log(import_chalk27.default.black.bgYellow(" WARNING ") + import_chalk27.default.yellow(" Dry-Run disabled! Eitri is authorized to write code."));
4957
5000
  const { confirm } = await import_inquirer3.default.prompt([{
4958
5001
  type: "confirm",
4959
5002
  name: "confirm",
@@ -4974,26 +5017,26 @@ function createNexusCommand() {
4974
5017
  };
4975
5018
  const dispatcher = new NexusDispatcher(context);
4976
5019
  dispatcher.on("order:created", (o) => {
4977
- console.log(import_chalk26.default.blue(`\u{1F195} [${o.id.slice(0, 6)}] Order Created: `) + o.intent);
5020
+ console.log(import_chalk27.default.blue(`\u{1F195} [${o.id.slice(0, 6)}] Order Created: `) + o.intent);
4978
5021
  });
4979
5022
  dispatcher.on("order:started", (o) => {
4980
- console.log(import_chalk26.default.yellow(`\u23F3 [${o.id.slice(0, 6)}] Processing...`));
5023
+ console.log(import_chalk27.default.yellow(`\u23F3 [${o.id.slice(0, 6)}] Processing...`));
4981
5024
  });
4982
5025
  dispatcher.on("order:blocked", (o) => {
4983
- console.log(import_chalk26.default.red(`\u{1F6D1} [${o.id.slice(0, 6)}] BLOCKED by Kill-Switch`));
4984
- console.log(import_chalk26.default.dim(` Target: ${o.targetAgent} | Action: ${o.action}`));
4985
- console.log(import_chalk26.default.dim(" Run with --force to execute automatically (NOT RECOMMENDED)."));
5026
+ console.log(import_chalk27.default.red(`\u{1F6D1} [${o.id.slice(0, 6)}] BLOCKED by Kill-Switch`));
5027
+ console.log(import_chalk27.default.dim(` Target: ${o.targetAgent} | Action: ${o.action}`));
5028
+ console.log(import_chalk27.default.dim(" Run with --force to execute automatically (NOT RECOMMENDED)."));
4986
5029
  });
4987
- dispatcher.on("agent:SINDRE", (o) => console.log(import_chalk26.default.cyan(`\u{1F916} Sindre (Vault): I'm on it! (${o.action})`)));
4988
- dispatcher.on("agent:EITRI", (o) => console.log(import_chalk26.default.green(`\u{1F477} Eitri (Smith): Ready to build! (${o.action})`)));
4989
- console.log(import_chalk26.default.dim("\u{1F9E0} Frank is analyzing your intent..."));
5030
+ dispatcher.on("agent:SINDRE", (o) => console.log(import_chalk27.default.cyan(`\u{1F916} Sindre (Vault): I'm on it! (${o.action})`)));
5031
+ dispatcher.on("agent:EITRI", (o) => console.log(import_chalk27.default.green(`\u{1F477} Eitri (Smith): Ready to build! (${o.action})`)));
5032
+ console.log(import_chalk27.default.dim("\u{1F9E0} Frank is analyzing your intent..."));
4990
5033
  await new Promise((r) => setTimeout(r, 800));
4991
5034
  if (intent.toLowerCase().includes("db") || intent.toLowerCase().includes("database")) {
4992
5035
  await dispatcher.dispatch("FRANK", "SINDRE", intent, "db.analyze", { raw: intent });
4993
5036
  } else if (intent.toLowerCase().includes("create") || intent.toLowerCase().includes("code")) {
4994
5037
  await dispatcher.dispatch("FRANK", "EITRI", intent, "fs.write", { path: "src/demo.ts", content: "// demo" });
4995
5038
  } else {
4996
- console.log(import_chalk26.default.gray("Frank didn't understand. Try 'create file' or 'check database'."));
5039
+ console.log(import_chalk27.default.gray("Frank didn't understand. Try 'create file' or 'check database'."));
4997
5040
  }
4998
5041
  });
4999
5042
  return command;
@@ -5005,7 +5048,7 @@ init_sync_rules();
5005
5048
  // src/commands/override.ts
5006
5049
  init_cjs_shims();
5007
5050
  var import_commander18 = require("commander");
5008
- var import_chalk27 = __toESM(require("chalk"), 1);
5051
+ var import_chalk28 = __toESM(require("chalk"), 1);
5009
5052
  init_governance();
5010
5053
  init_config();
5011
5054
  var import_axios19 = __toESM(require("axios"), 1);
@@ -5013,19 +5056,19 @@ function createOverrideCommand() {
5013
5056
  const override = new import_commander18.Command("override");
5014
5057
  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
5058
  const { reason } = options;
5016
- console.log(import_chalk27.default.bold(`
5059
+ console.log(import_chalk28.default.bold(`
5017
5060
  \u{1F513} Initiating Governance Override Protocol...`));
5018
5061
  const session = await getSessionState(process.cwd());
5019
5062
  if (session.status !== "SOFT_LOCK") {
5020
- console.log(import_chalk27.default.yellow(" Info: Session is not currently locked."));
5063
+ console.log(import_chalk28.default.yellow(" Info: Session is not currently locked."));
5021
5064
  return;
5022
5065
  }
5023
- console.log(import_chalk27.default.dim(` Active Violation: ${session.active_violation}`));
5024
- console.log(import_chalk27.default.dim(` Reason Provided: "${reason}"`));
5066
+ console.log(import_chalk28.default.dim(` Active Violation: ${session.active_violation}`));
5067
+ console.log(import_chalk28.default.dim(` Reason Provided: "${reason}"`));
5025
5068
  const success = await performOverride(violationId, reason, process.cwd());
5026
5069
  if (success) {
5027
- console.log(import_chalk27.default.green(` \u2705 Session UNLOCKED.`));
5028
- console.log(import_chalk27.default.dim(` This event has been logged to the Mission Report.`));
5070
+ console.log(import_chalk28.default.green(` \u2705 Session UNLOCKED.`));
5071
+ console.log(import_chalk28.default.dim(` This event has been logged to the Mission Report.`));
5029
5072
  try {
5030
5073
  const projectId = getProjectId();
5031
5074
  if (projectId) {
@@ -5042,13 +5085,13 @@ function createOverrideCommand() {
5042
5085
  }, {
5043
5086
  headers: { Authorization: `Bearer ${apiKey}` }
5044
5087
  });
5045
- console.log(import_chalk27.default.dim(` \u2601 Audit log synced to Cloud.`));
5088
+ console.log(import_chalk28.default.dim(` \u2601 Audit log synced to Cloud.`));
5046
5089
  }
5047
5090
  } catch (e) {
5048
- console.log(import_chalk27.default.dim(` (Cloud audit sync failed: ${e.message})`));
5091
+ console.log(import_chalk28.default.dim(` (Cloud audit sync failed: ${e.message})`));
5049
5092
  }
5050
5093
  } else {
5051
- console.log(import_chalk27.default.red(` \u{1F6D1} Override Failed. Check project configuration.`));
5094
+ console.log(import_chalk28.default.red(` \u{1F6D1} Override Failed. Check project configuration.`));
5052
5095
  }
5053
5096
  });
5054
5097
  return override;
@@ -5057,7 +5100,7 @@ function createOverrideCommand() {
5057
5100
  // src/commands/idea.ts
5058
5101
  init_cjs_shims();
5059
5102
  var import_commander19 = require("commander");
5060
- var import_chalk28 = __toESM(require("chalk"), 1);
5103
+ var import_chalk29 = __toESM(require("chalk"), 1);
5061
5104
  var import_ora12 = __toESM(require("ora"), 1);
5062
5105
  var import_axios20 = __toESM(require("axios"), 1);
5063
5106
  var import_inquirer4 = __toESM(require("inquirer"), 1);
@@ -5069,7 +5112,7 @@ function createIdeaCommand() {
5069
5112
  const apiUrl = getApiUrl();
5070
5113
  const projectId = getProjectId();
5071
5114
  if (!projectId) {
5072
- console.error(import_chalk28.default.red("Project context missing. Run rigstate link."));
5115
+ console.error(import_chalk29.default.red("Project context missing. Run rigstate link."));
5073
5116
  process.exit(1);
5074
5117
  }
5075
5118
  let ideaTitle = title;
@@ -5105,14 +5148,14 @@ function createIdeaCommand() {
5105
5148
  { headers: { Authorization: `Bearer ${apiKey}` } }
5106
5149
  );
5107
5150
  if (response.data.success) {
5108
- spinner.succeed(import_chalk28.default.green("Idea Captured! \u{1F4A1}"));
5109
- console.log(import_chalk28.default.dim(`ID: ${response.data.data?.id || "Saved"}`));
5151
+ spinner.succeed(import_chalk29.default.green("Idea Captured! \u{1F4A1}"));
5152
+ console.log(import_chalk29.default.dim(`ID: ${response.data.data?.id || "Saved"}`));
5110
5153
  } else {
5111
5154
  throw new Error(response.data.error);
5112
5155
  }
5113
5156
  } catch (e) {
5114
5157
  const errorDetail = e.response?.data?.error || e.message;
5115
- console.error(import_chalk28.default.red(`
5158
+ console.error(import_chalk29.default.red(`
5116
5159
  Failed to capture idea: ${errorDetail}`));
5117
5160
  }
5118
5161
  });
@@ -5121,7 +5164,7 @@ Failed to capture idea: ${errorDetail}`));
5121
5164
  // src/commands/release.ts
5122
5165
  init_cjs_shims();
5123
5166
  var import_commander20 = require("commander");
5124
- var import_chalk29 = __toESM(require("chalk"), 1);
5167
+ var import_chalk30 = __toESM(require("chalk"), 1);
5125
5168
  var import_ora13 = __toESM(require("ora"), 1);
5126
5169
  var import_inquirer5 = __toESM(require("inquirer"), 1);
5127
5170
  var import_promises20 = __toESM(require("fs/promises"), 1);
@@ -9698,7 +9741,7 @@ function createReleaseCommand() {
9698
9741
  if (type === "major") newVersion = `${major + 1}.0.0`;
9699
9742
  if (type === "minor") newVersion = `${major}.${minor + 1}.0`;
9700
9743
  if (type === "patch") newVersion = `${major}.${minor}.${patch + 1}`;
9701
- spinner.succeed(`Bumping ${pkg.name} from ${import_chalk29.default.dim(currentVersion)} to ${import_chalk29.default.green(newVersion)}`);
9744
+ spinner.succeed(`Bumping ${pkg.name} from ${import_chalk30.default.dim(currentVersion)} to ${import_chalk30.default.green(newVersion)}`);
9702
9745
  const { confirm } = await import_inquirer5.default.prompt([{
9703
9746
  type: "confirm",
9704
9747
  name: "confirm",
@@ -9728,7 +9771,7 @@ function createReleaseCommand() {
9728
9771
  await git.addTag(`v${newVersion}`);
9729
9772
  await git.push();
9730
9773
  await git.pushTags();
9731
- spinner.succeed(import_chalk29.default.bold.green(`\u{1F680} Release v${newVersion} shipped!`));
9774
+ spinner.succeed(import_chalk30.default.bold.green(`\u{1F680} Release v${newVersion} shipped!`));
9732
9775
  } catch (e) {
9733
9776
  spinner.fail(e.message);
9734
9777
  }
@@ -9745,7 +9788,7 @@ function getContext2() {
9745
9788
  // src/commands/roadmap.ts
9746
9789
  init_cjs_shims();
9747
9790
  var import_commander21 = require("commander");
9748
- var import_chalk30 = __toESM(require("chalk"), 1);
9791
+ var import_chalk31 = __toESM(require("chalk"), 1);
9749
9792
  var import_ora14 = __toESM(require("ora"), 1);
9750
9793
  var import_axios21 = __toESM(require("axios"), 1);
9751
9794
  init_config();
@@ -9757,7 +9800,7 @@ function createRoadmapCommand() {
9757
9800
  const apiUrl = getApiUrl();
9758
9801
  const projectId = getProjectId();
9759
9802
  if (!projectId) {
9760
- spinner.fail(import_chalk30.default.red('Project context missing. Run "rigstate link".'));
9803
+ spinner.fail(import_chalk31.default.red('Project context missing. Run "rigstate link".'));
9761
9804
  return;
9762
9805
  }
9763
9806
  const response = await import_axios21.default.get(
@@ -9770,11 +9813,11 @@ function createRoadmapCommand() {
9770
9813
  const tasks = response.data.data.roadmap || [];
9771
9814
  spinner.stop();
9772
9815
  if (tasks.length === 0) {
9773
- console.log(import_chalk30.default.yellow("\nRoadmap is empty. Use the web UI to define your journey."));
9816
+ console.log(import_chalk31.default.yellow("\nRoadmap is empty. Use the web UI to define your journey."));
9774
9817
  return;
9775
9818
  }
9776
- console.log("\n" + import_chalk30.default.bold.underline("\u{1F6F0}\uFE0F TACTICAL OVERVIEW: PROJECT ROADMAP"));
9777
- console.log(import_chalk30.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"));
9819
+ console.log("\n" + import_chalk31.default.bold.underline("\u{1F6F0}\uFE0F TACTICAL OVERVIEW: PROJECT ROADMAP"));
9820
+ 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
9821
  const columns = {
9779
9822
  "IN_PROGRESS": [],
9780
9823
  "ACTIVE": [],
@@ -9786,14 +9829,14 @@ function createRoadmapCommand() {
9786
9829
  columns[t.status].push(t);
9787
9830
  }
9788
9831
  });
9789
- displayColumn("\u{1F525} IN PROGRESS", columns.IN_PROGRESS, import_chalk30.default.yellow);
9790
- displayColumn("\u25B6\uFE0F ACTIVE / NEXT", columns.ACTIVE, import_chalk30.default.green);
9791
- displayColumn("\u{1F512} LOCKED", columns.LOCKED, import_chalk30.default.blue);
9792
- displayColumn("\u23F3 PENDING", columns.PENDING, import_chalk30.default.gray);
9793
- console.log(import_chalk30.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"));
9794
- console.log(import_chalk30.default.dim(`Total: ${tasks.length} tasks | Run "rigstate work" to start coding.`));
9832
+ displayColumn("\u{1F525} IN PROGRESS", columns.IN_PROGRESS, import_chalk31.default.yellow);
9833
+ displayColumn("\u25B6\uFE0F ACTIVE / NEXT", columns.ACTIVE, import_chalk31.default.green);
9834
+ displayColumn("\u{1F512} LOCKED", columns.LOCKED, import_chalk31.default.blue);
9835
+ displayColumn("\u23F3 PENDING", columns.PENDING, import_chalk31.default.gray);
9836
+ 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"));
9837
+ console.log(import_chalk31.default.dim(`Total: ${tasks.length} tasks | Run "rigstate work" to start coding.`));
9795
9838
  } catch (e) {
9796
- spinner.fail(import_chalk30.default.red(`
9839
+ spinner.fail(import_chalk31.default.red(`
9797
9840
  Failed to fetch roadmap: ${e.message}`));
9798
9841
  }
9799
9842
  });
@@ -9804,15 +9847,15 @@ function displayColumn(title, items, color) {
9804
9847
  ${color.bold(title)}`);
9805
9848
  items.sort((a, b) => a.step_number - b.step_number).forEach((item) => {
9806
9849
  const id = `T-${item.step_number}`.padEnd(8);
9807
- const priority = item.priority === "MVP" ? import_chalk30.default.magenta(" [MVP]") : "";
9808
- console.log(` ${color("\u2022")} ${import_chalk30.default.bold(id)} ${item.title}${priority}`);
9850
+ const priority = item.priority === "MVP" ? import_chalk31.default.magenta(" [MVP]") : "";
9851
+ console.log(` ${color("\u2022")} ${import_chalk31.default.bold(id)} ${item.title}${priority}`);
9809
9852
  });
9810
9853
  }
9811
9854
 
9812
9855
  // src/commands/council.ts
9813
9856
  init_cjs_shims();
9814
9857
  var import_commander22 = require("commander");
9815
- var import_chalk31 = __toESM(require("chalk"), 1);
9858
+ var import_chalk32 = __toESM(require("chalk"), 1);
9816
9859
  var import_ora15 = __toESM(require("ora"), 1);
9817
9860
  var import_inquirer6 = __toESM(require("inquirer"), 1);
9818
9861
  init_config();
@@ -9824,7 +9867,7 @@ function createCouncilCommand() {
9824
9867
  const apiUrl = getApiUrl();
9825
9868
  const projectId = getProjectId();
9826
9869
  if (!projectId) {
9827
- console.error(import_chalk31.default.red('Project context missing. Run "rigstate link".'));
9870
+ console.error(import_chalk32.default.red('Project context missing. Run "rigstate link".'));
9828
9871
  return;
9829
9872
  }
9830
9873
  let sessionTopic = topic;
@@ -9836,25 +9879,25 @@ function createCouncilCommand() {
9836
9879
  }]);
9837
9880
  sessionTopic = ans.topic;
9838
9881
  }
9839
- console.log(import_chalk31.default.bold.magenta("\n\u2696\uFE0F CONVENING THE COUNCIL OF SOVEREIGNTY\n"));
9840
- console.log(import_chalk31.default.dim(`Topic: ${sessionTopic}`));
9841
- 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"));
9842
- console.log(import_chalk31.default.yellow("\n\u{1F9E0} Frank (Architect): Analyzing alignment with Project DNA..."));
9882
+ console.log(import_chalk32.default.bold.magenta("\n\u2696\uFE0F CONVENING THE COUNCIL OF SOVEREIGNTY\n"));
9883
+ console.log(import_chalk32.default.dim(`Topic: ${sessionTopic}`));
9884
+ 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"));
9885
+ console.log(import_chalk32.default.yellow("\n\u{1F9E0} Frank (Architect): Analyzing alignment with Project DNA..."));
9843
9886
  await sleep(1500);
9844
- console.log(import_chalk31.default.gray(' "This decision affects our backend scalability. I recommend caution."'));
9845
- console.log(import_chalk31.default.blue("\n\u{1F6E1}\uFE0F Sigrid (Curator): Checking historical precedents..."));
9887
+ console.log(import_chalk32.default.gray(' "This decision affects our backend scalability. I recommend caution."'));
9888
+ console.log(import_chalk32.default.blue("\n\u{1F6E1}\uFE0F Sigrid (Curator): Checking historical precedents..."));
9846
9889
  await sleep(1500);
9847
- console.log(import_chalk31.default.gray(` "Similar patterns in other projects led to technical debt. Let's review RLS."`));
9848
- console.log(import_chalk31.default.green("\n\u{1F4D0} Einar (Analyst): Scanning dependency impact..."));
9890
+ console.log(import_chalk32.default.gray(` "Similar patterns in other projects led to technical debt. Let's review RLS."`));
9891
+ console.log(import_chalk32.default.green("\n\u{1F4D0} Einar (Analyst): Scanning dependency impact..."));
9849
9892
  await sleep(1500);
9850
- console.log(import_chalk31.default.gray(' "Implementation will require updating 3 core services."'));
9851
- console.log(import_chalk31.default.bold.white("\n\u{1F4CB} [FINAL DECISION RECORD]"));
9852
- console.log(import_chalk31.default.white(" Status: Approved with conditions"));
9853
- console.log(import_chalk31.default.white(" Rationale: Value outweighs migration cost. Ensure SEC-SQL-01 compliance."));
9854
- 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"));
9855
- console.log(import_chalk31.default.green("\u2705 Decision saved to Project Brain (ADR-102)"));
9893
+ console.log(import_chalk32.default.gray(' "Implementation will require updating 3 core services."'));
9894
+ console.log(import_chalk32.default.bold.white("\n\u{1F4CB} [FINAL DECISION RECORD]"));
9895
+ console.log(import_chalk32.default.white(" Status: Approved with conditions"));
9896
+ console.log(import_chalk32.default.white(" Rationale: Value outweighs migration cost. Ensure SEC-SQL-01 compliance."));
9897
+ 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"));
9898
+ console.log(import_chalk32.default.green("\u2705 Decision saved to Project Brain (ADR-102)"));
9856
9899
  } catch (e) {
9857
- console.error(import_chalk31.default.red(`
9900
+ console.error(import_chalk32.default.red(`
9858
9901
  Council session aborted: ${e.message}`));
9859
9902
  }
9860
9903
  });
@@ -9900,19 +9943,19 @@ program.hook("preAction", async () => {
9900
9943
  });
9901
9944
  program.on("--help", () => {
9902
9945
  console.log("");
9903
- console.log(import_chalk32.default.bold("Examples:"));
9946
+ console.log(import_chalk33.default.bold("Examples:"));
9904
9947
  console.log("");
9905
- console.log(import_chalk32.default.cyan(" $ rigstate login sk_rigstate_your_api_key"));
9906
- console.log(import_chalk32.default.dim(" Authenticate with your Rigstate API key"));
9948
+ console.log(import_chalk33.default.cyan(" $ rigstate login sk_rigstate_your_api_key"));
9949
+ console.log(import_chalk33.default.dim(" Authenticate with your Rigstate API key"));
9907
9950
  console.log("");
9908
- console.log(import_chalk32.default.cyan(" $ rigstate scan"));
9909
- console.log(import_chalk32.default.dim(" Scan the current directory"));
9951
+ console.log(import_chalk33.default.cyan(" $ rigstate scan"));
9952
+ console.log(import_chalk33.default.dim(" Scan the current directory"));
9910
9953
  console.log("");
9911
- console.log(import_chalk32.default.cyan(" $ rigstate scan ./src --project abc123"));
9912
- console.log(import_chalk32.default.dim(" Scan a specific directory with project ID"));
9954
+ console.log(import_chalk33.default.cyan(" $ rigstate scan ./src --project abc123"));
9955
+ console.log(import_chalk33.default.dim(" Scan a specific directory with project ID"));
9913
9956
  console.log("");
9914
- console.log(import_chalk32.default.cyan(" $ rigstate scan --json"));
9915
- console.log(import_chalk32.default.dim(" Output results in JSON format (useful for IDE extensions)"));
9957
+ console.log(import_chalk33.default.cyan(" $ rigstate scan --json"));
9958
+ console.log(import_chalk33.default.dim(" Output results in JSON format (useful for IDE extensions)"));
9916
9959
  console.log("");
9917
9960
  });
9918
9961
  program.parse(process.argv);