@workit-dev/pi 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.
package/dist/workit.js CHANGED
@@ -25938,6 +25938,14 @@ var heavyDenial = (original, plan) => ({
25938
25938
  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}`,
25939
25939
  unblock: plan.command
25940
25940
  });
25941
+ var retryDenial = (gate, what, retry) => ({
25942
+ kind: "deny",
25943
+ reason: `workit ${gate}: ${what}.
25944
+ Retry as: ${retry}
25945
+ Why: Claude Code auto mode refuses a call whose input a hook changed.`,
25946
+ unblock: retry
25947
+ });
25948
+ 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);
25941
25949
  var splitDenial = (plan) => ({
25942
25950
  kind: "deny",
25943
25951
  reason: plan.reason,
@@ -30093,7 +30101,7 @@ var standingDelta = (input) => {
30093
30101
  };
30094
30102
  var sinceStart = new Map;
30095
30103
  // packages/workit-core/src/hooks/cwd-normalize.ts
30096
- var DIR = String.raw`[A-Za-z0-9_./@%+:,=-]+|'[^'$${"`"}\\\n]*'|"[^"$${"`"}\\!\n]*"`;
30104
+ var DIR = String.raw`(?:[A-Za-z0-9_./@%+:,=-]|(?<=[A-Za-z0-9])~)+|'[^'$${"`"}\n]*'|"(?:[^"$${"`"}\\!\n]|\\(?=[^"$${"`"}\\!\n]))*"`;
30097
30105
  var COMPOUND2 = new RegExp(String.raw`^\s*cd\s+(${DIR})\s*&&\s*(workit(?:\s[\s\S]*)?)$`, "u");
30098
30106
  var GLOBALS_FIRST = new RegExp(String.raw`^(\s*workit)((?:\s+(?:--json|--cwd(?:=|\s+)(?:${DIR})))+)\s+([a-z][a-z-]*)(?=\s|$)`, "u");
30099
30107
  var VERB_FIRST = /^((?:--json\s+)*)([a-z][a-z-]*)(?=\s|$)/u;
@@ -31427,6 +31435,7 @@ function decide(input, deps) {
31427
31435
  return withContextLine(text ? { kind: "context", text } : NONE6, promptNudge(input, event.prompt));
31428
31436
  }
31429
31437
  case "shell.pre": {
31438
+ const auto = input.host === "claude_code" && input.permissionMode === "auto";
31430
31439
  const npx = npxWorkit(event.command);
31431
31440
  if (npx && workitOnPath2()) {
31432
31441
  const canDeny = usable2(descriptor.shellPolicy.deny);
@@ -31438,6 +31447,8 @@ function decide(input, deps) {
31438
31447
  const plain = decide({ ...input, event: { ...event, command: npx } }, deps);
31439
31448
  if (plain.kind !== "none" && plain.kind !== "context")
31440
31449
  return plain;
31450
+ if (auto && canDeny)
31451
+ return retryDenial("npx", "workit is on PATH, so run it directly", npx);
31441
31452
  if (usable2(descriptor.shellPolicy.rewrite))
31442
31453
  return {
31443
31454
  kind: "rewrite",
@@ -31506,8 +31517,10 @@ function decide(input, deps) {
31506
31517
  const rewrites = usable2(descriptor.shellPolicy.rewrite);
31507
31518
  if (plan.kind === "rewrite" && !rewrites && canDeny)
31508
31519
  return heavyDenial(event.command, plan);
31520
+ if (plan.kind === "rewrite" && auto && canDeny)
31521
+ return autoRouteDenial(plan);
31509
31522
  const lease = plan.kind === "rewrite" && rewrites ? plan : null;
31510
- const cwdCommand = !lease && rewrites && input.host === "claude_code" ? cwdRewrite(event.command) ?? verbFirst(event.command) : null;
31523
+ const cwdCommand = !lease && rewrites && input.host === "claude_code" ? cwdRewrite(event.command) ?? (auto ? null : verbFirst(event.command)) : null;
31511
31524
  const aside = plan.kind === "passthrough" ? plan.note : null;
31512
31525
  noteRawCommit(input, event.command, postTool ? callKey(event.toolUseId, event.command) : NEXT_COMMAND);
31513
31526
  const bypass = !lease && input.host === "claude_code" ? workitBypassFlag(event.command, event.dialect) : null;
@@ -31528,8 +31541,11 @@ function decide(input, deps) {
31528
31541
  });
31529
31542
  const nudge = canDeny ? rawGitPre(input, event.command, { nudge: nudges }) : NONE6;
31530
31543
  const nudged = withContextLine(withContextLine(nudge, aside), shipNudge(input, event.command));
31531
- if (!lease)
31532
- return cwdCommand && nudged.kind !== "deny" ? rewritten(nudged.kind === "context" ? nudged.text : null) : nudged;
31544
+ if (!lease) {
31545
+ if (!cwdCommand || nudged.kind === "deny")
31546
+ return nudged;
31547
+ return auto ? retryDenial("cwd", "run one verb per call with --cwd", cwdCommand) : rewritten(nudged.kind === "context" ? nudged.text : null);
31548
+ }
31533
31549
  return rewritten([rewriteNote(lease), nudged.kind === "context" ? nudged.text : null].filter(Boolean).join(`
31534
31550
  `));
31535
31551
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/pi",
3
- "version": "2.17.0",
3
+ "version": "2.18.0",
4
4
  "description": "Workit native extension for Pi — tools, method skills, and session continuity",
5
5
  "keywords": [
6
6
  "agentic-coding",
@@ -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`.