opencode-swarm 7.200.2 → 7.200.4
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/README.md +1 -1
- package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/cli/{attest-task-s9cpm1pa.js → attest-task-dch4wwmn.js} +41 -41
- package/dist/cli/{auto-checkpoint-bhtc5gjf.js → auto-checkpoint-7ef4x67m.js} +7 -7
- package/dist/cli/{checkpoint-1jmfejsh.js → checkpoint-3a7rgjs9.js} +15 -15
- package/dist/cli/{coder-settlement-qabkaq79.js → coder-settlement-5mgxjwz9.js} +10 -10
- package/dist/cli/{config-doctor-q4805y29.js → config-doctor-pes681a5.js} +14 -14
- package/dist/cli/{core-jtmr767v.js → core-fxxnawnv.js} +3 -3
- package/dist/cli/{curation-policy-fth5n93x.js → curation-policy-gy868ec3.js} +4 -4
- package/dist/cli/{curator-drift-681mc3a2.js → curator-drift-jtqr5rwe.js} +8 -8
- package/dist/cli/curator-llm-factory-fp9gzt41.js +82 -0
- package/dist/cli/{curator-4tqbp1re.js → curator-tncdqrcf.js} +41 -41
- package/dist/cli/{doctor-knowledge-receipt-phase-id-h16qsh6e.js → doctor-knowledge-receipt-phase-id-6wan4z5n.js} +7 -7
- package/dist/cli/{evidence-summary-service-qr8kf99s.js → evidence-summary-service-cnvgae1a.js} +18 -18
- package/dist/cli/{gate-evidence-phq4rs28.js → gate-evidence-hmdnb430.js} +5 -5
- package/dist/cli/guardrail-explain-7g0y6ahb.js +83 -0
- package/dist/cli/{guardrail-log-jk30vszs.js → guardrail-log-wpm6srkg.js} +6 -6
- package/dist/cli/{guardrail-reset-0sfceecs.js → guardrail-reset-henzpvh4.js} +41 -41
- package/dist/cli/{hive-promoter-8v9vcd75.js → hive-promoter-zr4xnyxn.js} +41 -41
- package/dist/cli/{index-yctvn9z9.js → index-08h39kf4.js} +1 -1
- package/dist/cli/{index-f50e1pn3.js → index-0swbpe4d.js} +43 -43
- package/dist/cli/{index-sv514p10.js → index-1qc3fhnv.js} +6 -6
- package/dist/cli/{index-evf5t4ba.js → index-2s3wgvj8.js} +7 -7
- package/dist/cli/{index-na6ph1fp.js → index-2x015vjy.js} +1 -1
- package/dist/cli/{index-rav29yb2.js → index-2xdsmkev.js} +3 -3
- package/dist/cli/{index-gpr3j0w1.js → index-3vwfpqaj.js} +4 -4
- package/dist/cli/{index-43scxm6a.js → index-43djb5h6.js} +4 -4
- package/dist/cli/{index-g57p8p1k.js → index-4fkxdnc7.js} +1 -1
- package/dist/cli/{index-xyvsdn07.js → index-4krkevgc.js} +20 -1
- package/dist/cli/{index-5snwc3dz.js → index-4ph7ad0b.js} +1 -1
- package/dist/cli/{index-nbg19t1b.js → index-52arsav6.js} +7 -7
- package/dist/cli/{index-0jmt8y9r.js → index-5dkwdfh9.js} +2 -2
- package/dist/cli/{index-kezh6nhq.js → index-5fm37ceh.js} +3 -3
- package/dist/cli/{index-bncex5hw.js → index-5y245xwk.js} +3 -3
- package/dist/cli/{index-y7khxj1g.js → index-66c8xae5.js} +79 -79
- package/dist/cli/{index-v3bmwmqw.js → index-697mg68b.js} +10 -2
- package/dist/cli/{index-4ts6jpmj.js → index-6rxm153v.js} +2 -2
- package/dist/cli/{index-4cw3w8qm.js → index-70ctksz3.js} +3 -3
- package/dist/cli/{index-b4kdms7x.js → index-7h22y3ew.js} +2 -2
- package/dist/cli/{index-ab1k780s.js → index-81b69x1b.js} +3 -3
- package/dist/cli/{index-pktvge7a.js → index-8jbvmffw.js} +2 -2
- package/dist/cli/{index-ypxq0x7r.js → index-8srvdpw6.js} +1 -1
- package/dist/cli/{index-1v277wxc.js → index-bk8r4m9j.js} +2 -2
- package/dist/cli/{index-bt2h69a2.js → index-ddf3f3k8.js} +6 -6
- package/dist/cli/{index-56w2vy52.js → index-fs6t820n.js} +3 -3
- package/dist/cli/{index-pvpeggb5.js → index-fz5qbpbw.js} +1 -1
- package/dist/cli/{index-h29ckdg5.js → index-gs4gnndf.js} +8 -8
- package/dist/cli/{index-yk3b7ywa.js → index-hmndq4hk.js} +11 -11
- package/dist/cli/{index-v1h70r3y.js → index-mhd6kdzr.js} +1 -1
- package/dist/cli/{index-epzadpmm.js → index-mn75z39t.js} +1 -1
- package/dist/cli/{index-s3w41p1x.js → index-p2dst45x.js} +1 -1
- package/dist/cli/{index-mrq61h10.js → index-q8456mrf.js} +4 -4
- package/dist/cli/{index-048p7deh.js → index-qgzg1vac.js} +1 -1
- package/dist/cli/{index-1feqa2vz.js → index-snft68y9.js} +41 -41
- package/dist/cli/{index-ngzt2xmr.js → index-ss8wnczy.js} +2 -2
- package/dist/cli/{index-wgf1780e.js → index-tecp3a77.js} +5 -5
- package/dist/cli/{index-s9y49avf.js → index-v839c9mv.js} +1 -1
- package/dist/cli/{index-bw6q2v41.js → index-vqzsp93p.js} +3 -3
- package/dist/cli/{index-nzfq1ms2.js → index-vtpt8yns.js} +1 -1
- package/dist/cli/{index-gss7ch5k.js → index-xd5jn7nr.js} +2 -2
- package/dist/cli/{index-ves1rtqt.js → index-y7c4hqcj.js} +1 -1
- package/dist/cli/{index-trvn0kg0.js → index-yp5p6kpf.js} +4 -4
- package/dist/cli/{index-traz987v.js → index-yyrnkc3a.js} +1 -1
- package/dist/cli/{index-xfkzwc4p.js → index-zbxahqb0.js} +5 -5
- package/dist/cli/{index-vrvcn7k1.js → index-zystaewy.js} +4 -4
- package/dist/cli/index.js +42 -42
- package/dist/cli/{knowledge-escalator-53n7wa7s.js → knowledge-escalator-a9mkynzv.js} +12 -12
- package/dist/cli/{knowledge-events-80fw8pf6.js → knowledge-events-r720tzeq.js} +10 -10
- package/dist/cli/{knowledge-link-wfhsfyn2.js → knowledge-link-13t3nfrz.js} +3 -3
- package/dist/cli/{knowledge-store-rh1v0509.js → knowledge-store-4gktt30d.js} +4 -4
- package/dist/cli/{knowledge-validator-c3926fw5.js → knowledge-validator-fv4qgn0x.js} +6 -6
- package/dist/cli/{mcp-r43tvhzy.js → mcp-tx4qjmr1.js} +1 -1
- package/dist/cli/{model-preflight-vx9px5ac.js → model-preflight-4pexdgrc.js} +41 -41
- package/dist/cli/{pending-delegations-0vbkv5d2.js → pending-delegations-9sbf3na8.js} +11 -11
- package/dist/cli/{pr-subscriptions-a6cm44fs.js → pr-subscriptions-db26rzak.js} +10 -10
- package/dist/cli/{pr-workflow-gate-yvgpmywz.js → pr-workflow-gate-t8kewb9h.js} +41 -41
- package/dist/cli/{runner-s1a73y5h.js → runner-q1g9atrv.js} +4 -4
- package/dist/cli/{scan-cursor-pk4h80c1.js → scan-cursor-53s9zt38.js} +5 -5
- package/dist/cli/{schema-5rxfybx2.js → schema-eaq24w9q.js} +1 -1
- package/dist/cli/{scope-persistence-qzs1f91v.js → scope-persistence-erxj8vq6.js} +13 -13
- package/dist/cli/{server-gdewbeyb.js → server-95fz00er.js} +41 -41
- package/dist/cli/{skill-generator-xh2w2pvq.js → skill-generator-kt8j40ev.js} +14 -14
- package/dist/cli/{snapshot-coordination-init-jn2rh2s8.js → snapshot-coordination-init-b08vm3ye.js} +41 -41
- package/dist/cli/{speckit-checkoff-98zsw8c4.js → speckit-checkoff-3g3bfv0y.js} +4 -4
- package/dist/cli/{workspace-snapshot-93gzfac2.js → workspace-snapshot-7hws89e9.js} +3 -3
- package/dist/cli/{worktree-collision-ownership-2xqxqp0x.js → worktree-collision-ownership-sf7vbj8n.js} +13 -13
- package/dist/cli/{worktree-isolation-rxpwxvw3.js → worktree-isolation-5eh9bgcm.js} +41 -41
- package/dist/hooks/delegation-gate/worktree-merge-status.d.ts +4 -4
- package/dist/hooks/utils.d.ts +15 -0
- package/dist/host/v2/agents-commands.d.ts +133 -7
- package/dist/host/v2/hooks.d.ts +16 -2
- package/dist/host/v2/model-apply.d.ts +16 -6
- package/dist/host/v2/setup.d.ts +26 -2
- package/dist/host/v2/types.d.ts +27 -3
- package/dist/index.d.ts +15 -0
- package/dist/index.js +74 -73
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-46bzwbzr.js +0 -82
- package/dist/cli/guardrail-explain-q2eqawnk.js +0 -83
|
@@ -6,28 +6,28 @@ import {
|
|
|
6
6
|
WORKTREE_PROVISIONING_OWNER_LEASE_MS,
|
|
7
7
|
removeWorktreeProvisioningOwner,
|
|
8
8
|
scanWorktreeProvisioningOwnersForRecovery
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-7h22y3ew.js";
|
|
10
10
|
import {
|
|
11
11
|
scanDelegationFallbacksForRecovery,
|
|
12
12
|
scanDelegationsForRecovery
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-gs4gnndf.js";
|
|
14
14
|
import {
|
|
15
15
|
scanWorktreeMergeFailuresForRecovery
|
|
16
|
-
} from "./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
16
|
+
} from "./index-697mg68b.js";
|
|
17
|
+
import"./index-4krkevgc.js";
|
|
18
|
+
import"./index-v839c9mv.js";
|
|
19
|
+
import"./index-2x015vjy.js";
|
|
20
|
+
import"./index-y7c4hqcj.js";
|
|
21
21
|
import"./index-ry16d01s.js";
|
|
22
22
|
import"./index-rdm3px0g.js";
|
|
23
|
-
import"./index-
|
|
23
|
+
import"./index-vtpt8yns.js";
|
|
24
24
|
import"./index-7pmbnjvj.js";
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
25
|
+
import"./index-8srvdpw6.js";
|
|
26
|
+
import"./index-52arsav6.js";
|
|
27
27
|
import"./index-vzm6zre7.js";
|
|
28
28
|
import"./index-ae75rja9.js";
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
29
|
+
import"./index-4fkxdnc7.js";
|
|
30
|
+
import"./index-yyrnkc3a.js";
|
|
31
31
|
import"./index-q8vfw61p.js";
|
|
32
32
|
import"./index-t7hmqgjy.js";
|
|
33
33
|
import"./index-c2k7q723.js";
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
} from "./index-te9hq2f4.js";
|
|
37
37
|
import"./index-ejhxgyvm.js";
|
|
38
38
|
import"./index-7g4c7s5r.js";
|
|
39
|
-
import"./index-
|
|
39
|
+
import"./index-mn75z39t.js";
|
|
40
40
|
import"./index-sp2cxpaq.js";
|
|
41
41
|
import"./index-qbxk2rn6.js";
|
|
42
42
|
import"./index-zgwm4ryv.js";
|
|
@@ -25,79 +25,79 @@ import {
|
|
|
25
25
|
sanitizeWorktreeTaskId,
|
|
26
26
|
standardWorktreeByCallID,
|
|
27
27
|
standardWorktreeSerializationSessions
|
|
28
|
-
} from "./index-
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-
|
|
32
|
-
import"./index-
|
|
33
|
-
import"./index-
|
|
28
|
+
} from "./index-66c8xae5.js";
|
|
29
|
+
import"./index-p2dst45x.js";
|
|
30
|
+
import"./index-ss8wnczy.js";
|
|
31
|
+
import"./index-vqzsp93p.js";
|
|
32
|
+
import"./index-43djb5h6.js";
|
|
33
|
+
import"./index-4ph7ad0b.js";
|
|
34
34
|
import"./index-axqyjreb.js";
|
|
35
35
|
import"./index-txdagbh7.js";
|
|
36
|
-
import"./index-
|
|
37
|
-
import"./index-
|
|
36
|
+
import"./index-ddf3f3k8.js";
|
|
37
|
+
import"./index-6rxm153v.js";
|
|
38
38
|
import"./index-rdec0y3z.js";
|
|
39
|
-
import"./index-
|
|
40
|
-
import"./index-
|
|
41
|
-
import"./index-
|
|
42
|
-
import"./index-
|
|
43
|
-
import"./index-
|
|
39
|
+
import"./index-5fm37ceh.js";
|
|
40
|
+
import"./index-2s3wgvj8.js";
|
|
41
|
+
import"./index-q8456mrf.js";
|
|
42
|
+
import"./index-bk8r4m9j.js";
|
|
43
|
+
import"./index-tecp3a77.js";
|
|
44
44
|
import"./index-x5jwegqw.js";
|
|
45
|
-
import"./index-
|
|
46
|
-
import"./index-
|
|
45
|
+
import"./index-7h22y3ew.js";
|
|
46
|
+
import"./index-gs4gnndf.js";
|
|
47
47
|
import"./index-pt7h91zc.js";
|
|
48
48
|
import"./index-q7sjgr1y.js";
|
|
49
|
-
import"./index-
|
|
50
|
-
import"./index-
|
|
49
|
+
import"./index-1qc3fhnv.js";
|
|
50
|
+
import"./index-hmndq4hk.js";
|
|
51
51
|
import"./index-6b295cas.js";
|
|
52
52
|
import"./index-9nyqt3kb.js";
|
|
53
|
-
import"./index-
|
|
54
|
-
import"./index-
|
|
53
|
+
import"./index-70ctksz3.js";
|
|
54
|
+
import"./index-697mg68b.js";
|
|
55
55
|
import"./index-8mrentmw.js";
|
|
56
|
-
import"./index-
|
|
57
|
-
import"./index-
|
|
58
|
-
import"./index-
|
|
56
|
+
import"./index-8jbvmffw.js";
|
|
57
|
+
import"./index-2xdsmkev.js";
|
|
58
|
+
import"./index-81b69x1b.js";
|
|
59
59
|
import"./index-spggmr30.js";
|
|
60
|
-
import"./index-
|
|
61
|
-
import"./index-
|
|
60
|
+
import"./index-yp5p6kpf.js";
|
|
61
|
+
import"./index-zystaewy.js";
|
|
62
62
|
import"./index-m9zzj4ee.js";
|
|
63
|
-
import"./index-
|
|
64
|
-
import"./index-
|
|
65
|
-
import"./index-
|
|
63
|
+
import"./index-4krkevgc.js";
|
|
64
|
+
import"./index-3vwfpqaj.js";
|
|
65
|
+
import"./index-mhd6kdzr.js";
|
|
66
66
|
import"./index-rtry5xyf.js";
|
|
67
67
|
import {
|
|
68
68
|
resolveWorktreeIsolationConfig
|
|
69
|
-
} from "./index-
|
|
69
|
+
} from "./index-xd5jn7nr.js";
|
|
70
70
|
import"./index-g22dps7x.js";
|
|
71
71
|
import"./index-0725jpp7.js";
|
|
72
|
-
import"./index-
|
|
73
|
-
import"./index-
|
|
74
|
-
import"./index-
|
|
75
|
-
import"./index-
|
|
76
|
-
import"./index-
|
|
72
|
+
import"./index-zbxahqb0.js";
|
|
73
|
+
import"./index-v839c9mv.js";
|
|
74
|
+
import"./index-5y245xwk.js";
|
|
75
|
+
import"./index-2x015vjy.js";
|
|
76
|
+
import"./index-y7c4hqcj.js";
|
|
77
77
|
import"./index-ry16d01s.js";
|
|
78
78
|
import"./index-rdm3px0g.js";
|
|
79
|
-
import"./index-
|
|
79
|
+
import"./index-vtpt8yns.js";
|
|
80
80
|
import"./index-7pmbnjvj.js";
|
|
81
81
|
import"./index-9rwhas09.js";
|
|
82
|
-
import"./index-
|
|
83
|
-
import"./index-
|
|
82
|
+
import"./index-8srvdpw6.js";
|
|
83
|
+
import"./index-52arsav6.js";
|
|
84
84
|
import"./index-vzm6zre7.js";
|
|
85
85
|
import"./index-ae75rja9.js";
|
|
86
|
-
import"./index-
|
|
87
|
-
import"./index-
|
|
86
|
+
import"./index-4fkxdnc7.js";
|
|
87
|
+
import"./index-yyrnkc3a.js";
|
|
88
88
|
import"./index-q8vfw61p.js";
|
|
89
89
|
import"./index-t7hmqgjy.js";
|
|
90
90
|
import"./index-c2k7q723.js";
|
|
91
91
|
import"./index-te9hq2f4.js";
|
|
92
92
|
import"./index-ejhxgyvm.js";
|
|
93
93
|
import"./index-7g4c7s5r.js";
|
|
94
|
-
import"./index-
|
|
94
|
+
import"./index-mn75z39t.js";
|
|
95
95
|
import"./index-3t46mez1.js";
|
|
96
|
-
import"./index-
|
|
96
|
+
import"./index-fz5qbpbw.js";
|
|
97
97
|
import"./index-sp2cxpaq.js";
|
|
98
98
|
import"./index-qbxk2rn6.js";
|
|
99
99
|
import"./index-zgwm4ryv.js";
|
|
100
|
-
import"./index-
|
|
100
|
+
import"./index-08h39kf4.js";
|
|
101
101
|
import"./index-xfzkq1k4.js";
|
|
102
102
|
import"./index-bk5tah7q.js";
|
|
103
103
|
import"./index-gknz3bv1.js";
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
* can depend on it without creating an import cycle.
|
|
22
22
|
*
|
|
23
23
|
* STATE DURABILITY: Status is stored in an in-memory Map (fast, per-process)
|
|
24
|
-
* AND persisted to `.swarm/worktree-merge-status.json` (survives plugin restart
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
24
|
+
* AND persisted to `.swarm/worktree-merge-status.json` (survives plugin restart;
|
|
25
|
+
* EXCEPTION (#3448): a write whose status-directory parent root has vanished is
|
|
26
|
+
* skipped rather than recreating that root). On read, the in-memory map is
|
|
27
|
+
* checked first (fast path); after a restart the durable file restores it.
|
|
28
28
|
*/
|
|
29
29
|
/** Why a task's worktree work did not fully reach the main tree. */
|
|
30
30
|
export type WorktreeMergeOutcome = 'partial' | 'failed';
|
package/dist/hooks/utils.d.ts
CHANGED
|
@@ -25,6 +25,21 @@ type HookHandler<I, O> = (input: I, output: O) => Promise<void>;
|
|
|
25
25
|
export declare function markFailClosed<I, O>(fn: HookHandler<I, O>): HookHandler<I, O> & {
|
|
26
26
|
__failClosed?: true;
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* Read-once accessor for the swallowed-command-error registry (#3318 AC6):
|
|
30
|
+
* returns the recorded error message for the exact (sessionID, command) pair
|
|
31
|
+
* and consumes the entry, or undefined when nothing is recorded (a miss
|
|
32
|
+
* consumes nothing). The v2 command dispatcher is the sole designed reader.
|
|
33
|
+
*
|
|
34
|
+
* `sinceMs` (#2910 W6 / review PRR-006): when provided, a record OLDER than
|
|
35
|
+
* this timestamp is STALE timeout residue (a timed-out dispatch's handler
|
|
36
|
+
* throwing after its dispatch already returned) — it is consumed and ignored
|
|
37
|
+
* (undefined) so it cannot poison this dispatch. Records created at or after
|
|
38
|
+
* `sinceMs` are fresh failures of THIS dispatch.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getLastSwallowedCommandError(sessionID: string, command: string, sinceMs?: number): string | undefined;
|
|
41
|
+
/** Empty the swallowed-command-error registry (v2 setup cleanup / tests). */
|
|
42
|
+
export declare function clearSwallowedCommandErrorRegistry(): void;
|
|
28
43
|
export declare function safeHook<I, O>(fn: HookHandler<I, O>): HookHandler<I, O>;
|
|
29
44
|
/**
|
|
30
45
|
* `composeHandlers` runs handlers sequentially, wrapping EACH handler in
|
|
@@ -8,14 +8,19 @@
|
|
|
8
8
|
* zero extraction from src/index.ts (the v1 TUI shortcut block stays
|
|
9
9
|
* byte-pinned). DELTA: the lane-permission mutations the v1 hook writes into
|
|
10
10
|
* the config object (applyLanePermissions) have no v2 destination here and
|
|
11
|
-
* are dropped - external-directory lane scoping is
|
|
12
|
-
* docs/host/v2-hook-inventory.md.
|
|
11
|
+
* are dropped - external-directory lane scoping is tracked on #2910 (open)
|
|
12
|
+
* with its disclosure in docs/host/v2-hook-inventory.md row 4.
|
|
13
13
|
*
|
|
14
14
|
* Mappings (docs/host/v2-hook-inventory.md rows 4-5):
|
|
15
15
|
* - v1 AgentConfig → v2 Agent.Info: `prompt`→`system`, `mode` preserved
|
|
16
16
|
* (multi-swarm `*_architect` primary semantics — AGENTS.md invariant 11),
|
|
17
|
-
* `model` string 'provider/model' → Model.Ref, `
|
|
18
|
-
*
|
|
17
|
+
* `model` string 'provider/model' → Model.Ref, and the v1 `permission`
|
|
18
|
+
* block → v2 permission rules through the HOST's own v1→v2 migration
|
|
19
|
+
* (normalizeV2PermissionAction + preserve-and-append merge; #2910 W2).
|
|
20
|
+
* The legacy `tools` allowlist branch is GONE: getAgentConfigs deletes
|
|
21
|
+
* `sdkConfig.tools` at the emit site (src/agents/index.ts, issue #2528),
|
|
22
|
+
* so nothing can ever feed it — the permission block is the only
|
|
23
|
+
* enforceable tool-gating channel.
|
|
19
24
|
* - Entries the v1 hook marks `disable: true` (auto-select disabling the
|
|
20
25
|
* `build`/`plan` built-ins) are REMOVED on the v2 agent editor.
|
|
21
26
|
* - v1 command entries `{template, description}` → v2 CommandDefinition
|
|
@@ -34,18 +39,139 @@ import type { V1HooksSubset, V2AgentInfo, V2PluginContext, V2Registration } from
|
|
|
34
39
|
export declare const _internals: {
|
|
35
40
|
dispatchTimeoutMs: number;
|
|
36
41
|
};
|
|
42
|
+
/** Fresh registration tables a rebuild source produces (#2910 W3). */
|
|
43
|
+
export interface V2RegistrationTables {
|
|
44
|
+
agentTable: Record<string, unknown>;
|
|
45
|
+
commandTable: Record<string, unknown>;
|
|
46
|
+
}
|
|
47
|
+
type V2ConfigRebuild = (directory: string) => Promise<V2RegistrationTables>;
|
|
48
|
+
/**
|
|
49
|
+
* Quiet gate for {@link deferredV2WarnOperator}. Writes attach to the
|
|
50
|
+
* CURRENTLY-RESOLVED owner's entry (ambient when no setup owner is live) —
|
|
51
|
+
* setup.ts's startup preflight calls this AFTER openCodeSwarmV2Setup made its
|
|
52
|
+
* per-instance token current, so the value lands on that instance's entry.
|
|
53
|
+
*/
|
|
54
|
+
export declare function setV2OperatorQuiet(quiet: boolean): void;
|
|
55
|
+
/**
|
|
56
|
+
* Owner-scoped quiet gate (#2910 W5): writes the given owner's entry and
|
|
57
|
+
* makes it the current owner. `undefined` detaches the owner's quiet value
|
|
58
|
+
* (setup cleanup; the entry drops when it holds nothing else).
|
|
59
|
+
*/
|
|
60
|
+
export declare function setV2OperatorQuietForOwner(token: string, quiet: boolean | undefined): void;
|
|
61
|
+
/**
|
|
62
|
+
* Clear the operator-warning dedup state and the ambient quiet entry (direct
|
|
63
|
+
* test calls). NOT part of setup cleanup anymore (review PRR-002): the dedup
|
|
64
|
+
* map is bounded FIFO with explicit eviction (the invariant-8 strategy) and a
|
|
65
|
+
* per-cleanup global clear would wipe a concurrent live instance's dedup
|
|
66
|
+
* state; per-owner quiet entries are unregistered only by their own
|
|
67
|
+
* instance's cleanup (owner isolation, #2910 W5).
|
|
68
|
+
*/
|
|
69
|
+
export declare function resetV2OperatorWarningState(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Release one owner's registration snapshot (#2910 W3 / review PRR-004):
|
|
72
|
+
* setup cleanup calls this after detaching rebuild + quiet so a torn-down
|
|
73
|
+
* instance's entry DROPS instead of staying immortal in `v2OwnerStates`
|
|
74
|
+
* (unbounded across re-setups, and a dead-but-resolvable owner shadows the
|
|
75
|
+
* fallback resolution for surviving instances).
|
|
76
|
+
*/
|
|
77
|
+
export declare function clearV2OwnerRegistrationSnapshot(ownerToken: string): void;
|
|
78
|
+
/**
|
|
79
|
+
* Remove the ctx→owner-token binding recorded at registration (#2910 W3/W5 /
|
|
80
|
+
* review PRR-003): setup cleanup detaches its ctx so a later dispatch through
|
|
81
|
+
* a re-used host ctx object cannot resolve a torn-down instance's state.
|
|
82
|
+
*/
|
|
83
|
+
export declare function clearV2CtxOwnerBinding(ctx: V2PluginContext): void;
|
|
84
|
+
/**
|
|
85
|
+
* Test-only bounded-state proof (review PRR-004): number of live owner
|
|
86
|
+
* entries. Production never calls this; tests assert a setup's cleanup drops
|
|
87
|
+
* its own entry (snapshot released) and a rejected setup leaks none.
|
|
88
|
+
*/
|
|
89
|
+
export declare function countV2OwnerStatesForTests(): number;
|
|
37
90
|
interface V1AgentConfigLike {
|
|
38
91
|
mode?: unknown;
|
|
39
92
|
prompt?: unknown;
|
|
40
93
|
description?: unknown;
|
|
41
94
|
model?: unknown;
|
|
42
|
-
tools?: unknown;
|
|
43
95
|
disable?: unknown;
|
|
96
|
+
/** v1 permission block: name -> effect ('allow'|'deny'|'ask') or { [resourceGlob]: effect }. */
|
|
97
|
+
permission?: unknown;
|
|
44
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Host v1→v2 permission-action normalization — the EXACT host migration
|
|
101
|
+
* table, captured verbatim from sst/opencode v2.0.29
|
|
102
|
+
* packages/core/src/v1/config/migrate.ts `normalizeAction` (local mirror:
|
|
103
|
+
* .agents/issue-traces/2910-v2-dual-host-plugin-port/probe-v2sdk/migrate-v2.0.29.ts):
|
|
104
|
+
*
|
|
105
|
+
* write | patch -> edit
|
|
106
|
+
* task -> subagent
|
|
107
|
+
* bash -> shell
|
|
108
|
+
* anything else -> VERBATIM (edit stays edit; apply_patch stays
|
|
109
|
+
* apply_patch — migrate.ts has NO rewrite for it; plugin tool names stay
|
|
110
|
+
* themselves). There is NO 'tool' catch-all anywhere in the host
|
|
111
|
+
* migration.
|
|
112
|
+
*
|
|
113
|
+
* Shared by the agent permission port (#2910 W2) and the permission-bridge
|
|
114
|
+
* assert routing (#3351 / #2910 W4).
|
|
115
|
+
*/
|
|
116
|
+
export declare function normalizeV2PermissionAction(action: string): string;
|
|
45
117
|
/** Map one v1 AgentConfig entry to a v2 Agent.Info. */
|
|
46
118
|
export declare function mapV1AgentToV2(name: string, config: V1AgentConfigLike): V2AgentInfo;
|
|
47
119
|
/** Expand a v1 TUI template for a v2 command execution. */
|
|
48
120
|
export declare function expandV1Template(template: string, argumentsText: string): string;
|
|
49
|
-
/**
|
|
50
|
-
|
|
121
|
+
/**
|
|
122
|
+
* Strip one leading `/swarm` (or bare `swarm`) token from a command
|
|
123
|
+
* invocation's raw prompt text (#3318 AC7). The v2 host hands the command's
|
|
124
|
+
* OWN prompt surface text to `execute` — on some hosts that text still
|
|
125
|
+
* carries the leading command token, which the registry handler would then
|
|
126
|
+
* double (`/swarm /swarm status` → "Command not found"). Exactly ONE token
|
|
127
|
+
* equal to `/swarm` or `swarm` is dropped, and only when followed by
|
|
128
|
+
* whitespace or end-of-text; every other shape (near-misses like
|
|
129
|
+
* `swarmish`, other commands, bare arguments) passes through unchanged.
|
|
130
|
+
*/
|
|
131
|
+
export declare function normalizeV2CommandArguments(text: string): string;
|
|
132
|
+
/**
|
|
133
|
+
* Register agents + commands via the synthetic config-hook run.
|
|
134
|
+
*
|
|
135
|
+
* `ownerToken` (#2910 W3/W5 / review PRR-003): the setup instance's token —
|
|
136
|
+
* binds the ctx (WeakMap) to that instance and stores the registration
|
|
137
|
+
* snapshot on ITS entry, so a dispatch-driven refresh through this ctx
|
|
138
|
+
* resolves this instance's rebuild source and snapshot even after a newer
|
|
139
|
+
* setup registered later. Omitted (direct/test calls): the ambient
|
|
140
|
+
* current-owner resolution, unchanged from the pre-PRR-003 contract.
|
|
141
|
+
*/
|
|
142
|
+
export declare function registerV2AgentsAndCommands(ctx: V2PluginContext, hooks: V1HooksSubset, directory: string, registrations: V2Registration[], ownerToken?: string): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* Register the AMBIENT owner's config rebuild source (#2910 W3, frozen C5
|
|
145
|
+
* surface): the current-truth table builder a config-writing command path
|
|
146
|
+
* installs. `undefined` detaches it. Setup instances register through
|
|
147
|
+
* {@link registerV2ConfigRebuildSourceForOwner} under their own token.
|
|
148
|
+
*/
|
|
149
|
+
export declare function registerV2ConfigRebuildSource(rebuild: V2ConfigRebuild | undefined): void;
|
|
150
|
+
/**
|
|
151
|
+
* Owner-scoped rebuild-source registration (#2910 W3/W5): attaches the given
|
|
152
|
+
* owner token's rebuild source and makes it the current owner; `undefined`
|
|
153
|
+
* detaches only that owner's source (setup cleanup — a concurrent live
|
|
154
|
+
* instance's entry is never touched).
|
|
155
|
+
*/
|
|
156
|
+
export declare function registerV2ConfigRebuildSourceForOwner(token: string, rebuild: V2ConfigRebuild | undefined): void;
|
|
157
|
+
/**
|
|
158
|
+
* Refresh the v2 registration tables from the REGISTERED rebuild source
|
|
159
|
+
* (#2910 W3 / frozen C5). `hooks.config` is deliberately NOT re-consulted —
|
|
160
|
+
* the production closure is stale by construction (captured at setup time);
|
|
161
|
+
* the rebuild source is the only current-truth channel. No source or a
|
|
162
|
+
* rejecting source: deferred warning, no reloads, no throw. Unchanged
|
|
163
|
+
* tables: no reloads (idempotent refresh). Changed tables: the snapshot
|
|
164
|
+
* holder is updated FIRST (so the host's post-reload re-run of the
|
|
165
|
+
* registered transforms replays the fresh tables), then feature-detected
|
|
166
|
+
* `ctx.agent.reload()` + `ctx.command.reload()` fire; a failed reload marks
|
|
167
|
+
* its domain dirty for the next refresh.
|
|
168
|
+
*
|
|
169
|
+
* #2910 W3/W5 / review PRR-003: the OWNING instance is resolved through the
|
|
170
|
+
* dispatching ctx's bound owner token (`ownerTokenByCtx`, recorded by
|
|
171
|
+
* registerV2AgentsAndCommands under the setup instance's token), falling
|
|
172
|
+
* back to the ambient current-owner chain when the ctx was never bound
|
|
173
|
+
* (direct/test calls — the frozen C5 arms). Rebuild source, snapshot and the
|
|
174
|
+
* quiet gate all resolve through the SAME token.
|
|
175
|
+
*/
|
|
176
|
+
export declare function deferredV2RefreshRegistrations(ctx: V2PluginContext, hooks: V1HooksSubset, directory: string, registrations?: V2Registration[]): Promise<void>;
|
|
51
177
|
export {};
|
package/dist/host/v2/hooks.d.ts
CHANGED
|
@@ -59,7 +59,21 @@ export declare function isV2CodeModeWrapper(event: {
|
|
|
59
59
|
/** Plain-object shape guard (arrays/instances rejected); exported for the
|
|
60
60
|
* event pump's progress-metadata validation (issue #3401 / PR #3402). */
|
|
61
61
|
export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
|
|
62
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Register the tool hooks (execute.before/after).
|
|
64
|
+
*
|
|
65
|
+
* #3352: BOTH registrations of the pair are attempted independently — a
|
|
66
|
+
* rejection of the first never skips its sibling. Each failure records a
|
|
67
|
+
* deferred warning naming the hook + error; the function resolves when at
|
|
68
|
+
* least one registration landed and rejects only if both failed (setup's
|
|
69
|
+
* runRegistration wrapper isolates that rejection with its own warning).
|
|
70
|
+
*/
|
|
63
71
|
export declare function registerV2ToolHooks(ctx: V2PluginContext, hooks: V1HooksSubset, directory: string, registrations: V2Registration[]): Promise<void>;
|
|
64
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Register the compaction + prompt session hooks.
|
|
74
|
+
*
|
|
75
|
+
* #3352: same pair-independence contract as registerV2ToolHooks — a
|
|
76
|
+
* rejecting 'compaction' registration still attempts 'prompt', each failure
|
|
77
|
+
* warns, and only a double failure rejects.
|
|
78
|
+
*/
|
|
65
79
|
export declare function registerV2SessionHooks(ctx: V2PluginContext, hooks: V1HooksSubset, directory: string, registrations: V2Registration[]): Promise<void>;
|
|
@@ -17,19 +17,29 @@
|
|
|
17
17
|
*
|
|
18
18
|
* Everything here is fail-open: with no registered surface (v1 hosts, or a v2
|
|
19
19
|
* host without the agent domain) the apply is a logged no-op.
|
|
20
|
+
*
|
|
21
|
+
* #3352 / #2910 W5: the surface is OWNER-TOKEN-KEYED (see the registry
|
|
22
|
+
* comment below) — setup.ts passes its per-instance token on register and on
|
|
23
|
+
* owner-scoped clear, so concurrent live setups own disjoint surfaces.
|
|
20
24
|
*/
|
|
21
25
|
import type { V2PluginContext } from './types';
|
|
22
26
|
/**
|
|
23
27
|
* Remember the v2 agent transform surface for later model rewrites. Called
|
|
24
|
-
* once from setup after agent registration
|
|
28
|
+
* once from setup after agent registration (with the setup's owner token);
|
|
29
|
+
* a no-argument call registers the legacy '__default__' owner. Cleared on
|
|
30
|
+
* cleanup via `clearV2AgentTransformSurface(token)`.
|
|
25
31
|
*/
|
|
26
|
-
export declare function registerV2AgentTransformSurface(ctx: V2PluginContext): void;
|
|
32
|
+
export declare function registerV2AgentTransformSurface(ctx: V2PluginContext, token?: string): void;
|
|
27
33
|
/**
|
|
28
|
-
* Drop
|
|
29
|
-
*
|
|
34
|
+
* Drop a registered surface and dispose every held apply registration.
|
|
35
|
+
* WITH token: clears/disposes ONLY that owner's surface + held registrations
|
|
36
|
+
* (v2 setup cleanup — a concurrent live instance is untouched). WITHOUT
|
|
37
|
+
* token: LEGACY ADMINISTRATIVE clear-all (kept for the pre-W5 test seams
|
|
38
|
+
* model-apply-3022 / setup-wiring-3022 / review-followup-3029). Best-effort:
|
|
39
|
+
* disposal failure is logged, never thrown.
|
|
30
40
|
*/
|
|
31
|
-
export declare function clearV2AgentTransformSurface(): void;
|
|
32
|
-
/** True when a v2 apply surface
|
|
41
|
+
export declare function clearV2AgentTransformSurface(token?: string): void;
|
|
42
|
+
/** True when any live owner carries a v2 apply surface (test/diagnostic seam). */
|
|
33
43
|
export declare function hasV2AgentTransformSurface(): boolean;
|
|
34
44
|
/**
|
|
35
45
|
* Rewrite one registered agent's model to `modelString` ('provider/model').
|
package/dist/host/v2/setup.d.ts
CHANGED
|
@@ -7,15 +7,39 @@
|
|
|
7
7
|
* because a custom `hook_timeout_ms` / `total_timeout_ms` would not apply.
|
|
8
8
|
*/
|
|
9
9
|
declare function deferredV2ConfigureToolBeforeBudget(directory: string, loadConfig?: typeof loadPluginConfigWithMetaAsync): Promise<void>;
|
|
10
|
+
import { loadPluginConfigWithMetaAsync } from '../../config/loader';
|
|
11
|
+
import type { V1HooksSubset, V2PluginContext } from './types';
|
|
12
|
+
/**
|
|
13
|
+
* Test seam (#3350 AC4 declared seam, frozen checks
|
|
14
|
+
* setup-registration-budget-fakeclock-3327 / setup-preflight-timeout-3327):
|
|
15
|
+
* the registration-stage budget, the preflight config budget, the preflight
|
|
16
|
+
* loader and the deferred tool.execute.before budget configurator are read
|
|
17
|
+
* through this object AT CALL TIME so tests can pin them without patching
|
|
18
|
+
* global timers (AGENTS.md invariant 7; precedent: PRR-002 dispatchTimeoutMs
|
|
19
|
+
* in agents-commands.ts). Production never mutates it.
|
|
20
|
+
*/
|
|
10
21
|
export declare const _internals: {
|
|
22
|
+
registrationTimeoutMs: number;
|
|
23
|
+
preflightConfigTimeoutMs: number;
|
|
24
|
+
loadConfig: typeof loadPluginConfigWithMetaAsync;
|
|
11
25
|
configureToolBeforeBudget: typeof deferredV2ConfigureToolBeforeBudget;
|
|
12
26
|
};
|
|
13
|
-
import { loadPluginConfigWithMetaAsync } from '../../config/loader';
|
|
14
|
-
import type { V1HooksSubset, V2PluginContext } from './types';
|
|
15
27
|
/** Dependencies injected from src/index.ts (avoids an index↔host cycle). */
|
|
16
28
|
export interface V2SetupDependencies {
|
|
17
29
|
/** The shared server-initialization wrapper (begin-interval → init core → schedule deferred → end-interval). */
|
|
18
30
|
runInit: (input: unknown) => Promise<V1HooksSubset>;
|
|
31
|
+
/**
|
|
32
|
+
* Fresh registration-table builder (#2910 W3): a FRESH config read plus
|
|
33
|
+
* `getAgentConfigs` + the shared command-table builder — no
|
|
34
|
+
* side-effecting init re-run. Registered as this setup instance's config
|
|
35
|
+
* rebuild source so a successful `config doctor --fix` dispatch can
|
|
36
|
+
* refresh the registration tables. `undefined` -> the adapter registers
|
|
37
|
+
* no rebuild source (registration refresh stays a no-op).
|
|
38
|
+
*/
|
|
39
|
+
buildV2RegistrationTables?: (directory: string) => Promise<{
|
|
40
|
+
agentTable: Record<string, unknown>;
|
|
41
|
+
commandTable: Record<string, unknown>;
|
|
42
|
+
}>;
|
|
19
43
|
}
|
|
20
44
|
/** Normalize a v2 agent reference (Agent.Info object or bare string) to a name. */
|
|
21
45
|
export declare function normalizeV2AgentRef(agent: unknown): string | undefined;
|
package/dist/host/v2/types.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* `{ field: Body["field"] }` records; they are vendored here as plain optional fields of the
|
|
13
13
|
* same types (e.g. `SessionCreateInput` is all-optional in the published form).
|
|
14
14
|
*
|
|
15
|
-
* Drift guard:
|
|
15
|
+
* Drift guard: SHIPPED with the #2910 dual-host work — the check-host-contract-v2 digest leg and the dual-host CI lane landed, and the weekly digest plus the vendored-pin freshness detector (scripts/drift-check.ts, reading this header's pin) now guard this corpus. See docs/host/v2-hook-inventory.md for the full v1-to-v2 map.
|
|
16
16
|
*
|
|
17
17
|
* Host-tolerance contract for the session/worktree method surface (issue #3169):
|
|
18
18
|
* the members below are REQUIRED to mirror the published `SessionDomain`/`WorktreeDomain`.
|
|
@@ -475,9 +475,33 @@ export interface V2EventEnvelope {
|
|
|
475
475
|
export interface V2EventDomain {
|
|
476
476
|
readonly subscribe?: (...args: unknown[]) => AsyncIterable<V2EventEnvelope> | Promise<AsyncIterable<V2EventEnvelope>>;
|
|
477
477
|
}
|
|
478
|
-
/**
|
|
478
|
+
/**
|
|
479
|
+
* v2 `PermissionDomain` (only used for the v1 ask() bridge, best-effort).
|
|
480
|
+
* `assert` is documented in `@opencode/plugin@2.0.29`
|
|
481
|
+
* `dist/promise/permission.d.ts` and ABSENT at the 2.0.26 vendored pin —
|
|
482
|
+
* feature-detected (`typeof === 'function'`) at the call site
|
|
483
|
+
* (src/host/v2/tools.ts buildPermissionBridge, #3351).
|
|
484
|
+
*/
|
|
479
485
|
export interface V2PermissionDomain {
|
|
480
|
-
|
|
486
|
+
/**
|
|
487
|
+
* Ask-side permission assertion (2.0.29+): input
|
|
488
|
+
* `{ sessionID: string; agent: string; action: string; resources: string[] }`;
|
|
489
|
+
* a resolution grants the request, a rejection denies it.
|
|
490
|
+
*/
|
|
491
|
+
assert?: (input: {
|
|
492
|
+
sessionID: string;
|
|
493
|
+
agent: string;
|
|
494
|
+
action: string;
|
|
495
|
+
resources: string[];
|
|
496
|
+
}) => Promise<unknown>;
|
|
497
|
+
/**
|
|
498
|
+
* Answer-side RPC `{ requestID, reply, message }` — the host's channel for
|
|
499
|
+
* ANSWERING a permission request, not for raising one. The bridge never
|
|
500
|
+
* interprets a resolved reply value as a grant (fail-closed; #3351
|
|
501
|
+
* decision — grant shapes stay uninterpreted pending live-host
|
|
502
|
+
* observation).
|
|
503
|
+
*/
|
|
504
|
+
reply?: (input: unknown) => Promise<unknown>;
|
|
481
505
|
readonly list?: () => Promise<unknown[]>;
|
|
482
506
|
readonly hook?: (name: 'evaluate', callback: (input: unknown) => Promise<void> | void) => Promise<V2Registration>;
|
|
483
507
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -83,6 +83,21 @@ type PendingCostCorrection = {
|
|
|
83
83
|
version: number;
|
|
84
84
|
currentFields: DelegationCostFields;
|
|
85
85
|
};
|
|
86
|
+
/**
|
|
87
|
+
* Fresh registration-table builder for the v2 host path (#2910 W3 / AC5).
|
|
88
|
+
* Injected into `openCodeSwarmV2Setup` as the per-instance config rebuild
|
|
89
|
+
* source: a FRESH config read through the async loader (never the init-time
|
|
90
|
+
* closure), the same release-aware auto-review resolution, project context
|
|
91
|
+
* and lane-permission application the v1 init path feeds
|
|
92
|
+
* `getAgentConfigs`, and the SAME shared table builder — no
|
|
93
|
+
* side-effecting init re-run (no snapshot / repo-graph / bundled-skill
|
|
94
|
+
* work). Invoked only from the user-triggered registration refresh, never
|
|
95
|
+
* from plugin init.
|
|
96
|
+
*/
|
|
97
|
+
export declare function buildV2RegistrationTables(directory: string): Promise<{
|
|
98
|
+
agentTable: Record<string, unknown>;
|
|
99
|
+
commandTable: Record<string, unknown>;
|
|
100
|
+
}>;
|
|
86
101
|
declare const _default: {
|
|
87
102
|
id: "opencode-swarm";
|
|
88
103
|
server: Plugin;
|