@rigstate/cli 0.7.25 → 0.7.26
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 +22 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/daemon/core.ts +28 -11
- package/.rigstate/daemon.state.json +0 -8
package/dist/index.js
CHANGED
|
@@ -1757,7 +1757,7 @@ var require_package = __commonJS({
|
|
|
1757
1757
|
"package.json"(exports, module) {
|
|
1758
1758
|
module.exports = {
|
|
1759
1759
|
name: "@rigstate/cli",
|
|
1760
|
-
version: "0.7.
|
|
1760
|
+
version: "0.7.26",
|
|
1761
1761
|
description: "Rigstate CLI - Code audit, sync and supervision tool",
|
|
1762
1762
|
type: "module",
|
|
1763
1763
|
main: "./dist/index.js",
|
|
@@ -4015,6 +4015,7 @@ var GuardianDaemon = class extends EventEmitter3 {
|
|
|
4015
4015
|
this.emit("skill:suggestion", match);
|
|
4016
4016
|
}
|
|
4017
4017
|
}
|
|
4018
|
+
violationsMap = /* @__PURE__ */ new Map();
|
|
4018
4019
|
async runIntegrityCheck(filePath) {
|
|
4019
4020
|
if (!this.guardianMonitor) return;
|
|
4020
4021
|
if (this.interventionProtocol) this.interventionProtocol.clear(filePath);
|
|
@@ -4023,24 +4024,37 @@ var GuardianDaemon = class extends EventEmitter3 {
|
|
|
4023
4024
|
if (result.violations.length > 0) {
|
|
4024
4025
|
this.handleViolations(filePath, result.violations);
|
|
4025
4026
|
} else {
|
|
4026
|
-
|
|
4027
|
+
if (this.violationsMap.has(filePath)) {
|
|
4028
|
+
this.violationsMap.delete(filePath);
|
|
4029
|
+
this.updateViolationReport();
|
|
4030
|
+
}
|
|
4027
4031
|
}
|
|
4028
4032
|
}
|
|
4029
4033
|
async updateViolationReport(violations) {
|
|
4030
4034
|
const reportPath = path20.join(process.cwd(), ".rigstate", "ACTIVE_VIOLATIONS.md");
|
|
4031
|
-
|
|
4035
|
+
const allViolations = Array.from(this.violationsMap.entries());
|
|
4036
|
+
const totalCount = allViolations.reduce((acc, [, v]) => acc + v.length, 0);
|
|
4037
|
+
let content = `# \u{1F6E1}\uFE0F Guardian Status: ${totalCount > 0 ? "\u26A0\uFE0F ATTENTION" : "\u2705 PASS"}
|
|
4032
4038
|
|
|
4033
4039
|
`;
|
|
4034
4040
|
content += `*Last check: ${(/* @__PURE__ */ new Date()).toLocaleString()}*
|
|
4041
|
+
`;
|
|
4042
|
+
content += `*Files with issues: ${allViolations.length}*
|
|
4035
4043
|
|
|
4036
4044
|
`;
|
|
4037
|
-
if (
|
|
4045
|
+
if (totalCount === 0) {
|
|
4038
4046
|
content += "All systems within architectural limits. Frank is satisfied. \u{1F92B}\n";
|
|
4039
4047
|
} else {
|
|
4040
4048
|
content += "### \u{1F6A8} Active Violations\n\n";
|
|
4041
|
-
for (const
|
|
4042
|
-
|
|
4049
|
+
for (const [file, fileViolations] of allViolations) {
|
|
4050
|
+
const relPath = path20.relative(process.cwd(), file);
|
|
4051
|
+
content += `#### \u{1F4C4} ${relPath}
|
|
4043
4052
|
`;
|
|
4053
|
+
for (const v of fileViolations) {
|
|
4054
|
+
content += `- **[${v.severity.toUpperCase()}]**: ${v.message}
|
|
4055
|
+
`;
|
|
4056
|
+
}
|
|
4057
|
+
content += "\n";
|
|
4044
4058
|
}
|
|
4045
4059
|
content += "\n---\n*Rigstate Daemon is watching. Fix violations to clear this report.*";
|
|
4046
4060
|
}
|
|
@@ -4052,7 +4066,8 @@ var GuardianDaemon = class extends EventEmitter3 {
|
|
|
4052
4066
|
handleViolations(filePath, violations) {
|
|
4053
4067
|
this.state.violationsFound += violations.length;
|
|
4054
4068
|
this.emit("violation", { file: filePath, violations });
|
|
4055
|
-
this.
|
|
4069
|
+
this.violationsMap.set(filePath, violations);
|
|
4070
|
+
this.updateViolationReport();
|
|
4056
4071
|
for (const v of violations) {
|
|
4057
4072
|
const level = v.severity === "critical" ? "error" : v.severity === "warning" ? "warn" : "info";
|
|
4058
4073
|
Logger[level](`[${v.severity.toUpperCase()}] ${filePath}: ${v.message}`);
|