dsh-switchman 1.8.1 → 1.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -659,11 +714,11 @@ window.__ModuleLoader__.load({
659
714
  badgeTip:
660
715
  'dsh-switchman:四个内置预设(standard / ptc / minimal / cordis)已注入自主智能体团队调度规程',
661
716
  handoverActive: '交接进行中',
662
- handoverPhaseBackup: '备份会话',
717
+ handoverPhaseBackup: '写入交接文档',
663
718
  handoverPhaseCompacting: '压缩上下文',
664
719
  handoverPhaseContinuation: '唤醒续接',
665
720
  handoverActiveTip:
666
- 'Switchman 正在后台交接:fork 备份会话并压缩上下文,完成后自动继续任务;期间会话静止属正常现象。',
721
+ 'Switchman 正在后台交接:写入交接文档并压缩上下文,完成后自动继续任务;期间会话静止属正常现象。',
667
722
  visionHintNeedsPool:
668
723
  '当前模型不支持读图:请在 dsh-switchman 设置中配置「视觉池」模型,之后用 /vision 发送图片。',
669
724
  visionHintUseVision:
@@ -770,7 +825,7 @@ window.__ModuleLoader__.load({
770
825
  wmHardLabel: '硬水位(hard)',
771
826
  wmHardHelp: '达到后读取预算收紧,并建议收尾当前工作。',
772
827
  wmForceLabel: '强制水位(force)',
773
- wmForceHelp: '达到后建议备份并移交压缩(可设为自动)。',
828
+ wmForceHelp: '达到后建议写交接文档并压缩(可设为自动)。',
774
829
  wmReadBudgetLabel: '单次读取预算',
775
830
  wmReadBudgetHelp: '每次读取的 token 预算;每轮上限为其两倍。',
776
831
  wmNumberInvalid: '请输入不小于 {min} 的整数。',
@@ -781,7 +836,7 @@ window.__ModuleLoader__.load({
781
836
  wmDenyModeHelpCap: '超出读预算的调用放行,但记录警示。',
782
837
  wmDenyModeHelpDeny: '超出读预算的调用直接拒绝。',
783
838
  wmAutoHandoverLabel: '自动交接',
784
- wmAutoHandoverHelp: '达到强制水位时自动备份并移交压缩,无需手动确认。',
839
+ wmAutoHandoverHelp: '达到强制水位时自动写交接文档并压缩,无需手动确认。',
785
840
  wmSubagentTitle: '子智能体',
786
841
  wmSubagentCapLabel: '子智能体上下文上限',
787
842
  wmSubagentCapHelp:
@@ -791,7 +846,26 @@ window.__ModuleLoader__.load({
791
846
  '仅覆盖子智能体的 force 档(soft/hard 与主会话共用);0 = 跟随上方强制水位。',
792
847
  wmSubagentFollowForce: '跟随 force 档(0)',
793
848
  wmCommands:
794
- '命令:/ctx-pause 暂停水位干预 · /ctx-resume 恢复干预 · /ctx-handover 立即备份并交接压缩。',
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。',
@@ -879,11 +953,11 @@ window.__ModuleLoader__.load({
879
953
  badgeTip:
880
954
  'dsh-switchman: the four built-in presets (standard / ptc / minimal / cordis) carry the autonomous Agent Teams doctrine',
881
955
  handoverActive: 'Handover in progress',
882
- handoverPhaseBackup: 'forking backup',
956
+ handoverPhaseBackup: 'writing handover doc',
883
957
  handoverPhaseCompacting: 'compacting context',
884
958
  handoverPhaseContinuation: 'waking continuation',
885
959
  handoverActiveTip:
886
- 'Switchman is handing over in the background: forking a backup session and compacting context; the task continues automatically when done. A still session during this window is expected.',
960
+ 'Switchman is handing over in the background: writing the handover document and compacting context; the task continues automatically when done. A still session during this window is expected.',
887
961
  visionHintNeedsPool:
888
962
  'This model cannot read images: add vision-pool models in the dsh-switchman settings, then send images with /vision.',
889
963
  visionHintUseVision:
@@ -991,7 +1065,7 @@ window.__ModuleLoader__.load({
991
1065
  wmHardLabel: 'Hard watermark',
992
1066
  wmHardHelp: 'Past this, the read budget tightens and wrapping up is advised.',
993
1067
  wmForceLabel: 'Force watermark',
994
- wmForceHelp: 'Past this, back up and hand over to compaction (can be automatic).',
1068
+ wmForceHelp: 'Past this, write the handover doc and compact (can be automatic).',
995
1069
  wmReadBudgetLabel: 'Read budget',
996
1070
  wmReadBudgetHelp: 'Token budget per read; each round caps at twice this.',
997
1071
  wmNumberInvalid: 'Enter a whole number of {min} or more.',
@@ -1002,7 +1076,7 @@ window.__ModuleLoader__.load({
1002
1076
  wmDenyModeHelpCap: 'Over-budget calls pass, but a warning is recorded.',
1003
1077
  wmDenyModeHelpDeny: 'Over-budget calls are denied outright.',
1004
1078
  wmAutoHandoverLabel: 'Automatic handover',
1005
- wmAutoHandoverHelp: 'At the force watermark, back up and hand over to compaction automatically.',
1079
+ wmAutoHandoverHelp: 'At the force watermark, write the handover doc and compact automatically.',
1006
1080
  wmSubagentTitle: 'Subagents',
1007
1081
  wmSubagentCapLabel: 'Subagent context cap',
1008
1082
  wmSubagentCapHelp:
@@ -1012,7 +1086,29 @@ window.__ModuleLoader__.load({
1012
1086
  'Overrides only the subagent force tier (soft/hard are shared with the main session); 0 follows the force watermark above.',
1013
1087
  wmSubagentFollowForce: 'Follow the force tier (0)',
1014
1088
  wmCommands:
1015
- 'Commands: /ctx-pause suspends watermark actions · /ctx-resume resumes them · /ctx-handover backs up and hands over now.',
1089
+ 'Commands: /ctx-pause suspends watermark actions · /ctx-resume resumes them · /ctx-handover writes the handover doc and compacts 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.",
@@ -1117,10 +1213,10 @@ window.__ModuleLoader__.load({
1117
1213
  badge: '自主團隊',
1118
1214
  badgeTip: 'dsh-switchman:四個內建預設(standard / ptc / minimal / cordis)已注入自主智能體團隊調度規程',
1119
1215
  handoverActive: '交接進行中',
1120
- handoverPhaseBackup: '備份會話',
1216
+ handoverPhaseBackup: '寫入交接文件',
1121
1217
  handoverPhaseCompacting: '壓縮上下文',
1122
1218
  handoverPhaseContinuation: '喚醒續接',
1123
- handoverActiveTip: 'Switchman 正在背景交接:fork 備份會話並壓縮上下文,完成後自動繼續任務;期間會話靜止屬正常現象。',
1219
+ handoverActiveTip: 'Switchman 正在背景交接:寫入交接文件並壓縮上下文,完成後自動繼續任務;期間會話靜止屬正常現象。',
1124
1220
  visionHintNeedsPool: '目前模型不支援讀圖:請在 dsh-switchman 設定中配置多模態池模型,之後用 /vision 傳送圖片。',
1125
1221
  visionHintUseVision: '目前模型不支援讀圖:圖片請用 /vision 傳送(將自動派發多模態池讀取)。',
1126
1222
  visionAutoConverted: '圖片直傳被拒:已自動改用 /vision 重送(由多模態池讀取)。',
@@ -1215,7 +1311,7 @@ window.__ModuleLoader__.load({
1215
1311
  wmHardLabel: '硬水位(hard)',
1216
1312
  wmHardHelp: '達到後讀取預算收緊,並建議收尾目前工作。',
1217
1313
  wmForceLabel: '強制水位(force)',
1218
- wmForceHelp: '達到後建議備份並移交壓縮(可設為自動)。',
1314
+ wmForceHelp: '達到後建議寫交接文件並壓縮(可設為自動)。',
1219
1315
  wmReadBudgetLabel: '單次讀取預算',
1220
1316
  wmReadBudgetHelp: '每次讀取的 token 預算;每輪上限為其兩倍。',
1221
1317
  wmNumberInvalid: '請輸入不小於 {min} 的整數。',
@@ -1226,14 +1322,33 @@ window.__ModuleLoader__.load({
1226
1322
  wmDenyModeHelpCap: '超出讀取預算的呼叫放行,但記錄警示。',
1227
1323
  wmDenyModeHelpDeny: '超出讀取預算的呼叫直接拒絕。',
1228
1324
  wmAutoHandoverLabel: '自動交接',
1229
- wmAutoHandoverHelp: '達到強制水位時自動備份並移交壓縮,無需手動確認。',
1325
+ wmAutoHandoverHelp: '達到強制水位時自動寫交接文件並壓縮,無需手動確認。',
1230
1326
  wmSubagentTitle: '子智能體',
1231
1327
  wmSubagentCapLabel: '子智能體上下文上限',
1232
1328
  wmSubagentCapHelp: '開啟後子智能體可用下方獨立強制閾值;關閉則完全跟隨上方三檔水位。',
1233
1329
  wmSubagentForceLabel: '子智能體強制閾值',
1234
1330
  wmSubagentForceHelp: '僅覆蓋子智能體的 force 檔(soft/hard 與主會話共用);0 = 跟隨上方強制水位。',
1235
1331
  wmSubagentFollowForce: '跟隨 force 檔(0)',
1236
- wmCommands: '命令:/ctx-pause 暫停水位干預 · /ctx-resume 恢復干預 · /ctx-handover 立即備份並交接壓縮。',
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: '智能體團隊模式',
@@ -1317,10 +1432,10 @@ window.__ModuleLoader__.load({
1317
1432
  badge: '自律チーム',
1318
1433
  badgeTip: 'dsh-switchman:内蔵の 4 プリセット(standard / ptc / minimal / cordis)には自律エージェントチームのディスパッチ規律が注入済み',
1319
1434
  handoverActive: 'ハンドオーバー進行中',
1320
- handoverPhaseBackup: 'バックアップ作成中',
1435
+ handoverPhaseBackup: '引き継ぎ文書を作成中',
1321
1436
  handoverPhaseCompacting: 'コンテキスト圧縮中',
1322
1437
  handoverPhaseContinuation: '継続セッション起動中',
1323
- handoverActiveTip: 'Switchman がバックグラウンドでハンドオーバー中です:セッションを fork してバックアップし、コンテキストを圧縮します。完了するとタスクは自動的に再開します。この間セッションが静止するのは正常です。',
1438
+ handoverActiveTip: 'Switchman がバックグラウンドでハンドオーバー中です:引き継ぎ文書を書き込み、コンテキストを圧縮します。完了するとタスクは自動的に再開します。この間セッションが静止するのは正常です。',
1324
1439
  visionHintNeedsPool: 'このモデルは画像を読めません:dsh-switchman の設定でマルチモーダルプールのモデルを追加し、画像は /vision で送信してください。',
1325
1440
  visionHintUseVision: 'このモデルは画像を読めません:画像は /vision で送ってください(自動的にマルチモーダルプールへルーティングされます)。',
1326
1441
  visionAutoConverted: '画像の直接送信は拒否されました:自動的に /vision で再送信します(マルチモーダルプールが読み取ります)。',
@@ -1415,7 +1530,7 @@ window.__ModuleLoader__.load({
1415
1530
  wmHardLabel: 'ハード水位(hard)',
1416
1531
  wmHardHelp: '超えると読み取り予算が引き締められ、仕事の締めくくりが推奨されます。',
1417
1532
  wmForceLabel: '強制水位(force)',
1418
- wmForceHelp: '超えるとバックアップと圧縮へのハンドオーバーが推奨されます(自動化可能)。',
1533
+ wmForceHelp: '超えると引き継ぎ文書の作成と圧縮が推奨されます(自動化可能)。',
1419
1534
  wmReadBudgetLabel: '読み取り予算',
1420
1535
  wmReadBudgetHelp: '1 回の読み取りあたりの token 予算です。各ラウンドの上限はその 2 倍です。',
1421
1536
  wmNumberInvalid: '{min} 以上の整数を入力してください。',
@@ -1426,14 +1541,37 @@ window.__ModuleLoader__.load({
1426
1541
  wmDenyModeHelpCap: '予算超過の呼び出しは通しますが、警告を記録します。',
1427
1542
  wmDenyModeHelpDeny: '予算超過の呼び出しは即座に拒否します。',
1428
1543
  wmAutoHandoverLabel: '自動ハンドオーバー',
1429
- wmAutoHandoverHelp: '強制水位に達したら、確認なしでバックアップして圧縮へハンドオーバーします。',
1544
+ wmAutoHandoverHelp: '強制水位に達したら、確認なしで引き継ぎ文書を書いて圧縮します。',
1430
1545
  wmSubagentTitle: 'サブエージェント',
1431
1546
  wmSubagentCapLabel: 'サブエージェントのコンテキスト上限',
1432
1547
  wmSubagentCapHelp: 'オンにすると、下の専用強制しきい値を使えます。オフなら上の 3 段階の水位に完全に従います。',
1433
1548
  wmSubagentForceLabel: 'サブエージェント強制しきい値',
1434
1549
  wmSubagentForceHelp: 'サブエージェントの force 段階のみを上書きします(soft/hard はメインセッションと共通)。0 なら上の強制水位に従います。',
1435
1550
  wmSubagentFollowForce: 'force 段階に従う(0)',
1436
- wmCommands: 'コマンド:/ctx-pause で水位アクションを一時停止 · /ctx-resume で再開 · /ctx-handover で今すぐバックアップしてハンドオーバー。',
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: 'エージェントチームモード',
@@ -1521,10 +1659,10 @@ window.__ModuleLoader__.load({
1521
1659
  badge: '자율 팀',
1522
1660
  badgeTip: 'dsh-switchman: 네 가지 내장 프리셋(standard / ptc / minimal / cordis)에 자율 에이전트 팀 디스패치 규율이 주입되어 있습니다',
1523
1661
  handoverActive: '핸드오버 진행 중',
1524
- handoverPhaseBackup: '세션 백업 중',
1662
+ handoverPhaseBackup: '핸드오버 문서 작성 중',
1525
1663
  handoverPhaseCompacting: '컨텍스트 압축 중',
1526
1664
  handoverPhaseContinuation: '후속 세션 깨우는 중',
1527
- handoverActiveTip: 'Switchman이 백그라운드에서 핸드오버 중입니다: 세션을 fork해 백업하고 컨텍스트를 압축하며, 완료되면 작업이 자동으로 이어집니다. 이 동안 세션이 잠시 멈추는 것은 정상입니다.',
1665
+ handoverActiveTip: 'Switchman이 백그라운드에서 핸드오버 중입니다: 핸드오버 문서를 작성하고 컨텍스트를 압축하며, 완료되면 작업이 자동으로 이어집니다. 이 동안 세션이 잠시 멈추는 것은 정상입니다.',
1528
1666
  visionHintNeedsPool: '이 모델은 이미지를 읽을 수 없습니다: dsh-switchman 설정에서 멀티모달 풀 모델을 추가한 뒤, 이미지를 /vision으로 보내 주세요.',
1529
1667
  visionHintUseVision: '이 모델은 이미지를 읽을 수 없습니다: 이미지는 /vision으로 보내 주세요(자동으로 멀티모달 풀로 라우팅됩니다).',
1530
1668
  visionAutoConverted: '이미지 직접 전송이 거부되었습니다: 자동으로 /vision으로 다시 보냅니다(멀티모달 풀이 읽습니다).',
@@ -1619,7 +1757,7 @@ window.__ModuleLoader__.load({
1619
1757
  wmHardLabel: '하드 수위(hard)',
1620
1758
  wmHardHelp: '넘으면 읽기 예산이 줄어들고 작업 마무리를 권장합니다.',
1621
1759
  wmForceLabel: '강제 수위(force)',
1622
- wmForceHelp: '넘으면 백업 후 압축으로 핸드오버를 권장합니다(자동화 가능).',
1760
+ wmForceHelp: '넘으면 핸드오버 문서 작성 후 압축을 권장합니다(자동화 가능).',
1623
1761
  wmReadBudgetLabel: '읽기 예산',
1624
1762
  wmReadBudgetHelp: '한 번 읽기당 토큰 예산입니다. 매 라운드 상한은 그 두 배입니다.',
1625
1763
  wmNumberInvalid: '{min} 이상의 정수를 입력하세요.',
@@ -1630,14 +1768,36 @@ window.__ModuleLoader__.load({
1630
1768
  wmDenyModeHelpCap: '예산 초과 호출은 통과시키지만 경고를 기록합니다.',
1631
1769
  wmDenyModeHelpDeny: '예산 초과 호출은 즉시 거부합니다.',
1632
1770
  wmAutoHandoverLabel: '자동 핸드오버',
1633
- wmAutoHandoverHelp: '강제 수위에 도달하면 확인 없이 백업하고 압축으로 핸드오버합니다.',
1771
+ wmAutoHandoverHelp: '강제 수위에 도달하면 확인 없이 핸드오버 문서를 작성하고 압축합니다.',
1634
1772
  wmSubagentTitle: '서브에이전트',
1635
1773
  wmSubagentCapLabel: '서브에이전트 컨텍스트 상한',
1636
1774
  wmSubagentCapHelp: '켜면 서브에이전트가 아래 전용 강제 임계값을 사용합니다. 끄면 위 세 수위를 그대로 따릅니다.',
1637
1775
  wmSubagentForceLabel: '서브에이전트 강제 임계값',
1638
1776
  wmSubagentForceHelp: '서브에이전트의 force 단계만 덮어씁니다(soft/hard는 메인 세션과 공유). 0이면 위 강제 수위를 따릅니다.',
1639
1777
  wmSubagentFollowForce: 'force 단계 따르기(0)',
1640
- wmCommands: '명령: /ctx-pause 수위 개입 일시 중지 · /ctx-resume 재개 · /ctx-handover 지금 백업하고 핸드오버.',
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: '에이전트 팀 모드',
@@ -1725,10 +1885,10 @@ window.__ModuleLoader__.load({
1725
1885
  badge: 'Autonomes Team',
1726
1886
  badgeTip: 'dsh-switchman: Die vier integrierten Presets (standard / ptc / minimal / cordis) tragen die autonome-Agent-Teams-Doktrin',
1727
1887
  handoverActive: 'Übergabe läuft',
1728
- handoverPhaseBackup: 'Backup wird erstellt',
1888
+ handoverPhaseBackup: 'Übergabedokument wird geschrieben',
1729
1889
  handoverPhaseCompacting: 'Kontext wird komprimiert',
1730
1890
  handoverPhaseContinuation: 'Fortsetzung wird geweckt',
1731
- handoverActiveTip: 'Switchman übergibt gerade im Hintergrund: Eine Backup-Session wird geforkt und der Kontext komprimiert; die Aufgabe läuft danach automatisch weiter. Eine ruhende Session ist in dieser Phase normal.',
1891
+ handoverActiveTip: 'Switchman übergibt gerade im Hintergrund: Ein Übergabedokument wird geschrieben und der Kontext komprimiert; die Aufgabe läuft danach automatisch weiter. Eine ruhende Session ist in dieser Phase normal.',
1732
1892
  visionHintNeedsPool: 'Dieses Modell kann keine Bilder lesen: Fügen Sie in den dsh-switchman-Einstellungen Modelle zum Vision-Pool hinzu und senden Sie Bilder dann mit /vision.',
1733
1893
  visionHintUseVision: 'Dieses Modell kann keine Bilder lesen: Senden Sie Bilder mit /vision (automatisch an den Vision-Pool geleitet).',
1734
1894
  visionAutoConverted: 'Direkter Bildversand wurde abgelehnt: Er wird automatisch über /vision erneut gesendet (vom Vision-Pool gelesen).',
@@ -1823,7 +1983,7 @@ window.__ModuleLoader__.load({
1823
1983
  wmHardLabel: 'Harter Wasserstand (hard)',
1824
1984
  wmHardHelp: 'Danach strafft sich das Lese-Budget, und ein Abschluss wird empfohlen.',
1825
1985
  wmForceLabel: 'Erzwungener Wasserstand (force)',
1826
- wmForceHelp: 'Danach Backup erstellen und an die Komprimierung übergeben (automatisch möglich).',
1986
+ wmForceHelp: 'Danach Übergabedokument schreiben und komprimieren (automatisch möglich).',
1827
1987
  wmReadBudgetLabel: 'Lese-Budget',
1828
1988
  wmReadBudgetHelp: 'Token-Budget pro Lesevorgang; jede Runde ist auf das Doppelte gedeckelt.',
1829
1989
  wmNumberInvalid: 'Geben Sie eine ganze Zahl von mindestens {min} ein.',
@@ -1834,14 +1994,37 @@ window.__ModuleLoader__.load({
1834
1994
  wmDenyModeHelpCap: 'Über-Budget-Aufrufe laufen durch, aber eine Warnung wird protokolliert.',
1835
1995
  wmDenyModeHelpDeny: 'Über-Budget-Aufrufe werden direkt abgelehnt.',
1836
1996
  wmAutoHandoverLabel: 'Automatische Übergabe',
1837
- wmAutoHandoverHelp: 'Beim erzwungenen Wasserstand automatisch sichern und an die Komprimierung übergeben.',
1997
+ wmAutoHandoverHelp: 'Beim erzwungenen Wasserstand automatisch Übergabedokument schreiben und komprimieren.',
1838
1998
  wmSubagentTitle: 'Subagents',
1839
1999
  wmSubagentCapLabel: 'Kontext-Deckel für Subagents',
1840
2000
  wmSubagentCapHelp: 'Subagents dürfen die eigene erzwungene Schwelle unten nutzen; aus = vollständig den drei Stufen oben folgen.',
1841
2001
  wmSubagentForceLabel: 'Erzwungene Schwelle für Subagents',
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
- wmCommands: 'Befehle: /ctx-pause pausiert Wasserstand-Aktionen · /ctx-resume setzt sie fort · /ctx-handover sichert jetzt und übergibt sofort.',
2004
+ wmCommands: 'Befehle: /ctx-pause pausiert Wasserstand-Aktionen · /ctx-resume setzt sie fort · /ctx-handover schreibt das Übergabedokument jetzt und komprimiert 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',
@@ -1931,10 +2114,10 @@ window.__ModuleLoader__.load({
1931
2114
  badge: 'Equipo autónomo',
1932
2115
  badgeTip: 'dsh-switchman: los cuatro preajustes integrados (standard / ptc / minimal / cordis) incorporan la doctrina de equipos de agentes autónomos',
1933
2116
  handoverActive: 'Traspaso en curso',
1934
- handoverPhaseBackup: 'creando copia de seguridad',
2117
+ handoverPhaseBackup: 'escribiendo documento de traspaso',
1935
2118
  handoverPhaseCompacting: 'compactando contexto',
1936
2119
  handoverPhaseContinuation: 'despertando continuación',
1937
- handoverActiveTip: 'Switchman está realizando el traspaso en segundo plano: crea un fork de la sesión de respaldo y compacta el contexto; la tarea continúa automáticamente al terminar. Es normal que la sesión quede quieta durante este intervalo.',
2120
+ handoverActiveTip: 'Switchman está realizando el traspaso en segundo plano: escribe el documento de traspaso y compacta el contexto; la tarea continúa automáticamente al terminar. Es normal que la sesión quede quieta durante este intervalo.',
1938
2121
  visionHintNeedsPool: 'Este modelo no puede leer imágenes: añade modelos del grupo de visión en los ajustes de dsh-switchman y envía las imágenes con /vision.',
1939
2122
  visionHintUseVision: 'Este modelo no puede leer imágenes: envíalas con /vision (se enrutan automáticamente al grupo de visión).',
1940
2123
  visionAutoConverted: 'El envío directo de la imagen fue rechazado: se reenvía automáticamente vía /vision (lo lee el grupo de visión).',
@@ -2029,7 +2212,7 @@ window.__ModuleLoader__.load({
2029
2212
  wmHardLabel: 'Nivel duro (hard)',
2030
2213
  wmHardHelp: 'Al superarlo se ajusta el presupuesto de lectura y se recomienda cerrar el trabajo.',
2031
2214
  wmForceLabel: 'Nivel forzado (force)',
2032
- wmForceHelp: 'Al superarlo, haz copia de seguridad y traspasa a la compactación (puede ser automático).',
2215
+ wmForceHelp: 'Al superarlo, escribe el documento de traspaso y compacta (puede ser automático).',
2033
2216
  wmReadBudgetLabel: 'Presupuesto de lectura',
2034
2217
  wmReadBudgetHelp: 'Presupuesto de tokens por lectura; cada ronda se limita al doble.',
2035
2218
  wmNumberInvalid: 'Introduce un número entero de {min} o más.',
@@ -2040,14 +2223,38 @@ window.__ModuleLoader__.load({
2040
2223
  wmDenyModeHelpCap: 'Las llamadas sobre el presupuesto pasan, pero se registra un aviso.',
2041
2224
  wmDenyModeHelpDeny: 'Las llamadas sobre el presupuesto se rechazan directamente.',
2042
2225
  wmAutoHandoverLabel: 'Traspaso automático',
2043
- wmAutoHandoverHelp: 'En el nivel forzado, hace copia de seguridad y traspasa a la compactación automáticamente.',
2226
+ wmAutoHandoverHelp: 'En el nivel forzado, escribe el documento de traspaso y compacta automáticamente.',
2044
2227
  wmSubagentTitle: 'Subagentes',
2045
2228
  wmSubagentCapLabel: 'Tope de contexto de subagentes',
2046
2229
  wmSubagentCapHelp: 'Permite que los subagentes usen el umbral forzado propio de abajo; desactivado = seguir por completo los tres niveles de arriba.',
2047
2230
  wmSubagentForceLabel: 'Umbral forzado de subagentes',
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
- wmCommands: 'Comandos: /ctx-pause suspende las acciones del nivel · /ctx-resume las reanuda · /ctx-handover hace copia y traspasa ahora.',
2233
+ wmCommands: 'Comandos: /ctx-pause suspende las acciones del nivel · /ctx-resume las reanuda · /ctx-handover escribe el documento y compacta 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',
@@ -2137,10 +2344,10 @@ window.__ModuleLoader__.load({
2137
2344
  badge: 'Équipe autonome',
2138
2345
  badgeTip: 'dsh-switchman : les quatre préréglages intégrés (standard / ptc / minimal / cordis) embarquent la doctrine d’équipe autonome des Agent Teams',
2139
2346
  handoverActive: 'Remise en cours',
2140
- handoverPhaseBackup: 'sauvegarde de la session',
2347
+ handoverPhaseBackup: 'écriture du document de remise',
2141
2348
  handoverPhaseCompacting: 'compactage du contexte',
2142
2349
  handoverPhaseContinuation: 'réveil de la continuation',
2143
- handoverActiveTip: 'Switchman effectue la remise en arrière-plan : fork d’une session de sauvegarde et compactage du contexte ; la tâche se poursuit automatiquement une fois terminée. Une session immobile pendant cette fenêtre est normale.',
2350
+ handoverActiveTip: 'Switchman effectue la remise en arrière-plan : écriture du document de remise et compactage du contexte ; la tâche se poursuit automatiquement une fois terminée. Une session immobile pendant cette fenêtre est normale.',
2144
2351
  visionHintNeedsPool: 'Ce modèle ne sait pas lire les images : ajoutez des modèles au pool multimodal dans les réglages dsh-switchman, puis envoyez les images avec /vision.',
2145
2352
  visionHintUseVision: 'Ce modèle ne sait pas lire les images : envoyez-les avec /vision (routage automatique vers le pool multimodal).',
2146
2353
  visionAutoConverted: 'Envoi d’image refusé : renvoi automatique via /vision (lecture par le pool multimodal).',
@@ -2235,7 +2442,7 @@ window.__ModuleLoader__.load({
2235
2442
  wmHardLabel: 'Ligne d’eau hard',
2236
2443
  wmHardHelp: 'Au-delà, le budget de lecture se resserre et il est conseillé de conclure.',
2237
2444
  wmForceLabel: 'Ligne d’eau force',
2238
- wmForceHelp: 'Au-delà, sauvegardez et remettez à la compaction (peut être automatique).',
2445
+ wmForceHelp: 'Au-delà, écrivez le document de remise et compactez (peut être automatique).',
2239
2446
  wmReadBudgetLabel: 'Budget de lecture',
2240
2447
  wmReadBudgetHelp: 'Budget de tokens par lecture ; chaque tour plafonne au double.',
2241
2448
  wmNumberInvalid: 'Saisissez un nombre entier d’au moins {min}.',
@@ -2246,14 +2453,38 @@ window.__ModuleLoader__.load({
2246
2453
  wmDenyModeHelpCap: 'Les appels au-delà du budget passent, mais un avertissement est consigné.',
2247
2454
  wmDenyModeHelpDeny: 'Les appels au-delà du budget sont refusés d’office.',
2248
2455
  wmAutoHandoverLabel: 'Remise automatique',
2249
- wmAutoHandoverHelp: 'À la ligne d’eau force, sauvegarde et remise automatiques à la compaction.',
2456
+ wmAutoHandoverHelp: 'À la ligne d’eau force, écriture du document de remise et compactage automatiques.',
2250
2457
  wmSubagentTitle: 'Subagents',
2251
2458
  wmSubagentCapLabel: 'Plafond de contexte des subagents',
2252
2459
  wmSubagentCapHelp: 'Laisse les subagents utiliser le seuil force dédié ci-dessous ; désactivé = suivent intégralement les trois paliers ci-dessus.',
2253
2460
  wmSubagentForceLabel: 'Seuil force des subagents',
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
- wmCommands: 'Commandes : /ctx-pause suspend les actions de niveau d’eau · /ctx-resume les reprend · /ctx-handover sauvegarde et remet maintenant.',
2463
+ wmCommands: 'Commandes : /ctx-pause suspend les actions de niveau d’eau · /ctx-resume les reprend · /ctx-handover écrit le document et compacte 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',
@@ -2343,10 +2574,10 @@ window.__ModuleLoader__.load({
2343
2574
  badge: 'Squadra autonoma',
2344
2575
  badgeTip: 'dsh-switchman: i quattro preset integrati (standard / ptc / minimal / cordis) portano con sé la dottrina di squadra autonoma degli Agent Teams',
2345
2576
  handoverActive: 'Handover in corso',
2346
- handoverPhaseBackup: 'backup della sessione',
2577
+ handoverPhaseBackup: 'scrittura del documento di handover',
2347
2578
  handoverPhaseCompacting: 'compattazione del contesto',
2348
2579
  handoverPhaseContinuation: 'risveglio della continuazione',
2349
- handoverActiveTip: 'Switchman sta facendo l’handover in background: fork di una sessione di backup e compattazione del contesto; finito quello, il task prosegue da solo. Una sessione ferma in questa finestra è normale.',
2580
+ handoverActiveTip: 'Switchman sta facendo l’handover in background: scrittura del documento di handover e compattazione del contesto; finito quello, il task prosegue da solo. Una sessione ferma in questa finestra è normale.',
2350
2581
  visionHintNeedsPool: 'Questo modello non sa leggere le immagini: aggiungi modelli al pool multimodale nelle impostazioni di dsh-switchman, poi invia le immagini con /vision.',
2351
2582
  visionHintUseVision: 'Questo modello non sa leggere le immagini: inviale con /vision (instradate automaticamente al pool multimodale).',
2352
2583
  visionAutoConverted: 'Invio dell’immagine rifiutato: reinvio automatico via /vision (lettura dal pool multimodale).',
@@ -2441,7 +2672,7 @@ window.__ModuleLoader__.load({
2441
2672
  wmHardLabel: 'Soglia hard',
2442
2673
  wmHardHelp: 'Superata, il budget di lettura si stringe e conviene chiudere.',
2443
2674
  wmForceLabel: 'Soglia force',
2444
- wmForceHelp: 'Superata, backup e handover alla compattazione (può essere automatico).',
2675
+ wmForceHelp: 'Superata, scrittura del documento di handover e compattazione (può essere automatica).',
2445
2676
  wmReadBudgetLabel: 'Budget di lettura',
2446
2677
  wmReadBudgetHelp: 'Budget di token per lettura; ogni turno arriva al massimo al doppio.',
2447
2678
  wmNumberInvalid: 'Inserisci un numero intero di almeno {min}.',
@@ -2452,14 +2683,38 @@ window.__ModuleLoader__.load({
2452
2683
  wmDenyModeHelpCap: 'Le chiamate oltre budget passano, ma viene registrato un avviso.',
2453
2684
  wmDenyModeHelpDeny: 'Le chiamate oltre budget vengono rifiutate sul posto.',
2454
2685
  wmAutoHandoverLabel: 'Handover automatico',
2455
- wmAutoHandoverHelp: 'Alla soglia force, backup e handover alla compattazione avvengono da soli.',
2686
+ wmAutoHandoverHelp: 'Alla soglia force, scrittura del documento di handover e compattazione avvengono da soli.',
2456
2687
  wmSubagentTitle: 'Subagent',
2457
2688
  wmSubagentCapLabel: 'Tetto di contesto dei subagent',
2458
2689
  wmSubagentCapHelp: 'Lascia i subagent usare la soglia force dedicata qui sotto; spento = seguono appieno le tre soglie sopra.',
2459
2690
  wmSubagentForceLabel: 'Soglia force dei subagent',
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
- wmCommands: 'Comandi: /ctx-pause sospende le azioni da livello dell’acqua · /ctx-resume le riprende · /ctx-handover fa backup e handover subito.',
2693
+ wmCommands: 'Comandi: /ctx-pause sospende le azioni da livello dell’acqua · /ctx-resume le riprende · /ctx-handover scrive il documento e compatta 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',
@@ -2549,10 +2804,10 @@ window.__ModuleLoader__.load({
2549
2804
  badge: 'Equipe autônoma',
2550
2805
  badgeTip: 'dsh-switchman: os quatro presets embutidos (standard / ptc / minimal / cordis) carregam a doutrina de equipe autônoma do Agent Teams',
2551
2806
  handoverActive: 'Handover em andamento',
2552
- handoverPhaseBackup: 'backup da sessão',
2807
+ handoverPhaseBackup: 'escrevendo documento de handover',
2553
2808
  handoverPhaseCompacting: 'compactação do contexto',
2554
2809
  handoverPhaseContinuation: 'despertar da continuação',
2555
- handoverActiveTip: 'O Switchman está fazendo o handover em segundo plano: fork de uma sessão de backup e compactação do contexto; ao terminar, a tarefa continua automaticamente. Uma sessão parada durante essa janela é esperada.',
2810
+ handoverActiveTip: 'O Switchman está fazendo o handover em segundo plano: escrita do documento de handover e compactação do contexto; ao terminar, a tarefa continua automaticamente. Uma sessão parada durante essa janela é esperada.',
2556
2811
  visionHintNeedsPool: 'Este modelo não sabe ler imagens: adicione modelos ao pool multimodal nas configurações do dsh-switchman e depois envie imagens com /vision.',
2557
2812
  visionHintUseVision: 'Este modelo não sabe ler imagens: envie-as com /vision (roteadas automaticamente para o pool multimodal).',
2558
2813
  visionAutoConverted: 'Envio da imagem recusado: reenvio automático via /vision (leitura pelo pool multimodal).',
@@ -2647,7 +2902,7 @@ window.__ModuleLoader__.load({
2647
2902
  wmHardLabel: 'Limiar hard',
2648
2903
  wmHardHelp: 'Além dele, o orçamento de leitura aperta e convém encerrar.',
2649
2904
  wmForceLabel: 'Limiar force',
2650
- wmForceHelp: 'Além dele, backup e handover para a compactação (pode ser automático).',
2905
+ wmForceHelp: 'Além dele, escrita do documento de handover e compactação (pode ser automática).',
2651
2906
  wmReadBudgetLabel: 'Orçamento de leitura',
2652
2907
  wmReadBudgetHelp: 'Orçamento de tokens por leitura; cada turno se limita ao dobro disso.',
2653
2908
  wmNumberInvalid: 'Informe um número inteiro de {min} ou mais.',
@@ -2658,14 +2913,38 @@ window.__ModuleLoader__.load({
2658
2913
  wmDenyModeHelpCap: 'Chamadas acima do orçamento passam, mas um aviso é registrado.',
2659
2914
  wmDenyModeHelpDeny: 'Chamadas acima do orçamento são negadas na hora.',
2660
2915
  wmAutoHandoverLabel: 'Handover automático',
2661
- wmAutoHandoverHelp: 'No limiar force, backup e handover para a compactação acontecem sozinhos.',
2916
+ wmAutoHandoverHelp: 'No limiar force, a escrita do documento de handover e a compactação acontecem sozinhas.',
2662
2917
  wmSubagentTitle: 'Subagents',
2663
2918
  wmSubagentCapLabel: 'Teto de contexto dos subagents',
2664
2919
  wmSubagentCapHelp: 'Deixa os subagents usar o limiar force dedicado abaixo; desligado = seguem integralmente os três limiares acima.',
2665
2920
  wmSubagentForceLabel: 'Limiar force dos subagents',
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
- wmCommands: 'Comandos: /ctx-pause suspende as ações de nível de água · /ctx-resume as retoma · /ctx-handover faz backup e handover agora.',
2923
+ wmCommands: 'Comandos: /ctx-pause suspende as ações de nível de água · /ctx-resume as retoma · /ctx-handover escreve o documento e compacta 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',
@@ -2755,10 +3034,10 @@ window.__ModuleLoader__.load({
2755
3034
  badge: 'Автономная команда',
2756
3035
  badgeTip: 'dsh-switchman: четыре встроенных пресета (standard / ptc / minimal / cordis) несут с собой регламент автономной команды Agent Teams',
2757
3036
  handoverActive: 'Идёт передача',
2758
- handoverPhaseBackup: 'резервная сессия',
3037
+ handoverPhaseBackup: 'запись документа передачи',
2759
3038
  handoverPhaseCompacting: 'сжатие контекста',
2760
3039
  handoverPhaseContinuation: 'пробуждение продолжения',
2761
- handoverActiveTip: 'Switchman передаёт контекст в фоне: форкает резервную сессию и сжимает контекст; по завершении задача продолжается автоматически. Неподвижная сессия в это окно — это нормально.',
3040
+ handoverActiveTip: 'Switchman передаёт контекст в фоне: записывает документ передачи и сжимает контекст; по завершении задача продолжается автоматически. Неподвижная сессия в это окно — это нормально.',
2762
3041
  visionHintNeedsPool: 'Эта модель не умеет читать изображения: добавьте модели в мультимодальный пул в настройках dsh-switchman и отправляйте картинки через /vision.',
2763
3042
  visionHintUseVision: 'Эта модель не умеет читать изображения: отправляйте их через /vision (автоматически уйдут в мультимодальный пул).',
2764
3043
  visionAutoConverted: 'Отправка картинки отклонена: повторная отправка идёт автоматически через /vision (прочитает мультимодальный пул).',
@@ -2853,7 +3132,7 @@ window.__ModuleLoader__.load({
2853
3132
  wmHardLabel: 'Линия hard',
2854
3133
  wmHardHelp: 'Выше неё бюджет чтения урезается и стоит подвигаться к завершению.',
2855
3134
  wmForceLabel: 'Линия force',
2856
- wmForceHelp: 'Выше неё — резервная копия и передача на сжатие (может быть автоматически).',
3135
+ wmForceHelp: 'Выше неё — запись документа передачи и сжатие (может быть автоматически).',
2857
3136
  wmReadBudgetLabel: 'Бюджет чтения',
2858
3137
  wmReadBudgetHelp: 'Бюджет токенов на одно чтение; каждый ход ограничен удвоенным значением.',
2859
3138
  wmNumberInvalid: 'Введите целое число не меньше {min}.',
@@ -2864,14 +3143,37 @@ window.__ModuleLoader__.load({
2864
3143
  wmDenyModeHelpCap: 'Вызовы сверх бюджета проходят, но предупреждение записывается.',
2865
3144
  wmDenyModeHelpDeny: 'Вызовы сверх бюджета отклоняются сразу.',
2866
3145
  wmAutoHandoverLabel: 'Автоматическая передача',
2867
- wmAutoHandoverHelp: 'На линии force — резервная копия и передача на сжатие автоматически.',
3146
+ wmAutoHandoverHelp: 'На линии force — запись документа передачи и сжатие автоматически.',
2868
3147
  wmSubagentTitle: 'Субагенты',
2869
3148
  wmSubagentCapLabel: 'Потолок контекста субагентов',
2870
3149
  wmSubagentCapHelp: 'Субагенты используют отдельный порог force ниже; выключено = полностью следуют трём линиям выше.',
2871
3150
  wmSubagentForceLabel: 'Порог force субагентов',
2872
3151
  wmSubagentForceHelp: 'Меняет только линию force субагентов (soft/hard общие с главной сессией); 0 — следовать линии force выше.',
2873
3152
  wmSubagentFollowForce: 'Следовать линии force (0)',
2874
- wmCommands: 'Команды: /ctx-pause приостанавливает действия по уровню воды · /ctx-resume возобновляет их · /ctx-handover делает резервную копию и передаёт прямо сейчас.',
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',
@@ -3015,7 +3317,7 @@ window.__ModuleLoader__.load({
3015
3317
  );
3016
3318
  // Re-render when the manual interface-locale override changes.
3017
3319
  React.useSyncExternalStore(subscribeUiLocale, () => uiLocaleVersion);
3018
- // Live handover cue: during the fork+compact window the session
3320
+ // Live handover cue: during the handover window the session
3019
3321
  // GUI has no motion of its own, so the badge polls the Host's
3020
3322
  // handover-state route (phases recorded from runHandover's first
3021
3323
  // synchronous line) and flips to an animated status chip. Fast
@@ -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
- [...WM_NUMBER_FIELDS, ...INTENT_NUMBER_FIELDS].map(
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(