@workit-dev/mcp 1.4.2 → 1.5.1
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 +113 -69
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -6620,11 +6620,11 @@ var require_dist = __commonJS(function(exports, module) {
|
|
|
6620
6620
|
|
|
6621
6621
|
// packages/workit-mcp/src/index.ts
|
|
6622
6622
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
6623
|
-
import
|
|
6623
|
+
import path29 from "node:path";
|
|
6624
6624
|
|
|
6625
6625
|
// packages/workit-mcp/src/server.ts
|
|
6626
|
-
import { existsSync as
|
|
6627
|
-
import
|
|
6626
|
+
import { existsSync as existsSync11, readFileSync as readFileSync8, realpathSync as realpathSync9 } from "node:fs";
|
|
6627
|
+
import path28 from "node:path";
|
|
6628
6628
|
|
|
6629
6629
|
// node_modules/zod/v4/core/util.js
|
|
6630
6630
|
function getEnumValues(entries) {
|
|
@@ -14937,8 +14937,8 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
|
14937
14937
|
|
|
14938
14938
|
// packages/workit-core/src/core.ts
|
|
14939
14939
|
import { spawnSync as spawnSync19 } from "node:child_process";
|
|
14940
|
-
import { existsSync as
|
|
14941
|
-
import
|
|
14940
|
+
import { existsSync as existsSync10, realpathSync as realpathSync8 } from "node:fs";
|
|
14941
|
+
import path27 from "node:path";
|
|
14942
14942
|
|
|
14943
14943
|
// packages/workit-core/src/core/task-contract.ts
|
|
14944
14944
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -24704,12 +24704,11 @@ function checkVerdictsOnce(cwd, branch, ledgerRows) {
|
|
|
24704
24704
|
}
|
|
24705
24705
|
return reasons;
|
|
24706
24706
|
};
|
|
24707
|
-
const
|
|
24707
|
+
const voided = verdictVoids(rows, { chained: true });
|
|
24708
|
+
const retired = new Set(voided.keys());
|
|
24708
24709
|
for (const row of rows)
|
|
24709
|
-
if (row.type === "verdict" && row.supersedes && !row.supersedeIgnored && trustReasons(cwd, row).length === 0)
|
|
24710
|
+
if (row.type === "verdict" && row.supersedes && !row.supersedeIgnored && !voided.has(row.id) && trustReasons(cwd, row).length === 0)
|
|
24710
24711
|
retired.add(row.supersedes);
|
|
24711
|
-
for (const id of verdictVoids(rows, { chained: true }).keys())
|
|
24712
|
-
retired.add(id);
|
|
24713
24712
|
const byKind = new Map;
|
|
24714
24713
|
for (const row of rows.toSorted(byRank))
|
|
24715
24714
|
if (isLiveVerdict(row, retired) && scope(row)) {
|
|
@@ -26124,20 +26123,64 @@ var exportDigest = (bundle) => sha256({
|
|
|
26124
26123
|
task: bundle.task
|
|
26125
26124
|
});
|
|
26126
26125
|
// packages/workit-core/src/autonomy.ts
|
|
26126
|
+
import os6 from "node:os";
|
|
26127
|
+
import path22 from "node:path";
|
|
26128
|
+
|
|
26129
|
+
// packages/workit-core/src/core/eval-world.ts
|
|
26130
|
+
import { existsSync as existsSync8, realpathSync as realpathSync5 } from "node:fs";
|
|
26127
26131
|
import os5 from "node:os";
|
|
26128
26132
|
import path21 from "node:path";
|
|
26133
|
+
var EVAL_WORLD_ENV = "WORKIT_EVAL_WORLD";
|
|
26134
|
+
var EVAL_WORLD_MARKER = ".workit-eval-world";
|
|
26135
|
+
var inside2 = (dir, file) => {
|
|
26136
|
+
const rel = path21.relative(dir, file);
|
|
26137
|
+
return !rel.startsWith("..") && !path21.isAbsolute(rel);
|
|
26138
|
+
};
|
|
26139
|
+
var evalWorldEntry = (cwd) => {
|
|
26140
|
+
const raw = process.env[EVAL_WORLD_ENV];
|
|
26141
|
+
if (!raw || !path21.isAbsolute(raw))
|
|
26142
|
+
return null;
|
|
26143
|
+
try {
|
|
26144
|
+
const world = realpathSync5(raw);
|
|
26145
|
+
if (!inside2(realpathSync5(os5.tmpdir()), world) || !inside2(world, realpathSync5(cwd)) || !existsSync8(path21.join(world, EVAL_WORLD_MARKER)))
|
|
26146
|
+
return null;
|
|
26147
|
+
return loadWorkspacesFrom(path21.join(world, "config"))[0] ?? null;
|
|
26148
|
+
} catch {
|
|
26149
|
+
return null;
|
|
26150
|
+
}
|
|
26151
|
+
};
|
|
26152
|
+
|
|
26153
|
+
// packages/workit-core/src/autonomy.ts
|
|
26129
26154
|
var accountHome2 = () => {
|
|
26130
26155
|
try {
|
|
26131
|
-
return
|
|
26156
|
+
return os6.userInfo().homedir;
|
|
26132
26157
|
} catch {
|
|
26133
|
-
return
|
|
26158
|
+
return os6.homedir();
|
|
26134
26159
|
}
|
|
26135
26160
|
};
|
|
26136
26161
|
var grantsHome = { resolve: accountHome2 };
|
|
26137
26162
|
var grantsDir = () => configDir({ HOME: grantsHome.resolve() });
|
|
26163
|
+
var benchWorld = (cwd) => {
|
|
26164
|
+
const entry = evalWorldEntry(cwd);
|
|
26165
|
+
if (!entry)
|
|
26166
|
+
return null;
|
|
26167
|
+
const { grants } = configuredGrants(entry);
|
|
26168
|
+
const lowered = {};
|
|
26169
|
+
for (const kind of GRANT_KINDS) {
|
|
26170
|
+
const value = grants[kind];
|
|
26171
|
+
if (value !== undefined && raises(kind, value, DEFAULT_GRANTS[kind]))
|
|
26172
|
+
lowered[kind] = value;
|
|
26173
|
+
}
|
|
26174
|
+
return {
|
|
26175
|
+
name: entry.name,
|
|
26176
|
+
glob: entry.glob,
|
|
26177
|
+
...entry.defaultEndpoint ? { defaultEndpoint: entry.defaultEndpoint } : {},
|
|
26178
|
+
autonomy: lowered
|
|
26179
|
+
};
|
|
26180
|
+
};
|
|
26138
26181
|
var grantsOverride = () => {
|
|
26139
|
-
const configured =
|
|
26140
|
-
return configured ===
|
|
26182
|
+
const configured = path22.resolve(resolveConfigDir());
|
|
26183
|
+
return configured === path22.resolve(grantsDir()) ? 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 ${path22.join(grantsDir(), "workspaces.json")}, so the D4 defaults apply until grants are set there`;
|
|
26141
26184
|
};
|
|
26142
26185
|
var GRANT_KINDS = ["push", "pr", "merge", "release", "rerun"];
|
|
26143
26186
|
var DEFAULT_GRANTS = Object.freeze({
|
|
@@ -26302,11 +26345,12 @@ function capAt(named, where, by, why, main = false) {
|
|
|
26302
26345
|
};
|
|
26303
26346
|
}
|
|
26304
26347
|
function resolveAutonomy(cwd, target) {
|
|
26305
|
-
const
|
|
26348
|
+
const world = benchWorld(cwd);
|
|
26349
|
+
const override = world ? null : grantsOverride();
|
|
26306
26350
|
if (override)
|
|
26307
26351
|
return { ...autonomyOf(null), note: override };
|
|
26308
26352
|
const name = process.env.WORKIT_WORKSPACE_NAME?.trim() || undefined;
|
|
26309
|
-
let autonomy = autonomyOf(resolveWorkspaceFrom(cwd, grantsDir(), name));
|
|
26353
|
+
let autonomy = autonomyOf(resolveWorkspaceFrom(cwd, grantsDir(), name) ?? world);
|
|
26310
26354
|
if (name)
|
|
26311
26355
|
autonomy = capAt(autonomy, cwd, `WORKIT_WORKSPACE_NAME=${name}`, "a name never raises grants");
|
|
26312
26356
|
const above = checkoutsAbove(cwd);
|
|
@@ -26455,7 +26499,7 @@ var BRANCH_RENAME = new Set(["-m", "-M", "--move", "-c", "-C", "--copy"]);
|
|
|
26455
26499
|
var WORKTREE_VALUES = new Set(["--reason"]);
|
|
26456
26500
|
var FETCH_VALUES = new Set(["--depth", "--deepen", "--shallow-since", "--shallow-exclude", "--refmap", "-j", "--jobs"].concat(["--upload-pack", "-o", "--server-option", "--negotiation-tip", "--filter"]).concat(["--recurse-submodules-default", "--submodule-prefix", "-s", "--strategy", "-X"]).concat(["--strategy-option"]));
|
|
26457
26501
|
// packages/workit-core/src/core/task-engine.ts
|
|
26458
|
-
import { realpathSync as
|
|
26502
|
+
import { realpathSync as realpathSync7 } from "node:fs";
|
|
26459
26503
|
|
|
26460
26504
|
// packages/workit-core/src/core/policy-resolver.ts
|
|
26461
26505
|
function resolvePolicy(input) {
|
|
@@ -26704,12 +26748,12 @@ var judgeInputSummary = (raw) => {
|
|
|
26704
26748
|
};
|
|
26705
26749
|
|
|
26706
26750
|
// packages/workit-core/src/core/task-view.ts
|
|
26707
|
-
import { realpathSync as
|
|
26751
|
+
import { realpathSync as realpathSync6 } from "node:fs";
|
|
26708
26752
|
var environment = () => [];
|
|
26709
26753
|
var sameSession2 = (value, context) => typeof value === "object" && value !== null && value.kind === "host" && value.host === context.caller.host && value.handle === context.caller.actor;
|
|
26710
26754
|
function contextRootError(store, context) {
|
|
26711
26755
|
try {
|
|
26712
|
-
|
|
26756
|
+
realpathSync6(context.root);
|
|
26713
26757
|
const root = checkoutRootOf(context.root);
|
|
26714
26758
|
if (root !== store.root && !sameDirectoryIdentity(root, store.root))
|
|
26715
26759
|
return failure2("invalid_input", "operation context root does not match the task store root");
|
|
@@ -28179,7 +28223,7 @@ class WorkitCore {
|
|
|
28179
28223
|
if (view.task.workspaceId !== view.workspace.id)
|
|
28180
28224
|
return failure2("invalid_input", "task and workspace bindings are invalid");
|
|
28181
28225
|
try {
|
|
28182
|
-
if (
|
|
28226
|
+
if (realpathSync7(view.workspace.root) !== this.store.root)
|
|
28183
28227
|
return failure2("invalid_input", "task view root does not match the task store");
|
|
28184
28228
|
} catch {
|
|
28185
28229
|
return failure2("invalid_input", "task view root cannot be resolved");
|
|
@@ -28430,8 +28474,8 @@ class WorkitCore {
|
|
|
28430
28474
|
}
|
|
28431
28475
|
// packages/workit-core/src/core/repo-context.ts
|
|
28432
28476
|
import { spawnSync as spawnSync15 } from "node:child_process";
|
|
28433
|
-
import { existsSync as
|
|
28434
|
-
import
|
|
28477
|
+
import { existsSync as existsSync9, readFileSync as readFileSync7, readdirSync as readdirSync3 } from "node:fs";
|
|
28478
|
+
import path23 from "node:path";
|
|
28435
28479
|
var isSafeContextRange = (value) => value.length <= 4096 && (() => {
|
|
28436
28480
|
try {
|
|
28437
28481
|
gitRevisionParts(value);
|
|
@@ -28575,13 +28619,13 @@ var findPrTemplate = (cwd) => {
|
|
|
28575
28619
|
for (const rel of PR_TEMPLATE_FILES) {
|
|
28576
28620
|
const parts = rel.split("/");
|
|
28577
28621
|
const base = parts[parts.length - 1];
|
|
28578
|
-
const dir = parts.length > 1 ?
|
|
28622
|
+
const dir = parts.length > 1 ? path23.join(cwd, ...parts.slice(0, -1)) : cwd;
|
|
28579
28623
|
const actual = probeCaseInsensitive(dir, base);
|
|
28580
28624
|
if (actual)
|
|
28581
28625
|
return [...parts.slice(0, -1), actual].join("/");
|
|
28582
28626
|
}
|
|
28583
28627
|
for (const rel of PR_TEMPLATE_DIRS) {
|
|
28584
|
-
const only = singleMarkdown(
|
|
28628
|
+
const only = singleMarkdown(path23.join(cwd, ...rel.split("/")));
|
|
28585
28629
|
if (only)
|
|
28586
28630
|
return `${rel}/${only}`;
|
|
28587
28631
|
}
|
|
@@ -28611,8 +28655,8 @@ var diffStatForRange = (cwd, range) => {
|
|
|
28611
28655
|
return runGit(cwd, ["diff", "--stat", "--"]).stdout;
|
|
28612
28656
|
};
|
|
28613
28657
|
var packageScripts = (cwd, keys) => {
|
|
28614
|
-
const pkgPath =
|
|
28615
|
-
if (!
|
|
28658
|
+
const pkgPath = path23.join(cwd, "package.json");
|
|
28659
|
+
if (!existsSync9(pkgPath))
|
|
28616
28660
|
return [];
|
|
28617
28661
|
try {
|
|
28618
28662
|
const pkg = JSON.parse(readFileSync7(pkgPath, "utf8"));
|
|
@@ -28637,9 +28681,9 @@ var documentationFiles = (cwd) => {
|
|
|
28637
28681
|
if (entry.isDirectory()) {
|
|
28638
28682
|
if (excluded.has(entry.name))
|
|
28639
28683
|
continue;
|
|
28640
|
-
walk(
|
|
28684
|
+
walk(path23.join(dir, entry.name), depth + 1);
|
|
28641
28685
|
} else if (entry.isFile() && (entry.name === "README.md" || entry.name.endsWith(".md"))) {
|
|
28642
|
-
matches.push("./" +
|
|
28686
|
+
matches.push("./" + path23.relative(cwd, path23.join(dir, entry.name)).replaceAll("\\", "/"));
|
|
28643
28687
|
}
|
|
28644
28688
|
}
|
|
28645
28689
|
};
|
|
@@ -28647,7 +28691,7 @@ var documentationFiles = (cwd) => {
|
|
|
28647
28691
|
return matches.toSorted().slice(0, 200);
|
|
28648
28692
|
};
|
|
28649
28693
|
var readTrimmed2 = (file, maxLines) => {
|
|
28650
|
-
if (!
|
|
28694
|
+
if (!existsSync9(file))
|
|
28651
28695
|
return "";
|
|
28652
28696
|
const lines = readFileSync7(file, "utf8").split(`
|
|
28653
28697
|
`);
|
|
@@ -28655,7 +28699,7 @@ var readTrimmed2 = (file, maxLines) => {
|
|
|
28655
28699
|
`);
|
|
28656
28700
|
};
|
|
28657
28701
|
function prReadyContext(root, range) {
|
|
28658
|
-
const cwd =
|
|
28702
|
+
const cwd = path23.resolve(repoRoot(root));
|
|
28659
28703
|
if (range !== undefined && !isResolvableContextRange(cwd, range))
|
|
28660
28704
|
return invalidRange(cwd);
|
|
28661
28705
|
let stdout = "";
|
|
@@ -28713,7 +28757,7 @@ ${status.stderr}` : "");
|
|
|
28713
28757
|
stdout += `template_path: ${template}
|
|
28714
28758
|
|
|
28715
28759
|
`;
|
|
28716
|
-
stdout += readTrimmed2(
|
|
28760
|
+
stdout += readTrimmed2(path23.join(cwd, template), 220);
|
|
28717
28761
|
} else {
|
|
28718
28762
|
stdout += `template_path: none
|
|
28719
28763
|
|
|
@@ -28723,7 +28767,7 @@ ${status.stderr}` : "");
|
|
|
28723
28767
|
stdout += `
|
|
28724
28768
|
`;
|
|
28725
28769
|
stdout += printSection("Recent Validation Signals");
|
|
28726
|
-
if (
|
|
28770
|
+
if (existsSync9(path23.join(cwd, "package.json"))) {
|
|
28727
28771
|
stdout += `package.json detected. Common scripts:
|
|
28728
28772
|
`;
|
|
28729
28773
|
const found = packageScripts(cwd, ["lint", "format:check", "test", "build"]);
|
|
@@ -28732,7 +28776,7 @@ ${status.stderr}` : "");
|
|
|
28732
28776
|
`) + `
|
|
28733
28777
|
`;
|
|
28734
28778
|
}
|
|
28735
|
-
if (
|
|
28779
|
+
if (existsSync9(path23.join(cwd, "Cargo.toml")) || existsSync9(path23.join(cwd, "src-tauri/Cargo.toml"))) {
|
|
28736
28780
|
stdout += `Rust project detected.
|
|
28737
28781
|
`;
|
|
28738
28782
|
}
|
|
@@ -28765,7 +28809,7 @@ var CHANGELOG_RULES = `- Use an [Unreleased] section.
|
|
|
28765
28809
|
- Apply with the host-native editor, preserving the repository changelog conventions.
|
|
28766
28810
|
- If Unreleased already has duplicate category headings, normalize_only first.`;
|
|
28767
28811
|
function changelogContext(root, range) {
|
|
28768
|
-
const cwd =
|
|
28812
|
+
const cwd = path23.resolve(repoRoot(root));
|
|
28769
28813
|
if (range !== undefined && !isResolvableContextRange(cwd, range))
|
|
28770
28814
|
return invalidRange(cwd);
|
|
28771
28815
|
const resolvedRange = rangeArgOrDefault(range, cwd);
|
|
@@ -28783,8 +28827,8 @@ function changelogContext(root, range) {
|
|
|
28783
28827
|
stdout += CHANGELOG_RULES + `
|
|
28784
28828
|
`;
|
|
28785
28829
|
stdout += printSection("Existing CHANGELOG.md");
|
|
28786
|
-
const changelogPath =
|
|
28787
|
-
if (
|
|
28830
|
+
const changelogPath = path23.join(cwd, "CHANGELOG.md");
|
|
28831
|
+
if (existsSync9(changelogPath)) {
|
|
28788
28832
|
stdout += readTrimmed2(changelogPath, 260) + `
|
|
28789
28833
|
`;
|
|
28790
28834
|
} else {
|
|
@@ -28803,7 +28847,7 @@ function changelogContext(root, range) {
|
|
|
28803
28847
|
return { stdout, stderr: "", exitCode: 0, cwd };
|
|
28804
28848
|
}
|
|
28805
28849
|
function docsRefreshContext(root, range) {
|
|
28806
|
-
const cwd =
|
|
28850
|
+
const cwd = path23.resolve(repoRoot(root));
|
|
28807
28851
|
if (range !== undefined && !isResolvableContextRange(cwd, range))
|
|
28808
28852
|
return invalidRange(cwd);
|
|
28809
28853
|
const resolvedRange = rangeArgOrDefault(range, cwd);
|
|
@@ -28825,8 +28869,8 @@ function docsRefreshContext(root, range) {
|
|
|
28825
28869
|
`) + `
|
|
28826
28870
|
`;
|
|
28827
28871
|
stdout += printSection("README Preview");
|
|
28828
|
-
const readme =
|
|
28829
|
-
if (
|
|
28872
|
+
const readme = path23.join(cwd, "README.md");
|
|
28873
|
+
if (existsSync9(readme)) {
|
|
28830
28874
|
stdout += readTrimmed2(readme, 220) + `
|
|
28831
28875
|
`;
|
|
28832
28876
|
} else {
|
|
@@ -28834,8 +28878,8 @@ function docsRefreshContext(root, range) {
|
|
|
28834
28878
|
`;
|
|
28835
28879
|
}
|
|
28836
28880
|
stdout += printSection("Package Scripts");
|
|
28837
|
-
const pkgPath =
|
|
28838
|
-
if (
|
|
28881
|
+
const pkgPath = path23.join(cwd, "package.json");
|
|
28882
|
+
if (existsSync9(pkgPath)) {
|
|
28839
28883
|
try {
|
|
28840
28884
|
const pkg = JSON.parse(readFileSync7(pkgPath, "utf8"));
|
|
28841
28885
|
stdout += JSON.stringify({ name: pkg.name, version: pkg.version, scripts: pkg.scripts }, null, 2) + `
|
|
@@ -28848,7 +28892,7 @@ function docsRefreshContext(root, range) {
|
|
|
28848
28892
|
return { stdout, stderr: "", exitCode: 0, cwd };
|
|
28849
28893
|
}
|
|
28850
28894
|
function releaseNotesContext(root, rangeOrTag) {
|
|
28851
|
-
const cwd =
|
|
28895
|
+
const cwd = path23.resolve(repoRoot(root));
|
|
28852
28896
|
if (!rangeOrTag) {
|
|
28853
28897
|
return {
|
|
28854
28898
|
stdout: "",
|
|
@@ -28891,7 +28935,7 @@ function releaseNotesContext(root, rangeOrTag) {
|
|
|
28891
28935
|
`;
|
|
28892
28936
|
stdout += printSection("Existing Release Files");
|
|
28893
28937
|
for (const rel of ["CHANGELOG.md", "RELEASE_NOTES.md", ".github/releases.md"]) {
|
|
28894
|
-
if (
|
|
28938
|
+
if (existsSync9(path23.join(cwd, rel)))
|
|
28895
28939
|
stdout += rel + `
|
|
28896
28940
|
`;
|
|
28897
28941
|
}
|
|
@@ -28923,7 +28967,7 @@ import { spawnSync as spawnSync17 } from "node:child_process";
|
|
|
28923
28967
|
|
|
28924
28968
|
// packages/workit-core/src/core/pr-create.ts
|
|
28925
28969
|
import fs16 from "node:fs";
|
|
28926
|
-
import
|
|
28970
|
+
import path24 from "node:path";
|
|
28927
28971
|
import { spawnSync as spawnSync16 } from "node:child_process";
|
|
28928
28972
|
// packages/workit-core/src/forge/pr-body.ts
|
|
28929
28973
|
function parseGhIssue(value) {
|
|
@@ -28943,11 +28987,11 @@ var LOCAL = bounded(20000);
|
|
|
28943
28987
|
var NETWORK = bounded(60000);
|
|
28944
28988
|
function whichOnPath(tool) {
|
|
28945
28989
|
const names = process.platform === "win32" ? [tool, `${tool}.exe`, `${tool}.cmd`] : [tool];
|
|
28946
|
-
for (const dir of (process.env.PATH ?? "").split(
|
|
28990
|
+
for (const dir of (process.env.PATH ?? "").split(path24.delimiter)) {
|
|
28947
28991
|
if (!dir)
|
|
28948
28992
|
continue;
|
|
28949
28993
|
for (const name of names) {
|
|
28950
|
-
const candidate =
|
|
28994
|
+
const candidate = path24.join(dir, name);
|
|
28951
28995
|
try {
|
|
28952
28996
|
fs16.accessSync(candidate, fs16.constants.X_OK);
|
|
28953
28997
|
return candidate;
|
|
@@ -29068,7 +29112,7 @@ var fetchGitLabIssueBody = async (ref, root, deps = {}) => {
|
|
|
29068
29112
|
|
|
29069
29113
|
// packages/workit-core/src/core/youtrack.ts
|
|
29070
29114
|
import fs18 from "node:fs";
|
|
29071
|
-
import
|
|
29115
|
+
import path26 from "node:path";
|
|
29072
29116
|
|
|
29073
29117
|
// packages/workit-core/src/core/templates.ts
|
|
29074
29118
|
var repoRoot2 = assetRoot();
|
|
@@ -29083,7 +29127,7 @@ import { spawnSync as spawnSync18 } from "node:child_process";
|
|
|
29083
29127
|
|
|
29084
29128
|
// packages/workit-core/src/forge/exec.ts
|
|
29085
29129
|
import fs17 from "node:fs";
|
|
29086
|
-
import
|
|
29130
|
+
import path25 from "node:path";
|
|
29087
29131
|
|
|
29088
29132
|
// packages/workit-core/src/forge/redact.ts
|
|
29089
29133
|
var KEY = String.raw`[A-Za-z0-9_.-]*?(?:token|secret|password|passwd|pwd|api[_-]?key|access[_-]?key|account[_-]?key|private[_-]?key|client[_-]?secret|credentials?|authorization|cookie|signature)[A-Za-z0-9_.-]*`;
|
|
@@ -29094,11 +29138,11 @@ var ANSI = new RegExp(String.raw`\u001b\[[0-9;?]*[ -/]*[@-~]|\u001b\][^\u0007]*\
|
|
|
29094
29138
|
// packages/workit-core/src/forge/exec.ts
|
|
29095
29139
|
var MAX_BUFFER2 = 64 * 1024 * 1024;
|
|
29096
29140
|
function findExecutable(bin, env) {
|
|
29097
|
-
const dirs = (env.PATH ?? env.Path ?? "").split(
|
|
29141
|
+
const dirs = (env.PATH ?? env.Path ?? "").split(path25.delimiter).filter(Boolean);
|
|
29098
29142
|
const exts = process.platform === "win32" ? [".exe"] : [""];
|
|
29099
29143
|
for (const dir of dirs)
|
|
29100
29144
|
for (const ext of exts) {
|
|
29101
|
-
const candidate =
|
|
29145
|
+
const candidate = path25.join(dir, `${bin}${ext}`);
|
|
29102
29146
|
try {
|
|
29103
29147
|
const stat = fs17.statSync(candidate);
|
|
29104
29148
|
if (stat.isFile())
|
|
@@ -29141,7 +29185,7 @@ var YTRACK_MISSING = "ytrack is not on PATH: Workit reaches YouTrack only throug
|
|
|
29141
29185
|
|
|
29142
29186
|
// packages/workit-core/src/core/youtrack.ts
|
|
29143
29187
|
var ISSUE_RE = /^[A-Z]+-\d+$/;
|
|
29144
|
-
var youTrackReadOnlyConfigPath = () => process.env.WORKIT_YOUTRACK_CONFIG ??
|
|
29188
|
+
var youTrackReadOnlyConfigPath = () => process.env.WORKIT_YOUTRACK_CONFIG ?? path26.join(resolveConfigDir(), "youtrack.json");
|
|
29145
29189
|
var readYouTrackContextConfig = () => {
|
|
29146
29190
|
const cfgPath = youTrackReadOnlyConfigPath();
|
|
29147
29191
|
if (!fs18.existsSync(cfgPath))
|
|
@@ -29493,22 +29537,22 @@ function resolveGitRevision(root, value) {
|
|
|
29493
29537
|
}
|
|
29494
29538
|
}
|
|
29495
29539
|
function resolveInside(root, candidate) {
|
|
29496
|
-
const base =
|
|
29497
|
-
const target =
|
|
29498
|
-
if (target !== base && !target.startsWith(base +
|
|
29540
|
+
const base = realpathSync8(root);
|
|
29541
|
+
const target = path27.resolve(base, candidate);
|
|
29542
|
+
if (target !== base && !target.startsWith(base + path27.sep)) {
|
|
29499
29543
|
throw new Error("path must stay inside repository root");
|
|
29500
29544
|
}
|
|
29501
29545
|
let ancestor = target;
|
|
29502
|
-
while (!
|
|
29503
|
-
ancestor =
|
|
29504
|
-
const canonicalAncestor =
|
|
29505
|
-
if (canonicalAncestor !== base && !canonicalAncestor.startsWith(base +
|
|
29546
|
+
while (!existsSync10(ancestor))
|
|
29547
|
+
ancestor = path27.dirname(ancestor);
|
|
29548
|
+
const canonicalAncestor = realpathSync8(ancestor);
|
|
29549
|
+
if (canonicalAncestor !== base && !canonicalAncestor.startsWith(base + path27.sep)) {
|
|
29506
29550
|
throw new Error("path must stay inside repository root");
|
|
29507
29551
|
}
|
|
29508
29552
|
return target;
|
|
29509
29553
|
}
|
|
29510
29554
|
function run2(root, executable, args, env = {}) {
|
|
29511
|
-
const cwd =
|
|
29555
|
+
const cwd = realpathSync8(root);
|
|
29512
29556
|
const result = spawnSync19(executable, args, {
|
|
29513
29557
|
cwd,
|
|
29514
29558
|
encoding: "utf8",
|
|
@@ -29609,13 +29653,13 @@ var rootVariants = (workspaceRoot) => {
|
|
|
29609
29653
|
if (!workspaceRoot)
|
|
29610
29654
|
return [];
|
|
29611
29655
|
const roots = new Set;
|
|
29612
|
-
for (const candidate of [workspaceRoot,
|
|
29613
|
-
if (
|
|
29656
|
+
for (const candidate of [workspaceRoot, path28.resolve(workspaceRoot)]) {
|
|
29657
|
+
if (path28.isAbsolute(candidate) && candidate !== path28.parse(candidate).root)
|
|
29614
29658
|
roots.add(candidate);
|
|
29615
29659
|
}
|
|
29616
29660
|
try {
|
|
29617
|
-
const canonical =
|
|
29618
|
-
if (canonical !==
|
|
29661
|
+
const canonical = realpathSync9(workspaceRoot);
|
|
29662
|
+
if (canonical !== path28.parse(canonical).root)
|
|
29619
29663
|
roots.add(canonical);
|
|
29620
29664
|
} catch {}
|
|
29621
29665
|
return [...roots].toSorted((left, right) => right.length - left.length);
|
|
@@ -29697,12 +29741,12 @@ var thrownResult = (tool, error, workspaceRoot) => {
|
|
|
29697
29741
|
};
|
|
29698
29742
|
function createMcpServer(host, contextProvider) {
|
|
29699
29743
|
assertMcpHost(host);
|
|
29700
|
-
const here =
|
|
29744
|
+
const here = path28.dirname(fileURLToPath2(import.meta.url));
|
|
29701
29745
|
const sourceMarker = markSourcesLoaded([
|
|
29702
|
-
|
|
29703
|
-
|
|
29704
|
-
|
|
29705
|
-
].filter((file) =>
|
|
29746
|
+
path28.join(here, "server.ts"),
|
|
29747
|
+
path28.join(here, "..", "..", "workit-core", "src", "core", "task-contract.ts"),
|
|
29748
|
+
path28.join(here, "..", "..", "workit-core", "src", "core", "task-engine.ts")
|
|
29749
|
+
].filter((file) => existsSync11(file)));
|
|
29706
29750
|
let staleWarned = false;
|
|
29707
29751
|
const failures = new Map;
|
|
29708
29752
|
const server = new Server({ name: "workit", version: VERSION }, { capabilities: { tools: {}, resources: {} } });
|
|
@@ -29884,8 +29928,8 @@ var main = async () => {
|
|
|
29884
29928
|
process.exitCode = 2;
|
|
29885
29929
|
}
|
|
29886
29930
|
};
|
|
29887
|
-
var entryPath = process.argv[1] ?
|
|
29888
|
-
if (entryPath ===
|
|
29931
|
+
var entryPath = process.argv[1] ? path29.resolve(process.argv[1]) : "";
|
|
29932
|
+
if (entryPath === path29.resolve(fileURLToPath3(import.meta.url)))
|
|
29889
29933
|
await main();
|
|
29890
29934
|
export {
|
|
29891
29935
|
McpCapabilityUnavailableError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workit-dev/mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
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": "^1.
|
|
47
|
+
"@workit-dev/core": "^1.5.1",
|
|
48
48
|
"zod": "4.6.5"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|