@brainervirus/workit-cursor 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/.cursor-plugin/plugin.json +1 -1
- package/dist/cursor-session-start.js +32 -11
- package/dist/mcp-server.js +15 -1
- package/dist/workit-hook.js +31 -10
- package/package.json +3 -3
|
@@ -14811,9 +14811,22 @@ function detectedChecks(root) {
|
|
|
14811
14811
|
add(plain("test", ["make", "test"]));
|
|
14812
14812
|
return checks;
|
|
14813
14813
|
}
|
|
14814
|
+
function configFileFor(root) {
|
|
14815
|
+
const own = checksConfigFile(root);
|
|
14816
|
+
if (fs13.existsSync(own))
|
|
14817
|
+
return own;
|
|
14818
|
+
const common = git4(root, ["rev-parse", "--path-format=absolute", "--git-common-dir"]);
|
|
14819
|
+
if (!common || path18.basename(common) !== ".git")
|
|
14820
|
+
return own;
|
|
14821
|
+
const main = path18.dirname(common);
|
|
14822
|
+
if (path18.resolve(main) === path18.resolve(root))
|
|
14823
|
+
return own;
|
|
14824
|
+
const shared = checksConfigFile(main);
|
|
14825
|
+
return fs13.existsSync(shared) ? shared : own;
|
|
14826
|
+
}
|
|
14814
14827
|
function loadCheckConfig(cwd) {
|
|
14815
14828
|
const root = checkRoot(cwd);
|
|
14816
|
-
const file =
|
|
14829
|
+
const file = configFileFor(root);
|
|
14817
14830
|
const legacy = path18.basename(file) === LEGACY_CHECKS_FILE;
|
|
14818
14831
|
const label = legacy ? LEGACY_CHECKS_FILE : CHECKS_FILE;
|
|
14819
14832
|
const note = legacy ? {
|
|
@@ -18464,17 +18477,21 @@ function workitCheckTail(words) {
|
|
|
18464
18477
|
return null;
|
|
18465
18478
|
return args.slice(0, split).includes("--shell") ? { script: tail.join(" "), cwd } : { argv: tail, cwd };
|
|
18466
18479
|
}
|
|
18467
|
-
function simpleCommand(command, dialect = "posix", depth = 0) {
|
|
18480
|
+
function simpleCommand(command, dialect = "posix", depth = 0, shaped = false) {
|
|
18468
18481
|
let segments;
|
|
18469
18482
|
try {
|
|
18470
18483
|
segments = segmentsOf(command, dialect);
|
|
18471
18484
|
} catch {
|
|
18472
18485
|
return null;
|
|
18473
18486
|
}
|
|
18474
|
-
|
|
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)
|
|
18475
18492
|
return null;
|
|
18476
18493
|
const [segment] = segments;
|
|
18477
|
-
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)
|
|
18478
18495
|
return null;
|
|
18479
18496
|
const { words } = stripPrefixes(segment.words);
|
|
18480
18497
|
const name = commandName(words[0]);
|
|
@@ -18937,7 +18954,7 @@ var NONE2, SHELLS, POWERSHELLS, EVALS, WRAPPERS, WRAPPER_VALUES, KEYWORDS, DECLA
|
|
|
18937
18954
|
...Object.keys(env).length ? { env } : {},
|
|
18938
18955
|
...stdin === undefined ? {} : { stdin }
|
|
18939
18956
|
};
|
|
18940
|
-
}, 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) => {
|
|
18941
18958
|
if (destination === "HEAD" || destination === "@" || CURRENT_BRANCH.test(destination))
|
|
18942
18959
|
return { name: null };
|
|
18943
18960
|
if (destination.startsWith("refs/heads/"))
|
|
@@ -19631,6 +19648,7 @@ var init_raw_git = __esm(() => {
|
|
|
19631
19648
|
WORKIT_BIN = /(?:^|[\\/])workit(?:\.exe)?$|^@brainervirus\/workit-cli$/;
|
|
19632
19649
|
WORKIT_PACKAGE = /^@brainervirus\/workit-cli(?:@\S*)?$/;
|
|
19633
19650
|
PACKAGE_RUNNERS = new Set(["npx", "bunx", "pnpx"]);
|
|
19651
|
+
OUTPUT_FILTERS = new Set(["tail", "head", "grep"]);
|
|
19634
19652
|
WORKIT_GLOBAL = /^--(?:cwd|session|token|as)(=|$)/;
|
|
19635
19653
|
PUSH_VALUE_OPTIONS = new Set(["-o", "--push-option", "--receive-pack", "--exec", "--repo"]);
|
|
19636
19654
|
CURRENT_BRANCH = /^\$\(\s*git\s+(?:branch\s+--show-current|rev-parse\s+--abbrev-ref\s+HEAD|symbolic-ref\s+--short\s+HEAD)\s*\)$/;
|
|
@@ -20414,7 +20432,7 @@ function heavyPlan(command, options) {
|
|
|
20414
20432
|
const heavy = heavyLines(lines, options);
|
|
20415
20433
|
if (!heavy.length)
|
|
20416
20434
|
return { kind: "none" };
|
|
20417
|
-
const simple = simpleCommand(command, dialect);
|
|
20435
|
+
const simple = simpleCommand(command, dialect, 0, true);
|
|
20418
20436
|
const single = simple && !WORKIT.test(baseName2(simple[0])) && heavyLines([simple], options)[0];
|
|
20419
20437
|
const judged = single ? [{ words: lines.flat(), text: command }] : heavy.map((match) => ({
|
|
20420
20438
|
words: match.line,
|
|
@@ -20426,7 +20444,7 @@ function heavyPlan(command, options) {
|
|
|
20426
20444
|
if (!verdict.ok)
|
|
20427
20445
|
return {
|
|
20428
20446
|
kind: "passthrough",
|
|
20429
|
-
note:
|
|
20447
|
+
note: ""
|
|
20430
20448
|
};
|
|
20431
20449
|
}
|
|
20432
20450
|
if (single) {
|
|
@@ -20436,7 +20454,7 @@ function heavyPlan(command, options) {
|
|
|
20436
20454
|
const parts = heavy.map((match) => leaseCommand(match.line));
|
|
20437
20455
|
return {
|
|
20438
20456
|
kind: "split",
|
|
20439
|
-
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" : ""}.`,
|
|
20440
20458
|
unblock: parts[0] ?? null
|
|
20441
20459
|
};
|
|
20442
20460
|
}
|
|
@@ -22648,12 +22666,15 @@ ${subagentStartText({ ...input, cwd: "" }, descriptor, event)}`;
|
|
|
22648
22666
|
return readOnly;
|
|
22649
22667
|
const own = subagentSession(session, event.agentId);
|
|
22650
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.`;
|
|
22651
22674
|
const token = session ? recordIssuedSession(cwd, session, own) : null;
|
|
22652
22675
|
if (session && !token)
|
|
22653
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.`;
|
|
22654
|
-
const
|
|
22655
|
-
const line = verdictCommand({ branch: judgeBranch(cwd), judge, session: own, token });
|
|
22656
|
-
const pick = judge === "verifier" ? ", --kind live when you drove the real surface" : "";
|
|
22677
|
+
const line = verdictCommand({ branch, judge, session: own, token });
|
|
22657
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." : ""}`;
|
|
22658
22679
|
}, PRE_TOOL, failureDecision = (descriptor, event, error) => {
|
|
22659
22680
|
if (event === "shell.pre" || event === "tool.pre" || event === "write.pre")
|
package/dist/mcp-server.js
CHANGED
|
@@ -21645,9 +21645,22 @@ function detectedChecks(root) {
|
|
|
21645
21645
|
return checks;
|
|
21646
21646
|
}
|
|
21647
21647
|
var GATES = ["testing", "verification"];
|
|
21648
|
+
function configFileFor(root) {
|
|
21649
|
+
const own = checksConfigFile(root);
|
|
21650
|
+
if (fs11.existsSync(own))
|
|
21651
|
+
return own;
|
|
21652
|
+
const common = git3(root, ["rev-parse", "--path-format=absolute", "--git-common-dir"]);
|
|
21653
|
+
if (!common || path13.basename(common) !== ".git")
|
|
21654
|
+
return own;
|
|
21655
|
+
const main = path13.dirname(common);
|
|
21656
|
+
if (path13.resolve(main) === path13.resolve(root))
|
|
21657
|
+
return own;
|
|
21658
|
+
const shared = checksConfigFile(main);
|
|
21659
|
+
return fs11.existsSync(shared) ? shared : own;
|
|
21660
|
+
}
|
|
21648
21661
|
function loadCheckConfig(cwd) {
|
|
21649
21662
|
const root = checkRoot(cwd);
|
|
21650
|
-
const file =
|
|
21663
|
+
const file = configFileFor(root);
|
|
21651
21664
|
const legacy = path13.basename(file) === LEGACY_CHECKS_FILE;
|
|
21652
21665
|
const label = legacy ? LEGACY_CHECKS_FILE : CHECKS_FILE;
|
|
21653
21666
|
const note = legacy ? {
|
|
@@ -24561,6 +24574,7 @@ var LAUNCHERS = new Set([
|
|
|
24561
24574
|
"command"
|
|
24562
24575
|
]);
|
|
24563
24576
|
var PACKAGE_RUNNERS = new Set(["npx", "bunx", "pnpx"]);
|
|
24577
|
+
var OUTPUT_FILTERS = new Set(["tail", "head", "grep"]);
|
|
24564
24578
|
var PUSH_VALUE_OPTIONS = new Set(["-o", "--push-option", "--receive-pack", "--exec", "--repo"]);
|
|
24565
24579
|
var VALUE_OPTIONS = {
|
|
24566
24580
|
git: new Set([
|
package/dist/workit-hook.js
CHANGED
|
@@ -14853,9 +14853,22 @@ function detectedChecks(root) {
|
|
|
14853
14853
|
return checks;
|
|
14854
14854
|
}
|
|
14855
14855
|
var GATES = ["testing", "verification"];
|
|
14856
|
+
function configFileFor(root) {
|
|
14857
|
+
const own = checksConfigFile(root);
|
|
14858
|
+
if (fs13.existsSync(own))
|
|
14859
|
+
return own;
|
|
14860
|
+
const common = git4(root, ["rev-parse", "--path-format=absolute", "--git-common-dir"]);
|
|
14861
|
+
if (!common || path18.basename(common) !== ".git")
|
|
14862
|
+
return own;
|
|
14863
|
+
const main = path18.dirname(common);
|
|
14864
|
+
if (path18.resolve(main) === path18.resolve(root))
|
|
14865
|
+
return own;
|
|
14866
|
+
const shared = checksConfigFile(main);
|
|
14867
|
+
return fs13.existsSync(shared) ? shared : own;
|
|
14868
|
+
}
|
|
14856
14869
|
function loadCheckConfig(cwd) {
|
|
14857
14870
|
const root = checkRoot(cwd);
|
|
14858
|
-
const file =
|
|
14871
|
+
const file = configFileFor(root);
|
|
14859
14872
|
const legacy = path18.basename(file) === LEGACY_CHECKS_FILE;
|
|
14860
14873
|
const label = legacy ? LEGACY_CHECKS_FILE : CHECKS_FILE;
|
|
14861
14874
|
const note = legacy ? {
|
|
@@ -18941,17 +18954,22 @@ function workitCheckTail(words) {
|
|
|
18941
18954
|
return null;
|
|
18942
18955
|
return args.slice(0, split).includes("--shell") ? { script: tail.join(" "), cwd } : { argv: tail, cwd };
|
|
18943
18956
|
}
|
|
18944
|
-
|
|
18957
|
+
var OUTPUT_FILTERS = new Set(["tail", "head", "grep"]);
|
|
18958
|
+
function simpleCommand(command, dialect = "posix", depth = 0, shaped = false) {
|
|
18945
18959
|
let segments;
|
|
18946
18960
|
try {
|
|
18947
18961
|
segments = segmentsOf(command, dialect);
|
|
18948
18962
|
} catch {
|
|
18949
18963
|
return null;
|
|
18950
18964
|
}
|
|
18951
|
-
|
|
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)
|
|
18952
18970
|
return null;
|
|
18953
18971
|
const [segment] = segments;
|
|
18954
|
-
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)
|
|
18955
18973
|
return null;
|
|
18956
18974
|
const { words } = stripPrefixes(segment.words);
|
|
18957
18975
|
const name = commandName(words[0]);
|
|
@@ -20726,7 +20744,7 @@ function heavyPlan(command, options) {
|
|
|
20726
20744
|
const heavy = heavyLines(lines, options);
|
|
20727
20745
|
if (!heavy.length)
|
|
20728
20746
|
return { kind: "none" };
|
|
20729
|
-
const simple = simpleCommand(command, dialect);
|
|
20747
|
+
const simple = simpleCommand(command, dialect, 0, true);
|
|
20730
20748
|
const single = simple && !WORKIT.test(baseName2(simple[0])) && heavyLines([simple], options)[0];
|
|
20731
20749
|
const judged = single ? [{ words: lines.flat(), text: command }] : heavy.map((match) => ({
|
|
20732
20750
|
words: match.line,
|
|
@@ -20738,7 +20756,7 @@ function heavyPlan(command, options) {
|
|
|
20738
20756
|
if (!verdict.ok)
|
|
20739
20757
|
return {
|
|
20740
20758
|
kind: "passthrough",
|
|
20741
|
-
note:
|
|
20759
|
+
note: ""
|
|
20742
20760
|
};
|
|
20743
20761
|
}
|
|
20744
20762
|
if (single) {
|
|
@@ -20748,7 +20766,7 @@ function heavyPlan(command, options) {
|
|
|
20748
20766
|
const parts = heavy.map((match) => leaseCommand(match.line));
|
|
20749
20767
|
return {
|
|
20750
20768
|
kind: "split",
|
|
20751
|
-
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" : ""}.`,
|
|
20752
20770
|
unblock: parts[0] ?? null
|
|
20753
20771
|
};
|
|
20754
20772
|
}
|
|
@@ -22758,12 +22776,15 @@ ${subagentStartText({ ...input, cwd: "" }, descriptor, event)}`;
|
|
|
22758
22776
|
return readOnly;
|
|
22759
22777
|
const own = subagentSession(session, event.agentId);
|
|
22760
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.`;
|
|
22761
22784
|
const token = session ? recordIssuedSession(cwd, session, own) : null;
|
|
22762
22785
|
if (session && !token)
|
|
22763
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.`;
|
|
22764
|
-
const
|
|
22765
|
-
const line = verdictCommand({ branch: judgeBranch(cwd), judge, session: own, token });
|
|
22766
|
-
const pick = judge === "verifier" ? ", --kind live when you drove the real surface" : "";
|
|
22787
|
+
const line = verdictCommand({ branch, judge, session: own, token });
|
|
22767
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." : ""}`;
|
|
22768
22789
|
};
|
|
22769
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.
|
|
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.
|
|
50
|
-
"@brainervirus/workit-mcp": "^8.
|
|
49
|
+
"@brainervirus/workit-core": "^8.29.1",
|
|
50
|
+
"@brainervirus/workit-mcp": "^8.29.1"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=24"
|