@brainervirus/workit-codex 8.19.0 → 8.19.2
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/.codex-plugin/plugin.json +1 -1
- package/dist/{workit-hook-rkwtxnyc.js → workit-hook-00hstm40.js} +49 -4
- package/dist/{workit-hook-8yfjygc1.js → workit-hook-kg4dxyfv.js} +1 -1
- package/dist/workit-hook.js +8 -3
- package/package.json +3 -3
- package/skills/workit-implement/SKILL.md +5 -3
- package/skills/workit-verify-app/SKILL.md +6 -2
- package/skills/workit-verify-app/references/template.md +2 -0
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
gateCheckNames,
|
|
8
8
|
checkCommand,
|
|
9
9
|
maybeHeavy
|
|
10
|
-
} from "./workit-hook-
|
|
10
|
+
} from "./workit-hook-kg4dxyfv.js";
|
|
11
11
|
// packages/workit-core/src/hooks/descriptor.ts
|
|
12
12
|
var support = (descriptor, axis) => {
|
|
13
13
|
if (axis.startsWith("event:"))
|
|
@@ -21227,7 +21227,7 @@ var canonical2 = (file) => {
|
|
|
21227
21227
|
let rest = "";
|
|
21228
21228
|
for (let dir = path24.resolve(file);; dir = path24.dirname(dir)) {
|
|
21229
21229
|
try {
|
|
21230
|
-
return path24.join(realpathSync5(dir), rest);
|
|
21230
|
+
return path24.join(realpathSync5.native(dir), rest);
|
|
21231
21231
|
} catch {
|
|
21232
21232
|
if (path24.dirname(dir) === dir)
|
|
21233
21233
|
return path24.resolve(file);
|
|
@@ -21447,18 +21447,26 @@ var CD2 = new Set(["cd", "chdir", "set-location", "sl"]);
|
|
|
21447
21447
|
var PUSHD2 = new Set(["pushd", "push-location"]);
|
|
21448
21448
|
var POPD2 = new Set(["popd", "pop-location"]);
|
|
21449
21449
|
var cdInto = (dir, words) => {
|
|
21450
|
-
const
|
|
21450
|
+
const named = words.slice(1).find((word) => !word.startsWith("-") || word === "-");
|
|
21451
|
+
const target = named === undefined ? undefined : homeExpanded(named);
|
|
21451
21452
|
if (dir === undefined || target === "-" || target && /^~|[$`*?]/.test(target))
|
|
21452
21453
|
return;
|
|
21453
21454
|
return target === undefined ? os9.homedir() : path24.resolve(dir, target);
|
|
21454
21455
|
};
|
|
21455
21456
|
var quoteWord2 = (word) => /^[\w@%+=:,./-]+$/.test(word) ? word : `'${word.replaceAll("'", "'\\''")}'`;
|
|
21457
|
+
var homeExpanded = (file) => {
|
|
21458
|
+
const match = /^(?:~|\$HOME|\$\{HOME\})(?=\/|$)/.exec(file);
|
|
21459
|
+
return match ? (process.env.HOME || os9.homedir()) + file.slice(match[0].length) : file;
|
|
21460
|
+
};
|
|
21456
21461
|
var segmentTargets = (cwd, command, dialect, depth = 0) => {
|
|
21457
21462
|
const targets = [];
|
|
21458
21463
|
let dir = cwd;
|
|
21459
21464
|
let stack = [];
|
|
21460
21465
|
const groups = [];
|
|
21461
|
-
const at = (file) =>
|
|
21466
|
+
const at = (file) => {
|
|
21467
|
+
const home = homeExpanded(file);
|
|
21468
|
+
return path24.isAbsolute(home) ? home : dir === undefined ? null : path24.resolve(dir, home);
|
|
21469
|
+
};
|
|
21462
21470
|
for (const segment of segmentsOf(command, dialect)) {
|
|
21463
21471
|
if (segment.group === "open") {
|
|
21464
21472
|
groups.push({ dir, stack: [...stack] });
|
|
@@ -21563,7 +21571,39 @@ var claimAll = (owner, targets, deps) => {
|
|
|
21563
21571
|
claimLiveSession(target, owner, deps);
|
|
21564
21572
|
};
|
|
21565
21573
|
var liveTargets = (cwd, paths) => paths?.length ? paths.map((file) => path24.resolve(cwd, file)) : [path24.join(cwd, DIR_TARGET)];
|
|
21574
|
+
var issuedTarget = (cwd, targets) => {
|
|
21575
|
+
const state = resolveStateDir();
|
|
21576
|
+
const found = targets.find((target) => underIssued(state, cwd, homeExpanded(target), process.platform, canonical2));
|
|
21577
|
+
return found ?? null;
|
|
21578
|
+
};
|
|
21579
|
+
var underIssued = (state, cwd, target, platform = process.platform, real = (file) => file) => {
|
|
21580
|
+
const win = platform === "win32";
|
|
21581
|
+
const p = win ? path24.win32 : path24.posix;
|
|
21582
|
+
const fold = (value) => win || platform === "darwin" ? value.toLowerCase() : value;
|
|
21583
|
+
const named = win ? target.replace(/^\/([a-zA-Z])(?=\/|$)/, "$1:") : target;
|
|
21584
|
+
const relative = p.relative(fold(real(p.resolve(state))), fold(real(p.resolve(cwd, named))));
|
|
21585
|
+
if (relative.startsWith("..") || p.isAbsolute(relative))
|
|
21586
|
+
return false;
|
|
21587
|
+
return relative.split(p.sep)[0].startsWith("issued");
|
|
21588
|
+
};
|
|
21589
|
+
var unquotedWindowsIssued = (command) => {
|
|
21590
|
+
if (process.platform !== "win32" || !command.includes("\\"))
|
|
21591
|
+
return false;
|
|
21592
|
+
const flat = (value) => value.replaceAll("\\", "/").toLowerCase();
|
|
21593
|
+
return flat(command).includes(`${flat(resolveStateDir())}/issued`) && shellWrites(command).writes;
|
|
21594
|
+
};
|
|
21595
|
+
var issuedDeny = (file) => {
|
|
21596
|
+
const unblock = "Issued ids and tokens are written only by Workit's SubagentStart hook. Run the verifier or reviewer agent so the host issues its own session; never edit the issued registries by hand.";
|
|
21597
|
+
return {
|
|
21598
|
+
kind: "deny",
|
|
21599
|
+
reason: `workit issued-registry guard: ${file} is under Workit's issued-session state. ${unblock}`,
|
|
21600
|
+
unblock
|
|
21601
|
+
};
|
|
21602
|
+
};
|
|
21566
21603
|
function writeGate(cwd, paths, owner, deps) {
|
|
21604
|
+
const forged = paths?.length ? issuedTarget(cwd, paths) : null;
|
|
21605
|
+
if (forged)
|
|
21606
|
+
return issuedDeny(forged);
|
|
21567
21607
|
if (!owner)
|
|
21568
21608
|
return beforeWriteGate(cwd, paths);
|
|
21569
21609
|
const targets = liveTargets(cwd, paths);
|
|
@@ -21576,6 +21616,11 @@ function writeGate(cwd, paths, owner, deps) {
|
|
|
21576
21616
|
return decision;
|
|
21577
21617
|
}
|
|
21578
21618
|
function shellGate(cwd, command, owner, dialect = "posix", deps) {
|
|
21619
|
+
try {
|
|
21620
|
+
const forged = issuedTarget(cwd, segmentTargets(cwd, command, dialect)) ?? (unquotedWindowsIssued(command) ? "the issued registry" : null);
|
|
21621
|
+
if (forged)
|
|
21622
|
+
return issuedDeny(forged);
|
|
21623
|
+
} catch {}
|
|
21579
21624
|
const writes = shellWrites(command);
|
|
21580
21625
|
let targets = [];
|
|
21581
21626
|
if (owner) {
|
|
@@ -290,4 +290,4 @@ function maybeHeavy(command, cwd, env = process.env) {
|
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
export { CHECKS_FILE, repoHeavyCommands, loadCheckConfig, matchesNamedCheck, gateCheckNames, checkCommand, maybeHeavy };
|
|
293
|
+
export { CHECKS_FILE, repoHeavyCommands, loadCheckConfig, matchesNamedCheck, gateCheckNames, checkCommand, stateDir, maybeHeavy };
|
package/dist/workit-hook.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
stateDir,
|
|
3
4
|
maybeHeavy
|
|
4
|
-
} from "./workit-hook-
|
|
5
|
+
} from "./workit-hook-kg4dxyfv.js";
|
|
5
6
|
|
|
6
7
|
// packages/workit-codex/hooks/launcher.ts
|
|
7
8
|
var payload = "";
|
|
@@ -9,6 +10,10 @@ for await (const chunk of process.stdin)
|
|
|
9
10
|
payload += String(chunk);
|
|
10
11
|
var SHELL_TOOLS = new Set(["bash", "unified-exec"]);
|
|
11
12
|
var WRITE_TOOLS = new Set(["applypatch", "edit", "write"]);
|
|
13
|
+
var mentionsIssued = (text) => {
|
|
14
|
+
const flat = (value) => value.replaceAll("\\", "/").toLowerCase();
|
|
15
|
+
return /issued/i.test(text) || flat(text).includes(flat(stateDir(process.env)));
|
|
16
|
+
};
|
|
12
17
|
var quietEvent = () => {
|
|
13
18
|
try {
|
|
14
19
|
const value = JSON.parse(payload);
|
|
@@ -29,7 +34,7 @@ var quietEvent = () => {
|
|
|
29
34
|
return null;
|
|
30
35
|
if (event === "PostToolUse")
|
|
31
36
|
return /\bcommit\b/.test(text) ? null : event;
|
|
32
|
-
return /\b(?:git|gh|glab)\b/.test(text) || maybeHeavy(text, value.cwd) ? null : event;
|
|
37
|
+
return /\b(?:git|gh|glab)\b/.test(text) || mentionsIssued(text) || maybeHeavy(text, value.cwd) ? null : event;
|
|
33
38
|
} catch {
|
|
34
39
|
return null;
|
|
35
40
|
}
|
|
@@ -39,6 +44,6 @@ if (quiet)
|
|
|
39
44
|
process.stdout.write(`${JSON.stringify({ hookSpecificOutput: { hookEventName: quiet } })}
|
|
40
45
|
`);
|
|
41
46
|
else {
|
|
42
|
-
const { runCodexHook } = await import("./workit-hook-
|
|
47
|
+
const { runCodexHook } = await import("./workit-hook-00hstm40.js");
|
|
43
48
|
await runCodexHook([payload]);
|
|
44
49
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-codex",
|
|
3
|
-
"version": "8.19.
|
|
3
|
+
"version": "8.19.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit Codex CLI/desktop plugin — shared MCP transport, hooks, method skills, and verifier/reviewer/implementer agents",
|
|
6
6
|
"keywords": [
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"build": "bun scripts/build.ts"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@brainervirus/workit-core": "^8.19.
|
|
43
|
-
"@brainervirus/workit-mcp": "^8.19.
|
|
42
|
+
"@brainervirus/workit-core": "^8.19.2",
|
|
43
|
+
"@brainervirus/workit-mcp": "^8.19.2"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=24"
|
|
@@ -24,7 +24,10 @@ description: Build a requested change in small verified steps - follow local pat
|
|
|
24
24
|
lease waits and names its holder (`workit lock status`).
|
|
25
25
|
5. Prove the feature on its real surface with the project's `verify-<app>`
|
|
26
26
|
skill; none yet? Write one (read the `workit-verify-app` skill's SKILL.md and follow it). Tests show branch behavior,
|
|
27
|
-
not that the feature works.
|
|
27
|
+
not that the feature works. The report carries what you observed: a UI
|
|
28
|
+
change a screenshot or console/network check (chrome devtools or
|
|
29
|
+
agent-browser), an API a quoted real response. App not runnable? Say so
|
|
30
|
+
plainly, never claim success.
|
|
28
31
|
6. Commit: `workit git commit -m "<type>: <what>" -- <paths>` (or `--all`).
|
|
29
32
|
No endpoint named? Stop here and state the next command. Hand delivery to
|
|
30
33
|
ship, which pushes and opens the PR with its body shape (read the `workit-ship` skill's SKILL.md and follow it), only
|
|
@@ -55,8 +58,7 @@ flag was never invoked)
|
|
|
55
58
|
|
|
56
59
|
Good: "Added `--since`. measured: `workit check test` exit 0;
|
|
57
60
|
`mytool log --since 2d` printed 3 entries against the fixture repo. inferred:
|
|
58
|
-
the GitLab path behaves the same (
|
|
59
|
-
to the verifier agent."
|
|
61
|
+
the GitLab path behaves the same (not run). Handed to the verifier agent."
|
|
60
62
|
|
|
61
63
|
## Check
|
|
62
64
|
|
|
@@ -27,7 +27,10 @@ way a user would.
|
|
|
27
27
|
- **Drive:** how to exercise it: CLI invocations, `curl` against routes, a
|
|
28
28
|
browser tool for UI, with fixture data.
|
|
29
29
|
- **Evidence:** what to capture (exit code, response body, screenshot path)
|
|
30
|
-
and the command that records it.
|
|
30
|
+
and the command that records it. A UI is driven with chrome devtools or
|
|
31
|
+
agent-browser, with a screenshot or console/network observation; an API
|
|
32
|
+
with a real call, response quoted. The report carries the observation.
|
|
33
|
+
App not runnable? Say so plainly, never claim success.
|
|
31
34
|
- **Cleanup:** stop processes, remove temp data.
|
|
32
35
|
- **Feature map:** feature, how to drive it, expected observation.
|
|
33
36
|
3. **Prove it end-to-end once:** launch, drive one feature, capture evidence,
|
|
@@ -54,7 +57,8 @@ report `clean`, `changed` (what) or `blocked` (why).
|
|
|
54
57
|
Bad: "Verify by running the tests." (that is not the real surface)
|
|
55
58
|
|
|
56
59
|
Good: "Launch `bun run dev` (ready: `listening on :5173`, 30 s). Drive:
|
|
57
|
-
`curl -s localhost:5173/api/health`
|
|
60
|
+
`curl -s localhost:5173/api/health` returned `{"ok":true}`; screenshot of
|
|
61
|
+
/settings at .workit-scratch/settings.png. Evidence:
|
|
58
62
|
`workit check --name verify-web -- bun scripts/smoke.ts` exit 0."
|
|
59
63
|
|
|
60
64
|
## Check
|
|
@@ -30,6 +30,8 @@ description: Launch, drive and observe <app> on its real surface (<cli|web|api>)
|
|
|
30
30
|
## Evidence
|
|
31
31
|
`workit check --name verify-<app> -- <driver command>` records exit code and log.
|
|
32
32
|
Screenshots go to `<tmp dir>/verify-<app>/<feature>.png`; cite the path.
|
|
33
|
+
UI: also report a console or network observation. API: quote the real response.
|
|
34
|
+
If the app cannot be run, say so plainly instead of claiming success.
|
|
33
35
|
|
|
34
36
|
## Cleanup
|
|
35
37
|
`<command>` (stop servers, remove `<tmp dir>`).
|