opencode-swarm 7.133.0 → 7.134.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/.opencode/skills/codebase-review-swarm/SKILL.md +18 -2
- package/.opencode/skills/codebase-review-swarm/references/review-protocol-v8.2.md +18 -2
- package/.opencode/skills/swarm-implement/SKILL.md +17 -2
- package/dist/background/completion-observer.d.ts +17 -7
- package/dist/background/pending-delegations.d.ts +305 -30
- package/dist/background/pr-event-subscribers.d.ts +1 -1
- package/dist/cli/{config-doctor-8nbdwnn6.js → config-doctor-4avzz3rh.js} +3 -3
- package/dist/cli/{core-egwpry19.js → core-d6yd2jzv.js} +3 -3
- package/dist/cli/{curation-policy-gae3xm5d.js → curation-policy-8vkzjtwb.js} +7 -7
- package/dist/cli/{curator-e88bm4mg.js → curator-3vsvhwav.js} +31 -28
- package/dist/cli/{curator-drift-ea0p8nh1.js → curator-drift-9q6f85bm.js} +7 -7
- package/dist/cli/{curator-llm-factory-1a7esr69.js → curator-llm-factory-2qk8q4y9.js} +31 -28
- package/dist/cli/{dispatch-3mhgqj2x.js → dispatch-gxbeb2ps.js} +2 -2
- package/dist/cli/{evidence-summary-service-nhsmsap8.js → evidence-summary-service-mrzsjpg4.js} +13 -12
- package/dist/cli/{gate-evidence-cy2te3x8.js → gate-evidence-b5v1xvxp.js} +4 -4
- package/dist/cli/guardrail-explain-tw521x47.js +57 -0
- package/dist/cli/{guardrail-log-fjgyx76r.js → guardrail-log-e3jrwdw8.js} +5 -5
- package/dist/cli/{hive-promoter-2b04e0wh.js → hive-promoter-sdy5qjzn.js} +31 -28
- package/dist/cli/{index-66zght9d.js → index-0541h76w.js} +2 -2
- package/dist/cli/{index-g4mnf3p5.js → index-1j3682j8.js} +5 -5
- package/dist/cli/{index-mmvaf4t6.js → index-1v5mby7t.js} +25 -3
- package/dist/cli/{index-j5pnah1w.js → index-2j8f71c3.js} +12 -12
- package/dist/cli/{index-17zjp67y.js → index-2t1n9k7b.js} +4 -4
- package/dist/cli/{index-mwqfyjja.js → index-358f9h8p.js} +48406 -48697
- package/dist/cli/{index-hfpw5m0e.js → index-463k8mfr.js} +3 -3
- package/dist/cli/{index-2tn5h2zp.js → index-4p02dp92.js} +6 -6
- package/dist/cli/{index-7ftthvqt.js → index-6b69mp0r.js} +8 -8
- package/dist/cli/{index-bz08438z.js → index-8t9xpn1a.js} +7 -7
- package/dist/cli/{index-sp7tm8t7.js → index-9z1q181f.js} +1 -1
- package/dist/cli/index-b4z7s917.js +80 -0
- package/dist/cli/index-b8zgtz81.js +123 -0
- package/dist/cli/{index-tj2mkfb3.js → index-bq2848a3.js} +1 -1
- package/dist/cli/{index-kc1m6vpr.js → index-c0e3vhv9.js} +2 -2
- package/dist/cli/{index-q27bajqb.js → index-cfkvc5q9.js} +3 -3
- package/dist/cli/{index-7mkpsw6g.js → index-dd7ttx8x.js} +1 -1
- package/dist/cli/{index-r260ybay.js → index-k742ecbm.js} +178 -222
- package/dist/cli/{index-cpest8sa.js → index-kwm7hz18.js} +5 -5
- package/dist/cli/{index-0vd91yb8.js → index-m8ajf6wb.js} +3 -3
- package/dist/cli/{index-mhcge2ry.js → index-mz6sqtm9.js} +33 -30
- package/dist/cli/{index-74tptrss.js → index-p8hezdtz.js} +1 -1
- package/dist/cli/{index-sw82jvf2.js → index-pz49rx4y.js} +2 -2
- package/dist/cli/{index-3x761jqv.js → index-wk1h5ec2.js} +1 -1
- package/dist/cli/{index-wzb4dv5s.js → index-y2esw64s.js} +4 -4
- package/dist/cli/index-y3v1404y.js +1625 -0
- package/dist/cli/{index-wz36r0fk.js → index-zjw32rv9.js} +2 -2
- package/dist/cli/index.js +31 -28
- package/dist/cli/{knowledge-escalator-hzkw1ban.js → knowledge-escalator-v09w0jmg.js} +8 -8
- package/dist/cli/{knowledge-events-pbycdhqd.js → knowledge-events-qp19r2he.js} +6 -6
- package/dist/cli/{knowledge-link-4yd2z8ev.js → knowledge-link-nc4y2zkq.js} +5 -5
- package/dist/cli/{knowledge-store-45jawb2p.js → knowledge-store-n5pvv0s3.js} +6 -6
- package/dist/cli/{knowledge-validator-ge576f8n.js → knowledge-validator-qg31ycbb.js} +9 -9
- package/dist/cli/pending-delegations-v9e40hfk.js +96 -0
- package/dist/cli/{pr-subscriptions-zqbmctwz.js → pr-subscriptions-ztq40hrt.js} +7 -7
- package/dist/cli/{scan-cursor-kvw872be.js → scan-cursor-wtzfvkh2.js} +7 -7
- package/dist/cli/{schema-a2zm2m3r.js → schema-erk5bz43.js} +2 -2
- package/dist/cli/{scope-persistence-5qypzxxm.js → scope-persistence-hz3zmmsv.js} +5 -5
- package/dist/cli/{skill-generator-ch79hvxh.js → skill-generator-nxs65tq3.js} +10 -10
- package/dist/cli/worktree-collision-ownership-c4bdnjtx.js +221 -0
- package/dist/evaluation/contracts.d.ts +1 -1
- package/dist/evaluation/public-api.d.ts +1 -1
- package/dist/hooks/delegation-gate/worktree-collision-ownership.d.ts +28 -0
- package/dist/hooks/delegation-gate/worktree-isolation.d.ts +63 -1
- package/dist/hooks/delegation-gate/worktree-merge-status.d.ts +14 -0
- package/dist/hooks/delegation-gate/worktree-ownership-tag.d.ts +19 -0
- package/dist/hooks/delegation-gate/worktree-provisioning-owner.d.ts +30 -0
- package/dist/hooks/delegation-gate.d.ts +14 -5
- package/dist/hooks/guardrails/messages-transform.d.ts +10 -0
- package/dist/hooks/guardrails/stored-input-args.d.ts +6 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/init-orphan-recovery.d.ts +17 -0
- package/dist/index.js +486 -479
- package/dist/memory/schema.d.ts +4 -4
- package/dist/prm/escalation.d.ts +1 -11
- package/dist/prm/index.d.ts +1 -0
- package/dist/prm/types.d.ts +0 -2
- package/dist/session/snapshot-writer.d.ts +3 -0
- package/dist/state.d.ts +54 -1
- package/dist/tools/dispatch-lanes.d.ts +1 -1
- package/dist/tools/epic-record-divergence.d.ts +5 -5
- package/dist/utils/advisory-queue.d.ts +60 -0
- package/dist/worktree/merge.d.ts +47 -1
- package/package.json +1 -1
- package/dist/cli/guardrail-explain-zgja2b9m.js +0 -54
- package/dist/cli/pending-delegations-kxy8mdqg.js +0 -75
- package/dist/cli/{index-9f71ye47.js → index-13xxjfhn.js} +3 -3
- package/dist/cli/{index-s80bsjkj.js → index-2ghkk9ve.js} +6 -6
- package/dist/cli/{index-76kvm9z5.js → index-5nybajn9.js} +3 -3
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
loadPluginConfigWithMeta,
|
|
8
8
|
loadPluginConfigWithMetaAsync,
|
|
9
9
|
resolveWorktreeIsolationConfig
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-c0e3vhv9.js";
|
|
11
11
|
import {
|
|
12
12
|
ApprovalEvidenceSchema,
|
|
13
13
|
BaseEvidenceSchema,
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
isQAAgent,
|
|
63
63
|
isSubagent,
|
|
64
64
|
resolveAutoReviewConfig
|
|
65
|
-
} from "./index-
|
|
65
|
+
} from "./index-y2esw64s.js";
|
|
66
66
|
import"./index-bk5tah7q.js";
|
|
67
67
|
import {
|
|
68
68
|
MigrationStatusSchema,
|
|
@@ -74,9 +74,9 @@ import {
|
|
|
74
74
|
TaskStatusSchema
|
|
75
75
|
} from "./index-1kz6da87.js";
|
|
76
76
|
import"./index-4rhhvd1a.js";
|
|
77
|
+
import"./index-bpmtbmy9.js";
|
|
77
78
|
import"./index-zjygnfay.js";
|
|
78
79
|
import"./index-zgwm4ryv.js";
|
|
79
|
-
import"./index-bpmtbmy9.js";
|
|
80
80
|
import"./index-a76rekgs.js";
|
|
81
81
|
export {
|
|
82
82
|
validateSpecContent,
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
PlanSchema,
|
|
5
5
|
TaskStatusSchema
|
|
6
6
|
} from "./index-1kz6da87.js";
|
|
7
|
-
import {
|
|
8
|
-
criticalWarn,
|
|
9
|
-
init_logger,
|
|
10
|
-
log
|
|
11
|
-
} from "./index-zgwm4ryv.js";
|
|
12
7
|
import {
|
|
13
8
|
withEvidenceLock
|
|
14
|
-
} from "./index-
|
|
9
|
+
} from "./index-5nybajn9.js";
|
|
15
10
|
import {
|
|
16
11
|
emit
|
|
17
12
|
} from "./index-q2rrv0cy.js";
|
|
13
|
+
import {
|
|
14
|
+
criticalWarn,
|
|
15
|
+
init_logger,
|
|
16
|
+
log
|
|
17
|
+
} from "./index-zgwm4ryv.js";
|
|
18
18
|
|
|
19
19
|
// src/plan/utils.ts
|
|
20
20
|
function derivePlanId(plan) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
authorizeCuration
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-zjw32rv9.js";
|
|
5
5
|
import {
|
|
6
6
|
findNearDuplicate,
|
|
7
7
|
inferTags,
|
|
@@ -9,20 +9,20 @@ import {
|
|
|
9
9
|
resolveSwarmKnowledgePath,
|
|
10
10
|
resolveSwarmRejectedPath,
|
|
11
11
|
transactKnowledge
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-2j8f71c3.js";
|
|
13
13
|
import {
|
|
14
14
|
resolveKnowledgeStoreDir
|
|
15
|
-
} from "./index-
|
|
16
|
-
import {
|
|
17
|
-
init_logger,
|
|
18
|
-
warn
|
|
19
|
-
} from "./index-zgwm4ryv.js";
|
|
15
|
+
} from "./index-cfkvc5q9.js";
|
|
20
16
|
import {
|
|
21
17
|
atomicWriteFile
|
|
22
|
-
} from "./index-
|
|
18
|
+
} from "./index-dd7ttx8x.js";
|
|
23
19
|
import {
|
|
24
20
|
require_proper_lockfile
|
|
25
21
|
} from "./index-7g4c7s5r.js";
|
|
22
|
+
import {
|
|
23
|
+
init_logger,
|
|
24
|
+
warn
|
|
25
|
+
} from "./index-zgwm4ryv.js";
|
|
26
26
|
import {
|
|
27
27
|
__toESM
|
|
28
28
|
} from "./index-a76rekgs.js";
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
} from "./index-ae75rja9.js";
|
|
5
5
|
import {
|
|
6
6
|
resolveKnowledgeStoreDir
|
|
7
|
-
} from "./index-
|
|
8
|
-
import {
|
|
9
|
-
init_logger,
|
|
10
|
-
warn
|
|
11
|
-
} from "./index-zgwm4ryv.js";
|
|
7
|
+
} from "./index-cfkvc5q9.js";
|
|
12
8
|
import {
|
|
13
9
|
atomicWriteFile
|
|
14
|
-
} from "./index-
|
|
10
|
+
} from "./index-dd7ttx8x.js";
|
|
15
11
|
import {
|
|
16
12
|
require_proper_lockfile
|
|
17
13
|
} from "./index-7g4c7s5r.js";
|
|
14
|
+
import {
|
|
15
|
+
init_logger,
|
|
16
|
+
warn
|
|
17
|
+
} from "./index-zgwm4ryv.js";
|
|
18
18
|
import {
|
|
19
19
|
__require,
|
|
20
20
|
__toESM
|
|
@@ -608,7 +608,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
|
|
|
608
608
|
deltas.push({ id, delta });
|
|
609
609
|
}
|
|
610
610
|
if (deltas.length > 0) {
|
|
611
|
-
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-
|
|
611
|
+
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-n5pvv0s3.js");
|
|
612
612
|
await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
|
|
613
613
|
}
|
|
614
614
|
return {
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
validateSwarmPath
|
|
4
|
+
} from "./index-2ghkk9ve.js";
|
|
5
|
+
|
|
6
|
+
// src/hooks/delegation-gate/worktree-provisioning-owner.ts
|
|
7
|
+
import * as fs from "fs";
|
|
8
|
+
import * as path from "path";
|
|
9
|
+
var PROVISIONING_OWNER_DIR = "worktree-provisioning-owners";
|
|
10
|
+
var MAX_PROVISIONING_OWNERS = 512;
|
|
11
|
+
var MAX_PROVISIONING_OWNER_BYTES = 16 * 1024;
|
|
12
|
+
function ownerDirectory(directory) {
|
|
13
|
+
return path.dirname(validateSwarmPath(directory, path.join(PROVISIONING_OWNER_DIR, ".containment-anchor")));
|
|
14
|
+
}
|
|
15
|
+
function isOwner(value) {
|
|
16
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
17
|
+
return false;
|
|
18
|
+
const candidate = value;
|
|
19
|
+
const schemaVersion = candidate.schemaVersion;
|
|
20
|
+
const validTaskIdentity = schemaVersion === 1 ? candidate.taskId === undefined : schemaVersion === 2 && typeof candidate.taskId === "string" && candidate.taskId.length > 0 && candidate.taskId.length <= 512;
|
|
21
|
+
return (schemaVersion === 1 || schemaVersion === 2) && validTaskIdentity && typeof candidate.callID === "string" && candidate.callID.length > 0 && candidate.callID.length <= 512 && typeof candidate.parentSessionId === "string" && candidate.parentSessionId.length > 0 && candidate.parentSessionId.length <= 512 && typeof candidate.worktreeSessionId === "string" && candidate.worktreeSessionId.length > 0 && candidate.worktreeSessionId.length <= 512 && typeof candidate.createdAt === "number" && Number.isFinite(candidate.createdAt) && candidate.createdAt >= 0;
|
|
22
|
+
}
|
|
23
|
+
function scanWorktreeProvisioningOwnersForRecovery(directory) {
|
|
24
|
+
let directoryPath;
|
|
25
|
+
let entries;
|
|
26
|
+
try {
|
|
27
|
+
directoryPath = ownerDirectory(directory);
|
|
28
|
+
entries = fs.readdirSync(directoryPath, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json"));
|
|
29
|
+
} catch (error) {
|
|
30
|
+
if (error.code === "ENOENT") {
|
|
31
|
+
return { status: "ok", owners: [] };
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
status: "uncertain",
|
|
35
|
+
reason: `worktree provisioning-owner directory is unreadable: ${error instanceof Error ? error.message : String(error)}`
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (entries.length > MAX_PROVISIONING_OWNERS) {
|
|
39
|
+
return {
|
|
40
|
+
status: "uncertain",
|
|
41
|
+
reason: `worktree provisioning-owner count exceeds the ${MAX_PROVISIONING_OWNERS}-marker safety bound`
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const owners = [];
|
|
45
|
+
for (const entry of entries) {
|
|
46
|
+
const absolutePath = path.join(directoryPath, entry.name);
|
|
47
|
+
try {
|
|
48
|
+
const stat = fs.statSync(absolutePath);
|
|
49
|
+
if (stat.size > MAX_PROVISIONING_OWNER_BYTES) {
|
|
50
|
+
return {
|
|
51
|
+
status: "uncertain",
|
|
52
|
+
reason: `worktree provisioning owner "${entry.name}" exceeds the recovery size bound`
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const raw = fs.readFileSync(absolutePath, "utf8");
|
|
56
|
+
if (Buffer.byteLength(raw, "utf8") > MAX_PROVISIONING_OWNER_BYTES) {
|
|
57
|
+
return {
|
|
58
|
+
status: "uncertain",
|
|
59
|
+
reason: `worktree provisioning owner "${entry.name}" changed beyond the recovery size bound`
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const parsed = JSON.parse(raw);
|
|
63
|
+
if (!isOwner(parsed)) {
|
|
64
|
+
return {
|
|
65
|
+
status: "uncertain",
|
|
66
|
+
reason: `worktree provisioning owner "${entry.name}" is invalid`
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
owners.push(parsed);
|
|
70
|
+
} catch (error) {
|
|
71
|
+
return {
|
|
72
|
+
status: "uncertain",
|
|
73
|
+
reason: `worktree provisioning owner "${entry.name}" is unreadable or malformed: ${error instanceof Error ? error.message : String(error)}`
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return { status: "ok", owners };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { scanWorktreeProvisioningOwnersForRecovery };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/hooks/delegation-gate/worktree-merge-status.ts
|
|
3
|
+
import * as fs from "fs";
|
|
4
|
+
import * as path from "path";
|
|
5
|
+
var failuresByTask = new Map;
|
|
6
|
+
var durableStatusPath;
|
|
7
|
+
var MAX_RECOVERY_STATUS_BYTES = 2 * 1024 * 1024;
|
|
8
|
+
var MAX_RECOVERY_STATUS_ENTRIES = 512;
|
|
9
|
+
var hasLoaded = false;
|
|
10
|
+
function loadDurableStatus(statusPath) {
|
|
11
|
+
try {
|
|
12
|
+
hasLoaded = true;
|
|
13
|
+
if (!fs.existsSync(statusPath)) {
|
|
14
|
+
failuresByTask.clear();
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const data = JSON.parse(fs.readFileSync(statusPath, "utf-8"));
|
|
18
|
+
if (data && typeof data === "object") {
|
|
19
|
+
failuresByTask.clear();
|
|
20
|
+
for (const [taskId, failure] of Object.entries(data)) {
|
|
21
|
+
failuresByTask.set(taskId, failure);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
} catch {
|
|
25
|
+
failuresByTask.clear();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function isRecoveryFailure(value) {
|
|
29
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
30
|
+
return false;
|
|
31
|
+
const candidate = value;
|
|
32
|
+
if (candidate.outcome !== "partial" && candidate.outcome !== "failed" || typeof candidate.stage !== "string" || !candidate.stage || typeof candidate.message !== "string" || !candidate.message) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
for (const key of ["worktreePath", "branch"]) {
|
|
36
|
+
if (candidate[key] !== undefined && (typeof candidate[key] !== "string" || candidate[key].length === 0)) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
for (const key of ["queuedAt", "completedAt"]) {
|
|
41
|
+
if (candidate[key] !== undefined && (typeof candidate[key] !== "number" || !Number.isFinite(candidate[key]) || candidate[key] < 0)) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
function scanWorktreeMergeFailuresForRecovery(projectDir) {
|
|
48
|
+
const statusPath = path.join(projectDir, ".swarm", "worktree-merge-status.json");
|
|
49
|
+
try {
|
|
50
|
+
const stat = fs.statSync(statusPath);
|
|
51
|
+
if (stat.size > MAX_RECOVERY_STATUS_BYTES) {
|
|
52
|
+
return {
|
|
53
|
+
status: "uncertain",
|
|
54
|
+
reason: `worktree merge-status file exceeds the ${MAX_RECOVERY_STATUS_BYTES}-byte recovery bound`
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const raw = fs.readFileSync(statusPath, "utf-8");
|
|
58
|
+
if (Buffer.byteLength(raw, "utf8") > MAX_RECOVERY_STATUS_BYTES) {
|
|
59
|
+
return {
|
|
60
|
+
status: "uncertain",
|
|
61
|
+
reason: `worktree merge-status file changed beyond the ${MAX_RECOVERY_STATUS_BYTES}-byte recovery bound`
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const parsed = JSON.parse(raw);
|
|
65
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
66
|
+
return {
|
|
67
|
+
status: "uncertain",
|
|
68
|
+
reason: "worktree merge-status file does not contain an object"
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const entries = Object.entries(parsed);
|
|
72
|
+
if (entries.length > MAX_RECOVERY_STATUS_ENTRIES) {
|
|
73
|
+
return {
|
|
74
|
+
status: "uncertain",
|
|
75
|
+
reason: `worktree merge-status owner count exceeds the ${MAX_RECOVERY_STATUS_ENTRIES}-entry safety bound`
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
for (const [taskId, failure] of entries) {
|
|
79
|
+
if (!taskId || !isRecoveryFailure(failure)) {
|
|
80
|
+
return {
|
|
81
|
+
status: "uncertain",
|
|
82
|
+
reason: `worktree merge-status has an invalid owner record for task "${taskId}"`
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
status: "ok",
|
|
88
|
+
failures: entries
|
|
89
|
+
};
|
|
90
|
+
} catch (error) {
|
|
91
|
+
if (error.code === "ENOENT") {
|
|
92
|
+
return { status: "ok", failures: [] };
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
status: "uncertain",
|
|
96
|
+
reason: `worktree merge-status is unreadable or malformed: ${error instanceof Error ? error.message : String(error)}`
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function initDurableStatusPath(projectDir) {
|
|
101
|
+
if (typeof projectDir !== "string" || projectDir.length === 0)
|
|
102
|
+
return;
|
|
103
|
+
const nextPath = path.join(projectDir, ".swarm", "worktree-merge-status.json");
|
|
104
|
+
if (durableStatusPath === nextPath && hasLoaded)
|
|
105
|
+
return;
|
|
106
|
+
durableStatusPath = nextPath;
|
|
107
|
+
hasLoaded = false;
|
|
108
|
+
loadDurableStatus(durableStatusPath);
|
|
109
|
+
}
|
|
110
|
+
function getWorktreeMergeFailure(taskId) {
|
|
111
|
+
if (!hasLoaded && durableStatusPath) {
|
|
112
|
+
loadDurableStatus(durableStatusPath);
|
|
113
|
+
}
|
|
114
|
+
return failuresByTask.get(taskId);
|
|
115
|
+
}
|
|
116
|
+
function getAllWorktreeMergeFailures() {
|
|
117
|
+
if (!hasLoaded && durableStatusPath) {
|
|
118
|
+
loadDurableStatus(durableStatusPath);
|
|
119
|
+
}
|
|
120
|
+
return failuresByTask.entries();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export { scanWorktreeMergeFailuresForRecovery, initDurableStatusPath, getWorktreeMergeFailure, getAllWorktreeMergeFailures };
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
init_constants,
|
|
9
9
|
init_schema,
|
|
10
10
|
resolveExternalSkillsConfig
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-y2esw64s.js";
|
|
12
12
|
import {
|
|
13
13
|
advisoryWarn,
|
|
14
14
|
init_warning_buffer
|
|
@@ -715,4 +715,4 @@ function resolveWorktreeIsolationConfig(config) {
|
|
|
715
715
|
// src/config/index.ts
|
|
716
716
|
var _internals = { loadPluginConfigWithMeta };
|
|
717
717
|
|
|
718
|
-
export {
|
|
718
|
+
export { loadPluginConfig, loadPluginConfigWithMeta, getSafeDefaultConfigLoadResult, loadPluginConfigWithMetaAsync, loadAgentPrompt, exports_loader, init_loader, resolveWorktreeIsolationConfig, _internals };
|