@sechroom/cli 2026.6.21 → 2026.6.22
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.js +22 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1574,7 +1574,7 @@ Examples:
|
|
|
1574
1574
|
// src/commands/hook.ts
|
|
1575
1575
|
import { existsSync as existsSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
1576
1576
|
import { homedir as homedir3 } from "os";
|
|
1577
|
-
import { dirname as dirname4, join as join4 } from "path";
|
|
1577
|
+
import { delimiter, dirname as dirname4, join as join4 } from "path";
|
|
1578
1578
|
|
|
1579
1579
|
// src/sem.ts
|
|
1580
1580
|
import { basename as basename2, dirname as dirname2, join as join2 } from "path";
|
|
@@ -2049,6 +2049,25 @@ function detectHookSurfaces(cwd) {
|
|
|
2049
2049
|
if (detected.includes("codex")) surfaces.push("codex");
|
|
2050
2050
|
return surfaces;
|
|
2051
2051
|
}
|
|
2052
|
+
function isSechroomOnPath() {
|
|
2053
|
+
const pathEnv = process.env.PATH ?? "";
|
|
2054
|
+
if (!pathEnv) return false;
|
|
2055
|
+
const names = process.platform === "win32" ? ["sechroom.cmd", "sechroom.exe", "sechroom.bat", "sechroom"] : ["sechroom"];
|
|
2056
|
+
for (const dir of pathEnv.split(delimiter)) {
|
|
2057
|
+
if (!dir) continue;
|
|
2058
|
+
for (const name of names) {
|
|
2059
|
+
if (existsSync4(join4(dir, name))) return true;
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
return false;
|
|
2063
|
+
}
|
|
2064
|
+
function warnIfSechroomNotOnPath(write = (s) => void process.stderr.write(s)) {
|
|
2065
|
+
if (isSechroomOnPath()) return false;
|
|
2066
|
+
write(
|
|
2067
|
+
"\n\u26A0 `sechroom` isn't on your PATH. The hooks run a bare `sechroom hook \u2026` command\n when your agent fires them, so a non-global install (npx / local) will fail at\n that point. Install globally so the command resolves:\n npm i -g @sechroom/cli\n"
|
|
2068
|
+
);
|
|
2069
|
+
return true;
|
|
2070
|
+
}
|
|
2052
2071
|
function registerHook(program2) {
|
|
2053
2072
|
const hook = program2.command("hook").description("Agent-lifecycle hook adapter (Claude Code / Codex) \u2014 bridges hooks to continuity");
|
|
2054
2073
|
hook.addHelpText(
|
|
@@ -2160,6 +2179,7 @@ Fail-soft: no lane / no auth / no-or-partial intent file / API error -> exit 0,
|
|
|
2160
2179
|
} else {
|
|
2161
2180
|
process.stdout.write("\nRestart (or reload) your agent for the hooks to take effect.\n");
|
|
2162
2181
|
}
|
|
2182
|
+
warnIfSechroomNotOnPath();
|
|
2163
2183
|
return process.exit(0);
|
|
2164
2184
|
});
|
|
2165
2185
|
}
|
|
@@ -2619,6 +2639,7 @@ auto-resumes where you left off and checkpoints working state before compacting.
|
|
|
2619
2639
|
process.stderr.write(`${style.dim("Restart (or reload) your agent for the hooks to take effect.")}
|
|
2620
2640
|
`);
|
|
2621
2641
|
}
|
|
2642
|
+
warnIfSechroomNotOnPath();
|
|
2622
2643
|
} catch (err2) {
|
|
2623
2644
|
process.stderr.write(`${style.dim(`(skipped hook install: ${err2.message})`)}
|
|
2624
2645
|
`);
|
package/package.json
CHANGED