@ahggg/dsh-side-chat 0.6.1 → 0.7.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 +9 -5
- package/README.zh-CN.md +9 -5
- package/lib/client/apply.d.ts.map +1 -1
- package/lib/client/apply.js +3 -0
- package/lib/client/apply.js.map +1 -1
- package/lib/client/panel/SideChatHeader.d.ts +3 -1
- package/lib/client/panel/SideChatHeader.d.ts.map +1 -1
- package/lib/client/panel/SideChatHeader.js +5 -2
- package/lib/client/panel/SideChatHeader.js.map +1 -1
- package/lib/client/panel/SideChatPanel.d.ts +3 -1
- package/lib/client/panel/SideChatPanel.d.ts.map +1 -1
- package/lib/client/panel/SideChatPanel.js +2 -2
- package/lib/client/panel/SideChatPanel.js.map +1 -1
- package/lib/client/panel/messages.d.ts +1 -0
- package/lib/client/panel/messages.d.ts.map +1 -1
- package/lib/client/panel/messages.js +2 -0
- package/lib/client/panel/messages.js.map +1 -1
- package/lib/client/parent-composer/ParentConversationAnnotations.d.ts +2 -0
- package/lib/client/parent-composer/ParentConversationAnnotations.d.ts.map +1 -1
- package/lib/client/parent-composer/ParentConversationAnnotations.js +42 -3
- package/lib/client/parent-composer/ParentConversationAnnotations.js.map +1 -1
- package/lib/client/parent-composer/add-to-conversation.d.ts +3 -0
- package/lib/client/parent-composer/add-to-conversation.d.ts.map +1 -1
- package/lib/client/parent-composer/add-to-conversation.js.map +1 -1
- package/lib/client/parent-composer/referenced-conversation.d.ts +35 -0
- package/lib/client/parent-composer/referenced-conversation.d.ts.map +1 -0
- package/lib/client/parent-composer/referenced-conversation.js +207 -0
- package/lib/client/parent-composer/referenced-conversation.js.map +1 -0
- package/lib/client/rc6/Rc6SideChatOverlay.d.ts.map +1 -1
- package/lib/client/rc6/Rc6SideChatOverlay.js +157 -26
- package/lib/client/rc6/Rc6SideChatOverlay.js.map +1 -1
- package/lib/client/rc6/sessions-adapter.d.ts +3 -0
- package/lib/client/rc6/sessions-adapter.d.ts.map +1 -1
- package/lib/client/rc6/sessions-adapter.js +10 -0
- package/lib/client/rc6/sessions-adapter.js.map +1 -1
- package/lib/client/selection/SelectionActions.d.ts +12 -1
- package/lib/client/selection/SelectionActions.d.ts.map +1 -1
- package/lib/client/selection/SelectionActions.js +121 -19
- package/lib/client/selection/SelectionActions.js.map +1 -1
- package/lib/client.js +532 -53
- package/lib/client.js.map +1 -1
- package/package.json +28 -28
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.dsh-side-chat-parent-annotation-dock,\n.dsh-side-chat-parent-user-message {\n /* DSH rc.6 themes publish the semantic alias layer. Keep the legacy tokens\n as fallbacks for older hosts instead of falling through to light colors\n while the host has selected its dark palette. */\n --side-chat-border: var(--dsw-alias-border-l2, var(--dsw-border, #d8d8de));\n --side-chat-bg: var(--dsw-alias-bg-layer-2, var(--dsw-surface, #ffffff));\n --side-chat-muted: var(--dsw-alias-label-tertiary, var(--dsw-text-muted, #62636a));\n --side-chat-text: var(--dsw-alias-label-primary, var(--dsw-text, #19191d));\n --side-chat-accent: var(--dsw-alias-state-business-primary, #1473e6);\n --side-chat-accent-fill: var(--dsw-alias-button-info-fill, #4176e6);\n --side-chat-accent-hover: var(--dsw-alias-button-info-hover, #3467d6);\n --side-chat-accent-text: var(--dsw-alias-label-primary-foreground, #ffffff);\n color: var(--side-chat-text);\n}\n\n.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 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(--side-chat-text);\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-alias-bg-layer-3, var(--dsw-surface-subtle, #f7f7f9));\n}\n\n.dsh-side-chat-message[data-role=\"user\"] {\n align-self: end;\n background: var(--dsw-specific-bubble, 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(--side-chat-accent) 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-alias-interactive-bg-hover-solid, 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-alias-interactive-bg-hover-solid, 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-alias-interactive-bg-hover, 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-alias-interactive-bg-hover, 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: var(--dsw-alias-interactive-bg-hover, 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-alias-interactive-bg-hover-danger, var(--dsw-surface-subtle, #f7f7f9)); }\n.dsh-side-chat-error { border-color: var(--dsw-alias-state-error-primary, 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 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(--side-chat-accent-fill);\n color: var(--side-chat-accent-text);\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(--side-chat-accent-hover);\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(--side-chat-border);\n border-radius: 999px;\n background: var(--dsw-alias-button-floating-fill, var(--side-chat-bg));\n box-shadow: 0 4px 14px rgb(0 0 0 / 12%);\n color: var(--side-chat-text);\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-alias-interactive-bg-hover, var(--dsw-surface-subtle, #f3f3f5));\n}\n.dsh-side-chat-selection-actions button + button {\n border-left: 1px solid var(--side-chat-border);\n border-radius: 0;\n}\n\n::highlight(dsh-side-chat-annotations) {\n background: color-mix(in srgb, var(--dsw-alias-state-business-primary, #1473e6) 18%, transparent);\n}\n::highlight(dsh-side-chat-active-annotation) {\n background: color-mix(in srgb, var(--dsw-alias-state-business-primary, #1473e6) 32%, transparent);\n text-decoration: underline;\n text-decoration-color: color-mix(in srgb, var(--dsw-alias-state-business-primary, #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(--side-chat-accent-fill);\n box-shadow: 0 2px 6px rgb(0 0 0 / 14%);\n color: var(--side-chat-accent-text);\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(--side-chat-accent-hover);\n}\n.dsh-side-chat-annotation-marker:focus-visible {\n outline: 2px solid color-mix(in srgb, var(--side-chat-accent) 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(--side-chat-border);\n border-radius: 20px;\n background: var(--side-chat-bg);\n box-shadow: 0 5px 18px rgb(0 0 0 / 9%);\n color: var(--side-chat-text);\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(--side-chat-border);\n border-radius: 999px;\n background: var(--side-chat-bg);\n color: inherit;\n cursor: pointer;\n font: inherit;\n}\n.dsh-side-chat-selection-comment-actions button:hover { background: var(--dsw-alias-interactive-bg-hover, 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(--side-chat-accent-fill);\n color: var(--side-chat-accent-text);\n}\n.dsh-side-chat-selection-comment-actions .dsh-side-chat-selection-comment-save:hover {\n background: var(--side-chat-accent-hover);\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";
|
|
11
|
+
var _dsh_side_chat_css_L2hvbWUvcnVubmVyL3dvcmsvZHNoLXNpZGUtY2hhdC9kc2gtc2lkZS1jaGF0L3NyYy9jbGllbnQvcGFuZWwvc2lkZS1jaGF0LmNzcw_default = ".dsh-side-chat-overlay,\n.dsh-side-chat-parent-annotation-dock,\n.dsh-side-chat-parent-user-message {\n /* DSH rc.6 themes publish the semantic alias layer. Keep the legacy tokens\n as fallbacks for older hosts instead of falling through to light colors\n while the host has selected its dark palette. */\n --side-chat-border: var(--dsw-alias-border-l2, var(--dsw-border, #d8d8de));\n --side-chat-bg: var(--dsw-alias-bg-layer-2, var(--dsw-surface, #ffffff));\n --side-chat-muted: var(--dsw-alias-label-tertiary, var(--dsw-text-muted, #62636a));\n --side-chat-text: var(--dsw-alias-label-primary, var(--dsw-text, #19191d));\n --side-chat-accent: var(--dsw-alias-state-business-primary, #1473e6);\n --side-chat-accent-fill: var(--dsw-alias-button-info-fill, #4176e6);\n --side-chat-accent-hover: var(--dsw-alias-button-info-hover, #3467d6);\n --side-chat-accent-text: var(--dsw-alias-label-primary-foreground, #ffffff);\n color: var(--side-chat-text);\n}\n\n.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 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(--side-chat-text);\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-alias-bg-layer-3, var(--dsw-surface-subtle, #f7f7f9));\n}\n\n.dsh-side-chat-message[data-role=\"user\"] {\n align-self: end;\n background: var(--dsw-specific-bubble, 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(--side-chat-accent) 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-alias-interactive-bg-hover-solid, 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-alias-interactive-bg-hover-solid, 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-actions {\n display: flex;\n min-width: 0;\n align-items: center;\n justify-content: flex-end;\n gap: 4px;\n}\n.dsh-side-chat-header .dsh-side-chat-add-to-conversation {\n display: inline-flex;\n min-width: 0;\n align-items: center;\n gap: 6px;\n padding: 0 9px;\n border: 0;\n border-radius: 999px;\n background: transparent;\n color: var(--dsw-alias-label-secondary, var(--side-chat-muted));\n font: inherit;\n font-size: 13px;\n white-space: nowrap;\n}\n.dsh-side-chat-add-to-conversation:hover:not(:disabled),\n.dsh-side-chat-add-to-conversation:focus-visible {\n background: var(--dsw-alias-interactive-bg-hover, var(--dsw-surface-subtle, #f3f3f5));\n color: var(--side-chat-text);\n}\n.dsh-side-chat-add-to-conversation-icon {\n width: 18px;\n height: 18px;\n flex: none;\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-width: 1.5;\n}\n.dsh-side-chat-header .dsh-side-chat-close {\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-close:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover, 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-alias-interactive-bg-hover, 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: var(--dsw-alias-interactive-bg-hover, 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-alias-interactive-bg-hover-danger, var(--dsw-surface-subtle, #f7f7f9)); }\n.dsh-side-chat-error { border-color: var(--dsw-alias-state-error-primary, 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 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(--side-chat-accent-fill);\n color: var(--side-chat-accent-text);\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(--side-chat-accent-hover);\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 width: max-content;\n max-width: calc(100vw - 16px);\n box-sizing: border-box;\n flex-wrap: wrap;\n gap: 0;\n padding: 0;\n border: 1px solid var(--side-chat-border);\n border-radius: 999px;\n background: var(--dsw-alias-button-floating-fill, var(--side-chat-bg));\n box-shadow: 0 4px 14px rgb(0 0 0 / 12%);\n color: var(--side-chat-text);\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-alias-interactive-bg-hover, var(--dsw-surface-subtle, #f3f3f5));\n}\n.dsh-side-chat-selection-actions button + button {\n border-left: 1px solid var(--side-chat-border);\n border-radius: 0;\n}\n.dsh-side-chat-selection-actions[data-touch] button {\n min-height: 42px;\n padding-inline: 14px;\n touch-action: manipulation;\n white-space: nowrap;\n}\n\n::highlight(dsh-side-chat-annotations) {\n background: color-mix(in srgb, var(--dsw-alias-state-business-primary, #1473e6) 18%, transparent);\n}\n::highlight(dsh-side-chat-active-annotation) {\n background: color-mix(in srgb, var(--dsw-alias-state-business-primary, #1473e6) 32%, transparent);\n text-decoration: underline;\n text-decoration-color: color-mix(in srgb, var(--dsw-alias-state-business-primary, #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(--side-chat-accent-fill);\n box-shadow: 0 2px 6px rgb(0 0 0 / 14%);\n color: var(--side-chat-accent-text);\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(--side-chat-accent-hover);\n}\n.dsh-side-chat-annotation-marker:focus-visible {\n outline: 2px solid color-mix(in srgb, var(--side-chat-accent) 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(--side-chat-border);\n border-radius: 20px;\n background: var(--side-chat-bg);\n box-shadow: 0 5px 18px rgb(0 0 0 / 9%);\n color: var(--side-chat-text);\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(--side-chat-border);\n border-radius: 999px;\n background: var(--side-chat-bg);\n color: inherit;\n cursor: pointer;\n font: inherit;\n}\n.dsh-side-chat-selection-comment-actions button:hover { background: var(--dsw-alias-interactive-bg-hover, 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(--side-chat-accent-fill);\n color: var(--side-chat-accent-text);\n}\n.dsh-side-chat-selection-comment-actions .dsh-side-chat-selection-comment-save:hover {\n background: var(--side-chat-accent-hover);\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";
|
|
@@ -290,6 +290,7 @@ window.__ModuleLoader__.load({
|
|
|
290
290
|
en: Object.freeze({
|
|
291
291
|
title: "Side Chat",
|
|
292
292
|
close: "Close Side Chat",
|
|
293
|
+
addToConversation: "Add to conversation",
|
|
293
294
|
placeholder: "Ask about this in a Side Chat",
|
|
294
295
|
send: "Send",
|
|
295
296
|
selectedPassage: "Selected passage",
|
|
@@ -310,6 +311,7 @@ window.__ModuleLoader__.load({
|
|
|
310
311
|
"zh-CN": Object.freeze({
|
|
311
312
|
title: "侧边对话",
|
|
312
313
|
close: "关闭侧边对话",
|
|
314
|
+
addToConversation: "添加到主对话",
|
|
313
315
|
placeholder: "在侧边对话中询问这段内容",
|
|
314
316
|
send: "发送",
|
|
315
317
|
selectedPassage: "所选段落",
|
|
@@ -447,6 +449,178 @@ window.__ModuleLoader__.load({
|
|
|
447
449
|
});
|
|
448
450
|
}
|
|
449
451
|
//#endregion
|
|
452
|
+
//#region src/client/parent-composer/referenced-conversation.ts
|
|
453
|
+
const SIDE_CHAT_CONVERSATION_REFERENCE_SOURCE = "dsh-side-chat-conversation";
|
|
454
|
+
const OPEN_TAG = "<referenced_conversation>";
|
|
455
|
+
const CLOSE_TAG = "</referenced_conversation>";
|
|
456
|
+
function normalizedTitle(title) {
|
|
457
|
+
const normalized = title.trim().replace(/\s+/gu, " ");
|
|
458
|
+
return normalized.length === 0 ? "Side Chat" : normalized;
|
|
459
|
+
}
|
|
460
|
+
function visibleContentText(content) {
|
|
461
|
+
return content.map((block) => {
|
|
462
|
+
if (typeof block !== "object" || block === null) return "";
|
|
463
|
+
const value = block;
|
|
464
|
+
if (value.type === "text" && typeof value.text === "string") return value.text;
|
|
465
|
+
if (value.type === "image") return "[Image attachment]";
|
|
466
|
+
return "";
|
|
467
|
+
}).filter(Boolean).join("\n").trim();
|
|
468
|
+
}
|
|
469
|
+
function assistantText(node) {
|
|
470
|
+
return node.blocks.flatMap((block) => block.kind === "text" ? [block.text] : []).join("\n").trim();
|
|
471
|
+
}
|
|
472
|
+
/** Project exactly the user/assistant history visible in the Side Chat modal. */
|
|
473
|
+
function referencedSideChatConversation(input) {
|
|
474
|
+
const conversation = [];
|
|
475
|
+
for (const node of input.nodes) {
|
|
476
|
+
if (node.seq <= input.inheritedThroughSeq) continue;
|
|
477
|
+
if (node.kind === "user" || node.kind === "steering") {
|
|
478
|
+
const content = visibleContentText(node.content);
|
|
479
|
+
if (content.length > 0) conversation.push({
|
|
480
|
+
role: "user",
|
|
481
|
+
content
|
|
482
|
+
});
|
|
483
|
+
continue;
|
|
484
|
+
}
|
|
485
|
+
if (node.kind === "assistant") {
|
|
486
|
+
const content = assistantText(node);
|
|
487
|
+
if (content.length > 0) conversation.push({
|
|
488
|
+
role: "assistant",
|
|
489
|
+
content
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
return {
|
|
494
|
+
version: 1,
|
|
495
|
+
conversationId: input.conversationId,
|
|
496
|
+
title: normalizedTitle(input.title),
|
|
497
|
+
conversation
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
function isReferencedConversationMessage(value) {
|
|
501
|
+
if (typeof value !== "object" || value === null) return false;
|
|
502
|
+
const message = value;
|
|
503
|
+
return (message.role === "user" || message.role === "assistant") && typeof message.content === "string" && message.content.length > 0;
|
|
504
|
+
}
|
|
505
|
+
function decodeReferencedConversation(ref) {
|
|
506
|
+
const value = JSON.parse(ref);
|
|
507
|
+
if (typeof value !== "object" || value === null) throw new Error("The referenced Side Chat conversation is no longer valid.");
|
|
508
|
+
const reference = value;
|
|
509
|
+
if (reference.version !== 1 || typeof reference.conversationId !== "string" || reference.conversationId.length === 0 || typeof reference.title !== "string" || reference.title.length === 0 || !Array.isArray(reference.conversation) || reference.conversation.length === 0 || !reference.conversation.every(isReferencedConversationMessage)) throw new Error("The referenced Side Chat conversation is no longer valid.");
|
|
510
|
+
return {
|
|
511
|
+
version: 1,
|
|
512
|
+
conversationId: reference.conversationId,
|
|
513
|
+
title: reference.title,
|
|
514
|
+
conversation: reference.conversation
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
function encodeReferencedConversation(reference) {
|
|
518
|
+
return JSON.stringify(reference);
|
|
519
|
+
}
|
|
520
|
+
function stringifyTagSafeJson(value) {
|
|
521
|
+
return JSON.stringify(value).replaceAll("<", "\\u003c");
|
|
522
|
+
}
|
|
523
|
+
/** Durable model-facing form of the referenced conversation label. */
|
|
524
|
+
function serializeReferencedConversation(reference) {
|
|
525
|
+
return [
|
|
526
|
+
OPEN_TAG,
|
|
527
|
+
stringifyTagSafeJson({
|
|
528
|
+
conversationId: reference.conversationId,
|
|
529
|
+
title: reference.title,
|
|
530
|
+
conversation: reference.conversation
|
|
531
|
+
}),
|
|
532
|
+
CLOSE_TAG
|
|
533
|
+
].join("\n");
|
|
534
|
+
}
|
|
535
|
+
/** Parse a sent reference prefix so the main thread can keep showing one label. */
|
|
536
|
+
function parseReferencedConversationPrompt(text) {
|
|
537
|
+
const prefix = `${OPEN_TAG}\n`;
|
|
538
|
+
if (!text.startsWith(prefix)) return;
|
|
539
|
+
const closeToken = `\n${CLOSE_TAG}`;
|
|
540
|
+
const closeIndex = text.indexOf(closeToken, prefix.length);
|
|
541
|
+
if (closeIndex < 0) return;
|
|
542
|
+
const json = text.slice(prefix.length, closeIndex);
|
|
543
|
+
if (json.length === 0) return;
|
|
544
|
+
try {
|
|
545
|
+
const parsed = JSON.parse(json);
|
|
546
|
+
return {
|
|
547
|
+
reference: decodeReferencedConversation(JSON.stringify({
|
|
548
|
+
version: 1,
|
|
549
|
+
conversationId: parsed.conversationId,
|
|
550
|
+
title: parsed.title,
|
|
551
|
+
conversation: parsed.conversation
|
|
552
|
+
})),
|
|
553
|
+
message: text.slice(closeIndex + closeToken.length).trim()
|
|
554
|
+
};
|
|
555
|
+
} catch {
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
function matchingOccurrences(snapshot, reference) {
|
|
560
|
+
return snapshot.occurrences.filter((occurrence) => {
|
|
561
|
+
if (occurrence.source !== "dsh-side-chat-conversation") return false;
|
|
562
|
+
try {
|
|
563
|
+
return decodeReferencedConversation(occurrence.ref).conversationId === reference.conversationId;
|
|
564
|
+
} catch {
|
|
565
|
+
return false;
|
|
566
|
+
}
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
function occurrenceLength(occurrence) {
|
|
570
|
+
if (occurrence.length !== void 0 && Number.isSafeInteger(occurrence.length) && occurrence.length > 0) return occurrence.length;
|
|
571
|
+
try {
|
|
572
|
+
return `@${decodeReferencedConversation(occurrence.ref).title}`.length;
|
|
573
|
+
} catch {
|
|
574
|
+
return 1;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
function removeOccurrence(input, occurrenceId) {
|
|
578
|
+
const snapshot = input.state.getSnapshot();
|
|
579
|
+
const occurrence = snapshot.occurrences.find((candidate) => candidate.occurrenceId === occurrenceId);
|
|
580
|
+
if (occurrence === void 0) return;
|
|
581
|
+
let start = occurrence.offset;
|
|
582
|
+
let end = occurrence.offset + occurrenceLength(occurrence);
|
|
583
|
+
if (snapshot.draft[end] === " ") end += 1;
|
|
584
|
+
else if (start > 0 && snapshot.draft[start - 1] === " ") start -= 1;
|
|
585
|
+
input.setDraft(snapshot.draft.slice(0, start) + snapshot.draft.slice(end));
|
|
586
|
+
}
|
|
587
|
+
/** Insert or refresh one Side Chat label without duplicating an older snapshot. */
|
|
588
|
+
function addReferencedSideChatToConversation(input, reference) {
|
|
589
|
+
if (reference.conversation.length === 0) return false;
|
|
590
|
+
const before = input.state.getSnapshot();
|
|
591
|
+
const existing = matchingOccurrences(before, reference);
|
|
592
|
+
const encoded = encodeReferencedConversation(reference);
|
|
593
|
+
if (existing.some((occurrence) => occurrence.ref === encoded)) return true;
|
|
594
|
+
if (!input.insertReference({
|
|
595
|
+
source: "dsh-side-chat-conversation",
|
|
596
|
+
ref: encoded,
|
|
597
|
+
label: reference.title,
|
|
598
|
+
appearance: "session",
|
|
599
|
+
clipboardText: `@${reference.title}`
|
|
600
|
+
}, {
|
|
601
|
+
start: 0,
|
|
602
|
+
end: 0,
|
|
603
|
+
draftRev: before.draftRev
|
|
604
|
+
})) return false;
|
|
605
|
+
for (const occurrence of existing) removeOccurrence(input, occurrence.occurrenceId);
|
|
606
|
+
return true;
|
|
607
|
+
}
|
|
608
|
+
/** Reference codec used by the native composer chip and submit pipeline. */
|
|
609
|
+
const sideChatConversationReferenceSource = {
|
|
610
|
+
trigger: "@",
|
|
611
|
+
name: SIDE_CHAT_CONVERSATION_REFERENCE_SOURCE,
|
|
612
|
+
order: 1001,
|
|
613
|
+
candidates: async () => [],
|
|
614
|
+
onPick: () => void 0,
|
|
615
|
+
codec: {
|
|
616
|
+
clipboardText: (ref) => `@${decodeReferencedConversation(ref).title}`,
|
|
617
|
+
serialize: async (ref, signal) => {
|
|
618
|
+
if (signal.aborted) throw signal.reason;
|
|
619
|
+
return serializeReferencedConversation(decodeReferencedConversation(ref));
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
//#endregion
|
|
450
624
|
//#region src/client/parent-composer/ParentConversationAnnotations.tsx
|
|
451
625
|
function currentLocale() {
|
|
452
626
|
return navigator.language.toLowerCase().startsWith("zh") ? "zh-CN" : "en";
|
|
@@ -492,18 +666,53 @@ window.__ModuleLoader__.load({
|
|
|
492
666
|
text: message
|
|
493
667
|
}, ...next];
|
|
494
668
|
}
|
|
669
|
+
function parsePluginPrompt(text) {
|
|
670
|
+
let message = text;
|
|
671
|
+
let annotations;
|
|
672
|
+
let reference;
|
|
673
|
+
for (let index = 0; index < 2; index += 1) {
|
|
674
|
+
const annotated = annotations === void 0 ? parseAnnotatedConversationPrompt(message) : void 0;
|
|
675
|
+
if (annotated !== void 0) {
|
|
676
|
+
annotations = annotated.annotations;
|
|
677
|
+
message = annotated.message;
|
|
678
|
+
continue;
|
|
679
|
+
}
|
|
680
|
+
const referenced = reference === void 0 ? parseReferencedConversationPrompt(message) : void 0;
|
|
681
|
+
if (referenced !== void 0) {
|
|
682
|
+
reference = referenced.reference;
|
|
683
|
+
message = referenced.message;
|
|
684
|
+
continue;
|
|
685
|
+
}
|
|
686
|
+
break;
|
|
687
|
+
}
|
|
688
|
+
if (annotations === void 0 && reference === void 0) return;
|
|
689
|
+
return {
|
|
690
|
+
...annotations === void 0 ? {} : { annotations },
|
|
691
|
+
...reference === void 0 ? {} : { reference },
|
|
692
|
+
message
|
|
693
|
+
};
|
|
694
|
+
}
|
|
495
695
|
/** Wrap DSH's own user renderer only when this plugin's durable prefix exists. */
|
|
496
696
|
function annotatedUserMessageRenderer(Original) {
|
|
497
697
|
return function AnnotatedUserMessageRenderer(props) {
|
|
498
|
-
const parsed =
|
|
698
|
+
const parsed = parsePluginPrompt(contentText$2(props.node.data.content));
|
|
499
699
|
if (parsed === void 0) return (0, react.createElement)(Original, props);
|
|
700
|
+
const body = visibleMessage(parsed.message);
|
|
701
|
+
const visible = parsed.reference === void 0 ? body : [`@${parsed.reference.title}`, body].filter((part) => part.length > 0).join("\n\n");
|
|
702
|
+
const existingLabels = props.node.data.referenceLabels ?? [];
|
|
500
703
|
const node = {
|
|
501
704
|
...props.node,
|
|
502
705
|
data: {
|
|
503
706
|
...props.node.data,
|
|
504
|
-
content: replaceTextContent(props.node.data.content,
|
|
707
|
+
content: replaceTextContent(props.node.data.content, visible),
|
|
708
|
+
...parsed.reference === void 0 ? {} : { referenceLabels: [.../* @__PURE__ */ new Set([parsed.reference.title, ...existingLabels])] }
|
|
505
709
|
}
|
|
506
710
|
};
|
|
711
|
+
const original = (0, react.createElement)(Original, {
|
|
712
|
+
...props,
|
|
713
|
+
node
|
|
714
|
+
});
|
|
715
|
+
if (parsed.annotations === void 0) return original;
|
|
507
716
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
508
717
|
className: "dsh-side-chat-parent-user-message",
|
|
509
718
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectionQuote, {
|
|
@@ -511,10 +720,7 @@ window.__ModuleLoader__.load({
|
|
|
511
720
|
messages: SIDE_CHAT_MESSAGES[currentLocale()]
|
|
512
721
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
513
722
|
className: "dsh-side-chat-parent-user-message-body",
|
|
514
|
-
children:
|
|
515
|
-
...props,
|
|
516
|
-
node
|
|
517
|
-
})
|
|
723
|
+
children: original
|
|
518
724
|
})]
|
|
519
725
|
});
|
|
520
726
|
};
|
|
@@ -5826,7 +6032,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5826
6032
|
}
|
|
5827
6033
|
//#endregion
|
|
5828
6034
|
//#region src/client/panel/SideChatHeader.tsx
|
|
5829
|
-
function
|
|
6035
|
+
function AddToConversationIcon() {
|
|
6036
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
6037
|
+
className: "dsh-side-chat-add-to-conversation-icon",
|
|
6038
|
+
viewBox: "0 0 20 20",
|
|
6039
|
+
"aria-hidden": "true",
|
|
6040
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4.25 4.5h11.5v8.25H9l-3.5 2.75v-2.75H4.25z" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M10 6.5v4M8 8.5h4" })]
|
|
6041
|
+
});
|
|
6042
|
+
}
|
|
6043
|
+
function SideChatHeader({ phase, messages, addToConversationDisabled = false, onAddToConversation, onFocusParent, onClose }) {
|
|
5830
6044
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
|
|
5831
6045
|
className: "dsh-side-chat-header",
|
|
5832
6046
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
@@ -5834,12 +6048,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5834
6048
|
className: "dsh-side-chat-heading",
|
|
5835
6049
|
onClick: onFocusParent,
|
|
5836
6050
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: messages.title })
|
|
5837
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
6051
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6052
|
+
className: "dsh-side-chat-header-actions",
|
|
6053
|
+
children: [onAddToConversation !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
6054
|
+
type: "button",
|
|
6055
|
+
className: "dsh-side-chat-add-to-conversation",
|
|
6056
|
+
disabled: addToConversationDisabled,
|
|
6057
|
+
onClick: onAddToConversation,
|
|
6058
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AddToConversationIcon, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: messages.addToConversation })]
|
|
6059
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
6060
|
+
type: "button",
|
|
6061
|
+
className: "dsh-side-chat-close",
|
|
6062
|
+
"aria-label": messages.close,
|
|
6063
|
+
disabled: phase === "closing",
|
|
6064
|
+
onClick: onClose,
|
|
6065
|
+
children: "×"
|
|
6066
|
+
})]
|
|
5843
6067
|
})]
|
|
5844
6068
|
});
|
|
5845
6069
|
}
|
|
@@ -5861,7 +6085,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5861
6085
|
}
|
|
5862
6086
|
//#endregion
|
|
5863
6087
|
//#region src/client/panel/SideChatPanel.tsx
|
|
5864
|
-
function SideChatPanel({ state, locale = "en", embeddedConversation, modelControl, onDraftChange, onFirstSend, onClose, onRetry, onFocusParent, onRemoveSelection }) {
|
|
6088
|
+
function SideChatPanel({ state, locale = "en", embeddedConversation, modelControl, onDraftChange, onFirstSend, onClose, onRetry, onFocusParent, onAddToConversation, addToConversationDisabled, onRemoveSelection }) {
|
|
5865
6089
|
const messages = SIDE_CHAT_MESSAGES[locale];
|
|
5866
6090
|
const [submitting, setSubmitting] = (0, react.useState)(false);
|
|
5867
6091
|
const draftRef = useAutoGrowingTextarea(state.draft);
|
|
@@ -5888,6 +6112,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5888
6112
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SideChatHeader, {
|
|
5889
6113
|
phase: state.phase,
|
|
5890
6114
|
messages,
|
|
6115
|
+
...onAddToConversation === void 0 ? {} : { onAddToConversation },
|
|
6116
|
+
...addToConversationDisabled === void 0 ? {} : { addToConversationDisabled },
|
|
5891
6117
|
onFocusParent,
|
|
5892
6118
|
onClose: () => {
|
|
5893
6119
|
onClose();
|
|
@@ -6328,15 +6554,49 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6328
6554
|
function clamp(value, minimum, maximum) {
|
|
6329
6555
|
return Math.min(Math.max(minimum, value), Math.max(minimum, maximum));
|
|
6330
6556
|
}
|
|
6331
|
-
function
|
|
6557
|
+
function calculateSelectionActionsPosition(rect, size, touch, viewport = {
|
|
6558
|
+
width: rect.viewportWidth,
|
|
6559
|
+
height: rect.viewportHeight
|
|
6560
|
+
}) {
|
|
6561
|
+
const edge = 8;
|
|
6562
|
+
const width = Math.max(0, size.width);
|
|
6563
|
+
const height = Math.max(0, size.height);
|
|
6564
|
+
const left = clamp(rect.x + rect.width / 2 - width / 2, edge, viewport.width - width - edge);
|
|
6565
|
+
const belowGap = touch ? 12 : 8;
|
|
6566
|
+
const aboveGap = touch ? 64 : 8;
|
|
6567
|
+
const below = rect.y + rect.height + belowGap;
|
|
6568
|
+
const above = rect.y - height - aboveGap;
|
|
6569
|
+
const belowFits = below + height <= viewport.height - edge;
|
|
6570
|
+
const aboveFits = above >= edge;
|
|
6571
|
+
let top;
|
|
6572
|
+
if (touch && belowFits) top = below;
|
|
6573
|
+
else if (aboveFits) top = above;
|
|
6574
|
+
else if (belowFits) top = below;
|
|
6575
|
+
else top = rect.y - aboveGap - edge >= viewport.height - edge - rect.y - rect.height - belowGap ? above : below;
|
|
6576
|
+
return {
|
|
6577
|
+
left,
|
|
6578
|
+
top: clamp(top, edge, viewport.height - height - edge)
|
|
6579
|
+
};
|
|
6580
|
+
}
|
|
6581
|
+
function SelectionActions({ selection, touchInteraction = false, askDisabledReason, annotationNumber = 1, annotationEditor, onAddToChat, onMoreDetails, onAskInSideChat, onAnnotationEditorChange, onDismiss }) {
|
|
6332
6582
|
const [editingAnnotation, setEditingAnnotation] = (0, react.useState)(annotationEditor !== void 0);
|
|
6333
6583
|
const [comment, setComment] = (0, react.useState)(annotationEditor?.initialComment ?? "");
|
|
6584
|
+
const [toolbarGeometry, setToolbarGeometry] = (0, react.useState)(() => ({
|
|
6585
|
+
width: 0,
|
|
6586
|
+
height: 0,
|
|
6587
|
+
viewportWidth: selection.rect.viewportWidth,
|
|
6588
|
+
viewportHeight: selection.rect.viewportHeight
|
|
6589
|
+
}));
|
|
6334
6590
|
const commentRef = (0, react.useRef)(null);
|
|
6335
|
-
const
|
|
6591
|
+
const toolbarRef = (0, react.useRef)(null);
|
|
6592
|
+
const touchActivationRef = (0, react.useRef)(null);
|
|
6593
|
+
const toolbarPosition = calculateSelectionActionsPosition(selection.rect, toolbarGeometry, touchInteraction, {
|
|
6594
|
+
width: toolbarGeometry.viewportWidth,
|
|
6595
|
+
height: toolbarGeometry.viewportHeight
|
|
6596
|
+
});
|
|
6336
6597
|
const style = {
|
|
6337
|
-
left:
|
|
6338
|
-
top:
|
|
6339
|
-
transform: selection.rect.y < 56 ? "translate(0, 0)" : "translate(0, -100%)"
|
|
6598
|
+
left: toolbarPosition.left,
|
|
6599
|
+
top: toolbarPosition.top
|
|
6340
6600
|
};
|
|
6341
6601
|
const editorWidth = Math.min(420, selection.rect.viewportWidth - 16);
|
|
6342
6602
|
const editorAbove = selection.rect.y - 118;
|
|
@@ -6353,6 +6613,40 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6353
6613
|
const keepSelection = (event) => {
|
|
6354
6614
|
event.preventDefault();
|
|
6355
6615
|
};
|
|
6616
|
+
(0, react.useLayoutEffect)(() => {
|
|
6617
|
+
if (editingAnnotation) return;
|
|
6618
|
+
const toolbar = toolbarRef.current;
|
|
6619
|
+
if (toolbar === null) return;
|
|
6620
|
+
const measure = () => {
|
|
6621
|
+
const bounds = toolbar.getBoundingClientRect();
|
|
6622
|
+
const visualViewport = window.visualViewport;
|
|
6623
|
+
const viewportWidth = visualViewport?.width ?? window.innerWidth ?? selection.rect.viewportWidth;
|
|
6624
|
+
const viewportHeight = visualViewport?.height ?? window.innerHeight ?? selection.rect.viewportHeight;
|
|
6625
|
+
const next = {
|
|
6626
|
+
width: bounds.width,
|
|
6627
|
+
height: bounds.height,
|
|
6628
|
+
viewportWidth,
|
|
6629
|
+
viewportHeight
|
|
6630
|
+
};
|
|
6631
|
+
setToolbarGeometry((current) => current.width === next.width && current.height === next.height && current.viewportWidth === next.viewportWidth && current.viewportHeight === next.viewportHeight ? current : next);
|
|
6632
|
+
};
|
|
6633
|
+
measure();
|
|
6634
|
+
const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(measure);
|
|
6635
|
+
observer?.observe(toolbar);
|
|
6636
|
+
window.addEventListener("resize", measure);
|
|
6637
|
+
window.visualViewport?.addEventListener("resize", measure);
|
|
6638
|
+
window.visualViewport?.addEventListener("scroll", measure);
|
|
6639
|
+
return () => {
|
|
6640
|
+
observer?.disconnect();
|
|
6641
|
+
window.removeEventListener("resize", measure);
|
|
6642
|
+
window.visualViewport?.removeEventListener("resize", measure);
|
|
6643
|
+
window.visualViewport?.removeEventListener("scroll", measure);
|
|
6644
|
+
};
|
|
6645
|
+
}, [
|
|
6646
|
+
editingAnnotation,
|
|
6647
|
+
selection,
|
|
6648
|
+
touchInteraction
|
|
6649
|
+
]);
|
|
6356
6650
|
(0, react.useEffect)(() => {
|
|
6357
6651
|
if (editingAnnotation) commentRef.current?.focus();
|
|
6358
6652
|
}, [editingAnnotation]);
|
|
@@ -6384,6 +6678,37 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6384
6678
|
saveAnnotation();
|
|
6385
6679
|
}
|
|
6386
6680
|
};
|
|
6681
|
+
const openAnnotationEditor = () => {
|
|
6682
|
+
setEditingAnnotation(true);
|
|
6683
|
+
onAnnotationEditorChange?.(true);
|
|
6684
|
+
};
|
|
6685
|
+
const showMoreDetails = () => {
|
|
6686
|
+
onMoreDetails(selection);
|
|
6687
|
+
onDismiss();
|
|
6688
|
+
};
|
|
6689
|
+
const askInSideChat = () => {
|
|
6690
|
+
onAskInSideChat(selection);
|
|
6691
|
+
onDismiss();
|
|
6692
|
+
};
|
|
6693
|
+
const activateOnTouch = (event, action) => {
|
|
6694
|
+
if (!touchInteraction || event.pointerType !== "touch" || event.currentTarget.disabled) return;
|
|
6695
|
+
event.preventDefault();
|
|
6696
|
+
touchActivationRef.current = {
|
|
6697
|
+
target: event.currentTarget,
|
|
6698
|
+
timeStamp: event.timeStamp
|
|
6699
|
+
};
|
|
6700
|
+
action();
|
|
6701
|
+
};
|
|
6702
|
+
const activateOnClick = (event, action) => {
|
|
6703
|
+
const touchActivation = touchActivationRef.current;
|
|
6704
|
+
touchActivationRef.current = null;
|
|
6705
|
+
const elapsed = touchActivation === null ? Number.POSITIVE_INFINITY : event.timeStamp - touchActivation.timeStamp;
|
|
6706
|
+
if (event.detail !== 0 && touchActivation?.target === event.currentTarget && elapsed >= 0 && elapsed < 1e3) {
|
|
6707
|
+
event.preventDefault();
|
|
6708
|
+
return;
|
|
6709
|
+
}
|
|
6710
|
+
action();
|
|
6711
|
+
};
|
|
6387
6712
|
if (editingAnnotation) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [annotationEditor === void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6388
6713
|
className: "dsh-side-chat-selection-marker",
|
|
6389
6714
|
"aria-hidden": "true",
|
|
@@ -6426,20 +6751,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6426
6751
|
})]
|
|
6427
6752
|
})] });
|
|
6428
6753
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6754
|
+
ref: toolbarRef,
|
|
6429
6755
|
className: "dsh-side-chat-selection-actions",
|
|
6430
6756
|
role: "toolbar",
|
|
6431
6757
|
"aria-label": "Selected conversation text actions",
|
|
6758
|
+
"data-touch": touchInteraction || void 0,
|
|
6432
6759
|
style,
|
|
6433
6760
|
onMouseDown: keepSelection,
|
|
6761
|
+
onPointerDown: (event) => {
|
|
6762
|
+
if (touchInteraction && event.pointerType === "touch") event.preventDefault();
|
|
6763
|
+
},
|
|
6434
6764
|
onKeyDown: (event) => {
|
|
6435
6765
|
if (event.key === "Escape") onDismiss();
|
|
6436
6766
|
},
|
|
6437
6767
|
children: [
|
|
6438
6768
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
6439
6769
|
type: "button",
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6770
|
+
onPointerDown: (event) => {
|
|
6771
|
+
activateOnTouch(event, openAnnotationEditor);
|
|
6772
|
+
},
|
|
6773
|
+
onClick: (event) => {
|
|
6774
|
+
activateOnClick(event, openAnnotationEditor);
|
|
6443
6775
|
},
|
|
6444
6776
|
children: "Add to chat"
|
|
6445
6777
|
}),
|
|
@@ -6447,9 +6779,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6447
6779
|
type: "button",
|
|
6448
6780
|
disabled: askDisabledReason !== void 0,
|
|
6449
6781
|
title: askDisabledReason,
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6782
|
+
onPointerDown: (event) => {
|
|
6783
|
+
activateOnTouch(event, showMoreDetails);
|
|
6784
|
+
},
|
|
6785
|
+
onClick: (event) => {
|
|
6786
|
+
activateOnClick(event, showMoreDetails);
|
|
6453
6787
|
},
|
|
6454
6788
|
children: "More details"
|
|
6455
6789
|
}),
|
|
@@ -6457,9 +6791,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6457
6791
|
type: "button",
|
|
6458
6792
|
disabled: askDisabledReason !== void 0,
|
|
6459
6793
|
title: askDisabledReason,
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6794
|
+
onPointerDown: (event) => {
|
|
6795
|
+
activateOnTouch(event, askInSideChat);
|
|
6796
|
+
},
|
|
6797
|
+
onClick: (event) => {
|
|
6798
|
+
activateOnClick(event, askInSideChat);
|
|
6463
6799
|
},
|
|
6464
6800
|
children: "Ask in side chat"
|
|
6465
6801
|
})
|
|
@@ -7789,6 +8125,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7789
8125
|
this.annotationPersistence.reconcile(selection.parentSessionId, input);
|
|
7790
8126
|
return true;
|
|
7791
8127
|
}
|
|
8128
|
+
/** Add one immutable Side Chat transcript to its parent Session's composer. */
|
|
8129
|
+
addSideChatToConversation(parentSessionId, reference) {
|
|
8130
|
+
const scope = this.ctx.sessions.scope(dshSessionId(parentSessionId));
|
|
8131
|
+
const input = scope === void 0 ? void 0 : this.ctx.conversation.input.for(scope);
|
|
8132
|
+
if (input === void 0 || !addReferencedSideChatToConversation(input, reference)) return false;
|
|
8133
|
+
this.annotationPersistence.reconcile(parentSessionId, input);
|
|
8134
|
+
return true;
|
|
8135
|
+
}
|
|
7792
8136
|
/** Update an existing unsent annotation without adding a duplicate passage. */
|
|
7793
8137
|
updateConversationAnnotation(annotationIndex, comment) {
|
|
7794
8138
|
const sessionId = this.currentSessionId();
|
|
@@ -7910,6 +8254,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7910
8254
|
//#endregion
|
|
7911
8255
|
//#region src/client/rc6/Rc6SideChatOverlay.tsx
|
|
7912
8256
|
const MORE_DETAILS_PROMPT = "Please explain the selected passage in more detail.";
|
|
8257
|
+
const TOUCH_SELECTION_SETTLE_MS = 300;
|
|
8258
|
+
const TOUCH_ACTIVATION_SUPPRESS_MS = 750;
|
|
7913
8259
|
function captureEvent(event) {
|
|
7914
8260
|
if (event instanceof KeyboardEvent && event.key === "Escape") return false;
|
|
7915
8261
|
const target = event.target;
|
|
@@ -7945,19 +8291,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7945
8291
|
const currentSessionId = (0, react.useSyncExternalStore)(sessions.subscribeList, () => sessions.currentSessionId(), () => sessions.currentSessionId());
|
|
7946
8292
|
const composerInput = (0, react.useSyncExternalStore)(sessions.subscribeConversationInput, sessions.currentConversationInputSnapshot, sessions.currentConversationInputSnapshot);
|
|
7947
8293
|
const annotations = (0, react.useMemo)(() => composerInput === void 0 ? [] : conversationSelectionAnnotations(composerInput), [composerInput]);
|
|
7948
|
-
const [
|
|
8294
|
+
const [activeSelection, setActiveSelection] = (0, react.useState)(null);
|
|
7949
8295
|
const [editingAnnotation, setEditingAnnotation] = (0, react.useState)(null);
|
|
7950
8296
|
const captureGeneration = (0, react.useRef)(0);
|
|
8297
|
+
const captureTimer = (0, react.useRef)(void 0);
|
|
7951
8298
|
const mouseDownPoint = (0, react.useRef)(null);
|
|
7952
8299
|
const annotationEditing = (0, react.useRef)(false);
|
|
7953
|
-
const
|
|
8300
|
+
const touchInteraction = (0, react.useRef)(false);
|
|
8301
|
+
const suppressTouchCaptureUntil = (0, react.useRef)(0);
|
|
8302
|
+
const capture = (0, react.useCallback)(async (touch) => {
|
|
7954
8303
|
const generation = ++captureGeneration.current;
|
|
7955
8304
|
const parentSessionId = sessions.currentSessionId();
|
|
7956
8305
|
const face = parentSessionId === void 0 ? void 0 : sessions.face(parentSessionId);
|
|
7957
8306
|
const conversationRoot = document.querySelector("[data-chat-flow]");
|
|
7958
8307
|
const browserSelection = window.getSelection();
|
|
7959
8308
|
if (parentSessionId === void 0 || face === void 0 || conversationRoot === null || browserSelection === null || browserSelection.isCollapsed) {
|
|
7960
|
-
if (generation === captureGeneration.current)
|
|
8309
|
+
if (generation === captureGeneration.current) setActiveSelection(null);
|
|
7961
8310
|
return;
|
|
7962
8311
|
}
|
|
7963
8312
|
const snapshot = face.getSnapshot();
|
|
@@ -7971,67 +8320,139 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7971
8320
|
return key === void 0 ? void 0 : selectionDescriptor(snapshot, key);
|
|
7972
8321
|
} }
|
|
7973
8322
|
});
|
|
7974
|
-
if (generation === captureGeneration.current)
|
|
8323
|
+
if (generation === captureGeneration.current) setActiveSelection({
|
|
8324
|
+
value: captured,
|
|
8325
|
+
touch
|
|
8326
|
+
});
|
|
7975
8327
|
} catch {
|
|
7976
|
-
if (generation === captureGeneration.current)
|
|
8328
|
+
if (generation === captureGeneration.current) setActiveSelection(null);
|
|
7977
8329
|
}
|
|
7978
8330
|
}, [sessions]);
|
|
8331
|
+
const cancelScheduledCapture = (0, react.useCallback)(() => {
|
|
8332
|
+
if (captureTimer.current === void 0) return;
|
|
8333
|
+
window.clearTimeout(captureTimer.current);
|
|
8334
|
+
captureTimer.current = void 0;
|
|
8335
|
+
}, []);
|
|
8336
|
+
const scheduleTouchCapture = (0, react.useCallback)(() => {
|
|
8337
|
+
cancelScheduledCapture();
|
|
8338
|
+
const generation = ++captureGeneration.current;
|
|
8339
|
+
captureTimer.current = window.setTimeout(() => {
|
|
8340
|
+
captureTimer.current = void 0;
|
|
8341
|
+
if (generation !== captureGeneration.current || annotationEditing.current) return;
|
|
8342
|
+
capture(true);
|
|
8343
|
+
}, TOUCH_SELECTION_SETTLE_MS);
|
|
8344
|
+
}, [cancelScheduledCapture, capture]);
|
|
7979
8345
|
(0, react.useEffect)(() => {
|
|
8346
|
+
const clearSelection = () => {
|
|
8347
|
+
cancelScheduledCapture();
|
|
8348
|
+
mouseDownPoint.current = null;
|
|
8349
|
+
annotationEditing.current = false;
|
|
8350
|
+
++captureGeneration.current;
|
|
8351
|
+
setActiveSelection(null);
|
|
8352
|
+
setEditingAnnotation(null);
|
|
8353
|
+
};
|
|
8354
|
+
const touchCaptureSuppressed = () => Date.now() < suppressTouchCaptureUntil.current;
|
|
8355
|
+
const onPointerDown = (event) => {
|
|
8356
|
+
if (!captureEvent(event)) return;
|
|
8357
|
+
if (event.pointerType === "touch" && touchCaptureSuppressed()) return;
|
|
8358
|
+
if (event.pointerType !== "touch") suppressTouchCaptureUntil.current = 0;
|
|
8359
|
+
touchInteraction.current = event.pointerType === "touch";
|
|
8360
|
+
if (touchInteraction.current) clearSelection();
|
|
8361
|
+
};
|
|
8362
|
+
const onTouchStart = (event) => {
|
|
8363
|
+
if (!captureEvent(event) || touchCaptureSuppressed()) return;
|
|
8364
|
+
touchInteraction.current = true;
|
|
8365
|
+
clearSelection();
|
|
8366
|
+
};
|
|
8367
|
+
const onTouchEnd = (event) => {
|
|
8368
|
+
if (!captureEvent(event) || touchCaptureSuppressed()) return;
|
|
8369
|
+
touchInteraction.current = true;
|
|
8370
|
+
scheduleTouchCapture();
|
|
8371
|
+
};
|
|
7980
8372
|
const onMouseDown = (event) => {
|
|
8373
|
+
if (touchInteraction.current || touchCaptureSuppressed()) {
|
|
8374
|
+
mouseDownPoint.current = null;
|
|
8375
|
+
return;
|
|
8376
|
+
}
|
|
7981
8377
|
if (!captureEvent(event)) {
|
|
7982
8378
|
mouseDownPoint.current = null;
|
|
7983
8379
|
return;
|
|
7984
8380
|
}
|
|
8381
|
+
cancelScheduledCapture();
|
|
7985
8382
|
mouseDownPoint.current = {
|
|
7986
8383
|
x: event.clientX,
|
|
7987
8384
|
y: event.clientY
|
|
7988
8385
|
};
|
|
7989
8386
|
annotationEditing.current = false;
|
|
7990
8387
|
++captureGeneration.current;
|
|
7991
|
-
|
|
8388
|
+
setActiveSelection(null);
|
|
7992
8389
|
setEditingAnnotation(null);
|
|
7993
8390
|
};
|
|
7994
8391
|
const onMouseUp = (event) => {
|
|
7995
8392
|
const start = mouseDownPoint.current;
|
|
7996
8393
|
mouseDownPoint.current = null;
|
|
7997
|
-
if (!captureEvent(event)) return;
|
|
7998
|
-
if (
|
|
8394
|
+
if (!captureEvent(event) || touchCaptureSuppressed()) return;
|
|
8395
|
+
if (touchInteraction.current) {
|
|
8396
|
+
scheduleTouchCapture();
|
|
8397
|
+
return;
|
|
8398
|
+
}
|
|
8399
|
+
if (start === null || Math.abs(event.clientX - start.x) > 2 || Math.abs(event.clientY - start.y) > 2 || event.detail > 1 || event.shiftKey) capture(false);
|
|
7999
8400
|
};
|
|
8000
8401
|
const onSelectionChange = () => {
|
|
8001
8402
|
if (annotationEditing.current) return;
|
|
8403
|
+
if (touchInteraction.current) {
|
|
8404
|
+
scheduleTouchCapture();
|
|
8405
|
+
return;
|
|
8406
|
+
}
|
|
8002
8407
|
const browserSelection = window.getSelection();
|
|
8003
8408
|
if (browserSelection !== null && !browserSelection.isCollapsed) return;
|
|
8409
|
+
cancelScheduledCapture();
|
|
8004
8410
|
++captureGeneration.current;
|
|
8005
|
-
|
|
8411
|
+
setActiveSelection(null);
|
|
8006
8412
|
};
|
|
8007
8413
|
const onKeyUp = (event) => {
|
|
8414
|
+
touchInteraction.current = false;
|
|
8415
|
+
cancelScheduledCapture();
|
|
8008
8416
|
if (event.key === "Escape") {
|
|
8009
8417
|
++captureGeneration.current;
|
|
8010
8418
|
annotationEditing.current = false;
|
|
8011
|
-
|
|
8419
|
+
setActiveSelection(null);
|
|
8012
8420
|
setEditingAnnotation(null);
|
|
8013
8421
|
controller.close();
|
|
8014
8422
|
return;
|
|
8015
8423
|
}
|
|
8016
|
-
if (captureEvent(event)) capture();
|
|
8424
|
+
if (captureEvent(event)) capture(false);
|
|
8017
8425
|
};
|
|
8426
|
+
document.addEventListener("pointerdown", onPointerDown);
|
|
8427
|
+
document.addEventListener("touchstart", onTouchStart, { passive: true });
|
|
8428
|
+
document.addEventListener("touchend", onTouchEnd, { passive: true });
|
|
8018
8429
|
document.addEventListener("mousedown", onMouseDown);
|
|
8019
8430
|
document.addEventListener("mouseup", onMouseUp);
|
|
8020
8431
|
document.addEventListener("selectionchange", onSelectionChange);
|
|
8021
8432
|
document.addEventListener("keyup", onKeyUp);
|
|
8022
8433
|
return () => {
|
|
8434
|
+
cancelScheduledCapture();
|
|
8435
|
+
document.removeEventListener("pointerdown", onPointerDown);
|
|
8436
|
+
document.removeEventListener("touchstart", onTouchStart);
|
|
8437
|
+
document.removeEventListener("touchend", onTouchEnd);
|
|
8023
8438
|
document.removeEventListener("mousedown", onMouseDown);
|
|
8024
8439
|
document.removeEventListener("mouseup", onMouseUp);
|
|
8025
8440
|
document.removeEventListener("selectionchange", onSelectionChange);
|
|
8026
8441
|
document.removeEventListener("keyup", onKeyUp);
|
|
8027
8442
|
};
|
|
8028
|
-
}, [
|
|
8443
|
+
}, [
|
|
8444
|
+
cancelScheduledCapture,
|
|
8445
|
+
capture,
|
|
8446
|
+
controller,
|
|
8447
|
+
scheduleTouchCapture
|
|
8448
|
+
]);
|
|
8029
8449
|
(0, react.useEffect)(() => {
|
|
8450
|
+
cancelScheduledCapture();
|
|
8030
8451
|
++captureGeneration.current;
|
|
8031
8452
|
annotationEditing.current = false;
|
|
8032
|
-
|
|
8453
|
+
setActiveSelection(null);
|
|
8033
8454
|
setEditingAnnotation(null);
|
|
8034
|
-
}, [currentSessionId]);
|
|
8455
|
+
}, [cancelScheduledCapture, currentSessionId]);
|
|
8035
8456
|
(0, react.useEffect)(() => {
|
|
8036
8457
|
if (composerInput !== void 0) sessions.reconcileConversationAnnotationPersistence();
|
|
8037
8458
|
}, [composerInput, sessions]);
|
|
@@ -8041,12 +8462,66 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8041
8462
|
annotationEditing.current = false;
|
|
8042
8463
|
setEditingAnnotation(null);
|
|
8043
8464
|
}, [annotations, editingAnnotation]);
|
|
8465
|
+
const dismissActiveSelection = (0, react.useCallback)(() => {
|
|
8466
|
+
cancelScheduledCapture();
|
|
8467
|
+
if (touchInteraction.current) suppressTouchCaptureUntil.current = Date.now() + TOUCH_ACTIVATION_SUPPRESS_MS;
|
|
8468
|
+
touchInteraction.current = false;
|
|
8469
|
+
annotationEditing.current = false;
|
|
8470
|
+
++captureGeneration.current;
|
|
8471
|
+
setActiveSelection(null);
|
|
8472
|
+
}, [cancelScheduledCapture]);
|
|
8044
8473
|
const askDisabledReason = state.phase === "closed" ? void 0 : "Close the current Side Chat before starting another one.";
|
|
8045
8474
|
const childFace = state.childSessionId === void 0 ? void 0 : sessions.face(state.childSessionId);
|
|
8046
8475
|
const childCwd = state.childSessionId === void 0 ? void 0 : sessions.cwd(state.childSessionId);
|
|
8047
8476
|
const inheritedThroughSeq = state.inheritedThroughSeq;
|
|
8048
8477
|
const locale = navigator.language.toLowerCase().startsWith("zh") ? "zh-CN" : "en";
|
|
8049
8478
|
const modelDirectory = state.parentSessionId === void 0 ? void 0 : sessions.modelDirectory?.(state.parentSessionId);
|
|
8479
|
+
const addToConversationDisabled = childFace === void 0 || inheritedThroughSeq === void 0 || state.parentSessionId === void 0 || state.childSessionId === void 0 || state.phase !== "ready";
|
|
8480
|
+
const addToConversation = () => {
|
|
8481
|
+
const parentSessionId = state.parentSessionId;
|
|
8482
|
+
const childSessionId = state.childSessionId;
|
|
8483
|
+
const face = childSessionId === void 0 ? void 0 : sessions.face(childSessionId);
|
|
8484
|
+
if (parentSessionId === void 0 || childSessionId === void 0 || inheritedThroughSeq === void 0 || face === void 0) {
|
|
8485
|
+
sessions.notify({
|
|
8486
|
+
kind: "warning",
|
|
8487
|
+
text: "The Side Chat conversation is not ready to add yet."
|
|
8488
|
+
});
|
|
8489
|
+
return;
|
|
8490
|
+
}
|
|
8491
|
+
const reference = referencedSideChatConversation({
|
|
8492
|
+
conversationId: childSessionId,
|
|
8493
|
+
title: sessions.title(childSessionId) ?? (locale === "zh-CN" ? "侧边对话" : "Side Chat"),
|
|
8494
|
+
nodes: face.getSnapshot().nodes,
|
|
8495
|
+
inheritedThroughSeq
|
|
8496
|
+
});
|
|
8497
|
+
if (reference.conversation.length === 0) {
|
|
8498
|
+
sessions.notify({
|
|
8499
|
+
kind: "warning",
|
|
8500
|
+
text: "The Side Chat does not have any conversation history to add yet."
|
|
8501
|
+
});
|
|
8502
|
+
return;
|
|
8503
|
+
}
|
|
8504
|
+
try {
|
|
8505
|
+
if (!sessions.addSideChatToConversation(parentSessionId, reference)) {
|
|
8506
|
+
sessions.notify({
|
|
8507
|
+
kind: "warning",
|
|
8508
|
+
text: "Could not add the Side Chat to the main conversation."
|
|
8509
|
+
});
|
|
8510
|
+
return;
|
|
8511
|
+
}
|
|
8512
|
+
sessions.openSession(parentSessionId).then(focusParentComposer, () => {
|
|
8513
|
+
sessions.notify({
|
|
8514
|
+
kind: "warning",
|
|
8515
|
+
text: "The Side Chat was added, but its parent conversation could not be opened."
|
|
8516
|
+
});
|
|
8517
|
+
});
|
|
8518
|
+
} catch {
|
|
8519
|
+
sessions.notify({
|
|
8520
|
+
kind: "warning",
|
|
8521
|
+
text: "Could not add the Side Chat to the main conversation."
|
|
8522
|
+
});
|
|
8523
|
+
}
|
|
8524
|
+
};
|
|
8050
8525
|
const modelControl = modelDirectory === void 0 ? void 0 : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SideChatModelSelect, {
|
|
8051
8526
|
directory: modelDirectory,
|
|
8052
8527
|
selection: state.modelSelection,
|
|
@@ -8071,16 +8546,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8071
8546
|
...editingAnnotation === null ? {} : { activeAnnotationIndex: editingAnnotation.annotationIndex },
|
|
8072
8547
|
onEdit: (annotation, restoredSelection) => {
|
|
8073
8548
|
annotationEditing.current = true;
|
|
8549
|
+
cancelScheduledCapture();
|
|
8074
8550
|
++captureGeneration.current;
|
|
8075
|
-
|
|
8551
|
+
setActiveSelection(null);
|
|
8076
8552
|
setEditingAnnotation({
|
|
8077
8553
|
...annotation,
|
|
8078
8554
|
selection: restoredSelection
|
|
8079
8555
|
});
|
|
8080
8556
|
}
|
|
8081
8557
|
}),
|
|
8082
|
-
|
|
8083
|
-
selection,
|
|
8558
|
+
activeSelection !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectionActions, {
|
|
8559
|
+
selection: activeSelection.value,
|
|
8560
|
+
touchInteraction: activeSelection.touch,
|
|
8084
8561
|
annotationNumber: sessions.nextConversationAnnotationNumber(),
|
|
8085
8562
|
...askDisabledReason === void 0 ? {} : { askDisabledReason },
|
|
8086
8563
|
onAddToChat: (captured, comment) => {
|
|
@@ -8096,10 +8573,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8096
8573
|
text: "Could not add the selection to the current chat."
|
|
8097
8574
|
});
|
|
8098
8575
|
}
|
|
8099
|
-
|
|
8576
|
+
dismissActiveSelection();
|
|
8100
8577
|
},
|
|
8101
8578
|
onAnnotationEditorChange: (open) => {
|
|
8102
8579
|
annotationEditing.current = open;
|
|
8580
|
+
if (open && touchInteraction.current) suppressTouchCaptureUntil.current = Date.now() + TOUCH_ACTIVATION_SUPPRESS_MS;
|
|
8103
8581
|
},
|
|
8104
8582
|
onMoreDetails: (captured) => {
|
|
8105
8583
|
const opened = controller.openDraft({ selection: captured });
|
|
@@ -8108,7 +8586,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8108
8586
|
text: opened.error.message
|
|
8109
8587
|
});
|
|
8110
8588
|
else controller.sendFirst(MORE_DETAILS_PROMPT);
|
|
8111
|
-
|
|
8589
|
+
dismissActiveSelection();
|
|
8112
8590
|
},
|
|
8113
8591
|
onAskInSideChat: (captured) => {
|
|
8114
8592
|
const opened = controller.openDraft({ selection: captured });
|
|
@@ -8116,12 +8594,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8116
8594
|
kind: "warning",
|
|
8117
8595
|
text: opened.error.message
|
|
8118
8596
|
});
|
|
8119
|
-
|
|
8597
|
+
dismissActiveSelection();
|
|
8120
8598
|
},
|
|
8121
|
-
onDismiss:
|
|
8122
|
-
annotationEditing.current = false;
|
|
8123
|
-
setSelection(null);
|
|
8124
|
-
}
|
|
8599
|
+
onDismiss: dismissActiveSelection
|
|
8125
8600
|
}),
|
|
8126
8601
|
editingAnnotation !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectionActions, {
|
|
8127
8602
|
selection: editingAnnotation.selection,
|
|
@@ -8177,6 +8652,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8177
8652
|
onFocusParent: () => {
|
|
8178
8653
|
if (state.parentSessionId !== void 0) sessions.openSession(state.parentSessionId);
|
|
8179
8654
|
},
|
|
8655
|
+
onAddToConversation: addToConversation,
|
|
8656
|
+
addToConversationDisabled,
|
|
8180
8657
|
onRemoveSelection: () => {
|
|
8181
8658
|
controller.clearSelection();
|
|
8182
8659
|
}
|
|
@@ -8204,6 +8681,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8204
8681
|
const clientCtx = ctx;
|
|
8205
8682
|
const mounted = await mountArchivedRemote(clientCtx);
|
|
8206
8683
|
const removeSelectionReferenceSource = clientCtx.inputTriggers.registerSource(selectionReferenceSource);
|
|
8684
|
+
const removeConversationReferenceSource = clientCtx.inputTriggers.registerSource(sideChatConversationReferenceSource);
|
|
8207
8685
|
const sessions = new Rc6SideChatSessions(clientCtx);
|
|
8208
8686
|
const removeParentAnnotations = mountParentConversationAnnotations(clientCtx, () => {
|
|
8209
8687
|
sessions.removeConversationAnnotations();
|
|
@@ -8222,6 +8700,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8222
8700
|
await controller.dispose();
|
|
8223
8701
|
} finally {
|
|
8224
8702
|
removeParentAnnotations();
|
|
8703
|
+
removeConversationReferenceSource();
|
|
8225
8704
|
removeSelectionReferenceSource();
|
|
8226
8705
|
removeOverlay();
|
|
8227
8706
|
await mounted.dispose();
|