dsh-thinking-levels 3.4.4 → 4.0.1

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/lib/client.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":["providerNameStyle","modelRowStyle","labelStyle","providersOf","useSyncExternalStore","useState","useRef","useCallback","useMemo","useSyncExternalStore","useState","useState"],"sources":["../src/client/locales.ts","../src/context-window.ts","../src/client/model-panel.tsx","../src/client/card.tsx","../src/client/family-tab.tsx","../src/client/index.ts"],"sourcesContent":["/** `thinking-levels` client dictionaries (zh / en / ja / ko / fr / de / it / ru / es). */\r\n\r\n/** Dictionary namespace owned by this plugin. */\r\nexport const NS = 'thinking-levels'\r\n\r\n/** Simplified Chinese dictionary (the key-set source of truth). */\r\nexport const zh = {\r\n 'card.title': '思考档位',\r\n 'family.title': '起子插件设置',\r\n 'card.description': '在模型选择器中可选 Auto(mask):按工具调用历史自动在 low / high / max 间调度后提交 API。此处配置默认档位、调度边界与模型能力(档位 → 网关线上值映射)。',\r\n 'card.level': '默认档位',\r\n 'card.level.off': 'off — 关闭思考(仅手动,永不自动选择)',\r\n 'card.level.on': 'on — 开启思考(仅 toggle 型模型;只发 enable_thinking,不发 effort)',\r\n 'card.level.minimal': 'minimal — 最低(极轻任务)',\r\n 'card.level.low': 'low — 低(简单任务,廉价轮保持廉价)',\r\n 'card.level.medium': 'medium — 中',\r\n 'card.level.high': 'high — 高(官方默认)',\r\n 'card.level.xhigh': 'xhigh — 特高',\r\n 'card.level.max': 'max — 最大(重任务)',\r\n 'card.level.auto': 'auto — 按工具历史自动调度(默认)',\r\n 'card.enabled': '启用',\r\n 'card.allowDowngrade': '允许降档(auto 可降至 low)',\r\n 'card.allowUpgrade': '允许升档(auto 可升至 max)',\r\n 'card.unavailable': '设置命名空间不可用:请确认 dsh-thinking-levels 已装配进 profile。',\r\n 'card.readonly': '只读',\r\n 'card.capabilities': '模型能力(llm-pi-ai 自定义提供方)',\r\n 'card.capabilities.hint': '直接读写 llm-pi-ai 配置:勾选档位并填写发送给网关的线上值(例如 high → ultra);off 留空表示不发送。视觉决定图片输入;思考开关决定 enable_thinking 置位;thinkingFormat 决定 wire 序列化格式。',\r\n 'card.capabilities.empty': 'llm-pi-ai 中没有已配置模型的自定义提供方。请先在「设置 → 模型」添加提供方与模型。',\r\n 'card.capabilities.unavailable': 'llm-pi-ai 设置命名空间不可用。',\r\n 'card.capabilities.none': '(无模型)',\r\n 'card.capabilities.search': '搜索模型(名称或 ID)…',\r\n 'card.capabilities.noMatches': '没有匹配的模型',\r\n 'card.capabilities.quickSettings': '一键设置',\r\n 'card.capabilities.presetOfficial': '应用到全部:Off / High / Max(官方 DeepSeek 风格)',\r\n 'card.capabilities.presetGeneric': '应用到全部:Off / Low / Medium / High(通用)',\r\n 'card.capabilities.vendor': '提供方',\r\n 'card.capabilities.developerRole': '网关不支持 developer 角色',\r\n 'card.capabilities.developerRoleHint': '官方兼容开关(dsh ≥ v0.1.0-rc.8):写入路由级 compat.supportsDeveloperRole: false,系统提示词按 system 角色发送,修复 vLLM / SGLang 等网关的 Unexpected message role 400。取消勾选 = 删除该字段、恢复继承。',\r\n 'card.capabilities.expandProvider': '展开提供方',\r\n 'card.capabilities.collapseProvider': '收起提供方',\r\n 'card.capabilities.openModelSettings': '打开模型设置',\r\n 'card.capabilities.closeModelSettings': '收起模型设置',\r\n 'card.capabilities.vision': '视觉模型',\r\n 'card.capabilities.thinking': '思考模型',\r\n 'card.capabilities.supportsEffort': '支持 think effort',\r\n 'card.capabilities.efforts': '思考档位(勾选后填写线上值)',\r\n 'card.capabilities.wirePlaceholder': '线上值,如 ultra',\r\n 'card.capabilities.offPlaceholder': '留空 = 不发送',\r\n 'card.capabilities.atLeastThinking': '至少需要一个思考档位(off 除外)',\r\n 'card.capabilities.applyLevel': '应用此档位',\r\n 'card.capabilities.restoreDefault': '恢复默认档位',\r\n 'card.capabilities.unsaved': '未保存',\r\n 'card.capabilities.saveChanges': '保存更改',\r\n 'card.capabilities.saved': '已保存',\r\n 'card.capabilities.thinkingFormat': '思考格式',\r\n 'card.capabilities.thinkingFormat.inherit': '继承',\r\n 'card.capabilities.contextWindow': '上下文窗口上限',\r\n 'card.capabilities.contextCustomPlaceholder': '自定义整数,如 256000',\r\n 'card.capabilities.contextClear': '清除',\r\n 'card.capabilities.contextInteger': '上下文长度必须是整数(2000-1000000)',\r\n 'card.capabilities.contextRange': '上下文长度必须在 2000 到 1000000 之间',\r\n 'card.capabilities.contextHint': '选择预设或输入整数(2000–1000000),写入 llm-pi-ai 供上下文压力/压缩使用,无需重启即对下一请求生效。',\r\n 'input.context.title': '上下文窗口',\r\n 'input.context.globalHint': '全局生效:作用于所有使用该模型的会话(清除可恢复默认)',\r\n 'input.context.unset': '未设',\r\n 'input.context.custom': '自定义',\r\n 'input.context.noModel': '暂无会话模型',\r\n 'input.context.customPlaceholder': '自定义整数,如 256000',\r\n 'input.context.apply': '应用',\r\n 'input.context.clear': '清除',\r\n 'input.context.integer': '上下文长度必须是整数(2000-1000000)',\r\n 'input.context.range': '上下文长度必须在 2000 到 1000000 之间',\r\n 'model.panel.choose': '选择模型',\r\n 'model.panel.loading': '模型目录加载中…',\r\n 'model.panel.empty': '没有可用模型',\r\n 'model.panel.window': '窗口',\r\n 'model.panel.noTarget': '该模型没有可写的配置项',\r\n 'model.panel.unavailable': '当前会话的模型目录不可用',\r\n 'input.effort.title': '思考强度',\r\n 'input.effort.default': '提供方默认',\r\n 'card.capabilities.failed': '保存失败:配置被拒绝或冲突,请检查值。',\r\n} satisfies Record<string, string>\r\n\r\n/** English dictionary (keys mirror zh). */\r\nexport const en: Record<keyof typeof zh, string> = {\r\n 'card.title': 'Thinking Levels',\r\n 'family.title': 'Qizi Plugin Settings',\r\n 'card.description': 'Pick Auto in the model selector: the plugin schedules low / high / max per tool round before submitting the API effort. Here you configure the default level, scheduler bounds, and per-model capabilities (level → gateway wire value mapping).',\r\n 'card.level': 'Default level',\r\n 'card.level.off': 'off — disable thinking (manual only, never auto-picked)',\r\n 'card.level.on': 'on — enable thinking (toggle-only models only; sends enable_thinking, never an effort)',\r\n 'card.level.minimal': 'minimal — least (very light tasks)',\r\n 'card.level.low': 'low — cheap rounds stay cheap',\r\n 'card.level.medium': 'medium — medium',\r\n 'card.level.high': 'high — the official default',\r\n 'card.level.xhigh': 'xhigh — extra high',\r\n 'card.level.max': 'max — heavy work',\r\n 'card.level.auto': 'auto — schedule from tool history (default)',\r\n 'card.enabled': 'Enabled',\r\n 'card.allowDowngrade': 'Allow downgrade (auto may drop to low)',\r\n 'card.allowUpgrade': 'Allow upgrade (auto may lift to max)',\r\n 'card.unavailable': 'Settings namespace unavailable: make sure dsh-thinking-levels is assembled into this profile.',\r\n 'card.readonly': 'Read-only',\r\n 'card.capabilities': 'Model capabilities (llm-pi-ai custom providers)',\r\n 'card.capabilities.hint': 'Reads and writes the llm-pi-ai config directly: tick a level and enter the exact value sent to the gateway (e.g. high → ultra); leaving off empty means “do not send”. Vision gates image input; the thinking toggle drives enable_thinking; thinkingFormat picks the wire serialization.',\r\n 'card.capabilities.empty': 'No custom provider has models configured in llm-pi-ai. Add a provider and models under Settings → Models first.',\r\n 'card.capabilities.unavailable': 'The llm-pi-ai settings namespace is unavailable.',\r\n 'card.capabilities.none': '(no models)',\r\n 'card.capabilities.search': 'Search models by name or ID…',\r\n 'card.capabilities.noMatches': 'No matching models',\r\n 'card.capabilities.quickSettings': 'Quick settings',\r\n 'card.capabilities.presetOfficial': 'Apply to all: Off / High / Max (official DeepSeek style)',\r\n 'card.capabilities.presetGeneric': 'Apply to all: Off / Low / Medium / High (generic)',\r\n 'card.capabilities.vendor': 'Provider',\r\n 'card.capabilities.developerRole': 'Gateway rejects the developer role',\r\n 'card.capabilities.developerRoleHint': 'Official compat switch (dsh ≥ v0.1.0-rc.8): writes route-level compat.supportsDeveloperRole: false so the system prompt is sent as role system — fixes the Unexpected message role 400 on vLLM / SGLang gateways. Unchecking deletes the field and restores inheritance.',\r\n 'card.capabilities.expandProvider': 'Expand provider',\r\n 'card.capabilities.collapseProvider': 'Collapse provider',\r\n 'card.capabilities.openModelSettings': 'Open model settings',\r\n 'card.capabilities.closeModelSettings': 'Collapse model settings',\r\n 'card.capabilities.vision': 'Vision model',\r\n 'card.capabilities.thinking': 'Thinking model',\r\n 'card.capabilities.supportsEffort': 'Supports think effort',\r\n 'card.capabilities.efforts': 'Thinking effort levels (tick, then enter the wire value)',\r\n 'card.capabilities.wirePlaceholder': 'Wire value, e.g. ultra',\r\n 'card.capabilities.offPlaceholder': 'Empty = do not send',\r\n 'card.capabilities.atLeastThinking': 'Select at least one thinking level (other than off)',\r\n 'card.capabilities.applyLevel': 'Apply levels',\r\n 'card.capabilities.restoreDefault': 'Restore defaults',\r\n 'card.capabilities.unsaved': 'Unsaved',\r\n 'card.capabilities.saveChanges': 'Save changes',\r\n 'card.capabilities.saved': 'Saved',\r\n 'card.capabilities.thinkingFormat': 'Thinking format',\r\n 'card.capabilities.thinkingFormat.inherit': 'Inherit',\r\n 'card.capabilities.contextWindow': 'Context window limit',\r\n 'card.capabilities.contextCustomPlaceholder': 'Custom integer, e.g. 256000',\r\n 'card.capabilities.contextClear': 'Clear',\r\n 'card.capabilities.contextInteger': 'Context length must be an integer (2000-1000000)',\r\n 'card.capabilities.contextRange': 'Context length must be between 2000 and 1000000',\r\n 'card.capabilities.contextHint': 'Pick a preset or enter an integer (2000–1000000); written to llm-pi-ai for context pressure/compaction and applied to the next request without a restart.',\r\n 'input.context.title': 'Context window',\r\n 'input.context.globalHint': 'Applies globally to every session using this model (Clear restores the default)',\r\n 'input.context.unset': 'Unset',\r\n 'input.context.custom': 'Custom',\r\n 'input.context.noModel': 'No session model yet',\r\n 'input.context.customPlaceholder': 'Custom integer, e.g. 256000',\r\n 'input.context.apply': 'Apply',\r\n 'input.context.clear': 'Clear',\r\n 'input.context.integer': 'Context length must be an integer (2000-1000000)',\r\n 'input.context.range': 'Context length must be between 2000 and 1000000',\r\n 'model.panel.choose': 'Choose model',\r\n 'model.panel.loading': 'Loading the model directory…',\r\n 'model.panel.empty': 'No models available',\r\n 'model.panel.window': 'Window',\r\n 'model.panel.noTarget': 'No writable config entry for this model',\r\n 'model.panel.unavailable': 'The model directory is unavailable for this session',\r\n 'input.effort.title': 'Reasoning effort',\r\n 'input.effort.default': 'Provider default',\r\n 'card.capabilities.failed': 'Save failed: the value was rejected or conflicted. Check it.',\r\n}\r\n\r\n/** Japanese dictionary (keys mirror zh). */\r\nexport const ja: Record<keyof typeof zh, string> = {\r\n 'card.title': '思考レベル',\r\n 'family.title': '起子プラグイン設定',\r\n 'card.description': 'モデルセレクターで Auto(マスク)を選択すると、ツール呼び出し履歴から low / high / max を自動スケジュールして API に送信します。ここでは既定レベル、スケジューラーの境界、モデル能力(レベル → ゲートウェイ送信値のマッピング)を設定します。',\r\n 'card.level': '既定レベル',\r\n 'card.level.off': 'off — 思考を無効化(手動のみ、自動選択はされません)',\r\n 'card.level.on': 'on — 思考を有効化(トグルのみのモデル向け。enable_thinking のみ送信、effort は送信しません)',\r\n 'card.level.minimal': 'minimal — 最小(非常に軽いタスク)',\r\n 'card.level.low': 'low — 低(軽いラウンドは軽いまま)',\r\n 'card.level.medium': 'medium — 中',\r\n 'card.level.high': 'high — 高(公式既定値)',\r\n 'card.level.xhigh': 'xhigh — 特高',\r\n 'card.level.max': 'max — 最大(重いタスク)',\r\n 'card.level.auto': 'auto — ツール履歴から自動スケジュール(既定)',\r\n 'card.enabled': '有効',\r\n 'card.allowDowngrade': '降格を許可(auto は low まで下げられる)',\r\n 'card.allowUpgrade': '昇格を許可(auto は max まで上げられる)',\r\n 'card.unavailable': '設定名前空間が利用できません:dsh-thinking-levels が profile に組み込まれているか確認してください。',\r\n 'card.readonly': '読み取り専用',\r\n 'card.capabilities': 'モデル能力(llm-pi-ai カスタムプロバイダー)',\r\n 'card.capabilities.hint': 'llm-pi-ai 設定を直接読み書きします:レベルにチェックを入れ、ゲートウェイに送信する値を入力(例:high → ultra)。off を空欄にすると送信しません。視覚は画像入力を決定、思考トグルは enable_thinking を制御、thinkingFormat は wire シリアライズ形式を選択します。',\r\n 'card.capabilities.empty': 'llm-pi-ai にモデルが設定されたカスタムプロバイダーがありません。先に「設定 → モデル」でプロバイダーとモデルを追加してください。',\r\n 'card.capabilities.unavailable': 'llm-pi-ai の設定名前空間が利用できません。',\r\n 'card.capabilities.none': '(モデルなし)',\r\n 'card.capabilities.search': 'モデル名または ID で検索…',\r\n 'card.capabilities.noMatches': '一致するモデルがありません',\r\n 'card.capabilities.quickSettings': 'クイック設定',\r\n 'card.capabilities.presetOfficial': 'すべてに適用:Off / High / Max(公式 DeepSeek 形式)',\r\n 'card.capabilities.presetGeneric': 'すべてに適用:Off / Low / Medium / High(汎用)',\r\n 'card.capabilities.vendor': 'プロバイダー',\r\n 'card.capabilities.developerRole': 'ゲートウェイは developer ロール非対応',\r\n 'card.capabilities.developerRoleHint': '公式互換スイッチ(dsh ≥ v0.1.0-rc.8):ルートレベルの compat.supportsDeveloperRole: false を書き込み、システムプロンプトを system ロールで送信します。vLLM / SGLang などの Unexpected message role 400 を修正。チェックを外すとフィールドを削除し継承に戻します。',\r\n 'card.capabilities.expandProvider': 'プロバイダーを展開',\r\n 'card.capabilities.collapseProvider': 'プロバイダーを折りたたむ',\r\n 'card.capabilities.openModelSettings': 'モデル設定を開く',\r\n 'card.capabilities.closeModelSettings': 'モデル設定を折りたたむ',\r\n 'card.capabilities.vision': '視覚モデル',\r\n 'card.capabilities.thinking': '思考モデル',\r\n 'card.capabilities.supportsEffort': 'think effort をサポート',\r\n 'card.capabilities.efforts': '思考レベル(チェック後、送信値を入力)',\r\n 'card.capabilities.wirePlaceholder': '送信値(例:ultra)',\r\n 'card.capabilities.offPlaceholder': '空欄 = 送信しない',\r\n 'card.capabilities.atLeastThinking': '思考レベルを 1 つ以上選択してください(off 以外)',\r\n 'card.capabilities.applyLevel': 'レベルを適用',\r\n 'card.capabilities.restoreDefault': '既定値に戻す',\r\n 'card.capabilities.unsaved': '未保存',\r\n 'card.capabilities.saveChanges': '変更を保存',\r\n 'card.capabilities.saved': '保存済み',\r\n 'card.capabilities.thinkingFormat': '思考形式',\r\n 'card.capabilities.thinkingFormat.inherit': '継承',\r\n 'card.capabilities.contextWindow': 'コンテキストウィンドウ上限',\r\n 'card.capabilities.contextCustomPlaceholder': 'カスタム整数(例:256000)',\r\n 'card.capabilities.contextClear': 'クリア',\r\n 'card.capabilities.contextInteger': 'コンテキスト長は整数で入力してください(2000-1000000)',\r\n 'card.capabilities.contextRange': 'コンテキスト長は 2000 から 1000000 の範囲で指定してください',\r\n 'card.capabilities.contextHint': 'プリセットを選ぶか整数を入力(2000–1000000)。llm-pi-ai に書き込まれ、コンテキスト圧力/圧縮に使用され、再起動なしで次のリクエストに反映されます。',\r\n 'input.context.title': 'コンテキストウィンドウ',\r\n 'input.context.globalHint': 'グローバルに有効:このモデルを使用するすべてのセッションに適用されます(クリアで既定値に戻ります)',\r\n 'input.context.unset': '未設定',\r\n 'input.context.custom': 'カスタム',\r\n 'input.context.noModel': 'セッションモデルがまだありません',\r\n 'input.context.customPlaceholder': 'カスタム整数(例:256000)',\r\n 'input.context.apply': '適用',\r\n 'input.context.clear': 'クリア',\r\n 'input.context.integer': 'コンテキスト長は整数で入力してください(2000-1000000)',\r\n 'input.context.range': 'コンテキスト長は 2000 から 1000000 の範囲で指定してください',\r\n 'model.panel.choose': 'モデルを選択',\r\n 'model.panel.loading': 'モデルディレクトリを読み込み中…',\r\n 'model.panel.empty': '利用可能なモデルがありません',\r\n 'model.panel.window': 'ウィンドウ',\r\n 'model.panel.noTarget': 'このモデルには書き込み可能な設定項目がありません',\r\n 'model.panel.unavailable': 'このセッションのモデルディレクトリは利用できません',\r\n 'input.effort.title': '思考レベル',\r\n 'input.effort.default': 'プロバイダーの既定',\r\n 'card.capabilities.failed': '保存に失敗しました:値が拒否されたか競合しています。確認してください。',\r\n}\r\n\r\n/** Korean dictionary (keys mirror zh). */\r\nexport const ko: Record<keyof typeof zh, string> = {\r\n 'card.title': '사고 수준',\r\n 'family.title': '起子 플러그인 설정',\r\n 'card.description': '모델 선택기에서 Auto(마스크)를 선택하면 도구 호출 기록을 기반으로 low / high / max 를 자동 스케줄링하여 API에 제출합니다. 여기서 기본 수준, 스케줄러 경계, 모델 기능(수준 → 게이트웨이 전송 값 매핑)을 구성합니다.',\r\n 'card.level': '기본 수준',\r\n 'card.level.off': 'off — 사고 비활성화(수동 전용, 자동 선택 안 됨)',\r\n 'card.level.on': 'on — 사고 활성화(토글 전용 모델용. enable_thinking만 전송, effort는 전송하지 않음)',\r\n 'card.level.minimal': 'minimal — 최소(매우 가벼운 작업)',\r\n 'card.level.low': 'low — 낮음(가벼운 라운드는 가볍게 유지)',\r\n 'card.level.medium': 'medium — 중간',\r\n 'card.level.high': 'high — 높음(공식 기본값)',\r\n 'card.level.xhigh': 'xhigh — 특별히 높음',\r\n 'card.level.max': 'max — 최대(무거운 작업)',\r\n 'card.level.auto': 'auto — 도구 기록에서 자동 스케줄링(기본값)',\r\n 'card.enabled': '활성화',\r\n 'card.allowDowngrade': '다운그레이드 허용(auto가 low까지 내릴 수 있음)',\r\n 'card.allowUpgrade': '업그레이드 허용(auto가 max까지 올릴 수 있음)',\r\n 'card.unavailable': '설정 네임스페이스를 사용할 수 없습니다: dsh-thinking-levels가 이 profile에 조립되었는지 확인하세요.',\r\n 'card.readonly': '읽기 전용',\r\n 'card.capabilities': '모델 기능(llm-pi-ai 사용자 지정 제공자)',\r\n 'card.capabilities.hint': 'llm-pi-ai 설정을 직접 읽고 씁니다: 수준을 체크하고 게이트웨이에 보낼 값을 입력(예: high → ultra). off를 비워 두면 전송하지 않습니다. 시각은 이미지 입력을 결정하고, 사고 토글은 enable_thinking을 제어하며, thinkingFormat은 wire 직렬화 형식을 선택합니다.',\r\n 'card.capabilities.empty': 'llm-pi-ai에 모델이 구성된 사용자 지정 제공자가 없습니다. 먼저 「설정 → 모델」에서 제공자와 모델을 추가하세요.',\r\n 'card.capabilities.unavailable': 'llm-pi-ai 설정 네임스페이스를 사용할 수 없습니다.',\r\n 'card.capabilities.none': '(모델 없음)',\r\n 'card.capabilities.search': '모델 이름 또는 ID로 검색…',\r\n 'card.capabilities.noMatches': '일치하는 모델이 없습니다',\r\n 'card.capabilities.quickSettings': '빠른 설정',\r\n 'card.capabilities.presetOfficial': '전체에 적용: Off / High / Max(공식 DeepSeek 방식)',\r\n 'card.capabilities.presetGeneric': '전체에 적용: Off / Low / Medium / High(일반 방식)',\r\n 'card.capabilities.vendor': '제공자',\r\n 'card.capabilities.developerRole': '게이트웨이가 developer 역할 미지원',\r\n 'card.capabilities.developerRoleHint': '공식 호환 스위치(dsh ≥ v0.1.0-rc.8): 라우트 수준 compat.supportsDeveloperRole: false 를 기록하여 시스템 프롬프트를 system 역할로 전송합니다. vLLM / SGLang 등의 Unexpected message role 400 을 수정. 체크 해제 시 필드를 삭제하고 상속을 복원합니다.',\r\n 'card.capabilities.expandProvider': '제공자 펼치기',\r\n 'card.capabilities.collapseProvider': '제공자 접기',\r\n 'card.capabilities.openModelSettings': '모델 설정 열기',\r\n 'card.capabilities.closeModelSettings': '모델 설정 접기',\r\n 'card.capabilities.vision': '시각 모델',\r\n 'card.capabilities.thinking': '사고 모델',\r\n 'card.capabilities.supportsEffort': 'think effort 지원',\r\n 'card.capabilities.efforts': '사고 수준(체크 후 전송 값 입력)',\r\n 'card.capabilities.wirePlaceholder': '전송 값(예: ultra)',\r\n 'card.capabilities.offPlaceholder': '비워 둠 = 전송하지 않음',\r\n 'card.capabilities.atLeastThinking': '사고 수준을 하나 이상 선택하세요(off 제외)',\r\n 'card.capabilities.applyLevel': '수준 적용',\r\n 'card.capabilities.restoreDefault': '기본값 복원',\r\n 'card.capabilities.unsaved': '저장되지 않음',\r\n 'card.capabilities.saveChanges': '변경 사항 저장',\r\n 'card.capabilities.saved': '저장됨',\r\n 'card.capabilities.thinkingFormat': '사고 형식',\r\n 'card.capabilities.thinkingFormat.inherit': '상속',\r\n 'card.capabilities.contextWindow': '컨텍스트 창 상한',\r\n 'card.capabilities.contextCustomPlaceholder': '사용자 지정 정수(예: 256000)',\r\n 'card.capabilities.contextClear': '지우기',\r\n 'card.capabilities.contextInteger': '컨텍스트 길이는 정수여야 합니다 (2000-1000000)',\r\n 'card.capabilities.contextRange': '컨텍스트 길이는 2000에서 1000000 사이여야 합니다',\r\n 'card.capabilities.contextHint': '프리셋을 선택하거나 정수를 입력하세요(2000–1000000). llm-pi-ai에 기록되어 컨텍스트 압력/압축에 사용되며, 재시작 없이 다음 요청에 반영됩니다.',\r\n 'input.context.title': '컨텍스트 창',\r\n 'input.context.globalHint': '전역 적용: 이 모델을 사용하는 모든 세션에 적용됩니다(지우면 기본값 복원)',\r\n 'input.context.unset': '미설정',\r\n 'input.context.custom': '사용자 지정',\r\n 'input.context.noModel': '세션 모델이 아직 없습니다',\r\n 'input.context.customPlaceholder': '사용자 지정 정수(예: 256000)',\r\n 'input.context.apply': '적용',\r\n 'input.context.clear': '지우기',\r\n 'input.context.integer': '컨텍스트 길이는 정수여야 합니다 (2000-1000000)',\r\n 'input.context.range': '컨텍스트 길이는 2000에서 1000000 사이여야 합니다',\r\n 'model.panel.choose': '모델 선택',\r\n 'model.panel.loading': '모델 디렉터리를 불러오는 중…',\r\n 'model.panel.empty': '사용 가능한 모델이 없습니다',\r\n 'model.panel.window': '창',\r\n 'model.panel.noTarget': '이 모델에는 쓰기 가능한 설정 항목이 없습니다',\r\n 'model.panel.unavailable': '이 세션의 모델 디렉터리를 사용할 수 없습니다',\r\n 'input.effort.title': '추론 강도',\r\n 'input.effort.default': '공급자 기본값',\r\n 'card.capabilities.failed': '저장 실패: 값이 거부되었거나 충돌합니다. 확인하세요.',\r\n}\r\n\r\n/** French dictionary (keys mirror zh). */\r\nexport const fr: Record<keyof typeof zh, string> = {\r\n 'card.title': 'Niveaux de réflexion',\r\n 'family.title': 'Paramètres des plugins Qizi',\r\n 'card.description': 'Choisissez Auto dans le sélecteur de modèle : le plugin planifie low / high / max selon l\\'historique des appels d\\'outils avant de soumettre l\\'effort à l\\'API. Configurez ici le niveau par défaut, les limites du planificateur et les capacités par modèle (niveau → valeur envoyée à la passerelle).',\r\n 'card.level': 'Niveau par défaut',\r\n 'card.level.off': 'off — désactiver la réflexion (manuel uniquement, jamais auto-sélectionné)',\r\n 'card.level.on': 'on — activer la réflexion (modèles à bascule uniquement ; envoie enable_thinking, jamais d\\'effort)',\r\n 'card.level.minimal': 'minimal — minimum (tâches très légères)',\r\n 'card.level.low': 'low — bas (tours économiques restent économiques)',\r\n 'card.level.medium': 'medium — moyen',\r\n 'card.level.high': 'high — élevé (valeur officielle par défaut)',\r\n 'card.level.xhigh': 'xhigh — très élevé',\r\n 'card.level.max': 'max — maximum (tâches lourdes)',\r\n 'card.level.auto': 'auto — planification depuis l\\'historique des outils (par défaut)',\r\n 'card.enabled': 'Activé',\r\n 'card.allowDowngrade': 'Autoriser la rétrogradation (auto peut descendre à low)',\r\n 'card.allowUpgrade': 'Autoriser la montée (auto peut monter à max)',\r\n 'card.unavailable': 'Espace de noms des paramètres indisponible : assurez-vous que dsh-thinking-levels est assemblé dans ce profil.',\r\n 'card.readonly': 'Lecture seule',\r\n 'card.capabilities': 'Capacités du modèle (fournisseurs personnalisés llm-pi-ai)',\r\n 'card.capabilities.hint': 'Lit et écrit directement la configuration llm-pi-ai : cochez un niveau et saisissez la valeur exacte envoyée à la passerelle (ex. high → ultra) ; laisser off vide signifie « ne pas envoyer ». Vision contrôle l\\'entrée d\\'image ; le bouton de réflexion pilote enable_thinking ; thinkingFormat choisit la sérialisation wire.',\r\n 'card.capabilities.empty': 'Aucun fournisseur personnalisé n\\'a de modèles configurés dans llm-pi-ai. Ajoutez d\\'abord un fournisseur et des modèles dans Paramètres → Modèles.',\r\n 'card.capabilities.unavailable': 'L\\'espace de noms des paramètres llm-pi-ai est indisponible.',\r\n 'card.capabilities.none': '(aucun modèle)',\r\n 'card.capabilities.search': 'Rechercher des modèles par nom ou ID…',\r\n 'card.capabilities.noMatches': 'Aucun modèle correspondant',\r\n 'card.capabilities.quickSettings': 'Paramètres rapides',\r\n 'card.capabilities.presetOfficial': 'Appliquer à tous : Off / High / Max (style officiel DeepSeek)',\r\n 'card.capabilities.presetGeneric': 'Appliquer à tous : Off / Low / Medium / High (générique)',\r\n 'card.capabilities.vendor': 'Fournisseur',\r\n 'card.capabilities.developerRole': 'La passerelle rejette le rôle developer',\r\n 'card.capabilities.developerRoleHint': 'Commutateur de compatibilité officiel (dsh ≥ v0.1.0-rc.8) : écrit compat.supportsDeveloperRole: false au niveau de la route pour que le prompt système soit envoyé avec le rôle system — corrige l\\'erreur Unexpected message role 400 sur les passerelles vLLM / SGLang. Décocher supprime le champ et restaure l\\'héritage.',\r\n 'card.capabilities.expandProvider': 'Déplier le fournisseur',\r\n 'card.capabilities.collapseProvider': 'Replier le fournisseur',\r\n 'card.capabilities.openModelSettings': 'Ouvrir les paramètres du modèle',\r\n 'card.capabilities.closeModelSettings': 'Replier les paramètres du modèle',\r\n 'card.capabilities.vision': 'Modèle vision',\r\n 'card.capabilities.thinking': 'Modèle de réflexion',\r\n 'card.capabilities.supportsEffort': 'Prend en charge think effort',\r\n 'card.capabilities.efforts': 'Niveaux de réflexion (cochez, puis saisissez la valeur wire)',\r\n 'card.capabilities.wirePlaceholder': 'Valeur wire, ex. ultra',\r\n 'card.capabilities.offPlaceholder': 'Vide = ne pas envoyer',\r\n 'card.capabilities.atLeastThinking': 'Sélectionnez au moins un niveau de réflexion (autre que off)',\r\n 'card.capabilities.applyLevel': 'Appliquer les niveaux',\r\n 'card.capabilities.restoreDefault': 'Restaurer les valeurs par défaut',\r\n 'card.capabilities.unsaved': 'Non enregistré',\r\n 'card.capabilities.saveChanges': 'Enregistrer les modifications',\r\n 'card.capabilities.saved': 'Enregistré',\r\n 'card.capabilities.thinkingFormat': 'Format de réflexion',\r\n 'card.capabilities.thinkingFormat.inherit': 'Hériter',\r\n 'card.capabilities.contextWindow': 'Limite de fenêtre de contexte',\r\n 'card.capabilities.contextCustomPlaceholder': 'Entier personnalisé, ex. 256000',\r\n 'card.capabilities.contextClear': 'Effacer',\r\n 'card.capabilities.contextInteger': 'La longueur du contexte doit être un entier (2000-1000000)',\r\n 'card.capabilities.contextRange': 'La longueur du contexte doit être comprise entre 2000 et 1000000',\r\n 'card.capabilities.contextHint': 'Choisissez un préréglage ou saisissez un entier (2000–1000000) ; écrit dans llm-pi-ai pour la pression/compression du contexte et appliqué à la requête suivante sans redémarrage.',\r\n 'input.context.title': 'Fenêtre de contexte',\r\n 'input.context.globalHint': 'S\\'applique globalement à toutes les sessions utilisant ce modèle (Effacer restaure la valeur par défaut)',\r\n 'input.context.unset': 'Non défini',\r\n 'input.context.custom': 'Personnalisé',\r\n 'input.context.noModel': 'Aucun modèle de session',\r\n 'input.context.customPlaceholder': 'Entier personnalisé, ex. 256000',\r\n 'input.context.apply': 'Appliquer',\r\n 'input.context.clear': 'Effacer',\r\n 'input.context.integer': 'La longueur du contexte doit être un entier (2000-1000000)',\r\n 'input.context.range': 'La longueur du contexte doit être comprise entre 2000 et 1000000',\r\n 'model.panel.choose': 'Choisir un modèle',\r\n 'model.panel.loading': 'Chargement du répertoire de modèles…',\r\n 'model.panel.empty': 'Aucun modèle disponible',\r\n 'model.panel.window': 'Fenêtre',\r\n 'model.panel.noTarget': 'Aucune entrée de configuration inscriptible pour ce modèle',\r\n 'model.panel.unavailable': 'Le répertoire de modèles est indisponible pour cette session',\r\n 'input.effort.title': 'Effort de raisonnement',\r\n 'input.effort.default': 'Valeur par défaut du fournisseur',\r\n 'card.capabilities.failed': 'Échec de l\\'enregistrement : la valeur a été rejetée ou est en conflit. Vérifiez-la.',\r\n}\r\n\r\n/** German dictionary (keys mirror zh). */\r\nexport const de: Record<keyof typeof zh, string> = {\r\n 'card.title': 'Denkstufen',\r\n 'family.title': 'Qizi-Plugin-Einstellungen',\r\n 'card.description': 'Wählen Sie Auto im Modellselektor: Das Plugin plant low / high / max anhand des Tool-Aufrufverlaufs, bevor der API-Aufwand übermittelt wird. Hier konfigurieren Sie die Standardstufe, Planer-Grenzen und Modellfähigkeiten (Stufe → Gateway-Drahtwert-Zuordnung).',\r\n 'card.level': 'Standardstufe',\r\n 'card.level.off': 'off — Denken deaktivieren (nur manuell, nie automatisch gewählt)',\r\n 'card.level.on': 'on — Denken aktivieren (nur Umschaltmodelle; sendet enable_thinking, nie einen Aufwand)',\r\n 'card.level.minimal': 'minimal — geringst (sehr leichte Aufgaben)',\r\n 'card.level.low': 'low — niedrig (günstige Runden bleiben günstig)',\r\n 'card.level.medium': 'medium — mittel',\r\n 'card.level.high': 'high — hoch (offizieller Standard)',\r\n 'card.level.xhigh': 'xhigh — extra hoch',\r\n 'card.level.max': 'max — maximal (schwere Aufgaben)',\r\n 'card.level.auto': 'auto — Planung aus Tool-Verlauf (Standard)',\r\n 'card.enabled': 'Aktiviert',\r\n 'card.allowDowngrade': 'Herabstufung erlauben (auto kann auf low fallen)',\r\n 'card.allowUpgrade': 'Hochstufung erlauben (auto kann auf max steigen)',\r\n 'card.unavailable': 'Einstellungs-Namensraum nicht verfügbar: Stellen Sie sicher, dass dsh-thinking-levels in diesem Profil eingebunden ist.',\r\n 'card.readonly': 'Schreibgeschützt',\r\n 'card.capabilities': 'Modellfähigkeiten (llm-pi-ai benutzerdefinierte Anbieter)',\r\n 'card.capabilities.hint': 'Liest und schreibt die llm-pi-ai-Konfiguration direkt: Aktivieren Sie eine Stufe und geben Sie den genauen Wert ein, der an das Gateway gesendet wird (z. B. high → ultra); off leer lassen bedeutet „nicht senden\". Vision steuert die Bild-Eingabe; der Denk-Schalter treibt enable_thinking; thinkingFormat wählt die Wire-Serialisierung.',\r\n 'card.capabilities.empty': 'Kein benutzerdefinierter Anbieter hat Modelle in llm-pi-ai konfiguriert. Fügen Sie zuerst einen Anbieter und Modelle unter Einstellungen → Modelle hinzu.',\r\n 'card.capabilities.unavailable': 'Der llm-pi-ai Einstellungs-Namensraum ist nicht verfügbar.',\r\n 'card.capabilities.none': '(keine Modelle)',\r\n 'card.capabilities.search': 'Modelle nach Name oder ID suchen…',\r\n 'card.capabilities.noMatches': 'Keine passenden Modelle',\r\n 'card.capabilities.quickSettings': 'Schnelleinstellungen',\r\n 'card.capabilities.presetOfficial': 'Auf alle anwenden: Off / High / Max (offizieller DeepSeek-Stil)',\r\n 'card.capabilities.presetGeneric': 'Auf alle anwenden: Off / Low / Medium / High (generisch)',\r\n 'card.capabilities.vendor': 'Anbieter',\r\n 'card.capabilities.developerRole': 'Gateway lehnt die Entwickler-Rolle ab',\r\n 'card.capabilities.developerRoleHint': 'Offizieller Kompatibilitätsschalter (dsh ≥ v0.1.0-rc.8): Schreibt compat.supportsDeveloperRole: false auf Routenebene, damit der System-Prompt als Rolle system gesendet wird — behebt den Unexpected message role 400 auf vLLM / SGLang Gateways. Deaktivieren löscht das Feld und stellt die Vererbung wieder her.',\r\n 'card.capabilities.expandProvider': 'Anbieter aufklappen',\r\n 'card.capabilities.collapseProvider': 'Anbieter einklappen',\r\n 'card.capabilities.openModelSettings': 'Modelleinstellungen öffnen',\r\n 'card.capabilities.closeModelSettings': 'Modelleinstellungen einklappen',\r\n 'card.capabilities.vision': 'Vision-Modell',\r\n 'card.capabilities.thinking': 'Denkmodell',\r\n 'card.capabilities.supportsEffort': 'Unterstützt think effort',\r\n 'card.capabilities.efforts': 'Denkstufen (aktivieren, dann Drahtwert eingeben)',\r\n 'card.capabilities.wirePlaceholder': 'Drahtwert, z. B. ultra',\r\n 'card.capabilities.offPlaceholder': 'Leer = nicht senden',\r\n 'card.capabilities.atLeastThinking': 'Wählen Sie mindestens eine Denkstufe (außer off)',\r\n 'card.capabilities.applyLevel': 'Stufen anwenden',\r\n 'card.capabilities.restoreDefault': 'Standardwerte wiederherstellen',\r\n 'card.capabilities.unsaved': 'Ungespeichert',\r\n 'card.capabilities.saveChanges': 'Änderungen speichern',\r\n 'card.capabilities.saved': 'Gespeichert',\r\n 'card.capabilities.thinkingFormat': 'Denkformat',\r\n 'card.capabilities.thinkingFormat.inherit': 'Erben',\r\n 'card.capabilities.contextWindow': 'Kontextfenster-Limit',\r\n 'card.capabilities.contextCustomPlaceholder': 'Benutzerdefinierte Ganzzahl, z. B. 256000',\r\n 'card.capabilities.contextClear': 'Löschen',\r\n 'card.capabilities.contextInteger': 'Kontextlänge muss eine Ganzzahl sein (2000-1000000)',\r\n 'card.capabilities.contextRange': 'Kontextlänge muss zwischen 2000 und 1000000 liegen',\r\n 'card.capabilities.contextHint': 'Wählen Sie eine Voreinstellung oder geben Sie eine Ganzzahl ein (2000–1000000); wird in llm-pi-ai geschrieben für Kontextdruck/Komprimierung und gilt ab der nächsten Anfrage ohne Neustart.',\r\n 'input.context.title': 'Kontextfenster',\r\n 'input.context.globalHint': 'Gilt global für alle Sitzungen mit diesem Modell (Löschen stellt den Standard wieder her)',\r\n 'input.context.unset': 'Nicht festgelegt',\r\n 'input.context.custom': 'Benutzerdefiniert',\r\n 'input.context.noModel': 'Noch kein Sitzungsmodell',\r\n 'input.context.customPlaceholder': 'Benutzerdefinierte Ganzzahl, z. B. 256000',\r\n 'input.context.apply': 'Anwenden',\r\n 'input.context.clear': 'Löschen',\r\n 'input.context.integer': 'Kontextlänge muss eine Ganzzahl sein (2000-1000000)',\r\n 'input.context.range': 'Kontextlänge muss zwischen 2000 und 1000000 liegen',\r\n 'model.panel.choose': 'Modell wählen',\r\n 'model.panel.loading': 'Modellverzeichnis wird geladen…',\r\n 'model.panel.empty': 'Keine Modelle verfügbar',\r\n 'model.panel.window': 'Fenster',\r\n 'model.panel.noTarget': 'Kein beschreibbarer Konfigurationseintrag für dieses Modell',\r\n 'model.panel.unavailable': 'Das Modellverzeichnis ist für diese Sitzung nicht verfügbar',\r\n 'input.effort.title': 'Schlussfolgerungsaufwand',\r\n 'input.effort.default': 'Anbieterstandard',\r\n 'card.capabilities.failed': 'Speichern fehlgeschlagen: Der Wert wurde abgelehnt oder steht in Konflikt. Bitte überprüfen.',\r\n}\r\n\r\n/** Italian dictionary (keys mirror zh). */\r\nexport const it: Record<keyof typeof zh, string> = {\r\n 'card.title': 'Livelli di ragionamento',\r\n 'family.title': 'Impostazioni plugin Qizi',\r\n 'card.description': 'Scegli Auto nel selettore del modello: il plugin pianifica low / high / max in base alla cronologia delle chiamate degli strumenti prima di inviare l\\'effort all\\'API. Qui configuri il livello predefinito, i limiti dello scheduler e le capacità per modello (livello → valore wire inviato al gateway).',\r\n 'card.level': 'Livello predefinito',\r\n 'card.level.off': 'off — disabilita il ragionamento (solo manuale, mai scelto automaticamente)',\r\n 'card.level.on': 'on — abilita il ragionamento (solo modelli a commutazione; invia enable_thinking, mai un effort)',\r\n 'card.level.minimal': 'minimal — minimo (compiti molto leggeri)',\r\n 'card.level.low': 'low — basso (i round economici restano economici)',\r\n 'card.level.medium': 'medium — medio',\r\n 'card.level.high': 'high — alto (predefinito ufficiale)',\r\n 'card.level.xhigh': 'xhigh — molto alto',\r\n 'card.level.max': 'max — massimo (compiti pesanti)',\r\n 'card.level.auto': 'auto — pianificazione dalla cronologia strumenti (predefinito)',\r\n 'card.enabled': 'Abilitato',\r\n 'card.allowDowngrade': 'Consenti declassamento (auto può scendere a low)',\r\n 'card.allowUpgrade': 'Consenti avanzamento (auto può salire a max)',\r\n 'card.unavailable': 'Namespace delle impostazioni non disponibile: assicurati che dsh-thinking-levels sia integrato in questo profilo.',\r\n 'card.readonly': 'Sola lettura',\r\n 'card.capabilities': 'Capacità del modello (provider personalizzati llm-pi-ai)',\r\n 'card.capabilities.hint': 'Legge e scrive direttamente la configurazione llm-pi-ai: spunta un livello e inserisci il valore esatto inviato al gateway (es. high → ultra); lasciare off vuoto significa «non inviare». Vision controlla l\\'input immagine; l\\'interruttore di ragionamento guida enable_thinking; thinkingFormat sceglie la serializzazione wire.',\r\n 'card.capabilities.empty': 'Nessun provider personalizzato ha modelli configurati in llm-pi-ai. Aggiungi prima un provider e dei modelli in Impostazioni → Modelli.',\r\n 'card.capabilities.unavailable': 'Il namespace delle impostazioni llm-pi-ai non è disponibile.',\r\n 'card.capabilities.none': '(nessun modello)',\r\n 'card.capabilities.search': 'Cerca modelli per nome o ID…',\r\n 'card.capabilities.noMatches': 'Nessun modello corrispondente',\r\n 'card.capabilities.quickSettings': 'Impostazioni rapide',\r\n 'card.capabilities.presetOfficial': 'Applica a tutti: Off / High / Max (stile ufficiale DeepSeek)',\r\n 'card.capabilities.presetGeneric': 'Applica a tutti: Off / Low / Medium / High (generico)',\r\n 'card.capabilities.vendor': 'Provider',\r\n 'card.capabilities.developerRole': 'Il gateway rifiuta il ruolo developer',\r\n 'card.capabilities.developerRoleHint': 'Interruttore di compatibilità ufficiale (dsh ≥ v0.1.0-rc.8): scrive compat.supportsDeveloperRole: false a livello di rotta così il prompt di sistema viene inviato come ruolo system — corregge l\\'errore Unexpected message role 400 su gateway vLLM / SGLang. Deselezionare elimina il campo e ripristina l\\'ereditarietà.',\r\n 'card.capabilities.expandProvider': 'Espandi provider',\r\n 'card.capabilities.collapseProvider': 'Comprimi provider',\r\n 'card.capabilities.openModelSettings': 'Apri impostazioni modello',\r\n 'card.capabilities.closeModelSettings': 'Comprimi impostazioni modello',\r\n 'card.capabilities.vision': 'Modello vision',\r\n 'card.capabilities.thinking': 'Modello di ragionamento',\r\n 'card.capabilities.supportsEffort': 'Supporta think effort',\r\n 'card.capabilities.efforts': 'Livelli di ragionamento (spunta, poi inserisci il valore wire)',\r\n 'card.capabilities.wirePlaceholder': 'Valore wire, es. ultra',\r\n 'card.capabilities.offPlaceholder': 'Vuoto = non inviare',\r\n 'card.capabilities.atLeastThinking': 'Seleziona almeno un livello di ragionamento (diverso da off)',\r\n 'card.capabilities.applyLevel': 'Applica livelli',\r\n 'card.capabilities.restoreDefault': 'Ripristina predefiniti',\r\n 'card.capabilities.unsaved': 'Non salvato',\r\n 'card.capabilities.saveChanges': 'Salva modifiche',\r\n 'card.capabilities.saved': 'Salvato',\r\n 'card.capabilities.thinkingFormat': 'Formato di ragionamento',\r\n 'card.capabilities.thinkingFormat.inherit': 'Eredita',\r\n 'card.capabilities.contextWindow': 'Limite finestra di contesto',\r\n 'card.capabilities.contextCustomPlaceholder': 'Intero personalizzato, es. 256000',\r\n 'card.capabilities.contextClear': 'Cancella',\r\n 'card.capabilities.contextInteger': 'La lunghezza del contesto deve essere un intero (2000-1000000)',\r\n 'card.capabilities.contextRange': 'La lunghezza del contesto deve essere compresa tra 2000 e 1000000',\r\n 'card.capabilities.contextHint': 'Scegli un predefinito o inserisci un intero (2000–1000000); scritto in llm-pi-ai per la pressione/compressione del contesto e applicato alla richiesta successiva senza riavvio.',\r\n 'input.context.title': 'Finestra di contesto',\r\n 'input.context.globalHint': 'Si applica globalmente a tutte le sessioni che usano questo modello (Cancella ripristina il predefinito)',\r\n 'input.context.unset': 'Non impostato',\r\n 'input.context.custom': 'Personalizzato',\r\n 'input.context.noModel': 'Nessun modello di sessione',\r\n 'input.context.customPlaceholder': 'Intero personalizzato, es. 256000',\r\n 'input.context.apply': 'Applica',\r\n 'input.context.clear': 'Cancella',\r\n 'input.context.integer': 'La lunghezza del contesto deve essere un intero (2000-1000000)',\r\n 'input.context.range': 'La lunghezza del contesto deve essere compresa tra 2000 e 1000000',\r\n 'model.panel.choose': 'Scegli modello',\r\n 'model.panel.loading': 'Caricamento directory modelli…',\r\n 'model.panel.empty': 'Nessun modello disponibile',\r\n 'model.panel.window': 'Finestra',\r\n 'model.panel.noTarget': 'Nessuna voce di configurazione scrivibile per questo modello',\r\n 'model.panel.unavailable': 'La directory dei modelli non è disponibile per questa sessione',\r\n 'input.effort.title': 'Sforzo di ragionamento',\r\n 'input.effort.default': 'Predefinito del provider',\r\n 'card.capabilities.failed': 'Salvataggio non riuscito: il valore è stato rifiutato o è in conflitto. Verifica.',\r\n}\r\n\r\n/** Russian dictionary (keys mirror zh). */\r\nexport const ru: Record<keyof typeof zh, string> = {\r\n 'card.title': 'Уровни мышления',\r\n 'family.title': 'Настройки плагинов Qizi',\r\n 'card.description': 'Выберите Auto в селекторе модели: плагин планирует low / high / max по истории вызовов инструментов перед отправкой effort в API. Здесь настраивается уровень по умолчанию, границы планировщика и возможности модели (уровень → значение, отправляемое шлюзу).',\r\n 'card.level': 'Уровень по умолчанию',\r\n 'card.level.off': 'off — отключить мышление (только вручную, никогда не выбирается автоматически)',\r\n 'card.level.on': 'on — включить мышление (только модели с переключателем; отправляет enable_thinking, без effort)',\r\n 'card.level.minimal': 'minimal — минимальный (очень лёгкие задачи)',\r\n 'card.level.low': 'low — низкий (дешёвые раунды остаются дешёвыми)',\r\n 'card.level.medium': 'medium — средний',\r\n 'card.level.high': 'high — высокий (официальное значение по умолчанию)',\r\n 'card.level.xhigh': 'xhigh — особо высокий',\r\n 'card.level.max': 'max — максимальный (тяжёлые задачи)',\r\n 'card.level.auto': 'auto — планирование по истории инструментов (по умолчанию)',\r\n 'card.enabled': 'Включено',\r\n 'card.allowDowngrade': 'Разрешить понижение (auto может снизить до low)',\r\n 'card.allowUpgrade': 'Разрешить повышение (auto может поднять до max)',\r\n 'card.unavailable': 'Пространство имён настроек недоступно: убедитесь, что dsh-thinking-levels подключён к этому профилю.',\r\n 'card.readonly': 'Только чтение',\r\n 'card.capabilities': 'Возможности модели (пользовательские провайдеры llm-pi-ai)',\r\n 'card.capabilities.hint': 'Напрямую читает и пишет конфигурацию llm-pi-ai: отметьте уровень и введите точное значение, отправляемое шлюзу (напр. high → ultra); пустое поле off означает «не отправлять». Vision управляет вводом изображений; переключатель мышления управляет enable_thinking; thinkingFormat задаёт формат сериализации wire.',\r\n 'card.capabilities.empty': 'Ни один пользовательский провайдер не имеет настроенных моделей в llm-pi-ai. Сначала добавьте провайдер и модели в Настройки → Модели.',\r\n 'card.capabilities.unavailable': 'Пространство имён настроек llm-pi-ai недоступно.',\r\n 'card.capabilities.none': '(нет моделей)',\r\n 'card.capabilities.search': 'Поиск моделей по имени или ID…',\r\n 'card.capabilities.noMatches': 'Нет подходящих моделей',\r\n 'card.capabilities.quickSettings': 'Быстрые настройки',\r\n 'card.capabilities.presetOfficial': 'Применить ко всем: Off / High / Max (официальный стиль DeepSeek)',\r\n 'card.capabilities.presetGeneric': 'Применить ко всем: Off / Low / Medium / High (общий)',\r\n 'card.capabilities.vendor': 'Провайдер',\r\n 'card.capabilities.developerRole': 'Шлюз отклоняет роль developer',\r\n 'card.capabilities.developerRoleHint': 'Официальный переключатель совместимости (dsh ≥ v0.1.0-rc.8): записывает compat.supportsDeveloperRole: false на уровне маршрута, чтобы системный промпт отправлялся с ролью system — исправляет Unexpected message role 400 на шлюзах vLLM / SGLang. Снятие флажка удаляет поле и восстанавливает наследование.',\r\n 'card.capabilities.expandProvider': 'Развернуть провайдер',\r\n 'card.capabilities.collapseProvider': 'Свернуть провайдер',\r\n 'card.capabilities.openModelSettings': 'Открыть настройки модели',\r\n 'card.capabilities.closeModelSettings': 'Свернуть настройки модели',\r\n 'card.capabilities.vision': 'Модель с vision',\r\n 'card.capabilities.thinking': 'Модель с мышлением',\r\n 'card.capabilities.supportsEffort': 'Поддерживает think effort',\r\n 'card.capabilities.efforts': 'Уровни мышления (отметьте, затем введите значение wire)',\r\n 'card.capabilities.wirePlaceholder': 'Значение wire, напр. ultra',\r\n 'card.capabilities.offPlaceholder': 'Пусто = не отправлять',\r\n 'card.capabilities.atLeastThinking': 'Выберите хотя бы один уровень мышления (кроме off)',\r\n 'card.capabilities.applyLevel': 'Применить уровни',\r\n 'card.capabilities.restoreDefault': 'Восстановить значения по умолчанию',\r\n 'card.capabilities.unsaved': 'Не сохранено',\r\n 'card.capabilities.saveChanges': 'Сохранить изменения',\r\n 'card.capabilities.saved': 'Сохранено',\r\n 'card.capabilities.thinkingFormat': 'Формат мышления',\r\n 'card.capabilities.thinkingFormat.inherit': 'Наследовать',\r\n 'card.capabilities.contextWindow': 'Лимит контекстного окна',\r\n 'card.capabilities.contextCustomPlaceholder': 'Пользовательское целое число, напр. 256000',\r\n 'card.capabilities.contextClear': 'Очистить',\r\n 'card.capabilities.contextInteger': 'Длина контекста должна быть целым числом (2000-1000000)',\r\n 'card.capabilities.contextRange': 'Длина контекста должна быть от 2000 до 1000000',\r\n 'card.capabilities.contextHint': 'Выберите пресет или введите целое число (2000–1000000); записывается в llm-pi-ai для давления/сжатия контекста и применяется к следующему запросу без перезапуска.',\r\n 'input.context.title': 'Контекстное окно',\r\n 'input.context.globalHint': 'Применяется глобально ко всем сессиям с этой моделью (Очистить восстанавливает значение по умолчанию)',\r\n 'input.context.unset': 'Не задано',\r\n 'input.context.custom': 'Пользовательское',\r\n 'input.context.noModel': 'Модель сессии ещё не выбрана',\r\n 'input.context.customPlaceholder': 'Пользовательское целое число, напр. 256000',\r\n 'input.context.apply': 'Применить',\r\n 'input.context.clear': 'Очистить',\r\n 'input.context.integer': 'Длина контекста должна быть целым числом (2000-1000000)',\r\n 'input.context.range': 'Длина контекста должна быть от 2000 до 1000000',\r\n 'model.panel.choose': 'Выбрать модель',\r\n 'model.panel.loading': 'Загрузка каталога моделей…',\r\n 'model.panel.empty': 'Нет доступных моделей',\r\n 'model.panel.window': 'Окно',\r\n 'model.panel.noTarget': 'Нет записываемой записи конфигурации для этой модели',\r\n 'model.panel.unavailable': 'Каталог моделей недоступен для этой сессии',\r\n 'input.effort.title': 'Усилие рассуждения',\r\n 'input.effort.default': 'Значение провайдера по умолчанию',\r\n 'card.capabilities.failed': 'Ошибка сохранения: значение отклонено или конфликтует. Проверьте его.',\r\n}\r\n\r\n/** Spanish dictionary (keys mirror zh). */\r\nexport const es: Record<keyof typeof zh, string> = {\r\n 'card.title': 'Niveles de razonamiento',\r\n 'family.title': 'Configuración de plugins Qizi',\r\n 'card.description': 'Elige Auto en el selector de modelo: el plugin planifica low / high / max según el historial de llamadas de herramientas antes de enviar el effort a la API. Aquí configuras el nivel predeterminado, los límites del planificador y las capacidades por modelo (nivel → valor wire enviado al gateway).',\r\n 'card.level': 'Nivel predeterminado',\r\n 'card.level.off': 'off — desactivar razonamiento (solo manual, nunca seleccionado automáticamente)',\r\n 'card.level.on': 'on — activar razonamiento (solo modelos de conmutación; envía enable_thinking, nunca un effort)',\r\n 'card.level.minimal': 'minimal — mínimo (tareas muy ligeras)',\r\n 'card.level.low': 'low — bajo (las rondas económicas siguen siendo económicas)',\r\n 'card.level.medium': 'medium — medio',\r\n 'card.level.high': 'high — alto (predeterminado oficial)',\r\n 'card.level.xhigh': 'xhigh — extra alto',\r\n 'card.level.max': 'max — máximo (tareas pesadas)',\r\n 'card.level.auto': 'auto — planificación desde el historial de herramientas (predeterminado)',\r\n 'card.enabled': 'Activado',\r\n 'card.allowDowngrade': 'Permitir degradación (auto puede bajar a low)',\r\n 'card.allowUpgrade': 'Permitir mejora (auto puede subir a max)',\r\n 'card.unavailable': 'Espacio de nombres de configuración no disponible: asegúrate de que dsh-thinking-levels esté ensamblado en este perfil.',\r\n 'card.readonly': 'Solo lectura',\r\n 'card.capabilities': 'Capacidades del modelo (proveedores personalizados llm-pi-ai)',\r\n 'card.capabilities.hint': 'Lee y escribe directamente la configuración de llm-pi-ai: marca un nivel e introduce el valor exacto enviado al gateway (ej. high → ultra); dejar off vacío significa «no enviar». Vision controla la entrada de imágenes; el interruptor de razonamiento gestiona enable_thinking; thinkingFormat elige la serialización wire.',\r\n 'card.capabilities.empty': 'Ningún proveedor personalizado tiene modelos configurados en llm-pi-ai. Añade primero un proveedor y modelos en Configuración → Modelos.',\r\n 'card.capabilities.unavailable': 'El espacio de nombres de configuración de llm-pi-ai no está disponible.',\r\n 'card.capabilities.none': '(sin modelos)',\r\n 'card.capabilities.search': 'Buscar modelos por nombre o ID…',\r\n 'card.capabilities.noMatches': 'No hay modelos coincidentes',\r\n 'card.capabilities.quickSettings': 'Configuración rápida',\r\n 'card.capabilities.presetOfficial': 'Aplicar a todos: Off / High / Max (estilo oficial DeepSeek)',\r\n 'card.capabilities.presetGeneric': 'Aplicar a todos: Off / Low / Medium / High (genérico)',\r\n 'card.capabilities.vendor': 'Proveedor',\r\n 'card.capabilities.developerRole': 'El gateway rechaza el rol developer',\r\n 'card.capabilities.developerRoleHint': 'Interruptor de compatibilidad oficial (dsh ≥ v0.1.0-rc.8): escribe compat.supportsDeveloperRole: false a nivel de ruta para que el prompt del sistema se envíe con rol system — corrige el error Unexpected message role 400 en gateways vLLM / SGLang. Desmarcar elimina el campo y restaura la herencia.',\r\n 'card.capabilities.expandProvider': 'Expandir proveedor',\r\n 'card.capabilities.collapseProvider': 'Contraer proveedor',\r\n 'card.capabilities.openModelSettings': 'Abrir configuración del modelo',\r\n 'card.capabilities.closeModelSettings': 'Contraer configuración del modelo',\r\n 'card.capabilities.vision': 'Modelo de visión',\r\n 'card.capabilities.thinking': 'Modelo de razonamiento',\r\n 'card.capabilities.supportsEffort': 'Soporta think effort',\r\n 'card.capabilities.efforts': 'Niveles de razonamiento (marca, luego introduce el valor wire)',\r\n 'card.capabilities.wirePlaceholder': 'Valor wire, ej. ultra',\r\n 'card.capabilities.offPlaceholder': 'Vacío = no enviar',\r\n 'card.capabilities.atLeastThinking': 'Selecciona al menos un nivel de razonamiento (distinto de off)',\r\n 'card.capabilities.applyLevel': 'Aplicar niveles',\r\n 'card.capabilities.restoreDefault': 'Restaurar valores predeterminados',\r\n 'card.capabilities.unsaved': 'Sin guardar',\r\n 'card.capabilities.saveChanges': 'Guardar cambios',\r\n 'card.capabilities.saved': 'Guardado',\r\n 'card.capabilities.thinkingFormat': 'Formato de razonamiento',\r\n 'card.capabilities.thinkingFormat.inherit': 'Heredar',\r\n 'card.capabilities.contextWindow': 'Límite de ventana de contexto',\r\n 'card.capabilities.contextCustomPlaceholder': 'Entero personalizado, ej. 256000',\r\n 'card.capabilities.contextClear': 'Borrar',\r\n 'card.capabilities.contextInteger': 'La longitud del contexto debe ser un entero (2000-1000000)',\r\n 'card.capabilities.contextRange': 'La longitud del contexto debe estar entre 2000 y 1000000',\r\n 'card.capabilities.contextHint': 'Elige un ajuste predefinido o introduce un entero (2000–1000000); se escribe en llm-pi-ai para la presión/compresión del contexto y se aplica a la siguiente solicitud sin reiniciar.',\r\n 'input.context.title': 'Ventana de contexto',\r\n 'input.context.globalHint': 'Se aplica globalmente a todas las sesiones que usan este modelo (Borrar restaura el valor predeterminado)',\r\n 'input.context.unset': 'Sin definir',\r\n 'input.context.custom': 'Personalizado',\r\n 'input.context.noModel': 'Aún no hay modelo de sesión',\r\n 'input.context.customPlaceholder': 'Entero personalizado, ej. 256000',\r\n 'input.context.apply': 'Aplicar',\r\n 'input.context.clear': 'Borrar',\r\n 'input.context.integer': 'La longitud del contexto debe ser un entero (2000-1000000)',\r\n 'input.context.range': 'La longitud del contexto debe estar entre 2000 y 1000000',\r\n 'model.panel.choose': 'Elegir modelo',\r\n 'model.panel.loading': 'Cargando el directorio de modelos…',\r\n 'model.panel.empty': 'No hay modelos disponibles',\r\n 'model.panel.window': 'Ventana',\r\n 'model.panel.noTarget': 'No hay entrada de configuración escribible para este modelo',\r\n 'model.panel.unavailable': 'El directorio de modelos no está disponible para esta sesión',\r\n 'input.effort.title': 'Esfuerzo de razonamiento',\r\n 'input.effort.default': 'Predeterminado del proveedor',\r\n 'card.capabilities.failed': 'Error al guardar: el valor fue rechazado o está en conflicto. Verifícalo.',\r\n}\r\n\r\n/** Combined dictionary map — all 9 languages, single-call registration. */\r\nexport const dictionaries: Record<string, Record<string, string>> = { zh, en, ja, ko, fr, de, it, ru, es }\r\n","/**\n * Pure context-window helpers for the dsh-thinking-levels plugin.\n *\n * The context-window limit of a custom gateway model is declared in the\n * llm-pi-ai model entry (`contextWindow`, a positive integer). The harness\n * consumes it through `resolveModelInfo(...).context.contextWindow` for\n * compaction thresholds, context-overflow detection and context-pressure\n * projections — a settings write takes effect on the next request without a\n * restart. This module centralizes the legal range, the common presets and\n * the display formatting shared by the config schema, the settings card and\n * the tests. Kept dependency-free (pure inputs -> output).\n */\n\n/** Smallest accepted context window (tokens), aligned with dsh-thinking-effort. */\nexport const CONTEXT_WINDOW_MIN = 2000\n/** Largest accepted context window (tokens), e.g. third-party DeepSeek 1M. */\nexport const CONTEXT_WINDOW_MAX = 1_000_000\n\n/** One selectable context-window preset. */\nexport interface ContextWindowPreset {\n /** Human-readable label shown on the card button and the model badge. */\n label: string\n /** The token count written to the llm-pi-ai model entry. */\n value: number\n}\n\n/** The multi-level context-window presets, in ascending order. */\nexport const CONTEXT_WINDOW_PRESETS: readonly ContextWindowPreset[] = [\n { label: '64K', value: 64_000 },\n { label: '128K', value: 131_072 },\n { label: '256K', value: 256_000 },\n { label: '400K', value: 400_000 },\n { label: '512K', value: 524_288 },\n { label: '1M', value: 1_000_000 },\n] as const\n\n/** Format a token count as a readable label (exact presets keep their label). */\nexport function formatContextWindow(value: number): string {\n const preset = CONTEXT_WINDOW_PRESETS.find(candidate => candidate.value === value)\n if (preset !== undefined) return preset.label\n if (value >= CONTEXT_WINDOW_MAX) return '1M'\n if (value >= 1024) return `${Math.round(value / 1024)}K`\n return String(value)\n}\n\n/** The result of validating a context-window value. */\nexport type ContextWindowValidation =\n | { ok: true; value: number }\n | { ok: false; reason: 'integer' | 'range' }\n\n/**\n * Validate a context-window candidate (number or numeric string). Accepts only\n * base-10 integers inside [CONTEXT_WINDOW_MIN, CONTEXT_WINDOW_MAX]; anything\n * else (float, 'abc', '1e3', out-of-range) is rejected with a reason.\n */\nexport function validateContextWindow(value: unknown): ContextWindowValidation {\n const raw = typeof value === 'string' ? value.trim() : value\n const asString = typeof raw === 'string' ? raw : String(raw)\n if (!/^\\d+$/.test(asString)) return { ok: false, reason: 'integer' }\n const numeric = Number(asString)\n if (!Number.isSafeInteger(numeric)) return { ok: false, reason: 'integer' }\n if (numeric < CONTEXT_WINDOW_MIN || numeric > CONTEXT_WINDOW_MAX) {\n return { ok: false, reason: 'range' }\n }\n return { ok: true, value: numeric }\n}\n","/**\r\n * Model-seat panel for the composer (`conversation.input.model`).\r\n *\r\n * Why this seat: the shipped `ModelSelect` renders no slots inside its popup,\r\n * so a plugin can never contribute *into* that panel — the working pattern\r\n * (proven by dsh-reasoning-effort) is to occupy the model seat itself: one\r\n * registered entry named after the seat with `priority: -1` replaces the\r\n * shipped trigger and popup outright. This component then renders its own\r\n * picker over the harness's shared model directory (`modelDirectories`\r\n * service), so model switching keeps working, and adds what the official\r\n * popup cannot offer: a context-window editor on every model line.\r\n *\r\n * Per-line context window (the \"max context window\" moved into each line):\r\n * each model row carries a compact chip showing the model's effective\r\n * `contextWindow`; clicking it opens an inline editor row (preset slider,\r\n * custom-integer input, Clear). Writes follow the same two-family discipline\r\n * the retired composer pill used (both consumed live by\r\n * `resolveModelInfo(...).context.contextWindow`, effective on the next\r\n * request without a restart):\r\n * - Custom gateways (`llm-pi-ai` providers): writes the model entry's\r\n * `contextWindow` under `providers[provider].models[i]`; a gateway model\r\n * missing from the config has no write target and renders the chip disabled.\r\n * - Official DeepSeek (`deepseek-official`, the `llm-deepseek` entry): writes\r\n * the catalog model's `contextWindow` when listed, otherwise caps via\r\n * `defaultContextWindow`.\r\n *\r\n * Graceful degradation: when the harness provides no `modelDirectories`\r\n * service (older lines) the registration is skipped entirely and the shipped\r\n * model selector stays untouched.\r\n */\r\nimport { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react'\r\nimport type { CSSProperties, JSX } from 'react'\r\nimport type { SettingsScope } from './scope-face.ts'\r\nimport { CONTEXT_WINDOW_PRESETS, formatContextWindow, validateContextWindow } from '../context-window.ts'\r\n\r\n/** The official DeepSeek provider route owned by the llm-deepseek adapter. */\r\nconst DEEPSEEK_PROVIDER = 'deepseek-official'\r\n/** llm-deepseek's native default context capacity (DEFAULT_CONTEXT_WINDOW). */\r\nconst DEEPSEEK_DEFAULT_WINDOW = 1_000_000\r\n/** Slider stop an unset window parks on: the thumb needs a position, the readout stays \"unset\". */\r\nconst UNSET_STOP_INDEX = CONTEXT_WINDOW_PRESETS.findIndex(preset => preset.value === 256_000)\r\n\r\n/** Snapshot shown when the session's directory face is unavailable. */\r\nconst UNAVAILABLE_STATE: ModelDirectoryState = {\r\n status: 'loading',\r\n groups: [],\r\n current: null,\r\n error: null,\r\n}\r\n\r\n/** One injected face: the shared model directory plus the two config forms. */\r\nexport interface ModelPanelInjected {\r\n /**\r\n * The session's shared model directory store, loader and selector.\r\n * Undefined when the resolver refused this session (odd session shape):\r\n * the panel renders its unavailable notice instead of crashing — a thrown\r\n * render abdicates the seat entry and the shipped selector comes back.\r\n */\r\n directory: ModelDirectoryFace | undefined\r\n /** The `llm-pi-ai` config form (custom gateway models). */\r\n piAiScope: SettingsScope<unknown>\r\n /** The `llm-deepseek` config form (official DeepSeek models). */\r\n deepseekScope: SettingsScope<unknown>\r\n}\r\n\r\n/** Full props: the injected face + the session standard seat + locale copy. */\r\nexport interface ModelPanelProps extends ModelPanelInjected {\r\n /** The session id of the slot's owning conversation (standard seat). */\r\n sessionId: string\r\n /** Locale copy thunk. */\r\n t: (key: string) => string\r\n}\r\n\r\n/* ── shared inline styling (no CSS modules in the client bundle) ───────── */\r\n\r\nconst rootStyle: CSSProperties = { position: 'relative', display: 'inline-flex' }\r\n\r\nconst triggerStyle: CSSProperties = {\r\n display: 'inline-flex',\r\n alignItems: 'center',\r\n gap: '6px',\r\n height: '26px',\r\n padding: '0 10px',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n color: 'var(--dsw-alias-label-primary)',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '8px',\r\n fontSize: '12px',\r\n lineHeight: '18px',\r\n cursor: 'pointer',\r\n whiteSpace: 'nowrap',\r\n maxWidth: '220px',\r\n}\r\n\r\nconst triggerNameStyle: CSSProperties = {\r\n minWidth: 0,\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n}\r\n\r\nconst triggerEffortStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n maxWidth: '72px',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n}\r\n\r\nconst chevronStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n fontSize: '9px',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n}\r\n\r\nconst popStyle: CSSProperties = {\r\n position: 'absolute',\r\n bottom: 'calc(100% + 8px)',\r\n left: '0',\r\n zIndex: 1200,\r\n width: '320px',\r\n padding: '8px',\r\n background: 'var(--dsw-alias-bg-layer-3)',\r\n color: 'var(--dsw-alias-label-primary)',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '10px',\r\n boxShadow: '0 8px 28px rgba(0,0,0,0.18)',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '4px',\r\n}\r\n\r\nconst backdropStyle: CSSProperties = { position: 'fixed', inset: 0, zIndex: 1199 }\r\n\r\nconst modelsStyle: CSSProperties = { maxHeight: '320px', overflowY: 'auto', display: 'flex', flexDirection: 'column', gap: '2px' }\r\n\r\nconst providerToggleStyle: CSSProperties = {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '6px',\r\n width: '100%',\r\n padding: '6px 8px',\r\n border: 'none',\r\n borderRadius: '6px',\r\n background: 'transparent',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n font: 'inherit',\r\n fontSize: '12px',\r\n cursor: 'pointer',\r\n textAlign: 'left',\r\n}\r\n\r\nconst providerNameStyle: CSSProperties = { flex: '1 1 auto', fontWeight: 600 }\r\n\r\nconst providerMetaStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n fontSize: '11px',\r\n}\r\n\r\n/** The model-line row CONTAINER: highlight surface + flex parent of pick/select/chip.\r\n* Wraps so the inline window editor (a flex item too) takes its own full line. */\r\nconst modelRowStyle: CSSProperties = {\r\n display: 'flex',\r\n flexWrap: 'wrap',\r\n alignItems: 'center',\r\n gap: '6px',\r\n width: '100%',\r\n borderRadius: '6px',\r\n}\r\n\r\nconst modelRowActiveStyle: CSSProperties = {\r\n ...modelRowStyle,\r\n background: 'var(--dsw-alias-state-business-primary-weak, var(--dsw-alias-interactive-bg-hover, transparent))',\r\n}\r\n\r\n/** The pick button inside the row: name/description/✓, keeps the row's old padding. */\r\nconst modelPickStyle: CSSProperties = {\r\n flex: '1 1 auto',\r\n minWidth: 0,\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '6px',\r\n padding: '6px 4px 6px 18px',\r\n border: 'none',\r\n background: 'transparent',\r\n color: 'var(--dsw-alias-label-primary)',\r\n font: 'inherit',\r\n fontSize: '12px',\r\n cursor: 'pointer',\r\n textAlign: 'left',\r\n}\r\n\r\nconst modelCopyStyle: CSSProperties = {\r\n flex: '1 1 auto',\r\n minWidth: 0,\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '1px',\r\n}\r\n\r\nconst modelNameStyle: CSSProperties = { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }\r\n\r\nconst checkStyle: CSSProperties = { flex: '0 0 auto', color: 'var(--dsw-alias-state-business-primary)' }\r\n\r\nconst chipStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n height: '18px',\r\n padding: '0 6px',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '5px',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n fontSize: '11px',\r\n lineHeight: '16px',\r\n fontFamily: 'var(--ds-font-family-code, monospace)',\r\n fontVariantNumeric: 'tabular-nums',\r\n cursor: 'pointer',\r\n whiteSpace: 'nowrap',\r\n marginRight: '8px',\r\n}\r\n\r\nconst chipDisabledStyle: CSSProperties = { ...chipStyle, cursor: 'default', opacity: 0.55 }\r\n\r\nconst selectStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n height: '18px',\r\n maxWidth: '96px',\r\n padding: '0 2px',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '5px',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n font: 'inherit',\r\n fontSize: '11px',\r\n lineHeight: '16px',\r\n cursor: 'pointer',\r\n colorScheme: 'dark light',\r\n}\r\n\r\nconst editorRowStyle: CSSProperties = {\r\n flex: '1 1 100%',\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '6px',\r\n margin: '2px 8px 6px 18px',\r\n padding: '6px',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '6px',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n fontSize: '12px',\r\n}\r\n\r\nconst labelStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n whiteSpace: 'nowrap',\r\n}\r\n\r\nconst sliderStyle: CSSProperties = {\r\n flex: '1 1 auto',\r\n minWidth: '48px',\r\n height: '14px',\r\n margin: '0',\r\n accentColor: 'var(--dsw-alias-state-business-primary)',\r\n cursor: 'pointer',\r\n}\r\n\r\nconst valueStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n minWidth: '36px',\r\n textAlign: 'right',\r\n color: 'var(--dsw-alias-label-primary)',\r\n fontFamily: 'var(--ds-font-family-code, monospace)',\r\n fontVariantNumeric: 'tabular-nums',\r\n}\r\n\r\nconst actionButtonStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n height: '18px',\r\n padding: '0 6px',\r\n border: '1px solid transparent',\r\n borderRadius: '4px',\r\n background: 'transparent',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n font: 'inherit',\r\n cursor: 'pointer',\r\n}\r\n\r\nconst inputStyle: CSSProperties = {\r\n flex: '1 1 auto',\r\n minWidth: '0',\r\n boxSizing: 'border-box',\r\n padding: '2px 6px',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '5px',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n color: 'var(--dsw-alias-label-primary)',\r\n font: 'inherit',\r\n}\r\n\r\nconst errorStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n color: 'var(--dsw-alias-state-error-primary)',\r\n fontSize: '11px',\r\n}\r\n\r\nconst statusStyle: CSSProperties = {\r\n padding: '10px 8px',\r\n fontSize: '12px',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n}\r\n\r\nconst errorBannerStyle: CSSProperties = {\r\n padding: '6px 8px',\r\n borderRadius: '6px',\r\n background: 'var(--dsw-alias-interactive-bg-hover-danger)',\r\n color: 'var(--dsw-alias-state-error-primary)',\r\n fontSize: '11px',\r\n}\r\n\r\n/* ── helpers over the settings user layer ──────────────────────────────── */\r\n\r\n/** The user-layer `providers` value of the llm-pi-ai namespace, when present. */\r\nfunction providersOf(snapshot: unknown): Record<string, unknown> {\r\n if (typeof snapshot !== 'object' || snapshot === null) return {}\r\n const user = (snapshot as { user?: unknown }).user\r\n if (typeof user !== 'object' || user === null || Array.isArray(user)) return {}\r\n const providers = (user as Record<string, unknown>)['providers']\r\n return typeof providers === 'object' && providers !== null && !Array.isArray(providers)\r\n ? providers as Record<string, unknown>\r\n : {}\r\n}\r\n\r\n/** The user-layer `models`/`defaultContextWindow` of the llm-deepseek namespace. */\r\nfunction deepseekSectionOf(snapshot: unknown): {\r\n models?: Record<string, unknown>[]\r\n defaultContextWindow?: number\r\n} {\r\n if (typeof snapshot !== 'object' || snapshot === null) return {}\r\n const user = (snapshot as { user?: unknown }).user\r\n if (typeof user !== 'object' || user === null || Array.isArray(user)) return {}\r\n const section = user as { models?: unknown; defaultContextWindow?: unknown }\r\n const models = Array.isArray(section.models)\r\n ? section.models.filter((model): model is Record<string, unknown> =>\r\n typeof model === 'object' && model !== null && !Array.isArray(model))\r\n : undefined\r\n const defaultContextWindow = typeof section.defaultContextWindow === 'number'\r\n ? section.defaultContextWindow\r\n : undefined\r\n return {\r\n ...models === undefined ? {} : { models },\r\n ...defaultContextWindow === undefined ? {} : { defaultContextWindow },\r\n }\r\n}\r\n\r\n/** One model entry's declared contextWindow, when present. */\r\nfunction contextWindowOf(model: Record<string, unknown>): number | undefined {\r\n const value = model['contextWindow']\r\n return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : undefined\r\n}\r\n\r\n/** A provider's model entry in the llm-pi-ai user layer, when present. */\r\nfunction piModelEntry(\r\n providers: Record<string, unknown>,\r\n provider: string,\r\n model: string,\r\n): Record<string, unknown> | undefined {\r\n const profile = providers[provider] as { models?: unknown[] } | undefined\r\n const entry = profile !== undefined && Array.isArray(profile.models)\r\n ? profile.models.find((candidate): candidate is Record<string, unknown> =>\r\n typeof candidate === 'object' && candidate !== null && (candidate as Record<string, unknown>)['id'] === model)\r\n : undefined\r\n return entry\r\n}\r\n\r\n/** The slider stop nearest to a committed token count. */\r\nfunction stopIndexOf(value: number | undefined): number {\r\n if (value === undefined) return Math.max(0, UNSET_STOP_INDEX)\r\n let best = 0\r\n let bestDistance = Number.POSITIVE_INFINITY\r\n CONTEXT_WINDOW_PRESETS.forEach((preset, index) => {\r\n const distance = Math.abs(preset.value - value)\r\n if (distance < bestDistance) {\r\n bestDistance = distance\r\n best = index\r\n }\r\n })\r\n return best\r\n}\r\n\r\n/**\r\n * The model-seat panel: replaces the shipped model selector on this seat and\r\n * renders one picker whose every model line carries a context-window chip\r\n * (the \"max context window\" editor moved into each line).\r\n * @param props - injected directory + config forms, session seat, copy.\r\n */\r\nexport function ModelPanel({ directory, piAiScope, deepseekScope, t }: ModelPanelProps): JSX.Element {\r\n const state = useSyncExternalStore(\r\n listener => directory?.store.subscribe(listener) ?? (() => {}),\r\n () => directory?.store.getSnapshot() ?? UNAVAILABLE_STATE,\r\n )\r\n const piSnapshot = useSyncExternalStore(\r\n listener => piAiScope.subscribe(listener),\r\n () => piAiScope.getSnapshot(),\r\n )\r\n const dsSnapshot = useSyncExternalStore(\r\n listener => deepseekScope.subscribe(listener),\r\n () => deepseekScope.getSnapshot(),\r\n )\r\n\r\n const [open, setOpen] = useState(false)\r\n const [expanded, setExpanded] = useState<ReadonlySet<string>>(() => new Set())\r\n const [editing, setEditing] = useState<{ provider: string; model: string } | null>(null)\r\n const [draft, setDraft] = useState<number | null>(null)\r\n const [custom, setCustom] = useState(false)\r\n const [raw, setRaw] = useState('')\r\n const [error, setError] = useState<string | null>(null)\r\n const [busy, setBusy] = useState(false)\r\n const rootRef = useRef<HTMLDivElement>(null)\r\n\r\n useEffect(() => {\r\n if (!open) return\r\n directory?.load().catch(() => { /* surfaced on the shared store */ })\r\n }, [directory, open])\r\n\r\n const close = useCallback((): void => {\r\n setOpen(false)\r\n setEditing(null)\r\n setError(null)\r\n }, [])\r\n\r\n useEffect(() => {\r\n if (!open) return\r\n const onOutside = (event: globalThis.MouseEvent): void => {\r\n const target = event.target\r\n if (target instanceof Node && rootRef.current?.contains(target)) return\r\n close()\r\n }\r\n document.addEventListener('mousedown', onOutside)\r\n return () => document.removeEventListener('mousedown', onOutside)\r\n }, [close, open])\r\n\r\n const writable = piSnapshot.status === 'ready' && piSnapshot.writable\r\n && dsSnapshot.status === 'ready' && dsSnapshot.writable\r\n\r\n const current = useMemo(() => {\r\n if (state.current === null) return undefined\r\n for (const group of state.groups) {\r\n if (group.id !== state.current.provider) continue\r\n const model = group.models.find(candidate => candidate.id === state.current?.model)\r\n if (model !== undefined) return { model, name: model.name }\r\n }\r\n return undefined\r\n }, [state])\r\n\r\n const providers = useMemo(() => providersOf(piSnapshot), [piSnapshot])\r\n const dsSection = useMemo(() => deepseekSectionOf(dsSnapshot), [dsSnapshot])\r\n\r\n /** The effective window of one model line, resolved against its family. */\r\n const windowOf = (provider: string, model: string): number | undefined => {\r\n if (provider === DEEPSEEK_PROVIDER) {\r\n const models = dsSection.models ?? []\r\n const index = models.findIndex(entry => entry['id'] === model)\r\n return index >= 0 ? contextWindowOf(models[index]) : dsSection.defaultContextWindow\r\n }\r\n const entry = piModelEntry(providers, provider, model)\r\n return entry === undefined ? undefined : contextWindowOf(entry)\r\n }\r\n\r\n /** Whether one model line has a config write target. */\r\n const writableLine = (provider: string, model: string): boolean => {\r\n if (!writable) return false\r\n if (provider === DEEPSEEK_PROVIDER) return true\r\n return piModelEntry(providers, provider, model) !== undefined\r\n }\r\n\r\n /** Commit (or delete) one model line's context window. */\r\n const commitWindow = (provider: string, model: string, value: number | undefined): void => {\r\n setBusy(true)\r\n const done = (): void => { setBusy(false); setDraft(null) }\r\n if (provider === DEEPSEEK_PROVIDER) {\r\n const models = (deepseekSectionOf(dsSnapshot).models ?? []).map(entry => ({ ...entry }))\r\n const index = models.findIndex(entry => entry['id'] === model)\r\n const commit = index >= 0\r\n ? deepseekScope.set('models', models.map((entry, at) => {\r\n if (at !== index) return entry\r\n if (value === undefined) {\r\n const rest = { ...entry }\r\n delete rest['contextWindow']\r\n return rest\r\n }\r\n return { ...entry, contextWindow: value }\r\n }))\r\n : deepseekScope.set('defaultContextWindow', value === undefined ? DEEPSEEK_DEFAULT_WINDOW : value)\r\n commit.then(done, done)\r\n return\r\n }\r\n const next = structuredClone(providers)\r\n const entry = piModelEntry(next, provider, model)\r\n if (entry === undefined) {\r\n setBusy(false)\r\n setDraft(null)\r\n return\r\n }\r\n if (value === undefined) delete entry['contextWindow']\r\n else entry['contextWindow'] = value\r\n piAiScope.set('providers', next).then(done, done)\r\n }\r\n\r\n /** Validate and commit the custom input; empty clears. */\r\n const applyCustom = (): void => {\r\n if (editing === null) return\r\n const trimmed = raw.trim()\r\n if (trimmed === '') {\r\n setError(null)\r\n commitWindow(editing.provider, editing.model, undefined)\r\n return\r\n }\r\n const validation = validateContextWindow(trimmed)\r\n if (!validation.ok) {\r\n setError(t(validation.reason === 'integer' ? 'input.context.integer' : 'input.context.range'))\r\n return\r\n }\r\n setError(null)\r\n commitWindow(editing.provider, editing.model, validation.value)\r\n }\r\n\r\n const openEditor = (provider: string, model: string): void => {\r\n setEditing({ provider, model })\r\n setDraft(null)\r\n setCustom(false)\r\n setRaw('')\r\n setError(null)\r\n }\r\n\r\n const toggleProvider = (provider: string): void => {\r\n setExpanded(previous => {\r\n const next = new Set(previous)\r\n if (next.has(provider)) next.delete(provider)\r\n else next.add(provider)\r\n return next\r\n })\r\n }\r\n\r\n const chooseModel = (provider: string, model: string): void => {\r\n if (busy || directory === undefined) return\r\n setBusy(true)\r\n directory.select({ provider, model })\r\n .then(() => { setBusy(false); close() })\r\n .catch(() => { setBusy(false) })\r\n }\r\n\r\n /** Commit one model line's reasoning effort; empty string = provider default (omit the field). */\r\n const chooseEffort = (provider: string, model: string, effort: string): void => {\r\n if (busy || directory === undefined) return\r\n setBusy(true)\r\n directory.select({ provider, model, ...(effort === '' ? {} : { reasoningEffort: effort }) })\r\n .then(() => { setBusy(false) })\r\n .catch(() => { setBusy(false) })\r\n }\r\n\r\n const triggerLabel = current?.name ?? state.current?.model ?? t('model.panel.choose')\r\n\r\n const currentReasoning = current?.model.reasoning\r\n const effectiveEffort = state.current?.reasoningEffort ?? currentReasoning?.defaultEffort\r\n const effortLabel = currentReasoning === undefined\r\n ? undefined\r\n : effectiveEffort === undefined\r\n ? t('input.effort.default')\r\n : currentReasoning.efforts.find(level => level.id === effectiveEffort)?.name ?? effectiveEffort\r\n\r\n return (\r\n <div ref={rootRef} style={rootStyle}>\r\n <button\r\n type=\"button\"\r\n style={triggerStyle}\r\n aria-expanded={open}\r\n aria-haspopup=\"dialog\"\r\n aria-label={t('model.panel.choose')}\r\n title={state.current === null ? triggerLabel : `${state.current.provider}/${triggerLabel}`}\r\n onClick={() => { if (open) close(); else { setOpen(true); setError(null) } }}\r\n >\r\n <span style={triggerNameStyle}>{triggerLabel}</span>\r\n {effortLabel !== undefined && <span style={triggerEffortStyle}>{effortLabel}</span>}\r\n <span style={chevronStyle}>{open ? '▲' : '▼'}</span>\r\n </button>\r\n {open\r\n ? (\r\n <>\r\n <div style={backdropStyle} onClick={close} />\r\n <div style={popStyle} role=\"dialog\" aria-label={t('model.panel.choose')}>\r\n <div style={modelsStyle}>\r\n {directory === undefined && (\r\n <div style={statusStyle}>{t('model.panel.unavailable')}</div>\r\n )}\r\n {directory !== undefined && state.status === 'loading' && state.groups.length === 0 && (\r\n <div style={statusStyle}>{t('model.panel.loading')}</div>\r\n )}\r\n {directory !== undefined && state.groups.map(group => {\r\n const isExpanded = expanded.has(group.id)\r\n const name = group.name ?? group.label ?? group.id\r\n const activeModel = state.current?.provider === group.id ? state.current.model : undefined\r\n return (\r\n <section key={group.id}>\r\n <button\r\n type=\"button\"\r\n style={providerToggleStyle}\r\n aria-expanded={isExpanded}\r\n onClick={() => toggleProvider(group.id)}\r\n >\r\n <span style={providerNameStyle}>{name}</span>\r\n <span style={providerMetaStyle}>{group.models.length}</span>\r\n <span style={chevronStyle}>{isExpanded ? '▼' : '▶'}</span>\r\n </button>\r\n {isExpanded && group.models.map(model => {\r\n const active = activeModel === model.id\r\n const lineWritable = writableLine(group.id, model.id)\r\n const lineWindow = windowOf(group.id, model.id)\r\n const isEditing = editing !== null\r\n && editing.provider === group.id\r\n && editing.model === model.id\r\n const lineEffort = active\r\n ? state.current?.reasoningEffort ?? model.reasoning?.defaultEffort\r\n : model.reasoning?.defaultEffort\r\n return (\r\n <div key={group.id + ':' + model.id} style={active ? modelRowActiveStyle : modelRowStyle}>\r\n <button\r\n type=\"button\"\r\n role=\"option\"\r\n aria-selected={active}\r\n style={modelPickStyle}\r\n disabled={busy}\r\n onClick={() => chooseModel(group.id, model.id)}\r\n >\r\n <span style={modelCopyStyle}>\r\n <span style={modelNameStyle}>{model.name}</span>\r\n </span>\r\n {active && <span style={checkStyle} aria-hidden=\"true\">✓</span>}\r\n </button>\r\n {model.reasoning !== undefined && (\r\n <select\r\n aria-label={t('input.effort.title')}\r\n title={t('input.effort.title')}\r\n style={selectStyle}\r\n disabled={busy}\r\n value={lineEffort ?? ''}\r\n onClick={event => event.stopPropagation()}\r\n onChange={event => {\r\n event.stopPropagation()\r\n const value = event.currentTarget.value\r\n // '' (provider default) only exists for models declaring a\r\n // defaultEffort: the host keeps the current effort when a\r\n // selection omits reasoningEffort, so reset submits the\r\n // declared default instead.\r\n const target = value === '' ? model.reasoning?.defaultEffort : value\r\n if (target !== undefined) chooseEffort(group.id, model.id, target)\r\n }}\r\n >\r\n {model.reasoning.defaultEffort !== undefined && (\r\n <option value=\"\">{t('input.effort.default')}</option>\r\n )}\r\n {model.reasoning.defaultEffort === undefined && (\r\n <option value=\"\" hidden>{t('input.effort.default')}</option>\r\n )}\r\n {model.reasoning.efforts.map(level => (\r\n <option key={level.id} value={level.id}>{level.name}</option>\r\n ))}\r\n </select>\r\n )}\r\n <span\r\n role=\"button\"\r\n tabIndex={0}\r\n aria-label={t('input.context.title')}\r\n title={lineWritable\r\n ? t('input.context.globalHint')\r\n : t('model.panel.noTarget')}\r\n style={lineWritable && !busy ? chipStyle : chipDisabledStyle}\r\n onClick={event => {\r\n event.stopPropagation()\r\n if (!lineWritable || busy) return\r\n if (isEditing) { setEditing(null); return }\r\n openEditor(group.id, model.id)\r\n }}\r\n onKeyDown={event => {\r\n if (event.key !== 'Enter' && event.key !== ' ') return\r\n event.preventDefault()\r\n event.stopPropagation()\r\n if (!lineWritable || busy) return\r\n openEditor(group.id, model.id)\r\n }}\r\n >\r\n {lineWindow === undefined\r\n ? t('input.context.unset')\r\n : formatContextWindow(lineWindow)}\r\n </span>\r\n {isEditing && (\r\n <div style={editorRowStyle}>\r\n <span style={labelStyle} title={t('input.context.globalHint')}>\r\n {t('model.panel.window')}\r\n </span>\r\n <input\r\n type=\"range\"\r\n min={0}\r\n max={CONTEXT_WINDOW_PRESETS.length - 1}\r\n step={1}\r\n value={draft ?? stopIndexOf(lineWindow)}\r\n disabled={busy}\r\n aria-label={t('input.context.title')}\r\n style={sliderStyle}\r\n onChange={event => { setDraft(Number(event.currentTarget.value)) }}\r\n onPointerUp={() => {\r\n if (draft === null) return\r\n commitWindow(group.id, model.id, CONTEXT_WINDOW_PRESETS[draft]?.value)\r\n }}\r\n onKeyUp={() => {\r\n if (draft === null) return\r\n commitWindow(group.id, model.id, CONTEXT_WINDOW_PRESETS[draft]?.value)\r\n }}\r\n />\r\n <span style={valueStyle}>\r\n {draft === null\r\n ? lineWindow === undefined ? t('input.context.unset') : formatContextWindow(lineWindow)\r\n : formatContextWindow(CONTEXT_WINDOW_PRESETS[draft]?.value ?? 0)}\r\n </span>\r\n {custom\r\n ? (\r\n <>\r\n <input\r\n type=\"text\"\r\n inputMode=\"numeric\"\r\n value={raw}\r\n disabled={busy}\r\n placeholder={t('input.context.customPlaceholder')}\r\n aria-label={t('input.context.customPlaceholder')}\r\n style={inputStyle}\r\n onChange={event => { setRaw(event.currentTarget.value) }}\r\n onKeyDown={event => { if (event.key === 'Enter') applyCustom() }}\r\n />\r\n <button\r\n type=\"button\"\r\n disabled={busy}\r\n style={actionButtonStyle}\r\n onClick={applyCustom}\r\n >\r\n {t('input.context.apply')}\r\n </button>\r\n </>\r\n )\r\n : (\r\n <>\r\n <button\r\n type=\"button\"\r\n disabled={busy}\r\n aria-label={t('input.context.custom')}\r\n title={t('input.context.custom')}\r\n style={actionButtonStyle}\r\n onClick={() => { setCustom(true); setError(null) }}\r\n >\r\n ⋯\r\n </button>\r\n <button\r\n type=\"button\"\r\n disabled={busy || lineWindow === undefined}\r\n style={{\r\n ...actionButtonStyle,\r\n opacity: lineWindow === undefined ? 0.55 : 1,\r\n }}\r\n onClick={() => {\r\n setDraft(null)\r\n setError(null)\r\n commitWindow(group.id, model.id, undefined)\r\n }}\r\n >\r\n {t('input.context.clear')}\r\n </button>\r\n </>\r\n )}\r\n {error !== null && <span style={errorStyle}>{error}</span>}\r\n </div>\r\n )}\r\n </div>\r\n )\r\n })}\r\n </section>\r\n )\r\n })}\r\n {directory !== undefined && state.status !== 'loading' && state.groups.length === 0 && (\r\n <div style={statusStyle}>{t('model.panel.empty')}</div>\r\n )}\r\n </div>\r\n {directory !== undefined && state.error !== null && <div style={errorBannerStyle} role=\"status\">{state.error}</div>}\r\n </div>\r\n </>\r\n )\r\n : null}\r\n </div>\r\n )\r\n}\r\n\r\nexport default ModelPanel\r\n","/**\r\n * Thinking-levels settings card — the family settings tab face of the\r\n * dsh-thinking-levels plugin.\r\n *\r\n * The card binds this plugin's entry config through the `configForms` cordis\r\n * service and renders its fields: the level picker\r\n * (off / on / minimal / low / medium / high / xhigh / max / auto) plus the\r\n * scheduler toggles. Every change commits immediately through the scope (no\r\n * staged form): the decision is read per model request, so a committed change\r\n * applies to the next request without a restart.\r\n *\r\n * Below the scheduler rows, a \"model capabilities\" block edits the\r\n * `llm-pi-ai` namespace directly (read + write through the same settings\r\n * transport), borrowing dsh-thinking-effort's presentation: providers group\r\n * their models, each model row shows capability badges and expands into a\r\n * per-level editor where a level is ticked and its gateway wire value entered\r\n * (e.g. `high` → `ultra`); `off` left empty means \"do not send\". A search box\r\n * filters models and one-click presets apply official/generic level sets to\r\n * every thinking model.\r\n *\r\n * Kept dependency-free beyond react: the scopes are subscribed with\r\n * `useSyncExternalStore`, and the controls are plain HTML so the client bundle\r\n * needs no CSS modules and no primitives value import.\r\n */\r\nimport { useState, useSyncExternalStore } from 'react'\r\nimport type { CSSProperties, JSX } from 'react'\r\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\r\nimport type { SettingsScope } from './scope-face.ts'\r\nimport type { EffortId } from '../thinking-level.ts'\r\nimport { CONTEXT_WINDOW_PRESETS, formatContextWindow, validateContextWindow } from '../context-window.ts'\r\nimport type { ThinkingLevelsConfig } from '../index.ts'\r\n\r\n/** One injected face: the plugin's own scope plus the llm-pi-ai namespace scope. */\r\nexport interface ThinkingLevelsCardInjected {\r\n scope: SettingsScope<ThinkingLevelsConfig>\r\n /** The `llm-pi-ai` settings namespace, read and written for model capabilities. */\r\n piAiScope: SettingsScope<unknown>\r\n}\r\n\r\n/** Full props: locale seat + the injected scopes. */\r\nexport type ThinkingLevelsCardProps = PropsLocale<'thinking-levels'> & ThinkingLevelsCardInjected\r\n\r\n/** The user-facing levels, in picker order: eight standard levels plus the auto scheduler sentinel. */\r\nconst EFFORT_OPTIONS: readonly EffortId[] = [\r\n 'off', 'on', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'auto',\r\n]\r\n\r\n/**\r\n * The levels the capability editor offers. This is the llm-pi-ai\r\n * `reasoningEfforts` table-key space — pi-ai's fixed seven levels (schema\r\n * rejects any other key). `on` (the enable-thinking toggle) is a selector /\r\n * injection-level concept, expressed here by the `off` + `high` pair\r\n * (enable_thinking false/true), so it has no table key of its own.\r\n */\r\nconst CAPABILITY_LEVELS: readonly EffortId[] = [\r\n 'off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max',\r\n] as const\r\n\r\n/** One-click presets, mirroring dsh-thinking-effort: official DeepSeek style and a generic set. */\r\nconst PRESETS: readonly { key: 'official' | 'generic'; levels: Record<string, unknown> }[] = [\r\n { key: 'official', levels: { off: null, high: 'high', max: 'max' } },\r\n { key: 'generic', levels: { off: null, low: 'low', medium: 'medium', high: 'high' } },\r\n]\r\n\r\n/** The wire thinking formats offered (llm-pi-ai's nameable set, incl. qwen-chat-template). */\r\nconst THINKING_FORMATS = [\r\n 'openai', 'deepseek', 'openrouter', 'together', 'zai', 'qwen',\r\n 'qwen-chat-template', 'string-thinking', 'ant-ling',\r\n] as const\r\n\r\n/* ── shared row styling (inline; keeps the client bundle CSS-free) ──────── */\r\n\r\nconst rowStyle: CSSProperties = {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n gap: '12px',\r\n padding: '6px 0',\r\n fontSize: '13px',\r\n lineHeight: '20px',\r\n}\r\n\r\nconst labelStyle: CSSProperties = { margin: 0, color: 'var(--dsw-alias-label-primary)' }\r\n\r\nconst controlStyle: CSSProperties = {\r\n background: 'var(--dsw-alias-bg-surface, #fff)',\r\n color: 'var(--dsw-alias-label-primary)',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '4px',\r\n padding: '3px 8px',\r\n fontSize: '13px',\r\n}\r\n\r\nconst sectionStyle: CSSProperties = {\r\n marginTop: '14px',\r\n paddingTop: '12px',\r\n borderTop: '1px solid var(--dsw-alias-border-l2)',\r\n}\r\n\r\nconst fieldStyle: CSSProperties = { display: 'flex', flexDirection: 'column', gap: '4px' }\r\n\r\nconst fieldLabelStyle: CSSProperties = { margin: 0, fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-label-tertiary)' }\r\n\r\nconst hintStyle: CSSProperties = { margin: '6px 0 0', fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-label-tertiary)' }\r\n\r\n/** Provider group shell: an outlined row grouping its models. */\r\nconst providerStyle: CSSProperties = {\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '8px',\r\n margin: '8px 0 0',\r\n overflow: 'hidden',\r\n}\r\n\r\nconst providerHeadStyle: CSSProperties = {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '8px',\r\n padding: '7px 10px',\r\n background: 'var(--dsw-alias-bg-layer-2, rgba(127,127,127,0.06))',\r\n}\r\n\r\nconst providerNameStyle: CSSProperties = {\r\n margin: 0,\r\n flex: '1 1 auto',\r\n minWidth: 0,\r\n fontFamily: 'var(--ds-font-family-code, monospace)',\r\n fontSize: '12px',\r\n lineHeight: '18px',\r\n fontWeight: 600,\r\n color: 'var(--dsw-alias-label-primary)',\r\n overflowWrap: 'anywhere',\r\n}\r\n\r\nconst providerBadgeStyle: CSSProperties = {\r\n margin: 0,\r\n fontSize: '10px',\r\n lineHeight: '16px',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '4px',\r\n padding: '0 5px',\r\n whiteSpace: 'nowrap',\r\n}\r\n\r\nconst iconButtonStyle: CSSProperties = {\r\n background: 'none',\r\n border: 'none',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n cursor: 'pointer',\r\n padding: '2px 4px',\r\n display: 'inline-flex',\r\n alignItems: 'center',\r\n}\r\n\r\n/** One model row inside a provider group. */\r\nconst modelRowStyle: CSSProperties = {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '8px',\r\n padding: '7px 10px',\r\n borderTop: '1px solid var(--dsw-alias-border-l2)',\r\n}\r\n\r\nconst modelIdStyle: CSSProperties = {\r\n margin: 0,\r\n flex: '1 1 auto',\r\n minWidth: 0,\r\n fontFamily: 'var(--ds-font-family-code, monospace)',\r\n fontSize: '12px',\r\n lineHeight: '18px',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n overflowWrap: 'anywhere',\r\n}\r\n\r\n/** Capability badge chips (text / image / context). */\r\nconst badgeStyle: CSSProperties = {\r\n fontSize: '10px',\r\n lineHeight: '16px',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '4px',\r\n padding: '0 5px',\r\n whiteSpace: 'nowrap',\r\n}\r\n\r\n/** The per-level editor grid: one row per level with a toggle, a label and a wire input. */\r\nconst levelRowStyle: CSSProperties = {\r\n display: 'grid',\r\n gridTemplateColumns: 'auto 92px minmax(0, 1fr)',\r\n alignItems: 'center',\r\n gap: '8px',\r\n padding: '4px 0',\r\n fontSize: '13px',\r\n}\r\n\r\nconst levelNameStyle: CSSProperties = { margin: 0, fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-label-secondary)' }\r\n\r\nconst wireInputStyle: CSSProperties = {\r\n background: 'var(--dsw-alias-bg-surface, #fff)',\r\n color: 'var(--dsw-alias-label-primary)',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '4px',\r\n padding: '3px 8px',\r\n fontSize: '12px',\r\n width: '100%',\r\n boxSizing: 'border-box',\r\n}\r\n\r\n/* ── helpers over the llm-pi-ai user layer ─────────────────────────────── */\r\n\r\n/** A row's `reasoningEfforts` as stored in the user layer. */\r\nfunction effortsOf(model: Record<string, unknown>): false | Record<string, unknown> | undefined {\r\n const value = model['reasoningEfforts']\r\n if (value === false) return false\r\n if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\r\n return value as Record<string, unknown>\r\n }\r\n return undefined\r\n}\r\n\r\n/**\r\n * Build a `reasoningEfforts` table from a level→wire draft. `off` maps to\r\n * `null` (omit the reasoning option → enable_thinking false) unless the user\r\n * typed a wire value; every other ticked level keeps its typed wire value.\r\n * pi-ai rejects a table offering nothing beyond `off`, so a selection of only\r\n * `off` falls back to the default `high` level.\r\n */\r\nfunction effortTableOf(draft: Record<string, string | null>): Record<string, unknown> {\r\n const table: Record<string, unknown> = {}\r\n for (const level of CAPABILITY_LEVELS) {\r\n const wire = draft[level]\r\n if (wire === undefined || wire === null) continue\r\n const trimmed = typeof wire === 'string' ? wire.trim() : ''\r\n if (level === 'off') table[level] = trimmed === '' ? null : trimmed\r\n else if (trimmed !== '') table[level] = trimmed\r\n }\r\n if (Object.keys(table).length === 0 || Object.keys(table).every(level => table[level] === null)) {\r\n return { ...table, high: 'high' }\r\n }\r\n return table\r\n}\r\n\r\n/** Whether a row declares `compat.supportsReasoningEffort` (the wire sends reasoning_effort). */\r\nfunction supportsEffortOf(model: Record<string, unknown>): boolean {\r\n const compat = model['compat']\r\n if (typeof compat !== 'object' || compat === null || Array.isArray(compat)) return false\r\n return (compat as Record<string, unknown>)['supportsReasoningEffort'] === true\r\n}\r\n\r\n/** Patch one row's `compat` object, merging rather than replacing sibling fields. */\r\nfunction patchCompat(\r\n row: Record<string, unknown>,\r\n patch: (compat: Record<string, unknown>) => void,\r\n): void {\r\n const compat = typeof row['compat'] === 'object' && row['compat'] !== null && !Array.isArray(row['compat'])\r\n ? { ...(row['compat'] as Record<string, unknown>) }\r\n : {}\r\n patch(compat)\r\n if (Object.keys(compat).length === 0) delete row['compat']\r\n else row['compat'] = compat\r\n}\r\n\r\n/** The user-layer `providers` value of the llm-pi-ai namespace, when present. */\r\nfunction providersOf(snapshot: unknown): Record<string, unknown> {\r\n if (typeof snapshot !== 'object' || snapshot === null) return {}\r\n const user = (snapshot as { user?: unknown }).user\r\n if (typeof user !== 'object' || user === null || Array.isArray(user)) return {}\r\n const providers = (user as Record<string, unknown>)['providers']\r\n return typeof providers === 'object' && providers !== null && !Array.isArray(providers)\r\n ? providers as Record<string, unknown>\r\n : {}\r\n}\r\n\r\n/** Whether a route-level profile declares `compat.supportsDeveloperRole: false`. */\r\nfunction developerRoleDisabledOf(profile: unknown): boolean {\r\n if (typeof profile !== 'object' || profile === null) return false\r\n const compat = (profile as Record<string, unknown>)['compat']\r\n if (typeof compat !== 'object' || compat === null || Array.isArray(compat)) return false\r\n return (compat as Record<string, unknown>)['supportsDeveloperRole'] === false\r\n}\r\n\r\n/** One flattened capability entry: a provider's model at an array index. */\r\ninterface CapabilityEntry {\r\n providerId: string\r\n index: number\r\n model: Record<string, unknown>\r\n modelId: string\r\n /** The provider-level `compat`, applied to models that declare none (display parity). */\r\n providerCompat?: unknown\r\n /** The provider-level `defaultInput`, applied to models that declare none (display parity). */\r\n providerInput?: unknown[]\r\n}\r\n\r\n/** The effective `compat` of an entry: its own `compat` merged over the provider-level `compat`. */\r\nfunction compatOf(entry: CapabilityEntry): Record<string, unknown> {\r\n const base = typeof entry.providerCompat === 'object' && entry.providerCompat !== null\r\n ? entry.providerCompat as Record<string, unknown>\r\n : {}\r\n const own = entry.model['compat']\r\n return typeof own === 'object' && own !== null && !Array.isArray(own)\r\n ? { ...base, ...(own as Record<string, unknown>) }\r\n : base\r\n}\r\n\r\n/** Flatten the user-layer providers into capability entries (models arrays only). */\r\nfunction entriesOf(providers: Record<string, unknown>): CapabilityEntry[] {\r\n return Object.entries(providers).flatMap(([providerId, profile]) => {\r\n const raw = profile as Record<string, unknown>\r\n const models = raw['models']\r\n if (!Array.isArray(models)) return []\r\n const providerCompat = raw['compat']\r\n const providerInput = Array.isArray(raw['defaultInput']) ? raw['defaultInput'] as unknown[] : undefined\r\n return models.map((model, index) => ({\r\n providerId,\r\n index,\r\n model: (typeof model === 'object' && model !== null && !Array.isArray(model)\r\n ? model as Record<string, unknown>\r\n : {}),\r\n modelId: typeof model === 'object' && model !== null && typeof (model as Record<string, unknown>)['id'] === 'string'\r\n ? (model as Record<string, unknown>)['id'] as string\r\n : `#${index + 1}`,\r\n providerCompat,\r\n providerInput,\r\n }))\r\n })\r\n}\r\n\r\n/** Human-readable capability summary of one entry (input modalities + declared context window). */\r\nfunction summaryOf(entry: CapabilityEntry): { text: boolean; image: boolean; context: string | null } {\r\n // Modalities fall back to the provider-level `defaultInput` so a vision\r\n // gateway declared once on the route shows every model as vision, matching\r\n // llm-pi-ai's resolution and the adapter's runtime gate.\r\n const input = Array.isArray(entry.model['input'])\r\n ? entry.model['input'] as unknown[]\r\n : entry.providerInput\r\n const text = !Array.isArray(input) || input.length === 0 || input.includes('text')\r\n const image = Array.isArray(input) && input.includes('image')\r\n const contextWindow = entry.model['contextWindow']\r\n const context = typeof contextWindow === 'number' && Number.isFinite(contextWindow) && contextWindow > 0\r\n ? formatContextWindow(contextWindow)\r\n : null\r\n return { text, image, context }\r\n}\r\n\r\n/** A tiny inline chevron icon (no CSS modules). */\r\nfunction ChevronIcon({ open }: { open: boolean }): JSX.Element {\r\n return (\r\n <svg\r\n width=\"12\" height=\"12\" viewBox=\"0 0 16 16\" aria-hidden\r\n style={{ transform: open ? 'rotate(180deg)' : 'none', transition: 'transform 0.16s' }}\r\n >\r\n <path d=\"M4 6l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\r\n </svg>\r\n )\r\n}\r\n\r\n/**\r\n * The llm-pi-ai model-capability editor block (dsh-thinking-effort style:\r\n * provider groups, model rows with badges, per-level wire editors, search and\r\n * one-click presets).\r\n * @param scope - the `llm-pi-ai` namespace scope.\r\n * @param t - copy lookup.\r\n * @param readonly - whether writes are forbidden.\r\n * @returns the capabilities block, or a placeholder when nothing is configured.\r\n */\r\nfunction ModelCapabilities(props: {\r\n scope: SettingsScope<unknown>\r\n t: (key: string) => string\r\n readonly: boolean\r\n}): JSX.Element {\r\n const { scope, t, readonly } = props\r\n const snapshot = useSyncExternalStore(\r\n (listener) => scope.subscribe(listener),\r\n () => scope.getSnapshot(),\r\n )\r\n const unavailable = snapshot.status === 'unavailable'\r\n const providers = snapshot.status === 'ready' ? providersOf(snapshot) : {}\r\n // Every llm-pi-ai provider is listed with its models — no list gating: the\r\n // official compat surface (dsh ≥ rc.8) means pi-ai serves every route\r\n // natively, so each model is editable right here.\r\n const allEntries = entriesOf(providers)\r\n\r\n // UI-only state: provider/model expansion, the wire drafts, and the query.\r\n const [query, setQuery] = useState('')\r\n const [expandedProviders, setExpandedProviders] = useState<Record<string, boolean>>({})\r\n const [expandedModels, setExpandedModels] = useState<Record<string, boolean>>({})\r\n const [drafts, setDrafts] = useState<Record<string, Record<string, string | null>>>({})\r\n const [busy, setBusy] = useState(false)\r\n const [contextRaw, setContextRaw] = useState<Record<string, string>>({})\r\n const [contextError, setContextError] = useState<Record<string, string>>({})\r\n\r\n const entryKey = (entry: CapabilityEntry): string => `${entry.providerId}\\u0000${entry.index}`\r\n\r\n /** Commit one patch over the user-layer providers. */\r\n const commitProviders = (mutate: (current: Record<string, unknown>) => Record<string, unknown>): void => {\r\n if (snapshot.status !== 'ready' || readonly) return\r\n setBusy(true)\r\n void scope.set('providers', mutate(structuredClone(providers)))\r\n .then(() => { setBusy(false) })\r\n .catch(() => { setBusy(false) })\r\n }\r\n\r\n /** Toggle the route-level official compat flag: unchecked = inherit (unset). */\r\n const toggleDeveloperRole = (providerId: string, next: boolean): void => {\r\n commitProviders((current) => {\r\n const profile = current[providerId] as Record<string, unknown> | undefined\r\n if (profile === undefined) return current\r\n const compat = typeof profile['compat'] === 'object' && profile['compat'] !== null && !Array.isArray(profile['compat'])\r\n ? { ...(profile['compat'] as Record<string, unknown>) }\r\n : {}\r\n if (next) compat['supportsDeveloperRole'] = false\r\n else delete compat['supportsDeveloperRole']\r\n if (Object.keys(compat).length === 0) delete profile['compat']\r\n else profile['compat'] = compat\r\n return current\r\n })\r\n }\r\n\r\n /** Patch one model row of one provider. */\r\n const patchModel = (\r\n providerId: string,\r\n index: number,\r\n patch: (model: Record<string, unknown>) => void,\r\n ): void => {\r\n commitProviders((current) => {\r\n const profile = current[providerId] as { models?: unknown[] } | undefined\r\n if (profile === undefined || !Array.isArray(profile.models)) return current\r\n const model = profile.models[index]\r\n if (typeof model !== 'object' || model === null) return current\r\n patch(model as Record<string, unknown>)\r\n return current\r\n })\r\n }\r\n\r\n /** Toggle whether a model is a thinking model (reasoningEfforts table vs false). */\r\n const toggleThinking = (entry: CapabilityEntry, next: boolean): void => {\r\n patchModel(entry.providerId, entry.index, (row) => {\r\n if (next) {\r\n // Thinking on: a table must exist so the wire drives enable_thinking /\r\n // reasoning_effort. Start from the persisted table or the default high\r\n // set; a toggle model (no effort) keeps supportsReasoningEffort false.\r\n const effortCapable = supportsEffortOf(row)\r\n row['reasoningEfforts'] = effortCapable\r\n ? effortTableOf({ high: 'high' })\r\n : { off: null, high: 'high' }\r\n // Toggle-style thinking models need the official qwen format so pi-ai\r\n // sends enable_thinking (early vLLM thinking models return no thinking\r\n // content without that flag, and reject reasoning_effort). Only fills\r\n // an absent format — an explicit choice is never clobbered.\r\n if (!effortCapable) {\r\n patchCompat(row, (compat) => {\r\n if (compat['thinkingFormat'] === undefined) compat['thinkingFormat'] = 'qwen-chat-template'\r\n })\r\n }\r\n } else {\r\n // Thinking off: a non-reasoning model never takes an effort.\r\n row['reasoningEfforts'] = false\r\n }\r\n })\r\n }\r\n\r\n /** Toggle whether a model accepts reasoning_effort levels. */\r\n const toggleEffortCapable = (entry: CapabilityEntry, next: boolean): void => {\r\n patchModel(entry.providerId, entry.index, (row) => {\r\n patchCompat(row, (compat) => {\r\n compat['supportsReasoningEffort'] = next\r\n // Counterpart of the auto-fill in toggleThinking: effort-capable rows\r\n // need reasoning_effort on the wire, so drop the toggle-style qwen\r\n // format when effort turns on (it would drive enable_thinking instead).\r\n if (next && compat['thinkingFormat'] === 'qwen-chat-template') delete compat['thinkingFormat']\r\n })\r\n })\r\n }\r\n\r\n /** Apply one model's wire draft as its `reasoningEfforts` table. */\r\n const applyDraft = (entry: CapabilityEntry): void => {\r\n const key = entryKey(entry)\r\n const draft = drafts[key]\r\n if (draft === undefined) return\r\n const table = effortTableOf(draft)\r\n patchModel(entry.providerId, entry.index, (row) => {\r\n row['reasoningEfforts'] = table\r\n // Mark effort support only when the model already had it or the user\r\n // ticked a reasoning_effort-only level (minimal/low/medium/xhigh/max).\r\n // A toggle-only model (Qwen3.6: off/high = enable_thinking) must keep\r\n // supportsReasoningEffort false — flipping it would make the adapter\r\n // send a reasoning_effort the gateway rejects (400).\r\n const extended = Object.keys(table).some(level => level !== 'off' && level !== 'on' && level !== 'high')\r\n if (supportsEffortOf(row) || extended) {\r\n patchCompat(row, (compat) => {\r\n compat['supportsReasoningEffort'] = true\r\n })\r\n }\r\n })\r\n }\r\n\r\n /** Reset a model's draft to its persisted table (or the default high set). */\r\n const resetDraft = (entry: CapabilityEntry): void => {\r\n const key = entryKey(entry)\r\n setDrafts(current => {\r\n const next = { ...current }\r\n const table = effortsOf(entry.model)\r\n if (typeof table === 'object' && table !== null) {\r\n next[key] = Object.fromEntries(CAPABILITY_LEVELS.map(level => [\r\n level,\r\n table[level] === undefined ? null : (table[level] === null ? '' : String(table[level])),\r\n ]))\r\n } else {\r\n next[key] = { off: '', high: 'high' }\r\n }\r\n return next\r\n })\r\n }\r\n\r\n /** Seed a model's draft when it is first expanded. */\r\n const ensureDraft = (entry: CapabilityEntry): void => {\r\n const key = entryKey(entry)\r\n setDrafts(current => {\r\n if (current[key] !== undefined) return current\r\n const next = { ...current }\r\n const table = effortsOf(entry.model)\r\n if (typeof table === 'object' && table !== null) {\r\n next[key] = Object.fromEntries(CAPABILITY_LEVELS.map(level => [\r\n level,\r\n table[level] === undefined ? null : (table[level] === null ? '' : String(table[level])),\r\n ]))\r\n } else {\r\n next[key] = { off: '', high: 'high' }\r\n }\r\n return next\r\n })\r\n }\r\n\r\n /** Apply a one-click preset to every thinking model. */\r\n const applyPreset = (levels: Record<string, unknown>): void => {\r\n commitProviders((current) => {\r\n for (const entry of entriesOf(current)) {\r\n const profile = current[entry.providerId] as { models?: unknown[] } | undefined\r\n if (profile === undefined || !Array.isArray(profile.models)) continue\r\n const model = profile.models[entry.index]\r\n if (typeof model !== 'object' || model === null) continue\r\n const row = model as Record<string, unknown>\r\n if (effortsOf(row) === undefined) continue // only thinking models\r\n // Replace the table but never touch supportsReasoningEffort: a\r\n // toggle-only model (Qwen3.6) must stay Off/On (enable_thinking), so\r\n // the request guard keeps clamping any injected level to its default\r\n // strength instead of sending a reasoning_effort the gateway rejects.\r\n row['reasoningEfforts'] = levels\r\n }\r\n return current\r\n })\r\n }\r\n\r\n /** Seed a model's context-window input when it is first expanded. */\r\n const seedContext = (entry: CapabilityEntry): void => {\r\n const key = entryKey(entry)\r\n setContextRaw(current => {\r\n if (current[key] !== undefined) return current\r\n const value = entry.model['contextWindow']\r\n return {\r\n ...current,\r\n [key]: typeof value === 'number' && Number.isFinite(value) ? String(value) : '',\r\n }\r\n })\r\n }\r\n\r\n /** Write (or delete) a model's `contextWindow` in the llm-pi-ai entry. */\r\n const commitContextWindow = (entry: CapabilityEntry, value: number | undefined): void => {\r\n const key = entryKey(entry)\r\n patchModel(entry.providerId, entry.index, (row) => {\r\n if (value === undefined) delete row['contextWindow']\r\n else row['contextWindow'] = value\r\n })\r\n setContextError(current => {\r\n const next = { ...current }\r\n delete next[key]\r\n return next\r\n })\r\n }\r\n\r\n /** Apply one preset immediately. */\r\n const applyContextPreset = (entry: CapabilityEntry, value: number): void => {\r\n const key = entryKey(entry)\r\n setContextRaw(current => ({ ...current, [key]: String(value) }))\r\n commitContextWindow(entry, value)\r\n }\r\n\r\n /** Validate and commit the custom input (blur / Enter); empty clears it. */\r\n const applyContextInput = (entry: CapabilityEntry): void => {\r\n const key = entryKey(entry)\r\n const raw = (contextRaw[key] ?? '').trim()\r\n if (raw === '') {\r\n commitContextWindow(entry, undefined)\r\n return\r\n }\r\n const validation = validateContextWindow(raw)\r\n if (!validation.ok) {\r\n setContextError(current => ({\r\n ...current,\r\n [key]: t(validation.reason === 'integer'\r\n ? 'card.capabilities.contextInteger'\r\n : 'card.capabilities.contextRange'),\r\n }))\r\n return\r\n }\r\n commitContextWindow(entry, validation.value)\r\n }\r\n\r\n /** Clear the model's context-window declaration (delete the field). */\r\n const clearContext = (entry: CapabilityEntry): void => {\r\n const key = entryKey(entry)\r\n setContextRaw(current => ({ ...current, [key]: '' }))\r\n commitContextWindow(entry, undefined)\r\n }\r\n\r\n if (unavailable) {\r\n return (\r\n <div style={sectionStyle}>\r\n <p style={hintStyle}>{t('card.capabilities.unavailable')}</p>\r\n </div>\r\n )\r\n }\r\n if (allEntries.length === 0) {\r\n return (\r\n <div style={sectionStyle}>\r\n <p style={fieldLabelStyle}>{t('card.capabilities')}</p>\r\n <p style={hintStyle}>{t('card.capabilities.empty')}</p>\r\n </div>\r\n )\r\n }\r\n\r\n const needle = query.trim().toLowerCase()\r\n const visible = needle === ''\r\n ? allEntries\r\n : allEntries.filter(entry =>\r\n entry.modelId.toLowerCase().includes(needle)\r\n || entry.providerId.toLowerCase().includes(needle))\r\n const providerIds = [...new Set(visible.map(entry => entry.providerId))]\r\n\r\n return (\r\n <div style={sectionStyle}>\r\n <p style={fieldLabelStyle}>{t('card.capabilities')}</p>\r\n <p style={hintStyle}>{t('card.capabilities.hint')}</p>\r\n\r\n {/* Search + one-click presets */}\r\n <div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap', alignItems: 'center', margin: '8px 0 2px' }}>\r\n <input\r\n type=\"text\"\r\n value={query}\r\n placeholder={t('card.capabilities.search')}\r\n disabled={readonly || busy}\r\n style={{ ...controlStyle, flex: '1 1 160px', minWidth: '140px' }}\r\n onChange={(event) => setQuery(event.currentTarget.value)}\r\n />\r\n {PRESETS.map(preset => (\r\n <button\r\n key={preset.key}\r\n type=\"button\"\r\n disabled={readonly || busy}\r\n onClick={() => applyPreset(preset.levels)}\r\n style={{\r\n ...controlStyle,\r\n cursor: readonly || busy ? 'default' : 'pointer',\r\n opacity: readonly || busy ? 0.5 : 1,\r\n }}\r\n >\r\n {t(`card.capabilities.preset${preset.key === 'official' ? 'Official' : 'Generic'}`)}\r\n </button>\r\n ))}\r\n </div>\r\n\r\n {visible.length === 0\r\n ? <p style={hintStyle}>{t('card.capabilities.noMatches')}</p>\r\n : providerIds.map(providerId => {\r\n const providerEntries = visible.filter(entry => entry.providerId === providerId)\r\n const providerOpen = expandedProviders[providerId] === true || needle !== ''\r\n return (\r\n <div key={providerId} style={providerStyle}>\r\n <div style={providerHeadStyle}>\r\n <button\r\n type=\"button\"\r\n aria-expanded={providerOpen}\r\n disabled={readonly || busy}\r\n onClick={() => setExpandedProviders(current => ({\r\n ...current,\r\n [providerId]: current[providerId] !== true,\r\n }))}\r\n style={{\r\n ...iconButtonStyle,\r\n cursor: readonly || busy ? 'default' : 'pointer',\r\n }}\r\n title={providerOpen ? t('card.capabilities.collapseProvider') : t('card.capabilities.expandProvider')}\r\n >\r\n <ChevronIcon open={providerOpen} />\r\n </button>\r\n <p style={providerNameStyle}>{providerId}</p>\r\n <label\r\n style={{ display: 'inline-flex', alignItems: 'center', gap: '5px', fontSize: '11px', whiteSpace: 'nowrap', color: 'var(--dsw-alias-label-secondary)' }}\r\n title={t('card.capabilities.developerRoleHint')}\r\n >\r\n <input\r\n type=\"checkbox\"\r\n checked={developerRoleDisabledOf(providers[providerId])}\r\n disabled={readonly || busy}\r\n onChange={(event) => toggleDeveloperRole(providerId, event.currentTarget.checked)}\r\n />\r\n <span>{t('card.capabilities.developerRole')}</span>\r\n </label>\r\n <p style={providerBadgeStyle}>{providerEntries.length}</p>\r\n </div>\r\n {providerOpen\r\n ? providerEntries.map(entry => {\r\n const key = entryKey(entry)\r\n const modelOpen = expandedModels[key] === true\r\n const efforts = effortsOf(entry.model)\r\n const thinking = typeof efforts === 'object'\r\n // Display falls back to the provider-level `compat` so a\r\n // route-declared thinking/effort posture shows on every model.\r\n const compat = compatOf(entry)\r\n const supportsEffort = compat['supportsReasoningEffort'] === true\r\n const meta = summaryOf(entry)\r\n const format = typeof compat['thinkingFormat'] === 'string'\r\n ? compat['thinkingFormat']\r\n : undefined\r\n return (\r\n <div key={key}>\r\n <div style={modelRowStyle}>\r\n <button\r\n type=\"button\"\r\n aria-expanded={modelOpen}\r\n disabled={readonly || busy}\r\n onClick={() => {\r\n const next = expandedModels[key] !== true\r\n setExpandedModels(current => ({ ...current, [key]: next }))\r\n if (next) { ensureDraft(entry); seedContext(entry) }\r\n }}\r\n style={{\r\n ...iconButtonStyle,\r\n cursor: readonly || busy ? 'default' : 'pointer',\r\n }}\r\n title={modelOpen ? t('card.capabilities.closeModelSettings') : t('card.capabilities.openModelSettings')}\r\n >\r\n <ChevronIcon open={modelOpen} />\r\n </button>\r\n <p style={modelIdStyle}>{entry.modelId}</p>\r\n <span style={badgeStyle} title=\"text\">{meta.text ? 'T' : '–'}</span>\r\n <span style={badgeStyle} title=\"image\">{meta.image ? 'IMG' : '–'}</span>\r\n {meta.context !== null && <span style={badgeStyle}>{meta.context}</span>}\r\n {thinking && !supportsEffort && <span style={badgeStyle}>On/Off</span>}\r\n </div>\r\n {modelOpen\r\n ? (\r\n <div style={{ padding: '4px 10px 10px', borderTop: '1px solid var(--dsw-alias-border-l2)' }}>\r\n {/* Layer 1 — base capabilities: is it a thinking model? A vision model? */}\r\n <div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap', margin: '2px 0 8px' }}>\r\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px' }}>\r\n <input\r\n type=\"checkbox\"\r\n checked={thinking}\r\n disabled={readonly || busy}\r\n onChange={(event) => toggleThinking(entry, event.currentTarget.checked)}\r\n />\r\n <span>{t('card.capabilities.thinking')}</span>\r\n </label>\r\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px' }}>\r\n <input\r\n type=\"checkbox\"\r\n checked={meta.image}\r\n disabled={readonly || busy}\r\n onChange={(event) => {\r\n patchModel(entry.providerId, entry.index, (row) => {\r\n // Image input implies text input; the pair is written together.\r\n row['input'] = event.currentTarget.checked ? ['text', 'image'] : ['text']\r\n })\r\n }}\r\n />\r\n <span>{t('card.capabilities.vision')}</span>\r\n </label>\r\n </div>\r\n {/* Layer 2 — only for thinking models: does it take reasoning_effort levels? */}\r\n {thinking\r\n ? (\r\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px', margin: '0 0 8px' }}>\r\n <input\r\n type=\"checkbox\"\r\n checked={supportsEffort}\r\n disabled={readonly || busy}\r\n onChange={(event) => toggleEffortCapable(entry, event.currentTarget.checked)}\r\n />\r\n <span>{t('card.capabilities.supportsEffort')}</span>\r\n </label>\r\n )\r\n : null}\r\n {thinking && supportsEffort\r\n ? (\r\n <>\r\n {/* Per-level wire editor — only for effort-capable thinking models */}\r\n <p style={fieldLabelStyle}>{t('card.capabilities.efforts')}</p>\r\n <div style={{ margin: '4px 0 6px' }}>\r\n {CAPABILITY_LEVELS.map(level => {\r\n const wire = drafts[key]?.[level]\r\n const on = wire !== undefined && wire !== null\r\n return (\r\n <div key={level} style={levelRowStyle}>\r\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px' }}>\r\n <input\r\n type=\"checkbox\"\r\n checked={on}\r\n disabled={readonly || busy}\r\n onChange={(event) => {\r\n const checked = event.currentTarget.checked\r\n setDrafts(current => {\r\n const draft = { ...(current[key] ?? {}) }\r\n draft[level] = checked\r\n ? (level === 'off' ? '' : level)\r\n : null\r\n return { ...current, [key]: draft }\r\n })\r\n }}\r\n />\r\n <span>{level}</span>\r\n </label>\r\n <span style={levelNameStyle}>{level === 'off' ? t('card.capabilities.offPlaceholder') : '→'}</span>\r\n <input\r\n type=\"text\"\r\n value={wire ?? ''}\r\n disabled={readonly || busy || !on}\r\n placeholder={t('card.capabilities.wirePlaceholder')}\r\n style={wireInputStyle}\r\n onChange={(event) => {\r\n setDrafts(current => {\r\n const draft = { ...(current[key] ?? {}) }\r\n draft[level] = event.currentTarget.value\r\n return { ...current, [key]: draft }\r\n })\r\n }}\r\n />\r\n </div>\r\n )\r\n })}\r\n </div>\r\n <div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>\r\n <button\r\n type=\"button\"\r\n disabled={readonly || busy}\r\n onClick={() => applyDraft(entry)}\r\n style={{\r\n ...controlStyle,\r\n cursor: readonly || busy ? 'default' : 'pointer',\r\n opacity: readonly || busy ? 0.5 : 1,\r\n }}\r\n >\r\n {t('card.capabilities.applyLevel')}\r\n </button>\r\n <button\r\n type=\"button\"\r\n disabled={readonly || busy}\r\n onClick={() => resetDraft(entry)}\r\n style={{\r\n ...controlStyle,\r\n cursor: readonly || busy ? 'default' : 'pointer',\r\n opacity: readonly || busy ? 0.5 : 1,\r\n }}\r\n >\r\n {t('card.capabilities.restoreDefault')}\r\n </button>\r\n </div>\r\n </>\r\n )\r\n : null}\r\n {/* Layer 4 — thinking format (wire serialization) */}\r\n <div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap', marginTop: '10px' }}>\r\n <label style={fieldStyle}>\r\n <span style={fieldLabelStyle}>{t('card.capabilities.thinkingFormat')}</span>\r\n <select\r\n style={controlStyle}\r\n value={format ?? 'inherit'}\r\n disabled={readonly || busy}\r\n onChange={(event) => {\r\n const next = event.currentTarget.value\r\n patchModel(entry.providerId, entry.index, (row) => {\r\n patchCompat(row, (compat) => {\r\n if (next === 'inherit') delete compat['thinkingFormat']\r\n else compat['thinkingFormat'] = next\r\n })\r\n })\r\n }}\r\n >\r\n <option value=\"inherit\">{t('card.capabilities.thinkingFormat.inherit')}</option>\r\n {THINKING_FORMATS.map(formatOption => (\r\n <option key={formatOption} value={formatOption}>{formatOption}</option>\r\n ))}\r\n </select>\r\n </label>\r\n </div>\r\n {/* Context-window limit: presets + custom integer (written to llm-pi-ai, live on next request) */}\r\n <div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap', marginTop: '10px' }}>\r\n <label style={fieldStyle}>\r\n <span style={fieldLabelStyle}>{t('card.capabilities.contextWindow')}</span>\r\n <div style={{ display: 'flex', gap: '6px', flexWrap: 'wrap', alignItems: 'center' }}>\r\n {CONTEXT_WINDOW_PRESETS.map(preset => (\r\n <button\r\n key={preset.value}\r\n type=\"button\"\r\n disabled={readonly || busy}\r\n onClick={() => applyContextPreset(entry, preset.value)}\r\n style={{\r\n ...controlStyle,\r\n padding: '2px 8px',\r\n cursor: readonly || busy ? 'default' : 'pointer',\r\n opacity: readonly || busy ? 0.5 : 1,\r\n }}\r\n >\r\n {preset.label}\r\n </button>\r\n ))}\r\n <input\r\n type=\"text\"\r\n value={contextRaw[key] ?? ''}\r\n disabled={readonly || busy}\r\n placeholder={t('card.capabilities.contextCustomPlaceholder')}\r\n style={{ ...controlStyle, width: '120px' }}\r\n onChange={(event) => {\r\n const next = event.currentTarget.value\r\n setContextRaw(current => ({ ...current, [key]: next }))\r\n }}\r\n onBlur={() => applyContextInput(entry)}\r\n onKeyDown={(event) => {\r\n if (event.key === 'Enter') event.currentTarget.blur()\r\n }}\r\n />\r\n <button\r\n type=\"button\"\r\n disabled={readonly || busy}\r\n onClick={() => clearContext(entry)}\r\n style={{\r\n ...controlStyle,\r\n cursor: readonly || busy ? 'default' : 'pointer',\r\n opacity: readonly || busy ? 0.5 : 1,\r\n }}\r\n >\r\n {t('card.capabilities.contextClear')}\r\n </button>\r\n </div>\r\n {contextError[key] !== undefined\r\n ? (\r\n <span style={{ margin: 0, fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-danger, #e5484d)' }}>\r\n {contextError[key]}\r\n </span>\r\n )\r\n : null}\r\n </label>\r\n </div>\r\n </div>\r\n )\r\n : null}\r\n </div>\r\n )\r\n })\r\n : null}\r\n </div>\r\n )\r\n })}\r\n {readonly ? <p style={hintStyle}>{t('card.readonly')}</p> : null}\r\n </div>\r\n )\r\n}\r\n\r\n/**\r\n * The card body, wrapped in a disclosure shell like every peer settings card:\r\n * a header (name + description + chevron) that toggles the body, expanded by\r\n * default so the family section reads as an open page of drawers.\r\n * @param props - locale copy and the injected scopes.\r\n */\r\nexport function ThinkingLevelsCard({ t, scope, piAiScope }: ThinkingLevelsCardProps): JSX.Element {\r\n const [open, setOpen] = useState(true)\r\n const snapshot = useSyncExternalStore(\r\n (listener) => scope.subscribe(listener),\r\n () => scope.getSnapshot(),\r\n )\r\n const unavailable = snapshot.status === 'unavailable'\r\n const readonly = unavailable || !snapshot.writable\r\n // configForms serves the STORED doc: volatile fields arrive as plain values\r\n // (simplify() unwraps the live refs before persistence), so the card sees a\r\n // plain config shape even though the host-side type carries Volatile unions.\r\n const value = (snapshot.value ?? {}) as unknown as Partial<{\r\n enabled: boolean\r\n level: EffortId\r\n allowDowngrade: boolean\r\n allowUpgrade: boolean\r\n }>\r\n const level = EFFORT_OPTIONS.includes(value.level as EffortId) ? value.level as EffortId : 'auto'\r\n\r\n return (\r\n <div style={{\r\n border: '1px solid var(--dsw-alias-border-l2, rgba(127,127,127,0.35))',\r\n background: 'var(--dsw-alias-bg-layer-3, rgba(127,127,127,0.05))',\r\n borderRadius: '12px',\r\n transition: 'border-color 0.16s, background 0.16s',\r\n }}>\r\n <button\r\n type=\"button\"\r\n aria-expanded={open}\r\n style={{\r\n appearance: 'none',\r\n width: '100%',\r\n font: 'inherit',\r\n color: 'inherit',\r\n textAlign: 'left',\r\n cursor: 'pointer',\r\n background: 'none',\r\n border: 0,\r\n borderRadius: '12px',\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '12px',\r\n padding: '14px 16px',\r\n }}\r\n onClick={() => { setOpen(current => !current) }}\r\n >\r\n <span style={{ flex: '1 1 0%', minWidth: 0 }}>\r\n <div style={{ fontSize: '14px', fontWeight: 600, color: 'var(--dsw-alias-label-primary)' }}>{t('card.title')}</div>\r\n <div style={{ color: 'var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))', fontSize: '13px', lineHeight: 1.5 }}>{t('card.description')}</div>\r\n </span>\r\n <svg\r\n width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden\r\n style={{\r\n color: 'var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))',\r\n flex: '0 0 auto',\r\n transition: 'transform 0.16s',\r\n transform: open ? 'rotate(180deg)' : 'none',\r\n }}\r\n >\r\n <path d=\"M4 6l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\r\n </svg>\r\n </button>\r\n {open\r\n ? (\r\n <div style={{ padding: '12px 16px' }}>\r\n {unavailable\r\n ? (\r\n <div style={{ fontSize: '13px', color: 'var(--dsw-alias-label-tertiary)' }}>\r\n {t('card.unavailable')}\r\n </div>\r\n )\r\n : (\r\n <>\r\n <div style={rowStyle}>\r\n <label htmlFor=\"plugin-config-thinking-levels-level\" style={labelStyle}>{t('card.level')}</label>\r\n <select\r\n id=\"plugin-config-thinking-levels-level\"\r\n value={level}\r\n disabled={readonly}\r\n style={controlStyle}\r\n onChange={(event) => { void scope.set('level', event.currentTarget.value as EffortId) }}\r\n >\r\n {EFFORT_OPTIONS.map((option) => (\r\n <option key={option} value={option}>{t(`card.level.${option}`)}</option>\r\n ))}\r\n </select>\r\n </div>\r\n <div style={rowStyle}>\r\n <label htmlFor=\"plugin-config-thinking-levels-enabled\" style={labelStyle}>{t('card.enabled')}</label>\r\n <input\r\n id=\"plugin-config-thinking-levels-enabled\"\r\n type=\"checkbox\"\r\n checked={value.enabled ?? true}\r\n disabled={readonly}\r\n onChange={(event) => { void scope.set('enabled', event.currentTarget.checked) }}\r\n />\r\n </div>\r\n <div style={rowStyle}>\r\n <label htmlFor=\"plugin-config-thinking-levels-downgrade\" style={labelStyle}>{t('card.allowDowngrade')}</label>\r\n <input\r\n id=\"plugin-config-thinking-levels-downgrade\"\r\n type=\"checkbox\"\r\n checked={value.allowDowngrade ?? true}\r\n disabled={readonly || value.level !== 'auto'}\r\n onChange={(event) => { void scope.set('allowDowngrade', event.currentTarget.checked) }}\r\n />\r\n </div>\r\n <div style={rowStyle}>\r\n <label htmlFor=\"plugin-config-thinking-levels-upgrade\" style={labelStyle}>{t('card.allowUpgrade')}</label>\r\n <input\r\n id=\"plugin-config-thinking-levels-upgrade\"\r\n type=\"checkbox\"\r\n checked={value.allowUpgrade ?? false}\r\n disabled={readonly || value.level !== 'auto'}\r\n onChange={(event) => { void scope.set('allowUpgrade', event.currentTarget.checked) }}\r\n />\r\n </div>\r\n {!snapshot.writable\r\n && <p style={{ margin: '8px 0 0', fontSize: '12px', color: 'var(--dsw-alias-label-tertiary)' }}>{t('card.readonly')}</p>}\r\n <ModelCapabilities scope={piAiScope} t={t} readonly={readonly} />\r\n </>\r\n )}\r\n </div>\r\n )\r\n : null}\r\n </div>\r\n )\r\n}\r\n","/**\r\n * FamilySettingsSection — the top-level 「起子插件设置」 settings section.\r\n *\r\n * One `settings.section` nav entry (registered by this plugin) whose entry\r\n * declares the `dsh-family.tab` child slot; sibling plugins (session-guard\r\n * first) contribute their cards there via `ctx.slots.inject('dsh-family.tab',\r\n * …)`. The section renders the family's own thinking-levels card as the first\r\n * tab and every contributor as a following tab — the same tabs-around-pages\r\n * pattern the built-in Plugins section uses (ui-settings-plugins): the tab\r\n * ledger is a HostObservable projected from the child-slot registry, and the\r\n * active tab mounts through `renderSlot(key, {}, { only: id })`. Each card is\r\n * a disclosure drawer expanded by default, so an opened tab shows its full\r\n * panel right away.\r\n *\r\n * When this section is absent the whole family surface is absent; a\r\n * contributor's inject simply idles (an undischarged wait never blocks the\r\n * client half), so plugins stay fully functional without their card.\r\n */\r\nimport { useState } from 'react'\r\nimport type { JSX } from 'react'\r\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\r\nimport { ThinkingLevelsCard, type ThinkingLevelsCardInjected } from './card.tsx'\r\n\r\n/**\r\n * Structural mirrors of the ui-slots faces this section consumes (the same\r\n * pattern as scope-face.ts: the package's `export *` type graph resolves\r\n * unreliably outside the harness workspace, so the handful of shapes are\r\n * declared locally instead).\r\n */\r\ntype HostObservable<T> = {\r\n getSnapshot(): T\r\n subscribe(listener: () => void): () => void\r\n}\r\n\r\n/** One contributor tab projected from the `dsh-family.tab` ledger. */\r\nexport interface FamilyTabEntry {\r\n id: string\r\n order: number\r\n label: string\r\n}\r\n\r\n/** Registration-side business face for the section. */\r\nexport interface FamilySectionInjected extends ThinkingLevelsCardInjected {\r\n hooks: {\r\n /** Ordered projection of the contributor ledger (locale-aware). */\r\n tabs: HostObservable<readonly FamilyTabEntry[]>\r\n }\r\n}\r\n\r\n/**\r\n * The framework-delivered child-slot dispatcher, narrowed to our one child key.\r\n * Optional: the Plugins-page `plugins.bundle.config` card renders this same\r\n * component WITHOUT a children declaration (the `dsh-family.tab` child slot is\r\n * claimed by the settings.section entry alone), so the machinery delivers no\r\n * renderSlot seat on that surface — contributor tabs degrade to empty panels\r\n * there instead of crashing on an absent dispatcher.\r\n */\r\ninterface FamilyRenderSlots {\r\n renderSlot?(key: 'dsh-family.tab', owner?: object, opts?: { only?: string; fallback?: React.ReactNode }): React.ReactNode\r\n}\r\n\r\n/** Full props: locale + contributor dispatcher + the resolved inject face. */\r\nexport type FamilySettingsSectionProps =\r\n PropsLocale<'thinking-levels'>\r\n & FamilyRenderSlots\r\n & FamilySectionInjected\r\n\r\n/** This plugin's own tab, always first: the thinking-levels card itself. */\r\nconst OWN_TAB_ID = 'thinking-levels'\r\n\r\n/** The hooks-compartment selector hook face (bound `use<Name>` hook). */\r\ninterface FamilyHooksFace {\r\n useTabs: <S>(selector: (value: readonly FamilyTabEntry[]) => S) => S\r\n}\r\n\r\nexport function FamilySettingsSection(props: FamilySettingsSectionProps): JSX.Element {\r\n const { t, renderSlot, scope, piAiScope } = props\r\n const { useTabs } = props as unknown as FamilyHooksFace\r\n const contributors = useTabs(value => value)\r\n const [activeId, setActiveId] = useState<string>(OWN_TAB_ID)\r\n const rows = [\r\n { id: OWN_TAB_ID, order: Number.NEGATIVE_INFINITY, label: t('card.title') },\r\n ...contributors,\r\n ]\r\n const active = rows.some(row => row.id === activeId) ? activeId : OWN_TAB_ID\r\n\r\n return (\r\n <div style={{ display: 'grid', gap: '12px' }}>\r\n <div role=\"tablist\" aria-label={t('family.title')} style={{ display: 'flex', flexWrap: 'wrap', gap: '4px' }}>\r\n {rows.map(row => (\r\n <button\r\n key={row.id}\r\n type=\"button\"\r\n role=\"tab\"\r\n aria-selected={row.id === active}\r\n onClick={() => { setActiveId(row.id) }}\r\n style={{\r\n appearance: 'none',\r\n font: 'inherit',\r\n cursor: 'pointer',\r\n border: '1px solid var(--dsw-alias-border-l2, rgba(127,127,127,0.35))',\r\n background: row.id === active ? 'var(--dsw-alias-bg-layer-3, rgba(127,127,127,0.08))' : 'none',\r\n color: 'var(--dsw-alias-label-primary, inherit)',\r\n borderRadius: '8px',\r\n padding: '5px 12px',\r\n fontSize: '13px',\r\n }}\r\n >\r\n {row.label}\r\n </button>\r\n ))}\r\n </div>\r\n <div role=\"tabpanel\">\r\n {active === OWN_TAB_ID\r\n ? <ThinkingLevelsCard t={t} scope={scope} piAiScope={piAiScope} />\r\n : renderSlot?.('dsh-family.tab', {}, { only: active, fallback: null })}\r\n </div>\r\n </div>\r\n )\r\n}\r\n","/**\r\n * dsh-thinking-levels — browser half.\r\n *\r\n * Registers the `thinking-levels` dictionaries and one composer model-seat\r\n * panel (`conversation.input.model`) carrying the per-line context-window\r\n * editor.\r\n *\r\n * The plugin's own settings (default level, enable toggle, scheduler bounds)\r\n * have NO standalone settings card since the DSH 0.1.7 line: the host renders\r\n * the Plugins settings form declaratively from the `.volatile()` fields of the\r\n * schema in src/index.ts, and the runtime values flow through the\r\n * `configForms` service keyed by the composition entry id. The former\r\n * per-plugin settings card was dropped with that migration (its seat no\r\n * longer exists in 0.1.7), including its llm-pi-ai model-capability editor.\r\n * The family settings section below and the Plugins-page\r\n * `plugins.bundle.config` card (same component, same inject factory) give\r\n * them a client face on hosts that declare the seat.\r\n *\r\n * All @deepseek-ai/* imports are type-only: collaboration happens through\r\n * cordis services (`configForms`) and slot registration only (client bundle\r\n * purity).\r\n */\r\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\r\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\r\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\r\n// DSH 0.1.5 moved the `ctx.slots` Context augmentation here (it used to live in\r\n// the retired `dsh-client-runtime` package): importing the client types restores\r\n// the typed `ctx.slots` member on the cordis Context surface.\r\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\r\nimport { NS, dictionaries } from './locales.ts'\r\nimport { ModelPanel, type ModelPanelInjected } from './model-panel.tsx'\r\nimport { FamilySettingsSection, type FamilySectionInjected, type FamilyTabEntry } from './family-tab.tsx'\r\nimport type { ThinkingLevelsConfig } from '../index.ts'\r\n// Type-only: pulls the settings shell's SlotMap merges ('settings.section').\r\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\r\n\r\n/**\r\n * The plugin-family shared settings surface: ONE top-level `settings.section`\r\n * nav entry (「起子插件设置」) whose entry declares the `dsh-family.tab` child\r\n * slot; sibling plugins contribute their cards there (session-guard first) and\r\n * the section renders them as tabs — the built-in Plugins section's\r\n * tabs-around-pages pattern; every card drawer is expanded by default. Declaring is claiming (ui-slots): the child slot\r\n * exists exactly while this section entry does, and a contributor's\r\n * `ctx.slots.inject('dsh-family.tab', …)` idles harmlessly if this plugin is\r\n * absent (an undischarged inject never blocks the client half).\r\n */\r\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\r\n interface SlotMap {\r\n 'dsh-family.tab': { kind: 'list'; scope: 'root' }\r\n /**\r\n * Plugins-page configuration card (official ui-plugin-manager contract):\r\n * keyed by the bundle's package name, rendered on the bundle's detail page\r\n * with `{ view: 'page' }` owner props. Declared here because community\r\n * plugins don't import the official package's client types — the same\r\n * merge pattern as dsh-tidy-display's settings-slots.ts.\r\n */\r\n 'plugins.bundle.config': { kind: 'keyed'; scope: 'root'; owner: Record<string, unknown> }\r\n }\r\n}\r\n\r\n/** Services required by the browser half. */\r\nexport const inject = ['slots', 'locale', 'configForms', 'modelDirectories']\r\n\r\n/**\r\n * Client plugin body: dictionaries plus the composer quick-control slot.\r\n * @param ctx - client root context.\r\n */\r\nexport function apply(ctx: ClientContext): void {\r\n const t = ctx.locale.bind(NS)\r\n // Single consolidated registration: one `register(ns, dicts)` call activates\r\n // all 9 languages (zh, en, ja, ko, fr, de, it, ru, es) — the untyped map\r\n // overload accepts any BCP-47-style id and throws only on duplicate (ns, locale).\r\n // Wrapped in try/catch so a throw can never escape the effect body (S5).\r\n ctx.effect(() => {\r\n try {\r\n return ctx.locale.register(NS, dictionaries)\r\n } catch {\r\n return () => {}\r\n }\r\n }, 'dsh-thinking-levels: dictionaries')\r\n\r\n // Composer model seat: one registered entry named after the seat with\r\n // `priority: -1` replaces the shipped `ModelSelect` trigger and popup\r\n // outright (the official popup renders no slots, so occupying the seat is\r\n // the only way to contribute inside it — the dsh-reasoning-effort pattern).\r\n // The panel renders its own picker over the harness's shared\r\n // `modelDirectories` service (model switching keeps working) and puts a\r\n // context-window editor on every model line: custom gateways write the\r\n // `llm-pi-ai` entry config, official DeepSeek models write the\r\n // `llm-deepseek` entry (its `models[].contextWindow`, else the provider\r\n // default).\r\n // Resolve `modelDirectories` through a cordis inject, NOT a synchronous\r\n // property read: at apply time the ui-model-selection module's service may\r\n // not be started yet, and the property read returned undefined on 0.1.7\r\n // hosts — the whole panel was silently skipped and the shipped selector\r\n // stayed. The deferred inject waits for the service to start; on harness\r\n // lines without the module the callback never fires or sees undefined,\r\n // leaving the shipped selector untouched.\r\n //\r\n // The inject must ALSO declare the resolver's own dependency set\r\n // (`sessions`, `remote`, `remote.session` — ui-model-selection's\r\n // `ModelDirectoryResolver.static inject`): a cordis Service resolves\r\n // `this.ctx` through the ACCESSING context (the traceable proxy rebinds\r\n // `ctx` to the reader), and `directoryFor()` reads `this.ctx.sessions` —\r\n // with only `modelDirectories` declared that read came back undefined and\r\n // every `directoryFor` call threw, so the seat entry crashed on first\r\n // render and the slot boundary abdicated it back to the shipped selector.\r\n ;(ctx as unknown as {\r\n inject: (\r\n deps: string[],\r\n cb: (scope: {\r\n modelDirectories: ModelDirectoriesFace | undefined\r\n sessions: SessionsFace | undefined\r\n }) => void,\r\n ) => void\r\n }).inject(['modelDirectories', 'sessions', 'remote', 'remote.session'], (scope) => {\r\n const directories = scope.modelDirectories\r\n if (directories === undefined) return\r\n ctx.slots.inject('conversation.input.model', function* () {\r\n yield ctx.slots.register({\r\n name: 'conversation.input.model',\r\n id: 'context-window-model-panel',\r\n priority: -1,\r\n locale: NS,\r\n inject: (sessionId: string): ModelPanelInjected => {\r\n // Entry ids of the target plugins: each dsh llm plugin's composition\r\n // entry id matches its settings namespace (`llm-pi-ai` / `llm-deepseek`).\r\n // A `directoryFor` failure (odd session shape) must not throw out of\r\n // the render: a thrown inject abdicates the seat entry — the whole\r\n // takeover — so degrade to the unavailable face instead.\r\n let directory: ModelDirectoryFace | undefined\r\n try {\r\n directory = directories.directoryFor(sessionId)\r\n } catch {\r\n directory = undefined\r\n }\r\n return {\r\n directory,\r\n piAiScope: ctx.configForms.get<unknown>('llm-pi-ai'),\r\n deepseekScope: ctx.configForms.get<unknown>('llm-deepseek'),\r\n }\r\n },\r\n }, ModelPanel)\r\n })\r\n })\r\n\r\n // Family settings section (see the SlotMap note above): the contributor\r\n // ledger is projected exactly like the built-in Plugins section projects its\r\n // tab ledger (cache until ledger/locale revision bumps, so useSyncExternalStore\r\n // sees a stable snapshot).\r\n/** Registrant labels arrive as a string or a locale thunk; unwrap either.\r\n * A throwing thunk (e.g. a contributor whose label touches a service its own\r\n * inject never declared) must not kill the whole tab-ledger projection — fall\r\n * back to the entry id. */\r\nconst resolveLabel = (label: unknown, fallback = ''): string => {\r\n try {\r\n if (typeof label === 'function') return (label as () => string)() || fallback\r\n if (typeof label === 'string') return label\r\n } catch { /* bad contributor label — degrade to the fallback */ }\r\n return fallback\r\n}\r\n\r\n let tabsVersion = -1\r\n let tabsRevision = -1\r\n let tabs: readonly FamilyTabEntry[] = []\r\n const sectionInjected = (): FamilySectionInjected => ({\r\n scope: ctx.configForms.get<ThinkingLevelsConfig>('dsh-thinking-levels'),\r\n piAiScope: ctx.configForms.get<unknown>('llm-pi-ai'),\r\n hooks: {\r\n tabs: {\r\n getSnapshot: () => {\r\n const version = ctx.slots.getVersion('dsh-family.tab')\r\n const revision = ctx.locale.getSnapshot().revision\r\n if (version !== tabsVersion || revision !== tabsRevision) {\r\n tabsVersion = version\r\n tabsRevision = revision\r\n tabs = ctx.slots.entries('dsh-family.tab')\r\n .map(entry => ({\r\n id: entry.options.id ?? '',\r\n order: entry.options.order ?? 0,\r\n label: resolveLabel(entry.options.label, entry.options.id ?? ''),\r\n }))\r\n .sort((a, b) => a.order - b.order)\r\n }\r\n return tabs\r\n },\r\n subscribe: (listener) => {\r\n const offLedger = ctx.slots.subscribe('dsh-family.tab', listener)\r\n const offLocale = ctx.locale.subscribe(listener)\r\n return () => {\r\n offLedger()\r\n offLocale()\r\n }\r\n },\r\n },\r\n },\r\n })\r\n\r\n ctx.slots.inject('settings.section', function* () {\r\n yield ctx.slots.register({\r\n name: 'settings.section',\r\n id: 'dsh-family',\r\n order: 40,\r\n label: () => t('family.title'),\r\n locale: NS,\r\n inject: sectionInjected,\r\n children: { 'dsh-family.tab': { kind: 'list', scope: 'root' } },\r\n }, FamilySettingsSection)\r\n })\r\n\r\n // Plugins-page configuration card: the Plugins page renders no volatile\r\n // config form on its own — the bundle's detail page mounts the\r\n // `plugins.bundle.config` keyed slot, dispatched by the package name, and\r\n // without a registration here the page shows no configuration card at all.\r\n // SAME component and SAME inject factory as the family section above, so\r\n // both surfaces stay one source of truth. On hosts whose slot map does not\r\n // declare the seat this inject idles harmlessly (an undischarged inject\r\n // never blocks the client half — same story as the `dsh-family.tab` note\r\n // above).\r\n ctx.slots.inject('plugins.bundle.config', () => ctx.slots.register({\r\n name: 'plugins.bundle.config',\r\n key: 'dsh-thinking-levels',\r\n locale: NS,\r\n inject: sectionInjected,\r\n }, FamilySettingsSection))\r\n}\r\n"],"mappings":";;;;;;;;;;;EAGA,MAAa,KAAK;;EAisBlB,MAAa,eAAuD;GAAE;IA7rBpE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Q;KACR,QAAQ;KACR,UAAU,EAAE,kBAAkB;MAAE,MAAM;MAAQ,OAAO;KAAO,EAAE;IAChE,GAAG,qBAAqB;GAC1B,CAAC;GAWD,IAAI,MAAM,OAAO,+BAA+B,IAAI,MAAM,SAAS;IACjE,MAAM;IACN,KAAK;IACL,QAAQ;IACR,QAAQ;GACV,GAAG,qBAAqB,CAAC;EAC3B"}
1
+ {"version":3,"file":"client.js","names":["providerNameStyle","modelRowStyle","labelStyle","providersOf","useSyncExternalStore","useState","useRef","useCallback","useMemo","useSyncExternalStore","useState","useState"],"sources":["../src/client/locales.ts","../src/context-window.ts","../src/client/model-panel.tsx","../src/client/card.tsx","../src/client/family-tab.tsx","../src/client/index.ts"],"sourcesContent":["/** `thinking-levels` client dictionaries (zh / en / ja / ko / fr / de / it / ru / es). */\r\n\r\n/** Dictionary namespace owned by this plugin. */\r\nexport const NS = 'thinking-levels'\r\n\r\n/** Simplified Chinese dictionary (the key-set source of truth). */\r\nexport const zh = {\r\n 'card.title': '思考档位',\r\n 'family.title': '起子插件设置',\r\n 'card.description': '在模型选择器中可选 Auto(mask):按工具调用历史自动在 low / high / max 间调度后提交 API。此处配置默认档位、调度边界与模型能力(档位 → 网关线上值映射)。',\r\n 'card.level': '默认档位',\r\n 'card.level.off': 'off — 关闭思考(仅手动,永不自动选择)',\r\n 'card.level.on': 'on — 开启思考(仅 toggle 型模型;只发 enable_thinking,不发 effort)',\r\n 'card.level.minimal': 'minimal — 最低(极轻任务)',\r\n 'card.level.low': 'low — 低(简单任务,廉价轮保持廉价)',\r\n 'card.level.medium': 'medium — 中',\r\n 'card.level.high': 'high — 高(官方默认)',\r\n 'card.level.xhigh': 'xhigh — 特高',\r\n 'card.level.max': 'max — 最大(重任务)',\r\n 'card.level.auto': 'auto — 按工具历史自动调度(默认)',\r\n 'card.enabled': '启用',\r\n 'card.allowDowngrade': '允许降档(auto 可降至 low)',\r\n 'card.allowUpgrade': '允许升档(auto 可升至 max)',\r\n 'card.unavailable': '设置命名空间不可用:请确认 dsh-thinking-levels 已装配进 profile。',\r\n 'card.readonly': '只读',\r\n 'card.capabilities': '模型能力(llm-pi-ai 自定义提供方)',\r\n 'card.capabilities.hint': '直接读写 llm-pi-ai 配置:勾选档位并填写发送给网关的线上值(例如 high → ultra);off 留空表示不发送。视觉决定图片输入;思考开关决定 enable_thinking 置位;thinkingFormat 决定 wire 序列化格式。',\r\n 'card.capabilities.empty': 'llm-pi-ai 中没有已配置模型的自定义提供方。请先在「设置 → 模型」添加提供方与模型。',\r\n 'card.capabilities.unavailable': 'llm-pi-ai 设置命名空间不可用。',\r\n 'card.capabilities.none': '(无模型)',\r\n 'card.capabilities.search': '搜索模型(名称或 ID)…',\r\n 'card.capabilities.noMatches': '没有匹配的模型',\r\n 'card.capabilities.quickSettings': '一键设置',\r\n 'card.capabilities.presetOfficial': '应用到全部:Off / High / Max(官方 DeepSeek 风格)',\r\n 'card.capabilities.presetGeneric': '应用到全部:Off / Low / Medium / High(通用)',\r\n 'card.capabilities.vendor': '提供方',\r\n 'card.capabilities.developerRole': '网关不支持 developer 角色',\r\n 'card.capabilities.developerRoleHint': '官方兼容开关(dsh ≥ v0.1.0-rc.8):写入路由级 compat.supportsDeveloperRole: false,系统提示词按 system 角色发送,修复 vLLM / SGLang 等网关的 Unexpected message role 400。取消勾选 = 删除该字段、恢复继承。',\r\n 'card.capabilities.expandProvider': '展开提供方',\r\n 'card.capabilities.collapseProvider': '收起提供方',\r\n 'card.capabilities.openModelSettings': '打开模型设置',\r\n 'card.capabilities.closeModelSettings': '收起模型设置',\r\n 'card.capabilities.vision': '视觉模型',\r\n 'card.capabilities.thinking': '思考模型',\r\n 'card.capabilities.supportsEffort': '支持 think effort',\r\n 'card.capabilities.efforts': '思考档位(勾选后填写线上值)',\r\n 'card.capabilities.wirePlaceholder': '线上值,如 ultra',\r\n 'card.capabilities.offPlaceholder': '留空 = 不发送',\r\n 'card.capabilities.atLeastThinking': '至少需要一个思考档位(off 除外)',\r\n 'card.capabilities.applyLevel': '应用此档位',\r\n 'card.capabilities.restoreDefault': '恢复默认档位',\r\n 'card.capabilities.unsaved': '未保存',\r\n 'card.capabilities.saveChanges': '保存更改',\r\n 'card.capabilities.saved': '已保存',\r\n 'card.capabilities.thinkingFormat': '思考格式',\r\n 'card.capabilities.thinkingFormat.inherit': '继承',\r\n 'card.capabilities.contextWindow': '上下文窗口上限',\r\n 'card.capabilities.contextCustomPlaceholder': '自定义整数,如 256000',\r\n 'card.capabilities.contextClear': '清除',\r\n 'card.capabilities.contextInteger': '上下文长度必须是整数(2000-1000000)',\r\n 'card.capabilities.contextRange': '上下文长度必须在 2000 到 1000000 之间',\r\n 'card.capabilities.contextHint': '选择预设或输入整数(2000–1000000),写入 llm-pi-ai 供上下文压力/压缩使用,无需重启即对下一请求生效。',\r\n 'input.context.title': '上下文窗口',\r\n 'input.context.globalHint': '全局生效:作用于所有使用该模型的会话(清除可恢复默认)',\r\n 'input.context.unset': '未设',\r\n 'input.context.custom': '自定义',\r\n 'input.context.noModel': '暂无会话模型',\r\n 'input.context.customPlaceholder': '自定义整数,如 256000',\r\n 'input.context.apply': '应用',\r\n 'input.context.clear': '清除',\r\n 'input.context.integer': '上下文长度必须是整数(2000-1000000)',\r\n 'input.context.range': '上下文长度必须在 2000 到 1000000 之间',\r\n 'model.panel.choose': '选择模型',\r\n 'model.panel.loading': '模型目录加载中…',\r\n 'model.panel.empty': '没有可用模型',\r\n 'model.panel.window': '窗口',\r\n 'model.panel.noTarget': '该模型没有可写的配置项',\r\n 'model.panel.unavailable': '当前会话的模型目录不可用',\r\n 'input.effort.title': '思考强度',\r\n 'input.effort.default': '提供方默认',\r\n 'card.capabilities.failed': '保存失败:配置被拒绝或冲突,请检查值。',\r\n} satisfies Record<string, string>\r\n\r\n/** English dictionary (keys mirror zh). */\r\nexport const en: Record<keyof typeof zh, string> = {\r\n 'card.title': 'Thinking Levels',\r\n 'family.title': 'Qizi Plugin Settings',\r\n 'card.description': 'Pick Auto in the model selector: the plugin schedules low / high / max per tool round before submitting the API effort. Here you configure the default level, scheduler bounds, and per-model capabilities (level → gateway wire value mapping).',\r\n 'card.level': 'Default level',\r\n 'card.level.off': 'off — disable thinking (manual only, never auto-picked)',\r\n 'card.level.on': 'on — enable thinking (toggle-only models only; sends enable_thinking, never an effort)',\r\n 'card.level.minimal': 'minimal — least (very light tasks)',\r\n 'card.level.low': 'low — cheap rounds stay cheap',\r\n 'card.level.medium': 'medium — medium',\r\n 'card.level.high': 'high — the official default',\r\n 'card.level.xhigh': 'xhigh — extra high',\r\n 'card.level.max': 'max — heavy work',\r\n 'card.level.auto': 'auto — schedule from tool history (default)',\r\n 'card.enabled': 'Enabled',\r\n 'card.allowDowngrade': 'Allow downgrade (auto may drop to low)',\r\n 'card.allowUpgrade': 'Allow upgrade (auto may lift to max)',\r\n 'card.unavailable': 'Settings namespace unavailable: make sure dsh-thinking-levels is assembled into this profile.',\r\n 'card.readonly': 'Read-only',\r\n 'card.capabilities': 'Model capabilities (llm-pi-ai custom providers)',\r\n 'card.capabilities.hint': 'Reads and writes the llm-pi-ai config directly: tick a level and enter the exact value sent to the gateway (e.g. high → ultra); leaving off empty means “do not send”. Vision gates image input; the thinking toggle drives enable_thinking; thinkingFormat picks the wire serialization.',\r\n 'card.capabilities.empty': 'No custom provider has models configured in llm-pi-ai. Add a provider and models under Settings → Models first.',\r\n 'card.capabilities.unavailable': 'The llm-pi-ai settings namespace is unavailable.',\r\n 'card.capabilities.none': '(no models)',\r\n 'card.capabilities.search': 'Search models by name or ID…',\r\n 'card.capabilities.noMatches': 'No matching models',\r\n 'card.capabilities.quickSettings': 'Quick settings',\r\n 'card.capabilities.presetOfficial': 'Apply to all: Off / High / Max (official DeepSeek style)',\r\n 'card.capabilities.presetGeneric': 'Apply to all: Off / Low / Medium / High (generic)',\r\n 'card.capabilities.vendor': 'Provider',\r\n 'card.capabilities.developerRole': 'Gateway rejects the developer role',\r\n 'card.capabilities.developerRoleHint': 'Official compat switch (dsh ≥ v0.1.0-rc.8): writes route-level compat.supportsDeveloperRole: false so the system prompt is sent as role system — fixes the Unexpected message role 400 on vLLM / SGLang gateways. Unchecking deletes the field and restores inheritance.',\r\n 'card.capabilities.expandProvider': 'Expand provider',\r\n 'card.capabilities.collapseProvider': 'Collapse provider',\r\n 'card.capabilities.openModelSettings': 'Open model settings',\r\n 'card.capabilities.closeModelSettings': 'Collapse model settings',\r\n 'card.capabilities.vision': 'Vision model',\r\n 'card.capabilities.thinking': 'Thinking model',\r\n 'card.capabilities.supportsEffort': 'Supports think effort',\r\n 'card.capabilities.efforts': 'Thinking effort levels (tick, then enter the wire value)',\r\n 'card.capabilities.wirePlaceholder': 'Wire value, e.g. ultra',\r\n 'card.capabilities.offPlaceholder': 'Empty = do not send',\r\n 'card.capabilities.atLeastThinking': 'Select at least one thinking level (other than off)',\r\n 'card.capabilities.applyLevel': 'Apply levels',\r\n 'card.capabilities.restoreDefault': 'Restore defaults',\r\n 'card.capabilities.unsaved': 'Unsaved',\r\n 'card.capabilities.saveChanges': 'Save changes',\r\n 'card.capabilities.saved': 'Saved',\r\n 'card.capabilities.thinkingFormat': 'Thinking format',\r\n 'card.capabilities.thinkingFormat.inherit': 'Inherit',\r\n 'card.capabilities.contextWindow': 'Context window limit',\r\n 'card.capabilities.contextCustomPlaceholder': 'Custom integer, e.g. 256000',\r\n 'card.capabilities.contextClear': 'Clear',\r\n 'card.capabilities.contextInteger': 'Context length must be an integer (2000-1000000)',\r\n 'card.capabilities.contextRange': 'Context length must be between 2000 and 1000000',\r\n 'card.capabilities.contextHint': 'Pick a preset or enter an integer (2000–1000000); written to llm-pi-ai for context pressure/compaction and applied to the next request without a restart.',\r\n 'input.context.title': 'Context window',\r\n 'input.context.globalHint': 'Applies globally to every session using this model (Clear restores the default)',\r\n 'input.context.unset': 'Unset',\r\n 'input.context.custom': 'Custom',\r\n 'input.context.noModel': 'No session model yet',\r\n 'input.context.customPlaceholder': 'Custom integer, e.g. 256000',\r\n 'input.context.apply': 'Apply',\r\n 'input.context.clear': 'Clear',\r\n 'input.context.integer': 'Context length must be an integer (2000-1000000)',\r\n 'input.context.range': 'Context length must be between 2000 and 1000000',\r\n 'model.panel.choose': 'Choose model',\r\n 'model.panel.loading': 'Loading the model directory…',\r\n 'model.panel.empty': 'No models available',\r\n 'model.panel.window': 'Window',\r\n 'model.panel.noTarget': 'No writable config entry for this model',\r\n 'model.panel.unavailable': 'The model directory is unavailable for this session',\r\n 'input.effort.title': 'Reasoning effort',\r\n 'input.effort.default': 'Provider default',\r\n 'card.capabilities.failed': 'Save failed: the value was rejected or conflicted. Check it.',\r\n}\r\n\r\n/** Japanese dictionary (keys mirror zh). */\r\nexport const ja: Record<keyof typeof zh, string> = {\r\n 'card.title': '思考レベル',\r\n 'family.title': '起子プラグイン設定',\r\n 'card.description': 'モデルセレクターで Auto(マスク)を選択すると、ツール呼び出し履歴から low / high / max を自動スケジュールして API に送信します。ここでは既定レベル、スケジューラーの境界、モデル能力(レベル → ゲートウェイ送信値のマッピング)を設定します。',\r\n 'card.level': '既定レベル',\r\n 'card.level.off': 'off — 思考を無効化(手動のみ、自動選択はされません)',\r\n 'card.level.on': 'on — 思考を有効化(トグルのみのモデル向け。enable_thinking のみ送信、effort は送信しません)',\r\n 'card.level.minimal': 'minimal — 最小(非常に軽いタスク)',\r\n 'card.level.low': 'low — 低(軽いラウンドは軽いまま)',\r\n 'card.level.medium': 'medium — 中',\r\n 'card.level.high': 'high — 高(公式既定値)',\r\n 'card.level.xhigh': 'xhigh — 特高',\r\n 'card.level.max': 'max — 最大(重いタスク)',\r\n 'card.level.auto': 'auto — ツール履歴から自動スケジュール(既定)',\r\n 'card.enabled': '有効',\r\n 'card.allowDowngrade': '降格を許可(auto は low まで下げられる)',\r\n 'card.allowUpgrade': '昇格を許可(auto は max まで上げられる)',\r\n 'card.unavailable': '設定名前空間が利用できません:dsh-thinking-levels が profile に組み込まれているか確認してください。',\r\n 'card.readonly': '読み取り専用',\r\n 'card.capabilities': 'モデル能力(llm-pi-ai カスタムプロバイダー)',\r\n 'card.capabilities.hint': 'llm-pi-ai 設定を直接読み書きします:レベルにチェックを入れ、ゲートウェイに送信する値を入力(例:high → ultra)。off を空欄にすると送信しません。視覚は画像入力を決定、思考トグルは enable_thinking を制御、thinkingFormat は wire シリアライズ形式を選択します。',\r\n 'card.capabilities.empty': 'llm-pi-ai にモデルが設定されたカスタムプロバイダーがありません。先に「設定 → モデル」でプロバイダーとモデルを追加してください。',\r\n 'card.capabilities.unavailable': 'llm-pi-ai の設定名前空間が利用できません。',\r\n 'card.capabilities.none': '(モデルなし)',\r\n 'card.capabilities.search': 'モデル名または ID で検索…',\r\n 'card.capabilities.noMatches': '一致するモデルがありません',\r\n 'card.capabilities.quickSettings': 'クイック設定',\r\n 'card.capabilities.presetOfficial': 'すべてに適用:Off / High / Max(公式 DeepSeek 形式)',\r\n 'card.capabilities.presetGeneric': 'すべてに適用:Off / Low / Medium / High(汎用)',\r\n 'card.capabilities.vendor': 'プロバイダー',\r\n 'card.capabilities.developerRole': 'ゲートウェイは developer ロール非対応',\r\n 'card.capabilities.developerRoleHint': '公式互換スイッチ(dsh ≥ v0.1.0-rc.8):ルートレベルの compat.supportsDeveloperRole: false を書き込み、システムプロンプトを system ロールで送信します。vLLM / SGLang などの Unexpected message role 400 を修正。チェックを外すとフィールドを削除し継承に戻します。',\r\n 'card.capabilities.expandProvider': 'プロバイダーを展開',\r\n 'card.capabilities.collapseProvider': 'プロバイダーを折りたたむ',\r\n 'card.capabilities.openModelSettings': 'モデル設定を開く',\r\n 'card.capabilities.closeModelSettings': 'モデル設定を折りたたむ',\r\n 'card.capabilities.vision': '視覚モデル',\r\n 'card.capabilities.thinking': '思考モデル',\r\n 'card.capabilities.supportsEffort': 'think effort をサポート',\r\n 'card.capabilities.efforts': '思考レベル(チェック後、送信値を入力)',\r\n 'card.capabilities.wirePlaceholder': '送信値(例:ultra)',\r\n 'card.capabilities.offPlaceholder': '空欄 = 送信しない',\r\n 'card.capabilities.atLeastThinking': '思考レベルを 1 つ以上選択してください(off 以外)',\r\n 'card.capabilities.applyLevel': 'レベルを適用',\r\n 'card.capabilities.restoreDefault': '既定値に戻す',\r\n 'card.capabilities.unsaved': '未保存',\r\n 'card.capabilities.saveChanges': '変更を保存',\r\n 'card.capabilities.saved': '保存済み',\r\n 'card.capabilities.thinkingFormat': '思考形式',\r\n 'card.capabilities.thinkingFormat.inherit': '継承',\r\n 'card.capabilities.contextWindow': 'コンテキストウィンドウ上限',\r\n 'card.capabilities.contextCustomPlaceholder': 'カスタム整数(例:256000)',\r\n 'card.capabilities.contextClear': 'クリア',\r\n 'card.capabilities.contextInteger': 'コンテキスト長は整数で入力してください(2000-1000000)',\r\n 'card.capabilities.contextRange': 'コンテキスト長は 2000 から 1000000 の範囲で指定してください',\r\n 'card.capabilities.contextHint': 'プリセットを選ぶか整数を入力(2000–1000000)。llm-pi-ai に書き込まれ、コンテキスト圧力/圧縮に使用され、再起動なしで次のリクエストに反映されます。',\r\n 'input.context.title': 'コンテキストウィンドウ',\r\n 'input.context.globalHint': 'グローバルに有効:このモデルを使用するすべてのセッションに適用されます(クリアで既定値に戻ります)',\r\n 'input.context.unset': '未設定',\r\n 'input.context.custom': 'カスタム',\r\n 'input.context.noModel': 'セッションモデルがまだありません',\r\n 'input.context.customPlaceholder': 'カスタム整数(例:256000)',\r\n 'input.context.apply': '適用',\r\n 'input.context.clear': 'クリア',\r\n 'input.context.integer': 'コンテキスト長は整数で入力してください(2000-1000000)',\r\n 'input.context.range': 'コンテキスト長は 2000 から 1000000 の範囲で指定してください',\r\n 'model.panel.choose': 'モデルを選択',\r\n 'model.panel.loading': 'モデルディレクトリを読み込み中…',\r\n 'model.panel.empty': '利用可能なモデルがありません',\r\n 'model.panel.window': 'ウィンドウ',\r\n 'model.panel.noTarget': 'このモデルには書き込み可能な設定項目がありません',\r\n 'model.panel.unavailable': 'このセッションのモデルディレクトリは利用できません',\r\n 'input.effort.title': '思考レベル',\r\n 'input.effort.default': 'プロバイダーの既定',\r\n 'card.capabilities.failed': '保存に失敗しました:値が拒否されたか競合しています。確認してください。',\r\n}\r\n\r\n/** Korean dictionary (keys mirror zh). */\r\nexport const ko: Record<keyof typeof zh, string> = {\r\n 'card.title': '사고 수준',\r\n 'family.title': '起子 플러그인 설정',\r\n 'card.description': '모델 선택기에서 Auto(마스크)를 선택하면 도구 호출 기록을 기반으로 low / high / max 를 자동 스케줄링하여 API에 제출합니다. 여기서 기본 수준, 스케줄러 경계, 모델 기능(수준 → 게이트웨이 전송 값 매핑)을 구성합니다.',\r\n 'card.level': '기본 수준',\r\n 'card.level.off': 'off — 사고 비활성화(수동 전용, 자동 선택 안 됨)',\r\n 'card.level.on': 'on — 사고 활성화(토글 전용 모델용. enable_thinking만 전송, effort는 전송하지 않음)',\r\n 'card.level.minimal': 'minimal — 최소(매우 가벼운 작업)',\r\n 'card.level.low': 'low — 낮음(가벼운 라운드는 가볍게 유지)',\r\n 'card.level.medium': 'medium — 중간',\r\n 'card.level.high': 'high — 높음(공식 기본값)',\r\n 'card.level.xhigh': 'xhigh — 특별히 높음',\r\n 'card.level.max': 'max — 최대(무거운 작업)',\r\n 'card.level.auto': 'auto — 도구 기록에서 자동 스케줄링(기본값)',\r\n 'card.enabled': '활성화',\r\n 'card.allowDowngrade': '다운그레이드 허용(auto가 low까지 내릴 수 있음)',\r\n 'card.allowUpgrade': '업그레이드 허용(auto가 max까지 올릴 수 있음)',\r\n 'card.unavailable': '설정 네임스페이스를 사용할 수 없습니다: dsh-thinking-levels가 이 profile에 조립되었는지 확인하세요.',\r\n 'card.readonly': '읽기 전용',\r\n 'card.capabilities': '모델 기능(llm-pi-ai 사용자 지정 제공자)',\r\n 'card.capabilities.hint': 'llm-pi-ai 설정을 직접 읽고 씁니다: 수준을 체크하고 게이트웨이에 보낼 값을 입력(예: high → ultra). off를 비워 두면 전송하지 않습니다. 시각은 이미지 입력을 결정하고, 사고 토글은 enable_thinking을 제어하며, thinkingFormat은 wire 직렬화 형식을 선택합니다.',\r\n 'card.capabilities.empty': 'llm-pi-ai에 모델이 구성된 사용자 지정 제공자가 없습니다. 먼저 「설정 → 모델」에서 제공자와 모델을 추가하세요.',\r\n 'card.capabilities.unavailable': 'llm-pi-ai 설정 네임스페이스를 사용할 수 없습니다.',\r\n 'card.capabilities.none': '(모델 없음)',\r\n 'card.capabilities.search': '모델 이름 또는 ID로 검색…',\r\n 'card.capabilities.noMatches': '일치하는 모델이 없습니다',\r\n 'card.capabilities.quickSettings': '빠른 설정',\r\n 'card.capabilities.presetOfficial': '전체에 적용: Off / High / Max(공식 DeepSeek 방식)',\r\n 'card.capabilities.presetGeneric': '전체에 적용: Off / Low / Medium / High(일반 방식)',\r\n 'card.capabilities.vendor': '제공자',\r\n 'card.capabilities.developerRole': '게이트웨이가 developer 역할 미지원',\r\n 'card.capabilities.developerRoleHint': '공식 호환 스위치(dsh ≥ v0.1.0-rc.8): 라우트 수준 compat.supportsDeveloperRole: false 를 기록하여 시스템 프롬프트를 system 역할로 전송합니다. vLLM / SGLang 등의 Unexpected message role 400 을 수정. 체크 해제 시 필드를 삭제하고 상속을 복원합니다.',\r\n 'card.capabilities.expandProvider': '제공자 펼치기',\r\n 'card.capabilities.collapseProvider': '제공자 접기',\r\n 'card.capabilities.openModelSettings': '모델 설정 열기',\r\n 'card.capabilities.closeModelSettings': '모델 설정 접기',\r\n 'card.capabilities.vision': '시각 모델',\r\n 'card.capabilities.thinking': '사고 모델',\r\n 'card.capabilities.supportsEffort': 'think effort 지원',\r\n 'card.capabilities.efforts': '사고 수준(체크 후 전송 값 입력)',\r\n 'card.capabilities.wirePlaceholder': '전송 값(예: ultra)',\r\n 'card.capabilities.offPlaceholder': '비워 둠 = 전송하지 않음',\r\n 'card.capabilities.atLeastThinking': '사고 수준을 하나 이상 선택하세요(off 제외)',\r\n 'card.capabilities.applyLevel': '수준 적용',\r\n 'card.capabilities.restoreDefault': '기본값 복원',\r\n 'card.capabilities.unsaved': '저장되지 않음',\r\n 'card.capabilities.saveChanges': '변경 사항 저장',\r\n 'card.capabilities.saved': '저장됨',\r\n 'card.capabilities.thinkingFormat': '사고 형식',\r\n 'card.capabilities.thinkingFormat.inherit': '상속',\r\n 'card.capabilities.contextWindow': '컨텍스트 창 상한',\r\n 'card.capabilities.contextCustomPlaceholder': '사용자 지정 정수(예: 256000)',\r\n 'card.capabilities.contextClear': '지우기',\r\n 'card.capabilities.contextInteger': '컨텍스트 길이는 정수여야 합니다 (2000-1000000)',\r\n 'card.capabilities.contextRange': '컨텍스트 길이는 2000에서 1000000 사이여야 합니다',\r\n 'card.capabilities.contextHint': '프리셋을 선택하거나 정수를 입력하세요(2000–1000000). llm-pi-ai에 기록되어 컨텍스트 압력/압축에 사용되며, 재시작 없이 다음 요청에 반영됩니다.',\r\n 'input.context.title': '컨텍스트 창',\r\n 'input.context.globalHint': '전역 적용: 이 모델을 사용하는 모든 세션에 적용됩니다(지우면 기본값 복원)',\r\n 'input.context.unset': '미설정',\r\n 'input.context.custom': '사용자 지정',\r\n 'input.context.noModel': '세션 모델이 아직 없습니다',\r\n 'input.context.customPlaceholder': '사용자 지정 정수(예: 256000)',\r\n 'input.context.apply': '적용',\r\n 'input.context.clear': '지우기',\r\n 'input.context.integer': '컨텍스트 길이는 정수여야 합니다 (2000-1000000)',\r\n 'input.context.range': '컨텍스트 길이는 2000에서 1000000 사이여야 합니다',\r\n 'model.panel.choose': '모델 선택',\r\n 'model.panel.loading': '모델 디렉터리를 불러오는 중…',\r\n 'model.panel.empty': '사용 가능한 모델이 없습니다',\r\n 'model.panel.window': '창',\r\n 'model.panel.noTarget': '이 모델에는 쓰기 가능한 설정 항목이 없습니다',\r\n 'model.panel.unavailable': '이 세션의 모델 디렉터리를 사용할 수 없습니다',\r\n 'input.effort.title': '추론 강도',\r\n 'input.effort.default': '공급자 기본값',\r\n 'card.capabilities.failed': '저장 실패: 값이 거부되었거나 충돌합니다. 확인하세요.',\r\n}\r\n\r\n/** French dictionary (keys mirror zh). */\r\nexport const fr: Record<keyof typeof zh, string> = {\r\n 'card.title': 'Niveaux de réflexion',\r\n 'family.title': 'Paramètres des plugins Qizi',\r\n 'card.description': 'Choisissez Auto dans le sélecteur de modèle : le plugin planifie low / high / max à chaque tour d\\'outils avant de soumettre l\\'effort à l\\'API. Configurez ici le niveau par défaut, les bornes du planificateur et les capacités par modèle (mapping niveau → valeur wire envoyée à la passerelle).',\r\n 'card.level': 'Niveau par défaut',\r\n 'card.level.off': 'off — désactive la réflexion (manuel uniquement, jamais choisi automatiquement)',\r\n 'card.level.on': 'on — active la réflexion (modèles à bascule uniquement ; envoie enable_thinking, jamais un effort)',\r\n 'card.level.minimal': 'minimal — minimal (tâches très légères)',\r\n 'card.level.low': 'low — bas (les tours bon marché restent bon marché)',\r\n 'card.level.medium': 'medium — moyen',\r\n 'card.level.high': 'high — haut (défaut officiel)',\r\n 'card.level.xhigh': 'xhigh — très haut',\r\n 'card.level.max': 'max — maximal (tâches lourdes)',\r\n 'card.level.auto': 'auto — planifie selon l\\'historique d\\'outils (défaut)',\r\n 'card.enabled': 'Activé',\r\n 'card.allowDowngrade': 'Autoriser la rétrogradation (auto peut descendre à low)',\r\n 'card.allowUpgrade': 'Autoriser la promotion (auto peut monter à max)',\r\n 'card.unavailable': 'Espace de noms des réglages indisponible : vérifiez que dsh-thinking-levels est assemblé dans ce profil.',\r\n 'card.readonly': 'Lecture seule',\r\n 'card.capabilities': 'Capacités des modèles (fournisseurs personnalisés llm-pi-ai)',\r\n 'card.capabilities.hint': 'Lit et écrit directement la configuration llm-pi-ai : cochez un niveau et saisissez la valeur exacte envoyée à la passerelle (ex. high → ultra) ; laisser off vide signifie « ne pas envoyer ». La vision autorise l\\'entrée d\\'images ; l\\'interrupteur de réflexion pilote enable_thinking ; thinkingFormat choisit le format de sérialisation wire.',\r\n 'card.capabilities.empty': 'Aucun fournisseur personnalisé n\\'a de modèles configurés dans llm-pi-ai. Ajoutez d\\'abord un fournisseur et des modèles dans Réglages → Modèles.',\r\n 'card.capabilities.unavailable': 'L\\'espace de noms des réglages llm-pi-ai est indisponible.',\r\n 'card.capabilities.none': '(aucun modèle)',\r\n 'card.capabilities.search': 'Rechercher des modèles par nom ou ID…',\r\n 'card.capabilities.noMatches': 'Aucun modèle correspondant',\r\n 'card.capabilities.quickSettings': 'Réglages rapides',\r\n 'card.capabilities.presetOfficial': 'Appliquer à tous : Off / High / Max (style officiel DeepSeek)',\r\n 'card.capabilities.presetGeneric': 'Appliquer à tous : Off / Low / Medium / High (générique)',\r\n 'card.capabilities.vendor': 'Fournisseur',\r\n 'card.capabilities.developerRole': 'La passerelle rejette le rôle developer',\r\n 'card.capabilities.developerRoleHint': 'Commutateur de compatibilité officiel (dsh ≥ v0.1.0-rc.8) : écrit compat.supportsDeveloperRole: false au niveau de la route pour envoyer le prompt système avec le rôle system — corrige l\\'erreur Unexpected message role 400 des passerelles vLLM / SGLang. Décocher supprime le champ et restaure l\\'héritage.',\r\n 'card.capabilities.expandProvider': 'Déplier le fournisseur',\r\n 'card.capabilities.collapseProvider': 'Replier le fournisseur',\r\n 'card.capabilities.openModelSettings': 'Ouvrir les réglages du modèle',\r\n 'card.capabilities.closeModelSettings': 'Replier les réglages du modèle',\r\n 'card.capabilities.vision': 'Modèle vision',\r\n 'card.capabilities.thinking': 'Modèle de réflexion',\r\n 'card.capabilities.supportsEffort': 'Prend en charge l\\'effort de réflexion',\r\n 'card.capabilities.efforts': 'Niveaux d\\'effort de réflexion (cochez, puis saisissez la valeur wire)',\r\n 'card.capabilities.wirePlaceholder': 'Valeur wire, ex. ultra',\r\n 'card.capabilities.offPlaceholder': 'Vide = ne pas envoyer',\r\n 'card.capabilities.atLeastThinking': 'Sélectionnez au moins un niveau de réflexion (autre que off)',\r\n 'card.capabilities.applyLevel': 'Appliquer les niveaux',\r\n 'card.capabilities.restoreDefault': 'Restaurer les défauts',\r\n 'card.capabilities.unsaved': 'Non enregistré',\r\n 'card.capabilities.saveChanges': 'Enregistrer les modifications',\r\n 'card.capabilities.saved': 'Enregistré',\r\n 'card.capabilities.thinkingFormat': 'Format de réflexion',\r\n 'card.capabilities.thinkingFormat.inherit': 'Hériter',\r\n 'card.capabilities.contextWindow': 'Limite de fenêtre de contexte',\r\n 'card.capabilities.contextCustomPlaceholder': 'Entier personnalisé, ex. 256000',\r\n 'card.capabilities.contextClear': 'Effacer',\r\n 'card.capabilities.contextInteger': 'La longueur du contexte doit être un entier (2000-1000000)',\r\n 'card.capabilities.contextRange': 'La longueur du contexte doit être comprise entre 2000 et 1000000',\r\n 'card.capabilities.contextHint': 'Choisissez un préréglage ou saisissez un entier (2000–1000000) ; écrit dans llm-pi-ai pour la pression/compaction du contexte et appliqué à la requête suivante sans redémarrage.',\r\n 'input.context.title': 'Fenêtre de contexte',\r\n 'input.context.globalHint': 'S\\'applique globalement à toutes les sessions utilisant ce modèle (Effacer restaure le défaut)',\r\n 'input.context.unset': 'Non défini',\r\n 'input.context.custom': 'Personnalisé',\r\n 'input.context.noModel': 'Aucun modèle de session pour l\\'instant',\r\n 'input.context.customPlaceholder': 'Entier personnalisé, ex. 256000',\r\n 'input.context.apply': 'Appliquer',\r\n 'input.context.clear': 'Effacer',\r\n 'input.context.integer': 'La longueur du contexte doit être un entier (2000-1000000)',\r\n 'input.context.range': 'La longueur du contexte doit être comprise entre 2000 et 1000000',\r\n 'model.panel.choose': 'Choisir un modèle',\r\n 'model.panel.loading': 'Chargement du répertoire de modèles…',\r\n 'model.panel.empty': 'Aucun modèle disponible',\r\n 'model.panel.window': 'Fenêtre',\r\n 'model.panel.noTarget': 'Aucune entrée de configuration inscriptible pour ce modèle',\r\n 'model.panel.unavailable': 'Le répertoire de modèles est indisponible pour cette session',\r\n 'input.effort.title': 'Effort de réflexion',\r\n 'input.effort.default': 'Défaut du fournisseur',\r\n 'card.capabilities.failed': 'Échec de l\\'enregistrement : la valeur a été rejetée ou est en conflit. Vérifiez-la.',\r\n}\r\n\r\n/** German dictionary (keys mirror zh). */\r\nexport const de: Record<keyof typeof zh, string> = {\r\n 'card.title': 'Denkstufen',\r\n 'family.title': 'Qizi-Plugin-Einstellungen',\r\n 'card.description': 'Wählen Sie in der Modellauswahl Auto: Das Plugin plant vor der API-Übermittlung in jedem Tool-Schritt zwischen low / high / max. Hier konfigurieren Sie die Standardstufe, die Planungsgrenzen und die Modellfähigkeiten (Zuordnung Stufe → Wire-Wert an das Gateway).',\r\n 'card.level': 'Standardstufe',\r\n 'card.level.off': 'off — Denken aus (nur manuell, nie automatisch gewählt)',\r\n 'card.level.on': 'on — Denken ein (nur Toggle-Modelle; sendet enable_thinking, nie einen Effort)',\r\n 'card.level.minimal': 'minimal — geringste (sehr leichte Aufgaben)',\r\n 'card.level.low': 'low — niedrig (billige Runden bleiben billig)',\r\n 'card.level.medium': 'medium — mittel',\r\n 'card.level.high': 'high — hoch (offizieller Standard)',\r\n 'card.level.xhigh': 'xhigh — besonders hoch',\r\n 'card.level.max': 'max — maximal (schwere Aufgaben)',\r\n 'card.level.auto': 'auto — plant aus dem Tool-Verlauf (Standard)',\r\n 'card.enabled': 'Aktiviert',\r\n 'card.allowDowngrade': 'Herabstufung erlauben (auto darf auf low sinken)',\r\n 'card.allowUpgrade': 'Heraufstufung erlauben (auto darf auf max steigen)',\r\n 'card.unavailable': 'Einstellungs-Namespace nicht verfügbar: Stellen Sie sicher, dass dsh-thinking-levels in dieses Profil eingebaut ist.',\r\n 'card.readonly': 'Schreibgeschützt',\r\n 'card.capabilities': 'Modellfähigkeiten (benutzerdefinierte llm-pi-ai-Provider)',\r\n 'card.capabilities.hint': 'Liest und schreibt die llm-pi-ai-Konfiguration direkt: Markieren Sie eine Stufe und tragen Sie den exakten Wert ein, der ans Gateway gesendet wird (z. B. high → ultra); ein leeres off heißt „nicht senden“. Vision steuert die Bildeingabe; der Denk-Schalter setzt enable_thinking; thinkingFormat wählt die Wire-Serialisierung.',\r\n 'card.capabilities.empty': 'Kein benutzerdefinierter Provider hat Modelle in llm-pi-ai konfiguriert. Fügen Sie zuerst unter Einstellungen → Modelle einen Provider mit Modellen hinzu.',\r\n 'card.capabilities.unavailable': 'Der llm-pi-ai-Einstellungs-Namespace ist nicht verfügbar.',\r\n 'card.capabilities.none': '(keine Modelle)',\r\n 'card.capabilities.search': 'Modelle nach Name oder ID suchen…',\r\n 'card.capabilities.noMatches': 'Keine passenden Modelle',\r\n 'card.capabilities.quickSettings': 'Schnelleinstellungen',\r\n 'card.capabilities.presetOfficial': 'Auf alle anwenden: Off / High / Max (offizieller DeepSeek-Stil)',\r\n 'card.capabilities.presetGeneric': 'Auf alle anwenden: Off / Low / Medium / High (generisch)',\r\n 'card.capabilities.vendor': 'Provider',\r\n 'card.capabilities.developerRole': 'Gateway lehnt die developer-Rolle ab',\r\n 'card.capabilities.developerRoleHint': 'Offizieller Kompatibilitätsschalter (dsh ≥ v0.1.0-rc.8): schreibt compat.supportsDeveloperRole: false auf Routenebene, damit der Systemprompt als Rolle system gesendet wird — behebt den Unexpected-message-role-400 von vLLM-/SGLang-Gateways. Abwählen löscht das Feld und stellt die Vererbung wieder her.',\r\n 'card.capabilities.expandProvider': 'Provider ausklappen',\r\n 'card.capabilities.collapseProvider': 'Provider einklappen',\r\n 'card.capabilities.openModelSettings': 'Modelleinstellungen öffnen',\r\n 'card.capabilities.closeModelSettings': 'Modelleinstellungen einklappen',\r\n 'card.capabilities.vision': 'Vision-Modell',\r\n 'card.capabilities.thinking': 'Denkmodell',\r\n 'card.capabilities.supportsEffort': 'Unterstützt Reasoning-Effort',\r\n 'card.capabilities.efforts': 'Denkstufen (anmarkieren, dann Wire-Wert eintragen)',\r\n 'card.capabilities.wirePlaceholder': 'Wire-Wert, z. B. ultra',\r\n 'card.capabilities.offPlaceholder': 'Leer = nicht senden',\r\n 'card.capabilities.atLeastThinking': 'Mindestens eine Denkstufe wählen (außer off)',\r\n 'card.capabilities.applyLevel': 'Stufen anwenden',\r\n 'card.capabilities.restoreDefault': 'Standardwerte wiederherstellen',\r\n 'card.capabilities.unsaved': 'Nicht gespeichert',\r\n 'card.capabilities.saveChanges': 'Änderungen speichern',\r\n 'card.capabilities.saved': 'Gespeichert',\r\n 'card.capabilities.thinkingFormat': 'Denkformat',\r\n 'card.capabilities.thinkingFormat.inherit': 'Vererben',\r\n 'card.capabilities.contextWindow': 'Kontextfenster-Limit',\r\n 'card.capabilities.contextCustomPlaceholder': 'Eigene Ganzzahl, z. B. 256000',\r\n 'card.capabilities.contextClear': 'Löschen',\r\n 'card.capabilities.contextInteger': 'Die Kontextlänge muss eine Ganzzahl sein (2000-1000000)',\r\n 'card.capabilities.contextRange': 'Die Kontextlänge muss zwischen 2000 und 1000000 liegen',\r\n 'card.capabilities.contextHint': 'Voreinstellung wählen oder Ganzzahl eingeben (2000–1000000); wird in llm-pi-ai für Kontextdruck/Kompaktierung geschrieben und gilt ohne Neustart ab der nächsten Anfrage.',\r\n 'input.context.title': 'Kontextfenster',\r\n 'input.context.globalHint': 'Gilt global für alle Sessions mit diesem Modell (Löschen stellt den Standard wieder her)',\r\n 'input.context.unset': 'Nicht gesetzt',\r\n 'input.context.custom': 'Benutzerdefiniert',\r\n 'input.context.noModel': 'Noch kein Session-Modell',\r\n 'input.context.customPlaceholder': 'Eigene Ganzzahl, z. B. 256000',\r\n 'input.context.apply': 'Anwenden',\r\n 'input.context.clear': 'Löschen',\r\n 'input.context.integer': 'Die Kontextlänge muss eine Ganzzahl sein (2000-1000000)',\r\n 'input.context.range': 'Die Kontextlänge muss zwischen 2000 und 1000000 liegen',\r\n 'model.panel.choose': 'Modell wählen',\r\n 'model.panel.loading': 'Modellverzeichnis wird geladen…',\r\n 'model.panel.empty': 'Keine Modelle verfügbar',\r\n 'model.panel.window': 'Fenster',\r\n 'model.panel.noTarget': 'Kein schreibbarer Konfigurationseintrag für dieses Modell',\r\n 'model.panel.unavailable': 'Das Modellverzeichnis ist für diese Session nicht verfügbar',\r\n 'input.effort.title': 'Reasoning-Effort',\r\n 'input.effort.default': 'Provider-Standard',\r\n 'card.capabilities.failed': 'Speichern fehlgeschlagen: Der Wert wurde abgelehnt oder kollidiert. Bitte prüfen.',\r\n}\r\n\r\n/** Italian dictionary (keys mirror zh). */\r\nexport const it: Record<keyof typeof zh, string> = {\r\n 'card.title': 'Livelli di pensiero',\r\n 'family.title': 'Impostazioni dei plugin Qizi',\r\n 'card.description': 'Scegli Auto nel selettore del modello: il plugin pianifica low / high / max a ogni turno di strumenti prima di inviare l\\'effort all\\'API. Qui configuri il livello predefinito, i limiti dello scheduler e le capacità per modello (mapping livello → valore wire inviato al gateway).',\r\n 'card.level': 'Livello predefinito',\r\n 'card.level.off': 'off — disattiva il pensiero (solo manuale, mai scelto in automatico)',\r\n 'card.level.on': 'on — attiva il pensiero (solo modelli a toggle; invia enable_thinking, mai un effort)',\r\n 'card.level.minimal': 'minimal — minimo (attività molto leggere)',\r\n 'card.level.low': 'low — basso (i turni economici restano economici)',\r\n 'card.level.medium': 'medium — medio',\r\n 'card.level.high': 'high — alto (predefinito ufficiale)',\r\n 'card.level.xhigh': 'xhigh — molto alto',\r\n 'card.level.max': 'max — massimo (attività pesanti)',\r\n 'card.level.auto': 'auto — pianifica dalla cronologia degli strumenti (predefinito)',\r\n 'card.enabled': 'Attivato',\r\n 'card.allowDowngrade': 'Consenti il downgrade (auto può scendere a low)',\r\n 'card.allowUpgrade': 'Consenti l\\'upgrade (auto può salire a max)',\r\n 'card.unavailable': 'Namespace delle impostazioni non disponibile: verifica che dsh-thinking-levels sia assemblato in questo profilo.',\r\n 'card.readonly': 'Sola lettura',\r\n 'card.capabilities': 'Capacità del modello (provider personalizzati llm-pi-ai)',\r\n 'card.capabilities.hint': 'Legge e scrive direttamente la configurazione llm-pi-ai: spunta un livello e inserisci il valore esatto inviato al gateway (es. high → ultra); lasciare off vuoto significa «non inviare». La visione abilita l\\'input di immagini; l\\'interruttore di pensiero comanda enable_thinking; thinkingFormat sceglie la serializzazione wire.',\r\n 'card.capabilities.empty': 'Nessun provider personalizzato ha modelli configurati in llm-pi-ai. Aggiungi prima un provider e i modelli in Impostazioni → Modelli.',\r\n 'card.capabilities.unavailable': 'Il namespace delle impostazioni llm-pi-ai non è disponibile.',\r\n 'card.capabilities.none': '(nessun modello)',\r\n 'card.capabilities.search': 'Cerca modelli per nome o ID…',\r\n 'card.capabilities.noMatches': 'Nessun modello corrispondente',\r\n 'card.capabilities.quickSettings': 'Impostazioni rapide',\r\n 'card.capabilities.presetOfficial': 'Applica a tutti: Off / High / Max (stile ufficiale DeepSeek)',\r\n 'card.capabilities.presetGeneric': 'Applica a tutti: Off / Low / Medium / High (generico)',\r\n 'card.capabilities.vendor': 'Provider',\r\n 'card.capabilities.developerRole': 'Il gateway non accetta il ruolo developer',\r\n 'card.capabilities.developerRoleHint': 'Interruttore di compatibilità ufficiale (dsh ≥ v0.1.0-rc.8): scrive compat.supportsDeveloperRole: false a livello di route così il prompt di sistema viene inviato con ruolo system — corregge l\\'errore Unexpected message role 400 dei gateway vLLM / SGLang. Deselezionare elimina il campo e ripristina l\\'ereditarietà.',\r\n 'card.capabilities.expandProvider': 'Espandi provider',\r\n 'card.capabilities.collapseProvider': 'Comprimi provider',\r\n 'card.capabilities.openModelSettings': 'Apri impostazioni modello',\r\n 'card.capabilities.closeModelSettings': 'Comprimi impostazioni modello',\r\n 'card.capabilities.vision': 'Modello vision',\r\n 'card.capabilities.thinking': 'Modello di pensiero',\r\n 'card.capabilities.supportsEffort': 'Supporta l\\'effort di pensiero',\r\n 'card.capabilities.efforts': 'Livelli di effort (spunta, poi inserisci il valore wire)',\r\n 'card.capabilities.wirePlaceholder': 'Valore wire, es. ultra',\r\n 'card.capabilities.offPlaceholder': 'Vuoto = non inviare',\r\n 'card.capabilities.atLeastThinking': 'Seleziona almeno un livello di pensiero (escluso off)',\r\n 'card.capabilities.applyLevel': 'Applica livelli',\r\n 'card.capabilities.restoreDefault': 'Ripristina predefiniti',\r\n 'card.capabilities.unsaved': 'Non salvato',\r\n 'card.capabilities.saveChanges': 'Salva modifiche',\r\n 'card.capabilities.saved': 'Salvato',\r\n 'card.capabilities.thinkingFormat': 'Formato di pensiero',\r\n 'card.capabilities.thinkingFormat.inherit': 'Eredita',\r\n 'card.capabilities.contextWindow': 'Limite finestra di contesto',\r\n 'card.capabilities.contextCustomPlaceholder': 'Intero personalizzato, es. 256000',\r\n 'card.capabilities.contextClear': 'Cancella',\r\n 'card.capabilities.contextInteger': 'La lunghezza del contesto deve essere un intero (2000-1000000)',\r\n 'card.capabilities.contextRange': 'La lunghezza del contesto deve essere tra 2000 e 1000000',\r\n 'card.capabilities.contextHint': 'Scegli un preset o inserisci un intero (2000–1000000); viene scritto in llm-pi-ai per pressione/compattazione del contesto e vale dalla richiesta successiva senza riavvio.',\r\n 'input.context.title': 'Finestra di contesto',\r\n 'input.context.globalHint': 'Vale globalmente per tutte le sessioni che usano questo modello (Cancella ripristina il predefinito)',\r\n 'input.context.unset': 'Non impostato',\r\n 'input.context.custom': 'Personalizzato',\r\n 'input.context.noModel': 'Ancora nessun modello di sessione',\r\n 'input.context.customPlaceholder': 'Intero personalizzato, es. 256000',\r\n 'input.context.apply': 'Applica',\r\n 'input.context.clear': 'Cancella',\r\n 'input.context.integer': 'La lunghezza del contesto deve essere un intero (2000-1000000)',\r\n 'input.context.range': 'La lunghezza del contesto deve essere tra 2000 e 1000000',\r\n 'model.panel.choose': 'Scegli modello',\r\n 'model.panel.loading': 'Caricamento del catalogo modelli…',\r\n 'model.panel.empty': 'Nessun modello disponibile',\r\n 'model.panel.window': 'Finestra',\r\n 'model.panel.noTarget': 'Nessuna voce di configurazione scrivibile per questo modello',\r\n 'model.panel.unavailable': 'Il catalogo modelli non è disponibile per questa sessione',\r\n 'input.effort.title': 'Sforzo di ragionamento',\r\n 'input.effort.default': 'Predefinito del provider',\r\n 'card.capabilities.failed': 'Salvataggio non riuscito: il valore è stato rifiutato o è in conflitto. Controllalo.',\r\n}\r\n\r\n/** Russian dictionary (keys mirror zh). */\r\nexport const ru: Record<keyof typeof zh, string> = {\r\n 'card.title': 'Уровни мышления',\r\n 'family.title': 'Настройки плагинов Qizi',\r\n 'card.description': 'Выберите Auto в селекторе модели: перед отправкой effort в API плагин в каждом раунде планирует low / high / max по истории вызовов инструментов. Здесь настраиваются уровень по умолчанию, границы планировщика и возможности моделей (отображение уровень → wire-значение для шлюза).',\r\n 'card.level': 'Уровень по умолчанию',\r\n 'card.level.off': 'off — мышление выключено (только вручную, автоматически не выбирается)',\r\n 'card.level.on': 'on — мышление включено (только toggle-модели; отправляет enable_thinking, без effort)',\r\n 'card.level.minimal': 'minimal — минимум (очень лёгкие задачи)',\r\n 'card.level.low': 'low — низкий (дешёвые ходы остаются дешёвыми)',\r\n 'card.level.medium': 'medium — средний',\r\n 'card.level.high': 'high — высокий (официальное значение по умолчанию)',\r\n 'card.level.xhigh': 'xhigh — очень высокий',\r\n 'card.level.max': 'max — максимум (тяжёлые задачи)',\r\n 'card.level.auto': 'auto — планирование по истории инструментов (по умолчанию)',\r\n 'card.enabled': 'Включено',\r\n 'card.allowDowngrade': 'Разрешить понижение (auto может опуститься до low)',\r\n 'card.allowUpgrade': 'Разрешить повышение (auto может подняться до max)',\r\n 'card.unavailable': 'Пространство имён настроек недоступно: убедитесь, что dsh-thinking-levels собран в этот профиль.',\r\n 'card.readonly': 'Только чтение',\r\n 'card.capabilities': 'Возможности моделей (свои провайдеры llm-pi-ai)',\r\n 'card.capabilities.hint': 'Читает и пишет конфигурацию llm-pi-ai напрямую: отметьте уровень и введите точное значение, отправляемое шлюзу (например, high → ultra); пустой off означает «не отправлять». Vision разрешает ввод изображений; переключатель мышления управляет enable_thinking; thinkingFormat выбирает формат wire-сериализации.',\r\n 'card.capabilities.empty': 'Ни у одного своего провайдера в llm-pi-ai нет настроенных моделей. Сначала добавьте провайдера и модели в «Настройки → Модели».',\r\n 'card.capabilities.unavailable': 'Пространство имён настроек llm-pi-ai недоступно.',\r\n 'card.capabilities.none': '(нет моделей)',\r\n 'card.capabilities.search': 'Поиск моделей по имени или ID…',\r\n 'card.capabilities.noMatches': 'Нет подходящих моделей',\r\n 'card.capabilities.quickSettings': 'Быстрые настройки',\r\n 'card.capabilities.presetOfficial': 'Применить ко всем: Off / High / Max (официальный стиль DeepSeek)',\r\n 'card.capabilities.presetGeneric': 'Применить ко всем: Off / Low / Medium / High (универсальный)',\r\n 'card.capabilities.vendor': 'Провайдер',\r\n 'card.capabilities.developerRole': 'Шлюз не поддерживает роль developer',\r\n 'card.capabilities.developerRoleHint': 'Официальный переключатель совместимости (dsh ≥ v0.1.0-rc.8): записывает compat.supportsDeveloperRole: false на уровне маршрута, чтобы системный промпт уходил с ролью system, — исправляет ошибку Unexpected message role 400 у шлюзов vLLM / SGLang. Снятие флажка удаляет поле и возвращает наследование.',\r\n 'card.capabilities.expandProvider': 'Развернуть провайдера',\r\n 'card.capabilities.collapseProvider': 'Свернуть провайдера',\r\n 'card.capabilities.openModelSettings': 'Открыть настройки модели',\r\n 'card.capabilities.closeModelSettings': 'Свернуть настройки модели',\r\n 'card.capabilities.vision': 'Vision-модель',\r\n 'card.capabilities.thinking': 'Модель мышления',\r\n 'card.capabilities.supportsEffort': 'Поддерживает reasoning-effort',\r\n 'card.capabilities.efforts': 'Уровни reasoning-effort (отметьте и введите wire-значение)',\r\n 'card.capabilities.wirePlaceholder': 'Wire-значение, например ultra',\r\n 'card.capabilities.offPlaceholder': 'Пусто = не отправлять',\r\n 'card.capabilities.atLeastThinking': 'Выберите хотя бы один уровень мышления (кроме off)',\r\n 'card.capabilities.applyLevel': 'Применить уровни',\r\n 'card.capabilities.restoreDefault': 'Вернуть значения по умолчанию',\r\n 'card.capabilities.unsaved': 'Не сохранено',\r\n 'card.capabilities.saveChanges': 'Сохранить изменения',\r\n 'card.capabilities.saved': 'Сохранено',\r\n 'card.capabilities.thinkingFormat': 'Формат мышления',\r\n 'card.capabilities.thinkingFormat.inherit': 'Наследовать',\r\n 'card.capabilities.contextWindow': 'Лимит контекстного окна',\r\n 'card.capabilities.contextCustomPlaceholder': 'Своё целое число, например 256000',\r\n 'card.capabilities.contextClear': 'Очистить',\r\n 'card.capabilities.contextInteger': 'Длина контекста должна быть целым числом (2000-1000000)',\r\n 'card.capabilities.contextRange': 'Длина контекста должна быть от 2000 до 1000000',\r\n 'card.capabilities.contextHint': 'Выберите предустановку или введите целое число (2000–1000000); оно записывается в llm-pi-ai для контроля нехватки контекста/сжатия и применяется к следующему запросу без перезапуска.',\r\n 'input.context.title': 'Контекстное окно',\r\n 'input.context.globalHint': 'Действует глобально для всех сессий с этой моделью (очистка вернёт значение по умолчанию)',\r\n 'input.context.unset': 'Не задано',\r\n 'input.context.custom': 'Своё значение',\r\n 'input.context.noModel': 'Модель сессии пока не выбрана',\r\n 'input.context.customPlaceholder': 'Своё целое число, например 256000',\r\n 'input.context.apply': 'Применить',\r\n 'input.context.clear': 'Очистить',\r\n 'input.context.integer': 'Длина контекста должна быть целым числом (2000-1000000)',\r\n 'input.context.range': 'Длина контекста должна быть от 2000 до 1000000',\r\n 'model.panel.choose': 'Выбрать модель',\r\n 'model.panel.loading': 'Загрузка каталога моделей…',\r\n 'model.panel.empty': 'Нет доступных моделей',\r\n 'model.panel.window': 'Окно',\r\n 'model.panel.noTarget': 'Для этой модели нет записываемых настроек',\r\n 'model.panel.unavailable': 'Каталог моделей недоступен для этой сессии',\r\n 'input.effort.title': 'Интенсивность рассуждений',\r\n 'input.effort.default': 'Значение провайдера по умолчанию',\r\n 'card.capabilities.failed': 'Не удалось сохранить: значение отклонено или конфликтует. Проверьте его.',\r\n}\r\n\r\n/** Spanish dictionary (keys mirror zh). */\r\nexport const es: Record<keyof typeof zh, string> = {\r\n 'card.title': 'Niveles de pensamiento',\r\n 'family.title': 'Ajustes de los plugins Qizi',\r\n 'card.description': 'Elige Auto en el selector de modelo: el plugin programa low / high / max en cada ronda de herramientas antes de enviar el effort a la API. Aquí configuras el nivel por defecto, los límites del planificador y las capacidades por modelo (mapeo nivel → valor wire enviado a la gateway).',\r\n 'card.level': 'Nivel por defecto',\r\n 'card.level.off': 'off — desactiva el pensamiento (solo manual, nunca se elige automáticamente)',\r\n 'card.level.on': 'on — activa el pensamiento (solo modelos de toggle; envía enable_thinking, nunca un effort)',\r\n 'card.level.minimal': 'minimal — mínimo (tareas muy ligeras)',\r\n 'card.level.low': 'low — bajo (las rondas baratas siguen siendo baratas)',\r\n 'card.level.medium': 'medium — medio',\r\n 'card.level.high': 'high — alto (valor oficial por defecto)',\r\n 'card.level.xhigh': 'xhigh — muy alto',\r\n 'card.level.max': 'max — máximo (tareas pesadas)',\r\n 'card.level.auto': 'auto — programa según el historial de herramientas (por defecto)',\r\n 'card.enabled': 'Activado',\r\n 'card.allowDowngrade': 'Permitir bajar de nivel (auto puede bajar a low)',\r\n 'card.allowUpgrade': 'Permitir subir de nivel (auto puede subir a max)',\r\n 'card.unavailable': 'Espacio de nombres de ajustes no disponible: comprueba que dsh-thinking-levels esté montado en este perfil.',\r\n 'card.readonly': 'Solo lectura',\r\n 'card.capabilities': 'Capacidades del modelo (proveedores personalizados de llm-pi-ai)',\r\n 'card.capabilities.hint': 'Lee y escribe directamente la configuración de llm-pi-ai: marca un nivel e introduce el valor exacto que se envía a la gateway (p. ej., high → ultra); dejar off vacío significa «no enviar». La visión habilita la entrada de imágenes; el interruptor de pensamiento controla enable_thinking; thinkingFormat elige la serialización wire.',\r\n 'card.capabilities.empty': 'Ningún proveedor personalizado tiene modelos configurados en llm-pi-ai. Añade antes un proveedor y modelos en Ajustes → Modelos.',\r\n 'card.capabilities.unavailable': 'El espacio de nombres de ajustes de llm-pi-ai no está disponible.',\r\n 'card.capabilities.none': '(sin modelos)',\r\n 'card.capabilities.search': 'Buscar modelos por nombre o ID…',\r\n 'card.capabilities.noMatches': 'No hay modelos coincidentes',\r\n 'card.capabilities.quickSettings': 'Ajustes rápidos',\r\n 'card.capabilities.presetOfficial': 'Aplicar a todos: Off / High / Max (estilo oficial DeepSeek)',\r\n 'card.capabilities.presetGeneric': 'Aplicar a todos: Off / Low / Medium / High (genérico)',\r\n 'card.capabilities.vendor': 'Proveedor',\r\n 'card.capabilities.developerRole': 'La gateway rechaza el rol developer',\r\n 'card.capabilities.developerRoleHint': 'Interruptor de compatibilidad oficial (dsh ≥ v0.1.0-rc.8): escribe compat.supportsDeveloperRole: false a nivel de ruta para que el prompt del sistema se envíe con rol system; corrige el error Unexpected message role 400 de las gateway vLLM / SGLang. Desmarcar elimina el campo y restaura la herencia.',\r\n 'card.capabilities.expandProvider': 'Desplegar proveedor',\r\n 'card.capabilities.collapseProvider': 'Plegar proveedor',\r\n 'card.capabilities.openModelSettings': 'Abrir ajustes del modelo',\r\n 'card.capabilities.closeModelSettings': 'Plegar ajustes del modelo',\r\n 'card.capabilities.vision': 'Modelo con visión',\r\n 'card.capabilities.thinking': 'Modelo de pensamiento',\r\n 'card.capabilities.supportsEffort': 'Admite esfuerzo de razonamiento',\r\n 'card.capabilities.efforts': 'Niveles de esfuerzo (márcalos e introduce el valor wire)',\r\n 'card.capabilities.wirePlaceholder': 'Valor wire, p. ej., ultra',\r\n 'card.capabilities.offPlaceholder': 'Vacío = no enviar',\r\n 'card.capabilities.atLeastThinking': 'Selecciona al menos un nivel de pensamiento (distinto de off)',\r\n 'card.capabilities.applyLevel': 'Aplicar niveles',\r\n 'card.capabilities.restoreDefault': 'Restaurar valores por defecto',\r\n 'card.capabilities.unsaved': 'Sin guardar',\r\n 'card.capabilities.saveChanges': 'Guardar cambios',\r\n 'card.capabilities.saved': 'Guardado',\r\n 'card.capabilities.thinkingFormat': 'Formato de pensamiento',\r\n 'card.capabilities.thinkingFormat.inherit': 'Heredar',\r\n 'card.capabilities.contextWindow': 'Límite de ventana de contexto',\r\n 'card.capabilities.contextCustomPlaceholder': 'Entero personalizado, p. ej., 256000',\r\n 'card.capabilities.contextClear': 'Borrar',\r\n 'card.capabilities.contextInteger': 'La longitud del contexto debe ser un entero (2000-1000000)',\r\n 'card.capabilities.contextRange': 'La longitud del contexto debe estar entre 2000 y 1000000',\r\n 'card.capabilities.contextHint': 'Elige un preajuste o introduce un entero (2000–1000000); se escribe en llm-pi-ai para la presión/compactación del contexto y se aplica a la siguiente petición sin reiniciar.',\r\n 'input.context.title': 'Ventana de contexto',\r\n 'input.context.globalHint': 'Se aplica globalmente a todas las sesiones que usan este modelo (Borrar restaura el valor por defecto)',\r\n 'input.context.unset': 'Sin fijar',\r\n 'input.context.custom': 'Personalizado',\r\n 'input.context.noModel': 'Aún no hay modelo de sesión',\r\n 'input.context.customPlaceholder': 'Entero personalizado, p. ej., 256000',\r\n 'input.context.apply': 'Aplicar',\r\n 'input.context.clear': 'Borrar',\r\n 'input.context.integer': 'La longitud del contexto debe ser un entero (2000-1000000)',\r\n 'input.context.range': 'La longitud del contexto debe estar entre 2000 y 1000000',\r\n 'model.panel.choose': 'Elegir modelo',\r\n 'model.panel.loading': 'Cargando el catálogo de modelos…',\r\n 'model.panel.empty': 'No hay modelos disponibles',\r\n 'model.panel.window': 'Ventana',\r\n 'model.panel.noTarget': 'No hay ajustes editables para este modelo',\r\n 'model.panel.unavailable': 'El catálogo de modelos no está disponible para esta sesión',\r\n 'input.effort.title': 'Esfuerzo de razonamiento',\r\n 'input.effort.default': 'Por defecto del proveedor',\r\n 'card.capabilities.failed': 'Error al guardar: el valor fue rechazado o entra en conflicto. Revísalo.',\r\n}\r\n","/**\r\n * Pure context-window helpers for the dsh-thinking-levels plugin.\r\n *\r\n * The context-window limit of a custom gateway model is declared in the\r\n * llm-pi-ai model entry (`contextWindow`, a positive integer). The harness\r\n * consumes it through `resolveModelInfo(...).context.contextWindow` for\r\n * compaction thresholds, context-overflow detection and context-pressure\r\n * projections — a settings write takes effect on the next request without a\r\n * restart. This module centralizes the legal range, the common presets and\r\n * the display formatting shared by the config schema, the settings card and\r\n * the tests. Kept dependency-free (pure inputs -> output).\r\n */\r\n\r\n/** Smallest accepted context window (tokens), aligned with dsh-thinking-effort. */\r\nexport const CONTEXT_WINDOW_MIN = 2000\r\n/** Largest accepted context window (tokens), e.g. third-party DeepSeek 1M. */\r\nexport const CONTEXT_WINDOW_MAX = 1_000_000\r\n\r\n/** One selectable context-window preset. */\r\nexport interface ContextWindowPreset {\r\n /** Human-readable label shown on the card button and the model badge. */\r\n label: string\r\n /** The token count written to the llm-pi-ai model entry. */\r\n value: number\r\n}\r\n\r\n/** The multi-level context-window presets, in ascending order. */\r\nexport const CONTEXT_WINDOW_PRESETS: readonly ContextWindowPreset[] = [\r\n { label: '64K', value: 64_000 },\r\n { label: '128K', value: 131_072 },\r\n { label: '256K', value: 256_000 },\r\n { label: '400K', value: 400_000 },\r\n { label: '512K', value: 524_288 },\r\n { label: '1M', value: 1_000_000 },\r\n] as const\r\n\r\n/** Format a token count as a readable label (exact presets keep their label). */\r\nexport function formatContextWindow(value: number): string {\r\n const preset = CONTEXT_WINDOW_PRESETS.find(candidate => candidate.value === value)\r\n if (preset !== undefined) return preset.label\r\n if (value >= CONTEXT_WINDOW_MAX) return '1M'\r\n if (value >= 1024) return `${Math.round(value / 1024)}K`\r\n return String(value)\r\n}\r\n\r\n/** The result of validating a context-window value. */\r\nexport type ContextWindowValidation =\r\n | { ok: true; value: number }\r\n | { ok: false; reason: 'integer' | 'range' }\r\n\r\n/**\r\n * Validate a context-window candidate (number or numeric string). Accepts only\r\n * base-10 integers inside [CONTEXT_WINDOW_MIN, CONTEXT_WINDOW_MAX]; anything\r\n * else (float, 'abc', '1e3', out-of-range) is rejected with a reason.\r\n */\r\nexport function validateContextWindow(value: unknown): ContextWindowValidation {\r\n const raw = typeof value === 'string' ? value.trim() : value\r\n const asString = typeof raw === 'string' ? raw : String(raw)\r\n if (!/^\\d+$/.test(asString)) return { ok: false, reason: 'integer' }\r\n const numeric = Number(asString)\r\n if (!Number.isSafeInteger(numeric)) return { ok: false, reason: 'integer' }\r\n if (numeric < CONTEXT_WINDOW_MIN || numeric > CONTEXT_WINDOW_MAX) {\r\n return { ok: false, reason: 'range' }\r\n }\r\n return { ok: true, value: numeric }\r\n}\r\n","/**\r\n * Model-seat panel for the composer (`conversation.input.model`).\r\n *\r\n * Why this seat: the shipped `ModelSelect` renders no slots inside its popup,\r\n * so a plugin can never contribute *into* that panel — the working pattern\r\n * (proven by dsh-reasoning-effort) is to occupy the model seat itself: one\r\n * registered entry named after the seat with `priority: -1` replaces the\r\n * shipped trigger and popup outright. This component then renders its own\r\n * picker over the harness's shared model directory (`modelDirectories`\r\n * service), so model switching keeps working, and adds what the official\r\n * popup cannot offer: a context-window editor on every model line.\r\n *\r\n * Per-line context window (the \"max context window\" moved into each line):\r\n * each model row carries a compact chip showing the model's effective\r\n * `contextWindow`; clicking it opens an inline editor row (preset slider,\r\n * custom-integer input, Clear). Writes follow the same two-family discipline\r\n * the retired composer pill used (both consumed live by\r\n * `resolveModelInfo(...).context.contextWindow`, effective on the next\r\n * request without a restart):\r\n * - Custom gateways (`llm-pi-ai` providers): writes the model entry's\r\n * `contextWindow` under `providers[provider].models[i]`; a gateway model\r\n * missing from the config has no write target and renders the chip disabled.\r\n * - Official DeepSeek (`deepseek-official`, the `llm-deepseek` entry): writes\r\n * the catalog model's `contextWindow` when listed, otherwise caps via\r\n * `defaultContextWindow`.\r\n *\r\n * Graceful degradation: when the harness provides no `modelDirectories`\r\n * service (older lines) the registration is skipped entirely and the shipped\r\n * model selector stays untouched.\r\n */\r\nimport { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react'\r\nimport type { CSSProperties, JSX } from 'react'\r\nimport type { SettingsScope } from './scope-face.ts'\r\nimport { CONTEXT_WINDOW_PRESETS, formatContextWindow, validateContextWindow } from '../context-window.ts'\r\n\r\n/** The official DeepSeek provider route owned by the llm-deepseek adapter. */\r\nconst DEEPSEEK_PROVIDER = 'deepseek-official'\r\n/** llm-deepseek's native default context capacity (DEFAULT_CONTEXT_WINDOW). */\r\nconst DEEPSEEK_DEFAULT_WINDOW = 1_000_000\r\n/** Slider stop an unset window parks on: the thumb needs a position, the readout stays \"unset\". */\r\nconst UNSET_STOP_INDEX = CONTEXT_WINDOW_PRESETS.findIndex(preset => preset.value === 256_000)\r\n\r\n/** Snapshot shown when the session's directory face is unavailable. */\r\nconst UNAVAILABLE_STATE: ModelDirectoryState = {\r\n status: 'loading',\r\n groups: [],\r\n current: null,\r\n error: null,\r\n}\r\n\r\n/** One injected face: the shared model directory plus the two config forms. */\r\nexport interface ModelPanelInjected {\r\n /**\r\n * The session's shared model directory store, loader and selector.\r\n * Undefined when the resolver refused this session (odd session shape):\r\n * the panel renders its unavailable notice instead of crashing — a thrown\r\n * render abdicates the seat entry and the shipped selector comes back.\r\n */\r\n directory: ModelDirectoryFace | undefined\r\n /** The `llm-pi-ai` config form (custom gateway models). */\r\n piAiScope: SettingsScope<unknown>\r\n /** The `llm-deepseek` config form (official DeepSeek models). */\r\n deepseekScope: SettingsScope<unknown>\r\n}\r\n\r\n/** Full props: the injected face + the session standard seat + locale copy. */\r\nexport interface ModelPanelProps extends ModelPanelInjected {\r\n /** The session id of the slot's owning conversation (standard seat). */\r\n sessionId: string\r\n /** Locale copy thunk. */\r\n t: (key: string) => string\r\n}\r\n\r\n/* ── shared inline styling (no CSS modules in the client bundle) ───────── */\r\n\r\nconst rootStyle: CSSProperties = { position: 'relative', display: 'inline-flex' }\r\n\r\nconst triggerStyle: CSSProperties = {\r\n display: 'inline-flex',\r\n alignItems: 'center',\r\n gap: '6px',\r\n height: '26px',\r\n padding: '0 10px',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n color: 'var(--dsw-alias-label-primary)',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '8px',\r\n fontSize: '12px',\r\n lineHeight: '18px',\r\n cursor: 'pointer',\r\n whiteSpace: 'nowrap',\r\n maxWidth: '220px',\r\n}\r\n\r\nconst triggerNameStyle: CSSProperties = {\r\n minWidth: 0,\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n}\r\n\r\nconst triggerEffortStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n maxWidth: '72px',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n}\r\n\r\nconst chevronStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n fontSize: '9px',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n}\r\n\r\nconst popStyle: CSSProperties = {\r\n position: 'absolute',\r\n bottom: 'calc(100% + 8px)',\r\n left: '0',\r\n zIndex: 1200,\r\n width: '320px',\r\n padding: '8px',\r\n background: 'var(--dsw-alias-bg-layer-3)',\r\n color: 'var(--dsw-alias-label-primary)',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '10px',\r\n boxShadow: '0 8px 28px rgba(0,0,0,0.18)',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '4px',\r\n}\r\n\r\nconst backdropStyle: CSSProperties = { position: 'fixed', inset: 0, zIndex: 1199 }\r\n\r\nconst modelsStyle: CSSProperties = { maxHeight: '320px', overflowY: 'auto', display: 'flex', flexDirection: 'column', gap: '2px' }\r\n\r\nconst providerToggleStyle: CSSProperties = {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '6px',\r\n width: '100%',\r\n padding: '6px 8px',\r\n border: 'none',\r\n borderRadius: '6px',\r\n background: 'transparent',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n font: 'inherit',\r\n fontSize: '12px',\r\n cursor: 'pointer',\r\n textAlign: 'left',\r\n}\r\n\r\nconst providerNameStyle: CSSProperties = { flex: '1 1 auto', fontWeight: 600 }\r\n\r\nconst providerMetaStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n fontSize: '11px',\r\n}\r\n\r\n/** The model-line row CONTAINER: highlight surface + flex parent of pick/select/chip.\r\n* Wraps so the inline window editor (a flex item too) takes its own full line. */\r\nconst modelRowStyle: CSSProperties = {\r\n display: 'flex',\r\n flexWrap: 'wrap',\r\n alignItems: 'center',\r\n gap: '6px',\r\n width: '100%',\r\n borderRadius: '6px',\r\n}\r\n\r\nconst modelRowActiveStyle: CSSProperties = {\r\n ...modelRowStyle,\r\n background: 'var(--dsw-alias-state-business-primary-weak, var(--dsw-alias-interactive-bg-hover, transparent))',\r\n}\r\n\r\n/** The pick button inside the row: name/description/✓, keeps the row's old padding. */\r\nconst modelPickStyle: CSSProperties = {\r\n flex: '1 1 auto',\r\n minWidth: 0,\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '6px',\r\n padding: '6px 4px 6px 18px',\r\n border: 'none',\r\n background: 'transparent',\r\n color: 'var(--dsw-alias-label-primary)',\r\n font: 'inherit',\r\n fontSize: '12px',\r\n cursor: 'pointer',\r\n textAlign: 'left',\r\n}\r\n\r\nconst modelCopyStyle: CSSProperties = {\r\n flex: '1 1 auto',\r\n minWidth: 0,\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '1px',\r\n}\r\n\r\nconst modelNameStyle: CSSProperties = { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }\r\n\r\nconst checkStyle: CSSProperties = { flex: '0 0 auto', color: 'var(--dsw-alias-state-business-primary)' }\r\n\r\nconst chipStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n height: '18px',\r\n padding: '0 6px',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '5px',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n fontSize: '11px',\r\n lineHeight: '16px',\r\n fontFamily: 'var(--ds-font-family-code, monospace)',\r\n fontVariantNumeric: 'tabular-nums',\r\n cursor: 'pointer',\r\n whiteSpace: 'nowrap',\r\n marginRight: '8px',\r\n}\r\n\r\nconst chipDisabledStyle: CSSProperties = { ...chipStyle, cursor: 'default', opacity: 0.55 }\r\n\r\nconst selectStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n height: '18px',\r\n maxWidth: '96px',\r\n padding: '0 2px',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '5px',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n font: 'inherit',\r\n fontSize: '11px',\r\n lineHeight: '16px',\r\n cursor: 'pointer',\r\n colorScheme: 'dark light',\r\n}\r\n\r\nconst editorRowStyle: CSSProperties = {\r\n flex: '1 1 100%',\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '6px',\r\n margin: '2px 8px 6px 18px',\r\n padding: '6px',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '6px',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n fontSize: '12px',\r\n}\r\n\r\nconst labelStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n whiteSpace: 'nowrap',\r\n}\r\n\r\nconst sliderStyle: CSSProperties = {\r\n flex: '1 1 auto',\r\n minWidth: '48px',\r\n height: '14px',\r\n margin: '0',\r\n accentColor: 'var(--dsw-alias-state-business-primary)',\r\n cursor: 'pointer',\r\n}\r\n\r\nconst valueStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n minWidth: '36px',\r\n textAlign: 'right',\r\n color: 'var(--dsw-alias-label-primary)',\r\n fontFamily: 'var(--ds-font-family-code, monospace)',\r\n fontVariantNumeric: 'tabular-nums',\r\n}\r\n\r\nconst actionButtonStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n height: '18px',\r\n padding: '0 6px',\r\n border: '1px solid transparent',\r\n borderRadius: '4px',\r\n background: 'transparent',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n font: 'inherit',\r\n cursor: 'pointer',\r\n}\r\n\r\nconst inputStyle: CSSProperties = {\r\n flex: '1 1 auto',\r\n minWidth: '0',\r\n boxSizing: 'border-box',\r\n padding: '2px 6px',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '5px',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n color: 'var(--dsw-alias-label-primary)',\r\n font: 'inherit',\r\n}\r\n\r\nconst errorStyle: CSSProperties = {\r\n flex: '0 0 auto',\r\n color: 'var(--dsw-alias-state-error-primary)',\r\n fontSize: '11px',\r\n}\r\n\r\nconst statusStyle: CSSProperties = {\r\n padding: '10px 8px',\r\n fontSize: '12px',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n}\r\n\r\nconst errorBannerStyle: CSSProperties = {\r\n padding: '6px 8px',\r\n borderRadius: '6px',\r\n background: 'var(--dsw-alias-interactive-bg-hover-danger)',\r\n color: 'var(--dsw-alias-state-error-primary)',\r\n fontSize: '11px',\r\n}\r\n\r\n/* ── helpers over the settings user layer ──────────────────────────────── */\r\n\r\n/** The user-layer `providers` value of the llm-pi-ai namespace, when present. */\r\nfunction providersOf(snapshot: unknown): Record<string, unknown> {\r\n if (typeof snapshot !== 'object' || snapshot === null) return {}\r\n const user = (snapshot as { user?: unknown }).user\r\n if (typeof user !== 'object' || user === null || Array.isArray(user)) return {}\r\n const providers = (user as Record<string, unknown>)['providers']\r\n return typeof providers === 'object' && providers !== null && !Array.isArray(providers)\r\n ? providers as Record<string, unknown>\r\n : {}\r\n}\r\n\r\n/** The user-layer `models`/`defaultContextWindow` of the llm-deepseek namespace. */\r\nfunction deepseekSectionOf(snapshot: unknown): {\r\n models?: Record<string, unknown>[]\r\n defaultContextWindow?: number\r\n} {\r\n if (typeof snapshot !== 'object' || snapshot === null) return {}\r\n const user = (snapshot as { user?: unknown }).user\r\n if (typeof user !== 'object' || user === null || Array.isArray(user)) return {}\r\n const section = user as { models?: unknown; defaultContextWindow?: unknown }\r\n const models = Array.isArray(section.models)\r\n ? section.models.filter((model): model is Record<string, unknown> =>\r\n typeof model === 'object' && model !== null && !Array.isArray(model))\r\n : undefined\r\n const defaultContextWindow = typeof section.defaultContextWindow === 'number'\r\n ? section.defaultContextWindow\r\n : undefined\r\n return {\r\n ...models === undefined ? {} : { models },\r\n ...defaultContextWindow === undefined ? {} : { defaultContextWindow },\r\n }\r\n}\r\n\r\n/** One model entry's declared contextWindow, when present. */\r\nfunction contextWindowOf(model: Record<string, unknown>): number | undefined {\r\n const value = model['contextWindow']\r\n return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : undefined\r\n}\r\n\r\n/** A provider's model entry in the llm-pi-ai user layer, when present. */\r\nfunction piModelEntry(\r\n providers: Record<string, unknown>,\r\n provider: string,\r\n model: string,\r\n): Record<string, unknown> | undefined {\r\n const profile = providers[provider] as { models?: unknown[] } | undefined\r\n const entry = profile !== undefined && Array.isArray(profile.models)\r\n ? profile.models.find((candidate): candidate is Record<string, unknown> =>\r\n typeof candidate === 'object' && candidate !== null && (candidate as Record<string, unknown>)['id'] === model)\r\n : undefined\r\n return entry\r\n}\r\n\r\n/** The slider stop nearest to a committed token count. */\r\nfunction stopIndexOf(value: number | undefined): number {\r\n if (value === undefined) return Math.max(0, UNSET_STOP_INDEX)\r\n let best = 0\r\n let bestDistance = Number.POSITIVE_INFINITY\r\n CONTEXT_WINDOW_PRESETS.forEach((preset, index) => {\r\n const distance = Math.abs(preset.value - value)\r\n if (distance < bestDistance) {\r\n bestDistance = distance\r\n best = index\r\n }\r\n })\r\n return best\r\n}\r\n\r\n/**\r\n * The model-seat panel: replaces the shipped model selector on this seat and\r\n * renders one picker whose every model line carries a context-window chip\r\n * (the \"max context window\" editor moved into each line).\r\n * @param props - injected directory + config forms, session seat, copy.\r\n */\r\nexport function ModelPanel({ directory, piAiScope, deepseekScope, t }: ModelPanelProps): JSX.Element {\r\n const state = useSyncExternalStore(\r\n listener => directory?.store.subscribe(listener) ?? (() => {}),\r\n () => directory?.store.getSnapshot() ?? UNAVAILABLE_STATE,\r\n )\r\n const piSnapshot = useSyncExternalStore(\r\n listener => piAiScope.subscribe(listener),\r\n () => piAiScope.getSnapshot(),\r\n )\r\n const dsSnapshot = useSyncExternalStore(\r\n listener => deepseekScope.subscribe(listener),\r\n () => deepseekScope.getSnapshot(),\r\n )\r\n\r\n const [open, setOpen] = useState(false)\r\n const [expanded, setExpanded] = useState<ReadonlySet<string>>(() => new Set())\r\n const [editing, setEditing] = useState<{ provider: string; model: string } | null>(null)\r\n const [draft, setDraft] = useState<number | null>(null)\r\n const [custom, setCustom] = useState(false)\r\n const [raw, setRaw] = useState('')\r\n const [error, setError] = useState<string | null>(null)\r\n const [busy, setBusy] = useState(false)\r\n const rootRef = useRef<HTMLDivElement>(null)\r\n\r\n useEffect(() => {\r\n if (!open) return\r\n directory?.load().catch(() => { /* surfaced on the shared store */ })\r\n }, [directory, open])\r\n\r\n const close = useCallback((): void => {\r\n setOpen(false)\r\n setEditing(null)\r\n setError(null)\r\n }, [])\r\n\r\n useEffect(() => {\r\n if (!open) return\r\n const onOutside = (event: globalThis.MouseEvent): void => {\r\n const target = event.target\r\n if (target instanceof Node && rootRef.current?.contains(target)) return\r\n close()\r\n }\r\n document.addEventListener('mousedown', onOutside)\r\n return () => document.removeEventListener('mousedown', onOutside)\r\n }, [close, open])\r\n\r\n const writable = piSnapshot.status === 'ready' && piSnapshot.writable\r\n && dsSnapshot.status === 'ready' && dsSnapshot.writable\r\n\r\n const current = useMemo(() => {\r\n if (state.current === null) return undefined\r\n for (const group of state.groups) {\r\n if (group.id !== state.current.provider) continue\r\n const model = group.models.find(candidate => candidate.id === state.current?.model)\r\n if (model !== undefined) return { model, name: model.name }\r\n }\r\n return undefined\r\n }, [state])\r\n\r\n const providers = useMemo(() => providersOf(piSnapshot), [piSnapshot])\r\n const dsSection = useMemo(() => deepseekSectionOf(dsSnapshot), [dsSnapshot])\r\n\r\n /** The effective window of one model line, resolved against its family. */\r\n const windowOf = (provider: string, model: string): number | undefined => {\r\n if (provider === DEEPSEEK_PROVIDER) {\r\n const models = dsSection.models ?? []\r\n const index = models.findIndex(entry => entry['id'] === model)\r\n return index >= 0 ? contextWindowOf(models[index]) : dsSection.defaultContextWindow\r\n }\r\n const entry = piModelEntry(providers, provider, model)\r\n return entry === undefined ? undefined : contextWindowOf(entry)\r\n }\r\n\r\n /** Whether one model line has a config write target. */\r\n const writableLine = (provider: string, model: string): boolean => {\r\n if (!writable) return false\r\n if (provider === DEEPSEEK_PROVIDER) return true\r\n return piModelEntry(providers, provider, model) !== undefined\r\n }\r\n\r\n /** Commit (or delete) one model line's context window. */\r\n const commitWindow = (provider: string, model: string, value: number | undefined): void => {\r\n setBusy(true)\r\n const done = (): void => { setBusy(false); setDraft(null) }\r\n if (provider === DEEPSEEK_PROVIDER) {\r\n const models = (deepseekSectionOf(dsSnapshot).models ?? []).map(entry => ({ ...entry }))\r\n const index = models.findIndex(entry => entry['id'] === model)\r\n const commit = index >= 0\r\n ? deepseekScope.set('models', models.map((entry, at) => {\r\n if (at !== index) return entry\r\n if (value === undefined) {\r\n const rest = { ...entry }\r\n delete rest['contextWindow']\r\n return rest\r\n }\r\n return { ...entry, contextWindow: value }\r\n }))\r\n : deepseekScope.set('defaultContextWindow', value === undefined ? DEEPSEEK_DEFAULT_WINDOW : value)\r\n commit.then(done, done)\r\n return\r\n }\r\n const next = structuredClone(providers)\r\n const entry = piModelEntry(next, provider, model)\r\n if (entry === undefined) {\r\n setBusy(false)\r\n setDraft(null)\r\n return\r\n }\r\n if (value === undefined) delete entry['contextWindow']\r\n else entry['contextWindow'] = value\r\n piAiScope.set('providers', next).then(done, done)\r\n }\r\n\r\n /** Validate and commit the custom input; empty clears. */\r\n const applyCustom = (): void => {\r\n if (editing === null) return\r\n const trimmed = raw.trim()\r\n if (trimmed === '') {\r\n setError(null)\r\n commitWindow(editing.provider, editing.model, undefined)\r\n return\r\n }\r\n const validation = validateContextWindow(trimmed)\r\n if (!validation.ok) {\r\n setError(t(validation.reason === 'integer' ? 'input.context.integer' : 'input.context.range'))\r\n return\r\n }\r\n setError(null)\r\n commitWindow(editing.provider, editing.model, validation.value)\r\n }\r\n\r\n const openEditor = (provider: string, model: string): void => {\r\n setEditing({ provider, model })\r\n setDraft(null)\r\n setCustom(false)\r\n setRaw('')\r\n setError(null)\r\n }\r\n\r\n const toggleProvider = (provider: string): void => {\r\n setExpanded(previous => {\r\n const next = new Set(previous)\r\n if (next.has(provider)) next.delete(provider)\r\n else next.add(provider)\r\n return next\r\n })\r\n }\r\n\r\n const chooseModel = (provider: string, model: string): void => {\r\n if (busy || directory === undefined) return\r\n setBusy(true)\r\n directory.select({ provider, model })\r\n .then(() => { setBusy(false); close() })\r\n .catch(() => { setBusy(false) })\r\n }\r\n\r\n /** Commit one model line's reasoning effort; empty string = provider default (omit the field). */\r\n const chooseEffort = (provider: string, model: string, effort: string): void => {\r\n if (busy || directory === undefined) return\r\n setBusy(true)\r\n directory.select({ provider, model, ...(effort === '' ? {} : { reasoningEffort: effort }) })\r\n .then(() => { setBusy(false) })\r\n .catch(() => { setBusy(false) })\r\n }\r\n\r\n const triggerLabel = current?.name ?? state.current?.model ?? t('model.panel.choose')\r\n\r\n const currentReasoning = current?.model.reasoning\r\n const effectiveEffort = state.current?.reasoningEffort ?? currentReasoning?.defaultEffort\r\n const effortLabel = currentReasoning === undefined\r\n ? undefined\r\n : effectiveEffort === undefined\r\n ? t('input.effort.default')\r\n : currentReasoning.efforts.find(level => level.id === effectiveEffort)?.name ?? effectiveEffort\r\n\r\n return (\r\n <div ref={rootRef} style={rootStyle}>\r\n <button\r\n type=\"button\"\r\n style={triggerStyle}\r\n aria-expanded={open}\r\n aria-haspopup=\"dialog\"\r\n aria-label={t('model.panel.choose')}\r\n title={state.current === null ? triggerLabel : `${state.current.provider}/${triggerLabel}`}\r\n onClick={() => { if (open) close(); else { setOpen(true); setError(null) } }}\r\n >\r\n <span style={triggerNameStyle}>{triggerLabel}</span>\r\n {effortLabel !== undefined && <span style={triggerEffortStyle}>{effortLabel}</span>}\r\n <span style={chevronStyle}>{open ? '▲' : '▼'}</span>\r\n </button>\r\n {open\r\n ? (\r\n <>\r\n <div style={backdropStyle} onClick={close} />\r\n <div style={popStyle} role=\"dialog\" aria-label={t('model.panel.choose')}>\r\n <div style={modelsStyle}>\r\n {directory === undefined && (\r\n <div style={statusStyle}>{t('model.panel.unavailable')}</div>\r\n )}\r\n {directory !== undefined && state.status === 'loading' && state.groups.length === 0 && (\r\n <div style={statusStyle}>{t('model.panel.loading')}</div>\r\n )}\r\n {directory !== undefined && state.groups.map(group => {\r\n const isExpanded = expanded.has(group.id)\r\n const name = group.name ?? group.label ?? group.id\r\n const activeModel = state.current?.provider === group.id ? state.current.model : undefined\r\n return (\r\n <section key={group.id}>\r\n <button\r\n type=\"button\"\r\n style={providerToggleStyle}\r\n aria-expanded={isExpanded}\r\n onClick={() => toggleProvider(group.id)}\r\n >\r\n <span style={providerNameStyle}>{name}</span>\r\n <span style={providerMetaStyle}>{group.models.length}</span>\r\n <span style={chevronStyle}>{isExpanded ? '▼' : '▶'}</span>\r\n </button>\r\n {isExpanded && group.models.map(model => {\r\n const active = activeModel === model.id\r\n const lineWritable = writableLine(group.id, model.id)\r\n const lineWindow = windowOf(group.id, model.id)\r\n const isEditing = editing !== null\r\n && editing.provider === group.id\r\n && editing.model === model.id\r\n const lineEffort = active\r\n ? state.current?.reasoningEffort ?? model.reasoning?.defaultEffort\r\n : model.reasoning?.defaultEffort\r\n return (\r\n <div key={group.id + ':' + model.id} style={active ? modelRowActiveStyle : modelRowStyle}>\r\n <button\r\n type=\"button\"\r\n role=\"option\"\r\n aria-selected={active}\r\n style={modelPickStyle}\r\n disabled={busy}\r\n onClick={() => chooseModel(group.id, model.id)}\r\n >\r\n <span style={modelCopyStyle}>\r\n <span style={modelNameStyle}>{model.name}</span>\r\n </span>\r\n {active && <span style={checkStyle} aria-hidden=\"true\">✓</span>}\r\n </button>\r\n {model.reasoning !== undefined && (\r\n <select\r\n aria-label={t('input.effort.title')}\r\n title={t('input.effort.title')}\r\n style={selectStyle}\r\n disabled={busy}\r\n value={lineEffort ?? ''}\r\n onClick={event => event.stopPropagation()}\r\n onChange={event => {\r\n event.stopPropagation()\r\n const value = event.currentTarget.value\r\n // '' (provider default) only exists for models declaring a\r\n // defaultEffort: the host keeps the current effort when a\r\n // selection omits reasoningEffort, so reset submits the\r\n // declared default instead.\r\n const target = value === '' ? model.reasoning?.defaultEffort : value\r\n if (target !== undefined) chooseEffort(group.id, model.id, target)\r\n }}\r\n >\r\n {model.reasoning.defaultEffort !== undefined && (\r\n <option value=\"\">{t('input.effort.default')}</option>\r\n )}\r\n {model.reasoning.defaultEffort === undefined && (\r\n <option value=\"\" hidden>{t('input.effort.default')}</option>\r\n )}\r\n {model.reasoning.efforts.map(level => (\r\n <option key={level.id} value={level.id}>{level.name}</option>\r\n ))}\r\n </select>\r\n )}\r\n <span\r\n role=\"button\"\r\n tabIndex={0}\r\n aria-label={t('input.context.title')}\r\n title={lineWritable\r\n ? t('input.context.globalHint')\r\n : t('model.panel.noTarget')}\r\n style={lineWritable && !busy ? chipStyle : chipDisabledStyle}\r\n onClick={event => {\r\n event.stopPropagation()\r\n if (!lineWritable || busy) return\r\n if (isEditing) { setEditing(null); return }\r\n openEditor(group.id, model.id)\r\n }}\r\n onKeyDown={event => {\r\n if (event.key !== 'Enter' && event.key !== ' ') return\r\n event.preventDefault()\r\n event.stopPropagation()\r\n if (!lineWritable || busy) return\r\n openEditor(group.id, model.id)\r\n }}\r\n >\r\n {lineWindow === undefined\r\n ? t('input.context.unset')\r\n : formatContextWindow(lineWindow)}\r\n </span>\r\n {isEditing && (\r\n <div style={editorRowStyle}>\r\n <span style={labelStyle} title={t('input.context.globalHint')}>\r\n {t('model.panel.window')}\r\n </span>\r\n <input\r\n type=\"range\"\r\n min={0}\r\n max={CONTEXT_WINDOW_PRESETS.length - 1}\r\n step={1}\r\n value={draft ?? stopIndexOf(lineWindow)}\r\n disabled={busy}\r\n aria-label={t('input.context.title')}\r\n style={sliderStyle}\r\n onChange={event => { setDraft(Number(event.currentTarget.value)) }}\r\n onPointerUp={() => {\r\n if (draft === null) return\r\n commitWindow(group.id, model.id, CONTEXT_WINDOW_PRESETS[draft]?.value)\r\n }}\r\n onKeyUp={() => {\r\n if (draft === null) return\r\n commitWindow(group.id, model.id, CONTEXT_WINDOW_PRESETS[draft]?.value)\r\n }}\r\n />\r\n <span style={valueStyle}>\r\n {draft === null\r\n ? lineWindow === undefined ? t('input.context.unset') : formatContextWindow(lineWindow)\r\n : formatContextWindow(CONTEXT_WINDOW_PRESETS[draft]?.value ?? 0)}\r\n </span>\r\n {custom\r\n ? (\r\n <>\r\n <input\r\n type=\"text\"\r\n inputMode=\"numeric\"\r\n value={raw}\r\n disabled={busy}\r\n placeholder={t('input.context.customPlaceholder')}\r\n aria-label={t('input.context.customPlaceholder')}\r\n style={inputStyle}\r\n onChange={event => { setRaw(event.currentTarget.value) }}\r\n onKeyDown={event => { if (event.key === 'Enter') applyCustom() }}\r\n />\r\n <button\r\n type=\"button\"\r\n disabled={busy}\r\n style={actionButtonStyle}\r\n onClick={applyCustom}\r\n >\r\n {t('input.context.apply')}\r\n </button>\r\n </>\r\n )\r\n : (\r\n <>\r\n <button\r\n type=\"button\"\r\n disabled={busy}\r\n aria-label={t('input.context.custom')}\r\n title={t('input.context.custom')}\r\n style={actionButtonStyle}\r\n onClick={() => { setCustom(true); setError(null) }}\r\n >\r\n ⋯\r\n </button>\r\n <button\r\n type=\"button\"\r\n disabled={busy || lineWindow === undefined}\r\n style={{\r\n ...actionButtonStyle,\r\n opacity: lineWindow === undefined ? 0.55 : 1,\r\n }}\r\n onClick={() => {\r\n setDraft(null)\r\n setError(null)\r\n commitWindow(group.id, model.id, undefined)\r\n }}\r\n >\r\n {t('input.context.clear')}\r\n </button>\r\n </>\r\n )}\r\n {error !== null && <span style={errorStyle}>{error}</span>}\r\n </div>\r\n )}\r\n </div>\r\n )\r\n })}\r\n </section>\r\n )\r\n })}\r\n {directory !== undefined && state.status !== 'loading' && state.groups.length === 0 && (\r\n <div style={statusStyle}>{t('model.panel.empty')}</div>\r\n )}\r\n </div>\r\n {directory !== undefined && state.error !== null && <div style={errorBannerStyle} role=\"status\">{state.error}</div>}\r\n </div>\r\n </>\r\n )\r\n : null}\r\n </div>\r\n )\r\n}\r\n\r\nexport default ModelPanel\r\n","/**\r\n * Thinking-levels settings card — the family settings tab face of the\r\n * dsh-thinking-levels plugin.\r\n *\r\n * The card binds this plugin's entry config through the `configForms` cordis\r\n * service and renders its fields: the level picker\r\n * (off / on / minimal / low / medium / high / xhigh / max / auto) plus the\r\n * scheduler toggles. Every change commits immediately through the scope (no\r\n * staged form): the decision is read per model request, so a committed change\r\n * applies to the next request without a restart.\r\n *\r\n * Below the scheduler rows, a \"model capabilities\" block edits the\r\n * `llm-pi-ai` namespace directly (read + write through the same settings\r\n * transport), borrowing dsh-thinking-effort's presentation: providers group\r\n * their models, each model row shows capability badges and expands into a\r\n * per-level editor where a level is ticked and its gateway wire value entered\r\n * (e.g. `high` → `ultra`); `off` left empty means \"do not send\". A search box\r\n * filters models and one-click presets apply official/generic level sets to\r\n * every thinking model.\r\n *\r\n * Kept dependency-free beyond react: the scopes are subscribed with\r\n * `useSyncExternalStore`, and the controls are plain HTML so the client bundle\r\n * needs no CSS modules and no primitives value import.\r\n */\r\nimport { useState, useSyncExternalStore } from 'react'\r\nimport type { CSSProperties, JSX } from 'react'\r\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\r\nimport type { SettingsScope } from './scope-face.ts'\r\nimport type { EffortId } from '../thinking-level.ts'\r\nimport { CONTEXT_WINDOW_PRESETS, formatContextWindow, validateContextWindow } from '../context-window.ts'\r\nimport type { ThinkingLevelsConfig } from '../index.ts'\r\n\r\n/** One injected face: the plugin's own scope plus the llm-pi-ai namespace scope. */\r\nexport interface ThinkingLevelsCardInjected {\r\n scope: SettingsScope<ThinkingLevelsConfig>\r\n /** The `llm-pi-ai` settings namespace, read and written for model capabilities. */\r\n piAiScope: SettingsScope<unknown>\r\n}\r\n\r\n/** Full props: locale seat + the injected scopes. */\r\nexport type ThinkingLevelsCardProps = PropsLocale<'thinking-levels'> & ThinkingLevelsCardInjected\r\n\r\n/** The user-facing levels, in picker order: eight standard levels plus the auto scheduler sentinel. */\r\nconst EFFORT_OPTIONS: readonly EffortId[] = [\r\n 'off', 'on', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'auto',\r\n]\r\n\r\n/**\r\n * The levels the capability editor offers. This is the llm-pi-ai\r\n * `reasoningEfforts` table-key space — pi-ai's fixed seven levels (schema\r\n * rejects any other key). `on` (the enable-thinking toggle) is a selector /\r\n * injection-level concept, expressed here by the `off` + `high` pair\r\n * (enable_thinking false/true), so it has no table key of its own.\r\n */\r\nconst CAPABILITY_LEVELS: readonly EffortId[] = [\r\n 'off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max',\r\n] as const\r\n\r\n/** One-click presets, mirroring dsh-thinking-effort: official DeepSeek style and a generic set. */\r\nconst PRESETS: readonly { key: 'official' | 'generic'; levels: Record<string, unknown> }[] = [\r\n { key: 'official', levels: { off: null, high: 'high', max: 'max' } },\r\n { key: 'generic', levels: { off: null, low: 'low', medium: 'medium', high: 'high' } },\r\n]\r\n\r\n/** The wire thinking formats offered (llm-pi-ai's nameable set, incl. qwen-chat-template). */\r\nconst THINKING_FORMATS = [\r\n 'openai', 'deepseek', 'openrouter', 'together', 'zai', 'qwen',\r\n 'qwen-chat-template', 'string-thinking', 'ant-ling',\r\n] as const\r\n\r\n/* ── shared row styling (inline; keeps the client bundle CSS-free) ──────── */\r\n\r\nconst rowStyle: CSSProperties = {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n gap: '12px',\r\n padding: '6px 0',\r\n fontSize: '13px',\r\n lineHeight: '20px',\r\n}\r\n\r\nconst labelStyle: CSSProperties = { margin: 0, color: 'var(--dsw-alias-label-primary)' }\r\n\r\nconst controlStyle: CSSProperties = {\r\n background: 'var(--dsw-alias-bg-surface, #fff)',\r\n color: 'var(--dsw-alias-label-primary)',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '4px',\r\n padding: '3px 8px',\r\n fontSize: '13px',\r\n}\r\n\r\nconst sectionStyle: CSSProperties = {\r\n marginTop: '14px',\r\n paddingTop: '12px',\r\n borderTop: '1px solid var(--dsw-alias-border-l2)',\r\n}\r\n\r\nconst fieldStyle: CSSProperties = { display: 'flex', flexDirection: 'column', gap: '4px' }\r\n\r\nconst fieldLabelStyle: CSSProperties = { margin: 0, fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-label-tertiary)' }\r\n\r\nconst hintStyle: CSSProperties = { margin: '6px 0 0', fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-label-tertiary)' }\r\n\r\n/** Provider group shell: an outlined row grouping its models. */\r\nconst providerStyle: CSSProperties = {\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '8px',\r\n margin: '8px 0 0',\r\n overflow: 'hidden',\r\n}\r\n\r\nconst providerHeadStyle: CSSProperties = {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '8px',\r\n padding: '7px 10px',\r\n background: 'var(--dsw-alias-bg-layer-2, rgba(127,127,127,0.06))',\r\n}\r\n\r\nconst providerNameStyle: CSSProperties = {\r\n margin: 0,\r\n flex: '1 1 auto',\r\n minWidth: 0,\r\n fontFamily: 'var(--ds-font-family-code, monospace)',\r\n fontSize: '12px',\r\n lineHeight: '18px',\r\n fontWeight: 600,\r\n color: 'var(--dsw-alias-label-primary)',\r\n overflowWrap: 'anywhere',\r\n}\r\n\r\nconst providerBadgeStyle: CSSProperties = {\r\n margin: 0,\r\n fontSize: '10px',\r\n lineHeight: '16px',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '4px',\r\n padding: '0 5px',\r\n whiteSpace: 'nowrap',\r\n}\r\n\r\nconst iconButtonStyle: CSSProperties = {\r\n background: 'none',\r\n border: 'none',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n cursor: 'pointer',\r\n padding: '2px 4px',\r\n display: 'inline-flex',\r\n alignItems: 'center',\r\n}\r\n\r\n/** One model row inside a provider group. */\r\nconst modelRowStyle: CSSProperties = {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '8px',\r\n padding: '7px 10px',\r\n borderTop: '1px solid var(--dsw-alias-border-l2)',\r\n}\r\n\r\nconst modelIdStyle: CSSProperties = {\r\n margin: 0,\r\n flex: '1 1 auto',\r\n minWidth: 0,\r\n fontFamily: 'var(--ds-font-family-code, monospace)',\r\n fontSize: '12px',\r\n lineHeight: '18px',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n overflowWrap: 'anywhere',\r\n}\r\n\r\n/** Capability badge chips (text / image / context). */\r\nconst badgeStyle: CSSProperties = {\r\n fontSize: '10px',\r\n lineHeight: '16px',\r\n color: 'var(--dsw-alias-label-tertiary)',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '4px',\r\n padding: '0 5px',\r\n whiteSpace: 'nowrap',\r\n}\r\n\r\n/** The per-level editor grid: one row per level with a toggle, a label and a wire input. */\r\nconst levelRowStyle: CSSProperties = {\r\n display: 'grid',\r\n gridTemplateColumns: 'auto 92px minmax(0, 1fr)',\r\n alignItems: 'center',\r\n gap: '8px',\r\n padding: '4px 0',\r\n fontSize: '13px',\r\n}\r\n\r\nconst levelNameStyle: CSSProperties = { margin: 0, fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-label-secondary)' }\r\n\r\nconst wireInputStyle: CSSProperties = {\r\n background: 'var(--dsw-alias-bg-surface, #fff)',\r\n color: 'var(--dsw-alias-label-primary)',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '4px',\r\n padding: '3px 8px',\r\n fontSize: '12px',\r\n width: '100%',\r\n boxSizing: 'border-box',\r\n}\r\n\r\n/* ── helpers over the llm-pi-ai user layer ─────────────────────────────── */\r\n\r\n/** A row's `reasoningEfforts` as stored in the user layer. */\r\nfunction effortsOf(model: Record<string, unknown>): false | Record<string, unknown> | undefined {\r\n const value = model['reasoningEfforts']\r\n if (value === false) return false\r\n if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\r\n return value as Record<string, unknown>\r\n }\r\n return undefined\r\n}\r\n\r\n/**\r\n * Build a `reasoningEfforts` table from a level→wire draft. `off` maps to\r\n * `null` (omit the reasoning option → enable_thinking false) unless the user\r\n * typed a wire value; every other ticked level keeps its typed wire value.\r\n * pi-ai rejects a table offering nothing beyond `off`, so a selection of only\r\n * `off` falls back to the default `high` level.\r\n */\r\nfunction effortTableOf(draft: Record<string, string | null>): Record<string, unknown> {\r\n const table: Record<string, unknown> = {}\r\n for (const level of CAPABILITY_LEVELS) {\r\n const wire = draft[level]\r\n if (wire === undefined || wire === null) continue\r\n const trimmed = typeof wire === 'string' ? wire.trim() : ''\r\n if (level === 'off') table[level] = trimmed === '' ? null : trimmed\r\n else if (trimmed !== '') table[level] = trimmed\r\n }\r\n if (Object.keys(table).length === 0 || Object.keys(table).every(level => table[level] === null)) {\r\n return { ...table, high: 'high' }\r\n }\r\n return table\r\n}\r\n\r\n/** Whether a row declares `compat.supportsReasoningEffort` (the wire sends reasoning_effort). */\r\nfunction supportsEffortOf(model: Record<string, unknown>): boolean {\r\n const compat = model['compat']\r\n if (typeof compat !== 'object' || compat === null || Array.isArray(compat)) return false\r\n return (compat as Record<string, unknown>)['supportsReasoningEffort'] === true\r\n}\r\n\r\n/** Patch one row's `compat` object, merging rather than replacing sibling fields. */\r\nfunction patchCompat(\r\n row: Record<string, unknown>,\r\n patch: (compat: Record<string, unknown>) => void,\r\n): void {\r\n const compat = typeof row['compat'] === 'object' && row['compat'] !== null && !Array.isArray(row['compat'])\r\n ? { ...(row['compat'] as Record<string, unknown>) }\r\n : {}\r\n patch(compat)\r\n if (Object.keys(compat).length === 0) delete row['compat']\r\n else row['compat'] = compat\r\n}\r\n\r\n/** The user-layer `providers` value of the llm-pi-ai namespace, when present. */\r\nfunction providersOf(snapshot: unknown): Record<string, unknown> {\r\n if (typeof snapshot !== 'object' || snapshot === null) return {}\r\n const user = (snapshot as { user?: unknown }).user\r\n if (typeof user !== 'object' || user === null || Array.isArray(user)) return {}\r\n const providers = (user as Record<string, unknown>)['providers']\r\n return typeof providers === 'object' && providers !== null && !Array.isArray(providers)\r\n ? providers as Record<string, unknown>\r\n : {}\r\n}\r\n\r\n/** Whether a route-level profile declares `compat.supportsDeveloperRole: false`. */\r\nfunction developerRoleDisabledOf(profile: unknown): boolean {\r\n if (typeof profile !== 'object' || profile === null) return false\r\n const compat = (profile as Record<string, unknown>)['compat']\r\n if (typeof compat !== 'object' || compat === null || Array.isArray(compat)) return false\r\n return (compat as Record<string, unknown>)['supportsDeveloperRole'] === false\r\n}\r\n\r\n/** One flattened capability entry: a provider's model at an array index. */\r\ninterface CapabilityEntry {\r\n providerId: string\r\n index: number\r\n model: Record<string, unknown>\r\n modelId: string\r\n /** The provider-level `compat`, applied to models that declare none (display parity). */\r\n providerCompat?: unknown\r\n /** The provider-level `defaultInput`, applied to models that declare none (display parity). */\r\n providerInput?: unknown[]\r\n}\r\n\r\n/** The effective `compat` of an entry: its own `compat` merged over the provider-level `compat`. */\r\nfunction compatOf(entry: CapabilityEntry): Record<string, unknown> {\r\n const base = typeof entry.providerCompat === 'object' && entry.providerCompat !== null\r\n ? entry.providerCompat as Record<string, unknown>\r\n : {}\r\n const own = entry.model['compat']\r\n return typeof own === 'object' && own !== null && !Array.isArray(own)\r\n ? { ...base, ...(own as Record<string, unknown>) }\r\n : base\r\n}\r\n\r\n/** Flatten the user-layer providers into capability entries (models arrays only). */\r\nfunction entriesOf(providers: Record<string, unknown>): CapabilityEntry[] {\r\n return Object.entries(providers).flatMap(([providerId, profile]) => {\r\n const raw = profile as Record<string, unknown>\r\n const models = raw['models']\r\n if (!Array.isArray(models)) return []\r\n const providerCompat = raw['compat']\r\n const providerInput = Array.isArray(raw['defaultInput']) ? raw['defaultInput'] as unknown[] : undefined\r\n return models.map((model, index) => ({\r\n providerId,\r\n index,\r\n model: (typeof model === 'object' && model !== null && !Array.isArray(model)\r\n ? model as Record<string, unknown>\r\n : {}),\r\n modelId: typeof model === 'object' && model !== null && typeof (model as Record<string, unknown>)['id'] === 'string'\r\n ? (model as Record<string, unknown>)['id'] as string\r\n : `#${index + 1}`,\r\n providerCompat,\r\n providerInput,\r\n }))\r\n })\r\n}\r\n\r\n/** Human-readable capability summary of one entry (input modalities + declared context window). */\r\nfunction summaryOf(entry: CapabilityEntry): { text: boolean; image: boolean; context: string | null } {\r\n // Modalities fall back to the provider-level `defaultInput` so a vision\r\n // gateway declared once on the route shows every model as vision, matching\r\n // llm-pi-ai's resolution and the adapter's runtime gate.\r\n const input = Array.isArray(entry.model['input'])\r\n ? entry.model['input'] as unknown[]\r\n : entry.providerInput\r\n const text = !Array.isArray(input) || input.length === 0 || input.includes('text')\r\n const image = Array.isArray(input) && input.includes('image')\r\n const contextWindow = entry.model['contextWindow']\r\n const context = typeof contextWindow === 'number' && Number.isFinite(contextWindow) && contextWindow > 0\r\n ? formatContextWindow(contextWindow)\r\n : null\r\n return { text, image, context }\r\n}\r\n\r\n/** A tiny inline chevron icon (no CSS modules). */\r\nfunction ChevronIcon({ open }: { open: boolean }): JSX.Element {\r\n return (\r\n <svg\r\n width=\"12\" height=\"12\" viewBox=\"0 0 16 16\" aria-hidden\r\n style={{ transform: open ? 'rotate(180deg)' : 'none', transition: 'transform 0.16s' }}\r\n >\r\n <path d=\"M4 6l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\r\n </svg>\r\n )\r\n}\r\n\r\n/**\r\n * The llm-pi-ai model-capability editor block (dsh-thinking-effort style:\r\n * provider groups, model rows with badges, per-level wire editors, search and\r\n * one-click presets).\r\n * @param scope - the `llm-pi-ai` namespace scope.\r\n * @param t - copy lookup.\r\n * @param readonly - whether writes are forbidden.\r\n * @returns the capabilities block, or a placeholder when nothing is configured.\r\n */\r\nfunction ModelCapabilities(props: {\r\n scope: SettingsScope<unknown>\r\n t: (key: string) => string\r\n readonly: boolean\r\n}): JSX.Element {\r\n const { scope, t, readonly } = props\r\n const snapshot = useSyncExternalStore(\r\n (listener) => scope.subscribe(listener),\r\n () => scope.getSnapshot(),\r\n )\r\n const unavailable = snapshot.status === 'unavailable'\r\n const providers = snapshot.status === 'ready' ? providersOf(snapshot) : {}\r\n // Every llm-pi-ai provider is listed with its models — no list gating: the\r\n // official compat surface (dsh ≥ rc.8) means pi-ai serves every route\r\n // natively, so each model is editable right here.\r\n const allEntries = entriesOf(providers)\r\n\r\n // UI-only state: provider/model expansion, the wire drafts, and the query.\r\n const [query, setQuery] = useState('')\r\n const [expandedProviders, setExpandedProviders] = useState<Record<string, boolean>>({})\r\n const [expandedModels, setExpandedModels] = useState<Record<string, boolean>>({})\r\n const [drafts, setDrafts] = useState<Record<string, Record<string, string | null>>>({})\r\n const [busy, setBusy] = useState(false)\r\n const [contextRaw, setContextRaw] = useState<Record<string, string>>({})\r\n const [contextError, setContextError] = useState<Record<string, string>>({})\r\n\r\n const entryKey = (entry: CapabilityEntry): string => `${entry.providerId}\\u0000${entry.index}`\r\n\r\n /** Commit one patch over the user-layer providers. */\r\n const commitProviders = (mutate: (current: Record<string, unknown>) => Record<string, unknown>): void => {\r\n if (snapshot.status !== 'ready' || readonly) return\r\n setBusy(true)\r\n void scope.set('providers', mutate(structuredClone(providers)))\r\n .then(() => { setBusy(false) })\r\n .catch(() => { setBusy(false) })\r\n }\r\n\r\n /** Toggle the route-level official compat flag: unchecked = inherit (unset). */\r\n const toggleDeveloperRole = (providerId: string, next: boolean): void => {\r\n commitProviders((current) => {\r\n const profile = current[providerId] as Record<string, unknown> | undefined\r\n if (profile === undefined) return current\r\n const compat = typeof profile['compat'] === 'object' && profile['compat'] !== null && !Array.isArray(profile['compat'])\r\n ? { ...(profile['compat'] as Record<string, unknown>) }\r\n : {}\r\n if (next) compat['supportsDeveloperRole'] = false\r\n else delete compat['supportsDeveloperRole']\r\n if (Object.keys(compat).length === 0) delete profile['compat']\r\n else profile['compat'] = compat\r\n return current\r\n })\r\n }\r\n\r\n /** Patch one model row of one provider. */\r\n const patchModel = (\r\n providerId: string,\r\n index: number,\r\n patch: (model: Record<string, unknown>) => void,\r\n ): void => {\r\n commitProviders((current) => {\r\n const profile = current[providerId] as { models?: unknown[] } | undefined\r\n if (profile === undefined || !Array.isArray(profile.models)) return current\r\n const model = profile.models[index]\r\n if (typeof model !== 'object' || model === null) return current\r\n patch(model as Record<string, unknown>)\r\n return current\r\n })\r\n }\r\n\r\n /** Toggle whether a model is a thinking model (reasoningEfforts table vs false). */\r\n const toggleThinking = (entry: CapabilityEntry, next: boolean): void => {\r\n patchModel(entry.providerId, entry.index, (row) => {\r\n if (next) {\r\n // Thinking on: a table must exist so the wire drives enable_thinking /\r\n // reasoning_effort. Start from the persisted table or the default high\r\n // set; a toggle model (no effort) keeps supportsReasoningEffort false.\r\n const effortCapable = supportsEffortOf(row)\r\n row['reasoningEfforts'] = effortCapable\r\n ? effortTableOf({ high: 'high' })\r\n : { off: null, high: 'high' }\r\n // Toggle-style thinking models need the official qwen format so pi-ai\r\n // sends enable_thinking (early vLLM thinking models return no thinking\r\n // content without that flag, and reject reasoning_effort). Only fills\r\n // an absent format — an explicit choice is never clobbered.\r\n if (!effortCapable) {\r\n patchCompat(row, (compat) => {\r\n if (compat['thinkingFormat'] === undefined) compat['thinkingFormat'] = 'qwen-chat-template'\r\n })\r\n }\r\n } else {\r\n // Thinking off: a non-reasoning model never takes an effort.\r\n row['reasoningEfforts'] = false\r\n }\r\n })\r\n }\r\n\r\n /** Toggle whether a model accepts reasoning_effort levels. */\r\n const toggleEffortCapable = (entry: CapabilityEntry, next: boolean): void => {\r\n patchModel(entry.providerId, entry.index, (row) => {\r\n patchCompat(row, (compat) => {\r\n compat['supportsReasoningEffort'] = next\r\n // Counterpart of the auto-fill in toggleThinking: effort-capable rows\r\n // need reasoning_effort on the wire, so drop the toggle-style qwen\r\n // format when effort turns on (it would drive enable_thinking instead).\r\n if (next && compat['thinkingFormat'] === 'qwen-chat-template') delete compat['thinkingFormat']\r\n })\r\n })\r\n }\r\n\r\n /** Apply one model's wire draft as its `reasoningEfforts` table. */\r\n const applyDraft = (entry: CapabilityEntry): void => {\r\n const key = entryKey(entry)\r\n const draft = drafts[key]\r\n if (draft === undefined) return\r\n const table = effortTableOf(draft)\r\n patchModel(entry.providerId, entry.index, (row) => {\r\n row['reasoningEfforts'] = table\r\n // Mark effort support only when the model already had it or the user\r\n // ticked a reasoning_effort-only level (minimal/low/medium/xhigh/max).\r\n // A toggle-only model (Qwen3.6: off/high = enable_thinking) must keep\r\n // supportsReasoningEffort false — flipping it would make the adapter\r\n // send a reasoning_effort the gateway rejects (400).\r\n const extended = Object.keys(table).some(level => level !== 'off' && level !== 'on' && level !== 'high')\r\n if (supportsEffortOf(row) || extended) {\r\n patchCompat(row, (compat) => {\r\n compat['supportsReasoningEffort'] = true\r\n })\r\n }\r\n })\r\n }\r\n\r\n /** Reset a model's draft to its persisted table (or the default high set). */\r\n const resetDraft = (entry: CapabilityEntry): void => {\r\n const key = entryKey(entry)\r\n setDrafts(current => {\r\n const next = { ...current }\r\n const table = effortsOf(entry.model)\r\n if (typeof table === 'object' && table !== null) {\r\n next[key] = Object.fromEntries(CAPABILITY_LEVELS.map(level => [\r\n level,\r\n table[level] === undefined ? null : (table[level] === null ? '' : String(table[level])),\r\n ]))\r\n } else {\r\n next[key] = { off: '', high: 'high' }\r\n }\r\n return next\r\n })\r\n }\r\n\r\n /** Seed a model's draft when it is first expanded. */\r\n const ensureDraft = (entry: CapabilityEntry): void => {\r\n const key = entryKey(entry)\r\n setDrafts(current => {\r\n if (current[key] !== undefined) return current\r\n const next = { ...current }\r\n const table = effortsOf(entry.model)\r\n if (typeof table === 'object' && table !== null) {\r\n next[key] = Object.fromEntries(CAPABILITY_LEVELS.map(level => [\r\n level,\r\n table[level] === undefined ? null : (table[level] === null ? '' : String(table[level])),\r\n ]))\r\n } else {\r\n next[key] = { off: '', high: 'high' }\r\n }\r\n return next\r\n })\r\n }\r\n\r\n /** Apply a one-click preset to every thinking model. */\r\n const applyPreset = (levels: Record<string, unknown>): void => {\r\n commitProviders((current) => {\r\n for (const entry of entriesOf(current)) {\r\n const profile = current[entry.providerId] as { models?: unknown[] } | undefined\r\n if (profile === undefined || !Array.isArray(profile.models)) continue\r\n const model = profile.models[entry.index]\r\n if (typeof model !== 'object' || model === null) continue\r\n const row = model as Record<string, unknown>\r\n if (effortsOf(row) === undefined) continue // only thinking models\r\n // Replace the table but never touch supportsReasoningEffort: a\r\n // toggle-only model (Qwen3.6) must stay Off/On (enable_thinking), so\r\n // the request guard keeps clamping any injected level to its default\r\n // strength instead of sending a reasoning_effort the gateway rejects.\r\n row['reasoningEfforts'] = levels\r\n }\r\n return current\r\n })\r\n }\r\n\r\n /** Seed a model's context-window input when it is first expanded. */\r\n const seedContext = (entry: CapabilityEntry): void => {\r\n const key = entryKey(entry)\r\n setContextRaw(current => {\r\n if (current[key] !== undefined) return current\r\n const value = entry.model['contextWindow']\r\n return {\r\n ...current,\r\n [key]: typeof value === 'number' && Number.isFinite(value) ? String(value) : '',\r\n }\r\n })\r\n }\r\n\r\n /** Write (or delete) a model's `contextWindow` in the llm-pi-ai entry. */\r\n const commitContextWindow = (entry: CapabilityEntry, value: number | undefined): void => {\r\n const key = entryKey(entry)\r\n patchModel(entry.providerId, entry.index, (row) => {\r\n if (value === undefined) delete row['contextWindow']\r\n else row['contextWindow'] = value\r\n })\r\n setContextError(current => {\r\n const next = { ...current }\r\n delete next[key]\r\n return next\r\n })\r\n }\r\n\r\n /** Apply one preset immediately. */\r\n const applyContextPreset = (entry: CapabilityEntry, value: number): void => {\r\n const key = entryKey(entry)\r\n setContextRaw(current => ({ ...current, [key]: String(value) }))\r\n commitContextWindow(entry, value)\r\n }\r\n\r\n /** Validate and commit the custom input (blur / Enter); empty clears it. */\r\n const applyContextInput = (entry: CapabilityEntry): void => {\r\n const key = entryKey(entry)\r\n const raw = (contextRaw[key] ?? '').trim()\r\n if (raw === '') {\r\n commitContextWindow(entry, undefined)\r\n return\r\n }\r\n const validation = validateContextWindow(raw)\r\n if (!validation.ok) {\r\n setContextError(current => ({\r\n ...current,\r\n [key]: t(validation.reason === 'integer'\r\n ? 'card.capabilities.contextInteger'\r\n : 'card.capabilities.contextRange'),\r\n }))\r\n return\r\n }\r\n commitContextWindow(entry, validation.value)\r\n }\r\n\r\n /** Clear the model's context-window declaration (delete the field). */\r\n const clearContext = (entry: CapabilityEntry): void => {\r\n const key = entryKey(entry)\r\n setContextRaw(current => ({ ...current, [key]: '' }))\r\n commitContextWindow(entry, undefined)\r\n }\r\n\r\n if (unavailable) {\r\n return (\r\n <div style={sectionStyle}>\r\n <p style={hintStyle}>{t('card.capabilities.unavailable')}</p>\r\n </div>\r\n )\r\n }\r\n if (allEntries.length === 0) {\r\n return (\r\n <div style={sectionStyle}>\r\n <p style={fieldLabelStyle}>{t('card.capabilities')}</p>\r\n <p style={hintStyle}>{t('card.capabilities.empty')}</p>\r\n </div>\r\n )\r\n }\r\n\r\n const needle = query.trim().toLowerCase()\r\n const visible = needle === ''\r\n ? allEntries\r\n : allEntries.filter(entry =>\r\n entry.modelId.toLowerCase().includes(needle)\r\n || entry.providerId.toLowerCase().includes(needle))\r\n const providerIds = [...new Set(visible.map(entry => entry.providerId))]\r\n\r\n return (\r\n <div style={sectionStyle}>\r\n <p style={fieldLabelStyle}>{t('card.capabilities')}</p>\r\n <p style={hintStyle}>{t('card.capabilities.hint')}</p>\r\n\r\n {/* Search + one-click presets */}\r\n <div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap', alignItems: 'center', margin: '8px 0 2px' }}>\r\n <input\r\n type=\"text\"\r\n value={query}\r\n placeholder={t('card.capabilities.search')}\r\n disabled={readonly || busy}\r\n style={{ ...controlStyle, flex: '1 1 160px', minWidth: '140px' }}\r\n onChange={(event) => setQuery(event.currentTarget.value)}\r\n />\r\n {PRESETS.map(preset => (\r\n <button\r\n key={preset.key}\r\n type=\"button\"\r\n disabled={readonly || busy}\r\n onClick={() => applyPreset(preset.levels)}\r\n style={{\r\n ...controlStyle,\r\n cursor: readonly || busy ? 'default' : 'pointer',\r\n opacity: readonly || busy ? 0.5 : 1,\r\n }}\r\n >\r\n {t(`card.capabilities.preset${preset.key === 'official' ? 'Official' : 'Generic'}`)}\r\n </button>\r\n ))}\r\n </div>\r\n\r\n {visible.length === 0\r\n ? <p style={hintStyle}>{t('card.capabilities.noMatches')}</p>\r\n : providerIds.map(providerId => {\r\n const providerEntries = visible.filter(entry => entry.providerId === providerId)\r\n const providerOpen = expandedProviders[providerId] === true || needle !== ''\r\n return (\r\n <div key={providerId} style={providerStyle}>\r\n <div style={providerHeadStyle}>\r\n <button\r\n type=\"button\"\r\n aria-expanded={providerOpen}\r\n disabled={readonly || busy}\r\n onClick={() => setExpandedProviders(current => ({\r\n ...current,\r\n [providerId]: current[providerId] !== true,\r\n }))}\r\n style={{\r\n ...iconButtonStyle,\r\n cursor: readonly || busy ? 'default' : 'pointer',\r\n }}\r\n title={providerOpen ? t('card.capabilities.collapseProvider') : t('card.capabilities.expandProvider')}\r\n >\r\n <ChevronIcon open={providerOpen} />\r\n </button>\r\n <p style={providerNameStyle}>{providerId}</p>\r\n <label\r\n style={{ display: 'inline-flex', alignItems: 'center', gap: '5px', fontSize: '11px', whiteSpace: 'nowrap', color: 'var(--dsw-alias-label-secondary)' }}\r\n title={t('card.capabilities.developerRoleHint')}\r\n >\r\n <input\r\n type=\"checkbox\"\r\n checked={developerRoleDisabledOf(providers[providerId])}\r\n disabled={readonly || busy}\r\n onChange={(event) => toggleDeveloperRole(providerId, event.currentTarget.checked)}\r\n />\r\n <span>{t('card.capabilities.developerRole')}</span>\r\n </label>\r\n <p style={providerBadgeStyle}>{providerEntries.length}</p>\r\n </div>\r\n {providerOpen\r\n ? providerEntries.map(entry => {\r\n const key = entryKey(entry)\r\n const modelOpen = expandedModels[key] === true\r\n const efforts = effortsOf(entry.model)\r\n const thinking = typeof efforts === 'object'\r\n // Display falls back to the provider-level `compat` so a\r\n // route-declared thinking/effort posture shows on every model.\r\n const compat = compatOf(entry)\r\n const supportsEffort = compat['supportsReasoningEffort'] === true\r\n const meta = summaryOf(entry)\r\n const format = typeof compat['thinkingFormat'] === 'string'\r\n ? compat['thinkingFormat']\r\n : undefined\r\n return (\r\n <div key={key}>\r\n <div style={modelRowStyle}>\r\n <button\r\n type=\"button\"\r\n aria-expanded={modelOpen}\r\n disabled={readonly || busy}\r\n onClick={() => {\r\n const next = expandedModels[key] !== true\r\n setExpandedModels(current => ({ ...current, [key]: next }))\r\n if (next) { ensureDraft(entry); seedContext(entry) }\r\n }}\r\n style={{\r\n ...iconButtonStyle,\r\n cursor: readonly || busy ? 'default' : 'pointer',\r\n }}\r\n title={modelOpen ? t('card.capabilities.closeModelSettings') : t('card.capabilities.openModelSettings')}\r\n >\r\n <ChevronIcon open={modelOpen} />\r\n </button>\r\n <p style={modelIdStyle}>{entry.modelId}</p>\r\n <span style={badgeStyle} title=\"text\">{meta.text ? 'T' : '–'}</span>\r\n <span style={badgeStyle} title=\"image\">{meta.image ? 'IMG' : '–'}</span>\r\n {meta.context !== null && <span style={badgeStyle}>{meta.context}</span>}\r\n {thinking && !supportsEffort && <span style={badgeStyle}>On/Off</span>}\r\n </div>\r\n {modelOpen\r\n ? (\r\n <div style={{ padding: '4px 10px 10px', borderTop: '1px solid var(--dsw-alias-border-l2)' }}>\r\n {/* Layer 1 — base capabilities: is it a thinking model? A vision model? */}\r\n <div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap', margin: '2px 0 8px' }}>\r\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px' }}>\r\n <input\r\n type=\"checkbox\"\r\n checked={thinking}\r\n disabled={readonly || busy}\r\n onChange={(event) => toggleThinking(entry, event.currentTarget.checked)}\r\n />\r\n <span>{t('card.capabilities.thinking')}</span>\r\n </label>\r\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px' }}>\r\n <input\r\n type=\"checkbox\"\r\n checked={meta.image}\r\n disabled={readonly || busy}\r\n onChange={(event) => {\r\n patchModel(entry.providerId, entry.index, (row) => {\r\n // Image input implies text input; the pair is written together.\r\n row['input'] = event.currentTarget.checked ? ['text', 'image'] : ['text']\r\n })\r\n }}\r\n />\r\n <span>{t('card.capabilities.vision')}</span>\r\n </label>\r\n </div>\r\n {/* Layer 2 — only for thinking models: does it take reasoning_effort levels? */}\r\n {thinking\r\n ? (\r\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px', margin: '0 0 8px' }}>\r\n <input\r\n type=\"checkbox\"\r\n checked={supportsEffort}\r\n disabled={readonly || busy}\r\n onChange={(event) => toggleEffortCapable(entry, event.currentTarget.checked)}\r\n />\r\n <span>{t('card.capabilities.supportsEffort')}</span>\r\n </label>\r\n )\r\n : null}\r\n {thinking && supportsEffort\r\n ? (\r\n <>\r\n {/* Per-level wire editor — only for effort-capable thinking models */}\r\n <p style={fieldLabelStyle}>{t('card.capabilities.efforts')}</p>\r\n <div style={{ margin: '4px 0 6px' }}>\r\n {CAPABILITY_LEVELS.map(level => {\r\n const wire = drafts[key]?.[level]\r\n const on = wire !== undefined && wire !== null\r\n return (\r\n <div key={level} style={levelRowStyle}>\r\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px' }}>\r\n <input\r\n type=\"checkbox\"\r\n checked={on}\r\n disabled={readonly || busy}\r\n onChange={(event) => {\r\n const checked = event.currentTarget.checked\r\n setDrafts(current => {\r\n const draft = { ...(current[key] ?? {}) }\r\n draft[level] = checked\r\n ? (level === 'off' ? '' : level)\r\n : null\r\n return { ...current, [key]: draft }\r\n })\r\n }}\r\n />\r\n <span>{level}</span>\r\n </label>\r\n <span style={levelNameStyle}>{level === 'off' ? t('card.capabilities.offPlaceholder') : '→'}</span>\r\n <input\r\n type=\"text\"\r\n value={wire ?? ''}\r\n disabled={readonly || busy || !on}\r\n placeholder={t('card.capabilities.wirePlaceholder')}\r\n style={wireInputStyle}\r\n onChange={(event) => {\r\n setDrafts(current => {\r\n const draft = { ...(current[key] ?? {}) }\r\n draft[level] = event.currentTarget.value\r\n return { ...current, [key]: draft }\r\n })\r\n }}\r\n />\r\n </div>\r\n )\r\n })}\r\n </div>\r\n <div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>\r\n <button\r\n type=\"button\"\r\n disabled={readonly || busy}\r\n onClick={() => applyDraft(entry)}\r\n style={{\r\n ...controlStyle,\r\n cursor: readonly || busy ? 'default' : 'pointer',\r\n opacity: readonly || busy ? 0.5 : 1,\r\n }}\r\n >\r\n {t('card.capabilities.applyLevel')}\r\n </button>\r\n <button\r\n type=\"button\"\r\n disabled={readonly || busy}\r\n onClick={() => resetDraft(entry)}\r\n style={{\r\n ...controlStyle,\r\n cursor: readonly || busy ? 'default' : 'pointer',\r\n opacity: readonly || busy ? 0.5 : 1,\r\n }}\r\n >\r\n {t('card.capabilities.restoreDefault')}\r\n </button>\r\n </div>\r\n </>\r\n )\r\n : null}\r\n {/* Layer 4 — thinking format (wire serialization) */}\r\n <div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap', marginTop: '10px' }}>\r\n <label style={fieldStyle}>\r\n <span style={fieldLabelStyle}>{t('card.capabilities.thinkingFormat')}</span>\r\n <select\r\n style={controlStyle}\r\n value={format ?? 'inherit'}\r\n disabled={readonly || busy}\r\n onChange={(event) => {\r\n const next = event.currentTarget.value\r\n patchModel(entry.providerId, entry.index, (row) => {\r\n patchCompat(row, (compat) => {\r\n if (next === 'inherit') delete compat['thinkingFormat']\r\n else compat['thinkingFormat'] = next\r\n })\r\n })\r\n }}\r\n >\r\n <option value=\"inherit\">{t('card.capabilities.thinkingFormat.inherit')}</option>\r\n {THINKING_FORMATS.map(formatOption => (\r\n <option key={formatOption} value={formatOption}>{formatOption}</option>\r\n ))}\r\n </select>\r\n </label>\r\n </div>\r\n {/* Context-window limit: presets + custom integer (written to llm-pi-ai, live on next request) */}\r\n <div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap', marginTop: '10px' }}>\r\n <label style={fieldStyle}>\r\n <span style={fieldLabelStyle}>{t('card.capabilities.contextWindow')}</span>\r\n <div style={{ display: 'flex', gap: '6px', flexWrap: 'wrap', alignItems: 'center' }}>\r\n {CONTEXT_WINDOW_PRESETS.map(preset => (\r\n <button\r\n key={preset.value}\r\n type=\"button\"\r\n disabled={readonly || busy}\r\n onClick={() => applyContextPreset(entry, preset.value)}\r\n style={{\r\n ...controlStyle,\r\n padding: '2px 8px',\r\n cursor: readonly || busy ? 'default' : 'pointer',\r\n opacity: readonly || busy ? 0.5 : 1,\r\n }}\r\n >\r\n {preset.label}\r\n </button>\r\n ))}\r\n <input\r\n type=\"text\"\r\n value={contextRaw[key] ?? ''}\r\n disabled={readonly || busy}\r\n placeholder={t('card.capabilities.contextCustomPlaceholder')}\r\n style={{ ...controlStyle, width: '120px' }}\r\n onChange={(event) => {\r\n const next = event.currentTarget.value\r\n setContextRaw(current => ({ ...current, [key]: next }))\r\n }}\r\n onBlur={() => applyContextInput(entry)}\r\n onKeyDown={(event) => {\r\n if (event.key === 'Enter') event.currentTarget.blur()\r\n }}\r\n />\r\n <button\r\n type=\"button\"\r\n disabled={readonly || busy}\r\n onClick={() => clearContext(entry)}\r\n style={{\r\n ...controlStyle,\r\n cursor: readonly || busy ? 'default' : 'pointer',\r\n opacity: readonly || busy ? 0.5 : 1,\r\n }}\r\n >\r\n {t('card.capabilities.contextClear')}\r\n </button>\r\n </div>\r\n {contextError[key] !== undefined\r\n ? (\r\n <span style={{ margin: 0, fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-danger, #e5484d)' }}>\r\n {contextError[key]}\r\n </span>\r\n )\r\n : null}\r\n </label>\r\n </div>\r\n </div>\r\n )\r\n : null}\r\n </div>\r\n )\r\n })\r\n : null}\r\n </div>\r\n )\r\n })}\r\n {readonly ? <p style={hintStyle}>{t('card.readonly')}</p> : null}\r\n </div>\r\n )\r\n}\r\n\r\n/**\r\n * The card body, wrapped in a disclosure shell like every peer settings card:\r\n * a header (name + description + chevron) that toggles the body, expanded by\r\n * default so the family section reads as an open page of drawers.\r\n * @param props - locale copy and the injected scopes.\r\n */\r\nexport function ThinkingLevelsCard({ t, scope, piAiScope }: ThinkingLevelsCardProps): JSX.Element {\r\n const [open, setOpen] = useState(true)\r\n const snapshot = useSyncExternalStore(\r\n (listener) => scope.subscribe(listener),\r\n () => scope.getSnapshot(),\r\n )\r\n const unavailable = snapshot.status === 'unavailable'\r\n const readonly = unavailable || !snapshot.writable\r\n // configForms serves the STORED doc: volatile fields arrive as plain values\r\n // (simplify() unwraps the live refs before persistence), so the card sees a\r\n // plain config shape even though the host-side type carries Volatile unions.\r\n const value = (snapshot.value ?? {}) as unknown as Partial<{\r\n enabled: boolean\r\n level: EffortId\r\n allowDowngrade: boolean\r\n allowUpgrade: boolean\r\n }>\r\n const level = EFFORT_OPTIONS.includes(value.level as EffortId) ? value.level as EffortId : 'auto'\r\n\r\n return (\r\n <div style={{\r\n border: '1px solid var(--dsw-alias-border-l2, rgba(127,127,127,0.35))',\r\n background: 'var(--dsw-alias-bg-layer-3, rgba(127,127,127,0.05))',\r\n borderRadius: '12px',\r\n transition: 'border-color 0.16s, background 0.16s',\r\n }}>\r\n <button\r\n type=\"button\"\r\n aria-expanded={open}\r\n style={{\r\n appearance: 'none',\r\n width: '100%',\r\n font: 'inherit',\r\n color: 'inherit',\r\n textAlign: 'left',\r\n cursor: 'pointer',\r\n background: 'none',\r\n border: 0,\r\n borderRadius: '12px',\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '12px',\r\n padding: '14px 16px',\r\n }}\r\n onClick={() => { setOpen(current => !current) }}\r\n >\r\n <span style={{ flex: '1 1 0%', minWidth: 0 }}>\r\n <div style={{ fontSize: '14px', fontWeight: 600, color: 'var(--dsw-alias-label-primary)' }}>{t('card.title')}</div>\r\n <div style={{ color: 'var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))', fontSize: '13px', lineHeight: 1.5 }}>{t('card.description')}</div>\r\n </span>\r\n <svg\r\n width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden\r\n style={{\r\n color: 'var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))',\r\n flex: '0 0 auto',\r\n transition: 'transform 0.16s',\r\n transform: open ? 'rotate(180deg)' : 'none',\r\n }}\r\n >\r\n <path d=\"M4 6l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\r\n </svg>\r\n </button>\r\n {open\r\n ? (\r\n <div style={{ padding: '12px 16px' }}>\r\n {unavailable\r\n ? (\r\n <div style={{ fontSize: '13px', color: 'var(--dsw-alias-label-tertiary)' }}>\r\n {t('card.unavailable')}\r\n </div>\r\n )\r\n : (\r\n <>\r\n <div style={rowStyle}>\r\n <label htmlFor=\"plugin-config-thinking-levels-level\" style={labelStyle}>{t('card.level')}</label>\r\n <select\r\n id=\"plugin-config-thinking-levels-level\"\r\n value={level}\r\n disabled={readonly}\r\n style={controlStyle}\r\n onChange={(event) => { void scope.set('level', event.currentTarget.value as EffortId) }}\r\n >\r\n {EFFORT_OPTIONS.map((option) => (\r\n <option key={option} value={option}>{t(`card.level.${option}`)}</option>\r\n ))}\r\n </select>\r\n </div>\r\n <div style={rowStyle}>\r\n <label htmlFor=\"plugin-config-thinking-levels-enabled\" style={labelStyle}>{t('card.enabled')}</label>\r\n <input\r\n id=\"plugin-config-thinking-levels-enabled\"\r\n type=\"checkbox\"\r\n checked={value.enabled ?? true}\r\n disabled={readonly}\r\n onChange={(event) => { void scope.set('enabled', event.currentTarget.checked) }}\r\n />\r\n </div>\r\n <div style={rowStyle}>\r\n <label htmlFor=\"plugin-config-thinking-levels-downgrade\" style={labelStyle}>{t('card.allowDowngrade')}</label>\r\n <input\r\n id=\"plugin-config-thinking-levels-downgrade\"\r\n type=\"checkbox\"\r\n checked={value.allowDowngrade ?? true}\r\n disabled={readonly || value.level !== 'auto'}\r\n onChange={(event) => { void scope.set('allowDowngrade', event.currentTarget.checked) }}\r\n />\r\n </div>\r\n <div style={rowStyle}>\r\n <label htmlFor=\"plugin-config-thinking-levels-upgrade\" style={labelStyle}>{t('card.allowUpgrade')}</label>\r\n <input\r\n id=\"plugin-config-thinking-levels-upgrade\"\r\n type=\"checkbox\"\r\n checked={value.allowUpgrade ?? false}\r\n disabled={readonly || value.level !== 'auto'}\r\n onChange={(event) => { void scope.set('allowUpgrade', event.currentTarget.checked) }}\r\n />\r\n </div>\r\n {!snapshot.writable\r\n && <p style={{ margin: '8px 0 0', fontSize: '12px', color: 'var(--dsw-alias-label-tertiary)' }}>{t('card.readonly')}</p>}\r\n <ModelCapabilities scope={piAiScope} t={t} readonly={readonly} />\r\n </>\r\n )}\r\n </div>\r\n )\r\n : null}\r\n </div>\r\n )\r\n}\r\n","/**\r\n * FamilySettingsSection — the top-level 「起子插件设置」 settings section.\r\n *\r\n * One `settings.section` nav entry (registered by this plugin) whose entry\r\n * declares the `dsh-family.tab` child slot; sibling plugins (session-guard\r\n * first) contribute their cards there via `ctx.slots.inject('dsh-family.tab',\r\n * …)`. The section renders the family's own thinking-levels card as the first\r\n * tab and every contributor as a following tab — the same tabs-around-pages\r\n * pattern the built-in Plugins section uses (ui-settings-plugins): the tab\r\n * ledger is a HostObservable projected from the child-slot registry, and the\r\n * active tab mounts through `renderSlot(key, {}, { only: id })`. Each card is\r\n * a disclosure drawer expanded by default, so an opened tab shows its full\r\n * panel right away.\r\n *\r\n * When this section is absent the whole family surface is absent; a\r\n * contributor's inject simply idles (an undischarged wait never blocks the\r\n * client half), so plugins stay fully functional without their card.\r\n */\r\nimport { useState } from 'react'\r\nimport type { JSX } from 'react'\r\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\r\nimport { ThinkingLevelsCard, type ThinkingLevelsCardInjected } from './card.tsx'\r\n\r\n/**\r\n * Structural mirrors of the ui-slots faces this section consumes (the same\r\n * pattern as scope-face.ts: the package's `export *` type graph resolves\r\n * unreliably outside the harness workspace, so the handful of shapes are\r\n * declared locally instead).\r\n */\r\ntype HostObservable<T> = {\r\n getSnapshot(): T\r\n subscribe(listener: () => void): () => void\r\n}\r\n\r\n/** One contributor tab projected from the `dsh-family.tab` ledger. */\r\nexport interface FamilyTabEntry {\r\n id: string\r\n order: number\r\n label: string\r\n}\r\n\r\n/** Registration-side business face for the section. */\r\nexport interface FamilySectionInjected extends ThinkingLevelsCardInjected {\r\n hooks: {\r\n /** Ordered projection of the contributor ledger (locale-aware). */\r\n tabs: HostObservable<readonly FamilyTabEntry[]>\r\n }\r\n}\r\n\r\n/**\r\n * The framework-delivered child-slot dispatcher, narrowed to our one child key.\r\n * Optional: the Plugins-page `plugins.bundle.config` card renders this same\r\n * component WITHOUT a children declaration (the `dsh-family.tab` child slot is\r\n * claimed by the settings.section entry alone), so the machinery delivers no\r\n * renderSlot seat on that surface — contributor tabs degrade to empty panels\r\n * there instead of crashing on an absent dispatcher.\r\n */\r\ninterface FamilyRenderSlots {\r\n renderSlot?(key: 'dsh-family.tab', owner?: object, opts?: { only?: string; fallback?: React.ReactNode }): React.ReactNode\r\n}\r\n\r\n/** Full props: locale + contributor dispatcher + the resolved inject face. */\r\nexport type FamilySettingsSectionProps =\r\n PropsLocale<'thinking-levels'>\r\n & FamilyRenderSlots\r\n & FamilySectionInjected\r\n\r\n/** This plugin's own tab, always first: the thinking-levels card itself. */\r\nconst OWN_TAB_ID = 'thinking-levels'\r\n\r\n/** The hooks-compartment selector hook face (bound `use<Name>` hook). */\r\ninterface FamilyHooksFace {\r\n useTabs: <S>(selector: (value: readonly FamilyTabEntry[]) => S) => S\r\n}\r\n\r\nexport function FamilySettingsSection(props: FamilySettingsSectionProps): JSX.Element {\r\n const { t, renderSlot, scope, piAiScope } = props\r\n const { useTabs } = props as unknown as FamilyHooksFace\r\n const contributors = useTabs(value => value)\r\n const [activeId, setActiveId] = useState<string>(OWN_TAB_ID)\r\n const rows = [\r\n { id: OWN_TAB_ID, order: Number.NEGATIVE_INFINITY, label: t('card.title') },\r\n ...contributors,\r\n ]\r\n const active = rows.some(row => row.id === activeId) ? activeId : OWN_TAB_ID\r\n\r\n return (\r\n <div style={{ display: 'grid', gap: '12px' }}>\r\n <div role=\"tablist\" aria-label={t('family.title')} style={{ display: 'flex', flexWrap: 'wrap', gap: '4px' }}>\r\n {rows.map(row => (\r\n <button\r\n key={row.id}\r\n type=\"button\"\r\n role=\"tab\"\r\n aria-selected={row.id === active}\r\n onClick={() => { setActiveId(row.id) }}\r\n style={{\r\n appearance: 'none',\r\n font: 'inherit',\r\n cursor: 'pointer',\r\n border: '1px solid var(--dsw-alias-border-l2, rgba(127,127,127,0.35))',\r\n background: row.id === active ? 'var(--dsw-alias-bg-layer-3, rgba(127,127,127,0.08))' : 'none',\r\n color: 'var(--dsw-alias-label-primary, inherit)',\r\n borderRadius: '8px',\r\n padding: '5px 12px',\r\n fontSize: '13px',\r\n }}\r\n >\r\n {row.label}\r\n </button>\r\n ))}\r\n </div>\r\n <div role=\"tabpanel\">\r\n {active === OWN_TAB_ID\r\n ? <ThinkingLevelsCard t={t} scope={scope} piAiScope={piAiScope} />\r\n : renderSlot?.('dsh-family.tab', {}, { only: active, fallback: null })}\r\n </div>\r\n </div>\r\n )\r\n}\r\n","/**\r\n * dsh-thinking-levels — browser half.\r\n *\r\n * Registers the `thinking-levels` dictionaries and one composer model-seat\r\n * panel (`conversation.input.model`) carrying the per-line context-window\r\n * editor.\r\n *\r\n * The plugin's own settings (default level, enable toggle, scheduler bounds)\r\n * have NO standalone settings card since the DSH 0.1.7 line: the host renders\r\n * the Plugins settings form declaratively from the `.volatile()` fields of the\r\n * schema in src/index.ts, and the runtime values flow through the\r\n * `configForms` service keyed by the composition entry id. The former\r\n * per-plugin settings card was dropped with that migration (its seat no\r\n * longer exists in 0.1.7), including its llm-pi-ai model-capability editor.\r\n * DSH 0.2.0 restores a client face for them: the family settings section\r\n * below and the Plugins-page `plugins.bundle.config` card (same component,\r\n * same inject factory).\r\n *\r\n * All @deepseek-ai/* imports are type-only: collaboration happens through\r\n * cordis services (`configForms`) and slot registration only (client bundle\r\n * purity).\r\n */\r\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\r\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\r\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\r\n// DSH 0.1.5 moved the `ctx.slots` Context augmentation here (it used to live in\r\n// the retired `dsh-client-runtime` package): importing the client types restores\r\n// the typed `ctx.slots` member on the cordis Context surface.\r\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\r\nimport { NS, de, en, es, fr, it, ja, ko, ru, zh } from './locales.ts'\r\nimport { ModelPanel, type ModelPanelInjected } from './model-panel.tsx'\r\nimport { FamilySettingsSection, type FamilySectionInjected, type FamilyTabEntry } from './family-tab.tsx'\r\nimport type { ThinkingLevelsConfig } from '../index.ts'\r\n// Type-only: pulls the settings shell's SlotMap merges ('settings.section').\r\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\r\n\r\n/**\r\n * The plugin-family shared settings surface: ONE top-level `settings.section`\r\n * nav entry (「起子插件设置」) whose entry declares the `dsh-family.tab` child\r\n * slot; sibling plugins contribute their cards there (session-guard first) and\r\n * the section renders them as tabs — the built-in Plugins section's\r\n * tabs-around-pages pattern; every card drawer is expanded by default. Declaring is claiming (ui-slots): the child slot\r\n * exists exactly while this section entry does, and a contributor's\r\n * `ctx.slots.inject('dsh-family.tab', …)` idles harmlessly if this plugin is\r\n * absent (an undischarged inject never blocks the client half).\r\n */\r\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\r\n interface SlotMap {\r\n 'dsh-family.tab': { kind: 'list'; scope: 'root' }\r\n /**\r\n * Plugins-page configuration card (official ui-plugin-manager contract):\r\n * keyed by the bundle's package name, rendered on the bundle's detail page\r\n * with `{ view: 'page' }` owner props. Declared here because community\r\n * plugins don't import the official package's client types — the same\r\n * merge pattern as dsh-tidy-display's settings-slots.ts.\r\n */\r\n 'plugins.bundle.config': { kind: 'keyed'; scope: 'root'; owner: Record<string, unknown> }\r\n }\r\n}\r\n\r\n/** Services required by the browser half. */\r\nexport const inject = ['slots', 'locale', 'configForms', 'modelDirectories']\r\n\r\n/**\r\n * Client plugin body: dictionaries plus the composer quick-control slot.\r\n * @param ctx - client root context.\r\n */\r\nexport function apply(ctx: ClientContext): void {\r\n const t = ctx.locale.bind(NS)\r\n // `register(ns, dicts)` is typed to the built-in locale ids (`zh` / `en`\r\n // only); the shipped `ja` / `ko` / `fr` / `de` / `it` / `ru` / `es`\r\n // dictionaries go through the single-locale overload, so they are installed\r\n // and ready once DSH publishes those ids.\r\n ctx.effect(() => {\r\n const disposers = [\r\n ctx.locale.register(NS, { zh, en }),\r\n ctx.locale.register(NS, 'ja', ja),\r\n ctx.locale.register(NS, 'ko', ko),\r\n ctx.locale.register(NS, 'fr', fr),\r\n ctx.locale.register(NS, 'de', de),\r\n ctx.locale.register(NS, 'it', it),\r\n ctx.locale.register(NS, 'ru', ru),\r\n ctx.locale.register(NS, 'es', es),\r\n ]\r\n return () => { for (const dispose of disposers) dispose() }\r\n }, 'dsh-thinking-levels: dictionaries')\r\n\r\n // Composer model seat: one registered entry named after the seat with\r\n // `priority: -1` replaces the shipped `ModelSelect` trigger and popup\r\n // outright (the official popup renders no slots, so occupying the seat is\r\n // the only way to contribute inside it — the dsh-reasoning-effort pattern).\r\n // The panel renders its own picker over the harness's shared\r\n // `modelDirectories` service (model switching keeps working) and puts a\r\n // context-window editor on every model line: custom gateways write the\r\n // `llm-pi-ai` entry config, official DeepSeek models write the\r\n // `llm-deepseek` entry (its `models[].contextWindow`, else the provider\r\n // default).\r\n // Resolve `modelDirectories` through a cordis inject, NOT a synchronous\r\n // property read: at apply time the ui-model-selection module's service may\r\n // not be started yet, and the property read returned undefined on 0.1.7\r\n // hosts — the whole panel was silently skipped and the shipped selector\r\n // stayed. The deferred inject waits for the service to start; on harness\r\n // lines without the module the callback never fires or sees undefined,\r\n // leaving the shipped selector untouched.\r\n //\r\n // The inject must ALSO declare the resolver's own dependency set\r\n // (`sessions`, `remote`, `remote.session` — ui-model-selection's\r\n // `ModelDirectoryResolver.static inject`): a cordis Service resolves\r\n // `this.ctx` through the ACCESSING context (the traceable proxy rebinds\r\n // `ctx` to the reader), and `directoryFor()` reads `this.ctx.sessions` —\r\n // with only `modelDirectories` declared that read came back undefined and\r\n // every `directoryFor` call threw, so the seat entry crashed on first\r\n // render and the slot boundary abdicated it back to the shipped selector.\r\n ;(ctx as unknown as {\r\n inject: (\r\n deps: string[],\r\n cb: (scope: {\r\n modelDirectories: ModelDirectoriesFace | undefined\r\n sessions: SessionsFace | undefined\r\n }) => void,\r\n ) => void\r\n }).inject(['modelDirectories', 'sessions', 'remote', 'remote.session'], (scope) => {\r\n const directories = scope.modelDirectories\r\n if (directories === undefined) return\r\n ctx.slots.inject('conversation.input.model', function* () {\r\n yield ctx.slots.register({\r\n name: 'conversation.input.model',\r\n id: 'context-window-model-panel',\r\n priority: -1,\r\n locale: NS,\r\n inject: (sessionId: string): ModelPanelInjected => {\r\n // Entry ids of the target plugins: each dsh llm plugin's composition\r\n // entry id matches its settings namespace (`llm-pi-ai` / `llm-deepseek`).\r\n // A `directoryFor` failure (odd session shape) must not throw out of\r\n // the render: a thrown inject abdicates the seat entry — the whole\r\n // takeover — so degrade to the unavailable face instead.\r\n let directory: ModelDirectoryFace | undefined\r\n try {\r\n directory = directories.directoryFor(sessionId)\r\n } catch {\r\n directory = undefined\r\n }\r\n return {\r\n directory,\r\n piAiScope: ctx.configForms.get<unknown>('llm-pi-ai'),\r\n deepseekScope: ctx.configForms.get<unknown>('llm-deepseek'),\r\n }\r\n },\r\n }, ModelPanel)\r\n })\r\n })\r\n\r\n // Family settings section (see the SlotMap note above): the contributor\r\n // ledger is projected exactly like the built-in Plugins section projects its\r\n // tab ledger (cache until ledger/locale revision bumps, so useSyncExternalStore\r\n // sees a stable snapshot).\r\n/** Registrant labels arrive as a string or a locale thunk; unwrap either.\r\n * A throwing thunk (e.g. a contributor whose label touches a service its own\r\n * inject never declared) must not kill the whole tab-ledger projection — fall\r\n * back to the entry id. */\r\nconst resolveLabel = (label: unknown, fallback = ''): string => {\r\n try {\r\n if (typeof label === 'function') return (label as () => string)() || fallback\r\n if (typeof label === 'string') return label\r\n } catch { /* bad contributor label — degrade to the fallback */ }\r\n return fallback\r\n}\r\n\r\n let tabsVersion = -1\r\n let tabsRevision = -1\r\n let tabs: readonly FamilyTabEntry[] = []\r\n const sectionInjected = (): FamilySectionInjected => ({\r\n scope: ctx.configForms.get<ThinkingLevelsConfig>('dsh-thinking-levels'),\r\n piAiScope: ctx.configForms.get<unknown>('llm-pi-ai'),\r\n hooks: {\r\n tabs: {\r\n getSnapshot: () => {\r\n const version = ctx.slots.getVersion('dsh-family.tab')\r\n const revision = ctx.locale.getSnapshot().revision\r\n if (version !== tabsVersion || revision !== tabsRevision) {\r\n tabsVersion = version\r\n tabsRevision = revision\r\n tabs = ctx.slots.entries('dsh-family.tab')\r\n .map(entry => ({\r\n id: entry.options.id ?? '',\r\n order: entry.options.order ?? 0,\r\n label: resolveLabel(entry.options.label, entry.options.id ?? ''),\r\n }))\r\n .sort((a, b) => a.order - b.order)\r\n }\r\n return tabs\r\n },\r\n subscribe: (listener) => {\r\n const offLedger = ctx.slots.subscribe('dsh-family.tab', listener)\r\n const offLocale = ctx.locale.subscribe(listener)\r\n return () => {\r\n offLedger()\r\n offLocale()\r\n }\r\n },\r\n },\r\n },\r\n })\r\n\r\n ctx.slots.inject('settings.section', function* () {\r\n yield ctx.slots.register({\r\n name: 'settings.section',\r\n id: 'dsh-family',\r\n order: 40,\r\n label: () => t('family.title'),\r\n locale: NS,\r\n inject: sectionInjected,\r\n children: { 'dsh-family.tab': { kind: 'list', scope: 'root' } },\r\n }, FamilySettingsSection)\r\n })\r\n\r\n // Plugins-page configuration card (DSH 0.2.0): the Plugins page renders no\r\n // volatile config form on its own — the bundle's detail page mounts the\r\n // `plugins.bundle.config` keyed slot, dispatched by the package name, and\r\n // without a registration here the page shows no configuration card at all.\r\n // SAME component and SAME inject factory as the family section above, so\r\n // both surfaces stay one source of truth. On 0.1.7 hosts the slot is never\r\n // declared and this inject idles harmlessly (an undischarged inject never\r\n // blocks the client half — same story as the `dsh-family.tab` note above).\r\n ctx.slots.inject('plugins.bundle.config', () => ctx.slots.register({\r\n name: 'plugins.bundle.config',\r\n key: 'dsh-thinking-levels',\r\n locale: NS,\r\n inject: sectionInjected,\r\n }, FamilySettingsSection))\r\n}\r\n"],"mappings":";;;;;;;;;;;EAGA,MAAa,KAAK;;EAGlB,MAAa,KAAK;GAChB,cAAc;GACd,gBAAgB;GAChB,oBAAoB;GACpB,cAAc;GACd,kBAAkB;GAClB,iBAAiB;GACjB,sBAAsB;GACtB,kBAAkB;GAClB,qBAAqB;GACrB,mBAAmB;GACnB,oBAAoB;GACpB,kBAAkB;GAClB,mBAAmB;GACnB,gBAAgB;GAChB,uBAAuB;GACvB,qBAAqB;GACrB,oBAAoB;GACpB,iBAAiB;GACjB,qBAAqB;GACrB,0BAA0B;GAC1B,2BAA2B;GAC3B,iCAAiC;GACjC,0BAA0B;GAC1B,4BAA4B;GAC5B,+BAA+B;GAC/B,mCAAmC;GACnC,oCAAoC;GACpC,mCAAmC;GACnC,4BAA4B;GAC5B,mCAAmC;GACnC,uCAAuC;GACvC,oCAAoC;GACpC,sCAAsC;GACtC,uCAAuC;GACvC,wCAAwC;GACxC,4BAA4B;GAC5B,8BAA8B;GAC9B,oCAAoC;GACpC,6BAA6B;GAC7B,qCAAqC;GACrC,oCAAoC;GACpC,qCAAqC;GACrC,gCAAgC;GAChC,oCAAoC;GACpC,6BAA6B;GAC7B,iCAAiC;GACjC,2BAA2B;GAC3B,oCAAoC;GACpC,4CAA4C;GAC5C,mCAAmC;GACnC,8CAA8C;GAC9C,kCAAkC;GAClC,oCAAoC;GACpC,kCAAkC;GAClC,iCAAiC;GACjC,uBAAuB;GACvB,4BAA4B;GAC5B,uBAAuB;GACvB,wBAAwB;GACxB,yBAAyB;GACzB,mCAAmC;GACnC,uBAAuB;GACvB,uBAAuB;GACvB,yBA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