@brainervirus/workit-pi 8.29.0 → 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 +1 -0
- package/dist/workit.js +17 -9
- package/package.json +1 -1
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
|
@@ -17280,17 +17280,22 @@ function workitCheckTail(words) {
|
|
|
17280
17280
|
return null;
|
|
17281
17281
|
return args.slice(0, split).includes("--shell") ? { script: tail.join(" "), cwd } : { argv: tail, cwd };
|
|
17282
17282
|
}
|
|
17283
|
-
|
|
17283
|
+
var OUTPUT_FILTERS = new Set(["tail", "head", "grep"]);
|
|
17284
|
+
function simpleCommand(command, dialect = "posix", depth = 0, shaped = false) {
|
|
17284
17285
|
let segments;
|
|
17285
17286
|
try {
|
|
17286
17287
|
segments = segmentsOf(command, dialect);
|
|
17287
17288
|
} catch {
|
|
17288
17289
|
return null;
|
|
17289
17290
|
}
|
|
17290
|
-
|
|
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)
|
|
17291
17296
|
return null;
|
|
17292
17297
|
const [segment] = segments;
|
|
17293
|
-
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)
|
|
17294
17299
|
return null;
|
|
17295
17300
|
const { words } = stripPrefixes(segment.words);
|
|
17296
17301
|
const name = commandName(words[0]);
|
|
@@ -22424,7 +22429,7 @@ function heavyPlan(command, options) {
|
|
|
22424
22429
|
const heavy = heavyLines(lines, options);
|
|
22425
22430
|
if (!heavy.length)
|
|
22426
22431
|
return { kind: "none" };
|
|
22427
|
-
const simple = simpleCommand(command, dialect);
|
|
22432
|
+
const simple = simpleCommand(command, dialect, 0, true);
|
|
22428
22433
|
const single = simple && !WORKIT.test(baseName2(simple[0])) && heavyLines([simple], options)[0];
|
|
22429
22434
|
const judged = single ? [{ words: lines.flat(), text: command }] : heavy.map((match) => ({
|
|
22430
22435
|
words: match.line,
|
|
@@ -22436,7 +22441,7 @@ function heavyPlan(command, options) {
|
|
|
22436
22441
|
if (!verdict.ok)
|
|
22437
22442
|
return {
|
|
22438
22443
|
kind: "passthrough",
|
|
22439
|
-
note:
|
|
22444
|
+
note: ""
|
|
22440
22445
|
};
|
|
22441
22446
|
}
|
|
22442
22447
|
if (single) {
|
|
@@ -22446,7 +22451,7 @@ function heavyPlan(command, options) {
|
|
|
22446
22451
|
const parts = heavy.map((match) => leaseCommand(match.line));
|
|
22447
22452
|
return {
|
|
22448
22453
|
kind: "split",
|
|
22449
|
-
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
|
|
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" : ""}.`,
|
|
22450
22455
|
unblock: parts[0] ?? null
|
|
22451
22456
|
};
|
|
22452
22457
|
}
|
|
@@ -24424,12 +24429,15 @@ ${subagentStartText({ ...input, cwd: "" }, descriptor, event)}`;
|
|
|
24424
24429
|
return readOnly;
|
|
24425
24430
|
const own = subagentSession(session, event.agentId);
|
|
24426
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.`;
|
|
24427
24437
|
const token = session ? recordIssuedSession(cwd, session, own) : null;
|
|
24428
24438
|
if (session && !token)
|
|
24429
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.`;
|
|
24430
|
-
const
|
|
24431
|
-
const line = verdictCommand({ branch: judgeBranch(cwd), judge, session: own, token });
|
|
24432
|
-
const pick = judge === "verifier" ? ", --kind live when you drove the real surface" : "";
|
|
24440
|
+
const line = verdictCommand({ branch, judge, session: own, token });
|
|
24433
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." : ""}`;
|
|
24434
24442
|
};
|
|
24435
24443
|
var PRE_TOOL = new Set(["shell.pre", "write.pre", "tool.pre"]);
|