@brainervirus/workit-mcp 1.0.7 → 1.0.9

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 +13 -8
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -20308,7 +20308,7 @@ var workerReportSchema = object4({
20308
20308
  }).strict();
20309
20309
  var workerSchema = object4({
20310
20310
  assignment: assignmentSchema,
20311
- state: _enum2(["assigned", "running", "cancelling", "stopped", "unknown"]),
20311
+ state: _enum2(["assigned", "dispatching", "running", "cancelling", "stopped", "unknown"]),
20312
20312
  session: refSchema.nullable(),
20313
20313
  report: workerReportSchema.nullable()
20314
20314
  }).strict();
@@ -23142,7 +23142,7 @@ function reconcileResume(view, observations = []) {
23142
23142
  return candidate;
23143
23143
  const staleEvidenceIds = evaluateEvidence(view.task, candidate.data).filter((entry) => entry.status === "stale").map((entry) => entry.evidenceId);
23144
23144
  const blockers = [...view.task.progress.blockers];
23145
- if (view.task.workers.some((entry) => ["running", "cancelling", "unknown"].includes(entry.data.state)))
23145
+ if (view.task.workers.some((entry) => ["dispatching", "running", "cancelling", "unknown"].includes(entry.data.state)))
23146
23146
  blockers.push({
23147
23147
  reason: "worker state requires reconciliation",
23148
23148
  dependentAction: "resume",
@@ -23750,10 +23750,10 @@ var applyWorkerLifecycle = (input) => {
23750
23750
  const notStarted = input.dispatch === true;
23751
23751
  if (notStarted && (input.state !== "stopped" || input.session !== null))
23752
23752
  return failure("invalid_input", "a never-dispatched worker stops with no session");
23753
- if (notStarted && (entry.data.state === "stopped" || entry.data.state === "unknown"))
23754
- return failure("invalid_transition", "worker is no longer awaiting dispatch");
23755
- if (notStarted && (entry.data.session !== null || entry.data.state === "running"))
23753
+ if (notStarted && entry.data.session !== null)
23756
23754
  return failure("invalid_transition", "worker already has an observed session");
23755
+ if (notStarted && !["dispatching", "cancelling"].includes(entry.data.state))
23756
+ return failure("invalid_transition", "worker launch was not claimed");
23757
23757
  if ((input.state === "running" || input.state === "cancelling" || input.state === "stopped" && !notStarted) && !input.session)
23758
23758
  return failure("invalid_input", "running worker observations require a session");
23759
23759
  if (entry.data.session && !sameValue(entry.data.session, input.session))
@@ -24140,7 +24140,7 @@ class WorkitCore {
24140
24140
  activeWorkerBlocker(task, workspace) {
24141
24141
  if (workspace.writer)
24142
24142
  return failure("recovery_required", "writer ownership must be released first");
24143
- if (task.workers.some((entry) => ["running", "cancelling", "unknown"].includes(entry.data.state)))
24143
+ if (task.workers.some((entry) => ["dispatching", "running", "cancelling", "unknown"].includes(entry.data.state)))
24144
24144
  return failure("recovery_required", "worker state requires reconciliation");
24145
24145
  return null;
24146
24146
  }
@@ -24904,7 +24904,12 @@ class WorkitCore {
24904
24904
  return failure("invalid_transition", "worker is not awaiting dispatch");
24905
24905
  return success(mutation.revision, null, {
24906
24906
  ...current,
24907
- workers: current.workers.map((item) => item.id === input.workerId ? { ...item, recordedAt: mutation.now, provenance: attested.data } : item)
24907
+ workers: current.workers.map((item) => item.id === input.workerId ? {
24908
+ ...item,
24909
+ recordedAt: mutation.now,
24910
+ provenance: attested.data,
24911
+ data: { ...item.data, state: "dispatching" }
24912
+ } : item)
24908
24913
  });
24909
24914
  }
24910
24915
  });
@@ -25373,7 +25378,7 @@ class WorkitCore {
25373
25378
  const base = reconcileResume(effectiveView);
25374
25379
  if (!base.ok)
25375
25380
  return base;
25376
- const needsReconciliation = view.task.workers.some((entry) => ["running", "cancelling", "unknown"].includes(observedStates.get(entry.id) ?? entry.data.state));
25381
+ const needsReconciliation = view.task.workers.some((entry) => ["dispatching", "running", "cancelling", "unknown"].includes(observedStates.get(entry.id) ?? entry.data.state));
25377
25382
  const blockers = [...base.data.blockers];
25378
25383
  if (needsReconciliation && !blockers.some((entry) => entry.reason === "worker state requires reconciliation"))
25379
25384
  blockers.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-mcp",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
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.7",
45
+ "@brainervirus/workit-core": "^1.0.9",
46
46
  "@modelcontextprotocol/sdk": "1.30.0",
47
47
  "zod": "4.5.4"
48
48
  },