opencode-swarm 7.152.1 → 7.153.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.
Files changed (121) hide show
  1. package/.opencode/skills/swarm-pr-review/SKILL.md +10 -10
  2. package/dist/background/pending-delegations.d.ts +7 -0
  3. package/dist/cli/{capability-probe-va4kk8vg.js → capability-probe-5wa7mcp6.js} +3 -2
  4. package/dist/cli/{config-doctor-bbqmye7a.js → config-doctor-ze21qs6b.js} +3 -3
  5. package/dist/cli/{core-fh4e6ex0.js → core-qdmhh1kx.js} +2 -2
  6. package/dist/cli/{curation-policy-nem98yc9.js → curation-policy-twa6agf8.js} +7 -7
  7. package/dist/cli/{curator-909s9dvs.js → curator-hxb3wsxr.js} +32 -33
  8. package/dist/cli/curator-llm-factory-s8atmc2n.js +64 -0
  9. package/dist/cli/{evidence-summary-service-kqw4y0yr.js → evidence-summary-service-wzzym9r7.js} +15 -15
  10. package/dist/cli/{gate-evidence-ycts62pj.js → gate-evidence-f71dn9vv.js} +8 -8
  11. package/dist/cli/guardrail-explain-5kzeem4m.js +65 -0
  12. package/dist/cli/{guardrail-log-e1tmdxxa.js → guardrail-log-38jnajpa.js} +6 -6
  13. package/dist/cli/{guardrail-reset-gdnaxxvb.js → guardrail-reset-wzvtmpn2.js} +32 -33
  14. package/dist/cli/{hive-promoter-d0xydg6r.js → hive-promoter-55qcqgfx.js} +32 -33
  15. package/dist/cli/{index-x6803sxh.js → index-0tyc8kdg.js} +2 -2
  16. package/dist/cli/{index-z8s2asdk.js → index-0tzv5zg2.js} +22 -150
  17. package/dist/cli/{index-3djxegsc.js → index-1akn19mp.js} +1 -1
  18. package/dist/cli/{index-q77e475x.js → index-1dtshrzg.js} +5 -5
  19. package/dist/cli/{index-73pmnsjg.js → index-1gzdnjg9.js} +2 -2
  20. package/dist/cli/{index-4tvvh7pn.js → index-23rneydq.js} +36 -35
  21. package/dist/cli/{index-z4bg1hv8.js → index-2mqmvxac.js} +9 -2
  22. package/dist/cli/index-3cegckkq.js +239 -0
  23. package/dist/cli/{index-pvrap7xg.js → index-3ttktt56.js} +1 -1
  24. package/dist/cli/{index-85gkedsf.js → index-4fwbbad3.js} +521 -15
  25. package/dist/cli/{index-qqrdmaxq.js → index-4g0g3dqz.js} +2 -2
  26. package/dist/cli/{index-44xdtqz8.js → index-4pjkdcgc.js} +1 -1
  27. package/dist/cli/{index-29vd7v3e.js → index-6vgb5fyb.js} +1 -1
  28. package/dist/cli/{index-sg2sx2q7.js → index-6ybjrqf7.js} +13095 -9360
  29. package/dist/cli/{index-txbd25bc.js → index-891g7hbf.js} +1 -1
  30. package/dist/cli/{index-02ajc6d1.js → index-8v9sj4aq.js} +2 -2
  31. package/dist/cli/{index-z9fyd0d6.js → index-9v8d3c0k.js} +450 -48
  32. package/dist/cli/{index-26vyr198.js → index-af0cqe6n.js} +16 -16
  33. package/dist/cli/{index-ryecg2st.js → index-ajkxx2k6.js} +3 -3
  34. package/dist/cli/{index-k3d919yf.js → index-gn26q90p.js} +85 -24
  35. package/dist/cli/{index-0tfgn5x0.js → index-k10qtq71.js} +9 -9
  36. package/dist/cli/{index-xyfdmrv7.js → index-mb7b1gye.js} +3 -3
  37. package/dist/cli/{index-0q2mjxp2.js → index-meg33yyv.js} +1 -1
  38. package/dist/cli/{index-cpg98bh1.js → index-myt57pht.js} +1 -1
  39. package/dist/cli/{index-2e1294d1.js → index-n5pxkera.js} +16 -10
  40. package/dist/cli/{index-n0vc5b5t.js → index-n823qsae.js} +16 -7
  41. package/dist/cli/{index-6zkm4p7p.js → index-pk1gbqmq.js} +1 -1
  42. package/dist/cli/{index-nd8tkb3g.js → index-smqsp8hs.js} +5 -5
  43. package/dist/cli/{index-7fh82sm1.js → index-td0jz8xe.js} +6 -6
  44. package/dist/cli/{index-dn6yt0xg.js → index-tdzbm974.js} +7 -7
  45. package/dist/cli/{index-rq6aetkv.js → index-v689bmr2.js} +4 -4
  46. package/dist/cli/{index-79g6edht.js → index-x3y6zhgj.js} +1 -1
  47. package/dist/cli/{index-aw492hpn.js → index-x8vw6ap1.js} +58 -41
  48. package/dist/cli/{index-96m8ckpq.js → index-xkjrg9k4.js} +4 -4
  49. package/dist/cli/{index-mken64yj.js → index-zppxpc3y.js} +2 -2
  50. package/dist/cli/index.js +32 -33
  51. package/dist/cli/{knowledge-escalator-4egcr928.js → knowledge-escalator-w05ztgvk.js} +13 -13
  52. package/dist/cli/{knowledge-events-kdyv4jzn.js → knowledge-events-pwm9jc0m.js} +11 -11
  53. package/dist/cli/{knowledge-link-h8cwj7af.js → knowledge-link-ge0rddxw.js} +6 -6
  54. package/dist/cli/{knowledge-store-dq3cvg53.js → knowledge-store-4xv65tj2.js} +7 -7
  55. package/dist/cli/{knowledge-validator-4bhtden9.js → knowledge-validator-0ttfsca7.js} +9 -9
  56. package/dist/cli/{model-preflight-7ea00h34.js → model-preflight-b95w8wxy.js} +1 -1
  57. package/dist/cli/{pending-delegations-a2nmssr1.js → pending-delegations-nk78wx7h.js} +4 -4
  58. package/dist/cli/{pr-subscriptions-7879nq5k.js → pr-subscriptions-dq1f61ye.js} +4 -4
  59. package/dist/cli/{runner-w81n9js3.js → runner-n50w1y4w.js} +7 -7
  60. package/dist/cli/{scan-cursor-2eezv81a.js → scan-cursor-b6n15w8d.js} +8 -8
  61. package/dist/cli/{schema-v4qcqhek.js → schema-jkbfwqr2.js} +2 -2
  62. package/dist/cli/{scope-persistence-y2r227r0.js → scope-persistence-5xt2m5ep.js} +10 -10
  63. package/dist/cli/{skill-generator-hhzxvb3h.js → skill-generator-3keadpf7.js} +15 -15
  64. package/dist/cli/{telemetry-52pw5xac.js → telemetry-hh1j99za.js} +1 -1
  65. package/dist/cli/{worktree-collision-ownership-p31zm5k0.js → worktree-collision-ownership-4drcjymy.js} +15 -10
  66. package/dist/cli/{worktree-isolation-ve338ez6.js → worktree-isolation-1ymaxn4h.js} +32 -33
  67. package/dist/commands/approve-write.d.ts +1 -0
  68. package/dist/commands/index.d.ts +1 -0
  69. package/dist/commands/lanes.d.ts +25 -0
  70. package/dist/commands/registry.d.ts +7 -0
  71. package/dist/config/schema.d.ts +39 -4
  72. package/dist/consensus/contracts.d.ts +14 -0
  73. package/dist/consensus/corpus.d.ts +16 -0
  74. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +50 -3
  75. package/dist/hooks/delegation-gate/worktree-provisioning-owner.d.ts +40 -2
  76. package/dist/hooks/delegation-gate/worktree-recovery-authority.d.ts +201 -0
  77. package/dist/hooks/full-auto-permission.d.ts +7 -0
  78. package/dist/hooks/guardrails/index.d.ts +2 -1
  79. package/dist/hooks/guardrails/tool-before.d.ts +4 -0
  80. package/dist/hooks/init-orphan-recovery.d.ts +5 -1
  81. package/dist/hooks/pr-workflow-gate.d.ts +12 -0
  82. package/dist/hooks/scope-guard.d.ts +1 -3
  83. package/dist/hooks/trajectory-logger.d.ts +22 -6
  84. package/dist/hooks/trajectory-step-state.d.ts +43 -2
  85. package/dist/index.js +645 -622
  86. package/dist/learning/provenance.d.ts +9 -0
  87. package/dist/observability/catalog.d.ts +6 -4
  88. package/dist/prm/index.d.ts +3 -3
  89. package/dist/prm/replay.d.ts +29 -2
  90. package/dist/prm/trajectory-store.d.ts +210 -20
  91. package/dist/sandbox/capability-probe.d.ts +40 -1
  92. package/dist/sandbox/executor.d.ts +26 -1
  93. package/dist/sandbox/linux/bubblewrap-executor.d.ts +3 -1
  94. package/dist/sandbox/macos/sandbox-exec-executor.d.ts +3 -1
  95. package/dist/sandbox/skip-state.d.ts +24 -0
  96. package/dist/sandbox/win32/native-sandbox-executor.d.ts +5 -1
  97. package/dist/security/command-classifier.d.ts +22 -0
  98. package/dist/security/protected-input-integrity.d.ts +19 -0
  99. package/dist/security/protected-path-policy.d.ts +9 -0
  100. package/dist/security/write-authority.d.ts +46 -0
  101. package/dist/services/diagnose-service.d.ts +1 -1
  102. package/dist/services/skill-generator.d.ts +2 -0
  103. package/dist/services/skill-improver.d.ts +69 -0
  104. package/dist/telemetry.d.ts +21 -1
  105. package/dist/tools/dispatch-lanes.d.ts +47 -0
  106. package/dist/tools/repo-graph/query.d.ts +2 -1
  107. package/dist/tools/repo-graph/types.d.ts +64 -0
  108. package/dist/tools/repo-graph.d.ts +1 -1
  109. package/dist/tools/skill-improve.d.ts +7 -0
  110. package/dist/utils/atomic-write.d.ts +2 -0
  111. package/dist/utils/canonical-root.d.ts +31 -0
  112. package/dist/workflow/coder-settlement.d.ts +2 -0
  113. package/dist/worktree/index.d.ts +2 -2
  114. package/dist/worktree/merge.d.ts +47 -0
  115. package/package.json +2 -1
  116. package/dist/cli/curator-llm-factory-462rysph.js +0 -65
  117. package/dist/cli/guardrail-explain-7620hasq.js +0 -66
  118. package/dist/cli/index-3g0xk6tk.js +0 -219
  119. package/dist/cli/index-fxvgaeq4.js +0 -125
  120. package/dist/cli/worktree-provisioning-owner-cve95q4f.js +0 -22
  121. package/dist/cli/{curator-drift-2h1d2fnq.js → curator-drift-h57z6tm3.js} +1 -1
@@ -1,66 +0,0 @@
1
- // @bun
2
- import {
3
- handleGuardrailExplain
4
- } from "./index-z8s2asdk.js";
5
- import"./index-sg2sx2q7.js";
6
- import"./index-44xdtqz8.js";
7
- import"./index-k3d919yf.js";
8
- import"./index-x6803sxh.js";
9
- import"./index-26vyr198.js";
10
- import"./index-73pmnsjg.js";
11
- import"./index-134d35c1.js";
12
- import"./index-nj6rmyeh.js";
13
- import"./index-y8552snf.js";
14
- import"./index-nd8tkb3g.js";
15
- import"./index-02ajc6d1.js";
16
- import"./index-70ha9e09.js";
17
- import"./index-c8s9a3zh.js";
18
- import"./index-9ss2m4rs.js";
19
- import"./index-vnn7qq8c.js";
20
- import"./index-0q2mjxp2.js";
21
- import"./index-2e1294d1.js";
22
- import"./index-rq6aetkv.js";
23
- import"./index-pvrap7xg.js";
24
- import"./index-rtry5xyf.js";
25
- import"./index-zsrtt42s.js";
26
- import"./index-z4bg1hv8.js";
27
- import"./index-fxvgaeq4.js";
28
- import"./index-z9fyd0d6.js";
29
- import"./index-qqrdmaxq.js";
30
- import"./index-q77e475x.js";
31
- import"./index-xyfdmrv7.js";
32
- import"./index-6zkm4p7p.js";
33
- import"./index-556ja8an.js";
34
- import"./index-b43rt5ph.js";
35
- import"./index-q7sjgr1y.js";
36
- import"./index-3g0xk6tk.js";
37
- import"./index-85gkedsf.js";
38
- import"./index-0tfgn5x0.js";
39
- import"./index-dn6yt0xg.js";
40
- import"./index-ryecg2st.js";
41
- import"./index-gprxjmm7.js";
42
- import"./index-n832052r.js";
43
- import"./index-4cgee5vh.js";
44
- import"./index-z6xqpmqg.js";
45
- import"./index-r3mvsbtq.js";
46
- import"./index-3djxegsc.js";
47
- import"./index-n0vc5b5t.js";
48
- import"./index-cpg98bh1.js";
49
- import"./index-9e6fdz2h.js";
50
- import"./index-4rhhvd1a.js";
51
- import"./index-zjygnfay.js";
52
- import"./index-ae75rja9.js";
53
- import"./index-79g6edht.js";
54
- import"./index-mken64yj.js";
55
- import"./index-bk5tah7q.js";
56
- import"./index-7fh82sm1.js";
57
- import"./index-txbd25bc.js";
58
- import"./index-aw492hpn.js";
59
- import"./index-7g4c7s5r.js";
60
- import"./index-bpmtbmy9.js";
61
- import"./index-ed5ykebp.js";
62
- import"./index-zgwm4ryv.js";
63
- import"./index-a76rekgs.js";
64
- export {
65
- handleGuardrailExplain
66
- };
@@ -1,219 +0,0 @@
1
- // @bun
2
- import {
3
- _internals,
4
- _internals1 as _internals2,
5
- exports_runner_client,
6
- init_bubblewrap_executor,
7
- init_runner_client,
8
- init_sandbox_exec_executor
9
- } from "./index-85gkedsf.js";
10
- import {
11
- __esm,
12
- __toCommonJS
13
- } from "./index-a76rekgs.js";
14
-
15
- // src/sandbox/capability-probe.ts
16
- import { execFile, spawnSync } from "child_process";
17
- import * as os from "os";
18
- function _resetCapabilityCache() {
19
- _cached = undefined;
20
- }
21
- function withProbeTimeout(cmd, args, ms) {
22
- return new Promise((resolve, reject) => {
23
- const controller = new AbortController;
24
- const timer = setTimeout(() => {
25
- controller.abort();
26
- proc?.kill();
27
- }, ms);
28
- const unref = timer.unref;
29
- if (typeof unref === "function") {
30
- unref.call(timer);
31
- }
32
- let proc;
33
- try {
34
- proc = execFile(cmd, args, {
35
- signal: controller.signal,
36
- timeout: ms,
37
- windowsHide: true,
38
- cwd: os.tmpdir()
39
- }, (error, stdout, _stderr) => {
40
- clearTimeout(timer);
41
- if (error) {
42
- const exc = error;
43
- if (exc.code === "ENOENT" || exc.code === "ENOTFOUND") {
44
- reject(new Error("binary not found"));
45
- } else {
46
- reject(error);
47
- }
48
- return;
49
- }
50
- resolve(stdout?.trim() ?? "");
51
- });
52
- } catch (spawnError) {
53
- clearTimeout(timer);
54
- reject(spawnError);
55
- }
56
- });
57
- }
58
- async function probeLinux() {
59
- try {
60
- const binary = _internals.resolveBwrapBinary();
61
- const output = await _internals3.withProbeTimeout(binary, ["--version"], 2000);
62
- if (output.length > 0) {
63
- return {
64
- status: "enabled",
65
- strength: "strong",
66
- mechanism: "Bubblewrap",
67
- platform: "linux"
68
- };
69
- }
70
- return {
71
- status: "disabled",
72
- mechanism: "Bubblewrap",
73
- platform: "linux",
74
- error: "binary returned empty version"
75
- };
76
- } catch (err) {
77
- const msg = err instanceof Error ? err.message : String(err);
78
- if (msg === "binary not found") {
79
- return {
80
- status: "unsupported",
81
- mechanism: "Bubblewrap",
82
- platform: "linux",
83
- error: msg
84
- };
85
- }
86
- return {
87
- status: "disabled",
88
- mechanism: "Bubblewrap",
89
- platform: "linux",
90
- error: msg
91
- };
92
- }
93
- }
94
- async function probeMacOS() {
95
- try {
96
- const binary = _internals2.resolveSandboxExecBinary();
97
- const target = _internals2.resolveProbeTargetBinary();
98
- const profile = _internals2.buildProbeProfile(os.tmpdir());
99
- await _internals3.withProbeTimeout(binary, ["-p", profile, target], 2000);
100
- return {
101
- status: "enabled",
102
- strength: "strong",
103
- mechanism: "sandbox-exec",
104
- platform: "darwin"
105
- };
106
- } catch (err) {
107
- const msg = err instanceof Error ? err.message : String(err);
108
- if (msg === "binary not found") {
109
- return {
110
- status: "unsupported",
111
- mechanism: "sandbox-exec",
112
- platform: "darwin",
113
- error: msg
114
- };
115
- }
116
- return {
117
- status: "disabled",
118
- mechanism: "sandbox-exec",
119
- platform: "darwin",
120
- error: msg
121
- };
122
- }
123
- }
124
- function probeWindows() {
125
- try {
126
- const { probe: runnerProbe } = (init_runner_client(), __toCommonJS(exports_runner_client));
127
- const result = runnerProbe();
128
- if (result.available) {
129
- return {
130
- status: "enabled",
131
- strength: "strong",
132
- platform: "win32",
133
- mechanism: `native-runner/${result.mode}`
134
- };
135
- }
136
- } catch {}
137
- try {
138
- const result = spawnSync("cmd", ["/c", "echo", "ok"], {
139
- windowsHide: true,
140
- encoding: "utf-8",
141
- timeout: 5000,
142
- stdio: ["ignore", "pipe", "ignore"]
143
- });
144
- if (result.error) {
145
- return {
146
- status: "disabled",
147
- platform: "win32",
148
- mechanism: "PowerShell wrapper",
149
- error: `cmd.exe probe failed: ${result.error.code}`
150
- };
151
- }
152
- return result.status === 0 ? {
153
- status: "enabled",
154
- strength: "advisory",
155
- platform: "win32",
156
- mechanism: "PowerShell wrapper"
157
- } : {
158
- status: "disabled",
159
- platform: "win32",
160
- mechanism: "PowerShell wrapper",
161
- error: "cmd.exe probe returned non-zero"
162
- };
163
- } catch (err) {
164
- return {
165
- status: "disabled",
166
- platform: "win32",
167
- mechanism: "PowerShell wrapper",
168
- error: String(err)
169
- };
170
- }
171
- }
172
- function isBubblewrapAvailable() {
173
- return _cached?.status === "enabled" && _cached?.platform === "linux";
174
- }
175
- function isSandboxExecAvailable() {
176
- return _cached?.status === "enabled" && _cached?.platform === "darwin";
177
- }
178
- function isWindowsSandboxAvailable() {
179
- return _cached?.status === "enabled" && _cached?.platform === "win32";
180
- }
181
-
182
- class SandboxCapabilityProbe {
183
- async detect() {
184
- if (_cached !== undefined) {
185
- return _cached;
186
- }
187
- const platform = process.platform;
188
- switch (platform) {
189
- case "linux":
190
- _cached = await probeLinux();
191
- break;
192
- case "darwin":
193
- _cached = await probeMacOS();
194
- break;
195
- case "win32":
196
- _cached = probeWindows();
197
- break;
198
- default: {
199
- _cached = {
200
- status: "unsupported",
201
- mechanism: "unknown",
202
- platform,
203
- error: `unsupported platform: ${platform}`
204
- };
205
- }
206
- }
207
- return _cached;
208
- }
209
- }
210
- var _cached, _internals3;
211
- var init_capability_probe = __esm(() => {
212
- init_bubblewrap_executor();
213
- init_sandbox_exec_executor();
214
- _internals3 = {
215
- withProbeTimeout
216
- };
217
- });
218
-
219
- export { _resetCapabilityCache, _internals3 as _internals, isBubblewrapAvailable, isSandboxExecAvailable, isWindowsSandboxAvailable, SandboxCapabilityProbe, init_capability_probe };
@@ -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