dsh-edge 0.19.0 → 0.19.3
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/THIRD_PARTY_NOTICES.md +1991 -1741
- package/dist/assets/index-5SrrfWpU.js +127 -0
- package/dist/assets/index-BPHePDI_.css +1 -0
- package/dist/index.html +3 -3
- package/dist/plugins/@deepseek-ai/dsh-api-remotes/client.js +260 -20
- package/dist/plugins/@deepseek-ai/dsh-client-shortcuts/client.js +12 -7
- package/dist/plugins/@deepseek-ai/dsh-client-ui-agent-preset/client.js +9 -20
- package/dist/plugins/@deepseek-ai/dsh-client-ui-chat/client.js +90 -126
- package/dist/plugins/@deepseek-ai/dsh-client-ui-commands/client.js +111 -50
- package/dist/plugins/@deepseek-ai/dsh-client-ui-conversation/client.js +14 -1
- package/dist/plugins/@deepseek-ai/dsh-client-ui-deliverables/client.js +3 -3
- package/dist/plugins/@deepseek-ai/dsh-client-ui-model-selection/client.js +216 -63
- package/dist/plugins/@deepseek-ai/dsh-client-ui-open-in-app/client.js +37 -23
- package/dist/plugins/@deepseek-ai/dsh-client-ui-plan/client.js +4 -4
- package/dist/plugins/@deepseek-ai/dsh-client-ui-renderer/client.js +1 -1
- package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-general/client.js +7 -7
- package/dist/plugins/@deepseek-ai/dsh-client-ui-shortcuts/client.js +1 -1
- package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar/client.js +10 -15
- package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-files/client.js +9 -4
- package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-right/client.js +183 -156
- package/dist/plugins/@deepseek-ai/dsh-client-ui-skill/client.js +1 -1
- package/dist/plugins/@deepseek-ai/dsh-client-ui-theme/client.js +6 -6
- package/dist/plugins/@deepseek-ai/dsh-client-ui-tool/client.js +304 -54
- package/dist/plugins/@deepseek-ai/dsh-client-ui-user-questions/client.js +1257 -218
- package/dist/plugins/@deepseek-ai/dsh-client-ui-workflow-run/client.js +1 -1
- package/dist/plugins/@deepseek-ai/dsh-client-ui-workspace/client.js +3 -2
- package/package.json +93 -93
- package/worker/direct/index.js +945 -891
- package/worker/isolated/index.js +809 -755
- package/dist/assets/index-Cq6ljTv2.css +0 -1
- package/dist/assets/index-Dy0OhsZ5.js +0 -127
|
@@ -423,7 +423,7 @@ window.__ModuleLoader__.load({
|
|
|
423
423
|
}
|
|
424
424
|
//#endregion
|
|
425
425
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-model-selection/src/client/ModelSelect.module.css.mjs
|
|
426
|
-
const css = "._7KE1Ra_root{min-width:0;position:relative}._7KE1Ra_trigger{border-radius:var(--dsw-radius-sm);min-width:0;max-width:min(360px,45cqw);height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;outline:none;align-items:center;gap:4px;padding:0 4px 0 8px;font-size:13px;font-weight:400;line-height:20px;display:flex}._7KE1Ra_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}._7KE1Ra_trigger:focus-visible{box-shadow:0 0 0 2px var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary))}._7KE1Ra_trigger:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}._7KE1Ra_triggerLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}._7KE1Ra_triggerEffort{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-caption);flex-shrink:1000;overflow:hidden}._7KE1Ra_triggerIcon{display:var(--dsh-composer-model-icon-display,none);flex:none}._7KE1Ra_triggerLabel,._7KE1Ra_triggerEffort{display:var(--dsh-composer-model-text-display,block)}._7KE1Ra_chevron{color:var(--dsw-alias-label-caption);flex:none;transition:transform .12s}._7KE1Ra_chevronOpen{transform:rotate(180deg)}._7KE1Ra_menu{z-index:1100;--dsw-elevation-stroke-color:var(--dsw-alias-border-l1);width:max-content;min-width:min(240px,100vw - 32px);max-width:min(420px,100vw - 32px);max-height:min(360px,100vh - 96px);box-shadow:var(--dsw-elevation-prominent);color:var(--dsw-alias-label-primary);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border:0;flex-direction:column;padding:4px;display:flex;position:fixed;overflow:hidden}._7KE1Ra_status,._7KE1Ra_empty{color:var(--dsw-alias-label-tertiary);padding:8px;font-size:12px;line-height:18px}._7KE1Ra_error,._7KE1Ra_warning{border-radius:var(--dsw-radius-md);background:var(--dsw-alias-interactive-bg-hover-danger);color:var(--dsw-alias-state-error-primary);justify-content:space-between;align-items:flex-start;gap:6px;margin-bottom:3px;padding:6px 7px;font-size:11px;line-height:16px;display:flex}._7KE1Ra_warning{background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-state-warn-label)}._7KE1Ra_retry{color:inherit;font:inherit;cursor:pointer;background:0 0;border:none;flex:none;padding:0;font-weight:600}.
|
|
426
|
+
const css = "._7KE1Ra_root{min-width:0;position:relative}._7KE1Ra_trigger{border-radius:var(--dsw-radius-sm);min-width:0;max-width:min(360px,45cqw);height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;outline:none;align-items:center;gap:4px;padding:0 4px 0 8px;font-size:13px;font-weight:400;line-height:20px;display:flex}._7KE1Ra_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}._7KE1Ra_trigger:focus-visible:not([data-selection-focus]){box-shadow:0 0 0 2px var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary))}._7KE1Ra_trigger:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}._7KE1Ra_triggerLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}._7KE1Ra_triggerEffort{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-caption);flex-shrink:1000;overflow:hidden}._7KE1Ra_triggerIcon{display:var(--dsh-composer-model-icon-display,none);flex:none}._7KE1Ra_triggerLabel,._7KE1Ra_triggerEffort{display:var(--dsh-composer-model-text-display,block)}._7KE1Ra_chevron{color:var(--dsw-alias-label-caption);flex:none;transition:transform .12s}._7KE1Ra_chevronOpen{transform:rotate(180deg)}._7KE1Ra_menu{z-index:1100;--dsw-elevation-stroke-color:var(--dsw-alias-border-l1);width:max-content;min-width:min(240px,100vw - 32px);max-width:min(420px,100vw - 32px);max-height:min(360px,100vh - 96px);box-shadow:var(--dsw-elevation-prominent);color:var(--dsw-alias-label-primary);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border:0;flex-direction:column;padding:4px;display:flex;position:fixed;overflow:hidden}._7KE1Ra_status,._7KE1Ra_empty{color:var(--dsw-alias-label-tertiary);padding:8px;font-size:12px;line-height:18px}._7KE1Ra_error,._7KE1Ra_warning{border-radius:var(--dsw-radius-md);background:var(--dsw-alias-interactive-bg-hover-danger);color:var(--dsw-alias-state-error-primary);justify-content:space-between;align-items:flex-start;gap:6px;margin-bottom:3px;padding:6px 7px;font-size:11px;line-height:16px;display:flex}._7KE1Ra_warning{background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-state-warn-label)}._7KE1Ra_retry{color:inherit;font:inherit;cursor:pointer;background:0 0;border:none;flex:none;padding:0;font-weight:600}._7KE1Ra_searchRow{flex-shrink:0;margin:2px 0 3px;position:relative}._7KE1Ra_searchRow ._7KE1Ra_search{border-radius:var(--dsw-radius-md);background:0 0;border:0 solid #0000;height:auto;padding:5px 7px;display:flex}._7KE1Ra_searchRow ._7KE1Ra_searchWithQuery{padding-right:34px}._7KE1Ra_searchClear{corner-shape:round;width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:50%;justify-content:center;align-items:center;padding:0;display:inline-flex;position:absolute;top:50%;right:4px;transform:translateY(-50%)}._7KE1Ra_searchClear:hover,._7KE1Ra_searchClear:focus-visible{background:var(--dsw-alias-interactive-bg-hover);outline:none}._7KE1Ra_searchRow ._7KE1Ra_search:focus-within{border-color:#0000}._7KE1Ra_searchRow ._7KE1Ra_search input{padding:0;font-size:12px;line-height:normal}._7KE1Ra_searchRow ._7KE1Ra_search input::placeholder{color:var(--dsw-alias-label-caption)}._7KE1Ra_groups{min-height:0;overflow-y:auto}._7KE1Ra_option{box-sizing:border-box;border-radius:var(--dsw-radius-md);width:auto;min-width:100%;min-height:34px;color:inherit;text-align:left;cursor:pointer;background:0 0;border:none;outline:none;align-items:center;gap:6px;padding:5px 7px;display:flex}._7KE1Ra_option:not(._7KE1Ra_modelOption):hover:not(:disabled),._7KE1Ra_option:focus-visible,._7KE1Ra_optionActive:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}._7KE1Ra_selected{background:0 0}._7KE1Ra_option:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}._7KE1Ra_optionCopy{flex-direction:column;flex:1;min-width:0;display:flex}._7KE1Ra_modelName{color:inherit;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:400;line-height:18px;overflow:hidden}._7KE1Ra_check{color:var(--dsw-alias-label-primary);flex:0 0 14px;place-items:center;display:grid}._7KE1Ra_check svg{width:14px;height:14px}._7KE1Ra_cell{box-sizing:border-box;border-radius:var(--dsw-radius-md);width:auto;min-width:100%;height:34px;color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;background:0 0;border:none;outline:none;align-items:center;gap:6px;padding:0 8px;font-size:13px;line-height:20px;display:flex}._7KE1Ra_cell:hover,._7KE1Ra_cell:focus-visible{background:var(--dsw-alias-interactive-bg-hover)}._7KE1Ra_cellLabel{white-space:nowrap;flex:none}._7KE1Ra_cellValue{text-overflow:ellipsis;white-space:nowrap;text-align:right;min-width:0;color:var(--dsw-alias-label-tertiary);flex:auto;overflow:hidden}._7KE1Ra_cellChevron{width:12px;height:12px;color:var(--dsw-alias-menu-icon);flex:none}";
|
|
427
427
|
const tagId = "@deepseek-ai/dsh-client-ui-model-selection/ModelSelect.module.css";
|
|
428
428
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
429
429
|
const tag = document.createElement("style");
|
|
@@ -442,15 +442,19 @@ window.__ModuleLoader__.load({
|
|
|
442
442
|
"chevronOpen": "_7KE1Ra_chevronOpen",
|
|
443
443
|
"empty": "_7KE1Ra_empty",
|
|
444
444
|
"error": "_7KE1Ra_error",
|
|
445
|
-
"group": "_7KE1Ra_group",
|
|
446
|
-
"groupTitle": "_7KE1Ra_groupTitle",
|
|
447
445
|
"groups": "_7KE1Ra_groups",
|
|
448
446
|
"menu": "_7KE1Ra_menu",
|
|
449
447
|
"modelName": "_7KE1Ra_modelName",
|
|
448
|
+
"modelOption": "_7KE1Ra_modelOption",
|
|
450
449
|
"option": "_7KE1Ra_option",
|
|
450
|
+
"optionActive": "_7KE1Ra_optionActive",
|
|
451
451
|
"optionCopy": "_7KE1Ra_optionCopy",
|
|
452
452
|
"retry": "_7KE1Ra_retry",
|
|
453
453
|
"root": "_7KE1Ra_root",
|
|
454
|
+
"search": "_7KE1Ra_search",
|
|
455
|
+
"searchClear": "_7KE1Ra_searchClear",
|
|
456
|
+
"searchRow": "_7KE1Ra_searchRow",
|
|
457
|
+
"searchWithQuery": "_7KE1Ra_searchWithQuery",
|
|
454
458
|
"selected": "_7KE1Ra_selected",
|
|
455
459
|
"status": "_7KE1Ra_status",
|
|
456
460
|
"trigger": "_7KE1Ra_trigger",
|
|
@@ -460,6 +464,17 @@ window.__ModuleLoader__.load({
|
|
|
460
464
|
"warning": "_7KE1Ra_warning"
|
|
461
465
|
};
|
|
462
466
|
//#endregion
|
|
467
|
+
//#region lib/types/client/provider-order.js
|
|
468
|
+
/** Shared provider display order for the composer and command model pickers. */
|
|
469
|
+
/**
|
|
470
|
+
* Put the account and official providers first, preserving every other relative order.
|
|
471
|
+
* @param groups - Provider groups in catalog order.
|
|
472
|
+
* @returns a sorted copy; model order within each group is unchanged.
|
|
473
|
+
*/
|
|
474
|
+
function orderModelProviders(groups) {
|
|
475
|
+
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));
|
|
476
|
+
}
|
|
477
|
+
//#endregion
|
|
463
478
|
//#region lib/types/client/ModelSelect.js
|
|
464
479
|
/**
|
|
465
480
|
* ModelSelect: the composer's named model seat (`conversation.input.model`).
|
|
@@ -468,19 +483,25 @@ window.__ModuleLoader__.load({
|
|
|
468
483
|
* each drilling into its own list — the provider-grouped model list over
|
|
469
484
|
* the shared directory, and the effort levels. The trigger (313:14108's
|
|
470
485
|
* ToggleButton) shows both: model name + effort in the caption tone.
|
|
471
|
-
*
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
*
|
|
482
|
-
*
|
|
483
|
-
*
|
|
486
|
+
* Model catalogs above four entries show search, which retains focus while
|
|
487
|
+
* ↑/↓ cycle the highlighted result; Enter and Tab accept it. Smaller model
|
|
488
|
+
* catalogs, root panes, and effort panes move focus between rows. Escape and Shift+Tab leave a drilled pane first and otherwise close
|
|
489
|
+
* back to the trigger. A drilled pane focuses the current effort or model
|
|
490
|
+
* search field. Provider headings paint their background only while pinned
|
|
491
|
+
* by scrolling. Clearing a query restores the full list and search focus.
|
|
492
|
+
* Selecting restores trigger focus without a ring until the trigger loses focus
|
|
493
|
+
* or the menu reopens. Model names match a case-insensitive ordered subsequence
|
|
494
|
+
* within each provider group, ranked by
|
|
495
|
+
* prefix, alignment score, then catalog order. Returning to the root pane
|
|
496
|
+
* hands focus back to the cell that opened it. Data and submission ride the
|
|
497
|
+
* same per-session ModelDirectory as the /model popup; exact-model reasoning
|
|
498
|
+
* metadata and the selected effort come from the Host rather than a
|
|
499
|
+
* client-owned vocabulary. A rejected selection announces through the shared
|
|
500
|
+
* transient Toast anchored to the composer card; the in-menu strip with
|
|
501
|
+
* Retry remains the catalog-load surface. While the directory's pending
|
|
502
|
+
* selection is unsettled, the trigger shows a spinner in place of its
|
|
503
|
+
* chevron, and each row whose value that selection carries shows one in place
|
|
504
|
+
* of its check mark.
|
|
484
505
|
*/
|
|
485
506
|
/** Unplaced portal card: hidden but laid out at a fixed origin so offsetWidth/offsetHeight are real (Menu primitive's measure pass). */
|
|
486
507
|
const MEASURE_STYLE = {
|
|
@@ -498,16 +519,21 @@ window.__ModuleLoader__.load({
|
|
|
498
519
|
const state = (0, react.useSyncExternalStore)((fn) => directory.subscribe(fn), () => directory.getSnapshot());
|
|
499
520
|
const [open, setOpen] = (0, react.useState)(false);
|
|
500
521
|
const [pane, setPane] = (0, react.useState)("root");
|
|
522
|
+
const [query, setQuery] = (0, react.useState)("");
|
|
523
|
+
const [highlightedIndex, setHighlightedIndex] = (0, react.useState)(null);
|
|
524
|
+
const [selectionFocus, setSelectionFocus] = (0, react.useState)(false);
|
|
501
525
|
const lastActionRef = (0, react.useRef)("load");
|
|
502
526
|
const [toast, setToast] = (0, react.useState)(null);
|
|
503
527
|
const toastSeq = (0, react.useRef)(0);
|
|
504
528
|
const rootRef = (0, react.useRef)(null);
|
|
505
529
|
const triggerRef = (0, react.useRef)(null);
|
|
530
|
+
const searchRef = (0, react.useRef)(null);
|
|
506
531
|
const menuRef = (0, react.useRef)(null);
|
|
532
|
+
const groupsRef = (0, react.useRef)(null);
|
|
507
533
|
const [menuPos, setMenuPos] = (0, react.useState)(null);
|
|
508
534
|
const itemRefs = (0, react.useRef)([]);
|
|
509
535
|
const id = (0, react.useId)();
|
|
510
|
-
const groups = (0, react.useMemo)(() => state.groups
|
|
536
|
+
const groups = (0, react.useMemo)(() => orderModelProviders(state.groups), [state.groups]);
|
|
511
537
|
const choices = (0, react.useMemo)(() => groups.flatMap((group) => group.models.map((model) => ({
|
|
512
538
|
group,
|
|
513
539
|
model,
|
|
@@ -517,6 +543,21 @@ window.__ModuleLoader__.load({
|
|
|
517
543
|
...model.reasoning?.defaultEffort === void 0 ? {} : { reasoningEffort: model.reasoning.defaultEffort }
|
|
518
544
|
}
|
|
519
545
|
}))), [groups]);
|
|
546
|
+
const showSearch = choices.length > 4;
|
|
547
|
+
const filteredGroups = (0, react.useMemo)(() => groups.map((group) => ({
|
|
548
|
+
...group,
|
|
549
|
+
models: (0, _deepseek_ai_dsh_client_ui_primitives.rankByName)(group.models, showSearch ? query.trim() : "")
|
|
550
|
+
})).filter((group) => group.models.length > 0), [
|
|
551
|
+
groups,
|
|
552
|
+
query,
|
|
553
|
+
showSearch
|
|
554
|
+
]);
|
|
555
|
+
const visibleModels = (0, react.useMemo)(() => filteredGroups.flatMap((group) => group.models.map((model) => ({
|
|
556
|
+
provider: group.id,
|
|
557
|
+
model: model.id
|
|
558
|
+
}))), [filteredGroups]);
|
|
559
|
+
const currentVisibleIndex = visibleModels.findIndex((model) => model.provider === state.current?.provider && model.model === state.current.model);
|
|
560
|
+
const activeModelIndex = Math.min(highlightedIndex ?? Math.max(0, currentVisibleIndex), visibleModels.length - 1);
|
|
520
561
|
const currentChoice = choices[state.current === null ? -1 : choices.findIndex((c) => c.selection.provider === state.current?.provider && c.selection.model === state.current.model)];
|
|
521
562
|
const reasoning = currentChoice?.model.reasoning;
|
|
522
563
|
const effectiveEffort = state.current?.reasoningEffort ?? reasoning?.defaultEffort;
|
|
@@ -548,18 +589,53 @@ window.__ModuleLoader__.load({
|
|
|
548
589
|
document.removeEventListener("mousedown", closeOutside);
|
|
549
590
|
};
|
|
550
591
|
}, [open]);
|
|
592
|
+
(0, react.useLayoutEffect)(() => {
|
|
593
|
+
if (!showSearch) {
|
|
594
|
+
setQuery("");
|
|
595
|
+
setHighlightedIndex(null);
|
|
596
|
+
}
|
|
597
|
+
}, [showSearch]);
|
|
551
598
|
const paneFocus = (0, react.useRef)(null);
|
|
599
|
+
const previousShowSearch = (0, react.useRef)(showSearch);
|
|
552
600
|
(0, react.useEffect)(() => {
|
|
553
|
-
const
|
|
601
|
+
const changedSearchMode = previousShowSearch.current !== showSearch;
|
|
602
|
+
previousShowSearch.current = showSearch;
|
|
603
|
+
const intent = paneFocus.current ?? (changedSearchMode && pane === "model" ? "drill" : null);
|
|
554
604
|
paneFocus.current = null;
|
|
555
605
|
if (!open || intent === null) return;
|
|
556
606
|
if (intent === "drill") {
|
|
607
|
+
if (pane === "model" && showSearch) {
|
|
608
|
+
searchRef.current?.focus();
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
557
611
|
(menuRef.current?.querySelector("[role=\"menuitemradio\"][aria-checked=\"true\"]:not([disabled])") ?? itemRefs.current.find((item) => item !== null && !item.disabled) ?? triggerRef.current)?.focus();
|
|
558
612
|
return;
|
|
559
613
|
}
|
|
560
614
|
const cell = itemRefs.current[intent === "effort" ? 1 : 0];
|
|
561
615
|
(cell !== null && cell !== void 0 && !cell.disabled ? cell : triggerRef.current)?.focus();
|
|
562
|
-
}, [
|
|
616
|
+
}, [
|
|
617
|
+
open,
|
|
618
|
+
pane,
|
|
619
|
+
showSearch
|
|
620
|
+
]);
|
|
621
|
+
(0, react.useEffect)(() => {
|
|
622
|
+
const viewport = groupsRef.current;
|
|
623
|
+
if (viewport === null) return;
|
|
624
|
+
return (0, _deepseek_ai_dsh_client_ui_primitives.observeStickyMenuGroups)(viewport);
|
|
625
|
+
}, [
|
|
626
|
+
available,
|
|
627
|
+
open,
|
|
628
|
+
pane,
|
|
629
|
+
filteredGroups
|
|
630
|
+
]);
|
|
631
|
+
(0, react.useLayoutEffect)(() => {
|
|
632
|
+
if (open && pane === "model" && activeModelIndex >= 0) itemRefs.current[activeModelIndex]?.scrollIntoView({ block: "nearest" });
|
|
633
|
+
}, [
|
|
634
|
+
open,
|
|
635
|
+
pane,
|
|
636
|
+
activeModelIndex,
|
|
637
|
+
visibleModels
|
|
638
|
+
]);
|
|
563
639
|
(0, react.useLayoutEffect)(() => {
|
|
564
640
|
if (!open) {
|
|
565
641
|
setMenuPos(null);
|
|
@@ -591,16 +667,24 @@ window.__ModuleLoader__.load({
|
|
|
591
667
|
}, [
|
|
592
668
|
open,
|
|
593
669
|
pane,
|
|
594
|
-
state
|
|
670
|
+
state,
|
|
671
|
+
query
|
|
595
672
|
]);
|
|
596
673
|
if (!available) return null;
|
|
597
674
|
const show = () => {
|
|
675
|
+
setSelectionFocus(false);
|
|
598
676
|
triggerRef.current?.focus();
|
|
677
|
+
setQuery("");
|
|
678
|
+
setHighlightedIndex(null);
|
|
599
679
|
if (state.current === null) paneFocus.current = "drill";
|
|
600
680
|
setPane(state.current === null ? "model" : "root");
|
|
601
681
|
setOpen(true);
|
|
602
682
|
reload();
|
|
603
683
|
};
|
|
684
|
+
const changeQuery = (next) => {
|
|
685
|
+
setQuery(next);
|
|
686
|
+
setHighlightedIndex(0);
|
|
687
|
+
};
|
|
604
688
|
const close = (restoreFocus = false) => {
|
|
605
689
|
setOpen(false);
|
|
606
690
|
setPane("root");
|
|
@@ -608,7 +692,13 @@ window.__ModuleLoader__.load({
|
|
|
608
692
|
triggerRef.current?.focus();
|
|
609
693
|
});
|
|
610
694
|
};
|
|
695
|
+
const closeAfterSelection = () => {
|
|
696
|
+
setSelectionFocus(true);
|
|
697
|
+
close(true);
|
|
698
|
+
};
|
|
611
699
|
const drill = (next) => {
|
|
700
|
+
setQuery("");
|
|
701
|
+
setHighlightedIndex(null);
|
|
612
702
|
paneFocus.current = "drill";
|
|
613
703
|
setPane(next);
|
|
614
704
|
};
|
|
@@ -624,6 +714,7 @@ window.__ModuleLoader__.load({
|
|
|
624
714
|
items[active === -1 ? offset > 0 ? 0 : items.length - 1 : (active + offset + items.length) % items.length]?.focus();
|
|
625
715
|
};
|
|
626
716
|
const onRootKeyDown = (event) => {
|
|
717
|
+
if (event.nativeEvent.isComposing) return;
|
|
627
718
|
if (event.key === "Escape" && open) {
|
|
628
719
|
event.preventDefault();
|
|
629
720
|
if (pane !== "root" && state.current !== null) back(pane);
|
|
@@ -631,6 +722,21 @@ window.__ModuleLoader__.load({
|
|
|
631
722
|
return;
|
|
632
723
|
}
|
|
633
724
|
if (!open) return;
|
|
725
|
+
if (pane === "model" && showSearch && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
726
|
+
event.preventDefault();
|
|
727
|
+
if (!busy && visibleModels.length > 0) {
|
|
728
|
+
setHighlightedIndex((activeModelIndex + (event.key === "ArrowDown" ? 1 : -1) + visibleModels.length) % visibleModels.length);
|
|
729
|
+
searchRef.current?.focus();
|
|
730
|
+
}
|
|
731
|
+
return;
|
|
732
|
+
}
|
|
733
|
+
if (pane === "model" && showSearch && event.target instanceof HTMLInputElement && (event.key === "Enter" || event.key === "Tab" && !event.shiftKey)) {
|
|
734
|
+
if (event.key === "Tab" && visibleModels.length === 0) return;
|
|
735
|
+
event.preventDefault();
|
|
736
|
+
const highlighted = visibleModels[activeModelIndex];
|
|
737
|
+
if (!busy && highlighted !== void 0) choose(highlighted);
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
634
740
|
if (event.key === "Tab") {
|
|
635
741
|
if (event.shiftKey) {
|
|
636
742
|
event.preventDefault();
|
|
@@ -647,6 +753,11 @@ window.__ModuleLoader__.load({
|
|
|
647
753
|
}
|
|
648
754
|
if (focused !== triggerRef.current) return;
|
|
649
755
|
event.preventDefault();
|
|
756
|
+
if (pane === "model" && showSearch) {
|
|
757
|
+
setHighlightedIndex(null);
|
|
758
|
+
searchRef.current?.focus();
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
650
761
|
(menuRef.current?.querySelector("[role=\"menuitemradio\"][aria-checked=\"true\"]:not([disabled])") ?? rows.find((item) => !item.disabled))?.focus();
|
|
651
762
|
return;
|
|
652
763
|
}
|
|
@@ -662,7 +773,7 @@ window.__ModuleLoader__.load({
|
|
|
662
773
|
const settleSelection = (result) => {
|
|
663
774
|
if (result === void 0) return;
|
|
664
775
|
if (result.ok) {
|
|
665
|
-
if (rootRef.current !== null)
|
|
776
|
+
if (rootRef.current !== null) closeAfterSelection();
|
|
666
777
|
return;
|
|
667
778
|
}
|
|
668
779
|
const { error } = result;
|
|
@@ -674,12 +785,13 @@ window.__ModuleLoader__.load({
|
|
|
674
785
|
};
|
|
675
786
|
const submit = (selection) => {
|
|
676
787
|
lastActionRef.current = "select";
|
|
788
|
+
setSelectionFocus(true);
|
|
677
789
|
triggerRef.current?.focus();
|
|
678
790
|
select(selection).then(settleSelection);
|
|
679
791
|
};
|
|
680
792
|
const choose = (selection) => {
|
|
681
793
|
if (state.current?.provider === selection.provider && state.current.model === selection.model) {
|
|
682
|
-
|
|
794
|
+
closeAfterSelection();
|
|
683
795
|
return;
|
|
684
796
|
}
|
|
685
797
|
submit(selection);
|
|
@@ -687,7 +799,7 @@ window.__ModuleLoader__.load({
|
|
|
687
799
|
const chooseEffort = (effort) => {
|
|
688
800
|
if (state.current === null) return;
|
|
689
801
|
if (effectiveEffort === effort) {
|
|
690
|
-
|
|
802
|
+
closeAfterSelection();
|
|
691
803
|
return;
|
|
692
804
|
}
|
|
693
805
|
submit({
|
|
@@ -705,6 +817,7 @@ window.__ModuleLoader__.load({
|
|
|
705
817
|
});
|
|
706
818
|
itemRefs.current = [];
|
|
707
819
|
let itemIndex = 0;
|
|
820
|
+
let modelIndex = 0;
|
|
708
821
|
const itemRef = () => {
|
|
709
822
|
const at = itemIndex++;
|
|
710
823
|
return (node) => {
|
|
@@ -730,6 +843,10 @@ window.__ModuleLoader__.load({
|
|
|
730
843
|
"aria-controls": open ? `${id}-menu` : void 0,
|
|
731
844
|
title: triggerLabel,
|
|
732
845
|
"aria-busy": busy,
|
|
846
|
+
"data-selection-focus": selectionFocus ? "" : void 0,
|
|
847
|
+
onBlur: () => {
|
|
848
|
+
setSelectionFocus(false);
|
|
849
|
+
},
|
|
733
850
|
disabled: locked,
|
|
734
851
|
onClick: () => {
|
|
735
852
|
if (open) close(true);
|
|
@@ -756,7 +873,7 @@ window.__ModuleLoader__.load({
|
|
|
756
873
|
id: `${id}-menu`,
|
|
757
874
|
className: ModelSelect_module_css_default.menu,
|
|
758
875
|
style: menuPos ?? MEASURE_STYLE,
|
|
759
|
-
role: "menu",
|
|
876
|
+
role: pane === "model" ? "group" : "menu",
|
|
760
877
|
"aria-label": t("menu.aria"),
|
|
761
878
|
"aria-busy": state.status === "loading" || busy,
|
|
762
879
|
children: [
|
|
@@ -800,6 +917,34 @@ window.__ModuleLoader__.load({
|
|
|
800
917
|
]
|
|
801
918
|
})] }),
|
|
802
919
|
pane === "model" && (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
920
|
+
showSearch && (0, react_jsx_runtime.jsxs)("div", {
|
|
921
|
+
className: ModelSelect_module_css_default.searchRow,
|
|
922
|
+
children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
923
|
+
ref: searchRef,
|
|
924
|
+
className: clsx(ModelSelect_module_css_default.search, query !== "" && ModelSelect_module_css_default.searchWithQuery),
|
|
925
|
+
type: "text",
|
|
926
|
+
role: "searchbox",
|
|
927
|
+
"aria-label": t("search.placeholder"),
|
|
928
|
+
"aria-controls": `${id}-models`,
|
|
929
|
+
"aria-activedescendant": activeModelIndex < 0 ? void 0 : `${id}-model-${activeModelIndex}`,
|
|
930
|
+
placeholder: t("search.placeholder"),
|
|
931
|
+
value: query,
|
|
932
|
+
readOnly: busy,
|
|
933
|
+
onChange: (event) => {
|
|
934
|
+
changeQuery(event.target.value);
|
|
935
|
+
}
|
|
936
|
+
}), query !== "" && (0, react_jsx_runtime.jsx)("button", {
|
|
937
|
+
type: "button",
|
|
938
|
+
className: ModelSelect_module_css_default.searchClear,
|
|
939
|
+
"aria-label": t("search.clear"),
|
|
940
|
+
disabled: busy,
|
|
941
|
+
onClick: () => {
|
|
942
|
+
changeQuery("");
|
|
943
|
+
searchRef.current?.focus();
|
|
944
|
+
},
|
|
945
|
+
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseFillRegular, {})
|
|
946
|
+
})]
|
|
947
|
+
}),
|
|
803
948
|
state.status === "loading" && (0, react_jsx_runtime.jsx)("div", {
|
|
804
949
|
className: ModelSelect_module_css_default.status,
|
|
805
950
|
children: t("status.loading")
|
|
@@ -826,25 +971,34 @@ window.__ModuleLoader__.load({
|
|
|
826
971
|
})]
|
|
827
972
|
}, failure.id)),
|
|
828
973
|
(0, react_jsx_runtime.jsx)("div", {
|
|
974
|
+
ref: groupsRef,
|
|
975
|
+
id: `${id}-models`,
|
|
829
976
|
className: clsx(ModelSelect_module_css_default.groups, "scrollable"),
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
children:
|
|
837
|
-
|
|
838
|
-
id: headingId,
|
|
839
|
-
children: group.id === "deepseek-account" ? t("provider.account") : group.name
|
|
840
|
-
}), group.models.map((model) => {
|
|
977
|
+
role: "menu",
|
|
978
|
+
"aria-label": t("menu.model"),
|
|
979
|
+
hidden: filteredGroups.length === 0,
|
|
980
|
+
children: filteredGroups.map((group) => {
|
|
981
|
+
return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MenuGroup, {
|
|
982
|
+
label: group.id === "deepseek-account" ? t("provider.account") : group.name,
|
|
983
|
+
children: group.models.map((model) => {
|
|
984
|
+
const index = modelIndex++;
|
|
841
985
|
const selected = state.current?.provider === group.id && state.current.model === model.id;
|
|
842
986
|
return (0, react_jsx_runtime.jsxs)("button", {
|
|
843
987
|
ref: itemRef(),
|
|
844
988
|
type: "button",
|
|
845
989
|
role: "menuitemradio",
|
|
846
990
|
"aria-checked": selected,
|
|
847
|
-
|
|
991
|
+
id: `${id}-model-${index}`,
|
|
992
|
+
tabIndex: showSearch ? -1 : 0,
|
|
993
|
+
onFocus: () => {
|
|
994
|
+
setHighlightedIndex(index);
|
|
995
|
+
},
|
|
996
|
+
"data-highlighted": index === activeModelIndex ? "" : void 0,
|
|
997
|
+
className: clsx(ModelSelect_module_css_default.option, ModelSelect_module_css_default.modelOption, selected && ModelSelect_module_css_default.selected, index === activeModelIndex && ModelSelect_module_css_default.optionActive),
|
|
998
|
+
onMouseMove: busy || index === activeModelIndex ? void 0 : () => {
|
|
999
|
+
if (showSearch) setHighlightedIndex(index);
|
|
1000
|
+
else itemRefs.current[index]?.focus();
|
|
1001
|
+
},
|
|
848
1002
|
title: model.name,
|
|
849
1003
|
disabled: busy,
|
|
850
1004
|
onClick: () => {
|
|
@@ -864,13 +1018,14 @@ window.__ModuleLoader__.load({
|
|
|
864
1018
|
children: pending?.provider === group.id && pending.model === model.id ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: "ongoing" }) : selected ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutlineRegular, {}) : null
|
|
865
1019
|
})]
|
|
866
1020
|
}, model.id);
|
|
867
|
-
})
|
|
1021
|
+
})
|
|
868
1022
|
}, group.id);
|
|
869
1023
|
})
|
|
870
1024
|
}),
|
|
871
|
-
state.status === "ready" &&
|
|
1025
|
+
state.status === "ready" && filteredGroups.length === 0 && (0, react_jsx_runtime.jsx)("div", {
|
|
872
1026
|
className: ModelSelect_module_css_default.empty,
|
|
873
|
-
|
|
1027
|
+
role: "status",
|
|
1028
|
+
children: t(choices.length === 0 ? "empty.models" : "search.empty")
|
|
874
1029
|
})
|
|
875
1030
|
] }),
|
|
876
1031
|
pane === "effort" && (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [state.error !== null && lastActionRef.current === "load" && (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -935,8 +1090,6 @@ window.__ModuleLoader__.load({
|
|
|
935
1090
|
"command.label": "模型",
|
|
936
1091
|
"command.description": "选择本会话使用的模型",
|
|
937
1092
|
"option.loadError": "目录加载失败:{message}",
|
|
938
|
-
"option.deepseekV4Flash.description": "快速、高效且经济;适合目标明确、常规或并行任务。",
|
|
939
|
-
"option.deepseekV4Pro.description": "更强的自主编码、知识与复杂推理能力;适合复杂或质量优先的任务,但成本更高。",
|
|
940
1093
|
"trigger.fallback": "请选择模型",
|
|
941
1094
|
"trigger.loading": "正在加载模型…",
|
|
942
1095
|
"trigger.selectAria": "请选择模型",
|
|
@@ -951,6 +1104,9 @@ window.__ModuleLoader__.load({
|
|
|
951
1104
|
"error.sessionInUse": "当前会话已被占用,可能是其他正在运行的 DSH 导致的(如其他 dsh web、桌面端),请退出其他正在运行的 DSH 后重试。",
|
|
952
1105
|
"action.reload": "重新加载",
|
|
953
1106
|
"warning.groupLoad": "{name} 加载失败:{message}",
|
|
1107
|
+
"search.placeholder": "搜索模型…",
|
|
1108
|
+
"search.clear": "清除搜索",
|
|
1109
|
+
"search.empty": "没有匹配的模型。",
|
|
954
1110
|
"empty.models": "没有可用的模型。",
|
|
955
1111
|
"empty.efforts": "当前模型未提供推理等级。"
|
|
956
1112
|
};
|
|
@@ -960,8 +1116,6 @@ window.__ModuleLoader__.load({
|
|
|
960
1116
|
"command.label": "Model",
|
|
961
1117
|
"command.description": "Select the model for this conversation",
|
|
962
1118
|
"option.loadError": "Catalog failed to load: {message}",
|
|
963
|
-
"option.deepseekV4Flash.description": "Fast, efficient, and economical; suited to focused, routine, or parallel tasks.",
|
|
964
|
-
"option.deepseekV4Pro.description": "Stronger agentic coding, knowledge, and difficult reasoning; suited to complex or quality-critical tasks at higher cost.",
|
|
965
1119
|
"trigger.fallback": "Select model",
|
|
966
1120
|
"trigger.loading": "Loading models…",
|
|
967
1121
|
"trigger.selectAria": "Select model",
|
|
@@ -976,6 +1130,9 @@ window.__ModuleLoader__.load({
|
|
|
976
1130
|
"error.sessionInUse": "This session is already in use, possibly by another running DSH instance (such as dsh web or the desktop app). Quit other running DSH instances and try again.",
|
|
977
1131
|
"action.reload": "Reload",
|
|
978
1132
|
"warning.groupLoad": "{name} failed to load: {message}",
|
|
1133
|
+
"search.placeholder": "Search models…",
|
|
1134
|
+
"search.clear": "Clear search",
|
|
1135
|
+
"search.empty": "No matching models.",
|
|
979
1136
|
"empty.models": "No models available.",
|
|
980
1137
|
"empty.efforts": "This model provides no reasoning effort levels."
|
|
981
1138
|
};
|
|
@@ -985,30 +1142,20 @@ window.__ModuleLoader__.load({
|
|
|
985
1142
|
function rowId(providerId, modelId) {
|
|
986
1143
|
return `${providerId}/${modelId}`;
|
|
987
1144
|
}
|
|
988
|
-
const BUILTIN_DESCRIPTION_KEYS = {
|
|
989
|
-
"deepseek-account/deepseek-v4-flash": "option.deepseekV4Flash.description",
|
|
990
|
-
"deepseek-account/deepseek-v4-pro": "option.deepseekV4Pro.description",
|
|
991
|
-
"deepseek-official/deepseek-v4-flash": "option.deepseekV4Flash.description",
|
|
992
|
-
"deepseek-official/deepseek-v4-pro": "option.deepseekV4Pro.description"
|
|
993
|
-
};
|
|
994
|
-
function descriptionOf(providerId, model, t) {
|
|
995
|
-
const key = BUILTIN_DESCRIPTION_KEYS[rowId(providerId, model.id)];
|
|
996
|
-
return key !== void 0 && model.description === en[key] ? t(key) : model.description;
|
|
997
|
-
}
|
|
998
1145
|
/** Flatten the directory into popup rows; failure rows are listed for visibility but never selectable. */
|
|
999
1146
|
function optionsOf(directory, t) {
|
|
1000
1147
|
const rows = [];
|
|
1001
|
-
for (const group of directory.groups) {
|
|
1148
|
+
for (const group of orderModelProviders(directory.groups)) {
|
|
1002
1149
|
const name = group.id === "deepseek-account" ? t("provider.account") : group.name;
|
|
1003
|
-
for (const model of group.models) {
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1150
|
+
for (const model of group.models) rows.push({
|
|
1151
|
+
id: rowId(group.id, model.id),
|
|
1152
|
+
label: model.name,
|
|
1153
|
+
group: {
|
|
1154
|
+
name: group.id,
|
|
1155
|
+
label: name
|
|
1156
|
+
},
|
|
1157
|
+
...directory.current !== null && directory.current.provider === group.id && directory.current.model === model.id ? { active: true } : {}
|
|
1158
|
+
});
|
|
1012
1159
|
}
|
|
1013
1160
|
for (const failure of directory.failures) rows.push({
|
|
1014
1161
|
id: `failure/${failure.id}`,
|
|
@@ -1071,6 +1218,12 @@ window.__ModuleLoader__.load({
|
|
|
1071
1218
|
available: (session) => sessions.subagentAddress(session.sessionId) === void 0,
|
|
1072
1219
|
ui: {
|
|
1073
1220
|
kind: "popupSelect",
|
|
1221
|
+
searchMode: "fuzzy-label",
|
|
1222
|
+
searchLabels: () => ({
|
|
1223
|
+
placeholder: t("search.placeholder"),
|
|
1224
|
+
empty: t("empty.models"),
|
|
1225
|
+
noResults: t("search.empty")
|
|
1226
|
+
}),
|
|
1074
1227
|
options: async (session) => {
|
|
1075
1228
|
if (sessions.subagentAddress(session.sessionId) !== void 0) throw new Error("model selection is unavailable for addressed subagent sessions");
|
|
1076
1229
|
return optionsOf(await models.directoryFor(session.sessionId).load(), t);
|
|
@@ -4,9 +4,9 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
+
let react = require("react");
|
|
7
8
|
let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
|
|
8
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
-
let react = require("react");
|
|
10
10
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
11
11
|
/** Browser-relative form of {@link OPEN_IN_APP_APPS_PATH}. */
|
|
12
12
|
const OPEN_IN_APP_APPS_ROUTE = "/open-in-app/apps".slice(1);
|
|
@@ -364,12 +364,11 @@ window.__ModuleLoader__.load({
|
|
|
364
364
|
//#region lib/types/client/OpenInAppAction.js
|
|
365
365
|
/**
|
|
366
366
|
* Adapt the installed directory catalog to the shared opening control.
|
|
367
|
-
* @param props -
|
|
368
|
-
* @returns the shared control, or null without an eligible application
|
|
367
|
+
* @param props - displayed directory, installed catalog, and launch operations.
|
|
368
|
+
* @returns the shared control, or null without an eligible application.
|
|
369
369
|
*/
|
|
370
370
|
function OpenInAppAction(props) {
|
|
371
|
-
const {
|
|
372
|
-
const cwd = useSessions((state) => state.byId[sessionId]?.cwd);
|
|
371
|
+
const { absolutePath, useOpenInAppApps, useOpenInAppChoice, t } = props;
|
|
373
372
|
const available = useOpenInAppApps((apps) => apps);
|
|
374
373
|
const choice = useOpenInAppChoice((id) => id);
|
|
375
374
|
const operation = props.useOpenInAppLaunch((value) => value);
|
|
@@ -383,7 +382,7 @@ window.__ModuleLoader__.load({
|
|
|
383
382
|
}];
|
|
384
383
|
});
|
|
385
384
|
const preferred = apps.find((app) => app.id === choice) ?? apps[0];
|
|
386
|
-
if (preferred === void 0
|
|
385
|
+
if (preferred === void 0) return null;
|
|
387
386
|
return (0, react_jsx_runtime.jsx)(OpenTargetButton, {
|
|
388
387
|
kind: "directory",
|
|
389
388
|
applications: apps,
|
|
@@ -395,14 +394,14 @@ window.__ModuleLoader__.load({
|
|
|
395
394
|
execute: async (operation) => {
|
|
396
395
|
const id = operation.kind === "application" ? operation.id : preferred.id;
|
|
397
396
|
try {
|
|
398
|
-
await props.launch(id,
|
|
397
|
+
await props.launch(id, absolutePath);
|
|
399
398
|
} catch (_error) {
|
|
400
399
|
return "openError";
|
|
401
400
|
}
|
|
402
401
|
if (operation.kind === "application") props.choose(id);
|
|
403
402
|
return null;
|
|
404
403
|
}
|
|
405
|
-
},
|
|
404
|
+
}, absolutePath);
|
|
406
405
|
}
|
|
407
406
|
//#endregion
|
|
408
407
|
//#region lib/types/client/open-path.js
|
|
@@ -753,8 +752,8 @@ window.__ModuleLoader__.load({
|
|
|
753
752
|
"layout"
|
|
754
753
|
];
|
|
755
754
|
/**
|
|
756
|
-
* Client plugin body: register
|
|
757
|
-
*
|
|
755
|
+
* Client plugin body: register dictionaries, workspace directory controls, and
|
|
756
|
+
* document preview path controls.
|
|
758
757
|
* @param ctx - client root context.
|
|
759
758
|
*/
|
|
760
759
|
function apply(ctx) {
|
|
@@ -823,24 +822,39 @@ window.__ModuleLoader__.load({
|
|
|
823
822
|
};
|
|
824
823
|
}
|
|
825
824
|
}), "open-in-app: workspace command");
|
|
825
|
+
const directoryInjected = () => ({
|
|
826
|
+
hooks: {
|
|
827
|
+
openInAppApps: controller.apps,
|
|
828
|
+
openInAppChoice: controller.choice,
|
|
829
|
+
openInAppLaunch: controller.operation,
|
|
830
|
+
shortcuts: ctx.shortcuts.catalog
|
|
831
|
+
},
|
|
832
|
+
launch: (appId, path) => controller.launch(appId, path),
|
|
833
|
+
choose: (appId) => {
|
|
834
|
+
controller.choose(appId);
|
|
835
|
+
},
|
|
836
|
+
iconUrl: (appId) => `${OPEN_IN_APP_ICON_PREFIX_ROUTE}/${appId}`
|
|
837
|
+
});
|
|
838
|
+
function SessionOpenInAppAction(props) {
|
|
839
|
+
const { sessionId, useSessions } = props;
|
|
840
|
+
const cwd = useSessions((state) => state.byId[sessionId]?.cwd);
|
|
841
|
+
return cwd ? (0, react.createElement)(OpenInAppAction, {
|
|
842
|
+
...props,
|
|
843
|
+
absolutePath: cwd
|
|
844
|
+
}) : null;
|
|
845
|
+
}
|
|
826
846
|
ctx.slots.inject("conversation.session.header.utilities", () => ctx.slots.register({
|
|
827
847
|
name: "conversation.session.header.utilities",
|
|
828
848
|
id: "open-in-app",
|
|
829
849
|
order: -10,
|
|
830
850
|
locale: NS,
|
|
831
|
-
inject:
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
launch: (appId, path) => controller.launch(appId, path),
|
|
839
|
-
choose: (appId) => {
|
|
840
|
-
controller.choose(appId);
|
|
841
|
-
},
|
|
842
|
-
iconUrl: (appId) => `${OPEN_IN_APP_ICON_PREFIX_ROUTE}/${appId}`
|
|
843
|
-
})
|
|
851
|
+
inject: directoryInjected
|
|
852
|
+
}, SessionOpenInAppAction));
|
|
853
|
+
ctx.slots.inject("sidebar.right.tab.files.actions", () => ctx.slots.register({
|
|
854
|
+
name: "sidebar.right.tab.files.actions",
|
|
855
|
+
id: "open-in-app",
|
|
856
|
+
locale: NS,
|
|
857
|
+
inject: directoryInjected
|
|
844
858
|
}, OpenInAppAction));
|
|
845
859
|
const applications = (path, signal) => paths.applications(path, signal);
|
|
846
860
|
const pathInjected = () => ({
|