@rigstate/cli 0.7.18 → 0.7.20
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/.rigstate/cache/heuristics.json +79 -0
- package/.rigstate/daemon.pid +1 -0
- package/.rigstate/daemon.state.json +8 -0
- package/.rigstate/guardian.lock +7 -0
- package/.rigstate/rules-cache.json +166 -0
- package/dist/index.cjs +121 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +121 -28
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/daemon.ts +16 -5
- package/src/daemon/file-watcher.ts +33 -21
- package/src/index.ts +1 -2
package/dist/index.js
CHANGED
|
@@ -1752,9 +1752,67 @@ var require_dist2 = __commonJS({
|
|
|
1752
1752
|
}
|
|
1753
1753
|
});
|
|
1754
1754
|
|
|
1755
|
+
// package.json
|
|
1756
|
+
var require_package = __commonJS({
|
|
1757
|
+
"package.json"(exports, module) {
|
|
1758
|
+
module.exports = {
|
|
1759
|
+
name: "@rigstate/cli",
|
|
1760
|
+
version: "0.7.20",
|
|
1761
|
+
description: "Rigstate CLI - Code audit, sync and supervision tool",
|
|
1762
|
+
type: "module",
|
|
1763
|
+
main: "./dist/index.js",
|
|
1764
|
+
bin: {
|
|
1765
|
+
rigstate: "dist/index.js"
|
|
1766
|
+
},
|
|
1767
|
+
scripts: {
|
|
1768
|
+
dev: "tsup --watch",
|
|
1769
|
+
build: "tsup",
|
|
1770
|
+
lint: "tsc --noEmit",
|
|
1771
|
+
start: "node dist/index.js",
|
|
1772
|
+
test: "node dist/index.js --help"
|
|
1773
|
+
},
|
|
1774
|
+
dependencies: {
|
|
1775
|
+
"@rigstate/rules-engine": "*",
|
|
1776
|
+
"@rigstate/shared": "*",
|
|
1777
|
+
uuid: "^9.0.1",
|
|
1778
|
+
"@types/diff": "^7.0.2",
|
|
1779
|
+
"@types/inquirer": "^9.0.9",
|
|
1780
|
+
axios: "^1.6.5",
|
|
1781
|
+
chalk: "^5.3.0",
|
|
1782
|
+
chokidar: "^3.6.0",
|
|
1783
|
+
commander: "^12.0.0",
|
|
1784
|
+
conf: "^12.0.0",
|
|
1785
|
+
diff: "^4.0.2",
|
|
1786
|
+
dotenv: "^16.4.1",
|
|
1787
|
+
glob: "^10.3.10",
|
|
1788
|
+
inquirer: "^9.3.8",
|
|
1789
|
+
ora: "^8.0.1"
|
|
1790
|
+
},
|
|
1791
|
+
devDependencies: {
|
|
1792
|
+
"@types/node": "^20.11.5",
|
|
1793
|
+
"@types/uuid": "^10.0.0",
|
|
1794
|
+
tsup: "^8.0.1",
|
|
1795
|
+
typescript: "^5.3.3"
|
|
1796
|
+
},
|
|
1797
|
+
engines: {
|
|
1798
|
+
node: ">=18.0.0"
|
|
1799
|
+
},
|
|
1800
|
+
keywords: [
|
|
1801
|
+
"rigstate",
|
|
1802
|
+
"cli",
|
|
1803
|
+
"audit",
|
|
1804
|
+
"security",
|
|
1805
|
+
"code-quality",
|
|
1806
|
+
"supervisor"
|
|
1807
|
+
],
|
|
1808
|
+
author: "Rigstate",
|
|
1809
|
+
license: "MIT"
|
|
1810
|
+
};
|
|
1811
|
+
}
|
|
1812
|
+
});
|
|
1813
|
+
|
|
1755
1814
|
// src/index.ts
|
|
1756
1815
|
init_esm_shims();
|
|
1757
|
-
import { createRequire } from "module";
|
|
1758
1816
|
import { Command as Command23 } from "commander";
|
|
1759
1817
|
import chalk33 from "chalk";
|
|
1760
1818
|
|
|
@@ -3209,34 +3267,60 @@ function createFileWatcher(watchPath) {
|
|
|
3209
3267
|
emitter.start = () => {
|
|
3210
3268
|
const absolutePath = path16.resolve(process.cwd(), watchPath);
|
|
3211
3269
|
watcher = chokidar.watch(absolutePath, {
|
|
3212
|
-
ignored:
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3270
|
+
ignored: (pathStr) => {
|
|
3271
|
+
const relativePath = path16.relative(process.cwd(), pathStr);
|
|
3272
|
+
const segments = relativePath.split(path16.sep);
|
|
3273
|
+
const ignoreDirs = [
|
|
3274
|
+
"node_modules",
|
|
3275
|
+
".git",
|
|
3276
|
+
".next",
|
|
3277
|
+
".turbo",
|
|
3278
|
+
"dist",
|
|
3279
|
+
"build",
|
|
3280
|
+
".rigstate",
|
|
3281
|
+
"coverage",
|
|
3282
|
+
"tmp",
|
|
3283
|
+
"temp",
|
|
3284
|
+
"vendor",
|
|
3285
|
+
".cache",
|
|
3286
|
+
"public",
|
|
3287
|
+
"artifacts",
|
|
3288
|
+
"out",
|
|
3289
|
+
".vercel",
|
|
3290
|
+
".npm",
|
|
3291
|
+
".agent",
|
|
3292
|
+
".cursor",
|
|
3293
|
+
".npm-cache",
|
|
3294
|
+
"backups",
|
|
3295
|
+
"docs",
|
|
3296
|
+
"tests",
|
|
3297
|
+
"tools",
|
|
3298
|
+
"scripts",
|
|
3299
|
+
"supabase"
|
|
3300
|
+
];
|
|
3301
|
+
if (segments.some((segment) => ignoreDirs.includes(segment))) {
|
|
3302
|
+
return true;
|
|
3303
|
+
}
|
|
3304
|
+
const isFile = !!path16.extname(pathStr);
|
|
3305
|
+
if (isFile && !isCodeFile3(pathStr)) {
|
|
3306
|
+
return true;
|
|
3307
|
+
}
|
|
3308
|
+
return false;
|
|
3309
|
+
},
|
|
3228
3310
|
persistent: true,
|
|
3229
3311
|
ignoreInitial: true,
|
|
3230
3312
|
ignorePermissionErrors: true,
|
|
3231
|
-
|
|
3232
|
-
|
|
3313
|
+
depth: 5,
|
|
3314
|
+
// Strongly reduced for major monorepos
|
|
3233
3315
|
awaitWriteFinish: {
|
|
3234
|
-
stabilityThreshold:
|
|
3235
|
-
|
|
3316
|
+
stabilityThreshold: 500,
|
|
3317
|
+
// Increased for stability
|
|
3318
|
+
pollInterval: 200
|
|
3236
3319
|
},
|
|
3237
3320
|
usePolling: false,
|
|
3321
|
+
followSymlinks: false,
|
|
3322
|
+
// Prevent symlink loops and extra handles
|
|
3238
3323
|
atomic: true
|
|
3239
|
-
// Handle atomic writes (like vim/saving) better
|
|
3240
3324
|
});
|
|
3241
3325
|
watcher.on("change", (filePath) => {
|
|
3242
3326
|
if (isCodeFile3(filePath)) {
|
|
@@ -3916,10 +4000,20 @@ function createDaemonCommand() {
|
|
|
3916
4000
|
}
|
|
3917
4001
|
const spinner = ora8();
|
|
3918
4002
|
try {
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
4003
|
+
const pidPath = path20.join(process.cwd(), PID_FILE);
|
|
4004
|
+
try {
|
|
4005
|
+
const content = await fs18.readFile(pidPath, "utf-8");
|
|
4006
|
+
const pid = parseInt(content.trim(), 10);
|
|
4007
|
+
try {
|
|
4008
|
+
process.kill(pid, 0);
|
|
4009
|
+
console.log(chalk19.yellow("\u26A0 Another daemon instance is active (PID " + pid + ")."));
|
|
4010
|
+
console.log(chalk19.dim(` Run "rigstate daemon status" for details or Ctrl+C to stop.
|
|
4011
|
+
`));
|
|
4012
|
+
} catch {
|
|
4013
|
+
await fs18.unlink(pidPath).catch(() => {
|
|
4014
|
+
});
|
|
4015
|
+
}
|
|
4016
|
+
} catch {
|
|
3923
4017
|
}
|
|
3924
4018
|
spinner.start("Initializing Guardian Daemon...");
|
|
3925
4019
|
const daemonInstance = await createDaemon({
|
|
@@ -9883,8 +9977,7 @@ async function checkVersion() {
|
|
|
9883
9977
|
|
|
9884
9978
|
// src/index.ts
|
|
9885
9979
|
import dotenv from "dotenv";
|
|
9886
|
-
var
|
|
9887
|
-
var pkg = require2("../package.json");
|
|
9980
|
+
var pkg = require_package();
|
|
9888
9981
|
dotenv.config();
|
|
9889
9982
|
var program = new Command23();
|
|
9890
9983
|
program.name("rigstate").description("CLI for Rigstate - The AI-Native Dev Studio").version(pkg.version);
|