@ahggg/dsh-side-chat 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/README.zh-CN.md +2 -1
- package/lib/client/apply.d.ts.map +1 -1
- package/lib/client/apply.js +1 -1
- package/lib/client/apply.js.map +1 -1
- package/lib/client/contracts.d.ts +3 -1
- package/lib/client/contracts.d.ts.map +1 -1
- package/lib/client/index.d.ts +1 -1
- package/lib/client/index.d.ts.map +1 -1
- package/lib/client/model-preference.d.ts +14 -0
- package/lib/client/model-preference.d.ts.map +1 -0
- package/lib/client/model-preference.js +60 -0
- package/lib/client/model-preference.js.map +1 -0
- package/lib/client/panel/SideChatModelSelect.d.ts +17 -0
- package/lib/client/panel/SideChatModelSelect.d.ts.map +1 -0
- package/lib/client/panel/SideChatModelSelect.js +247 -0
- package/lib/client/panel/SideChatModelSelect.js.map +1 -0
- package/lib/client/panel/SideChatPanel.d.ts +2 -1
- package/lib/client/panel/SideChatPanel.d.ts.map +1 -1
- package/lib/client/panel/SideChatPanel.js +3 -3
- package/lib/client/panel/SideChatPanel.js.map +1 -1
- package/lib/client/rc6/ArchivedConversation.d.ts +3 -1
- package/lib/client/rc6/ArchivedConversation.d.ts.map +1 -1
- package/lib/client/rc6/ArchivedConversation.js +61 -11
- package/lib/client/rc6/ArchivedConversation.js.map +1 -1
- package/lib/client/rc6/Rc6SideChatOverlay.d.ts.map +1 -1
- package/lib/client/rc6/Rc6SideChatOverlay.js +14 -2
- package/lib/client/rc6/Rc6SideChatOverlay.js.map +1 -1
- package/lib/client/rc6/context.d.ts +3 -1
- package/lib/client/rc6/context.d.ts.map +1 -1
- package/lib/client/rc6/remote-adapter.d.ts.map +1 -1
- package/lib/client/rc6/remote-adapter.js +4 -0
- package/lib/client/rc6/remote-adapter.js.map +1 -1
- package/lib/client/rc6/sessions-adapter.d.ts +6 -1
- package/lib/client/rc6/sessions-adapter.d.ts.map +1 -1
- package/lib/client/rc6/sessions-adapter.js +16 -0
- package/lib/client/rc6/sessions-adapter.js.map +1 -1
- package/lib/client/side-chat-controller.d.ts +3 -1
- package/lib/client/side-chat-controller.d.ts.map +1 -1
- package/lib/client/side-chat-controller.js +45 -1
- package/lib/client/side-chat-controller.js.map +1 -1
- package/lib/client.js +705 -44
- package/lib/client.js.map +1 -1
- package/lib/host/archived-fork-service.d.ts +3 -1
- package/lib/host/archived-fork-service.d.ts.map +1 -1
- package/lib/host/archived-fork-service.js +80 -2
- package/lib/host/archived-fork-service.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -1
- package/lib/index.js.map +1 -1
- package/lib/remote.d.ts +5 -2
- package/lib/remote.d.ts.map +1 -1
- package/lib/remote.js.map +1 -1
- package/lib/shared/archived-wire.d.ts +56 -0
- package/lib/shared/archived-wire.d.ts.map +1 -1
- package/lib/shared/archived-wire.js +17 -0
- package/lib/shared/archived-wire.js.map +1 -1
- package/lib/shared/contracts.d.ts +16 -0
- package/lib/shared/contracts.d.ts.map +1 -1
- package/lib/shared/error-codes.d.ts +1 -1
- package/lib/shared/error-codes.d.ts.map +1 -1
- package/lib/shared/error-codes.js +1 -0
- package/lib/shared/error-codes.js.map +1 -1
- package/lib/typert.d.ts +2 -2
- package/lib/typert.d.ts.map +1 -1
- package/lib/typert.js +14 -3
- package/lib/typert.js.map +1 -1
- package/package.json +6 -1
package/lib/client.js
CHANGED
|
@@ -8,7 +8,7 @@ window.__ModuleLoader__.load({
|
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
10
10
|
//#region \0dsh-side-chat-css:L2hvbWUvcnVubmVyL3dvcmsvZHNoLXNpZGUtY2hhdC9kc2gtc2lkZS1jaGF0L3NyYy9jbGllbnQvcGFuZWwvc2lkZS1jaGF0LmNzcw
|
|
11
|
-
var _dsh_side_chat_css_L2hvbWUvcnVubmVyL3dvcmsvZHNoLXNpZGUtY2hhdC9kc2gtc2lkZS1jaGF0L3NyYy9jbGllbnQvcGFuZWwvc2lkZS1jaGF0LmNzcw_default = ".dsh-side-chat-overlay {\n pointer-events: none;\n}\n\n.dsh-side-chat-overlay > * {\n pointer-events: auto;\n}\n\n.dsh-side-chat-panel {\n --side-chat-border: var(--dsw-border, #d8d8de);\n --side-chat-bg: var(--dsw-surface, #ffffff);\n --side-chat-muted: var(--dsw-text-muted, #62636a);\n position: fixed;\n z-index: 70;\n right: clamp(12px, 2vw, 20px);\n bottom: clamp(12px, 2vw, 20px);\n display: flex;\n width: min(840px, calc(100vw - 32px));\n height: clamp(460px, 62dvh, 980px);\n max-height: calc(100dvh - 32px);\n min-width: 0;\n min-height: 0;\n box-sizing: border-box;\n flex-direction: column;\n overflow: hidden;\n border: 1px solid var(--side-chat-border);\n border-radius: 28px;\n background: var(--side-chat-bg);\n color: var(--dsw-text, #19191d);\n box-shadow: 0 12px 36px rgb(0 0 0 / 11%), 0 2px 8px rgb(0 0 0 / 6%);\n}\n\n.dsh-side-chat-conversation {\n display: flex;\n height: 100%;\n min-height: 0;\n flex-direction: column;\n overflow: hidden;\n}\n\n.dsh-side-chat-transcript {\n display: flex;\n min-height: 0;\n flex: 1;\n flex-direction: column;\n gap: 12px;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 18px 20px 24px;\n scrollbar-color: color-mix(in srgb, var(--side-chat-muted) 34%, transparent) transparent;\n scrollbar-width: thin;\n}\n\n.dsh-side-chat-message {\n max-width: 92%;\n padding: 10px 12px;\n border: 1px solid var(--side-chat-border);\n border-radius: 12px;\n background: var(--dsw-surface-subtle, #f7f7f9);\n}\n\n.dsh-side-chat-message[data-role=\"user\"] {\n align-self: end;\n background: var(--dsw-accent-soft, #eef4ff);\n}\n\n.dsh-side-chat-message[data-role=\"assistant\"] {\n align-self: start;\n min-width: 0;\n max-width: 100%;\n border-color: transparent;\n background: transparent;\n overflow-wrap: anywhere;\n}\n.dsh-side-chat-message-role,\n.dsh-side-chat-message-note { display: block; margin-bottom: 5px; color: var(--side-chat-muted); font-size: 12px; }\n.dsh-side-chat-message-text { white-space: pre-wrap; overflow-wrap: anywhere; }\n.dsh-side-chat-message pre,\n.dsh-side-chat-turn-notice pre { overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }\n.dsh-side-chat-message[data-role=\"assistant\"] :where(table) {\n display: block;\n max-width: 100%;\n overflow-x: auto;\n}\n.dsh-side-chat-tool-branch {\n min-width: 0;\n max-width: 100%;\n flex: 0 0 auto;\n}\n.dsh-side-chat-tool {\n display: flex;\n min-width: 0;\n max-width: 100%;\n flex: 0 0 auto;\n flex-direction: column;\n border-radius: 6px;\n}\n.dsh-side-chat-tool-row {\n position: relative;\n overflow: hidden;\n}\n.dsh-side-chat-tool[data-state=\"running\"] .dsh-side-chat-tool-row::after,\n.dsh-side-chat-tool[data-state=\"pending\"] .dsh-side-chat-tool-row::after {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 300px;\n background: linear-gradient(\n 90deg,\n transparent 0%,\n color-mix(in srgb, var(--dsw-alias-bg-base, #fff) 60%, transparent) 55%,\n transparent 100%\n );\n content: '';\n pointer-events: none;\n animation: dsh-side-chat-tool-sweep 2.6s ease-out infinite;\n}\n@keyframes dsh-side-chat-tool-sweep {\n 0% { left: -300px; }\n 90%, 100% { left: 100%; }\n}\n.dsh-side-chat-tool-row:focus-visible {\n border-radius: 4px;\n outline: 2px solid color-mix(in srgb, var(--dsw-alias-button-info, #1473e6) 42%, transparent);\n outline-offset: 1px;\n}\n.dsh-side-chat-tool-leading { flex-shrink: 0; }\n.dsh-side-chat-tool-chevron { color: var(--dsw-alias-label-secondary, var(--side-chat-muted)); }\n.dsh-side-chat-tool-title { font-weight: 400; }\n.dsh-side-chat-tool-separator {\n width: 2px;\n height: 2px;\n flex: none;\n margin: 0 8px;\n border-radius: 1px;\n background: var(--dsw-alias-label-caption, #a1a1aa);\n}\n.dsh-side-chat-tool-summary {\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n color: var(--dsw-alias-label-tertiary, var(--side-chat-muted));\n font-size: 14px;\n line-height: 24px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.dsh-side-chat-tool-error-summary { color: var(--dsw-alias-state-error-primary, var(--dsw-danger, #b42318)); }\n.dsh-side-chat-tool-body-wrap {\n display: flex;\n min-width: 0;\n flex-direction: column;\n}\n.dsh-side-chat-tool-code,\n.dsh-side-chat-tool-diff,\n.dsh-side-chat-tool-read,\n.dsh-side-chat-tool-search,\n.dsh-side-chat-tool-terminal,\n.dsh-side-chat-tool-web {\n margin: 4px 0 4px 4px;\n}\n.dsh-side-chat-tool-code { --dsl-code-block-content-font: var(--dsw-font-markdown-code-block-small); }\n.dsh-side-chat-tool-terminal {\n --dsl-terminal-font: var(--dsw-font-markdown-code-block-small);\n --dsl-terminal-line-height: 18px;\n --dsl-terminal-output-max-height: 224px;\n border: 1px solid var(--dsw-alias-border-l1, var(--side-chat-border));\n}\n.dsh-side-chat-tool-io-card {\n display: flex;\n flex-direction: column;\n margin: 4px 0 4px 4px;\n border: 1px solid var(--dsw-alias-border-l1, var(--side-chat-border));\n border-radius: 12px;\n background: var(--dsw-alias-markdown-code-block, #f6f6f7);\n font: var(--dsw-font-markdown-code-block-small, 12px/18px ui-monospace, SFMono-Regular, Consolas, monospace);\n}\n.dsh-side-chat-tool-io-section {\n display: grid;\n max-height: 150px;\n grid-template-columns: max-content minmax(0, 1fr);\n column-gap: 14px;\n align-items: baseline;\n overflow-y: auto;\n padding: 12px 16px;\n}\n.dsh-side-chat-tool-io-divider {\n height: 1px;\n flex: none;\n background: var(--dsw-alias-border-l2, var(--side-chat-border));\n}\n.dsh-side-chat-tool-io-label {\n position: sticky;\n top: 0;\n align-self: start;\n color: var(--dsw-alias-label-caption, #8d8d95);\n}\n.dsh-side-chat-tool-io-text {\n min-width: 0;\n white-space: pre-wrap;\n word-break: break-word;\n color: var(--dsw-alias-label-secondary, #4b4b52);\n}\n.dsh-side-chat-tool-io-text[data-error] { color: var(--dsw-alias-state-error-primary, var(--dsw-danger, #b42318)); }\n.dsh-side-chat-tool-subcalls {\n display: flex;\n flex-direction: column;\n gap: 4px;\n margin: 4px 0 2px 22px;\n padding-left: 8px;\n border-left: 1px solid var(--dsw-alias-border-l2, var(--side-chat-border));\n}\n.dsh-side-chat-tool-visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n}\n.dsh-side-chat-turn-notice,\n.dsh-side-chat-interaction,\n.dsh-side-chat-queue { padding: 10px; border: 1px solid var(--side-chat-border); border-radius: 10px; }\n.dsh-side-chat-interaction fieldset { margin: 8px 0; border: 1px solid var(--side-chat-border); border-radius: 8px; }\n.dsh-side-chat-question-option { display: flex; gap: 8px; margin: 8px 0; }\n.dsh-side-chat-interaction textarea { width: 100%; box-sizing: border-box; resize: vertical; }\n.dsh-side-chat-interaction-actions,\n.dsh-side-chat-composer > div,\n.dsh-side-chat-queue > div { display: flex; justify-content: end; gap: 8px; }\n.dsh-side-chat-interaction button,\n.dsh-side-chat-composer button,\n.dsh-side-chat-queue button { min-height: 32px; border: 1px solid var(--side-chat-border); border-radius: 7px; background: var(--dsw-control, #f7f7f9); color: inherit; cursor: pointer; }\n.dsh-side-chat-composer {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 8px;\n align-items: end;\n margin: 0 12px 12px;\n padding: 8px 8px 8px 12px;\n border: 1px solid var(--side-chat-border);\n border-radius: 24px;\n background: var(--side-chat-bg);\n box-shadow: 0 2px 8px rgb(0 0 0 / 5%);\n}\n.dsh-side-chat-composer textarea {\n width: 100%;\n height: auto;\n min-height: 24px;\n max-height: 160px;\n box-sizing: border-box;\n resize: none;\n overflow-y: hidden;\n padding: 6px;\n border: 0;\n outline: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n line-height: 1.5;\n}\n.dsh-side-chat-composer button { align-self: end; }\n.dsh-side-chat-loading { display: grid; height: 100%; place-items: center; color: var(--side-chat-muted); }\n\n.dsh-side-chat-header {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 8px 12px;\n align-items: center;\n flex: 0 0 auto;\n min-height: 46px;\n box-sizing: border-box;\n padding: 5px 10px 5px 16px;\n border-bottom: 1px solid var(--side-chat-border);\n background: var(--side-chat-bg);\n}\n\n.dsh-side-chat-heading { display: flex; min-width: 0; flex-direction: column; }\n.dsh-side-chat-heading strong { font-size: 14px; font-weight: 600; }\n.dsh-side-chat-footer { color: var(--side-chat-muted); font-size: 12px; }\n.dsh-side-chat-header button,\n.dsh-side-chat-inline-actions button,\n.dsh-side-chat-draft button,\n.dsh-side-chat-error button,\n.dsh-side-chat-selection-actions button {\n min-height: 32px;\n border: 1px solid var(--side-chat-border);\n border-radius: 7px;\n background: var(--dsw-control, #f7f7f9);\n color: inherit;\n cursor: pointer;\n}\n.dsh-side-chat-header button:disabled { cursor: not-allowed; opacity: .55; }\n.dsh-side-chat-header .dsh-side-chat-heading {\n align-items: flex-start;\n min-height: 0;\n padding: 4px 0;\n border: 0;\n background: transparent;\n text-align: left;\n}\n.dsh-side-chat-header > button:last-child {\n width: 32px;\n min-height: 32px;\n padding: 0;\n border: 0;\n border-radius: 999px;\n background: transparent;\n font-size: 20px;\n line-height: 1;\n}\n.dsh-side-chat-header > button:last-child:hover { background: var(--dsw-surface-subtle, #f3f3f5); }\n\n.dsh-side-chat-quote { position: relative; max-width: 100%; align-self: flex-start; }\n.dsh-side-chat-quote-chip {\n display: inline-flex;\n min-height: 36px;\n align-items: center;\n overflow: hidden;\n padding: 0;\n border: 1px solid var(--side-chat-border);\n border-radius: 999px;\n background: var(--side-chat-bg);\n transition: background-color 120ms ease;\n}\n.dsh-side-chat-quote:hover .dsh-side-chat-quote-chip,\n.dsh-side-chat-quote:focus-within .dsh-side-chat-quote-chip,\n.dsh-side-chat-quote[data-expanded] .dsh-side-chat-quote-chip { background: var(--dsw-surface-subtle, #f3f3f5); }\n.dsh-side-chat-quote-chip .dsh-side-chat-quote-trigger {\n display: inline-flex;\n min-height: 34px;\n align-items: center;\n gap: 8px;\n padding: 0 11px;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n}\n.dsh-side-chat-quote-trigger strong { font-size: 13px; font-weight: 500; line-height: 1; }\n.dsh-side-chat-quote-icon {\n width: 16px;\n height: 16px;\n flex: 0 0 auto;\n color: var(--side-chat-muted);\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-width: 1.7;\n}\n.dsh-side-chat-quote-chip .dsh-side-chat-quote-remove {\n display: grid;\n width: 0;\n height: 34px;\n min-height: 34px;\n box-sizing: border-box;\n flex: 0 0 auto;\n place-items: center;\n overflow: hidden;\n padding: 0;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: var(--side-chat-muted);\n cursor: pointer;\n font: inherit;\n font-size: 18px;\n line-height: 1;\n opacity: 0;\n pointer-events: none;\n transition: width 120ms ease, margin-left 120ms ease, opacity 100ms ease, background-color 100ms ease;\n}\n.dsh-side-chat-quote:hover .dsh-side-chat-quote-remove,\n.dsh-side-chat-quote:focus-within .dsh-side-chat-quote-remove {\n width: 30px;\n opacity: 1;\n pointer-events: auto;\n}\n.dsh-side-chat-quote-remove:hover { background: rgb(0 0 0 / 6%); color: inherit; }\n.dsh-side-chat-quote-details {\n position: absolute;\n z-index: 10;\n bottom: calc(100% + 8px);\n left: 0;\n width: min(520px, calc(100vw - 64px));\n max-width: calc(100vw - 48px);\n box-sizing: border-box;\n padding: 14px 16px;\n border: 1px solid var(--side-chat-border);\n border-radius: 16px;\n background: var(--side-chat-bg);\n box-shadow: 0 4px 14px rgb(0 0 0 / 8%);\n font-size: 14px;\n line-height: 1.45;\n opacity: 0;\n pointer-events: none;\n transform: translate(var(--dsh-side-chat-quote-offset-x, 0px), 4px);\n visibility: hidden;\n transition: opacity 100ms ease, transform 120ms ease, visibility 100ms ease;\n}\n.dsh-side-chat-quote-details::before {\n content: '';\n position: absolute;\n right: 0;\n bottom: -8px;\n left: 0;\n height: 8px;\n}\n.dsh-side-chat-quote[data-hovered] .dsh-side-chat-quote-details,\n.dsh-side-chat-quote[data-expanded] .dsh-side-chat-quote-details {\n opacity: 1;\n pointer-events: auto;\n transform: translate(var(--dsh-side-chat-quote-offset-x, 0px), 0);\n visibility: visible;\n}\n.dsh-side-chat-annotated-user-message .dsh-side-chat-quote-details {\n top: calc(100% + 8px);\n right: 0;\n bottom: auto;\n left: auto;\n}\n.dsh-side-chat-annotated-user-message .dsh-side-chat-quote-details::before {\n top: -8px;\n bottom: auto;\n}\n.dsh-side-chat-quote-details-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n.dsh-side-chat-quote-details-header strong { color: var(--side-chat-muted); font-size: 13px; font-weight: 500; }\n.dsh-side-chat-quote-detail + .dsh-side-chat-quote-detail {\n margin-top: 12px;\n padding-top: 12px;\n border-top: 1px solid var(--side-chat-border);\n}\n.dsh-side-chat-quote pre {\n max-height: 180px;\n margin: 4px 0 0;\n overflow: auto;\n white-space: pre-wrap;\n font: inherit;\n}\n.dsh-side-chat-quote-comment {\n margin-top: 9px;\n}\n.dsh-side-chat-quote-comment > strong { color: var(--side-chat-muted); font-size: 13px; font-weight: 500; }\n.dsh-side-chat-quote-comment > pre { margin-top: 4px; }\n.dsh-side-chat-error { margin: 10px 16px 0; padding: 10px 12px; border: 1px solid var(--side-chat-border); border-radius: 14px; background: var(--dsw-surface-subtle, #f7f7f9); }\n.dsh-side-chat-error { border-color: var(--dsw-danger, #b42318); }\n.dsh-side-chat-body { min-height: 0; flex: 1; overflow: hidden; }\n.dsh-side-chat-annotated-user-message {\n display: flex;\n max-width: 92%;\n align-self: end;\n align-items: flex-start;\n flex-direction: column;\n gap: 8px;\n}\n.dsh-side-chat-annotated-user-message .dsh-side-chat-message { max-width: 100%; align-self: stretch; }\n\n/* The DSH occurrence remains the durable serialization carrier, while this\n plugin-owned capsule supplies the visible and interactive projection. */\n[data-composer-seat] [data-decoration=\"chip\"][title=\"__dsh_side_chat_annotations__\"] {\n visibility: hidden;\n}\n.dsh-side-chat-parent-annotation-dock,\n.dsh-side-chat-parent-user-message {\n --side-chat-border: var(--dsw-border, #d8d8de);\n --side-chat-bg: var(--dsw-surface, #ffffff);\n --side-chat-muted: var(--dsw-text-muted, #62636a);\n color: var(--dsw-text, #19191d);\n}\n.dsh-side-chat-parent-annotation-dock {\n position: relative;\n z-index: 20;\n width: calc(100% - 32px);\n max-width: var(--dsh-composer-card-max-width, 780px);\n height: 0;\n /* The terminal zero-height dock would otherwise add a second gap between\n Todo/Goal/Queue and the input card. Its child still lands 10px inside the\n following card: -gap + top:16px against the card's own 6px gap. */\n margin: calc(0px - var(--dsh-composer-stack-gap, 6px)) auto 0;\n pointer-events: none;\n}\n.dsh-side-chat-parent-annotation-dock > .dsh-side-chat-quote {\n position: absolute;\n top: 16px;\n left: 16px;\n pointer-events: auto;\n}\n.dsh-side-chat-parent-user-message {\n display: flex;\n width: 100%;\n min-width: 0;\n flex-direction: column;\n align-items: stretch;\n gap: 8px;\n}\n.dsh-side-chat-parent-user-message > .dsh-side-chat-quote { align-self: flex-end; }\n/* rc.6 caps its inner user stack at 82%; give that percentage the full chat\n column as its containing width instead of the annotation chip's shrink width. */\n.dsh-side-chat-parent-user-message-body { width: 100%; min-width: 0; }\n.dsh-side-chat-parent-user-message > .dsh-side-chat-quote .dsh-side-chat-quote-details {\n right: 0;\n left: auto;\n}\n.dsh-side-chat-draft {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n min-height: 0;\n flex: 0 0 auto;\n gap: 8px;\n align-items: end;\n margin: auto 12px 12px;\n padding: 12px;\n border: 1px solid var(--side-chat-border);\n border-radius: 24px;\n background: var(--side-chat-bg);\n box-shadow: 0 2px 8px rgb(0 0 0 / 5%);\n}\n.dsh-side-chat-draft > .dsh-side-chat-quote { grid-column: 1 / -1; }\n.dsh-side-chat-draft label {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n}\n.dsh-side-chat-draft textarea {\n width: 100%;\n height: auto;\n min-height: 24px;\n max-height: 160px;\n box-sizing: border-box;\n resize: none;\n overflow-y: hidden;\n padding: 6px 2px;\n border: 0;\n outline: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n line-height: 1.5;\n}\n.dsh-side-chat-draft > button { align-self: end; }\n.dsh-side-chat-panel .dsh-side-chat-send-button,\n.dsh-side-chat-panel .dsh-side-chat-stop-button {\n display: grid;\n width: 34px;\n height: 34px;\n min-height: 34px;\n flex: none;\n place-items: center;\n padding: 1px 6px;\n border: 0;\n border-radius: 999px;\n background: var(--dsw-alias-button-info-fill, #4176e6);\n color: #fff;\n cursor: pointer;\n line-height: 1;\n transform: translateY(-2px);\n transition: background-color 100ms ease;\n}\n.dsh-side-chat-panel .dsh-side-chat-send-button:hover:not(:disabled),\n.dsh-side-chat-panel .dsh-side-chat-stop-button:hover:not(:disabled) {\n background: var(--dsw-alias-button-info-hover, #3467d6);\n}\n.dsh-side-chat-panel .dsh-side-chat-send-button:disabled,\n.dsh-side-chat-panel .dsh-side-chat-stop-button:disabled { cursor: default; opacity: .4; }\n.dsh-side-chat-footer { display: none; }\n.dsh-side-chat-announcer { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }\n\n.dsh-side-chat-selection-actions {\n position: fixed;\n z-index: 90;\n display: flex;\n max-width: calc(100vw - 16px);\n flex-wrap: wrap;\n gap: 0;\n padding: 0;\n border: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 999px;\n background: var(--dsw-surface, #fff);\n box-shadow: 0 4px 14px rgb(0 0 0 / 12%);\n overflow: hidden;\n}\n.dsh-side-chat-selection-actions button {\n min-height: 36px;\n padding: 0 14px;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: inherit;\n transition: background-color 120ms ease;\n}\n.dsh-side-chat-selection-actions button:hover:not(:disabled),\n.dsh-side-chat-selection-actions button:focus-visible {\n background: var(--dsw-surface-subtle, #f3f3f5);\n}\n.dsh-side-chat-selection-actions button + button {\n border-left: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 0;\n}\n\n::highlight(dsh-side-chat-annotations) {\n background: color-mix(in srgb, var(--dsw-alias-button-info, #1473e6) 18%, transparent);\n}\n::highlight(dsh-side-chat-active-annotation) {\n background: color-mix(in srgb, var(--dsw-alias-button-info, #1473e6) 32%, transparent);\n text-decoration: underline;\n text-decoration-color: color-mix(in srgb, var(--dsw-alias-button-info, #1473e6) 70%, transparent);\n text-decoration-thickness: 1px;\n}\n\n.dsh-side-chat-annotation-marker,\n.dsh-side-chat-selection-marker {\n position: fixed;\n z-index: 91;\n display: grid;\n width: 22px;\n height: 22px;\n min-height: 22px;\n box-sizing: border-box;\n place-items: center;\n padding: 0;\n border: 0;\n border-radius: 999px;\n background: var(--dsw-alias-button-info, #1473e6);\n box-shadow: 0 2px 6px rgb(0 0 0 / 14%);\n color: #fff;\n font: inherit;\n font-size: 11px;\n font-weight: 600;\n line-height: 1;\n}\n.dsh-side-chat-annotation-marker { cursor: pointer; }\n.dsh-side-chat-selection-marker { pointer-events: none; }\n.dsh-side-chat-annotation-marker[data-large],\n.dsh-side-chat-selection-marker[data-large] { font-size: 9px; }\n.dsh-side-chat-annotation-marker[data-active] {\n background: var(--dsw-alias-button-info-hover, #3467d6);\n}\n.dsh-side-chat-annotation-marker:focus-visible {\n outline: 2px solid color-mix(in srgb, var(--dsw-alias-button-info, #1473e6) 32%, transparent);\n outline-offset: 1px;\n}\n\n.dsh-side-chat-selection-comment {\n position: fixed;\n z-index: 92;\n display: grid;\n max-width: calc(100vw - 16px);\n box-sizing: border-box;\n gap: 10px;\n padding: 12px;\n border: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 20px;\n background: var(--dsw-surface, #fff);\n box-shadow: 0 5px 18px rgb(0 0 0 / 9%);\n color: var(--dsw-text, #19191d);\n}\n.dsh-side-chat-selection-comment textarea {\n width: 100%;\n min-height: 48px;\n max-height: 128px;\n box-sizing: border-box;\n resize: none;\n padding: 6px 8px;\n overflow-y: auto;\n border: 0;\n outline: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n line-height: 1.45;\n}\n.dsh-side-chat-selection-comment-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n.dsh-side-chat-selection-comment-actions button {\n min-height: 32px;\n padding: 0 14px;\n border: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 999px;\n background: var(--dsw-surface, #fff);\n color: inherit;\n cursor: pointer;\n font: inherit;\n}\n.dsh-side-chat-selection-comment-actions button:hover { background: var(--dsw-surface-subtle, #f3f3f5); }\n.dsh-side-chat-selection-comment-actions .dsh-side-chat-selection-comment-save {\n border-color: transparent;\n background: var(--dsw-alias-button-info, #1473e6);\n color: #fff;\n}\n.dsh-side-chat-selection-comment-actions .dsh-side-chat-selection-comment-save:hover {\n background: var(--dsw-alias-button-info-hover, #3467d6);\n}\n\n@media (max-width: 900px) {\n .dsh-side-chat-panel {\n right: 12px;\n bottom: 12px;\n width: calc(100vw - 24px);\n max-height: calc(100dvh - 24px);\n border-radius: 24px;\n }\n}\n\n@media (max-width: 720px) {\n .dsh-side-chat-panel {\n right: 8px;\n bottom: 8px;\n width: calc(100vw - 16px);\n height: min(78dvh, 760px);\n max-height: calc(100dvh - 16px);\n border-radius: 22px;\n }\n .dsh-side-chat-transcript { padding: 14px 14px 20px; }\n .dsh-side-chat-header { padding-left: 14px; }\n .dsh-side-chat-error { margin-inline: 12px; }\n}\n\n@media (max-height: 620px) {\n .dsh-side-chat-panel {\n bottom: 8px;\n height: calc(100dvh - 16px);\n max-height: calc(100dvh - 16px);\n }\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .dsh-side-chat-panel { animation: dsh-side-chat-enter 160ms ease-out; }\n @keyframes dsh-side-chat-enter { from { transform: translateY(18px) scale(.985); opacity: .7; } }\n}\n\n@media (forced-colors: active) {\n.dsh-side-chat-panel,\n.dsh-side-chat-selection-actions,\n.dsh-side-chat-selection-comment,\n.dsh-side-chat-annotation-marker { border: 1px solid CanvasText; }\n}\n";
|
|
11
|
+
var _dsh_side_chat_css_L2hvbWUvcnVubmVyL3dvcmsvZHNoLXNpZGUtY2hhdC9kc2gtc2lkZS1jaGF0L3NyYy9jbGllbnQvcGFuZWwvc2lkZS1jaGF0LmNzcw_default = ".dsh-side-chat-overlay {\n pointer-events: none;\n}\n\n.dsh-side-chat-overlay > * {\n pointer-events: auto;\n}\n\n.dsh-side-chat-panel {\n --side-chat-border: var(--dsw-border, #d8d8de);\n --side-chat-bg: var(--dsw-surface, #ffffff);\n --side-chat-muted: var(--dsw-text-muted, #62636a);\n position: fixed;\n z-index: 70;\n right: clamp(12px, 2vw, 20px);\n bottom: clamp(12px, 2vw, 20px);\n display: flex;\n width: min(840px, calc(100vw - 32px));\n height: clamp(460px, 62dvh, 980px);\n max-height: calc(100dvh - 32px);\n min-width: 0;\n min-height: 0;\n box-sizing: border-box;\n flex-direction: column;\n overflow: hidden;\n border: 1px solid var(--side-chat-border);\n border-radius: 28px;\n background: var(--side-chat-bg);\n color: var(--dsw-text, #19191d);\n box-shadow: 0 12px 36px rgb(0 0 0 / 11%), 0 2px 8px rgb(0 0 0 / 6%);\n}\n\n.dsh-side-chat-conversation {\n display: flex;\n height: 100%;\n min-height: 0;\n flex-direction: column;\n overflow: hidden;\n}\n\n.dsh-side-chat-transcript {\n display: flex;\n min-height: 0;\n flex: 1;\n flex-direction: column;\n gap: 12px;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 18px 20px 24px;\n scrollbar-color: color-mix(in srgb, var(--side-chat-muted) 34%, transparent) transparent;\n scrollbar-width: thin;\n}\n\n.dsh-side-chat-message {\n max-width: 92%;\n padding: 10px 12px;\n border: 1px solid var(--side-chat-border);\n border-radius: 12px;\n background: var(--dsw-surface-subtle, #f7f7f9);\n}\n\n.dsh-side-chat-message[data-role=\"user\"] {\n align-self: end;\n background: var(--dsw-accent-soft, #eef4ff);\n}\n\n.dsh-side-chat-message[data-role=\"assistant\"] {\n align-self: start;\n min-width: 0;\n max-width: 100%;\n border-color: transparent;\n background: transparent;\n overflow-wrap: anywhere;\n}\n.dsh-side-chat-message-role,\n.dsh-side-chat-message-note { display: block; margin-bottom: 5px; color: var(--side-chat-muted); font-size: 12px; }\n.dsh-side-chat-message-text { white-space: pre-wrap; overflow-wrap: anywhere; }\n.dsh-side-chat-message pre,\n.dsh-side-chat-turn-notice pre { overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }\n.dsh-side-chat-message[data-role=\"assistant\"] :where(table) {\n display: block;\n max-width: 100%;\n overflow-x: auto;\n}\n.dsh-side-chat-reasoning {\n display: flex;\n flex-direction: column;\n}\n.dsh-side-chat-reasoning-row {\n position: relative;\n overflow: hidden;\n}\n.dsh-side-chat-reasoning[data-state=\"running\"] .dsh-side-chat-reasoning-row::after {\n position: absolute;\n inset-block: 0;\n left: 0;\n width: 300px;\n background: linear-gradient(\n 90deg,\n transparent 0%,\n color-mix(in srgb, var(--dsw-alias-bg-base, #fff) 60%, transparent) 55%,\n transparent 100%\n );\n content: '';\n pointer-events: none;\n animation: dsh-side-chat-reasoning-sweep 2.6s ease-out infinite;\n}\n@keyframes dsh-side-chat-reasoning-sweep {\n 0% { left: -300px; }\n 90%, 100% { left: 100%; }\n}\n.dsh-side-chat-reasoning-leading { flex-shrink: 0; }\n.dsh-side-chat-reasoning-chevron { color: var(--dsw-alias-label-secondary, var(--side-chat-muted)); }\n.dsh-side-chat-reasoning-title { font-weight: 400; }\n.dsh-side-chat-reasoning-separator {\n width: 2px;\n height: 2px;\n flex: none;\n margin: 0 8px;\n border-radius: 1px;\n background: var(--dsw-alias-label-caption, #a1a1aa);\n}\n.dsh-side-chat-reasoning-summary {\n min-width: 0;\n flex: auto;\n overflow: hidden;\n color: var(--dsw-alias-label-tertiary, var(--side-chat-muted));\n font-size: 14px;\n line-height: 24px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.dsh-side-chat-reasoning-summary[data-follow-end] { text-overflow: clip; }\n.dsh-side-chat-reasoning-body {\n padding: 4px 0 4px 22px;\n color: var(--dsw-alias-label-tertiary, var(--side-chat-muted));\n font-size: 14px;\n line-height: 24px;\n white-space: pre-wrap;\n word-break: break-word;\n}\n.dsh-side-chat-reasoning-visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n}\n.dsh-side-chat-tool-branch {\n min-width: 0;\n max-width: 100%;\n flex: 0 0 auto;\n}\n.dsh-side-chat-tool {\n display: flex;\n min-width: 0;\n max-width: 100%;\n flex: 0 0 auto;\n flex-direction: column;\n border-radius: 6px;\n}\n.dsh-side-chat-tool-row {\n position: relative;\n overflow: hidden;\n}\n.dsh-side-chat-tool[data-state=\"running\"] .dsh-side-chat-tool-row::after,\n.dsh-side-chat-tool[data-state=\"pending\"] .dsh-side-chat-tool-row::after {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 300px;\n background: linear-gradient(\n 90deg,\n transparent 0%,\n color-mix(in srgb, var(--dsw-alias-bg-base, #fff) 60%, transparent) 55%,\n transparent 100%\n );\n content: '';\n pointer-events: none;\n animation: dsh-side-chat-tool-sweep 2.6s ease-out infinite;\n}\n@keyframes dsh-side-chat-tool-sweep {\n 0% { left: -300px; }\n 90%, 100% { left: 100%; }\n}\n.dsh-side-chat-tool-row:focus-visible {\n border-radius: 4px;\n outline: 2px solid color-mix(in srgb, var(--dsw-alias-button-info, #1473e6) 42%, transparent);\n outline-offset: 1px;\n}\n.dsh-side-chat-tool-leading { flex-shrink: 0; }\n.dsh-side-chat-tool-chevron { color: var(--dsw-alias-label-secondary, var(--side-chat-muted)); }\n.dsh-side-chat-tool-title { font-weight: 400; }\n.dsh-side-chat-tool-separator {\n width: 2px;\n height: 2px;\n flex: none;\n margin: 0 8px;\n border-radius: 1px;\n background: var(--dsw-alias-label-caption, #a1a1aa);\n}\n.dsh-side-chat-tool-summary {\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n color: var(--dsw-alias-label-tertiary, var(--side-chat-muted));\n font-size: 14px;\n line-height: 24px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.dsh-side-chat-tool-error-summary { color: var(--dsw-alias-state-error-primary, var(--dsw-danger, #b42318)); }\n.dsh-side-chat-tool-body-wrap {\n display: flex;\n min-width: 0;\n flex-direction: column;\n}\n.dsh-side-chat-tool-code,\n.dsh-side-chat-tool-diff,\n.dsh-side-chat-tool-read,\n.dsh-side-chat-tool-search,\n.dsh-side-chat-tool-terminal,\n.dsh-side-chat-tool-web {\n margin: 4px 0 4px 4px;\n}\n.dsh-side-chat-tool-code { --dsl-code-block-content-font: var(--dsw-font-markdown-code-block-small); }\n.dsh-side-chat-tool-terminal {\n --dsl-terminal-font: var(--dsw-font-markdown-code-block-small);\n --dsl-terminal-line-height: 18px;\n --dsl-terminal-output-max-height: 224px;\n border: 1px solid var(--dsw-alias-border-l1, var(--side-chat-border));\n}\n.dsh-side-chat-tool-io-card {\n display: flex;\n flex-direction: column;\n margin: 4px 0 4px 4px;\n border: 1px solid var(--dsw-alias-border-l1, var(--side-chat-border));\n border-radius: 12px;\n background: var(--dsw-alias-markdown-code-block, #f6f6f7);\n font: var(--dsw-font-markdown-code-block-small, 12px/18px ui-monospace, SFMono-Regular, Consolas, monospace);\n}\n.dsh-side-chat-tool-io-section {\n display: grid;\n max-height: 150px;\n grid-template-columns: max-content minmax(0, 1fr);\n column-gap: 14px;\n align-items: baseline;\n overflow-y: auto;\n padding: 12px 16px;\n}\n.dsh-side-chat-tool-io-divider {\n height: 1px;\n flex: none;\n background: var(--dsw-alias-border-l2, var(--side-chat-border));\n}\n.dsh-side-chat-tool-io-label {\n position: sticky;\n top: 0;\n align-self: start;\n color: var(--dsw-alias-label-caption, #8d8d95);\n}\n.dsh-side-chat-tool-io-text {\n min-width: 0;\n white-space: pre-wrap;\n word-break: break-word;\n color: var(--dsw-alias-label-secondary, #4b4b52);\n}\n.dsh-side-chat-tool-io-text[data-error] { color: var(--dsw-alias-state-error-primary, var(--dsw-danger, #b42318)); }\n.dsh-side-chat-tool-subcalls {\n display: flex;\n flex-direction: column;\n gap: 4px;\n margin: 4px 0 2px 22px;\n padding-left: 8px;\n border-left: 1px solid var(--dsw-alias-border-l2, var(--side-chat-border));\n}\n.dsh-side-chat-tool-visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n}\n.dsh-side-chat-turn-notice,\n.dsh-side-chat-interaction,\n.dsh-side-chat-queue { padding: 10px; border: 1px solid var(--side-chat-border); border-radius: 10px; }\n.dsh-side-chat-interaction fieldset { margin: 8px 0; border: 1px solid var(--side-chat-border); border-radius: 8px; }\n.dsh-side-chat-question-option { display: flex; gap: 8px; margin: 8px 0; }\n.dsh-side-chat-interaction textarea { width: 100%; box-sizing: border-box; resize: vertical; }\n.dsh-side-chat-interaction-actions,\n.dsh-side-chat-queue > div { display: flex; justify-content: end; gap: 8px; }\n.dsh-side-chat-interaction button,\n.dsh-side-chat-queue button { min-height: 32px; border: 1px solid var(--side-chat-border); border-radius: 7px; background: var(--dsw-control, #f7f7f9); color: inherit; cursor: pointer; }\n.dsh-side-chat-composer {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n gap: 6px;\n align-items: end;\n margin: 0 12px 12px;\n padding: 8px 8px 8px 12px;\n border: 1px solid var(--side-chat-border);\n border-radius: 24px;\n background: var(--side-chat-bg);\n box-shadow: 0 2px 8px rgb(0 0 0 / 5%);\n}\n.dsh-side-chat-composer textarea {\n grid-column: 1 / -1;\n width: 100%;\n height: auto;\n min-height: 24px;\n max-height: 160px;\n box-sizing: border-box;\n resize: none;\n overflow-y: hidden;\n padding: 6px;\n border: 0;\n outline: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n line-height: 1.5;\n}\n.dsh-side-chat-composer-actions,\n.dsh-side-chat-draft-actions {\n display: flex;\n min-width: 0;\n align-items: center;\n justify-content: flex-end;\n gap: 6px;\n}\n.dsh-side-chat-model-root {\n position: relative;\n min-width: 0;\n}\n.dsh-side-chat-model-trigger {\n display: flex;\n width: auto;\n height: 28px;\n min-height: 28px;\n max-width: 220px;\n align-items: center;\n gap: 4px;\n padding: 0 4px 0 8px;\n border: 0;\n border-radius: 24px;\n outline: 0;\n background: transparent;\n color: var(--dsw-alias-label-secondary, var(--side-chat-muted));\n cursor: pointer;\n font: inherit;\n font-size: 13px;\n font-weight: 500;\n line-height: 20px;\n}\n.dsh-side-chat-model-trigger:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover, var(--dsw-surface-subtle, #f3f3f5));\n}\n.dsh-side-chat-model-trigger:focus-visible {\n box-shadow: 0 0 0 2px var(--dsw-alias-border-l3, var(--side-chat-border));\n}\n.dsh-side-chat-model-trigger:disabled {\n color: var(--dsw-alias-label-dimmed, #a1a1aa);\n cursor: default;\n}\n.dsh-side-chat-model-trigger-label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.dsh-side-chat-model-trigger-effort {\n flex: none;\n color: var(--dsw-alias-label-caption, #8d8d95);\n}\n.dsh-side-chat-model-chevron {\n flex: none;\n color: var(--dsw-alias-label-caption, #8d8d95);\n transition: transform 120ms ease;\n}\n.dsh-side-chat-model-chevron-open { transform: rotate(180deg); }\n.dsh-side-chat-model-menu {\n position: absolute;\n z-index: 20;\n right: 0;\n bottom: calc(100% + 8px);\n display: flex;\n width: min(240px, calc(100vw - 32px));\n max-height: min(360px, calc(100dvh - 96px));\n flex-direction: column;\n overflow: hidden;\n padding: 4px;\n border: 1px solid var(--dsw-alias-border-inverted, var(--side-chat-border));\n border-radius: 12px;\n background: var(--dsw-specific-menu, var(--side-chat-bg));\n box-shadow: var(--dsw-shadow-lv3, 0 8px 24px rgb(0 0 0 / 16%));\n color: var(--dsw-alias-label-primary, inherit);\n --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2, #a1a1aa);\n --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2, #71717a);\n}\n.dsh-side-chat-model-status,\n.dsh-side-chat-model-empty {\n padding: 10px;\n color: var(--dsw-alias-label-tertiary, var(--side-chat-muted));\n font-size: 13px;\n line-height: 20px;\n}\n.dsh-side-chat-model-error,\n.dsh-side-chat-model-warning {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 8px;\n margin-bottom: 4px;\n padding: 7px 8px;\n border-radius: 8px;\n background: var(--dsw-alias-interactive-bg-hover-danger, #fff1f0);\n color: var(--dsw-alias-state-error-primary, var(--dsw-danger, #b42318));\n font-size: 12px;\n line-height: 18px;\n}\n.dsh-side-chat-model-warning {\n background: var(--dsw-alias-bg-module-platform, #fff8e6);\n color: var(--dsw-alias-state-warn-label, #8a5a00);\n}\n.dsh-side-chat-model-retry {\n min-height: 0;\n flex: none;\n padding: 0;\n border: 0;\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n font-weight: 600;\n}\n.dsh-side-chat-model-groups {\n min-height: 0;\n overflow-y: auto;\n}\n.dsh-side-chat-model-group + .dsh-side-chat-model-group { margin-top: 4px; }\n.dsh-side-chat-model-group-title {\n position: sticky;\n z-index: 1;\n top: 0;\n padding: 5px 8px 3px;\n background: var(--dsw-specific-menu, var(--side-chat-bg));\n color: var(--dsw-alias-label-tertiary, var(--side-chat-muted));\n font-size: 12px;\n font-weight: 500;\n line-height: 18px;\n}\n.dsh-side-chat-model-option {\n display: flex;\n width: 100%;\n min-height: 38px;\n align-items: center;\n gap: 8px;\n padding: 6px 8px;\n border: 0;\n border-radius: 10px;\n outline: 0;\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n text-align: left;\n}\n.dsh-side-chat-model-option:hover:not(:disabled),\n.dsh-side-chat-model-option:focus-visible {\n background: var(--dsw-alias-interactive-bg-hover, var(--dsw-surface-subtle, #f3f3f5));\n}\n.dsh-side-chat-model-selected { background: transparent; }\n.dsh-side-chat-model-option:disabled {\n color: var(--dsw-alias-label-dimmed, #a1a1aa);\n cursor: default;\n}\n.dsh-side-chat-model-option-copy {\n display: flex;\n min-width: 0;\n flex: 1;\n flex-direction: column;\n}\n.dsh-side-chat-model-name {\n overflow: hidden;\n color: inherit;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.dsh-side-chat-model-description {\n overflow: hidden;\n color: var(--dsw-alias-label-tertiary, var(--side-chat-muted));\n font-size: 12px;\n line-height: 18px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.dsh-side-chat-model-check {\n display: grid;\n flex: 0 0 18px;\n place-items: center;\n color: var(--dsw-alias-label-primary, inherit);\n}\n.dsh-side-chat-model-cell {\n display: flex;\n width: 100%;\n height: 40px;\n align-items: center;\n gap: 8px;\n padding: 0 10px;\n border: 0;\n border-radius: 10px;\n background: transparent;\n color: var(--dsw-alias-label-primary, inherit);\n cursor: pointer;\n font: inherit;\n font-size: 14px;\n line-height: 22px;\n text-align: left;\n}\n.dsh-side-chat-model-cell:hover {\n background: var(--dsw-alias-interactive-bg-hover, var(--dsw-surface-subtle, #f3f3f5));\n}\n.dsh-side-chat-model-cell-label {\n min-width: 0;\n flex: auto;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.dsh-side-chat-model-cell-value {\n min-width: 0;\n flex: 0 auto;\n overflow: hidden;\n color: var(--dsw-alias-label-tertiary, var(--side-chat-muted));\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.dsh-side-chat-model-cell-chevron {\n flex: none;\n color: var(--dsw-alias-label-tertiary, var(--side-chat-muted));\n}\n.dsh-side-chat-loading { display: grid; height: 100%; place-items: center; color: var(--side-chat-muted); }\n\n.dsh-side-chat-header {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 8px 12px;\n align-items: center;\n flex: 0 0 auto;\n min-height: 46px;\n box-sizing: border-box;\n padding: 5px 10px 5px 16px;\n border-bottom: 1px solid var(--side-chat-border);\n background: var(--side-chat-bg);\n}\n\n.dsh-side-chat-heading { display: flex; min-width: 0; flex-direction: column; }\n.dsh-side-chat-heading strong { font-size: 14px; font-weight: 600; }\n.dsh-side-chat-footer { color: var(--side-chat-muted); font-size: 12px; }\n.dsh-side-chat-header button,\n.dsh-side-chat-inline-actions button,\n.dsh-side-chat-error button,\n.dsh-side-chat-selection-actions button {\n min-height: 32px;\n border: 1px solid var(--side-chat-border);\n border-radius: 7px;\n background: var(--dsw-control, #f7f7f9);\n color: inherit;\n cursor: pointer;\n}\n.dsh-side-chat-header button:disabled { cursor: not-allowed; opacity: .55; }\n.dsh-side-chat-header .dsh-side-chat-heading {\n align-items: flex-start;\n min-height: 0;\n padding: 4px 0;\n border: 0;\n background: transparent;\n text-align: left;\n}\n.dsh-side-chat-header > button:last-child {\n width: 32px;\n min-height: 32px;\n padding: 0;\n border: 0;\n border-radius: 999px;\n background: transparent;\n font-size: 20px;\n line-height: 1;\n}\n.dsh-side-chat-header > button:last-child:hover { background: var(--dsw-surface-subtle, #f3f3f5); }\n\n.dsh-side-chat-quote { position: relative; max-width: 100%; align-self: flex-start; }\n.dsh-side-chat-quote-chip {\n display: inline-flex;\n min-height: 36px;\n align-items: center;\n overflow: hidden;\n padding: 0;\n border: 1px solid var(--side-chat-border);\n border-radius: 999px;\n background: var(--side-chat-bg);\n transition: background-color 120ms ease;\n}\n.dsh-side-chat-quote:hover .dsh-side-chat-quote-chip,\n.dsh-side-chat-quote:focus-within .dsh-side-chat-quote-chip,\n.dsh-side-chat-quote[data-expanded] .dsh-side-chat-quote-chip { background: var(--dsw-surface-subtle, #f3f3f5); }\n.dsh-side-chat-quote-chip .dsh-side-chat-quote-trigger {\n display: inline-flex;\n min-height: 34px;\n align-items: center;\n gap: 8px;\n padding: 0 11px;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n}\n.dsh-side-chat-quote-trigger strong { font-size: 13px; font-weight: 500; line-height: 1; }\n.dsh-side-chat-quote-icon {\n width: 16px;\n height: 16px;\n flex: 0 0 auto;\n color: var(--side-chat-muted);\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-width: 1.7;\n}\n.dsh-side-chat-quote-chip .dsh-side-chat-quote-remove {\n display: grid;\n width: 0;\n height: 34px;\n min-height: 34px;\n box-sizing: border-box;\n flex: 0 0 auto;\n place-items: center;\n overflow: hidden;\n padding: 0;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: var(--side-chat-muted);\n cursor: pointer;\n font: inherit;\n font-size: 18px;\n line-height: 1;\n opacity: 0;\n pointer-events: none;\n transition: width 120ms ease, margin-left 120ms ease, opacity 100ms ease, background-color 100ms ease;\n}\n.dsh-side-chat-quote:hover .dsh-side-chat-quote-remove,\n.dsh-side-chat-quote:focus-within .dsh-side-chat-quote-remove {\n width: 30px;\n opacity: 1;\n pointer-events: auto;\n}\n.dsh-side-chat-quote-remove:hover { background: rgb(0 0 0 / 6%); color: inherit; }\n.dsh-side-chat-quote-details {\n position: absolute;\n z-index: 10;\n bottom: calc(100% + 8px);\n left: 0;\n width: min(520px, calc(100vw - 64px));\n max-width: calc(100vw - 48px);\n box-sizing: border-box;\n padding: 14px 16px;\n border: 1px solid var(--side-chat-border);\n border-radius: 16px;\n background: var(--side-chat-bg);\n box-shadow: 0 4px 14px rgb(0 0 0 / 8%);\n font-size: 14px;\n line-height: 1.45;\n opacity: 0;\n pointer-events: none;\n transform: translate(var(--dsh-side-chat-quote-offset-x, 0px), 4px);\n visibility: hidden;\n transition: opacity 100ms ease, transform 120ms ease, visibility 100ms ease;\n}\n.dsh-side-chat-quote-details::before {\n content: '';\n position: absolute;\n right: 0;\n bottom: -8px;\n left: 0;\n height: 8px;\n}\n.dsh-side-chat-quote[data-hovered] .dsh-side-chat-quote-details,\n.dsh-side-chat-quote[data-expanded] .dsh-side-chat-quote-details {\n opacity: 1;\n pointer-events: auto;\n transform: translate(var(--dsh-side-chat-quote-offset-x, 0px), 0);\n visibility: visible;\n}\n.dsh-side-chat-annotated-user-message .dsh-side-chat-quote-details {\n top: calc(100% + 8px);\n right: 0;\n bottom: auto;\n left: auto;\n}\n.dsh-side-chat-annotated-user-message .dsh-side-chat-quote-details::before {\n top: -8px;\n bottom: auto;\n}\n.dsh-side-chat-quote-details-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n.dsh-side-chat-quote-details-header strong { color: var(--side-chat-muted); font-size: 13px; font-weight: 500; }\n.dsh-side-chat-quote-detail + .dsh-side-chat-quote-detail {\n margin-top: 12px;\n padding-top: 12px;\n border-top: 1px solid var(--side-chat-border);\n}\n.dsh-side-chat-quote pre {\n max-height: 180px;\n margin: 4px 0 0;\n overflow: auto;\n white-space: pre-wrap;\n font: inherit;\n}\n.dsh-side-chat-quote-comment {\n margin-top: 9px;\n}\n.dsh-side-chat-quote-comment > strong { color: var(--side-chat-muted); font-size: 13px; font-weight: 500; }\n.dsh-side-chat-quote-comment > pre { margin-top: 4px; }\n.dsh-side-chat-error { margin: 10px 16px 0; padding: 10px 12px; border: 1px solid var(--side-chat-border); border-radius: 14px; background: var(--dsw-surface-subtle, #f7f7f9); }\n.dsh-side-chat-error { border-color: var(--dsw-danger, #b42318); }\n.dsh-side-chat-body { min-height: 0; flex: 1; overflow: hidden; }\n.dsh-side-chat-annotated-user-message {\n display: flex;\n max-width: 92%;\n align-self: end;\n align-items: flex-start;\n flex-direction: column;\n gap: 8px;\n}\n.dsh-side-chat-annotated-user-message .dsh-side-chat-message { max-width: 100%; align-self: stretch; }\n\n/* The DSH occurrence remains the durable serialization carrier, while this\n plugin-owned capsule supplies the visible and interactive projection. */\n[data-composer-seat] [data-decoration=\"chip\"][title=\"__dsh_side_chat_annotations__\"] {\n visibility: hidden;\n}\n.dsh-side-chat-parent-annotation-dock,\n.dsh-side-chat-parent-user-message {\n --side-chat-border: var(--dsw-border, #d8d8de);\n --side-chat-bg: var(--dsw-surface, #ffffff);\n --side-chat-muted: var(--dsw-text-muted, #62636a);\n color: var(--dsw-text, #19191d);\n}\n.dsh-side-chat-parent-annotation-dock {\n position: relative;\n z-index: 20;\n width: calc(100% - 32px);\n max-width: var(--dsh-composer-card-max-width, 780px);\n height: 0;\n /* The terminal zero-height dock would otherwise add a second gap between\n Todo/Goal/Queue and the input card. Its child still lands 10px inside the\n following card: -gap + top:16px against the card's own 6px gap. */\n margin: calc(0px - var(--dsh-composer-stack-gap, 6px)) auto 0;\n pointer-events: none;\n}\n.dsh-side-chat-parent-annotation-dock > .dsh-side-chat-quote {\n position: absolute;\n top: 16px;\n left: 16px;\n pointer-events: auto;\n}\n.dsh-side-chat-parent-user-message {\n display: flex;\n width: 100%;\n min-width: 0;\n flex-direction: column;\n align-items: stretch;\n gap: 8px;\n}\n.dsh-side-chat-parent-user-message > .dsh-side-chat-quote { align-self: flex-end; }\n/* rc.6 caps its inner user stack at 82%; give that percentage the full chat\n column as its containing width instead of the annotation chip's shrink width. */\n.dsh-side-chat-parent-user-message-body { width: 100%; min-width: 0; }\n.dsh-side-chat-parent-user-message > .dsh-side-chat-quote .dsh-side-chat-quote-details {\n right: 0;\n left: auto;\n}\n.dsh-side-chat-draft {\n display: grid;\n grid-template-columns: minmax(0, 1fr);\n min-height: 0;\n flex: 0 0 auto;\n gap: 6px;\n align-items: end;\n margin: auto 12px 12px;\n padding: 12px;\n border: 1px solid var(--side-chat-border);\n border-radius: 24px;\n background: var(--side-chat-bg);\n box-shadow: 0 2px 8px rgb(0 0 0 / 5%);\n}\n.dsh-side-chat-draft > .dsh-side-chat-quote { grid-column: 1 / -1; }\n.dsh-side-chat-draft label {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n}\n.dsh-side-chat-draft textarea {\n grid-column: 1 / -1;\n width: 100%;\n height: auto;\n min-height: 24px;\n max-height: 160px;\n box-sizing: border-box;\n resize: none;\n overflow-y: hidden;\n padding: 6px 2px;\n border: 0;\n outline: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n line-height: 1.5;\n}\n.dsh-side-chat-panel .dsh-side-chat-send-button,\n.dsh-side-chat-panel .dsh-side-chat-stop-button {\n display: grid;\n width: 34px;\n height: 34px;\n min-height: 34px;\n flex: none;\n place-items: center;\n padding: 1px 6px;\n border: 0;\n border-radius: 999px;\n background: var(--dsw-alias-button-info-fill, #4176e6);\n color: #fff;\n cursor: pointer;\n line-height: 1;\n transform: translateY(-2px);\n transition: background-color 100ms ease;\n}\n.dsh-side-chat-panel .dsh-side-chat-send-button:hover:not(:disabled),\n.dsh-side-chat-panel .dsh-side-chat-stop-button:hover:not(:disabled) {\n background: var(--dsw-alias-button-info-hover, #3467d6);\n}\n.dsh-side-chat-panel .dsh-side-chat-send-button:disabled,\n.dsh-side-chat-panel .dsh-side-chat-stop-button:disabled { cursor: default; opacity: .4; }\n.dsh-side-chat-footer { display: none; }\n.dsh-side-chat-announcer { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }\n\n.dsh-side-chat-selection-actions {\n position: fixed;\n z-index: 90;\n display: flex;\n max-width: calc(100vw - 16px);\n flex-wrap: wrap;\n gap: 0;\n padding: 0;\n border: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 999px;\n background: var(--dsw-surface, #fff);\n box-shadow: 0 4px 14px rgb(0 0 0 / 12%);\n overflow: hidden;\n}\n.dsh-side-chat-selection-actions button {\n min-height: 36px;\n padding: 0 14px;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: inherit;\n transition: background-color 120ms ease;\n}\n.dsh-side-chat-selection-actions button:hover:not(:disabled),\n.dsh-side-chat-selection-actions button:focus-visible {\n background: var(--dsw-surface-subtle, #f3f3f5);\n}\n.dsh-side-chat-selection-actions button + button {\n border-left: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 0;\n}\n\n::highlight(dsh-side-chat-annotations) {\n background: color-mix(in srgb, var(--dsw-alias-button-info, #1473e6) 18%, transparent);\n}\n::highlight(dsh-side-chat-active-annotation) {\n background: color-mix(in srgb, var(--dsw-alias-button-info, #1473e6) 32%, transparent);\n text-decoration: underline;\n text-decoration-color: color-mix(in srgb, var(--dsw-alias-button-info, #1473e6) 70%, transparent);\n text-decoration-thickness: 1px;\n}\n\n.dsh-side-chat-annotation-marker,\n.dsh-side-chat-selection-marker {\n position: fixed;\n z-index: 91;\n display: grid;\n width: 22px;\n height: 22px;\n min-height: 22px;\n box-sizing: border-box;\n place-items: center;\n padding: 0;\n border: 0;\n border-radius: 999px;\n background: var(--dsw-alias-button-info, #1473e6);\n box-shadow: 0 2px 6px rgb(0 0 0 / 14%);\n color: #fff;\n font: inherit;\n font-size: 11px;\n font-weight: 600;\n line-height: 1;\n}\n.dsh-side-chat-annotation-marker { cursor: pointer; }\n.dsh-side-chat-selection-marker { pointer-events: none; }\n.dsh-side-chat-annotation-marker[data-large],\n.dsh-side-chat-selection-marker[data-large] { font-size: 9px; }\n.dsh-side-chat-annotation-marker[data-active] {\n background: var(--dsw-alias-button-info-hover, #3467d6);\n}\n.dsh-side-chat-annotation-marker:focus-visible {\n outline: 2px solid color-mix(in srgb, var(--dsw-alias-button-info, #1473e6) 32%, transparent);\n outline-offset: 1px;\n}\n\n.dsh-side-chat-selection-comment {\n position: fixed;\n z-index: 92;\n display: grid;\n max-width: calc(100vw - 16px);\n box-sizing: border-box;\n gap: 10px;\n padding: 12px;\n border: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 20px;\n background: var(--dsw-surface, #fff);\n box-shadow: 0 5px 18px rgb(0 0 0 / 9%);\n color: var(--dsw-text, #19191d);\n}\n.dsh-side-chat-selection-comment textarea {\n width: 100%;\n min-height: 48px;\n max-height: 128px;\n box-sizing: border-box;\n resize: none;\n padding: 6px 8px;\n overflow-y: auto;\n border: 0;\n outline: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n line-height: 1.45;\n}\n.dsh-side-chat-selection-comment-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n.dsh-side-chat-selection-comment-actions button {\n min-height: 32px;\n padding: 0 14px;\n border: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 999px;\n background: var(--dsw-surface, #fff);\n color: inherit;\n cursor: pointer;\n font: inherit;\n}\n.dsh-side-chat-selection-comment-actions button:hover { background: var(--dsw-surface-subtle, #f3f3f5); }\n.dsh-side-chat-selection-comment-actions .dsh-side-chat-selection-comment-save {\n border-color: transparent;\n background: var(--dsw-alias-button-info, #1473e6);\n color: #fff;\n}\n.dsh-side-chat-selection-comment-actions .dsh-side-chat-selection-comment-save:hover {\n background: var(--dsw-alias-button-info-hover, #3467d6);\n}\n\n@media (max-width: 900px) {\n .dsh-side-chat-panel {\n right: 12px;\n bottom: 12px;\n width: calc(100vw - 24px);\n max-height: calc(100dvh - 24px);\n border-radius: 24px;\n }\n}\n\n@media (max-width: 720px) {\n .dsh-side-chat-panel {\n right: 8px;\n bottom: 8px;\n width: calc(100vw - 16px);\n height: min(78dvh, 760px);\n max-height: calc(100dvh - 16px);\n border-radius: 22px;\n }\n .dsh-side-chat-transcript { padding: 14px 14px 20px; }\n .dsh-side-chat-header { padding-left: 14px; }\n .dsh-side-chat-error { margin-inline: 12px; }\n}\n\n@media (max-height: 620px) {\n .dsh-side-chat-panel {\n bottom: 8px;\n height: calc(100dvh - 16px);\n max-height: calc(100dvh - 16px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-side-chat-reasoning[data-state=\"running\"] .dsh-side-chat-reasoning-row::after { animation: none; }\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .dsh-side-chat-panel { animation: dsh-side-chat-enter 160ms ease-out; }\n @keyframes dsh-side-chat-enter { from { transform: translateY(18px) scale(.985); opacity: .7; } }\n}\n\n@media (forced-colors: active) {\n.dsh-side-chat-panel,\n.dsh-side-chat-selection-actions,\n.dsh-side-chat-selection-comment,\n.dsh-side-chat-annotation-marker { border: 1px solid CanvasText; }\n}\n";
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/client/parent-composer/add-to-conversation.ts
|
|
14
14
|
const SELECTION_REFERENCE_SOURCE = "dsh-side-chat-selection";
|
|
@@ -717,10 +717,12 @@ window.__ModuleLoader__.load({
|
|
|
717
717
|
} catch (error) {
|
|
718
718
|
return failure(localError("selection_stale", error instanceof Error ? error.message : "The selected text is no longer available.", false));
|
|
719
719
|
}
|
|
720
|
+
const modelSelection = this.sessions.sideChatModelPreference();
|
|
720
721
|
this.publish({
|
|
721
722
|
phase: "draft",
|
|
722
723
|
parentSessionId,
|
|
723
724
|
...input.selection === void 0 ? {} : { selection: input.selection },
|
|
725
|
+
...modelSelection === void 0 ? {} : { modelSelection },
|
|
724
726
|
draft: input.draft ?? ""
|
|
725
727
|
});
|
|
726
728
|
return success(void 0);
|
|
@@ -744,6 +746,45 @@ window.__ModuleLoader__.load({
|
|
|
744
746
|
});
|
|
745
747
|
return success(void 0);
|
|
746
748
|
}
|
|
749
|
+
initializeModel(selection) {
|
|
750
|
+
const state = this.getSnapshot();
|
|
751
|
+
if (state.childSessionId !== void 0 || !["draft", "error"].includes(state.phase) || state.error?.operation === "close") return failure(localError("invalid_request", "The Side Chat model cannot be initialized right now.", false));
|
|
752
|
+
const selected = { ...selection };
|
|
753
|
+
this.publish({
|
|
754
|
+
...state,
|
|
755
|
+
modelSelection: selected
|
|
756
|
+
});
|
|
757
|
+
return success(selected);
|
|
758
|
+
}
|
|
759
|
+
async selectModel(selection) {
|
|
760
|
+
const state = this.getSnapshot();
|
|
761
|
+
if (state.phase === "closed" || [
|
|
762
|
+
"creating",
|
|
763
|
+
"opening",
|
|
764
|
+
"closing"
|
|
765
|
+
].includes(state.phase) || state.error?.operation === "close") return failure(localError("invalid_request", "The Side Chat model cannot be changed right now.", false));
|
|
766
|
+
const selected = { ...selection };
|
|
767
|
+
const childSessionId = state.childSessionId;
|
|
768
|
+
if (childSessionId === void 0) {
|
|
769
|
+
const initialized = this.initializeModel(selected);
|
|
770
|
+
if (initialized.ok) this.sessions.rememberSideChatModelPreference(initialized.value);
|
|
771
|
+
return initialized;
|
|
772
|
+
}
|
|
773
|
+
const result = await this.invoke(() => this.remote.selectModel({
|
|
774
|
+
childSessionId,
|
|
775
|
+
...selected
|
|
776
|
+
}));
|
|
777
|
+
if (!result.ok) return failure(result.error);
|
|
778
|
+
const latest = this.getSnapshot();
|
|
779
|
+
if (latest.childSessionId === childSessionId && !["closed", "closing"].includes(latest.phase)) {
|
|
780
|
+
this.publish({
|
|
781
|
+
...latest,
|
|
782
|
+
modelSelection: result.value.selected
|
|
783
|
+
});
|
|
784
|
+
this.sessions.rememberSideChatModelPreference(result.value.selected);
|
|
785
|
+
}
|
|
786
|
+
return success(result.value.selected);
|
|
787
|
+
}
|
|
747
788
|
async sendFirst(question) {
|
|
748
789
|
if (this.opening !== void 0) return failure(localError("invalid_request", "The Side Chat is already opening.", false));
|
|
749
790
|
const state = this.getSnapshot();
|
|
@@ -878,7 +919,8 @@ window.__ModuleLoader__.load({
|
|
|
878
919
|
});
|
|
879
920
|
const created = await this.invoke(() => this.remote.create({
|
|
880
921
|
parentSessionId,
|
|
881
|
-
atSeq
|
|
922
|
+
atSeq,
|
|
923
|
+
...original.modelSelection === void 0 ? {} : { modelSelection: original.modelSelection }
|
|
882
924
|
}));
|
|
883
925
|
if (!created.ok) {
|
|
884
926
|
if (this.closeRequested) this.reset();
|
|
@@ -952,6 +994,7 @@ window.__ModuleLoader__.load({
|
|
|
952
994
|
childSessionId: created.childSessionId,
|
|
953
995
|
boundarySeq: created.boundarySeq,
|
|
954
996
|
inheritedThroughSeq: created.inheritedThroughSeq,
|
|
997
|
+
...created.modelSelection === void 0 ? {} : { modelSelection: created.modelSelection },
|
|
955
998
|
firstQuestion: question,
|
|
956
999
|
error: void 0
|
|
957
1000
|
});
|
|
@@ -5192,6 +5235,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5192
5235
|
"side_chat_not_found",
|
|
5193
5236
|
"side_chat_open_failed",
|
|
5194
5237
|
"side_chat_prompt_failed",
|
|
5238
|
+
"side_chat_model_failed",
|
|
5195
5239
|
"side_chat_interrupt_failed",
|
|
5196
5240
|
"side_chat_destroy_failed",
|
|
5197
5241
|
"transport_error",
|
|
@@ -5201,6 +5245,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5201
5245
|
//#endregion
|
|
5202
5246
|
//#region src/shared/archived-wire.ts
|
|
5203
5247
|
const id = string().min(1).max(512);
|
|
5248
|
+
const modelSelectionSchema = object({
|
|
5249
|
+
provider: id,
|
|
5250
|
+
model: id,
|
|
5251
|
+
reasoningEffort: id.optional()
|
|
5252
|
+
}).strict();
|
|
5204
5253
|
const sideChatWireErrorSchema = object({
|
|
5205
5254
|
code: _enum(SIDE_CHAT_ERROR_CODES),
|
|
5206
5255
|
message: string(),
|
|
@@ -5208,15 +5257,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5208
5257
|
}).strict();
|
|
5209
5258
|
const archivedCreateRequestSchema = object({
|
|
5210
5259
|
parentSessionId: id,
|
|
5211
|
-
atSeq: number().finite().nonnegative()
|
|
5260
|
+
atSeq: number().finite().nonnegative(),
|
|
5261
|
+
modelSelection: modelSelectionSchema.optional()
|
|
5262
|
+
}).strict();
|
|
5263
|
+
const archivedSelectModelRequestSchema = object({
|
|
5264
|
+
childSessionId: id,
|
|
5265
|
+
provider: id,
|
|
5266
|
+
model: id,
|
|
5267
|
+
reasoningEffort: id.optional()
|
|
5212
5268
|
}).strict();
|
|
5213
5269
|
const archivedCloseRequestSchema = object({ childSessionId: id }).strict();
|
|
5214
5270
|
const createValueSchema = object({
|
|
5215
5271
|
parentSessionId: id,
|
|
5216
5272
|
childSessionId: id,
|
|
5217
5273
|
boundarySeq: number().int().nonnegative(),
|
|
5218
|
-
inheritedThroughSeq: number().int().nonnegative()
|
|
5274
|
+
inheritedThroughSeq: number().int().nonnegative(),
|
|
5275
|
+
modelSelection: modelSelectionSchema.optional()
|
|
5219
5276
|
}).strict();
|
|
5277
|
+
const selectModelValueSchema = object({ selected: modelSelectionSchema }).strict();
|
|
5220
5278
|
const closeValueSchema = object({ closed: literal(true) }).strict();
|
|
5221
5279
|
function resultSchema(value) {
|
|
5222
5280
|
return discriminatedUnion("ok", [object({
|
|
@@ -5228,10 +5286,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5228
5286
|
}).strict()]);
|
|
5229
5287
|
}
|
|
5230
5288
|
const archivedCreateResultSchema = resultSchema(createValueSchema);
|
|
5289
|
+
const archivedSelectModelResultSchema = resultSchema(selectModelValueSchema);
|
|
5231
5290
|
const archivedCloseResultSchema = resultSchema(closeValueSchema);
|
|
5232
5291
|
//#endregion
|
|
5233
5292
|
//#region src/typert.ts
|
|
5234
5293
|
function invocation(method, implementation, parameterSchema, resultSchema) {
|
|
5294
|
+
const requestType = method === "create" ? "CreateSideChatRequest" : method === "selectModel" ? "SelectSideChatModelRequest" : "CloseSideChatRequest";
|
|
5295
|
+
const resultType = method === "create" ? "ArchivedCreateResult" : method === "selectModel" ? "ArchivedSelectModelResult" : "ArchivedCloseResult";
|
|
5235
5296
|
return {
|
|
5236
5297
|
id: `@ahggg/dsh-side-chat#sideChatArchived/${method}`,
|
|
5237
5298
|
service: "sideChat",
|
|
@@ -5245,13 +5306,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5245
5306
|
source: "json",
|
|
5246
5307
|
codec: {
|
|
5247
5308
|
mode: "strict",
|
|
5248
|
-
typeSymbol: `@ahggg/dsh-side-chat/remote#${
|
|
5309
|
+
typeSymbol: `@ahggg/dsh-side-chat/remote#${requestType}`,
|
|
5249
5310
|
schema: parameterSchema
|
|
5250
5311
|
}
|
|
5251
5312
|
}],
|
|
5252
5313
|
result: {
|
|
5253
5314
|
mode: "strict",
|
|
5254
|
-
typeSymbol: `@ahggg/dsh-side-chat/remote
|
|
5315
|
+
typeSymbol: `@ahggg/dsh-side-chat/remote#${resultType}`,
|
|
5255
5316
|
schema: resultSchema
|
|
5256
5317
|
},
|
|
5257
5318
|
sourceLocation: {
|
|
@@ -5265,7 +5326,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5265
5326
|
//#region src/remote.ts
|
|
5266
5327
|
const TYPERT_REMOTE = {
|
|
5267
5328
|
package: "@ahggg/dsh-side-chat",
|
|
5268
|
-
descriptors: [
|
|
5329
|
+
descriptors: [
|
|
5330
|
+
invocation("create", "createArchived", archivedCreateRequestSchema, archivedCreateResultSchema),
|
|
5331
|
+
invocation("selectModel", "selectArchivedModel", archivedSelectModelRequestSchema, archivedSelectModelResultSchema),
|
|
5332
|
+
invocation("close", "closeArchived", archivedCloseRequestSchema, archivedCloseResultSchema)
|
|
5333
|
+
]
|
|
5269
5334
|
};
|
|
5270
5335
|
//#endregion
|
|
5271
5336
|
//#region src/client/rc6/remote-adapter.ts
|
|
@@ -5291,6 +5356,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5291
5356
|
error: remoteFailure(result.error)
|
|
5292
5357
|
};
|
|
5293
5358
|
},
|
|
5359
|
+
selectModel: async (request) => {
|
|
5360
|
+
const result = await archived.selectModel(request);
|
|
5361
|
+
return result.ok ? result.value : {
|
|
5362
|
+
ok: false,
|
|
5363
|
+
error: remoteFailure(result.error)
|
|
5364
|
+
};
|
|
5365
|
+
},
|
|
5294
5366
|
close: async (request) => {
|
|
5295
5367
|
const result = await archived.close(request);
|
|
5296
5368
|
return result.ok ? result.value : {
|
|
@@ -5303,6 +5375,414 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5303
5375
|
};
|
|
5304
5376
|
}
|
|
5305
5377
|
//#endregion
|
|
5378
|
+
//#region src/client/panel/SideChatModelSelect.tsx
|
|
5379
|
+
const MODEL_MESSAGES = {
|
|
5380
|
+
en: {
|
|
5381
|
+
selectModel: "Select model",
|
|
5382
|
+
menu: "Model and reasoning effort",
|
|
5383
|
+
model: "Model",
|
|
5384
|
+
effort: "Effort",
|
|
5385
|
+
providerDefault: "Default",
|
|
5386
|
+
loading: "Refreshing model list…",
|
|
5387
|
+
reload: "Reload",
|
|
5388
|
+
emptyModels: "No models available.",
|
|
5389
|
+
emptyEfforts: "This model provides no reasoning effort levels.",
|
|
5390
|
+
aria: (model, effort) => effort === void 0 ? `Select model, current ${model}` : `Select model, current ${model}, reasoning effort ${effort}`,
|
|
5391
|
+
operationFailed: (message) => `Model operation failed: ${message}`,
|
|
5392
|
+
groupFailed: (name, message) => `${name} failed to load: ${message}`
|
|
5393
|
+
},
|
|
5394
|
+
"zh-CN": {
|
|
5395
|
+
selectModel: "选择模型",
|
|
5396
|
+
menu: "模型与推理等级",
|
|
5397
|
+
model: "模型",
|
|
5398
|
+
effort: "推理等级",
|
|
5399
|
+
providerDefault: "Default",
|
|
5400
|
+
loading: "正在刷新模型列表…",
|
|
5401
|
+
reload: "重新加载",
|
|
5402
|
+
emptyModels: "没有可用的模型。",
|
|
5403
|
+
emptyEfforts: "当前模型未提供推理等级。",
|
|
5404
|
+
aria: (model, effort) => effort === void 0 ? `选择模型,当前 ${model}` : `选择模型,当前 ${model},推理等级 ${effort}`,
|
|
5405
|
+
operationFailed: (message) => `模型操作失败:${message}`,
|
|
5406
|
+
groupFailed: (name, message) => `${name} 加载失败:${message}`
|
|
5407
|
+
}
|
|
5408
|
+
};
|
|
5409
|
+
function sameModel(selection, provider, model) {
|
|
5410
|
+
return selection?.provider === provider && selection.model === model;
|
|
5411
|
+
}
|
|
5412
|
+
function sameSelection(left, right) {
|
|
5413
|
+
return left.provider === right.provider && left.model === right.model && left.reasoningEffort === right.reasoningEffort;
|
|
5414
|
+
}
|
|
5415
|
+
function repairSelection(selection, choices, fallback) {
|
|
5416
|
+
const choice = choices.find((candidate) => sameModel(selection, candidate.group.id, candidate.model.id));
|
|
5417
|
+
if (choice === void 0) return fallback;
|
|
5418
|
+
const reasoning = choice.model.reasoning;
|
|
5419
|
+
if (reasoning === void 0) return {
|
|
5420
|
+
provider: selection.provider,
|
|
5421
|
+
model: selection.model
|
|
5422
|
+
};
|
|
5423
|
+
if (selection.reasoningEffort === void 0 || reasoning.efforts.some((effort) => effort.id === selection.reasoningEffort)) return selection;
|
|
5424
|
+
return {
|
|
5425
|
+
provider: selection.provider,
|
|
5426
|
+
model: selection.model,
|
|
5427
|
+
...reasoning.defaultEffort === void 0 ? {} : { reasoningEffort: reasoning.defaultEffort }
|
|
5428
|
+
};
|
|
5429
|
+
}
|
|
5430
|
+
/** Side Chat projection of DSH Web's native composer model selector. */
|
|
5431
|
+
function SideChatModelSelect({ directory, selection, locked, validateInitialSelection = true, locale = "en", onInitialize, onSelect }) {
|
|
5432
|
+
const messages = MODEL_MESSAGES[locale];
|
|
5433
|
+
const state = (0, react.useSyncExternalStore)((listener) => directory.store.subscribe(listener), () => directory.store.getSnapshot(), () => directory.store.getSnapshot());
|
|
5434
|
+
const [open, setOpen] = (0, react.useState)(false);
|
|
5435
|
+
const [pane, setPane] = (0, react.useState)("root");
|
|
5436
|
+
const [selecting, setSelecting] = (0, react.useState)(false);
|
|
5437
|
+
const [toast, setToast] = (0, react.useState)(null);
|
|
5438
|
+
const rootRef = (0, react.useRef)(null);
|
|
5439
|
+
const triggerRef = (0, react.useRef)(null);
|
|
5440
|
+
const itemRefs = (0, react.useRef)([]);
|
|
5441
|
+
const initialized = (0, react.useRef)(false);
|
|
5442
|
+
const operation = (0, react.useRef)(0);
|
|
5443
|
+
const toastSequence = (0, react.useRef)(0);
|
|
5444
|
+
const id = (0, react.useId)();
|
|
5445
|
+
const choices = (0, react.useMemo)(() => state.groups.flatMap((group) => group.models.map((model) => ({
|
|
5446
|
+
group,
|
|
5447
|
+
model
|
|
5448
|
+
}))), [state.groups]);
|
|
5449
|
+
const current = selection ?? state.current ?? void 0;
|
|
5450
|
+
const currentChoice = choices.find((choice) => sameModel(current, choice.group.id, choice.model.id));
|
|
5451
|
+
const reasoning = currentChoice?.model.reasoning;
|
|
5452
|
+
const effectiveEffort = current?.reasoningEffort ?? reasoning?.defaultEffort;
|
|
5453
|
+
const effortLabel = reasoning === void 0 ? void 0 : effectiveEffort === void 0 ? messages.providerDefault : reasoning.efforts.find((level) => level.id === effectiveEffort)?.name ?? effectiveEffort;
|
|
5454
|
+
const effortChoices = (0, react.useMemo)(() => reasoning === void 0 ? [] : [...reasoning.defaultEffort === void 0 ? [{
|
|
5455
|
+
key: "provider-default",
|
|
5456
|
+
effort: void 0,
|
|
5457
|
+
label: messages.providerDefault
|
|
5458
|
+
}] : [], ...reasoning.efforts.map((effort) => ({
|
|
5459
|
+
key: `effort:${effort.id}`,
|
|
5460
|
+
effort: effort.id,
|
|
5461
|
+
label: effort.name,
|
|
5462
|
+
...effort.description === void 0 ? {} : { description: effort.description }
|
|
5463
|
+
}))], [messages.providerDefault, reasoning]);
|
|
5464
|
+
const modelLabel = currentChoice?.model.name ?? messages.selectModel;
|
|
5465
|
+
const triggerLabel = effortLabel === void 0 ? modelLabel : `${modelLabel} · ${effortLabel}`;
|
|
5466
|
+
const reload = () => {
|
|
5467
|
+
directory.load().catch(() => void 0);
|
|
5468
|
+
};
|
|
5469
|
+
(0, react.useEffect)(() => {
|
|
5470
|
+
reload();
|
|
5471
|
+
}, [directory]);
|
|
5472
|
+
(0, react.useEffect)(() => {
|
|
5473
|
+
if (initialized.current) return;
|
|
5474
|
+
if (selection !== void 0 && !validateInitialSelection) {
|
|
5475
|
+
initialized.current = true;
|
|
5476
|
+
return;
|
|
5477
|
+
}
|
|
5478
|
+
if (state.current === null) return;
|
|
5479
|
+
const directoryCurrent = {
|
|
5480
|
+
provider: state.current.provider,
|
|
5481
|
+
model: state.current.model,
|
|
5482
|
+
...state.current.reasoningEffort === void 0 ? {} : { reasoningEffort: state.current.reasoningEffort }
|
|
5483
|
+
};
|
|
5484
|
+
if (selection === void 0) {
|
|
5485
|
+
initialized.current = true;
|
|
5486
|
+
onInitialize(directoryCurrent, { remember: false });
|
|
5487
|
+
return;
|
|
5488
|
+
}
|
|
5489
|
+
if (state.status !== "ready") return;
|
|
5490
|
+
initialized.current = true;
|
|
5491
|
+
const repaired = repairSelection(selection, choices, directoryCurrent);
|
|
5492
|
+
if (!sameSelection(selection, repaired)) onInitialize(repaired, { remember: true });
|
|
5493
|
+
}, [
|
|
5494
|
+
choices,
|
|
5495
|
+
onInitialize,
|
|
5496
|
+
selection,
|
|
5497
|
+
state.current,
|
|
5498
|
+
state.status,
|
|
5499
|
+
validateInitialSelection
|
|
5500
|
+
]);
|
|
5501
|
+
(0, react.useEffect)(() => {
|
|
5502
|
+
if (!open) return;
|
|
5503
|
+
const closeOutside = (event) => {
|
|
5504
|
+
if (!rootRef.current?.contains(event.target)) setOpen(false);
|
|
5505
|
+
};
|
|
5506
|
+
document.addEventListener("mousedown", closeOutside);
|
|
5507
|
+
return () => {
|
|
5508
|
+
document.removeEventListener("mousedown", closeOutside);
|
|
5509
|
+
};
|
|
5510
|
+
}, [open]);
|
|
5511
|
+
const show = () => {
|
|
5512
|
+
setPane("root");
|
|
5513
|
+
setOpen(true);
|
|
5514
|
+
reload();
|
|
5515
|
+
};
|
|
5516
|
+
const close = (restoreFocus = false) => {
|
|
5517
|
+
setOpen(false);
|
|
5518
|
+
setPane("root");
|
|
5519
|
+
if (restoreFocus) queueMicrotask(() => {
|
|
5520
|
+
triggerRef.current?.focus();
|
|
5521
|
+
});
|
|
5522
|
+
};
|
|
5523
|
+
const moveFocus = (offset) => {
|
|
5524
|
+
const items = itemRefs.current.filter((item) => item !== null);
|
|
5525
|
+
if (items.length === 0) return;
|
|
5526
|
+
const active = items.findIndex((item) => item === document.activeElement);
|
|
5527
|
+
items[(Math.max(active, 0) + offset + items.length) % items.length]?.focus();
|
|
5528
|
+
};
|
|
5529
|
+
const onKeyDown = (event) => {
|
|
5530
|
+
if (event.key === "Escape" && open) {
|
|
5531
|
+
event.preventDefault();
|
|
5532
|
+
if (pane !== "root") setPane("root");
|
|
5533
|
+
else close(true);
|
|
5534
|
+
return;
|
|
5535
|
+
}
|
|
5536
|
+
if (!open || event.key !== "ArrowDown" && event.key !== "ArrowUp") return;
|
|
5537
|
+
event.preventDefault();
|
|
5538
|
+
moveFocus(event.key === "ArrowDown" ? 1 : -1);
|
|
5539
|
+
};
|
|
5540
|
+
const onBlur = (event) => {
|
|
5541
|
+
if (event.relatedTarget instanceof Node && rootRef.current?.contains(event.relatedTarget)) return;
|
|
5542
|
+
close();
|
|
5543
|
+
};
|
|
5544
|
+
const submitSelection = async (next) => {
|
|
5545
|
+
const generation = ++operation.current;
|
|
5546
|
+
setSelecting(true);
|
|
5547
|
+
const result = await onSelect(next);
|
|
5548
|
+
if (generation !== operation.current) return;
|
|
5549
|
+
setSelecting(false);
|
|
5550
|
+
if (!result.ok) {
|
|
5551
|
+
toastSequence.current += 1;
|
|
5552
|
+
setToast({
|
|
5553
|
+
seq: toastSequence.current,
|
|
5554
|
+
text: messages.operationFailed(result.error.message)
|
|
5555
|
+
});
|
|
5556
|
+
return;
|
|
5557
|
+
}
|
|
5558
|
+
close(true);
|
|
5559
|
+
};
|
|
5560
|
+
const chooseModel = (group, model) => {
|
|
5561
|
+
if (sameModel(current, group.id, model.id)) {
|
|
5562
|
+
close(true);
|
|
5563
|
+
return;
|
|
5564
|
+
}
|
|
5565
|
+
submitSelection({
|
|
5566
|
+
provider: group.id,
|
|
5567
|
+
model: model.id,
|
|
5568
|
+
...model.reasoning?.defaultEffort === void 0 ? {} : { reasoningEffort: model.reasoning.defaultEffort }
|
|
5569
|
+
});
|
|
5570
|
+
};
|
|
5571
|
+
const chooseEffort = (effort) => {
|
|
5572
|
+
if (current === void 0) return;
|
|
5573
|
+
if (effectiveEffort === effort) {
|
|
5574
|
+
close(true);
|
|
5575
|
+
return;
|
|
5576
|
+
}
|
|
5577
|
+
submitSelection({
|
|
5578
|
+
provider: current.provider,
|
|
5579
|
+
model: current.model,
|
|
5580
|
+
...effort === void 0 ? {} : { reasoningEffort: effort }
|
|
5581
|
+
});
|
|
5582
|
+
};
|
|
5583
|
+
itemRefs.current = [];
|
|
5584
|
+
let itemIndex = 0;
|
|
5585
|
+
const itemRef = () => {
|
|
5586
|
+
const index = itemIndex++;
|
|
5587
|
+
return (node) => {
|
|
5588
|
+
itemRefs.current[index] = node;
|
|
5589
|
+
};
|
|
5590
|
+
};
|
|
5591
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5592
|
+
ref: rootRef,
|
|
5593
|
+
className: "dsh-side-chat-model-root",
|
|
5594
|
+
"data-side-chat-model-select": "",
|
|
5595
|
+
onKeyDown,
|
|
5596
|
+
onBlur,
|
|
5597
|
+
children: [
|
|
5598
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
5599
|
+
ref: triggerRef,
|
|
5600
|
+
type: "button",
|
|
5601
|
+
className: "dsh-side-chat-model-trigger",
|
|
5602
|
+
"aria-label": messages.aria(modelLabel, effortLabel),
|
|
5603
|
+
"aria-haspopup": "menu",
|
|
5604
|
+
"aria-expanded": open,
|
|
5605
|
+
"aria-controls": open ? `${id}-menu` : void 0,
|
|
5606
|
+
title: triggerLabel,
|
|
5607
|
+
disabled: locked,
|
|
5608
|
+
onClick: () => {
|
|
5609
|
+
if (open) close();
|
|
5610
|
+
else show();
|
|
5611
|
+
},
|
|
5612
|
+
children: [
|
|
5613
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5614
|
+
className: "dsh-side-chat-model-trigger-label",
|
|
5615
|
+
children: modelLabel
|
|
5616
|
+
}),
|
|
5617
|
+
effortLabel !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5618
|
+
className: "dsh-side-chat-model-trigger-effort",
|
|
5619
|
+
children: effortLabel
|
|
5620
|
+
}),
|
|
5621
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, { className: `dsh-side-chat-model-chevron${open ? " dsh-side-chat-model-chevron-open" : ""}` })
|
|
5622
|
+
]
|
|
5623
|
+
}),
|
|
5624
|
+
open && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5625
|
+
id: `${id}-menu`,
|
|
5626
|
+
className: "dsh-side-chat-model-menu",
|
|
5627
|
+
role: "menu",
|
|
5628
|
+
"aria-label": messages.menu,
|
|
5629
|
+
"aria-busy": state.status === "loading" || selecting,
|
|
5630
|
+
children: [
|
|
5631
|
+
pane === "root" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
5632
|
+
ref: itemRef(),
|
|
5633
|
+
type: "button",
|
|
5634
|
+
role: "menuitem",
|
|
5635
|
+
className: "dsh-side-chat-model-cell",
|
|
5636
|
+
onClick: () => {
|
|
5637
|
+
setPane("model");
|
|
5638
|
+
},
|
|
5639
|
+
children: [
|
|
5640
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5641
|
+
className: "dsh-side-chat-model-cell-label",
|
|
5642
|
+
children: messages.model
|
|
5643
|
+
}),
|
|
5644
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5645
|
+
className: "dsh-side-chat-model-cell-value",
|
|
5646
|
+
children: modelLabel
|
|
5647
|
+
}),
|
|
5648
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14, { className: "dsh-side-chat-model-cell-chevron" })
|
|
5649
|
+
]
|
|
5650
|
+
}), reasoning !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
5651
|
+
ref: itemRef(),
|
|
5652
|
+
type: "button",
|
|
5653
|
+
role: "menuitem",
|
|
5654
|
+
className: "dsh-side-chat-model-cell",
|
|
5655
|
+
onClick: () => {
|
|
5656
|
+
setPane("effort");
|
|
5657
|
+
},
|
|
5658
|
+
children: [
|
|
5659
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5660
|
+
className: "dsh-side-chat-model-cell-label",
|
|
5661
|
+
children: messages.effort
|
|
5662
|
+
}),
|
|
5663
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5664
|
+
className: "dsh-side-chat-model-cell-value",
|
|
5665
|
+
children: effortLabel
|
|
5666
|
+
}),
|
|
5667
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14, { className: "dsh-side-chat-model-cell-chevron" })
|
|
5668
|
+
]
|
|
5669
|
+
})] }),
|
|
5670
|
+
pane === "model" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
5671
|
+
state.status === "loading" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5672
|
+
className: "dsh-side-chat-model-status",
|
|
5673
|
+
children: messages.loading
|
|
5674
|
+
}),
|
|
5675
|
+
state.error !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5676
|
+
className: "dsh-side-chat-model-error",
|
|
5677
|
+
role: "alert",
|
|
5678
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: messages.operationFailed(state.error) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
5679
|
+
type: "button",
|
|
5680
|
+
className: "dsh-side-chat-model-retry",
|
|
5681
|
+
onClick: reload,
|
|
5682
|
+
children: messages.reload
|
|
5683
|
+
})]
|
|
5684
|
+
}),
|
|
5685
|
+
state.failures.map((failure) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5686
|
+
className: "dsh-side-chat-model-warning",
|
|
5687
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: messages.groupFailed(failure.name, failure.message) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
5688
|
+
type: "button",
|
|
5689
|
+
className: "dsh-side-chat-model-retry",
|
|
5690
|
+
onClick: reload,
|
|
5691
|
+
children: messages.reload
|
|
5692
|
+
})]
|
|
5693
|
+
}, failure.id)),
|
|
5694
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5695
|
+
className: "dsh-side-chat-model-groups scrollable",
|
|
5696
|
+
children: state.groups.map((group) => {
|
|
5697
|
+
const headingId = `${id}-${group.id}`;
|
|
5698
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
5699
|
+
role: "group",
|
|
5700
|
+
"aria-labelledby": headingId,
|
|
5701
|
+
className: "dsh-side-chat-model-group",
|
|
5702
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5703
|
+
id: headingId,
|
|
5704
|
+
className: "dsh-side-chat-model-group-title",
|
|
5705
|
+
children: group.name
|
|
5706
|
+
}), group.models.map((model) => {
|
|
5707
|
+
const selected = sameModel(current, group.id, model.id);
|
|
5708
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
5709
|
+
ref: itemRef(),
|
|
5710
|
+
type: "button",
|
|
5711
|
+
role: "menuitemradio",
|
|
5712
|
+
"aria-checked": selected,
|
|
5713
|
+
className: `dsh-side-chat-model-option${selected ? " dsh-side-chat-model-selected" : ""}`,
|
|
5714
|
+
title: model.name,
|
|
5715
|
+
disabled: selecting,
|
|
5716
|
+
onClick: () => {
|
|
5717
|
+
chooseModel(group, model);
|
|
5718
|
+
},
|
|
5719
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
5720
|
+
className: "dsh-side-chat-model-option-copy",
|
|
5721
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5722
|
+
className: "dsh-side-chat-model-name",
|
|
5723
|
+
children: model.name
|
|
5724
|
+
}), model.description !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5725
|
+
className: "dsh-side-chat-model-description",
|
|
5726
|
+
children: model.description
|
|
5727
|
+
})]
|
|
5728
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5729
|
+
className: "dsh-side-chat-model-check",
|
|
5730
|
+
children: selected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16, {}) : null
|
|
5731
|
+
})]
|
|
5732
|
+
}, model.id);
|
|
5733
|
+
})]
|
|
5734
|
+
}, group.id);
|
|
5735
|
+
})
|
|
5736
|
+
}),
|
|
5737
|
+
state.status === "ready" && choices.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5738
|
+
className: "dsh-side-chat-model-empty",
|
|
5739
|
+
children: messages.emptyModels
|
|
5740
|
+
})
|
|
5741
|
+
] }),
|
|
5742
|
+
pane === "effort" && (effortChoices.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5743
|
+
className: "dsh-side-chat-model-empty",
|
|
5744
|
+
children: messages.emptyEfforts
|
|
5745
|
+
}) : effortChoices.map((level) => {
|
|
5746
|
+
const selected = effectiveEffort === level.effort;
|
|
5747
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
5748
|
+
ref: itemRef(),
|
|
5749
|
+
type: "button",
|
|
5750
|
+
role: "menuitemradio",
|
|
5751
|
+
"aria-checked": selected,
|
|
5752
|
+
className: `dsh-side-chat-model-option${selected ? " dsh-side-chat-model-selected" : ""}`,
|
|
5753
|
+
disabled: selecting,
|
|
5754
|
+
onClick: () => {
|
|
5755
|
+
chooseEffort(level.effort);
|
|
5756
|
+
},
|
|
5757
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
5758
|
+
className: "dsh-side-chat-model-option-copy",
|
|
5759
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5760
|
+
className: "dsh-side-chat-model-name",
|
|
5761
|
+
children: level.label
|
|
5762
|
+
}), level.description !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5763
|
+
className: "dsh-side-chat-model-description",
|
|
5764
|
+
children: level.description
|
|
5765
|
+
})]
|
|
5766
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5767
|
+
className: "dsh-side-chat-model-check",
|
|
5768
|
+
children: selected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16, {}) : null
|
|
5769
|
+
})]
|
|
5770
|
+
}, level.key);
|
|
5771
|
+
}))
|
|
5772
|
+
]
|
|
5773
|
+
}),
|
|
5774
|
+
toast !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Toast, {
|
|
5775
|
+
text: toast.text,
|
|
5776
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconWarningOutline16, {}),
|
|
5777
|
+
anchor: rootRef.current?.closest("[data-composer-card]") ?? null,
|
|
5778
|
+
onDone: () => {
|
|
5779
|
+
setToast(null);
|
|
5780
|
+
}
|
|
5781
|
+
}, toast.seq)
|
|
5782
|
+
]
|
|
5783
|
+
});
|
|
5784
|
+
}
|
|
5785
|
+
//#endregion
|
|
5306
5786
|
//#region src/client/panel/SendIcon.tsx
|
|
5307
5787
|
/** Arrow used by DSH's native 34px primary send button. */
|
|
5308
5788
|
function SendIcon() {
|
|
@@ -5381,7 +5861,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5381
5861
|
}
|
|
5382
5862
|
//#endregion
|
|
5383
5863
|
//#region src/client/panel/SideChatPanel.tsx
|
|
5384
|
-
function SideChatPanel({ state, locale = "en", embeddedConversation, onDraftChange, onFirstSend, onClose, onRetry, onFocusParent, onRemoveSelection }) {
|
|
5864
|
+
function SideChatPanel({ state, locale = "en", embeddedConversation, modelControl, onDraftChange, onFirstSend, onClose, onRetry, onFocusParent, onRemoveSelection }) {
|
|
5385
5865
|
const messages = SIDE_CHAT_MESSAGES[locale];
|
|
5386
5866
|
const [submitting, setSubmitting] = (0, react.useState)(false);
|
|
5387
5867
|
const draftRef = useAutoGrowingTextarea(state.draft);
|
|
@@ -5422,6 +5902,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5422
5902
|
}),
|
|
5423
5903
|
state.childSessionId !== void 0 && embeddedConversation !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SideChatBody, { children: embeddedConversation }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
5424
5904
|
className: "dsh-side-chat-draft",
|
|
5905
|
+
"data-composer-card": "",
|
|
5425
5906
|
onSubmit: (event) => {
|
|
5426
5907
|
submit(event);
|
|
5427
5908
|
},
|
|
@@ -5457,12 +5938,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5457
5938
|
}
|
|
5458
5939
|
}
|
|
5459
5940
|
}),
|
|
5460
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5941
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5942
|
+
className: "dsh-side-chat-draft-actions",
|
|
5943
|
+
children: [modelControl, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
5944
|
+
type: "submit",
|
|
5945
|
+
className: "dsh-side-chat-send-button",
|
|
5946
|
+
"aria-label": messages.send,
|
|
5947
|
+
disabled: submitting || state.draft.trim().length === 0,
|
|
5948
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SendIcon, {})
|
|
5949
|
+
})]
|
|
5466
5950
|
})
|
|
5467
5951
|
]
|
|
5468
5952
|
}),
|
|
@@ -6053,7 +6537,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6053
6537
|
function booleanValue(value) {
|
|
6054
6538
|
return typeof value === "boolean" ? value : void 0;
|
|
6055
6539
|
}
|
|
6056
|
-
function firstLine(text) {
|
|
6540
|
+
function firstLine$1(text) {
|
|
6057
6541
|
const newline = text.indexOf("\n");
|
|
6058
6542
|
return newline === -1 ? text : text.slice(0, newline);
|
|
6059
6543
|
}
|
|
@@ -6115,7 +6599,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6115
6599
|
}
|
|
6116
6600
|
function summaryFromArguments(name, variant, argsRaw, callId, cwd) {
|
|
6117
6601
|
const args = parseArguments(argsRaw);
|
|
6118
|
-
const base = relativizeToCwd(firstLine((args === null ? void 0 : pickArgument(args, SUMMARY_KEYS[variant])) ?? (argsRaw === "" || argsRaw === "{}" ? callId : argsRaw)), cwd);
|
|
6602
|
+
const base = relativizeToCwd(firstLine$1((args === null ? void 0 : pickArgument(args, SUMMARY_KEYS[variant])) ?? (argsRaw === "" || argsRaw === "{}" ? callId : argsRaw)), cwd);
|
|
6119
6603
|
return variant === "others" && name !== "" ? `${name} · ${base}` : base;
|
|
6120
6604
|
}
|
|
6121
6605
|
function filePathFromArguments(variant, argsRaw) {
|
|
@@ -6353,7 +6837,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6353
6837
|
const code = variant === "code" && args !== null ? stringValue(args["code"]) : void 0;
|
|
6354
6838
|
const body = genericBody(variant, argsRaw);
|
|
6355
6839
|
const summary = terminal?.description ?? stringValue(record(resultView)?.["title"]) ?? summaryFromArguments(name, variant, argsRaw, callId, cwd);
|
|
6356
|
-
const failureLine = visualState === "error" && output !== void 0 ? firstLine(output) : null;
|
|
6840
|
+
const failureLine = visualState === "error" && output !== void 0 ? firstLine$1(output) : null;
|
|
6357
6841
|
const summaryText = failureLine ?? summary;
|
|
6358
6842
|
const expandable = terminal !== null || read !== null || search !== null || diffs !== null || web !== null || code !== void 0 || body !== null || output !== void 0;
|
|
6359
6843
|
const open = expanded && expandable;
|
|
@@ -6513,16 +6997,102 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6513
6997
|
function firstSideChatQuestion(text) {
|
|
6514
6998
|
return /<user_question>([\s\S]*?)<\/user_question>/u.exec(text)?.[1]?.trim() ?? text;
|
|
6515
6999
|
}
|
|
6516
|
-
function
|
|
7000
|
+
function firstLine(text) {
|
|
7001
|
+
const newline = text.indexOf("\n");
|
|
7002
|
+
return newline === -1 ? text : text.slice(0, newline);
|
|
7003
|
+
}
|
|
7004
|
+
function latestLine(text) {
|
|
7005
|
+
const visible = text.trimEnd();
|
|
7006
|
+
const newline = visible.lastIndexOf("\n");
|
|
7007
|
+
return newline === -1 ? visible : visible.slice(newline + 1);
|
|
7008
|
+
}
|
|
7009
|
+
function useThrottledVisualUpdate(update, intervalFrames = 3) {
|
|
7010
|
+
const updateRef = (0, react.useRef)(update);
|
|
7011
|
+
updateRef.current = update;
|
|
7012
|
+
const pendingFrameRef = (0, react.useRef)(null);
|
|
7013
|
+
(0, react.useLayoutEffect)(() => () => {
|
|
7014
|
+
if (pendingFrameRef.current === null) return;
|
|
7015
|
+
cancelAnimationFrame(pendingFrameRef.current);
|
|
7016
|
+
pendingFrameRef.current = null;
|
|
7017
|
+
}, []);
|
|
7018
|
+
return (0, react.useCallback)(() => {
|
|
7019
|
+
if (pendingFrameRef.current !== null) return;
|
|
7020
|
+
let remainingFrames = intervalFrames;
|
|
7021
|
+
const advance = () => {
|
|
7022
|
+
remainingFrames -= 1;
|
|
7023
|
+
if (remainingFrames > 0) {
|
|
7024
|
+
pendingFrameRef.current = requestAnimationFrame(advance);
|
|
7025
|
+
return;
|
|
7026
|
+
}
|
|
7027
|
+
pendingFrameRef.current = null;
|
|
7028
|
+
updateRef.current();
|
|
7029
|
+
};
|
|
7030
|
+
pendingFrameRef.current = requestAnimationFrame(advance);
|
|
7031
|
+
}, [intervalFrames]);
|
|
7032
|
+
}
|
|
7033
|
+
function ReasoningRow({ text, running, locale }) {
|
|
7034
|
+
const [expanded, setExpanded] = (0, react.useState)(false);
|
|
7035
|
+
const summaryRef = (0, react.useRef)(null);
|
|
7036
|
+
const summary = running ? latestLine(text) : firstLine(text);
|
|
7037
|
+
const scheduleSummaryScroll = useThrottledVisualUpdate(() => {
|
|
7038
|
+
const element = summaryRef.current;
|
|
7039
|
+
if (element === null) return;
|
|
7040
|
+
element.scrollLeft = running ? element.scrollWidth - element.clientWidth : 0;
|
|
7041
|
+
});
|
|
7042
|
+
(0, react.useEffect)(() => {
|
|
7043
|
+
scheduleSummaryScroll();
|
|
7044
|
+
}, [
|
|
7045
|
+
running,
|
|
7046
|
+
scheduleSummaryScroll,
|
|
7047
|
+
summary
|
|
7048
|
+
]);
|
|
7049
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7050
|
+
className: "dsh-side-chat-reasoning",
|
|
7051
|
+
"data-variant": "think",
|
|
7052
|
+
"data-state": running ? "running" : "ok",
|
|
7053
|
+
children: [running && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7054
|
+
className: "dsh-side-chat-reasoning-visually-hidden",
|
|
7055
|
+
children: locale === "zh-CN" ? "运行中" : "Running"
|
|
7056
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DisclosureRow, {
|
|
7057
|
+
rowClassName: "dsh-side-chat-reasoning-row",
|
|
7058
|
+
leadingClassName: "dsh-side-chat-reasoning-leading",
|
|
7059
|
+
titleClassName: "dsh-side-chat-reasoning-title",
|
|
7060
|
+
chevronClassName: "dsh-side-chat-reasoning-chevron",
|
|
7061
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconThinkOutline14, { size: 14 }),
|
|
7062
|
+
title: "Think",
|
|
7063
|
+
open: expanded,
|
|
7064
|
+
expandable: true,
|
|
7065
|
+
expandOnRowClick: true,
|
|
7066
|
+
onToggle: () => {
|
|
7067
|
+
setExpanded((value) => !value);
|
|
7068
|
+
},
|
|
7069
|
+
collapsedContent: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7070
|
+
className: "dsh-side-chat-reasoning-separator",
|
|
7071
|
+
"aria-hidden": "true"
|
|
7072
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7073
|
+
ref: summaryRef,
|
|
7074
|
+
className: "dsh-side-chat-reasoning-summary",
|
|
7075
|
+
"data-follow-end": running || void 0,
|
|
7076
|
+
children: summary
|
|
7077
|
+
})] }),
|
|
7078
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
7079
|
+
className: "dsh-side-chat-reasoning-body",
|
|
7080
|
+
children: text
|
|
7081
|
+
})
|
|
7082
|
+
})]
|
|
7083
|
+
});
|
|
7084
|
+
}
|
|
7085
|
+
function AssistantBlocks({ blocks, streaming = false, projectedToolCallIds, unprojectedToolState = "pending", cwd, locale }) {
|
|
6517
7086
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: blocks.map((block, index) => {
|
|
6518
7087
|
const key = `${block.kind}-${String(index)}`;
|
|
6519
7088
|
if (block.kind === "text") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MarkdownText, {
|
|
6520
7089
|
text: block.text,
|
|
6521
7090
|
streaming
|
|
6522
7091
|
}, key);
|
|
6523
|
-
if (block.kind === "reasoning") return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
6524
|
-
|
|
6525
|
-
|
|
7092
|
+
if (block.kind === "reasoning") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReasoningRow, {
|
|
7093
|
+
text: block.text,
|
|
7094
|
+
running: streaming && index === blocks.length - 1,
|
|
7095
|
+
locale
|
|
6526
7096
|
}, key);
|
|
6527
7097
|
if (block.kind === "image") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: "[Image attachment]" }, key);
|
|
6528
7098
|
if (block.kind === "tool-call") {
|
|
@@ -6538,7 +7108,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6538
7108
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { children: stringify(block.block) }, key);
|
|
6539
7109
|
}) });
|
|
6540
7110
|
}
|
|
6541
|
-
function MessageRow({ node, projectedToolCallIds, cwd }) {
|
|
7111
|
+
function MessageRow({ node, projectedToolCallIds, cwd, locale }) {
|
|
6542
7112
|
if (node.kind === "user" || node.kind === "steering") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
|
|
6543
7113
|
className: "dsh-side-chat-message",
|
|
6544
7114
|
"data-role": "user",
|
|
@@ -6562,7 +7132,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6562
7132
|
blocks: node.blocks,
|
|
6563
7133
|
projectedToolCallIds,
|
|
6564
7134
|
unprojectedToolState: node.interrupted === true ? "interrupted" : "pending",
|
|
6565
|
-
cwd
|
|
7135
|
+
cwd,
|
|
7136
|
+
locale
|
|
6566
7137
|
}),
|
|
6567
7138
|
node.interrupted === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6568
7139
|
className: "dsh-side-chat-message-note",
|
|
@@ -6747,7 +7318,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6747
7318
|
});
|
|
6748
7319
|
}
|
|
6749
7320
|
/** Functional rc.6 conversation surface bound to a non-current child Session. */
|
|
6750
|
-
function ArchivedConversation({ face, inheritedThroughSeq, controller, selection, locale = "en", cwd }) {
|
|
7321
|
+
function ArchivedConversation({ face, inheritedThroughSeq, controller, selection, locale = "en", cwd, modelControl }) {
|
|
6751
7322
|
const snapshot = (0, react.useSyncExternalStore)((listener) => face.subscribe(listener), () => face.getSnapshot(), () => face.getSnapshot());
|
|
6752
7323
|
const [draft, setDraft] = (0, react.useState)("");
|
|
6753
7324
|
const [sending, setSending] = (0, react.useState)(false);
|
|
@@ -6801,12 +7372,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6801
7372
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageRow, {
|
|
6802
7373
|
node,
|
|
6803
7374
|
projectedToolCallIds,
|
|
6804
|
-
cwd
|
|
7375
|
+
cwd,
|
|
7376
|
+
locale
|
|
6805
7377
|
})]
|
|
6806
7378
|
}, `${node.kind}-${String(node.seq)}`) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageRow, {
|
|
6807
7379
|
node,
|
|
6808
7380
|
projectedToolCallIds,
|
|
6809
|
-
cwd
|
|
7381
|
+
cwd,
|
|
7382
|
+
locale
|
|
6810
7383
|
}, `${node.kind}-${String(node.seq)}`)),
|
|
6811
7384
|
snapshot.partial !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
|
|
6812
7385
|
className: "dsh-side-chat-message",
|
|
@@ -6819,7 +7392,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6819
7392
|
streaming: true,
|
|
6820
7393
|
projectedToolCallIds,
|
|
6821
7394
|
unprojectedToolState: "running",
|
|
6822
|
-
cwd
|
|
7395
|
+
cwd,
|
|
7396
|
+
locale
|
|
6823
7397
|
})]
|
|
6824
7398
|
}),
|
|
6825
7399
|
runningCalls.map((call) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RunningToolCard, {
|
|
@@ -6842,6 +7416,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6842
7416
|
]
|
|
6843
7417
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
6844
7418
|
className: "dsh-side-chat-composer",
|
|
7419
|
+
"data-composer-card": "",
|
|
6845
7420
|
onSubmit: (event) => {
|
|
6846
7421
|
submit(event);
|
|
6847
7422
|
},
|
|
@@ -6859,22 +7434,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6859
7434
|
event.currentTarget.form?.requestSubmit();
|
|
6860
7435
|
}
|
|
6861
7436
|
}
|
|
6862
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
7437
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7438
|
+
className: "dsh-side-chat-composer-actions",
|
|
7439
|
+
children: [modelControl, snapshot.running ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7440
|
+
type: "button",
|
|
7441
|
+
className: "dsh-side-chat-stop-button",
|
|
7442
|
+
"aria-label": "Stop generating",
|
|
7443
|
+
title: "Stop generating",
|
|
7444
|
+
onClick: () => {
|
|
7445
|
+
controller.cancel();
|
|
7446
|
+
},
|
|
7447
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StopIcon, {})
|
|
7448
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7449
|
+
type: "submit",
|
|
7450
|
+
className: "dsh-side-chat-send-button",
|
|
7451
|
+
"aria-label": "Send",
|
|
7452
|
+
disabled: sending || draft.trim().length === 0,
|
|
7453
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SendIcon, {})
|
|
7454
|
+
})]
|
|
7455
|
+
})]
|
|
6878
7456
|
})]
|
|
6879
7457
|
});
|
|
6880
7458
|
}
|
|
@@ -6967,6 +7545,55 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6967
7545
|
}
|
|
6968
7546
|
};
|
|
6969
7547
|
//#endregion
|
|
7548
|
+
//#region src/client/model-preference.ts
|
|
7549
|
+
const STORAGE_KEY = "dsh-side-chat:model-preference:v1";
|
|
7550
|
+
function browserLocalStorage() {
|
|
7551
|
+
if (typeof window === "undefined") return;
|
|
7552
|
+
try {
|
|
7553
|
+
return window.localStorage;
|
|
7554
|
+
} catch {
|
|
7555
|
+
return;
|
|
7556
|
+
}
|
|
7557
|
+
}
|
|
7558
|
+
function modelSelection(value) {
|
|
7559
|
+
if (typeof value !== "object" || value === null) return;
|
|
7560
|
+
const candidate = value;
|
|
7561
|
+
if (typeof candidate.provider !== "string" || candidate.provider === "" || typeof candidate.model !== "string" || candidate.model === "" || candidate.reasoningEffort !== void 0 && (typeof candidate.reasoningEffort !== "string" || candidate.reasoningEffort === "")) return;
|
|
7562
|
+
return {
|
|
7563
|
+
provider: candidate.provider,
|
|
7564
|
+
model: candidate.model,
|
|
7565
|
+
...candidate.reasoningEffort === void 0 ? {} : { reasoningEffort: candidate.reasoningEffort }
|
|
7566
|
+
};
|
|
7567
|
+
}
|
|
7568
|
+
/** Browser-persistent default shared by every Side Chat in this DSH profile. */
|
|
7569
|
+
var SideChatModelPreferences = class {
|
|
7570
|
+
storage;
|
|
7571
|
+
constructor(storage = browserLocalStorage()) {
|
|
7572
|
+
this.storage = storage;
|
|
7573
|
+
}
|
|
7574
|
+
get() {
|
|
7575
|
+
if (this.storage === void 0) return;
|
|
7576
|
+
try {
|
|
7577
|
+
const raw = this.storage.getItem(STORAGE_KEY);
|
|
7578
|
+
if (raw === null) return;
|
|
7579
|
+
const parsed = JSON.parse(raw);
|
|
7580
|
+
return parsed.version === 1 ? modelSelection(parsed.selection) : void 0;
|
|
7581
|
+
} catch {
|
|
7582
|
+
return;
|
|
7583
|
+
}
|
|
7584
|
+
}
|
|
7585
|
+
set(selection) {
|
|
7586
|
+
if (this.storage === void 0) return;
|
|
7587
|
+
const preference = {
|
|
7588
|
+
version: 1,
|
|
7589
|
+
selection: { ...selection }
|
|
7590
|
+
};
|
|
7591
|
+
try {
|
|
7592
|
+
this.storage.setItem(STORAGE_KEY, JSON.stringify(preference));
|
|
7593
|
+
} catch {}
|
|
7594
|
+
}
|
|
7595
|
+
};
|
|
7596
|
+
//#endregion
|
|
6970
7597
|
//#region src/client/rc6/sessions-adapter.ts
|
|
6971
7598
|
const BINDING_WAIT_MS = 8e3;
|
|
6972
7599
|
function sideChatError(error, fallback) {
|
|
@@ -7109,6 +7736,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7109
7736
|
ctx;
|
|
7110
7737
|
renamed = /* @__PURE__ */ new Set();
|
|
7111
7738
|
annotationPersistence = new ConversationAnnotationPersistence();
|
|
7739
|
+
modelPreferences = new SideChatModelPreferences();
|
|
7112
7740
|
constructor(ctx) {
|
|
7113
7741
|
this.ctx = ctx;
|
|
7114
7742
|
}
|
|
@@ -7219,6 +7847,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7219
7847
|
cwd(sessionId) {
|
|
7220
7848
|
return this.ctx.sessions.list.getSnapshot().byId[dshSessionId(sessionId)]?.cwd;
|
|
7221
7849
|
}
|
|
7850
|
+
modelDirectory(sessionId) {
|
|
7851
|
+
try {
|
|
7852
|
+
return this.ctx.modelDirectories.directoryFor(dshSessionId(sessionId));
|
|
7853
|
+
} catch {
|
|
7854
|
+
return;
|
|
7855
|
+
}
|
|
7856
|
+
}
|
|
7857
|
+
sideChatModelPreference() {
|
|
7858
|
+
return this.modelPreferences.get();
|
|
7859
|
+
}
|
|
7860
|
+
rememberSideChatModelPreference(selection) {
|
|
7861
|
+
this.modelPreferences.set(selection);
|
|
7862
|
+
}
|
|
7222
7863
|
currentParentInput() {
|
|
7223
7864
|
const sessionId = this.currentSessionId();
|
|
7224
7865
|
if (sessionId === void 0) return;
|
|
@@ -7405,6 +8046,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7405
8046
|
const childCwd = state.childSessionId === void 0 ? void 0 : sessions.cwd(state.childSessionId);
|
|
7406
8047
|
const inheritedThroughSeq = state.inheritedThroughSeq;
|
|
7407
8048
|
const locale = navigator.language.toLowerCase().startsWith("zh") ? "zh-CN" : "en";
|
|
8049
|
+
const modelDirectory = state.parentSessionId === void 0 ? void 0 : sessions.modelDirectory?.(state.parentSessionId);
|
|
8050
|
+
const modelControl = modelDirectory === void 0 ? void 0 : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SideChatModelSelect, {
|
|
8051
|
+
directory: modelDirectory,
|
|
8052
|
+
selection: state.modelSelection,
|
|
8053
|
+
locked: [
|
|
8054
|
+
"creating",
|
|
8055
|
+
"opening",
|
|
8056
|
+
"closing"
|
|
8057
|
+
].includes(state.phase) || state.error?.operation === "close",
|
|
8058
|
+
validateInitialSelection: state.childSessionId === void 0,
|
|
8059
|
+
locale,
|
|
8060
|
+
onInitialize: (selection, options) => {
|
|
8061
|
+
if (options.remember) controller.selectModel(selection);
|
|
8062
|
+
else controller.initializeModel(selection);
|
|
8063
|
+
},
|
|
8064
|
+
onSelect: (selection) => controller.selectModel(selection)
|
|
8065
|
+
}, `${state.parentSessionId}:${state.childSessionId ?? "draft"}`);
|
|
7408
8066
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7409
8067
|
className: "dsh-side-chat-overlay",
|
|
7410
8068
|
children: [
|
|
@@ -7506,8 +8164,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7506
8164
|
controller,
|
|
7507
8165
|
cwd: childCwd,
|
|
7508
8166
|
...state.selection === void 0 ? {} : { selection: state.selection },
|
|
7509
|
-
locale
|
|
8167
|
+
locale,
|
|
8168
|
+
modelControl
|
|
7510
8169
|
}) },
|
|
8170
|
+
modelControl,
|
|
7511
8171
|
onDraftChange: (draft) => {
|
|
7512
8172
|
controller.setDraft(draft);
|
|
7513
8173
|
},
|
|
@@ -7530,6 +8190,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7530
8190
|
const inject = [
|
|
7531
8191
|
"conversation",
|
|
7532
8192
|
"inputTriggers",
|
|
8193
|
+
"modelDirectories",
|
|
7533
8194
|
"remote",
|
|
7534
8195
|
"sessions",
|
|
7535
8196
|
"slots"
|