@workit-dev/codex 2.4.4 → 2.5.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.4.4",
3
+ "version": "2.5.0",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -30860,6 +30860,17 @@ var writeTargets = (input) => {
30860
30860
  var REQUEST_TTL_MS = 30 * 60000;
30861
30861
  var GRANT_TTL_MS = 15 * 60000;
30862
30862
  var ASKING_HOSTS = new Set(["claude_code", "pi"]);
30863
+ var INLINE_ASK_TTL_MS = 2 * 60000;
30864
+
30865
+ // packages/workit-core/src/approvals/youtrack-ask.ts
30866
+ var TIME = "markdown file minutes text date";
30867
+ var FLAGS = {
30868
+ note: TIME,
30869
+ time: TIME,
30870
+ meeting: TIME,
30871
+ update: `${TIME} attach state command`,
30872
+ create: "project summary description file attach command"
30873
+ };
30863
30874
 
30864
30875
  // packages/workit-core/src/hooks/hosts/claude-code.ts
30865
30876
  var CLAUDE_CODE_DESCRIPTOR = {
@@ -30968,7 +30979,7 @@ var CONTEXT_EVENTS = new Set([
30968
30979
  "PreToolUse",
30969
30980
  "PostToolUse"
30970
30981
  ]);
30971
- var ASKING_MODES = new Set(["default", "acceptEdits", "plan"]);
30982
+ var ASKING_MODES = new Set(["default", "acceptEdits", "plan", "auto"]);
30972
30983
 
30973
30984
  // packages/workit-core/src/hooks/hosts/codex.ts
30974
30985
  function detectCodexSurface(env) {
@@ -31151,7 +31162,8 @@ var protocolEvent = (input) => {
31151
31162
  kind: "write.pre",
31152
31163
  tool: input.tool_name,
31153
31164
  paths: writeTargets(input.tool_input),
31154
- toolUseId
31165
+ toolUseId,
31166
+ text: JSON.stringify(input.tool_input)
31155
31167
  };
31156
31168
  return { kind: "tool.pre", tool: input.tool_name, toolUseId };
31157
31169
  }
@@ -21689,6 +21689,9 @@ var GRANT_TTL_MS = 15 * 60000;
21689
21689
  var ID_PATTERN = /^ap_[a-z2-7]{8}$/u;
21690
21690
  var isApprovalId = (word) => ID_PATTERN.test(word);
21691
21691
  var ASKING_HOSTS = new Set(["claude_code", "pi"]);
21692
+ var INLINE_ASK_TTL_MS = 2 * 60000;
21693
+ var namesTicket = (text) => /WORKIT_APPROVAL_(?:TICKET|UNASKED)/u.test(text.replace(/['"\\]/gu, ""));
21694
+ var TICKET_DENY = "Only the host's prompt adds an approval ticket.";
21692
21695
 
21693
21696
  // packages/workit-core/src/approvals/call.ts
21694
21697
  var isWorkitWord2 = (word) => /^(?:.*[\\/])?workit(?:-cli)?$/u.test(word);
@@ -21731,6 +21734,16 @@ var approveCallIn = (command, dialect = "posix") => {
21731
21734
  };
21732
21735
  var approveCallDeny = (fix) => `Run \`${fix}\` as its own call: no chain, pipe, substitution, leading cd, env prefix or redirect around it, so the host can show the request and record the user's answer.`;
21733
21736
 
21737
+ // packages/workit-core/src/approvals/youtrack-ask.ts
21738
+ var TIME = "markdown file minutes text date";
21739
+ var FLAGS = {
21740
+ note: TIME,
21741
+ time: TIME,
21742
+ meeting: TIME,
21743
+ update: `${TIME} attach state command`,
21744
+ create: "project summary description file attach command"
21745
+ };
21746
+
21734
21747
  // packages/workit-core/src/hooks/hosts/claude-code.ts
21735
21748
  var CLAUDE_CODE_DESCRIPTOR = {
21736
21749
  host: "claude_code",
@@ -21838,7 +21851,7 @@ var CONTEXT_EVENTS = new Set([
21838
21851
  "PreToolUse",
21839
21852
  "PostToolUse"
21840
21853
  ]);
21841
- var ASKING_MODES = new Set(["default", "acceptEdits", "plan"]);
21854
+ var ASKING_MODES = new Set(["default", "acceptEdits", "plan", "auto"]);
21842
21855
 
21843
21856
  // packages/workit-core/src/hooks/hosts/codex.ts
21844
21857
  function detectCodexSurface(env) {
@@ -22021,7 +22034,8 @@ var protocolEvent = (input) => {
22021
22034
  kind: "write.pre",
22022
22035
  tool: input.tool_name,
22023
22036
  paths: writeTargets(input.tool_input),
22024
- toolUseId
22037
+ toolUseId,
22038
+ text: JSON.stringify(input.tool_input)
22025
22039
  };
22026
22040
  return { kind: "tool.pre", tool: input.tool_name, toolUseId };
22027
22041
  }
@@ -24088,7 +24102,13 @@ var SHELLS3 = /^(?:sh|bash|zsh|dash|ksh|ash|mksh|yash|fish)$/;
24088
24102
  var MAX_DEPTH2 = 4;
24089
24103
  var READ = new Map;
24090
24104
  var NOT_PLAIN = gap("a ytrack call that is not a plain command of its own (a wrapper, loop, substitution or script around it can change or repeat it)");
24091
- var ungrant = (write) => write.workit ? { command: write.command, ...NOT_PLAIN } : write;
24105
+ var timeOnly = (effect) => effect?.minutes !== undefined && Object.keys(effect).every((key) => /^(?:issue|minutes|text|date)$/u.test(key));
24106
+ var ungrant = (write) => write.workit ? {
24107
+ command: write.command,
24108
+ ...NOT_PLAIN,
24109
+ ...timeOnly(write.effect) ? { hint: write.workit } : {}
24110
+ } : write;
24111
+ var hinted = (write) => write.hint ? { command: write.command, workit: write.hint } : write;
24092
24112
  var ytrackArgs = (line, found, depth, names, plain) => {
24093
24113
  const inner = (script) => void found.push(...ytrackWrites(script, "posix", depth + 1, plain));
24094
24114
  const tail = workitCheckTail(line);
@@ -24222,6 +24242,7 @@ var ytrackWrites = (command, dialect = "posix", depth = 0, plain = true) => {
24222
24242
  found = [];
24223
24243
  for (const line of commandLines(command, dialect))
24224
24244
  ytrackArgs(line, found, depth, aliases(command), false);
24245
+ found = found.map(hinted);
24225
24246
  }
24226
24247
  READ.set(key, found);
24227
24248
  if (READ.size > 64)
@@ -24229,6 +24250,8 @@ var ytrackWrites = (command, dialect = "posix", depth = 0, plain = true) => {
24229
24250
  return found;
24230
24251
  };
24231
24252
  var ytrackGate = (cwd, command, dialect, ask) => {
24253
+ if (namesTicket(command))
24254
+ return { kind: "deny", reason: TICKET_DENY, unblock: null };
24232
24255
  let writes;
24233
24256
  try {
24234
24257
  const merged = new Map;
@@ -24256,8 +24279,8 @@ var ytrackGate = (cwd, command, dialect, ask) => {
24256
24279
  reason: `${bare.join(", ")} writes to YouTrack: the user decides this call (#780).`
24257
24280
  };
24258
24281
  const why = `A raw ytrack write posts to YouTrack without the user's yes (#780).`;
24259
- const run = calls.length ? ` Run ${calls.join(", then ")} instead: it asks the user first. When it answers approval_needed, run exactly the \`workit approve <id>\` it names, now, with nothing around it (no 2>&1, pipe or echo), so the host asks the user; then rerun the workit call once.` : "";
24260
- const user = bare.length ? ` For ${bare.join(", ")}, the user decides: ask the user, and if they agree they run it in their own terminal.` : "";
24282
+ const run = calls.length ? ` Run ${calls.join(", then ")} instead, each as its own plain call: it asks the user first.` : "";
24283
+ const user = bare.length ? ask ? ` For ${bare.join(", ")}, run it as its own plain call: the host asks the user.` : ` For ${bare.join(", ")}, the user decides: ask the user, and if they agree they run it in their own terminal.` : "";
24261
24284
  const rerun = writes.some((write) => write.gap === NOT_PLAIN.gap) ? " To get the named workit youtrack call instead, rerun the ytrack call as one plain command, with no wrapper, loop, substitution or script around it." : "";
24262
24285
  return {
24263
24286
  kind: "deny",
@@ -24475,6 +24498,8 @@ function decide(input, deps) {
24475
24498
  case "write.pre": {
24476
24499
  if (!usable2(descriptor.events["write.pre"].support))
24477
24500
  return NONE6;
24501
+ if (event.text && namesTicket(event.text))
24502
+ return { kind: "deny", reason: TICKET_DENY, unblock: null };
24478
24503
  const role = agentRole(input, descriptor);
24479
24504
  if (role) {
24480
24505
  const targets = liveTargets(input.cwd, event.paths);
@@ -98,7 +98,7 @@ if (quiet) {
98
98
  `);
99
99
  } else {
100
100
  try {
101
- const { runCodexHook } = await import("./workit-hook-2zdknydg.js");
101
+ const { runCodexHook } = await import("./workit-hook-74basyv3.js");
102
102
  await runCodexHook([payload]);
103
103
  } catch (error) {
104
104
  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.4.4",
3
+ "version": "2.5.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.4.4",
45
- "@workit-dev/mcp": "^2.4.4"
44
+ "@workit-dev/core": "^2.5.0",
45
+ "@workit-dev/mcp": "^2.5.0"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=24"