@brainervirus/workit-mcp 8.0.0 → 8.1.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 +237 -161
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -16573,12 +16573,12 @@ class StdioServerTransport {
|
|
|
16573
16573
|
// packages/workit-mcp/src/server.ts
|
|
16574
16574
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
16575
16575
|
|
|
16576
|
-
// packages/workit-
|
|
16577
|
-
import { spawnSync as
|
|
16576
|
+
// packages/workit-core/src/core.ts
|
|
16577
|
+
import { spawnSync as spawnSync13 } from "node:child_process";
|
|
16578
16578
|
import { existsSync as existsSync7, realpathSync as realpathSync5 } from "node:fs";
|
|
16579
16579
|
import path19 from "node:path";
|
|
16580
16580
|
|
|
16581
|
-
// packages/workit-
|
|
16581
|
+
// packages/workit-core/src/core/task-contract.ts
|
|
16582
16582
|
import { createHash, randomUUID } from "node:crypto";
|
|
16583
16583
|
var SCHEMA_VERSION = 1;
|
|
16584
16584
|
var POLICY_VERSION = "1.0.0";
|
|
@@ -17434,7 +17434,7 @@ function requirementId(input) {
|
|
|
17434
17434
|
}
|
|
17435
17435
|
});
|
|
17436
17436
|
}
|
|
17437
|
-
// packages/workit-
|
|
17437
|
+
// packages/workit-core/src/core/operation-input.ts
|
|
17438
17438
|
var str = (d, values) => ({
|
|
17439
17439
|
type: "string",
|
|
17440
17440
|
...values ? { enum: values } : {},
|
|
@@ -17830,7 +17830,7 @@ function parseAdvertisedOperation(family, input, host) {
|
|
|
17830
17830
|
}))
|
|
17831
17831
|
});
|
|
17832
17832
|
}
|
|
17833
|
-
// packages/workit-
|
|
17833
|
+
// packages/workit-core/src/core/task-store.ts
|
|
17834
17834
|
import { createHash as createHash4, randomUUID as randomUUID3 } from "node:crypto";
|
|
17835
17835
|
import * as fs7 from "node:fs";
|
|
17836
17836
|
import path6 from "node:path";
|
|
@@ -18436,7 +18436,7 @@ function acquireFileLockSync(targetPath, options) {
|
|
|
18436
18436
|
}
|
|
18437
18437
|
}
|
|
18438
18438
|
}
|
|
18439
|
-
// packages/workit-
|
|
18439
|
+
// packages/workit-core/src/core/package-root.ts
|
|
18440
18440
|
import { existsSync } from "node:fs";
|
|
18441
18441
|
import path3 from "node:path";
|
|
18442
18442
|
import { fileURLToPath } from "node:url";
|
|
@@ -18455,12 +18455,12 @@ var assetRoot = () => {
|
|
|
18455
18455
|
return existsSync(assets) ? assets : root;
|
|
18456
18456
|
};
|
|
18457
18457
|
|
|
18458
|
-
// packages/workit-
|
|
18458
|
+
// packages/workit-core/src/core/store-lock.ts
|
|
18459
18459
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
18460
18460
|
import fs5 from "node:fs";
|
|
18461
18461
|
import { hostname } from "node:os";
|
|
18462
18462
|
|
|
18463
|
-
// packages/workit-
|
|
18463
|
+
// packages/workit-core/src/store/paths.ts
|
|
18464
18464
|
import { spawnSync } from "node:child_process";
|
|
18465
18465
|
import { createHash as createHash2 } from "node:crypto";
|
|
18466
18466
|
import fs4 from "node:fs";
|
|
@@ -18740,7 +18740,7 @@ var checkoutSlug = (root) => {
|
|
|
18740
18740
|
return `${base}-${shortHash(canonical)}`;
|
|
18741
18741
|
};
|
|
18742
18742
|
|
|
18743
|
-
// packages/workit-
|
|
18743
|
+
// packages/workit-core/src/core/store-lock.ts
|
|
18744
18744
|
var metadataLockSchema = object2({
|
|
18745
18745
|
pid: number2().int().nonnegative().safe(),
|
|
18746
18746
|
processStart: string2().nullable(),
|
|
@@ -18871,7 +18871,7 @@ var clearAbandonedReclaimGuard = (lockPath, nowMs = Date.now()) => {
|
|
|
18871
18871
|
}
|
|
18872
18872
|
};
|
|
18873
18873
|
|
|
18874
|
-
// packages/workit-
|
|
18874
|
+
// packages/workit-core/src/store/event-log.ts
|
|
18875
18875
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
18876
18876
|
import fs6 from "node:fs";
|
|
18877
18877
|
import path5 from "node:path";
|
|
@@ -19031,7 +19031,7 @@ var retryTransient = (run) => {
|
|
|
19031
19031
|
};
|
|
19032
19032
|
var renameWithRetry = (from, to) => retryTransient(() => fs6.renameSync(from, to));
|
|
19033
19033
|
|
|
19034
|
-
// packages/workit-
|
|
19034
|
+
// packages/workit-core/src/store/patch.ts
|
|
19035
19035
|
var isPlainObject3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19036
19036
|
var equal = (left, right) => {
|
|
19037
19037
|
if (left === right)
|
|
@@ -19141,7 +19141,7 @@ var isPatch = (value) => Array.isArray(value) && value.every((op) => {
|
|
|
19141
19141
|
return false;
|
|
19142
19142
|
});
|
|
19143
19143
|
|
|
19144
|
-
// packages/workit-
|
|
19144
|
+
// packages/workit-core/src/store/reduce.ts
|
|
19145
19145
|
import { createHash as createHash3 } from "node:crypto";
|
|
19146
19146
|
var OPENING_TYPES = new Set([
|
|
19147
19147
|
"task.opened",
|
|
@@ -19272,7 +19272,7 @@ function eventType(before, after) {
|
|
|
19272
19272
|
return "task.updated";
|
|
19273
19273
|
}
|
|
19274
19274
|
|
|
19275
|
-
// packages/workit-
|
|
19275
|
+
// packages/workit-core/src/store/notes.ts
|
|
19276
19276
|
var SLOT = Symbol.for("workit.migrationReporter");
|
|
19277
19277
|
var reportMigration = (report) => {
|
|
19278
19278
|
try {
|
|
@@ -19283,7 +19283,7 @@ var reportMigration = (report) => {
|
|
|
19283
19283
|
};
|
|
19284
19284
|
var migrationReporterInstalled = () => typeof globalThis[SLOT] === "function";
|
|
19285
19285
|
|
|
19286
|
-
// packages/workit-
|
|
19286
|
+
// packages/workit-core/src/core/task-store.ts
|
|
19287
19287
|
var MIGRATION_PENDING = "workit migration pending";
|
|
19288
19288
|
var STORE_FORMAT = 3;
|
|
19289
19289
|
var STORE_MIN_RUNTIME = "3.0.0";
|
|
@@ -20919,18 +20919,18 @@ class TaskStore {
|
|
|
20919
20919
|
return failure2(recovery ? "recovery_required" : "storage_error", `lock operation failed: ${String(error)}`, { path: lockPath });
|
|
20920
20920
|
}
|
|
20921
20921
|
}
|
|
20922
|
-
// packages/workit-
|
|
20922
|
+
// packages/workit-core/src/core/workers.ts
|
|
20923
20923
|
var UNCERTAIN_WORKER_STATES = ["dispatching", "running", "cancelling", "unknown"];
|
|
20924
20924
|
var isUncertainWorker = (state) => UNCERTAIN_WORKER_STATES.includes(state);
|
|
20925
20925
|
var workerBlocksTransition = (transition, state) => transition === "pause" ? false : isUncertainWorker(state);
|
|
20926
20926
|
|
|
20927
|
-
// packages/workit-
|
|
20927
|
+
// packages/workit-core/src/core/task-evaluation.ts
|
|
20928
20928
|
import { createHash as createHash7 } from "node:crypto";
|
|
20929
20929
|
import * as fs11 from "node:fs";
|
|
20930
20930
|
import { spawnSync as spawnSync6 } from "node:child_process";
|
|
20931
20931
|
import path11 from "node:path";
|
|
20932
20932
|
|
|
20933
|
-
// packages/workit-
|
|
20933
|
+
// packages/workit-core/src/check-config.ts
|
|
20934
20934
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
20935
20935
|
import fs8 from "node:fs";
|
|
20936
20936
|
import path7 from "node:path";
|
|
@@ -21135,7 +21135,7 @@ function checkCommand(args, version, onPath = workitAvailable()) {
|
|
|
21135
21135
|
return onPath ? `workit check ${args}` : `npx -y @brainervirus/workit-cli@${version} check ${args}`;
|
|
21136
21136
|
}
|
|
21137
21137
|
|
|
21138
|
-
// packages/workit-
|
|
21138
|
+
// packages/workit-core/src/git/rev.ts
|
|
21139
21139
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
21140
21140
|
import { createHash as createHash5 } from "node:crypto";
|
|
21141
21141
|
import fs9 from "node:fs";
|
|
@@ -21316,11 +21316,11 @@ function pushRemoteName(cwd, branch) {
|
|
|
21316
21316
|
return remotes.length === 1 ? remotes[0] : null;
|
|
21317
21317
|
}
|
|
21318
21318
|
|
|
21319
|
-
// packages/workit-
|
|
21319
|
+
// packages/workit-core/src/core/policy/derive.ts
|
|
21320
21320
|
import { existsSync as existsSync3 } from "node:fs";
|
|
21321
21321
|
import path10 from "node:path";
|
|
21322
21322
|
|
|
21323
|
-
// packages/workit-
|
|
21323
|
+
// packages/workit-core/src/ledger.ts
|
|
21324
21324
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
21325
21325
|
import { createHash as createHash6, randomBytes as randomBytes2 } from "node:crypto";
|
|
21326
21326
|
import fs10 from "node:fs";
|
|
@@ -21562,7 +21562,7 @@ var independenceReasons = (row, authors) => {
|
|
|
21562
21562
|
reasons.push("self");
|
|
21563
21563
|
return reasons;
|
|
21564
21564
|
};
|
|
21565
|
-
function effectiveOf(rows, authors) {
|
|
21565
|
+
function effectiveOf(rows, authors, sameCode) {
|
|
21566
21566
|
let effective = null;
|
|
21567
21567
|
for (const row of rows) {
|
|
21568
21568
|
if (!effective) {
|
|
@@ -21573,7 +21573,7 @@ function effectiveOf(rows, authors) {
|
|
|
21573
21573
|
const effIndependent = independenceReasons(effective, authors).length === 0;
|
|
21574
21574
|
if (effIndependent && !rowIndependent)
|
|
21575
21575
|
continue;
|
|
21576
|
-
if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session)
|
|
21576
|
+
if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session && sameCode(effective, row))
|
|
21577
21577
|
continue;
|
|
21578
21578
|
effective = row;
|
|
21579
21579
|
}
|
|
@@ -21604,16 +21604,22 @@ function checkVerdicts(cwd, branch, rows) {
|
|
|
21604
21604
|
const head = branchHead(cwd, branch);
|
|
21605
21605
|
const fallbackBase = defaultBase(cwd);
|
|
21606
21606
|
const keyCache = new Map;
|
|
21607
|
-
const
|
|
21608
|
-
if (!base || !
|
|
21607
|
+
const keysAt = (base, at) => {
|
|
21608
|
+
if (!base || !at)
|
|
21609
21609
|
return { patchId: null, diffHash: null };
|
|
21610
|
-
|
|
21610
|
+
const cacheKey = `${base}\x00${at}`;
|
|
21611
|
+
let key = keyCache.get(cacheKey);
|
|
21611
21612
|
if (!key) {
|
|
21612
|
-
key = { patchId: patchId(cwd, base,
|
|
21613
|
-
keyCache.set(
|
|
21613
|
+
key = { patchId: patchId(cwd, base, at), diffHash: diffHash(cwd, base, at) };
|
|
21614
|
+
keyCache.set(cacheKey, key);
|
|
21614
21615
|
}
|
|
21615
21616
|
return key;
|
|
21616
21617
|
};
|
|
21618
|
+
const keyFor = (base) => keysAt(base, head);
|
|
21619
|
+
const sameCode = (failed, row) => verdictBasis(failed, {
|
|
21620
|
+
head: row.head,
|
|
21621
|
+
...keysAt(failed.base ?? fallbackBase, row.head)
|
|
21622
|
+
}) !== "stale" || restackCarries(rows, branch, failed.head, row.head);
|
|
21617
21623
|
const authors = authorSessions(cwd, rows, branch, { base: fallbackBase, head });
|
|
21618
21624
|
const byKind = new Map;
|
|
21619
21625
|
for (const row of rows)
|
|
@@ -21623,7 +21629,7 @@ function checkVerdicts(cwd, branch, rows) {
|
|
|
21623
21629
|
}
|
|
21624
21630
|
const verdicts = [];
|
|
21625
21631
|
for (const [kind, list] of byKind) {
|
|
21626
|
-
const row = effectiveOf(list, authors);
|
|
21632
|
+
const row = effectiveOf(list, authors, sameCode);
|
|
21627
21633
|
if (!row)
|
|
21628
21634
|
continue;
|
|
21629
21635
|
let basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
|
|
@@ -21649,11 +21655,11 @@ function checkVerdicts(cwd, branch, rows) {
|
|
|
21649
21655
|
verdicts.sort((a, b) => a.verdict.seq - b.verdict.seq);
|
|
21650
21656
|
const newestCurrent = verdicts.findLast((entry) => entry.current) ?? verdicts.at(-1) ?? null;
|
|
21651
21657
|
const failing = verdicts.find((entry) => entry.current && entry.independent && FAILING.has(String(entry.verdict.result)));
|
|
21652
|
-
const newestAccepted = verdicts.findLast((entry) => entry.accepted) ?? null;
|
|
21658
|
+
const newestAccepted = verdicts.findLast((entry) => entry.accepted && STRONG_RESULTS.has(String(entry.verdict.result))) ?? null;
|
|
21653
21659
|
const accepted = newestAccepted && !failing ? { accepted: true, verdict: newestAccepted.verdict, reasons: [] } : {
|
|
21654
21660
|
accepted: false,
|
|
21655
21661
|
verdict: failing?.verdict ?? null,
|
|
21656
|
-
reasons: failing ? ["failing_verdict"] : newestCurrent
|
|
21662
|
+
reasons: failing ? ["failing_verdict"] : !newestCurrent ? ["no_verdict"] : newestCurrent.reasons.length ? newestCurrent.reasons : ["type_check_only"]
|
|
21657
21663
|
};
|
|
21658
21664
|
const selfEntry = failing ? undefined : verdicts.findLast((entry) => entry.current && !entry.independent && STRONG_RESULTS.has(String(entry.verdict.result)));
|
|
21659
21665
|
return {
|
|
@@ -21669,9 +21675,9 @@ function checkVerdicts(cwd, branch, rows) {
|
|
|
21669
21675
|
authors: [...authors].toSorted()
|
|
21670
21676
|
};
|
|
21671
21677
|
}
|
|
21672
|
-
var OBSERVED_ONLY = new Set(["check", ...PR_ROW_TYPES]);
|
|
21678
|
+
var OBSERVED_ONLY = new Set(["check", "merge.unverified", ...PR_ROW_TYPES]);
|
|
21673
21679
|
|
|
21674
|
-
// packages/workit-
|
|
21680
|
+
// packages/workit-core/src/core/policy/derive.ts
|
|
21675
21681
|
var RULES = {
|
|
21676
21682
|
test: "check:test",
|
|
21677
21683
|
self: "verdict:self",
|
|
@@ -21859,7 +21865,7 @@ function derivedRuleStatus(task, requirement, root, ledger) {
|
|
|
21859
21865
|
}
|
|
21860
21866
|
}
|
|
21861
21867
|
|
|
21862
|
-
// packages/workit-
|
|
21868
|
+
// packages/workit-core/src/core/task-evaluation.ts
|
|
21863
21869
|
var digestBytes = (value) => createHash7("sha256").update(value).digest("hex");
|
|
21864
21870
|
var inside = (root, candidate) => candidate === root || candidate.startsWith(`${root}${path11.sep}`);
|
|
21865
21871
|
var relative = (root, candidate) => path11.relative(root, candidate).split(path11.sep).join("/") || ".";
|
|
@@ -22525,7 +22531,7 @@ function evaluateClosure(requestedOutcome, view) {
|
|
|
22525
22531
|
});
|
|
22526
22532
|
}
|
|
22527
22533
|
|
|
22528
|
-
// packages/workit-
|
|
22534
|
+
// packages/workit-core/src/core/methods.ts
|
|
22529
22535
|
var METHODS = {
|
|
22530
22536
|
"workit-shape": { dimensions: ["challenge", "decisions", "artifacts", "continuity"] },
|
|
22531
22537
|
"workit-bdd": { dimensions: ["testing"] },
|
|
@@ -22571,7 +22577,7 @@ function selectMethods(policy, capabilities) {
|
|
|
22571
22577
|
});
|
|
22572
22578
|
}
|
|
22573
22579
|
|
|
22574
|
-
// packages/workit-
|
|
22580
|
+
// packages/workit-core/src/core/task-context.ts
|
|
22575
22581
|
function reconcileResume(view, observations = []) {
|
|
22576
22582
|
if (observations.length > 0)
|
|
22577
22583
|
return failure2("permission_denied", "worker observations require native host verification");
|
|
@@ -22685,75 +22691,10 @@ var exportDigest = (bundle) => sha256({
|
|
|
22685
22691
|
sourceWorkspaceId: bundle.sourceWorkspaceId,
|
|
22686
22692
|
task: bundle.task
|
|
22687
22693
|
});
|
|
22688
|
-
// packages/workit-
|
|
22689
|
-
import {
|
|
22690
|
-
var run = (cwd, args) => {
|
|
22691
|
-
try {
|
|
22692
|
-
const stdout = execFileSync("git", args, {
|
|
22693
|
-
cwd,
|
|
22694
|
-
encoding: "utf8",
|
|
22695
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
22696
|
-
});
|
|
22697
|
-
return { stdout: stdout.trimEnd(), stderr: "", exitCode: 0 };
|
|
22698
|
-
} catch (error) {
|
|
22699
|
-
const e = error;
|
|
22700
|
-
return {
|
|
22701
|
-
stdout: (e.stdout ?? "").trimEnd(),
|
|
22702
|
-
stderr: (e.stderr ?? "").trimEnd(),
|
|
22703
|
-
exitCode: e.status ?? 1
|
|
22704
|
-
};
|
|
22705
|
-
}
|
|
22706
|
-
};
|
|
22707
|
-
var gitContext = (workspaceRoot, paths = []) => {
|
|
22708
|
-
const cwd = workspaceRoot;
|
|
22709
|
-
let failure;
|
|
22710
|
-
const runHere = (args) => {
|
|
22711
|
-
const result = run(cwd, args);
|
|
22712
|
-
if (!failure && result.exitCode !== 0) {
|
|
22713
|
-
failure = { stderr: result.stderr, exitCode: result.exitCode };
|
|
22714
|
-
}
|
|
22715
|
-
return result.stdout;
|
|
22716
|
-
};
|
|
22717
|
-
const branch = runHere(["rev-parse", "--abbrev-ref", "HEAD"]) || "unknown";
|
|
22718
|
-
const status_short = runHere(["status", "--porcelain"]);
|
|
22719
|
-
const staged = [];
|
|
22720
|
-
const unstaged = [];
|
|
22721
|
-
const untracked = [];
|
|
22722
|
-
for (const line of status_short.split(`
|
|
22723
|
-
`).filter(Boolean)) {
|
|
22724
|
-
const code = line.slice(0, 2);
|
|
22725
|
-
const file = line.slice(3);
|
|
22726
|
-
if (code === "??") {
|
|
22727
|
-
untracked.push(file);
|
|
22728
|
-
} else {
|
|
22729
|
-
if (code[0] !== " " && code[0] !== "?")
|
|
22730
|
-
staged.push(file);
|
|
22731
|
-
if (code[1] !== " " && code[1] !== "?")
|
|
22732
|
-
unstaged.push(file);
|
|
22733
|
-
}
|
|
22734
|
-
}
|
|
22735
|
-
const pathArgs = paths.length ? ["--", ...paths] : [];
|
|
22736
|
-
const diff_stat = runHere(["diff", "--stat", ...pathArgs]);
|
|
22737
|
-
const cached_stat = runHere(["diff", "--cached", "--stat", ...pathArgs]);
|
|
22738
|
-
const stagedSet = new Set(staged);
|
|
22739
|
-
const unstagedSet = new Set(unstaged);
|
|
22740
|
-
const partial_staged = [...stagedSet].filter((f) => unstagedSet.has(f));
|
|
22741
|
-
return {
|
|
22742
|
-
workspace_root: cwd,
|
|
22743
|
-
branch,
|
|
22744
|
-
status_short,
|
|
22745
|
-
staged,
|
|
22746
|
-
unstaged,
|
|
22747
|
-
untracked,
|
|
22748
|
-
diff_stat: [diff_stat, cached_stat].filter(Boolean).join(`
|
|
22749
|
-
`),
|
|
22750
|
-
partial_staged: partial_staged.length > 0,
|
|
22751
|
-
partial_staged_files: partial_staged,
|
|
22752
|
-
...failure ? { stderr: failure.stderr, exitCode: failure.exitCode } : {}
|
|
22753
|
-
};
|
|
22754
|
-
};
|
|
22694
|
+
// packages/workit-core/src/core/branch-policy.ts
|
|
22695
|
+
import { spawnSync as spawnSync7 } from "node:child_process";
|
|
22755
22696
|
|
|
22756
|
-
// packages/workit-
|
|
22697
|
+
// packages/workit-core/src/core/config.ts
|
|
22757
22698
|
import {
|
|
22758
22699
|
copyFileSync as copyFileSync2,
|
|
22759
22700
|
cpSync as cpSync2,
|
|
@@ -22766,7 +22707,7 @@ import {
|
|
|
22766
22707
|
import os2 from "node:os";
|
|
22767
22708
|
import path12 from "node:path";
|
|
22768
22709
|
|
|
22769
|
-
// packages/workit-
|
|
22710
|
+
// packages/workit-core/src/core/boundary.ts
|
|
22770
22711
|
import { statSync as statSync2 } from "node:fs";
|
|
22771
22712
|
var EVENT = {
|
|
22772
22713
|
initialization: "initialization",
|
|
@@ -22802,7 +22743,7 @@ var changedSourcesSinceLoad = (marker) => {
|
|
|
22802
22743
|
return changed;
|
|
22803
22744
|
};
|
|
22804
22745
|
|
|
22805
|
-
// packages/workit-
|
|
22746
|
+
// packages/workit-core/src/core/config.ts
|
|
22806
22747
|
var diagnosticLogger;
|
|
22807
22748
|
var PRESETS = {
|
|
22808
22749
|
gitflow: {
|
|
@@ -22877,6 +22818,7 @@ var DEFAULTS = {
|
|
|
22877
22818
|
},
|
|
22878
22819
|
commitPolicy: { preset: "conventional" }
|
|
22879
22820
|
};
|
|
22821
|
+
var unchosenBranchPolicy = new WeakSet([DEFAULTS]);
|
|
22880
22822
|
var readSafe = (p) => {
|
|
22881
22823
|
try {
|
|
22882
22824
|
return readFileSync3(p, "utf8");
|
|
@@ -22901,22 +22843,21 @@ var parseConfigResult = (raw, file) => {
|
|
|
22901
22843
|
const locale = LOCALE_RE.test(String(input.locale ?? "")) ? input.locale : DEFAULTS.locale;
|
|
22902
22844
|
const preset = Object.hasOwn(PRESETS, input.branchPolicy?.preset) ? input.branchPolicy?.preset : "gitflow";
|
|
22903
22845
|
const commitPreset = COMMIT_PRESETS.includes(String(input.commitPolicy?.preset ?? "")) ? input.commitPolicy?.preset : "conventional";
|
|
22904
|
-
|
|
22905
|
-
|
|
22906
|
-
|
|
22907
|
-
|
|
22908
|
-
|
|
22909
|
-
|
|
22910
|
-
|
|
22911
|
-
|
|
22912
|
-
|
|
22913
|
-
}
|
|
22914
|
-
commitPolicy: {
|
|
22915
|
-
preset: commitPreset,
|
|
22916
|
-
...typeof input.commitPolicy?.pattern === "string" ? { pattern: input.commitPolicy.pattern } : {}
|
|
22917
|
-
}
|
|
22846
|
+
const config = {
|
|
22847
|
+
locale,
|
|
22848
|
+
localeOptions: Array.isArray(input.localeOptions) ? input.localeOptions : DEFAULTS.localeOptions,
|
|
22849
|
+
branchPolicy: mergePreset(preset, {
|
|
22850
|
+
allowed: Array.isArray(input.branchPolicy?.allowed) ? input.branchPolicy.allowed : undefined,
|
|
22851
|
+
protectedNames: Array.isArray(input.branchPolicy?.protected) ? input.branchPolicy.protected : undefined
|
|
22852
|
+
}, DEFAULTS),
|
|
22853
|
+
commitPolicy: {
|
|
22854
|
+
preset: commitPreset,
|
|
22855
|
+
...typeof input.commitPolicy?.pattern === "string" ? { pattern: input.commitPolicy.pattern } : {}
|
|
22918
22856
|
}
|
|
22919
22857
|
};
|
|
22858
|
+
if (!Object.hasOwn(PRESETS, input.branchPolicy?.preset))
|
|
22859
|
+
unchosenBranchPolicy.add(config);
|
|
22860
|
+
return { status: "valid", path: file, config };
|
|
22920
22861
|
};
|
|
22921
22862
|
var readConfigTyped = (dir) => {
|
|
22922
22863
|
const file = path12.join(dir ?? configDir(), "config.json");
|
|
@@ -22930,9 +22871,11 @@ var readConfig = () => {
|
|
|
22930
22871
|
};
|
|
22931
22872
|
var vcsConfigPath = () => process.env.WORKFLOW_VCS_CONFIG ?? path12.join(configDir(), "vcs.json");
|
|
22932
22873
|
var branchGlobPattern = (glob) => new RegExp(`^${glob.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*")}$`, "i");
|
|
22933
|
-
var resolveBranchPolicy = (config, workspace) => {
|
|
22874
|
+
var resolveBranchPolicy = (config, workspace, repoPreset) => {
|
|
22934
22875
|
const wp = workspace?.branchPolicy ?? {};
|
|
22935
|
-
const
|
|
22876
|
+
const workspacePreset = Object.hasOwn(PRESETS, wp.preset);
|
|
22877
|
+
const detected = !workspacePreset && unchosenBranchPolicy.has(config) ? repoPreset?.() ?? null : null;
|
|
22878
|
+
const preset = workspacePreset ? wp.preset : detected ?? config.branchPolicy?.preset ?? "gitflow";
|
|
22936
22879
|
const merged = mergePreset(preset, {
|
|
22937
22880
|
allowed: wp.allowed,
|
|
22938
22881
|
protectedNames: wp.protected
|
|
@@ -22941,9 +22884,10 @@ var resolveBranchPolicy = (config, workspace) => {
|
|
|
22941
22884
|
return {
|
|
22942
22885
|
preset,
|
|
22943
22886
|
allowed,
|
|
22944
|
-
protected: new Set(merged.protected.map((p) => p.toLowerCase())),
|
|
22887
|
+
protected: new Set([...merged.protected, ...detected ? PRESETS.gitflow.protected : []].map((p) => p.toLowerCase())),
|
|
22945
22888
|
integration: wp.integration === "merge" ? "merge" : "pr",
|
|
22946
|
-
defaultTargetBranch: preset === "github-flow" ? "main" : preset === "trunk-based" ? "master" : "develop"
|
|
22889
|
+
defaultTargetBranch: preset === "github-flow" ? "main" : preset === "trunk-based" ? "master" : "develop",
|
|
22890
|
+
detected: detected !== null
|
|
22947
22891
|
};
|
|
22948
22892
|
};
|
|
22949
22893
|
var COMMIT_PRESETS = [
|
|
@@ -22955,7 +22899,139 @@ var COMMIT_PRESETS = [
|
|
|
22955
22899
|
"auto"
|
|
22956
22900
|
];
|
|
22957
22901
|
|
|
22958
|
-
// packages/workit-
|
|
22902
|
+
// packages/workit-core/src/core/branch-policy.ts
|
|
22903
|
+
var PREFIXES = {
|
|
22904
|
+
feature: "feature/*",
|
|
22905
|
+
bugfix: "bugfix/*",
|
|
22906
|
+
release: "release/*",
|
|
22907
|
+
hotfix: "hotfix/*"
|
|
22908
|
+
};
|
|
22909
|
+
var branchNames = (workspaceRoot) => {
|
|
22910
|
+
const r = spawnSync7("git", ["for-each-ref", "--format=%(refname)", "refs/heads", "refs/remotes/origin"], { cwd: workspaceRoot, encoding: "utf8" });
|
|
22911
|
+
if (r.status !== 0)
|
|
22912
|
+
return new Set;
|
|
22913
|
+
return new Set((r.stdout ?? "").split(`
|
|
22914
|
+
`).filter(Boolean).map((ref) => ref.startsWith("refs/heads/") ? ref.slice("refs/heads/".length) : ref.slice("refs/remotes/origin/".length)));
|
|
22915
|
+
};
|
|
22916
|
+
var detectBranchPolicy = (workspaceRoot) => {
|
|
22917
|
+
const names = branchNames(workspaceRoot);
|
|
22918
|
+
const develop = names.has("develop");
|
|
22919
|
+
const main = names.has("main");
|
|
22920
|
+
const master = names.has("master");
|
|
22921
|
+
const root = main ? "main" : master ? "master" : null;
|
|
22922
|
+
if (develop) {
|
|
22923
|
+
return {
|
|
22924
|
+
preset: "gitflow",
|
|
22925
|
+
developBranch: "develop",
|
|
22926
|
+
integration: "merge",
|
|
22927
|
+
protected: root ? [root, "develop"] : ["develop"],
|
|
22928
|
+
allowed: [...PRESETS.gitflow.allowed],
|
|
22929
|
+
prefixes: PREFIXES
|
|
22930
|
+
};
|
|
22931
|
+
}
|
|
22932
|
+
if (root === "main") {
|
|
22933
|
+
return {
|
|
22934
|
+
preset: "github-flow",
|
|
22935
|
+
developBranch: null,
|
|
22936
|
+
integration: "pr",
|
|
22937
|
+
protected: [root],
|
|
22938
|
+
allowed: ["*"],
|
|
22939
|
+
prefixes: PREFIXES
|
|
22940
|
+
};
|
|
22941
|
+
}
|
|
22942
|
+
if (root === "master") {
|
|
22943
|
+
return {
|
|
22944
|
+
preset: "trunk-based",
|
|
22945
|
+
developBranch: null,
|
|
22946
|
+
integration: "pr",
|
|
22947
|
+
protected: [root],
|
|
22948
|
+
allowed: ["*"],
|
|
22949
|
+
prefixes: PREFIXES
|
|
22950
|
+
};
|
|
22951
|
+
}
|
|
22952
|
+
return {
|
|
22953
|
+
preset: "gitflow",
|
|
22954
|
+
developBranch: null,
|
|
22955
|
+
integration: "merge",
|
|
22956
|
+
protected: [],
|
|
22957
|
+
allowed: [],
|
|
22958
|
+
prefixes: PREFIXES
|
|
22959
|
+
};
|
|
22960
|
+
};
|
|
22961
|
+
var repoBranchPreset = (workspaceRoot) => {
|
|
22962
|
+
const detected = detectBranchPolicy(workspaceRoot);
|
|
22963
|
+
return detected.developBranch || detected.allowed.length ? detected.preset : null;
|
|
22964
|
+
};
|
|
22965
|
+
|
|
22966
|
+
// packages/workit-core/src/core/git.ts
|
|
22967
|
+
import { execFileSync } from "node:child_process";
|
|
22968
|
+
var run = (cwd, args) => {
|
|
22969
|
+
try {
|
|
22970
|
+
const stdout = execFileSync("git", args, {
|
|
22971
|
+
cwd,
|
|
22972
|
+
encoding: "utf8",
|
|
22973
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
22974
|
+
});
|
|
22975
|
+
return { stdout: stdout.trimEnd(), stderr: "", exitCode: 0 };
|
|
22976
|
+
} catch (error) {
|
|
22977
|
+
const e = error;
|
|
22978
|
+
return {
|
|
22979
|
+
stdout: (e.stdout ?? "").trimEnd(),
|
|
22980
|
+
stderr: (e.stderr ?? "").trimEnd(),
|
|
22981
|
+
exitCode: e.status ?? 1
|
|
22982
|
+
};
|
|
22983
|
+
}
|
|
22984
|
+
};
|
|
22985
|
+
var gitContext = (workspaceRoot, paths = []) => {
|
|
22986
|
+
const cwd = workspaceRoot;
|
|
22987
|
+
let failure;
|
|
22988
|
+
const runHere = (args) => {
|
|
22989
|
+
const result = run(cwd, args);
|
|
22990
|
+
if (!failure && result.exitCode !== 0) {
|
|
22991
|
+
failure = { stderr: result.stderr, exitCode: result.exitCode };
|
|
22992
|
+
}
|
|
22993
|
+
return result.stdout;
|
|
22994
|
+
};
|
|
22995
|
+
const branch = runHere(["rev-parse", "--abbrev-ref", "HEAD"]) || "unknown";
|
|
22996
|
+
const status_short = runHere(["status", "--porcelain"]);
|
|
22997
|
+
const staged = [];
|
|
22998
|
+
const unstaged = [];
|
|
22999
|
+
const untracked = [];
|
|
23000
|
+
for (const line of status_short.split(`
|
|
23001
|
+
`).filter(Boolean)) {
|
|
23002
|
+
const code = line.slice(0, 2);
|
|
23003
|
+
const file = line.slice(3);
|
|
23004
|
+
if (code === "??") {
|
|
23005
|
+
untracked.push(file);
|
|
23006
|
+
} else {
|
|
23007
|
+
if (code[0] !== " " && code[0] !== "?")
|
|
23008
|
+
staged.push(file);
|
|
23009
|
+
if (code[1] !== " " && code[1] !== "?")
|
|
23010
|
+
unstaged.push(file);
|
|
23011
|
+
}
|
|
23012
|
+
}
|
|
23013
|
+
const pathArgs = paths.length ? ["--", ...paths] : [];
|
|
23014
|
+
const diff_stat = runHere(["diff", "--stat", ...pathArgs]);
|
|
23015
|
+
const cached_stat = runHere(["diff", "--cached", "--stat", ...pathArgs]);
|
|
23016
|
+
const stagedSet = new Set(staged);
|
|
23017
|
+
const unstagedSet = new Set(unstaged);
|
|
23018
|
+
const partial_staged = [...stagedSet].filter((f) => unstagedSet.has(f));
|
|
23019
|
+
return {
|
|
23020
|
+
workspace_root: cwd,
|
|
23021
|
+
branch,
|
|
23022
|
+
status_short,
|
|
23023
|
+
staged,
|
|
23024
|
+
unstaged,
|
|
23025
|
+
untracked,
|
|
23026
|
+
diff_stat: [diff_stat, cached_stat].filter(Boolean).join(`
|
|
23027
|
+
`),
|
|
23028
|
+
partial_staged: partial_staged.length > 0,
|
|
23029
|
+
partial_staged_files: partial_staged,
|
|
23030
|
+
...failure ? { stderr: failure.stderr, exitCode: failure.exitCode } : {}
|
|
23031
|
+
};
|
|
23032
|
+
};
|
|
23033
|
+
|
|
23034
|
+
// packages/workit-core/src/core/workspaces.ts
|
|
22959
23035
|
import { createHash as createHash8 } from "node:crypto";
|
|
22960
23036
|
import { readFileSync as readFileSync4, realpathSync as realpathSync3 } from "node:fs";
|
|
22961
23037
|
import path13 from "node:path";
|
|
@@ -23360,18 +23436,18 @@ function workspaceDefaultTarget(cwd, globalDefault) {
|
|
|
23360
23436
|
const wp = ws?.branchPolicy ?? {};
|
|
23361
23437
|
const hasWorkspacePolicy = typeof wp.preset === "string" && Object.hasOwn(PRESETS, wp.preset);
|
|
23362
23438
|
const selected = resolveRuntimeWorkspacePolicy(cwd, "branch", process.env.WORKFLOW_PROFILE?.trim() || undefined);
|
|
23363
|
-
const policyDefault = resolveBranchPolicy(readConfig(), selected.policy ? { branchPolicy: selected.policy } : null).defaultTargetBranch;
|
|
23439
|
+
const policyDefault = resolveBranchPolicy(readConfig(), selected.policy ? { branchPolicy: selected.policy } : null, () => repoBranchPreset(cwd)).defaultTargetBranch;
|
|
23364
23440
|
return String(ws?.vcs?.defaultTargetBranch ?? (hasWorkspacePolicy ? policyDefault : globalDefault ?? policyDefault) ?? "develop");
|
|
23365
23441
|
}
|
|
23366
23442
|
|
|
23367
|
-
// packages/workit-
|
|
23443
|
+
// packages/workit-core/src/core/vcs-config.ts
|
|
23368
23444
|
import fs12 from "node:fs";
|
|
23369
23445
|
import path14 from "node:path";
|
|
23370
|
-
import { spawnSync as
|
|
23446
|
+
import { spawnSync as spawnSync9 } from "node:child_process";
|
|
23371
23447
|
|
|
23372
|
-
// packages/workit-
|
|
23448
|
+
// packages/workit-core/src/core/release-tracks.ts
|
|
23373
23449
|
import { createHash as createHash9 } from "node:crypto";
|
|
23374
|
-
import { spawnSync as
|
|
23450
|
+
import { spawnSync as spawnSync8 } from "node:child_process";
|
|
23375
23451
|
var KNOWN_FIELDS = new Set([
|
|
23376
23452
|
"strategy",
|
|
23377
23453
|
"productionBranch",
|
|
@@ -23643,7 +23719,7 @@ function resolveReleaseTrack(input) {
|
|
|
23643
23719
|
return fallback(`${branch} has the same or unrelated fork points with ${[...new Set(newest.map((fork) => `${fork.ref} (${fork.track.name === IMPLICIT ? "workspace default" : fork.track.name})`))].join(" and ")}`);
|
|
23644
23720
|
}
|
|
23645
23721
|
var git4 = (cwd, args) => {
|
|
23646
|
-
const run =
|
|
23722
|
+
const run = spawnSync8("git", args, {
|
|
23647
23723
|
cwd,
|
|
23648
23724
|
encoding: "utf8",
|
|
23649
23725
|
timeout: 20000,
|
|
@@ -23754,11 +23830,11 @@ function resolveTrackFor(cwd, options) {
|
|
|
23754
23830
|
return resolution;
|
|
23755
23831
|
}
|
|
23756
23832
|
|
|
23757
|
-
// packages/workit-
|
|
23833
|
+
// packages/workit-core/src/core/vcs-config.ts
|
|
23758
23834
|
var workspacesPath = () => path14.join(configDir(), "workspaces.json");
|
|
23759
23835
|
var vcsCwd = (cwd) => cwd ?? process.env.WORKFLOW_WORKSPACE_ROOT ?? process.cwd();
|
|
23760
23836
|
var remoteProvider = (cwd) => {
|
|
23761
|
-
const r =
|
|
23837
|
+
const r = spawnSync9("git", ["remote", "get-url", "origin"], { cwd, encoding: "utf8" });
|
|
23762
23838
|
if (r.status !== 0)
|
|
23763
23839
|
return null;
|
|
23764
23840
|
const url = (r.stdout ?? "").trim();
|
|
@@ -23795,7 +23871,7 @@ var remoteEndpoint = (remote) => {
|
|
|
23795
23871
|
var configuredSshEndpoint = (host) => {
|
|
23796
23872
|
if (host.startsWith("-"))
|
|
23797
23873
|
return null;
|
|
23798
|
-
const resolved =
|
|
23874
|
+
const resolved = spawnSync9("ssh", ["-G", host], {
|
|
23799
23875
|
encoding: "utf8",
|
|
23800
23876
|
timeout: 5000,
|
|
23801
23877
|
maxBuffer: 1024 * 1024,
|
|
@@ -23968,7 +24044,7 @@ function mergedPrStyle(limit = 6, cwd) {
|
|
|
23968
24044
|
`).filter((l) => l.startsWith("## ")).map((l) => l.trim()),
|
|
23969
24045
|
descriptionPreview: desc.slice(0, 600)
|
|
23970
24046
|
});
|
|
23971
|
-
const remoteResult =
|
|
24047
|
+
const remoteResult = spawnSync9("git", ["remote", "get-url", "--push", "--all", "origin"], {
|
|
23972
24048
|
cwd,
|
|
23973
24049
|
encoding: "utf8"
|
|
23974
24050
|
});
|
|
@@ -23984,7 +24060,7 @@ function mergedPrStyle(limit = 6, cwd) {
|
|
|
23984
24060
|
if (!hostingApiHostMatches(remote, host))
|
|
23985
24061
|
return { ok: false, error: "PR style target does not match the provider host" };
|
|
23986
24062
|
if (provider === "gitlab") {
|
|
23987
|
-
const run = (args) =>
|
|
24063
|
+
const run = (args) => spawnSync9("glab", ["api", ...args], {
|
|
23988
24064
|
cwd,
|
|
23989
24065
|
encoding: "utf8",
|
|
23990
24066
|
env
|
|
@@ -24004,7 +24080,7 @@ function mergedPrStyle(limit = 6, cwd) {
|
|
|
24004
24080
|
});
|
|
24005
24081
|
}
|
|
24006
24082
|
} else if (provider === "github") {
|
|
24007
|
-
const r =
|
|
24083
|
+
const r = spawnSync9("gh", [
|
|
24008
24084
|
"pr",
|
|
24009
24085
|
"list",
|
|
24010
24086
|
"--repo",
|
|
@@ -24035,10 +24111,10 @@ function mergedPrStyle(limit = 6, cwd) {
|
|
|
24035
24111
|
examples
|
|
24036
24112
|
};
|
|
24037
24113
|
}
|
|
24038
|
-
// packages/workit-
|
|
24114
|
+
// packages/workit-core/src/core/task-engine.ts
|
|
24039
24115
|
import { realpathSync as realpathSync4 } from "node:fs";
|
|
24040
24116
|
|
|
24041
|
-
// packages/workit-
|
|
24117
|
+
// packages/workit-core/src/core/policy-resolver.ts
|
|
24042
24118
|
function resolvePolicy(input) {
|
|
24043
24119
|
const ids = input.constraints.map((constraint) => constraint.id);
|
|
24044
24120
|
if (new Set(ids).size !== ids.length)
|
|
@@ -24094,7 +24170,7 @@ function diffPolicy(previous, next, reason, now) {
|
|
|
24094
24170
|
return parsed.data;
|
|
24095
24171
|
}
|
|
24096
24172
|
|
|
24097
|
-
// packages/workit-
|
|
24173
|
+
// packages/workit-core/src/core/policy/judgment.ts
|
|
24098
24174
|
var isObject6 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24099
24175
|
var squash = (key) => key.toLowerCase().replace(/[_-]/g, "");
|
|
24100
24176
|
var ALIASES = {
|
|
@@ -24218,7 +24294,7 @@ function normalizeJudgment(raw, previous) {
|
|
|
24218
24294
|
return success(null, null, { judgment: parsed.data, ignored, legacy });
|
|
24219
24295
|
}
|
|
24220
24296
|
|
|
24221
|
-
// packages/workit-
|
|
24297
|
+
// packages/workit-core/src/autonomy.ts
|
|
24222
24298
|
import os3 from "node:os";
|
|
24223
24299
|
import path15 from "node:path";
|
|
24224
24300
|
var accountHome = () => {
|
|
@@ -24355,7 +24431,7 @@ function resolveAutonomy(cwd) {
|
|
|
24355
24431
|
var suggested = (kind) => kind === "merge" ? "verified" : "true";
|
|
24356
24432
|
var grantHint = (workspace, kind) => `ask the user to run, in their own terminal: workit grant set ${workspace ?? "<workspace>"} ${kind}=${suggested(kind)}`;
|
|
24357
24433
|
|
|
24358
|
-
// packages/workit-
|
|
24434
|
+
// packages/workit-core/src/core/task-engine.ts
|
|
24359
24435
|
var workspaceVerification = (root) => {
|
|
24360
24436
|
try {
|
|
24361
24437
|
return resolveAutonomy(root).verification;
|
|
@@ -25940,8 +26016,8 @@ class WorkitCore {
|
|
|
25940
26016
|
return this.summary(changed.data.task);
|
|
25941
26017
|
}
|
|
25942
26018
|
}
|
|
25943
|
-
// packages/workit-
|
|
25944
|
-
import { spawnSync as
|
|
26019
|
+
// packages/workit-core/src/core/repo-context.ts
|
|
26020
|
+
import { spawnSync as spawnSync10 } from "node:child_process";
|
|
25945
26021
|
import { existsSync as existsSync6, readFileSync as readFileSync5, readdirSync as readdirSync4 } from "node:fs";
|
|
25946
26022
|
import path16 from "node:path";
|
|
25947
26023
|
var isSafeContextRange = (value) => value.length <= 4096 && (() => {
|
|
@@ -25970,7 +26046,7 @@ var invalidRange = (cwd) => ({
|
|
|
25970
26046
|
cwd
|
|
25971
26047
|
});
|
|
25972
26048
|
var runGit = (cwd, args) => {
|
|
25973
|
-
const result =
|
|
26049
|
+
const result = spawnSync10("git", args, { cwd, encoding: "utf8" });
|
|
25974
26050
|
return {
|
|
25975
26051
|
stdout: (result.stdout ?? "").trimEnd(),
|
|
25976
26052
|
stderr: (result.stderr ?? "").trimEnd(),
|
|
@@ -26410,20 +26486,20 @@ function releaseNotesContext(root, rangeOrTag) {
|
|
|
26410
26486
|
return { stdout, stderr: "", exitCode: 0, cwd };
|
|
26411
26487
|
}
|
|
26412
26488
|
|
|
26413
|
-
// packages/workit-
|
|
26414
|
-
import { spawnSync as
|
|
26489
|
+
// packages/workit-core/src/core/tracker-issues.ts
|
|
26490
|
+
import { spawnSync as spawnSync12 } from "node:child_process";
|
|
26415
26491
|
|
|
26416
|
-
// packages/workit-
|
|
26492
|
+
// packages/workit-core/src/core/pr-create.ts
|
|
26417
26493
|
import fs13 from "node:fs";
|
|
26418
26494
|
import path17 from "node:path";
|
|
26419
|
-
import { spawnSync as
|
|
26420
|
-
// packages/workit-
|
|
26495
|
+
import { spawnSync as spawnSync11 } from "node:child_process";
|
|
26496
|
+
// packages/workit-core/src/forge/pr-body.ts
|
|
26421
26497
|
function parseGhIssue(value) {
|
|
26422
26498
|
const m = /issues\/(\d+)/.exec(value);
|
|
26423
26499
|
return m ? m[1] : String(value).trim().replace(/^#/, "");
|
|
26424
26500
|
}
|
|
26425
26501
|
|
|
26426
|
-
// packages/workit-
|
|
26502
|
+
// packages/workit-core/src/core/pr-create.ts
|
|
26427
26503
|
function whichOnPath(tool) {
|
|
26428
26504
|
const names = process.platform === "win32" ? [tool, `${tool}.exe`, `${tool}.cmd`] : [tool];
|
|
26429
26505
|
for (const dir of (process.env.PATH ?? "").split(path17.delimiter)) {
|
|
@@ -26441,7 +26517,7 @@ function whichOnPath(tool) {
|
|
|
26441
26517
|
}
|
|
26442
26518
|
var hostingCliAvailable = (provider) => whichOnPath(provider === "gitlab" ? "glab" : "gh") !== null;
|
|
26443
26519
|
var pushRemote = (cwd) => {
|
|
26444
|
-
const result =
|
|
26520
|
+
const result = spawnSync11("git", ["remote", "get-url", "--push", "--all", "origin"], {
|
|
26445
26521
|
cwd,
|
|
26446
26522
|
encoding: "utf8"
|
|
26447
26523
|
});
|
|
@@ -26451,7 +26527,7 @@ var pushRemote = (cwd) => {
|
|
|
26451
26527
|
return urls.length === 1 ? urls[0] : null;
|
|
26452
26528
|
};
|
|
26453
26529
|
|
|
26454
|
-
// packages/workit-
|
|
26530
|
+
// packages/workit-core/src/core/tracker-issues.ts
|
|
26455
26531
|
var repoPathFromRemote = (remote) => {
|
|
26456
26532
|
let rest = (remote || "").trim().replace(/\/+$/, "");
|
|
26457
26533
|
if (!rest)
|
|
@@ -26472,7 +26548,7 @@ var defaultCli = (bin, available) => {
|
|
|
26472
26548
|
if (!available)
|
|
26473
26549
|
return null;
|
|
26474
26550
|
return (args, root) => {
|
|
26475
|
-
const out =
|
|
26551
|
+
const out = spawnSync12(bin, args, {
|
|
26476
26552
|
cwd: root,
|
|
26477
26553
|
encoding: "utf8",
|
|
26478
26554
|
env: { ...process.env, PATH: process.env.PATH ?? "" }
|
|
@@ -26549,19 +26625,19 @@ var fetchGitLabIssueBody = async (ref, root, deps = {}) => {
|
|
|
26549
26625
|
return tryCliTriple(deps.cli ?? defaultCli("glab", hostingCliAvailable("gitlab")), "glab", ["issue", "view", id, "-R", repoArg, "-F", "json"], root, id, ["iid"], ["description"]);
|
|
26550
26626
|
};
|
|
26551
26627
|
|
|
26552
|
-
// packages/workit-
|
|
26628
|
+
// packages/workit-core/src/core/youtrack.ts
|
|
26553
26629
|
import fs14 from "node:fs";
|
|
26554
26630
|
import path18 from "node:path";
|
|
26555
26631
|
|
|
26556
|
-
// packages/workit-
|
|
26632
|
+
// packages/workit-core/src/core/templates.ts
|
|
26557
26633
|
var repoRoot2 = assetRoot();
|
|
26558
26634
|
|
|
26559
|
-
// packages/workit-
|
|
26635
|
+
// packages/workit-core/src/core/scripts.ts
|
|
26560
26636
|
var PLUGIN_ROOT = packageRoot();
|
|
26561
26637
|
var ASSET_ROOT = assetRoot();
|
|
26562
26638
|
var resolveWorkspaceRoot = (explicit) => explicit || process.cwd();
|
|
26563
26639
|
|
|
26564
|
-
// packages/workit-
|
|
26640
|
+
// packages/workit-core/src/core/youtrack.ts
|
|
26565
26641
|
var ISSUE_RE = /^[A-Z]+-\d+$/;
|
|
26566
26642
|
var TOKEN_PLACEHOLDER = "YOUR_TOKEN_HERE";
|
|
26567
26643
|
var youTrackConfigPath = () => process.env.WORKFLOW_YOUTRACK_CONFIG ?? path18.join(configDir(), "youtrack.json");
|
|
@@ -26852,7 +26928,7 @@ var fetchYouTrackIssueBody = async (issue, creds = youTrackToken, request = youT
|
|
|
26852
26928
|
}
|
|
26853
26929
|
};
|
|
26854
26930
|
|
|
26855
|
-
// packages/workit-
|
|
26931
|
+
// packages/workit-core/src/core/context-read.ts
|
|
26856
26932
|
var contextReadSchema = object2({
|
|
26857
26933
|
kind: _enum([
|
|
26858
26934
|
"git",
|
|
@@ -26947,7 +27023,7 @@ var readExternalContext = async (root, payload) => {
|
|
|
26947
27023
|
}
|
|
26948
27024
|
}
|
|
26949
27025
|
};
|
|
26950
|
-
// packages/workit-
|
|
27026
|
+
// packages/workit-core/src/core.ts
|
|
26951
27027
|
var revision2 = /^[A-Za-z0-9@][A-Za-z0-9@._/~^{}-]*$/;
|
|
26952
27028
|
function gitRevisionParts(value) {
|
|
26953
27029
|
if (!value || value.startsWith("-") || /[\s\\'"`$;|&<>]/.test(value)) {
|
|
@@ -26990,7 +27066,7 @@ function resolveInside(root, candidate) {
|
|
|
26990
27066
|
}
|
|
26991
27067
|
function run2(root, executable, args, env = {}) {
|
|
26992
27068
|
const cwd = realpathSync5(root);
|
|
26993
|
-
const result =
|
|
27069
|
+
const result = spawnSync13(executable, args, {
|
|
26994
27070
|
cwd,
|
|
26995
27071
|
encoding: "utf8",
|
|
26996
27072
|
env: { ...process.env, ...env }
|
|
@@ -27003,7 +27079,7 @@ function run2(root, executable, args, env = {}) {
|
|
|
27003
27079
|
};
|
|
27004
27080
|
}
|
|
27005
27081
|
|
|
27006
|
-
// packages/workit-
|
|
27082
|
+
// packages/workit-core/src/core/logger.ts
|
|
27007
27083
|
import os4 from "node:os";
|
|
27008
27084
|
var REDACTED = "[REDACTED]";
|
|
27009
27085
|
var SECRET_VALUE = /\b(?:Bearer|Basic|Digest|Token)\s+\S+/gi;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-mcp",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.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.1.0",
|
|
46
46
|
"@modelcontextprotocol/sdk": "1.32.0",
|
|
47
47
|
"zod": "4.6.5"
|
|
48
48
|
},
|