dsh-thinking-levels 4.3.3 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.ja.md +11 -0
- package/CHANGELOG.ko.md +11 -0
- package/CHANGELOG.md +11 -0
- package/README.md +6 -0
- package/README.zh.md +6 -0
- package/dsh.plugin.json +1 -1
- package/lib/client.js +576 -243
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +52 -0
- package/lib/index.js +54 -5
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -99,6 +99,11 @@ window.__ModuleLoader__.load({
|
|
|
99
99
|
"model.panel.noTarget": "该模型没有可写的配置项",
|
|
100
100
|
"model.panel.unavailable": "当前会话的模型目录不可用",
|
|
101
101
|
"input.effort.title": "思考强度",
|
|
102
|
+
"panel.search.placeholder": "搜索模型…",
|
|
103
|
+
"card.takeoverUi": "模型界面接管",
|
|
104
|
+
"card.takeoverUiHint": "开启后由本插件重绘输入框的模型选择面板(含每行上下文/档位编辑与搜索);关闭(默认)保留官方模型弹窗——auto 档位照常出现,搜索与加载由官方界面负责。更改后需重载页面生效。",
|
|
105
|
+
"card.capabilities.apiUnsupported": "该提供方使用非 openai-completions 协议:思考兼容字段由宿主 pi-ai 原生处理,此处不可配置。",
|
|
106
|
+
"card.dsContextTitle": "官方 DeepSeek 模型上下文上限",
|
|
102
107
|
"input.effort.default": "提供方默认",
|
|
103
108
|
"input.effort.reset": "恢复提供方默认",
|
|
104
109
|
"card.capabilities.failed": "保存失败:配置被拒绝或冲突,请检查值。"
|
|
@@ -192,6 +197,11 @@ window.__ModuleLoader__.load({
|
|
|
192
197
|
"model.panel.noTarget": "No writable config entry for this model",
|
|
193
198
|
"model.panel.unavailable": "The model directory is unavailable for this session",
|
|
194
199
|
"input.effort.title": "Reasoning effort",
|
|
200
|
+
"panel.search.placeholder": "Search models…",
|
|
201
|
+
"card.takeoverUi": "Model UI takeover",
|
|
202
|
+
"card.takeoverUiHint": "On: this plugin replaces the composer model picker with its own panel (per-line context/effort editors + search). Off (default): the official popup stays — the auto level still appears, and search and loading remain the shipped selector’s. Reload the page after changing.",
|
|
203
|
+
"card.capabilities.apiUnsupported": "This provider uses a non-openai-completions protocol: the thinking-compat fields are handled natively by pi-ai and are not configurable here.",
|
|
204
|
+
"card.dsContextTitle": "Official DeepSeek context windows",
|
|
195
205
|
"input.effort.default": "Provider default",
|
|
196
206
|
"input.effort.reset": "Restore provider default",
|
|
197
207
|
"card.capabilities.failed": "Save failed: the value was rejected or conflicted. Check it."
|
|
@@ -285,6 +295,11 @@ window.__ModuleLoader__.load({
|
|
|
285
295
|
"model.panel.noTarget": "このモデルには書き込み可能な設定項目がありません",
|
|
286
296
|
"model.panel.unavailable": "このセッションのモデルディレクトリは利用できません",
|
|
287
297
|
"input.effort.title": "思考レベル",
|
|
298
|
+
"panel.search.placeholder": "モデルを検索…",
|
|
299
|
+
"card.takeoverUi": "モデルUI引き継ぎ",
|
|
300
|
+
"card.takeoverUiHint": "ON にするとこのプラグインが入力欄のモデル選択を独自パネル(行別のコンテキスト/レベル編集+検索)に置き換えます。OFF(既定)では公式ポップアップが維持され、auto レベルは引き続き表示され、検索と読み込みは標準セレクタの役割です。変更後はページの再読み込みが必要です。",
|
|
301
|
+
"card.capabilities.apiUnsupported": "このプロバイダーは openai-completions 以外のプロトコルを使用しています:思考互換フィールドは pi-ai がネイティブに処理するため、ここで設定できません。",
|
|
302
|
+
"card.dsContextTitle": "公式 DeepSeek モデルのコンテキスト上限",
|
|
288
303
|
"input.effort.default": "プロバイダーの既定",
|
|
289
304
|
"input.effort.reset": "プロバイダーの既定に戻す",
|
|
290
305
|
"card.capabilities.failed": "保存に失敗しました:値が拒否されたか競合しています。確認してください。"
|
|
@@ -378,6 +393,11 @@ window.__ModuleLoader__.load({
|
|
|
378
393
|
"model.panel.noTarget": "이 모델에는 쓰기 가능한 설정 항목이 없습니다",
|
|
379
394
|
"model.panel.unavailable": "이 세션의 모델 디렉터리를 사용할 수 없습니다",
|
|
380
395
|
"input.effort.title": "추론 강도",
|
|
396
|
+
"panel.search.placeholder": "모델 검색…",
|
|
397
|
+
"card.takeoverUi": "모델 UI 인수",
|
|
398
|
+
"card.takeoverUiHint": "켜면 이 플러그인이 입력창의 모델 선택을 자체 패널(행별 컨텍스트/레벨 편집 + 검색)로 대체합니다. 끄면(기본) 공식 팝업이 유지되며 auto 레벨은 계속 표시되고 검색과 로딩은 표준 셀렉터가 담당합니다. 변경 후 페이지 새로고침이 필요합니다.",
|
|
399
|
+
"card.capabilities.apiUnsupported": "이 제공자는 openai-completions 이외 프로토콜을 사용합니다: 사고 호환 필드는 pi-ai가 네이티브로 처리하므로 여기서 설정할 수 없습니다.",
|
|
400
|
+
"card.dsContextTitle": "공식 DeepSeek 모델 컨텍스트 상한",
|
|
381
401
|
"input.effort.default": "공급자 기본값",
|
|
382
402
|
"input.effort.reset": "공급자 기본값으로 복원",
|
|
383
403
|
"card.capabilities.failed": "저장 실패: 값이 거부되었거나 충돌합니다. 확인하세요."
|
|
@@ -471,6 +491,11 @@ window.__ModuleLoader__.load({
|
|
|
471
491
|
"model.panel.noTarget": "Aucune entrée de configuration inscriptible pour ce modèle",
|
|
472
492
|
"model.panel.unavailable": "Le répertoire de modèles est indisponible pour cette session",
|
|
473
493
|
"input.effort.title": "Effort de raisonnement",
|
|
494
|
+
"panel.search.placeholder": "Rechercher des modèles…",
|
|
495
|
+
"card.takeoverUi": "Reprise de l'UI modèle",
|
|
496
|
+
"card.takeoverUiHint": "Activé, ce plugin remplace le sélecteur de modèle du composeur par son propre panneau (éditeurs contexte/niveau par ligne + recherche). Désactivé (défaut), la popup officielle reste en place — le niveau auto apparaît toujours, recherche et chargement appartiennent au sélecteur d'origine. Rechargez la page après modification.",
|
|
497
|
+
"card.capabilities.apiUnsupported": "Ce fournisseur utilise un protocole autre qu'openai-completions : les champs de compat de réflexion sont gérés nativement par pi-ai et ne sont pas configurables ici.",
|
|
498
|
+
"card.dsContextTitle": "Fenêtres de contexte DeepSeek officielles",
|
|
474
499
|
"input.effort.default": "Valeur par défaut du fournisseur",
|
|
475
500
|
"input.effort.reset": "Restaurer la valeur par défaut du fournisseur",
|
|
476
501
|
"card.capabilities.failed": "Échec de l'enregistrement : la valeur a été rejetée ou est en conflit. Vérifiez-la."
|
|
@@ -564,6 +589,11 @@ window.__ModuleLoader__.load({
|
|
|
564
589
|
"model.panel.noTarget": "Kein beschreibbarer Konfigurationseintrag für dieses Modell",
|
|
565
590
|
"model.panel.unavailable": "Das Modellverzeichnis ist für diese Sitzung nicht verfügbar",
|
|
566
591
|
"input.effort.title": "Schlussfolgerungsaufwand",
|
|
592
|
+
"panel.search.placeholder": "Modelle suchen…",
|
|
593
|
+
"card.takeoverUi": "Modell-UI-Übernahme",
|
|
594
|
+
"card.takeoverUiHint": "Ein: dieses Plugin ersetzt die Modellauswahl des Composers durch ein eigenes Panel (Kontext-/Stufen-Editoren je Zeile + Suche). Aus (Standard): die offizielle Popup bleibt — die auto-Stufe erscheint weiterhin; Suche und Laden übernimmt der mitgelieferte Wähler. Nach der Änderung die Seite neu laden.",
|
|
595
|
+
"card.capabilities.apiUnsupported": "Dieser Provider nutzt ein anderes Protokoll als openai-completions: die Thinking-Kompatibilitätsfelder werden von pi-ai nativ behandelt und sind hier nicht konfigurierbar.",
|
|
596
|
+
"card.dsContextTitle": "Kontextfenster der offiziellen DeepSeek-Modelle",
|
|
567
597
|
"input.effort.default": "Anbieterstandard",
|
|
568
598
|
"input.effort.reset": "Auf Anbieterstandard zurücksetzen",
|
|
569
599
|
"card.capabilities.failed": "Speichern fehlgeschlagen: Der Wert wurde abgelehnt oder steht in Konflikt. Bitte überprüfen."
|
|
@@ -657,6 +687,11 @@ window.__ModuleLoader__.load({
|
|
|
657
687
|
"model.panel.noTarget": "Nessuna voce di configurazione scrivibile per questo modello",
|
|
658
688
|
"model.panel.unavailable": "La directory dei modelli non è disponibile per questa sessione",
|
|
659
689
|
"input.effort.title": "Sforzo di ragionamento",
|
|
690
|
+
"panel.search.placeholder": "Cerca modelli…",
|
|
691
|
+
"card.takeoverUi": "Sostituzione UI modello",
|
|
692
|
+
"card.takeoverUiHint": "Se attivo, questo plugin sostituisce il selettore modelli del compositore con un pannello proprio (editor contesto/livello per riga + ricerca). Se spento (predefinito) resta il popup ufficiale: il livello auto è comunque visibile, ricerca e caricamento sono a carico del selettore originale. Ricarica la pagina dopo la modifica.",
|
|
693
|
+
"card.capabilities.apiUnsupported": "Questo provider usa un protocollo diverso da openai-completions: i campi di compatibilità thinking sono gestiti nativamente da pi-ai e non sono configurabili qui.",
|
|
694
|
+
"card.dsContextTitle": "Finestra di contesto dei modelli DeepSeek ufficiali",
|
|
660
695
|
"input.effort.default": "Predefinito del provider",
|
|
661
696
|
"input.effort.reset": "Ripristina il predefinito del provider",
|
|
662
697
|
"card.capabilities.failed": "Salvataggio non riuscito: il valore è stato rifiutato o è in conflitto. Verifica."
|
|
@@ -750,6 +785,11 @@ window.__ModuleLoader__.load({
|
|
|
750
785
|
"model.panel.noTarget": "Нет записываемой записи конфигурации для этой модели",
|
|
751
786
|
"model.panel.unavailable": "Каталог моделей недоступен для этой сессии",
|
|
752
787
|
"input.effort.title": "Усилие рассуждения",
|
|
788
|
+
"panel.search.placeholder": "Поиск моделей…",
|
|
789
|
+
"card.takeoverUi": "Перехват UI модели",
|
|
790
|
+
"card.takeoverUiHint": "Включено: этот плагин заменяет выбор модели в композиторе собственной панелью (редакторы контекста/уровня в строках + поиск). Выключено (по умолчанию) остаётся официальное popup-окно — уровень auto по-прежнему виден, поиск и загрузка обеспечиваются штатным селектором. После изменения перезагрузите страницу.",
|
|
791
|
+
"card.capabilities.apiUnsupported": "Этот провайдер использует протокол, отличный от openai-completions: поля совместимости thinking обрабатываются pi-ai нативно и здесь не настраиваются.",
|
|
792
|
+
"card.dsContextTitle": "Лимиты контекста официальных моделей DeepSeek",
|
|
753
793
|
"input.effort.default": "Значение провайдера по умолчанию",
|
|
754
794
|
"input.effort.reset": "Вернуть значение провайдера по умолчанию",
|
|
755
795
|
"card.capabilities.failed": "Ошибка сохранения: значение отклонено или конфликтует. Проверьте его."
|
|
@@ -843,6 +883,11 @@ window.__ModuleLoader__.load({
|
|
|
843
883
|
"model.panel.noTarget": "No hay entrada de configuración escribible para este modelo",
|
|
844
884
|
"model.panel.unavailable": "El directorio de modelos no está disponible para esta sesión",
|
|
845
885
|
"input.effort.title": "Esfuerzo de razonamiento",
|
|
886
|
+
"panel.search.placeholder": "Buscar modelos…",
|
|
887
|
+
"card.takeoverUi": "Relevo de la UI de modelo",
|
|
888
|
+
"card.takeoverUiHint": "Si está activo, este plugin sustituye el selector de modelos del compositor por un panel propio (editores de contexto/nivel por línea + búsqueda). Si está desactivado (predeterminado) se mantiene el popup oficial: el nivel auto sigue apareciendo y la búsqueda y la carga corresponden al selector nativo. Recarga la página tras cambiarlo.",
|
|
889
|
+
"card.capabilities.apiUnsupported": "Este proveedor usa un protocolo distinto de openai-completions: los campos de compatibilidad de thinking los gestiona pi-ai de forma nativa y no son configurables aquí.",
|
|
890
|
+
"card.dsContextTitle": "Ventana de contexto de los modelos DeepSeek oficiales",
|
|
846
891
|
"input.effort.default": "Predeterminado del proveedor",
|
|
847
892
|
"input.effort.reset": "Restaurar el valor predeterminado del proveedor",
|
|
848
893
|
"card.capabilities.failed": "Error al guardar: el valor fue rechazado o está en conflicto. Verifícalo."
|
|
@@ -2232,7 +2277,8 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
2232
2277
|
*/
|
|
2233
2278
|
/** The official DeepSeek provider route owned by the llm-deepseek adapter. */
|
|
2234
2279
|
const DEEPSEEK_PROVIDER = "deepseek-official";
|
|
2235
|
-
/** llm-deepseek's native default context capacity (DEFAULT_CONTEXT_WINDOW).
|
|
2280
|
+
/** llm-deepseek's native default context capacity (DEFAULT_CONTEXT_WINDOW).
|
|
2281
|
+
* exported for the settings-card editor (4.4.0, takeoverUi off). */
|
|
2236
2282
|
const DEEPSEEK_DEFAULT_WINDOW = 1e6;
|
|
2237
2283
|
/** Slider stop an unset window parks on: the thumb needs a position, the readout stays "unset". */
|
|
2238
2284
|
const UNSET_STOP_INDEX = CONTEXT_WINDOW_PRESETS.findIndex((preset) => preset.value === 256e3);
|
|
@@ -2250,6 +2296,21 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
2250
2296
|
current: null,
|
|
2251
2297
|
error: null
|
|
2252
2298
|
};
|
|
2299
|
+
/**
|
|
2300
|
+
* The absent-own-settings-scope snapshot: a module-level CONSTANT —
|
|
2301
|
+
* `useSyncExternalStore` demands a stable getSnapshot value, an inline
|
|
2302
|
+
* literal re-renders forever (the #185 pattern proven on the capability
|
|
2303
|
+
* card's transport face).
|
|
2304
|
+
*/
|
|
2305
|
+
const TL_ABSENT_SNAPSHOT = Object.freeze({
|
|
2306
|
+
status: "unavailable",
|
|
2307
|
+
value: void 0,
|
|
2308
|
+
revision: void 0,
|
|
2309
|
+
writable: false,
|
|
2310
|
+
base: void 0,
|
|
2311
|
+
user: void 0,
|
|
2312
|
+
mode: "memory"
|
|
2313
|
+
});
|
|
2253
2314
|
const rootStyle = {
|
|
2254
2315
|
position: "relative",
|
|
2255
2316
|
display: "inline-flex"
|
|
@@ -2551,10 +2612,20 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
2551
2612
|
* (the "max context window" editor moved into each line).
|
|
2552
2613
|
* @param props - injected directory + config forms, session seat, copy.
|
|
2553
2614
|
*/
|
|
2554
|
-
function ModelPanel({ directory, piAiScope, deepseekScope, t }) {
|
|
2615
|
+
function ModelPanel({ directory, piAiScope, deepseekScope, tlScope, sessionId, t }) {
|
|
2555
2616
|
const state = (0, react.useSyncExternalStore)((listener) => directory?.store.subscribe(listener) ?? (() => {}), () => directory?.store.getSnapshot() ?? UNAVAILABLE_STATE);
|
|
2556
2617
|
const piSnapshot = (0, react.useSyncExternalStore)((listener) => piAiScope.subscribe(listener), () => piAiScope.getSnapshot());
|
|
2557
2618
|
const dsSnapshot = (0, react.useSyncExternalStore)((listener) => deepseekScope.subscribe(listener), () => deepseekScope.getSnapshot());
|
|
2619
|
+
const tlSnapshot = (0, react.useSyncExternalStore)((listener) => tlScope?.subscribe(listener) ?? (() => {}), () => tlScope === void 0 ? TL_ABSENT_SNAPSHOT : tlScope.getSnapshot());
|
|
2620
|
+
/** The configured default level: the chip's user-intent fallback (issue #5). */
|
|
2621
|
+
const configLevel = (tlSnapshot.status === "ready" ? tlSnapshot.value?.level : void 0) ?? "auto";
|
|
2622
|
+
/**
|
|
2623
|
+
* The effort explicitly picked in THIS mount — the authoritative intent
|
|
2624
|
+
* until the session changes (issue #5). The directory's merged `current`
|
|
2625
|
+
* cannot tell a persisted `auto` pending from a scheduler-resolved wire
|
|
2626
|
+
* level apart; a local pick can, so it wins whenever it exists.
|
|
2627
|
+
*/
|
|
2628
|
+
const selectedEffortRef = (0, react.useRef)(void 0);
|
|
2558
2629
|
const [open, setOpen] = (0, react.useState)(false);
|
|
2559
2630
|
const [expanded, setExpanded] = (0, react.useState)(() => /* @__PURE__ */ new Set());
|
|
2560
2631
|
const [editing, setEditing] = (0, react.useState)(null);
|
|
@@ -2563,15 +2634,20 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
2563
2634
|
const [raw, setRaw] = (0, react.useState)("");
|
|
2564
2635
|
const [error, setError] = (0, react.useState)(null);
|
|
2565
2636
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
2637
|
+
const [query, setQuery] = (0, react.useState)("");
|
|
2566
2638
|
const rootRef = (0, react.useRef)(null);
|
|
2567
2639
|
(0, react.useEffect)(() => {
|
|
2568
2640
|
if (!open) return;
|
|
2569
2641
|
directory?.load().catch(() => {});
|
|
2570
2642
|
}, [directory, open]);
|
|
2643
|
+
(0, react.useEffect)(() => {
|
|
2644
|
+
selectedEffortRef.current = void 0;
|
|
2645
|
+
}, [sessionId]);
|
|
2571
2646
|
const close = (0, react.useCallback)(() => {
|
|
2572
2647
|
setOpen(false);
|
|
2573
2648
|
setEditing(null);
|
|
2574
2649
|
setError(null);
|
|
2650
|
+
setQuery("");
|
|
2575
2651
|
}, []);
|
|
2576
2652
|
(0, react.useEffect)(() => {
|
|
2577
2653
|
if (!open) return;
|
|
@@ -2598,6 +2674,12 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
2598
2674
|
}, [state]);
|
|
2599
2675
|
const providers = (0, react.useMemo)(() => providersOf$1(piSnapshot), [piSnapshot]);
|
|
2600
2676
|
const dsSection = (0, react.useMemo)(() => deepseekSectionOf(dsSnapshot), [dsSnapshot]);
|
|
2677
|
+
const needle = query.trim().toLowerCase();
|
|
2678
|
+
const showSearch = (0, react.useMemo)(() => state.groups.reduce((count, group) => count + group.models.length, 0), [state.groups]) > 4;
|
|
2679
|
+
const visibleGroups = (0, react.useMemo)(() => needle === "" ? state.groups : state.groups.map((group) => ({
|
|
2680
|
+
...group,
|
|
2681
|
+
models: group.models.filter((model) => model.name.toLowerCase().includes(needle) || model.id.toLowerCase().includes(needle))
|
|
2682
|
+
})).filter((group) => group.models.length > 0), [state.groups, needle]);
|
|
2601
2683
|
/** The effective window of one model line, resolved against its family.
|
|
2602
2684
|
* Declared BEFORE activeWindow: the ring's window-fallback memo calls this
|
|
2603
2685
|
* in its factory, and a const arrow below the first caller would be a
|
|
@@ -2723,6 +2805,7 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
2723
2805
|
const chooseEffort = (provider, model, effort) => {
|
|
2724
2806
|
if (busy || directory === void 0) return;
|
|
2725
2807
|
setBusy(true);
|
|
2808
|
+
selectedEffortRef.current = effort === "" ? void 0 : effort;
|
|
2726
2809
|
directory.select({
|
|
2727
2810
|
provider,
|
|
2728
2811
|
model,
|
|
@@ -2735,8 +2818,12 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
2735
2818
|
};
|
|
2736
2819
|
const triggerLabel = current?.name ?? state.current?.model ?? t("model.panel.choose");
|
|
2737
2820
|
const currentReasoning = current?.model.reasoning;
|
|
2738
|
-
const
|
|
2739
|
-
const
|
|
2821
|
+
const resolvedEffort = state.current?.reasoningEffort;
|
|
2822
|
+
const autoAdvertised = currentReasoning?.efforts.some((effort) => effort.id === "auto") === true;
|
|
2823
|
+
const intentEffort = selectedEffortRef.current ?? (resolvedEffort === "auto" || autoAdvertised && configLevel === "auto" ? "auto" : resolvedEffort ?? currentReasoning?.defaultEffort);
|
|
2824
|
+
const effortName = (id) => currentReasoning?.efforts.find((level) => level.id === id)?.name ?? id;
|
|
2825
|
+
const effortLabel = currentReasoning === void 0 ? void 0 : intentEffort === void 0 ? t("input.effort.default") : effortName(intentEffort);
|
|
2826
|
+
const resolvedHint = currentReasoning !== void 0 && intentEffort === "auto" && resolvedEffort !== void 0 && resolvedEffort !== "auto" ? `→ ${effortName(resolvedEffort)}` : void 0;
|
|
2740
2827
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2741
2828
|
ref: rootRef,
|
|
2742
2829
|
style: rootStyle,
|
|
@@ -2764,6 +2851,10 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
2764
2851
|
style: triggerEffortStyle,
|
|
2765
2852
|
children: effortLabel
|
|
2766
2853
|
}),
|
|
2854
|
+
resolvedHint !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2855
|
+
style: triggerEffortStyle,
|
|
2856
|
+
children: resolvedHint
|
|
2857
|
+
}),
|
|
2767
2858
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2768
2859
|
style: chevronStyle,
|
|
2769
2860
|
children: open ? "▲" : "▼"
|
|
@@ -2778,243 +2869,263 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
2778
2869
|
style: popStyle,
|
|
2779
2870
|
role: "dialog",
|
|
2780
2871
|
"aria-label": t("model.panel.choose"),
|
|
2781
|
-
children: [
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
}), isExpanded && group.models.map((model) => {
|
|
2816
|
-
const active = activeModel === model.id;
|
|
2817
|
-
const lineWritable = writableLine(group.id, model.id);
|
|
2818
|
-
const lineWindow = windowOf(group.id, model.id);
|
|
2819
|
-
const isContextEditing = editing !== null && editing.provider === group.id && editing.model === model.id && editing.kind === "context";
|
|
2820
|
-
const isEffortEditing = editing !== null && editing.provider === group.id && editing.model === model.id && editing.kind === "effort";
|
|
2821
|
-
const lineEffort = active ? state.current?.reasoningEffort ?? model.reasoning?.defaultEffort : model.reasoning?.defaultEffort;
|
|
2822
|
-
const lineStops = model.reasoning === void 0 ? [] : orderEffortsForSlider(model.reasoning.efforts);
|
|
2823
|
-
const lineEffortName = lineEffort === void 0 ? t("input.effort.default") : lineStops.find((stop) => stop.id === lineEffort)?.name ?? lineEffort;
|
|
2824
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2825
|
-
style: active ? modelRowActiveStyle : modelRowStyle$1,
|
|
2872
|
+
children: [
|
|
2873
|
+
showSearch && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2874
|
+
type: "text",
|
|
2875
|
+
value: query,
|
|
2876
|
+
placeholder: t("panel.search.placeholder"),
|
|
2877
|
+
"aria-label": t("panel.search.placeholder"),
|
|
2878
|
+
style: {
|
|
2879
|
+
...inputStyle,
|
|
2880
|
+
width: "100%",
|
|
2881
|
+
boxSizing: "border-box",
|
|
2882
|
+
margin: "2px 0 6px"
|
|
2883
|
+
},
|
|
2884
|
+
onChange: (event) => setQuery(event.currentTarget.value)
|
|
2885
|
+
}),
|
|
2886
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2887
|
+
style: modelsStyle,
|
|
2888
|
+
children: [
|
|
2889
|
+
directory === void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2890
|
+
style: statusStyle,
|
|
2891
|
+
children: t("model.panel.unavailable")
|
|
2892
|
+
}),
|
|
2893
|
+
directory !== void 0 && state.status === "loading" && state.groups.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2894
|
+
style: statusStyle,
|
|
2895
|
+
children: t("model.panel.loading")
|
|
2896
|
+
}),
|
|
2897
|
+
directory !== void 0 && visibleGroups.map((group) => {
|
|
2898
|
+
const isExpanded = needle !== "" || expanded.has(group.id);
|
|
2899
|
+
const name = group.name ?? group.label ?? group.id;
|
|
2900
|
+
const activeModel = state.current?.provider === group.id ? state.current.model : void 0;
|
|
2901
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2902
|
+
type: "button",
|
|
2903
|
+
style: providerToggleStyle,
|
|
2904
|
+
"aria-expanded": isExpanded,
|
|
2905
|
+
onClick: () => toggleProvider(group.id),
|
|
2826
2906
|
children: [
|
|
2827
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
"aria-selected": active,
|
|
2831
|
-
style: modelPickStyle,
|
|
2832
|
-
disabled: busy,
|
|
2833
|
-
onClick: () => chooseModel(group.id, model.id),
|
|
2834
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2835
|
-
style: modelCopyStyle,
|
|
2836
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2837
|
-
style: modelNameStyle,
|
|
2838
|
-
children: model.name
|
|
2839
|
-
})
|
|
2840
|
-
}), active && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2841
|
-
style: checkStyle,
|
|
2842
|
-
"aria-hidden": "true",
|
|
2843
|
-
children: "✓"
|
|
2844
|
-
})]
|
|
2845
|
-
}),
|
|
2846
|
-
(model.reasoning?.efforts.length ?? 0) > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2847
|
-
role: "button",
|
|
2848
|
-
tabIndex: 0,
|
|
2849
|
-
"aria-label": t("input.effort.title"),
|
|
2850
|
-
title: t("input.effort.title"),
|
|
2851
|
-
"aria-expanded": isEffortEditing,
|
|
2852
|
-
style: effortChipStyle,
|
|
2853
|
-
onClick: (event) => {
|
|
2854
|
-
event.stopPropagation();
|
|
2855
|
-
if (!busy) toggleEffortEditor(group.id, model.id);
|
|
2856
|
-
},
|
|
2857
|
-
onKeyDown: (event) => {
|
|
2858
|
-
if (event.key !== "Enter" && event.key !== " ") return;
|
|
2859
|
-
event.preventDefault();
|
|
2860
|
-
event.stopPropagation();
|
|
2861
|
-
if (!busy) toggleEffortEditor(group.id, model.id);
|
|
2862
|
-
},
|
|
2863
|
-
children: lineEffortName
|
|
2864
|
-
}),
|
|
2865
|
-
isEffortEditing && model.reasoning !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2866
|
-
style: editorRowStyle,
|
|
2867
|
-
onClick: (event) => event.stopPropagation(),
|
|
2868
|
-
children: [
|
|
2869
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2870
|
-
style: labelStyle$1,
|
|
2871
|
-
children: t("input.effort.title")
|
|
2872
|
-
}),
|
|
2873
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(EffortSlider, {
|
|
2874
|
-
stops: lineStops,
|
|
2875
|
-
value: lineEffort,
|
|
2876
|
-
mascot: isDeepSeekLine(group.id, model.id, model.name),
|
|
2877
|
-
disabled: busy,
|
|
2878
|
-
onCommit: (id) => chooseEffort(group.id, model.id, id),
|
|
2879
|
-
t
|
|
2880
|
-
}),
|
|
2881
|
-
model.reasoning.defaultEffort !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2882
|
-
type: "button",
|
|
2883
|
-
disabled: busy,
|
|
2884
|
-
"aria-label": t("input.effort.reset"),
|
|
2885
|
-
title: t("input.effort.reset"),
|
|
2886
|
-
style: actionButtonStyle,
|
|
2887
|
-
onClick: (event) => {
|
|
2888
|
-
event.stopPropagation();
|
|
2889
|
-
const target = model.reasoning?.defaultEffort;
|
|
2890
|
-
if (target !== void 0) chooseEffort(group.id, model.id, target);
|
|
2891
|
-
},
|
|
2892
|
-
children: "↺"
|
|
2893
|
-
})
|
|
2894
|
-
]
|
|
2907
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2908
|
+
style: providerNameStyle$1,
|
|
2909
|
+
children: name
|
|
2895
2910
|
}),
|
|
2896
2911
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
"aria-label": t("input.context.title"),
|
|
2900
|
-
title: lineWritable ? t("input.context.globalHint") : t("model.panel.noTarget"),
|
|
2901
|
-
style: lineWritable && !busy ? chipStyle : chipDisabledStyle,
|
|
2902
|
-
onClick: (event) => {
|
|
2903
|
-
event.stopPropagation();
|
|
2904
|
-
if (!lineWritable || busy) return;
|
|
2905
|
-
if (isContextEditing) {
|
|
2906
|
-
setEditing(null);
|
|
2907
|
-
return;
|
|
2908
|
-
}
|
|
2909
|
-
openEditor(group.id, model.id);
|
|
2910
|
-
},
|
|
2911
|
-
onKeyDown: (event) => {
|
|
2912
|
-
if (event.key !== "Enter" && event.key !== " ") return;
|
|
2913
|
-
event.preventDefault();
|
|
2914
|
-
event.stopPropagation();
|
|
2915
|
-
if (!lineWritable || busy) return;
|
|
2916
|
-
openEditor(group.id, model.id);
|
|
2917
|
-
},
|
|
2918
|
-
children: lineWindow === void 0 ? t("input.context.unset") : formatContextWindow(lineWindow)
|
|
2912
|
+
style: providerMetaStyle,
|
|
2913
|
+
children: group.models.length
|
|
2919
2914
|
}),
|
|
2920
|
-
|
|
2921
|
-
style:
|
|
2922
|
-
children:
|
|
2923
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2924
|
-
style: labelStyle$1,
|
|
2925
|
-
title: t("input.context.globalHint"),
|
|
2926
|
-
children: t("model.panel.window")
|
|
2927
|
-
}),
|
|
2928
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2929
|
-
type: "range",
|
|
2930
|
-
min: 0,
|
|
2931
|
-
max: CONTEXT_WINDOW_PRESETS.length - 1,
|
|
2932
|
-
step: 1,
|
|
2933
|
-
value: draft ?? stopIndexOf(lineWindow),
|
|
2934
|
-
disabled: busy,
|
|
2935
|
-
"aria-label": t("input.context.title"),
|
|
2936
|
-
style: sliderStyle,
|
|
2937
|
-
onChange: (event) => {
|
|
2938
|
-
setDraft(Number(event.currentTarget.value));
|
|
2939
|
-
},
|
|
2940
|
-
onPointerUp: () => {
|
|
2941
|
-
if (draft === null) return;
|
|
2942
|
-
commitWindow(group.id, model.id, CONTEXT_WINDOW_PRESETS[draft]?.value);
|
|
2943
|
-
},
|
|
2944
|
-
onKeyUp: () => {
|
|
2945
|
-
if (draft === null) return;
|
|
2946
|
-
commitWindow(group.id, model.id, CONTEXT_WINDOW_PRESETS[draft]?.value);
|
|
2947
|
-
}
|
|
2948
|
-
}),
|
|
2949
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2950
|
-
style: valueStyle,
|
|
2951
|
-
children: draft === null ? lineWindow === void 0 ? t("input.context.unset") : formatContextWindow(lineWindow) : formatContextWindow(CONTEXT_WINDOW_PRESETS[draft]?.value ?? 0)
|
|
2952
|
-
}),
|
|
2953
|
-
custom ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2954
|
-
type: "text",
|
|
2955
|
-
inputMode: "numeric",
|
|
2956
|
-
value: raw,
|
|
2957
|
-
disabled: busy,
|
|
2958
|
-
placeholder: t("input.context.customPlaceholder"),
|
|
2959
|
-
"aria-label": t("input.context.customPlaceholder"),
|
|
2960
|
-
style: inputStyle,
|
|
2961
|
-
onChange: (event) => {
|
|
2962
|
-
setRaw(event.currentTarget.value);
|
|
2963
|
-
},
|
|
2964
|
-
onKeyDown: (event) => {
|
|
2965
|
-
if (event.key === "Enter") applyCustom();
|
|
2966
|
-
}
|
|
2967
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2968
|
-
type: "button",
|
|
2969
|
-
disabled: busy,
|
|
2970
|
-
style: actionButtonStyle,
|
|
2971
|
-
onClick: applyCustom,
|
|
2972
|
-
children: t("input.context.apply")
|
|
2973
|
-
})] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2974
|
-
type: "button",
|
|
2975
|
-
disabled: busy,
|
|
2976
|
-
"aria-label": t("input.context.custom"),
|
|
2977
|
-
title: t("input.context.custom"),
|
|
2978
|
-
style: actionButtonStyle,
|
|
2979
|
-
onClick: () => {
|
|
2980
|
-
setCustom(true);
|
|
2981
|
-
setError(null);
|
|
2982
|
-
},
|
|
2983
|
-
children: "⋯"
|
|
2984
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2985
|
-
type: "button",
|
|
2986
|
-
disabled: busy || lineWindow === void 0,
|
|
2987
|
-
style: {
|
|
2988
|
-
...actionButtonStyle,
|
|
2989
|
-
opacity: lineWindow === void 0 ? .55 : 1
|
|
2990
|
-
},
|
|
2991
|
-
onClick: () => {
|
|
2992
|
-
setDraft(null);
|
|
2993
|
-
setError(null);
|
|
2994
|
-
commitWindow(group.id, model.id, void 0);
|
|
2995
|
-
},
|
|
2996
|
-
children: t("input.context.clear")
|
|
2997
|
-
})] }),
|
|
2998
|
-
error !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2999
|
-
style: errorStyle,
|
|
3000
|
-
children: error
|
|
3001
|
-
})
|
|
3002
|
-
]
|
|
2915
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2916
|
+
style: chevronStyle,
|
|
2917
|
+
children: isExpanded ? "▼" : "▶"
|
|
3003
2918
|
})
|
|
3004
2919
|
]
|
|
3005
|
-
}, group.
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
2920
|
+
}), isExpanded && group.models.map((model) => {
|
|
2921
|
+
const active = activeModel === model.id;
|
|
2922
|
+
const lineWritable = writableLine(group.id, model.id);
|
|
2923
|
+
const lineWindow = windowOf(group.id, model.id);
|
|
2924
|
+
const isContextEditing = editing !== null && editing.provider === group.id && editing.model === model.id && editing.kind === "context";
|
|
2925
|
+
const isEffortEditing = editing !== null && editing.provider === group.id && editing.model === model.id && editing.kind === "effort";
|
|
2926
|
+
const lineEffort = active ? state.current?.reasoningEffort ?? model.reasoning?.defaultEffort : model.reasoning?.defaultEffort;
|
|
2927
|
+
const lineStops = model.reasoning === void 0 ? [] : orderEffortsForSlider(model.reasoning.efforts);
|
|
2928
|
+
const lineEffortName = lineEffort === void 0 ? t("input.effort.default") : lineStops.find((stop) => stop.id === lineEffort)?.name ?? lineEffort;
|
|
2929
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2930
|
+
style: active ? modelRowActiveStyle : modelRowStyle$1,
|
|
2931
|
+
children: [
|
|
2932
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2933
|
+
type: "button",
|
|
2934
|
+
role: "option",
|
|
2935
|
+
"aria-selected": active,
|
|
2936
|
+
style: modelPickStyle,
|
|
2937
|
+
disabled: busy,
|
|
2938
|
+
onClick: () => chooseModel(group.id, model.id),
|
|
2939
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2940
|
+
style: modelCopyStyle,
|
|
2941
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2942
|
+
style: modelNameStyle,
|
|
2943
|
+
children: model.name
|
|
2944
|
+
})
|
|
2945
|
+
}), active && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2946
|
+
style: checkStyle,
|
|
2947
|
+
"aria-hidden": "true",
|
|
2948
|
+
children: "✓"
|
|
2949
|
+
})]
|
|
2950
|
+
}),
|
|
2951
|
+
(model.reasoning?.efforts.length ?? 0) > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2952
|
+
role: "button",
|
|
2953
|
+
tabIndex: 0,
|
|
2954
|
+
"aria-label": t("input.effort.title"),
|
|
2955
|
+
title: t("input.effort.title"),
|
|
2956
|
+
"aria-expanded": isEffortEditing,
|
|
2957
|
+
style: effortChipStyle,
|
|
2958
|
+
onClick: (event) => {
|
|
2959
|
+
event.stopPropagation();
|
|
2960
|
+
if (!busy) toggleEffortEditor(group.id, model.id);
|
|
2961
|
+
},
|
|
2962
|
+
onKeyDown: (event) => {
|
|
2963
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
2964
|
+
event.preventDefault();
|
|
2965
|
+
event.stopPropagation();
|
|
2966
|
+
if (!busy) toggleEffortEditor(group.id, model.id);
|
|
2967
|
+
},
|
|
2968
|
+
children: lineEffortName
|
|
2969
|
+
}),
|
|
2970
|
+
isEffortEditing && model.reasoning !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2971
|
+
style: editorRowStyle,
|
|
2972
|
+
onClick: (event) => event.stopPropagation(),
|
|
2973
|
+
children: [
|
|
2974
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2975
|
+
style: labelStyle$1,
|
|
2976
|
+
children: t("input.effort.title")
|
|
2977
|
+
}),
|
|
2978
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(EffortSlider, {
|
|
2979
|
+
stops: lineStops,
|
|
2980
|
+
value: lineEffort,
|
|
2981
|
+
mascot: isDeepSeekLine(group.id, model.id, model.name),
|
|
2982
|
+
disabled: busy,
|
|
2983
|
+
onCommit: (id) => chooseEffort(group.id, model.id, id),
|
|
2984
|
+
t
|
|
2985
|
+
}),
|
|
2986
|
+
model.reasoning.defaultEffort !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2987
|
+
type: "button",
|
|
2988
|
+
disabled: busy,
|
|
2989
|
+
"aria-label": t("input.effort.reset"),
|
|
2990
|
+
title: t("input.effort.reset"),
|
|
2991
|
+
style: actionButtonStyle,
|
|
2992
|
+
onClick: (event) => {
|
|
2993
|
+
event.stopPropagation();
|
|
2994
|
+
const target = model.reasoning?.defaultEffort;
|
|
2995
|
+
if (target !== void 0) chooseEffort(group.id, model.id, target);
|
|
2996
|
+
},
|
|
2997
|
+
children: "↺"
|
|
2998
|
+
})
|
|
2999
|
+
]
|
|
3000
|
+
}),
|
|
3001
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3002
|
+
role: "button",
|
|
3003
|
+
tabIndex: 0,
|
|
3004
|
+
"aria-label": t("input.context.title"),
|
|
3005
|
+
title: lineWritable ? t("input.context.globalHint") : t("model.panel.noTarget"),
|
|
3006
|
+
style: lineWritable && !busy ? chipStyle : chipDisabledStyle,
|
|
3007
|
+
onClick: (event) => {
|
|
3008
|
+
event.stopPropagation();
|
|
3009
|
+
if (!lineWritable || busy) return;
|
|
3010
|
+
if (isContextEditing) {
|
|
3011
|
+
setEditing(null);
|
|
3012
|
+
return;
|
|
3013
|
+
}
|
|
3014
|
+
openEditor(group.id, model.id);
|
|
3015
|
+
},
|
|
3016
|
+
onKeyDown: (event) => {
|
|
3017
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
3018
|
+
event.preventDefault();
|
|
3019
|
+
event.stopPropagation();
|
|
3020
|
+
if (!lineWritable || busy) return;
|
|
3021
|
+
openEditor(group.id, model.id);
|
|
3022
|
+
},
|
|
3023
|
+
children: lineWindow === void 0 ? t("input.context.unset") : formatContextWindow(lineWindow)
|
|
3024
|
+
}),
|
|
3025
|
+
isContextEditing && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3026
|
+
style: editorRowStyle,
|
|
3027
|
+
children: [
|
|
3028
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3029
|
+
style: labelStyle$1,
|
|
3030
|
+
title: t("input.context.globalHint"),
|
|
3031
|
+
children: t("model.panel.window")
|
|
3032
|
+
}),
|
|
3033
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3034
|
+
type: "range",
|
|
3035
|
+
min: 0,
|
|
3036
|
+
max: CONTEXT_WINDOW_PRESETS.length - 1,
|
|
3037
|
+
step: 1,
|
|
3038
|
+
value: draft ?? stopIndexOf(lineWindow),
|
|
3039
|
+
disabled: busy,
|
|
3040
|
+
"aria-label": t("input.context.title"),
|
|
3041
|
+
style: sliderStyle,
|
|
3042
|
+
onChange: (event) => {
|
|
3043
|
+
setDraft(Number(event.currentTarget.value));
|
|
3044
|
+
},
|
|
3045
|
+
onPointerUp: () => {
|
|
3046
|
+
if (draft === null) return;
|
|
3047
|
+
commitWindow(group.id, model.id, CONTEXT_WINDOW_PRESETS[draft]?.value);
|
|
3048
|
+
},
|
|
3049
|
+
onKeyUp: () => {
|
|
3050
|
+
if (draft === null) return;
|
|
3051
|
+
commitWindow(group.id, model.id, CONTEXT_WINDOW_PRESETS[draft]?.value);
|
|
3052
|
+
}
|
|
3053
|
+
}),
|
|
3054
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3055
|
+
style: valueStyle,
|
|
3056
|
+
children: draft === null ? lineWindow === void 0 ? t("input.context.unset") : formatContextWindow(lineWindow) : formatContextWindow(CONTEXT_WINDOW_PRESETS[draft]?.value ?? 0)
|
|
3057
|
+
}),
|
|
3058
|
+
custom ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3059
|
+
type: "text",
|
|
3060
|
+
inputMode: "numeric",
|
|
3061
|
+
value: raw,
|
|
3062
|
+
disabled: busy,
|
|
3063
|
+
placeholder: t("input.context.customPlaceholder"),
|
|
3064
|
+
"aria-label": t("input.context.customPlaceholder"),
|
|
3065
|
+
style: inputStyle,
|
|
3066
|
+
onChange: (event) => {
|
|
3067
|
+
setRaw(event.currentTarget.value);
|
|
3068
|
+
},
|
|
3069
|
+
onKeyDown: (event) => {
|
|
3070
|
+
if (event.key === "Enter") applyCustom();
|
|
3071
|
+
}
|
|
3072
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3073
|
+
type: "button",
|
|
3074
|
+
disabled: busy,
|
|
3075
|
+
style: actionButtonStyle,
|
|
3076
|
+
onClick: applyCustom,
|
|
3077
|
+
children: t("input.context.apply")
|
|
3078
|
+
})] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3079
|
+
type: "button",
|
|
3080
|
+
disabled: busy,
|
|
3081
|
+
"aria-label": t("input.context.custom"),
|
|
3082
|
+
title: t("input.context.custom"),
|
|
3083
|
+
style: actionButtonStyle,
|
|
3084
|
+
onClick: () => {
|
|
3085
|
+
setCustom(true);
|
|
3086
|
+
setError(null);
|
|
3087
|
+
},
|
|
3088
|
+
children: "⋯"
|
|
3089
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3090
|
+
type: "button",
|
|
3091
|
+
disabled: busy || lineWindow === void 0,
|
|
3092
|
+
style: {
|
|
3093
|
+
...actionButtonStyle,
|
|
3094
|
+
opacity: lineWindow === void 0 ? .55 : 1
|
|
3095
|
+
},
|
|
3096
|
+
onClick: () => {
|
|
3097
|
+
setDraft(null);
|
|
3098
|
+
setError(null);
|
|
3099
|
+
commitWindow(group.id, model.id, void 0);
|
|
3100
|
+
},
|
|
3101
|
+
children: t("input.context.clear")
|
|
3102
|
+
})] }),
|
|
3103
|
+
error !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3104
|
+
style: errorStyle,
|
|
3105
|
+
children: error
|
|
3106
|
+
})
|
|
3107
|
+
]
|
|
3108
|
+
})
|
|
3109
|
+
]
|
|
3110
|
+
}, group.id + ":" + model.id);
|
|
3111
|
+
})] }, group.id);
|
|
3112
|
+
}),
|
|
3113
|
+
directory !== void 0 && state.status !== "loading" && state.groups.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3114
|
+
style: statusStyle,
|
|
3115
|
+
children: t("model.panel.empty")
|
|
3116
|
+
}),
|
|
3117
|
+
directory !== void 0 && needle !== "" && visibleGroups.length === 0 && state.groups.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3118
|
+
style: statusStyle,
|
|
3119
|
+
children: t("model.panel.empty")
|
|
3120
|
+
})
|
|
3121
|
+
]
|
|
3122
|
+
}),
|
|
3123
|
+
directory !== void 0 && state.error !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
3124
|
+
style: errorBannerStyle,
|
|
3125
|
+
role: "status",
|
|
3126
|
+
children: state.error
|
|
3127
|
+
})
|
|
3128
|
+
]
|
|
3018
3129
|
})] }) : null
|
|
3019
3130
|
]
|
|
3020
3131
|
});
|
|
@@ -3366,6 +3477,18 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3366
3477
|
...own
|
|
3367
3478
|
} : base;
|
|
3368
3479
|
}
|
|
3480
|
+
/**
|
|
3481
|
+
* Whether the model-level thinking-compat fields (`compat.thinkingFormat`,
|
|
3482
|
+
* `compat.supportsReasoningEffort`) may be written for this entry's provider
|
|
3483
|
+
* (issue #2): the host llm-pi-ai gate offers them ONLY on the
|
|
3484
|
+
* openai-completions protocol — a Responses route carrying them fails the
|
|
3485
|
+
* WHOLE providers write (`not configurable here`). An absent `api` keeps
|
|
3486
|
+
* pi-ai's openai-completions default, so the row stays editable.
|
|
3487
|
+
* (exported for the gate's unit regression, issue #2)
|
|
3488
|
+
*/
|
|
3489
|
+
function effortCompatConfigurable(entry) {
|
|
3490
|
+
return typeof entry.providerApi !== "string" || entry.providerApi === "openai-completions";
|
|
3491
|
+
}
|
|
3369
3492
|
/** Flatten the user-layer providers into capability entries (models arrays only). */
|
|
3370
3493
|
function entriesOf(providers) {
|
|
3371
3494
|
return Object.entries(providers).flatMap(([providerId, profile]) => {
|
|
@@ -3380,7 +3503,8 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3380
3503
|
model: typeof model === "object" && model !== null && !Array.isArray(model) ? model : {},
|
|
3381
3504
|
modelId: typeof model === "object" && model !== null && typeof model["id"] === "string" ? model["id"] : `#${index + 1}`,
|
|
3382
3505
|
providerCompat,
|
|
3383
|
-
providerInput
|
|
3506
|
+
providerInput,
|
|
3507
|
+
providerApi: raw["api"]
|
|
3384
3508
|
}));
|
|
3385
3509
|
});
|
|
3386
3510
|
}
|
|
@@ -3870,6 +3994,7 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3870
3994
|
const thinking = typeof effortsOf(entry.model) === "object";
|
|
3871
3995
|
const compat = compatOf(entry);
|
|
3872
3996
|
const supportsEffort = compat["supportsReasoningEffort"] === true;
|
|
3997
|
+
const apiGated = !effortCompatConfigurable(entry);
|
|
3873
3998
|
const meta = summaryOf(entry);
|
|
3874
3999
|
const format = typeof compat["thinkingFormat"] === "string" ? compat["thinkingFormat"] : void 0;
|
|
3875
4000
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -3936,6 +4061,10 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3936
4061
|
borderTop: "1px solid var(--dsw-alias-border-l2)"
|
|
3937
4062
|
},
|
|
3938
4063
|
children: [
|
|
4064
|
+
apiGated && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4065
|
+
style: hintStyle,
|
|
4066
|
+
children: t("card.capabilities.apiUnsupported")
|
|
4067
|
+
}),
|
|
3939
4068
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3940
4069
|
style: {
|
|
3941
4070
|
display: "flex",
|
|
@@ -3951,10 +4080,11 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
3951
4080
|
gap: "6px",
|
|
3952
4081
|
fontSize: "12px"
|
|
3953
4082
|
},
|
|
4083
|
+
title: apiGated ? t("card.capabilities.apiUnsupported") : void 0,
|
|
3954
4084
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3955
4085
|
type: "checkbox",
|
|
3956
4086
|
checked: thinking,
|
|
3957
|
-
disabled: readonly || busy,
|
|
4087
|
+
disabled: readonly || busy || apiGated,
|
|
3958
4088
|
onChange: (event) => toggleThinking(entry, event.currentTarget.checked)
|
|
3959
4089
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("card.capabilities.thinking") })]
|
|
3960
4090
|
}),
|
|
@@ -4002,10 +4132,11 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
4002
4132
|
fontSize: "12px",
|
|
4003
4133
|
margin: "0 0 8px"
|
|
4004
4134
|
},
|
|
4135
|
+
title: apiGated ? t("card.capabilities.apiUnsupported") : void 0,
|
|
4005
4136
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4006
4137
|
type: "checkbox",
|
|
4007
4138
|
checked: supportsEffort,
|
|
4008
|
-
disabled: readonly || busy,
|
|
4139
|
+
disabled: readonly || busy || apiGated,
|
|
4009
4140
|
onChange: (event) => toggleEffortCapable(entry, event.currentTarget.checked)
|
|
4010
4141
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("card.capabilities.supportsEffort") })]
|
|
4011
4142
|
}) : null,
|
|
@@ -4115,7 +4246,8 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
4115
4246
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
4116
4247
|
style: controlStyle,
|
|
4117
4248
|
value: format ?? "inherit",
|
|
4118
|
-
disabled: readonly || busy,
|
|
4249
|
+
disabled: readonly || busy || apiGated,
|
|
4250
|
+
title: apiGated ? t("card.capabilities.apiUnsupported") : void 0,
|
|
4119
4251
|
onChange: (event) => {
|
|
4120
4252
|
const next = event.currentTarget.value;
|
|
4121
4253
|
patchModel(entry.providerId, entry.index, (row) => {
|
|
@@ -4228,12 +4360,184 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
4228
4360
|
});
|
|
4229
4361
|
}
|
|
4230
4362
|
/**
|
|
4363
|
+
* The absent-llm-deepseek snapshot: module-level CONSTANT (the stable-snapshot
|
|
4364
|
+
* rule that killed the first-ever panel mount, #185).
|
|
4365
|
+
*/
|
|
4366
|
+
const DS_ABSENT_SNAPSHOT = Object.freeze({
|
|
4367
|
+
status: "unavailable",
|
|
4368
|
+
value: void 0,
|
|
4369
|
+
revision: void 0,
|
|
4370
|
+
writable: false,
|
|
4371
|
+
base: void 0,
|
|
4372
|
+
user: void 0,
|
|
4373
|
+
mode: "memory"
|
|
4374
|
+
});
|
|
4375
|
+
/**
|
|
4376
|
+
* Official DeepSeek model context-window editor (4.4.0): the per-line editor
|
|
4377
|
+
* lived only in the ModelPanel; with the seat takeover off by default the
|
|
4378
|
+
* card owns it. Writes mirror the panel's DEEPSEEK branch exactly: the model
|
|
4379
|
+
* entry's `contextWindow` when listed, the route `defaultContextWindow`
|
|
4380
|
+
* otherwise (clear = back to the native 1M).
|
|
4381
|
+
* @param props - the llm-deepseek scope (absent = section hidden), copy, fence.
|
|
4382
|
+
* @returns the editor block, or null when the namespace/scope is unavailable.
|
|
4383
|
+
*/
|
|
4384
|
+
function DeepSeekContextSection(props) {
|
|
4385
|
+
const { scope, t, readonly } = props;
|
|
4386
|
+
const subscribe = (0, react.useCallback)((listener) => scope !== void 0 ? scope.subscribe(listener) : () => {}, [scope]);
|
|
4387
|
+
const getSnapshot = (0, react.useCallback)(() => scope === void 0 ? DS_ABSENT_SNAPSHOT : scope.getSnapshot(), [scope]);
|
|
4388
|
+
const snapshot = (0, react.useSyncExternalStore)(subscribe, getSnapshot);
|
|
4389
|
+
const [raw, setRaw] = (0, react.useState)({});
|
|
4390
|
+
const [errors, setErrors] = (0, react.useState)({});
|
|
4391
|
+
const [busy, setBusy] = (0, react.useState)(false);
|
|
4392
|
+
if (snapshot.status !== "ready") return null;
|
|
4393
|
+
const section = deepseekSectionOf(snapshot);
|
|
4394
|
+
const models = section.models ?? [];
|
|
4395
|
+
if (models.length === 0 && section.defaultContextWindow === void 0) return null;
|
|
4396
|
+
const writable = snapshot.writable && !readonly && !busy;
|
|
4397
|
+
/** Commit one row's window (index -1 = the route default layer). */
|
|
4398
|
+
const commit = (index, value) => {
|
|
4399
|
+
if (scope === void 0 || !writable) return;
|
|
4400
|
+
setBusy(true);
|
|
4401
|
+
const rows = (deepseekSectionOf(scope.getSnapshot()).models ?? []).map((entry) => ({ ...entry }));
|
|
4402
|
+
(index >= 0 ? scope.set("models", rows.map((entry, at) => {
|
|
4403
|
+
if (at !== index) return entry;
|
|
4404
|
+
if (value === void 0) {
|
|
4405
|
+
const rest = { ...entry };
|
|
4406
|
+
delete rest["contextWindow"];
|
|
4407
|
+
return rest;
|
|
4408
|
+
}
|
|
4409
|
+
return {
|
|
4410
|
+
...entry,
|
|
4411
|
+
contextWindow: value
|
|
4412
|
+
};
|
|
4413
|
+
})) : scope.set("defaultContextWindow", value ?? 1e6)).then(() => {
|
|
4414
|
+
setBusy(false);
|
|
4415
|
+
setErrors((cur) => {
|
|
4416
|
+
const next = { ...cur };
|
|
4417
|
+
delete next[String(index)];
|
|
4418
|
+
return next;
|
|
4419
|
+
});
|
|
4420
|
+
}, () => {
|
|
4421
|
+
setBusy(false);
|
|
4422
|
+
setErrors((cur) => ({
|
|
4423
|
+
...cur,
|
|
4424
|
+
[String(index)]: t("card.capabilities.failed")
|
|
4425
|
+
}));
|
|
4426
|
+
});
|
|
4427
|
+
};
|
|
4428
|
+
/** Validate and commit the custom input; empty clears. */
|
|
4429
|
+
const applyCustom = (index) => {
|
|
4430
|
+
const key = String(index);
|
|
4431
|
+
const trimmed = (raw[key] ?? "").trim();
|
|
4432
|
+
if (trimmed === "") {
|
|
4433
|
+
commit(index, void 0);
|
|
4434
|
+
return;
|
|
4435
|
+
}
|
|
4436
|
+
const validation = validateContextWindow(trimmed);
|
|
4437
|
+
if (!validation.ok) {
|
|
4438
|
+
setErrors((cur) => ({
|
|
4439
|
+
...cur,
|
|
4440
|
+
[key]: t(validation.reason === "integer" ? "input.context.integer" : "input.context.range")
|
|
4441
|
+
}));
|
|
4442
|
+
return;
|
|
4443
|
+
}
|
|
4444
|
+
commit(index, validation.value);
|
|
4445
|
+
};
|
|
4446
|
+
const rows = [...models.map((entry, index) => ({
|
|
4447
|
+
label: String(entry["name"] ?? entry["id"] ?? index),
|
|
4448
|
+
index,
|
|
4449
|
+
value: contextWindowOf(entry)
|
|
4450
|
+
})), {
|
|
4451
|
+
label: t("model.panel.window"),
|
|
4452
|
+
index: -1,
|
|
4453
|
+
value: section.defaultContextWindow
|
|
4454
|
+
}];
|
|
4455
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4456
|
+
style: sectionStyle,
|
|
4457
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
4458
|
+
style: fieldLabelStyle,
|
|
4459
|
+
children: t("card.dsContextTitle")
|
|
4460
|
+
}), rows.map((row) => {
|
|
4461
|
+
const key = String(row.index);
|
|
4462
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4463
|
+
style: {
|
|
4464
|
+
display: "flex",
|
|
4465
|
+
gap: "8px",
|
|
4466
|
+
flexWrap: "wrap",
|
|
4467
|
+
alignItems: "center",
|
|
4468
|
+
margin: "6px 0"
|
|
4469
|
+
},
|
|
4470
|
+
children: [
|
|
4471
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4472
|
+
style: {
|
|
4473
|
+
...fieldLabelStyle,
|
|
4474
|
+
margin: 0
|
|
4475
|
+
},
|
|
4476
|
+
children: row.label
|
|
4477
|
+
}),
|
|
4478
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4479
|
+
style: badgeStyle,
|
|
4480
|
+
children: row.value === void 0 ? t("input.context.unset") : formatContextWindow(row.value)
|
|
4481
|
+
}),
|
|
4482
|
+
CONTEXT_WINDOW_PRESETS.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4483
|
+
type: "button",
|
|
4484
|
+
disabled: !writable,
|
|
4485
|
+
onClick: () => commit(row.index, preset.value),
|
|
4486
|
+
style: {
|
|
4487
|
+
...controlStyle,
|
|
4488
|
+
padding: "2px 8px",
|
|
4489
|
+
cursor: writable ? "pointer" : "default",
|
|
4490
|
+
opacity: writable ? 1 : .5
|
|
4491
|
+
},
|
|
4492
|
+
children: preset.label
|
|
4493
|
+
}, preset.value)),
|
|
4494
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4495
|
+
type: "text",
|
|
4496
|
+
inputMode: "numeric",
|
|
4497
|
+
value: raw[key] ?? "",
|
|
4498
|
+
disabled: !writable,
|
|
4499
|
+
placeholder: t("card.capabilities.contextCustomPlaceholder"),
|
|
4500
|
+
style: {
|
|
4501
|
+
...controlStyle,
|
|
4502
|
+
width: "120px"
|
|
4503
|
+
},
|
|
4504
|
+
onChange: (event) => setRaw((cur) => ({
|
|
4505
|
+
...cur,
|
|
4506
|
+
[key]: event.currentTarget.value
|
|
4507
|
+
})),
|
|
4508
|
+
onKeyDown: (event) => {
|
|
4509
|
+
if (event.key === "Enter") applyCustom(row.index);
|
|
4510
|
+
}
|
|
4511
|
+
}),
|
|
4512
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
4513
|
+
type: "button",
|
|
4514
|
+
disabled: !writable || row.value === void 0,
|
|
4515
|
+
onClick: () => commit(row.index, void 0),
|
|
4516
|
+
style: {
|
|
4517
|
+
...controlStyle,
|
|
4518
|
+
padding: "2px 8px"
|
|
4519
|
+
},
|
|
4520
|
+
children: t("input.context.clear")
|
|
4521
|
+
}),
|
|
4522
|
+
errors[key] !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4523
|
+
style: {
|
|
4524
|
+
fontSize: "12px",
|
|
4525
|
+
color: "var(--dsw-alias-danger, #e5484d)"
|
|
4526
|
+
},
|
|
4527
|
+
children: errors[key]
|
|
4528
|
+
})
|
|
4529
|
+
]
|
|
4530
|
+
}, key);
|
|
4531
|
+
})]
|
|
4532
|
+
});
|
|
4533
|
+
}
|
|
4534
|
+
/**
|
|
4231
4535
|
* The card body, wrapped in a disclosure shell like every peer settings card:
|
|
4232
4536
|
* a header (name + description + chevron) that toggles the body, expanded by
|
|
4233
4537
|
* default so the family section reads as an open page of drawers.
|
|
4234
4538
|
* @param props - locale copy and the injected scopes.
|
|
4235
4539
|
*/
|
|
4236
|
-
function ThinkingLevelsCard({ t, scope, piAiScope, ocScope }) {
|
|
4540
|
+
function ThinkingLevelsCard({ t, scope, piAiScope, ocScope, deepseekScope }) {
|
|
4237
4541
|
const [open, setOpen] = (0, react.useState)(true);
|
|
4238
4542
|
const subscribe = (0, react.useCallback)((listener) => scope.subscribe(listener), [scope]);
|
|
4239
4543
|
const getSnapshot = (0, react.useCallback)(() => scope.getSnapshot(), [scope]);
|
|
@@ -4397,6 +4701,24 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
4397
4701
|
}
|
|
4398
4702
|
})]
|
|
4399
4703
|
}),
|
|
4704
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4705
|
+
style: rowStyle,
|
|
4706
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
4707
|
+
htmlFor: "plugin-config-thinking-levels-takeover-ui",
|
|
4708
|
+
style: labelStyle,
|
|
4709
|
+
title: t("card.takeoverUiHint"),
|
|
4710
|
+
children: t("card.takeoverUi")
|
|
4711
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
4712
|
+
id: "plugin-config-thinking-levels-takeover-ui",
|
|
4713
|
+
type: "checkbox",
|
|
4714
|
+
checked: viewValue.takeoverUi ?? false,
|
|
4715
|
+
disabled: readonly,
|
|
4716
|
+
title: t("card.takeoverUiHint"),
|
|
4717
|
+
onChange: (event) => {
|
|
4718
|
+
writeTl("takeoverUi", event.currentTarget.checked);
|
|
4719
|
+
}
|
|
4720
|
+
})]
|
|
4721
|
+
}),
|
|
4400
4722
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4401
4723
|
style: rowStyle,
|
|
4402
4724
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
@@ -4473,6 +4795,11 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
4473
4795
|
tlScope: scope,
|
|
4474
4796
|
t,
|
|
4475
4797
|
readonly
|
|
4798
|
+
}),
|
|
4799
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DeepSeekContextSection, {
|
|
4800
|
+
scope: deepseekScope,
|
|
4801
|
+
t,
|
|
4802
|
+
readonly
|
|
4476
4803
|
})
|
|
4477
4804
|
] })
|
|
4478
4805
|
}) : null]
|
|
@@ -4519,7 +4846,7 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
4519
4846
|
return polled;
|
|
4520
4847
|
}
|
|
4521
4848
|
function FamilySettingsSection(props) {
|
|
4522
|
-
const { t: tHost, renderSlot, scope, piAiScope, ocScope } = props;
|
|
4849
|
+
const { t: tHost, renderSlot, scope, piAiScope, ocScope, deepseekScope } = props;
|
|
4523
4850
|
const t = tHost ?? props.tFallback ?? ((key) => key);
|
|
4524
4851
|
const contributors = useContributorTabs(props, props.hooks?.tabs);
|
|
4525
4852
|
const [activeId, setActiveId] = (0, react.useState)(OWN_TAB_ID);
|
|
@@ -4569,7 +4896,8 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
4569
4896
|
t,
|
|
4570
4897
|
scope,
|
|
4571
4898
|
piAiScope,
|
|
4572
|
-
ocScope
|
|
4899
|
+
ocScope,
|
|
4900
|
+
deepseekScope
|
|
4573
4901
|
}) : renderSlot ? renderSlot("dsh-family.tab", {}, {
|
|
4574
4902
|
only: active,
|
|
4575
4903
|
fallback: null
|
|
@@ -4692,6 +5020,9 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
4692
5020
|
const directories = scope.modelDirectories;
|
|
4693
5021
|
if (directories === void 0) return;
|
|
4694
5022
|
ctx.slots.inject("conversation.input.model", function* () {
|
|
5023
|
+
const tlHandle = scopeOf === void 0 ? void 0 : tlSettingsScopeOf(scopeOf);
|
|
5024
|
+
const tlSnap = typeof tlHandle?.getSnapshot === "function" ? tlHandle.getSnapshot() : void 0;
|
|
5025
|
+
if (!(tlSnap?.status === "ready" && tlSnap.value?.takeoverUi === true)) return;
|
|
4695
5026
|
yield ctx.slots.register({
|
|
4696
5027
|
name: "conversation.input.model",
|
|
4697
5028
|
id: "context-window-model-panel",
|
|
@@ -4707,7 +5038,8 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
4707
5038
|
return {
|
|
4708
5039
|
directory,
|
|
4709
5040
|
piAiScope: scopeOf?.("llm-pi-ai"),
|
|
4710
|
-
deepseekScope: scopeOf?.("llm-deepseek")
|
|
5041
|
+
deepseekScope: scopeOf?.("llm-deepseek"),
|
|
5042
|
+
tlScope: scopeOf === void 0 ? void 0 : tlSettingsScopeOf(scopeOf)
|
|
4711
5043
|
};
|
|
4712
5044
|
}
|
|
4713
5045
|
}, ModelPanel);
|
|
@@ -4740,6 +5072,7 @@ body:not([data-ds-dark-theme]) .${ZONE_CLASS}[data-top="1"] .${TRACK_CLASS} { an
|
|
|
4740
5072
|
const sectionInjected = () => ({
|
|
4741
5073
|
scope: tlSettingsScopeOf(scopeOf),
|
|
4742
5074
|
piAiScope: scopeOf("llm-pi-ai"),
|
|
5075
|
+
deepseekScope: scopeOf("llm-deepseek"),
|
|
4743
5076
|
ocScope: ocTransportScopeOf(scopeOf),
|
|
4744
5077
|
tFallback: t,
|
|
4745
5078
|
renderContributor,
|