@workit-dev/mcp 2.12.0 → 2.13.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 +44 -18
  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
@@ -26212,6 +26212,7 @@ var exportDigest = (bundle) => sha256({
26212
26212
  task: bundle.task
26213
26213
  });
26214
26214
  // packages/workit-core/src/autonomy.ts
26215
+ import { closeSync as closeSync2, copyFileSync as copyFileSync2, existsSync as existsSync11, openSync as openSync2 } from "node:fs";
26215
26216
  import path24 from "node:path";
26216
26217
 
26217
26218
  // packages/workit-core/src/core/eval-world.ts
@@ -26308,12 +26309,36 @@ function checkSeal(dir) {
26308
26309
  }
26309
26310
 
26310
26311
  // packages/workit-core/src/autonomy.ts
26311
- var accountDir = () => {
26312
+ var accountHomeDir = () => {
26312
26313
  const home = grantsHome.resolve();
26313
26314
  return home === null ? null : configDir({ HOME: home });
26314
26315
  };
26315
- var grantsDir = () => accountDir() ?? resolveConfigDir();
26316
+ var deniedFile = (dir) => {
26317
+ for (const name of ["workspaces.json", SEAL_FILE]) {
26318
+ const file = path24.join(dir, name);
26319
+ try {
26320
+ closeSync2(openSync2(file, "r"));
26321
+ } catch (error) {
26322
+ const code = error.code;
26323
+ if (code === "EACCES" || code === "EPERM")
26324
+ return file;
26325
+ }
26326
+ }
26327
+ return null;
26328
+ };
26329
+ var accountDir = () => {
26330
+ const dir = accountHomeDir();
26331
+ return dir === null || deniedFile(dir) !== null ? null : dir;
26332
+ };
26333
+ var grantsDir = () => accountHomeDir() ?? resolveConfigDir();
26316
26334
  var NO_ACCOUNT = "no OS account record answered (core/account-home.ts), so no grants are read: the D4 defaults apply";
26335
+ var accountUnread = () => {
26336
+ const dir = accountHomeDir();
26337
+ if (dir === null)
26338
+ return NO_ACCOUNT;
26339
+ const file = deniedFile(dir);
26340
+ 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`;
26341
+ };
26317
26342
  var entriesIn = (dir) => dir === null ? [] : loadWorkspacesFrom(dir);
26318
26343
  var fileSource = (dir = accountDir()) => ({
26319
26344
  resolve: (cwd, name) => dir === null ? null : resolveWorkspaceFrom(cwd, dir, name),
@@ -26356,7 +26381,7 @@ var benchWorld = (cwd) => {
26356
26381
  var grantsOverride = () => {
26357
26382
  const shown = shownGrantsDir();
26358
26383
  if (shown === null)
26359
- return NO_ACCOUNT;
26384
+ return accountUnread() ?? NO_ACCOUNT;
26360
26385
  const configured = path24.resolve(resolveConfigDir());
26361
26386
  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
26387
  };
@@ -26525,9 +26550,10 @@ function capAt(source, named, where, by, why, main = false) {
26525
26550
  }
26526
26551
  function resolveAutonomy(cwd, target) {
26527
26552
  const world = benchWorld(cwd);
26553
+ const unread = world ? null : accountUnread();
26554
+ if (unread !== null)
26555
+ return { ...autonomyOf(null), note: unread };
26528
26556
  const override = world ? null : grantsOverride();
26529
- if (override === NO_ACCOUNT)
26530
- return { ...autonomyOf(null), note: override };
26531
26557
  let resolved;
26532
26558
  const once = typeof target === "function" ? () => resolved ??= target() : target;
26533
26559
  const account = accountAuthority(cwd, world, once);
@@ -28735,7 +28761,7 @@ class WorkitCore {
28735
28761
  }
28736
28762
  // packages/workit-core/src/core/repo-context.ts
28737
28763
  import { spawnSync as spawnSync16 } from "node:child_process";
28738
- import { existsSync as existsSync11, readFileSync as readFileSync10, readdirSync as readdirSync4 } from "node:fs";
28764
+ import { existsSync as existsSync12, readFileSync as readFileSync10, readdirSync as readdirSync4 } from "node:fs";
28739
28765
  import path25 from "node:path";
28740
28766
  var isSafeContextRange = (value) => value.length <= 4096 && (() => {
28741
28767
  try {
@@ -28917,7 +28943,7 @@ var diffStatForRange = (cwd, range) => {
28917
28943
  };
28918
28944
  var packageScripts = (cwd, keys) => {
28919
28945
  const pkgPath = path25.join(cwd, "package.json");
28920
- if (!existsSync11(pkgPath))
28946
+ if (!existsSync12(pkgPath))
28921
28947
  return [];
28922
28948
  try {
28923
28949
  const pkg = JSON.parse(readFileSync10(pkgPath, "utf8"));
@@ -28952,7 +28978,7 @@ var documentationFiles = (cwd) => {
28952
28978
  return matches.toSorted().slice(0, 200);
28953
28979
  };
28954
28980
  var readTrimmed2 = (file, maxLines) => {
28955
- if (!existsSync11(file))
28981
+ if (!existsSync12(file))
28956
28982
  return "";
28957
28983
  const lines = readFileSync10(file, "utf8").split(`
28958
28984
  `);
@@ -29028,7 +29054,7 @@ ${status.stderr}` : "");
29028
29054
  stdout += `
29029
29055
  `;
29030
29056
  stdout += printSection("Recent Validation Signals");
29031
- if (existsSync11(path25.join(cwd, "package.json"))) {
29057
+ if (existsSync12(path25.join(cwd, "package.json"))) {
29032
29058
  stdout += `package.json detected. Common scripts:
29033
29059
  `;
29034
29060
  const found = packageScripts(cwd, ["lint", "format:check", "test", "build"]);
@@ -29037,7 +29063,7 @@ ${status.stderr}` : "");
29037
29063
  `) + `
29038
29064
  `;
29039
29065
  }
29040
- if (existsSync11(path25.join(cwd, "Cargo.toml")) || existsSync11(path25.join(cwd, "src-tauri/Cargo.toml"))) {
29066
+ if (existsSync12(path25.join(cwd, "Cargo.toml")) || existsSync12(path25.join(cwd, "src-tauri/Cargo.toml"))) {
29041
29067
  stdout += `Rust project detected.
29042
29068
  `;
29043
29069
  }
@@ -29089,7 +29115,7 @@ function changelogContext(root, range) {
29089
29115
  `;
29090
29116
  stdout += printSection("Existing CHANGELOG.md");
29091
29117
  const changelogPath = path25.join(cwd, "CHANGELOG.md");
29092
- if (existsSync11(changelogPath)) {
29118
+ if (existsSync12(changelogPath)) {
29093
29119
  stdout += readTrimmed2(changelogPath, 260) + `
29094
29120
  `;
29095
29121
  } else {
@@ -29131,7 +29157,7 @@ function docsRefreshContext(root, range) {
29131
29157
  `;
29132
29158
  stdout += printSection("README Preview");
29133
29159
  const readme = path25.join(cwd, "README.md");
29134
- if (existsSync11(readme)) {
29160
+ if (existsSync12(readme)) {
29135
29161
  stdout += readTrimmed2(readme, 220) + `
29136
29162
  `;
29137
29163
  } else {
@@ -29140,7 +29166,7 @@ function docsRefreshContext(root, range) {
29140
29166
  }
29141
29167
  stdout += printSection("Package Scripts");
29142
29168
  const pkgPath = path25.join(cwd, "package.json");
29143
- if (existsSync11(pkgPath)) {
29169
+ if (existsSync12(pkgPath)) {
29144
29170
  try {
29145
29171
  const pkg = JSON.parse(readFileSync10(pkgPath, "utf8"));
29146
29172
  stdout += JSON.stringify({ name: pkg.name, version: pkg.version, scripts: pkg.scripts }, null, 2) + `
@@ -29196,7 +29222,7 @@ function releaseNotesContext(root, rangeOrTag) {
29196
29222
  `;
29197
29223
  stdout += printSection("Existing Release Files");
29198
29224
  for (const rel of ["CHANGELOG.md", "RELEASE_NOTES.md", ".github/releases.md"]) {
29199
- if (existsSync11(path25.join(cwd, rel)))
29225
+ if (existsSync12(path25.join(cwd, rel)))
29200
29226
  stdout += rel + `
29201
29227
  `;
29202
29228
  }
@@ -29804,7 +29830,7 @@ function resolveInside(root, candidate) {
29804
29830
  throw new Error("path must stay inside repository root");
29805
29831
  }
29806
29832
  let ancestor = target;
29807
- while (!existsSync12(ancestor))
29833
+ while (!existsSync13(ancestor))
29808
29834
  ancestor = path29.dirname(ancestor);
29809
29835
  const canonicalAncestor = realpathSync9(ancestor);
29810
29836
  if (canonicalAncestor !== base && !canonicalAncestor.startsWith(base + path29.sep)) {
@@ -30007,7 +30033,7 @@ function createMcpServer(host, contextProvider) {
30007
30033
  path30.join(here, "server.ts"),
30008
30034
  path30.join(here, "..", "..", "workit-core", "src", "core", "task-contract.ts"),
30009
30035
  path30.join(here, "..", "..", "workit-core", "src", "core", "task-engine.ts")
30010
- ].filter((file) => existsSync13(file)));
30036
+ ].filter((file) => existsSync14(file)));
30011
30037
  let staleWarned = false;
30012
30038
  const failures = new Map;
30013
30039
  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.13.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.13.0",
48
48
  "zod": "4.6.5"
49
49
  },
50
50
  "engines": {