opencode-swarm 7.181.1 → 7.181.3

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 (99) hide show
  1. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  2. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  3. package/dist/background/stage-b-gates.d.ts +4 -0
  4. package/dist/cli/{coder-settlement-ee8bmg83.js → coder-settlement-txte2m87.js} +11 -11
  5. package/dist/cli/{config-doctor-mnmxzg86.js → config-doctor-101n3c1r.js} +3 -3
  6. package/dist/cli/{core-m9yymv84.js → core-s0yzzpaj.js} +3 -3
  7. package/dist/cli/{curation-policy-m3x9mkj9.js → curation-policy-r4dkajw9.js} +4 -4
  8. package/dist/cli/{curator-7nmwpcxy.js → curator-dp49fr0p.js} +38 -38
  9. package/dist/cli/curator-drift-r7w3cg3m.js +37 -0
  10. package/dist/cli/curator-llm-factory-tycc9xkw.js +74 -0
  11. package/dist/cli/{evidence-summary-service-m2b0mxmr.js → evidence-summary-service-r648x5f2.js} +17 -17
  12. package/dist/cli/{gate-evidence-4y2x85g4.js → gate-evidence-8rh69tsh.js} +6 -6
  13. package/dist/cli/guardrail-explain-dfyj1g1c.js +75 -0
  14. package/dist/cli/{guardrail-log-202rfw7b.js → guardrail-log-yr60w7h6.js} +7 -7
  15. package/dist/cli/{guardrail-reset-7nt7z18b.js → guardrail-reset-eztc62va.js} +38 -38
  16. package/dist/cli/{hive-promoter-segsykns.js → hive-promoter-g56ba4a4.js} +38 -38
  17. package/dist/cli/{index-m65tnv4j.js → index-01r2wrwa.js} +1 -1
  18. package/dist/cli/{index-hxe22tx3.js → index-1ks0rnzn.js} +5 -5
  19. package/dist/cli/{index-ztph1v9m.js → index-1w1xrk5k.js} +1 -1
  20. package/dist/cli/{index-12ewkms0.js → index-23mdeh2a.js} +1 -1
  21. package/dist/cli/{index-a7z6jygf.js → index-2pt5g7zz.js} +3 -3
  22. package/dist/cli/{index-y4zjbrqs.js → index-2t21pv2v.js} +1 -1
  23. package/dist/cli/{index-38cfx8g8.js → index-427x3j6p.js} +2 -2
  24. package/dist/cli/{index-tczqm089.js → index-4ffryqb1.js} +1 -1
  25. package/dist/cli/{index-pee6ykkg.js → index-4jvt3r77.js} +5 -5
  26. package/dist/cli/{index-908yea8v.js → index-6ep83w7x.js} +1 -1
  27. package/dist/cli/{index-r6p6x0pb.js → index-789tdsfv.js} +4 -4
  28. package/dist/cli/{index-yhx94xpr.js → index-7s6ct0t2.js} +6 -6
  29. package/dist/cli/{index-9j5jjqks.js → index-8c37kzh6.js} +7 -7
  30. package/dist/cli/{index-gc6h1fmf.js → index-a2hvmc3a.js} +1 -1
  31. package/dist/cli/{index-ea9fk6v0.js → index-ap6hs8fj.js} +1 -1
  32. package/dist/cli/{index-92m05mew.js → index-by9wfeja.js} +1 -1
  33. package/dist/cli/{index-kjstkfgh.js → index-ckrm4784.js} +7 -7
  34. package/dist/cli/{index-rxs0rrv1.js → index-dy9mxh0z.js} +40 -40
  35. package/dist/cli/{index-b2zbak7v.js → index-ekwe81my.js} +2 -2
  36. package/dist/cli/{index-3qhx9dx0.js → index-h6gxh3an.js} +4946 -1965
  37. package/dist/cli/{index-basp4sxt.js → index-hcaspktr.js} +1 -1
  38. package/dist/cli/{index-bdpgfep1.js → index-jrxrjz89.js} +1 -1
  39. package/dist/cli/{index-q1prchye.js → index-k5rqe97g.js} +27 -13
  40. package/dist/cli/{index-4h54k8h3.js → index-kexzhwbq.js} +2 -2
  41. package/dist/cli/{index-516j9vsk.js → index-kkrbybgt.js} +27 -2
  42. package/dist/cli/{index-cyyvc1cd.js → index-m4e3p8na.js} +2 -2
  43. package/dist/cli/{index-jqjdejqe.js → index-mdqp0cq2.js} +4 -4
  44. package/dist/cli/{index-6mwha20t.js → index-mkpdcbye.js} +3 -3
  45. package/dist/cli/{index-y30y1rkg.js → index-nw3z614g.js} +6 -6
  46. package/dist/cli/{index-nhxykfyy.js → index-nw8pfcw1.js} +270 -10
  47. package/dist/cli/{index-na3br902.js → index-qdz43cne.js} +38 -38
  48. package/dist/cli/{index-g9ax7jyf.js → index-rchygh27.js} +57 -4
  49. package/dist/cli/{index-6gcxgx84.js → index-s34y6gbh.js} +1 -1
  50. package/dist/cli/{index-s0zgz4p1.js → index-sf51gh68.js} +1 -1
  51. package/dist/cli/{index-gydvqmtg.js → index-sr9k8sh7.js} +4 -4
  52. package/dist/cli/{index-edb3sgxg.js → index-ttgex8ky.js} +6 -6
  53. package/dist/cli/{index-91dhg3wr.js → index-ved1325w.js} +2 -2
  54. package/dist/cli/{index-rw0wy2y7.js → index-vgjmahnd.js} +3 -3
  55. package/dist/cli/{index-bv4b8tpa.js → index-vvgpgcyn.js} +10 -0
  56. package/dist/cli/{index-vmthakz0.js → index-w1ydvzef.js} +1 -1
  57. package/dist/cli/{index-gqe4sm73.js → index-xqr076aq.js} +4 -4
  58. package/dist/cli/{index-g5wjasjn.js → index-yv0q0hp9.js} +140 -9
  59. package/dist/cli/{index-vs83acgx.js → index-yzapt508.js} +3 -3
  60. package/dist/cli/index.js +39 -39
  61. package/dist/cli/{knowledge-escalator-r9chkas8.js → knowledge-escalator-0rcft6q4.js} +12 -12
  62. package/dist/cli/{knowledge-events-5j2n6age.js → knowledge-events-7jyz3qxs.js} +10 -10
  63. package/dist/cli/{knowledge-link-s2qs178z.js → knowledge-link-655xa3db.js} +3 -3
  64. package/dist/cli/{knowledge-store-mybx9bmx.js → knowledge-store-asa26g6p.js} +4 -4
  65. package/dist/cli/{knowledge-validator-v1sj9tv4.js → knowledge-validator-j3x9ezej.js} +6 -6
  66. package/dist/cli/{mcp-7yx5230p.js → mcp-70hefjk6.js} +1 -1
  67. package/dist/cli/model-preflight-szekh1dc.js +359 -0
  68. package/dist/cli/{pending-delegations-amjfmc7t.js → pending-delegations-rb6bhv5x.js} +10 -10
  69. package/dist/cli/{pr-subscriptions-rctqs0gk.js → pr-subscriptions-v4ms5pfb.js} +10 -10
  70. package/dist/cli/{pr-workflow-gate-9he8ys4e.js → pr-workflow-gate-qmfpz6wb.js} +38 -38
  71. package/dist/cli/{runner-tzgwvvn1.js → runner-b5vt1any.js} +4 -4
  72. package/dist/cli/{scan-cursor-pxqkphrh.js → scan-cursor-7zn4t1hw.js} +5 -5
  73. package/dist/cli/{schema-n8pk3f80.js → schema-tx62mfy8.js} +2 -2
  74. package/dist/cli/{scope-persistence-p992x2yd.js → scope-persistence-f8w12sns.js} +14 -14
  75. package/dist/cli/{server-ywrd2q6z.js → server-f2vrp2wc.js} +73 -603
  76. package/dist/cli/{skill-generator-cdppktqx.js → skill-generator-jme09w7n.js} +14 -14
  77. package/dist/cli/{snapshot-coordination-init-z42ev5g9.js → snapshot-coordination-init-ad83sq6c.js} +38 -38
  78. package/dist/cli/{speckit-checkoff-6ynv46bn.js → speckit-checkoff-98gfvn3r.js} +4 -4
  79. package/dist/cli/{telemetry-zhcgfe70.js → telemetry-6k8t2mrw.js} +1 -1
  80. package/dist/cli/{workspace-snapshot-4m2ex1ey.js → workspace-snapshot-hsssm50w.js} +2 -2
  81. package/dist/cli/{worktree-collision-ownership-65971p3m.js → worktree-collision-ownership-47kdjtqb.js} +11 -11
  82. package/dist/cli/{worktree-isolation-xf7dfc46.js → worktree-isolation-etaawcnt.js} +38 -38
  83. package/dist/commands/registry.d.ts +1 -1
  84. package/dist/config/agent-model.d.ts +14 -0
  85. package/dist/config/bundled-skill-dispositions.d.ts +29 -0
  86. package/dist/db/qa-gate-profile.d.ts +6 -3
  87. package/dist/db/qa-gate-session-override.d.ts +72 -0
  88. package/dist/index.js +404 -390
  89. package/dist/memory/index.d.ts +1 -0
  90. package/dist/memory/instruction-pairing.d.ts +112 -0
  91. package/dist/services/model-preflight.d.ts +103 -21
  92. package/dist/session/restart-reconciliation.d.ts +74 -0
  93. package/dist/state.d.ts +6 -3
  94. package/dist/tools/get-qa-gate-profile.d.ts +13 -6
  95. package/package.json +1 -1
  96. package/dist/cli/curator-drift-q42fr0c9.js +0 -297
  97. package/dist/cli/curator-llm-factory-s1b2p162.js +0 -74
  98. package/dist/cli/guardrail-explain-nvmf3y7j.js +0 -75
  99. package/dist/cli/model-preflight-ckvv1arg.js +0 -170
package/dist/cli/index.js CHANGED
@@ -14,73 +14,73 @@ import {
14
14
  readCachePackageVersion,
15
15
  resolveCommand,
16
16
  safeRealpathSync
17
- } from "./index-3qhx9dx0.js";
18
- import"./index-jqjdejqe.js";
17
+ } from "./index-h6gxh3an.js";
18
+ import"./index-mdqp0cq2.js";
19
19
  import"./index-hamqvzqn.js";
20
- import"./index-m65tnv4j.js";
21
- import"./index-nhxykfyy.js";
22
- import"./index-b2zbak7v.js";
23
- import"./index-q1prchye.js";
24
- import"./index-s0zgz4p1.js";
20
+ import"./index-01r2wrwa.js";
21
+ import"./index-nw8pfcw1.js";
22
+ import"./index-ekwe81my.js";
23
+ import"./index-k5rqe97g.js";
24
+ import"./index-sf51gh68.js";
25
25
  import"./index-txdagbh7.js";
26
- import"./index-tczqm089.js";
26
+ import"./index-4ffryqb1.js";
27
27
  import"./index-6b295cas.js";
28
- import"./index-vs83acgx.js";
29
- import"./index-hxe22tx3.js";
30
- import"./index-cyyvc1cd.js";
28
+ import"./index-yzapt508.js";
29
+ import"./index-1ks0rnzn.js";
30
+ import"./index-m4e3p8na.js";
31
31
  import"./index-rdec0y3z.js";
32
- import"./index-y30y1rkg.js";
32
+ import"./index-nw3z614g.js";
33
33
  import"./index-cjapb4hy.js";
34
34
  import"./index-zsrtt42s.js";
35
- import"./index-kjstkfgh.js";
36
- import"./index-bdpgfep1.js";
37
- import"./index-92m05mew.js";
35
+ import"./index-ckrm4784.js";
36
+ import"./index-jrxrjz89.js";
37
+ import"./index-by9wfeja.js";
38
38
  import"./index-pt7h91zc.js";
39
39
  import"./index-q7sjgr1y.js";
40
- import"./index-908yea8v.js";
41
- import"./index-r6p6x0pb.js";
42
- import"./index-a7z6jygf.js";
43
- import"./index-9j5jjqks.js";
44
- import"./index-g5wjasjn.js";
45
- import"./index-gc6h1fmf.js";
40
+ import"./index-6ep83w7x.js";
41
+ import"./index-789tdsfv.js";
42
+ import"./index-2pt5g7zz.js";
43
+ import"./index-8c37kzh6.js";
44
+ import"./index-yv0q0hp9.js";
45
+ import"./index-a2hvmc3a.js";
46
46
  import"./index-2s7dvzff.js";
47
- import"./index-gqe4sm73.js";
48
- import"./index-6gcxgx84.js";
47
+ import"./index-xqr076aq.js";
48
+ import"./index-s34y6gbh.js";
49
49
  import"./index-rtry5xyf.js";
50
- import"./index-rw0wy2y7.js";
50
+ import"./index-vgjmahnd.js";
51
51
  import"./index-frcemc0b.js";
52
52
  import"./index-0725jpp7.js";
53
- import"./index-pee6ykkg.js";
54
- import"./index-edb3sgxg.js";
55
- import"./index-38cfx8g8.js";
56
- import"./index-91dhg3wr.js";
57
- import"./index-vmthakz0.js";
58
- import"./index-bv4b8tpa.js";
53
+ import"./index-4jvt3r77.js";
54
+ import"./index-ttgex8ky.js";
55
+ import"./index-427x3j6p.js";
56
+ import"./index-ved1325w.js";
57
+ import"./index-w1ydvzef.js";
58
+ import"./index-vvgpgcyn.js";
59
59
  import"./index-rdm3px0g.js";
60
60
  import"./index-ry16d01s.js";
61
- import"./index-516j9vsk.js";
62
- import"./index-yhx94xpr.js";
61
+ import"./index-kkrbybgt.js";
62
+ import"./index-7s6ct0t2.js";
63
63
  import"./index-vzm6zre7.js";
64
64
  import"./index-ae75rja9.js";
65
- import"./index-12ewkms0.js";
66
- import"./index-ea9fk6v0.js";
67
- import"./index-6mwha20t.js";
65
+ import"./index-23mdeh2a.js";
66
+ import"./index-ap6hs8fj.js";
67
+ import"./index-mkpdcbye.js";
68
68
  import"./index-1xnse449.js";
69
69
  import"./index-c1ggtmpm.js";
70
70
  import"./index-ejhxgyvm.js";
71
71
  import"./index-7g4c7s5r.js";
72
72
  import"./index-989v83pb.js";
73
73
  import"./index-gx2vp8gx.js";
74
- import"./index-basp4sxt.js";
74
+ import"./index-hcaspktr.js";
75
75
  import"./index-zxdawwc7.js";
76
76
  import {
77
77
  init_package,
78
78
  package_default
79
- } from "./index-g9ax7jyf.js";
79
+ } from "./index-rchygh27.js";
80
80
  import {
81
81
  DEFAULT_AGENT_CONFIGS,
82
82
  init_constants
83
- } from "./index-y4zjbrqs.js";
83
+ } from "./index-2t21pv2v.js";
84
84
  import"./index-bk5tah7q.js";
85
85
  import"./index-gknz3bv1.js";
86
86
  import"./index-zpsr8rpc.js";
@@ -644,7 +644,7 @@ async function main() {
644
644
  const exitCode = await run(["ci", ...args.slice(1)]);
645
645
  process.exit(exitCode);
646
646
  } else if (command === "mcp") {
647
- const { handleMcpCommand } = await import("./mcp-7yx5230p.js");
647
+ const { handleMcpCommand } = await import("./mcp-70hefjk6.js");
648
648
  const exitCode = await handleMcpCommand(args.slice(1));
649
649
  process.exit(exitCode);
650
650
  } else {
@@ -9,30 +9,30 @@ import {
9
9
  maybeEscalateOnViolation,
10
10
  maybeQuarantineOnContradiction,
11
11
  readRecentEscalations
12
- } from "./index-hxe22tx3.js";
13
- import"./index-g5wjasjn.js";
14
- import"./index-gc6h1fmf.js";
12
+ } from "./index-1ks0rnzn.js";
13
+ import"./index-yv0q0hp9.js";
14
+ import"./index-a2hvmc3a.js";
15
15
  import"./index-2s7dvzff.js";
16
- import"./index-rw0wy2y7.js";
16
+ import"./index-vgjmahnd.js";
17
17
  import"./index-frcemc0b.js";
18
18
  import"./index-0725jpp7.js";
19
- import"./index-516j9vsk.js";
20
- import"./index-yhx94xpr.js";
19
+ import"./index-kkrbybgt.js";
20
+ import"./index-7s6ct0t2.js";
21
21
  import"./index-vzm6zre7.js";
22
22
  import"./index-ae75rja9.js";
23
- import"./index-12ewkms0.js";
24
- import"./index-ea9fk6v0.js";
25
- import"./index-6mwha20t.js";
23
+ import"./index-23mdeh2a.js";
24
+ import"./index-ap6hs8fj.js";
25
+ import"./index-mkpdcbye.js";
26
26
  import"./index-1xnse449.js";
27
27
  import"./index-c1ggtmpm.js";
28
28
  import"./index-ejhxgyvm.js";
29
29
  import"./index-7g4c7s5r.js";
30
30
  import"./index-989v83pb.js";
31
31
  import"./index-gx2vp8gx.js";
32
- import"./index-basp4sxt.js";
32
+ import"./index-hcaspktr.js";
33
33
  import"./index-zxdawwc7.js";
34
- import"./index-g9ax7jyf.js";
35
- import"./index-y4zjbrqs.js";
34
+ import"./index-rchygh27.js";
35
+ import"./index-2t21pv2v.js";
36
36
  import"./index-bk5tah7q.js";
37
37
  import"./index-gknz3bv1.js";
38
38
  import"./index-zpsr8rpc.js";
@@ -29,27 +29,27 @@ import {
29
29
  resolveKnowledgeCounterBaselinePath,
30
30
  resolveKnowledgeEventsPath,
31
31
  resolveLegacyApplicationLogPath
32
- } from "./index-g5wjasjn.js";
33
- import"./index-gc6h1fmf.js";
32
+ } from "./index-yv0q0hp9.js";
33
+ import"./index-a2hvmc3a.js";
34
34
  import"./index-2s7dvzff.js";
35
- import"./index-rw0wy2y7.js";
35
+ import"./index-vgjmahnd.js";
36
36
  import"./index-frcemc0b.js";
37
37
  import"./index-0725jpp7.js";
38
- import"./index-516j9vsk.js";
38
+ import"./index-kkrbybgt.js";
39
39
  import"./index-ae75rja9.js";
40
- import"./index-12ewkms0.js";
41
- import"./index-ea9fk6v0.js";
42
- import"./index-6mwha20t.js";
40
+ import"./index-23mdeh2a.js";
41
+ import"./index-ap6hs8fj.js";
42
+ import"./index-mkpdcbye.js";
43
43
  import"./index-1xnse449.js";
44
44
  import"./index-c1ggtmpm.js";
45
45
  import"./index-ejhxgyvm.js";
46
46
  import"./index-7g4c7s5r.js";
47
47
  import"./index-989v83pb.js";
48
48
  import"./index-gx2vp8gx.js";
49
- import"./index-basp4sxt.js";
49
+ import"./index-hcaspktr.js";
50
50
  import"./index-zxdawwc7.js";
51
- import"./index-g9ax7jyf.js";
52
- import"./index-y4zjbrqs.js";
51
+ import"./index-rchygh27.js";
52
+ import"./index-2t21pv2v.js";
53
53
  import"./index-bk5tah7q.js";
54
54
  import"./index-gknz3bv1.js";
55
55
  import"./index-zpsr8rpc.js";
@@ -12,9 +12,9 @@ import {
12
12
  resolveLinkDir,
13
13
  sanitizeLinkId,
14
14
  writeLinkPointer
15
- } from "./index-12ewkms0.js";
16
- import"./index-ea9fk6v0.js";
17
- import"./index-6mwha20t.js";
15
+ } from "./index-23mdeh2a.js";
16
+ import"./index-ap6hs8fj.js";
17
+ import"./index-mkpdcbye.js";
18
18
  import"./index-1xnse449.js";
19
19
  import"./index-c1ggtmpm.js";
20
20
  import"./index-ejhxgyvm.js";
@@ -43,14 +43,14 @@ import {
43
43
  transactKnowledge,
44
44
  transactKnowledgeWithCas,
45
45
  wordBigrams
46
- } from "./index-yhx94xpr.js";
46
+ } from "./index-7s6ct0t2.js";
47
47
  import"./index-vzm6zre7.js";
48
48
  import {
49
49
  resolveHiveDataDir
50
50
  } from "./index-ae75rja9.js";
51
- import"./index-12ewkms0.js";
52
- import"./index-ea9fk6v0.js";
53
- import"./index-6mwha20t.js";
51
+ import"./index-23mdeh2a.js";
52
+ import"./index-ap6hs8fj.js";
53
+ import"./index-mkpdcbye.js";
54
54
  import"./index-1xnse449.js";
55
55
  import"./index-c1ggtmpm.js";
56
56
  import"./index-ejhxgyvm.js";
@@ -23,15 +23,15 @@ import {
23
23
  validateLesson,
24
24
  validateSkillCandidatePath,
25
25
  validateSkillPath
26
- } from "./index-gqe4sm73.js";
27
- import"./index-6gcxgx84.js";
26
+ } from "./index-xqr076aq.js";
27
+ import"./index-s34y6gbh.js";
28
28
  import"./index-rtry5xyf.js";
29
- import"./index-yhx94xpr.js";
29
+ import"./index-7s6ct0t2.js";
30
30
  import"./index-vzm6zre7.js";
31
31
  import"./index-ae75rja9.js";
32
- import"./index-12ewkms0.js";
33
- import"./index-ea9fk6v0.js";
34
- import"./index-6mwha20t.js";
32
+ import"./index-23mdeh2a.js";
33
+ import"./index-ap6hs8fj.js";
34
+ import"./index-mkpdcbye.js";
35
35
  import"./index-1xnse449.js";
36
36
  import"./index-c1ggtmpm.js";
37
37
  import"./index-ejhxgyvm.js";
@@ -81,7 +81,7 @@ function resolveMcpRoot(input) {
81
81
  }
82
82
  var _internals = {
83
83
  runMcpServer: async (options) => {
84
- const { runMcpServer } = await import("./server-ywrd2q6z.js");
84
+ const { runMcpServer } = await import("./server-f2vrp2wc.js");
85
85
  return runMcpServer(options);
86
86
  }
87
87
  };
@@ -0,0 +1,359 @@
1
+ // @bun
2
+ import {
3
+ resolveConfiguredAgentModel,
4
+ resolveEffectiveAgentOverride,
5
+ resolvePrimaryAgentNames,
6
+ resolveRegisteredAgentModel
7
+ } from "./index-h6gxh3an.js";
8
+ import"./index-mdqp0cq2.js";
9
+ import"./index-hamqvzqn.js";
10
+ import"./index-01r2wrwa.js";
11
+ import"./index-nw8pfcw1.js";
12
+ import"./index-ekwe81my.js";
13
+ import"./index-k5rqe97g.js";
14
+ import"./index-sf51gh68.js";
15
+ import"./index-txdagbh7.js";
16
+ import"./index-4ffryqb1.js";
17
+ import"./index-6b295cas.js";
18
+ import"./index-yzapt508.js";
19
+ import"./index-1ks0rnzn.js";
20
+ import"./index-m4e3p8na.js";
21
+ import"./index-rdec0y3z.js";
22
+ import"./index-nw3z614g.js";
23
+ import"./index-cjapb4hy.js";
24
+ import"./index-zsrtt42s.js";
25
+ import"./index-ckrm4784.js";
26
+ import"./index-jrxrjz89.js";
27
+ import"./index-by9wfeja.js";
28
+ import"./index-pt7h91zc.js";
29
+ import"./index-q7sjgr1y.js";
30
+ import"./index-6ep83w7x.js";
31
+ import"./index-789tdsfv.js";
32
+ import"./index-2pt5g7zz.js";
33
+ import"./index-8c37kzh6.js";
34
+ import"./index-yv0q0hp9.js";
35
+ import"./index-a2hvmc3a.js";
36
+ import"./index-2s7dvzff.js";
37
+ import"./index-xqr076aq.js";
38
+ import"./index-s34y6gbh.js";
39
+ import"./index-rtry5xyf.js";
40
+ import"./index-vgjmahnd.js";
41
+ import"./index-frcemc0b.js";
42
+ import"./index-0725jpp7.js";
43
+ import"./index-4jvt3r77.js";
44
+ import"./index-ttgex8ky.js";
45
+ import"./index-427x3j6p.js";
46
+ import"./index-ved1325w.js";
47
+ import"./index-w1ydvzef.js";
48
+ import"./index-vvgpgcyn.js";
49
+ import"./index-rdm3px0g.js";
50
+ import"./index-ry16d01s.js";
51
+ import"./index-kkrbybgt.js";
52
+ import"./index-7s6ct0t2.js";
53
+ import"./index-vzm6zre7.js";
54
+ import"./index-ae75rja9.js";
55
+ import"./index-23mdeh2a.js";
56
+ import"./index-ap6hs8fj.js";
57
+ import"./index-mkpdcbye.js";
58
+ import"./index-1xnse449.js";
59
+ import"./index-c1ggtmpm.js";
60
+ import"./index-ejhxgyvm.js";
61
+ import"./index-7g4c7s5r.js";
62
+ import"./index-989v83pb.js";
63
+ import"./index-gx2vp8gx.js";
64
+ import"./index-hcaspktr.js";
65
+ import"./index-zxdawwc7.js";
66
+ import {
67
+ init_schema,
68
+ stripKnownSwarmPrefix
69
+ } from "./index-rchygh27.js";
70
+ import {
71
+ ALL_AGENT_NAMES,
72
+ DEFAULT_MODELS,
73
+ init_constants
74
+ } from "./index-2t21pv2v.js";
75
+ import"./index-bk5tah7q.js";
76
+ import"./index-gknz3bv1.js";
77
+ import"./index-zpsr8rpc.js";
78
+ import"./index-wvghb3x6.js";
79
+ import"./index-9rwhas09.js";
80
+ import"./index-zgwm4ryv.js";
81
+ import"./index-a76rekgs.js";
82
+
83
+ // src/services/model-preflight.ts
84
+ init_constants();
85
+ init_schema();
86
+ var PROVIDER_LIST_TIMEOUT_MS = 2000;
87
+ function splitModelId(model) {
88
+ const separator = model.indexOf("/");
89
+ if (separator <= 0 || separator === model.length - 1)
90
+ return null;
91
+ return {
92
+ provider: model.slice(0, separator),
93
+ model: model.slice(separator + 1)
94
+ };
95
+ }
96
+ function collectConfiguredAgentModels(config) {
97
+ const collected = [];
98
+ const overriddenAgents = new Set;
99
+ const overrides = config?.agents ?? {};
100
+ for (const [agent, override] of Object.entries(overrides)) {
101
+ if (typeof override?.model === "string" && override.model.trim()) {
102
+ collected.push({
103
+ agent,
104
+ model: override.model.trim(),
105
+ source: "override"
106
+ });
107
+ overriddenAgents.add(agent);
108
+ }
109
+ for (const fallback of override?.fallback_models ?? []) {
110
+ if (typeof fallback === "string" && fallback.trim()) {
111
+ collected.push({
112
+ agent,
113
+ model: fallback.trim(),
114
+ source: "fallback"
115
+ });
116
+ }
117
+ }
118
+ }
119
+ for (const [agent, model] of Object.entries(DEFAULT_MODELS)) {
120
+ if (overriddenAgents.has(agent))
121
+ continue;
122
+ collected.push({ agent, model, source: "default" });
123
+ }
124
+ return collected;
125
+ }
126
+ var FEATURE_GATED_ROLES = new Map([
127
+ ["council_generalist", (c) => c?.council?.general?.enabled === true],
128
+ ["council_skeptic", (c) => c?.council?.general?.enabled === true],
129
+ ["council_domain_expert", (c) => c?.council?.general?.enabled === true],
130
+ ["docs_design", (c) => c?.design_docs?.enabled === true],
131
+ ["designer", (c) => c?.ui_review?.enabled === true]
132
+ ]);
133
+ var ALWAYS_ON_ROLES = ALL_AGENT_NAMES.filter((role) => !FEATURE_GATED_ROLES.has(role));
134
+ function enumerateEnabledAgentRoles(config) {
135
+ const names = [];
136
+ const emitSwarm = (swarmId, isDefault) => {
137
+ const prefix = isDefault ? "" : `${swarmId}_`;
138
+ const swarmAgents = config?.swarms?.[swarmId]?.agents;
139
+ const merged = config?.agents ? { ...config.agents, ...swarmAgents ?? {} } : swarmAgents ?? {};
140
+ for (const role of ALWAYS_ON_ROLES) {
141
+ if (merged?.[role]?.disabled === true)
142
+ continue;
143
+ names.push(`${prefix}${role}`);
144
+ }
145
+ for (const [role, flagEnabled] of FEATURE_GATED_ROLES) {
146
+ if (!flagEnabled(config))
147
+ continue;
148
+ if (merged?.[role]?.disabled === true)
149
+ continue;
150
+ names.push(`${prefix}${role}`);
151
+ }
152
+ };
153
+ const swarms = config?.swarms;
154
+ if (swarms && Object.keys(swarms).length > 0) {
155
+ for (const swarmId of Object.keys(swarms)) {
156
+ emitSwarm(swarmId, swarmId === "default");
157
+ }
158
+ } else {
159
+ emitSwarm("default", true);
160
+ }
161
+ return names;
162
+ }
163
+ function collectEnabledAgentModels(config, opts) {
164
+ const names = opts?.generatedAgentNames && opts.generatedAgentNames.length > 0 ? [...opts.generatedAgentNames] : enumerateEnabledAgentRoles(config);
165
+ const primaryNames = opts?.registeredAgents ? new Set(Object.entries(opts.registeredAgents).filter(([, value]) => value?.mode === "primary").map(([name]) => name)) : resolvePrimaryAgentNames(names, config?.default_agent).primaryNames;
166
+ const collected = [];
167
+ for (const name of names) {
168
+ const mode = primaryNames.has(name) ? "primary" : "subagent";
169
+ const effective = config ? resolveEffectiveAgentOverride(config, name) : undefined;
170
+ const configuredModel = config ? resolveConfiguredAgentModel(config, name) : undefined;
171
+ const finalModel = config ? resolveRegisteredAgentModel(config, name) : DEFAULT_MODELS[stripKnownSwarmPrefix(name)] ?? DEFAULT_MODELS.default;
172
+ if (effective && typeof effective.model === "string" && effective.model.trim() === "") {
173
+ collected.push({ agent: name, model: "", source: "override", mode });
174
+ } else {
175
+ collected.push({
176
+ agent: name,
177
+ model: finalModel ?? "",
178
+ source: configuredModel !== undefined ? "override" : "default",
179
+ mode
180
+ });
181
+ }
182
+ for (const fallback of effective?.fallbackModels ?? []) {
183
+ if (typeof fallback === "string" && fallback.trim()) {
184
+ collected.push({
185
+ agent: name,
186
+ model: fallback.trim(),
187
+ source: "fallback",
188
+ mode
189
+ });
190
+ }
191
+ }
192
+ }
193
+ return collected;
194
+ }
195
+ var CATALOG_CACHE_TTL_MS = 30000;
196
+ var catalogCacheByClient = new WeakMap;
197
+ var catalogCacheEpoch = 0;
198
+ function invalidateProviderCatalogCache() {
199
+ catalogCacheEpoch++;
200
+ catalogCacheByClient = new WeakMap;
201
+ }
202
+ function sanitizePreflightText(value) {
203
+ return value.replace(/[\x00-\x1f\x7f]+/g, " ");
204
+ }
205
+ async function fetchProviderCatalog(client) {
206
+ if (!client)
207
+ return null;
208
+ const cached = catalogCacheByClient.get(client);
209
+ if (cached && Date.now() - cached.fetchedAt < CATALOG_CACHE_TTL_MS) {
210
+ return cached.catalog;
211
+ }
212
+ const epochAtFetchStart = catalogCacheEpoch;
213
+ let response;
214
+ try {
215
+ response = await _internals.providerList(client);
216
+ } catch {
217
+ return null;
218
+ }
219
+ const all = response?.data?.all;
220
+ if (!Array.isArray(all))
221
+ return null;
222
+ const catalog = new Map;
223
+ for (const provider of all) {
224
+ if (typeof provider?.id !== "string")
225
+ continue;
226
+ const models = new Set;
227
+ if (provider.models && typeof provider.models === "object" && !Array.isArray(provider.models)) {
228
+ for (const modelKey of Object.keys(provider.models)) {
229
+ models.add(modelKey);
230
+ }
231
+ }
232
+ catalog.set(provider.id, models);
233
+ }
234
+ if (epochAtFetchStart === catalogCacheEpoch) {
235
+ catalogCacheByClient.set(client, { fetchedAt: Date.now(), catalog });
236
+ }
237
+ return catalog;
238
+ }
239
+ function resolveAgainstCatalog(models, catalog) {
240
+ const classifySelection = (entry) => {
241
+ if (entry.model.trim() === "") {
242
+ return {
243
+ ...entry,
244
+ status: "missing-selection",
245
+ detail: "enabled role has no final model selection: the exact agent target resolved to no configured model and no default (blank model override or a stale swarm registry entry). Fix agents.<role>.model in opencode-swarm.json \u2014 the matching swarm override wins over the top-level entry."
246
+ };
247
+ }
248
+ if (entry.mode === "primary") {
249
+ return {
250
+ ...entry,
251
+ status: "host-controlled",
252
+ detail: "primary agent: OpenCode UI owns the model selection; the registered model is intentionally not applied"
253
+ };
254
+ }
255
+ const split = splitModelId(entry.model);
256
+ if (!split) {
257
+ return {
258
+ ...entry,
259
+ status: "unknown",
260
+ detail: "model id has no provider prefix; resolution not checked against the catalog"
261
+ };
262
+ }
263
+ const providerModels = catalog?.get(split.provider);
264
+ if (providerModels === undefined) {
265
+ return {
266
+ ...entry,
267
+ status: "unresolved",
268
+ detail: `provider "${split.provider}" is not present in the provider catalog`
269
+ };
270
+ }
271
+ if (!providerModels.has(split.model)) {
272
+ return {
273
+ ...entry,
274
+ status: "unresolved",
275
+ detail: `provider "${split.provider}" does not list model "${split.model}"`
276
+ };
277
+ }
278
+ return { ...entry, status: "ok" };
279
+ };
280
+ if (catalog === null) {
281
+ return {
282
+ catalogAvailable: false,
283
+ resolutions: models.map((entry) => entry.model.trim() === "" ? classifySelection(entry) : {
284
+ ...entry,
285
+ status: "unknown",
286
+ detail: "provider catalog unavailable; model resolution not checked"
287
+ })
288
+ };
289
+ }
290
+ return {
291
+ catalogAvailable: true,
292
+ resolutions: models.map(classifySelection)
293
+ };
294
+ }
295
+ function formatModelPreflightWarning(result) {
296
+ const reportable = result.resolutions.filter((resolution) => resolution.status === "unresolved" || resolution.status === "missing-selection");
297
+ if (reportable.length === 0)
298
+ return null;
299
+ const lines = reportable.map((resolution) => {
300
+ const label = resolution.source === "fallback" ? `${sanitizePreflightText(resolution.agent)} (fallback entry)` : sanitizePreflightText(resolution.agent);
301
+ if (resolution.status === "missing-selection") {
302
+ return ` ${label}: no final model selection \u2014 ${sanitizePreflightText(resolution.detail ?? "")}`;
303
+ }
304
+ return ` ${label}: ${sanitizePreflightText(resolution.model)} (${sanitizePreflightText(resolution.detail ?? "does not resolve")})`;
305
+ });
306
+ return `[opencode-swarm] WARNING: ${reportable.length} enabled agent model selection(s) failed preflight:
307
+ ` + `${lines.join(`
308
+ `)}
309
+ ` + 'Dispatching these roles will fail permanently ("Model not found"/"Forbidden"). ' + "Fix the effective model configuration in opencode-swarm.json \u2014 the matching swarm override wins over top-level agents.<role>.model. " + "fallback_models entries only serve transient runtime failures; configure a resolvable primary model for the affected role.";
310
+ }
311
+ async function runModelPreflight(config, client, opts) {
312
+ const models = collectEnabledAgentModels(config, opts);
313
+ const catalog = await fetchProviderCatalog(client);
314
+ return resolveAgainstCatalog(models, catalog);
315
+ }
316
+ async function checkSingleModelResolution(model, client) {
317
+ const catalog = await fetchProviderCatalog(client);
318
+ if (catalog === null)
319
+ return "unknown";
320
+ const split = splitModelId(model);
321
+ if (!split)
322
+ return "unknown";
323
+ const providerModels = catalog.get(split.provider);
324
+ if (providerModels === undefined || !providerModels.has(split.model)) {
325
+ return "unresolved";
326
+ }
327
+ return "ok";
328
+ }
329
+ var _internals = {
330
+ providerList: async (client) => {
331
+ let timer;
332
+ try {
333
+ return await Promise.race([
334
+ client.provider.list(),
335
+ new Promise((_, reject) => {
336
+ timer = setTimeout(() => reject(new Error("provider list timed out")), PROVIDER_LIST_TIMEOUT_MS);
337
+ })
338
+ ]);
339
+ } finally {
340
+ if (timer)
341
+ clearTimeout(timer);
342
+ }
343
+ }
344
+ };
345
+ export {
346
+ splitModelId,
347
+ sanitizePreflightText,
348
+ runModelPreflight,
349
+ resolveAgainstCatalog,
350
+ invalidateProviderCatalogCache,
351
+ formatModelPreflightWarning,
352
+ fetchProviderCatalog,
353
+ enumerateEnabledAgentRoles,
354
+ collectEnabledAgentModels,
355
+ collectConfiguredAgentModels,
356
+ checkSingleModelResolution,
357
+ _internals,
358
+ PROVIDER_LIST_TIMEOUT_MS
359
+ };
@@ -71,21 +71,21 @@ import {
71
71
  sweepStaleDelegations,
72
72
  updateCoderSettlement,
73
73
  writeDelegationFallback
74
- } from "./index-9j5jjqks.js";
75
- import"./index-gc6h1fmf.js";
74
+ } from "./index-8c37kzh6.js";
75
+ import"./index-a2hvmc3a.js";
76
76
  import"./index-2s7dvzff.js";
77
- import"./index-91dhg3wr.js";
78
- import"./index-vmthakz0.js";
79
- import"./index-bv4b8tpa.js";
77
+ import"./index-ved1325w.js";
78
+ import"./index-w1ydvzef.js";
79
+ import"./index-vvgpgcyn.js";
80
80
  import"./index-rdm3px0g.js";
81
81
  import"./index-ry16d01s.js";
82
- import"./index-516j9vsk.js";
83
- import"./index-yhx94xpr.js";
82
+ import"./index-kkrbybgt.js";
83
+ import"./index-7s6ct0t2.js";
84
84
  import"./index-vzm6zre7.js";
85
85
  import"./index-ae75rja9.js";
86
- import"./index-12ewkms0.js";
87
- import"./index-ea9fk6v0.js";
88
- import"./index-6mwha20t.js";
86
+ import"./index-23mdeh2a.js";
87
+ import"./index-ap6hs8fj.js";
88
+ import"./index-mkpdcbye.js";
89
89
  import"./index-1xnse449.js";
90
90
  import"./index-c1ggtmpm.js";
91
91
  import"./index-ejhxgyvm.js";