@workit-dev/mcp 2.11.1 → 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.
- package/dist/index.js +45 -18
- 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
|
|
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
|
|
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
|
|
@@ -17885,6 +17885,7 @@ var workspaceConfigSchema = object({
|
|
|
17885
17885
|
releaseNotes: unknown().optional().describe("The release notes `workit release finish` publishes on the forge release: `auto` (default: the draft when there is one, else the notes built from the version's changelog section), `off` (no forge release) or `review` (finish refuses until `workit release notes approve`). A release track overrides it."),
|
|
17886
17886
|
trailers: boolean2().optional().describe("Whether commits get the `Workit-Session:` trailer (default true). With false, authorship lives in the ledger only."),
|
|
17887
17887
|
deleteBranch: boolean2().optional().describe("Whether `workit pr merge` deletes the head branch after a merge (default true); `--keep-branch` opts out for one merge."),
|
|
17888
|
+
cleanup: unknown().optional().describe("What happens when work finishes: `auto` (default) removes the delivered branch's clean Workit worktree and local branch, switches a clean checkout on it back to the trunk, and stops the processes registered inside them; `keep` removes and stops nothing. A value Workit does not know reads as `keep`."),
|
|
17888
17889
|
liveSessionGuard: boolean2().optional().describe("Whether the live-session guard denies edits in a checkout another live agent session owns (default true)."),
|
|
17889
17890
|
fanout: object({
|
|
17890
17891
|
tierModels: unknown().optional().describe("The model per slice TIER (mundane, standard, hard), as one name or per host.")
|
|
@@ -26211,6 +26212,7 @@ var exportDigest = (bundle) => sha256({
|
|
|
26211
26212
|
task: bundle.task
|
|
26212
26213
|
});
|
|
26213
26214
|
// packages/workit-core/src/autonomy.ts
|
|
26215
|
+
import { closeSync as closeSync2, copyFileSync as copyFileSync2, existsSync as existsSync11, openSync as openSync2 } from "node:fs";
|
|
26214
26216
|
import path24 from "node:path";
|
|
26215
26217
|
|
|
26216
26218
|
// packages/workit-core/src/core/eval-world.ts
|
|
@@ -26307,12 +26309,36 @@ function checkSeal(dir) {
|
|
|
26307
26309
|
}
|
|
26308
26310
|
|
|
26309
26311
|
// packages/workit-core/src/autonomy.ts
|
|
26310
|
-
var
|
|
26312
|
+
var accountHomeDir = () => {
|
|
26311
26313
|
const home = grantsHome.resolve();
|
|
26312
26314
|
return home === null ? null : configDir({ HOME: home });
|
|
26313
26315
|
};
|
|
26314
|
-
var
|
|
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();
|
|
26315
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
|
+
};
|
|
26316
26342
|
var entriesIn = (dir) => dir === null ? [] : loadWorkspacesFrom(dir);
|
|
26317
26343
|
var fileSource = (dir = accountDir()) => ({
|
|
26318
26344
|
resolve: (cwd, name) => dir === null ? null : resolveWorkspaceFrom(cwd, dir, name),
|
|
@@ -26355,7 +26381,7 @@ var benchWorld = (cwd) => {
|
|
|
26355
26381
|
var grantsOverride = () => {
|
|
26356
26382
|
const shown = shownGrantsDir();
|
|
26357
26383
|
if (shown === null)
|
|
26358
|
-
return NO_ACCOUNT;
|
|
26384
|
+
return accountUnread() ?? NO_ACCOUNT;
|
|
26359
26385
|
const configured = path24.resolve(resolveConfigDir());
|
|
26360
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`;
|
|
26361
26387
|
};
|
|
@@ -26524,9 +26550,10 @@ function capAt(source, named, where, by, why, main = false) {
|
|
|
26524
26550
|
}
|
|
26525
26551
|
function resolveAutonomy(cwd, target) {
|
|
26526
26552
|
const world = benchWorld(cwd);
|
|
26553
|
+
const unread = world ? null : accountUnread();
|
|
26554
|
+
if (unread !== null)
|
|
26555
|
+
return { ...autonomyOf(null), note: unread };
|
|
26527
26556
|
const override = world ? null : grantsOverride();
|
|
26528
|
-
if (override === NO_ACCOUNT)
|
|
26529
|
-
return { ...autonomyOf(null), note: override };
|
|
26530
26557
|
let resolved;
|
|
26531
26558
|
const once = typeof target === "function" ? () => resolved ??= target() : target;
|
|
26532
26559
|
const account = accountAuthority(cwd, world, once);
|
|
@@ -28734,7 +28761,7 @@ class WorkitCore {
|
|
|
28734
28761
|
}
|
|
28735
28762
|
// packages/workit-core/src/core/repo-context.ts
|
|
28736
28763
|
import { spawnSync as spawnSync16 } from "node:child_process";
|
|
28737
|
-
import { existsSync as
|
|
28764
|
+
import { existsSync as existsSync12, readFileSync as readFileSync10, readdirSync as readdirSync4 } from "node:fs";
|
|
28738
28765
|
import path25 from "node:path";
|
|
28739
28766
|
var isSafeContextRange = (value) => value.length <= 4096 && (() => {
|
|
28740
28767
|
try {
|
|
@@ -28916,7 +28943,7 @@ var diffStatForRange = (cwd, range) => {
|
|
|
28916
28943
|
};
|
|
28917
28944
|
var packageScripts = (cwd, keys) => {
|
|
28918
28945
|
const pkgPath = path25.join(cwd, "package.json");
|
|
28919
|
-
if (!
|
|
28946
|
+
if (!existsSync12(pkgPath))
|
|
28920
28947
|
return [];
|
|
28921
28948
|
try {
|
|
28922
28949
|
const pkg = JSON.parse(readFileSync10(pkgPath, "utf8"));
|
|
@@ -28951,7 +28978,7 @@ var documentationFiles = (cwd) => {
|
|
|
28951
28978
|
return matches.toSorted().slice(0, 200);
|
|
28952
28979
|
};
|
|
28953
28980
|
var readTrimmed2 = (file, maxLines) => {
|
|
28954
|
-
if (!
|
|
28981
|
+
if (!existsSync12(file))
|
|
28955
28982
|
return "";
|
|
28956
28983
|
const lines = readFileSync10(file, "utf8").split(`
|
|
28957
28984
|
`);
|
|
@@ -29027,7 +29054,7 @@ ${status.stderr}` : "");
|
|
|
29027
29054
|
stdout += `
|
|
29028
29055
|
`;
|
|
29029
29056
|
stdout += printSection("Recent Validation Signals");
|
|
29030
|
-
if (
|
|
29057
|
+
if (existsSync12(path25.join(cwd, "package.json"))) {
|
|
29031
29058
|
stdout += `package.json detected. Common scripts:
|
|
29032
29059
|
`;
|
|
29033
29060
|
const found = packageScripts(cwd, ["lint", "format:check", "test", "build"]);
|
|
@@ -29036,7 +29063,7 @@ ${status.stderr}` : "");
|
|
|
29036
29063
|
`) + `
|
|
29037
29064
|
`;
|
|
29038
29065
|
}
|
|
29039
|
-
if (
|
|
29066
|
+
if (existsSync12(path25.join(cwd, "Cargo.toml")) || existsSync12(path25.join(cwd, "src-tauri/Cargo.toml"))) {
|
|
29040
29067
|
stdout += `Rust project detected.
|
|
29041
29068
|
`;
|
|
29042
29069
|
}
|
|
@@ -29088,7 +29115,7 @@ function changelogContext(root, range) {
|
|
|
29088
29115
|
`;
|
|
29089
29116
|
stdout += printSection("Existing CHANGELOG.md");
|
|
29090
29117
|
const changelogPath = path25.join(cwd, "CHANGELOG.md");
|
|
29091
|
-
if (
|
|
29118
|
+
if (existsSync12(changelogPath)) {
|
|
29092
29119
|
stdout += readTrimmed2(changelogPath, 260) + `
|
|
29093
29120
|
`;
|
|
29094
29121
|
} else {
|
|
@@ -29130,7 +29157,7 @@ function docsRefreshContext(root, range) {
|
|
|
29130
29157
|
`;
|
|
29131
29158
|
stdout += printSection("README Preview");
|
|
29132
29159
|
const readme = path25.join(cwd, "README.md");
|
|
29133
|
-
if (
|
|
29160
|
+
if (existsSync12(readme)) {
|
|
29134
29161
|
stdout += readTrimmed2(readme, 220) + `
|
|
29135
29162
|
`;
|
|
29136
29163
|
} else {
|
|
@@ -29139,7 +29166,7 @@ function docsRefreshContext(root, range) {
|
|
|
29139
29166
|
}
|
|
29140
29167
|
stdout += printSection("Package Scripts");
|
|
29141
29168
|
const pkgPath = path25.join(cwd, "package.json");
|
|
29142
|
-
if (
|
|
29169
|
+
if (existsSync12(pkgPath)) {
|
|
29143
29170
|
try {
|
|
29144
29171
|
const pkg = JSON.parse(readFileSync10(pkgPath, "utf8"));
|
|
29145
29172
|
stdout += JSON.stringify({ name: pkg.name, version: pkg.version, scripts: pkg.scripts }, null, 2) + `
|
|
@@ -29195,7 +29222,7 @@ function releaseNotesContext(root, rangeOrTag) {
|
|
|
29195
29222
|
`;
|
|
29196
29223
|
stdout += printSection("Existing Release Files");
|
|
29197
29224
|
for (const rel of ["CHANGELOG.md", "RELEASE_NOTES.md", ".github/releases.md"]) {
|
|
29198
|
-
if (
|
|
29225
|
+
if (existsSync12(path25.join(cwd, rel)))
|
|
29199
29226
|
stdout += rel + `
|
|
29200
29227
|
`;
|
|
29201
29228
|
}
|
|
@@ -29803,7 +29830,7 @@ function resolveInside(root, candidate) {
|
|
|
29803
29830
|
throw new Error("path must stay inside repository root");
|
|
29804
29831
|
}
|
|
29805
29832
|
let ancestor = target;
|
|
29806
|
-
while (!
|
|
29833
|
+
while (!existsSync13(ancestor))
|
|
29807
29834
|
ancestor = path29.dirname(ancestor);
|
|
29808
29835
|
const canonicalAncestor = realpathSync9(ancestor);
|
|
29809
29836
|
if (canonicalAncestor !== base && !canonicalAncestor.startsWith(base + path29.sep)) {
|
|
@@ -30006,7 +30033,7 @@ function createMcpServer(host, contextProvider) {
|
|
|
30006
30033
|
path30.join(here, "server.ts"),
|
|
30007
30034
|
path30.join(here, "..", "..", "workit-core", "src", "core", "task-contract.ts"),
|
|
30008
30035
|
path30.join(here, "..", "..", "workit-core", "src", "core", "task-engine.ts")
|
|
30009
|
-
].filter((file) =>
|
|
30036
|
+
].filter((file) => existsSync14(file)));
|
|
30010
30037
|
let staleWarned = false;
|
|
30011
30038
|
const failures = new Map;
|
|
30012
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.
|
|
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.
|
|
47
|
+
"@workit-dev/core": "^2.13.0",
|
|
48
48
|
"zod": "4.6.5"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|