@brainervirus/workit-pi 8.28.1 → 8.29.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.
package/dist/worker.js CHANGED
@@ -7988,6 +7988,7 @@ var LAUNCHERS = new Set([
7988
7988
  "command"
7989
7989
  ]);
7990
7990
  var PACKAGE_RUNNERS = new Set(["npx", "bunx", "pnpx"]);
7991
+ var OUTPUT_FILTERS = new Set(["tail", "head", "grep"]);
7991
7992
  var PUSH_VALUE_OPTIONS = new Set(["-o", "--push-option", "--receive-pack", "--exec", "--repo"]);
7992
7993
  var VALUE_OPTIONS = {
7993
7994
  git: new Set([
package/dist/workit.js CHANGED
@@ -13141,9 +13141,22 @@ function detectedChecks(root) {
13141
13141
  return checks;
13142
13142
  }
13143
13143
  var GATES = ["testing", "verification"];
13144
+ function configFileFor(root) {
13145
+ const own = checksConfigFile(root);
13146
+ if (fs11.existsSync(own))
13147
+ return own;
13148
+ const common = git3(root, ["rev-parse", "--path-format=absolute", "--git-common-dir"]);
13149
+ if (!common || path13.basename(common) !== ".git")
13150
+ return own;
13151
+ const main = path13.dirname(common);
13152
+ if (path13.resolve(main) === path13.resolve(root))
13153
+ return own;
13154
+ const shared = checksConfigFile(main);
13155
+ return fs11.existsSync(shared) ? shared : own;
13156
+ }
13144
13157
  function loadCheckConfig(cwd) {
13145
13158
  const root = checkRoot(cwd);
13146
- const file = checksConfigFile(root);
13159
+ const file = configFileFor(root);
13147
13160
  const legacy = path13.basename(file) === LEGACY_CHECKS_FILE;
13148
13161
  const label = legacy ? LEGACY_CHECKS_FILE : CHECKS_FILE;
13149
13162
  const note = legacy ? {
@@ -17267,17 +17280,22 @@ function workitCheckTail(words) {
17267
17280
  return null;
17268
17281
  return args.slice(0, split).includes("--shell") ? { script: tail.join(" "), cwd } : { argv: tail, cwd };
17269
17282
  }
17270
- function simpleCommand(command, dialect = "posix", depth = 0) {
17283
+ var OUTPUT_FILTERS = new Set(["tail", "head", "grep"]);
17284
+ function simpleCommand(command, dialect = "posix", depth = 0, shaped = false) {
17271
17285
  let segments;
17272
17286
  try {
17273
17287
  segments = segmentsOf(command, dialect);
17274
17288
  } catch {
17275
17289
  return null;
17276
17290
  }
17277
- if (segments.length !== 1)
17291
+ const filter = shaped && segments.length === 2 ? segments[1] : null;
17292
+ if (filter) {
17293
+ if (!segments[0].pipe || !OUTPUT_FILTERS.has(commandName(filter.words[0])) || filter.group || filter.pipe || filter.unanalyzable || filter.subs?.length || filter.stdin?.length)
17294
+ return null;
17295
+ } else if (segments.length !== 1)
17278
17296
  return null;
17279
17297
  const [segment] = segments;
17280
- if (segment.group || segment.pipe || segment.unanalyzable || segment.redirects.length || segment.subs?.length || segment.stdin?.length)
17298
+ if (segment.group || segment.pipe && !filter || segment.unanalyzable || segment.redirects.length && !shaped || segment.subs?.length || segment.stdin?.length)
17281
17299
  return null;
17282
17300
  const { words } = stripPrefixes(segment.words);
17283
17301
  const name = commandName(words[0]);
@@ -22411,7 +22429,7 @@ function heavyPlan(command, options) {
22411
22429
  const heavy = heavyLines(lines, options);
22412
22430
  if (!heavy.length)
22413
22431
  return { kind: "none" };
22414
- const simple = simpleCommand(command, dialect);
22432
+ const simple = simpleCommand(command, dialect, 0, true);
22415
22433
  const single = simple && !WORKIT.test(baseName2(simple[0])) && heavyLines([simple], options)[0];
22416
22434
  const judged = single ? [{ words: lines.flat(), text: command }] : heavy.map((match) => ({
22417
22435
  words: match.line,
@@ -22423,7 +22441,7 @@ function heavyPlan(command, options) {
22423
22441
  if (!verdict.ok)
22424
22442
  return {
22425
22443
  kind: "passthrough",
22426
- note: `workit: \`${command.trim()}\` is heavy but runs outside the heavy-check lease because a host permission rule names it (or \`workit\` is allowlisted); the host decides.`
22444
+ note: ""
22427
22445
  };
22428
22446
  }
22429
22447
  if (single) {
@@ -22433,7 +22451,7 @@ function heavyPlan(command, options) {
22433
22451
  const parts = heavy.map((match) => leaseCommand(match.line));
22434
22452
  return {
22435
22453
  kind: "split",
22436
- reason: `heavy_command: \`${command.trim()}\` chains heavy work (${heavy.map((match) => match.reason).join("; ")}) with other commands, and a chain cannot run under the machine-wide heavy-check lease. Run each heavy part alone as \`workit check --heavy -- <segment>\` (here: ${parts.map((part) => `\`${part}\``).join("; ")}); run the other parts as their own commands.`,
22454
+ reason: `heavy_command: \`${command.trim()}\` chains heavy work (${heavy.map((match) => match.reason).join("; ")}) with other commands, and a chain cannot run under the machine-wide heavy-check lease. Run the heavy part alone, now: \`${parts[0]}\`; then run the other parts as their own commands${parts.length > 1 ? ", each heavy one the same way" : ""}.`,
22437
22455
  unblock: parts[0] ?? null
22438
22456
  };
22439
22457
  }
@@ -24411,12 +24429,15 @@ ${subagentStartText({ ...input, cwd: "" }, descriptor, event)}`;
24411
24429
  return readOnly;
24412
24430
  const own = subagentSession(session, event.agentId);
24413
24431
  const cwd = input.cwd || process.cwd();
24432
+ const judge = event.agentType.endsWith("reviewer") ? "reviewer" : "verifier";
24433
+ const pick = judge === "verifier" ? ", --kind live when you drove the real surface" : "";
24434
+ const branch = judgeBranch(cwd);
24435
+ if (descriptor.host === "codex_cli" || descriptor.host === "codex_desktop")
24436
+ return `${readOnly} Its shell already acts as its own Workit session, so the ledger tells its verdicts apart from the author's. Record the verdict with exactly this command (pick the result${pick}, name the candidate branch if it differs, say what you ran): \`${verdictCommand({ branch, judge })}\`. Add no session or token option to it, and never set WORKIT_SESSION_ID by hand.`;
24414
24437
  const token = session ? recordIssuedSession(cwd, session, own) : null;
24415
24438
  if (session && !token)
24416
24439
  return `${readOnly} ${own} was already issued to an earlier subagent, so no token is handed out again and a verdict under it would be refused (unbound_session). Record no verdict as ${own}: spawn a fresh verifier or reviewer, which gets its own session and token.`;
24417
- const judge = event.agentType.endsWith("reviewer") ? "reviewer" : "verifier";
24418
- const line = verdictCommand({ branch: judgeBranch(cwd), judge, session: own, token });
24419
- const pick = judge === "verifier" ? ", --kind live when you drove the real surface" : "";
24440
+ const line = verdictCommand({ branch, judge, session: own, token });
24420
24441
  return `${readOnly} Its own Workit session is ${own}, so the ledger tells its verdicts apart from the author's. Record the verdict with exactly this command (pick the result${pick}, name the candidate branch if it differs, say what you ran): \`${line}\`.${token ? " The token is this subagent's alone: never write it into a report, a file or a commit. --token needs a workit CLI at least as new as this plugin; if the CLI answers that --token is an unknown option, update the workit CLI (workit upgrade --cli) and record again." : ""}`;
24421
24442
  };
24422
24443
  var PRE_TOOL = new Set(["shell.pre", "write.pre", "tool.pre"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-pi",
3
- "version": "8.28.1",
3
+ "version": "8.29.1",
4
4
  "description": "Workit native extension for Pi — tools, method skills, and session continuity",
5
5
  "keywords": [
6
6
  "agentic-coding",