@brainervirus/workit-mcp 8.12.0 → 8.12.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 +67 -67
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -18436,6 +18436,63 @@ function acquireFileLockSync(targetPath, options) {
|
|
|
18436
18436
|
}
|
|
18437
18437
|
}
|
|
18438
18438
|
}
|
|
18439
|
+
// packages/workit-core/src/core/logger.ts
|
|
18440
|
+
import os from "node:os";
|
|
18441
|
+
var REDACTED = "[REDACTED]";
|
|
18442
|
+
var SECRET_VALUE = /\b(?:Bearer|Basic|Digest|Token)\s+\S+/gi;
|
|
18443
|
+
var KEY_EQ_VALUE = /\b([A-Za-z0-9_-]*(?:token|secret|password|passwd|apikey|api[_-]?key|authorization|credential|bearer)[A-Za-z0-9_-]*)([:=]\s*).+/gi;
|
|
18444
|
+
var URL_QUERY = /(https?:\/\/[^?#\s]+)\?[^#\s]*/g;
|
|
18445
|
+
var SENSITIVE_WORDS = new Set([
|
|
18446
|
+
"token",
|
|
18447
|
+
"secret",
|
|
18448
|
+
"password",
|
|
18449
|
+
"passwd",
|
|
18450
|
+
"authorization",
|
|
18451
|
+
"credential",
|
|
18452
|
+
"credentials",
|
|
18453
|
+
"cookie",
|
|
18454
|
+
"api",
|
|
18455
|
+
"apikey",
|
|
18456
|
+
"apitoken",
|
|
18457
|
+
"accesstoken",
|
|
18458
|
+
"clientsecret",
|
|
18459
|
+
"refreshtoken",
|
|
18460
|
+
"key",
|
|
18461
|
+
"bearer",
|
|
18462
|
+
"prompt",
|
|
18463
|
+
"message",
|
|
18464
|
+
"messages",
|
|
18465
|
+
"content",
|
|
18466
|
+
"body",
|
|
18467
|
+
"args",
|
|
18468
|
+
"argument",
|
|
18469
|
+
"result",
|
|
18470
|
+
"results",
|
|
18471
|
+
"output",
|
|
18472
|
+
"issue",
|
|
18473
|
+
"description",
|
|
18474
|
+
"summary",
|
|
18475
|
+
"payload",
|
|
18476
|
+
"script",
|
|
18477
|
+
"command",
|
|
18478
|
+
"text",
|
|
18479
|
+
"query"
|
|
18480
|
+
]);
|
|
18481
|
+
var STACK_WORDS = new Set(["stack", "stacktrace", "trace"]);
|
|
18482
|
+
var escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
18483
|
+
var homePattern = new RegExp(`${escapeRegExp(os.homedir())}(?=[/\\\\]|$)|\\$HOME(?=[/\\\\]|$)`, "g");
|
|
18484
|
+
var applyPatterns = (value) => {
|
|
18485
|
+
let out = value;
|
|
18486
|
+
out = out.replace(SECRET_VALUE, REDACTED);
|
|
18487
|
+
out = out.replace(KEY_EQ_VALUE, "$1$2[REDACTED]");
|
|
18488
|
+
out = out.replace(URL_QUERY, "$1?[REDACTED]");
|
|
18489
|
+
out = out.replace(homePattern, "~");
|
|
18490
|
+
if (process.platform === "win32")
|
|
18491
|
+
out = out.replace(/\\/g, "/");
|
|
18492
|
+
return out;
|
|
18493
|
+
};
|
|
18494
|
+
var redactSecrets = (value) => applyPatterns(value);
|
|
18495
|
+
|
|
18439
18496
|
// packages/workit-core/src/store/paths.ts
|
|
18440
18497
|
import { spawnSync } from "node:child_process";
|
|
18441
18498
|
import { createHash as createHash2 } from "node:crypto";
|
|
@@ -21266,7 +21323,7 @@ function checkCommand(args, version, onPath = workitAvailable()) {
|
|
|
21266
21323
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
21267
21324
|
import { createHash as createHash5 } from "node:crypto";
|
|
21268
21325
|
import fs9 from "node:fs";
|
|
21269
|
-
import
|
|
21326
|
+
import os2 from "node:os";
|
|
21270
21327
|
import path8 from "node:path";
|
|
21271
21328
|
var MAX_BUFFER = 256 * 1024 * 1024;
|
|
21272
21329
|
var GIT_TIMEOUTS = { local: 20000, worktree: 120000, network: 15000 };
|
|
@@ -21314,7 +21371,7 @@ function worktreeTree(cwd, options = {}) {
|
|
|
21314
21371
|
return null;
|
|
21315
21372
|
const cap = options.maxUntrackedBytes ?? MAX_UNTRACKED_BYTES;
|
|
21316
21373
|
const timeoutMs = options.timeoutMs ?? GIT_TIMEOUTS.worktree;
|
|
21317
|
-
const scratch = fs9.mkdtempSync(path8.join(
|
|
21374
|
+
const scratch = fs9.mkdtempSync(path8.join(os2.tmpdir(), "workit-tree-"));
|
|
21318
21375
|
try {
|
|
21319
21376
|
const tempIndex = path8.join(scratch, "index");
|
|
21320
21377
|
if (fs9.existsSync(indexPath))
|
|
@@ -21468,7 +21525,7 @@ import {
|
|
|
21468
21525
|
readdirSync as readdirSync2,
|
|
21469
21526
|
writeFileSync as writeFileSync2
|
|
21470
21527
|
} from "node:fs";
|
|
21471
|
-
import
|
|
21528
|
+
import os3 from "node:os";
|
|
21472
21529
|
import path9 from "node:path";
|
|
21473
21530
|
|
|
21474
21531
|
// packages/workit-core/src/core/boundary.ts
|
|
@@ -21528,7 +21585,7 @@ var mergePreset = (preset, input = {}, current = {
|
|
|
21528
21585
|
protected: preset === "custom" ? input.protectedNames ?? current.branchPolicy.protected : [...defs.protected]
|
|
21529
21586
|
};
|
|
21530
21587
|
};
|
|
21531
|
-
var resolveConfigDir = () => process.env.WORKFLOW_TOOLKIT_CONFIG ?? process.env.WORKFLOW_TOOLKIT_CONFIG_DIR ?? path9.join(process.env.XDG_CONFIG_HOME || path9.join(
|
|
21588
|
+
var resolveConfigDir = () => process.env.WORKFLOW_TOOLKIT_CONFIG ?? process.env.WORKFLOW_TOOLKIT_CONFIG_DIR ?? path9.join(process.env.XDG_CONFIG_HOME || path9.join(os3.homedir(), ".config"), "workit");
|
|
21532
21589
|
var migratedDir = null;
|
|
21533
21590
|
var migrationFailed = false;
|
|
21534
21591
|
var ensureConfigDir = (dir = resolveConfigDir()) => {
|
|
@@ -21538,7 +21595,7 @@ var ensureConfigDir = (dir = resolveConfigDir()) => {
|
|
|
21538
21595
|
migratedDir = dir;
|
|
21539
21596
|
return dir;
|
|
21540
21597
|
}
|
|
21541
|
-
const legacy = path9.join(process.env.XDG_CONFIG_HOME || path9.join(
|
|
21598
|
+
const legacy = path9.join(process.env.XDG_CONFIG_HOME || path9.join(os3.homedir(), ".config"), "workflow-toolkit");
|
|
21542
21599
|
if (!existsSync3(legacy)) {
|
|
21543
21600
|
migratedDir = dir;
|
|
21544
21601
|
return dir;
|
|
@@ -22453,7 +22510,7 @@ var git3 = (cwd, args) => {
|
|
|
22453
22510
|
return run.status === 0 ? (run.stdout ?? "").trim() : null;
|
|
22454
22511
|
};
|
|
22455
22512
|
var recordedBaseKey = (branch) => `branch.${branch}.workitBase`;
|
|
22456
|
-
var
|
|
22513
|
+
var escapeRegExp2 = (text) => text.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
|
|
22457
22514
|
var reflog = (cwd, ref) => (git3(cwd, ["log", "-g", "--date=unix", "--format=%H%x09%gd%x09%gs", ref, "--"]) ?? "").split(`
|
|
22458
22515
|
`).map((line) => {
|
|
22459
22516
|
const [sha = "", selector = "", ...subject] = line.split("\t");
|
|
@@ -22485,7 +22542,7 @@ function gitTrackProbe(cwd) {
|
|
|
22485
22542
|
const created = own.at(-1);
|
|
22486
22543
|
if (!created || created.subject !== "branch: Created from HEAD")
|
|
22487
22544
|
return null;
|
|
22488
|
-
const pattern = new RegExp(`^checkout: moving from (\\S+) to ${
|
|
22545
|
+
const pattern = new RegExp(`^checkout: moving from (\\S+) to ${escapeRegExp2(branch)}$`, "u");
|
|
22489
22546
|
const entry = reflog(cwd, "HEAD").findLast((item) => item.time >= created.time && item.sha === created.sha && pattern.test(item.subject));
|
|
22490
22547
|
return entry ? pattern.exec(entry.subject)?.[1] ?? null : null;
|
|
22491
22548
|
},
|
|
@@ -24925,13 +24982,13 @@ var judgeInputSummary = (raw) => {
|
|
|
24925
24982
|
};
|
|
24926
24983
|
|
|
24927
24984
|
// packages/workit-core/src/autonomy.ts
|
|
24928
|
-
import
|
|
24985
|
+
import os4 from "node:os";
|
|
24929
24986
|
import path15 from "node:path";
|
|
24930
24987
|
var accountHome = () => {
|
|
24931
24988
|
try {
|
|
24932
|
-
return
|
|
24989
|
+
return os4.userInfo().homedir;
|
|
24933
24990
|
} catch {
|
|
24934
|
-
return
|
|
24991
|
+
return os4.homedir();
|
|
24935
24992
|
}
|
|
24936
24993
|
};
|
|
24937
24994
|
var grantsHome = { resolve: accountHome };
|
|
@@ -27770,63 +27827,6 @@ function run2(root, executable, args, env = {}) {
|
|
|
27770
27827
|
};
|
|
27771
27828
|
}
|
|
27772
27829
|
|
|
27773
|
-
// packages/workit-core/src/core/logger.ts
|
|
27774
|
-
import os4 from "node:os";
|
|
27775
|
-
var REDACTED = "[REDACTED]";
|
|
27776
|
-
var SECRET_VALUE = /\b(?:Bearer|Basic|Digest|Token)\s+\S+/gi;
|
|
27777
|
-
var KEY_EQ_VALUE = /\b([A-Za-z0-9_-]*(?:token|secret|password|passwd|apikey|api[_-]?key|authorization|credential|bearer)[A-Za-z0-9_-]*)([:=]\s*).+/gi;
|
|
27778
|
-
var URL_QUERY = /(https?:\/\/[^?#\s]+)\?[^#\s]*/g;
|
|
27779
|
-
var SENSITIVE_WORDS = new Set([
|
|
27780
|
-
"token",
|
|
27781
|
-
"secret",
|
|
27782
|
-
"password",
|
|
27783
|
-
"passwd",
|
|
27784
|
-
"authorization",
|
|
27785
|
-
"credential",
|
|
27786
|
-
"credentials",
|
|
27787
|
-
"cookie",
|
|
27788
|
-
"api",
|
|
27789
|
-
"apikey",
|
|
27790
|
-
"apitoken",
|
|
27791
|
-
"accesstoken",
|
|
27792
|
-
"clientsecret",
|
|
27793
|
-
"refreshtoken",
|
|
27794
|
-
"key",
|
|
27795
|
-
"bearer",
|
|
27796
|
-
"prompt",
|
|
27797
|
-
"message",
|
|
27798
|
-
"messages",
|
|
27799
|
-
"content",
|
|
27800
|
-
"body",
|
|
27801
|
-
"args",
|
|
27802
|
-
"argument",
|
|
27803
|
-
"result",
|
|
27804
|
-
"results",
|
|
27805
|
-
"output",
|
|
27806
|
-
"issue",
|
|
27807
|
-
"description",
|
|
27808
|
-
"summary",
|
|
27809
|
-
"payload",
|
|
27810
|
-
"script",
|
|
27811
|
-
"command",
|
|
27812
|
-
"text",
|
|
27813
|
-
"query"
|
|
27814
|
-
]);
|
|
27815
|
-
var STACK_WORDS = new Set(["stack", "stacktrace", "trace"]);
|
|
27816
|
-
var escapeRegExp2 = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
27817
|
-
var homePattern = new RegExp(`${escapeRegExp2(os4.homedir())}(?=[/\\\\]|$)|\\$HOME(?=[/\\\\]|$)`, "g");
|
|
27818
|
-
var applyPatterns = (value) => {
|
|
27819
|
-
let out = value;
|
|
27820
|
-
out = out.replace(SECRET_VALUE, REDACTED);
|
|
27821
|
-
out = out.replace(KEY_EQ_VALUE, "$1$2[REDACTED]");
|
|
27822
|
-
out = out.replace(URL_QUERY, "$1?[REDACTED]");
|
|
27823
|
-
out = out.replace(homePattern, "~");
|
|
27824
|
-
if (process.platform === "win32")
|
|
27825
|
-
out = out.replace(/\\/g, "/");
|
|
27826
|
-
return out;
|
|
27827
|
-
};
|
|
27828
|
-
var redactSecrets = (value) => applyPatterns(value);
|
|
27829
|
-
|
|
27830
27830
|
// packages/workit-mcp/src/server.ts
|
|
27831
27831
|
class McpCapabilityUnavailableError extends Error {
|
|
27832
27832
|
capability;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-mcp",
|
|
3
|
-
"version": "8.12.
|
|
3
|
+
"version": "8.12.1",
|
|
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.12.
|
|
45
|
+
"@brainervirus/workit-core": "^8.12.1",
|
|
46
46
|
"@modelcontextprotocol/sdk": "1.32.0",
|
|
47
47
|
"zod": "4.6.5"
|
|
48
48
|
},
|