@workit-dev/mcp 2.12.0 → 2.14.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 +67 -26
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -6623,7 +6623,7 @@ import { fileURLToPath as fileURLToPath3 } from "node:url";
6623
6623
  import path31 from "node:path";
6624
6624
 
6625
6625
  // packages/workit-mcp/src/server.ts
6626
- import { existsSync as existsSync13, readFileSync as readFileSync11, realpathSync as realpathSync10 } from "node:fs";
6626
+ import { existsSync as existsSync14, readFileSync as readFileSync11, realpathSync as realpathSync10 } from "node:fs";
6627
6627
  import path30 from "node:path";
6628
6628
 
6629
6629
  // node_modules/zod/v4/core/util.js
@@ -14937,7 +14937,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
14937
14937
 
14938
14938
  // packages/workit-core/src/core.ts
14939
14939
  import { spawnSync as spawnSync20 } from "node:child_process";
14940
- import { existsSync as existsSync12, realpathSync as realpathSync9 } from "node:fs";
14940
+ import { existsSync as existsSync13, realpathSync as realpathSync9 } from "node:fs";
14941
14941
  import path29 from "node:path";
14942
14942
 
14943
14943
  // packages/workit-core/src/core/task-contract.ts
@@ -17890,7 +17890,7 @@ var workspaceConfigSchema = object({
17890
17890
  fanout: object({
17891
17891
  tierModels: unknown().optional().describe("The model per slice TIER (mundane, standard, hard), as one name or per host.")
17892
17892
  }).passthrough().optional().describe("Fanout settings."),
17893
- models: object({ roles: modelRoles }).passthrough().optional().describe("Model and effort per role and host (roles), the lead's own advisory model (lead) and whether a model the lead names on a spawn wins (allowLeadOverride, default false); the same key at the top of workspaces.json is the global default."),
17893
+ models: object({ roles: modelRoles }).passthrough().optional().describe("Model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false); the same key at the top of workspaces.json is the global default."),
17894
17894
  resources: unknown().optional().describe("Heavy-check limits on this machine: slots, scope, heavy, light, memoryMax, cpuQuota, wait."),
17895
17895
  remotes: array(nonBlank.refine((pattern) => remotePattern(pattern) !== null, "is not a remote URL (https://host/owner/repo, git@host:owner/repo, a path, or owner/*)")).optional().describe("Remote URLs this entry owns: a checkout pushing to or opening PRs on one never exceeds this entry's grants, wherever the folder is (`owner/*` claims a whole owner). Only the user changes it, in their own terminal."),
17896
17896
  autonomy: object(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
@@ -17928,7 +17928,7 @@ var workspaceConfigSchema = object({
17928
17928
  });
17929
17929
  var workspacesFileSchema = object({
17930
17930
  workspaces: array(workspaceConfigSchema).optional().describe("Workspace entries, each mapping a path glob to its forge, policies and grants."),
17931
- models: object({ roles: modelRoles }).passthrough().optional().describe("The global default model and effort per role and host (roles), the lead's own advisory model (lead) and whether a model the lead names on a spawn wins (allowLeadOverride, default false).")
17931
+ models: object({ roles: modelRoles }).passthrough().optional().describe("The global default model and effort per role and host (roles), the lead's own advisory model (lead), how a role model applies (enforce: advise, the default, or strict) and, under strict, whether a model the lead names on a spawn wins (allowLeadOverride, default false).")
17932
17932
  }).passthrough().superRefine((file, context) => {
17933
17933
  const names = new Set;
17934
17934
  for (const [index, workspace] of (file.workspaces ?? []).entries()) {
@@ -25943,18 +25943,33 @@ var HOST_KEYS = new Set([
25943
25943
  "pi",
25944
25944
  "default"
25945
25945
  ]);
25946
+ var CLAUDE_AGENT_FILES = {
25947
+ decider: { model: "fable", effort: "high" },
25948
+ implementer: { model: "sonnet" },
25949
+ verifier: { model: "sonnet" },
25950
+ reviewer: { model: "opus" },
25951
+ babysit: { model: "haiku" }
25952
+ };
25953
+ var BUILT_IN_CLAUDE_CODE = {
25954
+ ...CLAUDE_AGENT_FILES,
25955
+ "implementer.hard": { model: "opus" },
25956
+ "implementer.standard": { model: "sonnet" },
25957
+ "implementer.mundane": { model: "haiku" }
25958
+ };
25959
+ var FILE_ROLES = new Set(["decider", "verifier", "reviewer", "babysit"]);
25946
25960
  var CLAUDE_ALIASES = new Set(["sonnet", "opus", "haiku", "fable"]);
25947
25961
  var CLAUDE_EFFORTS = new Set(["low", "medium", "high", "xhigh", "max"]);
25948
25962
  var CLAUDE_SPAWNS = [
25949
- ...["hard", "standard", "mundane"].map((tier) => ({
25950
- label: tier === "hard" ? "workit:implementer hard" : tier,
25963
+ ...MODEL_TIERS.map((tier) => ({
25964
+ label: `workit:implementer ${tier}`,
25951
25965
  selector: { role: "implementer", tier }
25952
25966
  })),
25953
- { label: "workit:verifier", selector: { role: "verifier" } },
25954
- { label: "workit:reviewer", selector: { role: "reviewer" } },
25967
+ ...["verifier", "reviewer", "decider"].map((role) => ({
25968
+ label: `workit:${role}`,
25969
+ selector: { role }
25970
+ })),
25971
+ { label: "workit:babysitter", selector: { role: "babysit" } },
25955
25972
  { label: "Explore", selector: { role: "explore" } },
25956
- { label: "ROLE: decider", selector: { role: "decider" } },
25957
- { label: "ROLE: babysit", selector: { role: "babysit" } },
25958
25973
  { label: "general-purpose", selector: { role: "default" } }
25959
25974
  ];
25960
25975
  var ROLE_SELECTORS = MODEL_ROLES.flatMap((role) => role === "implementer" ? MODEL_TIERS.map((tier) => ({ role, tier })) : [{ role }]);
@@ -26212,6 +26227,7 @@ var exportDigest = (bundle) => sha256({
26212
26227
  task: bundle.task
26213
26228
  });
26214
26229
  // packages/workit-core/src/autonomy.ts
26230
+ import { closeSync as closeSync2, copyFileSync as copyFileSync2, existsSync as existsSync11, openSync as openSync2 } from "node:fs";
26215
26231
  import path24 from "node:path";
26216
26232
 
26217
26233
  // packages/workit-core/src/core/eval-world.ts
@@ -26308,12 +26324,36 @@ function checkSeal(dir) {
26308
26324
  }
26309
26325
 
26310
26326
  // packages/workit-core/src/autonomy.ts
26311
- var accountDir = () => {
26327
+ var accountHomeDir = () => {
26312
26328
  const home = grantsHome.resolve();
26313
26329
  return home === null ? null : configDir({ HOME: home });
26314
26330
  };
26315
- var grantsDir = () => accountDir() ?? resolveConfigDir();
26331
+ var deniedFile = (dir) => {
26332
+ for (const name of ["workspaces.json", SEAL_FILE]) {
26333
+ const file = path24.join(dir, name);
26334
+ try {
26335
+ closeSync2(openSync2(file, "r"));
26336
+ } catch (error) {
26337
+ const code = error.code;
26338
+ if (code === "EACCES" || code === "EPERM")
26339
+ return file;
26340
+ }
26341
+ }
26342
+ return null;
26343
+ };
26344
+ var accountDir = () => {
26345
+ const dir = accountHomeDir();
26346
+ return dir === null || deniedFile(dir) !== null ? null : dir;
26347
+ };
26348
+ var grantsDir = () => accountHomeDir() ?? resolveConfigDir();
26316
26349
  var NO_ACCOUNT = "no OS account record answered (core/account-home.ts), so no grants are read: the D4 defaults apply";
26350
+ var accountUnread = () => {
26351
+ const dir = accountHomeDir();
26352
+ if (dir === null)
26353
+ return NO_ACCOUNT;
26354
+ const file = deniedFile(dir);
26355
+ return file === null ? null : `the account's ${path24.basename(file)} cannot be read (permission denied), so it reads as no workspace entries: no grants, no models, the D4 defaults apply`;
26356
+ };
26317
26357
  var entriesIn = (dir) => dir === null ? [] : loadWorkspacesFrom(dir);
26318
26358
  var fileSource = (dir = accountDir()) => ({
26319
26359
  resolve: (cwd, name) => dir === null ? null : resolveWorkspaceFrom(cwd, dir, name),
@@ -26356,7 +26396,7 @@ var benchWorld = (cwd) => {
26356
26396
  var grantsOverride = () => {
26357
26397
  const shown = shownGrantsDir();
26358
26398
  if (shown === null)
26359
- return NO_ACCOUNT;
26399
+ return accountUnread() ?? NO_ACCOUNT;
26360
26400
  const configured = path24.resolve(resolveConfigDir());
26361
26401
  return configured === path24.resolve(shown) ? null : `the config directory is redirected to ${configured} (WORKIT_CONFIG, WORKIT_CONFIG_DIR or XDG_CONFIG_HOME), but that override does not apply to grants: grants are read only from ${path24.join(grantsDir(), "workspaces.json")}, and under a redirect they never exceed the D4 defaults`;
26362
26402
  };
@@ -26525,9 +26565,10 @@ function capAt(source, named, where, by, why, main = false) {
26525
26565
  }
26526
26566
  function resolveAutonomy(cwd, target) {
26527
26567
  const world = benchWorld(cwd);
26568
+ const unread = world ? null : accountUnread();
26569
+ if (unread !== null)
26570
+ return { ...autonomyOf(null), note: unread };
26528
26571
  const override = world ? null : grantsOverride();
26529
- if (override === NO_ACCOUNT)
26530
- return { ...autonomyOf(null), note: override };
26531
26572
  let resolved;
26532
26573
  const once = typeof target === "function" ? () => resolved ??= target() : target;
26533
26574
  const account = accountAuthority(cwd, world, once);
@@ -28735,7 +28776,7 @@ class WorkitCore {
28735
28776
  }
28736
28777
  // packages/workit-core/src/core/repo-context.ts
28737
28778
  import { spawnSync as spawnSync16 } from "node:child_process";
28738
- import { existsSync as existsSync11, readFileSync as readFileSync10, readdirSync as readdirSync4 } from "node:fs";
28779
+ import { existsSync as existsSync12, readFileSync as readFileSync10, readdirSync as readdirSync4 } from "node:fs";
28739
28780
  import path25 from "node:path";
28740
28781
  var isSafeContextRange = (value) => value.length <= 4096 && (() => {
28741
28782
  try {
@@ -28917,7 +28958,7 @@ var diffStatForRange = (cwd, range) => {
28917
28958
  };
28918
28959
  var packageScripts = (cwd, keys) => {
28919
28960
  const pkgPath = path25.join(cwd, "package.json");
28920
- if (!existsSync11(pkgPath))
28961
+ if (!existsSync12(pkgPath))
28921
28962
  return [];
28922
28963
  try {
28923
28964
  const pkg = JSON.parse(readFileSync10(pkgPath, "utf8"));
@@ -28952,7 +28993,7 @@ var documentationFiles = (cwd) => {
28952
28993
  return matches.toSorted().slice(0, 200);
28953
28994
  };
28954
28995
  var readTrimmed2 = (file, maxLines) => {
28955
- if (!existsSync11(file))
28996
+ if (!existsSync12(file))
28956
28997
  return "";
28957
28998
  const lines = readFileSync10(file, "utf8").split(`
28958
28999
  `);
@@ -29028,7 +29069,7 @@ ${status.stderr}` : "");
29028
29069
  stdout += `
29029
29070
  `;
29030
29071
  stdout += printSection("Recent Validation Signals");
29031
- if (existsSync11(path25.join(cwd, "package.json"))) {
29072
+ if (existsSync12(path25.join(cwd, "package.json"))) {
29032
29073
  stdout += `package.json detected. Common scripts:
29033
29074
  `;
29034
29075
  const found = packageScripts(cwd, ["lint", "format:check", "test", "build"]);
@@ -29037,7 +29078,7 @@ ${status.stderr}` : "");
29037
29078
  `) + `
29038
29079
  `;
29039
29080
  }
29040
- if (existsSync11(path25.join(cwd, "Cargo.toml")) || existsSync11(path25.join(cwd, "src-tauri/Cargo.toml"))) {
29081
+ if (existsSync12(path25.join(cwd, "Cargo.toml")) || existsSync12(path25.join(cwd, "src-tauri/Cargo.toml"))) {
29041
29082
  stdout += `Rust project detected.
29042
29083
  `;
29043
29084
  }
@@ -29089,7 +29130,7 @@ function changelogContext(root, range) {
29089
29130
  `;
29090
29131
  stdout += printSection("Existing CHANGELOG.md");
29091
29132
  const changelogPath = path25.join(cwd, "CHANGELOG.md");
29092
- if (existsSync11(changelogPath)) {
29133
+ if (existsSync12(changelogPath)) {
29093
29134
  stdout += readTrimmed2(changelogPath, 260) + `
29094
29135
  `;
29095
29136
  } else {
@@ -29131,7 +29172,7 @@ function docsRefreshContext(root, range) {
29131
29172
  `;
29132
29173
  stdout += printSection("README Preview");
29133
29174
  const readme = path25.join(cwd, "README.md");
29134
- if (existsSync11(readme)) {
29175
+ if (existsSync12(readme)) {
29135
29176
  stdout += readTrimmed2(readme, 220) + `
29136
29177
  `;
29137
29178
  } else {
@@ -29140,7 +29181,7 @@ function docsRefreshContext(root, range) {
29140
29181
  }
29141
29182
  stdout += printSection("Package Scripts");
29142
29183
  const pkgPath = path25.join(cwd, "package.json");
29143
- if (existsSync11(pkgPath)) {
29184
+ if (existsSync12(pkgPath)) {
29144
29185
  try {
29145
29186
  const pkg = JSON.parse(readFileSync10(pkgPath, "utf8"));
29146
29187
  stdout += JSON.stringify({ name: pkg.name, version: pkg.version, scripts: pkg.scripts }, null, 2) + `
@@ -29196,7 +29237,7 @@ function releaseNotesContext(root, rangeOrTag) {
29196
29237
  `;
29197
29238
  stdout += printSection("Existing Release Files");
29198
29239
  for (const rel of ["CHANGELOG.md", "RELEASE_NOTES.md", ".github/releases.md"]) {
29199
- if (existsSync11(path25.join(cwd, rel)))
29240
+ if (existsSync12(path25.join(cwd, rel)))
29200
29241
  stdout += rel + `
29201
29242
  `;
29202
29243
  }
@@ -29804,7 +29845,7 @@ function resolveInside(root, candidate) {
29804
29845
  throw new Error("path must stay inside repository root");
29805
29846
  }
29806
29847
  let ancestor = target;
29807
- while (!existsSync12(ancestor))
29848
+ while (!existsSync13(ancestor))
29808
29849
  ancestor = path29.dirname(ancestor);
29809
29850
  const canonicalAncestor = realpathSync9(ancestor);
29810
29851
  if (canonicalAncestor !== base && !canonicalAncestor.startsWith(base + path29.sep)) {
@@ -30007,7 +30048,7 @@ function createMcpServer(host, contextProvider) {
30007
30048
  path30.join(here, "server.ts"),
30008
30049
  path30.join(here, "..", "..", "workit-core", "src", "core", "task-contract.ts"),
30009
30050
  path30.join(here, "..", "..", "workit-core", "src", "core", "task-engine.ts")
30010
- ].filter((file) => existsSync13(file)));
30051
+ ].filter((file) => existsSync14(file)));
30011
30052
  let staleWarned = false;
30012
30053
  const failures = new Map;
30013
30054
  const server = new Server({ name: "workit", version: VERSION }, { capabilities: { tools: {}, resources: {} } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/mcp",
3
- "version": "2.12.0",
3
+ "version": "2.14.0",
4
4
  "private": false,
5
5
  "description": "Workit shared MCP transport for the eight task and policy operation families",
6
6
  "keywords": [
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@modelcontextprotocol/sdk": "1.32.0",
47
- "@workit-dev/core": "^2.12.0",
47
+ "@workit-dev/core": "^2.14.0",
48
48
  "zod": "4.6.5"
49
49
  },
50
50
  "engines": {