@workit-dev/codex 2.18.0 → 2.18.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workit",
3
- "version": "2.18.0",
3
+ "version": "2.18.1",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -19510,7 +19510,7 @@ function heavyPlan(command, options) {
19510
19510
  };
19511
19511
  }
19512
19512
  if (single) {
19513
- const rewrite = leaseRewrite(command);
19513
+ const rewrite = leaseRewrite(command.trim().replace(TAIL_FILTER, ""));
19514
19514
  return rewrite ? { kind: "rewrite", command: rewrite, reason: single.reason } : { kind: "none" };
19515
19515
  }
19516
19516
  const parts = heavy.map((match) => leaseCommand(match.line));
@@ -19555,6 +19555,7 @@ function workitOnPath(env = process.env) {
19555
19555
  }
19556
19556
  return false;
19557
19557
  }
19558
+ var TAIL_FILTER = /(?:\s+2>&1)?\s*\|\s*(?:tail|head)(?:\s+[\w=.+-]+)*\s*$/u;
19558
19559
  var ASSIGNMENTS = /^\s*((?:[A-Za-z_]\w*=(?:'[^']*'|"(?:[^"\\]|\\.)*"|[^\s'"])*\s+)*)/u;
19559
19560
  function leaseRewrite(command) {
19560
19561
  const text = command.trim();
@@ -24704,6 +24705,96 @@ Retry as: ${retry}` : ""}`,
24704
24705
  };
24705
24706
  };
24706
24707
 
24708
+ // packages/workit-core/src/hooks/exit-pipe.ts
24709
+ var EXIT_VERBS = [
24710
+ ["ci", "wait"],
24711
+ ["check"],
24712
+ ["pr", "merge"],
24713
+ ["release"],
24714
+ ["verify-delivery"]
24715
+ ];
24716
+ var base2 = (word = "") => word.split(/[\\/]/u).at(-1) ?? "";
24717
+ var quote3 = (word) => /^[\w@%+=:,./-]+$/u.test(word) ? word : `'${word.replaceAll("'", `'\\''`)}'`;
24718
+ var verbPath = (words) => {
24719
+ const path = [];
24720
+ for (let at = 0;at < words.length && path.length < 2; at += 1) {
24721
+ const word = words[at];
24722
+ if (word === "--")
24723
+ break;
24724
+ if (word === "--cwd")
24725
+ at += 1;
24726
+ else if (!word.startsWith("-"))
24727
+ path.push(word);
24728
+ }
24729
+ return path;
24730
+ };
24731
+ var exitCall = (words) => {
24732
+ let at = 0;
24733
+ while (at < words.length && /^[A-Za-z_]\w*=/u.test(words[at]))
24734
+ at += 1;
24735
+ if (!/^workit(?:-cli)?$/u.test(base2(words[at])))
24736
+ return null;
24737
+ const path = verbPath(words.slice(at + 1));
24738
+ return EXIT_VERBS.some((verb) => verb.every((word, index) => path[index] === word)) ? words.slice(at) : null;
24739
+ };
24740
+ var setsPipefail = (words) => words[0] === "set" && words.some((word, at) => word === "pipefail" && /^-[a-z]*o$/u.test(words[at - 1] ?? ""));
24741
+ var retryOf = ({ call, dir }) => {
24742
+ const at = call[1]?.startsWith("-") ? 1 : 2;
24743
+ const words = dir && !call.includes("--cwd") ? [...call.slice(0, at), "--cwd", dir, ...call.slice(at)] : call;
24744
+ return ["workit", ...words.slice(1)].map(quote3).join(" ");
24745
+ };
24746
+ function exitPipeGate(command, dialect = "posix") {
24747
+ if (!/\bworkit/u.test(command) || !/\b(?:tail|head)\b/u.test(command))
24748
+ return null;
24749
+ const subshellPiped = /\)\s*(?:\d*>&?\d*\s*)*\|(?!\|)/u.test(command);
24750
+ const groups = [];
24751
+ let carry = null;
24752
+ let pipefail = false;
24753
+ let dir = null;
24754
+ for (const segment of segmentsOf(command, dialect)) {
24755
+ if (segment.unanalyzable)
24756
+ return null;
24757
+ let words = segment.words;
24758
+ let closes = segment.group === "close";
24759
+ if (segment.group === "open") {
24760
+ groups.push(null);
24761
+ continue;
24762
+ }
24763
+ if (words[0] === "{") {
24764
+ groups.push(null);
24765
+ words = words.slice(1);
24766
+ } else if (words[0] === "}") {
24767
+ closes = true;
24768
+ words = words.slice(1);
24769
+ }
24770
+ if (closes) {
24771
+ const inner = groups.pop() ?? null;
24772
+ const piped = segment.pipe === true || segment.group === "close" && subshellPiped;
24773
+ carry = piped ? inner ?? carry : null;
24774
+ continue;
24775
+ }
24776
+ if (setsPipefail(words))
24777
+ pipefail = true;
24778
+ const filter = base2(words[0]);
24779
+ if (carry && !pipefail && (filter === "tail" || filter === "head")) {
24780
+ const retry = retryOf(carry);
24781
+ return {
24782
+ kind: "deny",
24783
+ reason: `workit exit-pipe: piping \`workit ${verbPath(carry.call.slice(1)).join(" ")}\` into ${filter} hides its exit code.
24784
+ Retry as: ${retry}`,
24785
+ unblock: retry
24786
+ };
24787
+ }
24788
+ const call = exitCall(words);
24789
+ const found = call ? { call, dir } : null;
24790
+ if (found && groups.length)
24791
+ groups[groups.length - 1] = found;
24792
+ carry = segment.pipe ? found ?? carry : null;
24793
+ dir = words.length === 2 && words[0] === "cd" && !segment.expands?.length ? words[1] : null;
24794
+ }
24795
+ return null;
24796
+ }
24797
+
24707
24798
  // packages/workit-core/src/hooks/handle.ts
24708
24799
  var usable2 = (value) => value === "native" || value === "partial";
24709
24800
  var NONE6 = { kind: "none" };
@@ -24847,6 +24938,9 @@ function decide(input, deps) {
24847
24938
  const ytrack = canDeny ? ytrackGate(input.cwd, event.command, event.dialect ?? "posix", input.host === "claude_code") : null;
24848
24939
  if (ytrack)
24849
24940
  return ytrack;
24941
+ const piped = canDeny ? exitPipeGate(event.command, event.dialect) : null;
24942
+ if (piped)
24943
+ return piped;
24850
24944
  const split = canDeny ? cdWorkitSplit(event.command) : null;
24851
24945
  if (split)
24852
24946
  return {
@@ -101,7 +101,7 @@ if (quiet) {
101
101
  `);
102
102
  } else {
103
103
  try {
104
- const { runCodexHook } = await import("./workit-hook-vytacjkg.js");
104
+ const { runCodexHook } = await import("./workit-hook-nq9mc37a.js");
105
105
  await runCodexHook([payload]);
106
106
  } catch (error) {
107
107
  const { answerRuntimeFailure } = await import("./workit-hook-9k8dtngs.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/codex",
3
- "version": "2.18.0",
3
+ "version": "2.18.1",
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": [
@@ -41,8 +41,8 @@
41
41
  "build": "bun scripts/build.ts"
42
42
  },
43
43
  "devDependencies": {
44
- "@workit-dev/core": "^2.18.0",
45
- "@workit-dev/mcp": "^2.18.0"
44
+ "@workit-dev/core": "^2.18.1",
45
+ "@workit-dev/mcp": "^2.18.1"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=24"
@@ -53,7 +53,7 @@ the same check. Fix round and recheck both failed: the decider agent (read the `
53
53
  with `workit check`, fix the root cause, batch every fix in one push, one focused commit per fix (unrelated hunks in one file: `workit git stage --patch <file>`, then `workit git commit -m "<msg>" --staged`). A tool warning is a finding: fix it in this PR in the right layer, or record the false positive with evidence; pre-existing ones get their own PR.
54
54
  6. **Verified.** The lane in `workit pr status` decides: none, no verdict; self, your `--self` verdict; focused or full (or `verification: self|independent`), one non-author verifier per PR after the last push, never per push (read the `workit-review` skill's SKILL.md and follow it), on Claude Code with the `model` and `effort` of `workit models show --role verifier`. A docs-only push (or test-only under a unit verdict) keeps the verdict (`carried`); `reverify: focused` re-checks only the new diff, reusing green CI; one verdict at a stack's top covers its unchanged lower PRs. Land only when
55
55
  granted: `workit stack land` or `workit pr merge`; `--unverified --reason` if user-asked.
56
- Never pipe a delivery verb through `grep`: read its exit code, or use `--json`.
56
+ Never pipe a delivery verb through `grep`, `tail` or `head`: read its exit code, or use `--json`. Trunk CI after a merge: `workit ci wait --branch <trunk>`.
57
57
  7. **Observe it landed:** `workit verify-delivery pr` or `merge`. After a failed
58
58
  verdict or a check red 3+ times, at any endpoint: offer `/wk-retro` in one
59
59
  line of the final or stop report; never pause the babysit loop for it.