opencode-swarm 7.180.0 → 7.181.0
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 +14 -0
- package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/agents/architect.d.ts +67 -0
- package/dist/agents/council-prompts.d.ts +3 -3
- package/dist/agents/index.d.ts +1 -1
- package/dist/cli/{coder-settlement-34z9xgnx.js → coder-settlement-pqrfkm9d.js} +7 -7
- package/dist/cli/{config-doctor-tkfrwztz.js → config-doctor-bjqg57jr.js} +2 -2
- package/dist/cli/{core-z9ybzpvr.js → core-3t3dzkrc.js} +1 -1
- package/dist/cli/{curation-policy-gwzmjmt7.js → curation-policy-m3x9mkj9.js} +4 -4
- package/dist/cli/{curator-drift-3bbn011w.js → curator-drift-gay4fx5j.js} +4 -4
- package/dist/cli/{curator-llm-factory-e162g7xp.js → curator-llm-factory-1wx0bd8k.js} +30 -30
- package/dist/cli/{curator-zv4qs07j.js → curator-y8qr4xgh.js} +30 -30
- package/dist/cli/{evidence-summary-service-wrfth5tr.js → evidence-summary-service-jeewwfpg.js} +13 -13
- package/dist/cli/{gate-evidence-adqbxnm7.js → gate-evidence-ncnfxz7t.js} +4 -4
- package/dist/cli/{guardrail-explain-dn96802k.js → guardrail-explain-cg9e3rr8.js} +31 -31
- package/dist/cli/{guardrail-log-rcza6v3y.js → guardrail-log-tjcnpwhv.js} +6 -6
- package/dist/cli/{guardrail-reset-fjn42e0n.js → guardrail-reset-ey81kcdq.js} +30 -30
- package/dist/cli/{hive-promoter-hgqqn7qw.js → hive-promoter-ghcynvfv.js} +30 -30
- package/dist/cli/{index-b9z9gvx0.js → index-06f6h0fv.js} +1 -1
- package/dist/cli/{index-zptq8mp1.js → index-0vvpe98m.js} +1 -1
- package/dist/cli/{index-zvxy0mev.js → index-12ewkms0.js} +1 -1
- package/dist/cli/{index-7pj0x345.js → index-1rcwsfwz.js} +32 -32
- package/dist/cli/{index-htrb9ec3.js → index-38cfx8g8.js} +2 -2
- package/dist/cli/{index-jmrsfhwq.js → index-516j9vsk.js} +1 -1
- package/dist/cli/{index-jrfv2am8.js → index-6aj0ej18.js} +3 -3
- package/dist/cli/{index-5yc5n4ae.js → index-6gcxgx84.js} +1 -1
- package/dist/cli/{index-qt0793qm.js → index-6mwha20t.js} +3 -3
- package/dist/cli/{index-2h0qng38.js → index-886rpw6w.js} +2 -2
- package/dist/cli/{index-kp654qcw.js → index-dn0wqvv2.js} +9 -9
- package/dist/cli/{index-0v1rtanv.js → index-ea9fk6v0.js} +1 -1
- package/dist/cli/{index-x6kjbjya.js → index-ge1w25n8.js} +4 -4
- package/dist/cli/{index-1hzqyx13.js → index-gez80bfr.js} +5 -1
- package/dist/cli/{index-ekgc71m1.js → index-gm67qky7.js} +7 -7
- package/dist/cli/{index-ret97f1t.js → index-jysjhvpv.js} +5 -5
- package/dist/cli/{index-mhrn7hbb.js → index-jzg3wrx6.js} +3 -3
- package/dist/cli/{index-dnbqmay5.js → index-m31a2q35.js} +2617 -1359
- package/dist/cli/{index-jscqefqm.js → index-m65tnv4j.js} +2 -2
- package/dist/cli/{index-bx70zs8d.js → index-m7havzy4.js} +1 -1
- package/dist/cli/{index-7w6dnpvc.js → index-mkpczxy7.js} +32 -30
- package/dist/cli/{index-caj76d0f.js → index-n7syegpa.js} +3 -3
- package/dist/cli/{index-1p8fk9jb.js → index-pb3vrqsf.js} +2 -2
- package/dist/cli/{index-dcttq1mn.js → index-pc3cw1xm.js} +2 -2
- package/dist/cli/{index-pnt98k7z.js → index-r1cnmq4j.js} +6 -6
- package/dist/cli/{index-defq2crz.js → index-rqm075jf.js} +14 -3
- package/dist/cli/{index-aspxz5r5.js → index-s0zgz4p1.js} +1 -1
- package/dist/cli/{index-5m378633.js → index-s5ghg4kg.js} +4 -4
- package/dist/cli/{index-06crt1ej.js → index-t5gqdkqx.js} +3 -3
- package/dist/cli/{index-v1sc1gxv.js → index-t8hv63wy.js} +4 -4
- package/dist/cli/{index-3jap3516.js → index-wxjvb4vq.js} +1 -1
- package/dist/cli/{index-cxgr6ad5.js → index-xq9gsfsc.js} +4 -4
- package/dist/cli/{index-93vk5s7v.js → index-y30y1rkg.js} +3 -3
- package/dist/cli/{index-5gmn0a3j.js → index-yet4r7kp.js} +3 -3
- package/dist/cli/{index-8b1f2t5q.js → index-ytxgr424.js} +1 -1
- package/dist/cli/index.js +31 -31
- package/dist/cli/{knowledge-escalator-x8vcmb6k.js → knowledge-escalator-jrkx2b6j.js} +10 -10
- package/dist/cli/{knowledge-events-naf9kyyc.js → knowledge-events-bha1zpbk.js} +8 -8
- package/dist/cli/{knowledge-link-g0q25hqv.js → knowledge-link-s2qs178z.js} +3 -3
- package/dist/cli/{knowledge-store-dnv0ph42.js → knowledge-store-q438tkyd.js} +4 -4
- package/dist/cli/{knowledge-validator-a1rfzkmv.js → knowledge-validator-3nx18fst.js} +6 -6
- package/dist/cli/{mcp-hnb0m05a.js → mcp-98693syb.js} +1 -1
- package/dist/cli/{pending-delegations-05p6cmbh.js → pending-delegations-nkpvtkz4.js} +6 -6
- package/dist/cli/{pr-subscriptions-a2djfzyx.js → pr-subscriptions-qrvhr6jw.js} +6 -6
- package/dist/cli/{pr-workflow-gate-wkmx8nr6.js → pr-workflow-gate-k44gdrqd.js} +30 -30
- package/dist/cli/{runner-hkbds12j.js → runner-tzgwvvn1.js} +4 -4
- package/dist/cli/{scan-cursor-4khfn5pm.js → scan-cursor-qjdn8kv6.js} +5 -5
- package/dist/cli/{schema-a5zb02h8.js → schema-pyax2tq7.js} +5 -1
- package/dist/cli/{scope-persistence-nsw324ce.js → scope-persistence-dyc17kze.js} +10 -10
- package/dist/cli/{server-exj4wt8j.js → server-bmzj5vt2.js} +30 -30
- package/dist/cli/{skill-generator-r2cdtx7b.js → skill-generator-mp29bht6.js} +12 -12
- package/dist/cli/{snapshot-coordination-init-sad6q0a2.js → snapshot-coordination-init-azkzphpy.js} +30 -30
- package/dist/cli/{speckit-checkoff-46g9sqak.js → speckit-checkoff-1cqfakw2.js} +3 -3
- package/dist/cli/{telemetry-qxav5cdk.js → telemetry-zhcgfe70.js} +1 -1
- package/dist/cli/{worktree-collision-ownership-4znkfq1t.js → worktree-collision-ownership-58sab2m6.js} +6 -6
- package/dist/cli/{worktree-isolation-mv9ee00v.js → worktree-isolation-9egt1ccv.js} +30 -30
- package/dist/commands/harness-opt.d.ts +44 -0
- package/dist/commands/registry.d.ts +56 -0
- package/dist/config/schema.d.ts +20 -0
- package/dist/council/disagreement-detector.d.ts +23 -1
- package/dist/council/general-council-service.d.ts +40 -3
- package/dist/failures/invocation-failure.d.ts +11 -0
- package/dist/harness/store.d.ts +9 -0
- package/dist/hooks/system-enhancer.d.ts +4 -2
- package/dist/hooks/system-render-boundary.d.ts +68 -0
- package/dist/index.js +271 -257
- package/dist/services/harness-optimizer/comparative.d.ts +81 -0
- package/dist/services/harness-optimizer/controller.d.ts +126 -0
- package/dist/services/harness-optimizer/execution.d.ts +68 -0
- package/dist/services/harness-optimizer/index.d.ts +10 -0
- package/dist/services/harness-optimizer/lineage.d.ts +70 -0
- package/dist/services/harness-optimizer/manifest.d.ts +65 -0
- package/dist/services/harness-optimizer/oracle.d.ts +40 -0
- package/dist/utils/provider-error-classification.d.ts +11 -0
- package/opencode-swarm.schema.json +42 -0
- package/package.json +1 -1
package/dist/cli/{snapshot-coordination-init-sad6q0a2.js → snapshot-coordination-init-azkzphpy.js}
RENAMED
|
@@ -8,66 +8,66 @@ import {
|
|
|
8
8
|
markSnapshotCoordinationClosing,
|
|
9
9
|
retrySnapshotCoordinationInitialization,
|
|
10
10
|
startSnapshotCoordinationInitialization
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
11
|
+
} from "./index-m31a2q35.js";
|
|
12
|
+
import"./index-t5gqdkqx.js";
|
|
13
13
|
import"./index-hamqvzqn.js";
|
|
14
|
-
import"./index-
|
|
14
|
+
import"./index-m65tnv4j.js";
|
|
15
15
|
import"./index-nhxykfyy.js";
|
|
16
|
-
import"./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
16
|
+
import"./index-gez80bfr.js";
|
|
17
|
+
import"./index-dn0wqvv2.js";
|
|
18
|
+
import"./index-s0zgz4p1.js";
|
|
19
19
|
import"./index-txdagbh7.js";
|
|
20
|
-
import"./index-
|
|
20
|
+
import"./index-m7havzy4.js";
|
|
21
21
|
import"./index-6b295cas.js";
|
|
22
|
-
import"./index-
|
|
23
|
-
import"./index-
|
|
24
|
-
import"./index-
|
|
22
|
+
import"./index-yet4r7kp.js";
|
|
23
|
+
import"./index-jysjhvpv.js";
|
|
24
|
+
import"./index-886rpw6w.js";
|
|
25
25
|
import"./index-rdec0y3z.js";
|
|
26
|
-
import"./index-
|
|
26
|
+
import"./index-y30y1rkg.js";
|
|
27
27
|
import"./index-cjapb4hy.js";
|
|
28
28
|
import"./index-zsrtt42s.js";
|
|
29
|
-
import"./index-
|
|
29
|
+
import"./index-xq9gsfsc.js";
|
|
30
30
|
import"./index-bdpgfep1.js";
|
|
31
31
|
import"./index-92m05mew.js";
|
|
32
32
|
import"./index-pt7h91zc.js";
|
|
33
33
|
import"./index-q7sjgr1y.js";
|
|
34
|
-
import"./index-
|
|
35
|
-
import"./index-
|
|
36
|
-
import"./index-
|
|
37
|
-
import"./index-
|
|
38
|
-
import"./index-
|
|
34
|
+
import"./index-06f6h0fv.js";
|
|
35
|
+
import"./index-n7syegpa.js";
|
|
36
|
+
import"./index-ytxgr424.js";
|
|
37
|
+
import"./index-t8hv63wy.js";
|
|
38
|
+
import"./index-gm67qky7.js";
|
|
39
39
|
import"./index-gc6h1fmf.js";
|
|
40
40
|
import"./index-2s7dvzff.js";
|
|
41
|
-
import"./index-
|
|
42
|
-
import"./index-
|
|
41
|
+
import"./index-s5ghg4kg.js";
|
|
42
|
+
import"./index-6gcxgx84.js";
|
|
43
43
|
import"./index-rtry5xyf.js";
|
|
44
|
-
import"./index-
|
|
44
|
+
import"./index-pc3cw1xm.js";
|
|
45
45
|
import"./index-frcemc0b.js";
|
|
46
46
|
import"./index-0725jpp7.js";
|
|
47
|
-
import"./index-
|
|
48
|
-
import"./index-
|
|
49
|
-
import"./index-
|
|
47
|
+
import"./index-6aj0ej18.js";
|
|
48
|
+
import"./index-ge1w25n8.js";
|
|
49
|
+
import"./index-38cfx8g8.js";
|
|
50
50
|
import"./index-91dhg3wr.js";
|
|
51
51
|
import"./index-vmthakz0.js";
|
|
52
52
|
import"./index-bv4b8tpa.js";
|
|
53
53
|
import"./index-rdm3px0g.js";
|
|
54
54
|
import"./index-ry16d01s.js";
|
|
55
|
-
import"./index-
|
|
56
|
-
import"./index-
|
|
55
|
+
import"./index-516j9vsk.js";
|
|
56
|
+
import"./index-r1cnmq4j.js";
|
|
57
57
|
import"./index-vzm6zre7.js";
|
|
58
58
|
import"./index-ae75rja9.js";
|
|
59
|
-
import"./index-
|
|
60
|
-
import"./index-
|
|
61
|
-
import"./index-
|
|
59
|
+
import"./index-12ewkms0.js";
|
|
60
|
+
import"./index-ea9fk6v0.js";
|
|
61
|
+
import"./index-6mwha20t.js";
|
|
62
62
|
import"./index-1xnse449.js";
|
|
63
63
|
import"./index-c1ggtmpm.js";
|
|
64
64
|
import"./index-ejhxgyvm.js";
|
|
65
65
|
import"./index-7g4c7s5r.js";
|
|
66
66
|
import"./index-989v83pb.js";
|
|
67
67
|
import"./index-gx2vp8gx.js";
|
|
68
|
-
import"./index-
|
|
68
|
+
import"./index-0vvpe98m.js";
|
|
69
69
|
import"./index-zxdawwc7.js";
|
|
70
|
-
import"./index-
|
|
70
|
+
import"./index-rqm075jf.js";
|
|
71
71
|
import"./index-w872yykk.js";
|
|
72
72
|
import"./index-bk5tah7q.js";
|
|
73
73
|
import"./index-gknz3bv1.js";
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
parseSpeckitTasksContent,
|
|
8
8
|
propagateSpeckitCheckoff,
|
|
9
9
|
writeSpeckitCheckoffLedger
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-06f6h0fv.js";
|
|
11
11
|
import"./index-ejhxgyvm.js";
|
|
12
12
|
import"./index-7g4c7s5r.js";
|
|
13
13
|
import"./index-989v83pb.js";
|
|
14
|
-
import"./index-
|
|
14
|
+
import"./index-0vvpe98m.js";
|
|
15
15
|
import"./index-zxdawwc7.js";
|
|
16
|
-
import"./index-
|
|
16
|
+
import"./index-rqm075jf.js";
|
|
17
17
|
import"./index-w872yykk.js";
|
|
18
18
|
import"./index-bk5tah7q.js";
|
|
19
19
|
import"./index-gknz3bv1.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
scanDelegationFallbacksForRecovery,
|
|
15
15
|
scanDelegationsForRecovery
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-t8hv63wy.js";
|
|
17
17
|
import"./index-gc6h1fmf.js";
|
|
18
18
|
import"./index-2s7dvzff.js";
|
|
19
19
|
import"./index-91dhg3wr.js";
|
|
@@ -21,13 +21,13 @@ import"./index-vmthakz0.js";
|
|
|
21
21
|
import"./index-bv4b8tpa.js";
|
|
22
22
|
import"./index-rdm3px0g.js";
|
|
23
23
|
import"./index-ry16d01s.js";
|
|
24
|
-
import"./index-
|
|
25
|
-
import"./index-
|
|
24
|
+
import"./index-516j9vsk.js";
|
|
25
|
+
import"./index-r1cnmq4j.js";
|
|
26
26
|
import"./index-vzm6zre7.js";
|
|
27
27
|
import"./index-ae75rja9.js";
|
|
28
|
-
import"./index-
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
28
|
+
import"./index-12ewkms0.js";
|
|
29
|
+
import"./index-ea9fk6v0.js";
|
|
30
|
+
import"./index-6mwha20t.js";
|
|
31
31
|
import {
|
|
32
32
|
canonicalRootKeyFresh
|
|
33
33
|
} from "./index-1xnse449.js";
|
|
@@ -21,68 +21,68 @@ import {
|
|
|
21
21
|
sanitizeWorktreeTaskId,
|
|
22
22
|
standardWorktreeByCallID,
|
|
23
23
|
standardWorktreeSerializationSessions
|
|
24
|
-
} from "./index-
|
|
25
|
-
import"./index-
|
|
24
|
+
} from "./index-m31a2q35.js";
|
|
25
|
+
import"./index-t5gqdkqx.js";
|
|
26
26
|
import"./index-hamqvzqn.js";
|
|
27
|
-
import"./index-
|
|
27
|
+
import"./index-m65tnv4j.js";
|
|
28
28
|
import"./index-nhxykfyy.js";
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-
|
|
29
|
+
import"./index-gez80bfr.js";
|
|
30
|
+
import"./index-dn0wqvv2.js";
|
|
31
|
+
import"./index-s0zgz4p1.js";
|
|
32
32
|
import"./index-txdagbh7.js";
|
|
33
|
-
import"./index-
|
|
33
|
+
import"./index-m7havzy4.js";
|
|
34
34
|
import"./index-6b295cas.js";
|
|
35
|
-
import"./index-
|
|
36
|
-
import"./index-
|
|
37
|
-
import"./index-
|
|
35
|
+
import"./index-yet4r7kp.js";
|
|
36
|
+
import"./index-jysjhvpv.js";
|
|
37
|
+
import"./index-886rpw6w.js";
|
|
38
38
|
import"./index-rdec0y3z.js";
|
|
39
|
-
import"./index-
|
|
39
|
+
import"./index-y30y1rkg.js";
|
|
40
40
|
import"./index-cjapb4hy.js";
|
|
41
41
|
import"./index-zsrtt42s.js";
|
|
42
|
-
import"./index-
|
|
42
|
+
import"./index-xq9gsfsc.js";
|
|
43
43
|
import"./index-bdpgfep1.js";
|
|
44
44
|
import"./index-92m05mew.js";
|
|
45
45
|
import"./index-pt7h91zc.js";
|
|
46
46
|
import"./index-q7sjgr1y.js";
|
|
47
|
-
import"./index-
|
|
48
|
-
import"./index-
|
|
49
|
-
import"./index-
|
|
50
|
-
import"./index-
|
|
51
|
-
import"./index-
|
|
47
|
+
import"./index-06f6h0fv.js";
|
|
48
|
+
import"./index-n7syegpa.js";
|
|
49
|
+
import"./index-ytxgr424.js";
|
|
50
|
+
import"./index-t8hv63wy.js";
|
|
51
|
+
import"./index-gm67qky7.js";
|
|
52
52
|
import"./index-gc6h1fmf.js";
|
|
53
53
|
import"./index-2s7dvzff.js";
|
|
54
|
-
import"./index-
|
|
55
|
-
import"./index-
|
|
54
|
+
import"./index-s5ghg4kg.js";
|
|
55
|
+
import"./index-6gcxgx84.js";
|
|
56
56
|
import"./index-rtry5xyf.js";
|
|
57
57
|
import {
|
|
58
58
|
resolveWorktreeIsolationConfig
|
|
59
|
-
} from "./index-
|
|
59
|
+
} from "./index-pc3cw1xm.js";
|
|
60
60
|
import"./index-frcemc0b.js";
|
|
61
61
|
import"./index-0725jpp7.js";
|
|
62
|
-
import"./index-
|
|
63
|
-
import"./index-
|
|
64
|
-
import"./index-
|
|
62
|
+
import"./index-6aj0ej18.js";
|
|
63
|
+
import"./index-ge1w25n8.js";
|
|
64
|
+
import"./index-38cfx8g8.js";
|
|
65
65
|
import"./index-91dhg3wr.js";
|
|
66
66
|
import"./index-vmthakz0.js";
|
|
67
67
|
import"./index-bv4b8tpa.js";
|
|
68
68
|
import"./index-rdm3px0g.js";
|
|
69
69
|
import"./index-ry16d01s.js";
|
|
70
|
-
import"./index-
|
|
71
|
-
import"./index-
|
|
70
|
+
import"./index-516j9vsk.js";
|
|
71
|
+
import"./index-r1cnmq4j.js";
|
|
72
72
|
import"./index-vzm6zre7.js";
|
|
73
73
|
import"./index-ae75rja9.js";
|
|
74
|
-
import"./index-
|
|
75
|
-
import"./index-
|
|
76
|
-
import"./index-
|
|
74
|
+
import"./index-12ewkms0.js";
|
|
75
|
+
import"./index-ea9fk6v0.js";
|
|
76
|
+
import"./index-6mwha20t.js";
|
|
77
77
|
import"./index-1xnse449.js";
|
|
78
78
|
import"./index-c1ggtmpm.js";
|
|
79
79
|
import"./index-ejhxgyvm.js";
|
|
80
80
|
import"./index-7g4c7s5r.js";
|
|
81
81
|
import"./index-989v83pb.js";
|
|
82
82
|
import"./index-gx2vp8gx.js";
|
|
83
|
-
import"./index-
|
|
83
|
+
import"./index-0vvpe98m.js";
|
|
84
84
|
import"./index-zxdawwc7.js";
|
|
85
|
-
import"./index-
|
|
85
|
+
import"./index-rqm075jf.js";
|
|
86
86
|
import"./index-w872yykk.js";
|
|
87
87
|
import"./index-bk5tah7q.js";
|
|
88
88
|
import"./index-gknz3bv1.js";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `/swarm harness-opt` command group (issue #2503 — governed HarnessOpt
|
|
3
|
+
* capstone).
|
|
4
|
+
*
|
|
5
|
+
* Subcommands: plan | run | status | stop | history
|
|
6
|
+
*
|
|
7
|
+
* - JSON output on `--json` (convention: skill-opt.ts).
|
|
8
|
+
* - Disabled by default: `run` requires `config.harness_opt.enabled === true`
|
|
9
|
+
* AND an explicit `--confirm`. The `--confirm` refusal is evaluated FIRST
|
|
10
|
+
* so it stays observable without any config in the command context.
|
|
11
|
+
* - `run` and `stop` are human-gated (`toolPolicy: 'human-only'` on the
|
|
12
|
+
* registry entries); `plan`/`status`/`history` are read-only/proposal-only.
|
|
13
|
+
* - Activation and rollback are NOT here: they stay on the existing
|
|
14
|
+
* human-only `/swarm approve-write` + harness store path.
|
|
15
|
+
* - `run` executes the round through the production evaluation substrate
|
|
16
|
+
* in a disposable worktree; a `test` split consumes the held-out set
|
|
17
|
+
* exactly once (substrate-enforced).
|
|
18
|
+
*/
|
|
19
|
+
import { type HarnessOptConfig } from '../config/schema.js';
|
|
20
|
+
import type { EvaluationModelDispatcher } from '../evaluation/model-dispatcher.js';
|
|
21
|
+
export interface HarnessOptRuntime {
|
|
22
|
+
config?: HarnessOptConfig;
|
|
23
|
+
/** Evaluation dispatcher from CommandContext.evaluationModelDispatcher. */
|
|
24
|
+
dispatcher?: EvaluationModelDispatcher;
|
|
25
|
+
parentSessionId?: string;
|
|
26
|
+
}
|
|
27
|
+
/** `/swarm harness-opt plan` — freeze the task set and report (dry-run). */
|
|
28
|
+
export declare function handleHarnessOptPlan(directory: string, args: string[], _runtime?: HarnessOptRuntime): Promise<string>;
|
|
29
|
+
/** `/swarm harness-opt run` — execute ONE governed round (human-only). */
|
|
30
|
+
export declare function handleHarnessOptRun(directory: string, args: string[], runtime?: HarnessOptRuntime): Promise<string>;
|
|
31
|
+
/** `/swarm harness-opt status` — loop status + latest lineage summary. */
|
|
32
|
+
export declare function handleHarnessOptStatus(directory: string, args: string[]): Promise<string>;
|
|
33
|
+
/** `/swarm harness-opt stop` — human-only operator stop (or --resume). */
|
|
34
|
+
export declare function handleHarnessOptStop(directory: string, args: string[]): Promise<string>;
|
|
35
|
+
/** `/swarm harness-opt history` — bounded lineage listing. */
|
|
36
|
+
export declare function handleHarnessOptHistory(directory: string, args: string[]): Promise<string>;
|
|
37
|
+
/** `/swarm harness-opt compare` — the separately executable comparative
|
|
38
|
+
* evaluation work package (issue #2503): three arms on one frozen task
|
|
39
|
+
* population, an independently validated manifest when supplied, the
|
|
40
|
+
* independent oracle's verdict on baseline-vs-candidate summaries, and a
|
|
41
|
+
* pilot-graduation record retaining the observed evidence verbatim.
|
|
42
|
+
* Human-gated: requires --confirm and an evaluation dispatcher; never
|
|
43
|
+
* consumes a held-out split and never mutates the harness. */
|
|
44
|
+
export declare function handleHarnessOptCompare(directory: string, args: string[], runtime?: HarnessOptRuntime): Promise<string>;
|
|
@@ -474,6 +474,62 @@ export declare const COMMAND_REGISTRY: {
|
|
|
474
474
|
readonly category: "utility";
|
|
475
475
|
readonly toolPolicy: "agent";
|
|
476
476
|
};
|
|
477
|
+
readonly 'harness-opt': {
|
|
478
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
479
|
+
readonly description: "Governed HarnessOpt capstone (issue #2503). Freezes the comparative task set and drives isolated, approved, reversible optimization rounds through the evaluation substrate.";
|
|
480
|
+
readonly args: "plan|run|status|stop|history [--tasks <json>] [--split train|validation|test] [--seed <s>] [--confirm] [--json] [--reason <text>]";
|
|
481
|
+
readonly details: "Disabled by default. `run` requires harness_opt.enabled=true AND --confirm, executes one governed round in a disposable worktree (a test split consumes the held-out set exactly once, substrate-enforced), and records durable lineage with task-cost accounting (unknown-not-zero). Activation/rollback stay on /swarm approve-write + the harness store; the controller never mutates the live harness.";
|
|
482
|
+
readonly category: "utility";
|
|
483
|
+
readonly toolPolicy: "agent";
|
|
484
|
+
};
|
|
485
|
+
readonly 'harness-opt plan': {
|
|
486
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
487
|
+
readonly description: "Freeze the comparative task set and report loop status (dry-run)";
|
|
488
|
+
readonly subcommandOf: "harness-opt";
|
|
489
|
+
readonly args: "--tasks <json> [--split train|validation|test] [--seed <s>] [--json]";
|
|
490
|
+
readonly category: "utility";
|
|
491
|
+
readonly toolPolicy: "agent";
|
|
492
|
+
};
|
|
493
|
+
readonly 'harness-opt run': {
|
|
494
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
495
|
+
readonly description: "Execute ONE governed optimization round in a disposable worktree. Requires harness_opt.enabled=true and --confirm; a test split consumes the held-out set exactly once.";
|
|
496
|
+
readonly subcommandOf: "harness-opt";
|
|
497
|
+
readonly args: "--tasks <json> --confirm [--split train|validation|test] [--seed <s>] [--json]";
|
|
498
|
+
readonly category: "utility";
|
|
499
|
+
readonly toolPolicy: "human-only";
|
|
500
|
+
};
|
|
501
|
+
readonly 'harness-opt status': {
|
|
502
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
503
|
+
readonly description: "Show loop status and the latest round lineage summary";
|
|
504
|
+
readonly subcommandOf: "harness-opt";
|
|
505
|
+
readonly args: "[--json]";
|
|
506
|
+
readonly category: "utility";
|
|
507
|
+
readonly toolPolicy: "agent";
|
|
508
|
+
};
|
|
509
|
+
readonly 'harness-opt stop': {
|
|
510
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
511
|
+
readonly description: "Human-only operator stop: halt governed rounds with a recorded reason";
|
|
512
|
+
readonly subcommandOf: "harness-opt";
|
|
513
|
+
readonly args: "[--reason <text>] [--json]";
|
|
514
|
+
readonly category: "utility";
|
|
515
|
+
readonly toolPolicy: "human-only";
|
|
516
|
+
};
|
|
517
|
+
readonly 'harness-opt compare': {
|
|
518
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
519
|
+
readonly description: "Separately executable comparative evaluation (issue #2503): baseline, ablation, and simple-agent arms on one frozen task population with an independently validated manifest, the independent oracle verdict, and a retained pilot-graduation record.";
|
|
520
|
+
readonly subcommandOf: "harness-opt";
|
|
521
|
+
readonly args: "--tasks <json> --confirm [--manifest <json>] [--seed <s>] [--lower-ci <n>] [--json]";
|
|
522
|
+
readonly category: "utility";
|
|
523
|
+
readonly toolPolicy: "human-only";
|
|
524
|
+
};
|
|
525
|
+
readonly 'harness-opt history': {
|
|
526
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
527
|
+
readonly description: "List durable round lineage records (bounded to the last 20)";
|
|
528
|
+
readonly subcommandOf: "harness-opt";
|
|
529
|
+
readonly args: "[--json]";
|
|
530
|
+
readonly category: "utility";
|
|
531
|
+
readonly toolPolicy: "agent";
|
|
532
|
+
};
|
|
477
533
|
readonly review: {
|
|
478
534
|
readonly handler: typeof handleReviewCommand;
|
|
479
535
|
readonly description: "Run the independent review model against a selected Git diff";
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -1149,6 +1149,17 @@ export declare const HarnessEvolutionConfigSchema: z.ZodObject<{
|
|
|
1149
1149
|
}, z.core.$strict>;
|
|
1150
1150
|
export type HarnessEvolutionConfig = z.infer<typeof HarnessEvolutionConfigSchema>;
|
|
1151
1151
|
export declare const DEFAULT_HARNESS_EVOLUTION_CONFIG: HarnessEvolutionConfig;
|
|
1152
|
+
export declare const HarnessOptConfigSchema: z.ZodObject<{
|
|
1153
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1154
|
+
max_rounds: z.ZodDefault<z.ZodNumber>;
|
|
1155
|
+
max_transient_retries: z.ZodDefault<z.ZodNumber>;
|
|
1156
|
+
max_wall_clock_ms: z.ZodDefault<z.ZodNumber>;
|
|
1157
|
+
max_spend_usd: z.ZodOptional<z.ZodNumber>;
|
|
1158
|
+
run_ablation_arm: z.ZodDefault<z.ZodBoolean>;
|
|
1159
|
+
run_simple_agent_arm: z.ZodDefault<z.ZodBoolean>;
|
|
1160
|
+
}, z.core.$strict>;
|
|
1161
|
+
export type HarnessOptConfig = z.infer<typeof HarnessOptConfigSchema>;
|
|
1162
|
+
export declare const DEFAULT_HARNESS_OPT_CONFIG: HarnessOptConfig;
|
|
1152
1163
|
export declare const SkillImproverConfigSchema: z.ZodObject<{
|
|
1153
1164
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1154
1165
|
model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -2817,6 +2828,15 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
2817
2828
|
max_replay_records: z.ZodDefault<z.ZodNumber>;
|
|
2818
2829
|
max_output_bytes: z.ZodDefault<z.ZodNumber>;
|
|
2819
2830
|
}, z.core.$strict>>;
|
|
2831
|
+
harness_opt: z.ZodOptional<z.ZodObject<{
|
|
2832
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
2833
|
+
max_rounds: z.ZodDefault<z.ZodNumber>;
|
|
2834
|
+
max_transient_retries: z.ZodDefault<z.ZodNumber>;
|
|
2835
|
+
max_wall_clock_ms: z.ZodDefault<z.ZodNumber>;
|
|
2836
|
+
max_spend_usd: z.ZodOptional<z.ZodNumber>;
|
|
2837
|
+
run_ablation_arm: z.ZodDefault<z.ZodBoolean>;
|
|
2838
|
+
run_simple_agent_arm: z.ZodDefault<z.ZodBoolean>;
|
|
2839
|
+
}, z.core.$strict>>;
|
|
2820
2840
|
spec_writer: z.ZodOptional<z.ZodObject<{
|
|
2821
2841
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
2822
2842
|
model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -23,7 +23,29 @@
|
|
|
23
23
|
* forward to Round 2, not full Round 1 context — mirrors the "semantic forget
|
|
24
24
|
* gate" selective-retention insight and keeps prompt sizes bounded.
|
|
25
25
|
*/
|
|
26
|
-
import type { GeneralCouncilDisagreement, GeneralCouncilMemberResponse } from './general-council-types.js';
|
|
26
|
+
import type { GeneralCouncilClaim, GeneralCouncilDisagreement, GeneralCouncilMemberResponse } from './general-council-types.js';
|
|
27
|
+
/**
|
|
28
|
+
* Defensive shape check for one structured claim. Malformed claims are
|
|
29
|
+
* skipped individually — they must never break the detector or suppress the
|
|
30
|
+
* fallback passes (issue #2102 contract G safety rule).
|
|
31
|
+
*
|
|
32
|
+
* Exported (issue #2578) so the general-council synthesis service applies the
|
|
33
|
+
* SAME well-formedness filter when deciding which members hold explicit
|
|
34
|
+
* contrary positions for consensus clustering — one definition, no duplicate
|
|
35
|
+
* shape-check.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isWellFormedClaim(value: unknown): value is GeneralCouncilClaim;
|
|
38
|
+
/**
|
|
39
|
+
* Two stances are contrary when they differ, neither is neutral, and at
|
|
40
|
+
* least one is an explicit contrary position (`oppose` or `alternative`).
|
|
41
|
+
* `concern` flags risk without taking a side, so support-vs-concern is not
|
|
42
|
+
* auto-detected here — the marker/heuristic passes still cover it.
|
|
43
|
+
*
|
|
44
|
+
* Exported (issue #2578): the synthesis service reuses this canonical
|
|
45
|
+
* definition to identify a member's explicit contrary stance
|
|
46
|
+
* (`areContraryStances(stance, 'support')`) instead of duplicating the list.
|
|
47
|
+
*/
|
|
48
|
+
export declare function areContraryStances(a: GeneralCouncilClaim['stance'], b: GeneralCouncilClaim['stance']): boolean;
|
|
27
49
|
/**
|
|
28
50
|
* Detect disagreements across Round 1 member responses.
|
|
29
51
|
*
|
|
@@ -9,14 +9,51 @@
|
|
|
9
9
|
* member confidence rather than counted by headcount. A claim is a consensus
|
|
10
10
|
* point only when its weighted agreement exceeds 0.6 across members.
|
|
11
11
|
*
|
|
12
|
-
* MAINTAIN/CONCEDE/NUANCE protocol (ConfMAD): a Round 2 response
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* MAINTAIN/CONCEDE/NUANCE protocol (ConfMAD): a Round 2 response resolves a
|
|
13
|
+
* Round 1 disagreement only when a disputant declares a paragraph-leading
|
|
14
|
+
* CONCEDE on that topic (the documented stance grammar in
|
|
15
|
+
* ../agents/council-prompts.ts); MAINTAIN and NUANCE both leave it
|
|
16
|
+
* persisting (NUANCE carries no distinct synthesis behavior — it is parsed
|
|
17
|
+
* only so the stance grammar is recognized and recorded). Issue #2578: prose
|
|
18
|
+
* that merely CONTAINS the word "concede" (e.g. "MAINTAIN — I do not
|
|
19
|
+
* concede…") is not a concession, and a member detected as holding a
|
|
20
|
+
* contrary position (typed oppose/alternative claim, or appearing in any
|
|
21
|
+
* detected disagreement) is disagreement evidence that must never be emitted
|
|
22
|
+
* as consensus.
|
|
15
23
|
*/
|
|
16
24
|
import type { GeneralCouncilDeliberationResponse, GeneralCouncilMemberResponse, GeneralCouncilResult } from './general-council-types.js';
|
|
25
|
+
/** Round 2 stance keywords, exactly as documented in council-prompts.ts. */
|
|
26
|
+
declare const LEADING_STANCE_KEYWORDS: readonly ["MAINTAIN", "CONCEDE", "NUANCE"];
|
|
27
|
+
export type GeneralCouncilLeadingStance = (typeof LEADING_STANCE_KEYWORDS)[number];
|
|
28
|
+
/** One paragraph-leading stance declaration parsed from a Round 2 response. */
|
|
29
|
+
export interface LeadingStanceDeclaration {
|
|
30
|
+
stance: GeneralCouncilLeadingStance;
|
|
31
|
+
/** The full text of the paragraph whose first word is the stance keyword. */
|
|
32
|
+
paragraph: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Parse the documented paragraph-leading stance contract (issue #2578 sole
|
|
36
|
+
* owner: this module — callers must reuse this parser, not re-implement it).
|
|
37
|
+
*
|
|
38
|
+
* A declaration exists only when the FIRST word of a paragraph (blank-line
|
|
39
|
+
* separated) is exactly one of the uppercase keywords MAINTAIN / CONCEDE /
|
|
40
|
+
* NUANCE (case-sensitive, as the prompt documents them), standing alone
|
|
41
|
+
* before whitespace, punctuation, or a markdown decorator. Prose such as
|
|
42
|
+
* "I do not concede" or "After review I concede…" never leads a paragraph
|
|
43
|
+
* with the keyword and so yields no declaration — the conservative direction
|
|
44
|
+
* (no concession).
|
|
45
|
+
*
|
|
46
|
+
* Council prompts sanction markdown inside the response string ("Markdown OK
|
|
47
|
+
* inside the string"), so common paragraph decorators must not hide a
|
|
48
|
+
* declaration: leading blockquote/heading/list markers are stripped before
|
|
49
|
+
* the first-word check, emphasis wrapping (bold/italic/code) and hyphen
|
|
50
|
+
* joins are boundary characters, and zero-width characters are removed.
|
|
51
|
+
*/
|
|
52
|
+
export declare function extractLeadingStanceDeclarations(response: string): LeadingStanceDeclaration[];
|
|
17
53
|
/**
|
|
18
54
|
* Pure synthesis. Given completed member responses, produces the final
|
|
19
55
|
* `GeneralCouncilResult` (without `moderatorOutput` — moderator is invoked
|
|
20
56
|
* by the architect after this returns and populated separately).
|
|
21
57
|
*/
|
|
22
58
|
export declare function synthesizeGeneralCouncil(question: string, mode: 'general' | 'spec_review', round1Responses: GeneralCouncilMemberResponse[], round2Responses: GeneralCouncilDeliberationResponse[]): GeneralCouncilResult;
|
|
59
|
+
export {};
|
|
@@ -58,6 +58,17 @@ export interface ToolFailureClassificationInput {
|
|
|
58
58
|
*/
|
|
59
59
|
export declare function sanitizeFailureEvidenceDisplay(value: string): string;
|
|
60
60
|
declare function isNeutralExitOne(command: string): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Provider failure categories in use (enumerated per issue #2673 plan-critic
|
|
63
|
+
* finding 6, so downstream category-prefix consumers — telemetry filters,
|
|
64
|
+
* dashboards, circuit thresholds — can discover every leaf):
|
|
65
|
+
* provider.cancelled, provider.authentication_configuration,
|
|
66
|
+
* provider.quota_billing, provider.rate_limit, provider.unavailable,
|
|
67
|
+
* provider.context_window, provider.content_policy,
|
|
68
|
+
* provider.request_shape (#2673: deterministic request-shape rejections,
|
|
69
|
+
* e.g. a strict single-system provider rejecting a multi-system payload),
|
|
70
|
+
* provider.unknown.
|
|
71
|
+
*/
|
|
61
72
|
export declare function classifyProviderFailure(error: unknown, action?: ActionIdentityInput): InvocationFailureRecordV1;
|
|
62
73
|
export declare function isRetryableProviderFailure(record: InvocationFailureRecordV1): boolean;
|
|
63
74
|
export declare function classifyToolInvocationFailure(input: ToolFailureClassificationInput): InvocationFailureRecordV1 | null;
|
package/dist/harness/store.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HarnessEvolutionConfig } from '../config/schema.js';
|
|
1
2
|
import { type WriteApprovalRequest } from '../security/write-authority.js';
|
|
2
3
|
import { type BlueprintPatchV1, type HarnessBlueprintV1, type PromptArtifactV1 } from './contracts.js';
|
|
3
4
|
import type { HarnessSourceCandidateV1 } from './source-candidate.js';
|
|
@@ -93,6 +94,9 @@ export type ActivateHarnessCandidateResult = {
|
|
|
93
94
|
} | {
|
|
94
95
|
status: 'candidate_not_activatable';
|
|
95
96
|
reason: string;
|
|
97
|
+
} | {
|
|
98
|
+
status: 'allowlist_revoked';
|
|
99
|
+
reason: string;
|
|
96
100
|
} | {
|
|
97
101
|
status: 'consumer_mismatch';
|
|
98
102
|
reason: string;
|
|
@@ -120,6 +124,9 @@ export type RollbackHarnessVersionResult = {
|
|
|
120
124
|
} | {
|
|
121
125
|
status: 'version_not_found';
|
|
122
126
|
reason: string;
|
|
127
|
+
} | {
|
|
128
|
+
status: 'allowlist_revoked';
|
|
129
|
+
reason: string;
|
|
123
130
|
} | {
|
|
124
131
|
status: 'consumer_mismatch';
|
|
125
132
|
reason: string;
|
|
@@ -229,6 +236,7 @@ export declare function activateHarnessCandidate(args: {
|
|
|
229
236
|
expectedCurrentGeneration: number;
|
|
230
237
|
targetContentHash: string;
|
|
231
238
|
allowedPathDigest: string;
|
|
239
|
+
config?: HarnessEvolutionConfig;
|
|
232
240
|
maxVersions?: number;
|
|
233
241
|
maxReplayRecords?: number;
|
|
234
242
|
maxInactiveCandidates?: number;
|
|
@@ -242,6 +250,7 @@ export declare function rollbackHarnessVersion(args: {
|
|
|
242
250
|
expectedCurrentGeneration: number;
|
|
243
251
|
targetContentHash: string;
|
|
244
252
|
allowedPathDigest: string;
|
|
253
|
+
config?: HarnessEvolutionConfig;
|
|
245
254
|
maxVersions?: number;
|
|
246
255
|
maxReplayRecords?: number;
|
|
247
256
|
maxInactiveCandidates?: number;
|
|
@@ -10,8 +10,10 @@ import type { RuntimePlan } from '../config/plan-schema';
|
|
|
10
10
|
/**
|
|
11
11
|
* Build the [spec-drift] advisory injected into the model's system prompt
|
|
12
12
|
* after every loadPlan whenever spec staleness is detected (issue #853
|
|
13
|
-
* Layer A). The text is appended to `output.system
|
|
14
|
-
* single-system
|
|
13
|
+
* Layer A). The text is appended to `output.system`; when the system render
|
|
14
|
+
* boundary (issue #2673) resolves `strict-single-system` for this request's
|
|
15
|
+
* model, the joined single entry retains the `[spec-drift]` block
|
|
16
|
+
* byte-verbatim (pinned by the boundary's acceptance checks).
|
|
15
17
|
*
|
|
16
18
|
* The "Do NOT proceed" line enumerates every tool in SPEC_DRIFT_BLOCKED_TOOLS
|
|
17
19
|
* so the architect knows exactly which calls will return SPEC_DRIFT_BLOCK
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System render boundary (issue #2673).
|
|
3
|
+
*
|
|
4
|
+
* The final request boundary for the SYSTEM surface. The pinned host
|
|
5
|
+
* (@opencode-ai 1.18.3 — anomalyco/opencode@v1.18.3,
|
|
6
|
+
* packages/opencode/src/session/llm/request.ts, LLMRequestPrep.prepare)
|
|
7
|
+
* triggers `experimental.chat.system.transform` with `{ sessionID?, model }`
|
|
8
|
+
* and the SHARED `system` array, then coalesces only when
|
|
9
|
+
* `system.length > 2 && system[0] === header`, and materializes EVERY
|
|
10
|
+
* surviving entry as a separate `{role:'system'}` message ahead of the
|
|
11
|
+
* conversation. With plugin guidance entries present, every non-OAuth
|
|
12
|
+
* provider therefore receives exactly two system messages.
|
|
13
|
+
*
|
|
14
|
+
* Strict single-system providers (Qwen3.6/Gemma class — the documented
|
|
15
|
+
* v6.85.1 incident: "require exactly one `{role:'system'}` message at
|
|
16
|
+
* index 0") crash or silently degrade on that shape. An UNCONDITIONAL
|
|
17
|
+
* collapse is wrong (issue #1619): the host marks prompt-cache breakpoints
|
|
18
|
+
* on the first two system messages, so folding the stable base prompt
|
|
19
|
+
* together with per-request injections would move the breakpoint behind
|
|
20
|
+
* varying content and defeat caching for cache-capable providers.
|
|
21
|
+
*
|
|
22
|
+
* This module resolves the per-request rendering capability from the model
|
|
23
|
+
* the host hands the boundary and collapses ONLY for strict single-system
|
|
24
|
+
* models, IN PLACE (`length = 0` + `push` — the #1619 discipline: the host
|
|
25
|
+
* discards hook return values and reads its own array). Everything else is
|
|
26
|
+
* left byte-identical.
|
|
27
|
+
*
|
|
28
|
+
* Known limitation (plan-critic round 1, finding 1): host request paths that
|
|
29
|
+
* bypass `output.system` — OpenAI OAuth and workflow models consume the
|
|
30
|
+
* system surface via `options.instructions` — cannot be shaped by any plugin
|
|
31
|
+
* hook and are out of scope.
|
|
32
|
+
*/
|
|
33
|
+
/** Rendering classes the boundary distinguishes. */
|
|
34
|
+
export type SystemRenderCapability = 'strict-single-system' | 'multi-system';
|
|
35
|
+
/** Bounded, observable result of one boundary application. */
|
|
36
|
+
export interface SystemRenderBoundaryResult {
|
|
37
|
+
capability: SystemRenderCapability;
|
|
38
|
+
entriesBefore: number;
|
|
39
|
+
entriesAfter: number;
|
|
40
|
+
collapsed: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Resolve the rendering capability for one request's model. Fail-open:
|
|
44
|
+
* anything unreadable or unknown resolves to `multi-system`, which leaves the
|
|
45
|
+
* array byte-identical (the pre-#2673 behavior), so the boundary can never
|
|
46
|
+
* regress a provider it does not positively know to be strict.
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolveSystemRenderCapability(model: unknown): SystemRenderCapability;
|
|
49
|
+
/**
|
|
50
|
+
* Apply the boundary to one request's system array, in place.
|
|
51
|
+
*
|
|
52
|
+
* Strict single-system models with more than one entry: empty-string entries
|
|
53
|
+
* are dropped, the rest are joined with a blank line (base prompt first —
|
|
54
|
+
* every producer appends after the host's pre-joined header), and the array is
|
|
55
|
+
* collapsed to exactly ONE entry via `length = 0` + `push`. Multi-system
|
|
56
|
+
* models: no mutation at all. Length ≤ 1: no-op. Never fabricates or reorders
|
|
57
|
+
* non-empty content.
|
|
58
|
+
*/
|
|
59
|
+
export declare function applySystemRenderBoundary(model: unknown, system: string[]): SystemRenderBoundaryResult;
|
|
60
|
+
/**
|
|
61
|
+
* Hook factory for the `experimental.chat.system.transform` chain. Registered
|
|
62
|
+
* LAST (after every producer, including the role filter) so the shape is
|
|
63
|
+
* finalized once, after all pushes and prunes. Fail-open: any throw leaves the
|
|
64
|
+
* array untouched and logs non-fatally.
|
|
65
|
+
*/
|
|
66
|
+
export declare function createSystemRenderBoundaryHook(): {
|
|
67
|
+
'experimental.chat.system.transform': (input: unknown, output: unknown) => Promise<void>;
|
|
68
|
+
};
|