@workit-dev/mcp 2.20.6 → 2.21.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 +110 -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,78 @@ 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 NAME = "[A-Za-z0-9_.-]";
|
|
27112
|
+
var KEY = String.raw`(?<!${NAME})(?=${NAME}*?(?:token|secret|password|passwd|pwd|api[_-]?key|access[_-]?key|account[_-]?key|private[_-]?key|client[_-]?secret|credentials?|authorization|cookie|signature))${NAME}+`;
|
|
27113
|
+
var ASSIGNMENT = new RegExp(String.raw`(?<![A-Za-z0-9])(["']?${KEY}["']?\s*[:=]\s*["']?)((?:bearer|basic|token|digest)\s+)?([^\s"',;&]+)`, "giu");
|
|
27114
|
+
var QUOTED_ASSIGNMENT = new RegExp(String.raw`(?<![A-Za-z0-9])(["']?${KEY}["']?\s*[:=]\s*)(["'])([^"'\n]*[^\s"'][^"'\n]*)\2`, "giu");
|
|
27115
|
+
var SECRET_FLAG = new RegExp(String.raw`(?<![\w-])(--(?=[\w-]*?(?<![a-z0-9])(?:password|passwd|pwd|secret|token|api[-_]?key|auth|authorization|credentials?|private[-_]?key|access[-_]?key)(?![a-z0-9]))[\w-]+(?:\s+|=))((?:bearer|basic|token|digest)\s+(?![\s-]))?(?:(["'])(?:[^\n]*?\3|[^\n]*)|(?!-)[^\s"']+)`, "giu");
|
|
27116
|
+
var ANSI = new RegExp(String.raw`\u001b\[[0-9;?]*[ -/]*[@-~]|\u001b\][^\u0007\u001b]*\u0007`, "gu");
|
|
27117
|
+
|
|
27118
|
+
// packages/workit-core/src/forge/exec.ts
|
|
27119
|
+
var MAX_BUFFER2 = 64 * 1024 * 1024;
|
|
27120
|
+
function findExecutable(bin, env) {
|
|
27121
|
+
const dirs = (env.PATH ?? env.Path ?? "").split(path24.delimiter).filter(Boolean);
|
|
27122
|
+
const exts = process.platform === "win32" ? [".exe"] : [""];
|
|
27123
|
+
for (const dir of dirs)
|
|
27124
|
+
for (const ext of exts) {
|
|
27125
|
+
const candidate = path24.join(dir, `${bin}${ext}`);
|
|
27126
|
+
try {
|
|
27127
|
+
const stat = fs17.statSync(candidate);
|
|
27128
|
+
if (stat.isFile())
|
|
27129
|
+
return candidate;
|
|
27130
|
+
} catch {}
|
|
27131
|
+
}
|
|
27132
|
+
return null;
|
|
27133
|
+
}
|
|
27134
|
+
|
|
27135
|
+
// packages/workit-core/src/core/youtrack-ytrack.ts
|
|
27136
|
+
var TIMEOUT_MS = 60000;
|
|
27137
|
+
var YTRACK_EXIT = { ok: 0, failed: 1, cancelled: 2, auth: 4 };
|
|
27138
|
+
var findYtrack = (env) => env.WORKIT_NO_YTRACK === "1" ? null : findExecutable("ytrack", env);
|
|
27139
|
+
var YTRACK_QUIET_ENV = {
|
|
27140
|
+
YTRACK_NO_UPDATE_NOTIFIER: "1",
|
|
27141
|
+
YTRACK_NO_AUTO_UPGRADE: "1"
|
|
27142
|
+
};
|
|
27143
|
+
function ytrackRunner(env, host, timeoutMs = TIMEOUT_MS) {
|
|
27144
|
+
return (args, input) => {
|
|
27145
|
+
const exe = findYtrack(env);
|
|
27146
|
+
if (!exe)
|
|
27147
|
+
return { status: null, stdout: "", stderr: "", missing: true };
|
|
27148
|
+
const result = spawnSync16(exe, args, {
|
|
27149
|
+
encoding: "utf8",
|
|
27150
|
+
env: {
|
|
27151
|
+
...env,
|
|
27152
|
+
NO_COLOR: "1",
|
|
27153
|
+
...YTRACK_QUIET_ENV,
|
|
27154
|
+
...host ? { YTRACK_HOST: host } : {}
|
|
27155
|
+
},
|
|
27156
|
+
timeout: timeoutMs,
|
|
27157
|
+
killSignal: "SIGKILL",
|
|
27158
|
+
windowsHide: true,
|
|
27159
|
+
...input === undefined ? { stdio: ["ignore", "pipe", "pipe"] } : { input, stdio: ["pipe", "pipe", "pipe"] }
|
|
27160
|
+
});
|
|
27161
|
+
const error = result.error;
|
|
27162
|
+
if (error?.code === "ENOENT")
|
|
27163
|
+
return { status: null, stdout: "", stderr: "", missing: true };
|
|
27164
|
+
return {
|
|
27165
|
+
status: result.status,
|
|
27166
|
+
stdout: result.stdout ?? "",
|
|
27167
|
+
stderr: result.stderr || (error ? error.message : "")
|
|
27168
|
+
};
|
|
27169
|
+
};
|
|
27170
|
+
}
|
|
27171
|
+
var ytrackDetail = (out) => out.stderr.trim().split(`
|
|
27172
|
+
`).slice(-3).join(" ").slice(0, 300);
|
|
27173
|
+
var YTRACK_MISSING = "ytrack is not on PATH: Workit reaches YouTrack only through ytrack";
|
|
27174
|
+
|
|
27102
27175
|
// packages/workit-core/src/autonomy.ts
|
|
27103
27176
|
var accountHomeDir = () => {
|
|
27104
27177
|
const home = grantsHome.resolve();
|
|
@@ -27106,7 +27179,7 @@ var accountHomeDir = () => {
|
|
|
27106
27179
|
};
|
|
27107
27180
|
var deniedFile = (dir) => {
|
|
27108
27181
|
for (const name of ["workspaces.json", SEAL_FILE]) {
|
|
27109
|
-
const file =
|
|
27182
|
+
const file = path25.join(dir, name);
|
|
27110
27183
|
try {
|
|
27111
27184
|
closeSync2(openSync2(file, "r"));
|
|
27112
27185
|
} catch (error) {
|
|
@@ -27128,7 +27201,7 @@ var accountUnread = () => {
|
|
|
27128
27201
|
if (dir === null)
|
|
27129
27202
|
return NO_ACCOUNT;
|
|
27130
27203
|
const file = deniedFile(dir);
|
|
27131
|
-
return file === null ? null : `the account's ${
|
|
27204
|
+
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
27205
|
};
|
|
27133
27206
|
var entriesIn = (dir) => dir === null ? [] : loadWorkspacesFrom(dir);
|
|
27134
27207
|
var fileSource = (dir = accountDir()) => ({
|
|
@@ -27149,7 +27222,7 @@ var NO_SEAL_NOTE = `workspaces.json has no seal yet (${SEAL_COMMAND} has never r
|
|
|
27149
27222
|
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
27223
|
var shownGrantsDir = () => {
|
|
27151
27224
|
const world = evalWorld(process.cwd());
|
|
27152
|
-
return world ?
|
|
27225
|
+
return world ? path25.join(world, "config") : accountDir();
|
|
27153
27226
|
};
|
|
27154
27227
|
var benchWorld = (cwd) => {
|
|
27155
27228
|
const entry = evalWorldEntry(cwd);
|
|
@@ -27173,10 +27246,10 @@ var grantsOverride = () => {
|
|
|
27173
27246
|
const shown = shownGrantsDir();
|
|
27174
27247
|
if (shown === null)
|
|
27175
27248
|
return accountUnread() ?? NO_ACCOUNT;
|
|
27176
|
-
const configured =
|
|
27177
|
-
return configured ===
|
|
27249
|
+
const configured = path25.resolve(resolveConfigDir());
|
|
27250
|
+
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
27251
|
};
|
|
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 ${
|
|
27252
|
+
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
27253
|
var GRANT_KINDS = ["push", "pr", "merge", "release", "rerun"];
|
|
27181
27254
|
var DEFAULT_GRANTS = Object.freeze({
|
|
27182
27255
|
push: true,
|
|
@@ -29551,9 +29624,9 @@ class WorkitCore {
|
|
|
29551
29624
|
}
|
|
29552
29625
|
}
|
|
29553
29626
|
// packages/workit-core/src/core/repo-context.ts
|
|
29554
|
-
import { spawnSync as
|
|
29627
|
+
import { spawnSync as spawnSync17 } from "node:child_process";
|
|
29555
29628
|
import { existsSync as existsSync12, readFileSync as readFileSync10, readdirSync as readdirSync4 } from "node:fs";
|
|
29556
|
-
import
|
|
29629
|
+
import path26 from "node:path";
|
|
29557
29630
|
var isSafeContextRange = (value) => value.length <= 4096 && (() => {
|
|
29558
29631
|
try {
|
|
29559
29632
|
gitRevisionParts(value);
|
|
@@ -29580,7 +29653,7 @@ var invalidRange = (cwd) => ({
|
|
|
29580
29653
|
cwd
|
|
29581
29654
|
});
|
|
29582
29655
|
var runGit = (cwd, args) => {
|
|
29583
|
-
const result =
|
|
29656
|
+
const result = spawnSync17("git", args, { cwd, encoding: "utf8" });
|
|
29584
29657
|
return {
|
|
29585
29658
|
stdout: (result.stdout ?? "").trimEnd(),
|
|
29586
29659
|
stderr: (result.stderr ?? "").trimEnd(),
|
|
@@ -29697,13 +29770,13 @@ var findPrTemplate = (cwd) => {
|
|
|
29697
29770
|
for (const rel of PR_TEMPLATE_FILES) {
|
|
29698
29771
|
const parts = rel.split("/");
|
|
29699
29772
|
const base = parts[parts.length - 1];
|
|
29700
|
-
const dir = parts.length > 1 ?
|
|
29773
|
+
const dir = parts.length > 1 ? path26.join(cwd, ...parts.slice(0, -1)) : cwd;
|
|
29701
29774
|
const actual = probeCaseInsensitive(dir, base);
|
|
29702
29775
|
if (actual)
|
|
29703
29776
|
return [...parts.slice(0, -1), actual].join("/");
|
|
29704
29777
|
}
|
|
29705
29778
|
for (const rel of PR_TEMPLATE_DIRS) {
|
|
29706
|
-
const only = singleMarkdown(
|
|
29779
|
+
const only = singleMarkdown(path26.join(cwd, ...rel.split("/")));
|
|
29707
29780
|
if (only)
|
|
29708
29781
|
return `${rel}/${only}`;
|
|
29709
29782
|
}
|
|
@@ -29733,7 +29806,7 @@ var diffStatForRange = (cwd, range) => {
|
|
|
29733
29806
|
return runGit(cwd, ["diff", "--stat", "--"]).stdout;
|
|
29734
29807
|
};
|
|
29735
29808
|
var packageScripts = (cwd, keys) => {
|
|
29736
|
-
const pkgPath =
|
|
29809
|
+
const pkgPath = path26.join(cwd, "package.json");
|
|
29737
29810
|
if (!existsSync12(pkgPath))
|
|
29738
29811
|
return [];
|
|
29739
29812
|
try {
|
|
@@ -29759,9 +29832,9 @@ var documentationFiles = (cwd) => {
|
|
|
29759
29832
|
if (entry.isDirectory()) {
|
|
29760
29833
|
if (excluded.has(entry.name))
|
|
29761
29834
|
continue;
|
|
29762
|
-
walk(
|
|
29835
|
+
walk(path26.join(dir, entry.name), depth + 1);
|
|
29763
29836
|
} else if (entry.isFile() && (entry.name === "README.md" || entry.name.endsWith(".md"))) {
|
|
29764
|
-
matches.push("./" +
|
|
29837
|
+
matches.push("./" + path26.relative(cwd, path26.join(dir, entry.name)).replaceAll("\\", "/"));
|
|
29765
29838
|
}
|
|
29766
29839
|
}
|
|
29767
29840
|
};
|
|
@@ -29777,7 +29850,7 @@ var readTrimmed2 = (file, maxLines) => {
|
|
|
29777
29850
|
`);
|
|
29778
29851
|
};
|
|
29779
29852
|
function prReadyContext(root, range) {
|
|
29780
|
-
const cwd =
|
|
29853
|
+
const cwd = path26.resolve(repoRoot(root));
|
|
29781
29854
|
if (range !== undefined && !isResolvableContextRange(cwd, range))
|
|
29782
29855
|
return invalidRange(cwd);
|
|
29783
29856
|
let stdout = "";
|
|
@@ -29835,7 +29908,7 @@ ${status.stderr}` : "");
|
|
|
29835
29908
|
stdout += `template_path: ${template}
|
|
29836
29909
|
|
|
29837
29910
|
`;
|
|
29838
|
-
stdout += readTrimmed2(
|
|
29911
|
+
stdout += readTrimmed2(path26.join(cwd, template), 220);
|
|
29839
29912
|
} else {
|
|
29840
29913
|
stdout += `template_path: none
|
|
29841
29914
|
|
|
@@ -29845,7 +29918,7 @@ ${status.stderr}` : "");
|
|
|
29845
29918
|
stdout += `
|
|
29846
29919
|
`;
|
|
29847
29920
|
stdout += printSection("Recent Validation Signals");
|
|
29848
|
-
if (existsSync12(
|
|
29921
|
+
if (existsSync12(path26.join(cwd, "package.json"))) {
|
|
29849
29922
|
stdout += `package.json detected. Common scripts:
|
|
29850
29923
|
`;
|
|
29851
29924
|
const found = packageScripts(cwd, ["lint", "format:check", "test", "build"]);
|
|
@@ -29854,7 +29927,7 @@ ${status.stderr}` : "");
|
|
|
29854
29927
|
`) + `
|
|
29855
29928
|
`;
|
|
29856
29929
|
}
|
|
29857
|
-
if (existsSync12(
|
|
29930
|
+
if (existsSync12(path26.join(cwd, "Cargo.toml")) || existsSync12(path26.join(cwd, "src-tauri/Cargo.toml"))) {
|
|
29858
29931
|
stdout += `Rust project detected.
|
|
29859
29932
|
`;
|
|
29860
29933
|
}
|
|
@@ -29887,7 +29960,7 @@ var CHANGELOG_RULES = `- Use an [Unreleased] section.
|
|
|
29887
29960
|
- Apply with the host-native editor, preserving the repository changelog conventions.
|
|
29888
29961
|
- If Unreleased already has duplicate category headings, normalize_only first.`;
|
|
29889
29962
|
function changelogContext(root, range) {
|
|
29890
|
-
const cwd =
|
|
29963
|
+
const cwd = path26.resolve(repoRoot(root));
|
|
29891
29964
|
if (range !== undefined && !isResolvableContextRange(cwd, range))
|
|
29892
29965
|
return invalidRange(cwd);
|
|
29893
29966
|
const resolvedRange = rangeArgOrDefault(range, cwd);
|
|
@@ -29905,7 +29978,7 @@ function changelogContext(root, range) {
|
|
|
29905
29978
|
stdout += CHANGELOG_RULES + `
|
|
29906
29979
|
`;
|
|
29907
29980
|
stdout += printSection("Existing CHANGELOG.md");
|
|
29908
|
-
const changelogPath =
|
|
29981
|
+
const changelogPath = path26.join(cwd, "CHANGELOG.md");
|
|
29909
29982
|
if (existsSync12(changelogPath)) {
|
|
29910
29983
|
stdout += readTrimmed2(changelogPath, 260) + `
|
|
29911
29984
|
`;
|
|
@@ -29925,7 +29998,7 @@ function changelogContext(root, range) {
|
|
|
29925
29998
|
return { stdout, stderr: "", exitCode: 0, cwd };
|
|
29926
29999
|
}
|
|
29927
30000
|
function docsRefreshContext(root, range) {
|
|
29928
|
-
const cwd =
|
|
30001
|
+
const cwd = path26.resolve(repoRoot(root));
|
|
29929
30002
|
if (range !== undefined && !isResolvableContextRange(cwd, range))
|
|
29930
30003
|
return invalidRange(cwd);
|
|
29931
30004
|
const resolvedRange = rangeArgOrDefault(range, cwd);
|
|
@@ -29947,7 +30020,7 @@ function docsRefreshContext(root, range) {
|
|
|
29947
30020
|
`) + `
|
|
29948
30021
|
`;
|
|
29949
30022
|
stdout += printSection("README Preview");
|
|
29950
|
-
const readme =
|
|
30023
|
+
const readme = path26.join(cwd, "README.md");
|
|
29951
30024
|
if (existsSync12(readme)) {
|
|
29952
30025
|
stdout += readTrimmed2(readme, 220) + `
|
|
29953
30026
|
`;
|
|
@@ -29956,7 +30029,7 @@ function docsRefreshContext(root, range) {
|
|
|
29956
30029
|
`;
|
|
29957
30030
|
}
|
|
29958
30031
|
stdout += printSection("Package Scripts");
|
|
29959
|
-
const pkgPath =
|
|
30032
|
+
const pkgPath = path26.join(cwd, "package.json");
|
|
29960
30033
|
if (existsSync12(pkgPath)) {
|
|
29961
30034
|
try {
|
|
29962
30035
|
const pkg = JSON.parse(readFileSync10(pkgPath, "utf8"));
|
|
@@ -29970,7 +30043,7 @@ function docsRefreshContext(root, range) {
|
|
|
29970
30043
|
return { stdout, stderr: "", exitCode: 0, cwd };
|
|
29971
30044
|
}
|
|
29972
30045
|
function releaseNotesContext(root, rangeOrTag) {
|
|
29973
|
-
const cwd =
|
|
30046
|
+
const cwd = path26.resolve(repoRoot(root));
|
|
29974
30047
|
if (!rangeOrTag) {
|
|
29975
30048
|
return {
|
|
29976
30049
|
stdout: "",
|
|
@@ -30013,7 +30086,7 @@ function releaseNotesContext(root, rangeOrTag) {
|
|
|
30013
30086
|
`;
|
|
30014
30087
|
stdout += printSection("Existing Release Files");
|
|
30015
30088
|
for (const rel of ["CHANGELOG.md", "RELEASE_NOTES.md", ".github/releases.md"]) {
|
|
30016
|
-
if (existsSync12(
|
|
30089
|
+
if (existsSync12(path26.join(cwd, rel)))
|
|
30017
30090
|
stdout += rel + `
|
|
30018
30091
|
`;
|
|
30019
30092
|
}
|
|
@@ -30041,12 +30114,12 @@ function releaseNotesContext(root, rangeOrTag) {
|
|
|
30041
30114
|
}
|
|
30042
30115
|
|
|
30043
30116
|
// packages/workit-core/src/core/tracker-issues.ts
|
|
30044
|
-
import { spawnSync as
|
|
30117
|
+
import { spawnSync as spawnSync19 } from "node:child_process";
|
|
30045
30118
|
|
|
30046
30119
|
// packages/workit-core/src/core/pr-create.ts
|
|
30047
|
-
import
|
|
30048
|
-
import
|
|
30049
|
-
import { spawnSync as
|
|
30120
|
+
import fs18 from "node:fs";
|
|
30121
|
+
import path27 from "node:path";
|
|
30122
|
+
import { spawnSync as spawnSync18 } from "node:child_process";
|
|
30050
30123
|
// packages/workit-core/src/forge/pr-body.ts
|
|
30051
30124
|
function parseGhIssue(value) {
|
|
30052
30125
|
const m = /issues\/(\d+)/.exec(value);
|
|
@@ -30065,13 +30138,13 @@ var LOCAL = bounded(20000);
|
|
|
30065
30138
|
var NETWORK = bounded(60000);
|
|
30066
30139
|
function whichOnPath(tool) {
|
|
30067
30140
|
const names = process.platform === "win32" ? [tool, `${tool}.exe`, `${tool}.cmd`] : [tool];
|
|
30068
|
-
for (const dir of (process.env.PATH ?? "").split(
|
|
30141
|
+
for (const dir of (process.env.PATH ?? "").split(path27.delimiter)) {
|
|
30069
30142
|
if (!dir)
|
|
30070
30143
|
continue;
|
|
30071
30144
|
for (const name of names) {
|
|
30072
|
-
const candidate =
|
|
30145
|
+
const candidate = path27.join(dir, name);
|
|
30073
30146
|
try {
|
|
30074
|
-
|
|
30147
|
+
fs18.accessSync(candidate, fs18.constants.X_OK);
|
|
30075
30148
|
return candidate;
|
|
30076
30149
|
} catch {}
|
|
30077
30150
|
}
|
|
@@ -30080,7 +30153,7 @@ function whichOnPath(tool) {
|
|
|
30080
30153
|
}
|
|
30081
30154
|
var hostingCliAvailable = (provider) => whichOnPath(provider === "gitlab" ? "glab" : "gh") !== null;
|
|
30082
30155
|
var pushRemote = (cwd) => {
|
|
30083
|
-
const result =
|
|
30156
|
+
const result = spawnSync18("git", ["remote", "get-url", "--push", "--all", "origin"], {
|
|
30084
30157
|
cwd,
|
|
30085
30158
|
...LOCAL
|
|
30086
30159
|
});
|
|
@@ -30111,7 +30184,7 @@ var defaultCli = (bin, available) => {
|
|
|
30111
30184
|
if (!available)
|
|
30112
30185
|
return null;
|
|
30113
30186
|
return (args, root) => {
|
|
30114
|
-
const out =
|
|
30187
|
+
const out = spawnSync19(bin, args, {
|
|
30115
30188
|
cwd: root,
|
|
30116
30189
|
encoding: "utf8",
|
|
30117
30190
|
env: { ...process.env, PATH: process.env.PATH ?? "" }
|
|
@@ -30200,76 +30273,6 @@ var PLUGIN_ROOT = packageRoot();
|
|
|
30200
30273
|
var ASSET_ROOT = assetRoot();
|
|
30201
30274
|
var resolveWorkspaceRoot = (explicit) => explicit || process.cwd();
|
|
30202
30275
|
|
|
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
30276
|
// packages/workit-core/src/core/youtrack.ts
|
|
30274
30277
|
var ISSUE_RE = /^[A-Z][A-Z0-9_]*-\d+$/;
|
|
30275
30278
|
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.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": "^2.
|
|
47
|
+
"@workit-dev/core": "^2.21.1",
|
|
48
48
|
"zod": "4.6.5"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|