opencode-swarm 7.144.4 → 7.144.6
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/.opencode/skills/swarm-pr-review/references/prompt-templates.md +2 -2
- package/dist/background/workspace-snapshot.d.ts +7 -0
- package/dist/cli/{capability-probe-f1paszww.js → capability-probe-976tt4ba.js} +6 -2
- package/dist/cli/{config-doctor-rw9zrjk6.js → config-doctor-4chz0b95.js} +2 -2
- package/dist/cli/{core-zjx9aqaf.js → core-p04nvknr.js} +4 -3
- package/dist/cli/{curation-policy-0wbrh11c.js → curation-policy-a511r0qz.js} +4 -4
- package/dist/cli/{curator-drift-2jbjv03a.js → curator-drift-ckjm272w.js} +2 -2
- package/dist/cli/curator-llm-factory-vc1mrc3r.js +63 -0
- package/dist/cli/{curator-g54a7wv0.js → curator-sxeh36gw.js} +33 -32
- package/dist/cli/{dispatch-1y1rnv1h.js → dispatch-ndxbsk98.js} +2 -2
- package/dist/cli/{evidence-summary-service-fnr5y54e.js → evidence-summary-service-spyxcgsx.js} +13 -12
- package/dist/cli/{gate-evidence-2xt1x07r.js → gate-evidence-nz0bwa15.js} +7 -6
- package/dist/cli/guardrail-explain-ass47kn8.js +64 -0
- package/dist/cli/{guardrail-log-5w4b9zrw.js → guardrail-log-fyzd55fp.js} +4 -4
- package/dist/cli/{hive-promoter-x63ehffd.js → hive-promoter-k8gtah3n.js} +33 -32
- package/dist/cli/{index-h98t1m88.js → index-01nhedm7.js} +29 -1
- package/dist/cli/{index-q4ed1jk7.js → index-42ezdzam.js} +1994 -1333
- package/dist/cli/{index-y8j8ehc8.js → index-68mqwvf5.js} +11 -5
- package/dist/cli/{index-1csyxv0f.js → index-6z5jtf7d.js} +2 -2
- package/dist/cli/{index-2m7mavaz.js → index-7zehmnv1.js} +2 -2
- package/dist/cli/index-9e6fdz2h.js +282 -0
- package/dist/cli/{index-mazgg5s2.js → index-9s8drsf9.js} +1 -1
- package/dist/cli/{index-b6e016tv.js → index-abtrcs16.js} +1 -1
- package/dist/cli/{index-8fwhhayc.js → index-b44qqqt2.js} +27 -18
- package/dist/cli/{index-yts89pqg.js → index-bac12jpv.js} +4 -4
- package/dist/cli/{index-psvxq93b.js → index-ckq719fr.js} +2 -2
- package/dist/cli/{index-k3cxyk66.js → index-cwtpqm5f.js} +1 -1
- package/dist/cli/{index-d12jd5mn.js → index-dj8cah6s.js} +1 -1
- package/dist/cli/{index-pw83zgny.js → index-dvybg11w.js} +3 -3
- package/dist/cli/{index-03pv47h2.js → index-ec1kywxg.js} +6 -6
- package/dist/cli/{index-74hpm6sh.js → index-f36ybbsv.js} +12 -6
- package/dist/cli/{index-az8etqpp.js → index-fgdhf6a5.js} +298 -1179
- package/dist/cli/{index-rn0eq85g.js → index-fv0s19g9.js} +1 -1
- package/dist/cli/{index-ywn7vtxp.js → index-h1p08s3n.js} +1 -1
- package/dist/cli/{index-nckg4gxb.js → index-h5krb653.js} +15 -4
- package/dist/cli/{index-bt9aa01f.js → index-hkdgkkhb.js} +1 -1
- package/dist/cli/{index-p7cm3gtj.js → index-jqvsh0g3.js} +35 -34
- package/dist/cli/{index-x6tp0hfr.js → index-n06653nr.js} +5 -5
- package/dist/cli/{index-jabkn643.js → index-n4hwcsbd.js} +2 -2
- package/dist/cli/{index-z6v7kwpa.js → index-q6bhmyxb.js} +1 -1
- package/dist/cli/{index-cz25e8xp.js → index-sqe3nqh5.js} +166 -34
- package/dist/cli/{index-q67jb94n.js → index-sswzhcqb.js} +1 -1
- package/dist/cli/{index-8j0va7jp.js → index-tq89td7b.js} +43 -22
- package/dist/cli/{index-dty5qgk2.js → index-vdha477y.js} +1 -1
- package/dist/cli/{index-zb0xcz9t.js → index-vngs0meh.js} +3 -3
- package/dist/cli/{index-fqcjragy.js → index-wknz5c8q.js} +1 -1
- package/dist/cli/{index-9qq7c18c.js → index-ytzz6pq1.js} +36 -1
- package/dist/cli/{index-4w5qdbk7.js → index-zde2mkmg.js} +6 -6
- package/dist/cli/{index-4nt52yr9.js → index-zj6t9zgx.js} +173 -25
- package/dist/cli/{index-btmsqv7p.js → index-zxr5r9b7.js} +5 -4
- package/dist/cli/index-zy7f84cs.js +1210 -0
- package/dist/cli/index.d.ts +11 -1
- package/dist/cli/index.js +61 -39
- package/dist/cli/{knowledge-escalator-ypg14d5r.js → knowledge-escalator-yaxzz0k5.js} +12 -11
- package/dist/cli/{knowledge-events-nkrym4wb.js → knowledge-events-rgcwewpn.js} +10 -9
- package/dist/cli/{knowledge-link-e4qgqmpx.js → knowledge-link-4cg4776a.js} +3 -3
- package/dist/cli/{knowledge-store-vh3nhtg2.js → knowledge-store-qf8t25sw.js} +4 -4
- package/dist/cli/{knowledge-validator-jrxvexv6.js → knowledge-validator-dx6zzcdf.js} +6 -6
- package/dist/cli/{pending-delegations-pw79c8ds.js → pending-delegations-9h1jmtw1.js} +3 -3
- package/dist/cli/{pr-subscriptions-fk628bhc.js → pr-subscriptions-8pg34pev.js} +3 -3
- package/dist/cli/{runner-b02sz2vx.js → runner-cqecp1na.js} +4 -4
- package/dist/cli/{scan-cursor-fp7w5jmc.js → scan-cursor-pbcaj8hj.js} +7 -5
- package/dist/cli/{schema-rptwqbm4.js → schema-tzcjwe8j.js} +3 -1
- package/dist/cli/{scope-persistence-0bkaxawa.js → scope-persistence-mjg4we75.js} +7 -6
- package/dist/cli/{skill-generator-nh8b4gjv.js → skill-generator-7jrzbaej.js} +14 -13
- package/dist/cli/{workspace-snapshot-w3tg4ne5.js → workspace-snapshot-d89zm6wm.js} +5 -2
- package/dist/cli/{worktree-collision-ownership-hqd9ypsz.js → worktree-collision-ownership-vy0kxa98.js} +26 -19
- package/dist/cli/{worktree-isolation-canf3rj8.js → worktree-isolation-awpkp0yh.js} +33 -32
- package/dist/cli/{worktree-provisioning-owner-g24xd417.js → worktree-provisioning-owner-zzkjycp1.js} +3 -3
- package/dist/commands/ci-simulate.d.ts +2 -0
- package/dist/config/cache-paths.d.ts +57 -0
- package/dist/config/evidence-schema.d.ts +3 -3
- package/dist/config/schema.d.ts +9 -0
- package/dist/git/branch.d.ts +2 -0
- package/dist/git/pr.d.ts +2 -0
- package/dist/hooks/delegation-gate/worktree-isolation.d.ts +7 -0
- package/dist/hooks/diff-scope.d.ts +7 -0
- package/dist/hooks/review-receipt-scope.d.ts +7 -0
- package/dist/hooks/reviewer-scope-lifecycle.d.ts +9 -0
- package/dist/hooks/semantic-diff-injection.d.ts +8 -0
- package/dist/index.js +599 -589
- package/dist/mutation/engine.d.ts +11 -0
- package/dist/review/diff-source.d.ts +2 -0
- package/dist/sandbox/capability-probe.d.ts +22 -0
- package/dist/sandbox/executor.d.ts +15 -0
- package/dist/sandbox/linux/bubblewrap-executor.d.ts +6 -0
- package/dist/sandbox/macos/sandbox-exec-executor.d.ts +41 -0
- package/dist/tools/checkpoint.d.ts +11 -0
- package/dist/tools/complexity-hotspots.d.ts +15 -0
- package/dist/tools/diff-summary.d.ts +12 -0
- package/dist/tools/dispatch-lanes.d.ts +8 -0
- package/dist/tools/gh-evidence.d.ts +17 -1
- package/dist/tools/knowledge-receipt.d.ts +1 -1
- package/dist/tools/pkg-audit.d.ts +13 -0
- package/dist/tools/prepare-pr-workflow-checkout.d.ts +1 -0
- package/dist/utils/bun-compat.d.ts +80 -3
- package/dist/utils/git-binary-missing-error.d.ts +80 -2
- package/dist/utils/git-executable.d.ts +179 -0
- package/dist/utils/gitignore-warning.d.ts +10 -0
- package/dist/workflow/coder-settlement.d.ts +18 -0
- package/dist/worktree/core.d.ts +8 -0
- package/dist/worktree/merge.d.ts +33 -0
- package/package.json +3 -2
- package/dist/cli/curator-llm-factory-xgb4pxmm.js +0 -62
- package/dist/cli/guardrail-explain-6wcgr9tz.js +0 -63
- package/dist/cli/index-q1exe2b3.js +0 -256
|
@@ -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 };
|