opencode-swarm 7.153.0 → 7.153.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/background/pending-delegations.d.ts +7 -0
- package/dist/cli/{config-doctor-7s7xga6f.js → config-doctor-tv0ar88m.js} +2 -2
- package/dist/cli/{core-vkpy14vv.js → core-kmsm50zn.js} +1 -1
- package/dist/cli/{curation-policy-xy7tm4ad.js → curation-policy-twa6agf8.js} +7 -7
- package/dist/cli/{curator-llm-factory-q5cjk7mt.js → curator-llm-factory-dxkhdhwg.js} +30 -30
- package/dist/cli/{curator-6freqnhf.js → curator-wxe863k9.js} +30 -30
- package/dist/cli/{evidence-summary-service-engtgjww.js → evidence-summary-service-9akrdg9t.js} +13 -13
- package/dist/cli/{gate-evidence-6bzzz8kq.js → gate-evidence-bdzqbg2y.js} +7 -7
- package/dist/cli/{guardrail-explain-vsck39dh.js → guardrail-explain-kx9rem51.js} +31 -31
- package/dist/cli/{guardrail-log-0dn8m3k6.js → guardrail-log-zxzyx1de.js} +5 -5
- package/dist/cli/{guardrail-reset-6e2vyfn9.js → guardrail-reset-1mc3st34.js} +30 -30
- package/dist/cli/{hive-promoter-021abs6z.js → hive-promoter-gncwtq0z.js} +30 -30
- package/dist/cli/{index-babtfqa0.js → index-02rbfrab.js} +450 -48
- package/dist/cli/{index-eqh3t8eh.js → index-0azn976d.js} +14 -14
- package/dist/cli/{index-9gjbe4e4.js → index-1gzdnjg9.js} +2 -2
- package/dist/cli/{index-g0m6kypc.js → index-21pt4jwf.js} +1 -1
- package/dist/cli/{index-z4bg1hv8.js → index-2mqmvxac.js} +9 -2
- package/dist/cli/{index-xv881ahz.js → index-3bh4h6ve.js} +108 -8
- package/dist/cli/index-3cegckkq.js +239 -0
- package/dist/cli/{index-hkmgzesw.js → index-3fpqpyp6.js} +2 -2
- package/dist/cli/{index-1yfpw7w0.js → index-3ttktt56.js} +1 -1
- package/dist/cli/{index-x6zy6veh.js → index-4pjkdcgc.js} +1 -1
- package/dist/cli/{index-5w915x8b.js → index-56ejcj07.js} +4 -4
- package/dist/cli/{index-7q56f3se.js → index-5ad8xcv3.js} +2 -2
- package/dist/cli/{index-e2hs0bh7.js → index-5zp4c36c.js} +1 -1
- package/dist/cli/{index-9vdh4kdx.js → index-84m4per1.js} +2 -2
- package/dist/cli/{index-txbd25bc.js → index-891g7hbf.js} +1 -1
- package/dist/cli/{index-3z5jtyan.js → index-a58nmnmz.js} +9 -2
- package/dist/cli/{index-77xy577c.js → index-bw55r5bz.js} +9 -9
- package/dist/cli/{index-80ekaf5b.js → index-ebshrg4x.js} +3 -3
- package/dist/cli/{index-5x67858f.js → index-h06112sh.js} +5 -5
- package/dist/cli/{index-6v77adf7.js → index-h3zhb18p.js} +2 -2
- package/dist/cli/{index-hw49515c.js → index-hhv2pvab.js} +1 -1
- package/dist/cli/{index-95qra69h.js → index-j4f8sz67.js} +4489 -2475
- package/dist/cli/{index-dh1gk5c5.js → index-kenz5bja.js} +32 -32
- package/dist/cli/{index-hexhzq5j.js → index-kvk65qzz.js} +3 -3
- package/dist/cli/{index-0q2mjxp2.js → index-meg33yyv.js} +1 -1
- package/dist/cli/{index-6zkm4p7p.js → index-pk1gbqmq.js} +1 -1
- package/dist/cli/{index-eajfs7v4.js → index-s6b8jgtn.js} +1 -1
- package/dist/cli/{index-k2ydsqs7.js → index-td0jz8xe.js} +4 -4
- package/dist/cli/{index-3z2f1cy8.js → index-vhbds89e.js} +4 -4
- package/dist/cli/{index-qgfnd206.js → index-x3y6zhgj.js} +1 -1
- package/dist/cli/{index-aw492hpn.js → index-x8vw6ap1.js} +58 -41
- package/dist/cli/{index-4gn111h3.js → index-yvepnbyd.js} +5 -5
- package/dist/cli/{index-0n7nm9e8.js → index-zppxpc3y.js} +2 -2
- package/dist/cli/index.js +30 -30
- package/dist/cli/{knowledge-escalator-79zbhpz5.js → knowledge-escalator-gp3mpbqe.js} +12 -12
- package/dist/cli/{knowledge-events-79cak7eb.js → knowledge-events-nvkhtqvn.js} +10 -10
- package/dist/cli/{knowledge-link-40zsr5ja.js → knowledge-link-ge0rddxw.js} +6 -6
- package/dist/cli/{knowledge-store-w29aw5w0.js → knowledge-store-2ngh8xvv.js} +7 -7
- package/dist/cli/{knowledge-validator-qsecnt2d.js → knowledge-validator-4bphyrec.js} +9 -9
- package/dist/cli/{pending-delegations-a2nmssr1.js → pending-delegations-nk78wx7h.js} +4 -4
- package/dist/cli/{pr-subscriptions-7879nq5k.js → pr-subscriptions-dq1f61ye.js} +4 -4
- package/dist/cli/{runner-fbgsxs74.js → runner-n50w1y4w.js} +7 -7
- package/dist/cli/{scan-cursor-1r3pcdqp.js → scan-cursor-c16xtygz.js} +8 -8
- package/dist/cli/{schema-19qsv6fw.js → schema-83tbte2g.js} +1 -1
- package/dist/cli/{scope-persistence-ypcrvqtt.js → scope-persistence-gdbw8xh8.js} +9 -9
- package/dist/cli/{skill-generator-wpp9kpa0.js → skill-generator-gr13xeha.js} +14 -14
- package/dist/cli/{telemetry-52pw5xac.js → telemetry-hh1j99za.js} +1 -1
- package/dist/cli/{worktree-collision-ownership-p31zm5k0.js → worktree-collision-ownership-4drcjymy.js} +15 -10
- package/dist/cli/{worktree-isolation-wcry8qnn.js → worktree-isolation-jjkfg2pg.js} +30 -30
- package/dist/commands/lanes.d.ts +25 -0
- package/dist/commands/registry.d.ts +1 -1
- package/dist/commands/reset-session.d.ts +8 -2
- package/dist/consensus/corpus.d.ts +16 -0
- package/dist/hooks/delegation-gate/worktree-isolation.d.ts +50 -3
- package/dist/hooks/delegation-gate/worktree-provisioning-owner.d.ts +40 -2
- package/dist/hooks/delegation-gate/worktree-recovery-authority.d.ts +201 -0
- package/dist/hooks/init-orphan-recovery.d.ts +5 -1
- package/dist/hooks/knowledge-application-gate.d.ts +10 -1
- package/dist/hooks/knowledge-receipt-ledger.d.ts +1 -1
- package/dist/hooks/trajectory-logger.d.ts +22 -6
- package/dist/hooks/trajectory-step-state.d.ts +43 -2
- package/dist/index.js +557 -552
- package/dist/observability/catalog.d.ts +6 -4
- package/dist/prm/index.d.ts +3 -3
- package/dist/prm/replay.d.ts +29 -2
- package/dist/prm/trajectory-store.d.ts +210 -20
- package/dist/state.d.ts +6 -4
- package/dist/telemetry.d.ts +21 -1
- package/dist/utils/atomic-write.d.ts +2 -0
- package/dist/utils/canonical-root.d.ts +31 -0
- package/dist/workflow/coder-settlement.d.ts +2 -0
- package/dist/worktree/index.d.ts +2 -2
- package/dist/worktree/merge.d.ts +47 -0
- package/package.json +8 -1
- package/dist/cli/index-fxvgaeq4.js +0 -125
- package/dist/cli/worktree-provisioning-owner-cve95q4f.js +0 -22
- package/dist/cli/{curator-drift-2h1d2fnq.js → curator-drift-h57z6tm3.js} +1 -1
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
validateSwarmPath
|
|
4
|
-
} from "./index-4cgee5vh.js";
|
|
5
|
-
|
|
6
|
-
// src/hooks/delegation-gate/worktree-provisioning-owner.ts
|
|
7
|
-
import { createHash, randomBytes } from "crypto";
|
|
8
|
-
import * as fs from "fs";
|
|
9
|
-
import * as path from "path";
|
|
10
|
-
var PROVISIONING_OWNER_DIR = "worktree-provisioning-owners";
|
|
11
|
-
var MAX_PROVISIONING_OWNERS = 512;
|
|
12
|
-
var MAX_PROVISIONING_OWNER_BYTES = 16 * 1024;
|
|
13
|
-
var WORKTREE_PROVISIONING_OWNER_LEASE_MS = 5 * 60 * 1000;
|
|
14
|
-
var WORKTREE_LIFECYCLE_LOCK_FILE = ".swarm/locks/init-orphan-recovery.lock";
|
|
15
|
-
function ownerDirectory(directory) {
|
|
16
|
-
return path.dirname(validateSwarmPath(directory, path.join(PROVISIONING_OWNER_DIR, ".containment-anchor")));
|
|
17
|
-
}
|
|
18
|
-
function ownerPath(directory, callID) {
|
|
19
|
-
const digest = createHash("sha256").update(callID).digest("hex");
|
|
20
|
-
return validateSwarmPath(directory, path.join(PROVISIONING_OWNER_DIR, `${digest}.json`));
|
|
21
|
-
}
|
|
22
|
-
function isOwner(value) {
|
|
23
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
24
|
-
return false;
|
|
25
|
-
const candidate = value;
|
|
26
|
-
const schemaVersion = candidate.schemaVersion;
|
|
27
|
-
const validTaskIdentity = schemaVersion === 1 ? candidate.taskId === undefined : schemaVersion === 2 && typeof candidate.taskId === "string" && candidate.taskId.length > 0 && candidate.taskId.length <= 512;
|
|
28
|
-
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;
|
|
29
|
-
}
|
|
30
|
-
function recordWorktreeProvisioningOwner(directory, input) {
|
|
31
|
-
const owner = {
|
|
32
|
-
schemaVersion: input.taskId ? 2 : 1,
|
|
33
|
-
callID: input.callID,
|
|
34
|
-
parentSessionId: input.parentSessionId,
|
|
35
|
-
worktreeSessionId: input.worktreeSessionId,
|
|
36
|
-
...input.taskId ? { taskId: input.taskId } : {},
|
|
37
|
-
createdAt: Date.now()
|
|
38
|
-
};
|
|
39
|
-
if (!isOwner(owner)) {
|
|
40
|
-
throw new Error("invalid worktree provisioning owner");
|
|
41
|
-
}
|
|
42
|
-
const absolutePath = ownerPath(directory, input.callID);
|
|
43
|
-
fs.mkdirSync(path.dirname(absolutePath), { recursive: true });
|
|
44
|
-
const tempPath = `${absolutePath}.tmp-${randomBytes(8).toString("hex")}`;
|
|
45
|
-
try {
|
|
46
|
-
fs.writeFileSync(tempPath, `${JSON.stringify(owner)}
|
|
47
|
-
`, {
|
|
48
|
-
encoding: "utf8",
|
|
49
|
-
flag: "wx"
|
|
50
|
-
});
|
|
51
|
-
fs.renameSync(tempPath, absolutePath);
|
|
52
|
-
} catch (error) {
|
|
53
|
-
try {
|
|
54
|
-
fs.unlinkSync(tempPath);
|
|
55
|
-
} catch {}
|
|
56
|
-
throw error;
|
|
57
|
-
}
|
|
58
|
-
return owner;
|
|
59
|
-
}
|
|
60
|
-
function removeWorktreeProvisioningOwner(directory, callID) {
|
|
61
|
-
try {
|
|
62
|
-
fs.unlinkSync(ownerPath(directory, callID));
|
|
63
|
-
return true;
|
|
64
|
-
} catch (error) {
|
|
65
|
-
return error.code === "ENOENT";
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function scanWorktreeProvisioningOwnersForRecovery(directory) {
|
|
69
|
-
let directoryPath;
|
|
70
|
-
let entries;
|
|
71
|
-
try {
|
|
72
|
-
directoryPath = ownerDirectory(directory);
|
|
73
|
-
entries = fs.readdirSync(directoryPath, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json"));
|
|
74
|
-
} catch (error) {
|
|
75
|
-
if (error.code === "ENOENT") {
|
|
76
|
-
return { status: "ok", owners: [] };
|
|
77
|
-
}
|
|
78
|
-
return {
|
|
79
|
-
status: "uncertain",
|
|
80
|
-
reason: `worktree provisioning-owner directory is unreadable: ${error instanceof Error ? error.message : String(error)}`
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
if (entries.length > MAX_PROVISIONING_OWNERS) {
|
|
84
|
-
return {
|
|
85
|
-
status: "uncertain",
|
|
86
|
-
reason: `worktree provisioning-owner count exceeds the ${MAX_PROVISIONING_OWNERS}-marker safety bound`
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
const owners = [];
|
|
90
|
-
for (const entry of entries) {
|
|
91
|
-
const absolutePath = path.join(directoryPath, entry.name);
|
|
92
|
-
try {
|
|
93
|
-
const stat = fs.statSync(absolutePath);
|
|
94
|
-
if (stat.size > MAX_PROVISIONING_OWNER_BYTES) {
|
|
95
|
-
return {
|
|
96
|
-
status: "uncertain",
|
|
97
|
-
reason: `worktree provisioning owner "${entry.name}" exceeds the recovery size bound`
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
const raw = fs.readFileSync(absolutePath, "utf8");
|
|
101
|
-
if (Buffer.byteLength(raw, "utf8") > MAX_PROVISIONING_OWNER_BYTES) {
|
|
102
|
-
return {
|
|
103
|
-
status: "uncertain",
|
|
104
|
-
reason: `worktree provisioning owner "${entry.name}" changed beyond the recovery size bound`
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
const parsed = JSON.parse(raw);
|
|
108
|
-
if (!isOwner(parsed)) {
|
|
109
|
-
return {
|
|
110
|
-
status: "uncertain",
|
|
111
|
-
reason: `worktree provisioning owner "${entry.name}" is invalid`
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
owners.push(parsed);
|
|
115
|
-
} catch (error) {
|
|
116
|
-
return {
|
|
117
|
-
status: "uncertain",
|
|
118
|
-
reason: `worktree provisioning owner "${entry.name}" is unreadable or malformed: ${error instanceof Error ? error.message : String(error)}`
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return { status: "ok", owners };
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export { WORKTREE_PROVISIONING_OWNER_LEASE_MS, WORKTREE_LIFECYCLE_LOCK_FILE, recordWorktreeProvisioningOwner, removeWorktreeProvisioningOwner, scanWorktreeProvisioningOwnersForRecovery };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
WORKTREE_LIFECYCLE_LOCK_FILE,
|
|
4
|
-
WORKTREE_PROVISIONING_OWNER_LEASE_MS,
|
|
5
|
-
recordWorktreeProvisioningOwner,
|
|
6
|
-
removeWorktreeProvisioningOwner,
|
|
7
|
-
scanWorktreeProvisioningOwnersForRecovery
|
|
8
|
-
} from "./index-fxvgaeq4.js";
|
|
9
|
-
import"./index-4cgee5vh.js";
|
|
10
|
-
import"./index-z6xqpmqg.js";
|
|
11
|
-
import"./index-r3mvsbtq.js";
|
|
12
|
-
import"./index-zjygnfay.js";
|
|
13
|
-
import"./index-ed5ykebp.js";
|
|
14
|
-
import"./index-zgwm4ryv.js";
|
|
15
|
-
import"./index-a76rekgs.js";
|
|
16
|
-
export {
|
|
17
|
-
scanWorktreeProvisioningOwnersForRecovery,
|
|
18
|
-
removeWorktreeProvisioningOwner,
|
|
19
|
-
recordWorktreeProvisioningOwner,
|
|
20
|
-
WORKTREE_PROVISIONING_OWNER_LEASE_MS,
|
|
21
|
-
WORKTREE_LIFECYCLE_LOCK_FILE
|
|
22
|
-
};
|
|
@@ -14,10 +14,10 @@ import"./index-z6xqpmqg.js";
|
|
|
14
14
|
import"./index-r3mvsbtq.js";
|
|
15
15
|
import"./index-4rhhvd1a.js";
|
|
16
16
|
import"./index-zjygnfay.js";
|
|
17
|
-
import"./index-bpmtbmy9.js";
|
|
18
17
|
import {
|
|
19
18
|
invalidateCachedArtifact
|
|
20
19
|
} from "./index-ed5ykebp.js";
|
|
20
|
+
import"./index-bpmtbmy9.js";
|
|
21
21
|
import {
|
|
22
22
|
init_logger,
|
|
23
23
|
warn
|