opencode-swarm 7.200.1 → 7.200.2

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 (81) 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/cli/{attest-task-sg8b5a5j.js → attest-task-s9cpm1pa.js} +25 -25
  4. package/dist/cli/{auto-checkpoint-bywgxh27.js → auto-checkpoint-bhtc5gjf.js} +4 -4
  5. package/dist/cli/{checkpoint-k2092cbw.js → checkpoint-1jmfejsh.js} +8 -8
  6. package/dist/cli/{coder-settlement-y0hkcngn.js → coder-settlement-qabkaq79.js} +3 -3
  7. package/dist/cli/{config-doctor-0fnrwkga.js → config-doctor-q4805y29.js} +7 -7
  8. package/dist/cli/{core-mfyaj8b4.js → core-jtmr767v.js} +1 -1
  9. package/dist/cli/{curator-1s64jkc3.js → curator-4tqbp1re.js} +25 -25
  10. package/dist/cli/{curator-drift-famx6p6s.js → curator-drift-681mc3a2.js} +5 -5
  11. package/dist/cli/{curator-llm-factory-vya4epq6.js → curator-llm-factory-46bzwbzr.js} +25 -25
  12. package/dist/cli/{doctor-knowledge-receipt-phase-id-v4y6pbek.js → doctor-knowledge-receipt-phase-id-h16qsh6e.js} +4 -4
  13. package/dist/cli/{evidence-summary-service-rd7y6yjq.js → evidence-summary-service-qr8kf99s.js} +9 -9
  14. package/dist/cli/{gate-evidence-kama66h5.js → gate-evidence-phq4rs28.js} +2 -2
  15. package/dist/cli/{guardrail-explain-8fkhq0cg.js → guardrail-explain-q2eqawnk.js} +26 -26
  16. package/dist/cli/{guardrail-log-gdj19fq5.js → guardrail-log-jk30vszs.js} +3 -3
  17. package/dist/cli/{guardrail-reset-bmg6czzk.js → guardrail-reset-0sfceecs.js} +25 -25
  18. package/dist/cli/{hive-promoter-ychygdgc.js → hive-promoter-8v9vcd75.js} +25 -25
  19. package/dist/cli/{index-b0d8ra32.js → index-048p7deh.js} +1 -1
  20. package/dist/cli/{index-2w5grmmj.js → index-0jmt8y9r.js} +2 -2
  21. package/dist/cli/{index-f6nrw8am.js → index-1feqa2vz.js} +25 -25
  22. package/dist/cli/{index-pe77h482.js → index-43scxm6a.js} +1 -1
  23. package/dist/cli/{index-vtkgg2qn.js → index-4cw3w8qm.js} +3 -3
  24. package/dist/cli/{index-z9mysg5m.js → index-4ts6jpmj.js} +1 -1
  25. package/dist/cli/{index-nawp90n7.js → index-56w2vy52.js} +3 -3
  26. package/dist/cli/{index-3exe6k66.js → index-ab1k780s.js} +1 -1
  27. package/dist/cli/{index-s8eac99p.js → index-bncex5hw.js} +2 -2
  28. package/dist/cli/{index-dgyddtje.js → index-bt2h69a2.js} +6 -6
  29. package/dist/cli/{index-c9g3hkjz.js → index-bw6q2v41.js} +3 -3
  30. package/dist/cli/{index-qaqyq25k.js → index-evf5t4ba.js} +3 -3
  31. package/dist/cli/{index-2dm42tgp.js → index-f50e1pn3.js} +27 -27
  32. package/dist/cli/{index-sz67z90q.js → index-gpr3j0w1.js} +1 -1
  33. package/dist/cli/{index-51dw4bjc.js → index-gss7ch5k.js} +2 -2
  34. package/dist/cli/{index-0tygsk8b.js → index-h29ckdg5.js} +3 -3
  35. package/dist/cli/{index-12h2rtdj.js → index-kezh6nhq.js} +1 -1
  36. package/dist/cli/{index-th667k1y.js → index-mrq61h10.js} +3 -3
  37. package/dist/cli/{index-bn3aa5q1.js → index-nbg19t1b.js} +4 -4
  38. package/dist/cli/{index-qzakbjcg.js → index-ngzt2xmr.js} +1 -1
  39. package/dist/cli/{index-3zspah3v.js → index-pktvge7a.js} +1 -1
  40. package/dist/cli/{index-3020n6d9.js → index-pvpeggb5.js} +1 -1
  41. package/dist/cli/{index-sva5swrs.js → index-rav29yb2.js} +1 -1
  42. package/dist/cli/{index-rzkmg02a.js → index-sv514p10.js} +3 -3
  43. package/dist/cli/{index-0ptf66x5.js → index-trvn0kg0.js} +2 -2
  44. package/dist/cli/{index-parkaa70.js → index-vrvcn7k1.js} +2 -2
  45. package/dist/cli/{index-2m740hyt.js → index-xfkzwc4p.js} +1 -1
  46. package/dist/cli/{index-2hnnkj64.js → index-y7khxj1g.js} +108 -63
  47. package/dist/cli/{index-p6v544jn.js → index-yctvn9z9.js} +5 -3
  48. package/dist/cli/{index-w2bhrp6z.js → index-yk3b7ywa.js} +5 -5
  49. package/dist/cli/index.js +26 -26
  50. package/dist/cli/{knowledge-escalator-zxd76jna.js → knowledge-escalator-53n7wa7s.js} +7 -7
  51. package/dist/cli/{knowledge-events-z8h0wmaw.js → knowledge-events-80fw8pf6.js} +5 -5
  52. package/dist/cli/{knowledge-store-g2gm13s8.js → knowledge-store-rh1v0509.js} +1 -1
  53. package/dist/cli/{knowledge-validator-2sech2sx.js → knowledge-validator-c3926fw5.js} +2 -2
  54. package/dist/cli/{mcp-t88363gj.js → mcp-r43tvhzy.js} +1 -1
  55. package/dist/cli/{model-preflight-akj8g1m2.js → model-preflight-vx9px5ac.js} +25 -25
  56. package/dist/cli/{pending-delegations-bqp6b6as.js → pending-delegations-0vbkv5d2.js} +2 -2
  57. package/dist/cli/{pr-subscriptions-wxjvkg56.js → pr-subscriptions-a6cm44fs.js} +1 -1
  58. package/dist/cli/{pr-workflow-gate-2wcrfa6g.js → pr-workflow-gate-yvgpmywz.js} +25 -25
  59. package/dist/cli/{scan-cursor-8br4x41t.js → scan-cursor-pk4h80c1.js} +2 -2
  60. package/dist/cli/{schema-mc419qh8.js → schema-5rxfybx2.js} +1 -1
  61. package/dist/cli/{scope-persistence-5gyjt70q.js → scope-persistence-qzs1f91v.js} +5 -5
  62. package/dist/cli/{server-bp247fqe.js → server-gdewbeyb.js} +25 -25
  63. package/dist/cli/{skill-generator-q4afafh3.js → skill-generator-xh2w2pvq.js} +8 -8
  64. package/dist/cli/{snapshot-coordination-init-b4kmrgh7.js → snapshot-coordination-init-jn2rh2s8.js} +25 -25
  65. package/dist/cli/{speckit-checkoff-1v02b2dt.js → speckit-checkoff-98zsw8c4.js} +3 -3
  66. package/dist/cli/{worktree-collision-ownership-84m9f5an.js → worktree-collision-ownership-2xqxqp0x.js} +2 -2
  67. package/dist/cli/{worktree-isolation-xwbszhja.js → worktree-isolation-rxpwxvw3.js} +25 -25
  68. package/dist/config/schema.d.ts +2 -0
  69. package/dist/full-auto/code-mode-program.d.ts +31 -0
  70. package/dist/full-auto/critic-tools.d.ts +18 -0
  71. package/dist/full-auto/policy.d.ts +17 -0
  72. package/dist/hooks/code-mode-wrapper.d.ts +28 -0
  73. package/dist/hooks/full-auto-intercept.d.ts +5 -0
  74. package/dist/hooks/full-auto-permission.d.ts +25 -0
  75. package/dist/hooks/pr-workflow-gate.d.ts +21 -1
  76. package/dist/host/v2/hook-budget.d.ts +37 -0
  77. package/dist/host/v2/hooks.d.ts +9 -0
  78. package/dist/host/v2/setup.d.ts +14 -0
  79. package/dist/index.js +52 -49
  80. package/opencode-swarm.schema.json +8 -0
  81. package/package.json +1 -1
@@ -33,20 +33,20 @@ import {
33
33
  sanitizeSlug,
34
34
  selectCandidateEntries,
35
35
  writeEvalStub
36
- } from "./index-th667k1y.js";
36
+ } from "./index-mrq61h10.js";
37
37
  import"./index-q7sjgr1y.js";
38
- import"./index-0ptf66x5.js";
39
- import"./index-parkaa70.js";
38
+ import"./index-trvn0kg0.js";
39
+ import"./index-vrvcn7k1.js";
40
40
  import"./index-m9zzj4ee.js";
41
41
  import"./index-xyvsdn07.js";
42
- import"./index-sz67z90q.js";
42
+ import"./index-gpr3j0w1.js";
43
43
  import"./index-v1h70r3y.js";
44
44
  import"./index-rtry5xyf.js";
45
- import"./index-51dw4bjc.js";
45
+ import"./index-gss7ch5k.js";
46
46
  import"./index-g22dps7x.js";
47
47
  import"./index-0725jpp7.js";
48
48
  import"./index-ypxq0x7r.js";
49
- import"./index-bn3aa5q1.js";
49
+ import"./index-nbg19t1b.js";
50
50
  import"./index-vzm6zre7.js";
51
51
  import"./index-ae75rja9.js";
52
52
  import"./index-g57p8p1k.js";
@@ -59,11 +59,11 @@ import"./index-ejhxgyvm.js";
59
59
  import"./index-7g4c7s5r.js";
60
60
  import"./index-epzadpmm.js";
61
61
  import"./index-3t46mez1.js";
62
- import"./index-3020n6d9.js";
62
+ import"./index-pvpeggb5.js";
63
63
  import"./index-sp2cxpaq.js";
64
64
  import"./index-qbxk2rn6.js";
65
65
  import"./index-zgwm4ryv.js";
66
- import"./index-p6v544jn.js";
66
+ import"./index-yctvn9z9.js";
67
67
  import"./index-xfzkq1k4.js";
68
68
  import"./index-bk5tah7q.js";
69
69
  import"./index-gknz3bv1.js";
@@ -8,51 +8,51 @@ import {
8
8
  markSnapshotCoordinationClosing,
9
9
  retrySnapshotCoordinationInitialization,
10
10
  startSnapshotCoordinationInitialization
11
- } from "./index-2hnnkj64.js";
11
+ } from "./index-y7khxj1g.js";
12
12
  import"./index-s3w41p1x.js";
13
- import"./index-qzakbjcg.js";
14
- import"./index-c9g3hkjz.js";
15
- import"./index-pe77h482.js";
13
+ import"./index-ngzt2xmr.js";
14
+ import"./index-bw6q2v41.js";
15
+ import"./index-43scxm6a.js";
16
16
  import"./index-5snwc3dz.js";
17
17
  import"./index-axqyjreb.js";
18
18
  import"./index-txdagbh7.js";
19
- import"./index-dgyddtje.js";
20
- import"./index-z9mysg5m.js";
19
+ import"./index-bt2h69a2.js";
20
+ import"./index-4ts6jpmj.js";
21
21
  import"./index-rdec0y3z.js";
22
- import"./index-12h2rtdj.js";
23
- import"./index-qaqyq25k.js";
24
- import"./index-th667k1y.js";
22
+ import"./index-kezh6nhq.js";
23
+ import"./index-evf5t4ba.js";
24
+ import"./index-mrq61h10.js";
25
25
  import"./index-1v277wxc.js";
26
26
  import"./index-wgf1780e.js";
27
27
  import"./index-x5jwegqw.js";
28
28
  import"./index-b4kdms7x.js";
29
- import"./index-0tygsk8b.js";
29
+ import"./index-h29ckdg5.js";
30
30
  import"./index-pt7h91zc.js";
31
31
  import"./index-q7sjgr1y.js";
32
- import"./index-rzkmg02a.js";
33
- import"./index-w2bhrp6z.js";
32
+ import"./index-sv514p10.js";
33
+ import"./index-yk3b7ywa.js";
34
34
  import"./index-6b295cas.js";
35
35
  import"./index-9nyqt3kb.js";
36
- import"./index-vtkgg2qn.js";
36
+ import"./index-4cw3w8qm.js";
37
37
  import"./index-v3bmwmqw.js";
38
38
  import"./index-8mrentmw.js";
39
- import"./index-3zspah3v.js";
40
- import"./index-sva5swrs.js";
41
- import"./index-3exe6k66.js";
39
+ import"./index-pktvge7a.js";
40
+ import"./index-rav29yb2.js";
41
+ import"./index-ab1k780s.js";
42
42
  import"./index-spggmr30.js";
43
- import"./index-0ptf66x5.js";
44
- import"./index-parkaa70.js";
43
+ import"./index-trvn0kg0.js";
44
+ import"./index-vrvcn7k1.js";
45
45
  import"./index-m9zzj4ee.js";
46
46
  import"./index-xyvsdn07.js";
47
- import"./index-sz67z90q.js";
47
+ import"./index-gpr3j0w1.js";
48
48
  import"./index-v1h70r3y.js";
49
49
  import"./index-rtry5xyf.js";
50
- import"./index-51dw4bjc.js";
50
+ import"./index-gss7ch5k.js";
51
51
  import"./index-g22dps7x.js";
52
52
  import"./index-0725jpp7.js";
53
- import"./index-2m740hyt.js";
53
+ import"./index-xfkzwc4p.js";
54
54
  import"./index-s9y49avf.js";
55
- import"./index-s8eac99p.js";
55
+ import"./index-bncex5hw.js";
56
56
  import"./index-na6ph1fp.js";
57
57
  import"./index-ves1rtqt.js";
58
58
  import"./index-ry16d01s.js";
@@ -61,7 +61,7 @@ import"./index-nzfq1ms2.js";
61
61
  import"./index-7pmbnjvj.js";
62
62
  import"./index-9rwhas09.js";
63
63
  import"./index-ypxq0x7r.js";
64
- import"./index-bn3aa5q1.js";
64
+ import"./index-nbg19t1b.js";
65
65
  import"./index-vzm6zre7.js";
66
66
  import"./index-ae75rja9.js";
67
67
  import"./index-g57p8p1k.js";
@@ -74,11 +74,11 @@ import"./index-ejhxgyvm.js";
74
74
  import"./index-7g4c7s5r.js";
75
75
  import"./index-epzadpmm.js";
76
76
  import"./index-3t46mez1.js";
77
- import"./index-3020n6d9.js";
77
+ import"./index-pvpeggb5.js";
78
78
  import"./index-sp2cxpaq.js";
79
79
  import"./index-qbxk2rn6.js";
80
80
  import"./index-zgwm4ryv.js";
81
- import"./index-p6v544jn.js";
81
+ import"./index-yctvn9z9.js";
82
82
  import"./index-xfzkq1k4.js";
83
83
  import"./index-bk5tah7q.js";
84
84
  import"./index-gknz3bv1.js";
@@ -7,15 +7,15 @@ import {
7
7
  parseSpeckitTasksContent,
8
8
  propagateSpeckitCheckoff,
9
9
  writeSpeckitCheckoffLedger
10
- } from "./index-3zspah3v.js";
10
+ } from "./index-pktvge7a.js";
11
11
  import"./index-ejhxgyvm.js";
12
12
  import"./index-7g4c7s5r.js";
13
13
  import"./index-epzadpmm.js";
14
- import"./index-3020n6d9.js";
14
+ import"./index-pvpeggb5.js";
15
15
  import"./index-sp2cxpaq.js";
16
16
  import"./index-qbxk2rn6.js";
17
17
  import"./index-zgwm4ryv.js";
18
- import"./index-p6v544jn.js";
18
+ import"./index-yctvn9z9.js";
19
19
  import"./index-xfzkq1k4.js";
20
20
  import"./index-bk5tah7q.js";
21
21
  import"./index-gknz3bv1.js";
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  scanDelegationFallbacksForRecovery,
12
12
  scanDelegationsForRecovery
13
- } from "./index-0tygsk8b.js";
13
+ } from "./index-h29ckdg5.js";
14
14
  import {
15
15
  scanWorktreeMergeFailuresForRecovery
16
16
  } from "./index-v3bmwmqw.js";
@@ -23,7 +23,7 @@ import"./index-rdm3px0g.js";
23
23
  import"./index-nzfq1ms2.js";
24
24
  import"./index-7pmbnjvj.js";
25
25
  import"./index-ypxq0x7r.js";
26
- import"./index-bn3aa5q1.js";
26
+ import"./index-nbg19t1b.js";
27
27
  import"./index-vzm6zre7.js";
28
28
  import"./index-ae75rja9.js";
29
29
  import"./index-g57p8p1k.js";
@@ -25,53 +25,53 @@ import {
25
25
  sanitizeWorktreeTaskId,
26
26
  standardWorktreeByCallID,
27
27
  standardWorktreeSerializationSessions
28
- } from "./index-2hnnkj64.js";
28
+ } from "./index-y7khxj1g.js";
29
29
  import"./index-s3w41p1x.js";
30
- import"./index-qzakbjcg.js";
31
- import"./index-c9g3hkjz.js";
32
- import"./index-pe77h482.js";
30
+ import"./index-ngzt2xmr.js";
31
+ import"./index-bw6q2v41.js";
32
+ import"./index-43scxm6a.js";
33
33
  import"./index-5snwc3dz.js";
34
34
  import"./index-axqyjreb.js";
35
35
  import"./index-txdagbh7.js";
36
- import"./index-dgyddtje.js";
37
- import"./index-z9mysg5m.js";
36
+ import"./index-bt2h69a2.js";
37
+ import"./index-4ts6jpmj.js";
38
38
  import"./index-rdec0y3z.js";
39
- import"./index-12h2rtdj.js";
40
- import"./index-qaqyq25k.js";
41
- import"./index-th667k1y.js";
39
+ import"./index-kezh6nhq.js";
40
+ import"./index-evf5t4ba.js";
41
+ import"./index-mrq61h10.js";
42
42
  import"./index-1v277wxc.js";
43
43
  import"./index-wgf1780e.js";
44
44
  import"./index-x5jwegqw.js";
45
45
  import"./index-b4kdms7x.js";
46
- import"./index-0tygsk8b.js";
46
+ import"./index-h29ckdg5.js";
47
47
  import"./index-pt7h91zc.js";
48
48
  import"./index-q7sjgr1y.js";
49
- import"./index-rzkmg02a.js";
50
- import"./index-w2bhrp6z.js";
49
+ import"./index-sv514p10.js";
50
+ import"./index-yk3b7ywa.js";
51
51
  import"./index-6b295cas.js";
52
52
  import"./index-9nyqt3kb.js";
53
- import"./index-vtkgg2qn.js";
53
+ import"./index-4cw3w8qm.js";
54
54
  import"./index-v3bmwmqw.js";
55
55
  import"./index-8mrentmw.js";
56
- import"./index-3zspah3v.js";
57
- import"./index-sva5swrs.js";
58
- import"./index-3exe6k66.js";
56
+ import"./index-pktvge7a.js";
57
+ import"./index-rav29yb2.js";
58
+ import"./index-ab1k780s.js";
59
59
  import"./index-spggmr30.js";
60
- import"./index-0ptf66x5.js";
61
- import"./index-parkaa70.js";
60
+ import"./index-trvn0kg0.js";
61
+ import"./index-vrvcn7k1.js";
62
62
  import"./index-m9zzj4ee.js";
63
63
  import"./index-xyvsdn07.js";
64
- import"./index-sz67z90q.js";
64
+ import"./index-gpr3j0w1.js";
65
65
  import"./index-v1h70r3y.js";
66
66
  import"./index-rtry5xyf.js";
67
67
  import {
68
68
  resolveWorktreeIsolationConfig
69
- } from "./index-51dw4bjc.js";
69
+ } from "./index-gss7ch5k.js";
70
70
  import"./index-g22dps7x.js";
71
71
  import"./index-0725jpp7.js";
72
- import"./index-2m740hyt.js";
72
+ import"./index-xfkzwc4p.js";
73
73
  import"./index-s9y49avf.js";
74
- import"./index-s8eac99p.js";
74
+ import"./index-bncex5hw.js";
75
75
  import"./index-na6ph1fp.js";
76
76
  import"./index-ves1rtqt.js";
77
77
  import"./index-ry16d01s.js";
@@ -80,7 +80,7 @@ import"./index-nzfq1ms2.js";
80
80
  import"./index-7pmbnjvj.js";
81
81
  import"./index-9rwhas09.js";
82
82
  import"./index-ypxq0x7r.js";
83
- import"./index-bn3aa5q1.js";
83
+ import"./index-nbg19t1b.js";
84
84
  import"./index-vzm6zre7.js";
85
85
  import"./index-ae75rja9.js";
86
86
  import"./index-g57p8p1k.js";
@@ -93,11 +93,11 @@ import"./index-ejhxgyvm.js";
93
93
  import"./index-7g4c7s5r.js";
94
94
  import"./index-epzadpmm.js";
95
95
  import"./index-3t46mez1.js";
96
- import"./index-3020n6d9.js";
96
+ import"./index-pvpeggb5.js";
97
97
  import"./index-sp2cxpaq.js";
98
98
  import"./index-qbxk2rn6.js";
99
99
  import"./index-zgwm4ryv.js";
100
- import"./index-p6v544jn.js";
100
+ import"./index-yctvn9z9.js";
101
101
  import"./index-xfzkq1k4.js";
102
102
  import"./index-bk5tah7q.js";
103
103
  import"./index-gknz3bv1.js";
@@ -3380,6 +3380,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
3380
3380
  trusted_domains: z.ZodDefault<z.ZodArray<z.ZodString>>;
3381
3381
  protected_paths: z.ZodDefault<z.ZodArray<z.ZodString>>;
3382
3382
  allow_defaults: z.ZodDefault<z.ZodBoolean>;
3383
+ trust_code_mode_wrapper: z.ZodOptional<z.ZodBoolean>;
3383
3384
  }, z.core.$strip>>;
3384
3385
  denials: z.ZodDefault<z.ZodObject<{
3385
3386
  max_consecutive: z.ZodDefault<z.ZodNumber>;
@@ -3402,6 +3403,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
3402
3403
  max_consecutive_dispatch_failures: z.ZodDefault<z.ZodNumber>;
3403
3404
  total_timeout_ms: z.ZodDefault<z.ZodNumber>;
3404
3405
  cleanup_timeout_ms: z.ZodDefault<z.ZodNumber>;
3406
+ hook_timeout_ms: z.ZodOptional<z.ZodNumber>;
3405
3407
  }, z.core.$strip>>;
3406
3408
  }, z.core.$strip>>>;
3407
3409
  pr_feedback_loop: z.ZodOptional<z.ZodObject<{
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Strict recogniser for the only OpenCode v2 Code Mode programs Full-Auto may
3
+ * pass through without a critic (#3446).
4
+ *
5
+ * The Code Mode sandbox is not limited to hooked tools: it also exposes
6
+ * `fetch`, `Function`, `crypto`, `URL`, `Promise`, `JSON`, `Math` and `Date`
7
+ * (observed on OpenCode 2.1.4), so "the wrapper only routes nested tool calls"
8
+ * is false in general. A denylist over arbitrary JS cannot be made safe
9
+ * (`Function(...)`, computed member access, string concatenation). Instead,
10
+ * this module ACCEPTS a tiny grammar and rejects everything else:
11
+ *
12
+ * program := ws [`return` ws] [`await` ws] callee ws `(` ws [value] ws `)` ws [`;`] ws
13
+ * callee := `search` | `tools` segment+
14
+ * segment := `.` ident | `[` ws string ws `]`
15
+ * value := string | number | `true` | `false` | `null` | object | array
16
+ * object := `{` ws [pair (ws `,` ws pair)* [ws `,`]] ws `}`
17
+ * pair := (ident | string) ws `:` ws value
18
+ *
19
+ * That is exactly one tool call whose argument is plain data: no identifiers
20
+ * other than the callee path and object keys, so no other call, no member
21
+ * access on a value, no computed keys, no templates, comments, regexes or
22
+ * functions can appear. The nested call itself is still dispatched through the
23
+ * same tool.execute.before chain under its own name and classified there.
24
+ * Anything else (multi-statement, loops, variables, `fetch`, ...) returns
25
+ * false and Full-Auto keeps escalating it to the critic.
26
+ */
27
+ /**
28
+ * True only when `code` is exactly one `tools.<path>(<plain data>)` or
29
+ * `search(<plain data>)` call, optionally prefixed by `return` and/or `await`.
30
+ */
31
+ export declare function isSingleToolCallProgram(code: unknown): boolean;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Tools denied to the Full-Auto critic agent (#3446).
3
+ *
4
+ * The critic's task is "verify using read-only tools only", but `shell`/`bash`
5
+ * are not read-only and — worse for latency — let the critic wander: on
6
+ * OpenCode 2 every observed critic session ran `grep -rl` / `find ~` over the
7
+ * user's home directory until the oversight deadline killed it, so no verdict
8
+ * was ever produced and Full-Auto paused. Shell is denied alongside the
9
+ * mutating tools; the critic keeps read/grep/glob and the swarm's own
10
+ * read-only verification tools (diff, evidence, test_impact, symbols).
11
+ *
12
+ * Limit, stated plainly: `execute` (OpenCode 2 Code Mode, which reaches plugin
13
+ * tools such as diff/evidence/test_impact) stays available to the critic by
14
+ * design, and its sandbox also exposes `fetch`/`Function`, which no hook sees.
15
+ * This denial list therefore bounds shell and mutating tools only; it is not a
16
+ * sandbox. A restricted critic Code Mode surface is a follow-up.
17
+ */
18
+ export declare const FULL_AUTO_CRITIC_DENIED_TOOLS: Readonly<Record<string, false>>;
@@ -31,6 +31,8 @@ export interface FullAutoPolicyConfig {
31
31
  trusted_domains?: string[];
32
32
  protected_paths?: string[];
33
33
  allow_defaults?: boolean;
34
+ /** Opt in to passing the marked OpenCode 2 Code Mode wrapper (#3446). */
35
+ trust_code_mode_wrapper?: boolean;
34
36
  };
35
37
  oversight?: {
36
38
  on_high_risk_action?: boolean;
@@ -52,6 +54,21 @@ export interface FullAutoClassifierInput {
52
54
  planSummary?: string;
53
55
  changedFiles?: string[];
54
56
  fullAutoConfig: FullAutoPolicyConfig | undefined;
57
+ /**
58
+ * True for a call the OpenCode v2 adapter marked as the host's Code Mode
59
+ * `execute` wrapper (see `src/hooks/code-mode-wrapper.ts`). The mark is not
60
+ * proof of provenance (a same-named third-party tool is marked too), so it
61
+ * is only honoured with the operator opt-in `trust_code_mode_wrapper`.
62
+ */
63
+ hostCodeModeWrapper?: boolean;
64
+ /**
65
+ * True when this `swarm_command` is on the explicit read-only allowlist
66
+ * (`READ_ONLY_SWARM_COMMANDS`) AND the tool's own policy allows it. Computed
67
+ * by the permission hook so this module stays free of the command
68
+ * registry's import graph. Absent or false means the call is escalated like
69
+ * any unclassified tool.
70
+ */
71
+ swarmCommandReadOnly?: boolean;
55
72
  pluginConfig?: {
56
73
  memory?: {
57
74
  enabled?: boolean;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Per-call marker for the OpenCode v2 Code Mode `execute` wrapper (#3446).
3
+ *
4
+ * OpenCode v2 reaches plugin and MCP tools through one host-owned `execute`
5
+ * tool whose input is a JS program (`{ code }`); every nested `tools.<name>()`
6
+ * call is dispatched through the tool.execute.before chain under its own name.
7
+ * Only the v2 adapter sees the host's real tool id, so only the adapter can
8
+ * mark a call. The mark is NOT proof of provenance: a v2 tool event is just
9
+ * {tool, sessionID, agent, messageID, id, input}, so a plugin- or MCP-provided
10
+ * tool that shares the name `execute` and takes a string `code` is marked too.
11
+ * That is why the Full-Auto classifier only honours the mark when the operator
12
+ * opts in (`permission_policy.trust_code_mode_wrapper`, default false) and the
13
+ * program is exactly one plain-data tool call. On a v1 host nothing is marked.
14
+ *
15
+ * Side-channel shape mirrors `src/sandbox/skip-state.ts` (keyed by
16
+ * session + call, bounded, FIFO-evicted) so session state stays bounded
17
+ * (invariant 8).
18
+ */
19
+ /** Hard cap on retained marks; oldest are evicted first. */
20
+ export declare const MAX_CODE_MODE_WRAPPER_MARKS = 256;
21
+ /** Record that this exact call is the host's Code Mode `execute` wrapper. */
22
+ export declare function recordCodeModeWrapperCall(sessionID: string, callID: string): void;
23
+ /** True only for a call the v2 adapter marked as the Code Mode wrapper. */
24
+ export declare function isCodeModeWrapperCall(sessionID: string, callID: string | undefined): boolean;
25
+ /** Drop a mark once the call has completed. */
26
+ export declare function clearCodeModeWrapperCall(sessionID: string, callID: string): void;
27
+ /** Test seam: drop every mark. */
28
+ export declare function resetCodeModeWrapperCalls(): void;
@@ -69,4 +69,9 @@ export declare function createFullAutoInterceptHook(config: PluginConfig, direct
69
69
  messages?: MessageWithParts[];
70
70
  }) => Promise<void>;
71
71
  };
72
+ /**
73
+ * Builds additional context to append to the autonomous oversight prompt.
74
+ * This provides the architect's question/output for the critic to evaluate.
75
+ */
76
+ export declare function buildCriticContext(architectOutput: string, escalationType: 'phase_completion' | 'question'): string;
72
77
  export {};
@@ -35,6 +35,31 @@ export interface FullAutoPermissionHookOptions {
35
35
  config: PluginConfig;
36
36
  directory: string;
37
37
  }
38
+ /**
39
+ * `/swarm` commands that only read and display state. Deliberately SEPARATE from
40
+ * the tool policy's agent allowlist, which also contains state-changing and
41
+ * process-spawning commands (`auto-proceed`, `guardrail reset`, `attest`,
42
+ * `ci-simulate`, `gate-audit`, `review`, `post-mortem`, `pr subscribe`,
43
+ * `sdd project`, `*-opt` runs, ...). Canonical keys.
44
+ *
45
+ * The invariant is: no change to source, plan, gates or any operator-visible
46
+ * state, and no process spawn or network egress. Some of these commands do
47
+ * refresh bookkeeping under `.swarm/` (e.g. `report` writes `.swarm/swarm.db`
48
+ * and a cohort manifest, `memory *` create `.swarm/memory/memory.db`, and
49
+ * commands that load the plan may regenerate `plan.md`): writes are confined
50
+ * to `.swarm/`, which `tests/unit/hooks/full-auto-swarm-command-policy-3446.test.ts`
51
+ * pins by running every key and diffing the tree outside `.swarm/`. Keys that
52
+ * were shown to spawn processes (`diagnose`, `doctor tools`) or contact
53
+ * GitHub (`pr status`) are NOT in this set.
54
+ */
55
+ export declare const READ_ONLY_SWARM_COMMANDS: ReadonlySet<string>;
56
+ /**
57
+ * Is this `swarm_command` call on the read-only allowlist AND permitted by the
58
+ * tool's own policy for this exact command + args? Anything else (unknown,
59
+ * human-only, restricted, bad args, or any state-changing command) returns
60
+ * false and falls through to the normal escalation.
61
+ */
62
+ export declare function isSwarmCommandReadOnly(args: unknown): boolean;
38
63
  export declare function createFullAutoPermissionHook(options: FullAutoPermissionHookOptions): {
39
64
  toolBefore: (input: {
40
65
  tool: string;
@@ -31,7 +31,7 @@ export { PR_REVIEW_BASE_DIMENSION_IDS };
31
31
  export declare const PR_REVIEW_REQUIRED_MICRO_LANE_IDS: ("auth-identity-secrets" | "untrusted-input-boundaries" | "subprocess-platform" | "concurrency-state" | "dependencies-build-release" | "api-schema-migrations" | "test-infrastructure" | "ui-accessibility-i18n" | "privacy-observability" | "generated-provenance" | "unclassified-risk")[];
32
32
  export type PrReviewBaseDimensionId = (typeof PR_REVIEW_BASE_DIMENSION_IDS)[number];
33
33
  export type PrWorkflowMode = 'PR_REVIEW' | 'PR_FEEDBACK';
34
- export type PrReviewLaneValidationPredicate = 'batch.validated_at' | 'batch.expected_lane_unique' | 'record.missing' | 'record.duplicate_lane' | 'record.subagent_session_id' | 'record.duplicate_subagent_session_id' | 'record.forbidden_subagent_session_id' | 'record.created_at' | 'record.workflow_lane' | 'record.owned_workflow_lanes' | 'record.mode' | 'record.pr_head_sha' | 'record.git_head' | 'record.status' | 'result.output_degraded' | 'result.transcript_incomplete' | 'result.chars' | 'result.digest' | 'result.output_ref' | 'artifact.readable' | 'artifact.ref' | 'artifact.batch_id' | 'artifact.lane_id' | 'artifact.mode' | 'artifact.session_id' | 'artifact.parent_session_id' | 'artifact.agent' | 'artifact.role' | 'artifact.source' | 'artifact.workflow_lane_record' | 'artifact.workflow_lane_expected' | 'artifact.pr_head_sha' | 'artifact.git_head' | 'artifact.revision_digest' | 'record.scope' | 'artifact.scope' | 'artifact.digest' | 'artifact.chars' | 'discovery.header' | 'discovery.row' | 'discovery.coverage' | 'discovery.duplicate_evidence' | 'reviewer.verdict_rows' | 'critic.verdict_rows';
34
+ export type PrReviewLaneValidationPredicate = 'batch.validated_at' | 'batch.expected_lane_unique' | 'record.missing' | 'record.duplicate_lane' | 'record.subagent_session_id' | 'record.duplicate_subagent_session_id' | 'record.forbidden_subagent_session_id' | 'record.created_at' | 'record.workflow_lane' | 'record.owned_workflow_lanes' | 'record.mode' | 'record.normalized_agent' | 'record.pr_head_sha' | 'record.git_head' | 'record.status' | 'result.output_degraded' | 'result.transcript_incomplete' | 'result.chars' | 'result.digest' | 'result.output_ref' | 'artifact.readable' | 'artifact.ref' | 'artifact.batch_id' | 'artifact.lane_id' | 'artifact.mode' | 'artifact.session_id' | 'artifact.parent_session_id' | 'artifact.agent' | 'artifact.role' | 'artifact.source' | 'artifact.workflow_lane_record' | 'artifact.workflow_lane_expected' | 'artifact.pr_head_sha' | 'artifact.git_head' | 'artifact.revision_digest' | 'record.scope' | 'artifact.scope' | 'artifact.digest' | 'artifact.chars' | 'discovery.header' | 'discovery.row' | 'discovery.coverage' | 'discovery.duplicate_evidence' | 'reviewer.verdict_rows' | 'critic.verdict_rows';
35
35
  export interface PrReviewLaneValidationFailure {
36
36
  predicate: PrReviewLaneValidationPredicate;
37
37
  expected: string;
@@ -182,6 +182,15 @@ export interface PrWorkflowLaneSpec {
182
182
  laneId?: string;
183
183
  workflowLane?: string;
184
184
  reviewItemIds?: string[];
185
+ /**
186
+ * The agent this lane declares it will run (threaded from the dispatch
187
+ * lane's `agent`). The critic-phase recorder asserts its canonical role
188
+ * (issue #3340 AC1): PR_REVIEW critic batches are refused unless every
189
+ * lane declares an agent whose resolved role is exactly `critic`, so the
190
+ * role rule holds at the persisting boundary instead of only at the
191
+ * dispatch call site (#3310). Persisted on the batch record for audit.
192
+ */
193
+ agent?: string;
185
194
  /**
186
195
  * Complete dimension/family set this lane covers under a consolidated depth
187
196
  * tier. Must contain workflowLane. Absent means the singleton [workflowLane].
@@ -425,6 +434,8 @@ interface PrReviewValidationBatchRecord {
425
434
  laneId: string;
426
435
  workflowLane: string;
427
436
  reviewItemIds?: string[];
437
+ /** Declared lane agent (issue #3340 audit trail; critic batches refuse non-critic roles at record time). */
438
+ agent?: string;
428
439
  }>;
429
440
  validatedAt: string;
430
441
  }
@@ -1357,6 +1368,14 @@ export declare function recordPrReviewValidationBatch(directory: string, session
1357
1368
  * closed so the prompt can never misrepresent the stamped receipt.
1358
1369
  */
1359
1370
  expectedPresentationOrder?: 'A' | 'B';
1371
+ /**
1372
+ * Issue #3340 AC1: the generated-agent-name registry the dispatch
1373
+ * caller resolves lane roles against. When supplied, the critic-phase
1374
+ * admission below resolves declared agents through the identical
1375
+ * strict resolver, so the gate verdict matches the dispatch verdict
1376
+ * for prefixed generated names (e.g. `mega_critic`).
1377
+ */
1378
+ generatedAgentNames?: readonly string[];
1360
1379
  }): Promise<PrWorkflowGateState>;
1361
1380
  /**
1362
1381
  * Validate that every declared council obligation has a successful retry, and
@@ -1835,6 +1854,7 @@ export declare const _test_exports: {
1835
1854
  laneId: string;
1836
1855
  workflowLane: string;
1837
1856
  reviewItemIds?: string[] | undefined;
1857
+ agent?: string | undefined;
1838
1858
  }[];
1839
1859
  validatedAt: string;
1840
1860
  }[] | undefined;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Budget for the OpenCode 2 `tool.execute.before` guard chain (#3446).
3
+ *
4
+ * The v2 adapter wraps the whole v1 before-chain in one timeout. The chain is
5
+ * normally instant, but while Full-Auto is running it can contain an LLM
6
+ * oversight dispatch whose own deadline (`full_auto.oversight.total_timeout_ms`,
7
+ * default 120 s, up to 300 s) is LONGER than the fixed 60 s the adapter used.
8
+ * The host then reported "tool.execute.before exceeded budget" at 60 s while the
9
+ * critic kept running to its own deadline, and the run paused.
10
+ *
11
+ * Resolution order:
12
+ * 1. `full_auto.oversight.hook_timeout_ms` when set (explicit, always applies);
13
+ * 2. else, while a Full-Auto run is active for the session:
14
+ * `oversight.total_timeout_ms + 30 s` (never below the base);
15
+ * 3. else the 60 s base.
16
+ *
17
+ * Settings are keyed by project directory (one plugin process can host several
18
+ * projects, each with its own config); a call without a directory, or for an
19
+ * unknown one, uses the default slot, then the module defaults.
20
+ */
21
+ export declare const V2_TOOL_BEFORE_BASE_MS = 60000;
22
+ export declare const V2_TOOL_BEFORE_MARGIN_MS = 30000;
23
+ export declare const V2_TOOL_BEFORE_MAX_MS = 900000;
24
+ /** Max distinct project directories retained (invariant 8: bounded state). */
25
+ export declare const V2_TOOL_BEFORE_BUDGET_MAX_ENTRIES = 64;
26
+ /**
27
+ * Record the relevant `full_auto.oversight` settings for a project directory
28
+ * (call at setup; omit `directory` to set the default slot).
29
+ */
30
+ export declare function configureV2ToolBeforeBudget(fullAuto: unknown, directory?: string): void;
31
+ /** Budget, in ms, for one `tool.execute.before` chain. */
32
+ export declare function resolveV2ToolBeforeBudgetMs(fullAutoActive: boolean, directory?: string): number;
33
+ /**
34
+ * Restore defaults for one project directory (setup failure path), or for
35
+ * everything when called without an argument (test seam).
36
+ */
37
+ export declare function resetV2ToolBeforeBudget(directory?: string): void;
@@ -40,6 +40,15 @@ import type { V1HooksSubset, V2PluginContext, V2Registration } from './types';
40
40
  /** Mirrors `isTaskToolId`'s shape (dotted SDK form OR normalized base name).
41
41
  * Exported for the event pump's progress-event gating (issue #3401). */
42
42
  export declare function isV2SubagentToolId(toolName: string | null | undefined): boolean;
43
+ /**
44
+ * True for the host's Code Mode wrapper (#3446): the host-owned `execute`
45
+ * tool whose input is a JS program. The host id is matched exactly (no
46
+ * namespace stripping), and the call must carry a string `code` program.
47
+ */
48
+ export declare function isV2CodeModeWrapper(event: {
49
+ readonly tool: string;
50
+ readonly input?: unknown;
51
+ }): boolean;
43
52
  /**
44
53
  * Any recognized v2 subagent id (bare, namespace-prefixed, or dotted) is handed
45
54
  * to the v1 chain as the bare v1 id `task`. The v1 host reports the native tool
@@ -1,3 +1,16 @@
1
+ /**
2
+ * Read `full_auto.oversight` once and size the v2 tool.execute.before budget
3
+ * for this project directory from it (#3446). Bounded and fail-open: on any
4
+ * error this project's entry is dropped and the module defaults apply (60 s
5
+ * base; 150 s while a Full-Auto run is active, i.e. the default 120 s
6
+ * oversight deadline + 30 s) and an operator-visible warning is queued,
7
+ * because a custom `hook_timeout_ms` / `total_timeout_ms` would not apply.
8
+ */
9
+ declare function deferredV2ConfigureToolBeforeBudget(directory: string, loadConfig?: typeof loadPluginConfigWithMetaAsync): Promise<void>;
10
+ export declare const _internals: {
11
+ configureToolBeforeBudget: typeof deferredV2ConfigureToolBeforeBudget;
12
+ };
13
+ import { loadPluginConfigWithMetaAsync } from '../../config/loader';
1
14
  import type { V1HooksSubset, V2PluginContext } from './types';
2
15
  /** Dependencies injected from src/index.ts (avoids an index↔host cycle). */
3
16
  export interface V2SetupDependencies {
@@ -24,3 +37,4 @@ export declare function seedV1SessionState(sessionID: string | undefined, agentR
24
37
  * be synchronous and cheap).
25
38
  */
26
39
  export declare function v2ToolInputSchema(args: unknown): unknown;
40
+ export {};