@brainervirus/workit-claude-code 8.28.0 → 8.28.1
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/.claude-plugin/plugin.json +1 -1
- package/bin/workit-hook.mjs +27 -0
- package/dist/workit-hook.js +61 -61
- package/dist/workit.js +10 -4
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workit",
|
|
3
3
|
"displayName": "Workit",
|
|
4
|
-
"version": "8.28.
|
|
4
|
+
"version": "8.28.1",
|
|
5
5
|
"description": "Workflow rails for agentic coding: task context on every session, branch policy on shell commands, and the workit method skills",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "BrainerVirus"
|
package/bin/workit-hook.mjs
CHANGED
|
@@ -33,6 +33,33 @@ const failOpen = (reason) => {
|
|
|
33
33
|
process.stdout.write("{}\n");
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
+
// A Node below this package's own engines minimum cannot load dist: fail open
|
|
37
|
+
// with one clear line instead of a syntax error. WORKIT_HOOK_NODE_VERSION
|
|
38
|
+
// stands in for process.versions.node (tests). An unreadable minimum never blocks.
|
|
39
|
+
const nodeFloorMessage = () => {
|
|
40
|
+
try {
|
|
41
|
+
const found = process.env.WORKIT_HOOK_NODE_VERSION || process.versions.node;
|
|
42
|
+
const range = JSON.parse(readFileSync(path.join(root, "package.json"), "utf8")).engines?.node;
|
|
43
|
+
const min = /^>=\s*(\d+)(?:\.(\d+))?(?:\.(\d+))?/.exec(String(range ?? ""));
|
|
44
|
+
if (!min) return null;
|
|
45
|
+
const need = [min[1], min[2] ?? 0, min[3] ?? 0].map(Number);
|
|
46
|
+
const have = String(found).replace(/^v/, "").split(".").map(Number);
|
|
47
|
+
for (let i = 0; i < 3; i++) {
|
|
48
|
+
const a = have[i] ?? 0;
|
|
49
|
+
if (Number.isNaN(a)) return null;
|
|
50
|
+
if (a !== need[i]) return a < need[i] ? `needs Node ${range}, found ${found}` : null;
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
} catch {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const tooOld = nodeFloorMessage();
|
|
58
|
+
if (tooOld) {
|
|
59
|
+
failOpen(tooOld);
|
|
60
|
+
process.exit(0);
|
|
61
|
+
}
|
|
62
|
+
|
|
36
63
|
// Every Bash/PowerShell call and every file edit reaches this hook (branch
|
|
37
64
|
// policy, raw git/forge steering and the before-write gate). Fast paths
|
|
38
65
|
// answer `{}` before the runtime loads: a shell command with no git/gh/glab,
|