@brainervirus/workit-cursor 1.0.10 → 1.0.11
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 +15 -7
- package/dist/mcp-server.js +12 -6
- package/dist/workit-hook.js +12 -6
- package/package.json +3 -3
|
@@ -7795,10 +7795,11 @@ var init_task_contract = __esm(() => {
|
|
|
7795
7795
|
presented: text,
|
|
7796
7796
|
approvedContent: text,
|
|
7797
7797
|
displayed: text.optional(),
|
|
7798
|
-
contentRefs: array(refSchema)
|
|
7798
|
+
contentRefs: array(refSchema),
|
|
7799
|
+
statedChoice: object({ ref: text, text }).strict().optional()
|
|
7799
7800
|
}).strict(),
|
|
7800
7801
|
digest,
|
|
7801
|
-
response: _enum(["approved", "rejected"]),
|
|
7802
|
+
response: _enum(["approved", "rejected", "stated"]),
|
|
7802
7803
|
requirementIds: array(digest),
|
|
7803
7804
|
revoked: object({ at: utc, reason: text }).strict().nullable(),
|
|
7804
7805
|
consumption: object({
|
|
@@ -10403,7 +10404,7 @@ function evaluateRequirements(task, workspace, capabilities, candidate, checkout
|
|
|
10403
10404
|
status: "satisfied",
|
|
10404
10405
|
evidenceIds: [],
|
|
10405
10406
|
decisionIds: decisions.map((decision) => decision.id),
|
|
10406
|
-
reason: "an applicable approved decision satisfies the requirement"
|
|
10407
|
+
reason: "an applicable approved or stated decision satisfies the requirement"
|
|
10407
10408
|
};
|
|
10408
10409
|
const limitations = requirement.acceptanceAllowed ? applicableDecision2(task, workspace, requirement, checkoutRoot) : [];
|
|
10409
10410
|
if (limitations.length)
|
|
@@ -10611,7 +10612,7 @@ var digestBytes3 = (value) => createHash4("sha256").update(value).digest("hex"),
|
|
|
10611
10612
|
}, sameSession = (left, right) => {
|
|
10612
10613
|
const other = sessionFromRef(right);
|
|
10613
10614
|
return left !== null && other !== null && left.host === other.host && left.handle === other.handle;
|
|
10614
|
-
}, evidenceScopes = (task, ids) => (task.policy?.requirements ?? []).filter((requirement) => ids.includes(requirement.id)).map((requirement) => requirement.scope), scopeCovers2, applicableDecision2 = (task, workspace, requirement, checkoutRoot) => task.decisions.filter((entry) => entry.provenance.kind !== "imported").map((entry) => entry.data).filter((decision) => decision.purpose === "limitation" && decision.response === "approved" && decision.revoked === null && decision.binding.taskId === task.id && decision.binding.workspaceId === workspace.id && decision.requirementIds.includes(requirement.id) && decision.binding.scope && scopeCovers2(decision.binding.scope, requirement.scope) && decision.digest === decisionDigest(decision) && (checkoutRoot ? verifyDecisionContentAtRoot(checkoutRoot, decision.binding).ok : decision.binding.contentRefs.every((reference) => reference.kind !== "file"))), applicableRequirementDecision = (task, workspace, requirement, checkoutRoot) => task.decisions.filter(({ data, provenance }) => provenance.kind !== "imported" && data.purpose !== "limitation" && data.response === "approved" && data.revoked === null && data.binding.taskId === task.id && data.binding.workspaceId === workspace.id && data.requirementIds.includes(requirement.id) && scopeCovers2(data.binding.scope, requirement.scope) && data.digest === decisionDigest(data) && (checkoutRoot ? verifyDecisionContentAtRoot(checkoutRoot, data.binding).ok : data.binding.contentRefs.every((reference) => reference.kind !== "file"))).map(({ id }) => ({ id })), evidenceMatchesRequirement = (kind, evidenceKind, dimension) => {
|
|
10615
|
+
}, evidenceScopes = (task, ids) => (task.policy?.requirements ?? []).filter((requirement) => ids.includes(requirement.id)).map((requirement) => requirement.scope), scopeCovers2, applicableDecision2 = (task, workspace, requirement, checkoutRoot) => task.decisions.filter((entry) => entry.provenance.kind !== "imported").map((entry) => entry.data).filter((decision) => decision.purpose === "limitation" && decision.response === "approved" && decision.revoked === null && decision.binding.taskId === task.id && decision.binding.workspaceId === workspace.id && decision.requirementIds.includes(requirement.id) && decision.binding.scope && scopeCovers2(decision.binding.scope, requirement.scope) && decision.digest === decisionDigest(decision) && (checkoutRoot ? verifyDecisionContentAtRoot(checkoutRoot, decision.binding).ok : decision.binding.contentRefs.every((reference) => reference.kind !== "file"))), applicableRequirementDecision = (task, workspace, requirement, checkoutRoot) => task.decisions.filter(({ data, provenance }) => provenance.kind !== "imported" && data.purpose !== "limitation" && (data.response === "approved" || data.response === "stated") && data.revoked === null && data.binding.taskId === task.id && data.binding.workspaceId === workspace.id && data.requirementIds.includes(requirement.id) && scopeCovers2(data.binding.scope, requirement.scope) && data.digest === decisionDigest(data) && (checkoutRoot ? verifyDecisionContentAtRoot(checkoutRoot, data.binding).ok : data.binding.contentRefs.every((reference) => reference.kind !== "file"))).map(({ id }) => ({ id })), evidenceMatchesRequirement = (kind, evidenceKind, dimension) => {
|
|
10615
10616
|
if (kind !== "passed")
|
|
10616
10617
|
return false;
|
|
10617
10618
|
if (dimension === "testing" || dimension === "verification")
|
|
@@ -10832,7 +10833,9 @@ var init_task_context = __esm(() => {
|
|
|
10832
10833
|
});
|
|
10833
10834
|
|
|
10834
10835
|
// packages/workit-core/src/core/route-intent.ts
|
|
10835
|
-
var init_route_intent = () => {
|
|
10836
|
+
var init_route_intent = __esm(() => {
|
|
10837
|
+
init_task_store();
|
|
10838
|
+
});
|
|
10836
10839
|
|
|
10837
10840
|
// packages/workit-core/src/core/external-action.ts
|
|
10838
10841
|
var externalActionSchema;
|
|
@@ -11622,7 +11625,12 @@ class WorkitCore {
|
|
|
11622
11625
|
const input = parsed.data;
|
|
11623
11626
|
if (nativeRequired && input.action !== "record")
|
|
11624
11627
|
return failure("permission_denied", "native observation is only valid for recording decisions");
|
|
11625
|
-
|
|
11628
|
+
const stated = input.action === "record" && input.response === "stated";
|
|
11629
|
+
if (stated && input.purpose === "action")
|
|
11630
|
+
return failure("permission_denied", "stated choices cannot authorize mutating actions");
|
|
11631
|
+
if (stated && !input.binding?.statedChoice)
|
|
11632
|
+
return failure("invalid_input", "stated choices require binding.statedChoice");
|
|
11633
|
+
if (nativeRequired && nativeObservation === undefined && !stated)
|
|
11626
11634
|
return failure("permission_denied", "native decision observation is required");
|
|
11627
11635
|
const task = this.store.readTask(input.taskId);
|
|
11628
11636
|
if (!task.ok)
|
|
@@ -11655,7 +11663,7 @@ class WorkitCore {
|
|
|
11655
11663
|
consumption: null
|
|
11656
11664
|
};
|
|
11657
11665
|
const data = { ...base, digest: decisionDigest(base) };
|
|
11658
|
-
const native = nativeRequired ? verifyNativeDecision(this.context.nativeAuthority, {
|
|
11666
|
+
const native = nativeRequired && !stated ? verifyNativeDecision(this.context.nativeAuthority, {
|
|
11659
11667
|
observation: nativeObservation,
|
|
11660
11668
|
expected: {
|
|
11661
11669
|
taskId: task.data.id,
|
package/dist/mcp-server.js
CHANGED
|
@@ -20273,10 +20273,11 @@ var decisionSchema = object4({
|
|
|
20273
20273
|
presented: text,
|
|
20274
20274
|
approvedContent: text,
|
|
20275
20275
|
displayed: text.optional(),
|
|
20276
|
-
contentRefs: array3(refSchema)
|
|
20276
|
+
contentRefs: array3(refSchema),
|
|
20277
|
+
statedChoice: object4({ ref: text, text }).strict().optional()
|
|
20277
20278
|
}).strict(),
|
|
20278
20279
|
digest,
|
|
20279
|
-
response: _enum2(["approved", "rejected"]),
|
|
20280
|
+
response: _enum2(["approved", "rejected", "stated"]),
|
|
20280
20281
|
requirementIds: array3(digest),
|
|
20281
20282
|
revoked: object4({ at: utc, reason: text }).strict().nullable(),
|
|
20282
20283
|
consumption: object4({
|
|
@@ -23128,7 +23129,7 @@ function evaluateEvidence(task, candidate) {
|
|
|
23128
23129
|
}
|
|
23129
23130
|
var scopeCovers2 = scopeCovers;
|
|
23130
23131
|
var applicableDecision2 = (task, workspace, requirement, checkoutRoot) => task.decisions.filter((entry) => entry.provenance.kind !== "imported").map((entry) => entry.data).filter((decision) => decision.purpose === "limitation" && decision.response === "approved" && decision.revoked === null && decision.binding.taskId === task.id && decision.binding.workspaceId === workspace.id && decision.requirementIds.includes(requirement.id) && decision.binding.scope && scopeCovers2(decision.binding.scope, requirement.scope) && decision.digest === decisionDigest(decision) && (checkoutRoot ? verifyDecisionContentAtRoot(checkoutRoot, decision.binding).ok : decision.binding.contentRefs.every((reference) => reference.kind !== "file")));
|
|
23131
|
-
var applicableRequirementDecision = (task, workspace, requirement, checkoutRoot) => task.decisions.filter(({ data, provenance }) => provenance.kind !== "imported" && data.purpose !== "limitation" && data.response === "approved" && data.revoked === null && data.binding.taskId === task.id && data.binding.workspaceId === workspace.id && data.requirementIds.includes(requirement.id) && scopeCovers2(data.binding.scope, requirement.scope) && data.digest === decisionDigest(data) && (checkoutRoot ? verifyDecisionContentAtRoot(checkoutRoot, data.binding).ok : data.binding.contentRefs.every((reference) => reference.kind !== "file"))).map(({ id }) => ({ id }));
|
|
23132
|
+
var applicableRequirementDecision = (task, workspace, requirement, checkoutRoot) => task.decisions.filter(({ data, provenance }) => provenance.kind !== "imported" && data.purpose !== "limitation" && (data.response === "approved" || data.response === "stated") && data.revoked === null && data.binding.taskId === task.id && data.binding.workspaceId === workspace.id && data.requirementIds.includes(requirement.id) && scopeCovers2(data.binding.scope, requirement.scope) && data.digest === decisionDigest(data) && (checkoutRoot ? verifyDecisionContentAtRoot(checkoutRoot, data.binding).ok : data.binding.contentRefs.every((reference) => reference.kind !== "file"))).map(({ id }) => ({ id }));
|
|
23132
23133
|
var evidenceMatchesRequirement = (kind, evidenceKind, dimension) => {
|
|
23133
23134
|
if (kind !== "passed")
|
|
23134
23135
|
return false;
|
|
@@ -23204,7 +23205,7 @@ function evaluateRequirements(task, workspace, capabilities, candidate, checkout
|
|
|
23204
23205
|
status: "satisfied",
|
|
23205
23206
|
evidenceIds: [],
|
|
23206
23207
|
decisionIds: decisions.map((decision) => decision.id),
|
|
23207
|
-
reason: "an applicable approved decision satisfies the requirement"
|
|
23208
|
+
reason: "an applicable approved or stated decision satisfies the requirement"
|
|
23208
23209
|
};
|
|
23209
23210
|
const limitations = requirement.acceptanceAllowed ? applicableDecision2(task, workspace, requirement, checkoutRoot) : [];
|
|
23210
23211
|
if (limitations.length)
|
|
@@ -24570,7 +24571,12 @@ class WorkitCore {
|
|
|
24570
24571
|
const input = parsed.data;
|
|
24571
24572
|
if (nativeRequired && input.action !== "record")
|
|
24572
24573
|
return failure("permission_denied", "native observation is only valid for recording decisions");
|
|
24573
|
-
|
|
24574
|
+
const stated = input.action === "record" && input.response === "stated";
|
|
24575
|
+
if (stated && input.purpose === "action")
|
|
24576
|
+
return failure("permission_denied", "stated choices cannot authorize mutating actions");
|
|
24577
|
+
if (stated && !input.binding?.statedChoice)
|
|
24578
|
+
return failure("invalid_input", "stated choices require binding.statedChoice");
|
|
24579
|
+
if (nativeRequired && nativeObservation === undefined && !stated)
|
|
24574
24580
|
return failure("permission_denied", "native decision observation is required");
|
|
24575
24581
|
const task = this.store.readTask(input.taskId);
|
|
24576
24582
|
if (!task.ok)
|
|
@@ -24603,7 +24609,7 @@ class WorkitCore {
|
|
|
24603
24609
|
consumption: null
|
|
24604
24610
|
};
|
|
24605
24611
|
const data = { ...base, digest: decisionDigest(base) };
|
|
24606
|
-
const native = nativeRequired ? verifyNativeDecision(this.context.nativeAuthority, {
|
|
24612
|
+
const native = nativeRequired && !stated ? verifyNativeDecision(this.context.nativeAuthority, {
|
|
24607
24613
|
observation: nativeObservation,
|
|
24608
24614
|
expected: {
|
|
24609
24615
|
taskId: task.data.id,
|
package/dist/workit-hook.js
CHANGED
|
@@ -7574,10 +7574,11 @@ var decisionSchema = object({
|
|
|
7574
7574
|
presented: text,
|
|
7575
7575
|
approvedContent: text,
|
|
7576
7576
|
displayed: text.optional(),
|
|
7577
|
-
contentRefs: array(refSchema)
|
|
7577
|
+
contentRefs: array(refSchema),
|
|
7578
|
+
statedChoice: object({ ref: text, text }).strict().optional()
|
|
7578
7579
|
}).strict(),
|
|
7579
7580
|
digest,
|
|
7580
|
-
response: _enum(["approved", "rejected"]),
|
|
7581
|
+
response: _enum(["approved", "rejected", "stated"]),
|
|
7581
7582
|
requirementIds: array(digest),
|
|
7582
7583
|
revoked: object({ at: utc, reason: text }).strict().nullable(),
|
|
7583
7584
|
consumption: object({
|
|
@@ -10368,7 +10369,7 @@ function evaluateEvidence(task, candidate) {
|
|
|
10368
10369
|
}
|
|
10369
10370
|
var scopeCovers2 = scopeCovers;
|
|
10370
10371
|
var applicableDecision2 = (task, workspace, requirement, checkoutRoot) => task.decisions.filter((entry) => entry.provenance.kind !== "imported").map((entry) => entry.data).filter((decision) => decision.purpose === "limitation" && decision.response === "approved" && decision.revoked === null && decision.binding.taskId === task.id && decision.binding.workspaceId === workspace.id && decision.requirementIds.includes(requirement.id) && decision.binding.scope && scopeCovers2(decision.binding.scope, requirement.scope) && decision.digest === decisionDigest(decision) && (checkoutRoot ? verifyDecisionContentAtRoot(checkoutRoot, decision.binding).ok : decision.binding.contentRefs.every((reference) => reference.kind !== "file")));
|
|
10371
|
-
var applicableRequirementDecision = (task, workspace, requirement, checkoutRoot) => task.decisions.filter(({ data, provenance }) => provenance.kind !== "imported" && data.purpose !== "limitation" && data.response === "approved" && data.revoked === null && data.binding.taskId === task.id && data.binding.workspaceId === workspace.id && data.requirementIds.includes(requirement.id) && scopeCovers2(data.binding.scope, requirement.scope) && data.digest === decisionDigest(data) && (checkoutRoot ? verifyDecisionContentAtRoot(checkoutRoot, data.binding).ok : data.binding.contentRefs.every((reference) => reference.kind !== "file"))).map(({ id }) => ({ id }));
|
|
10372
|
+
var applicableRequirementDecision = (task, workspace, requirement, checkoutRoot) => task.decisions.filter(({ data, provenance }) => provenance.kind !== "imported" && data.purpose !== "limitation" && (data.response === "approved" || data.response === "stated") && data.revoked === null && data.binding.taskId === task.id && data.binding.workspaceId === workspace.id && data.requirementIds.includes(requirement.id) && scopeCovers2(data.binding.scope, requirement.scope) && data.digest === decisionDigest(data) && (checkoutRoot ? verifyDecisionContentAtRoot(checkoutRoot, data.binding).ok : data.binding.contentRefs.every((reference) => reference.kind !== "file"))).map(({ id }) => ({ id }));
|
|
10372
10373
|
var evidenceMatchesRequirement = (kind, evidenceKind, dimension) => {
|
|
10373
10374
|
if (kind !== "passed")
|
|
10374
10375
|
return false;
|
|
@@ -10444,7 +10445,7 @@ function evaluateRequirements(task, workspace, capabilities, candidate, checkout
|
|
|
10444
10445
|
status: "satisfied",
|
|
10445
10446
|
evidenceIds: [],
|
|
10446
10447
|
decisionIds: decisions.map((decision) => decision.id),
|
|
10447
|
-
reason: "an applicable approved decision satisfies the requirement"
|
|
10448
|
+
reason: "an applicable approved or stated decision satisfies the requirement"
|
|
10448
10449
|
};
|
|
10449
10450
|
const limitations = requirement.acceptanceAllowed ? applicableDecision2(task, workspace, requirement, checkoutRoot) : [];
|
|
10450
10451
|
if (limitations.length)
|
|
@@ -11981,7 +11982,12 @@ class WorkitCore {
|
|
|
11981
11982
|
const input = parsed.data;
|
|
11982
11983
|
if (nativeRequired && input.action !== "record")
|
|
11983
11984
|
return failure("permission_denied", "native observation is only valid for recording decisions");
|
|
11984
|
-
|
|
11985
|
+
const stated = input.action === "record" && input.response === "stated";
|
|
11986
|
+
if (stated && input.purpose === "action")
|
|
11987
|
+
return failure("permission_denied", "stated choices cannot authorize mutating actions");
|
|
11988
|
+
if (stated && !input.binding?.statedChoice)
|
|
11989
|
+
return failure("invalid_input", "stated choices require binding.statedChoice");
|
|
11990
|
+
if (nativeRequired && nativeObservation === undefined && !stated)
|
|
11985
11991
|
return failure("permission_denied", "native decision observation is required");
|
|
11986
11992
|
const task = this.store.readTask(input.taskId);
|
|
11987
11993
|
if (!task.ok)
|
|
@@ -12014,7 +12020,7 @@ class WorkitCore {
|
|
|
12014
12020
|
consumption: null
|
|
12015
12021
|
};
|
|
12016
12022
|
const data = { ...base, digest: decisionDigest(base) };
|
|
12017
|
-
const native = nativeRequired ? verifyNativeDecision(this.context.nativeAuthority, {
|
|
12023
|
+
const native = nativeRequired && !stated ? verifyNativeDecision(this.context.nativeAuthority, {
|
|
12018
12024
|
observation: nativeObservation,
|
|
12019
12025
|
expected: {
|
|
12020
12026
|
taskId: task.data.id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-cursor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit Cursor plugin — shared MCP transport, native hooks, and fourteen method skills",
|
|
6
6
|
"keywords": [
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"build": "bun scripts/build.ts"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@brainervirus/workit-core": "^1.0.
|
|
48
|
-
"@brainervirus/workit-mcp": "^1.0.
|
|
47
|
+
"@brainervirus/workit-core": "^1.0.11",
|
|
48
|
+
"@brainervirus/workit-mcp": "^1.0.11"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
51
|
"node": ">=24"
|