@brainervirus/workit-mcp 8.14.1 → 8.15.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 +59 -14
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -22002,20 +22002,19 @@ var workspaceConfigSchema = object2({
|
|
|
22002
22002
|
union([boolean2(), literal("verified")]).optional()
|
|
22003
22003
|
]))).passthrough().optional(),
|
|
22004
22004
|
youtrack: object2({ baseUrl: nonBlank.optional(), link_issues: boolean2().optional() }).passthrough().optional(),
|
|
22005
|
-
issues: object2({
|
|
22005
|
+
issues: object2({
|
|
22006
|
+
provider: _enum(["github", "gitlab", "youtrack"]).optional(),
|
|
22007
|
+
link: boolean2().optional(),
|
|
22008
|
+
relation: unknown().optional(),
|
|
22009
|
+
backlink: boolean2().optional(),
|
|
22010
|
+
link_on_pr: boolean2().optional()
|
|
22011
|
+
}).passthrough().optional(),
|
|
22006
22012
|
branchPolicy: workspaceBranchPolicySchema.optional(),
|
|
22007
22013
|
commitPolicy: workspaceCommitPolicySchema.optional(),
|
|
22008
22014
|
defaultProfile: nonBlank.optional(),
|
|
22009
22015
|
profiles: record(nonBlank, workspaceProfileSchema).optional(),
|
|
22010
22016
|
releaseTracks: record(nonBlank, releaseTrackSchema).optional()
|
|
22011
22017
|
}).passthrough().superRefine((workspace, context) => {
|
|
22012
|
-
if (workspace.issues && workspace.vcs?.provider !== "github") {
|
|
22013
|
-
context.addIssue({
|
|
22014
|
-
code: "custom",
|
|
22015
|
-
path: ["issues"],
|
|
22016
|
-
message: `GitHub issue linking requires the github provider, got ${workspace.vcs?.provider ?? "unset"}`
|
|
22017
|
-
});
|
|
22018
|
-
}
|
|
22019
22018
|
if (workspace.defaultProfile !== undefined && !Object.hasOwn(workspace.profiles ?? {}, workspace.defaultProfile)) {
|
|
22020
22019
|
context.addIssue({
|
|
22021
22020
|
code: "custom",
|
|
@@ -22855,6 +22854,44 @@ var readVcsConfig = () => {
|
|
|
22855
22854
|
}
|
|
22856
22855
|
return { status: "malformed", path: file, config: {}, error: `${file} is not a JSON object` };
|
|
22857
22856
|
};
|
|
22857
|
+
var TRACKERS = new Set(["github", "gitlab", "youtrack"]);
|
|
22858
|
+
var asRecord = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
22859
|
+
var flag = (value) => typeof value === "boolean" ? value : null;
|
|
22860
|
+
var text2 = (value) => typeof value === "string" && value.trim() ? value.trim() : null;
|
|
22861
|
+
function issueTrackerOf(issues, youtrack) {
|
|
22862
|
+
const iss = asRecord(issues);
|
|
22863
|
+
const yt = asRecord(youtrack);
|
|
22864
|
+
const warnings = [];
|
|
22865
|
+
const named = typeof iss.provider === "string" && TRACKERS.has(iss.provider.toLowerCase()) ? iss.provider.toLowerCase() : null;
|
|
22866
|
+
if (iss.relation !== undefined && iss.relation !== "closes" && iss.relation !== "refs")
|
|
22867
|
+
warnings.push(`issues.relation ${JSON.stringify(iss.relation)} is not closes or refs; read as closes`);
|
|
22868
|
+
for (const key of ["repo", "host"])
|
|
22869
|
+
if (iss[key] !== undefined && text2(iss[key]) === null)
|
|
22870
|
+
warnings.push(`issues.${key} is not a non-empty string; ignored`);
|
|
22871
|
+
const common = {
|
|
22872
|
+
relation: iss.relation === "refs" ? "refs" : "closes",
|
|
22873
|
+
backlink: iss.backlink === true,
|
|
22874
|
+
baseUrl: text2(yt.baseUrl),
|
|
22875
|
+
repo: text2(iss.repo)?.replace(/^\/+|\/+$/gu, "") ?? null,
|
|
22876
|
+
host: text2(iss.host)?.toLowerCase() ?? null,
|
|
22877
|
+
warnings
|
|
22878
|
+
};
|
|
22879
|
+
const legacyGithub = named === "github" && flag(iss.link) === null;
|
|
22880
|
+
if (flag(yt.link_issues) === true && (named === null || legacyGithub))
|
|
22881
|
+
return { provider: "youtrack", link: true, ...common, source: "youtrack.link_issues" };
|
|
22882
|
+
if (named) {
|
|
22883
|
+
const link = flag(iss.link) ?? flag(iss.link_on_pr) ?? (named === "youtrack" ? flag(yt.link_issues) : null) ?? false;
|
|
22884
|
+
return {
|
|
22885
|
+
provider: named,
|
|
22886
|
+
link,
|
|
22887
|
+
...common,
|
|
22888
|
+
source: flag(iss.link) === null && flag(iss.link_on_pr) !== null ? "issues.link_on_pr" : "issues"
|
|
22889
|
+
};
|
|
22890
|
+
}
|
|
22891
|
+
if (common.baseUrl)
|
|
22892
|
+
return { provider: "youtrack", link: false, ...common, source: "youtrack.baseUrl" };
|
|
22893
|
+
return null;
|
|
22894
|
+
}
|
|
22858
22895
|
var trackSummary = (resolution) => resolution.status === "resolved" ? {
|
|
22859
22896
|
name: resolution.track?.name ?? null,
|
|
22860
22897
|
source: resolution.source,
|
|
@@ -22875,6 +22912,7 @@ function vcsConfig(mode, cwd, options = {}) {
|
|
|
22875
22912
|
const rawProvider = wsVcs.provider ?? (determinateRoot ? remoteProvider(root) : null) ?? cfg.provider ?? null;
|
|
22876
22913
|
const provider = rawProvider === null || rawProvider === undefined ? null : String(rawProvider).toLowerCase() || null;
|
|
22877
22914
|
const workspaceDefault = workspaceDefaultTarget(root, cfg.defaultTargetBranch);
|
|
22915
|
+
const issueTracker = issueTrackerOf(wsIssues, wsYt);
|
|
22878
22916
|
const linkIssues = typeof wsYt.link_issues === "boolean" ? wsYt.link_issues : null;
|
|
22879
22917
|
const youtrackBaseUrl = typeof wsYt.baseUrl === "string" ? wsYt.baseUrl : null;
|
|
22880
22918
|
let issuesProvider = null;
|
|
@@ -22907,7 +22945,8 @@ function vcsConfig(mode, cwd, options = {}) {
|
|
|
22907
22945
|
link_issues: linkIssues,
|
|
22908
22946
|
youtrack_base_url: youtrackBaseUrl,
|
|
22909
22947
|
issues_provider: issuesProvider,
|
|
22910
|
-
link_on_pr: linkOnPr
|
|
22948
|
+
link_on_pr: linkOnPr,
|
|
22949
|
+
issue_tracker: issueTracker
|
|
22911
22950
|
};
|
|
22912
22951
|
}
|
|
22913
22952
|
if (cfgStatus === "malformed") {
|
|
@@ -22933,7 +22972,8 @@ function vcsConfig(mode, cwd, options = {}) {
|
|
|
22933
22972
|
link_issues: linkIssues,
|
|
22934
22973
|
youtrack_base_url: youtrackBaseUrl,
|
|
22935
22974
|
issues_provider: issuesProvider,
|
|
22936
|
-
link_on_pr: linkOnPr
|
|
22975
|
+
link_on_pr: linkOnPr,
|
|
22976
|
+
issue_tracker: issueTracker
|
|
22937
22977
|
};
|
|
22938
22978
|
if (provider === "gitlab") {
|
|
22939
22979
|
out.gitlab = {
|
|
@@ -23037,7 +23077,12 @@ var MAX_LINE_BYTES = 4096;
|
|
|
23037
23077
|
var PASSING = new Set(["verified", "tests-verified", "type-check-only"]);
|
|
23038
23078
|
var FAILING = new Set(["failed", "blocked"]);
|
|
23039
23079
|
var STRONG_RESULTS = new Set(["verified", "tests-verified"]);
|
|
23040
|
-
var PR_ROW_TYPES = new Set([
|
|
23080
|
+
var PR_ROW_TYPES = new Set([
|
|
23081
|
+
"pr.created",
|
|
23082
|
+
"pr.status",
|
|
23083
|
+
"pr.merged",
|
|
23084
|
+
"pr.linked"
|
|
23085
|
+
]);
|
|
23041
23086
|
var err = (code, error, unblock) => ({
|
|
23042
23087
|
ok: false,
|
|
23043
23088
|
code,
|
|
@@ -25174,7 +25219,7 @@ var RISK = {
|
|
|
25174
25219
|
};
|
|
25175
25220
|
var YES = new Set(["true", "yes", "y", "1", "on"]);
|
|
25176
25221
|
var NO = new Set(["false", "no", "n", "0", "off", "none"]);
|
|
25177
|
-
var
|
|
25222
|
+
var flag2 = (value, unknownAs) => {
|
|
25178
25223
|
if (typeof value === "boolean")
|
|
25179
25224
|
return { ok: true, value };
|
|
25180
25225
|
if (typeof value === "number" && (value === 0 || value === 1))
|
|
@@ -25240,12 +25285,12 @@ function normalizeJudgment(raw, previous) {
|
|
|
25240
25285
|
const items = Array.isArray(value) ? value : [value];
|
|
25241
25286
|
judgment.refs.push(...items.filter((item) => item !== null && item !== "").map(refOf));
|
|
25242
25287
|
} else {
|
|
25243
|
-
if (name === "needsPlan" && typeof value === "string" && !
|
|
25288
|
+
if (name === "needsPlan" && typeof value === "string" && !flag2(value, false).ok && value.trim()) {
|
|
25244
25289
|
judgment.needsPlan = true;
|
|
25245
25290
|
judgment.refs.push(refOf(value.trim()));
|
|
25246
25291
|
continue;
|
|
25247
25292
|
}
|
|
25248
|
-
const parsed =
|
|
25293
|
+
const parsed = flag2(value, name === "behaviorChange");
|
|
25249
25294
|
if (parsed.ok)
|
|
25250
25295
|
judgment[name] = parsed.value;
|
|
25251
25296
|
else
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-mcp",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.15.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit shared MCP transport for the eight task and policy operation families",
|
|
6
6
|
"keywords": [
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"build": "bun scripts/build.ts"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@brainervirus/workit-core": "^8.
|
|
45
|
+
"@brainervirus/workit-core": "^8.15.0",
|
|
46
46
|
"@modelcontextprotocol/sdk": "1.32.0",
|
|
47
47
|
"zod": "4.6.5"
|
|
48
48
|
},
|