@workit-dev/mcp 2.20.6 → 2.21.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 +108 -107
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -17901,7 +17901,8 @@ var workspaceConfigSchema = object({
|
|
|
17901
17901
|
youtrack: object({
|
|
17902
17902
|
baseUrl: nonBlank.optional().describe("This workspace's YouTrack URL."),
|
|
17903
17903
|
link_issues: boolean2().optional().describe("Legacy alias of `issues: { provider: youtrack, link: true }`."),
|
|
17904
|
-
writes: _enum(["ask", "auto"]).optional().describe("ask (default): each workit youtrack write waits for the user's yes. auto: posts without asking, behind WORKIT_YT_WRITE=1.")
|
|
17904
|
+
writes: _enum(["ask", "auto"]).optional().describe("ask (default): each workit youtrack write waits for the user's yes. auto: posts without asking, behind WORKIT_YT_WRITE=1."),
|
|
17905
|
+
autoHosts: array(nonBlank).optional().describe("With writes auto: the only YouTrack hosts (`acme.youtrack.cloud`) a write may reach without asking. A raw ytrack write must name one with --host; a write elsewhere asks. Only the user widens it, in their own terminal (`workit workspace seal`).")
|
|
17905
17906
|
}).passthrough().optional().describe("YouTrack settings for this workspace."),
|
|
17906
17907
|
issues: object({
|
|
17907
17908
|
provider: _enum(["github", "gitlab", "youtrack"]).optional().describe("The issue tracker PRs link to."),
|
|
@@ -27004,7 +27005,7 @@ var exportDigest = (bundle) => sha256({
|
|
|
27004
27005
|
});
|
|
27005
27006
|
// packages/workit-core/src/autonomy.ts
|
|
27006
27007
|
import { closeSync as closeSync2, copyFileSync as copyFileSync2, existsSync as existsSync11, openSync as openSync2 } from "node:fs";
|
|
27007
|
-
import
|
|
27008
|
+
import path25 from "node:path";
|
|
27008
27009
|
|
|
27009
27010
|
// packages/workit-core/src/core/eval-world.ts
|
|
27010
27011
|
import { existsSync as existsSync10, realpathSync as realpathSync6 } from "node:fs";
|
|
@@ -27069,7 +27070,7 @@ var sealProjection = (entries) => entries.map((entry) => {
|
|
|
27069
27070
|
return pick2({
|
|
27070
27071
|
...all,
|
|
27071
27072
|
vcs: pick2(all.vcs, IDENTITY_KEYS),
|
|
27072
|
-
youtrack: pick2(all.youtrack, ["writes"])
|
|
27073
|
+
youtrack: pick2(all.youtrack, ["writes", "autoHosts"])
|
|
27073
27074
|
}, ENTRY_KEYS);
|
|
27074
27075
|
});
|
|
27075
27076
|
var canonical3 = (value) => JSON.stringify(value, (_key, item) => item && typeof item === "object" && !Array.isArray(item) ? Object.fromEntries(Object.entries(item).toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0)) : item);
|
|
@@ -27099,6 +27100,76 @@ function checkSeal(dir) {
|
|
|
27099
27100
|
return ok && sealDigest(sealProjection(current.entries)) === seal.sha256 ? { state: "valid" } : broken("workspaces.json changed since it was sealed", sealed.entries);
|
|
27100
27101
|
}
|
|
27101
27102
|
|
|
27103
|
+
// packages/workit-core/src/core/youtrack-ytrack.ts
|
|
27104
|
+
import { spawnSync as spawnSync16 } from "node:child_process";
|
|
27105
|
+
|
|
27106
|
+
// packages/workit-core/src/forge/exec.ts
|
|
27107
|
+
import fs17 from "node:fs";
|
|
27108
|
+
import path24 from "node:path";
|
|
27109
|
+
|
|
27110
|
+
// packages/workit-core/src/forge/redact.ts
|
|
27111
|
+
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_.-]*`;
|
|
27112
|
+
var ASSIGNMENT = new RegExp(String.raw`(?<![A-Za-z0-9])(["']?${KEY}["']?\s*[:=]\s*["']?)((?:bearer|basic|token|digest)\s+)?([^\s"',;&]+)`, "giu");
|
|
27113
|
+
var QUOTED_ASSIGNMENT = new RegExp(String.raw`(?<![A-Za-z0-9])(["']?${KEY}["']?\s*[:=]\s*)(["'])([^"'\n]*[^\s"'][^"'\n]*)\2`, "giu");
|
|
27114
|
+
var ANSI = new RegExp(String.raw`\u001b\[[0-9;?]*[ -/]*[@-~]|\u001b\][^\u0007]*\u0007`, "gu");
|
|
27115
|
+
|
|
27116
|
+
// packages/workit-core/src/forge/exec.ts
|
|
27117
|
+
var MAX_BUFFER2 = 64 * 1024 * 1024;
|
|
27118
|
+
function findExecutable(bin, env) {
|
|
27119
|
+
const dirs = (env.PATH ?? env.Path ?? "").split(path24.delimiter).filter(Boolean);
|
|
27120
|
+
const exts = process.platform === "win32" ? [".exe"] : [""];
|
|
27121
|
+
for (const dir of dirs)
|
|
27122
|
+
for (const ext of exts) {
|
|
27123
|
+
const candidate = path24.join(dir, `${bin}${ext}`);
|
|
27124
|
+
try {
|
|
27125
|
+
const stat = fs17.statSync(candidate);
|
|
27126
|
+
if (stat.isFile())
|
|
27127
|
+
return candidate;
|
|
27128
|
+
} catch {}
|
|
27129
|
+
}
|
|
27130
|
+
return null;
|
|
27131
|
+
}
|
|
27132
|
+
|
|
27133
|
+
// packages/workit-core/src/core/youtrack-ytrack.ts
|
|
27134
|
+
var TIMEOUT_MS = 60000;
|
|
27135
|
+
var YTRACK_EXIT = { ok: 0, failed: 1, cancelled: 2, auth: 4 };
|
|
27136
|
+
var findYtrack = (env) => env.WORKIT_NO_YTRACK === "1" ? null : findExecutable("ytrack", env);
|
|
27137
|
+
var YTRACK_QUIET_ENV = {
|
|
27138
|
+
YTRACK_NO_UPDATE_NOTIFIER: "1",
|
|
27139
|
+
YTRACK_NO_AUTO_UPGRADE: "1"
|
|
27140
|
+
};
|
|
27141
|
+
function ytrackRunner(env, host, timeoutMs = TIMEOUT_MS) {
|
|
27142
|
+
return (args, input) => {
|
|
27143
|
+
const exe = findYtrack(env);
|
|
27144
|
+
if (!exe)
|
|
27145
|
+
return { status: null, stdout: "", stderr: "", missing: true };
|
|
27146
|
+
const result = spawnSync16(exe, args, {
|
|
27147
|
+
encoding: "utf8",
|
|
27148
|
+
env: {
|
|
27149
|
+
...env,
|
|
27150
|
+
NO_COLOR: "1",
|
|
27151
|
+
...YTRACK_QUIET_ENV,
|
|
27152
|
+
...host ? { YTRACK_HOST: host } : {}
|
|
27153
|
+
},
|
|
27154
|
+
timeout: timeoutMs,
|
|
27155
|
+
killSignal: "SIGKILL",
|
|
27156
|
+
windowsHide: true,
|
|
27157
|
+
...input === undefined ? { stdio: ["ignore", "pipe", "pipe"] } : { input, stdio: ["pipe", "pipe", "pipe"] }
|
|
27158
|
+
});
|
|
27159
|
+
const error = result.error;
|
|
27160
|
+
if (error?.code === "ENOENT")
|
|
27161
|
+
return { status: null, stdout: "", stderr: "", missing: true };
|
|
27162
|
+
return {
|
|
27163
|
+
status: result.status,
|
|
27164
|
+
stdout: result.stdout ?? "",
|
|
27165
|
+
stderr: result.stderr || (error ? error.message : "")
|
|
27166
|
+
};
|
|
27167
|
+
};
|
|
27168
|
+
}
|
|
27169
|
+
var ytrackDetail = (out) => out.stderr.trim().split(`
|
|
27170
|
+
`).slice(-3).join(" ").slice(0, 300);
|
|
27171
|
+
var YTRACK_MISSING = "ytrack is not on PATH: Workit reaches YouTrack only through ytrack";
|
|
27172
|
+
|
|
27102
27173
|
// packages/workit-core/src/autonomy.ts
|
|
27103
27174
|
var accountHomeDir = () => {
|
|
27104
27175
|
const home = grantsHome.resolve();
|
|
@@ -27106,7 +27177,7 @@ var accountHomeDir = () => {
|
|
|
27106
27177
|
};
|
|
27107
27178
|
var deniedFile = (dir) => {
|
|
27108
27179
|
for (const name of ["workspaces.json", SEAL_FILE]) {
|
|
27109
|
-
const file =
|
|
27180
|
+
const file = path25.join(dir, name);
|
|
27110
27181
|
try {
|
|
27111
27182
|
closeSync2(openSync2(file, "r"));
|
|
27112
27183
|
} catch (error) {
|
|
@@ -27128,7 +27199,7 @@ var accountUnread = () => {
|
|
|
27128
27199
|
if (dir === null)
|
|
27129
27200
|
return NO_ACCOUNT;
|
|
27130
27201
|
const file = deniedFile(dir);
|
|
27131
|
-
return file === null ? null : `the account's ${
|
|
27202
|
+
return file === null ? null : `the account's ${path25.basename(file)} cannot be read (permission denied), so it reads as no workspace entries: no grants, no models, the D4 defaults apply`;
|
|
27132
27203
|
};
|
|
27133
27204
|
var entriesIn = (dir) => dir === null ? [] : loadWorkspacesFrom(dir);
|
|
27134
27205
|
var fileSource = (dir = accountDir()) => ({
|
|
@@ -27149,7 +27220,7 @@ var NO_SEAL_NOTE = `workspaces.json has no seal yet (${SEAL_COMMAND} has never r
|
|
|
27149
27220
|
var sealNote = (seal = sealOf()) => seal.state === "broken" ? `workspaces.json does not match its seal (${seal.reason}), so grants, endpoint, verification and youtrack.writes are the stricter of their current and last sealed values; ${SEAL_UNBLOCK}` : null;
|
|
27150
27221
|
var shownGrantsDir = () => {
|
|
27151
27222
|
const world = evalWorld(process.cwd());
|
|
27152
|
-
return world ?
|
|
27223
|
+
return world ? path25.join(world, "config") : accountDir();
|
|
27153
27224
|
};
|
|
27154
27225
|
var benchWorld = (cwd) => {
|
|
27155
27226
|
const entry = evalWorldEntry(cwd);
|
|
@@ -27173,10 +27244,10 @@ var grantsOverride = () => {
|
|
|
27173
27244
|
const shown = shownGrantsDir();
|
|
27174
27245
|
if (shown === null)
|
|
27175
27246
|
return accountUnread() ?? NO_ACCOUNT;
|
|
27176
|
-
const configured =
|
|
27177
|
-
return configured ===
|
|
27247
|
+
const configured = path25.resolve(resolveConfigDir());
|
|
27248
|
+
return configured === path25.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 ${path25.join(grantsDir(), "workspaces.json")}, and under a redirect they never exceed the D4 defaults`;
|
|
27178
27249
|
};
|
|
27179
|
-
var redirectUnblock = () => `ask the user: grants above the D4 defaults apply only without a config redirect (WORKIT_CONFIG, WORKIT_CONFIG_DIR or XDG_CONFIG_HOME), and are read from ${
|
|
27250
|
+
var redirectUnblock = () => `ask the user: grants above the D4 defaults apply only without a config redirect (WORKIT_CONFIG, WORKIT_CONFIG_DIR or XDG_CONFIG_HOME), and are read from ${path25.join(grantsDir(), "workspaces.json")}`;
|
|
27180
27251
|
var GRANT_KINDS = ["push", "pr", "merge", "release", "rerun"];
|
|
27181
27252
|
var DEFAULT_GRANTS = Object.freeze({
|
|
27182
27253
|
push: true,
|
|
@@ -29551,9 +29622,9 @@ class WorkitCore {
|
|
|
29551
29622
|
}
|
|
29552
29623
|
}
|
|
29553
29624
|
// packages/workit-core/src/core/repo-context.ts
|
|
29554
|
-
import { spawnSync as
|
|
29625
|
+
import { spawnSync as spawnSync17 } from "node:child_process";
|
|
29555
29626
|
import { existsSync as existsSync12, readFileSync as readFileSync10, readdirSync as readdirSync4 } from "node:fs";
|
|
29556
|
-
import
|
|
29627
|
+
import path26 from "node:path";
|
|
29557
29628
|
var isSafeContextRange = (value) => value.length <= 4096 && (() => {
|
|
29558
29629
|
try {
|
|
29559
29630
|
gitRevisionParts(value);
|
|
@@ -29580,7 +29651,7 @@ var invalidRange = (cwd) => ({
|
|
|
29580
29651
|
cwd
|
|
29581
29652
|
});
|
|
29582
29653
|
var runGit = (cwd, args) => {
|
|
29583
|
-
const result =
|
|
29654
|
+
const result = spawnSync17("git", args, { cwd, encoding: "utf8" });
|
|
29584
29655
|
return {
|
|
29585
29656
|
stdout: (result.stdout ?? "").trimEnd(),
|
|
29586
29657
|
stderr: (result.stderr ?? "").trimEnd(),
|
|
@@ -29697,13 +29768,13 @@ var findPrTemplate = (cwd) => {
|
|
|
29697
29768
|
for (const rel of PR_TEMPLATE_FILES) {
|
|
29698
29769
|
const parts = rel.split("/");
|
|
29699
29770
|
const base = parts[parts.length - 1];
|
|
29700
|
-
const dir = parts.length > 1 ?
|
|
29771
|
+
const dir = parts.length > 1 ? path26.join(cwd, ...parts.slice(0, -1)) : cwd;
|
|
29701
29772
|
const actual = probeCaseInsensitive(dir, base);
|
|
29702
29773
|
if (actual)
|
|
29703
29774
|
return [...parts.slice(0, -1), actual].join("/");
|
|
29704
29775
|
}
|
|
29705
29776
|
for (const rel of PR_TEMPLATE_DIRS) {
|
|
29706
|
-
const only = singleMarkdown(
|
|
29777
|
+
const only = singleMarkdown(path26.join(cwd, ...rel.split("/")));
|
|
29707
29778
|
if (only)
|
|
29708
29779
|
return `${rel}/${only}`;
|
|
29709
29780
|
}
|
|
@@ -29733,7 +29804,7 @@ var diffStatForRange = (cwd, range) => {
|
|
|
29733
29804
|
return runGit(cwd, ["diff", "--stat", "--"]).stdout;
|
|
29734
29805
|
};
|
|
29735
29806
|
var packageScripts = (cwd, keys) => {
|
|
29736
|
-
const pkgPath =
|
|
29807
|
+
const pkgPath = path26.join(cwd, "package.json");
|
|
29737
29808
|
if (!existsSync12(pkgPath))
|
|
29738
29809
|
return [];
|
|
29739
29810
|
try {
|
|
@@ -29759,9 +29830,9 @@ var documentationFiles = (cwd) => {
|
|
|
29759
29830
|
if (entry.isDirectory()) {
|
|
29760
29831
|
if (excluded.has(entry.name))
|
|
29761
29832
|
continue;
|
|
29762
|
-
walk(
|
|
29833
|
+
walk(path26.join(dir, entry.name), depth + 1);
|
|
29763
29834
|
} else if (entry.isFile() && (entry.name === "README.md" || entry.name.endsWith(".md"))) {
|
|
29764
|
-
matches.push("./" +
|
|
29835
|
+
matches.push("./" + path26.relative(cwd, path26.join(dir, entry.name)).replaceAll("\\", "/"));
|
|
29765
29836
|
}
|
|
29766
29837
|
}
|
|
29767
29838
|
};
|
|
@@ -29777,7 +29848,7 @@ var readTrimmed2 = (file, maxLines) => {
|
|
|
29777
29848
|
`);
|
|
29778
29849
|
};
|
|
29779
29850
|
function prReadyContext(root, range) {
|
|
29780
|
-
const cwd =
|
|
29851
|
+
const cwd = path26.resolve(repoRoot(root));
|
|
29781
29852
|
if (range !== undefined && !isResolvableContextRange(cwd, range))
|
|
29782
29853
|
return invalidRange(cwd);
|
|
29783
29854
|
let stdout = "";
|
|
@@ -29835,7 +29906,7 @@ ${status.stderr}` : "");
|
|
|
29835
29906
|
stdout += `template_path: ${template}
|
|
29836
29907
|
|
|
29837
29908
|
`;
|
|
29838
|
-
stdout += readTrimmed2(
|
|
29909
|
+
stdout += readTrimmed2(path26.join(cwd, template), 220);
|
|
29839
29910
|
} else {
|
|
29840
29911
|
stdout += `template_path: none
|
|
29841
29912
|
|
|
@@ -29845,7 +29916,7 @@ ${status.stderr}` : "");
|
|
|
29845
29916
|
stdout += `
|
|
29846
29917
|
`;
|
|
29847
29918
|
stdout += printSection("Recent Validation Signals");
|
|
29848
|
-
if (existsSync12(
|
|
29919
|
+
if (existsSync12(path26.join(cwd, "package.json"))) {
|
|
29849
29920
|
stdout += `package.json detected. Common scripts:
|
|
29850
29921
|
`;
|
|
29851
29922
|
const found = packageScripts(cwd, ["lint", "format:check", "test", "build"]);
|
|
@@ -29854,7 +29925,7 @@ ${status.stderr}` : "");
|
|
|
29854
29925
|
`) + `
|
|
29855
29926
|
`;
|
|
29856
29927
|
}
|
|
29857
|
-
if (existsSync12(
|
|
29928
|
+
if (existsSync12(path26.join(cwd, "Cargo.toml")) || existsSync12(path26.join(cwd, "src-tauri/Cargo.toml"))) {
|
|
29858
29929
|
stdout += `Rust project detected.
|
|
29859
29930
|
`;
|
|
29860
29931
|
}
|
|
@@ -29887,7 +29958,7 @@ var CHANGELOG_RULES = `- Use an [Unreleased] section.
|
|
|
29887
29958
|
- Apply with the host-native editor, preserving the repository changelog conventions.
|
|
29888
29959
|
- If Unreleased already has duplicate category headings, normalize_only first.`;
|
|
29889
29960
|
function changelogContext(root, range) {
|
|
29890
|
-
const cwd =
|
|
29961
|
+
const cwd = path26.resolve(repoRoot(root));
|
|
29891
29962
|
if (range !== undefined && !isResolvableContextRange(cwd, range))
|
|
29892
29963
|
return invalidRange(cwd);
|
|
29893
29964
|
const resolvedRange = rangeArgOrDefault(range, cwd);
|
|
@@ -29905,7 +29976,7 @@ function changelogContext(root, range) {
|
|
|
29905
29976
|
stdout += CHANGELOG_RULES + `
|
|
29906
29977
|
`;
|
|
29907
29978
|
stdout += printSection("Existing CHANGELOG.md");
|
|
29908
|
-
const changelogPath =
|
|
29979
|
+
const changelogPath = path26.join(cwd, "CHANGELOG.md");
|
|
29909
29980
|
if (existsSync12(changelogPath)) {
|
|
29910
29981
|
stdout += readTrimmed2(changelogPath, 260) + `
|
|
29911
29982
|
`;
|
|
@@ -29925,7 +29996,7 @@ function changelogContext(root, range) {
|
|
|
29925
29996
|
return { stdout, stderr: "", exitCode: 0, cwd };
|
|
29926
29997
|
}
|
|
29927
29998
|
function docsRefreshContext(root, range) {
|
|
29928
|
-
const cwd =
|
|
29999
|
+
const cwd = path26.resolve(repoRoot(root));
|
|
29929
30000
|
if (range !== undefined && !isResolvableContextRange(cwd, range))
|
|
29930
30001
|
return invalidRange(cwd);
|
|
29931
30002
|
const resolvedRange = rangeArgOrDefault(range, cwd);
|
|
@@ -29947,7 +30018,7 @@ function docsRefreshContext(root, range) {
|
|
|
29947
30018
|
`) + `
|
|
29948
30019
|
`;
|
|
29949
30020
|
stdout += printSection("README Preview");
|
|
29950
|
-
const readme =
|
|
30021
|
+
const readme = path26.join(cwd, "README.md");
|
|
29951
30022
|
if (existsSync12(readme)) {
|
|
29952
30023
|
stdout += readTrimmed2(readme, 220) + `
|
|
29953
30024
|
`;
|
|
@@ -29956,7 +30027,7 @@ function docsRefreshContext(root, range) {
|
|
|
29956
30027
|
`;
|
|
29957
30028
|
}
|
|
29958
30029
|
stdout += printSection("Package Scripts");
|
|
29959
|
-
const pkgPath =
|
|
30030
|
+
const pkgPath = path26.join(cwd, "package.json");
|
|
29960
30031
|
if (existsSync12(pkgPath)) {
|
|
29961
30032
|
try {
|
|
29962
30033
|
const pkg = JSON.parse(readFileSync10(pkgPath, "utf8"));
|
|
@@ -29970,7 +30041,7 @@ function docsRefreshContext(root, range) {
|
|
|
29970
30041
|
return { stdout, stderr: "", exitCode: 0, cwd };
|
|
29971
30042
|
}
|
|
29972
30043
|
function releaseNotesContext(root, rangeOrTag) {
|
|
29973
|
-
const cwd =
|
|
30044
|
+
const cwd = path26.resolve(repoRoot(root));
|
|
29974
30045
|
if (!rangeOrTag) {
|
|
29975
30046
|
return {
|
|
29976
30047
|
stdout: "",
|
|
@@ -30013,7 +30084,7 @@ function releaseNotesContext(root, rangeOrTag) {
|
|
|
30013
30084
|
`;
|
|
30014
30085
|
stdout += printSection("Existing Release Files");
|
|
30015
30086
|
for (const rel of ["CHANGELOG.md", "RELEASE_NOTES.md", ".github/releases.md"]) {
|
|
30016
|
-
if (existsSync12(
|
|
30087
|
+
if (existsSync12(path26.join(cwd, rel)))
|
|
30017
30088
|
stdout += rel + `
|
|
30018
30089
|
`;
|
|
30019
30090
|
}
|
|
@@ -30041,12 +30112,12 @@ function releaseNotesContext(root, rangeOrTag) {
|
|
|
30041
30112
|
}
|
|
30042
30113
|
|
|
30043
30114
|
// packages/workit-core/src/core/tracker-issues.ts
|
|
30044
|
-
import { spawnSync as
|
|
30115
|
+
import { spawnSync as spawnSync19 } from "node:child_process";
|
|
30045
30116
|
|
|
30046
30117
|
// packages/workit-core/src/core/pr-create.ts
|
|
30047
|
-
import
|
|
30048
|
-
import
|
|
30049
|
-
import { spawnSync as
|
|
30118
|
+
import fs18 from "node:fs";
|
|
30119
|
+
import path27 from "node:path";
|
|
30120
|
+
import { spawnSync as spawnSync18 } from "node:child_process";
|
|
30050
30121
|
// packages/workit-core/src/forge/pr-body.ts
|
|
30051
30122
|
function parseGhIssue(value) {
|
|
30052
30123
|
const m = /issues\/(\d+)/.exec(value);
|
|
@@ -30065,13 +30136,13 @@ var LOCAL = bounded(20000);
|
|
|
30065
30136
|
var NETWORK = bounded(60000);
|
|
30066
30137
|
function whichOnPath(tool) {
|
|
30067
30138
|
const names = process.platform === "win32" ? [tool, `${tool}.exe`, `${tool}.cmd`] : [tool];
|
|
30068
|
-
for (const dir of (process.env.PATH ?? "").split(
|
|
30139
|
+
for (const dir of (process.env.PATH ?? "").split(path27.delimiter)) {
|
|
30069
30140
|
if (!dir)
|
|
30070
30141
|
continue;
|
|
30071
30142
|
for (const name of names) {
|
|
30072
|
-
const candidate =
|
|
30143
|
+
const candidate = path27.join(dir, name);
|
|
30073
30144
|
try {
|
|
30074
|
-
|
|
30145
|
+
fs18.accessSync(candidate, fs18.constants.X_OK);
|
|
30075
30146
|
return candidate;
|
|
30076
30147
|
} catch {}
|
|
30077
30148
|
}
|
|
@@ -30080,7 +30151,7 @@ function whichOnPath(tool) {
|
|
|
30080
30151
|
}
|
|
30081
30152
|
var hostingCliAvailable = (provider) => whichOnPath(provider === "gitlab" ? "glab" : "gh") !== null;
|
|
30082
30153
|
var pushRemote = (cwd) => {
|
|
30083
|
-
const result =
|
|
30154
|
+
const result = spawnSync18("git", ["remote", "get-url", "--push", "--all", "origin"], {
|
|
30084
30155
|
cwd,
|
|
30085
30156
|
...LOCAL
|
|
30086
30157
|
});
|
|
@@ -30111,7 +30182,7 @@ var defaultCli = (bin, available) => {
|
|
|
30111
30182
|
if (!available)
|
|
30112
30183
|
return null;
|
|
30113
30184
|
return (args, root) => {
|
|
30114
|
-
const out =
|
|
30185
|
+
const out = spawnSync19(bin, args, {
|
|
30115
30186
|
cwd: root,
|
|
30116
30187
|
encoding: "utf8",
|
|
30117
30188
|
env: { ...process.env, PATH: process.env.PATH ?? "" }
|
|
@@ -30200,76 +30271,6 @@ var PLUGIN_ROOT = packageRoot();
|
|
|
30200
30271
|
var ASSET_ROOT = assetRoot();
|
|
30201
30272
|
var resolveWorkspaceRoot = (explicit) => explicit || process.cwd();
|
|
30202
30273
|
|
|
30203
|
-
// packages/workit-core/src/core/youtrack-ytrack.ts
|
|
30204
|
-
import { spawnSync as spawnSync19 } from "node:child_process";
|
|
30205
|
-
|
|
30206
|
-
// packages/workit-core/src/forge/exec.ts
|
|
30207
|
-
import fs18 from "node:fs";
|
|
30208
|
-
import path27 from "node:path";
|
|
30209
|
-
|
|
30210
|
-
// packages/workit-core/src/forge/redact.ts
|
|
30211
|
-
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_.-]*`;
|
|
30212
|
-
var ASSIGNMENT = new RegExp(String.raw`(?<![A-Za-z0-9])(["']?${KEY}["']?\s*[:=]\s*["']?)((?:bearer|basic|token|digest)\s+)?([^\s"',;&]+)`, "giu");
|
|
30213
|
-
var QUOTED_ASSIGNMENT = new RegExp(String.raw`(?<![A-Za-z0-9])(["']?${KEY}["']?\s*[:=]\s*)(["'])([^"'\n]*[^\s"'][^"'\n]*)\2`, "giu");
|
|
30214
|
-
var ANSI = new RegExp(String.raw`\u001b\[[0-9;?]*[ -/]*[@-~]|\u001b\][^\u0007]*\u0007`, "gu");
|
|
30215
|
-
|
|
30216
|
-
// packages/workit-core/src/forge/exec.ts
|
|
30217
|
-
var MAX_BUFFER2 = 64 * 1024 * 1024;
|
|
30218
|
-
function findExecutable(bin, env) {
|
|
30219
|
-
const dirs = (env.PATH ?? env.Path ?? "").split(path27.delimiter).filter(Boolean);
|
|
30220
|
-
const exts = process.platform === "win32" ? [".exe"] : [""];
|
|
30221
|
-
for (const dir of dirs)
|
|
30222
|
-
for (const ext of exts) {
|
|
30223
|
-
const candidate = path27.join(dir, `${bin}${ext}`);
|
|
30224
|
-
try {
|
|
30225
|
-
const stat = fs18.statSync(candidate);
|
|
30226
|
-
if (stat.isFile())
|
|
30227
|
-
return candidate;
|
|
30228
|
-
} catch {}
|
|
30229
|
-
}
|
|
30230
|
-
return null;
|
|
30231
|
-
}
|
|
30232
|
-
|
|
30233
|
-
// packages/workit-core/src/core/youtrack-ytrack.ts
|
|
30234
|
-
var TIMEOUT_MS = 60000;
|
|
30235
|
-
var YTRACK_EXIT = { ok: 0, failed: 1, cancelled: 2, auth: 4 };
|
|
30236
|
-
var findYtrack = (env) => env.WORKIT_NO_YTRACK === "1" ? null : findExecutable("ytrack", env);
|
|
30237
|
-
var YTRACK_QUIET_ENV = {
|
|
30238
|
-
YTRACK_NO_UPDATE_NOTIFIER: "1",
|
|
30239
|
-
YTRACK_NO_AUTO_UPGRADE: "1"
|
|
30240
|
-
};
|
|
30241
|
-
function ytrackRunner(env, host, timeoutMs = TIMEOUT_MS) {
|
|
30242
|
-
return (args, input) => {
|
|
30243
|
-
const exe = findYtrack(env);
|
|
30244
|
-
if (!exe)
|
|
30245
|
-
return { status: null, stdout: "", stderr: "", missing: true };
|
|
30246
|
-
const result = spawnSync19(exe, args, {
|
|
30247
|
-
encoding: "utf8",
|
|
30248
|
-
env: {
|
|
30249
|
-
...env,
|
|
30250
|
-
NO_COLOR: "1",
|
|
30251
|
-
...YTRACK_QUIET_ENV,
|
|
30252
|
-
...host ? { YTRACK_HOST: host } : {}
|
|
30253
|
-
},
|
|
30254
|
-
timeout: timeoutMs,
|
|
30255
|
-
killSignal: "SIGKILL",
|
|
30256
|
-
windowsHide: true,
|
|
30257
|
-
...input === undefined ? { stdio: ["ignore", "pipe", "pipe"] } : { input, stdio: ["pipe", "pipe", "pipe"] }
|
|
30258
|
-
});
|
|
30259
|
-
const error = result.error;
|
|
30260
|
-
if (error?.code === "ENOENT")
|
|
30261
|
-
return { status: null, stdout: "", stderr: "", missing: true };
|
|
30262
|
-
return {
|
|
30263
|
-
status: result.status,
|
|
30264
|
-
stdout: result.stdout ?? "",
|
|
30265
|
-
stderr: result.stderr || (error ? error.message : "")
|
|
30266
|
-
};
|
|
30267
|
-
};
|
|
30268
|
-
}
|
|
30269
|
-
var ytrackDetail = (out) => out.stderr.trim().split(`
|
|
30270
|
-
`).slice(-3).join(" ").slice(0, 300);
|
|
30271
|
-
var YTRACK_MISSING = "ytrack is not on PATH: Workit reaches YouTrack only through ytrack";
|
|
30272
|
-
|
|
30273
30274
|
// packages/workit-core/src/core/youtrack.ts
|
|
30274
30275
|
var ISSUE_RE = /^[A-Z][A-Z0-9_]*-\d+$/;
|
|
30275
30276
|
var youTrackReadOnlyConfigPath = () => process.env.WORKIT_YOUTRACK_CONFIG ?? path28.join(resolveConfigDir(), "youtrack.json");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workit-dev/mcp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.21.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.21.0",
|
|
48
48
|
"zod": "4.6.5"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|