@brainervirus/workit-mcp 8.17.0 → 8.18.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.
Files changed (2) hide show
  1. package/dist/index.js +26 -15
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -21244,8 +21244,13 @@ import { spawnSync as spawnSync3 } from "node:child_process";
21244
21244
  import fs9 from "node:fs";
21245
21245
  import path9 from "node:path";
21246
21246
  var SCRIPT_CHECKS = ["test", "lint", "typecheck", "check"];
21247
- var CHECKS_FILE = "workit.checks.json";
21248
- var checksConfigFile = (root) => path9.join(root, CHECKS_FILE);
21247
+ var CHECKS_FILE = ".workit/checks.json";
21248
+ var LEGACY_CHECKS_FILE = "workit.checks.json";
21249
+ function checksConfigFile(root) {
21250
+ const current = path9.join(root, CHECKS_FILE);
21251
+ const legacy = path9.join(root, LEGACY_CHECKS_FILE);
21252
+ return !fs9.existsSync(current) && fs9.existsSync(legacy) ? legacy : current;
21253
+ }
21249
21254
  var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
21250
21255
  var SHELL_META = /[|&;<>()$`\\*?[\]{}~!#]/u;
21251
21256
  function splitCommand(command) {
@@ -21359,19 +21364,25 @@ var GATES = ["testing", "verification"];
21359
21364
  function loadCheckConfig(cwd) {
21360
21365
  const root = checkRoot(cwd);
21361
21366
  const file = checksConfigFile(root);
21367
+ const legacy = path9.basename(file) === LEGACY_CHECKS_FILE;
21368
+ const label = legacy ? LEGACY_CHECKS_FILE : CHECKS_FILE;
21369
+ const note = legacy ? {
21370
+ note: `${LEGACY_CHECKS_FILE} is deprecated; move it to ${CHECKS_FILE} (workit doctor --fix)`
21371
+ } : {};
21362
21372
  const none = (error = null) => ({
21363
- source: error ? CHECKS_FILE : "none",
21373
+ source: error ? label : "none",
21364
21374
  root,
21365
21375
  checks: [],
21366
21376
  gates: {},
21367
- error
21377
+ error,
21378
+ ...note
21368
21379
  });
21369
21380
  let text = null;
21370
21381
  try {
21371
21382
  text = fs9.readFileSync(file, "utf8");
21372
21383
  } catch (error) {
21373
21384
  if (error.code !== "ENOENT")
21374
- return none(`cannot read ${CHECKS_FILE}: ${error.message}`);
21385
+ return none(`cannot read ${label}: ${error.message}`);
21375
21386
  }
21376
21387
  if (text === null) {
21377
21388
  const checks = detectedChecks(root);
@@ -21381,33 +21392,33 @@ function loadCheckConfig(cwd) {
21381
21392
  try {
21382
21393
  parsed = JSON.parse(text);
21383
21394
  } catch {
21384
- return none(`${CHECKS_FILE} is not valid JSON`);
21395
+ return none(`${label} is not valid JSON`);
21385
21396
  }
21386
21397
  if (!isRecord(parsed) || !isRecord(parsed.checks))
21387
- return none(`${CHECKS_FILE} must be {"checks":{"<name>":"<command>"|["argv",…]}}`);
21398
+ return none(`${label} must be {"checks":{"<name>":"<command>"|["argv",…]}}`);
21388
21399
  const checks = [];
21389
21400
  for (const [name, value] of Object.entries(parsed.checks)) {
21390
21401
  if (!CHECK_NAME.test(name))
21391
- return none(`${CHECKS_FILE}: check name "${name}" must match ${CHECK_NAME.source}`);
21402
+ return none(`${label}: check name "${name}" must match ${CHECK_NAME.source}`);
21392
21403
  const argv = typeof value === "string" ? splitCommand(value) : Array.isArray(value) && value.length > 0 && value.every((item) => typeof item === "string" && item.length > 0) ? value : new Error("expected a command string or a non-empty argv array");
21393
21404
  if (argv instanceof Error)
21394
- return none(`${CHECKS_FILE}: check "${name}": ${argv.message}`);
21405
+ return none(`${label}: check "${name}": ${argv.message}`);
21395
21406
  checks.push({ name, argv, accepts: [argv] });
21396
21407
  }
21397
21408
  const gates = {};
21398
21409
  if (parsed.gates !== undefined) {
21399
21410
  if (!isRecord(parsed.gates))
21400
- return none(`${CHECKS_FILE}: gates must be {"testing":"<name>"|["<name>",…]}`);
21411
+ return none(`${label}: gates must be {"testing":"<name>"|["<name>",…]}`);
21401
21412
  for (const [gate, value] of Object.entries(parsed.gates)) {
21402
21413
  if (!GATES.includes(gate))
21403
- return none(`${CHECKS_FILE}: unknown gate "${gate}" (use ${GATES.join(" or ")})`);
21414
+ return none(`${label}: unknown gate "${gate}" (use ${GATES.join(" or ")})`);
21404
21415
  const names = typeof value === "string" ? [value] : value;
21405
21416
  if (!Array.isArray(names) || names.length === 0 || !names.every((name) => typeof name === "string" && checks.some((c) => c.name === name)))
21406
- return none(`${CHECKS_FILE}: gates.${gate} must name configured checks`);
21417
+ return none(`${label}: gates.${gate} must name configured checks`);
21407
21418
  gates[gate] = names;
21408
21419
  }
21409
21420
  }
21410
- return { source: CHECKS_FILE, root, checks, gates, error: null, resources: parsed.resources };
21421
+ return { source: label, root, checks, gates, error: null, ...note, resources: parsed.resources };
21411
21422
  }
21412
21423
  var sameArgv = (left, right) => left.length === right.length && left.every((item, index) => item === right[index]);
21413
21424
  function matchesNamedCheck(config, name, argv, cwd) {
@@ -24066,7 +24077,7 @@ var productDecision = (task, ledger) => {
24066
24077
  };
24067
24078
  const since = Date.parse(task.createdAt);
24068
24079
  const branch = ledger.branch();
24069
- const row = ledger.rows().findLast((item) => item.type === "decision" && !item.superseded && (item.branch ?? null) === branch && Date.parse(item.at) >= since);
24080
+ const row = ledger.rows().findLast((item) => item.type === "decision" && item.by !== "decider" && !item.superseded && (item.branch ?? null) === branch && Date.parse(item.at) >= since);
24070
24081
  return row ? { met: true, reason: `ledger decision ${row.id} records the choice`, decisionIds: [] } : {
24071
24082
  met: false,
24072
24083
  reason: 'open product choice: ask the user, then `workit ledger decision "<choice>" --why "<reason>"` (or, if it is not open, `workit policy assess --judge product-choice=no --why "<reason>"`)',
@@ -24550,7 +24561,7 @@ function evaluateObservedGate(task, requirement, statuses, config) {
24550
24561
  return {
24551
24562
  satisfied: [],
24552
24563
  considered,
24553
- reason: requirement.dimension === "testing" && config.checks.length ? `no \`test\` check is configured; add one (or gates.testing) to ${CHECKS_FILE}, then run ${checkCommand("test", runtimeVersion())}` : `no checks are configured or detected; add ${CHECKS_FILE} (committed, so it shows in the diff), e.g. {"checks":{"test":"<your test command>"}}, then run ${checkCommand("test", runtimeVersion())}`
24564
+ reason: requirement.dimension === "testing" && config.checks.length ? `no \`test\` check is configured; add one (or gates.testing) to ${CHECKS_FILE}, then run ${checkCommand("test", runtimeVersion())}` : `no checks are configured or detected; add ${CHECKS_FILE}, e.g. {"checks":{"test":"<your test command>"}}, then run ${checkCommand("test", runtimeVersion())}`
24554
24565
  };
24555
24566
  const satisfied = fresh.filter(named);
24556
24567
  if (satisfied.length)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-mcp",
3
- "version": "8.17.0",
3
+ "version": "8.18.0",
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": "^8.17.0",
45
+ "@brainervirus/workit-core": "^8.18.0",
46
46
  "@modelcontextprotocol/sdk": "1.32.0",
47
47
  "zod": "4.6.5"
48
48
  },