opencode-swarm 7.144.3 → 7.144.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 (127) hide show
  1. package/.opencode/skills/swarm-pr-review/SKILL.md +3 -1
  2. package/.opencode/skills/swarm-pr-review/references/lane-output-recoverability.md +28 -0
  3. package/.opencode/skills/swarm-pr-review/references/prompt-templates.md +2 -0
  4. package/README.md +3 -1
  5. package/dist/background/pending-delegations.d.ts +14 -0
  6. package/dist/background/workspace-snapshot.d.ts +7 -0
  7. package/dist/cli/{capability-probe-f1paszww.js → capability-probe-976tt4ba.js} +6 -2
  8. package/dist/cli/{config-doctor-pkr9w2nv.js → config-doctor-m005xfdt.js} +3 -3
  9. package/dist/cli/{core-7pymdx0b.js → core-6vdtfb8s.js} +4 -3
  10. package/dist/cli/{curation-policy-y1pqpztb.js → curation-policy-a511r0qz.js} +6 -6
  11. package/dist/cli/{curator-wbzcjd0q.js → curator-0t87anp5.js} +35 -34
  12. package/dist/cli/{curator-drift-2jbjv03a.js → curator-drift-ckjm272w.js} +2 -2
  13. package/dist/cli/curator-llm-factory-j8tk9rxm.js +63 -0
  14. package/dist/cli/{dispatch-1y1rnv1h.js → dispatch-ndxbsk98.js} +2 -2
  15. package/dist/cli/{evidence-summary-service-rcgrdm52.js → evidence-summary-service-c22gahjc.js} +15 -14
  16. package/dist/cli/{gate-evidence-jmzctnhg.js → gate-evidence-hh8kc9wt.js} +9 -8
  17. package/dist/cli/guardrail-explain-9gjw2dsd.js +64 -0
  18. package/dist/cli/{guardrail-log-k1s9xf3h.js → guardrail-log-ejf5zjac.js} +5 -5
  19. package/dist/cli/{hive-promoter-vcj5h0e3.js → hive-promoter-gkbfpdtv.js} +35 -34
  20. package/dist/cli/{index-s2rcz51a.js → index-1jsmmx7y.js} +66 -34
  21. package/dist/cli/{index-qj22wyw2.js → index-1pxqkvvq.js} +3 -3
  22. package/dist/cli/{index-p863y7xx.js → index-3qdzpv91.js} +1 -1
  23. package/dist/cli/{index-8hkjk37c.js → index-58cvm3dw.js} +36 -1
  24. package/dist/cli/{index-ghzvxj3g.js → index-5wenr2vs.js} +40 -37
  25. package/dist/cli/{index-wck434f8.js → index-63tgh0cn.js} +15 -4
  26. package/dist/cli/{index-xwpmxpb7.js → index-641yjpk8.js} +6 -6
  27. package/dist/cli/{index-zwrqe065.js → index-6z5jtf7d.js} +2 -2
  28. package/dist/cli/{index-j6mfyy0a.js → index-7e4q41nb.js} +3 -3
  29. package/dist/cli/{index-6s2q144w.js → index-855hseq4.js} +43 -22
  30. package/dist/cli/index-9e6fdz2h.js +282 -0
  31. package/dist/cli/{index-zswmbm15.js → index-9s8drsf9.js} +2 -2
  32. package/dist/cli/{index-x68tw7v3.js → index-a1hxejxc.js} +168 -36
  33. package/dist/cli/{index-b6e016tv.js → index-abtrcs16.js} +1 -1
  34. package/dist/cli/{index-8fwhhayc.js → index-b44qqqt2.js} +27 -18
  35. package/dist/cli/{index-k3cxyk66.js → index-cwtpqm5f.js} +1 -1
  36. package/dist/cli/{index-2en8s72h.js → index-dc04v786.js} +30 -2
  37. package/dist/cli/{index-7554tecy.js → index-dtbzyr3s.js} +2 -2
  38. package/dist/cli/{index-eya357bk.js → index-ea09xax6.js} +5 -5
  39. package/dist/cli/{index-74hpm6sh.js → index-f36ybbsv.js} +12 -6
  40. package/dist/cli/{index-wd24zn2e.js → index-f9vvg5xb.js} +1 -1
  41. package/dist/cli/{index-rn0eq85g.js → index-fv0s19g9.js} +1 -1
  42. package/dist/cli/{index-ep14xc5z.js → index-fv2pzwnp.js} +6 -5
  43. package/dist/cli/{index-dpfphnmy.js → index-h1p08s3n.js} +1 -1
  44. package/dist/cli/{index-584grrwn.js → index-hkdgkkhb.js} +2 -2
  45. package/dist/cli/{index-1brb14xc.js → index-kdak6s63.js} +12 -6
  46. package/dist/cli/{index-satc0vs6.js → index-kh0jt9pg.js} +300 -1181
  47. package/dist/cli/{index-p7hbphaq.js → index-mkmcz6x8.js} +4 -4
  48. package/dist/cli/{index-krxcxkdq.js → index-n4hwcsbd.js} +20 -5
  49. package/dist/cli/{index-06cn7haa.js → index-rdgtfj74.js} +2 -2
  50. package/dist/cli/{index-b227mpnk.js → index-rnyt30tm.js} +4 -4
  51. package/dist/cli/{index-whezv7vc.js → index-v3y3qg48.js} +1 -1
  52. package/dist/cli/{index-0fgwdtvp.js → index-vdha477y.js} +1 -1
  53. package/dist/cli/{index-pr8vhj6j.js → index-wbrqvm2g.js} +8 -8
  54. package/dist/cli/{index-8214dd7j.js → index-wknz5c8q.js} +2 -2
  55. package/dist/cli/{index-pag8nsb1.js → index-wm6f7t7w.js} +3 -3
  56. package/dist/cli/{index-247wf23m.js → index-wmsehjq6.js} +2847 -1791
  57. package/dist/cli/{index-4nt52yr9.js → index-zj6t9zgx.js} +173 -25
  58. package/dist/cli/index-zy7f84cs.js +1210 -0
  59. package/dist/cli/index.d.ts +11 -1
  60. package/dist/cli/index.js +64 -42
  61. package/dist/cli/{knowledge-escalator-x6jrcrwj.js → knowledge-escalator-1d79m1tr.js} +14 -13
  62. package/dist/cli/{knowledge-events-aw22r72m.js → knowledge-events-ces29ncg.js} +12 -11
  63. package/dist/cli/{knowledge-link-bntppte4.js → knowledge-link-4cg4776a.js} +5 -5
  64. package/dist/cli/{knowledge-store-19xg1rw1.js → knowledge-store-pe8webc2.js} +6 -6
  65. package/dist/cli/{knowledge-validator-8wh82z0a.js → knowledge-validator-4yjf1f7k.js} +8 -8
  66. package/dist/cli/{pending-delegations-1y303j3k.js → pending-delegations-9h1jmtw1.js} +5 -5
  67. package/dist/cli/{pr-subscriptions-wvd041rp.js → pr-subscriptions-8pg34pev.js} +5 -5
  68. package/dist/cli/{runner-jn55k8xb.js → runner-cqecp1na.js} +6 -6
  69. package/dist/cli/{scan-cursor-429r5db9.js → scan-cursor-d6exjmqj.js} +9 -7
  70. package/dist/cli/{schema-jdwjcby0.js → schema-2esybebd.js} +4 -2
  71. package/dist/cli/{scope-persistence-s0s1bz15.js → scope-persistence-ej59x0yc.js} +9 -8
  72. package/dist/cli/{skill-generator-ffbj0ye5.js → skill-generator-yqta3yrg.js} +16 -15
  73. package/dist/cli/{telemetry-xyfb5vm8.js → telemetry-cybx6cfz.js} +1 -1
  74. package/dist/cli/{workspace-snapshot-w3tg4ne5.js → workspace-snapshot-d89zm6wm.js} +5 -2
  75. package/dist/cli/{worktree-collision-ownership-z5ftwjz3.js → worktree-collision-ownership-vy0kxa98.js} +28 -21
  76. package/dist/cli/{worktree-isolation-y2p93438.js → worktree-isolation-rwq0kke7.js} +35 -34
  77. package/dist/cli/{worktree-provisioning-owner-g24xd417.js → worktree-provisioning-owner-zzkjycp1.js} +3 -3
  78. package/dist/commands/ci-simulate.d.ts +2 -0
  79. package/dist/commands/index.d.ts +1 -0
  80. package/dist/commands/recover.d.ts +17 -0
  81. package/dist/commands/registry.d.ts +9 -1
  82. package/dist/commands/reset-session.d.ts +2 -0
  83. package/dist/config/cache-paths.d.ts +57 -0
  84. package/dist/config/evidence-schema.d.ts +3 -3
  85. package/dist/config/schema.d.ts +9 -0
  86. package/dist/git/branch.d.ts +2 -0
  87. package/dist/git/pr.d.ts +2 -0
  88. package/dist/hooks/context-budget.d.ts +4 -0
  89. package/dist/hooks/context-usage.d.ts +48 -0
  90. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +7 -0
  91. package/dist/hooks/diff-scope.d.ts +7 -0
  92. package/dist/hooks/pr-workflow-gate.d.ts +29 -2
  93. package/dist/hooks/review-receipt-scope.d.ts +7 -0
  94. package/dist/hooks/reviewer-scope-lifecycle.d.ts +9 -0
  95. package/dist/hooks/semantic-diff-injection.d.ts +8 -0
  96. package/dist/index.js +607 -591
  97. package/dist/mutation/engine.d.ts +11 -0
  98. package/dist/observability/catalog.d.ts +8 -6
  99. package/dist/review/diff-source.d.ts +2 -0
  100. package/dist/sandbox/capability-probe.d.ts +22 -0
  101. package/dist/sandbox/executor.d.ts +15 -0
  102. package/dist/sandbox/linux/bubblewrap-executor.d.ts +6 -0
  103. package/dist/sandbox/macos/sandbox-exec-executor.d.ts +41 -0
  104. package/dist/sast/semgrep.d.ts +3 -2
  105. package/dist/telemetry.d.ts +17 -1
  106. package/dist/tools/checkpoint.d.ts +11 -0
  107. package/dist/tools/complexity-hotspots.d.ts +15 -0
  108. package/dist/tools/context-status.d.ts +9 -3
  109. package/dist/tools/diff-summary.d.ts +12 -0
  110. package/dist/tools/dispatch-lanes.d.ts +35 -2
  111. package/dist/tools/gh-evidence.d.ts +17 -1
  112. package/dist/tools/knowledge-receipt.d.ts +1 -1
  113. package/dist/tools/pkg-audit.d.ts +13 -0
  114. package/dist/tools/pre-check-batch.d.ts +9 -0
  115. package/dist/tools/prepare-pr-workflow-checkout.d.ts +1 -0
  116. package/dist/tools/sast-scan.d.ts +3 -0
  117. package/dist/utils/bun-compat.d.ts +80 -3
  118. package/dist/utils/git-binary-missing-error.d.ts +80 -2
  119. package/dist/utils/git-executable.d.ts +179 -0
  120. package/dist/utils/gitignore-warning.d.ts +10 -0
  121. package/dist/workflow/coder-settlement.d.ts +92 -0
  122. package/dist/worktree/core.d.ts +8 -0
  123. package/dist/worktree/merge.d.ts +33 -0
  124. package/package.json +3 -2
  125. package/dist/cli/curator-llm-factory-7are9wjh.js +0 -62
  126. package/dist/cli/guardrail-explain-brgw4sve.js +0 -63
  127. package/dist/cli/index-q1exe2b3.js +0 -256
@@ -1,63 +0,0 @@
1
- // @bun
2
- import {
3
- handleGuardrailExplain
4
- } from "./index-06cn7haa.js";
5
- import"./index-247wf23m.js";
6
- import"./index-7554tecy.js";
7
- import"./index-2en8s72h.js";
8
- import"./index-satc0vs6.js";
9
- import"./index-134d35c1.js";
10
- import"./index-b6e016tv.js";
11
- import"./index-zwrqe065.js";
12
- import"./index-8214dd7j.js";
13
- import"./index-y8552snf.js";
14
- import"./index-wck434f8.js";
15
- import"./index-70ha9e09.js";
16
- import"./index-c8s9a3zh.js";
17
- import"./index-9ss2m4rs.js";
18
- import"./index-74hpm6sh.js";
19
- import"./index-584grrwn.js";
20
- import"./index-pag8nsb1.js";
21
- import"./index-eya357bk.js";
22
- import"./index-b227mpnk.js";
23
- import"./index-0fgwdtvp.js";
24
- import"./index-rtry5xyf.js";
25
- import"./index-zsrtt42s.js";
26
- import"./index-krxcxkdq.js";
27
- import"./index-k3cxyk66.js";
28
- import"./index-x68tw7v3.js";
29
- import"./index-6s2q144w.js";
30
- import"./index-p7hbphaq.js";
31
- import"./index-j6mfyy0a.js";
32
- import"./index-556ja8an.js";
33
- import"./index-7sy3aa9m.js";
34
- import"./index-wx8zdh4a.js";
35
- import"./index-8fwhhayc.js";
36
- import"./index-q1exe2b3.js";
37
- import"./index-xwpmxpb7.js";
38
- import"./index-pr8vhj6j.js";
39
- import"./index-qj22wyw2.js";
40
- import"./index-gprxjmm7.js";
41
- import"./index-n832052r.js";
42
- import"./index-rn0eq85g.js";
43
- import"./index-z6xqpmqg.js";
44
- import"./index-8hkjk37c.js";
45
- import"./index-1brb14xc.js";
46
- import"./index-4rhhvd1a.js";
47
- import"./index-whezv7vc.js";
48
- import"./index-zjygnfay.js";
49
- import"./index-ae75rja9.js";
50
- import"./index-dpfphnmy.js";
51
- import"./index-zswmbm15.js";
52
- import"./index-ed5ykebp.js";
53
- import"./index-bk5tah7q.js";
54
- import"./index-wd24zn2e.js";
55
- import"./index-s2rcz51a.js";
56
- import"./index-7g4c7s5r.js";
57
- import"./index-bpmtbmy9.js";
58
- import"./index-4nt52yr9.js";
59
- import"./index-zgwm4ryv.js";
60
- import"./index-a76rekgs.js";
61
- export {
62
- handleGuardrailExplain
63
- };
@@ -1,256 +0,0 @@
1
- // @bun
2
- import {
3
- init_logger,
4
- warn
5
- } from "./index-zgwm4ryv.js";
6
- import {
7
- __esm,
8
- __export
9
- } from "./index-a76rekgs.js";
10
-
11
- // src/sandbox/win32/runner-client.ts
12
- var exports_runner_client = {};
13
- __export(exports_runner_client, {
14
- probe: () => probe,
15
- execute: () => execute,
16
- buildDefaultPolicy: () => buildDefaultPolicy,
17
- _resetProbeCache: () => _resetProbeCache,
18
- _internals: () => _internals,
19
- RUNNER_EXIT_CODES: () => RUNNER_EXIT_CODES
20
- });
21
- import { spawn, spawnSync } from "child_process";
22
- import * as fs from "fs";
23
- import * as os from "os";
24
- import * as path from "path";
25
- import { fileURLToPath } from "url";
26
- function findRunnerBinary() {
27
- const arch = process.arch === "x64" ? "x64" : "arm64";
28
- const platform = "win32";
29
- const packagePaths = [
30
- path.resolve(_runtimeDir, "..", "..", "..", "binaries", `${platform}-${arch}`, "swarm-sandbox-runner.exe"),
31
- path.resolve(_runtimeDir, "..", "..", "..", "..", "binaries", `${platform}-${arch}`, "swarm-sandbox-runner.exe")
32
- ];
33
- for (const p of packagePaths) {
34
- try {
35
- if (fs.existsSync(p)) {
36
- return p;
37
- }
38
- } catch {}
39
- }
40
- try {
41
- const result = spawnSync("where", ["swarm-sandbox-runner.exe"], {
42
- windowsHide: true,
43
- encoding: "utf-8",
44
- timeout: 2000,
45
- stdio: ["ignore", "pipe", "ignore"]
46
- });
47
- if (result.status === 0 && result.stdout?.trim()) {
48
- return result.stdout.trim().split(`
49
- `)[0]?.trim() ?? null;
50
- }
51
- } catch {}
52
- return null;
53
- }
54
- function probe() {
55
- if (_cachedProbe !== undefined) {
56
- return _cachedProbe;
57
- }
58
- if (process.platform !== "win32") {
59
- _cachedProbe = {
60
- available: false,
61
- mode: "none",
62
- capabilities: null,
63
- error: "not Windows"
64
- };
65
- return _cachedProbe;
66
- }
67
- const binary = _internals.findRunnerBinary();
68
- if (!binary) {
69
- _cachedProbe = {
70
- available: false,
71
- mode: "none",
72
- capabilities: null,
73
- error: "runner binary not found"
74
- };
75
- warn("Sandbox runner binary not found \u2014 degrading to weak sandbox");
76
- return _cachedProbe;
77
- }
78
- try {
79
- const result = _internals.spawnRunner(binary, ["--probe"], {
80
- windowsHide: true,
81
- encoding: "utf-8",
82
- timeout: 2000,
83
- stdio: ["ignore", "pipe", "pipe"],
84
- cwd: os.tmpdir()
85
- });
86
- if (result.error) {
87
- _cachedProbe = {
88
- available: false,
89
- mode: "none",
90
- capabilities: null,
91
- error: `probe spawn error: ${result.error.code ?? result.error.message}`
92
- };
93
- warn(`Sandbox runner probe failed: ${_cachedProbe.error}`);
94
- return _cachedProbe;
95
- }
96
- if (result.status !== 0) {
97
- _cachedProbe = {
98
- available: false,
99
- mode: "none",
100
- capabilities: null,
101
- error: `probe exited with code ${result.status}`
102
- };
103
- warn(`Sandbox runner probe failed: ${_cachedProbe.error}`);
104
- return _cachedProbe;
105
- }
106
- const capabilities = JSON.parse(result.stdout?.trim() ?? "{}");
107
- let mode = "none";
108
- if (capabilities.app_container_available) {
109
- mode = "app-container";
110
- } else if (capabilities.restricted_token_available) {
111
- mode = "restricted-token";
112
- }
113
- _cachedProbe = {
114
- available: mode !== "none",
115
- mode,
116
- capabilities
117
- };
118
- return _cachedProbe;
119
- } catch (err) {
120
- const msg = err instanceof Error ? err.message : String(err);
121
- _cachedProbe = {
122
- available: false,
123
- mode: "none",
124
- capabilities: null,
125
- error: `probe threw: ${msg}`
126
- };
127
- warn(`Sandbox runner probe threw: ${msg}`);
128
- return _cachedProbe;
129
- }
130
- }
131
- async function execute(command, policy, mode = "auto") {
132
- const binary = _internals.findRunnerBinary();
133
- if (!binary) {
134
- throw new Error("runner binary not found");
135
- }
136
- const policyJson = JSON.stringify(policy);
137
- const args = ["--policy-stdin", "--mode", mode, "--", ...command];
138
- return new Promise((resolve2, reject) => {
139
- let proc;
140
- const timeout = setTimeout(() => {
141
- proc?.kill();
142
- reject(new Error("runner execution timeout"));
143
- }, policy.wall_clock_timeout_ms + 5000);
144
- const unref = timeout.unref;
145
- if (typeof unref === "function") {
146
- unref.call(timeout);
147
- }
148
- try {
149
- proc = _internals.spawnAsync(binary, args, {
150
- windowsHide: true,
151
- stdio: ["pipe", "pipe", "pipe"],
152
- cwd: policy.workspace_roots[0] ?? os.tmpdir()
153
- });
154
- } catch (err) {
155
- clearTimeout(timeout);
156
- reject(err);
157
- return;
158
- }
159
- proc.stdin?.write(policyJson);
160
- proc.stdin?.end();
161
- let stdout = "";
162
- let stderr = "";
163
- const events = [];
164
- proc.stdout?.on("data", (chunk) => {
165
- stdout += chunk.toString();
166
- });
167
- proc.stderr?.on("data", (chunk) => {
168
- const lines = chunk.toString().split(`
169
- `);
170
- for (const line of lines) {
171
- const trimmed = line.trim();
172
- if (!trimmed)
173
- continue;
174
- try {
175
- const event = JSON.parse(trimmed);
176
- if (event.type) {
177
- events.push(event);
178
- continue;
179
- }
180
- } catch {}
181
- stderr += `${trimmed}
182
- `;
183
- }
184
- });
185
- proc.on("error", (err) => {
186
- clearTimeout(timeout);
187
- reject(err);
188
- });
189
- proc.on("close", (code) => {
190
- clearTimeout(timeout);
191
- const startEvent = events.find((e) => e.type === "start");
192
- const runnerMode = startEvent?.mode ?? mode;
193
- resolve2({
194
- exitCode: code ?? 1,
195
- stdout,
196
- stderr,
197
- events,
198
- mode: runnerMode
199
- });
200
- });
201
- });
202
- }
203
- function _resetProbeCache() {
204
- _cachedProbe = undefined;
205
- }
206
- function buildDefaultPolicy(workspaceRoot, runId) {
207
- const id = runId ?? `swarm-${crypto.randomUUID?.() ?? Date.now()}`;
208
- const appData = process.env.LOCALAPPDATA ?? path.join(os.homedir(), "AppData", "Local");
209
- const tempRoot = path.join(appData, "opencode-swarm", "sandbox", id, "temp");
210
- return {
211
- schema_version: 1,
212
- run_id: id,
213
- workspace_roots: [workspaceRoot],
214
- writable_roots: [workspaceRoot],
215
- read_only_subpaths: [".git", ".codex", ".agents", ".swarm"],
216
- temp_root: tempRoot,
217
- temp_cap_bytes: 524288000,
218
- memory_cap_bytes: 2147483648,
219
- child_process_cap: 16,
220
- wall_clock_timeout_ms: 600000,
221
- network_mode: "off",
222
- env_allowlist: ["PATH", "TEMP", "TMP", "USERPROFILE", "SYSTEMROOT"],
223
- env_overrides: {
224
- HTTP_PROXY: "http://127.0.0.1:1",
225
- HTTPS_PROXY: "http://127.0.0.1:1"
226
- },
227
- path_stubs: ["ssh.exe", "curl.exe", "wget.exe", "scp.exe", "sftp.exe"],
228
- private_desktop: true,
229
- deny_alternate_data_streams: true,
230
- deny_unc_paths: true,
231
- deny_device_paths: true,
232
- deny_symlink_egress: true
233
- };
234
- }
235
- var _runtimeDir, RUNNER_EXIT_CODES, _cachedProbe, _internals;
236
- var init_runner_client = __esm(() => {
237
- init_logger();
238
- _runtimeDir = fileURLToPath(new URL(".", import.meta.url));
239
- RUNNER_EXIT_CODES = {
240
- SUCCESS: 0,
241
- CHILD_NON_ZERO: 1,
242
- POLICY_VIOLATION: 64,
243
- QUOTA_EXCEEDED: 65,
244
- WALL_CLOCK_TIMEOUT: 66,
245
- LAUNCHER_MISCONFIG: 67,
246
- OS_API_FAILURE: 68,
247
- PROBE_FAILED: 69
248
- };
249
- _internals = {
250
- findRunnerBinary,
251
- spawnRunner: spawnSync,
252
- spawnAsync: spawn
253
- };
254
- });
255
-
256
- export { _internals, probe, execute, buildDefaultPolicy, exports_runner_client, init_runner_client };