opencode-swarm 7.199.4 → 7.199.5

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 (120) hide show
  1. package/.opencode/skills/swarm-pr-feedback/references/followup-dispositions.md +1 -0
  2. package/.opencode/skills/swarm-pr-review/SKILL.md +3 -3
  3. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  4. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  5. package/dist/agents/architect.d.ts +1 -1
  6. package/dist/background/pending-delegations.d.ts +46 -0
  7. package/dist/cli/{auto-checkpoint-75n3s0qj.js → auto-checkpoint-tje4xvtw.js} +12 -11
  8. package/dist/cli/{checkpoint-vdjfn78h.js → checkpoint-wyh8nkhb.js} +21 -21
  9. package/dist/cli/{coder-settlement-wwgdrzcb.js → coder-settlement-d0ca5fb3.js} +18 -18
  10. package/dist/cli/{config-doctor-x8ke4n9r.js → config-doctor-swg02esj.js} +19 -19
  11. package/dist/cli/{core-2zmr3718.js → core-yh8ae69m.js} +7 -7
  12. package/dist/cli/{curation-policy-0smbd33w.js → curation-policy-w9y0db1n.js} +8 -8
  13. package/dist/cli/{curator-7pnzsqe8.js → curator-9vzqhesg.js} +51 -51
  14. package/dist/cli/{curator-drift-2rtecv79.js → curator-drift-85qect05.js} +12 -12
  15. package/dist/cli/curator-llm-factory-dwvftpvm.js +82 -0
  16. package/dist/cli/{dispatch-1pbmmj8z.js → dispatch-sftetpzv.js} +4 -4
  17. package/dist/cli/{doctor-knowledge-receipt-phase-id-0yqb8t1e.js → doctor-knowledge-receipt-phase-id-eqzsh3b7.js} +12 -12
  18. package/dist/cli/{evidence-summary-service-59r4wnbz.js → evidence-summary-service-hc513kyq.js} +27 -27
  19. package/dist/cli/{gate-evidence-7xp8a4s3.js → gate-evidence-a10epye0.js} +13 -13
  20. package/dist/cli/guardrail-explain-rqqhmb44.js +83 -0
  21. package/dist/cli/guardrail-log-caspzygc.js +23 -0
  22. package/dist/cli/{guardrail-reset-2edjt0zn.js → guardrail-reset-48r2n8mz.js} +51 -51
  23. package/dist/cli/hive-promoter-sd3a61mq.js +97 -0
  24. package/dist/cli/{index-h69d3ksz.js → index-0aj9tvms.js} +51 -51
  25. package/dist/cli/{index-dyp5807d.js → index-0je0mees.js} +10 -8
  26. package/dist/cli/{index-eh12k044.js → index-0ra0vs2p.js} +13 -11
  27. package/dist/cli/{index-2mx2gn97.js → index-0veqvgny.js} +1 -1
  28. package/dist/cli/{index-h44592hj.js → index-10wwrgj2.js} +6 -6
  29. package/dist/cli/{index-5mfahvm2.js → index-26dmsdx3.js} +4884 -5746
  30. package/dist/cli/{index-ywb5er8g.js → index-270zfq1f.js} +2 -2
  31. package/dist/cli/{index-ry1jgeqa.js → index-34jat4f2.js} +2 -2
  32. package/dist/cli/{index-97cpeqb2.js → index-3ckvw3j2.js} +2 -2
  33. package/dist/cli/{index-2wsh6d15.js → index-3fz5w2wb.js} +15 -6
  34. package/dist/cli/{index-h349p91m.js → index-3mzc5rqc.js} +2 -2
  35. package/dist/cli/{index-bkscmz4z.js → index-4cyc18bc.js} +11 -11
  36. package/dist/cli/{index-hxav7nr0.js → index-4pbzepgw.js} +1645 -124
  37. package/dist/cli/{index-vnmadnbs.js → index-6ssraqaa.js} +15 -11
  38. package/dist/cli/{index-9gfymmr8.js → index-6xv2hz0e.js} +5 -5
  39. package/dist/cli/{index-dradkxhb.js → index-6xyt6d5m.js} +13 -13
  40. package/dist/cli/{index-t94vcqg6.js → index-76skvj8z.js} +7 -7
  41. package/dist/cli/{index-ffkd1zwc.js → index-85vd6sxy.js} +10 -10
  42. package/dist/cli/{index-k0er6f51.js → index-9c0vp5yj.js} +2 -2
  43. package/dist/cli/{index-sxh861jr.js → index-9n40q82y.js} +4 -4
  44. package/dist/cli/{index-nr1pj3hy.js → index-9y6yk1n0.js} +1 -1
  45. package/dist/cli/{index-j2vv0h13.js → index-axqyjreb.js} +6 -4
  46. package/dist/cli/{index-aaqgsmxr.js → index-b0kr8720.js} +53 -53
  47. package/dist/cli/{index-820pzqd6.js → index-b3ws03kp.js} +7 -5
  48. package/dist/cli/{index-3chx0ed6.js → index-bgydmx8k.js} +11 -11
  49. package/dist/cli/{index-bh6j8qxz.js → index-d7y3cafq.js} +5 -5
  50. package/dist/cli/{index-g1wra8ky.js → index-dengtwpp.js} +5 -4
  51. package/dist/cli/{index-6dtt0brw.js → index-dtwj4hsk.js} +4 -4
  52. package/dist/cli/{index-4s6kdsfr.js → index-dz15f98h.js} +1 -1
  53. package/dist/cli/{index-s41r5s5p.js → index-esakwcr3.js} +1 -1
  54. package/dist/cli/{index-hz2609qt.js → index-eyq1q1xn.js} +9 -7
  55. package/dist/cli/{index-aayv19fb.js → index-gyz59cbh.js} +25 -21
  56. package/dist/cli/{index-7c432abn.js → index-hx2f3j9w.js} +2 -2
  57. package/dist/cli/{index-p5pgjp7n.js → index-j3rfbs45.js} +1 -1
  58. package/dist/cli/{index-w7d8gcj0.js → index-jmhn6ab5.js} +2 -2
  59. package/dist/cli/{index-jhz7qpb4.js → index-my753e0g.js} +21 -17
  60. package/dist/cli/{index-2bc7zfw3.js → index-n1ddn12j.js} +2 -2
  61. package/dist/cli/{index-hfpa3hrz.js → index-p5d32v0x.js} +11 -11
  62. package/dist/cli/{index-2s7dvzff.js → index-qbxk2rn6.js} +42 -41
  63. package/dist/cli/{index-w00dj8p5.js → index-snx2vb1x.js} +2 -2
  64. package/dist/cli/{index-zxdawwc7.js → index-sp2cxpaq.js} +131 -8
  65. package/dist/cli/{index-g4fs6z4e.js → index-spggmr30.js} +6 -2
  66. package/dist/cli/{index-pxdc0qn1.js → index-tsg61z0r.js} +2 -2
  67. package/dist/cli/{index-jwg4wy3g.js → index-v4mremxw.js} +6 -5
  68. package/dist/cli/{index-cjapb4hy.js → index-x5jwegqw.js} +7 -5
  69. package/dist/cli/{index-h3nns8py.js → index-xtda4xsn.js} +403 -170
  70. package/dist/cli/{index-3gr7a9j8.js → index-xyg7des8.js} +4 -4
  71. package/dist/cli/{index-65syfqe1.js → index-ybvnf7rt.js} +8 -8
  72. package/dist/cli/{index-nfpfbce0.js → index-yg5xd4am.js} +18 -16
  73. package/dist/cli/{index-hc6wa3yg.js → index-zbygz217.js} +3 -3
  74. package/dist/cli/{index-x1j0838n.js → index-zdfzrwbk.js} +7 -7
  75. package/dist/cli/{index-4f5ejd03.js → index-zte3djpf.js} +2 -2
  76. package/dist/cli/index.js +52 -52
  77. package/dist/cli/{knowledge-escalator-2kphhk52.js → knowledge-escalator-9wqe0m8j.js} +18 -18
  78. package/dist/cli/{knowledge-events-xw4qjnts.js → knowledge-events-m5vdchaa.js} +16 -16
  79. package/dist/cli/{knowledge-link-1f91bzcc.js → knowledge-link-t0ce3mw7.js} +7 -7
  80. package/dist/cli/{knowledge-store-1cm7y9e6.js → knowledge-store-ff4hy057.js} +8 -8
  81. package/dist/cli/{knowledge-validator-q4r4ng23.js → knowledge-validator-erj5thtq.js} +10 -10
  82. package/dist/cli/{mcp-0548g7fk.js → mcp-d0hz5gfp.js} +1 -1
  83. package/dist/cli/{model-preflight-pdewpzmm.js → model-preflight-p34x0k25.js} +51 -51
  84. package/dist/cli/{pending-delegations-zv9ffy5b.js → pending-delegations-1j6dx1mf.js} +18 -15
  85. package/dist/cli/{pr-subscriptions-0ktv4qaq.js → pr-subscriptions-b1g41jce.js} +15 -15
  86. package/dist/cli/{pr-workflow-gate-71nxjz6p.js → pr-workflow-gate-zjwt050h.js} +59 -59
  87. package/dist/cli/{runner-7sd43gan.js → runner-wq954cda.js} +9 -9
  88. package/dist/cli/{scan-cursor-ty5dqwhm.js → scan-cursor-enz1rp21.js} +11 -10
  89. package/dist/cli/{schema-tnrvn8h1.js → schema-9r8sggpb.js} +1 -1
  90. package/dist/cli/{scope-persistence-camnvcaq.js → scope-persistence-c5n4g9f0.js} +20 -19
  91. package/dist/cli/{server-cr9kvgzz.js → server-8z7pd66d.js} +56 -56
  92. package/dist/cli/{skill-generator-nx2g9975.js → skill-generator-nezzfa0t.js} +20 -20
  93. package/dist/cli/{snapshot-coordination-init-ymsjgsqf.js → snapshot-coordination-init-2j06c7ck.js} +51 -51
  94. package/dist/cli/{speckit-checkoff-1pyx7y0d.js → speckit-checkoff-805cqmrf.js} +7 -6
  95. package/dist/cli/{telemetry-6yv06xyz.js → telemetry-gena5typ.js} +3 -3
  96. package/dist/cli/{workspace-snapshot-4zfj5wnd.js → workspace-snapshot-hzhz0rxw.js} +7 -7
  97. package/dist/cli/{worktree-collision-ownership-twe4r9f2.js → worktree-collision-ownership-xpr0yv7h.js} +22 -21
  98. package/dist/cli/{worktree-isolation-yj3vfp1h.js → worktree-isolation-z6ytes0j.js} +51 -51
  99. package/dist/commands/close/dry-run.d.ts +2 -1
  100. package/dist/commands/close/orchestrator.d.ts +16 -5
  101. package/dist/commands/destructive-purge.d.ts +53 -12
  102. package/dist/commands/git-status-read.d.ts +76 -0
  103. package/dist/commands/rollback-gate.d.ts +24 -5
  104. package/dist/config/schema.d.ts +5 -3
  105. package/dist/evaluation/contracts.d.ts +5 -5
  106. package/dist/hooks/lane-liveness-watchdog.d.ts +6 -1
  107. package/dist/hooks/pr-workflow-gate.d.ts +61 -1
  108. package/dist/index.js +254 -252
  109. package/dist/memory/schema.d.ts +3 -3
  110. package/dist/pr-review/completion.d.ts +63 -2
  111. package/dist/services/diagnose-service.d.ts +7 -8
  112. package/dist/tools/dispatch-lanes.d.ts +2 -1
  113. package/dist/utils/git-executable.d.ts +4 -0
  114. package/opencode-swarm.schema.json +3 -2
  115. package/package.json +1 -1
  116. package/dist/cli/curator-llm-factory-aybwqak6.js +0 -82
  117. package/dist/cli/guardrail-explain-jahptqqd.js +0 -83
  118. package/dist/cli/guardrail-log-csp211g7.js +0 -23
  119. package/dist/cli/hive-promoter-17q1qg8e.js +0 -97
  120. package/dist/cli/{index-fzpt2djt.js → index-te9hq2f4.js} +3 -3
@@ -4,7 +4,7 @@ import {
4
4
  readShellAuditTail,
5
5
  redactPath,
6
6
  redactShellCommand
7
- } from "./index-jhz7qpb4.js";
7
+ } from "./index-my753e0g.js";
8
8
 
9
9
  // src/services/guardrail-log-service.ts
10
10
  var BLOCK_TYPES = new Set([
@@ -1,27 +1,29 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-820pzqd6.js";
5
- import {
6
- bunSpawn
7
- } from "./index-2s7dvzff.js";
4
+ } from "./index-b3ws03kp.js";
8
5
  import {
9
6
  canonicalRootKey,
10
7
  sameProjectRoot
11
- } from "./index-fzpt2djt.js";
8
+ } from "./index-te9hq2f4.js";
12
9
  import {
13
10
  atomicWriteSwarmFile
14
- } from "./index-ywb5er8g.js";
11
+ } from "./index-270zfq1f.js";
15
12
  import {
16
13
  init_git_executable,
17
14
  resolveGitExecutable
18
- } from "./index-zxdawwc7.js";
15
+ } from "./index-sp2cxpaq.js";
16
+ import {
17
+ bunSpawn,
18
+ init_bun_compat
19
+ } from "./index-qbxk2rn6.js";
19
20
 
20
21
  // src/background/workspace-snapshot.ts
21
22
  import * as child_process from "child_process";
22
23
  import { createHash } from "crypto";
23
24
  import * as fs from "fs";
24
25
  import * as path from "path";
26
+ init_bun_compat();
25
27
  init_git_executable();
26
28
  var GIT_SNAPSHOT_TIMEOUT_MS = 3000;
27
29
  var GIT_SNAPSHOT_MAX_BUFFER = 32 * 1024 * 1024;
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-6b295cas.js";
5
5
  import {
6
6
  readEffectiveSpecSync
7
- } from "./index-t94vcqg6.js";
7
+ } from "./index-76skvj8z.js";
8
8
  import {
9
9
  _internals,
10
10
  clearWorktreeMergeStatus,
@@ -20,11 +20,7 @@ import {
20
20
  estimateTokens,
21
21
  readSwarmFileAsync,
22
22
  validateSwarmPath
23
- } from "./index-820pzqd6.js";
24
- import {
25
- bunHash,
26
- bunWrite
27
- } from "./index-2s7dvzff.js";
23
+ } from "./index-b3ws03kp.js";
28
24
  import {
29
25
  LedgerStaleWriterError,
30
26
  appendLedgerEvent,
@@ -43,10 +39,7 @@ import {
43
39
  replayFromLedgerWithStatus,
44
40
  takeSnapshotEvent,
45
41
  takeSnapshotWithRetry
46
- } from "./index-65syfqe1.js";
47
- import {
48
- appendCoreEventSync
49
- } from "./index-h349p91m.js";
42
+ } from "./index-ybvnf7rt.js";
50
43
  import {
51
44
  deleteCoordinationStateWithinTransaction,
52
45
  getCoordinationStateRaw,
@@ -55,13 +48,16 @@ import {
55
48
  transitionCoordinationState,
56
49
  transitionCoordinationStateWithinTransaction,
57
50
  withCoordinationTransaction
58
- } from "./index-nr1pj3hy.js";
51
+ } from "./index-9y6yk1n0.js";
59
52
  import {
60
53
  DURABILITY_CLASSES,
61
54
  getProjectDb,
62
55
  projectDbExists,
63
56
  withDurabilityClass
64
- } from "./index-w00dj8p5.js";
57
+ } from "./index-snx2vb1x.js";
58
+ import {
59
+ appendCoreEventSync
60
+ } from "./index-3mzc5rqc.js";
65
61
  import {
66
62
  derivePlanId,
67
63
  derivePlanIdentityHash
@@ -71,10 +67,10 @@ import {
71
67
  } from "./index-t7hmqgjy.js";
72
68
  import {
73
69
  emit
74
- } from "./index-6dtt0brw.js";
70
+ } from "./index-dtwj4hsk.js";
75
71
  import {
76
72
  canonicalRootKeyFresh
77
- } from "./index-fzpt2djt.js";
73
+ } from "./index-te9hq2f4.js";
78
74
  import {
79
75
  tryAcquireLock
80
76
  } from "./index-ejhxgyvm.js";
@@ -82,7 +78,7 @@ import {
82
78
  atomicWriteSwarmFileSync,
83
79
  invalidateCachedArtifact,
84
80
  readCachedParsedFile
85
- } from "./index-ywb5er8g.js";
81
+ } from "./index-270zfq1f.js";
86
82
  import {
87
83
  PlanSchema,
88
84
  normalizeCurrentPhaseInPlace,
@@ -93,16 +89,21 @@ import {
93
89
  init_loader,
94
90
  isEpicModeConfigEnabled,
95
91
  loadPluginConfigWithMeta
96
- } from "./index-97cpeqb2.js";
92
+ } from "./index-3ckvw3j2.js";
97
93
  import {
98
- exports_external,
99
- init_zod
100
- } from "./index-gknz3bv1.js";
94
+ bunHash,
95
+ bunWrite,
96
+ init_bun_compat
97
+ } from "./index-qbxk2rn6.js";
101
98
  import {
102
99
  criticalWarn,
103
100
  init_logger,
104
101
  warn
105
102
  } from "./index-zgwm4ryv.js";
103
+ import {
104
+ exports_external,
105
+ init_zod
106
+ } from "./index-gknz3bv1.js";
106
107
  import {
107
108
  __require
108
109
  } from "./index-a76rekgs.js";
@@ -1198,6 +1199,9 @@ var _internals5 = {
1198
1199
  summarizeTask
1199
1200
  };
1200
1201
 
1202
+ // src/plan/manager.ts
1203
+ init_bun_compat();
1204
+
1201
1205
  // src/utils/spec-hash.ts
1202
1206
  import { createHash as createHash4 } from "crypto";
1203
1207
  import * as fsSync from "fs";
@@ -2664,7 +2668,7 @@ ${markdown}`;
2664
2668
  }
2665
2669
  }
2666
2670
  async function defaultMaybeSaveAutoCheckpoint(directory, plan) {
2667
- const { maybeSaveAutoCheckpoint } = await import("./auto-checkpoint-75n3s0qj.js");
2671
+ const { maybeSaveAutoCheckpoint } = await import("./auto-checkpoint-tje4xvtw.js");
2668
2672
  return maybeSaveAutoCheckpoint(directory, plan);
2669
2673
  }
2670
2674
  async function updateTaskStatus(directory, taskId, status, options) {
@@ -2740,7 +2744,7 @@ async function updateTaskStatus(directory, taskId, status, options) {
2740
2744
  if (status === "completed") {
2741
2745
  try {
2742
2746
  const completedTask = updatedPlan.phases.flatMap((phase) => phase.tasks).find((candidate) => candidate.id === taskId);
2743
- const { maybePropagateSpeckitCheckoff } = await import("./speckit-checkoff-1pyx7y0d.js");
2747
+ const { maybePropagateSpeckitCheckoff } = await import("./speckit-checkoff-805cqmrf.js");
2744
2748
  await maybePropagateSpeckitCheckoff(directory, {
2745
2749
  taskId,
2746
2750
  frRefs: completedTask?.fr_refs ?? [],
@@ -9,10 +9,10 @@ import {
9
9
  } from "./index-txdagbh7.js";
10
10
  import {
11
11
  atomicWriteFile
12
- } from "./index-w7d8gcj0.js";
12
+ } from "./index-jmhn6ab5.js";
13
13
  import {
14
14
  withEvidenceLock
15
- } from "./index-4s6kdsfr.js";
15
+ } from "./index-dz15f98h.js";
16
16
  import {
17
17
  assertProjectRoot
18
18
  } from "./index-t7hmqgjy.js";
@@ -4,7 +4,7 @@ import {
4
4
  getProjectDb,
5
5
  projectDbExists,
6
6
  withImmediateTransaction
7
- } from "./index-w00dj8p5.js";
7
+ } from "./index-snx2vb1x.js";
8
8
  import {
9
9
  derivePlanId,
10
10
  derivePlanIdentityHash
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  withEvidenceLock
4
- } from "./index-4s6kdsfr.js";
4
+ } from "./index-dz15f98h.js";
5
5
  import {
6
6
  atomicWriteFileAnyRoot
7
- } from "./index-ywb5er8g.js";
7
+ } from "./index-270zfq1f.js";
8
8
 
9
9
  // src/evidence/task-file.ts
10
10
  import * as path from "path";
@@ -1,21 +1,4 @@
1
1
  // @bun
2
- import {
3
- observeStoreHealth
4
- } from "./index-hc6wa3yg.js";
5
- import {
6
- telemetry
7
- } from "./index-6dtt0brw.js";
8
- import {
9
- init_git_executable,
10
- resolveGitExecutable
11
- } from "./index-zxdawwc7.js";
12
- import {
13
- init_schema,
14
- stripKnownSwarmPrefix
15
- } from "./index-g1wra8ky.js";
16
- import {
17
- init_constants
18
- } from "./index-xfzkq1k4.js";
19
2
  import {
20
3
  getPathFlavor,
21
4
  init_path_identity,
@@ -26,10 +9,30 @@ import {
26
9
  sanitizeDiagnosticText,
27
10
  unsafePathTextReason
28
11
  } from "./index-9rwhas09.js";
12
+ import {
13
+ observeStoreHealth
14
+ } from "./index-zbygz217.js";
15
+ import {
16
+ telemetry
17
+ } from "./index-dtwj4hsk.js";
18
+ import {
19
+ init_git_executable,
20
+ resolveGitExecutable
21
+ } from "./index-sp2cxpaq.js";
22
+ import {
23
+ init_bun_compat
24
+ } from "./index-qbxk2rn6.js";
29
25
  import {
30
26
  init_logger,
31
27
  warn
32
28
  } from "./index-zgwm4ryv.js";
29
+ import {
30
+ init_schema,
31
+ stripKnownSwarmPrefix
32
+ } from "./index-dengtwpp.js";
33
+ import {
34
+ init_constants
35
+ } from "./index-xfzkq1k4.js";
33
36
  import {
34
37
  __commonJS,
35
38
  __toESM
@@ -2150,6 +2153,7 @@ function protectedRoots(projectRoot, additional = []) {
2150
2153
  }
2151
2154
 
2152
2155
  // src/utils/arg-hash.ts
2156
+ init_bun_compat();
2153
2157
  var HASH_INPUT_CAP_BYTES = 64 * 1024;
2154
2158
 
2155
2159
  // src/hooks/guardrails/file-authority.ts
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  atomicWriteFile
4
- } from "./index-w7d8gcj0.js";
4
+ } from "./index-jmhn6ab5.js";
5
5
  import {
6
6
  canonicalRootKeyFresh
7
- } from "./index-fzpt2djt.js";
7
+ } from "./index-te9hq2f4.js";
8
8
  import {
9
9
  init_logger,
10
10
  warn
@@ -1,10 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  computePlanStructureHash
4
- } from "./index-65syfqe1.js";
5
- import {
6
- appendCoreEventSync
7
- } from "./index-h349p91m.js";
4
+ } from "./index-ybvnf7rt.js";
8
5
  import {
9
6
  deleteCoordinationState,
10
7
  importCoordinationOnce,
@@ -12,17 +9,24 @@ import {
12
9
  transitionCoordinationState,
13
10
  transitionCoordinationStateWithinTransaction,
14
11
  withCoordinationTransaction
15
- } from "./index-nr1pj3hy.js";
12
+ } from "./index-9y6yk1n0.js";
16
13
  import {
17
14
  getProjectDb
18
- } from "./index-w00dj8p5.js";
15
+ } from "./index-snx2vb1x.js";
19
16
  import {
20
17
  canonicalExistingFilesystemPath,
21
18
  legacyCanonicalExistingFilesystemPath
22
19
  } from "./index-ry16d01s.js";
20
+ import {
21
+ appendCoreEventSync
22
+ } from "./index-3mzc5rqc.js";
23
23
  import {
24
24
  derivePlanId
25
25
  } from "./index-7pmbnjvj.js";
26
+ import {
27
+ init_path_identity,
28
+ unsafePathTextReason
29
+ } from "./index-9rwhas09.js";
26
30
  import {
27
31
  assertProjectRoot
28
32
  } from "./index-t7hmqgjy.js";
@@ -32,14 +36,10 @@ import {
32
36
  import {
33
37
  atomicWriteSwarmFile,
34
38
  atomicWriteSwarmFileSync
35
- } from "./index-ywb5er8g.js";
39
+ } from "./index-270zfq1f.js";
36
40
  import {
37
41
  PlanSchema
38
42
  } from "./index-gx2vp8gx.js";
39
- import {
40
- init_path_identity,
41
- unsafePathTextReason
42
- } from "./index-9rwhas09.js";
43
43
  import {
44
44
  __toESM
45
45
  } from "./index-a76rekgs.js";
@@ -1,4 +1,8 @@
1
1
  // @bun
2
+ import {
3
+ __esm
4
+ } from "./index-a76rekgs.js";
5
+
2
6
  // src/utils/bun-compat.ts
3
7
  import {
4
8
  spawn as nodeSpawn,
@@ -7,9 +11,6 @@ import {
7
11
  import * as fsSync from "fs";
8
12
  import * as fsPromises from "fs/promises";
9
13
  import * as path from "path";
10
- var WINDOWS_RENAME_MAX_RETRIES = 3;
11
- var WINDOWS_RENAME_RETRY_DELAY_MS = 50;
12
- var tempCounter = 0;
13
14
  function getBun() {
14
15
  const g = globalThis;
15
16
  return g.Bun;
@@ -137,20 +138,6 @@ function bunHash(input) {
137
138
  }
138
139
  return hash;
139
140
  }
140
- var DEFAULT_BUN_SPAWN_MAX_BUFFER_BYTES = 5 * 1024 * 1024;
141
-
142
- class BunCompatOutputLimitError extends Error {
143
- limit;
144
- captured;
145
- total;
146
- constructor(limit, captured, total) {
147
- super(`Subprocess output exceeded the ${limit}-byte buffer limit after capturing ${captured} bytes (${total} bytes observed)`);
148
- this.name = "BunCompatOutputLimitError";
149
- this.limit = limit;
150
- this.captured = captured;
151
- this.total = total;
152
- }
153
- }
154
141
  async function killProcessTreeImpl(pid, signal, directKill, wasDetached) {
155
142
  if (typeof pid !== "number" || pid <= 0) {
156
143
  directKill(signal);
@@ -198,27 +185,6 @@ async function killProcessTreeImpl(pid, signal, directKill, wasDetached) {
198
185
  function createProcessTreeKiller(pid, directKill, wasDetached) {
199
186
  return (signal) => killProcessTreeImpl(pid, signal, directKill, wasDetached);
200
187
  }
201
- var _internals = {
202
- platform: () => process.platform,
203
- cwd: () => process.cwd(),
204
- spawnTaskkill: (args, options) => nodeSpawn("taskkill", args, options),
205
- createProcessTreeKiller,
206
- statSync: (target) => fsSync.statSync(target)
207
- };
208
-
209
- class SpawnCwdMissingError extends Error {
210
- name = "SpawnCwdMissingError";
211
- code = "ENOENT";
212
- cwd;
213
- reason;
214
- executable;
215
- constructor(cwd, reason, executable, options) {
216
- super(reason === "missing" ? `cannot start "${executable}": working directory no longer exists: ${cwd}` : `cannot start "${executable}": working directory is not a directory: ${cwd}`, options);
217
- this.cwd = cwd;
218
- this.reason = reason;
219
- this.executable = executable;
220
- }
221
- }
222
188
  function inspectSpawnCwd(cwd) {
223
189
  try {
224
190
  return _internals.statSync(cwd).isDirectory() ? "directory" : "not-directory";
@@ -243,7 +209,6 @@ function describeSpawnCwdFailure(cwd, executable, cause) {
243
209
  }
244
210
  return null;
245
211
  }
246
- var AMBIGUOUS_SPAWN_CODES = new Set(["ENOENT", "ENOTDIR", "EACCES", "EPERM"]);
247
212
  function spawnErrorCode(err) {
248
213
  if (typeof err !== "object" || err === null || !("code" in err)) {
249
214
  return;
@@ -543,7 +508,6 @@ function mergeEnvForChild(baseEnv, envOverrides) {
543
508
  }
544
509
  return merged;
545
510
  }
546
- var SPAWN_CREATION_FAILURE_EXIT_CODE = 1;
547
511
  function asError(value) {
548
512
  return value instanceof Error ? value : new Error(String(value));
549
513
  }
@@ -800,5 +764,42 @@ function bunSpawnSync(cmd, options) {
800
764
  success: exitCode === 0 && !result.error
801
765
  };
802
766
  }
767
+ var WINDOWS_RENAME_MAX_RETRIES = 3, WINDOWS_RENAME_RETRY_DELAY_MS = 50, tempCounter = 0, DEFAULT_BUN_SPAWN_MAX_BUFFER_BYTES, BunCompatOutputLimitError, _internals, SpawnCwdMissingError, AMBIGUOUS_SPAWN_CODES, SPAWN_CREATION_FAILURE_EXIT_CODE = 1;
768
+ var init_bun_compat = __esm(() => {
769
+ DEFAULT_BUN_SPAWN_MAX_BUFFER_BYTES = 5 * 1024 * 1024;
770
+ BunCompatOutputLimitError = class BunCompatOutputLimitError extends Error {
771
+ limit;
772
+ captured;
773
+ total;
774
+ constructor(limit, captured, total) {
775
+ super(`Subprocess output exceeded the ${limit}-byte buffer limit after capturing ${captured} bytes (${total} bytes observed)`);
776
+ this.name = "BunCompatOutputLimitError";
777
+ this.limit = limit;
778
+ this.captured = captured;
779
+ this.total = total;
780
+ }
781
+ };
782
+ _internals = {
783
+ platform: () => process.platform,
784
+ cwd: () => process.cwd(),
785
+ spawnTaskkill: (args, options) => nodeSpawn("taskkill", args, options),
786
+ createProcessTreeKiller,
787
+ statSync: (target) => fsSync.statSync(target)
788
+ };
789
+ SpawnCwdMissingError = class SpawnCwdMissingError extends Error {
790
+ name = "SpawnCwdMissingError";
791
+ code = "ENOENT";
792
+ cwd;
793
+ reason;
794
+ executable;
795
+ constructor(cwd, reason, executable, options) {
796
+ super(reason === "missing" ? `cannot start "${executable}": working directory no longer exists: ${cwd}` : `cannot start "${executable}": working directory is not a directory: ${cwd}`, options);
797
+ this.cwd = cwd;
798
+ this.reason = reason;
799
+ this.executable = executable;
800
+ }
801
+ };
802
+ AMBIGUOUS_SPAWN_CODES = new Set(["ENOENT", "ENOTDIR", "EACCES", "EPERM"]);
803
+ });
803
804
 
804
- export { bunFile, bunWrite, sleep, collectGarbageBestEffort, bunHash, classifySpawnFailure, mergeEnvForChild, bunSpawn, bunSpawnSync };
805
+ export { bunFile, bunWrite, sleep, collectGarbageBestEffort, bunHash, classifySpawnFailure, mergeEnvForChild, bunSpawn, bunSpawnSync, init_bun_compat };
@@ -8,10 +8,10 @@ import {
8
8
  import {
9
9
  canonicalRootKeyFresh,
10
10
  lexicalRootAliasKey
11
- } from "./index-fzpt2djt.js";
11
+ } from "./index-te9hq2f4.js";
12
12
  import {
13
13
  atomicWriteSwarmFileSync
14
- } from "./index-ywb5er8g.js";
14
+ } from "./index-270zfq1f.js";
15
15
 
16
16
  // src/db/project-db.ts
17
17
  import { existsSync, mkdirSync, unlinkSync } from "fs";
@@ -1,4 +1,8 @@
1
1
  // @bun
2
+ import {
3
+ bunSpawn,
4
+ init_bun_compat
5
+ } from "./index-qbxk2rn6.js";
2
6
  import {
3
7
  init_logger,
4
8
  log
@@ -220,7 +224,11 @@ function probeCandidate(candidatePath, platform) {
220
224
  };
221
225
  }
222
226
  if (result.error) {
223
- return { accepted: false, reason: `spawn failed: ${result.error.message}` };
227
+ return {
228
+ accepted: false,
229
+ reason: `spawn failed: ${result.error.message}`,
230
+ timedOut: result.error.code === "ETIMEDOUT"
231
+ };
224
232
  }
225
233
  if (result.status !== 0) {
226
234
  const statusDescription = result.status !== null ? `exit ${result.status}` : `signal ${result.signal ?? "unknown"}`;
@@ -242,6 +250,7 @@ function probeCandidate(candidatePath, platform) {
242
250
  function* probeCycle(candidates, platform, attempts) {
243
251
  const start = _internals.now();
244
252
  let budgetExceeded = false;
253
+ let sawTimeout = false;
245
254
  for (const candidate of candidates) {
246
255
  if (_internals.now() - start > TOTAL_BUDGET_MS) {
247
256
  budgetExceeded = true;
@@ -254,6 +263,8 @@ function* probeCycle(candidates, platform, attempts) {
254
263
  accepted: result.accepted,
255
264
  reason: result.reason
256
265
  });
266
+ if (result.timedOut)
267
+ sawTimeout = true;
257
268
  if (candidate.source === "override" && !result.accepted) {
258
269
  advisoryWarn(`[opencode-swarm] git.binary override "${candidate.path}" is unusable (${result.reason}); falling back to automatic git resolution.`);
259
270
  }
@@ -262,7 +273,7 @@ function* probeCycle(candidates, platform, attempts) {
262
273
  }
263
274
  yield;
264
275
  }
265
- return budgetExceeded ? { outcome: "exhausted-budget" } : { outcome: "all-rejected" };
276
+ return budgetExceeded ? { outcome: "exhausted-budget", sawTimeout } : { outcome: "all-rejected", sawTimeout };
266
277
  }
267
278
  function driveSync(gen) {
268
279
  let step = gen.next();
@@ -271,13 +282,120 @@ function driveSync(gen) {
271
282
  }
272
283
  return step.value;
273
284
  }
274
- async function driveAsync(gen) {
275
- let step = gen.next();
276
- while (!step.done) {
285
+ async function probeCandidateAsync(candidatePath, platform, probeTimeoutMs = PER_PROBE_TIMEOUT_MS) {
286
+ if (!isAbsoluteForPlatform(candidatePath, platform)) {
287
+ return { accepted: false, reason: "not an absolute path" };
288
+ }
289
+ let stat;
290
+ try {
291
+ stat = fs.statSync(candidatePath);
292
+ } catch (err) {
293
+ const code = err?.code;
294
+ if (code === "ENOENT")
295
+ return { accepted: false, reason: "no such file" };
296
+ return {
297
+ accepted: false,
298
+ reason: `cannot stat (${code ?? "unknown error"})`
299
+ };
300
+ }
301
+ if (stat.isDirectory()) {
302
+ return { accepted: false, reason: "is a directory" };
303
+ }
304
+ if (!stat.isFile()) {
305
+ return { accepted: false, reason: "not a regular file" };
306
+ }
307
+ let proc;
308
+ let timer;
309
+ try {
310
+ proc = _internals.asyncSpawn([candidatePath, "--version"], {
311
+ cwd: os.tmpdir(),
312
+ stdin: "ignore",
313
+ stdout: "pipe",
314
+ stderr: "ignore",
315
+ killProcessTree: true,
316
+ maxBuffer: PROBE_MAX_BUFFER_BYTES
317
+ });
318
+ if (proc.spawnError) {
319
+ return {
320
+ accepted: false,
321
+ reason: `spawn failed: ${proc.spawnError.message}`,
322
+ timedOut: proc.spawnError.code === "ETIMEDOUT"
323
+ };
324
+ }
325
+ const completed = (async () => {
326
+ const [exitCode, stdout] = await Promise.all([
327
+ proc.exited,
328
+ proc.stdout.text()
329
+ ]);
330
+ return { kind: "completed", exitCode, stdout };
331
+ })();
332
+ completed.catch(() => {});
333
+ const result = await Promise.race([
334
+ completed,
335
+ new Promise((resolve) => {
336
+ timer = setTimeout(() => resolve({ kind: "timeout" }), probeTimeoutMs);
337
+ })
338
+ ]);
339
+ if (result.kind === "timeout") {
340
+ return { accepted: false, reason: "spawn timed out", timedOut: true };
341
+ }
342
+ if (result.exitCode !== 0) {
343
+ const statusDescription = result.exitCode !== null ? `exit ${result.exitCode}` : `signal ${proc.signalCode ?? "unknown"}`;
344
+ return {
345
+ accepted: false,
346
+ reason: `git --version returned ${statusDescription}`
347
+ };
348
+ }
349
+ const versionOutput = result.stdout.trim();
350
+ if (!GIT_VERSION_PATTERN.test(versionOutput)) {
351
+ const excerpt = excerptProbeOutput(versionOutput);
352
+ return {
353
+ accepted: false,
354
+ reason: excerpt ? `not git: --version printed "${excerpt}"` : "not git: --version printed nothing"
355
+ };
356
+ }
357
+ return { accepted: true };
358
+ } catch (err) {
359
+ return {
360
+ accepted: false,
361
+ reason: `spawn threw: ${err instanceof Error ? err.message : String(err)}`
362
+ };
363
+ } finally {
364
+ if (timer)
365
+ clearTimeout(timer);
366
+ try {
367
+ proc?.kill("SIGKILL");
368
+ } catch {}
369
+ }
370
+ }
371
+ async function probeCycleAsync(candidates, platform, attempts) {
372
+ const start = _internals.now();
373
+ let budgetExceeded = false;
374
+ let sawTimeout = false;
375
+ for (const candidate of candidates) {
376
+ const remainingBudgetMs = TOTAL_BUDGET_MS - (_internals.now() - start);
377
+ if (remainingBudgetMs <= 0) {
378
+ budgetExceeded = true;
379
+ break;
380
+ }
381
+ const result = await probeCandidateAsync(candidate.path, platform, Math.min(PER_PROBE_TIMEOUT_MS, remainingBudgetMs));
382
+ attempts.push({
383
+ source: candidate.source,
384
+ candidate: candidate.path,
385
+ accepted: result.accepted,
386
+ reason: result.reason
387
+ });
388
+ if (result.timedOut)
389
+ sawTimeout = true;
390
+ if (candidate.source === "override" && !result.accepted) {
391
+ advisoryWarn(`[opencode-swarm] git.binary override "${candidate.path}" is unusable (${result.reason}); falling back to automatic git resolution.`);
392
+ }
393
+ if (result.accepted) {
394
+ return { outcome: "accepted", path: candidate.path };
395
+ }
277
396
  await _internals.yieldToEventLoop();
278
- step = gen.next();
279
397
  }
280
- return step.value;
398
+ return budgetExceeded ? { outcome: "exhausted-budget", sawTimeout } : { outcome: "all-rejected", sawTimeout };
281
399
  }
282
400
  function readCache() {
283
401
  if (cache === null)
@@ -298,6 +416,9 @@ function applyProbeResult(result, attempts, generation) {
298
416
  cache = { kind: "success", path: result.path };
299
417
  return result.path;
300
418
  }
419
+ if (result.sawTimeout) {
420
+ return BARE_GIT;
421
+ }
301
422
  cache = {
302
423
  kind: "fallback",
303
424
  expiresAt: _internals.now() + NEGATIVE_CACHE_TTL_MS
@@ -326,7 +447,7 @@ async function resolveGitExecutableAsync() {
326
447
  const generation = cacheGeneration;
327
448
  const candidates = buildCandidates(platform);
328
449
  const run = (async () => {
329
- const result = await driveAsync(probeCycle(candidates, platform, attempts));
450
+ const result = await probeCycleAsync(candidates, platform, attempts);
330
451
  return applyProbeResult(result, attempts, generation);
331
452
  })();
332
453
  inFlightAsync = run;
@@ -350,12 +471,14 @@ function describeGitResolution() {
350
471
  var GIT_BINARY_ENV_VAR = "OPENCODE_SWARM_GIT_BINARY", PER_PROBE_TIMEOUT_MS = 250, TOTAL_BUDGET_MS = 1000, NEGATIVE_CACHE_TTL_MS = 60000, BARE_GIT = "git", PROBE_MAX_BUFFER_BYTES, WINDOWS_PATH_EXTENSIONS, GIT_VERSION_PATTERN, PROBE_OUTPUT_EXCERPT_CHARS = 60, cache = null, lastAttempts, configuredOverride, inFlightAsync = null, cacheGeneration = 0, _internals;
351
472
  var init_git_executable = __esm(() => {
352
473
  init_warning_buffer();
474
+ init_bun_compat();
353
475
  PROBE_MAX_BUFFER_BYTES = 64 * 1024;
354
476
  WINDOWS_PATH_EXTENSIONS = [".exe", ".cmd", ".bat"];
355
477
  GIT_VERSION_PATTERN = /^git version \d+\.\d+/;
356
478
  lastAttempts = [];
357
479
  _internals = {
358
480
  spawnSync,
481
+ asyncSpawn: bunSpawn,
359
482
  platform: () => process.platform,
360
483
  env: () => process.env,
361
484
  now: () => Date.now(),