@brainervirus/workit-opencode 8.0.0 → 8.0.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/plugin.js +90 -84
- package/package.json +2 -2
package/dist/plugin.js
CHANGED
|
@@ -3,12 +3,12 @@ function define(plugin) {
|
|
|
3
3
|
return plugin;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
// packages/workit-
|
|
6
|
+
// packages/workit-core/src/core.ts
|
|
7
7
|
import { spawnSync as spawnSync12 } from "node:child_process";
|
|
8
8
|
import { existsSync as existsSync7, realpathSync as realpathSync5 } from "node:fs";
|
|
9
9
|
import path19 from "node:path";
|
|
10
10
|
|
|
11
|
-
// packages/workit-
|
|
11
|
+
// packages/workit-core/src/core/task-contract.ts
|
|
12
12
|
import { createHash, randomUUID } from "node:crypto";
|
|
13
13
|
|
|
14
14
|
// node_modules/zod/v4/core/util.js
|
|
@@ -7740,7 +7740,7 @@ function refine(fn, _params = {}) {
|
|
|
7740
7740
|
function superRefine(fn, params) {
|
|
7741
7741
|
return _superRefine(fn, params);
|
|
7742
7742
|
}
|
|
7743
|
-
// packages/workit-
|
|
7743
|
+
// packages/workit-core/src/core/task-contract.ts
|
|
7744
7744
|
var SCHEMA_VERSION = 1;
|
|
7745
7745
|
var POLICY_VERSION = "1.0.0";
|
|
7746
7746
|
var OPERATION_FAMILIES = [
|
|
@@ -8595,7 +8595,7 @@ function requirementId(input) {
|
|
|
8595
8595
|
}
|
|
8596
8596
|
});
|
|
8597
8597
|
}
|
|
8598
|
-
// packages/workit-
|
|
8598
|
+
// packages/workit-core/src/core/operation-input.ts
|
|
8599
8599
|
var str = (d, values) => ({
|
|
8600
8600
|
type: "string",
|
|
8601
8601
|
...values ? { enum: values } : {},
|
|
@@ -8991,7 +8991,7 @@ function parseAdvertisedOperation(family, input, host) {
|
|
|
8991
8991
|
}))
|
|
8992
8992
|
});
|
|
8993
8993
|
}
|
|
8994
|
-
// packages/workit-
|
|
8994
|
+
// packages/workit-core/src/core/task-store.ts
|
|
8995
8995
|
import { createHash as createHash4, randomUUID as randomUUID3 } from "node:crypto";
|
|
8996
8996
|
import * as fs7 from "node:fs";
|
|
8997
8997
|
import path6 from "node:path";
|
|
@@ -9597,7 +9597,7 @@ function acquireFileLockSync(targetPath, options) {
|
|
|
9597
9597
|
}
|
|
9598
9598
|
}
|
|
9599
9599
|
}
|
|
9600
|
-
// packages/workit-
|
|
9600
|
+
// packages/workit-core/src/core/package-root.ts
|
|
9601
9601
|
import { existsSync } from "node:fs";
|
|
9602
9602
|
import path3 from "node:path";
|
|
9603
9603
|
import { fileURLToPath } from "node:url";
|
|
@@ -9616,12 +9616,12 @@ var assetRoot = () => {
|
|
|
9616
9616
|
return existsSync(assets) ? assets : root;
|
|
9617
9617
|
};
|
|
9618
9618
|
|
|
9619
|
-
// packages/workit-
|
|
9619
|
+
// packages/workit-core/src/core/store-lock.ts
|
|
9620
9620
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
9621
9621
|
import fs5 from "node:fs";
|
|
9622
9622
|
import { hostname } from "node:os";
|
|
9623
9623
|
|
|
9624
|
-
// packages/workit-
|
|
9624
|
+
// packages/workit-core/src/store/paths.ts
|
|
9625
9625
|
import { spawnSync } from "node:child_process";
|
|
9626
9626
|
import { createHash as createHash2 } from "node:crypto";
|
|
9627
9627
|
import fs4 from "node:fs";
|
|
@@ -9901,7 +9901,7 @@ var checkoutSlug = (root) => {
|
|
|
9901
9901
|
return `${base}-${shortHash(canonical)}`;
|
|
9902
9902
|
};
|
|
9903
9903
|
|
|
9904
|
-
// packages/workit-
|
|
9904
|
+
// packages/workit-core/src/core/store-lock.ts
|
|
9905
9905
|
var metadataLockSchema = object({
|
|
9906
9906
|
pid: number2().int().nonnegative().safe(),
|
|
9907
9907
|
processStart: string2().nullable(),
|
|
@@ -10032,7 +10032,7 @@ var clearAbandonedReclaimGuard = (lockPath, nowMs = Date.now()) => {
|
|
|
10032
10032
|
}
|
|
10033
10033
|
};
|
|
10034
10034
|
|
|
10035
|
-
// packages/workit-
|
|
10035
|
+
// packages/workit-core/src/store/event-log.ts
|
|
10036
10036
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
10037
10037
|
import fs6 from "node:fs";
|
|
10038
10038
|
import path5 from "node:path";
|
|
@@ -10192,7 +10192,7 @@ var retryTransient = (run) => {
|
|
|
10192
10192
|
};
|
|
10193
10193
|
var renameWithRetry = (from, to) => retryTransient(() => fs6.renameSync(from, to));
|
|
10194
10194
|
|
|
10195
|
-
// packages/workit-
|
|
10195
|
+
// packages/workit-core/src/store/patch.ts
|
|
10196
10196
|
var isPlainObject2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10197
10197
|
var equal = (left, right) => {
|
|
10198
10198
|
if (left === right)
|
|
@@ -10302,7 +10302,7 @@ var isPatch = (value) => Array.isArray(value) && value.every((op) => {
|
|
|
10302
10302
|
return false;
|
|
10303
10303
|
});
|
|
10304
10304
|
|
|
10305
|
-
// packages/workit-
|
|
10305
|
+
// packages/workit-core/src/store/reduce.ts
|
|
10306
10306
|
import { createHash as createHash3 } from "node:crypto";
|
|
10307
10307
|
var OPENING_TYPES = new Set([
|
|
10308
10308
|
"task.opened",
|
|
@@ -10433,7 +10433,7 @@ function eventType(before, after) {
|
|
|
10433
10433
|
return "task.updated";
|
|
10434
10434
|
}
|
|
10435
10435
|
|
|
10436
|
-
// packages/workit-
|
|
10436
|
+
// packages/workit-core/src/store/notes.ts
|
|
10437
10437
|
var SLOT = Symbol.for("workit.migrationReporter");
|
|
10438
10438
|
var reportMigration = (report) => {
|
|
10439
10439
|
try {
|
|
@@ -10444,7 +10444,7 @@ var reportMigration = (report) => {
|
|
|
10444
10444
|
};
|
|
10445
10445
|
var migrationReporterInstalled = () => typeof globalThis[SLOT] === "function";
|
|
10446
10446
|
|
|
10447
|
-
// packages/workit-
|
|
10447
|
+
// packages/workit-core/src/core/task-store.ts
|
|
10448
10448
|
var MIGRATION_PENDING = "workit migration pending";
|
|
10449
10449
|
var STORE_FORMAT = 3;
|
|
10450
10450
|
var STORE_MIN_RUNTIME = "3.0.0";
|
|
@@ -12080,18 +12080,18 @@ class TaskStore {
|
|
|
12080
12080
|
return failure2(recovery ? "recovery_required" : "storage_error", `lock operation failed: ${String(error)}`, { path: lockPath });
|
|
12081
12081
|
}
|
|
12082
12082
|
}
|
|
12083
|
-
// packages/workit-
|
|
12083
|
+
// packages/workit-core/src/core/workers.ts
|
|
12084
12084
|
var UNCERTAIN_WORKER_STATES = ["dispatching", "running", "cancelling", "unknown"];
|
|
12085
12085
|
var isUncertainWorker = (state) => UNCERTAIN_WORKER_STATES.includes(state);
|
|
12086
12086
|
var workerBlocksTransition = (transition, state) => transition === "pause" ? false : isUncertainWorker(state);
|
|
12087
12087
|
|
|
12088
|
-
// packages/workit-
|
|
12088
|
+
// packages/workit-core/src/core/task-evaluation.ts
|
|
12089
12089
|
import { createHash as createHash7 } from "node:crypto";
|
|
12090
12090
|
import * as fs11 from "node:fs";
|
|
12091
12091
|
import { spawnSync as spawnSync6 } from "node:child_process";
|
|
12092
12092
|
import path11 from "node:path";
|
|
12093
12093
|
|
|
12094
|
-
// packages/workit-
|
|
12094
|
+
// packages/workit-core/src/check-config.ts
|
|
12095
12095
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
12096
12096
|
import fs8 from "node:fs";
|
|
12097
12097
|
import path7 from "node:path";
|
|
@@ -12296,7 +12296,7 @@ function checkCommand(args, version, onPath = workitAvailable()) {
|
|
|
12296
12296
|
return onPath ? `workit check ${args}` : `npx -y @brainervirus/workit-cli@${version} check ${args}`;
|
|
12297
12297
|
}
|
|
12298
12298
|
|
|
12299
|
-
// packages/workit-
|
|
12299
|
+
// packages/workit-core/src/git/rev.ts
|
|
12300
12300
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
12301
12301
|
import { createHash as createHash5 } from "node:crypto";
|
|
12302
12302
|
import fs9 from "node:fs";
|
|
@@ -12477,11 +12477,11 @@ function pushRemoteName(cwd, branch) {
|
|
|
12477
12477
|
return remotes.length === 1 ? remotes[0] : null;
|
|
12478
12478
|
}
|
|
12479
12479
|
|
|
12480
|
-
// packages/workit-
|
|
12480
|
+
// packages/workit-core/src/core/policy/derive.ts
|
|
12481
12481
|
import { existsSync as existsSync3 } from "node:fs";
|
|
12482
12482
|
import path10 from "node:path";
|
|
12483
12483
|
|
|
12484
|
-
// packages/workit-
|
|
12484
|
+
// packages/workit-core/src/ledger.ts
|
|
12485
12485
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
12486
12486
|
import { createHash as createHash6, randomBytes as randomBytes2 } from "node:crypto";
|
|
12487
12487
|
import fs10 from "node:fs";
|
|
@@ -12723,7 +12723,7 @@ var independenceReasons = (row, authors) => {
|
|
|
12723
12723
|
reasons.push("self");
|
|
12724
12724
|
return reasons;
|
|
12725
12725
|
};
|
|
12726
|
-
function effectiveOf(rows, authors) {
|
|
12726
|
+
function effectiveOf(rows, authors, sameCode) {
|
|
12727
12727
|
let effective = null;
|
|
12728
12728
|
for (const row of rows) {
|
|
12729
12729
|
if (!effective) {
|
|
@@ -12734,7 +12734,7 @@ function effectiveOf(rows, authors) {
|
|
|
12734
12734
|
const effIndependent = independenceReasons(effective, authors).length === 0;
|
|
12735
12735
|
if (effIndependent && !rowIndependent)
|
|
12736
12736
|
continue;
|
|
12737
|
-
if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session)
|
|
12737
|
+
if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session && sameCode(effective, row))
|
|
12738
12738
|
continue;
|
|
12739
12739
|
effective = row;
|
|
12740
12740
|
}
|
|
@@ -12765,16 +12765,22 @@ function checkVerdicts(cwd, branch, rows) {
|
|
|
12765
12765
|
const head = branchHead(cwd, branch);
|
|
12766
12766
|
const fallbackBase = defaultBase(cwd);
|
|
12767
12767
|
const keyCache = new Map;
|
|
12768
|
-
const
|
|
12769
|
-
if (!base || !
|
|
12768
|
+
const keysAt = (base, at) => {
|
|
12769
|
+
if (!base || !at)
|
|
12770
12770
|
return { patchId: null, diffHash: null };
|
|
12771
|
-
|
|
12771
|
+
const cacheKey = `${base}\x00${at}`;
|
|
12772
|
+
let key = keyCache.get(cacheKey);
|
|
12772
12773
|
if (!key) {
|
|
12773
|
-
key = { patchId: patchId(cwd, base,
|
|
12774
|
-
keyCache.set(
|
|
12774
|
+
key = { patchId: patchId(cwd, base, at), diffHash: diffHash(cwd, base, at) };
|
|
12775
|
+
keyCache.set(cacheKey, key);
|
|
12775
12776
|
}
|
|
12776
12777
|
return key;
|
|
12777
12778
|
};
|
|
12779
|
+
const keyFor = (base) => keysAt(base, head);
|
|
12780
|
+
const sameCode = (failed, row) => verdictBasis(failed, {
|
|
12781
|
+
head: row.head,
|
|
12782
|
+
...keysAt(failed.base ?? fallbackBase, row.head)
|
|
12783
|
+
}) !== "stale" || restackCarries(rows, branch, failed.head, row.head);
|
|
12778
12784
|
const authors = authorSessions(cwd, rows, branch, { base: fallbackBase, head });
|
|
12779
12785
|
const byKind = new Map;
|
|
12780
12786
|
for (const row of rows)
|
|
@@ -12784,7 +12790,7 @@ function checkVerdicts(cwd, branch, rows) {
|
|
|
12784
12790
|
}
|
|
12785
12791
|
const verdicts = [];
|
|
12786
12792
|
for (const [kind, list] of byKind) {
|
|
12787
|
-
const row = effectiveOf(list, authors);
|
|
12793
|
+
const row = effectiveOf(list, authors, sameCode);
|
|
12788
12794
|
if (!row)
|
|
12789
12795
|
continue;
|
|
12790
12796
|
let basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
|
|
@@ -12810,11 +12816,11 @@ function checkVerdicts(cwd, branch, rows) {
|
|
|
12810
12816
|
verdicts.sort((a, b) => a.verdict.seq - b.verdict.seq);
|
|
12811
12817
|
const newestCurrent = verdicts.findLast((entry) => entry.current) ?? verdicts.at(-1) ?? null;
|
|
12812
12818
|
const failing = verdicts.find((entry) => entry.current && entry.independent && FAILING.has(String(entry.verdict.result)));
|
|
12813
|
-
const newestAccepted = verdicts.findLast((entry) => entry.accepted) ?? null;
|
|
12819
|
+
const newestAccepted = verdicts.findLast((entry) => entry.accepted && STRONG_RESULTS.has(String(entry.verdict.result))) ?? null;
|
|
12814
12820
|
const accepted = newestAccepted && !failing ? { accepted: true, verdict: newestAccepted.verdict, reasons: [] } : {
|
|
12815
12821
|
accepted: false,
|
|
12816
12822
|
verdict: failing?.verdict ?? null,
|
|
12817
|
-
reasons: failing ? ["failing_verdict"] : newestCurrent
|
|
12823
|
+
reasons: failing ? ["failing_verdict"] : !newestCurrent ? ["no_verdict"] : newestCurrent.reasons.length ? newestCurrent.reasons : ["type_check_only"]
|
|
12818
12824
|
};
|
|
12819
12825
|
const selfEntry = failing ? undefined : verdicts.findLast((entry) => entry.current && !entry.independent && STRONG_RESULTS.has(String(entry.verdict.result)));
|
|
12820
12826
|
return {
|
|
@@ -12830,9 +12836,9 @@ function checkVerdicts(cwd, branch, rows) {
|
|
|
12830
12836
|
authors: [...authors].toSorted()
|
|
12831
12837
|
};
|
|
12832
12838
|
}
|
|
12833
|
-
var OBSERVED_ONLY = new Set(["check", ...PR_ROW_TYPES]);
|
|
12839
|
+
var OBSERVED_ONLY = new Set(["check", "merge.unverified", ...PR_ROW_TYPES]);
|
|
12834
12840
|
|
|
12835
|
-
// packages/workit-
|
|
12841
|
+
// packages/workit-core/src/core/policy/derive.ts
|
|
12836
12842
|
var RULES = {
|
|
12837
12843
|
test: "check:test",
|
|
12838
12844
|
self: "verdict:self",
|
|
@@ -13031,7 +13037,7 @@ function writeBlockers(task, root) {
|
|
|
13031
13037
|
});
|
|
13032
13038
|
}
|
|
13033
13039
|
|
|
13034
|
-
// packages/workit-
|
|
13040
|
+
// packages/workit-core/src/core/task-evaluation.ts
|
|
13035
13041
|
var digestBytes = (value) => createHash7("sha256").update(value).digest("hex");
|
|
13036
13042
|
var inside = (root, candidate) => candidate === root || candidate.startsWith(`${root}${path11.sep}`);
|
|
13037
13043
|
var relative = (root, candidate) => path11.relative(root, candidate).split(path11.sep).join("/") || ".";
|
|
@@ -13697,7 +13703,7 @@ function evaluateClosure(requestedOutcome, view) {
|
|
|
13697
13703
|
});
|
|
13698
13704
|
}
|
|
13699
13705
|
|
|
13700
|
-
// packages/workit-
|
|
13706
|
+
// packages/workit-core/src/core/methods.ts
|
|
13701
13707
|
var METHODS = {
|
|
13702
13708
|
"workit-shape": { dimensions: ["challenge", "decisions", "artifacts", "continuity"] },
|
|
13703
13709
|
"workit-bdd": { dimensions: ["testing"] },
|
|
@@ -13805,7 +13811,7 @@ Skills: load the skill, never act from memory of it (slash aliases /wk-<name>).
|
|
|
13805
13811
|
- architecture, deepen modules (user-invoked; offer it): workit-architecture
|
|
13806
13812
|
`.trim();
|
|
13807
13813
|
|
|
13808
|
-
// packages/workit-
|
|
13814
|
+
// packages/workit-core/src/core/task-context.ts
|
|
13809
13815
|
function reconcileResume(view, observations = []) {
|
|
13810
13816
|
if (observations.length > 0)
|
|
13811
13817
|
return failure2("permission_denied", "worker observations require native host verification");
|
|
@@ -13919,10 +13925,10 @@ var exportDigest = (bundle) => sha256({
|
|
|
13919
13925
|
sourceWorkspaceId: bundle.sourceWorkspaceId,
|
|
13920
13926
|
task: bundle.task
|
|
13921
13927
|
});
|
|
13922
|
-
// packages/workit-
|
|
13928
|
+
// packages/workit-core/src/core/branch.ts
|
|
13923
13929
|
import { createHash as createHash10 } from "node:crypto";
|
|
13924
13930
|
|
|
13925
|
-
// packages/workit-
|
|
13931
|
+
// packages/workit-core/src/core/git.ts
|
|
13926
13932
|
import { execFileSync } from "node:child_process";
|
|
13927
13933
|
var run = (cwd, args) => {
|
|
13928
13934
|
try {
|
|
@@ -13990,7 +13996,7 @@ var gitContext = (workspaceRoot, paths = []) => {
|
|
|
13990
13996
|
};
|
|
13991
13997
|
};
|
|
13992
13998
|
|
|
13993
|
-
// packages/workit-
|
|
13999
|
+
// packages/workit-core/src/core/config.ts
|
|
13994
14000
|
import {
|
|
13995
14001
|
copyFileSync as copyFileSync2,
|
|
13996
14002
|
cpSync as cpSync2,
|
|
@@ -14003,7 +14009,7 @@ import {
|
|
|
14003
14009
|
import os2 from "node:os";
|
|
14004
14010
|
import path12 from "node:path";
|
|
14005
14011
|
|
|
14006
|
-
// packages/workit-
|
|
14012
|
+
// packages/workit-core/src/core/boundary.ts
|
|
14007
14013
|
import { statSync as statSync2 } from "node:fs";
|
|
14008
14014
|
var EVENT = {
|
|
14009
14015
|
initialization: "initialization",
|
|
@@ -14039,7 +14045,7 @@ var changedSourcesSinceLoad = (marker) => {
|
|
|
14039
14045
|
return changed;
|
|
14040
14046
|
};
|
|
14041
14047
|
|
|
14042
|
-
// packages/workit-
|
|
14048
|
+
// packages/workit-core/src/core/config.ts
|
|
14043
14049
|
var diagnosticLogger;
|
|
14044
14050
|
var PRESETS = {
|
|
14045
14051
|
gitflow: {
|
|
@@ -14214,7 +14220,7 @@ var resolveCommitPolicy = (config, workspace) => {
|
|
|
14214
14220
|
return config.commitPolicy ?? { preset: "conventional" };
|
|
14215
14221
|
};
|
|
14216
14222
|
|
|
14217
|
-
// packages/workit-
|
|
14223
|
+
// packages/workit-core/src/core/workspaces.ts
|
|
14218
14224
|
import { createHash as createHash8 } from "node:crypto";
|
|
14219
14225
|
import { readFileSync as readFileSync4, realpathSync as realpathSync3 } from "node:fs";
|
|
14220
14226
|
import path13 from "node:path";
|
|
@@ -14623,12 +14629,12 @@ function workspaceDefaultTarget(cwd, globalDefault) {
|
|
|
14623
14629
|
return String(ws?.vcs?.defaultTargetBranch ?? (hasWorkspacePolicy ? policyDefault : globalDefault ?? policyDefault) ?? "develop");
|
|
14624
14630
|
}
|
|
14625
14631
|
|
|
14626
|
-
// packages/workit-
|
|
14632
|
+
// packages/workit-core/src/core/vcs-config.ts
|
|
14627
14633
|
import fs12 from "node:fs";
|
|
14628
14634
|
import path14 from "node:path";
|
|
14629
14635
|
import { spawnSync as spawnSync8 } from "node:child_process";
|
|
14630
14636
|
|
|
14631
|
-
// packages/workit-
|
|
14637
|
+
// packages/workit-core/src/core/release-tracks.ts
|
|
14632
14638
|
import { createHash as createHash9 } from "node:crypto";
|
|
14633
14639
|
import { spawnSync as spawnSync7 } from "node:child_process";
|
|
14634
14640
|
class ReleaseTrackError extends Error {
|
|
@@ -15026,7 +15032,7 @@ function resolveTrackFor(cwd, options) {
|
|
|
15026
15032
|
return resolution;
|
|
15027
15033
|
}
|
|
15028
15034
|
|
|
15029
|
-
// packages/workit-
|
|
15035
|
+
// packages/workit-core/src/core/vcs-config.ts
|
|
15030
15036
|
var workspacesPath = () => path14.join(configDir(), "workspaces.json");
|
|
15031
15037
|
var vcsCwd = (cwd) => cwd ?? process.env.WORKFLOW_WORKSPACE_ROOT ?? process.cwd();
|
|
15032
15038
|
var remoteProvider = (cwd) => {
|
|
@@ -15308,7 +15314,7 @@ function mergedPrStyle(limit = 6, cwd) {
|
|
|
15308
15314
|
};
|
|
15309
15315
|
}
|
|
15310
15316
|
|
|
15311
|
-
// packages/workit-
|
|
15317
|
+
// packages/workit-core/src/core/branch.ts
|
|
15312
15318
|
var withReleaseTracks = (workspaceRoot, policy) => {
|
|
15313
15319
|
const read = workspaceReleaseTracks(workspaceRoot);
|
|
15314
15320
|
if (read.error)
|
|
@@ -15401,7 +15407,7 @@ var validateBranchNameFor = (workspaceRoot, name) => {
|
|
|
15401
15407
|
}
|
|
15402
15408
|
};
|
|
15403
15409
|
|
|
15404
|
-
// packages/workit-
|
|
15410
|
+
// packages/workit-core/src/core/route-intent.ts
|
|
15405
15411
|
var shellBranchTarget = (command) => {
|
|
15406
15412
|
if (!command.trim() || /[\r\n;&|<>`'"$()\\*?{}~!#]/u.test(command) || command.includes("[") || command.includes("]"))
|
|
15407
15413
|
return null;
|
|
@@ -15416,10 +15422,10 @@ var shellBranchPolicyViolation = (root, command) => {
|
|
|
15416
15422
|
const target = shellBranchTarget(command);
|
|
15417
15423
|
return target === null ? null : validateBranchNameFor(root, target);
|
|
15418
15424
|
};
|
|
15419
|
-
// packages/workit-
|
|
15425
|
+
// packages/workit-core/src/core/task-engine.ts
|
|
15420
15426
|
import { realpathSync as realpathSync4 } from "node:fs";
|
|
15421
15427
|
|
|
15422
|
-
// packages/workit-
|
|
15428
|
+
// packages/workit-core/src/core/policy-resolver.ts
|
|
15423
15429
|
function resolvePolicy(input) {
|
|
15424
15430
|
const ids = input.constraints.map((constraint) => constraint.id);
|
|
15425
15431
|
if (new Set(ids).size !== ids.length)
|
|
@@ -15475,7 +15481,7 @@ function diffPolicy(previous, next, reason, now) {
|
|
|
15475
15481
|
return parsed.data;
|
|
15476
15482
|
}
|
|
15477
15483
|
|
|
15478
|
-
// packages/workit-
|
|
15484
|
+
// packages/workit-core/src/core/policy/judgment.ts
|
|
15479
15485
|
var isObject6 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
15480
15486
|
var squash = (key) => key.toLowerCase().replace(/[_-]/g, "");
|
|
15481
15487
|
var ALIASES = {
|
|
@@ -15599,11 +15605,11 @@ function normalizeJudgment(raw, previous) {
|
|
|
15599
15605
|
return success(null, null, { judgment: parsed.data, ignored, legacy });
|
|
15600
15606
|
}
|
|
15601
15607
|
|
|
15602
|
-
// packages/workit-
|
|
15608
|
+
// packages/workit-core/src/autonomy.ts
|
|
15603
15609
|
import os3 from "node:os";
|
|
15604
15610
|
import path15 from "node:path";
|
|
15605
15611
|
|
|
15606
|
-
// packages/workit-
|
|
15612
|
+
// packages/workit-core/src/core/safe-write.ts
|
|
15607
15613
|
import {
|
|
15608
15614
|
closeSync as closeSync2,
|
|
15609
15615
|
fchmodSync,
|
|
@@ -15626,7 +15632,7 @@ function writeFileExclusive(file, content, mode) {
|
|
|
15626
15632
|
}
|
|
15627
15633
|
}
|
|
15628
15634
|
|
|
15629
|
-
// packages/workit-
|
|
15635
|
+
// packages/workit-core/src/autonomy.ts
|
|
15630
15636
|
var accountHome = () => {
|
|
15631
15637
|
try {
|
|
15632
15638
|
return os3.userInfo().homedir;
|
|
@@ -15761,7 +15767,7 @@ function resolveAutonomy(cwd) {
|
|
|
15761
15767
|
var suggested = (kind) => kind === "merge" ? "verified" : "true";
|
|
15762
15768
|
var grantHint = (workspace, kind) => `ask the user to run, in their own terminal: workit grant set ${workspace ?? "<workspace>"} ${kind}=${suggested(kind)}`;
|
|
15763
15769
|
|
|
15764
|
-
// packages/workit-
|
|
15770
|
+
// packages/workit-core/src/core/task-engine.ts
|
|
15765
15771
|
var workspaceVerification = (root) => {
|
|
15766
15772
|
try {
|
|
15767
15773
|
return resolveAutonomy(root).verification;
|
|
@@ -17346,7 +17352,7 @@ class WorkitCore {
|
|
|
17346
17352
|
return this.summary(changed.data.task);
|
|
17347
17353
|
}
|
|
17348
17354
|
}
|
|
17349
|
-
// packages/workit-
|
|
17355
|
+
// packages/workit-core/src/core/repo-context.ts
|
|
17350
17356
|
import { spawnSync as spawnSync9 } from "node:child_process";
|
|
17351
17357
|
import { existsSync as existsSync6, readFileSync as readFileSync5, readdirSync as readdirSync4 } from "node:fs";
|
|
17352
17358
|
import path16 from "node:path";
|
|
@@ -17816,20 +17822,20 @@ function releaseNotesContext(root, rangeOrTag) {
|
|
|
17816
17822
|
return { stdout, stderr: "", exitCode: 0, cwd };
|
|
17817
17823
|
}
|
|
17818
17824
|
|
|
17819
|
-
// packages/workit-
|
|
17825
|
+
// packages/workit-core/src/core/tracker-issues.ts
|
|
17820
17826
|
import { spawnSync as spawnSync11 } from "node:child_process";
|
|
17821
17827
|
|
|
17822
|
-
// packages/workit-
|
|
17828
|
+
// packages/workit-core/src/core/pr-create.ts
|
|
17823
17829
|
import fs13 from "node:fs";
|
|
17824
17830
|
import path17 from "node:path";
|
|
17825
17831
|
import { spawnSync as spawnSync10 } from "node:child_process";
|
|
17826
|
-
// packages/workit-
|
|
17832
|
+
// packages/workit-core/src/forge/pr-body.ts
|
|
17827
17833
|
function parseGhIssue(value) {
|
|
17828
17834
|
const m = /issues\/(\d+)/.exec(value);
|
|
17829
17835
|
return m ? m[1] : String(value).trim().replace(/^#/, "");
|
|
17830
17836
|
}
|
|
17831
17837
|
|
|
17832
|
-
// packages/workit-
|
|
17838
|
+
// packages/workit-core/src/core/pr-create.ts
|
|
17833
17839
|
function whichOnPath(tool) {
|
|
17834
17840
|
const names = process.platform === "win32" ? [tool, `${tool}.exe`, `${tool}.cmd`] : [tool];
|
|
17835
17841
|
for (const dir of (process.env.PATH ?? "").split(path17.delimiter)) {
|
|
@@ -17857,7 +17863,7 @@ var pushRemote = (cwd) => {
|
|
|
17857
17863
|
return urls.length === 1 ? urls[0] : null;
|
|
17858
17864
|
};
|
|
17859
17865
|
|
|
17860
|
-
// packages/workit-
|
|
17866
|
+
// packages/workit-core/src/core/tracker-issues.ts
|
|
17861
17867
|
var repoPathFromRemote = (remote) => {
|
|
17862
17868
|
let rest = (remote || "").trim().replace(/\/+$/, "");
|
|
17863
17869
|
if (!rest)
|
|
@@ -17955,19 +17961,19 @@ var fetchGitLabIssueBody = async (ref, root, deps = {}) => {
|
|
|
17955
17961
|
return tryCliTriple(deps.cli ?? defaultCli("glab", hostingCliAvailable("gitlab")), "glab", ["issue", "view", id, "-R", repoArg, "-F", "json"], root, id, ["iid"], ["description"]);
|
|
17956
17962
|
};
|
|
17957
17963
|
|
|
17958
|
-
// packages/workit-
|
|
17964
|
+
// packages/workit-core/src/core/youtrack.ts
|
|
17959
17965
|
import fs14 from "node:fs";
|
|
17960
17966
|
import path18 from "node:path";
|
|
17961
17967
|
|
|
17962
|
-
// packages/workit-
|
|
17968
|
+
// packages/workit-core/src/core/templates.ts
|
|
17963
17969
|
var repoRoot2 = assetRoot();
|
|
17964
17970
|
|
|
17965
|
-
// packages/workit-
|
|
17971
|
+
// packages/workit-core/src/core/scripts.ts
|
|
17966
17972
|
var PLUGIN_ROOT = packageRoot();
|
|
17967
17973
|
var ASSET_ROOT = assetRoot();
|
|
17968
17974
|
var resolveWorkspaceRoot = (explicit) => explicit || process.cwd();
|
|
17969
17975
|
|
|
17970
|
-
// packages/workit-
|
|
17976
|
+
// packages/workit-core/src/core/youtrack.ts
|
|
17971
17977
|
var ISSUE_RE = /^[A-Z]+-\d+$/;
|
|
17972
17978
|
var TOKEN_PLACEHOLDER = "YOUR_TOKEN_HERE";
|
|
17973
17979
|
var youTrackConfigPath = () => process.env.WORKFLOW_YOUTRACK_CONFIG ?? path18.join(configDir(), "youtrack.json");
|
|
@@ -18294,7 +18300,7 @@ var fetchYouTrackIssueBody = async (issue, creds = youTrackToken, request = youT
|
|
|
18294
18300
|
}
|
|
18295
18301
|
};
|
|
18296
18302
|
|
|
18297
|
-
// packages/workit-
|
|
18303
|
+
// packages/workit-core/src/core/context-read.ts
|
|
18298
18304
|
var contextReadSchema = object({
|
|
18299
18305
|
kind: _enum([
|
|
18300
18306
|
"git",
|
|
@@ -18405,7 +18411,7 @@ var readExternalContext = async (root, payload) => {
|
|
|
18405
18411
|
}
|
|
18406
18412
|
};
|
|
18407
18413
|
|
|
18408
|
-
// packages/workit-
|
|
18414
|
+
// packages/workit-core/src/core.ts
|
|
18409
18415
|
var ok = (data) => ({ ok: true, data, error: null });
|
|
18410
18416
|
var fail = (error, data = null) => ({
|
|
18411
18417
|
ok: false,
|
|
@@ -18466,7 +18472,7 @@ function run2(root, executable, args, env = {}) {
|
|
|
18466
18472
|
cwd
|
|
18467
18473
|
};
|
|
18468
18474
|
}
|
|
18469
|
-
// packages/workit-
|
|
18475
|
+
// packages/workit-core/src/hooks/descriptor.ts
|
|
18470
18476
|
var support = (descriptor, axis) => {
|
|
18471
18477
|
if (axis.startsWith("event:"))
|
|
18472
18478
|
return descriptor.events[axis.slice("event:".length)].support;
|
|
@@ -18490,7 +18496,7 @@ var capabilitiesFor = (descriptor, observed = {}) => descriptor.capabilities.map
|
|
|
18490
18496
|
refs: rule.refs.map((handle) => ({ kind: "host", host: descriptor.host, handle }))
|
|
18491
18497
|
};
|
|
18492
18498
|
});
|
|
18493
|
-
// packages/workit-
|
|
18499
|
+
// packages/workit-core/src/hooks/context.ts
|
|
18494
18500
|
import path20 from "node:path";
|
|
18495
18501
|
var MIGRATION_PENDING_NOTE = "workit migration pending — run `workit task status`";
|
|
18496
18502
|
var migrationPending = (result) => !result.ok && result.code === "needs_input" && (result.error ?? "").startsWith(MIGRATION_PENDING);
|
|
@@ -18587,12 +18593,12 @@ function entryCompactContext(store, entry, session, context) {
|
|
|
18587
18593
|
cache.delete(cache.keys().next().value);
|
|
18588
18594
|
return compact.data;
|
|
18589
18595
|
}
|
|
18590
|
-
// packages/workit-
|
|
18596
|
+
// packages/workit-core/src/hooks/policy.ts
|
|
18591
18597
|
var shellPolicy = (cwd, command) => {
|
|
18592
18598
|
const policy = shellBranchPolicyViolation(cwd, command);
|
|
18593
18599
|
return policy && !policy.ok ? { kind: "deny", reason: `branch_policy_denied: ${policy.error}`, unblock: null } : { kind: "none" };
|
|
18594
18600
|
};
|
|
18595
|
-
// packages/workit-
|
|
18601
|
+
// packages/workit-core/src/hooks/write-gate.ts
|
|
18596
18602
|
import { realpathSync as realpathSync6 } from "node:fs";
|
|
18597
18603
|
import path21 from "node:path";
|
|
18598
18604
|
var NONE2 = { kind: "none" };
|
|
@@ -18853,7 +18859,7 @@ function writeGate(cwd, paths) {
|
|
|
18853
18859
|
return NONE2;
|
|
18854
18860
|
}
|
|
18855
18861
|
}
|
|
18856
|
-
// packages/workit-
|
|
18862
|
+
// packages/workit-core/src/hooks/hosts/fields.ts
|
|
18857
18863
|
var SHELLS = new Set(["sh", "bash", "zsh", "dash", "pwsh", "powershell", "cmd"]);
|
|
18858
18864
|
var WRITE_TOOLS = new Set([
|
|
18859
18865
|
"write",
|
|
@@ -18874,24 +18880,24 @@ var WRITE_TOOLS = new Set([
|
|
|
18874
18880
|
"editfile",
|
|
18875
18881
|
"writefile"
|
|
18876
18882
|
]);
|
|
18877
|
-
// packages/workit-
|
|
18883
|
+
// packages/workit-core/src/hooks/handle.ts
|
|
18878
18884
|
var offered = new Set;
|
|
18879
18885
|
var CLAUDE_JUDGES = new Set(["workit:verifier", "workit:reviewer"]);
|
|
18880
|
-
// packages/workit-
|
|
18886
|
+
// packages/workit-core/src/hooks/hosts/claude-code.ts
|
|
18881
18887
|
var SOURCES = new Set(["startup", "resume", "clear", "compact", "fork"]);
|
|
18882
18888
|
var SHELL_TOOLS = new Set(["Bash", "PowerShell"]);
|
|
18883
18889
|
var CONTEXT_EVENTS = new Set(["SessionStart", "UserPromptSubmit", "SubagentStart"]);
|
|
18884
18890
|
|
|
18885
|
-
// packages/workit-
|
|
18891
|
+
// packages/workit-core/src/hooks/hosts/codex.ts
|
|
18886
18892
|
var SHELL_TOOLS2 = new Set(["bash", "unified-exec"]);
|
|
18887
18893
|
var SOURCES2 = new Set(["startup", "resume", "clear", "compact"]);
|
|
18888
18894
|
|
|
18889
|
-
// packages/workit-
|
|
18895
|
+
// packages/workit-core/src/hooks/hosts/cursor.ts
|
|
18890
18896
|
var BLOCKING = new Set(["preToolUse", "beforeShellExecution", "subagentStart"]);
|
|
18891
18897
|
|
|
18892
|
-
// packages/workit-
|
|
18898
|
+
// packages/workit-core/src/hooks/run.ts
|
|
18893
18899
|
if (false) {}
|
|
18894
|
-
// packages/workit-
|
|
18900
|
+
// packages/workit-core/src/hooks/hosts/opencode.ts
|
|
18895
18901
|
var OPENCODE_DESCRIPTOR = {
|
|
18896
18902
|
host: "opencode",
|
|
18897
18903
|
label: "OpenCode",
|
|
@@ -18960,7 +18966,7 @@ var OPENCODE_DESCRIPTOR = {
|
|
|
18960
18966
|
// packages/workit-opencode/src/shared/init-apply.ts
|
|
18961
18967
|
import path26 from "node:path";
|
|
18962
18968
|
|
|
18963
|
-
// packages/workit-
|
|
18969
|
+
// packages/workit-core/src/core/gitignore.ts
|
|
18964
18970
|
import { existsSync as existsSync8, readFileSync as readFileSync6, writeFileSync as writeFileSync4 } from "node:fs";
|
|
18965
18971
|
import path22 from "node:path";
|
|
18966
18972
|
var GITIGNORE_ENTRIES = [
|
|
@@ -19008,7 +19014,7 @@ var ensureProjectGitignore = (workspaceRoot, confirmed) => {
|
|
|
19008
19014
|
return { ok: true, path: file, added };
|
|
19009
19015
|
};
|
|
19010
19016
|
|
|
19011
|
-
// packages/workit-
|
|
19017
|
+
// packages/workit-core/src/core/hygiene.ts
|
|
19012
19018
|
import { existsSync as existsSync9, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "node:fs";
|
|
19013
19019
|
import path23 from "node:path";
|
|
19014
19020
|
var repoRoot3 = assetRoot();
|
|
@@ -19072,17 +19078,17 @@ var ensureHygieneFiles = (root, opts) => {
|
|
|
19072
19078
|
return { ok: true, created };
|
|
19073
19079
|
};
|
|
19074
19080
|
|
|
19075
|
-
// packages/workit-
|
|
19081
|
+
// packages/workit-core/src/core/init.ts
|
|
19076
19082
|
import fs15 from "node:fs";
|
|
19077
19083
|
import path25 from "node:path";
|
|
19078
19084
|
import { spawnSync as spawnSync14 } from "node:child_process";
|
|
19079
19085
|
|
|
19080
|
-
// packages/workit-
|
|
19086
|
+
// packages/workit-core/src/core/workspace-branch-policy.ts
|
|
19081
19087
|
import { mkdirSync as mkdirSync4, readFileSync as readFileSync8, renameSync as renameSync3, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "node:fs";
|
|
19082
19088
|
import path24 from "node:path";
|
|
19083
19089
|
import { isDeepStrictEqual } from "node:util";
|
|
19084
19090
|
|
|
19085
|
-
// packages/workit-
|
|
19091
|
+
// packages/workit-core/src/core/branch-policy.ts
|
|
19086
19092
|
import { spawnSync as spawnSync13 } from "node:child_process";
|
|
19087
19093
|
var PREFIXES2 = {
|
|
19088
19094
|
feature: "feature/*",
|
|
@@ -19142,7 +19148,7 @@ var detectBranchPolicy = (workspaceRoot) => {
|
|
|
19142
19148
|
};
|
|
19143
19149
|
};
|
|
19144
19150
|
|
|
19145
|
-
// packages/workit-
|
|
19151
|
+
// packages/workit-core/src/core/workspace-branch-policy.ts
|
|
19146
19152
|
var readFileSafe = (p) => {
|
|
19147
19153
|
try {
|
|
19148
19154
|
return readFileSync8(p, "utf8");
|
|
@@ -19244,7 +19250,7 @@ function applyWorkspaceBranchPolicy(opts) {
|
|
|
19244
19250
|
};
|
|
19245
19251
|
}
|
|
19246
19252
|
|
|
19247
|
-
// packages/workit-
|
|
19253
|
+
// packages/workit-core/src/core/init.ts
|
|
19248
19254
|
var TOKEN_PLACEHOLDER2 = "YOUR_TOKEN_HERE";
|
|
19249
19255
|
var readJson = (p) => {
|
|
19250
19256
|
try {
|
|
@@ -20173,7 +20179,7 @@ var evaluateShellPermission = (root, event) => {
|
|
|
20173
20179
|
import { existsSync as existsSync11, readFileSync as readFileSync9 } from "node:fs";
|
|
20174
20180
|
import path30 from "node:path";
|
|
20175
20181
|
|
|
20176
|
-
// packages/workit-
|
|
20182
|
+
// packages/workit-core/src/core/skill-manifests.ts
|
|
20177
20183
|
var WORKIT_METHOD_SKILLS = [
|
|
20178
20184
|
"workit-shape",
|
|
20179
20185
|
"workit-implement",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-opencode",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit OpenCode plugin — native tools, adaptive policy, and sixteen method skills",
|
|
6
6
|
"keywords": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"typecheck": "tsc --noEmit"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@brainervirus/workit-core": "^8.0.
|
|
42
|
+
"@brainervirus/workit-core": "^8.0.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@opencode/plugin": "2.0.18"
|