@workit-dev/codex 2.17.0 → 2.18.0

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.17.0",
3
+ "version": "2.18.0",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -31602,7 +31602,7 @@ var DESCRIPTORS = {
31602
31602
  };
31603
31603
  var sinceStart = new Map;
31604
31604
  // packages/workit-core/src/hooks/cwd-normalize.ts
31605
- var DIR = String.raw`[A-Za-z0-9_./@%+:,=-]+|'[^'$${"`"}\\\n]*'|"[^"$${"`"}\\!\n]*"`;
31605
+ var DIR = String.raw`(?:[A-Za-z0-9_./@%+:,=-]|(?<=[A-Za-z0-9])~)+|'[^'$${"`"}\n]*'|"(?:[^"$${"`"}\\!\n]|\\(?=[^"$${"`"}\\!\n]))*"`;
31606
31606
  var COMPOUND2 = new RegExp(String.raw`^\s*cd\s+(${DIR})\s*&&\s*(workit(?:\s[\s\S]*)?)$`, "u");
31607
31607
  var GLOBALS_FIRST = new RegExp(String.raw`^(\s*workit)((?:\s+(?:--json|--cwd(?:=|\s+)(?:${DIR})))+)\s+([a-z][a-z-]*)(?=\s|$)`, "u");
31608
31608
  var VERBS = new Set(WORKIT_ALLOWED_VERBS);
@@ -19612,6 +19612,14 @@ var heavyDenial = (original, plan) => ({
19612
19612
  reason: plan.server ? `dev_server: \`${original.trim()}\` starts a dev server (${plan.reason}), which never returns. Start it in the background, owned by this session; run exactly: ${plan.command}` : `heavy_command: \`${original.trim()}\` is heavy (${plan.reason}) and must run under the machine-wide heavy-check lease, so parallel agents cannot exhaust this machine's memory and CPU. Run exactly: ${plan.command}`,
19613
19613
  unblock: plan.command
19614
19614
  });
19615
+ var retryDenial = (gate, what, retry) => ({
19616
+ kind: "deny",
19617
+ reason: `workit ${gate}: ${what}.
19618
+ Retry as: ${retry}
19619
+ Why: Claude Code auto mode refuses a call whose input a hook changed.`,
19620
+ unblock: retry
19621
+ });
19622
+ var autoRouteDenial = (plan) => plan.server ? retryDenial("dev-server", "a dev server never returns, so start it in the background, owned by this session", plan.command) : retryDenial("heavy", "this heavy command runs under the machine-wide heavy-check lease", plan.command);
19615
19623
  var splitDenial = (plan) => ({
19616
19624
  kind: "deny",
19617
19625
  reason: plan.reason,
@@ -23591,7 +23599,7 @@ var standingDelta = (input) => {
23591
23599
  };
23592
23600
  var sinceStart = new Map;
23593
23601
  // packages/workit-core/src/hooks/cwd-normalize.ts
23594
- var DIR = String.raw`[A-Za-z0-9_./@%+:,=-]+|'[^'$${"`"}\\\n]*'|"[^"$${"`"}\\!\n]*"`;
23602
+ var DIR = String.raw`(?:[A-Za-z0-9_./@%+:,=-]|(?<=[A-Za-z0-9])~)+|'[^'$${"`"}\n]*'|"(?:[^"$${"`"}\\!\n]|\\(?=[^"$${"`"}\\!\n]))*"`;
23595
23603
  var COMPOUND2 = new RegExp(String.raw`^\s*cd\s+(${DIR})\s*&&\s*(workit(?:\s[\s\S]*)?)$`, "u");
23596
23604
  var GLOBALS_FIRST = new RegExp(String.raw`^(\s*workit)((?:\s+(?:--json|--cwd(?:=|\s+)(?:${DIR})))+)\s+([a-z][a-z-]*)(?=\s|$)`, "u");
23597
23605
  var VERB_FIRST = /^((?:--json\s+)*)([a-z][a-z-]*)(?=\s|$)/u;
@@ -24804,6 +24812,7 @@ function decide(input, deps) {
24804
24812
  return withContextLine(text ? { kind: "context", text } : NONE6, promptNudge(input, event.prompt));
24805
24813
  }
24806
24814
  case "shell.pre": {
24815
+ const auto = input.host === "claude_code" && input.permissionMode === "auto";
24807
24816
  const npx = npxWorkit(event.command);
24808
24817
  if (npx && workitOnPath()) {
24809
24818
  const canDeny = usable2(descriptor.shellPolicy.deny);
@@ -24815,6 +24824,8 @@ function decide(input, deps) {
24815
24824
  const plain = decide({ ...input, event: { ...event, command: npx } }, deps);
24816
24825
  if (plain.kind !== "none" && plain.kind !== "context")
24817
24826
  return plain;
24827
+ if (auto && canDeny)
24828
+ return retryDenial("npx", "workit is on PATH, so run it directly", npx);
24818
24829
  if (usable2(descriptor.shellPolicy.rewrite))
24819
24830
  return {
24820
24831
  kind: "rewrite",
@@ -24883,8 +24894,10 @@ function decide(input, deps) {
24883
24894
  const rewrites = usable2(descriptor.shellPolicy.rewrite);
24884
24895
  if (plan.kind === "rewrite" && !rewrites && canDeny)
24885
24896
  return heavyDenial(event.command, plan);
24897
+ if (plan.kind === "rewrite" && auto && canDeny)
24898
+ return autoRouteDenial(plan);
24886
24899
  const lease = plan.kind === "rewrite" && rewrites ? plan : null;
24887
- const cwdCommand = !lease && rewrites && input.host === "claude_code" ? cwdRewrite(event.command) ?? verbFirst(event.command) : null;
24900
+ const cwdCommand = !lease && rewrites && input.host === "claude_code" ? cwdRewrite(event.command) ?? (auto ? null : verbFirst(event.command)) : null;
24888
24901
  const aside = plan.kind === "passthrough" ? plan.note : null;
24889
24902
  noteRawCommit(input, event.command, postTool ? callKey(event.toolUseId, event.command) : NEXT_COMMAND);
24890
24903
  const bypass = !lease && input.host === "claude_code" ? workitBypassFlag(event.command, event.dialect) : null;
@@ -24905,8 +24918,11 @@ function decide(input, deps) {
24905
24918
  });
24906
24919
  const nudge = canDeny ? rawGitPre(input, event.command, { nudge: nudges }) : NONE6;
24907
24920
  const nudged = withContextLine(withContextLine(nudge, aside), shipNudge(input, event.command));
24908
- if (!lease)
24909
- return cwdCommand && nudged.kind !== "deny" ? rewritten(nudged.kind === "context" ? nudged.text : null) : nudged;
24921
+ if (!lease) {
24922
+ if (!cwdCommand || nudged.kind === "deny")
24923
+ return nudged;
24924
+ return auto ? retryDenial("cwd", "run one verb per call with --cwd", cwdCommand) : rewritten(nudged.kind === "context" ? nudged.text : null);
24925
+ }
24910
24926
  return rewritten([rewriteNote(lease), nudged.kind === "context" ? nudged.text : null].filter(Boolean).join(`
24911
24927
  `));
24912
24928
  }
@@ -101,7 +101,7 @@ if (quiet) {
101
101
  `);
102
102
  } else {
103
103
  try {
104
- const { runCodexHook } = await import("./workit-hook-0paqaefq.js");
104
+ const { runCodexHook } = await import("./workit-hook-vytacjkg.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.17.0",
3
+ "version": "2.18.0",
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.17.0",
45
- "@workit-dev/mcp": "^2.17.0"
44
+ "@workit-dev/core": "^2.18.0",
45
+ "@workit-dev/mcp": "^2.18.0"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=24"
@@ -13,7 +13,7 @@ and report the grant it names. PR creation does not start babysitting (a
13
13
  `green` or `merged` endpoint does), and a babysit request does not authorize
14
14
  merge: Stop at PR-ready (`babysit` `ready`) unless the user, or `merged` on a
15
15
  request that named no endpoint, set merge. `release publish` only if asked.
16
- Release: `workit release start <v>`, commits, `finish` (references/release.md).
16
+ Release: `workit release start <v>`, commits, `finish`; a repo that releases by pushing a tag: `workit release tag v<v>` (references/release.md).
17
17
 
18
18
  **Babysit endpoints.** After opening the PR keep babysitting without asking
19
19
  until CI is green, every thread is resolved and the verification gate is met;
@@ -48,3 +48,11 @@ A workspace `releasePackages` entry, after the workspace release finished:
48
48
  release commit (`--at <ref>`), pushes it, creates its forge release (not
49
49
  Latest; `--latest` only when asked) and verifies it. Notes:
50
50
  `workit release notes draft <name>@<version>`.
51
+
52
+ ## Release by tag (goreleaser and similar)
53
+
54
+ A repo whose workflow releases on a pushed `v<version>` tag: merge the
55
+ changelog roll (`## [<version>]`) by PR, then `workit release tag
56
+ v<version>` (never raw `git tag`). It refuses red CI, an existing tag or a
57
+ missing section, naming the fix; `--wait` (background) watches the release
58
+ workflow. Backfill notes: `workit release notes edit <tag> --from-changelog`.