opencode-swarm 7.184.0 → 7.184.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/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/background/delegation-health.d.ts +1 -1
- package/dist/background/index.d.ts +1 -0
- package/dist/background/pr-event-delivery.d.ts +29 -14
- package/dist/background/pr-event-subscribers.d.ts +6 -5
- package/dist/background/pr-feedback-event-queue.d.ts +19 -2
- package/dist/background/pr-feedback-loop-runtime.d.ts +75 -0
- package/dist/background/pr-feedback-loop.d.ts +47 -12
- package/dist/cli/{coder-settlement-vrc5zxvv.js → coder-settlement-vqh4b7fb.js} +15 -12
- package/dist/cli/{config-doctor-y0bpap07.js → config-doctor-8fp6s15v.js} +2 -2
- package/dist/cli/{core-7f955h2f.js → core-75bsfgse.js} +4 -4
- package/dist/cli/{curation-policy-fa2h82c4.js → curation-policy-49f8jx48.js} +7 -6
- package/dist/cli/{curator-drift-48x02n2m.js → curator-drift-pmcpywr0.js} +9 -9
- package/dist/cli/{curator-m7enwwz2.js → curator-gwqs85sp.js} +40 -39
- package/dist/cli/curator-llm-factory-g6hb1vvw.js +75 -0
- package/dist/cli/{dispatch-p5zjg5e6.js → dispatch-cv89p2y1.js} +1 -1
- package/dist/cli/{evidence-summary-service-k8a5vkfk.js → evidence-summary-service-rm0tp8d1.js} +21 -20
- package/dist/cli/{gate-evidence-nktrs0w2.js → gate-evidence-ra0trg97.js} +14 -7
- package/dist/cli/guardrail-explain-kghhhjky.js +76 -0
- package/dist/cli/{guardrail-log-dppv6tgn.js → guardrail-log-r72971jr.js} +8 -8
- package/dist/cli/{guardrail-reset-btzq4ses.js → guardrail-reset-1kq1m70y.js} +40 -39
- package/dist/cli/{hive-promoter-yp1baj9z.js → hive-promoter-82ygdw79.js} +40 -39
- package/dist/cli/{index-6h81yvyc.js → index-131ay7x1.js} +3 -3
- package/dist/cli/{index-rwfmx7vn.js → index-1v13c6r0.js} +2 -2
- package/dist/cli/{index-ad3yskxy.js → index-279xp2be.js} +158 -27
- package/dist/cli/{index-9yvjwfay.js → index-2wn8ww1e.js} +3156 -1887
- package/dist/cli/{index-0bpr8vag.js → index-3n5zsp31.js} +2 -2
- package/dist/cli/{index-w81jmdkt.js → index-456awy1p.js} +2 -2
- package/dist/cli/{index-74x26wyj.js → index-475bkab8.js} +2 -2
- package/dist/cli/{index-nvm6mxep.js → index-5r5s0dbb.js} +271 -80
- package/dist/cli/{index-r30xs0wp.js → index-6ayk7a3q.js} +1 -1
- package/dist/cli/{index-4t0wd9sv.js → index-6g664sy8.js} +1 -1
- package/dist/cli/{index-me39468k.js → index-8chh1c96.js} +38 -18
- package/dist/cli/{index-079xzcxb.js → index-ahe4mn8t.js} +40 -39
- package/dist/cli/{index-3fhg7pqf.js → index-amhr3swp.js} +2 -2
- package/dist/cli/{index-e90m050y.js → index-ar2gsn6b.js} +8 -8
- package/dist/cli/{index-51xtrf7g.js → index-b0qyb790.js} +39 -15
- package/dist/cli/{index-edrgc139.js → index-bga7w4rt.js} +2 -2
- package/dist/cli/{index-t1swv35d.js → index-dm2ydm2b.js} +1 -1
- package/dist/cli/{index-v3hpsxvd.js → index-earq3mda.js} +1 -1
- package/dist/cli/{index-3rb5gs4w.js → index-f0nj3d8z.js} +1 -1
- package/dist/cli/{index-152b9c6m.js → index-hkqd9jz6.js} +5 -5
- package/dist/cli/{index-ysr6n4ca.js → index-j2xcdbfd.js} +1 -1
- package/dist/cli/{index-t26gj2fh.js → index-jct9kb50.js} +2 -2
- package/dist/cli/{index-mn5zzmqx.js → index-jvk95e6y.js} +2 -2
- package/dist/cli/{index-b5mkznms.js → index-k1cxfede.js} +1 -1
- package/dist/cli/{index-5cve9g2b.js → index-k53a69vb.js} +6 -6
- package/dist/cli/{index-1xnse449.js → index-mc72pk74.js} +1 -1
- package/dist/cli/{index-nm8ma9xb.js → index-peg6sftq.js} +8 -8
- package/dist/cli/{index-fs9y88h1.js → index-q5115jpe.js} +3 -3
- package/dist/cli/{index-4gr9pj67.js → index-rp6sfpwp.js} +4 -4
- package/dist/cli/{index-pq6vr26z.js → index-rpsmx4ke.js} +3 -3
- package/dist/cli/{index-z3b157ew.js → index-rr1m7cc6.js} +12 -10
- package/dist/cli/{index-bf1726rj.js → index-stcacf0k.js} +42 -41
- package/dist/cli/{index-01wt209s.js → index-t7hmqgjy.js} +90 -141
- package/dist/cli/{index-5wk0etp8.js → index-w6agyrzs.js} +4 -4
- package/dist/cli/{index-08x7gsnf.js → index-w9hxzcz4.js} +2 -2
- package/dist/cli/{index-nmh0s6dg.js → index-wy3zpwjy.js} +1 -1
- package/dist/cli/{index-fbhtb6f5.js → index-x1gyqgze.js} +7 -7
- package/dist/cli/{index-6b4vkz6q.js → index-x9wpvhpk.js} +1 -1
- package/dist/cli/index-xf69xty9.js +105 -0
- package/dist/cli/{index-46z4c89b.js → index-xka1cq9k.js} +4 -4
- package/dist/cli/{index-z8smhv7k.js → index-ya32wfkp.js} +4 -2
- package/dist/cli/{index-njf5pbkm.js → index-zmgs43tw.js} +6 -6
- package/dist/cli/{index-qyx53xrz.js → index-zq40mkha.js} +7 -7
- package/dist/cli/{index-j40czc9v.js → index-zvbn85q0.js} +5 -5
- package/dist/cli/{index-1d6ssjcj.js → index-zzvxj02e.js} +3 -3
- package/dist/cli/index.js +41 -40
- package/dist/cli/{knowledge-escalator-4296y1h2.js → knowledge-escalator-x0159cv7.js} +14 -13
- package/dist/cli/{knowledge-events-31nga9yt.js → knowledge-events-4879bjbz.js} +12 -11
- package/dist/cli/{knowledge-link-ydpvzam8.js → knowledge-link-ap2274vm.js} +6 -5
- package/dist/cli/{knowledge-store-0qz3zmq3.js → knowledge-store-zvstn7dy.js} +7 -6
- package/dist/cli/{knowledge-validator-vndnwdj6.js → knowledge-validator-k0q00zsj.js} +9 -8
- package/dist/cli/{mcp-taace90a.js → mcp-tmr9kgrr.js} +15 -1
- package/dist/cli/mcp.d.ts +1 -0
- package/dist/cli/{model-preflight-bv8nvjjx.js → model-preflight-17y17gys.js} +40 -39
- package/dist/cli/{pending-delegations-kwdk8j9d.js → pending-delegations-jzr2w62w.js} +13 -12
- package/dist/cli/{pr-subscriptions-w2fwdpkk.js → pr-subscriptions-t867sq1q.js} +13 -12
- package/dist/cli/{pr-workflow-gate-sqjc6jmd.js → pr-workflow-gate-npgdhk7j.js} +40 -39
- package/dist/cli/{runner-r6gxq7m1.js → runner-yz3ysehf.js} +7 -6
- package/dist/cli/{scan-cursor-f74b9b4k.js → scan-cursor-5zy5h556.js} +8 -7
- package/dist/cli/{schema-cyet68tw.js → schema-80nb4z6k.js} +1 -1
- package/dist/cli/{scope-persistence-rg8v0r8q.js → scope-persistence-t2888gjf.js} +16 -15
- package/dist/cli/{server-765s4stz.js → server-41f41q15.js} +40 -39
- package/dist/cli/{skill-generator-qg5m18k7.js → skill-generator-6kj1xzk8.js} +16 -15
- package/dist/cli/{snapshot-coordination-init-zzs4bkmj.js → snapshot-coordination-init-pbdzjv20.js} +40 -39
- package/dist/cli/{speckit-checkoff-2bsm6p0c.js → speckit-checkoff-4ppx68ks.js} +4 -4
- package/dist/cli/{telemetry-rzvcp2n9.js → telemetry-39zmx4fp.js} +2 -2
- package/dist/cli/{workspace-snapshot-t22m6gbd.js → workspace-snapshot-0q1n1xq5.js} +4 -4
- package/dist/cli/{worktree-collision-ownership-qf2shp2n.js → worktree-collision-ownership-hn1mgtta.js} +14 -13
- package/dist/cli/{worktree-isolation-0b0jy6dt.js → worktree-isolation-w4nq6yzp.js} +40 -39
- package/dist/db/qa-gate-session-override.d.ts +12 -12
- package/dist/gate-evidence.d.ts +43 -1
- package/dist/hooks/guardrails/index.d.ts +13 -7
- package/dist/index.js +507 -503
- package/dist/plan/ledger.d.ts +20 -4
- package/dist/plan/manager.d.ts +20 -2
- package/dist/session/hydration-ownership.d.ts +39 -12
- package/dist/session/snapshot-coordination-init.d.ts +11 -4
- package/dist/session/snapshot-reader.d.ts +9 -4
- package/dist/session/snapshot-writer.d.ts +2 -3
- package/dist/state.d.ts +35 -5
- package/dist/tools/phase-complete.d.ts +1 -0
- package/dist/tools/update-task-status.d.ts +1 -1
- package/dist/utils/project-boundary.d.ts +32 -1
- package/dist/workflow/coder-settlement.d.ts +8 -0
- package/dist/workflow/task-terminal.d.ts +2 -1
- package/dist/workflow/workflow-wal-schema.d.ts +2 -0
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-g6at4hn6.js +0 -74
- package/dist/cli/guardrail-explain-1ccchxdr.js +0 -75
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
atomicWriteFileAnyRoot,
|
|
7
7
|
atomicWriteSwarmFileSync
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-k53a69vb.js";
|
|
9
9
|
import {
|
|
10
10
|
init_loader,
|
|
11
11
|
loadPluginConfig
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-dm2ydm2b.js";
|
|
13
13
|
import {
|
|
14
14
|
init_logger,
|
|
15
15
|
log,
|
|
@@ -229,9 +229,9 @@ var SWARM_TEMP_GRAMMARS = [
|
|
|
229
229
|
"src/evidence/task-file.ts (pre-#2035; migrated-to=src/evidence/task-file.ts:atomicWriteFile)",
|
|
230
230
|
"src/scope/scope-persistence.ts (pre-#2035; migrated-to=src/scope/scope-persistence.ts:atomicWrite)",
|
|
231
231
|
"src/scope/scope-persistence.ts (pre-#2035; migrated-to=src/scope/scope-persistence.ts:atomicWriteSync)",
|
|
232
|
-
"src/plan/manager.ts:
|
|
233
|
-
"src/plan/manager.ts:
|
|
234
|
-
"src/plan/manager.ts:
|
|
232
|
+
"src/plan/manager.ts:683",
|
|
233
|
+
"src/plan/manager.ts:2110",
|
|
234
|
+
"src/plan/manager.ts:2170",
|
|
235
235
|
"src/review/evidence.ts:175",
|
|
236
236
|
"src/turbo/lean/evidence.ts:182",
|
|
237
237
|
"src/summaries/manager.ts:163",
|
|
@@ -250,7 +250,7 @@ var SWARM_TEMP_GRAMMARS = [
|
|
|
250
250
|
"src/tools/record-trace-validation.ts:134",
|
|
251
251
|
"src/tools/record-merge-approval.ts:87",
|
|
252
252
|
"src/turbo/lean/reviewer.ts:403",
|
|
253
|
-
"src/plan/ledger.ts:
|
|
253
|
+
"src/plan/ledger.ts:1471",
|
|
254
254
|
"src/services/synonym-map.ts:389",
|
|
255
255
|
"src/services/skill-optimizer/store.ts:340",
|
|
256
256
|
"src/services/skill-optimizer/store.ts:503",
|
|
@@ -364,7 +364,7 @@ var SWARM_TEMP_GRAMMARS = [
|
|
|
364
364
|
token: "instance",
|
|
365
365
|
quarantineEligible: true,
|
|
366
366
|
parsesTarget: true,
|
|
367
|
-
producers: ["src/plan/manager.ts:
|
|
367
|
+
producers: ["src/plan/manager.ts:2369", "src/plan/manager.ts:2431"],
|
|
368
368
|
note: "plan-durability (invariant 5) fd-write paths; grammars registered, writers unchanged in this PR"
|
|
369
369
|
},
|
|
370
370
|
{
|
|
@@ -431,7 +431,7 @@ var SWARM_TEMP_GRAMMARS = [
|
|
|
431
431
|
"src/hooks/skill-usage-pending.ts:817",
|
|
432
432
|
"src/parallel/file-locks.ts:113",
|
|
433
433
|
"src/plan/ledger.ts:607",
|
|
434
|
-
"src/plan/ledger.ts:
|
|
434
|
+
"src/plan/ledger.ts:1793"
|
|
435
435
|
],
|
|
436
436
|
note: "constant-name temps: reported when stale, never auto-quarantined. file-locks meta sidecars live under the scanner-skipped .swarm/locks/ subtree; the ledger reconcile temp embeds instance tokens but its .tmp-suffix shape maps here (conservatively report-only)"
|
|
437
437
|
}
|
|
@@ -78,4 +78,4 @@ function sessionKeySuffix(sessionId) {
|
|
|
78
78
|
return `${SESSION_KEY_SEPARATOR}${sessionId}`;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
export { _internals, lexicalRootAliasKey, canonicalRootKeyLexical, canonicalRootKeyFreshAsync, canonicalRootKey, canonicalRootKeyFresh, sameProjectRoot, compositeSessionKey, sessionKeySuffix };
|
|
81
|
+
export { SESSION_KEY_SEPARATOR, _internals, lexicalRootAliasKey, canonicalRootKeyLexical, canonicalRootKeyFreshAsync, canonicalRootKey, canonicalRootKeyFresh, sameProjectRoot, compositeSessionKey, sessionKeySuffix };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
validateSwarmPath
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-wy3zpwjy.js";
|
|
5
5
|
import {
|
|
6
6
|
bunWrite
|
|
7
7
|
} from "./index-2s7dvzff.js";
|
|
@@ -18,25 +18,25 @@ import {
|
|
|
18
18
|
releaseCoordinationLease,
|
|
19
19
|
transitionCoordinationState,
|
|
20
20
|
withCoordinationTransaction
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-f0nj3d8z.js";
|
|
22
22
|
import {
|
|
23
23
|
getProjectDb,
|
|
24
24
|
projectDbExists
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-w9hxzcz4.js";
|
|
26
26
|
import {
|
|
27
27
|
observeDelegationLedgerPressure
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-zzvxj02e.js";
|
|
29
29
|
import {
|
|
30
30
|
EvidenceLockTimeoutError,
|
|
31
31
|
withEvidenceLock
|
|
32
|
-
} from "./index-
|
|
32
|
+
} from "./index-xf69xty9.js";
|
|
33
33
|
import {
|
|
34
34
|
telemetry
|
|
35
|
-
} from "./index-
|
|
35
|
+
} from "./index-x1gyqgze.js";
|
|
36
36
|
import {
|
|
37
37
|
canonicalRootKeyFresh,
|
|
38
38
|
sameProjectRoot
|
|
39
|
-
} from "./index-
|
|
39
|
+
} from "./index-mc72pk74.js";
|
|
40
40
|
import {
|
|
41
41
|
exports_external,
|
|
42
42
|
init_zod
|
|
@@ -4669,7 +4669,7 @@ async function reconcileLegacyCoderSettlements(directory, maxRecords, onReconcil
|
|
|
4669
4669
|
const candidates = readDelegations(directory).filter((record) => record.normalizedAgent === "coder" && Boolean(record.legacyCoderSettlementTransfer) && Boolean(record.terminalResult)).slice(0, maxRecords);
|
|
4670
4670
|
if (candidates.length === 0)
|
|
4671
4671
|
return 0;
|
|
4672
|
-
const { transferCoderSettlementToBackground } = await import("./coder-settlement-
|
|
4672
|
+
const { transferCoderSettlementToBackground } = await import("./coder-settlement-vqh4b7fb.js");
|
|
4673
4673
|
let transferred = 0;
|
|
4674
4674
|
for (const record of candidates) {
|
|
4675
4675
|
try {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
_internals,
|
|
4
4
|
resolveWorktreeIsolationConfig
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-bga7w4rt.js";
|
|
6
6
|
import {
|
|
7
7
|
ApprovalEvidenceSchema,
|
|
8
8
|
BaseEvidenceSchema,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
loadPluginConfigWithMeta,
|
|
47
47
|
loadPluginConfigWithMetaAsync,
|
|
48
48
|
resetConfigAdvisoryDedup
|
|
49
|
-
} from "./index-
|
|
49
|
+
} from "./index-dm2ydm2b.js";
|
|
50
50
|
import"./index-zxdawwc7.js";
|
|
51
51
|
import {
|
|
52
52
|
AUTO_REVIEW_V8_BURN_IN_DECISION,
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
TurboConfigSchema,
|
|
73
73
|
WorktreeIsolationConfigSchema,
|
|
74
74
|
resolveAutoReviewConfig
|
|
75
|
-
} from "./index-
|
|
75
|
+
} from "./index-j2xcdbfd.js";
|
|
76
76
|
import {
|
|
77
77
|
ALL_AGENT_NAMES,
|
|
78
78
|
ALL_SUBAGENT_NAMES,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
validateSwarmPath
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-wy3zpwjy.js";
|
|
5
5
|
import {
|
|
6
6
|
bunSpawn
|
|
7
7
|
} from "./index-2s7dvzff.js";
|
|
8
8
|
import {
|
|
9
9
|
canonicalRootKeyFresh
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-mc72pk74.js";
|
|
11
11
|
import {
|
|
12
12
|
atomicWriteSwarmFileSync
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-k53a69vb.js";
|
|
14
14
|
import {
|
|
15
15
|
advisoryWarn,
|
|
16
16
|
init_git_executable,
|
|
@@ -242,7 +242,7 @@ var _internals2 = {
|
|
|
242
242
|
symlinkSync: fs2.symlinkSync
|
|
243
243
|
},
|
|
244
244
|
writeScopeToDisk: async (directory, taskId, files) => {
|
|
245
|
-
const { writeScopeToDisk: realWrite } = await import("./scope-persistence-
|
|
245
|
+
const { writeScopeToDisk: realWrite } = await import("./scope-persistence-t2888gjf.js");
|
|
246
246
|
return realWrite(directory, taskId, files);
|
|
247
247
|
},
|
|
248
248
|
writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
observeStoreHealth
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-zzvxj02e.js";
|
|
5
5
|
import {
|
|
6
6
|
telemetry
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-x1gyqgze.js";
|
|
8
8
|
import {
|
|
9
9
|
init_schema,
|
|
10
10
|
stripKnownSwarmPrefix
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-j2xcdbfd.js";
|
|
12
12
|
import {
|
|
13
13
|
init_constants
|
|
14
14
|
} from "./index-wzec3c4g.js";
|
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
validateSwarmPath
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-wy3zpwjy.js";
|
|
5
5
|
import {
|
|
6
6
|
observeReceiptTransition
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-zzvxj02e.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveHiveEventsPath
|
|
10
10
|
} from "./index-ae75rja9.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveKnowledgeStoreDir
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-475bkab8.js";
|
|
14
14
|
import {
|
|
15
|
-
assertProjectRoot,
|
|
16
15
|
atomicWriteFile
|
|
17
|
-
} from "./index-
|
|
16
|
+
} from "./index-xf69xty9.js";
|
|
17
|
+
import {
|
|
18
|
+
assertProjectRoot
|
|
19
|
+
} from "./index-t7hmqgjy.js";
|
|
18
20
|
import {
|
|
19
21
|
emit
|
|
20
|
-
} from "./index-
|
|
22
|
+
} from "./index-x1gyqgze.js";
|
|
21
23
|
import {
|
|
22
24
|
canonicalRootKey
|
|
23
|
-
} from "./index-
|
|
25
|
+
} from "./index-mc72pk74.js";
|
|
24
26
|
import {
|
|
25
27
|
require_proper_lockfile
|
|
26
28
|
} from "./index-7g4c7s5r.js";
|
|
27
29
|
import {
|
|
28
30
|
loadPluginConfigWithMeta
|
|
29
|
-
} from "./index-
|
|
31
|
+
} from "./index-dm2ydm2b.js";
|
|
30
32
|
import {
|
|
31
33
|
KnowledgeConfigSchema,
|
|
32
34
|
init_schema
|
|
33
|
-
} from "./index-
|
|
35
|
+
} from "./index-j2xcdbfd.js";
|
|
34
36
|
import {
|
|
35
37
|
init_logger,
|
|
36
38
|
warn
|
|
@@ -2944,7 +2946,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
|
|
|
2944
2946
|
}
|
|
2945
2947
|
let bumps = 0;
|
|
2946
2948
|
if (deltas.length > 0) {
|
|
2947
|
-
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-
|
|
2949
|
+
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-zvstn7dy.js");
|
|
2948
2950
|
bumps = await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
|
|
2949
2951
|
}
|
|
2950
2952
|
return {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailLog
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-k1cxfede.js";
|
|
5
5
|
import {
|
|
6
6
|
handleGuardrailExplain
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-1v13c6r0.js";
|
|
8
8
|
import {
|
|
9
9
|
COMMAND_REGISTRY,
|
|
10
10
|
DEFAULT_CI_DEADLINE_MS,
|
|
@@ -97,69 +97,70 @@ import {
|
|
|
97
97
|
handleWriteRetroCommand,
|
|
98
98
|
normalizeSwarmCommandInput,
|
|
99
99
|
resolveCommand
|
|
100
|
-
} from "./index-
|
|
101
|
-
import"./index-
|
|
100
|
+
} from "./index-2wn8ww1e.js";
|
|
101
|
+
import"./index-rpsmx4ke.js";
|
|
102
102
|
import"./index-hamqvzqn.js";
|
|
103
|
-
import"./index-
|
|
104
|
-
import"./index-
|
|
105
|
-
import"./index-
|
|
106
|
-
import"./index-
|
|
107
|
-
import"./index-
|
|
103
|
+
import"./index-6g664sy8.js";
|
|
104
|
+
import"./index-xka1cq9k.js";
|
|
105
|
+
import"./index-6ayk7a3q.js";
|
|
106
|
+
import"./index-5r5s0dbb.js";
|
|
107
|
+
import"./index-ya32wfkp.js";
|
|
108
108
|
import"./index-txdagbh7.js";
|
|
109
|
-
import"./index-
|
|
109
|
+
import"./index-x9wpvhpk.js";
|
|
110
110
|
import"./index-6b295cas.js";
|
|
111
|
-
import"./index-
|
|
112
|
-
import"./index-
|
|
113
|
-
import"./index-
|
|
111
|
+
import"./index-zvbn85q0.js";
|
|
112
|
+
import"./index-hkqd9jz6.js";
|
|
113
|
+
import"./index-amhr3swp.js";
|
|
114
114
|
import"./index-rdec0y3z.js";
|
|
115
|
-
import"./index-
|
|
115
|
+
import"./index-ar2gsn6b.js";
|
|
116
116
|
import"./index-cjapb4hy.js";
|
|
117
117
|
import"./index-zsrtt42s.js";
|
|
118
|
-
import"./index-
|
|
119
|
-
import"./index-
|
|
120
|
-
import"./index-
|
|
118
|
+
import"./index-8chh1c96.js";
|
|
119
|
+
import"./index-131ay7x1.js";
|
|
120
|
+
import"./index-3n5zsp31.js";
|
|
121
121
|
import"./index-pt7h91zc.js";
|
|
122
122
|
import"./index-q7sjgr1y.js";
|
|
123
|
-
import"./index-
|
|
124
|
-
import"./index-
|
|
125
|
-
import"./index-
|
|
126
|
-
import"./index-
|
|
127
|
-
import"./index-
|
|
128
|
-
import"./index-
|
|
123
|
+
import"./index-jct9kb50.js";
|
|
124
|
+
import"./index-279xp2be.js";
|
|
125
|
+
import"./index-rp6sfpwp.js";
|
|
126
|
+
import"./index-peg6sftq.js";
|
|
127
|
+
import"./index-rr1m7cc6.js";
|
|
128
|
+
import"./index-wy3zpwjy.js";
|
|
129
129
|
import"./index-2s7dvzff.js";
|
|
130
|
-
import"./index-
|
|
131
|
-
import"./index-
|
|
130
|
+
import"./index-w6agyrzs.js";
|
|
131
|
+
import"./index-earq3mda.js";
|
|
132
132
|
import"./index-rtry5xyf.js";
|
|
133
|
-
import"./index-
|
|
133
|
+
import"./index-bga7w4rt.js";
|
|
134
134
|
import"./index-frcemc0b.js";
|
|
135
135
|
import"./index-0725jpp7.js";
|
|
136
|
-
import"./index-
|
|
137
|
-
import"./index-
|
|
138
|
-
import"./index-
|
|
139
|
-
import"./index-
|
|
140
|
-
import"./index-
|
|
141
|
-
import"./index-
|
|
136
|
+
import"./index-zmgs43tw.js";
|
|
137
|
+
import"./index-b0qyb790.js";
|
|
138
|
+
import"./index-jvk95e6y.js";
|
|
139
|
+
import"./index-456awy1p.js";
|
|
140
|
+
import"./index-f0nj3d8z.js";
|
|
141
|
+
import"./index-w9hxzcz4.js";
|
|
142
142
|
import"./index-rdm3px0g.js";
|
|
143
143
|
import"./index-ry16d01s.js";
|
|
144
|
-
import"./index-
|
|
145
|
-
import"./index-
|
|
144
|
+
import"./index-zzvxj02e.js";
|
|
145
|
+
import"./index-zq40mkha.js";
|
|
146
146
|
import"./index-vzm6zre7.js";
|
|
147
147
|
import"./index-ae75rja9.js";
|
|
148
|
-
import"./index-
|
|
149
|
-
import"./index-
|
|
150
|
-
import"./index-
|
|
151
|
-
import"./index-
|
|
148
|
+
import"./index-475bkab8.js";
|
|
149
|
+
import"./index-xf69xty9.js";
|
|
150
|
+
import"./index-t7hmqgjy.js";
|
|
151
|
+
import"./index-x1gyqgze.js";
|
|
152
|
+
import"./index-mc72pk74.js";
|
|
152
153
|
import"./index-c1ggtmpm.js";
|
|
153
154
|
import"./index-ejhxgyvm.js";
|
|
154
155
|
import"./index-7g4c7s5r.js";
|
|
155
|
-
import"./index-
|
|
156
|
+
import"./index-k53a69vb.js";
|
|
156
157
|
import"./index-gx2vp8gx.js";
|
|
157
|
-
import"./index-
|
|
158
|
+
import"./index-dm2ydm2b.js";
|
|
158
159
|
import"./index-zxdawwc7.js";
|
|
159
160
|
import {
|
|
160
161
|
init_schema,
|
|
161
162
|
stripKnownSwarmPrefix
|
|
162
|
-
} from "./index-
|
|
163
|
+
} from "./index-j2xcdbfd.js";
|
|
163
164
|
import {
|
|
164
165
|
AGENT_TOOL_MAP,
|
|
165
166
|
ORCHESTRATOR_NAME,
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import {
|
|
3
|
-
emit
|
|
4
|
-
} from "./index-fbhtb6f5.js";
|
|
5
|
-
import {
|
|
6
|
-
tryAcquireLock
|
|
7
|
-
} from "./index-ejhxgyvm.js";
|
|
8
|
-
import {
|
|
9
|
-
atomicWriteFileAnyRoot
|
|
10
|
-
} from "./index-5cve9g2b.js";
|
|
11
2
|
import {
|
|
12
3
|
init_logger,
|
|
13
4
|
warn
|
|
@@ -61,6 +52,56 @@ function isStrictPathDescendant(candidate, root) {
|
|
|
61
52
|
const relative2 = path.relative(root, candidate);
|
|
62
53
|
return relative2 !== "" && relative2 !== ".." && !relative2.startsWith(`..${path.sep}`) && !path.isAbsolute(relative2);
|
|
63
54
|
}
|
|
55
|
+
function walkProjectBoundary(resolved, dependencies) {
|
|
56
|
+
if (hasExplicitProjectBoundary(resolved))
|
|
57
|
+
return { outcome: "marker-root" };
|
|
58
|
+
let current = resolved;
|
|
59
|
+
let depth = 0;
|
|
60
|
+
while (true) {
|
|
61
|
+
if (depth >= MAX_PROJECT_ROOT_DEPTH) {
|
|
62
|
+
return { outcome: "fail-closed", reason: "depth" };
|
|
63
|
+
}
|
|
64
|
+
depth++;
|
|
65
|
+
const parent = path.dirname(current);
|
|
66
|
+
if (parent === current)
|
|
67
|
+
return { outcome: "unclaimed" };
|
|
68
|
+
if (path.dirname(parent) === parent) {
|
|
69
|
+
current = parent;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const parentSwarm = path.join(parent, ".swarm");
|
|
73
|
+
let parentSwarmStat;
|
|
74
|
+
try {
|
|
75
|
+
parentSwarmStat = dependencies.statSync(parentSwarm);
|
|
76
|
+
} catch (error) {
|
|
77
|
+
if (isMissingPathError(error)) {
|
|
78
|
+
current = parent;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
outcome: "fail-closed",
|
|
83
|
+
reason: "ancestor-swarm",
|
|
84
|
+
path: parentSwarm
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (parentSwarmStat.isDirectory()) {
|
|
88
|
+
const indicatorState = projectIndicatorState(parent, dependencies, {
|
|
89
|
+
allowConfigOnly: !isWeakConfigContainerRoot(parent, dependencies)
|
|
90
|
+
});
|
|
91
|
+
if (indicatorState === "inaccessible") {
|
|
92
|
+
return {
|
|
93
|
+
outcome: "fail-closed",
|
|
94
|
+
reason: "ancestor-indicators",
|
|
95
|
+
path: parent
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
if (indicatorState === "present") {
|
|
99
|
+
return { outcome: "claimed", ancestor: parent };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
current = parent;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
64
105
|
function isMissingPathError(error) {
|
|
65
106
|
const code = error?.code;
|
|
66
107
|
return code === "ENOENT" || code === "ENOTDIR";
|
|
@@ -98,143 +139,51 @@ function assertProjectRoot(directory, dependencies = fs, artifactLabel = "runtim
|
|
|
98
139
|
warn(`[project-boundary] Cannot canonicalize directory "${directory}" \u2014 failing closed`);
|
|
99
140
|
throw new Error(`Cannot verify project root for "${directory}" \u2014 directory may not exist or is inaccessible`);
|
|
100
141
|
}
|
|
101
|
-
|
|
142
|
+
const walk = walkProjectBoundary(resolved, dependencies);
|
|
143
|
+
if (walk.outcome === "marker-root" || walk.outcome === "unclaimed")
|
|
102
144
|
return;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (depth >= MAX_PROJECT_ROOT_DEPTH) {
|
|
107
|
-
warn(`[project-boundary] Ancestor search exceeded ${MAX_PROJECT_ROOT_DEPTH} levels for "${resolved}" \u2014 failing closed`);
|
|
108
|
-
throw new Error(`Cannot verify project root for "${resolved}" \u2014 ancestor search exceeded ${MAX_PROJECT_ROOT_DEPTH} levels`);
|
|
109
|
-
}
|
|
110
|
-
depth++;
|
|
111
|
-
const parent = path.dirname(current);
|
|
112
|
-
if (parent === current)
|
|
113
|
-
break;
|
|
114
|
-
if (path.dirname(parent) === parent) {
|
|
115
|
-
current = parent;
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
const parentSwarm = path.join(parent, ".swarm");
|
|
119
|
-
let parentSwarmStat;
|
|
120
|
-
try {
|
|
121
|
-
parentSwarmStat = dependencies.statSync(parentSwarm);
|
|
122
|
-
} catch (error) {
|
|
123
|
-
if (isMissingPathError(error)) {
|
|
124
|
-
current = parent;
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
warn(`[project-boundary] Cannot inspect ancestor state "${parentSwarm}" \u2014 failing closed`);
|
|
128
|
-
throw new Error(`Cannot verify project root for "${resolved}" \u2014 ancestor state "${parentSwarm}" is inaccessible`);
|
|
129
|
-
}
|
|
130
|
-
if (parentSwarmStat.isDirectory()) {
|
|
131
|
-
const indicatorState = projectIndicatorState(parent, dependencies, {
|
|
132
|
-
allowConfigOnly: !isWeakConfigContainerRoot(parent, dependencies)
|
|
133
|
-
});
|
|
134
|
-
if (indicatorState === "inaccessible") {
|
|
135
|
-
warn(`[project-boundary] Cannot inspect project indicators in ancestor "${parent}" \u2014 failing closed`);
|
|
136
|
-
throw new Error(`Cannot verify project root for "${resolved}" \u2014 project indicators in ancestor "${parent}" are inaccessible`);
|
|
137
|
-
}
|
|
138
|
-
if (indicatorState === "present") {
|
|
139
|
-
warn(`[project-boundary] Rejecting write to subdirectory "${resolved}" \u2014 parent "${parent}" already contains .swarm/`);
|
|
140
|
-
throw new Error(`Cannot write ${artifactLabel} in "${resolved}" \u2014 parent directory "${parent}" already contains a .swarm/ folder. Runtime state must be written to the project root.`);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
current = parent;
|
|
145
|
+
if (walk.outcome === "claimed") {
|
|
146
|
+
warn(`[project-boundary] Rejecting write to subdirectory "${resolved}" \u2014 parent "${walk.ancestor}" already contains .swarm/`);
|
|
147
|
+
throw new Error(`Cannot write ${artifactLabel} in "${resolved}" \u2014 parent directory "${walk.ancestor}" already contains a .swarm/ folder. Runtime state must be written to the project root.`);
|
|
144
148
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
// src/evidence/lock.ts
|
|
151
|
-
class EvidenceLockTimeoutError extends Error {
|
|
152
|
-
directory;
|
|
153
|
-
evidencePath;
|
|
154
|
-
agent;
|
|
155
|
-
taskId;
|
|
156
|
-
constructor(directory, evidencePath, agent, taskId, timeoutMs) {
|
|
157
|
-
super(`Evidence lock timeout after ${timeoutMs}ms for ${evidencePath} (agent=${agent}, task=${taskId})`);
|
|
158
|
-
this.name = "EvidenceLockTimeoutError";
|
|
159
|
-
this.directory = directory;
|
|
160
|
-
this.evidencePath = evidencePath;
|
|
161
|
-
this.agent = agent;
|
|
162
|
-
this.taskId = taskId;
|
|
149
|
+
if (walk.reason === "depth") {
|
|
150
|
+
warn(`[project-boundary] Ancestor search exceeded ${MAX_PROJECT_ROOT_DEPTH} levels for "${resolved}" \u2014 failing closed`);
|
|
151
|
+
throw new Error(`Cannot verify project root for "${resolved}" \u2014 ancestor search exceeded ${MAX_PROJECT_ROOT_DEPTH} levels`);
|
|
163
152
|
}
|
|
153
|
+
if (walk.reason === "ancestor-swarm") {
|
|
154
|
+
warn(`[project-boundary] Cannot inspect ancestor state "${walk.path}" \u2014 failing closed`);
|
|
155
|
+
throw new Error(`Cannot verify project root for "${resolved}" \u2014 ancestor state "${walk.path}" is inaccessible`);
|
|
156
|
+
}
|
|
157
|
+
warn(`[project-boundary] Cannot inspect project indicators in ancestor "${walk.path}" \u2014 failing closed`);
|
|
158
|
+
throw new Error(`Cannot verify project root for "${resolved}" \u2014 project indicators in ancestor "${walk.path}" are inaccessible`);
|
|
164
159
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
async function withEvidenceLock(directory, evidencePath, agent, taskId, fn, timeoutMs = 60000) {
|
|
174
|
-
assertProjectRoot(directory);
|
|
175
|
-
const deadline = Date.now() + timeoutMs;
|
|
176
|
-
let attempt = 0;
|
|
177
|
-
while (true) {
|
|
178
|
-
const result = await tryAcquireLock(directory, evidencePath, agent, taskId);
|
|
179
|
-
if (result.acquired) {
|
|
180
|
-
const lock = result.lock;
|
|
181
|
-
if (attempt > 0) {
|
|
182
|
-
emit("evidence_lock_stale_recovered", {
|
|
183
|
-
directory,
|
|
184
|
-
evidencePath,
|
|
185
|
-
agent,
|
|
186
|
-
taskId,
|
|
187
|
-
attempt
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
emit("evidence_lock_acquired", {
|
|
191
|
-
directory,
|
|
192
|
-
evidencePath,
|
|
193
|
-
agent,
|
|
194
|
-
taskId,
|
|
195
|
-
attempt
|
|
196
|
-
});
|
|
197
|
-
try {
|
|
198
|
-
return await fn();
|
|
199
|
-
} finally {
|
|
200
|
-
if (lock._release) {
|
|
201
|
-
try {
|
|
202
|
-
await lock._release();
|
|
203
|
-
} catch {}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
if (Date.now() >= deadline) {
|
|
208
|
-
throw new EvidenceLockTimeoutError(directory, evidencePath, agent, taskId, timeoutMs);
|
|
209
|
-
}
|
|
210
|
-
emit("evidence_lock_contended", {
|
|
160
|
+
function resolveProjectRootDecision(directory, dependencies = fs) {
|
|
161
|
+
let resolved;
|
|
162
|
+
try {
|
|
163
|
+
resolved = dependencies.realpathSync(directory);
|
|
164
|
+
} catch {
|
|
165
|
+
return {
|
|
166
|
+
kind: "fail-closed",
|
|
211
167
|
directory,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
taskId,
|
|
215
|
-
attempt
|
|
216
|
-
});
|
|
217
|
-
const delay = Math.min(backoffMs(attempt), deadline - Date.now());
|
|
218
|
-
if (delay > 0) {
|
|
219
|
-
await new Promise((resolve2) => setTimeout(resolve2, delay));
|
|
220
|
-
}
|
|
221
|
-
attempt++;
|
|
168
|
+
reason: `cannot canonicalize directory "${directory}" \u2014 it may not exist or is inaccessible`
|
|
169
|
+
};
|
|
222
170
|
}
|
|
171
|
+
const walk = walkProjectBoundary(resolved, dependencies);
|
|
172
|
+
if (walk.outcome === "marker-root" || walk.outcome === "unclaimed") {
|
|
173
|
+
return { kind: "root", directory: resolved };
|
|
174
|
+
}
|
|
175
|
+
if (walk.outcome === "claimed") {
|
|
176
|
+
return {
|
|
177
|
+
kind: "redirect",
|
|
178
|
+
directory: resolved,
|
|
179
|
+
owningRoot: walk.ancestor
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
const reason = walk.reason === "depth" ? `ancestor search exceeded ${MAX_PROJECT_ROOT_DEPTH} levels` : walk.reason === "ancestor-swarm" ? `ancestor state "${walk.path}" is inaccessible` : `project indicators in ancestor "${walk.path}" are inaccessible`;
|
|
183
|
+
return { kind: "fail-closed", directory: resolved, reason };
|
|
223
184
|
}
|
|
185
|
+
var _internals = {
|
|
186
|
+
lstatSync: fs.lstatSync
|
|
187
|
+
};
|
|
224
188
|
|
|
225
|
-
|
|
226
|
-
import * as path2 from "path";
|
|
227
|
-
function taskEvidenceRelPath(taskId) {
|
|
228
|
-
return path2.join("evidence", `${taskId}.json`);
|
|
229
|
-
}
|
|
230
|
-
function taskEvidencePath(directory, taskId) {
|
|
231
|
-
return path2.join(directory, ".swarm", taskEvidenceRelPath(taskId));
|
|
232
|
-
}
|
|
233
|
-
async function atomicWriteFile(targetPath, content) {
|
|
234
|
-
await atomicWriteFileAnyRoot(targetPath, content);
|
|
235
|
-
}
|
|
236
|
-
function withTaskEvidenceLock(directory, taskId, agent, fn) {
|
|
237
|
-
return withEvidenceLock(directory, taskEvidenceRelPath(taskId), agent, taskId, fn);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
export { hasExplicitProjectBoundary, isStrictPathDescendant, assertProjectRoot, EvidenceLockTimeoutError, withEvidenceLock, taskEvidencePath, atomicWriteFile, withTaskEvidenceLock };
|
|
189
|
+
export { hasExplicitProjectBoundary, isStrictPathDescendant, assertProjectRoot, resolveProjectRootDecision };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
authorizeCuration
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-earq3mda.js";
|
|
5
5
|
import {
|
|
6
6
|
findNearDuplicate,
|
|
7
7
|
inferTags,
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
resolveSwarmKnowledgePath,
|
|
10
10
|
resolveSwarmRejectedPath,
|
|
11
11
|
transactKnowledge
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-zq40mkha.js";
|
|
13
13
|
import {
|
|
14
14
|
resolveKnowledgeStoreDir
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-475bkab8.js";
|
|
16
16
|
import {
|
|
17
17
|
atomicWriteFile
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-xf69xty9.js";
|
|
19
19
|
import {
|
|
20
20
|
require_proper_lockfile
|
|
21
21
|
} from "./index-7g4c7s5r.js";
|