dsh-switchman 1.8.0 → 1.9.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.de.md +41 -1
- package/README.es.md +41 -1
- package/README.fr.md +41 -1
- package/README.it.md +41 -1
- package/README.ja.md +41 -1
- package/README.ko.md +41 -1
- package/README.md +41 -1
- package/README.pt.md +41 -1
- package/README.ru.md +41 -1
- package/README.zh-TW.md +41 -1
- package/README.zh.md +41 -1
- package/client.js +399 -2
- package/cordis.patch.yml +32 -0
- package/host/config.js +40 -0
- package/host/context-trim/fork.js +168 -0
- package/host/context-trim/index.js +830 -0
- package/host/context-trim/metrics.js +104 -0
- package/host/context-trim/state.js +241 -0
- package/host/context-trim/summarizer.js +179 -0
- package/host/context-trim/trigger.js +122 -0
- package/host/context-trim/view.js +316 -0
- package/host/context-watch.js +22 -2
- package/host/dispatch.js +132 -20
- package/host/subagent-model.js +1 -1
- package/index.js +15 -1
- package/package.json +4 -1
package/client.js
CHANGED
|
@@ -257,6 +257,44 @@ window.__ModuleLoader__.load({
|
|
|
257
257
|
},
|
|
258
258
|
};
|
|
259
259
|
|
|
260
|
+
/** Context-trim folding modes (Host config.js trimMode, design:
|
|
261
|
+
* .dsh-switchman/analysis/context-trim-port-design.md): off =
|
|
262
|
+
* never fold, advisory = the model invokes the trim tools,
|
|
263
|
+
* auto = automatic idle folds. */
|
|
264
|
+
const TRIM_MODES = ['off', 'advisory', 'auto'];
|
|
265
|
+
|
|
266
|
+
/** Numeric trim fields: settings field, schema minimum, and the
|
|
267
|
+
* Host-side default (also the fallback for malformed stored
|
|
268
|
+
* values). Percent fields cap at 100 like their Host schema. */
|
|
269
|
+
const TRIM_NUMBER_FIELDS = [
|
|
270
|
+
{ field: 'trimGrowthTokens', min: 1000, def: 22500 },
|
|
271
|
+
{ field: 'trimIncrementTokens', min: 1000, def: 50000 },
|
|
272
|
+
{ field: 'trimPressurePercent', min: 5, max: 100, def: 60 },
|
|
273
|
+
{ field: 'trimEmergencyPercent', min: 5, max: 100, def: 95 },
|
|
274
|
+
{ field: 'trimWindowTokens', min: 0, def: 0 },
|
|
275
|
+
];
|
|
276
|
+
|
|
277
|
+
/** Dictionary keys per numeric trim row. */
|
|
278
|
+
const TRIM_ROW_KEYS = {
|
|
279
|
+
trimGrowthTokens: { label: 'trimGrowthLabel', help: 'trimGrowthHelp' },
|
|
280
|
+
trimIncrementTokens: {
|
|
281
|
+
label: 'trimIncrementLabel',
|
|
282
|
+
help: 'trimIncrementHelp',
|
|
283
|
+
},
|
|
284
|
+
trimPressurePercent: {
|
|
285
|
+
label: 'trimPressureLabel',
|
|
286
|
+
help: 'trimPressureHelp',
|
|
287
|
+
},
|
|
288
|
+
trimEmergencyPercent: {
|
|
289
|
+
label: 'trimEmergencyLabel',
|
|
290
|
+
help: 'trimEmergencyHelp',
|
|
291
|
+
},
|
|
292
|
+
trimWindowTokens: {
|
|
293
|
+
label: 'trimWindowLabel',
|
|
294
|
+
help: 'trimWindowHelp',
|
|
295
|
+
},
|
|
296
|
+
};
|
|
297
|
+
|
|
260
298
|
/** Every settings field this page edits, in mutate order. */
|
|
261
299
|
const ALL_FIELDS = [
|
|
262
300
|
'uiLocale',
|
|
@@ -270,6 +308,10 @@ window.__ModuleLoader__.load({
|
|
|
270
308
|
'wmDenyMode',
|
|
271
309
|
'wmAutoHandover',
|
|
272
310
|
'wmSubagentCap',
|
|
311
|
+
// Context trim (design: context-trim-port-design.md).
|
|
312
|
+
'trimMode',
|
|
313
|
+
'trimEnabled',
|
|
314
|
+
...TRIM_NUMBER_FIELDS.map(({ field }) => field),
|
|
273
315
|
'teamsMode',
|
|
274
316
|
'syncWhitelist',
|
|
275
317
|
// Intent recognition (design: intent-routing.md §2).
|
|
@@ -435,6 +477,14 @@ window.__ModuleLoader__.load({
|
|
|
435
477
|
wmDenyMode: value?.wmDenyMode === 'deny' ? 'deny' : 'cap',
|
|
436
478
|
wmAutoHandover: bool('wmAutoHandover', true),
|
|
437
479
|
wmSubagentCap: bool('wmSubagentCap', true),
|
|
480
|
+
// Context trim (design: context-trim-port-design.md).
|
|
481
|
+
trimMode: TRIM_MODES.includes(value?.trimMode)
|
|
482
|
+
? value.trimMode
|
|
483
|
+
: 'auto',
|
|
484
|
+
trimEnabled: bool('trimEnabled', true),
|
|
485
|
+
...Object.fromEntries(
|
|
486
|
+
TRIM_NUMBER_FIELDS.map((spec) => [spec.field, number(spec)]),
|
|
487
|
+
),
|
|
438
488
|
teamsMode: bool('teamsMode', false),
|
|
439
489
|
syncWhitelist: bool('syncWhitelist', false),
|
|
440
490
|
// Intent recognition (design: intent-routing.md §2): route
|
|
@@ -509,6 +559,11 @@ window.__ModuleLoader__.load({
|
|
|
509
559
|
wmDenyMode: values.wmDenyMode,
|
|
510
560
|
wmAutoHandover: values.wmAutoHandover,
|
|
511
561
|
wmSubagentCap: values.wmSubagentCap,
|
|
562
|
+
trimMode: values.trimMode,
|
|
563
|
+
trimEnabled: values.trimEnabled,
|
|
564
|
+
...Object.fromEntries(
|
|
565
|
+
TRIM_NUMBER_FIELDS.map(({ field }) => [field, values[field]]),
|
|
566
|
+
),
|
|
512
567
|
teamsMode: values.teamsMode,
|
|
513
568
|
syncWhitelist: values.syncWhitelist,
|
|
514
569
|
// Intent recognition: routes compare as route keys, the
|
|
@@ -792,6 +847,25 @@ window.__ModuleLoader__.load({
|
|
|
792
847
|
wmSubagentFollowForce: '跟随 force 档(0)',
|
|
793
848
|
wmCommands:
|
|
794
849
|
'命令:/ctx-pause 暂停水位干预 · /ctx-resume 恢复干预 · /ctx-handover 立即备份并交接压缩。',
|
|
850
|
+
trimSectionTitle: '上下文裁剪',
|
|
851
|
+
trimModeLabel: '自动裁剪模式',
|
|
852
|
+
trimModeHelp:
|
|
853
|
+
'空闲时何时把历史折叠为摘要:off = 从不折叠,advisory = 仅模型主动调用,auto = 自动折叠。',
|
|
854
|
+
trimEnabledLabel: '启用自动裁剪',
|
|
855
|
+
trimEnabledHelp: '上下文裁剪层的总开关。',
|
|
856
|
+
trimGrowthLabel: '增长阈值(token)',
|
|
857
|
+
trimGrowthHelp: '视图较上次折叠增长超过该 token 数后触发折叠。',
|
|
858
|
+
trimIncrementLabel: '增量阈值(token)',
|
|
859
|
+
trimIncrementHelp: '可折叠片段至少要覆盖的新增 token 数。',
|
|
860
|
+
trimPressureLabel: '压力阈值(%)',
|
|
861
|
+
trimPressureHelp: '出站视图达到上下文窗口的这一百分比时折叠。',
|
|
862
|
+
trimEmergencyLabel: '紧急阈值(%)',
|
|
863
|
+
trimEmergencyHelp: '达到窗口的这一百分比时立即机械折叠。',
|
|
864
|
+
trimModeOff: '关闭',
|
|
865
|
+
trimWindowLabel: '窗口上限(token)',
|
|
866
|
+
trimWindowHelp: '压力与紧急档按 min(模型窗口, 上限) 计算;0 = 跟随强制水位(wmForceTokens)。',
|
|
867
|
+
trimModeAdvisory: '仅建议',
|
|
868
|
+
trimModeAuto: '自动',
|
|
795
869
|
teamsSectionTitle: '智能体团队',
|
|
796
870
|
teamsSectionDescription:
|
|
797
871
|
'切换派发形态:关闭为纯 subagent 派发(DSH 出厂保守团队策略接管);开启后注入自主团队规程并启用 Agent Teams。',
|
|
@@ -1013,6 +1087,28 @@ window.__ModuleLoader__.load({
|
|
|
1013
1087
|
wmSubagentFollowForce: 'Follow the force tier (0)',
|
|
1014
1088
|
wmCommands:
|
|
1015
1089
|
'Commands: /ctx-pause suspends watermark actions · /ctx-resume resumes them · /ctx-handover backs up and hands over now.',
|
|
1090
|
+
trimSectionTitle: 'Context trim',
|
|
1091
|
+
trimModeLabel: 'Trim mode',
|
|
1092
|
+
trimModeHelp:
|
|
1093
|
+
'When to fold history into summaries at idle: off = never, advisory = model-invoked only, auto = automatic folds.',
|
|
1094
|
+
trimEnabledLabel: 'Enable auto-trim',
|
|
1095
|
+
trimEnabledHelp: 'Master switch for the context-trim layer.',
|
|
1096
|
+
trimGrowthLabel: 'Growth threshold (tokens)',
|
|
1097
|
+
trimGrowthHelp:
|
|
1098
|
+
'Fold once the view grows this many tokens since the last fold.',
|
|
1099
|
+
trimIncrementLabel: 'Increment threshold (tokens)',
|
|
1100
|
+
trimIncrementHelp: 'Minimum new tokens a foldable span must cover.',
|
|
1101
|
+
trimPressureLabel: 'Pressure threshold (%)',
|
|
1102
|
+
trimPressureHelp:
|
|
1103
|
+
'Fold when the outbound view reaches this percent of the context window.',
|
|
1104
|
+
trimEmergencyLabel: 'Emergency threshold (%)',
|
|
1105
|
+
trimEmergencyHelp:
|
|
1106
|
+
'Immediate mechanical fold at this percent of the window.',
|
|
1107
|
+
trimWindowLabel: 'Window cap (tokens)',
|
|
1108
|
+
trimWindowHelp: 'Pressure and emergency tiers use min(model window, cap); 0 = follow wmForceTokens.',
|
|
1109
|
+
trimModeOff: 'Off',
|
|
1110
|
+
trimModeAdvisory: 'Advisory',
|
|
1111
|
+
trimModeAuto: 'Auto',
|
|
1016
1112
|
teamsSectionTitle: 'Agent teams',
|
|
1017
1113
|
teamsSectionDescription:
|
|
1018
1114
|
"Switch the dispatch shape: off is plain subagent dispatch (DSH's factory conservative team policy takes over); on injects the autonomous team doctrine and enables Agent Teams.",
|
|
@@ -1234,6 +1330,25 @@ window.__ModuleLoader__.load({
|
|
|
1234
1330
|
wmSubagentForceHelp: '僅覆蓋子智能體的 force 檔(soft/hard 與主會話共用);0 = 跟隨上方強制水位。',
|
|
1235
1331
|
wmSubagentFollowForce: '跟隨 force 檔(0)',
|
|
1236
1332
|
wmCommands: '命令:/ctx-pause 暫停水位干預 · /ctx-resume 恢復干預 · /ctx-handover 立即備份並交接壓縮。',
|
|
1333
|
+
trimSectionTitle: '上下文裁剪',
|
|
1334
|
+
trimModeLabel: '自動裁剪模式',
|
|
1335
|
+
trimModeHelp:
|
|
1336
|
+
'閒置時何時將歷史摺疊為摘要:off = 從不摺疊,advisory = 僅模型主動呼叫,auto = 自動摺疊。',
|
|
1337
|
+
trimEnabledLabel: '啟用自動裁剪',
|
|
1338
|
+
trimEnabledHelp: '上下文裁剪層的總開關。',
|
|
1339
|
+
trimGrowthLabel: '增長閾值(token)',
|
|
1340
|
+
trimGrowthHelp: '檢視較上次摺疊增長超過該 token 數後觸發摺疊。',
|
|
1341
|
+
trimIncrementLabel: '增量閾值(token)',
|
|
1342
|
+
trimIncrementHelp: '可摺疊片段至少要涵蓋的新增 token 數。',
|
|
1343
|
+
trimPressureLabel: '壓力閾值(%)',
|
|
1344
|
+
trimPressureHelp: '出站檢視達到上下文視窗的這一百分比時摺疊。',
|
|
1345
|
+
trimEmergencyLabel: '緊急閾值(%)',
|
|
1346
|
+
trimEmergencyHelp: '達到視窗的這一百分比時立即機械摺疊。',
|
|
1347
|
+
trimModeOff: '關閉',
|
|
1348
|
+
trimWindowLabel: '視窗上限(token)',
|
|
1349
|
+
trimWindowHelp: '壓力與緊急檔按 min(模型視窗, 上限) 計算;0 = 跟隨強制水位(wmForceTokens)。',
|
|
1350
|
+
trimModeAdvisory: '僅建議',
|
|
1351
|
+
trimModeAuto: '自動',
|
|
1237
1352
|
teamsSectionTitle: '智能體團隊',
|
|
1238
1353
|
teamsSectionDescription: '切換派發形態:關閉為純 subagent 派發(DSH 出廠保守團隊策略接管);開啟後注入自主團隊規程並啟用 Agent Teams。',
|
|
1239
1354
|
teamsModeLabel: '智能體團隊模式',
|
|
@@ -1434,6 +1549,29 @@ window.__ModuleLoader__.load({
|
|
|
1434
1549
|
wmSubagentForceHelp: 'サブエージェントの force 段階のみを上書きします(soft/hard はメインセッションと共通)。0 なら上の強制水位に従います。',
|
|
1435
1550
|
wmSubagentFollowForce: 'force 段階に従う(0)',
|
|
1436
1551
|
wmCommands: 'コマンド:/ctx-pause で水位アクションを一時停止 · /ctx-resume で再開 · /ctx-handover で今すぐバックアップしてハンドオーバー。',
|
|
1552
|
+
trimSectionTitle: 'コンテキストトリム',
|
|
1553
|
+
trimModeLabel: 'トリムモード',
|
|
1554
|
+
trimModeHelp:
|
|
1555
|
+
'アイドル時に履歴を要約へ折りたたむタイミング:off = 折りたたまない、advisory = モデル呼び出しのみ、auto = 自動で折りたたむ。',
|
|
1556
|
+
trimEnabledLabel: '自動トリムを有効化',
|
|
1557
|
+
trimEnabledHelp: 'コンテキストトリム層のマスタースイッチ。',
|
|
1558
|
+
trimGrowthLabel: '増加しきい値(token)',
|
|
1559
|
+
trimGrowthHelp:
|
|
1560
|
+
'前回の折りたたみからこのトークン数以上増えたら折りたたみます。',
|
|
1561
|
+
trimIncrementLabel: '増分しきい値(token)',
|
|
1562
|
+
trimIncrementHelp:
|
|
1563
|
+
'折りたたみ対象の範囲がカバーする必要のある最小トークン数。',
|
|
1564
|
+
trimPressureLabel: '圧力しきい値(%)',
|
|
1565
|
+
trimPressureHelp:
|
|
1566
|
+
'送信ビューがコンテキストウィンドウのこの割合に達したら折りたたみます。',
|
|
1567
|
+
trimEmergencyLabel: '緊急しきい値(%)',
|
|
1568
|
+
trimEmergencyHelp:
|
|
1569
|
+
'ウィンドウのこの割合に達したら即座に機械的に折りたたみます。',
|
|
1570
|
+
trimWindowLabel: 'ウィンドウ上限(トークン)',
|
|
1571
|
+
trimWindowHelp: '圧力・緊急ティアは min(モデルウィンドウ, 上限) で計算。0 = wmForceTokens に追従。',
|
|
1572
|
+
trimModeOff: 'オフ',
|
|
1573
|
+
trimModeAdvisory: 'アドバイザリー',
|
|
1574
|
+
trimModeAuto: '自動',
|
|
1437
1575
|
teamsSectionTitle: 'エージェントチーム',
|
|
1438
1576
|
teamsSectionDescription: 'ディスパッチ形態の切り替え:オフは通常の subagent ディスパッチ(DSH 出荷時の保守的なチームポリシーが引き継ぎ)。オンにすると自律チーム規律を注入し、Agent Teams を有効にします。',
|
|
1439
1577
|
teamsModeLabel: 'エージェントチームモード',
|
|
@@ -1638,6 +1776,28 @@ window.__ModuleLoader__.load({
|
|
|
1638
1776
|
wmSubagentForceHelp: '서브에이전트의 force 단계만 덮어씁니다(soft/hard는 메인 세션과 공유). 0이면 위 강제 수위를 따릅니다.',
|
|
1639
1777
|
wmSubagentFollowForce: 'force 단계 따르기(0)',
|
|
1640
1778
|
wmCommands: '명령: /ctx-pause 수위 개입 일시 중지 · /ctx-resume 재개 · /ctx-handover 지금 백업하고 핸드오버.',
|
|
1779
|
+
trimSectionTitle: '컨텍스트 트림',
|
|
1780
|
+
trimModeLabel: '트림 모드',
|
|
1781
|
+
trimModeHelp:
|
|
1782
|
+
'유휴 시 언제 기록을 요약으로 접을지: off = 접지 않음, advisory = 모델 호출 시에만, auto = 자동 접기.',
|
|
1783
|
+
trimEnabledLabel: '자동 트림 사용',
|
|
1784
|
+
trimEnabledHelp: '컨텍스트 트림 계층의 마스터 스위치.',
|
|
1785
|
+
trimGrowthLabel: '증가 임계값(token)',
|
|
1786
|
+
trimGrowthHelp: '마지막 접기 이후 이만큼의 토큰이 늘면 접습니다.',
|
|
1787
|
+
trimIncrementLabel: '증분 임계값(token)',
|
|
1788
|
+
trimIncrementHelp:
|
|
1789
|
+
'접을 수 있는 구간이 최소한 포함해야 하는 새 토큰 수.',
|
|
1790
|
+
trimPressureLabel: '압력 임계값(%)',
|
|
1791
|
+
trimPressureHelp:
|
|
1792
|
+
'발신 뷰가 컨텍스트 창의 이 백분율에 도달하면 접습니다.',
|
|
1793
|
+
trimEmergencyLabel: '긴급 임계값(%)',
|
|
1794
|
+
trimEmergencyHelp:
|
|
1795
|
+
'창의 이 백분율에 도달하면 즉시 기계적으로 접습니다.',
|
|
1796
|
+
trimWindowLabel: '윈도우 상한(토큰)',
|
|
1797
|
+
trimWindowHelp: '압력·긴급 티어는 min(모델 윈도우, 상한)으로 계산. 0 = wmForceTokens를 따름.',
|
|
1798
|
+
trimModeOff: '끄기',
|
|
1799
|
+
trimModeAdvisory: '조언',
|
|
1800
|
+
trimModeAuto: '자동',
|
|
1641
1801
|
teamsSectionTitle: '에이전트 팀',
|
|
1642
1802
|
teamsSectionDescription: '디스패치 형태 전환: 끄면 일반 subagent 디스패치입니다(DSH 출고 기본 보수적 팀 정책이 이어받음). 켜면 자율 팀 규율을 주입하고 Agent Teams를 활성화합니다.',
|
|
1643
1803
|
teamsModeLabel: '에이전트 팀 모드',
|
|
@@ -1842,6 +2002,29 @@ window.__ModuleLoader__.load({
|
|
|
1842
2002
|
wmSubagentForceHelp: 'Überschreibt nur die Force-Stufe der Subagents (soft/hard teilen sich mit der Haupt-Session); 0 folgt dem erzwungenen Wasserstand oben.',
|
|
1843
2003
|
wmSubagentFollowForce: 'Der Force-Stufe folgen (0)',
|
|
1844
2004
|
wmCommands: 'Befehle: /ctx-pause pausiert Wasserstand-Aktionen · /ctx-resume setzt sie fort · /ctx-handover sichert jetzt und übergibt sofort.',
|
|
2005
|
+
trimSectionTitle: 'Kontext-Trim',
|
|
2006
|
+
trimModeLabel: 'Trim-Modus',
|
|
2007
|
+
trimModeHelp:
|
|
2008
|
+
'Wann der Verlauf im Leerlauf zu Zusammenfassungen gefaltet wird: off = nie, advisory = nur per Modellaufruf, auto = automatisches Falten.',
|
|
2009
|
+
trimEnabledLabel: 'Auto-Trim aktivieren',
|
|
2010
|
+
trimEnabledHelp: 'Hauptschalter für die Kontext-Trim-Schicht.',
|
|
2011
|
+
trimGrowthLabel: 'Wachstumsschwelle (Token)',
|
|
2012
|
+
trimGrowthHelp:
|
|
2013
|
+
'Faltet, sobald die Ansicht seit dem letzten Falten um so viele Token gewachsen ist.',
|
|
2014
|
+
trimIncrementLabel: 'Zuwachsschwelle (Token)',
|
|
2015
|
+
trimIncrementHelp:
|
|
2016
|
+
'Minimale neue Token, die ein faltbarer Bereich abdecken muss.',
|
|
2017
|
+
trimPressureLabel: 'Druckschwelle (%)',
|
|
2018
|
+
trimPressureHelp:
|
|
2019
|
+
'Faltet, wenn die ausgehende Ansicht diesen Prozentanteil des Kontextfensters erreicht.',
|
|
2020
|
+
trimEmergencyLabel: 'Notfallschwelle (%)',
|
|
2021
|
+
trimEmergencyHelp:
|
|
2022
|
+
'Sofortiges mechanisches Falten bei diesem Prozentanteil des Fensters.',
|
|
2023
|
+
trimWindowLabel: 'Fensterlimit (Token)',
|
|
2024
|
+
trimWindowHelp: 'Druck- und Notfallstufen rechnen mit min(Modellfenster, Limit); 0 = folgt wmForceTokens.',
|
|
2025
|
+
trimModeOff: 'Aus',
|
|
2026
|
+
trimModeAdvisory: 'Empfehlung',
|
|
2027
|
+
trimModeAuto: 'Auto',
|
|
1845
2028
|
teamsSectionTitle: 'Agent-Teams',
|
|
1846
2029
|
teamsSectionDescription: 'Wechselt die Dispatch-Form: Aus ist gewöhnlicher Subagent-Versand (die konservative Werks-Teamrichtlinie von DSH greift); an speist die autonome Team-Doktrin ein und aktiviert Agent Teams.',
|
|
1847
2030
|
teamsModeLabel: 'Agent-Teams-Modus',
|
|
@@ -2048,6 +2231,30 @@ window.__ModuleLoader__.load({
|
|
|
2048
2231
|
wmSubagentForceHelp: 'Solo sobrescribe el nivel forzado de los subagentes (soft/hard se comparten con la sesión principal); 0 sigue el nivel forzado de arriba.',
|
|
2049
2232
|
wmSubagentFollowForce: 'Seguir el nivel forzado (0)',
|
|
2050
2233
|
wmCommands: 'Comandos: /ctx-pause suspende las acciones del nivel · /ctx-resume las reanuda · /ctx-handover hace copia y traspasa ahora.',
|
|
2234
|
+
trimSectionTitle: 'Recorte de contexto',
|
|
2235
|
+
trimModeLabel: 'Modo de recorte',
|
|
2236
|
+
trimModeHelp:
|
|
2237
|
+
'Cuándo plegar el historial en resúmenes en reposo: off = nunca, advisory = solo por invocación del modelo, auto = plegado automático.',
|
|
2238
|
+
trimEnabledLabel: 'Activar recorte automático',
|
|
2239
|
+
trimEnabledHelp:
|
|
2240
|
+
'Interruptor maestro de la capa de recorte de contexto.',
|
|
2241
|
+
trimGrowthLabel: 'Umbral de crecimiento (tokens)',
|
|
2242
|
+
trimGrowthHelp:
|
|
2243
|
+
'Pliega cuando la vista crezca esta cantidad de tokens desde el último plegado.',
|
|
2244
|
+
trimIncrementLabel: 'Umbral de incremento (tokens)',
|
|
2245
|
+
trimIncrementHelp:
|
|
2246
|
+
'Mínimo de tokens nuevos que debe cubrir un tramo plegable.',
|
|
2247
|
+
trimPressureLabel: 'Umbral de presión (%)',
|
|
2248
|
+
trimPressureHelp:
|
|
2249
|
+
'Pliega cuando la vista saliente alcanza este porcentaje de la ventana de contexto.',
|
|
2250
|
+
trimEmergencyLabel: 'Umbral de emergencia (%)',
|
|
2251
|
+
trimEmergencyHelp:
|
|
2252
|
+
'Plegado mecánico inmediato al alcanzar este porcentaje de la ventana.',
|
|
2253
|
+
trimWindowLabel: 'Límite de ventana (tokens)',
|
|
2254
|
+
trimWindowHelp: 'Los niveles de presión y emergencia usan min(ventana del modelo, límite); 0 = sigue a wmForceTokens.',
|
|
2255
|
+
trimModeOff: 'Desactivado',
|
|
2256
|
+
trimModeAdvisory: 'Consejo',
|
|
2257
|
+
trimModeAuto: 'Auto',
|
|
2051
2258
|
teamsSectionTitle: 'Equipos de agentes',
|
|
2052
2259
|
teamsSectionDescription: 'Cambia la forma de despacho: desactivado es despacho simple de subagentes (aplica la política conservadora de fábrica de DSH); activado inyecta la doctrina de equipo autónomo y habilita Agent Teams.',
|
|
2053
2260
|
teamsModeLabel: 'Modo de equipos de agentes',
|
|
@@ -2254,6 +2461,30 @@ window.__ModuleLoader__.load({
|
|
|
2254
2461
|
wmSubagentForceHelp: 'Ne remplace que le palier force des subagents (soft/hard partagés avec la session principale) ; 0 suit la ligne d’eau force ci-dessus.',
|
|
2255
2462
|
wmSubagentFollowForce: 'Suivre le palier force (0)',
|
|
2256
2463
|
wmCommands: 'Commandes : /ctx-pause suspend les actions de niveau d’eau · /ctx-resume les reprend · /ctx-handover sauvegarde et remet maintenant.',
|
|
2464
|
+
trimSectionTitle: 'Rognage du contexte',
|
|
2465
|
+
trimModeLabel: 'Mode de rognage',
|
|
2466
|
+
trimModeHelp:
|
|
2467
|
+
'Quand replier l’historique en résumés au repos : off = jamais, advisory = sur invocation du modèle uniquement, auto = repli automatique.',
|
|
2468
|
+
trimEnabledLabel: 'Activer le rognage automatique',
|
|
2469
|
+
trimEnabledHelp:
|
|
2470
|
+
'Interrupteur principal de la couche de rognage de contexte.',
|
|
2471
|
+
trimGrowthLabel: 'Seuil de croissance (jetons)',
|
|
2472
|
+
trimGrowthHelp:
|
|
2473
|
+
'Replie dès que la vue grossit d’autant de jetons depuis le dernier repli.',
|
|
2474
|
+
trimIncrementLabel: 'Seuil d’incrément (jetons)',
|
|
2475
|
+
trimIncrementHelp:
|
|
2476
|
+
'Nombre minimal de nouveaux jetons qu’un segment repliable doit couvrir.',
|
|
2477
|
+
trimPressureLabel: 'Seuil de pression (%)',
|
|
2478
|
+
trimPressureHelp:
|
|
2479
|
+
'Replie quand la vue sortante atteint ce pourcentage de la fenêtre de contexte.',
|
|
2480
|
+
trimEmergencyLabel: 'Seuil d’urgence (%)',
|
|
2481
|
+
trimEmergencyHelp:
|
|
2482
|
+
'Repli mécanique immédiat à ce pourcentage de la fenêtre.',
|
|
2483
|
+
trimWindowLabel: 'Plafond de fenêtre (jetons)',
|
|
2484
|
+
trimWindowHelp: 'Les paliers pression/urgence utilisent min(fenêtre du modèle, plafond) ; 0 = suit wmForceTokens.',
|
|
2485
|
+
trimModeOff: 'Off',
|
|
2486
|
+
trimModeAdvisory: 'Advisory',
|
|
2487
|
+
trimModeAuto: 'Auto',
|
|
2257
2488
|
teamsSectionTitle: 'Agent Teams',
|
|
2258
2489
|
teamsSectionDescription: 'Change la forme du dispatch : éteint, c’est le dispatch subagent simple (la politique d’équipe prudente d’usine de DSH reprend la main) ; allumé, la doctrine d’équipe autonome est injectée et les Agent Teams sont activés.',
|
|
2259
2490
|
teamsModeLabel: 'Mode Agent Teams',
|
|
@@ -2460,6 +2691,30 @@ window.__ModuleLoader__.load({
|
|
|
2460
2691
|
wmSubagentForceHelp: 'Sostituisce solo la soglia force dei subagent (soft/hard restano condivise con la sessione principale); 0 segue la soglia force sopra.',
|
|
2461
2692
|
wmSubagentFollowForce: 'Segui la soglia force (0)',
|
|
2462
2693
|
wmCommands: 'Comandi: /ctx-pause sospende le azioni da livello dell’acqua · /ctx-resume le riprende · /ctx-handover fa backup e handover subito.',
|
|
2694
|
+
trimSectionTitle: 'Riduzione del contesto',
|
|
2695
|
+
trimModeLabel: 'Modalità di riduzione',
|
|
2696
|
+
trimModeHelp:
|
|
2697
|
+
'Quando comprimere la cronologia in riepiloghi a riposo: off = mai, advisory = solo su invocazione del modello, auto = riduzione automatica.',
|
|
2698
|
+
trimEnabledLabel: 'Attiva riduzione automatica',
|
|
2699
|
+
trimEnabledHelp:
|
|
2700
|
+
'Interruttore principale del livello di riduzione del contesto.',
|
|
2701
|
+
trimGrowthLabel: 'Soglia di crescita (token)',
|
|
2702
|
+
trimGrowthHelp:
|
|
2703
|
+
'Comprime quando la vista cresce di questo numero di token dall’ultima compressione.',
|
|
2704
|
+
trimIncrementLabel: 'Soglia di incremento (token)',
|
|
2705
|
+
trimIncrementHelp:
|
|
2706
|
+
'Numero minimo di token nuovi che un tratto comprimibile deve coprire.',
|
|
2707
|
+
trimPressureLabel: 'Soglia di pressione (%)',
|
|
2708
|
+
trimPressureHelp:
|
|
2709
|
+
'Comprime quando la vista in uscita raggiunge questa percentuale della finestra di contesto.',
|
|
2710
|
+
trimEmergencyLabel: 'Soglia di emergenza (%)',
|
|
2711
|
+
trimEmergencyHelp:
|
|
2712
|
+
'Riduzione meccanica immediata a questa percentuale della finestra.',
|
|
2713
|
+
trimWindowLabel: 'Limite finestra (token)',
|
|
2714
|
+
trimWindowHelp: 'Le soglie di pressione/emergenza usano min(finestra del modello, limite); 0 = segue wmForceTokens.',
|
|
2715
|
+
trimModeOff: 'Off',
|
|
2716
|
+
trimModeAdvisory: 'Advisory',
|
|
2717
|
+
trimModeAuto: 'Auto',
|
|
2463
2718
|
teamsSectionTitle: 'Agent Teams',
|
|
2464
2719
|
teamsSectionDescription: 'Cambia la forma del dispatch: spento è il semplice dispatch via subagent (subentra la politica di squadra prudente di fabbrica di DSH); acceso inietta la dottrina di squadra autonoma e abilita gli Agent Teams.',
|
|
2465
2720
|
teamsModeLabel: 'Modalità Agent Teams',
|
|
@@ -2666,6 +2921,30 @@ window.__ModuleLoader__.load({
|
|
|
2666
2921
|
wmSubagentForceHelp: 'Sobrepõe apenas o limiar force dos subagents (soft/hard são compartilhados com a sessão principal); 0 segue o limiar force acima.',
|
|
2667
2922
|
wmSubagentFollowForce: 'Seguir o limiar force (0)',
|
|
2668
2923
|
wmCommands: 'Comandos: /ctx-pause suspende as ações de nível de água · /ctx-resume as retoma · /ctx-handover faz backup e handover agora.',
|
|
2924
|
+
trimSectionTitle: 'Corte de contexto',
|
|
2925
|
+
trimModeLabel: 'Modo de corte',
|
|
2926
|
+
trimModeHelp:
|
|
2927
|
+
'Quando dobrar o histórico em resumos na ociosidade: off = nunca, advisory = apenas por invocação do modelo, auto = dobra automática.',
|
|
2928
|
+
trimEnabledLabel: 'Ativar corte automático',
|
|
2929
|
+
trimEnabledHelp:
|
|
2930
|
+
'Interruptor principal da camada de corte de contexto.',
|
|
2931
|
+
trimGrowthLabel: 'Limiar de crescimento (tokens)',
|
|
2932
|
+
trimGrowthHelp:
|
|
2933
|
+
'Dobra quando a visualização crescer essa quantidade de tokens desde a última dobra.',
|
|
2934
|
+
trimIncrementLabel: 'Limiar de incremento (tokens)',
|
|
2935
|
+
trimIncrementHelp:
|
|
2936
|
+
'Mínimo de tokens novos que um trecho dobrável deve cobrir.',
|
|
2937
|
+
trimPressureLabel: 'Limiar de pressão (%)',
|
|
2938
|
+
trimPressureHelp:
|
|
2939
|
+
'Dobra quando a visualização de saída atinge essa porcentagem da janela de contexto.',
|
|
2940
|
+
trimEmergencyLabel: 'Limiar de emergência (%)',
|
|
2941
|
+
trimEmergencyHelp:
|
|
2942
|
+
'Dobra mecânica imediata nessa porcentagem da janela.',
|
|
2943
|
+
trimWindowLabel: 'Limite de janela (tokens)',
|
|
2944
|
+
trimWindowHelp: 'Os níveis de pressão e emergência usam min(janela do modelo, limite); 0 = segue wmForceTokens.',
|
|
2945
|
+
trimModeOff: 'Off',
|
|
2946
|
+
trimModeAdvisory: 'Advisory',
|
|
2947
|
+
trimModeAuto: 'Auto',
|
|
2669
2948
|
teamsSectionTitle: 'Agent Teams',
|
|
2670
2949
|
teamsSectionDescription: 'Muda o formato do despacho: desligado é o despacho simples via subagent (entra a política conservadora de equipe de fábrica do DSH); ligado injeta a doutrina de equipe autônoma e habilita os Agent Teams.',
|
|
2671
2950
|
teamsModeLabel: 'Modo Agent Teams',
|
|
@@ -2872,6 +3151,29 @@ window.__ModuleLoader__.load({
|
|
|
2872
3151
|
wmSubagentForceHelp: 'Меняет только линию force субагентов (soft/hard общие с главной сессией); 0 — следовать линии force выше.',
|
|
2873
3152
|
wmSubagentFollowForce: 'Следовать линии force (0)',
|
|
2874
3153
|
wmCommands: 'Команды: /ctx-pause приостанавливает действия по уровню воды · /ctx-resume возобновляет их · /ctx-handover делает резервную копию и передаёт прямо сейчас.',
|
|
3154
|
+
trimSectionTitle: 'Обрезка контекста',
|
|
3155
|
+
trimModeLabel: 'Режим обрезки',
|
|
3156
|
+
trimModeHelp:
|
|
3157
|
+
'Когда сворачивать историю в сводки в простое: off = никогда, advisory = только по вызову модели, auto = автоматически.',
|
|
3158
|
+
trimEnabledLabel: 'Включить автообрезку',
|
|
3159
|
+
trimEnabledHelp: 'Главный выключатель слоя обрезки контекста.',
|
|
3160
|
+
trimGrowthLabel: 'Порог роста (токенов)',
|
|
3161
|
+
trimGrowthHelp:
|
|
3162
|
+
'Сворачивает, когда представление вырастает на столько токенов с прошлого сворачивания.',
|
|
3163
|
+
trimIncrementLabel: 'Порог прироста (токенов)',
|
|
3164
|
+
trimIncrementHelp:
|
|
3165
|
+
'Минимум новых токенов, которые должен покрывать сворачиваемый диапазон.',
|
|
3166
|
+
trimPressureLabel: 'Порог давления (%)',
|
|
3167
|
+
trimPressureHelp:
|
|
3168
|
+
'Сворачивает, когда исходящее представление достигает этого процента окна контекста.',
|
|
3169
|
+
trimEmergencyLabel: 'Аварийный порог (%)',
|
|
3170
|
+
trimEmergencyHelp:
|
|
3171
|
+
'Немедленное механическое сворачивание при этом проценте окна.',
|
|
3172
|
+
trimWindowLabel: 'Лимит окна (токены)',
|
|
3173
|
+
trimWindowHelp: 'Уровни давления и аварийный считают от min(окно модели, лимит); 0 = следует за wmForceTokens.',
|
|
3174
|
+
trimModeOff: 'Off',
|
|
3175
|
+
trimModeAdvisory: 'Advisory',
|
|
3176
|
+
trimModeAuto: 'Авто',
|
|
2875
3177
|
teamsSectionTitle: 'Agent Teams',
|
|
2876
3178
|
teamsSectionDescription: 'Переключает форму диспетчеризации: выключено — обычный dispatch через субагентов (вступает консервативная заводская командная политика DSH); включено — внедряется регламент автономной команды и включаются Agent Teams.',
|
|
2877
3179
|
teamsModeLabel: 'Режим Agent Teams',
|
|
@@ -4649,10 +4951,14 @@ window.__ModuleLoader__.load({
|
|
|
4649
4951
|
(values.langConversation !== '' &&
|
|
4650
4952
|
!isCandidate(values.langConversation));
|
|
4651
4953
|
/** Per-field numeric validity: raw text (when present) must be a
|
|
4652
|
-
* whole number at or above the schema minimum. The intent rows
|
|
4954
|
+
* whole number at or above the schema minimum. The trim and intent rows
|
|
4653
4955
|
* share the same raw-text overlay and save gate. */
|
|
4654
4956
|
const numberInvalid = Object.fromEntries(
|
|
4655
|
-
|
|
4957
|
+
[
|
|
4958
|
+
...WM_NUMBER_FIELDS,
|
|
4959
|
+
...TRIM_NUMBER_FIELDS,
|
|
4960
|
+
...INTENT_NUMBER_FIELDS,
|
|
4961
|
+
].map(
|
|
4656
4962
|
({ field, min, max }) => {
|
|
4657
4963
|
const raw = numText[field];
|
|
4658
4964
|
return [
|
|
@@ -4899,6 +5205,11 @@ window.__ModuleLoader__.load({
|
|
|
4899
5205
|
wmDenyMode: values.wmDenyMode,
|
|
4900
5206
|
wmAutoHandover: values.wmAutoHandover,
|
|
4901
5207
|
wmSubagentCap: values.wmSubagentCap,
|
|
5208
|
+
trimMode: values.trimMode,
|
|
5209
|
+
trimEnabled: values.trimEnabled,
|
|
5210
|
+
...Object.fromEntries(
|
|
5211
|
+
TRIM_NUMBER_FIELDS.map(({ field }) => [field, values[field]]),
|
|
5212
|
+
),
|
|
4902
5213
|
teamsMode: values.teamsMode,
|
|
4903
5214
|
syncWhitelist: values.syncWhitelist,
|
|
4904
5215
|
// Intent recognition (design: intent-routing.md §2): route
|
|
@@ -5146,6 +5457,8 @@ window.__ModuleLoader__.load({
|
|
|
5146
5457
|
const teamsId = `${headingId}-teams`;
|
|
5147
5458
|
// ---- intent section id ----
|
|
5148
5459
|
const intentId = `${headingId}-intent`;
|
|
5460
|
+
// ---- trim section id ----
|
|
5461
|
+
const trimId = `${headingId}-trim`;
|
|
5149
5462
|
|
|
5150
5463
|
/** One watermark number input: raw-text overlay over the draft
|
|
5151
5464
|
* value (0 renders as the placeholder for the follow-force row),
|
|
@@ -5225,6 +5538,38 @@ window.__ModuleLoader__.load({
|
|
|
5225
5538
|
numberInvalid[spec.field]
|
|
5226
5539
|
? [{ text: t('wmNumberInvalid', { min: spec.min }), invalid: true }]
|
|
5227
5540
|
: [];
|
|
5541
|
+
/** One trim number input: the watermark rows' raw-text overlay
|
|
5542
|
+
* pattern under the trim section id (invalid text shows the
|
|
5543
|
+
* shared minimum hint and blocks saving via `invalid`). */
|
|
5544
|
+
const trimNumberControl = (spec) => {
|
|
5545
|
+
const { field } = spec;
|
|
5546
|
+
const shown = numText[field] ?? String(values[field]);
|
|
5547
|
+
return h('input', {
|
|
5548
|
+
type: 'text',
|
|
5549
|
+
inputMode: 'numeric',
|
|
5550
|
+
id: `${trimId}-${field}`,
|
|
5551
|
+
value: shown,
|
|
5552
|
+
onChange: (event) => {
|
|
5553
|
+
editNumber(field, event.target.value);
|
|
5554
|
+
},
|
|
5555
|
+
onBlur: blurNumber(field),
|
|
5556
|
+
disabled: !editable,
|
|
5557
|
+
'aria-label': t(TRIM_ROW_KEYS[field].label),
|
|
5558
|
+
style: numberInvalid[field]
|
|
5559
|
+
? {
|
|
5560
|
+
...STYLE.control,
|
|
5561
|
+
borderColor: 'var(--dsw-alias-state-error-primary)',
|
|
5562
|
+
color: 'var(--dsw-alias-state-error-primary)',
|
|
5563
|
+
}
|
|
5564
|
+
: STYLE.control,
|
|
5565
|
+
});
|
|
5566
|
+
};
|
|
5567
|
+
|
|
5568
|
+
/** Status lines under one trim number row: minimum hint. */
|
|
5569
|
+
const trimNumberLines = (spec) =>
|
|
5570
|
+
numberInvalid[spec.field]
|
|
5571
|
+
? [{ text: t('wmNumberInvalid', { min: spec.min }), invalid: true }]
|
|
5572
|
+
: [];
|
|
5228
5573
|
|
|
5229
5574
|
/** Intent option sets fed by the DSH model catalog (the same
|
|
5230
5575
|
* source the shipped model-selection page uses). A stored
|
|
@@ -6265,6 +6610,58 @@ window.__ModuleLoader__.load({
|
|
|
6265
6610
|
),
|
|
6266
6611
|
}),
|
|
6267
6612
|
),
|
|
6613
|
+
h('h4', { style: STYLE.subheading }, t('trimSectionTitle')),
|
|
6614
|
+
h(
|
|
6615
|
+
'div',
|
|
6616
|
+
{ style: STYLE.rows },
|
|
6617
|
+
h(SettingsRow, {
|
|
6618
|
+
key: 'trimMode',
|
|
6619
|
+
id: `${trimId}-mode`,
|
|
6620
|
+
label: t('trimModeLabel'),
|
|
6621
|
+
help: t('trimModeHelp'),
|
|
6622
|
+
control: h(
|
|
6623
|
+
'select',
|
|
6624
|
+
selectProps(`${trimId}-mode`, values.trimMode, (mode) => {
|
|
6625
|
+
if (TRIM_MODES.includes(mode)) edit('trimMode', mode);
|
|
6626
|
+
}),
|
|
6627
|
+
...TRIM_MODES.map((mode) =>
|
|
6628
|
+
h(
|
|
6629
|
+
'option',
|
|
6630
|
+
{ key: mode, value: mode },
|
|
6631
|
+
t(`trimMode${mode[0].toUpperCase()}${mode.slice(1)}`),
|
|
6632
|
+
),
|
|
6633
|
+
),
|
|
6634
|
+
),
|
|
6635
|
+
lines: [],
|
|
6636
|
+
}),
|
|
6637
|
+
h(SettingsRow, {
|
|
6638
|
+
key: 'trimEnabled',
|
|
6639
|
+
id: `${trimId}-enabled`,
|
|
6640
|
+
label: t('trimEnabledLabel'),
|
|
6641
|
+
help: t('trimEnabledHelp'),
|
|
6642
|
+
control: h('input', {
|
|
6643
|
+
type: 'checkbox',
|
|
6644
|
+
id: `${trimId}-enabled`,
|
|
6645
|
+
checked: values.trimEnabled,
|
|
6646
|
+
onChange: () => {
|
|
6647
|
+
edit('trimEnabled', !values.trimEnabled);
|
|
6648
|
+
},
|
|
6649
|
+
disabled: !editable,
|
|
6650
|
+
style: STYLE.checkbox,
|
|
6651
|
+
}),
|
|
6652
|
+
lines: [],
|
|
6653
|
+
}),
|
|
6654
|
+
...TRIM_NUMBER_FIELDS.map((spec) =>
|
|
6655
|
+
h(SettingsRow, {
|
|
6656
|
+
key: spec.field,
|
|
6657
|
+
id: `${trimId}-${spec.field}`,
|
|
6658
|
+
label: t(TRIM_ROW_KEYS[spec.field].label),
|
|
6659
|
+
help: t(TRIM_ROW_KEYS[spec.field].help),
|
|
6660
|
+
control: trimNumberControl(spec),
|
|
6661
|
+
lines: trimNumberLines(spec),
|
|
6662
|
+
}),
|
|
6663
|
+
),
|
|
6664
|
+
),
|
|
6268
6665
|
h('p', { style: STYLE.progress }, t('wmCommands')),
|
|
6269
6666
|
),
|
|
6270
6667
|
h(
|
package/cordis.patch.yml
CHANGED
|
@@ -168,6 +168,14 @@
|
|
|
168
168
|
config:
|
|
169
169
|
- id: compaction-basic
|
|
170
170
|
name: '@deepseek-ai/dsh-compaction-basic'
|
|
171
|
+
# Compaction arbitration (option A): auto=false disables ONLY the
|
|
172
|
+
# engine's automatic triggers (pre-step pressure + overflow
|
|
173
|
+
# retry). The compaction service stays mounted, so manual /compact
|
|
174
|
+
# and the context-watch handover borrow keep working (compactNow
|
|
175
|
+
# never consults this flag). scripts/validate.mjs carries a drift
|
|
176
|
+
# guard for the shipped auto gate.
|
|
177
|
+
config:
|
|
178
|
+
auto: false
|
|
171
179
|
- id: command-compact
|
|
172
180
|
name: '@deepseek-ai/dsh-command-compact'
|
|
173
181
|
- id: tool-result-pruner
|
|
@@ -298,6 +306,14 @@
|
|
|
298
306
|
config:
|
|
299
307
|
- id: compaction-basic
|
|
300
308
|
name: '@deepseek-ai/dsh-compaction-basic'
|
|
309
|
+
# Compaction arbitration (option A): auto=false disables ONLY the
|
|
310
|
+
# engine's automatic triggers (pre-step pressure + overflow
|
|
311
|
+
# retry). The compaction service stays mounted, so manual /compact
|
|
312
|
+
# and the context-watch handover borrow keep working (compactNow
|
|
313
|
+
# never consults this flag). scripts/validate.mjs carries a drift
|
|
314
|
+
# guard for the shipped auto gate.
|
|
315
|
+
config:
|
|
316
|
+
auto: false
|
|
301
317
|
- id: command-compact
|
|
302
318
|
name: '@deepseek-ai/dsh-command-compact'
|
|
303
319
|
- id: tool-result-pruner
|
|
@@ -399,6 +415,14 @@
|
|
|
399
415
|
config:
|
|
400
416
|
- id: compaction-basic
|
|
401
417
|
name: '@deepseek-ai/dsh-compaction-basic'
|
|
418
|
+
# Compaction arbitration (option A): auto=false disables ONLY the
|
|
419
|
+
# engine's automatic triggers (pre-step pressure + overflow
|
|
420
|
+
# retry). The compaction service stays mounted, so manual /compact
|
|
421
|
+
# and the context-watch handover borrow keep working (compactNow
|
|
422
|
+
# never consults this flag). scripts/validate.mjs carries a drift
|
|
423
|
+
# guard for the shipped auto gate.
|
|
424
|
+
config:
|
|
425
|
+
auto: false
|
|
402
426
|
- id: command-compact
|
|
403
427
|
name: '@deepseek-ai/dsh-command-compact'
|
|
404
428
|
- id: persistent-shell
|
|
@@ -520,6 +544,14 @@
|
|
|
520
544
|
config:
|
|
521
545
|
- id: compaction-basic
|
|
522
546
|
name: '@deepseek-ai/dsh-compaction-basic'
|
|
547
|
+
# Compaction arbitration (option A): auto=false disables ONLY the
|
|
548
|
+
# engine's automatic triggers (pre-step pressure + overflow
|
|
549
|
+
# retry). The compaction service stays mounted, so manual /compact
|
|
550
|
+
# and the context-watch handover borrow keep working (compactNow
|
|
551
|
+
# never consults this flag). scripts/validate.mjs carries a drift
|
|
552
|
+
# guard for the shipped auto gate.
|
|
553
|
+
config:
|
|
554
|
+
auto: false
|
|
523
555
|
- id: command-compact
|
|
524
556
|
name: '@deepseek-ai/dsh-command-compact'
|
|
525
557
|
- id: tool-result-pruner
|
package/host/config.js
CHANGED
|
@@ -221,6 +221,46 @@ export const Config = z.object({
|
|
|
221
221
|
/** Optional last-resort route when the classifier fails and no previous
|
|
222
222
|
* routed model exists; empty = the first candidate. */
|
|
223
223
|
intentFallbackRoute: IntentRouteSchema.default({ provider: "", model: "" }).volatile(),
|
|
224
|
+
|
|
225
|
+
// --- Context trim: fully-automatic conversation compression ------------
|
|
226
|
+
/** Master switch for the context-trim layer (design:
|
|
227
|
+
* .dsh-switchman/analysis/context-trim-port-design.md). OFF disables
|
|
228
|
+
* view folding AND metrics sampling entirely; the llm/stream listener
|
|
229
|
+
* degrades to a pure pass-through. */
|
|
230
|
+
trimEnabled: z.boolean().default(true).volatile(),
|
|
231
|
+
/** Automation level: "off" = measure only (no banner, no folds),
|
|
232
|
+
* "advisory" = expose ctx_trim_fold/ctx_trim_status + the protocol head
|
|
233
|
+
* so the session model can fold itself, "auto" = everything plus
|
|
234
|
+
* idle-boundary automatic folds (growth gate / pressure / emergency). */
|
|
235
|
+
trimMode: z.union(["off", "advisory", "auto"]).default("auto").volatile(),
|
|
236
|
+
/** Growth gate (tier a): fold when the outbound-view estimate grew this
|
|
237
|
+
* much since the last fold. */
|
|
238
|
+
trimGrowthTokens: z.number().min(1000).default(22500).volatile(),
|
|
239
|
+
/** Growth gate companion: the contiguous compressible increment must
|
|
240
|
+
* also reach this many estimated tokens (chars/4 heuristic). */
|
|
241
|
+
trimIncrementTokens: z.number().min(1000).default(50000).volatile(),
|
|
242
|
+
/** Pressure tier (tier b): fold when view usage reaches this percent of
|
|
243
|
+
* the context window (requires a resolvable window; otherwise skipped). */
|
|
244
|
+
trimPressurePercent: z.number().min(1).max(100).default(60).volatile(),
|
|
245
|
+
/** Emergency tier (tier c): forced MECHANICAL fold (no side-model call)
|
|
246
|
+
* at this percent of the window; cooldown-gated. */
|
|
247
|
+
trimEmergencyPercent: z.number().min(1).max(100).default(95).volatile(),
|
|
248
|
+
/** Effective-window cap for the tier math: tier points are computed
|
|
249
|
+
* against min(model-resolved window, cap). 0 = auto (cap follows
|
|
250
|
+
* wmForceTokens, so folds always fire ahead of the handover tier). */
|
|
251
|
+
trimWindowTokens: z.number().min(0).default(0).volatile(),
|
|
252
|
+
/** Last N messages of a history are never folded (the live tail the
|
|
253
|
+
* next model call reasons over). */
|
|
254
|
+
trimProtectedTail: z.number().min(0).max(100).default(6).volatile(),
|
|
255
|
+
/** Side-model fold cadence cap per rolling hour (emergency mechanical
|
|
256
|
+
* folds are exempt; they have their own cooldown). */
|
|
257
|
+
trimMaxFoldsPerHour: z.number().min(1).max(60).default(6).volatile(),
|
|
258
|
+
/** Route for the side-model summarizer (L3). Empty = inherit the
|
|
259
|
+
* session's current model. */
|
|
260
|
+
trimSideModel: IntentRouteSchema.default({ provider: "", model: "" }).volatile(),
|
|
261
|
+
/** Explicit ledger state directory. Empty = <dshHome>/.dsh-switchman/
|
|
262
|
+
* state/trim/. */
|
|
263
|
+
trimStateDir: z.string().default("").volatile(),
|
|
224
264
|
});
|
|
225
265
|
|
|
226
266
|
/** The six dispatch lanes, in display order. */
|