@brainervirus/workit-cli 7.5.0 → 7.5.2
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 +41 -34
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -65,7 +65,7 @@ var package_default;
|
|
|
65
65
|
var init_package = __esm(() => {
|
|
66
66
|
package_default = {
|
|
67
67
|
name: "@brainervirus/workit-cli",
|
|
68
|
-
version: "7.5.
|
|
68
|
+
version: "7.5.2",
|
|
69
69
|
private: false,
|
|
70
70
|
description: "Workit CLI — setup wizard, doctor, and task control for agentic coding workflows",
|
|
71
71
|
keywords: [
|
|
@@ -103,9 +103,9 @@ var init_package = __esm(() => {
|
|
|
103
103
|
},
|
|
104
104
|
dependencies: {
|
|
105
105
|
"@babel/parser": "7.29.9",
|
|
106
|
-
"@brainervirus/workit-core": "^7.5.
|
|
107
|
-
"@brainervirus/workit-cursor": "^7.5.
|
|
108
|
-
"@brainervirus/workit-opencode": "^7.5.
|
|
106
|
+
"@brainervirus/workit-core": "^7.5.2",
|
|
107
|
+
"@brainervirus/workit-cursor": "^7.5.2",
|
|
108
|
+
"@brainervirus/workit-opencode": "^7.5.2",
|
|
109
109
|
"@inkjs/ui": "2.0.0",
|
|
110
110
|
ink: "7.1.1",
|
|
111
111
|
react: "19.2.8"
|
|
@@ -13458,7 +13458,7 @@ function recordVerdict(context, input) {
|
|
|
13458
13458
|
});
|
|
13459
13459
|
const authoring = [session, input.derivedFrom].find((candidate) => typeof candidate === "string" && authors.has(candidate));
|
|
13460
13460
|
if (!self2 && authoring)
|
|
13461
|
-
return err("blocked", `author_verdict: session ${authoring} authored ${branch}; a verdict must come from a different session`, input.derivedFrom === undefined ?
|
|
13461
|
+
return err("blocked", `author_verdict: session ${authoring} authored ${branch}; a verdict must come from a different session`, input.derivedFrom === undefined ? "have a non-author session record the verdict: spawn a verifier with its own WORKIT_SESSION_ID=<lead>-v<n> (Claude Code: subagents get one from the SubagentStart hook); or, as the author, pass --self (self-reviewed, never accepted)" : "run the verifier as a separate session: the lead spawns it with its own WORKIT_SESSION_ID (Claude Code: subagents get one from the SubagentStart hook)");
|
|
13462
13462
|
const link = checkSupersede(context, "verdict", self2);
|
|
13463
13463
|
if (!link.ok)
|
|
13464
13464
|
return link;
|
|
@@ -63107,7 +63107,7 @@ var init_host_install = __esm(() => {
|
|
|
63107
63107
|
});
|
|
63108
63108
|
|
|
63109
63109
|
// packages/workit-core/src/core/skill-manifests.ts
|
|
63110
|
-
import { existsSync as existsSync12, readFileSync as readFileSync12, readdirSync as readdirSync5, statSync as statSync3 } from "node:fs";
|
|
63110
|
+
import { cpSync as cpSync3, existsSync as existsSync12, readFileSync as readFileSync12, readdirSync as readdirSync5, statSync as statSync3, writeFileSync as writeFileSync5 } from "node:fs";
|
|
63111
63111
|
import path28 from "node:path";
|
|
63112
63112
|
var WORKIT_METHOD_SKILLS, skillManifestNames = (root) => existsSync12(root) ? readdirSync5(root).filter((name) => existsSync12(path28.join(root, name, "SKILL.md"))).toSorted() : [], validateSkillManifests = (root, expected, label) => {
|
|
63113
63113
|
const actual = skillManifestNames(root);
|
|
@@ -63162,7 +63162,7 @@ import {
|
|
|
63162
63162
|
rmSync as rmSync2,
|
|
63163
63163
|
statSync as statSync4,
|
|
63164
63164
|
unlinkSync as unlinkSync2,
|
|
63165
|
-
writeFileSync as
|
|
63165
|
+
writeFileSync as writeFileSync6
|
|
63166
63166
|
} from "node:fs";
|
|
63167
63167
|
import os7 from "node:os";
|
|
63168
63168
|
import path29 from "node:path";
|
|
@@ -64233,7 +64233,7 @@ var TOKEN_PLACEHOLDER2 = "YOUR_TOKEN_HERE", findDevFromCwd = (cwd) => {
|
|
|
64233
64233
|
const probe = path29.join(logsDir, "doctor-probe.tmp");
|
|
64234
64234
|
try {
|
|
64235
64235
|
mkdirSync4(logsDir, { recursive: true, mode: 448 });
|
|
64236
|
-
|
|
64236
|
+
writeFileSync6(probe, `{"probe":true}
|
|
64237
64237
|
`, { mode: 384 });
|
|
64238
64238
|
return {
|
|
64239
64239
|
id: "log_writable",
|
|
@@ -64398,7 +64398,7 @@ var init_doctor = __esm(() => {
|
|
|
64398
64398
|
// packages/workit-cli/src/admin/setup.ts
|
|
64399
64399
|
import {
|
|
64400
64400
|
copyFileSync as copyFileSync4,
|
|
64401
|
-
cpSync as
|
|
64401
|
+
cpSync as cpSync4,
|
|
64402
64402
|
existsSync as existsSync14,
|
|
64403
64403
|
lstatSync as lstatSync5,
|
|
64404
64404
|
mkdirSync as mkdirSync5,
|
|
@@ -64409,7 +64409,7 @@ import {
|
|
|
64409
64409
|
renameSync as renameSync3,
|
|
64410
64410
|
rmSync as rmSync3,
|
|
64411
64411
|
statSync as statSync5,
|
|
64412
|
-
writeFileSync as
|
|
64412
|
+
writeFileSync as writeFileSync7
|
|
64413
64413
|
} from "node:fs";
|
|
64414
64414
|
import os8 from "node:os";
|
|
64415
64415
|
import path30 from "node:path";
|
|
@@ -64635,7 +64635,7 @@ function applyMutation(m) {
|
|
|
64635
64635
|
return { platform: "core", file: m.path, status: "Skipped", detail: "already configured" };
|
|
64636
64636
|
}
|
|
64637
64637
|
mkdirSync5(dir, { recursive: true });
|
|
64638
|
-
|
|
64638
|
+
writeFileSync7(m.path, JSON.stringify(merged, null, 2) + `
|
|
64639
64639
|
`, "utf8");
|
|
64640
64640
|
return existing.kind === "record" ? { platform: "core", file: m.path, status: "Configured" } : { platform: "core", file: m.path, status: "Installed" };
|
|
64641
64641
|
}
|
|
@@ -64679,7 +64679,7 @@ function applyMutation(m) {
|
|
|
64679
64679
|
mkdirSync5(dir, { recursive: true });
|
|
64680
64680
|
const tmp = `${m.path}.${process.pid}.tmp`;
|
|
64681
64681
|
try {
|
|
64682
|
-
|
|
64682
|
+
writeFileSync7(tmp, next, "utf8");
|
|
64683
64683
|
if (workspacesRevision(readFileSafe(m.path)) !== m.expectedRevision) {
|
|
64684
64684
|
rmSync3(tmp, { force: true });
|
|
64685
64685
|
return {
|
|
@@ -64718,7 +64718,7 @@ function applyMutation(m) {
|
|
|
64718
64718
|
const separator = existing && !existing.endsWith(`
|
|
64719
64719
|
`) ? `
|
|
64720
64720
|
` : "";
|
|
64721
|
-
|
|
64721
|
+
writeFileSync7(m.path, existing + separator + (existing ? `
|
|
64722
64722
|
` : "") + add.join(`
|
|
64723
64723
|
`) + `
|
|
64724
64724
|
`, "utf8");
|
|
@@ -64758,7 +64758,7 @@ function applyMutation(m) {
|
|
|
64758
64758
|
};
|
|
64759
64759
|
}
|
|
64760
64760
|
mkdirSync5(path30.dirname(m.path), { recursive: true });
|
|
64761
|
-
|
|
64761
|
+
writeFileSync7(m.path, JSON.stringify(merged, null, 2) + `
|
|
64762
64762
|
`, "utf8");
|
|
64763
64763
|
return existing.kind === "record" ? { platform: "core", file: m.path, status: "Configured" } : { platform: "core", file: m.path, status: "Installed" };
|
|
64764
64764
|
}
|
|
@@ -64830,7 +64830,7 @@ function applyOpenCode(root, res) {
|
|
|
64830
64830
|
detail: "already registered"
|
|
64831
64831
|
};
|
|
64832
64832
|
}
|
|
64833
|
-
|
|
64833
|
+
writeFileSync7(res.opencodeConfig, JSON.stringify(merged.config, null, 2) + `
|
|
64834
64834
|
`, "utf8");
|
|
64835
64835
|
return existing.kind === "record" ? {
|
|
64836
64836
|
platform: "opencode",
|
|
@@ -64859,15 +64859,15 @@ function copyPluginDir(src, dest) {
|
|
|
64859
64859
|
const stage = path30.join(swap, "stage");
|
|
64860
64860
|
const backup = path30.join(swap, "backup");
|
|
64861
64861
|
try {
|
|
64862
|
-
|
|
64862
|
+
cpSync4(realSrc, stage, {
|
|
64863
64863
|
recursive: true,
|
|
64864
64864
|
filter: (entry) => !path30.relative(realSrc, entry).split(path30.sep).includes("node_modules")
|
|
64865
64865
|
});
|
|
64866
64866
|
for (const [name, content] of rules) {
|
|
64867
64867
|
mkdirSync5(path30.join(stage, "rules"), { recursive: true });
|
|
64868
|
-
|
|
64868
|
+
writeFileSync7(path30.join(stage, "rules", name), content);
|
|
64869
64869
|
}
|
|
64870
|
-
|
|
64870
|
+
writeFileSync7(path30.join(stage, ".workit-root"), realSrc + `
|
|
64871
64871
|
`, "utf8");
|
|
64872
64872
|
if (!samePluginContent(realSrc, stage))
|
|
64873
64873
|
throw new Error("staged adapter content is incomplete");
|
|
@@ -64909,7 +64909,7 @@ function applyCursorSettings(root, res) {
|
|
|
64909
64909
|
detail: "already registered"
|
|
64910
64910
|
};
|
|
64911
64911
|
}
|
|
64912
|
-
|
|
64912
|
+
writeFileSync7(res.cursorSettings, JSON.stringify(settings.config, null, 2) + `
|
|
64913
64913
|
`, "utf8");
|
|
64914
64914
|
return {
|
|
64915
64915
|
platform: "cursor",
|
|
@@ -64948,7 +64948,7 @@ function applyCursorMcp(root, res) {
|
|
|
64948
64948
|
detail: "already registered"
|
|
64949
64949
|
};
|
|
64950
64950
|
}
|
|
64951
|
-
|
|
64951
|
+
writeFileSync7(res.cursorMcp, JSON.stringify(mcp.config, null, 2) + `
|
|
64952
64952
|
`, "utf8");
|
|
64953
64953
|
return {
|
|
64954
64954
|
platform: "cursor",
|
|
@@ -65432,7 +65432,7 @@ var init_branch_policy = __esm(() => {
|
|
|
65432
65432
|
});
|
|
65433
65433
|
|
|
65434
65434
|
// packages/workit-core/src/core/workspace-branch-policy.ts
|
|
65435
|
-
import { mkdirSync as mkdirSync6, readFileSync as readFileSync15, renameSync as renameSync4, rmSync as rmSync4, writeFileSync as
|
|
65435
|
+
import { mkdirSync as mkdirSync6, readFileSync as readFileSync15, renameSync as renameSync4, rmSync as rmSync4, writeFileSync as writeFileSync8 } from "node:fs";
|
|
65436
65436
|
import path31 from "node:path";
|
|
65437
65437
|
import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
|
|
65438
65438
|
function applyWorkspaceBranchPolicy(opts) {
|
|
@@ -65501,7 +65501,7 @@ function applyWorkspaceBranchPolicy(opts) {
|
|
|
65501
65501
|
mkdirSync6(path31.dirname(wsPath), { recursive: true });
|
|
65502
65502
|
const tmp = `${wsPath}.${process.pid}.tmp`;
|
|
65503
65503
|
try {
|
|
65504
|
-
|
|
65504
|
+
writeFileSync8(tmp, JSON.stringify({ ...document2, workspaces: next }, null, 2) + `
|
|
65505
65505
|
`, "utf8");
|
|
65506
65506
|
if (workspacesRevision(readFileSafe2(wsPath)) !== revision) {
|
|
65507
65507
|
rmSync4(tmp, { force: true });
|
|
@@ -66370,7 +66370,7 @@ var init_wizard_state = __esm(() => {
|
|
|
66370
66370
|
});
|
|
66371
66371
|
|
|
66372
66372
|
// packages/workit-cli/src/admin/uninstall.ts
|
|
66373
|
-
import { existsSync as existsSync16, readFileSync as readFileSync16, realpathSync as realpathSync8, rmSync as rmSync5, writeFileSync as
|
|
66373
|
+
import { existsSync as existsSync16, readFileSync as readFileSync16, realpathSync as realpathSync8, rmSync as rmSync5, writeFileSync as writeFileSync9 } from "node:fs";
|
|
66374
66374
|
import os9 from "node:os";
|
|
66375
66375
|
import path33 from "node:path";
|
|
66376
66376
|
function cleanCursorSettings(settings, pluginDir) {
|
|
@@ -66654,7 +66654,7 @@ var resolveUninstallPaths = (options = {}) => {
|
|
|
66654
66654
|
return { status: "skipped", detail: "already clean" };
|
|
66655
66655
|
}
|
|
66656
66656
|
try {
|
|
66657
|
-
|
|
66657
|
+
writeFileSync9(target, serialized, "utf8");
|
|
66658
66658
|
} catch (error) {
|
|
66659
66659
|
return {
|
|
66660
66660
|
status: "failed",
|
|
@@ -69389,7 +69389,7 @@ import {
|
|
|
69389
69389
|
mkdirSync as mkdirSync8,
|
|
69390
69390
|
copyFileSync as copyFileSync5,
|
|
69391
69391
|
chmodSync,
|
|
69392
|
-
cpSync as
|
|
69392
|
+
cpSync as cpSync5,
|
|
69393
69393
|
lstatSync as lstatSync6
|
|
69394
69394
|
} from "node:fs";
|
|
69395
69395
|
import path35 from "node:path";
|
|
@@ -69541,7 +69541,7 @@ function applyUpgrade(plan, deps = {}) {
|
|
|
69541
69541
|
const run = runner(deps);
|
|
69542
69542
|
const cursorRoot = path35.join(home, ".cursor/plugins/local/workit");
|
|
69543
69543
|
if (plan.entries.some((entry) => entry.host === "cursor") && existsSync17(cursorRoot))
|
|
69544
|
-
|
|
69544
|
+
cpSync5(cursorRoot, path35.join(backup, "cursor-package"), { recursive: true });
|
|
69545
69545
|
for (const entry of plan.entries) {
|
|
69546
69546
|
if (entry.host === "opencode")
|
|
69547
69547
|
return {
|
|
@@ -69619,7 +69619,7 @@ function applyUpgrade(plan, deps = {}) {
|
|
|
69619
69619
|
if (currentRoot.status !== 0 || currentRoot.stdout.trim() !== plan.cli.root)
|
|
69620
69620
|
return { ok: false, backup, error: "Global npm location changed; preview again" };
|
|
69621
69621
|
const cliBackup = path35.join(backup, "cli-package");
|
|
69622
|
-
|
|
69622
|
+
cpSync5(path35.join(plan.cli.root, "@brainervirus/workit-cli"), cliBackup, { recursive: true });
|
|
69623
69623
|
if (run("npm", ["install", "--global", `@brainervirus/workit-cli@${plan.cli.latest}`]).status !== 0)
|
|
69624
69624
|
return {
|
|
69625
69625
|
ok: false,
|
|
@@ -70173,7 +70173,7 @@ var init_knowledge = __esm(() => {
|
|
|
70173
70173
|
HEADING = /^\s{0,3}#{1,6}(\s|$)/;
|
|
70174
70174
|
TABLE_SEPARATOR = /^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)*\|?\s*$/;
|
|
70175
70175
|
LIST_ITEM = /^\s*(?:[-*+]|\d+[.)])\s+/;
|
|
70176
|
-
PLACEHOLDER2 = /^(?:(?:tbd|todo|tba|fixme)
|
|
70176
|
+
PLACEHOLDER2 = /^(?:(?:tbd|todo|tba|fixme)(?:\s*[:–—-].*)?|n\/a|none|none yet|coming soon|placeholder|\.\.\.|…|-)?[.:]?$/i;
|
|
70177
70177
|
INDENTED_CODE = /^(?: {4}|\t)/;
|
|
70178
70178
|
LINK = /!?\[[^\]]*\]\(\s*(?:<([^>\n]+)>|((?:[^()\s<>]|\([^()\s]*\))+))(?:\s+["'(][^)]*)?\)/g;
|
|
70179
70179
|
REFERENCE_DEFINITION = /^\s{0,3}\[[^\]]+\]:\s*<?(\S+?)>?(?:\s|$)/;
|
|
@@ -77789,7 +77789,7 @@ async function run16(argv, io) {
|
|
|
77789
77789
|
})), (row) => `recorded ruling ${row.id}`);
|
|
77790
77790
|
if (rest.length !== 1)
|
|
77791
77791
|
return usage4(io, `ledger verdict takes one result: ${VERDICT_RESULTS.join("|")}`);
|
|
77792
|
-
|
|
77792
|
+
const verdict = await recorded(recordVerdict(context, {
|
|
77793
77793
|
result: rest[0],
|
|
77794
77794
|
kind: values.kind,
|
|
77795
77795
|
how: values.how,
|
|
@@ -77797,7 +77797,11 @@ async function run16(argv, io) {
|
|
|
77797
77797
|
self: values.self === true,
|
|
77798
77798
|
evidenceRefs: values.evidence,
|
|
77799
77799
|
..."derivedFrom" in acting ? { derivedFrom: acting.derivedFrom } : {}
|
|
77800
|
-
}))
|
|
77800
|
+
}));
|
|
77801
|
+
if (verdict.ok && verdict.value.selfReason === "flag" && !passedTestOn(io.cwd, verdict.value))
|
|
77802
|
+
io.stderr(`warning: no passing \`workit check test\` observed on ${(verdict.value.head ?? "this head").slice(0, 12)}; run it before a --self verdict
|
|
77803
|
+
`);
|
|
77804
|
+
return fromResult(io, verdict, (row) => `recorded verdict ${row.id}: ${row.result} [${row.kind}] for ${row.branch} @ ${(row.head ?? "").slice(0, 12)} as ${actor.session ?? "no session"}${row.self ? ` (self${row.selfReason === "no_session" ? ": WORKIT_SESSION_ID unset" : ""}; never accepted)` : ""}`);
|
|
77801
77805
|
}
|
|
77802
77806
|
var USAGE9 = "workit ledger decision|ruling|verdict|list|check ... (workit help ledger for the grammar)", OPTIONS, SESSION_SAFE2, ROLE_SAFE, actorFor = (io, values) => {
|
|
77803
77807
|
const actor = actorFromEnv(io.env);
|
|
@@ -77823,7 +77827,10 @@ var USAGE9 = "workit ledger decision|ruling|verdict|list|check ... (workit help
|
|
|
77823
77827
|
return;
|
|
77824
77828
|
const parsed = Number(value);
|
|
77825
77829
|
return Number.isInteger(parsed) && parsed > 0 ? parsed : new Error(`${flag} must be a positive integer`);
|
|
77826
|
-
}, failed2 = (io, result) => emit(io, fail(result.code, result.error, result.unblock ? { unblock: result.unblock } : {})), fromResult = (io, result, human) => result.ok ? emit(io, ok(result.value), human) : failed2(io, result), usage4 = (io, error) => emit(io, fail("invalid_input", error, { unblock: USAGE9 })),
|
|
77830
|
+
}, failed2 = (io, result) => emit(io, fail(result.code, result.error, result.unblock ? { unblock: result.unblock } : {})), fromResult = (io, result, human) => result.ok ? emit(io, ok(result.value), human) : failed2(io, result), usage4 = (io, error) => emit(io, fail("invalid_input", error, { unblock: USAGE9 })), passedTestOn = (cwd, verdict) => {
|
|
77831
|
+
const ledger = readLedger(cwd);
|
|
77832
|
+
return ledger.ok && ledger.value.rows.some((row) => row.type === "check" && row.observer === "workit_cli" && row.name === "test" && row.result === "passed" && row.dirty !== true && row.branch === verdict.branch && row.head === verdict.head);
|
|
77833
|
+
}, verdictLines = (check) => {
|
|
77827
77834
|
const lines = [
|
|
77828
77835
|
`${check.branch} @ ${(check.head ?? "no commit").slice(0, 12)}: current: ${check.current.basis}${typeof check.current.verdict?.result === "string" ? ` (${check.current.verdict.result})` : ""}; ${check.accepted.accepted ? "accepted" : `not accepted (${check.accepted.reasons.join(", ")})`}; review: ${check.review}`
|
|
77829
77836
|
];
|
|
@@ -93862,7 +93869,7 @@ import {
|
|
|
93862
93869
|
rmSync as rmSync7,
|
|
93863
93870
|
statSync as statSync8,
|
|
93864
93871
|
symlinkSync,
|
|
93865
|
-
writeFileSync as
|
|
93872
|
+
writeFileSync as writeFileSync10,
|
|
93866
93873
|
copyFileSync as copyFileSync6
|
|
93867
93874
|
} from "node:fs";
|
|
93868
93875
|
import os14 from "node:os";
|
|
@@ -94034,13 +94041,13 @@ function writeInside(copy, file, content) {
|
|
|
94034
94041
|
return false;
|
|
94035
94042
|
}
|
|
94036
94043
|
const temp = `${target}.workit-mutant-${process.pid}`;
|
|
94037
|
-
|
|
94044
|
+
writeFileSync10(temp, content);
|
|
94038
94045
|
renameSync5(temp, target);
|
|
94039
94046
|
return true;
|
|
94040
94047
|
}
|
|
94041
94048
|
function copyWorkingTree(repo) {
|
|
94042
94049
|
const dir = mkdtempSync4(path48.join(os14.tmpdir(), TEMP_PREFIX));
|
|
94043
|
-
|
|
94050
|
+
writeFileSync10(path48.join(dir, PID_FILE), String(process.pid));
|
|
94044
94051
|
const tree = path48.join(dir, "tree");
|
|
94045
94052
|
const head = git6(repo, ["rev-parse", "--verify", "--quiet", "HEAD"]).stdout.trim();
|
|
94046
94053
|
if (head && git6(dir, ["clone", "-q", "--shared", "--no-checkout", repo, tree]).ok) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-cli",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit CLI — setup wizard, doctor, and task control for agentic coding workflows",
|
|
6
6
|
"keywords": [
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@babel/parser": "7.29.9",
|
|
41
|
-
"@brainervirus/workit-core": "^7.5.
|
|
42
|
-
"@brainervirus/workit-cursor": "^7.5.
|
|
43
|
-
"@brainervirus/workit-opencode": "^7.5.
|
|
41
|
+
"@brainervirus/workit-core": "^7.5.2",
|
|
42
|
+
"@brainervirus/workit-cursor": "^7.5.2",
|
|
43
|
+
"@brainervirus/workit-opencode": "^7.5.2",
|
|
44
44
|
"@inkjs/ui": "2.0.0",
|
|
45
45
|
"ink": "7.1.1",
|
|
46
46
|
"react": "19.2.8"
|