@brainervirus/workit-cursor 8.15.0 → 8.16.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/.cursor-plugin/plugin.json +1 -1
- package/dist/cursor-session-start.js +54 -1
- package/dist/mcp-server.js +63 -1
- package/dist/workit-hook.js +57 -0
- package/package.json +3 -3
|
@@ -15648,6 +15648,42 @@ function evaluateClosure(requestedOutcome, view) {
|
|
|
15648
15648
|
requirementIds: evaluations.map((item) => item.requirementId)
|
|
15649
15649
|
});
|
|
15650
15650
|
}
|
|
15651
|
+
function boundTaskSummary(summary) {
|
|
15652
|
+
const rules = new Map((summary.policy?.requirements ?? []).map((item) => [item.id, item]));
|
|
15653
|
+
const unmet = summary.requirements.filter((item) => item.status === "unsatisfied" || item.status === "unavailable");
|
|
15654
|
+
const { progress, closure } = summary;
|
|
15655
|
+
const next = progress.nextAction;
|
|
15656
|
+
const open = unmet.slice(0, BRIEF_OPEN).map((item) => ({
|
|
15657
|
+
dimension: rules.get(item.requirementId)?.dimension ?? "verification",
|
|
15658
|
+
before: rules.get(item.requirementId)?.before ?? "close",
|
|
15659
|
+
status: item.status
|
|
15660
|
+
}));
|
|
15661
|
+
const brief = {
|
|
15662
|
+
id: summary.id,
|
|
15663
|
+
revision: summary.revision,
|
|
15664
|
+
workspaceRevision: summary.workspaceRevision,
|
|
15665
|
+
updatedAt: summary.updatedAt,
|
|
15666
|
+
objective: clip(summary.objective),
|
|
15667
|
+
status: summary.status,
|
|
15668
|
+
closure: closure && {
|
|
15669
|
+
outcome: closure.outcome,
|
|
15670
|
+
at: closure.at,
|
|
15671
|
+
summary: clip(closure.summary)
|
|
15672
|
+
},
|
|
15673
|
+
progress: {
|
|
15674
|
+
summary: clip(progress.summary),
|
|
15675
|
+
nextAction: next && clip(next),
|
|
15676
|
+
blockers: progress.blockers.slice(0, BRIEF_BLOCKERS).map((item) => ({
|
|
15677
|
+
reason: clip(item.reason),
|
|
15678
|
+
dependentAction: clip(item.dependentAction)
|
|
15679
|
+
}))
|
|
15680
|
+
},
|
|
15681
|
+
requirements: { total: summary.requirements.length, unmet: unmet.length, open },
|
|
15682
|
+
truncated: false
|
|
15683
|
+
};
|
|
15684
|
+
brief.truncated = JSON.stringify(brief).includes("…") || progress.blockers.length > BRIEF_BLOCKERS || unmet.length > BRIEF_OPEN;
|
|
15685
|
+
return brief;
|
|
15686
|
+
}
|
|
15651
15687
|
var digestBytes = (value) => createHash10("sha256").update(value).digest("hex"), inside = (root, candidate) => candidate === root || candidate.startsWith(`${root}${path17.sep}`), relative = (root, candidate) => path17.relative(root, candidate).split(path17.sep).join("/") || ".", canonicalPath = (value) => {
|
|
15652
15688
|
if (typeof value !== "string" || !value)
|
|
15653
15689
|
return null;
|
|
@@ -15867,7 +15903,15 @@ var digestBytes = (value) => createHash10("sha256").update(value).digest("hex"),
|
|
|
15867
15903
|
if (dimension === "decisions")
|
|
15868
15904
|
return "decision";
|
|
15869
15905
|
return "worker report";
|
|
15870
|
-
}, observedGate = (requirement) => (requirement.dimension === "testing" || requirement.dimension === "verification") && requirement.before === "close"
|
|
15906
|
+
}, observedGate = (requirement) => (requirement.dimension === "testing" || requirement.dimension === "verification") && requirement.before === "close", BRIEF_TEXT = 250, BRIEF_BLOCKERS = 3, BRIEF_OPEN = 8, clip = (value) => {
|
|
15907
|
+
const fits = (text) => Buffer.byteLength(JSON.stringify(text)) <= BRIEF_TEXT;
|
|
15908
|
+
if (fits(value))
|
|
15909
|
+
return value;
|
|
15910
|
+
let length = Math.min(value.length, BRIEF_TEXT);
|
|
15911
|
+
while (length > 0 && !fits(`${value.slice(0, length)}…`))
|
|
15912
|
+
length -= 1;
|
|
15913
|
+
return `${value.slice(0, length)}…`;
|
|
15914
|
+
};
|
|
15871
15915
|
var init_task_evaluation = __esm(() => {
|
|
15872
15916
|
init_task_contract();
|
|
15873
15917
|
init_check_config();
|
|
@@ -16294,6 +16338,15 @@ class WorkitCore {
|
|
|
16294
16338
|
if (!parsed.ok)
|
|
16295
16339
|
return parsed;
|
|
16296
16340
|
const input = parsed.data;
|
|
16341
|
+
if (this.context.readOnlyChild) {
|
|
16342
|
+
if (input.action !== "inspect")
|
|
16343
|
+
return failure2("permission_denied", "child sessions can only inspect the task summary");
|
|
16344
|
+
const task = this.store.readTask(input.taskId);
|
|
16345
|
+
if (!task.ok)
|
|
16346
|
+
return task;
|
|
16347
|
+
const summary = this.summary(task.data);
|
|
16348
|
+
return summary.ok ? { ...summary, data: boundTaskSummary(summary.data) } : summary;
|
|
16349
|
+
}
|
|
16297
16350
|
if ((this.context.workerId ?? null) !== null) {
|
|
16298
16351
|
if (input.action !== "inspect" && input.action !== "list")
|
|
16299
16352
|
return failure2("permission_denied", "helpers cannot control task lifecycle or scope");
|
package/dist/mcp-server.js
CHANGED
|
@@ -24790,6 +24790,58 @@ function evaluateClosure(requestedOutcome, view) {
|
|
|
24790
24790
|
requirementIds: evaluations.map((item) => item.requirementId)
|
|
24791
24791
|
});
|
|
24792
24792
|
}
|
|
24793
|
+
var BRIEF_TEXT = 250;
|
|
24794
|
+
var BRIEF_BLOCKERS = 3;
|
|
24795
|
+
var BRIEF_OPEN = 8;
|
|
24796
|
+
var clip = (value) => {
|
|
24797
|
+
const fits = (text) => Buffer.byteLength(JSON.stringify(text)) <= BRIEF_TEXT;
|
|
24798
|
+
if (fits(value))
|
|
24799
|
+
return value;
|
|
24800
|
+
let length = Math.min(value.length, BRIEF_TEXT);
|
|
24801
|
+
while (length > 0 && !fits(`${value.slice(0, length)}…`))
|
|
24802
|
+
length -= 1;
|
|
24803
|
+
return `${value.slice(0, length)}…`;
|
|
24804
|
+
};
|
|
24805
|
+
function boundTaskSummary(summary) {
|
|
24806
|
+
const rules = new Map((summary.policy?.requirements ?? []).map((item) => [item.id, item]));
|
|
24807
|
+
const unmet = summary.requirements.filter((item) => item.status === "unsatisfied" || item.status === "unavailable");
|
|
24808
|
+
const { progress, closure } = summary;
|
|
24809
|
+
const next = progress.nextAction;
|
|
24810
|
+
const open = unmet.slice(0, BRIEF_OPEN).map((item) => ({
|
|
24811
|
+
dimension: rules.get(item.requirementId)?.dimension ?? "verification",
|
|
24812
|
+
before: rules.get(item.requirementId)?.before ?? "close",
|
|
24813
|
+
status: item.status
|
|
24814
|
+
}));
|
|
24815
|
+
const brief = {
|
|
24816
|
+
id: summary.id,
|
|
24817
|
+
revision: summary.revision,
|
|
24818
|
+
workspaceRevision: summary.workspaceRevision,
|
|
24819
|
+
updatedAt: summary.updatedAt,
|
|
24820
|
+
objective: clip(summary.objective),
|
|
24821
|
+
status: summary.status,
|
|
24822
|
+
closure: closure && {
|
|
24823
|
+
outcome: closure.outcome,
|
|
24824
|
+
at: closure.at,
|
|
24825
|
+
summary: clip(closure.summary)
|
|
24826
|
+
},
|
|
24827
|
+
progress: {
|
|
24828
|
+
summary: clip(progress.summary),
|
|
24829
|
+
nextAction: next && clip(next),
|
|
24830
|
+
blockers: progress.blockers.slice(0, BRIEF_BLOCKERS).map((item) => ({
|
|
24831
|
+
reason: clip(item.reason),
|
|
24832
|
+
dependentAction: clip(item.dependentAction)
|
|
24833
|
+
}))
|
|
24834
|
+
},
|
|
24835
|
+
requirements: { total: summary.requirements.length, unmet: unmet.length, open },
|
|
24836
|
+
truncated: false
|
|
24837
|
+
};
|
|
24838
|
+
brief.truncated = JSON.stringify(brief).includes("…") || progress.blockers.length > BRIEF_BLOCKERS || unmet.length > BRIEF_OPEN;
|
|
24839
|
+
return brief;
|
|
24840
|
+
}
|
|
24841
|
+
function briefInspectResult(request, result) {
|
|
24842
|
+
const { action, view } = request ?? {};
|
|
24843
|
+
return result.ok && action === "inspect" && (view ?? "summary") === "summary" ? { ...result, data: boundTaskSummary(result.data) } : result;
|
|
24844
|
+
}
|
|
24793
24845
|
|
|
24794
24846
|
// packages/workit-core/src/core/methods.ts
|
|
24795
24847
|
var METHODS = {
|
|
@@ -26050,6 +26102,15 @@ class WorkitCore {
|
|
|
26050
26102
|
if (!parsed.ok)
|
|
26051
26103
|
return parsed;
|
|
26052
26104
|
const input = parsed.data;
|
|
26105
|
+
if (this.context.readOnlyChild) {
|
|
26106
|
+
if (input.action !== "inspect")
|
|
26107
|
+
return failure2("permission_denied", "child sessions can only inspect the task summary");
|
|
26108
|
+
const task = this.store.readTask(input.taskId);
|
|
26109
|
+
if (!task.ok)
|
|
26110
|
+
return task;
|
|
26111
|
+
const summary = this.summary(task.data);
|
|
26112
|
+
return summary.ok ? { ...summary, data: boundTaskSummary(summary.data) } : summary;
|
|
26113
|
+
}
|
|
26053
26114
|
if ((this.context.workerId ?? null) !== null) {
|
|
26054
26115
|
if (input.action !== "inspect" && input.action !== "list")
|
|
26055
26116
|
return failure2("permission_denied", "helpers cannot control task lifecycle or scope");
|
|
@@ -28487,7 +28548,8 @@ function createMcpServer(host, contextProvider) {
|
|
|
28487
28548
|
}, workspaceRoot);
|
|
28488
28549
|
const core = new WorkitCore(new TaskStore(context.root), context);
|
|
28489
28550
|
const run = core[family];
|
|
28490
|
-
|
|
28551
|
+
const result = run.call(core, parsed.data);
|
|
28552
|
+
return resultForClient(family === "task" && context.callerAttested !== true ? briefInspectResult(parsed.data, result) : result, workspaceRoot);
|
|
28491
28553
|
} catch (error) {
|
|
28492
28554
|
return thrownResult(toolName, error, workspaceRoot);
|
|
28493
28555
|
}
|
package/dist/workit-hook.js
CHANGED
|
@@ -15935,6 +15935,54 @@ function evaluateClosure(requestedOutcome, view) {
|
|
|
15935
15935
|
requirementIds: evaluations.map((item) => item.requirementId)
|
|
15936
15936
|
});
|
|
15937
15937
|
}
|
|
15938
|
+
var BRIEF_TEXT = 250;
|
|
15939
|
+
var BRIEF_BLOCKERS = 3;
|
|
15940
|
+
var BRIEF_OPEN = 8;
|
|
15941
|
+
var clip = (value) => {
|
|
15942
|
+
const fits = (text) => Buffer.byteLength(JSON.stringify(text)) <= BRIEF_TEXT;
|
|
15943
|
+
if (fits(value))
|
|
15944
|
+
return value;
|
|
15945
|
+
let length = Math.min(value.length, BRIEF_TEXT);
|
|
15946
|
+
while (length > 0 && !fits(`${value.slice(0, length)}…`))
|
|
15947
|
+
length -= 1;
|
|
15948
|
+
return `${value.slice(0, length)}…`;
|
|
15949
|
+
};
|
|
15950
|
+
function boundTaskSummary(summary) {
|
|
15951
|
+
const rules = new Map((summary.policy?.requirements ?? []).map((item) => [item.id, item]));
|
|
15952
|
+
const unmet = summary.requirements.filter((item) => item.status === "unsatisfied" || item.status === "unavailable");
|
|
15953
|
+
const { progress, closure } = summary;
|
|
15954
|
+
const next = progress.nextAction;
|
|
15955
|
+
const open = unmet.slice(0, BRIEF_OPEN).map((item) => ({
|
|
15956
|
+
dimension: rules.get(item.requirementId)?.dimension ?? "verification",
|
|
15957
|
+
before: rules.get(item.requirementId)?.before ?? "close",
|
|
15958
|
+
status: item.status
|
|
15959
|
+
}));
|
|
15960
|
+
const brief = {
|
|
15961
|
+
id: summary.id,
|
|
15962
|
+
revision: summary.revision,
|
|
15963
|
+
workspaceRevision: summary.workspaceRevision,
|
|
15964
|
+
updatedAt: summary.updatedAt,
|
|
15965
|
+
objective: clip(summary.objective),
|
|
15966
|
+
status: summary.status,
|
|
15967
|
+
closure: closure && {
|
|
15968
|
+
outcome: closure.outcome,
|
|
15969
|
+
at: closure.at,
|
|
15970
|
+
summary: clip(closure.summary)
|
|
15971
|
+
},
|
|
15972
|
+
progress: {
|
|
15973
|
+
summary: clip(progress.summary),
|
|
15974
|
+
nextAction: next && clip(next),
|
|
15975
|
+
blockers: progress.blockers.slice(0, BRIEF_BLOCKERS).map((item) => ({
|
|
15976
|
+
reason: clip(item.reason),
|
|
15977
|
+
dependentAction: clip(item.dependentAction)
|
|
15978
|
+
}))
|
|
15979
|
+
},
|
|
15980
|
+
requirements: { total: summary.requirements.length, unmet: unmet.length, open },
|
|
15981
|
+
truncated: false
|
|
15982
|
+
};
|
|
15983
|
+
brief.truncated = JSON.stringify(brief).includes("…") || progress.blockers.length > BRIEF_BLOCKERS || unmet.length > BRIEF_OPEN;
|
|
15984
|
+
return brief;
|
|
15985
|
+
}
|
|
15938
15986
|
|
|
15939
15987
|
// packages/workit-core/src/core/methods.ts
|
|
15940
15988
|
var METHODS = {
|
|
@@ -16732,6 +16780,15 @@ class WorkitCore {
|
|
|
16732
16780
|
if (!parsed.ok)
|
|
16733
16781
|
return parsed;
|
|
16734
16782
|
const input = parsed.data;
|
|
16783
|
+
if (this.context.readOnlyChild) {
|
|
16784
|
+
if (input.action !== "inspect")
|
|
16785
|
+
return failure2("permission_denied", "child sessions can only inspect the task summary");
|
|
16786
|
+
const task = this.store.readTask(input.taskId);
|
|
16787
|
+
if (!task.ok)
|
|
16788
|
+
return task;
|
|
16789
|
+
const summary = this.summary(task.data);
|
|
16790
|
+
return summary.ok ? { ...summary, data: boundTaskSummary(summary.data) } : summary;
|
|
16791
|
+
}
|
|
16735
16792
|
if ((this.context.workerId ?? null) !== null) {
|
|
16736
16793
|
if (input.action !== "inspect" && input.action !== "list")
|
|
16737
16794
|
return failure2("permission_denied", "helpers cannot control task lifecycle or scope");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-cursor",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.16.0",
|
|
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.16.0",
|
|
50
|
+
"@brainervirus/workit-mcp": "^8.16.0"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=24"
|