@brainervirus/workit-mcp 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.
Files changed (2) hide show
  1. package/dist/index.js +12 -6
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -20271,10 +20271,11 @@ var decisionSchema = object4({
20271
20271
  presented: text,
20272
20272
  approvedContent: text,
20273
20273
  displayed: text.optional(),
20274
- contentRefs: array3(refSchema)
20274
+ contentRefs: array3(refSchema),
20275
+ statedChoice: object4({ ref: text, text }).strict().optional()
20275
20276
  }).strict(),
20276
20277
  digest,
20277
- response: _enum2(["approved", "rejected"]),
20278
+ response: _enum2(["approved", "rejected", "stated"]),
20278
20279
  requirementIds: array3(digest),
20279
20280
  revoked: object4({ at: utc, reason: text }).strict().nullable(),
20280
20281
  consumption: object4({
@@ -23126,7 +23127,7 @@ function evaluateEvidence(task, candidate) {
23126
23127
  }
23127
23128
  var scopeCovers2 = scopeCovers;
23128
23129
  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")));
23129
- 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 }));
23130
+ 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 }));
23130
23131
  var evidenceMatchesRequirement = (kind, evidenceKind, dimension) => {
23131
23132
  if (kind !== "passed")
23132
23133
  return false;
@@ -23202,7 +23203,7 @@ function evaluateRequirements(task, workspace, capabilities, candidate, checkout
23202
23203
  status: "satisfied",
23203
23204
  evidenceIds: [],
23204
23205
  decisionIds: decisions.map((decision) => decision.id),
23205
- reason: "an applicable approved decision satisfies the requirement"
23206
+ reason: "an applicable approved or stated decision satisfies the requirement"
23206
23207
  };
23207
23208
  const limitations = requirement.acceptanceAllowed ? applicableDecision2(task, workspace, requirement, checkoutRoot) : [];
23208
23209
  if (limitations.length)
@@ -24568,7 +24569,12 @@ class WorkitCore {
24568
24569
  const input = parsed.data;
24569
24570
  if (nativeRequired && input.action !== "record")
24570
24571
  return failure("permission_denied", "native observation is only valid for recording decisions");
24571
- if (nativeRequired && nativeObservation === undefined)
24572
+ const stated = input.action === "record" && input.response === "stated";
24573
+ if (stated && input.purpose === "action")
24574
+ return failure("permission_denied", "stated choices cannot authorize mutating actions");
24575
+ if (stated && !input.binding?.statedChoice)
24576
+ return failure("invalid_input", "stated choices require binding.statedChoice");
24577
+ if (nativeRequired && nativeObservation === undefined && !stated)
24572
24578
  return failure("permission_denied", "native decision observation is required");
24573
24579
  const task = this.store.readTask(input.taskId);
24574
24580
  if (!task.ok)
@@ -24601,7 +24607,7 @@ class WorkitCore {
24601
24607
  consumption: null
24602
24608
  };
24603
24609
  const data = { ...base, digest: decisionDigest(base) };
24604
- const native = nativeRequired ? verifyNativeDecision(this.context.nativeAuthority, {
24610
+ const native = nativeRequired && !stated ? verifyNativeDecision(this.context.nativeAuthority, {
24605
24611
  observation: nativeObservation,
24606
24612
  expected: {
24607
24613
  taskId: task.data.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-mcp",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "private": false,
5
5
  "description": "Workit shared MCP transport for the eight task and policy operation families",
6
6
  "keywords": [
@@ -42,7 +42,7 @@
42
42
  "build": "bun scripts/build.ts"
43
43
  },
44
44
  "dependencies": {
45
- "@brainervirus/workit-core": "^1.0.10",
45
+ "@brainervirus/workit-core": "^1.0.11",
46
46
  "@modelcontextprotocol/sdk": "1.30.0",
47
47
  "zod": "4.5.4"
48
48
  },