opencode-swarm 7.144.4 → 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 (106) hide show
  1. package/.opencode/skills/swarm-pr-review/references/prompt-templates.md +2 -2
  2. package/dist/background/workspace-snapshot.d.ts +7 -0
  3. package/dist/cli/{capability-probe-f1paszww.js → capability-probe-976tt4ba.js} +6 -2
  4. package/dist/cli/{config-doctor-rw9zrjk6.js → config-doctor-m005xfdt.js} +2 -2
  5. package/dist/cli/{core-zjx9aqaf.js → core-6vdtfb8s.js} +4 -3
  6. package/dist/cli/{curation-policy-0wbrh11c.js → curation-policy-a511r0qz.js} +4 -4
  7. package/dist/cli/{curator-g54a7wv0.js → curator-0t87anp5.js} +33 -32
  8. package/dist/cli/{curator-drift-2jbjv03a.js → curator-drift-ckjm272w.js} +2 -2
  9. package/dist/cli/curator-llm-factory-j8tk9rxm.js +63 -0
  10. package/dist/cli/{dispatch-1y1rnv1h.js → dispatch-ndxbsk98.js} +2 -2
  11. package/dist/cli/{evidence-summary-service-fnr5y54e.js → evidence-summary-service-c22gahjc.js} +13 -12
  12. package/dist/cli/{gate-evidence-2xt1x07r.js → gate-evidence-hh8kc9wt.js} +7 -6
  13. package/dist/cli/guardrail-explain-9gjw2dsd.js +64 -0
  14. package/dist/cli/{guardrail-log-5w4b9zrw.js → guardrail-log-ejf5zjac.js} +4 -4
  15. package/dist/cli/{hive-promoter-x63ehffd.js → hive-promoter-gkbfpdtv.js} +33 -32
  16. package/dist/cli/{index-psvxq93b.js → index-1pxqkvvq.js} +2 -2
  17. package/dist/cli/{index-q67jb94n.js → index-3qdzpv91.js} +1 -1
  18. package/dist/cli/{index-9qq7c18c.js → index-58cvm3dw.js} +36 -1
  19. package/dist/cli/{index-p7cm3gtj.js → index-5wenr2vs.js} +35 -34
  20. package/dist/cli/{index-nckg4gxb.js → index-63tgh0cn.js} +15 -4
  21. package/dist/cli/{index-03pv47h2.js → index-641yjpk8.js} +6 -6
  22. package/dist/cli/{index-1csyxv0f.js → index-6z5jtf7d.js} +2 -2
  23. package/dist/cli/{index-z6v7kwpa.js → index-7e4q41nb.js} +1 -1
  24. package/dist/cli/{index-8j0va7jp.js → index-855hseq4.js} +43 -22
  25. package/dist/cli/index-9e6fdz2h.js +282 -0
  26. package/dist/cli/{index-mazgg5s2.js → index-9s8drsf9.js} +1 -1
  27. package/dist/cli/{index-cz25e8xp.js → index-a1hxejxc.js} +166 -34
  28. package/dist/cli/{index-b6e016tv.js → index-abtrcs16.js} +1 -1
  29. package/dist/cli/{index-8fwhhayc.js → index-b44qqqt2.js} +27 -18
  30. package/dist/cli/{index-k3cxyk66.js → index-cwtpqm5f.js} +1 -1
  31. package/dist/cli/{index-h98t1m88.js → index-dc04v786.js} +29 -1
  32. package/dist/cli/{index-d12jd5mn.js → index-dtbzyr3s.js} +1 -1
  33. package/dist/cli/{index-x6tp0hfr.js → index-ea09xax6.js} +5 -5
  34. package/dist/cli/{index-74hpm6sh.js → index-f36ybbsv.js} +12 -6
  35. package/dist/cli/{index-rn0eq85g.js → index-fv0s19g9.js} +1 -1
  36. package/dist/cli/{index-btmsqv7p.js → index-fv2pzwnp.js} +5 -4
  37. package/dist/cli/{index-ywn7vtxp.js → index-h1p08s3n.js} +1 -1
  38. package/dist/cli/{index-bt9aa01f.js → index-hkdgkkhb.js} +1 -1
  39. package/dist/cli/{index-y8j8ehc8.js → index-kdak6s63.js} +11 -5
  40. package/dist/cli/{index-az8etqpp.js → index-kh0jt9pg.js} +298 -1179
  41. package/dist/cli/{index-pw83zgny.js → index-mkmcz6x8.js} +3 -3
  42. package/dist/cli/{index-jabkn643.js → index-n4hwcsbd.js} +2 -2
  43. package/dist/cli/{index-2m7mavaz.js → index-rdgtfj74.js} +2 -2
  44. package/dist/cli/{index-yts89pqg.js → index-rnyt30tm.js} +4 -4
  45. package/dist/cli/{index-dty5qgk2.js → index-vdha477y.js} +1 -1
  46. package/dist/cli/{index-4w5qdbk7.js → index-wbrqvm2g.js} +6 -6
  47. package/dist/cli/{index-fqcjragy.js → index-wknz5c8q.js} +1 -1
  48. package/dist/cli/{index-zb0xcz9t.js → index-wm6f7t7w.js} +3 -3
  49. package/dist/cli/{index-q4ed1jk7.js → index-wmsehjq6.js} +1994 -1333
  50. package/dist/cli/{index-4nt52yr9.js → index-zj6t9zgx.js} +173 -25
  51. package/dist/cli/index-zy7f84cs.js +1210 -0
  52. package/dist/cli/index.d.ts +11 -1
  53. package/dist/cli/index.js +61 -39
  54. package/dist/cli/{knowledge-escalator-ypg14d5r.js → knowledge-escalator-1d79m1tr.js} +12 -11
  55. package/dist/cli/{knowledge-events-nkrym4wb.js → knowledge-events-ces29ncg.js} +10 -9
  56. package/dist/cli/{knowledge-link-e4qgqmpx.js → knowledge-link-4cg4776a.js} +3 -3
  57. package/dist/cli/{knowledge-store-vh3nhtg2.js → knowledge-store-pe8webc2.js} +4 -4
  58. package/dist/cli/{knowledge-validator-jrxvexv6.js → knowledge-validator-4yjf1f7k.js} +6 -6
  59. package/dist/cli/{pending-delegations-pw79c8ds.js → pending-delegations-9h1jmtw1.js} +3 -3
  60. package/dist/cli/{pr-subscriptions-fk628bhc.js → pr-subscriptions-8pg34pev.js} +3 -3
  61. package/dist/cli/{runner-b02sz2vx.js → runner-cqecp1na.js} +4 -4
  62. package/dist/cli/{scan-cursor-fp7w5jmc.js → scan-cursor-d6exjmqj.js} +7 -5
  63. package/dist/cli/{schema-rptwqbm4.js → schema-2esybebd.js} +3 -1
  64. package/dist/cli/{scope-persistence-0bkaxawa.js → scope-persistence-ej59x0yc.js} +7 -6
  65. package/dist/cli/{skill-generator-nh8b4gjv.js → skill-generator-yqta3yrg.js} +14 -13
  66. package/dist/cli/{workspace-snapshot-w3tg4ne5.js → workspace-snapshot-d89zm6wm.js} +5 -2
  67. package/dist/cli/{worktree-collision-ownership-hqd9ypsz.js → worktree-collision-ownership-vy0kxa98.js} +26 -19
  68. package/dist/cli/{worktree-isolation-canf3rj8.js → worktree-isolation-rwq0kke7.js} +33 -32
  69. package/dist/cli/{worktree-provisioning-owner-g24xd417.js → worktree-provisioning-owner-zzkjycp1.js} +3 -3
  70. package/dist/commands/ci-simulate.d.ts +2 -0
  71. package/dist/config/cache-paths.d.ts +57 -0
  72. package/dist/config/evidence-schema.d.ts +3 -3
  73. package/dist/config/schema.d.ts +9 -0
  74. package/dist/git/branch.d.ts +2 -0
  75. package/dist/git/pr.d.ts +2 -0
  76. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +7 -0
  77. package/dist/hooks/diff-scope.d.ts +7 -0
  78. package/dist/hooks/review-receipt-scope.d.ts +7 -0
  79. package/dist/hooks/reviewer-scope-lifecycle.d.ts +9 -0
  80. package/dist/hooks/semantic-diff-injection.d.ts +8 -0
  81. package/dist/index.js +599 -589
  82. package/dist/mutation/engine.d.ts +11 -0
  83. package/dist/review/diff-source.d.ts +2 -0
  84. package/dist/sandbox/capability-probe.d.ts +22 -0
  85. package/dist/sandbox/executor.d.ts +15 -0
  86. package/dist/sandbox/linux/bubblewrap-executor.d.ts +6 -0
  87. package/dist/sandbox/macos/sandbox-exec-executor.d.ts +41 -0
  88. package/dist/tools/checkpoint.d.ts +11 -0
  89. package/dist/tools/complexity-hotspots.d.ts +15 -0
  90. package/dist/tools/diff-summary.d.ts +12 -0
  91. package/dist/tools/dispatch-lanes.d.ts +8 -0
  92. package/dist/tools/gh-evidence.d.ts +17 -1
  93. package/dist/tools/knowledge-receipt.d.ts +1 -1
  94. package/dist/tools/pkg-audit.d.ts +13 -0
  95. package/dist/tools/prepare-pr-workflow-checkout.d.ts +1 -0
  96. package/dist/utils/bun-compat.d.ts +80 -3
  97. package/dist/utils/git-binary-missing-error.d.ts +80 -2
  98. package/dist/utils/git-executable.d.ts +179 -0
  99. package/dist/utils/gitignore-warning.d.ts +10 -0
  100. package/dist/workflow/coder-settlement.d.ts +18 -0
  101. package/dist/worktree/core.d.ts +8 -0
  102. package/dist/worktree/merge.d.ts +33 -0
  103. package/package.json +3 -2
  104. package/dist/cli/curator-llm-factory-xgb4pxmm.js +0 -62
  105. package/dist/cli/guardrail-explain-6wcgr9tz.js +0 -63
  106. package/dist/cli/index-q1exe2b3.js +0 -256
@@ -175,8 +175,85 @@ var _internals = {
175
175
  platform: () => process.platform,
176
176
  cwd: () => process.cwd(),
177
177
  spawnTaskkill: (args, options) => nodeSpawn("taskkill", args, options),
178
- createProcessTreeKiller
178
+ createProcessTreeKiller,
179
+ statSync: (target) => fsSync.statSync(target)
179
180
  };
181
+
182
+ class SpawnCwdMissingError extends Error {
183
+ name = "SpawnCwdMissingError";
184
+ code = "ENOENT";
185
+ cwd;
186
+ reason;
187
+ executable;
188
+ constructor(cwd, reason, executable, options) {
189
+ super(reason === "missing" ? `cannot start "${executable}": working directory no longer exists: ${cwd}` : `cannot start "${executable}": working directory is not a directory: ${cwd}`, options);
190
+ this.cwd = cwd;
191
+ this.reason = reason;
192
+ this.executable = executable;
193
+ }
194
+ }
195
+ function inspectSpawnCwd(cwd) {
196
+ try {
197
+ return _internals.statSync(cwd).isDirectory() ? "directory" : "not-directory";
198
+ } catch (err) {
199
+ const code = typeof err === "object" && err !== null && "code" in err ? err.code : undefined;
200
+ if (code === "ENOENT" || code === "ENOTDIR")
201
+ return "missing";
202
+ if (code === "EACCES" || code === "EPERM")
203
+ return "unreadable";
204
+ return "unknown";
205
+ }
206
+ }
207
+ function describeSpawnCwdFailure(cwd, executable, cause) {
208
+ const state = inspectSpawnCwd(cwd);
209
+ if (state === "missing") {
210
+ return new SpawnCwdMissingError(cwd, "missing", executable, { cause });
211
+ }
212
+ if (state === "not-directory") {
213
+ return new SpawnCwdMissingError(cwd, "not-directory", executable, {
214
+ cause
215
+ });
216
+ }
217
+ return null;
218
+ }
219
+ var AMBIGUOUS_SPAWN_CODES = new Set(["ENOENT", "ENOTDIR", "EACCES", "EPERM"]);
220
+ function spawnErrorCode(err) {
221
+ if (typeof err !== "object" || err === null || !("code" in err)) {
222
+ return;
223
+ }
224
+ const code = err.code;
225
+ return typeof code === "string" ? code : undefined;
226
+ }
227
+ function classifySpawnFailure(err, cwd) {
228
+ if (err instanceof SpawnCwdMissingError)
229
+ return "cwd-missing";
230
+ const code = spawnErrorCode(err);
231
+ if (code === undefined || !AMBIGUOUS_SPAWN_CODES.has(code))
232
+ return "other";
233
+ if (cwd === undefined || cwd === "") {
234
+ return code === "ENOENT" ? "binary-missing" : "other";
235
+ }
236
+ switch (inspectSpawnCwd(cwd)) {
237
+ case "missing":
238
+ case "not-directory":
239
+ return "cwd-missing";
240
+ case "unreadable":
241
+ case "unknown":
242
+ return "cwd-unreadable";
243
+ default:
244
+ return code === "ENOENT" ? "binary-missing" : "other";
245
+ }
246
+ }
247
+ function wrapSpawnFailure(error, cwd, executable) {
248
+ const err = asError(error);
249
+ if (err instanceof SpawnCwdMissingError)
250
+ return err;
251
+ if (cwd === undefined || cwd === "")
252
+ return err;
253
+ if (classifySpawnFailure(err, cwd) !== "cwd-missing")
254
+ return err;
255
+ return describeSpawnCwdFailure(cwd, executable, err) ?? err;
256
+ }
180
257
  function streamFromNode(pipe) {
181
258
  let collected;
182
259
  let readerClaimed = false;
@@ -321,6 +398,42 @@ function mergeEnvForChild(baseEnv, envOverrides) {
321
398
  }
322
399
  return merged;
323
400
  }
401
+ var SPAWN_CREATION_FAILURE_EXIT_CODE = 1;
402
+ function asError(value) {
403
+ return value instanceof Error ? value : new Error(String(value));
404
+ }
405
+ function staticStream(text) {
406
+ const bytes = new TextEncoder().encode(text);
407
+ return {
408
+ async text() {
409
+ return text;
410
+ },
411
+ async bytes() {
412
+ return bytes;
413
+ },
414
+ getReader() {
415
+ return new ReadableStream({
416
+ start(controller) {
417
+ if (bytes.byteLength > 0)
418
+ controller.enqueue(bytes);
419
+ controller.close();
420
+ }
421
+ }).getReader();
422
+ }
423
+ };
424
+ }
425
+ function spawnCreationFailure(error) {
426
+ return {
427
+ stdout: streamFromBun(undefined),
428
+ stderr: staticStream(error.message),
429
+ exited: Promise.resolve(SPAWN_CREATION_FAILURE_EXIT_CODE),
430
+ exitCode: null,
431
+ signalCode: null,
432
+ spawnError: error,
433
+ kill() {},
434
+ killTree: () => Promise.resolve()
435
+ };
436
+ }
324
437
  function bunSpawn(cmd, options) {
325
438
  const bun = getBun();
326
439
  if (bun?.spawn) {
@@ -337,7 +450,13 @@ function bunSpawn(cmd, options) {
337
450
  delete spawnOpts.killSignal;
338
451
  spawnOpts.detached = true;
339
452
  }
340
- const proc2 = bun.spawn(cmd, spawnOpts);
453
+ let spawned;
454
+ try {
455
+ spawned = bun.spawn(cmd, spawnOpts);
456
+ } catch (error) {
457
+ return spawnCreationFailure(wrapSpawnFailure(error, options?.cwd, cmd[0] ?? ""));
458
+ }
459
+ const proc2 = spawned;
341
460
  const killBunTree = createProcessTreeKiller(proc2.pid, (sig) => proc2.kill(sig), true);
342
461
  const killBunProcess = (sig) => options?.killProcessTree ? killBunTree(sig) : Promise.resolve(proc2.kill(sig));
343
462
  let timeoutHandle2;
@@ -377,18 +496,23 @@ function bunSpawn(cmd, options) {
377
496
  const [file, ...args] = cmd;
378
497
  const detached = options?.killProcessTree === true;
379
498
  const mergedEnv = mergeEnvForChild(options?.env, options?.envOverrides);
380
- const proc = nodeSpawn(file, args, {
381
- cwd: options?.cwd,
382
- env: mergedEnv,
383
- detached,
384
- windowsHide: true,
385
- windowsVerbatimArguments: options?.windowsVerbatimArguments,
386
- stdio: [
387
- mapStdio(options?.stdin),
388
- mapStdio(options?.stdout),
389
- mapStdio(options?.stderr)
390
- ]
391
- });
499
+ let proc;
500
+ try {
501
+ proc = nodeSpawn(file, args, {
502
+ cwd: options?.cwd,
503
+ env: mergedEnv,
504
+ detached,
505
+ windowsHide: true,
506
+ windowsVerbatimArguments: options?.windowsVerbatimArguments,
507
+ stdio: [
508
+ mapStdio(options?.stdin),
509
+ mapStdio(options?.stdout),
510
+ mapStdio(options?.stderr)
511
+ ]
512
+ });
513
+ } catch (error) {
514
+ return spawnCreationFailure(wrapSpawnFailure(error, options?.cwd, file));
515
+ }
392
516
  const killChildTree = createProcessTreeKiller(proc.pid, (signal) => proc.kill(signal), true);
393
517
  const killChild = (signal) => {
394
518
  if (detached)
@@ -405,7 +529,7 @@ function bunSpawn(cmd, options) {
405
529
  resolve(code ?? -1);
406
530
  });
407
531
  proc.on("error", (error) => {
408
- observedSpawnError = error;
532
+ observedSpawnError = wrapSpawnFailure(error, options?.cwd, file);
409
533
  resolve(1);
410
534
  });
411
535
  if (options?.timeout && options.timeout > 0) {
@@ -445,13 +569,26 @@ function bunSpawn(cmd, options) {
445
569
  killTree: killChild
446
570
  };
447
571
  }
572
+ function syncSpawnCreationFailure(error) {
573
+ return {
574
+ stdout: new Uint8Array(0),
575
+ stderr: new TextEncoder().encode(error.message),
576
+ exitCode: SPAWN_CREATION_FAILURE_EXIT_CODE,
577
+ success: false
578
+ };
579
+ }
448
580
  function bunSpawnSync(cmd, options) {
581
+ const requestedCwd = Array.isArray(cmd) ? options?.cwd : options?.cwd ?? cmd.cwd;
582
+ const executable = (Array.isArray(cmd) ? cmd[0] : cmd.cmd[0]) ?? "";
449
583
  const bun = getBun();
450
584
  if (bun?.spawnSync) {
451
585
  const mergedEnv2 = mergeEnvForChild(options?.env, options?.envOverrides);
452
586
  const spawnOpts = mergedEnv2 !== undefined ? { ...options, env: mergedEnv2 } : options;
453
- const result2 = bun.spawnSync(cmd, spawnOpts);
454
- return result2;
587
+ try {
588
+ return bun.spawnSync(cmd, spawnOpts);
589
+ } catch (error) {
590
+ return syncSpawnCreationFailure(wrapSpawnFailure(error, requestedCwd, executable));
591
+ }
455
592
  }
456
593
  let argv;
457
594
  let mergedOptions;
@@ -473,13 +610,24 @@ function bunSpawnSync(cmd, options) {
473
610
  }
474
611
  const [file, ...args] = argv;
475
612
  const mergedEnv = mergeEnvForChild(mergedOptions.env, options?.envOverrides);
476
- const result = nodeSpawnSync(file, args, {
477
- cwd: mergedOptions.cwd,
478
- env: mergedEnv,
479
- input: mergedOptions.stdin instanceof Uint8Array || typeof mergedOptions.stdin === "string" ? mergedOptions.stdin : undefined,
480
- timeout: mergedOptions.timeout,
481
- windowsHide: true
482
- });
613
+ let result;
614
+ try {
615
+ result = nodeSpawnSync(file, args, {
616
+ cwd: mergedOptions.cwd,
617
+ env: mergedEnv,
618
+ input: mergedOptions.stdin instanceof Uint8Array || typeof mergedOptions.stdin === "string" ? mergedOptions.stdin : undefined,
619
+ timeout: mergedOptions.timeout,
620
+ windowsHide: true
621
+ });
622
+ } catch (error) {
623
+ return syncSpawnCreationFailure(wrapSpawnFailure(error, mergedOptions.cwd, file));
624
+ }
625
+ if (result.error) {
626
+ const wrapped = wrapSpawnFailure(result.error, mergedOptions.cwd, file);
627
+ if (wrapped instanceof SpawnCwdMissingError) {
628
+ return syncSpawnCreationFailure(wrapped);
629
+ }
630
+ }
483
631
  const stdout = result.stdout instanceof Buffer ? new Uint8Array(result.stdout.buffer, result.stdout.byteOffset, result.stdout.byteLength) : typeof result.stdout === "string" ? new TextEncoder().encode(result.stdout) : new Uint8Array(0);
484
632
  const stderr = result.stderr instanceof Buffer ? new Uint8Array(result.stderr.buffer, result.stderr.byteOffset, result.stderr.byteLength) : typeof result.stderr === "string" ? new TextEncoder().encode(result.stderr) : new Uint8Array(0);
485
633
  const exitCode = result.status ?? (result.signal ? 128 : 1);
@@ -491,4 +639,4 @@ function bunSpawnSync(cmd, options) {
491
639
  };
492
640
  }
493
641
 
494
- export { bunFile, bunWrite, bunHash, mergeEnvForChild, bunSpawn, bunSpawnSync };
642
+ export { bunFile, bunWrite, bunHash, classifySpawnFailure, mergeEnvForChild, bunSpawn, bunSpawnSync };