dsh-plugin-lark-bridge 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -63
- package/dist/bridge.d.ts +15 -3
- package/dist/bridge.d.ts.map +1 -1
- package/dist/client/config-form.d.ts +10 -2
- package/dist/client/config-form.d.ts.map +1 -1
- package/dist/client/config-page.d.ts +8 -0
- package/dist/client/config-page.d.ts.map +1 -1
- package/dist/client/index.d.ts +3 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/locales.d.ts +15 -1
- package/dist/client/locales.d.ts.map +1 -1
- package/dist/client/model-defaults.d.ts +49 -0
- package/dist/client/model-defaults.d.ts.map +1 -0
- package/dist/client/preset-defaults.d.ts +84 -0
- package/dist/client/preset-defaults.d.ts.map +1 -0
- package/dist/client/preset-select.d.ts +26 -0
- package/dist/client/preset-select.d.ts.map +1 -0
- package/dist/client.js +1244 -21
- package/dist/config.d.ts +20 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/constants.d.ts +7 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +432 -90
- package/dist/quote.d.ts +49 -0
- package/dist/quote.d.ts.map +1 -0
- package/dist/reminder.d.ts +1 -1
- package/dist/reminder.d.ts.map +1 -1
- package/dist/sessions.d.ts +10 -4
- package/dist/sessions.d.ts.map +1 -1
- package/dist/tools.d.ts +1 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/utils.d.ts +2 -0
- package/dist/utils.d.ts.map +1 -1
- package/icon.svg +9 -0
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +30 -19
package/dist/client.js
CHANGED
|
@@ -7,6 +7,8 @@ window.__ModuleLoader__.load({
|
|
|
7
7
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
8
8
|
let react = require("react");
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
let react_dom = require("react-dom");
|
|
11
|
+
let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
|
|
10
12
|
//#region src/workspace-path.ts
|
|
11
13
|
/** 工作区路径:统一 Linux 风格表示、平台比较与 Host 原生路径转换。 */
|
|
12
14
|
/** 判断原始或归一化路径是否使用 Windows 语义。 */
|
|
@@ -391,6 +393,811 @@ window.__ModuleLoader__.load({
|
|
|
391
393
|
padding: 0
|
|
392
394
|
};
|
|
393
395
|
//#endregion
|
|
396
|
+
//#region node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
397
|
+
function r(e) {
|
|
398
|
+
var t, f, n = "";
|
|
399
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
400
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
401
|
+
var o = e.length;
|
|
402
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
403
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
404
|
+
return n;
|
|
405
|
+
}
|
|
406
|
+
function clsx() {
|
|
407
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
408
|
+
return n;
|
|
409
|
+
}
|
|
410
|
+
//#endregion
|
|
411
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-client-ui-model-selection@0.2.2-rc.5_@deepseek-ai+cordis@4.1.0/node_modules/@deepseek-ai/dsh-client-ui-model-selection/src/client/ModelSelect.module.css
|
|
412
|
+
var ModelSelect_module_default = {
|
|
413
|
+
"badge": "KofATW_badge",
|
|
414
|
+
"badgedName": "KofATW_badgedName",
|
|
415
|
+
"badgedNameText": "KofATW_badgedNameText",
|
|
416
|
+
"cell": "KofATW_cell",
|
|
417
|
+
"cellChevron": "KofATW_cellChevron",
|
|
418
|
+
"cellLabel": "KofATW_cellLabel",
|
|
419
|
+
"cellValue": "KofATW_cellValue",
|
|
420
|
+
"check": "KofATW_check",
|
|
421
|
+
"chevron": "KofATW_chevron",
|
|
422
|
+
"chevronOpen": "KofATW_chevronOpen",
|
|
423
|
+
"empty": "KofATW_empty",
|
|
424
|
+
"error": "KofATW_error",
|
|
425
|
+
"groups": "KofATW_groups",
|
|
426
|
+
"menu": "KofATW_menu",
|
|
427
|
+
"modelName": "KofATW_modelName",
|
|
428
|
+
"modelOption": "KofATW_modelOption",
|
|
429
|
+
"option": "KofATW_option",
|
|
430
|
+
"optionActive": "KofATW_optionActive",
|
|
431
|
+
"optionCopy": "KofATW_optionCopy",
|
|
432
|
+
"retry": "KofATW_retry",
|
|
433
|
+
"root": "KofATW_root",
|
|
434
|
+
"search": "KofATW_search",
|
|
435
|
+
"searchClear": "KofATW_searchClear",
|
|
436
|
+
"searchRow": "KofATW_searchRow",
|
|
437
|
+
"searchWithQuery": "KofATW_searchWithQuery",
|
|
438
|
+
"selected": "KofATW_selected",
|
|
439
|
+
"status": "KofATW_status",
|
|
440
|
+
"trigger": "KofATW_trigger",
|
|
441
|
+
"triggerEffort": "KofATW_triggerEffort",
|
|
442
|
+
"triggerIcon": "KofATW_triggerIcon",
|
|
443
|
+
"triggerLabel": "KofATW_triggerLabel",
|
|
444
|
+
"warning": "KofATW_warning"
|
|
445
|
+
};
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-client-ui-model-selection@0.2.2-rc.5_@deepseek-ai+cordis@4.1.0/node_modules/@deepseek-ai/dsh-client-ui-model-selection/src/client/provider-order.ts
|
|
448
|
+
/** Shared provider display order for the composer and command model pickers. */
|
|
449
|
+
/**
|
|
450
|
+
* Put the account and official providers first, preserving every other relative order.
|
|
451
|
+
* @param groups - Provider groups in catalog order.
|
|
452
|
+
* @returns a sorted copy; model order within each group is unchanged.
|
|
453
|
+
*/
|
|
454
|
+
function orderModelProviders(groups) {
|
|
455
|
+
return groups.toSorted((left, right) => (left.id === "deepseek-account" ? 0 : left.id === "deepseek-official" ? 1 : 2) - (right.id === "deepseek-account" ? 0 : right.id === "deepseek-official" ? 1 : 2));
|
|
456
|
+
}
|
|
457
|
+
//#endregion
|
|
458
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-client-ui-model-selection@0.2.2-rc.5_@deepseek-ai+cordis@4.1.0/node_modules/@deepseek-ai/dsh-client-ui-model-selection/src/client/ModelSelect.tsx
|
|
459
|
+
/**
|
|
460
|
+
* ModelSelect: the composer's named model seat (`conversation.input.model`).
|
|
461
|
+
* Two-level selection per figma 496:26454's MenuDropdown: the root menu is
|
|
462
|
+
* the Model / Effort row pair (label + current value + a right chevron),
|
|
463
|
+
* each drilling into its own list — the provider-grouped model list over
|
|
464
|
+
* the shared directory, and the effort levels. The trigger (313:14108's
|
|
465
|
+
* ToggleButton) shows both: model name + effort in the caption tone.
|
|
466
|
+
* Model catalogs above four entries show search, which retains focus while
|
|
467
|
+
* ↑/↓ cycle the highlighted result; Enter and Tab accept it. Smaller model
|
|
468
|
+
* catalogs, root panes, and effort panes move focus between rows. Escape and Shift+Tab leave a drilled pane first and otherwise close
|
|
469
|
+
* back to the trigger. A drilled pane focuses the current effort or model
|
|
470
|
+
* search field. Provider headings paint their background only while pinned
|
|
471
|
+
* by scrolling. Clearing a query restores the full list and search focus.
|
|
472
|
+
* Selecting restores trigger focus without a ring until the trigger loses focus
|
|
473
|
+
* or the menu reopens. Mobile devices restore button focus when opening or
|
|
474
|
+
* drilling; model search takes focus only after explicit user input.
|
|
475
|
+
* Model names match a case-insensitive ordered subsequence
|
|
476
|
+
* within each provider group, ranked by
|
|
477
|
+
* prefix, alignment score, then catalog order. Returning to the root pane
|
|
478
|
+
* hands focus back to the cell that opened it. Data and submission ride the
|
|
479
|
+
* same per-session ModelDirectory as the /model popup; exact-model reasoning
|
|
480
|
+
* metadata and the selected effort come from the Host rather than a
|
|
481
|
+
* client-owned vocabulary. A rejected selection announces through the shared
|
|
482
|
+
* transient Toast anchored to the composer card; the in-menu strip with
|
|
483
|
+
* Retry remains the catalog-load surface. While the directory's pending
|
|
484
|
+
* selection is unsettled, the trigger shows a spinner in place of its
|
|
485
|
+
* chevron, and each row whose value that selection carries shows one in place
|
|
486
|
+
* of its check mark.
|
|
487
|
+
*/
|
|
488
|
+
/**
|
|
489
|
+
* Render the composer model seat.
|
|
490
|
+
* @param props - owner share (locked) + injected face (shared directory
|
|
491
|
+
* store/verbs) + the standard locale seat.
|
|
492
|
+
* @returns the trigger and, while open, the two-level menu.
|
|
493
|
+
*/
|
|
494
|
+
function ModelSelect({ locked, available, directory, load, select, resolveText, t, renderSlot }) {
|
|
495
|
+
const state = (0, react.useSyncExternalStore)((fn) => directory.subscribe(fn), () => directory.getSnapshot());
|
|
496
|
+
const [open, setOpen] = (0, react.useState)(false);
|
|
497
|
+
const [pane, setPane] = (0, react.useState)("root");
|
|
498
|
+
const [query, setQuery] = (0, react.useState)("");
|
|
499
|
+
const [highlightedIndex, setHighlightedIndex] = (0, react.useState)(null);
|
|
500
|
+
const [selectionFocus, setSelectionFocus] = (0, react.useState)(false);
|
|
501
|
+
const lastActionRef = (0, react.useRef)("load");
|
|
502
|
+
const [toast, setToast] = (0, react.useState)(null);
|
|
503
|
+
const toastSeq = (0, react.useRef)(0);
|
|
504
|
+
const rootRef = (0, react.useRef)(null);
|
|
505
|
+
const triggerRef = (0, react.useRef)(null);
|
|
506
|
+
const searchRef = (0, react.useRef)(null);
|
|
507
|
+
const menuRef = (0, react.useRef)(null);
|
|
508
|
+
const groupsRef = (0, react.useRef)(null);
|
|
509
|
+
const itemRefs = (0, react.useRef)([]);
|
|
510
|
+
const id = (0, react.useId)();
|
|
511
|
+
const anchorStyle = { "--dsh-model-anchor": `--dsh-model-${id.replaceAll(":", "")}` };
|
|
512
|
+
const accountProviderName = t("provider.account");
|
|
513
|
+
const groups = (0, react.useMemo)(() => orderModelProviders(state.groups).map((group) => ({
|
|
514
|
+
...group,
|
|
515
|
+
provider: {
|
|
516
|
+
id: group.id,
|
|
517
|
+
name: group.id === "deepseek-account" ? accountProviderName : group.name
|
|
518
|
+
}
|
|
519
|
+
})), [state.groups, accountProviderName]);
|
|
520
|
+
const choices = (0, react.useMemo)(() => groups.flatMap((group) => group.models.map((model) => ({
|
|
521
|
+
group,
|
|
522
|
+
model,
|
|
523
|
+
selection: {
|
|
524
|
+
provider: group.id,
|
|
525
|
+
model: model.id,
|
|
526
|
+
...model.reasoning?.defaultEffort === void 0 ? {} : { reasoningEffort: model.reasoning.defaultEffort }
|
|
527
|
+
}
|
|
528
|
+
}))), [groups]);
|
|
529
|
+
const showSearch = choices.length > 4;
|
|
530
|
+
const filteredGroups = (0, react.useMemo)(() => groups.map((group) => ({
|
|
531
|
+
...group,
|
|
532
|
+
models: (0, _deepseek_ai_dsh_client_ui_primitives.rankByName)(group.models, showSearch ? query.trim() : "")
|
|
533
|
+
})).filter((group) => group.models.length > 0), [
|
|
534
|
+
groups,
|
|
535
|
+
query,
|
|
536
|
+
showSearch
|
|
537
|
+
]);
|
|
538
|
+
const visibleModels = (0, react.useMemo)(() => filteredGroups.flatMap((group) => group.models.map((model) => ({
|
|
539
|
+
provider: group.id,
|
|
540
|
+
model: model.id
|
|
541
|
+
}))), [filteredGroups]);
|
|
542
|
+
const currentVisibleIndex = visibleModels.findIndex((model) => model.provider === state.current?.provider && model.model === state.current.model);
|
|
543
|
+
const activeModelIndex = Math.min(highlightedIndex ?? Math.max(0, currentVisibleIndex), visibleModels.length - 1);
|
|
544
|
+
const currentChoice = choices[state.current === null ? -1 : choices.findIndex((c) => c.selection.provider === state.current?.provider && c.selection.model === state.current.model)];
|
|
545
|
+
const reasoning = currentChoice?.model.reasoning;
|
|
546
|
+
const effectiveEffort = state.current?.reasoningEffort ?? reasoning?.defaultEffort;
|
|
547
|
+
const effortLabel = currentChoice === void 0 ? void 0 : reasoning === void 0 ? state.retainedEffort : effectiveEffort === void 0 ? t("effort.providerDefault") : reasoning.efforts.find((level) => level.id === effectiveEffort)?.name ?? effectiveEffort;
|
|
548
|
+
const effortChoices = (0, react.useMemo)(() => reasoning === void 0 ? [] : [...reasoning.defaultEffort === void 0 ? [{
|
|
549
|
+
key: "provider-default",
|
|
550
|
+
effort: void 0,
|
|
551
|
+
label: t("effort.providerDefault")
|
|
552
|
+
}] : [], ...reasoning.efforts.map((effort) => ({
|
|
553
|
+
key: `effort:${effort.id}`,
|
|
554
|
+
effort: effort.id,
|
|
555
|
+
label: effort.name
|
|
556
|
+
}))], [reasoning, t]);
|
|
557
|
+
const { pending } = state;
|
|
558
|
+
const busy = pending !== null;
|
|
559
|
+
const reload = () => {
|
|
560
|
+
lastActionRef.current = "load";
|
|
561
|
+
load();
|
|
562
|
+
};
|
|
563
|
+
(0, react.useEffect)(() => {
|
|
564
|
+
if (!open) return;
|
|
565
|
+
const closeOutside = (event) => {
|
|
566
|
+
if (rootRef.current?.contains(event.target) === true) return;
|
|
567
|
+
if (menuRef.current?.contains(event.target) === true) return;
|
|
568
|
+
setOpen(false);
|
|
569
|
+
};
|
|
570
|
+
document.addEventListener("mousedown", closeOutside);
|
|
571
|
+
return () => {
|
|
572
|
+
document.removeEventListener("mousedown", closeOutside);
|
|
573
|
+
};
|
|
574
|
+
}, [open]);
|
|
575
|
+
(0, react.useLayoutEffect)(() => {
|
|
576
|
+
if (!showSearch) {
|
|
577
|
+
setQuery("");
|
|
578
|
+
setHighlightedIndex(null);
|
|
579
|
+
}
|
|
580
|
+
}, [showSearch]);
|
|
581
|
+
const paneFocus = (0, react.useRef)(null);
|
|
582
|
+
const previousShowSearch = (0, react.useRef)(showSearch);
|
|
583
|
+
(0, react.useEffect)(() => {
|
|
584
|
+
const changedSearchMode = previousShowSearch.current !== showSearch;
|
|
585
|
+
previousShowSearch.current = showSearch;
|
|
586
|
+
const intent = paneFocus.current ?? (changedSearchMode && pane === "model" ? "drill" : null);
|
|
587
|
+
paneFocus.current = null;
|
|
588
|
+
if (!open || intent === null) return;
|
|
589
|
+
if (intent === "drill") {
|
|
590
|
+
if (pane === "model" && showSearch && !(0, _deepseek_ai_dsh_client_ui_primitives.isMobileDevice)()) {
|
|
591
|
+
searchRef.current?.focus();
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
(menuRef.current?.querySelector("[role=\"menuitemradio\"][aria-checked=\"true\"]:not([disabled])") ?? itemRefs.current.find((item) => item !== null && !item.disabled) ?? triggerRef.current)?.focus();
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
const cell = itemRefs.current[intent === "effort" ? 1 : 0];
|
|
598
|
+
(cell !== null && cell !== void 0 && !cell.disabled ? cell : triggerRef.current)?.focus();
|
|
599
|
+
}, [
|
|
600
|
+
open,
|
|
601
|
+
pane,
|
|
602
|
+
showSearch
|
|
603
|
+
]);
|
|
604
|
+
(0, react.useEffect)(() => {
|
|
605
|
+
const viewport = groupsRef.current;
|
|
606
|
+
if (viewport === null) return;
|
|
607
|
+
return (0, _deepseek_ai_dsh_client_ui_primitives.observeStickyMenuGroups)(viewport);
|
|
608
|
+
}, [
|
|
609
|
+
available,
|
|
610
|
+
open,
|
|
611
|
+
pane,
|
|
612
|
+
filteredGroups
|
|
613
|
+
]);
|
|
614
|
+
(0, react.useLayoutEffect)(() => {
|
|
615
|
+
if (open && pane === "model" && activeModelIndex >= 0) itemRefs.current[activeModelIndex]?.scrollIntoView({ block: "nearest" });
|
|
616
|
+
}, [
|
|
617
|
+
open,
|
|
618
|
+
pane,
|
|
619
|
+
activeModelIndex,
|
|
620
|
+
visibleModels
|
|
621
|
+
]);
|
|
622
|
+
if (!available) return null;
|
|
623
|
+
const show = () => {
|
|
624
|
+
setSelectionFocus(false);
|
|
625
|
+
triggerRef.current?.focus();
|
|
626
|
+
setQuery("");
|
|
627
|
+
setHighlightedIndex(null);
|
|
628
|
+
if (currentChoice === void 0) paneFocus.current = "drill";
|
|
629
|
+
setPane(currentChoice === void 0 ? "model" : "root");
|
|
630
|
+
setOpen(true);
|
|
631
|
+
reload();
|
|
632
|
+
};
|
|
633
|
+
const changeQuery = (next) => {
|
|
634
|
+
setQuery(next);
|
|
635
|
+
setHighlightedIndex(0);
|
|
636
|
+
};
|
|
637
|
+
const close = (restoreFocus = false) => {
|
|
638
|
+
setOpen(false);
|
|
639
|
+
setPane("root");
|
|
640
|
+
if (restoreFocus) queueMicrotask(() => {
|
|
641
|
+
triggerRef.current?.focus();
|
|
642
|
+
});
|
|
643
|
+
};
|
|
644
|
+
const closeAfterSelection = () => {
|
|
645
|
+
setSelectionFocus(true);
|
|
646
|
+
close(true);
|
|
647
|
+
};
|
|
648
|
+
const drill = (next) => {
|
|
649
|
+
setQuery("");
|
|
650
|
+
setHighlightedIndex(null);
|
|
651
|
+
paneFocus.current = "drill";
|
|
652
|
+
setPane(next);
|
|
653
|
+
};
|
|
654
|
+
/** Leave a drilled pane for the root one, handing the keyboard back to its cell. */
|
|
655
|
+
const back = (from) => {
|
|
656
|
+
paneFocus.current = from;
|
|
657
|
+
setPane("root");
|
|
658
|
+
};
|
|
659
|
+
const moveFocus = (offset) => {
|
|
660
|
+
const items = Array.from(menuRef.current?.querySelectorAll("button[role=\"menuitem\"]:not([disabled]), button[role=\"menuitemradio\"]:not([disabled]), button[role=\"switch\"]:not([disabled])") ?? []);
|
|
661
|
+
if (items.length === 0) return;
|
|
662
|
+
const active = items.findIndex((item) => item === document.activeElement);
|
|
663
|
+
items[active === -1 ? offset > 0 ? 0 : items.length - 1 : (active + offset + items.length) % items.length]?.focus();
|
|
664
|
+
};
|
|
665
|
+
const onRootKeyDown = (event) => {
|
|
666
|
+
if (event.nativeEvent.isComposing) return;
|
|
667
|
+
if (event.key === "Escape" && open) {
|
|
668
|
+
event.preventDefault();
|
|
669
|
+
if (pane !== "root" && currentChoice !== void 0) back(pane);
|
|
670
|
+
else close(true);
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
if (!open) return;
|
|
674
|
+
if (pane === "model" && showSearch && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
675
|
+
event.preventDefault();
|
|
676
|
+
if (!busy && visibleModels.length > 0) {
|
|
677
|
+
const direction = event.key === "ArrowDown" ? 1 : -1;
|
|
678
|
+
setHighlightedIndex((activeModelIndex + direction + visibleModels.length) % visibleModels.length);
|
|
679
|
+
searchRef.current?.focus();
|
|
680
|
+
}
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
if (pane === "model" && showSearch && event.target instanceof HTMLInputElement && (event.key === "Enter" || event.key === "Tab" && !event.shiftKey)) {
|
|
684
|
+
if (event.key === "Tab" && visibleModels.length === 0) return;
|
|
685
|
+
event.preventDefault();
|
|
686
|
+
const highlighted = visibleModels[activeModelIndex];
|
|
687
|
+
if (!busy && highlighted !== void 0) choose(highlighted);
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
if (event.key === "Tab") {
|
|
691
|
+
if (event.shiftKey) {
|
|
692
|
+
event.preventDefault();
|
|
693
|
+
if (pane !== "root" && currentChoice !== void 0) back(pane);
|
|
694
|
+
else close(true);
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
const focused = document.activeElement;
|
|
698
|
+
const rows = Array.from(menuRef.current?.querySelectorAll("button[role=\"menuitem\"]:not([disabled]), button[role=\"menuitemradio\"]:not([disabled]), button[role=\"switch\"]:not([disabled])") ?? []);
|
|
699
|
+
if (focused instanceof HTMLButtonElement && rows.includes(focused)) {
|
|
700
|
+
event.preventDefault();
|
|
701
|
+
focused.click();
|
|
702
|
+
return;
|
|
703
|
+
}
|
|
704
|
+
if (focused !== triggerRef.current) return;
|
|
705
|
+
event.preventDefault();
|
|
706
|
+
if (pane === "model" && showSearch) {
|
|
707
|
+
setHighlightedIndex(null);
|
|
708
|
+
searchRef.current?.focus();
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
(menuRef.current?.querySelector("[role=\"menuitemradio\"][aria-checked=\"true\"]:not([disabled])") ?? rows.find((item) => !item.disabled))?.focus();
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
715
|
+
event.preventDefault();
|
|
716
|
+
moveFocus(event.key === "ArrowDown" ? 1 : -1);
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
const onBlur = (event) => {
|
|
720
|
+
if (event.relatedTarget instanceof Node && (rootRef.current?.contains(event.relatedTarget) === true || menuRef.current?.contains(event.relatedTarget) === true)) return;
|
|
721
|
+
close();
|
|
722
|
+
};
|
|
723
|
+
const settleSelection = (result) => {
|
|
724
|
+
if (result === void 0) return;
|
|
725
|
+
if (result.ok) {
|
|
726
|
+
if (rootRef.current !== null) closeAfterSelection();
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
const { error } = result;
|
|
730
|
+
toastSeq.current += 1;
|
|
731
|
+
setToast({
|
|
732
|
+
seq: toastSeq.current,
|
|
733
|
+
text: error.code === "session/writer-held" ? t("error.sessionInUse") : t("error.action", { message: `${error.code}: ${error.message}` })
|
|
734
|
+
});
|
|
735
|
+
};
|
|
736
|
+
const submit = (selection) => {
|
|
737
|
+
lastActionRef.current = "select";
|
|
738
|
+
setSelectionFocus(true);
|
|
739
|
+
triggerRef.current?.focus();
|
|
740
|
+
select(selection).then(settleSelection);
|
|
741
|
+
};
|
|
742
|
+
const choose = (selection) => {
|
|
743
|
+
if (state.current?.provider === selection.provider && state.current.model === selection.model) {
|
|
744
|
+
closeAfterSelection();
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
submit(selection);
|
|
748
|
+
};
|
|
749
|
+
const chooseEffort = (effort) => {
|
|
750
|
+
if (state.current === null) return;
|
|
751
|
+
if (effectiveEffort === effort) {
|
|
752
|
+
closeAfterSelection();
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
const selection = {
|
|
756
|
+
provider: state.current.provider,
|
|
757
|
+
model: state.current.model,
|
|
758
|
+
...effort === void 0 ? {} : { reasoningEffort: effort }
|
|
759
|
+
};
|
|
760
|
+
submit(selection);
|
|
761
|
+
};
|
|
762
|
+
const waiting = currentChoice === void 0 && state.status === "loading";
|
|
763
|
+
const modelLabel = waiting ? t("trigger.loading") : currentChoice?.model.name ?? t("trigger.fallback");
|
|
764
|
+
const triggerLabel = effortLabel === void 0 ? modelLabel : `${modelLabel} · ${effortLabel}`;
|
|
765
|
+
const triggerAria = waiting ? t("trigger.loading") : currentChoice === void 0 ? t("trigger.selectAria") : effortLabel === void 0 ? t("trigger.aria", { model: modelLabel }) : t("trigger.ariaEffort", {
|
|
766
|
+
model: modelLabel,
|
|
767
|
+
effort: effortLabel
|
|
768
|
+
});
|
|
769
|
+
const renderModelLabel = (provider, model, placement, selected) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
770
|
+
"data-provider-id": provider.id,
|
|
771
|
+
"data-model-id": model.id,
|
|
772
|
+
children: renderSlot("conversation.input.model.label", {
|
|
773
|
+
provider,
|
|
774
|
+
model,
|
|
775
|
+
placement,
|
|
776
|
+
selected
|
|
777
|
+
}, { fallback: model.badge === void 0 ? model.name : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
778
|
+
className: ModelSelect_module_default.badgedName,
|
|
779
|
+
children: [
|
|
780
|
+
placement === "trigger" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
|
|
781
|
+
className: ModelSelect_module_default.badge,
|
|
782
|
+
tone: model.badge.tone,
|
|
783
|
+
children: resolveText(model.badge.text)
|
|
784
|
+
}), " "] }) : null,
|
|
785
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
786
|
+
className: ModelSelect_module_default.badgedNameText,
|
|
787
|
+
children: model.name
|
|
788
|
+
}),
|
|
789
|
+
placement === "trigger" ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [" ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
|
|
790
|
+
className: ModelSelect_module_default.badge,
|
|
791
|
+
tone: model.badge.tone,
|
|
792
|
+
children: resolveText(model.badge.text)
|
|
793
|
+
})] })
|
|
794
|
+
]
|
|
795
|
+
}) })
|
|
796
|
+
});
|
|
797
|
+
let itemIndex = 0;
|
|
798
|
+
let modelIndex = 0;
|
|
799
|
+
const itemRef = () => {
|
|
800
|
+
const at = itemIndex++;
|
|
801
|
+
return (node) => {
|
|
802
|
+
itemRefs.current[at] = node;
|
|
803
|
+
};
|
|
804
|
+
};
|
|
805
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
806
|
+
ref: rootRef,
|
|
807
|
+
className: ModelSelect_module_default.root,
|
|
808
|
+
onKeyDown: onRootKeyDown,
|
|
809
|
+
onBlur,
|
|
810
|
+
onMouseDown: (event) => {
|
|
811
|
+
if (event.target instanceof Element && event.target.closest("button") !== null) event.preventDefault();
|
|
812
|
+
},
|
|
813
|
+
children: [
|
|
814
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
815
|
+
ref: triggerRef,
|
|
816
|
+
type: "button",
|
|
817
|
+
className: ModelSelect_module_default.trigger,
|
|
818
|
+
style: anchorStyle,
|
|
819
|
+
"aria-label": triggerAria,
|
|
820
|
+
"aria-haspopup": "menu",
|
|
821
|
+
"aria-expanded": open,
|
|
822
|
+
"aria-controls": open ? `${id}-menu` : void 0,
|
|
823
|
+
title: triggerLabel,
|
|
824
|
+
"aria-busy": busy,
|
|
825
|
+
"data-selection-focus": selectionFocus ? "" : void 0,
|
|
826
|
+
onBlur: () => {
|
|
827
|
+
setSelectionFocus(false);
|
|
828
|
+
},
|
|
829
|
+
disabled: locked,
|
|
830
|
+
onClick: () => {
|
|
831
|
+
if (open) close(true);
|
|
832
|
+
else show();
|
|
833
|
+
},
|
|
834
|
+
children: [
|
|
835
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconDataOutlineRegular, {
|
|
836
|
+
className: ModelSelect_module_default.triggerIcon,
|
|
837
|
+
size: 16
|
|
838
|
+
}),
|
|
839
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
840
|
+
className: ModelSelect_module_default.triggerLabel,
|
|
841
|
+
children: currentChoice === void 0 ? modelLabel : renderModelLabel(currentChoice.group.provider, currentChoice.model, "trigger", true)
|
|
842
|
+
}),
|
|
843
|
+
effortLabel !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
844
|
+
className: ModelSelect_module_default.triggerEffort,
|
|
845
|
+
children: effortLabel
|
|
846
|
+
}),
|
|
847
|
+
busy ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: "ongoing" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, { className: clsx(ModelSelect_module_default.chevron, open && ModelSelect_module_default.chevronOpen) })
|
|
848
|
+
]
|
|
849
|
+
}),
|
|
850
|
+
open && (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.MenuSurface, {
|
|
851
|
+
ref: menuRef,
|
|
852
|
+
id: `${id}-menu`,
|
|
853
|
+
className: ModelSelect_module_default.menu,
|
|
854
|
+
style: anchorStyle,
|
|
855
|
+
role: pane === "model" ? "group" : "menu",
|
|
856
|
+
"aria-label": t("menu.aria"),
|
|
857
|
+
"aria-busy": state.status === "loading" || busy,
|
|
858
|
+
children: [
|
|
859
|
+
pane === "root" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
860
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
861
|
+
ref: itemRef(),
|
|
862
|
+
type: "button",
|
|
863
|
+
role: "menuitem",
|
|
864
|
+
className: ModelSelect_module_default.cell,
|
|
865
|
+
onClick: () => {
|
|
866
|
+
drill("model");
|
|
867
|
+
},
|
|
868
|
+
children: [
|
|
869
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
870
|
+
className: ModelSelect_module_default.cellLabel,
|
|
871
|
+
children: t("menu.model")
|
|
872
|
+
}),
|
|
873
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
874
|
+
className: ModelSelect_module_default.cellValue,
|
|
875
|
+
children: currentChoice === void 0 ? modelLabel : renderModelLabel(currentChoice.group.provider, currentChoice.model, "menu", true)
|
|
876
|
+
}),
|
|
877
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutlineRegular, { className: ModelSelect_module_default.cellChevron })
|
|
878
|
+
]
|
|
879
|
+
}),
|
|
880
|
+
reasoning !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
881
|
+
ref: itemRef(),
|
|
882
|
+
type: "button",
|
|
883
|
+
role: "menuitem",
|
|
884
|
+
className: ModelSelect_module_default.cell,
|
|
885
|
+
onClick: () => {
|
|
886
|
+
drill("effort");
|
|
887
|
+
},
|
|
888
|
+
children: [
|
|
889
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
890
|
+
className: ModelSelect_module_default.cellLabel,
|
|
891
|
+
children: t("menu.effort")
|
|
892
|
+
}),
|
|
893
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
894
|
+
className: ModelSelect_module_default.cellValue,
|
|
895
|
+
children: effortLabel
|
|
896
|
+
}),
|
|
897
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutlineRegular, { className: ModelSelect_module_default.cellChevron })
|
|
898
|
+
]
|
|
899
|
+
}),
|
|
900
|
+
renderSlot("conversation.input.model.options", {
|
|
901
|
+
locked: locked || busy,
|
|
902
|
+
dismiss: () => {
|
|
903
|
+
close();
|
|
904
|
+
triggerRef.current?.focus();
|
|
905
|
+
},
|
|
906
|
+
reportFailure: (message) => {
|
|
907
|
+
setToast({
|
|
908
|
+
seq: ++toastSeq.current,
|
|
909
|
+
text: message
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
})
|
|
913
|
+
] }),
|
|
914
|
+
pane === "model" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
915
|
+
showSearch && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
916
|
+
className: ModelSelect_module_default.searchRow,
|
|
917
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
918
|
+
ref: searchRef,
|
|
919
|
+
className: clsx(ModelSelect_module_default.search, query !== "" && ModelSelect_module_default.searchWithQuery),
|
|
920
|
+
type: "text",
|
|
921
|
+
role: "searchbox",
|
|
922
|
+
"aria-label": t("search.placeholder"),
|
|
923
|
+
"aria-controls": `${id}-models`,
|
|
924
|
+
"aria-activedescendant": activeModelIndex < 0 ? void 0 : `${id}-model-${activeModelIndex}`,
|
|
925
|
+
placeholder: t("search.placeholder"),
|
|
926
|
+
value: query,
|
|
927
|
+
readOnly: busy,
|
|
928
|
+
onChange: (event) => {
|
|
929
|
+
changeQuery(event.target.value);
|
|
930
|
+
}
|
|
931
|
+
}), query !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
932
|
+
type: "button",
|
|
933
|
+
className: ModelSelect_module_default.searchClear,
|
|
934
|
+
"aria-label": t("search.clear"),
|
|
935
|
+
disabled: busy,
|
|
936
|
+
onClick: () => {
|
|
937
|
+
changeQuery("");
|
|
938
|
+
searchRef.current?.focus();
|
|
939
|
+
},
|
|
940
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseFillRegular, {})
|
|
941
|
+
})]
|
|
942
|
+
}),
|
|
943
|
+
state.status === "loading" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
944
|
+
className: ModelSelect_module_default.status,
|
|
945
|
+
children: t("status.loading")
|
|
946
|
+
}),
|
|
947
|
+
state.error !== null && lastActionRef.current === "load" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
948
|
+
className: ModelSelect_module_default.error,
|
|
949
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("error.action", { message: state.error }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
950
|
+
type: "button",
|
|
951
|
+
className: ModelSelect_module_default.retry,
|
|
952
|
+
onClick: reload,
|
|
953
|
+
children: t("retry")
|
|
954
|
+
})]
|
|
955
|
+
}),
|
|
956
|
+
state.failures.map((failure) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
957
|
+
className: ModelSelect_module_default.warning,
|
|
958
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("warning.groupLoad", {
|
|
959
|
+
name: failure.id === "deepseek-account" ? t("provider.account") : failure.name,
|
|
960
|
+
message: failure.message
|
|
961
|
+
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
962
|
+
type: "button",
|
|
963
|
+
className: ModelSelect_module_default.retry,
|
|
964
|
+
onClick: reload,
|
|
965
|
+
children: t("retry")
|
|
966
|
+
})]
|
|
967
|
+
}, failure.id)),
|
|
968
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
969
|
+
ref: groupsRef,
|
|
970
|
+
id: `${id}-models`,
|
|
971
|
+
className: clsx(ModelSelect_module_default.groups, "scrollable"),
|
|
972
|
+
role: "menu",
|
|
973
|
+
"aria-label": t("menu.model"),
|
|
974
|
+
hidden: filteredGroups.length === 0,
|
|
975
|
+
children: filteredGroups.map((group) => {
|
|
976
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MenuGroup, {
|
|
977
|
+
label: group.provider.name,
|
|
978
|
+
children: group.models.map((model) => {
|
|
979
|
+
const index = modelIndex++;
|
|
980
|
+
const selected = state.current?.provider === group.id && state.current.model === model.id;
|
|
981
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
982
|
+
ref: itemRef(),
|
|
983
|
+
type: "button",
|
|
984
|
+
role: "menuitemradio",
|
|
985
|
+
"aria-checked": selected,
|
|
986
|
+
id: `${id}-model-${index}`,
|
|
987
|
+
tabIndex: showSearch ? -1 : 0,
|
|
988
|
+
onFocus: () => {
|
|
989
|
+
setHighlightedIndex(index);
|
|
990
|
+
},
|
|
991
|
+
"data-highlighted": index === activeModelIndex ? "" : void 0,
|
|
992
|
+
className: clsx(ModelSelect_module_default.option, ModelSelect_module_default.modelOption, selected && ModelSelect_module_default.selected, index === activeModelIndex && ModelSelect_module_default.optionActive),
|
|
993
|
+
onMouseMove: busy || index === activeModelIndex ? void 0 : () => {
|
|
994
|
+
if (showSearch) setHighlightedIndex(index);
|
|
995
|
+
else itemRefs.current[index]?.focus();
|
|
996
|
+
},
|
|
997
|
+
title: model.name,
|
|
998
|
+
disabled: busy,
|
|
999
|
+
onClick: () => {
|
|
1000
|
+
choose({
|
|
1001
|
+
provider: group.id,
|
|
1002
|
+
model: model.id
|
|
1003
|
+
});
|
|
1004
|
+
},
|
|
1005
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1006
|
+
className: ModelSelect_module_default.optionCopy,
|
|
1007
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1008
|
+
className: ModelSelect_module_default.modelName,
|
|
1009
|
+
children: renderModelLabel(group.provider, model, "option", selected)
|
|
1010
|
+
})
|
|
1011
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1012
|
+
className: ModelSelect_module_default.check,
|
|
1013
|
+
children: pending?.provider === group.id && pending.model === model.id ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: "ongoing" }) : selected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutlineRegular, {}) : null
|
|
1014
|
+
})]
|
|
1015
|
+
}, model.id);
|
|
1016
|
+
})
|
|
1017
|
+
}, group.id);
|
|
1018
|
+
})
|
|
1019
|
+
}),
|
|
1020
|
+
state.status === "ready" && filteredGroups.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1021
|
+
className: ModelSelect_module_default.empty,
|
|
1022
|
+
role: "status",
|
|
1023
|
+
children: t(choices.length === 0 ? "empty.models" : "search.empty")
|
|
1024
|
+
})
|
|
1025
|
+
] }),
|
|
1026
|
+
pane === "effort" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [state.error !== null && lastActionRef.current === "load" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1027
|
+
className: ModelSelect_module_default.error,
|
|
1028
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("error.action", { message: state.error }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1029
|
+
type: "button",
|
|
1030
|
+
className: ModelSelect_module_default.retry,
|
|
1031
|
+
onClick: reload,
|
|
1032
|
+
children: t("action.reload")
|
|
1033
|
+
})]
|
|
1034
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1035
|
+
className: clsx(ModelSelect_module_default.groups, "scrollable"),
|
|
1036
|
+
children: effortChoices.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1037
|
+
className: ModelSelect_module_default.empty,
|
|
1038
|
+
children: t("empty.efforts")
|
|
1039
|
+
}) : effortChoices.map((level) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1040
|
+
ref: itemRef(),
|
|
1041
|
+
type: "button",
|
|
1042
|
+
role: "menuitemradio",
|
|
1043
|
+
"aria-checked": effectiveEffort === level.effort,
|
|
1044
|
+
className: clsx(ModelSelect_module_default.option, effectiveEffort === level.effort && ModelSelect_module_default.selected),
|
|
1045
|
+
disabled: busy,
|
|
1046
|
+
onClick: () => {
|
|
1047
|
+
chooseEffort(level.effort);
|
|
1048
|
+
},
|
|
1049
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1050
|
+
className: ModelSelect_module_default.optionCopy,
|
|
1051
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1052
|
+
className: ModelSelect_module_default.modelName,
|
|
1053
|
+
children: level.label
|
|
1054
|
+
})
|
|
1055
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1056
|
+
className: ModelSelect_module_default.check,
|
|
1057
|
+
children: pending !== null && pending.provider === state.current?.provider && pending.model === state.current.model && pending.reasoningEffort === level.effort ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: "ongoing" }) : effectiveEffort === level.effort ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutlineRegular, {}) : null
|
|
1058
|
+
})]
|
|
1059
|
+
}, level.key))
|
|
1060
|
+
})] })
|
|
1061
|
+
]
|
|
1062
|
+
}), document.body),
|
|
1063
|
+
toast !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Toast, {
|
|
1064
|
+
text: toast.text,
|
|
1065
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconWarningOutlineRegular, {}),
|
|
1066
|
+
anchor: rootRef.current?.closest("[data-composer-card]") ?? null,
|
|
1067
|
+
onDone: () => {
|
|
1068
|
+
setToast(null);
|
|
1069
|
+
}
|
|
1070
|
+
}, toast.seq)
|
|
1071
|
+
]
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
//#endregion
|
|
1075
|
+
//#region src/client/preset-select.tsx
|
|
1076
|
+
/**
|
|
1077
|
+
* 预设选择器:右侧 select 触发器,浮窗使用宿主自带 Menu。
|
|
1078
|
+
* 导出 PresetSelect、currentText 与 menuItems。
|
|
1079
|
+
*/
|
|
1080
|
+
/** 当前选择的显示文案。 */
|
|
1081
|
+
function currentText(state, t) {
|
|
1082
|
+
if (state.status === "loading") return t("config.sessionPreset.loading");
|
|
1083
|
+
if (state.status === "noService") return t("config.sessionPreset.noService");
|
|
1084
|
+
if (state.status === "error") return t("config.sessionPreset.loadFailed");
|
|
1085
|
+
if (state.current === "") return t("config.sessionPreset.followHost");
|
|
1086
|
+
const row = state.rows.find((entry) => entry.id === state.current);
|
|
1087
|
+
if (row === void 0) return `${state.current} · ${t("config.sessionPreset.unavailable")}`;
|
|
1088
|
+
const name = row.name?.trim();
|
|
1089
|
+
return name === void 0 || name === "" ? row.id : name;
|
|
1090
|
+
}
|
|
1091
|
+
/** 菜单项:先「跟随宿主默认」,再列出可用预设,不可用的已存值以禁用项补足。 */
|
|
1092
|
+
function menuItems(state, t) {
|
|
1093
|
+
const items = [{
|
|
1094
|
+
id: "",
|
|
1095
|
+
label: t("config.sessionPreset.followHost")
|
|
1096
|
+
}, ...state.rows.map((row) => ({
|
|
1097
|
+
id: row.id,
|
|
1098
|
+
label: row.name?.trim() || row.id
|
|
1099
|
+
}))];
|
|
1100
|
+
if (state.status === "ready" && state.current !== "" && !state.rows.some((row) => row.id === state.current)) items.push({
|
|
1101
|
+
id: state.current,
|
|
1102
|
+
label: `${state.current} · ${t("config.sessionPreset.unavailable")}`,
|
|
1103
|
+
disabled: true
|
|
1104
|
+
});
|
|
1105
|
+
return items;
|
|
1106
|
+
}
|
|
1107
|
+
/**
|
|
1108
|
+
* 渲染预设行右侧的选择控制。
|
|
1109
|
+
* @param props - 名册状态、选择动作、只读开关与字典。
|
|
1110
|
+
* @returns 触发器、可选的重试提示与浮窗菜单。
|
|
1111
|
+
*/
|
|
1112
|
+
function PresetSelect({ hooks, load, select, locked, t }) {
|
|
1113
|
+
const state = (0, react.useSyncExternalStore)((notify) => hooks.presetDefaults.subscribe(notify), () => hooks.presetDefaults.getSnapshot(), () => hooks.presetDefaults.getSnapshot());
|
|
1114
|
+
const [open, setOpen] = (0, react.useState)(false);
|
|
1115
|
+
const triggerRef = (0, react.useRef)(null);
|
|
1116
|
+
const editable = !locked && state.status === "ready";
|
|
1117
|
+
(0, react.useEffect)(() => {
|
|
1118
|
+
load();
|
|
1119
|
+
}, [load]);
|
|
1120
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
|
|
1121
|
+
open,
|
|
1122
|
+
anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1123
|
+
ref: triggerRef,
|
|
1124
|
+
type: "button",
|
|
1125
|
+
"data-dsh-lark-preset-trigger": true,
|
|
1126
|
+
style: triggerStyle$1,
|
|
1127
|
+
"aria-haspopup": "menu",
|
|
1128
|
+
"aria-expanded": open,
|
|
1129
|
+
"aria-label": t("config.sessionPreset.menuLabel"),
|
|
1130
|
+
disabled: !editable,
|
|
1131
|
+
onClick: () => setOpen((value) => !value),
|
|
1132
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1133
|
+
style: triggerLabelStyle$1,
|
|
1134
|
+
children: currentText(state, t)
|
|
1135
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, {
|
|
1136
|
+
size: 14,
|
|
1137
|
+
"aria-hidden": "true"
|
|
1138
|
+
})]
|
|
1139
|
+
}),
|
|
1140
|
+
items: menuItems(state, t),
|
|
1141
|
+
selectedId: state.current,
|
|
1142
|
+
onSelect: (id) => {
|
|
1143
|
+
select(id);
|
|
1144
|
+
setOpen(false);
|
|
1145
|
+
},
|
|
1146
|
+
onClose: () => setOpen(false),
|
|
1147
|
+
returnFocus: () => triggerRef.current,
|
|
1148
|
+
portal: true,
|
|
1149
|
+
align: "start"
|
|
1150
|
+
}), state.status === "error" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
1151
|
+
style: noticeStyle,
|
|
1152
|
+
role: "alert",
|
|
1153
|
+
children: [state.error ?? t("config.sessionPreset.loadFailed"), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1154
|
+
type: "button",
|
|
1155
|
+
style: retryStyle,
|
|
1156
|
+
onClick: load,
|
|
1157
|
+
children: t("config.sessionPreset.retry")
|
|
1158
|
+
})]
|
|
1159
|
+
})] });
|
|
1160
|
+
}
|
|
1161
|
+
const triggerStyle$1 = {
|
|
1162
|
+
display: "flex",
|
|
1163
|
+
alignItems: "center",
|
|
1164
|
+
justifyContent: "space-between",
|
|
1165
|
+
gap: 8,
|
|
1166
|
+
width: "100%",
|
|
1167
|
+
paddingInline: 10,
|
|
1168
|
+
minHeight: 32,
|
|
1169
|
+
fontSize: 13,
|
|
1170
|
+
fontWeight: 400,
|
|
1171
|
+
color: "var(--dsw-alias-label-primary)",
|
|
1172
|
+
background: "var(--dsw-alias-bg-l1)",
|
|
1173
|
+
border: "0.5px solid var(--dsw-alias-border-l2)",
|
|
1174
|
+
borderRadius: 6,
|
|
1175
|
+
cursor: "pointer"
|
|
1176
|
+
};
|
|
1177
|
+
const triggerLabelStyle$1 = {
|
|
1178
|
+
flex: "1 1 auto",
|
|
1179
|
+
minWidth: 0,
|
|
1180
|
+
overflow: "hidden",
|
|
1181
|
+
textOverflow: "ellipsis",
|
|
1182
|
+
whiteSpace: "nowrap",
|
|
1183
|
+
textAlign: "left"
|
|
1184
|
+
};
|
|
1185
|
+
const noticeStyle = {
|
|
1186
|
+
margin: 0,
|
|
1187
|
+
fontSize: 12,
|
|
1188
|
+
lineHeight: "18px",
|
|
1189
|
+
color: "var(--dsw-alias-error-fill, #cf222e)"
|
|
1190
|
+
};
|
|
1191
|
+
const retryStyle = {
|
|
1192
|
+
marginLeft: 8,
|
|
1193
|
+
font: "inherit",
|
|
1194
|
+
color: "var(--dsw-alias-label-link, #0969da)",
|
|
1195
|
+
background: "none",
|
|
1196
|
+
border: "none",
|
|
1197
|
+
padding: 0,
|
|
1198
|
+
cursor: "pointer"
|
|
1199
|
+
};
|
|
1200
|
+
//#endregion
|
|
394
1201
|
//#region src/client/config-page.tsx
|
|
395
1202
|
/** 读取宿主当前工作区条目。 */
|
|
396
1203
|
function useWorkspaceItems(useWorkspaces) {
|
|
@@ -481,6 +1288,21 @@ window.__ModuleLoader__.load({
|
|
|
481
1288
|
]
|
|
482
1289
|
});
|
|
483
1290
|
}
|
|
1291
|
+
/** 模型标签:在 trigger、根菜单与选项中显示 provider。 */
|
|
1292
|
+
const renderModelSlot = (name, owner) => {
|
|
1293
|
+
if (name === "conversation.input.model.label") {
|
|
1294
|
+
const label = owner;
|
|
1295
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1296
|
+
"data-dsh-lark-provider": label.provider.id,
|
|
1297
|
+
children: [
|
|
1298
|
+
label.provider.name,
|
|
1299
|
+
" / ",
|
|
1300
|
+
label.model.name
|
|
1301
|
+
]
|
|
1302
|
+
});
|
|
1303
|
+
}
|
|
1304
|
+
return null;
|
|
1305
|
+
};
|
|
484
1306
|
/** 表单框架文案。 */
|
|
485
1307
|
function formLabels(t) {
|
|
486
1308
|
return {
|
|
@@ -500,19 +1322,72 @@ window.__ModuleLoader__.load({
|
|
|
500
1322
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AuthPanel, {
|
|
501
1323
|
t,
|
|
502
1324
|
controller: props.controller
|
|
503
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
1325
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.SettingsForm, {
|
|
504
1326
|
state,
|
|
505
1327
|
labels: formLabels(t),
|
|
506
1328
|
onSave: props.save,
|
|
507
1329
|
onDiscard: props.discard,
|
|
508
|
-
children:
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
1330
|
+
children: [
|
|
1331
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorkspaceSelect, {
|
|
1332
|
+
t,
|
|
1333
|
+
useWorkspaces: props.useWorkspaces,
|
|
1334
|
+
value: state.workspaceRoot.text,
|
|
1335
|
+
disabled,
|
|
1336
|
+
invalid: state.workspaceRoot.invalid,
|
|
1337
|
+
onChange: (path) => props.edit("workspaceRoot", path)
|
|
1338
|
+
}),
|
|
1339
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1340
|
+
"data-dsh-lark-config-model": "default",
|
|
1341
|
+
style: fieldStyle,
|
|
1342
|
+
children: [
|
|
1343
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1344
|
+
style: labelRowStyle,
|
|
1345
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1346
|
+
style: titleStyle,
|
|
1347
|
+
children: t("config.sessionModel.label")
|
|
1348
|
+
})
|
|
1349
|
+
}),
|
|
1350
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1351
|
+
style: triggerRowStyle,
|
|
1352
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelSelect, {
|
|
1353
|
+
...props.modelDefaults,
|
|
1354
|
+
locked: disabled,
|
|
1355
|
+
available: state.available,
|
|
1356
|
+
renderSlot: renderModelSlot
|
|
1357
|
+
})
|
|
1358
|
+
}),
|
|
1359
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1360
|
+
style: descriptionStyle,
|
|
1361
|
+
children: t("config.sessionModel.description")
|
|
1362
|
+
})
|
|
1363
|
+
]
|
|
1364
|
+
}),
|
|
1365
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1366
|
+
"data-dsh-lark-config-preset": "default",
|
|
1367
|
+
style: fieldStyle,
|
|
1368
|
+
children: [
|
|
1369
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1370
|
+
style: labelRowStyle,
|
|
1371
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1372
|
+
style: titleStyle,
|
|
1373
|
+
children: t("config.sessionPreset.label")
|
|
1374
|
+
})
|
|
1375
|
+
}),
|
|
1376
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1377
|
+
style: triggerRowStyle,
|
|
1378
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PresetSelect, {
|
|
1379
|
+
...props.presetDefaults,
|
|
1380
|
+
locked: disabled,
|
|
1381
|
+
t
|
|
1382
|
+
})
|
|
1383
|
+
}),
|
|
1384
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1385
|
+
style: descriptionStyle,
|
|
1386
|
+
children: t("config.sessionPreset.description")
|
|
1387
|
+
})
|
|
1388
|
+
]
|
|
1389
|
+
})
|
|
1390
|
+
]
|
|
516
1391
|
})] });
|
|
517
1392
|
}
|
|
518
1393
|
const fieldStyle = {
|
|
@@ -833,7 +1708,7 @@ window.__ModuleLoader__.load({
|
|
|
833
1708
|
const ROW_KEY = "dsh-plugin-lark-bridge#dsh-plugin-lark-bridge";
|
|
834
1709
|
/** 行 id,同时是宿主配置的条目 id 与表单命名空间。 */
|
|
835
1710
|
const ROW_ID = "dsh-plugin-lark-bridge";
|
|
836
|
-
const
|
|
1711
|
+
const FIELD_SPECS = [{
|
|
837
1712
|
field: "workspaceRoot",
|
|
838
1713
|
format: (value) => typeof value === "string" ? normalizeWorkspacePath(value) : "",
|
|
839
1714
|
parse: (text) => {
|
|
@@ -843,17 +1718,26 @@ window.__ModuleLoader__.load({
|
|
|
843
1718
|
value: path
|
|
844
1719
|
} : void 0;
|
|
845
1720
|
}
|
|
846
|
-
}
|
|
847
|
-
|
|
1721
|
+
}, ...[
|
|
1722
|
+
"sessionProvider",
|
|
1723
|
+
"sessionModel",
|
|
1724
|
+
"sessionEffort",
|
|
1725
|
+
"sessionPreset"
|
|
1726
|
+
].map((field) => (0, _deepseek_ai_dsh_client_ui_primitives.settingsTextField)(field))];
|
|
1727
|
+
/** 暂存配置编辑,保存时写入宿主配置。 */
|
|
848
1728
|
var PluginConfigForm = class {
|
|
849
1729
|
form;
|
|
850
1730
|
state;
|
|
851
1731
|
/** @param scope - 宿主为该行提供的配置表单。 */
|
|
852
1732
|
constructor(scope) {
|
|
853
|
-
this.form = new _deepseek_ai_dsh_client_ui_primitives.SettingsFormModel(scope,
|
|
1733
|
+
this.form = new _deepseek_ai_dsh_client_ui_primitives.SettingsFormModel(scope, FIELD_SPECS);
|
|
854
1734
|
this.state = this.form.bind(() => ({
|
|
855
1735
|
...this.form.shell(),
|
|
856
|
-
workspaceRoot: this.form.field("workspaceRoot")
|
|
1736
|
+
workspaceRoot: this.form.field("workspaceRoot"),
|
|
1737
|
+
sessionProvider: this.form.field("sessionProvider"),
|
|
1738
|
+
sessionModel: this.form.field("sessionModel"),
|
|
1739
|
+
sessionEffort: this.form.field("sessionEffort"),
|
|
1740
|
+
sessionPreset: this.form.field("sessionPreset")
|
|
857
1741
|
}));
|
|
858
1742
|
}
|
|
859
1743
|
/** @returns 配置页向槽位组件提供的注入值。 */
|
|
@@ -870,7 +1754,6 @@ window.__ModuleLoader__.load({
|
|
|
870
1754
|
};
|
|
871
1755
|
//#endregion
|
|
872
1756
|
//#region src/client/locales.ts
|
|
873
|
-
/** 前端字典与命名空间。中文字典是键集事实源。 */
|
|
874
1757
|
/** 前端使用的字典命名空间,与插件名一致。 */
|
|
875
1758
|
const NS = "dsh-plugin-lark-bridge";
|
|
876
1759
|
/** 中文字典。 */
|
|
@@ -894,12 +1777,23 @@ window.__ModuleLoader__.load({
|
|
|
894
1777
|
"auth.command.user": "lark-cli auth login --scope auth:user.id:read",
|
|
895
1778
|
"auth.command.copy": "复制命令",
|
|
896
1779
|
"auth.command.copied": "已复制",
|
|
897
|
-
"config.summary": "
|
|
1780
|
+
"config.summary": "工作区、模型、预设与飞书连接",
|
|
898
1781
|
"config.workspaceRoot.title": "工作区",
|
|
899
1782
|
"config.workspaceRoot.description": "飞书消息注入到所选 DSH 工作区的会话。",
|
|
900
1783
|
"config.workspaceRoot.invalid": "请选择一个已注册的工作区。",
|
|
901
1784
|
"config.workspaceRoot.placeholder": "请选择工作区",
|
|
902
1785
|
"config.workspaceRoot.empty": "暂无已注册工作区",
|
|
1786
|
+
"config.sessionModel.label": "模型",
|
|
1787
|
+
"config.sessionModel.description": "选择新建桥接会话时使用的模型。",
|
|
1788
|
+
"config.sessionPreset.label": "预设",
|
|
1789
|
+
"config.sessionPreset.description": "选择新建桥接会话时使用的预设。",
|
|
1790
|
+
"config.sessionPreset.followHost": "跟随宿主默认",
|
|
1791
|
+
"config.sessionPreset.loading": "加载中…",
|
|
1792
|
+
"config.sessionPreset.unavailable": "不可用",
|
|
1793
|
+
"config.sessionPreset.noService": "此部署不提供预设",
|
|
1794
|
+
"config.sessionPreset.loadFailed": "预设加载失败",
|
|
1795
|
+
"config.sessionPreset.retry": "重试",
|
|
1796
|
+
"config.sessionPreset.menuLabel": "预设",
|
|
903
1797
|
"config.saveSelection": "保存选择",
|
|
904
1798
|
"config.unavailable": "配置不可用。",
|
|
905
1799
|
"config.readOnly": "此部署以只读方式保存设置。",
|
|
@@ -928,12 +1822,23 @@ window.__ModuleLoader__.load({
|
|
|
928
1822
|
"auth.command.user": "lark-cli auth login --scope auth:user.id:read",
|
|
929
1823
|
"auth.command.copy": "Copy command",
|
|
930
1824
|
"auth.command.copied": "Copied",
|
|
931
|
-
"config.summary": "Workspace and Lark connections",
|
|
1825
|
+
"config.summary": "Workspace, model, preset, and Lark connections",
|
|
932
1826
|
"config.workspaceRoot.title": "Workspace",
|
|
933
1827
|
"config.workspaceRoot.description": "Lark messages are injected into the selected DSH workspace.",
|
|
934
1828
|
"config.workspaceRoot.invalid": "Select a registered workspace.",
|
|
935
1829
|
"config.workspaceRoot.placeholder": "Select a workspace",
|
|
936
1830
|
"config.workspaceRoot.empty": "No registered workspaces",
|
|
1831
|
+
"config.sessionModel.label": "Model",
|
|
1832
|
+
"config.sessionModel.description": "Choose the model new bridge sessions use.",
|
|
1833
|
+
"config.sessionPreset.label": "Preset",
|
|
1834
|
+
"config.sessionPreset.description": "Choose the preset new bridge sessions use.",
|
|
1835
|
+
"config.sessionPreset.followHost": "Follow Host default",
|
|
1836
|
+
"config.sessionPreset.loading": "Loading…",
|
|
1837
|
+
"config.sessionPreset.unavailable": "Unavailable",
|
|
1838
|
+
"config.sessionPreset.noService": "This deployment provides no presets.",
|
|
1839
|
+
"config.sessionPreset.loadFailed": "Could not load presets",
|
|
1840
|
+
"config.sessionPreset.retry": "Retry",
|
|
1841
|
+
"config.sessionPreset.menuLabel": "Preset",
|
|
937
1842
|
"config.saveSelection": "Save selection",
|
|
938
1843
|
"config.unavailable": "Configuration is unavailable.",
|
|
939
1844
|
"config.readOnly": "This deployment stores settings read-only.",
|
|
@@ -942,7 +1847,308 @@ window.__ModuleLoader__.load({
|
|
|
942
1847
|
"config.saving": "Saving…"
|
|
943
1848
|
};
|
|
944
1849
|
//#endregion
|
|
1850
|
+
//#region node_modules/.pnpm/@deepseek-ai+dsh-client-ui-model-selection@0.2.2-rc.5_@deepseek-ai+cordis@4.1.0/node_modules/@deepseek-ai/dsh-client-ui-model-selection/src/client/catalog.ts
|
|
1851
|
+
/** Loads at most one model catalog for the current Host generation. */
|
|
1852
|
+
var ModelCatalogDirectory = class {
|
|
1853
|
+
ctx;
|
|
1854
|
+
/** Current shared catalog value and load lifecycle. */
|
|
1855
|
+
store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)({
|
|
1856
|
+
value: null,
|
|
1857
|
+
status: "idle",
|
|
1858
|
+
error: null
|
|
1859
|
+
});
|
|
1860
|
+
reasoning = /* @__PURE__ */ new Map();
|
|
1861
|
+
/**
|
|
1862
|
+
* Read the last advertised reasoning metadata, including unavailable models.
|
|
1863
|
+
* @param selection - provider and model whose effort is displayed.
|
|
1864
|
+
* @returns reasoning metadata observed during this Host generation.
|
|
1865
|
+
*/
|
|
1866
|
+
reasoningFor(selection) {
|
|
1867
|
+
return this.reasoning.get(JSON.stringify([selection.provider, selection.model]));
|
|
1868
|
+
}
|
|
1869
|
+
generation = 0;
|
|
1870
|
+
inflight;
|
|
1871
|
+
/**
|
|
1872
|
+
* @param ctx - the providing plugin's context, whose `remote.session`
|
|
1873
|
+
* namespace carries the Host-generation catalog.
|
|
1874
|
+
*/
|
|
1875
|
+
constructor(ctx) {
|
|
1876
|
+
this.ctx = ctx;
|
|
1877
|
+
}
|
|
1878
|
+
/**
|
|
1879
|
+
* Return the current generation's catalog, sharing its one in-flight load.
|
|
1880
|
+
* @returns the loaded global catalog.
|
|
1881
|
+
*/
|
|
1882
|
+
load() {
|
|
1883
|
+
const state = this.store.getSnapshot();
|
|
1884
|
+
if (state.status === "ready" && state.value !== null) return Promise.resolve(state.value);
|
|
1885
|
+
if (this.inflight !== void 0) return this.inflight;
|
|
1886
|
+
const generation = this.generation;
|
|
1887
|
+
this.store.update((draft) => {
|
|
1888
|
+
draft.status = "loading";
|
|
1889
|
+
draft.error = null;
|
|
1890
|
+
});
|
|
1891
|
+
const operation = this.ctx.remote.session.modelCatalog().then((response) => {
|
|
1892
|
+
if (!response.ok) throw new Error(`${response.error.code}: ${response.error.message}`);
|
|
1893
|
+
if (generation === this.generation) {
|
|
1894
|
+
for (const group of response.value.groups) for (const model of group.models) this.reasoning.set(JSON.stringify([group.id, model.id]), model.reasoning);
|
|
1895
|
+
this.store.set({
|
|
1896
|
+
value: response.value,
|
|
1897
|
+
status: "ready",
|
|
1898
|
+
error: null
|
|
1899
|
+
});
|
|
1900
|
+
}
|
|
1901
|
+
return response.value;
|
|
1902
|
+
}).catch((error) => {
|
|
1903
|
+
if (generation === this.generation) this.store.update((draft) => {
|
|
1904
|
+
draft.status = "error";
|
|
1905
|
+
draft.error = error instanceof Error ? error.message : String(error);
|
|
1906
|
+
});
|
|
1907
|
+
throw error;
|
|
1908
|
+
}).finally(() => {
|
|
1909
|
+
if (generation === this.generation && this.inflight === operation) this.inflight = void 0;
|
|
1910
|
+
});
|
|
1911
|
+
this.inflight = operation;
|
|
1912
|
+
return operation;
|
|
1913
|
+
}
|
|
1914
|
+
/**
|
|
1915
|
+
* Invalidate the loaded catalog; the next explicit menu read reloads it.
|
|
1916
|
+
* @param clear - whether values from the previous Host generation must be hidden.
|
|
1917
|
+
*/
|
|
1918
|
+
invalidate(clear = false) {
|
|
1919
|
+
this.generation += 1;
|
|
1920
|
+
this.inflight = void 0;
|
|
1921
|
+
const value = clear ? null : this.store.getSnapshot().value;
|
|
1922
|
+
this.store.set({
|
|
1923
|
+
value,
|
|
1924
|
+
status: "idle",
|
|
1925
|
+
error: null
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1928
|
+
/** Invalidate and reload the catalog after a Host-side model input changes. */
|
|
1929
|
+
refresh() {
|
|
1930
|
+
this.invalidate();
|
|
1931
|
+
this.load().catch(() => {});
|
|
1932
|
+
}
|
|
1933
|
+
/** Clear Host-specific values and load the replacement Host generation. */
|
|
1934
|
+
resetGeneration() {
|
|
1935
|
+
this.reasoning.clear();
|
|
1936
|
+
this.invalidate(true);
|
|
1937
|
+
this.load().catch(() => {});
|
|
1938
|
+
}
|
|
1939
|
+
};
|
|
1940
|
+
//#endregion
|
|
1941
|
+
//#region src/client/model-defaults.ts
|
|
1942
|
+
/** 保存模型目录、配置草稿与选择器共享状态的订阅。 */
|
|
1943
|
+
var ModelDefaults = class {
|
|
1944
|
+
form;
|
|
1945
|
+
edit;
|
|
1946
|
+
catalog;
|
|
1947
|
+
store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)({
|
|
1948
|
+
current: null,
|
|
1949
|
+
routable: null,
|
|
1950
|
+
groups: [],
|
|
1951
|
+
failures: [],
|
|
1952
|
+
status: "idle",
|
|
1953
|
+
pending: null,
|
|
1954
|
+
error: null
|
|
1955
|
+
});
|
|
1956
|
+
disposers = [];
|
|
1957
|
+
/**
|
|
1958
|
+
* @param ctx - 前端根上下文,提供模型目录与连接事件。
|
|
1959
|
+
* @param form - 配置页草稿状态。
|
|
1960
|
+
* @param edit - 配置页草稿编辑动作。
|
|
1961
|
+
*/
|
|
1962
|
+
constructor(ctx, form, edit) {
|
|
1963
|
+
this.form = form;
|
|
1964
|
+
this.edit = edit;
|
|
1965
|
+
this.catalog = new ModelCatalogDirectory(ctx);
|
|
1966
|
+
this.disposers.push(this.catalog.store.subscribe(() => this.sync()));
|
|
1967
|
+
this.disposers.push(form.subscribe(() => this.sync()));
|
|
1968
|
+
this.disposers.push(ctx.on("connection/reset", () => {
|
|
1969
|
+
this.catalog.resetGeneration();
|
|
1970
|
+
}));
|
|
1971
|
+
for (const event of [
|
|
1972
|
+
"llm/adapters-updated",
|
|
1973
|
+
"llm/models-updated",
|
|
1974
|
+
"settings/document-updated",
|
|
1975
|
+
"credentials/record-updated",
|
|
1976
|
+
"credentials/reference-updated"
|
|
1977
|
+
]) this.disposers.push(ctx.remote.$on(event, () => {
|
|
1978
|
+
this.catalog.refresh();
|
|
1979
|
+
}));
|
|
1980
|
+
this.catalog.load().catch(() => void 0);
|
|
1981
|
+
this.sync();
|
|
1982
|
+
}
|
|
1983
|
+
/** @returns 配置页选择器的注入值。 */
|
|
1984
|
+
inject(t, resolveText) {
|
|
1985
|
+
return {
|
|
1986
|
+
directory: this.store,
|
|
1987
|
+
load: () => {
|
|
1988
|
+
this.catalog.load().catch(() => void 0);
|
|
1989
|
+
},
|
|
1990
|
+
select: (selection) => this.select(selection),
|
|
1991
|
+
t,
|
|
1992
|
+
resolveText
|
|
1993
|
+
};
|
|
1994
|
+
}
|
|
1995
|
+
/** 释放目录、配置与连接事件的订阅。 */
|
|
1996
|
+
dispose() {
|
|
1997
|
+
for (const dispose of this.disposers.splice(0)) dispose();
|
|
1998
|
+
}
|
|
1999
|
+
/** 把选择写入草稿,并立即更新选择器显示。 */
|
|
2000
|
+
select(selection) {
|
|
2001
|
+
this.store.update((state) => {
|
|
2002
|
+
state.pending = selection;
|
|
2003
|
+
state.status = "selecting";
|
|
2004
|
+
state.error = null;
|
|
2005
|
+
});
|
|
2006
|
+
this.edit("sessionProvider", selection.provider);
|
|
2007
|
+
this.edit("sessionModel", selection.model);
|
|
2008
|
+
this.edit("sessionEffort", selection.reasoningEffort ?? "");
|
|
2009
|
+
this.store.update((state) => {
|
|
2010
|
+
state.pending = null;
|
|
2011
|
+
state.status = "ready";
|
|
2012
|
+
});
|
|
2013
|
+
return Promise.resolve({
|
|
2014
|
+
ok: true,
|
|
2015
|
+
value: void 0
|
|
2016
|
+
});
|
|
2017
|
+
}
|
|
2018
|
+
/** 从目录与配置草稿重建选择器状态。 */
|
|
2019
|
+
sync() {
|
|
2020
|
+
const config = this.form.getSnapshot();
|
|
2021
|
+
const catalog = this.catalog.store.getSnapshot();
|
|
2022
|
+
const provider = config.sessionProvider?.text.trim() ?? "";
|
|
2023
|
+
const model = config.sessionModel?.text.trim() ?? "";
|
|
2024
|
+
const effort = config.sessionEffort?.text.trim() ?? "";
|
|
2025
|
+
const current = provider === "" || model === "" ? null : {
|
|
2026
|
+
provider,
|
|
2027
|
+
model,
|
|
2028
|
+
...effort === "" ? {} : { reasoningEffort: effort }
|
|
2029
|
+
};
|
|
2030
|
+
const groups = catalog.value?.groups ?? [];
|
|
2031
|
+
const routable = current === null || catalog.status !== "ready" ? null : groups.some((group) => group.id === current.provider && group.models.some((entry) => entry.id === current.model));
|
|
2032
|
+
this.store.update((state) => {
|
|
2033
|
+
state.current = current;
|
|
2034
|
+
if (effort === "") delete state.retainedEffort;
|
|
2035
|
+
else state.retainedEffort = effort;
|
|
2036
|
+
state.routable = routable;
|
|
2037
|
+
state.groups = groups;
|
|
2038
|
+
state.failures = catalog.value?.failures ?? [];
|
|
2039
|
+
state.status = catalog.status === "error" ? "error" : catalog.status === "ready" ? "ready" : "loading";
|
|
2040
|
+
state.error = catalog.error;
|
|
2041
|
+
});
|
|
2042
|
+
}
|
|
2043
|
+
};
|
|
2044
|
+
//#endregion
|
|
2045
|
+
//#region src/client/preset-defaults.ts
|
|
2046
|
+
/** 保存名册、配置草稿与选择器共享状态的订阅。 */
|
|
2047
|
+
var PresetDefaults = class {
|
|
2048
|
+
form;
|
|
2049
|
+
edit;
|
|
2050
|
+
store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)({
|
|
2051
|
+
status: "noService",
|
|
2052
|
+
error: null,
|
|
2053
|
+
rows: [],
|
|
2054
|
+
current: ""
|
|
2055
|
+
});
|
|
2056
|
+
disposers = [];
|
|
2057
|
+
reading = false;
|
|
2058
|
+
remote;
|
|
2059
|
+
/**
|
|
2060
|
+
* @param ctx - 前端根上下文,提供连接事件。
|
|
2061
|
+
* @param form - 配置页草稿状态。
|
|
2062
|
+
* @param edit - 配置页草稿编辑动作。
|
|
2063
|
+
* @param remote - 预设名册远程命名空间;缺失时选择器保持禁用。
|
|
2064
|
+
*/
|
|
2065
|
+
constructor(ctx, form, edit, remote) {
|
|
2066
|
+
this.form = form;
|
|
2067
|
+
this.edit = edit;
|
|
2068
|
+
this.remote = remote;
|
|
2069
|
+
this.disposers.push(form.subscribe(() => this.sync()));
|
|
2070
|
+
this.disposers.push(ctx.on("connection/reset", () => this.load(true)));
|
|
2071
|
+
this.sync();
|
|
2072
|
+
}
|
|
2073
|
+
/** 宿主预设服务就绪后接入名册,并读取一次。 */
|
|
2074
|
+
attach(remote) {
|
|
2075
|
+
this.remote = remote;
|
|
2076
|
+
this.load(true);
|
|
2077
|
+
}
|
|
2078
|
+
/** @returns 配置页选择器的注入值。 */
|
|
2079
|
+
inject() {
|
|
2080
|
+
return {
|
|
2081
|
+
hooks: { presetDefaults: this.store },
|
|
2082
|
+
load: () => {
|
|
2083
|
+
this.load(true);
|
|
2084
|
+
},
|
|
2085
|
+
select: (id) => this.edit("sessionPreset", id)
|
|
2086
|
+
};
|
|
2087
|
+
}
|
|
2088
|
+
/** 释放对配置草稿与连接事件的订阅。 */
|
|
2089
|
+
dispose() {
|
|
2090
|
+
for (const dispose of this.disposers.splice(0)) dispose();
|
|
2091
|
+
}
|
|
2092
|
+
/** 读取宿主的可用预设;失败时保留已保存值。 */
|
|
2093
|
+
async load(force = false) {
|
|
2094
|
+
if (this.reading) return;
|
|
2095
|
+
if (!force && this.store.getSnapshot().status === "ready") return;
|
|
2096
|
+
const remote = this.remote;
|
|
2097
|
+
if (remote === void 0) {
|
|
2098
|
+
this.store.update((state) => {
|
|
2099
|
+
state.status = "noService";
|
|
2100
|
+
state.error = null;
|
|
2101
|
+
});
|
|
2102
|
+
return;
|
|
2103
|
+
}
|
|
2104
|
+
this.reading = true;
|
|
2105
|
+
this.store.update((state) => {
|
|
2106
|
+
state.status = "loading";
|
|
2107
|
+
state.error = null;
|
|
2108
|
+
});
|
|
2109
|
+
try {
|
|
2110
|
+
const result = await remote.list();
|
|
2111
|
+
if (result.ok) {
|
|
2112
|
+
const rows = result.value.presets.filter((row) => row.broken === void 0);
|
|
2113
|
+
this.store.update((state) => {
|
|
2114
|
+
state.status = "ready";
|
|
2115
|
+
state.rows = rows;
|
|
2116
|
+
});
|
|
2117
|
+
} else if (result.error.code === "gateway/invocation-unavailable") this.store.update((state) => {
|
|
2118
|
+
state.status = "noService";
|
|
2119
|
+
state.error = null;
|
|
2120
|
+
});
|
|
2121
|
+
else this.store.update((state) => {
|
|
2122
|
+
state.status = "error";
|
|
2123
|
+
state.error = result.error.message;
|
|
2124
|
+
});
|
|
2125
|
+
} catch (error) {
|
|
2126
|
+
this.store.update((state) => {
|
|
2127
|
+
state.status = "error";
|
|
2128
|
+
state.error = error instanceof Error ? error.message : String(error);
|
|
2129
|
+
});
|
|
2130
|
+
} finally {
|
|
2131
|
+
this.reading = false;
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
/** 从配置草稿重建当前选择。 */
|
|
2135
|
+
sync() {
|
|
2136
|
+
const current = this.form.getSnapshot().sessionPreset?.text ?? "";
|
|
2137
|
+
this.store.update((state) => {
|
|
2138
|
+
state.current = current.trim();
|
|
2139
|
+
});
|
|
2140
|
+
}
|
|
2141
|
+
};
|
|
2142
|
+
//#endregion
|
|
945
2143
|
//#region src/client/index.ts
|
|
2144
|
+
/** 需要宿主注入的客户端服务。 */
|
|
2145
|
+
const inject = [
|
|
2146
|
+
"slots",
|
|
2147
|
+
"locale",
|
|
2148
|
+
"configForms",
|
|
2149
|
+
"remote",
|
|
2150
|
+
"remote.session"
|
|
2151
|
+
];
|
|
946
2152
|
/** 注册共享状态、弹窗和配置页。 */
|
|
947
2153
|
function apply(ctx) {
|
|
948
2154
|
ctx.inject(["locale"], (ctx) => {
|
|
@@ -954,13 +2160,25 @@ window.__ModuleLoader__.load({
|
|
|
954
2160
|
ctx.inject([
|
|
955
2161
|
"slots",
|
|
956
2162
|
"locale",
|
|
957
|
-
"configForms"
|
|
2163
|
+
"configForms",
|
|
2164
|
+
"remote",
|
|
2165
|
+
"remote.session"
|
|
958
2166
|
], (ctx) => {
|
|
959
2167
|
const form = new PluginConfigForm(ctx.configForms.get(ROW_ID));
|
|
2168
|
+
const injected = form.inject();
|
|
2169
|
+
const models = new ModelDefaults(ctx, injected.hooks.configForm, injected.edit);
|
|
2170
|
+
const presets = new PresetDefaults(ctx, injected.hooks.configForm, injected.edit);
|
|
2171
|
+
ctx.inject(["remote.agentPresets"], (scoped) => {
|
|
2172
|
+
const remote = scoped.remote.agentPresets;
|
|
2173
|
+
if (remote !== void 0 && typeof remote.list === "function") presets.attach(remote);
|
|
2174
|
+
});
|
|
2175
|
+
const modelT = ctx.locale.bind("model");
|
|
960
2176
|
const controller = new StatusController({ autoStart: typeof window !== "undefined" && typeof window.setInterval === "function" && typeof window.clearInterval === "function" });
|
|
961
2177
|
ctx.effect(() => () => {
|
|
962
2178
|
controller.dispose();
|
|
963
2179
|
form.dispose();
|
|
2180
|
+
models.dispose();
|
|
2181
|
+
presets.dispose();
|
|
964
2182
|
}, `${NS}: shared state`);
|
|
965
2183
|
const layout = ctx.get("layout");
|
|
966
2184
|
const navigation = ctx.get("pluginNavigation");
|
|
@@ -977,7 +2195,7 @@ window.__ModuleLoader__.load({
|
|
|
977
2195
|
order: 20,
|
|
978
2196
|
locale: NS,
|
|
979
2197
|
inject: () => ({
|
|
980
|
-
...
|
|
2198
|
+
...injected,
|
|
981
2199
|
controller,
|
|
982
2200
|
openSettings
|
|
983
2201
|
})
|
|
@@ -987,14 +2205,19 @@ window.__ModuleLoader__.load({
|
|
|
987
2205
|
key: ROW_KEY,
|
|
988
2206
|
locale: NS,
|
|
989
2207
|
inject: () => ({
|
|
990
|
-
...
|
|
991
|
-
controller
|
|
2208
|
+
...injected,
|
|
2209
|
+
controller,
|
|
2210
|
+
modelDefaults: models.inject(modelT, (text) => ctx.locale.resolveText(text)),
|
|
2211
|
+
presetDefaults: presets.inject()
|
|
992
2212
|
})
|
|
993
2213
|
}, ConfigPage));
|
|
994
2214
|
});
|
|
995
2215
|
}
|
|
996
2216
|
//#endregion
|
|
997
2217
|
exports.apply = apply;
|
|
2218
|
+
exports.inject = inject;
|
|
998
2219
|
return module.exports;
|
|
999
2220
|
}
|
|
1000
2221
|
});
|
|
2222
|
+
|
|
2223
|
+
;(() => { if (typeof document === 'undefined') return; const id = 'dsh-plugin-lark-bridge-model-selection'; document.getElementById(id)?.remove(); const style = document.createElement('style'); style.id = id; style.setAttribute('data-dsh-lark-bridge-model-selection', ''); style.textContent = ".KofATW_root {\n min-width: 0;\n position: relative;\n}\n\n.KofATW_trigger {\n anchor-name: var(--dsh-model-anchor);\n border-radius: var(--dsw-radius-sm);\n min-width: 0;\n max-width: 360px;\n height: 28px;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n background: none;\n border: none;\n outline: none;\n align-items: center;\n gap: 4px;\n padding: 0 4px 0 8px;\n font-size: 13px;\n font-weight: 400;\n line-height: 20px;\n display: flex;\n}\n\n@media (hover: hover) {\n .KofATW_trigger:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.KofATW_trigger:focus-visible:not([data-selection-focus]) {\n box-shadow: 0 0 0 2px var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));\n}\n\n.KofATW_trigger:disabled {\n color: var(--dsw-alias-label-dimmed);\n cursor: default;\n}\n\n.KofATW_triggerLabel {\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 0;\n overflow: hidden;\n}\n\n.KofATW_triggerEffort {\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 0;\n color: var(--dsw-alias-label-caption);\n flex-shrink: 1000;\n overflow: hidden;\n}\n\n.KofATW_triggerIcon {\n display: var(--dsh-composer-model-icon-display, none);\n flex: none;\n}\n\n.KofATW_triggerLabel, .KofATW_triggerEffort {\n display: var(--dsh-composer-model-text-display, block);\n}\n\n.KofATW_chevron {\n color: var(--dsw-alias-label-caption);\n flex: none;\n transition: transform .12s;\n}\n\n.KofATW_chevronOpen {\n transform: rotate(180deg);\n}\n\n.KofATW_menu {\n box-sizing: border-box;\n position-anchor: var(--dsh-model-anchor);\n top: max(12px, var(--dsh-frame-overlay-top, 12px));\n left: 12px;\n right: anchor(right);\n bottom: calc(anchor(top) + 8px);\n z-index: 1100;\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n width: fit-content;\n min-width: min(240px, 100vw - 24px);\n max-width: min(420px, 100vw - 24px);\n height: fit-content;\n max-height: min(360px, 100dvh - 96px);\n box-shadow: var(--dsw-elevation-prominent);\n color: var(--dsw-alias-label-primary);\n --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);\n --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);\n border: 0;\n flex-direction: column;\n place-self: safe end;\n margin: 0;\n padding: 4px;\n display: flex;\n position: fixed;\n overflow: hidden;\n}\n\n.KofATW_status, .KofATW_empty {\n color: var(--dsw-alias-label-tertiary);\n padding: 8px;\n font-size: 12px;\n line-height: 18px;\n}\n\n.KofATW_error, .KofATW_warning {\n border-radius: var(--dsw-radius-md);\n background: var(--dsw-alias-interactive-bg-hover-danger);\n color: var(--dsw-alias-state-error-primary);\n justify-content: space-between;\n align-items: flex-start;\n gap: 6px;\n margin-bottom: 3px;\n padding: 6px 7px;\n font-size: 11px;\n line-height: 16px;\n display: flex;\n}\n\n.KofATW_warning {\n background: var(--dsw-alias-bg-module-platform);\n color: var(--dsw-alias-state-warn-label);\n}\n\n.KofATW_retry {\n color: inherit;\n font: inherit;\n cursor: pointer;\n background: none;\n border: none;\n flex: none;\n padding: 0;\n font-weight: 600;\n}\n\n.KofATW_searchRow {\n flex-shrink: 0;\n margin: 2px 0 3px;\n position: relative;\n}\n\n.KofATW_searchRow .KofATW_search {\n border-radius: var(--dsw-radius-md);\n background: none;\n border: 0 solid #0000;\n height: auto;\n padding: 5px 7px;\n display: flex;\n}\n\n.KofATW_searchRow .KofATW_searchWithQuery {\n padding-right: 34px;\n}\n\n.KofATW_searchClear {\n corner-shape: round;\n width: 24px;\n height: 24px;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n background: none;\n border: none;\n border-radius: 50%;\n justify-content: center;\n align-items: center;\n padding: 0;\n display: inline-flex;\n position: absolute;\n top: 50%;\n right: 4px;\n transform: translateY(-50%);\n}\n\n.KofATW_searchClear:focus-visible {\n background: var(--dsw-alias-interactive-bg-hover);\n outline: none;\n}\n\n@media (hover: hover) {\n .KofATW_searchClear:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n outline: none;\n }\n}\n\n.KofATW_searchRow .KofATW_search:focus-within {\n border-color: #0000;\n}\n\n.KofATW_searchRow .KofATW_search input {\n padding: 0;\n font-size: 12px;\n line-height: normal;\n}\n\n@media (pointer: coarse) {\n .KofATW_searchRow .KofATW_search input {\n font-size: 16px;\n }\n}\n\n.KofATW_searchRow .KofATW_search input::placeholder {\n color: var(--dsw-alias-label-caption);\n}\n\n.KofATW_groups:not([hidden]) {\n min-height: 0;\n overflow: hidden auto;\n}\n\n.KofATW_option {\n box-sizing: border-box;\n border-radius: var(--dsw-radius-md);\n width: auto;\n min-width: 100%;\n min-height: 34px;\n color: inherit;\n text-align: left;\n cursor: pointer;\n background: none;\n border: none;\n outline: none;\n align-items: center;\n gap: 6px;\n padding: 5px 7px;\n display: flex;\n}\n\n.KofATW_option:focus-visible, .KofATW_optionActive:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n.KofATW_modelOption {\n max-width: 100%;\n}\n\n@media (hover: hover) {\n .KofATW_option:not(.KofATW_modelOption):hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.KofATW_selected {\n background: none;\n}\n\n.KofATW_option:disabled {\n color: var(--dsw-alias-label-dimmed);\n cursor: default;\n}\n\n.KofATW_optionCopy {\n flex-direction: column;\n flex: 1;\n min-width: 0;\n display: flex;\n}\n\n.KofATW_modelName {\n color: inherit;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 13px;\n font-weight: 400;\n line-height: 18px;\n overflow: hidden;\n}\n\n.KofATW_badgedName {\n vertical-align: baseline;\n white-space: nowrap;\n align-items: center;\n gap: 4px;\n max-width: 100%;\n display: inline-flex;\n}\n\n.KofATW_badgedNameText {\n text-overflow: ellipsis;\n min-width: 0;\n overflow: hidden;\n}\n\n.KofATW_badge {\n flex: none;\n}\n\n.KofATW_check {\n color: var(--dsw-alias-label-primary);\n flex: 0 0 14px;\n place-items: center;\n display: grid;\n}\n\n.KofATW_check svg {\n width: 14px;\n height: 14px;\n}\n\n.KofATW_cell {\n box-sizing: border-box;\n border-radius: var(--dsw-radius-md);\n width: auto;\n min-width: 100%;\n height: 34px;\n color: var(--dsw-alias-label-primary);\n cursor: pointer;\n text-align: left;\n background: none;\n border: none;\n outline: none;\n align-items: center;\n gap: 6px;\n padding: 0 8px;\n font-size: 13px;\n line-height: 20px;\n display: flex;\n}\n\n.KofATW_cell:focus-visible {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n\n@media (hover: hover) {\n .KofATW_cell:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n }\n}\n\n.KofATW_cellLabel {\n white-space: nowrap;\n flex: none;\n}\n\n.KofATW_cellValue {\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: right;\n min-width: 0;\n color: var(--dsw-alias-label-tertiary);\n flex: auto;\n overflow: hidden;\n}\n\n.KofATW_cellChevron {\n width: 12px;\n height: 12px;\n color: var(--dsw-alias-menu-icon);\n flex: none;\n}\n"; document.head.append(style); })();
|