@brainervirus/workit-cursor 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/.cursor-plugin/plugin.json +1 -1
- package/dist/cursor-session-start.js +18 -10
- package/dist/mcp-server.js +1 -0
- package/dist/workit-hook.js +17 -9
- package/package.json +3 -3
|
@@ -18477,17 +18477,21 @@ function workitCheckTail(words) {
|
|
|
18477
18477
|
return null;
|
|
18478
18478
|
return args.slice(0, split).includes("--shell") ? { script: tail.join(" "), cwd } : { argv: tail, cwd };
|
|
18479
18479
|
}
|
|
18480
|
-
function simpleCommand(command, dialect = "posix", depth = 0) {
|
|
18480
|
+
function simpleCommand(command, dialect = "posix", depth = 0, shaped = false) {
|
|
18481
18481
|
let segments;
|
|
18482
18482
|
try {
|
|
18483
18483
|
segments = segmentsOf(command, dialect);
|
|
18484
18484
|
} catch {
|
|
18485
18485
|
return null;
|
|
18486
18486
|
}
|
|
18487
|
-
|
|
18487
|
+
const filter = shaped && segments.length === 2 ? segments[1] : null;
|
|
18488
|
+
if (filter) {
|
|
18489
|
+
if (!segments[0].pipe || !OUTPUT_FILTERS.has(commandName(filter.words[0])) || filter.group || filter.pipe || filter.unanalyzable || filter.subs?.length || filter.stdin?.length)
|
|
18490
|
+
return null;
|
|
18491
|
+
} else if (segments.length !== 1)
|
|
18488
18492
|
return null;
|
|
18489
18493
|
const [segment] = segments;
|
|
18490
|
-
if (segment.group || segment.pipe || segment.unanalyzable || segment.redirects.length || segment.subs?.length || segment.stdin?.length)
|
|
18494
|
+
if (segment.group || segment.pipe && !filter || segment.unanalyzable || segment.redirects.length && !shaped || segment.subs?.length || segment.stdin?.length)
|
|
18491
18495
|
return null;
|
|
18492
18496
|
const { words } = stripPrefixes(segment.words);
|
|
18493
18497
|
const name = commandName(words[0]);
|
|
@@ -18950,7 +18954,7 @@ var NONE2, SHELLS, POWERSHELLS, EVALS, WRAPPERS, WRAPPER_VALUES, KEYWORDS, DECLA
|
|
|
18950
18954
|
...Object.keys(env).length ? { env } : {},
|
|
18951
18955
|
...stdin === undefined ? {} : { stdin }
|
|
18952
18956
|
};
|
|
18953
|
-
}, RECENT, LAUNCHERS, WORKIT_BIN, WORKIT_PACKAGE, PACKAGE_RUNNERS, WORKIT_GLOBAL, PUSH_VALUE_OPTIONS, CURRENT_BRANCH, pushDestination = (destination) => {
|
|
18957
|
+
}, RECENT, LAUNCHERS, WORKIT_BIN, WORKIT_PACKAGE, PACKAGE_RUNNERS, OUTPUT_FILTERS, WORKIT_GLOBAL, PUSH_VALUE_OPTIONS, CURRENT_BRANCH, pushDestination = (destination) => {
|
|
18954
18958
|
if (destination === "HEAD" || destination === "@" || CURRENT_BRANCH.test(destination))
|
|
18955
18959
|
return { name: null };
|
|
18956
18960
|
if (destination.startsWith("refs/heads/"))
|
|
@@ -19644,6 +19648,7 @@ var init_raw_git = __esm(() => {
|
|
|
19644
19648
|
WORKIT_BIN = /(?:^|[\\/])workit(?:\.exe)?$|^@brainervirus\/workit-cli$/;
|
|
19645
19649
|
WORKIT_PACKAGE = /^@brainervirus\/workit-cli(?:@\S*)?$/;
|
|
19646
19650
|
PACKAGE_RUNNERS = new Set(["npx", "bunx", "pnpx"]);
|
|
19651
|
+
OUTPUT_FILTERS = new Set(["tail", "head", "grep"]);
|
|
19647
19652
|
WORKIT_GLOBAL = /^--(?:cwd|session|token|as)(=|$)/;
|
|
19648
19653
|
PUSH_VALUE_OPTIONS = new Set(["-o", "--push-option", "--receive-pack", "--exec", "--repo"]);
|
|
19649
19654
|
CURRENT_BRANCH = /^\$\(\s*git\s+(?:branch\s+--show-current|rev-parse\s+--abbrev-ref\s+HEAD|symbolic-ref\s+--short\s+HEAD)\s*\)$/;
|
|
@@ -20427,7 +20432,7 @@ function heavyPlan(command, options) {
|
|
|
20427
20432
|
const heavy = heavyLines(lines, options);
|
|
20428
20433
|
if (!heavy.length)
|
|
20429
20434
|
return { kind: "none" };
|
|
20430
|
-
const simple = simpleCommand(command, dialect);
|
|
20435
|
+
const simple = simpleCommand(command, dialect, 0, true);
|
|
20431
20436
|
const single = simple && !WORKIT.test(baseName2(simple[0])) && heavyLines([simple], options)[0];
|
|
20432
20437
|
const judged = single ? [{ words: lines.flat(), text: command }] : heavy.map((match) => ({
|
|
20433
20438
|
words: match.line,
|
|
@@ -20439,7 +20444,7 @@ function heavyPlan(command, options) {
|
|
|
20439
20444
|
if (!verdict.ok)
|
|
20440
20445
|
return {
|
|
20441
20446
|
kind: "passthrough",
|
|
20442
|
-
note:
|
|
20447
|
+
note: ""
|
|
20443
20448
|
};
|
|
20444
20449
|
}
|
|
20445
20450
|
if (single) {
|
|
@@ -20449,7 +20454,7 @@ function heavyPlan(command, options) {
|
|
|
20449
20454
|
const parts = heavy.map((match) => leaseCommand(match.line));
|
|
20450
20455
|
return {
|
|
20451
20456
|
kind: "split",
|
|
20452
|
-
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
|
|
20457
|
+
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" : ""}.`,
|
|
20453
20458
|
unblock: parts[0] ?? null
|
|
20454
20459
|
};
|
|
20455
20460
|
}
|
|
@@ -22661,12 +22666,15 @@ ${subagentStartText({ ...input, cwd: "" }, descriptor, event)}`;
|
|
|
22661
22666
|
return readOnly;
|
|
22662
22667
|
const own = subagentSession(session, event.agentId);
|
|
22663
22668
|
const cwd = input.cwd || process.cwd();
|
|
22669
|
+
const judge = event.agentType.endsWith("reviewer") ? "reviewer" : "verifier";
|
|
22670
|
+
const pick = judge === "verifier" ? ", --kind live when you drove the real surface" : "";
|
|
22671
|
+
const branch = judgeBranch(cwd);
|
|
22672
|
+
if (descriptor.host === "codex_cli" || descriptor.host === "codex_desktop")
|
|
22673
|
+
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.`;
|
|
22664
22674
|
const token = session ? recordIssuedSession(cwd, session, own) : null;
|
|
22665
22675
|
if (session && !token)
|
|
22666
22676
|
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.`;
|
|
22667
|
-
const
|
|
22668
|
-
const line = verdictCommand({ branch: judgeBranch(cwd), judge, session: own, token });
|
|
22669
|
-
const pick = judge === "verifier" ? ", --kind live when you drove the real surface" : "";
|
|
22677
|
+
const line = verdictCommand({ branch, judge, session: own, token });
|
|
22670
22678
|
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." : ""}`;
|
|
22671
22679
|
}, PRE_TOOL, failureDecision = (descriptor, event, error) => {
|
|
22672
22680
|
if (event === "shell.pre" || event === "tool.pre" || event === "write.pre")
|
package/dist/mcp-server.js
CHANGED
|
@@ -24574,6 +24574,7 @@ var LAUNCHERS = new Set([
|
|
|
24574
24574
|
"command"
|
|
24575
24575
|
]);
|
|
24576
24576
|
var PACKAGE_RUNNERS = new Set(["npx", "bunx", "pnpx"]);
|
|
24577
|
+
var OUTPUT_FILTERS = new Set(["tail", "head", "grep"]);
|
|
24577
24578
|
var PUSH_VALUE_OPTIONS = new Set(["-o", "--push-option", "--receive-pack", "--exec", "--repo"]);
|
|
24578
24579
|
var VALUE_OPTIONS = {
|
|
24579
24580
|
git: new Set([
|
package/dist/workit-hook.js
CHANGED
|
@@ -18954,17 +18954,22 @@ function workitCheckTail(words) {
|
|
|
18954
18954
|
return null;
|
|
18955
18955
|
return args.slice(0, split).includes("--shell") ? { script: tail.join(" "), cwd } : { argv: tail, cwd };
|
|
18956
18956
|
}
|
|
18957
|
-
|
|
18957
|
+
var OUTPUT_FILTERS = new Set(["tail", "head", "grep"]);
|
|
18958
|
+
function simpleCommand(command, dialect = "posix", depth = 0, shaped = false) {
|
|
18958
18959
|
let segments;
|
|
18959
18960
|
try {
|
|
18960
18961
|
segments = segmentsOf(command, dialect);
|
|
18961
18962
|
} catch {
|
|
18962
18963
|
return null;
|
|
18963
18964
|
}
|
|
18964
|
-
|
|
18965
|
+
const filter = shaped && segments.length === 2 ? segments[1] : null;
|
|
18966
|
+
if (filter) {
|
|
18967
|
+
if (!segments[0].pipe || !OUTPUT_FILTERS.has(commandName(filter.words[0])) || filter.group || filter.pipe || filter.unanalyzable || filter.subs?.length || filter.stdin?.length)
|
|
18968
|
+
return null;
|
|
18969
|
+
} else if (segments.length !== 1)
|
|
18965
18970
|
return null;
|
|
18966
18971
|
const [segment] = segments;
|
|
18967
|
-
if (segment.group || segment.pipe || segment.unanalyzable || segment.redirects.length || segment.subs?.length || segment.stdin?.length)
|
|
18972
|
+
if (segment.group || segment.pipe && !filter || segment.unanalyzable || segment.redirects.length && !shaped || segment.subs?.length || segment.stdin?.length)
|
|
18968
18973
|
return null;
|
|
18969
18974
|
const { words } = stripPrefixes(segment.words);
|
|
18970
18975
|
const name = commandName(words[0]);
|
|
@@ -20739,7 +20744,7 @@ function heavyPlan(command, options) {
|
|
|
20739
20744
|
const heavy = heavyLines(lines, options);
|
|
20740
20745
|
if (!heavy.length)
|
|
20741
20746
|
return { kind: "none" };
|
|
20742
|
-
const simple = simpleCommand(command, dialect);
|
|
20747
|
+
const simple = simpleCommand(command, dialect, 0, true);
|
|
20743
20748
|
const single = simple && !WORKIT.test(baseName2(simple[0])) && heavyLines([simple], options)[0];
|
|
20744
20749
|
const judged = single ? [{ words: lines.flat(), text: command }] : heavy.map((match) => ({
|
|
20745
20750
|
words: match.line,
|
|
@@ -20751,7 +20756,7 @@ function heavyPlan(command, options) {
|
|
|
20751
20756
|
if (!verdict.ok)
|
|
20752
20757
|
return {
|
|
20753
20758
|
kind: "passthrough",
|
|
20754
|
-
note:
|
|
20759
|
+
note: ""
|
|
20755
20760
|
};
|
|
20756
20761
|
}
|
|
20757
20762
|
if (single) {
|
|
@@ -20761,7 +20766,7 @@ function heavyPlan(command, options) {
|
|
|
20761
20766
|
const parts = heavy.map((match) => leaseCommand(match.line));
|
|
20762
20767
|
return {
|
|
20763
20768
|
kind: "split",
|
|
20764
|
-
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
|
|
20769
|
+
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" : ""}.`,
|
|
20765
20770
|
unblock: parts[0] ?? null
|
|
20766
20771
|
};
|
|
20767
20772
|
}
|
|
@@ -22771,12 +22776,15 @@ ${subagentStartText({ ...input, cwd: "" }, descriptor, event)}`;
|
|
|
22771
22776
|
return readOnly;
|
|
22772
22777
|
const own = subagentSession(session, event.agentId);
|
|
22773
22778
|
const cwd = input.cwd || process.cwd();
|
|
22779
|
+
const judge = event.agentType.endsWith("reviewer") ? "reviewer" : "verifier";
|
|
22780
|
+
const pick = judge === "verifier" ? ", --kind live when you drove the real surface" : "";
|
|
22781
|
+
const branch = judgeBranch(cwd);
|
|
22782
|
+
if (descriptor.host === "codex_cli" || descriptor.host === "codex_desktop")
|
|
22783
|
+
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.`;
|
|
22774
22784
|
const token = session ? recordIssuedSession(cwd, session, own) : null;
|
|
22775
22785
|
if (session && !token)
|
|
22776
22786
|
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.`;
|
|
22777
|
-
const
|
|
22778
|
-
const line = verdictCommand({ branch: judgeBranch(cwd), judge, session: own, token });
|
|
22779
|
-
const pick = judge === "verifier" ? ", --kind live when you drove the real surface" : "";
|
|
22787
|
+
const line = verdictCommand({ branch, judge, session: own, token });
|
|
22780
22788
|
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." : ""}`;
|
|
22781
22789
|
};
|
|
22782
22790
|
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-cursor",
|
|
3
|
-
"version": "8.29.
|
|
3
|
+
"version": "8.29.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit Cursor plugin — shared MCP transport, native hooks, and sixteen method skills",
|
|
6
6
|
"keywords": [
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"build": "bun scripts/build.ts"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@brainervirus/workit-core": "^8.29.
|
|
50
|
-
"@brainervirus/workit-mcp": "^8.29.
|
|
49
|
+
"@brainervirus/workit-core": "^8.29.1",
|
|
50
|
+
"@brainervirus/workit-mcp": "^8.29.1"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=24"
|