@ahggg/dsh-side-chat 0.4.0 → 0.4.2
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 +10 -9
- package/README.zh-CN.md +10 -9
- package/lib/client/rc6/ArchivedConversation.d.ts +2 -1
- package/lib/client/rc6/ArchivedConversation.d.ts.map +1 -1
- package/lib/client/rc6/ArchivedConversation.js +16 -8
- package/lib/client/rc6/ArchivedConversation.js.map +1 -1
- package/lib/client/rc6/Rc6SideChatOverlay.d.ts.map +1 -1
- package/lib/client/rc6/Rc6SideChatOverlay.js +2 -1
- package/lib/client/rc6/Rc6SideChatOverlay.js.map +1 -1
- package/lib/client/rc6/SideChatTool.d.ts +23 -0
- package/lib/client/rc6/SideChatTool.d.ts.map +1 -0
- package/lib/client/rc6/SideChatTool.js +395 -0
- package/lib/client/rc6/SideChatTool.js.map +1 -0
- package/lib/client/rc6/sessions-adapter.d.ts +1 -0
- package/lib/client/rc6/sessions-adapter.d.ts.map +1 -1
- package/lib/client/rc6/sessions-adapter.js +3 -0
- package/lib/client/rc6/sessions-adapter.js.map +1 -1
- package/lib/client.js +539 -25
- package/lib/client.js.map +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -8,7 +8,7 @@ window.__ModuleLoader__.load({
|
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
10
10
|
//#region \0dsh-side-chat-css:L2hvbWUvcnVubmVyL3dvcmsvZHNoLXNpZGUtY2hhdC9kc2gtc2lkZS1jaGF0L3NyYy9jbGllbnQvcGFuZWwvc2lkZS1jaGF0LmNzcw
|
|
11
|
-
var _dsh_side_chat_css_L2hvbWUvcnVubmVyL3dvcmsvZHNoLXNpZGUtY2hhdC9kc2gtc2lkZS1jaGF0L3NyYy9jbGllbnQvcGFuZWwvc2lkZS1jaGF0LmNzcw_default = ".dsh-side-chat-overlay {\n pointer-events: none;\n}\n\n.dsh-side-chat-overlay > * {\n pointer-events: auto;\n}\n\n.dsh-side-chat-panel {\n --side-chat-border: var(--dsw-border, #d8d8de);\n --side-chat-bg: var(--dsw-surface, #ffffff);\n --side-chat-muted: var(--dsw-text-muted, #62636a);\n position: fixed;\n z-index: 70;\n right: clamp(12px, 2vw, 20px);\n bottom: clamp(12px, 2vw, 20px);\n display: flex;\n width: min(840px, calc(100vw - 32px));\n height: clamp(460px, 62dvh, 980px);\n max-height: calc(100dvh - 32px);\n min-width: 0;\n min-height: 0;\n box-sizing: border-box;\n flex-direction: column;\n overflow: hidden;\n border: 1px solid var(--side-chat-border);\n border-radius: 28px;\n background: var(--side-chat-bg);\n color: var(--dsw-text, #19191d);\n box-shadow: 0 12px 36px rgb(0 0 0 / 11%), 0 2px 8px rgb(0 0 0 / 6%);\n}\n\n.dsh-side-chat-conversation {\n display: flex;\n height: 100%;\n min-height: 0;\n flex-direction: column;\n overflow: hidden;\n}\n\n.dsh-side-chat-transcript {\n display: flex;\n min-height: 0;\n flex: 1;\n flex-direction: column;\n gap: 12px;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 18px 20px 24px;\n scrollbar-color: color-mix(in srgb, var(--side-chat-muted) 34%, transparent) transparent;\n scrollbar-width: thin;\n}\n\n.dsh-side-chat-message {\n max-width: 92%;\n padding: 10px 12px;\n border: 1px solid var(--side-chat-border);\n border-radius: 12px;\n background: var(--dsw-surface-subtle, #f7f7f9);\n}\n\n.dsh-side-chat-message[data-role=\"user\"] {\n align-self: end;\n background: var(--dsw-accent-soft, #eef4ff);\n}\n\n.dsh-side-chat-message[data-role=\"assistant\"] {\n align-self: start;\n max-width: 100%;\n border-color: transparent;\n background: transparent;\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-turn-notice,\n.dsh-side-chat-interaction,\n.dsh-side-chat-queue { padding: 10px; border: 1px solid var(--side-chat-border); border-radius: 10px; }\n.dsh-side-chat-interaction fieldset { margin: 8px 0; border: 1px solid var(--side-chat-border); border-radius: 8px; }\n.dsh-side-chat-question-option { display: flex; gap: 8px; margin: 8px 0; }\n.dsh-side-chat-interaction textarea { width: 100%; box-sizing: border-box; resize: vertical; }\n.dsh-side-chat-interaction-actions,\n.dsh-side-chat-composer > div,\n.dsh-side-chat-queue > div { display: flex; justify-content: end; gap: 8px; }\n.dsh-side-chat-interaction button,\n.dsh-side-chat-composer button,\n.dsh-side-chat-queue button { min-height: 32px; border: 1px solid var(--side-chat-border); border-radius: 7px; background: var(--dsw-control, #f7f7f9); color: inherit; cursor: pointer; }\n.dsh-side-chat-composer {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 8px;\n align-items: end;\n margin: 0 12px 12px;\n padding: 8px 8px 8px 12px;\n border: 1px solid var(--side-chat-border);\n border-radius: 24px;\n background: var(--side-chat-bg);\n box-shadow: 0 2px 8px rgb(0 0 0 / 5%);\n}\n.dsh-side-chat-composer textarea {\n width: 100%;\n height: auto;\n min-height: 24px;\n max-height: 160px;\n box-sizing: border-box;\n resize: none;\n overflow-y: hidden;\n padding: 6px;\n border: 0;\n outline: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n line-height: 1.5;\n}\n.dsh-side-chat-composer button { align-self: end; }\n.dsh-side-chat-loading { display: grid; height: 100%; place-items: center; color: var(--side-chat-muted); }\n\n.dsh-side-chat-header {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 8px 12px;\n align-items: center;\n flex: 0 0 auto;\n min-height: 46px;\n box-sizing: border-box;\n padding: 5px 10px 5px 16px;\n border-bottom: 1px solid var(--side-chat-border);\n background: var(--side-chat-bg);\n}\n\n.dsh-side-chat-heading { display: flex; min-width: 0; flex-direction: column; }\n.dsh-side-chat-heading strong { font-size: 14px; font-weight: 600; }\n.dsh-side-chat-footer { color: var(--side-chat-muted); font-size: 12px; }\n.dsh-side-chat-header button,\n.dsh-side-chat-inline-actions button,\n.dsh-side-chat-draft button,\n.dsh-side-chat-error button,\n.dsh-side-chat-selection-actions button {\n min-height: 32px;\n border: 1px solid var(--side-chat-border);\n border-radius: 7px;\n background: var(--dsw-control, #f7f7f9);\n color: inherit;\n cursor: pointer;\n}\n.dsh-side-chat-header button:disabled { cursor: not-allowed; opacity: .55; }\n.dsh-side-chat-header .dsh-side-chat-heading {\n align-items: flex-start;\n min-height: 0;\n padding: 4px 0;\n border: 0;\n background: transparent;\n text-align: left;\n}\n.dsh-side-chat-header > button:last-child {\n width: 32px;\n min-height: 32px;\n padding: 0;\n border: 0;\n border-radius: 999px;\n background: transparent;\n font-size: 20px;\n line-height: 1;\n}\n.dsh-side-chat-header > button:last-child:hover { background: var(--dsw-surface-subtle, #f3f3f5); }\n\n.dsh-side-chat-quote { position: relative; max-width: 100%; align-self: flex-start; }\n.dsh-side-chat-quote-chip {\n display: inline-flex;\n min-height: 36px;\n align-items: center;\n overflow: hidden;\n padding: 0;\n border: 1px solid var(--side-chat-border);\n border-radius: 999px;\n background: var(--side-chat-bg);\n transition: background-color 120ms ease;\n}\n.dsh-side-chat-quote:hover .dsh-side-chat-quote-chip,\n.dsh-side-chat-quote:focus-within .dsh-side-chat-quote-chip,\n.dsh-side-chat-quote[data-expanded] .dsh-side-chat-quote-chip { background: var(--dsw-surface-subtle, #f3f3f5); }\n.dsh-side-chat-quote-chip .dsh-side-chat-quote-trigger {\n display: inline-flex;\n min-height: 34px;\n align-items: center;\n gap: 8px;\n padding: 0 11px;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n}\n.dsh-side-chat-quote-trigger strong { font-size: 13px; font-weight: 500; line-height: 1; }\n.dsh-side-chat-quote-icon {\n width: 16px;\n height: 16px;\n flex: 0 0 auto;\n color: var(--side-chat-muted);\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-width: 1.7;\n}\n.dsh-side-chat-quote-chip .dsh-side-chat-quote-remove {\n display: grid;\n width: 0;\n height: 34px;\n min-height: 34px;\n box-sizing: border-box;\n flex: 0 0 auto;\n place-items: center;\n overflow: hidden;\n padding: 0;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: var(--side-chat-muted);\n cursor: pointer;\n font: inherit;\n font-size: 18px;\n line-height: 1;\n opacity: 0;\n pointer-events: none;\n transition: width 120ms ease, margin-left 120ms ease, opacity 100ms ease, background-color 100ms ease;\n}\n.dsh-side-chat-quote:hover .dsh-side-chat-quote-remove,\n.dsh-side-chat-quote:focus-within .dsh-side-chat-quote-remove {\n width: 30px;\n opacity: 1;\n pointer-events: auto;\n}\n.dsh-side-chat-quote-remove:hover { background: rgb(0 0 0 / 6%); color: inherit; }\n.dsh-side-chat-quote-details {\n position: absolute;\n z-index: 10;\n bottom: calc(100% + 8px);\n left: 0;\n width: min(520px, calc(100vw - 64px));\n max-width: calc(100vw - 48px);\n box-sizing: border-box;\n padding: 14px 16px;\n border: 1px solid var(--side-chat-border);\n border-radius: 16px;\n background: var(--side-chat-bg);\n box-shadow: 0 4px 14px rgb(0 0 0 / 8%);\n font-size: 14px;\n line-height: 1.45;\n opacity: 0;\n pointer-events: none;\n transform: translate(var(--dsh-side-chat-quote-offset-x, 0px), 4px);\n visibility: hidden;\n transition: opacity 100ms ease, transform 120ms ease, visibility 100ms ease;\n}\n.dsh-side-chat-quote-details::before {\n content: '';\n position: absolute;\n right: 0;\n bottom: -8px;\n left: 0;\n height: 8px;\n}\n.dsh-side-chat-quote:hover .dsh-side-chat-quote-details,\n.dsh-side-chat-quote[data-hovered] .dsh-side-chat-quote-details,\n.dsh-side-chat-quote:focus-within .dsh-side-chat-quote-details,\n.dsh-side-chat-quote[data-expanded] .dsh-side-chat-quote-details {\n opacity: 1;\n pointer-events: auto;\n transform: translate(var(--dsh-side-chat-quote-offset-x, 0px), 0);\n visibility: visible;\n}\n.dsh-side-chat-annotated-user-message .dsh-side-chat-quote-details {\n top: calc(100% + 8px);\n right: 0;\n bottom: auto;\n left: auto;\n}\n.dsh-side-chat-annotated-user-message .dsh-side-chat-quote-details::before {\n top: -8px;\n bottom: auto;\n}\n.dsh-side-chat-quote-details-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n.dsh-side-chat-quote-details-header strong { color: var(--side-chat-muted); font-size: 13px; font-weight: 500; }\n.dsh-side-chat-quote-detail + .dsh-side-chat-quote-detail {\n margin-top: 12px;\n padding-top: 12px;\n border-top: 1px solid var(--side-chat-border);\n}\n.dsh-side-chat-quote pre {\n max-height: 180px;\n margin: 4px 0 0;\n overflow: auto;\n white-space: pre-wrap;\n font: inherit;\n}\n.dsh-side-chat-quote-comment {\n margin-top: 9px;\n}\n.dsh-side-chat-quote-comment > strong { color: var(--side-chat-muted); font-size: 13px; font-weight: 500; }\n.dsh-side-chat-quote-comment > pre { margin-top: 4px; }\n.dsh-side-chat-error { margin: 10px 16px 0; padding: 10px 12px; border: 1px solid var(--side-chat-border); border-radius: 14px; background: var(--dsw-surface-subtle, #f7f7f9); }\n.dsh-side-chat-error { border-color: var(--dsw-danger, #b42318); }\n.dsh-side-chat-body { min-height: 0; flex: 1; overflow: hidden; }\n.dsh-side-chat-annotated-user-message {\n display: flex;\n max-width: 92%;\n align-self: end;\n align-items: flex-start;\n flex-direction: column;\n gap: 8px;\n}\n.dsh-side-chat-annotated-user-message .dsh-side-chat-message { max-width: 100%; align-self: stretch; }\n\n/* The DSH occurrence remains the durable serialization carrier, while this\n plugin-owned capsule supplies the visible and interactive projection. */\n[data-composer-seat] [data-decoration=\"chip\"][title=\"__dsh_side_chat_annotations__\"] {\n visibility: hidden;\n}\n.dsh-side-chat-parent-annotation-dock,\n.dsh-side-chat-parent-user-message {\n --side-chat-border: var(--dsw-border, #d8d8de);\n --side-chat-bg: var(--dsw-surface, #ffffff);\n --side-chat-muted: var(--dsw-text-muted, #62636a);\n color: var(--dsw-text, #19191d);\n}\n.dsh-side-chat-parent-annotation-dock {\n position: relative;\n z-index: 20;\n width: calc(100% - 32px);\n max-width: var(--dsh-composer-card-max-width, 780px);\n height: 0;\n margin: 0 auto;\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 flex-direction: column;\n align-items: flex-end;\n gap: 8px;\n}\n.dsh-side-chat-parent-user-message > .dsh-side-chat-quote { align-self: flex-end; }\n.dsh-side-chat-parent-user-message > .dsh-side-chat-quote .dsh-side-chat-quote-details {\n right: 0;\n left: auto;\n}\n.dsh-side-chat-draft {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n min-height: 0;\n flex: 0 0 auto;\n gap: 8px;\n align-items: end;\n margin: auto 12px 12px;\n padding: 12px;\n border: 1px solid var(--side-chat-border);\n border-radius: 24px;\n background: var(--side-chat-bg);\n box-shadow: 0 2px 8px rgb(0 0 0 / 5%);\n}\n.dsh-side-chat-draft > .dsh-side-chat-quote { grid-column: 1 / -1; }\n.dsh-side-chat-draft label {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n}\n.dsh-side-chat-draft textarea {\n width: 100%;\n height: auto;\n min-height: 24px;\n max-height: 160px;\n box-sizing: border-box;\n resize: none;\n overflow-y: hidden;\n padding: 6px 2px;\n border: 0;\n outline: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n line-height: 1.5;\n}\n.dsh-side-chat-draft > button { align-self: end; }\n.dsh-side-chat-panel .dsh-side-chat-send-button,\n.dsh-side-chat-panel .dsh-side-chat-stop-button {\n display: grid;\n width: 34px;\n height: 34px;\n min-height: 34px;\n flex: none;\n place-items: center;\n padding: 1px 6px;\n border: 0;\n border-radius: 999px;\n background: var(--dsw-alias-button-info-fill, #4176e6);\n color: #fff;\n cursor: pointer;\n line-height: 1;\n transform: translateY(-2px);\n transition: background-color 100ms ease;\n}\n.dsh-side-chat-panel .dsh-side-chat-send-button:hover:not(:disabled),\n.dsh-side-chat-panel .dsh-side-chat-stop-button:hover:not(:disabled) {\n background: var(--dsw-alias-button-info-hover, #3467d6);\n}\n.dsh-side-chat-panel .dsh-side-chat-send-button:disabled,\n.dsh-side-chat-panel .dsh-side-chat-stop-button:disabled { cursor: default; opacity: .4; }\n.dsh-side-chat-footer { display: none; }\n.dsh-side-chat-announcer { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }\n\n.dsh-side-chat-selection-actions {\n position: fixed;\n z-index: 90;\n display: flex;\n max-width: calc(100vw - 16px);\n flex-wrap: wrap;\n gap: 0;\n padding: 0;\n border: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 999px;\n background: var(--dsw-surface, #fff);\n box-shadow: 0 4px 14px rgb(0 0 0 / 12%);\n overflow: hidden;\n}\n.dsh-side-chat-selection-actions button {\n min-height: 36px;\n padding: 0 14px;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: inherit;\n transition: background-color 120ms ease;\n}\n.dsh-side-chat-selection-actions button:hover:not(:disabled),\n.dsh-side-chat-selection-actions button:focus-visible {\n background: var(--dsw-surface-subtle, #f3f3f5);\n}\n.dsh-side-chat-selection-actions button + button {\n border-left: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 0;\n}\n\n.dsh-side-chat-selection-marker {\n position: fixed;\n z-index: 91;\n display: grid;\n width: 28px;\n height: 28px;\n place-items: center;\n border: 2px solid var(--dsw-surface, #fff);\n border-radius: 999px;\n background: var(--dsw-alias-button-info, #1473e6);\n box-shadow: 0 2px 6px rgb(0 0 0 / 12%);\n color: #fff;\n font-size: 13px;\n font-weight: 600;\n line-height: 1;\n pointer-events: none;\n}\n\n.dsh-side-chat-selection-comment {\n position: fixed;\n z-index: 92;\n display: grid;\n max-width: calc(100vw - 16px);\n box-sizing: border-box;\n gap: 10px;\n padding: 12px;\n border: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 20px;\n background: var(--dsw-surface, #fff);\n box-shadow: 0 5px 18px rgb(0 0 0 / 9%);\n color: var(--dsw-text, #19191d);\n}\n.dsh-side-chat-selection-comment textarea {\n width: 100%;\n min-height: 48px;\n max-height: 128px;\n box-sizing: border-box;\n resize: none;\n padding: 6px 8px;\n overflow-y: auto;\n border: 0;\n outline: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n line-height: 1.45;\n}\n.dsh-side-chat-selection-comment-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n.dsh-side-chat-selection-comment-actions button {\n min-height: 32px;\n padding: 0 14px;\n border: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 999px;\n background: var(--dsw-surface, #fff);\n color: inherit;\n cursor: pointer;\n font: inherit;\n}\n.dsh-side-chat-selection-comment-actions button:hover { background: var(--dsw-surface-subtle, #f3f3f5); }\n.dsh-side-chat-selection-comment-actions .dsh-side-chat-selection-comment-save {\n border-color: transparent;\n background: var(--dsw-alias-button-info, #1473e6);\n color: #fff;\n}\n.dsh-side-chat-selection-comment-actions .dsh-side-chat-selection-comment-save:hover {\n background: var(--dsw-alias-button-info-hover, #3467d6);\n}\n\n@media (max-width: 900px) {\n .dsh-side-chat-panel {\n right: 12px;\n bottom: 12px;\n width: calc(100vw - 24px);\n max-height: calc(100dvh - 24px);\n border-radius: 24px;\n }\n}\n\n@media (max-width: 720px) {\n .dsh-side-chat-panel {\n right: 8px;\n bottom: 8px;\n width: calc(100vw - 16px);\n height: min(78dvh, 760px);\n max-height: calc(100dvh - 16px);\n border-radius: 22px;\n }\n .dsh-side-chat-transcript { padding: 14px 14px 20px; }\n .dsh-side-chat-header { padding-left: 14px; }\n .dsh-side-chat-error { margin-inline: 12px; }\n}\n\n@media (max-height: 620px) {\n .dsh-side-chat-panel {\n bottom: 8px;\n height: calc(100dvh - 16px);\n max-height: calc(100dvh - 16px);\n }\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .dsh-side-chat-panel { animation: dsh-side-chat-enter 160ms ease-out; }\n @keyframes dsh-side-chat-enter { from { transform: translateY(18px) scale(.985); opacity: .7; } }\n}\n\n@media (forced-colors: active) {\n.dsh-side-chat-panel,\n.dsh-side-chat-selection-actions,\n.dsh-side-chat-selection-comment { border: 1px solid CanvasText; }\n}\n";
|
|
11
|
+
var _dsh_side_chat_css_L2hvbWUvcnVubmVyL3dvcmsvZHNoLXNpZGUtY2hhdC9kc2gtc2lkZS1jaGF0L3NyYy9jbGllbnQvcGFuZWwvc2lkZS1jaGF0LmNzcw_default = ".dsh-side-chat-overlay {\n pointer-events: none;\n}\n\n.dsh-side-chat-overlay > * {\n pointer-events: auto;\n}\n\n.dsh-side-chat-panel {\n --side-chat-border: var(--dsw-border, #d8d8de);\n --side-chat-bg: var(--dsw-surface, #ffffff);\n --side-chat-muted: var(--dsw-text-muted, #62636a);\n position: fixed;\n z-index: 70;\n right: clamp(12px, 2vw, 20px);\n bottom: clamp(12px, 2vw, 20px);\n display: flex;\n width: min(840px, calc(100vw - 32px));\n height: clamp(460px, 62dvh, 980px);\n max-height: calc(100dvh - 32px);\n min-width: 0;\n min-height: 0;\n box-sizing: border-box;\n flex-direction: column;\n overflow: hidden;\n border: 1px solid var(--side-chat-border);\n border-radius: 28px;\n background: var(--side-chat-bg);\n color: var(--dsw-text, #19191d);\n box-shadow: 0 12px 36px rgb(0 0 0 / 11%), 0 2px 8px rgb(0 0 0 / 6%);\n}\n\n.dsh-side-chat-conversation {\n display: flex;\n height: 100%;\n min-height: 0;\n flex-direction: column;\n overflow: hidden;\n}\n\n.dsh-side-chat-transcript {\n display: flex;\n min-height: 0;\n flex: 1;\n flex-direction: column;\n gap: 12px;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 18px 20px 24px;\n scrollbar-color: color-mix(in srgb, var(--side-chat-muted) 34%, transparent) transparent;\n scrollbar-width: thin;\n}\n\n.dsh-side-chat-message {\n max-width: 92%;\n padding: 10px 12px;\n border: 1px solid var(--side-chat-border);\n border-radius: 12px;\n background: var(--dsw-surface-subtle, #f7f7f9);\n}\n\n.dsh-side-chat-message[data-role=\"user\"] {\n align-self: end;\n background: var(--dsw-accent-soft, #eef4ff);\n}\n\n.dsh-side-chat-message[data-role=\"assistant\"] {\n align-self: start;\n min-width: 0;\n max-width: 100%;\n border-color: transparent;\n background: transparent;\n overflow-wrap: anywhere;\n}\n.dsh-side-chat-message-role,\n.dsh-side-chat-message-note { display: block; margin-bottom: 5px; color: var(--side-chat-muted); font-size: 12px; }\n.dsh-side-chat-message-text { white-space: pre-wrap; overflow-wrap: anywhere; }\n.dsh-side-chat-message pre,\n.dsh-side-chat-turn-notice pre { overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }\n.dsh-side-chat-message[data-role=\"assistant\"] :where(table) {\n display: block;\n max-width: 100%;\n overflow-x: auto;\n}\n.dsh-side-chat-tool-branch {\n min-width: 0;\n max-width: 100%;\n flex: 0 0 auto;\n}\n.dsh-side-chat-tool {\n display: flex;\n min-width: 0;\n max-width: 100%;\n flex: 0 0 auto;\n flex-direction: column;\n border-radius: 6px;\n}\n.dsh-side-chat-tool-row {\n position: relative;\n overflow: hidden;\n}\n.dsh-side-chat-tool[data-state=\"running\"] .dsh-side-chat-tool-row::after,\n.dsh-side-chat-tool[data-state=\"pending\"] .dsh-side-chat-tool-row::after {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 300px;\n background: linear-gradient(\n 90deg,\n transparent 0%,\n color-mix(in srgb, var(--dsw-alias-bg-base, #fff) 60%, transparent) 55%,\n transparent 100%\n );\n content: '';\n pointer-events: none;\n animation: dsh-side-chat-tool-sweep 2.6s ease-out infinite;\n}\n@keyframes dsh-side-chat-tool-sweep {\n 0% { left: -300px; }\n 90%, 100% { left: 100%; }\n}\n.dsh-side-chat-tool-row:focus-visible {\n border-radius: 4px;\n outline: 2px solid color-mix(in srgb, var(--dsw-alias-button-info, #1473e6) 42%, transparent);\n outline-offset: 1px;\n}\n.dsh-side-chat-tool-leading { flex-shrink: 0; }\n.dsh-side-chat-tool-chevron { color: var(--dsw-alias-label-secondary, var(--side-chat-muted)); }\n.dsh-side-chat-tool-title { font-weight: 400; }\n.dsh-side-chat-tool-separator {\n width: 2px;\n height: 2px;\n flex: none;\n margin: 0 8px;\n border-radius: 1px;\n background: var(--dsw-alias-label-caption, #a1a1aa);\n}\n.dsh-side-chat-tool-summary {\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n color: var(--dsw-alias-label-tertiary, var(--side-chat-muted));\n font-size: 14px;\n line-height: 24px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.dsh-side-chat-tool-error-summary { color: var(--dsw-alias-state-error-primary, var(--dsw-danger, #b42318)); }\n.dsh-side-chat-tool-body-wrap {\n display: flex;\n min-width: 0;\n flex-direction: column;\n}\n.dsh-side-chat-tool-code,\n.dsh-side-chat-tool-diff,\n.dsh-side-chat-tool-read,\n.dsh-side-chat-tool-search,\n.dsh-side-chat-tool-terminal,\n.dsh-side-chat-tool-web {\n margin: 4px 0 4px 4px;\n}\n.dsh-side-chat-tool-code { --dsl-code-block-content-font: var(--dsw-font-markdown-code-block-small); }\n.dsh-side-chat-tool-terminal {\n --dsl-terminal-font: var(--dsw-font-markdown-code-block-small);\n --dsl-terminal-line-height: 18px;\n --dsl-terminal-output-max-height: 224px;\n border: 1px solid var(--dsw-alias-border-l1, var(--side-chat-border));\n}\n.dsh-side-chat-tool-io-card {\n display: flex;\n flex-direction: column;\n margin: 4px 0 4px 4px;\n border: 1px solid var(--dsw-alias-border-l1, var(--side-chat-border));\n border-radius: 12px;\n background: var(--dsw-alias-markdown-code-block, #f6f6f7);\n font: var(--dsw-font-markdown-code-block-small, 12px/18px ui-monospace, SFMono-Regular, Consolas, monospace);\n}\n.dsh-side-chat-tool-io-section {\n display: grid;\n max-height: 150px;\n grid-template-columns: max-content minmax(0, 1fr);\n column-gap: 14px;\n align-items: baseline;\n overflow-y: auto;\n padding: 12px 16px;\n}\n.dsh-side-chat-tool-io-divider {\n height: 1px;\n flex: none;\n background: var(--dsw-alias-border-l2, var(--side-chat-border));\n}\n.dsh-side-chat-tool-io-label {\n position: sticky;\n top: 0;\n align-self: start;\n color: var(--dsw-alias-label-caption, #8d8d95);\n}\n.dsh-side-chat-tool-io-text {\n min-width: 0;\n white-space: pre-wrap;\n word-break: break-word;\n color: var(--dsw-alias-label-secondary, #4b4b52);\n}\n.dsh-side-chat-tool-io-text[data-error] { color: var(--dsw-alias-state-error-primary, var(--dsw-danger, #b42318)); }\n.dsh-side-chat-tool-subcalls {\n display: flex;\n flex-direction: column;\n gap: 4px;\n margin: 4px 0 2px 22px;\n padding-left: 8px;\n border-left: 1px solid var(--dsw-alias-border-l2, var(--side-chat-border));\n}\n.dsh-side-chat-tool-visually-hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n}\n.dsh-side-chat-turn-notice,\n.dsh-side-chat-interaction,\n.dsh-side-chat-queue { padding: 10px; border: 1px solid var(--side-chat-border); border-radius: 10px; }\n.dsh-side-chat-interaction fieldset { margin: 8px 0; border: 1px solid var(--side-chat-border); border-radius: 8px; }\n.dsh-side-chat-question-option { display: flex; gap: 8px; margin: 8px 0; }\n.dsh-side-chat-interaction textarea { width: 100%; box-sizing: border-box; resize: vertical; }\n.dsh-side-chat-interaction-actions,\n.dsh-side-chat-composer > div,\n.dsh-side-chat-queue > div { display: flex; justify-content: end; gap: 8px; }\n.dsh-side-chat-interaction button,\n.dsh-side-chat-composer button,\n.dsh-side-chat-queue button { min-height: 32px; border: 1px solid var(--side-chat-border); border-radius: 7px; background: var(--dsw-control, #f7f7f9); color: inherit; cursor: pointer; }\n.dsh-side-chat-composer {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 8px;\n align-items: end;\n margin: 0 12px 12px;\n padding: 8px 8px 8px 12px;\n border: 1px solid var(--side-chat-border);\n border-radius: 24px;\n background: var(--side-chat-bg);\n box-shadow: 0 2px 8px rgb(0 0 0 / 5%);\n}\n.dsh-side-chat-composer textarea {\n width: 100%;\n height: auto;\n min-height: 24px;\n max-height: 160px;\n box-sizing: border-box;\n resize: none;\n overflow-y: hidden;\n padding: 6px;\n border: 0;\n outline: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n line-height: 1.5;\n}\n.dsh-side-chat-composer button { align-self: end; }\n.dsh-side-chat-loading { display: grid; height: 100%; place-items: center; color: var(--side-chat-muted); }\n\n.dsh-side-chat-header {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n gap: 8px 12px;\n align-items: center;\n flex: 0 0 auto;\n min-height: 46px;\n box-sizing: border-box;\n padding: 5px 10px 5px 16px;\n border-bottom: 1px solid var(--side-chat-border);\n background: var(--side-chat-bg);\n}\n\n.dsh-side-chat-heading { display: flex; min-width: 0; flex-direction: column; }\n.dsh-side-chat-heading strong { font-size: 14px; font-weight: 600; }\n.dsh-side-chat-footer { color: var(--side-chat-muted); font-size: 12px; }\n.dsh-side-chat-header button,\n.dsh-side-chat-inline-actions button,\n.dsh-side-chat-draft button,\n.dsh-side-chat-error button,\n.dsh-side-chat-selection-actions button {\n min-height: 32px;\n border: 1px solid var(--side-chat-border);\n border-radius: 7px;\n background: var(--dsw-control, #f7f7f9);\n color: inherit;\n cursor: pointer;\n}\n.dsh-side-chat-header button:disabled { cursor: not-allowed; opacity: .55; }\n.dsh-side-chat-header .dsh-side-chat-heading {\n align-items: flex-start;\n min-height: 0;\n padding: 4px 0;\n border: 0;\n background: transparent;\n text-align: left;\n}\n.dsh-side-chat-header > button:last-child {\n width: 32px;\n min-height: 32px;\n padding: 0;\n border: 0;\n border-radius: 999px;\n background: transparent;\n font-size: 20px;\n line-height: 1;\n}\n.dsh-side-chat-header > button:last-child:hover { background: var(--dsw-surface-subtle, #f3f3f5); }\n\n.dsh-side-chat-quote { position: relative; max-width: 100%; align-self: flex-start; }\n.dsh-side-chat-quote-chip {\n display: inline-flex;\n min-height: 36px;\n align-items: center;\n overflow: hidden;\n padding: 0;\n border: 1px solid var(--side-chat-border);\n border-radius: 999px;\n background: var(--side-chat-bg);\n transition: background-color 120ms ease;\n}\n.dsh-side-chat-quote:hover .dsh-side-chat-quote-chip,\n.dsh-side-chat-quote:focus-within .dsh-side-chat-quote-chip,\n.dsh-side-chat-quote[data-expanded] .dsh-side-chat-quote-chip { background: var(--dsw-surface-subtle, #f3f3f5); }\n.dsh-side-chat-quote-chip .dsh-side-chat-quote-trigger {\n display: inline-flex;\n min-height: 34px;\n align-items: center;\n gap: 8px;\n padding: 0 11px;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n}\n.dsh-side-chat-quote-trigger strong { font-size: 13px; font-weight: 500; line-height: 1; }\n.dsh-side-chat-quote-icon {\n width: 16px;\n height: 16px;\n flex: 0 0 auto;\n color: var(--side-chat-muted);\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-width: 1.7;\n}\n.dsh-side-chat-quote-chip .dsh-side-chat-quote-remove {\n display: grid;\n width: 0;\n height: 34px;\n min-height: 34px;\n box-sizing: border-box;\n flex: 0 0 auto;\n place-items: center;\n overflow: hidden;\n padding: 0;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: var(--side-chat-muted);\n cursor: pointer;\n font: inherit;\n font-size: 18px;\n line-height: 1;\n opacity: 0;\n pointer-events: none;\n transition: width 120ms ease, margin-left 120ms ease, opacity 100ms ease, background-color 100ms ease;\n}\n.dsh-side-chat-quote:hover .dsh-side-chat-quote-remove,\n.dsh-side-chat-quote:focus-within .dsh-side-chat-quote-remove {\n width: 30px;\n opacity: 1;\n pointer-events: auto;\n}\n.dsh-side-chat-quote-remove:hover { background: rgb(0 0 0 / 6%); color: inherit; }\n.dsh-side-chat-quote-details {\n position: absolute;\n z-index: 10;\n bottom: calc(100% + 8px);\n left: 0;\n width: min(520px, calc(100vw - 64px));\n max-width: calc(100vw - 48px);\n box-sizing: border-box;\n padding: 14px 16px;\n border: 1px solid var(--side-chat-border);\n border-radius: 16px;\n background: var(--side-chat-bg);\n box-shadow: 0 4px 14px rgb(0 0 0 / 8%);\n font-size: 14px;\n line-height: 1.45;\n opacity: 0;\n pointer-events: none;\n transform: translate(var(--dsh-side-chat-quote-offset-x, 0px), 4px);\n visibility: hidden;\n transition: opacity 100ms ease, transform 120ms ease, visibility 100ms ease;\n}\n.dsh-side-chat-quote-details::before {\n content: '';\n position: absolute;\n right: 0;\n bottom: -8px;\n left: 0;\n height: 8px;\n}\n.dsh-side-chat-quote:hover .dsh-side-chat-quote-details,\n.dsh-side-chat-quote[data-hovered] .dsh-side-chat-quote-details,\n.dsh-side-chat-quote:focus-within .dsh-side-chat-quote-details,\n.dsh-side-chat-quote[data-expanded] .dsh-side-chat-quote-details {\n opacity: 1;\n pointer-events: auto;\n transform: translate(var(--dsh-side-chat-quote-offset-x, 0px), 0);\n visibility: visible;\n}\n.dsh-side-chat-annotated-user-message .dsh-side-chat-quote-details {\n top: calc(100% + 8px);\n right: 0;\n bottom: auto;\n left: auto;\n}\n.dsh-side-chat-annotated-user-message .dsh-side-chat-quote-details::before {\n top: -8px;\n bottom: auto;\n}\n.dsh-side-chat-quote-details-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n.dsh-side-chat-quote-details-header strong { color: var(--side-chat-muted); font-size: 13px; font-weight: 500; }\n.dsh-side-chat-quote-detail + .dsh-side-chat-quote-detail {\n margin-top: 12px;\n padding-top: 12px;\n border-top: 1px solid var(--side-chat-border);\n}\n.dsh-side-chat-quote pre {\n max-height: 180px;\n margin: 4px 0 0;\n overflow: auto;\n white-space: pre-wrap;\n font: inherit;\n}\n.dsh-side-chat-quote-comment {\n margin-top: 9px;\n}\n.dsh-side-chat-quote-comment > strong { color: var(--side-chat-muted); font-size: 13px; font-weight: 500; }\n.dsh-side-chat-quote-comment > pre { margin-top: 4px; }\n.dsh-side-chat-error { margin: 10px 16px 0; padding: 10px 12px; border: 1px solid var(--side-chat-border); border-radius: 14px; background: var(--dsw-surface-subtle, #f7f7f9); }\n.dsh-side-chat-error { border-color: var(--dsw-danger, #b42318); }\n.dsh-side-chat-body { min-height: 0; flex: 1; overflow: hidden; }\n.dsh-side-chat-annotated-user-message {\n display: flex;\n max-width: 92%;\n align-self: end;\n align-items: flex-start;\n flex-direction: column;\n gap: 8px;\n}\n.dsh-side-chat-annotated-user-message .dsh-side-chat-message { max-width: 100%; align-self: stretch; }\n\n/* The DSH occurrence remains the durable serialization carrier, while this\n plugin-owned capsule supplies the visible and interactive projection. */\n[data-composer-seat] [data-decoration=\"chip\"][title=\"__dsh_side_chat_annotations__\"] {\n visibility: hidden;\n}\n.dsh-side-chat-parent-annotation-dock,\n.dsh-side-chat-parent-user-message {\n --side-chat-border: var(--dsw-border, #d8d8de);\n --side-chat-bg: var(--dsw-surface, #ffffff);\n --side-chat-muted: var(--dsw-text-muted, #62636a);\n color: var(--dsw-text, #19191d);\n}\n.dsh-side-chat-parent-annotation-dock {\n position: relative;\n z-index: 20;\n width: calc(100% - 32px);\n max-width: var(--dsh-composer-card-max-width, 780px);\n height: 0;\n margin: 0 auto;\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 flex-direction: column;\n align-items: flex-end;\n gap: 8px;\n}\n.dsh-side-chat-parent-user-message > .dsh-side-chat-quote { align-self: flex-end; }\n.dsh-side-chat-parent-user-message > .dsh-side-chat-quote .dsh-side-chat-quote-details {\n right: 0;\n left: auto;\n}\n.dsh-side-chat-draft {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n min-height: 0;\n flex: 0 0 auto;\n gap: 8px;\n align-items: end;\n margin: auto 12px 12px;\n padding: 12px;\n border: 1px solid var(--side-chat-border);\n border-radius: 24px;\n background: var(--side-chat-bg);\n box-shadow: 0 2px 8px rgb(0 0 0 / 5%);\n}\n.dsh-side-chat-draft > .dsh-side-chat-quote { grid-column: 1 / -1; }\n.dsh-side-chat-draft label {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n}\n.dsh-side-chat-draft textarea {\n width: 100%;\n height: auto;\n min-height: 24px;\n max-height: 160px;\n box-sizing: border-box;\n resize: none;\n overflow-y: hidden;\n padding: 6px 2px;\n border: 0;\n outline: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n line-height: 1.5;\n}\n.dsh-side-chat-draft > button { align-self: end; }\n.dsh-side-chat-panel .dsh-side-chat-send-button,\n.dsh-side-chat-panel .dsh-side-chat-stop-button {\n display: grid;\n width: 34px;\n height: 34px;\n min-height: 34px;\n flex: none;\n place-items: center;\n padding: 1px 6px;\n border: 0;\n border-radius: 999px;\n background: var(--dsw-alias-button-info-fill, #4176e6);\n color: #fff;\n cursor: pointer;\n line-height: 1;\n transform: translateY(-2px);\n transition: background-color 100ms ease;\n}\n.dsh-side-chat-panel .dsh-side-chat-send-button:hover:not(:disabled),\n.dsh-side-chat-panel .dsh-side-chat-stop-button:hover:not(:disabled) {\n background: var(--dsw-alias-button-info-hover, #3467d6);\n}\n.dsh-side-chat-panel .dsh-side-chat-send-button:disabled,\n.dsh-side-chat-panel .dsh-side-chat-stop-button:disabled { cursor: default; opacity: .4; }\n.dsh-side-chat-footer { display: none; }\n.dsh-side-chat-announcer { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }\n\n.dsh-side-chat-selection-actions {\n position: fixed;\n z-index: 90;\n display: flex;\n max-width: calc(100vw - 16px);\n flex-wrap: wrap;\n gap: 0;\n padding: 0;\n border: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 999px;\n background: var(--dsw-surface, #fff);\n box-shadow: 0 4px 14px rgb(0 0 0 / 12%);\n overflow: hidden;\n}\n.dsh-side-chat-selection-actions button {\n min-height: 36px;\n padding: 0 14px;\n border: 0;\n border-radius: 0;\n background: transparent;\n color: inherit;\n transition: background-color 120ms ease;\n}\n.dsh-side-chat-selection-actions button:hover:not(:disabled),\n.dsh-side-chat-selection-actions button:focus-visible {\n background: var(--dsw-surface-subtle, #f3f3f5);\n}\n.dsh-side-chat-selection-actions button + button {\n border-left: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 0;\n}\n\n.dsh-side-chat-selection-marker {\n position: fixed;\n z-index: 91;\n display: grid;\n width: 28px;\n height: 28px;\n place-items: center;\n border: 2px solid var(--dsw-surface, #fff);\n border-radius: 999px;\n background: var(--dsw-alias-button-info, #1473e6);\n box-shadow: 0 2px 6px rgb(0 0 0 / 12%);\n color: #fff;\n font-size: 13px;\n font-weight: 600;\n line-height: 1;\n pointer-events: none;\n}\n\n.dsh-side-chat-selection-comment {\n position: fixed;\n z-index: 92;\n display: grid;\n max-width: calc(100vw - 16px);\n box-sizing: border-box;\n gap: 10px;\n padding: 12px;\n border: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 20px;\n background: var(--dsw-surface, #fff);\n box-shadow: 0 5px 18px rgb(0 0 0 / 9%);\n color: var(--dsw-text, #19191d);\n}\n.dsh-side-chat-selection-comment textarea {\n width: 100%;\n min-height: 48px;\n max-height: 128px;\n box-sizing: border-box;\n resize: none;\n padding: 6px 8px;\n overflow-y: auto;\n border: 0;\n outline: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n line-height: 1.45;\n}\n.dsh-side-chat-selection-comment-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n.dsh-side-chat-selection-comment-actions button {\n min-height: 32px;\n padding: 0 14px;\n border: 1px solid var(--dsw-border, #d8d8de);\n border-radius: 999px;\n background: var(--dsw-surface, #fff);\n color: inherit;\n cursor: pointer;\n font: inherit;\n}\n.dsh-side-chat-selection-comment-actions button:hover { background: var(--dsw-surface-subtle, #f3f3f5); }\n.dsh-side-chat-selection-comment-actions .dsh-side-chat-selection-comment-save {\n border-color: transparent;\n background: var(--dsw-alias-button-info, #1473e6);\n color: #fff;\n}\n.dsh-side-chat-selection-comment-actions .dsh-side-chat-selection-comment-save:hover {\n background: var(--dsw-alias-button-info-hover, #3467d6);\n}\n\n@media (max-width: 900px) {\n .dsh-side-chat-panel {\n right: 12px;\n bottom: 12px;\n width: calc(100vw - 24px);\n max-height: calc(100dvh - 24px);\n border-radius: 24px;\n }\n}\n\n@media (max-width: 720px) {\n .dsh-side-chat-panel {\n right: 8px;\n bottom: 8px;\n width: calc(100vw - 16px);\n height: min(78dvh, 760px);\n max-height: calc(100dvh - 16px);\n border-radius: 22px;\n }\n .dsh-side-chat-transcript { padding: 14px 14px 20px; }\n .dsh-side-chat-header { padding-left: 14px; }\n .dsh-side-chat-error { margin-inline: 12px; }\n}\n\n@media (max-height: 620px) {\n .dsh-side-chat-panel {\n bottom: 8px;\n height: calc(100dvh - 16px);\n max-height: calc(100dvh - 16px);\n }\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .dsh-side-chat-panel { animation: dsh-side-chat-enter 160ms ease-out; }\n @keyframes dsh-side-chat-enter { from { transform: translateY(18px) scale(.985); opacity: .7; } }\n}\n\n@media (forced-colors: active) {\n.dsh-side-chat-panel,\n.dsh-side-chat-selection-actions,\n.dsh-side-chat-selection-comment { 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";
|
|
@@ -339,7 +339,7 @@ window.__ModuleLoader__.load({
|
|
|
339
339
|
})
|
|
340
340
|
});
|
|
341
341
|
}
|
|
342
|
-
function contentText$
|
|
342
|
+
function contentText$2(content) {
|
|
343
343
|
return content.map((block) => {
|
|
344
344
|
if (typeof block !== "object" || block === null) return "";
|
|
345
345
|
const value = block;
|
|
@@ -370,7 +370,7 @@ window.__ModuleLoader__.load({
|
|
|
370
370
|
/** Wrap DSH's own user renderer only when this plugin's durable prefix exists. */
|
|
371
371
|
function annotatedUserMessageRenderer(Original) {
|
|
372
372
|
return function AnnotatedUserMessageRenderer(props) {
|
|
373
|
-
const parsed = parseAnnotatedConversationPrompt(contentText$
|
|
373
|
+
const parsed = parseAnnotatedConversationPrompt(contentText$2(props.node.data.content));
|
|
374
374
|
if (parsed === void 0) return (0, react.createElement)(Original, props);
|
|
375
375
|
const node = {
|
|
376
376
|
...props.node,
|
|
@@ -5605,6 +5605,496 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5605
5605
|
});
|
|
5606
5606
|
}
|
|
5607
5607
|
//#endregion
|
|
5608
|
+
//#region src/client/rc6/SideChatTool.tsx
|
|
5609
|
+
const TOOL_VARIANTS = {
|
|
5610
|
+
bash: "bash",
|
|
5611
|
+
pwsh: "bash",
|
|
5612
|
+
read: "read",
|
|
5613
|
+
web_fetch: "read",
|
|
5614
|
+
web_search: "search",
|
|
5615
|
+
grep: "search",
|
|
5616
|
+
glob: "search",
|
|
5617
|
+
write: "write",
|
|
5618
|
+
edit: "edit",
|
|
5619
|
+
run_code: "code"
|
|
5620
|
+
};
|
|
5621
|
+
const VARIANT_TITLES = {
|
|
5622
|
+
search: "Search",
|
|
5623
|
+
read: "Read",
|
|
5624
|
+
bash: "Bash",
|
|
5625
|
+
write: "Write",
|
|
5626
|
+
edit: "Edit",
|
|
5627
|
+
code: "Code",
|
|
5628
|
+
others: "Tool call"
|
|
5629
|
+
};
|
|
5630
|
+
const SUMMARY_KEYS = {
|
|
5631
|
+
bash: ["description", "command"],
|
|
5632
|
+
read: [
|
|
5633
|
+
"path",
|
|
5634
|
+
"file_path",
|
|
5635
|
+
"url"
|
|
5636
|
+
],
|
|
5637
|
+
search: [
|
|
5638
|
+
"query",
|
|
5639
|
+
"pattern",
|
|
5640
|
+
"url"
|
|
5641
|
+
],
|
|
5642
|
+
write: ["path", "file_path"],
|
|
5643
|
+
edit: ["path", "file_path"],
|
|
5644
|
+
code: ["description"],
|
|
5645
|
+
others: []
|
|
5646
|
+
};
|
|
5647
|
+
function record(value) {
|
|
5648
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
|
|
5649
|
+
}
|
|
5650
|
+
function stringValue(value) {
|
|
5651
|
+
return typeof value === "string" && value !== "" ? value : void 0;
|
|
5652
|
+
}
|
|
5653
|
+
function numberValue(value) {
|
|
5654
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
5655
|
+
}
|
|
5656
|
+
function booleanValue(value) {
|
|
5657
|
+
return typeof value === "boolean" ? value : void 0;
|
|
5658
|
+
}
|
|
5659
|
+
function firstLine(text) {
|
|
5660
|
+
const newline = text.indexOf("\n");
|
|
5661
|
+
return newline === -1 ? text : text.slice(0, newline);
|
|
5662
|
+
}
|
|
5663
|
+
function stringify$1(value) {
|
|
5664
|
+
if (typeof value === "string") return value;
|
|
5665
|
+
try {
|
|
5666
|
+
return JSON.stringify(value, null, 2);
|
|
5667
|
+
} catch {
|
|
5668
|
+
return String(value);
|
|
5669
|
+
}
|
|
5670
|
+
}
|
|
5671
|
+
function contentText$1(content) {
|
|
5672
|
+
return content.map((block) => {
|
|
5673
|
+
if (block.type === "text" || block.type === "reasoning") return block.text;
|
|
5674
|
+
if (block.type === "image") return "[Image]";
|
|
5675
|
+
if (block.type === "tool-call") return `${block.name}(${block.arguments})`;
|
|
5676
|
+
if (block.type === "tool-result") return contentText$1(block.content);
|
|
5677
|
+
return stringify$1(block);
|
|
5678
|
+
}).filter(Boolean).join("\n");
|
|
5679
|
+
}
|
|
5680
|
+
function toolOutputText(content) {
|
|
5681
|
+
const text = contentText$1(content);
|
|
5682
|
+
return /^<path>[\s\S]*?<\/path>\s*<type>[\s\S]*?<\/type>\s*<content>\s*\n?([\s\S]*?)\n?<\/content>\s*$/u.exec(text)?.[1]?.trimEnd() ?? text;
|
|
5683
|
+
}
|
|
5684
|
+
function parseArguments(argsRaw) {
|
|
5685
|
+
try {
|
|
5686
|
+
return record(JSON.parse(argsRaw));
|
|
5687
|
+
} catch {
|
|
5688
|
+
return null;
|
|
5689
|
+
}
|
|
5690
|
+
}
|
|
5691
|
+
function formattedArguments(argsRaw) {
|
|
5692
|
+
try {
|
|
5693
|
+
return JSON.stringify(JSON.parse(argsRaw), null, 2);
|
|
5694
|
+
} catch {
|
|
5695
|
+
return argsRaw;
|
|
5696
|
+
}
|
|
5697
|
+
}
|
|
5698
|
+
function classifyTool(name) {
|
|
5699
|
+
return TOOL_VARIANTS[name.toLowerCase()] ?? "others";
|
|
5700
|
+
}
|
|
5701
|
+
function toolTitle(name, variant) {
|
|
5702
|
+
if (name.toLowerCase() === "pwsh") return "Pwsh";
|
|
5703
|
+
return VARIANT_TITLES[variant];
|
|
5704
|
+
}
|
|
5705
|
+
function pickArgument(args, keys) {
|
|
5706
|
+
for (const key of keys) {
|
|
5707
|
+
const value = stringValue(args[key]);
|
|
5708
|
+
if (value !== void 0) return value;
|
|
5709
|
+
}
|
|
5710
|
+
return Object.values(args).find((value) => typeof value === "string" && value !== "");
|
|
5711
|
+
}
|
|
5712
|
+
function relativizeToCwd(path, cwd) {
|
|
5713
|
+
if (cwd === void 0 || cwd === "") return path;
|
|
5714
|
+
const root = cwd.replace(/[/\\]+$/u, "");
|
|
5715
|
+
const lowerPath = path.toLowerCase();
|
|
5716
|
+
const lowerRoot = root.toLowerCase();
|
|
5717
|
+
return lowerPath.startsWith(`${lowerRoot}/`) || lowerPath.startsWith(`${lowerRoot}\\`) ? path.slice(root.length + 1) : path;
|
|
5718
|
+
}
|
|
5719
|
+
function summaryFromArguments(name, variant, argsRaw, callId, cwd) {
|
|
5720
|
+
const args = parseArguments(argsRaw);
|
|
5721
|
+
const base = relativizeToCwd(firstLine((args === null ? void 0 : pickArgument(args, SUMMARY_KEYS[variant])) ?? (argsRaw === "" || argsRaw === "{}" ? callId : argsRaw)), cwd);
|
|
5722
|
+
return variant === "others" && name !== "" ? `${name} · ${base}` : base;
|
|
5723
|
+
}
|
|
5724
|
+
function filePathFromArguments(variant, argsRaw) {
|
|
5725
|
+
if (variant !== "read" && variant !== "write" && variant !== "edit") return void 0;
|
|
5726
|
+
const args = parseArguments(argsRaw);
|
|
5727
|
+
if (args === null) return void 0;
|
|
5728
|
+
return stringValue(args["path"]) ?? stringValue(args["file_path"]);
|
|
5729
|
+
}
|
|
5730
|
+
function variantIcon(variant) {
|
|
5731
|
+
switch (variant) {
|
|
5732
|
+
case "search": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSearchOutline16, { size: 14 });
|
|
5733
|
+
case "read": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBrowseOutline16, { size: 14 });
|
|
5734
|
+
case "bash": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconApiOutline14, { size: 14 });
|
|
5735
|
+
case "write":
|
|
5736
|
+
case "edit": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEditOutline16, { size: 14 });
|
|
5737
|
+
case "code": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCodeOutline16, { size: 14 });
|
|
5738
|
+
case "others": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSparkle16, { size: 14 });
|
|
5739
|
+
}
|
|
5740
|
+
}
|
|
5741
|
+
function resolveTerminalCwd(viewCwd, cwd) {
|
|
5742
|
+
if (viewCwd === void 0 || viewCwd === "") return cwd;
|
|
5743
|
+
if (cwd === void 0 || cwd === "" || /^(?:[A-Za-z]:[/\\]|[/\\]{1,2})/u.test(viewCwd)) return viewCwd;
|
|
5744
|
+
return `${cwd.replace(/[/\\]+$/u, "")}\\${viewCwd}`;
|
|
5745
|
+
}
|
|
5746
|
+
function terminalCard(variant, argsRaw, state, output, callView, resultView, cwd) {
|
|
5747
|
+
const call = record(callView);
|
|
5748
|
+
const result = record(resultView);
|
|
5749
|
+
const callIsTerminal = call?.["card"] === "terminal";
|
|
5750
|
+
const resultIsTerminal = result?.["card"] === "terminal";
|
|
5751
|
+
if (variant !== "bash" && !callIsTerminal && !resultIsTerminal) return null;
|
|
5752
|
+
const args = parseArguments(argsRaw);
|
|
5753
|
+
return {
|
|
5754
|
+
command: stringValue(result?.["title"]) ?? stringValue(call?.["title"]) ?? (args === null ? void 0 : stringValue(args["command"])) ?? "",
|
|
5755
|
+
cwd: resolveTerminalCwd(stringValue(call?.["cwd"]), cwd),
|
|
5756
|
+
output: stringValue(result?.["output"]) ?? output,
|
|
5757
|
+
exitCode: numberValue(result?.["exitCode"]),
|
|
5758
|
+
signal: stringValue(result?.["signal"]),
|
|
5759
|
+
running: state === "running" || state === "pending",
|
|
5760
|
+
description: stringValue(call?.["description"])
|
|
5761
|
+
};
|
|
5762
|
+
}
|
|
5763
|
+
function languageForPath(path) {
|
|
5764
|
+
if (path === void 0) return void 0;
|
|
5765
|
+
const extension = /\.([^.\\/]+)$/u.exec(path)?.[1]?.toLowerCase();
|
|
5766
|
+
return extension === void 0 ? void 0 : {
|
|
5767
|
+
js: "javascript",
|
|
5768
|
+
jsx: "jsx",
|
|
5769
|
+
ts: "typescript",
|
|
5770
|
+
tsx: "tsx",
|
|
5771
|
+
json: "json",
|
|
5772
|
+
css: "css",
|
|
5773
|
+
html: "html",
|
|
5774
|
+
md: "markdown",
|
|
5775
|
+
yml: "yaml",
|
|
5776
|
+
yaml: "yaml",
|
|
5777
|
+
py: "python",
|
|
5778
|
+
ps1: "powershell",
|
|
5779
|
+
sh: "bash",
|
|
5780
|
+
toml: "toml",
|
|
5781
|
+
xml: "xml"
|
|
5782
|
+
}[extension];
|
|
5783
|
+
}
|
|
5784
|
+
function validReadLines(value) {
|
|
5785
|
+
if (!Array.isArray(value)) return null;
|
|
5786
|
+
const lines = [];
|
|
5787
|
+
for (const item of value) {
|
|
5788
|
+
const line = record(item);
|
|
5789
|
+
const number = numberValue(line?.["number"]);
|
|
5790
|
+
const text = stringValue(line?.["text"]) ?? (line?.["text"] === "" ? "" : void 0);
|
|
5791
|
+
if (number === void 0 || text === void 0) return null;
|
|
5792
|
+
lines.push({
|
|
5793
|
+
number,
|
|
5794
|
+
text
|
|
5795
|
+
});
|
|
5796
|
+
}
|
|
5797
|
+
return lines;
|
|
5798
|
+
}
|
|
5799
|
+
function readCard(name, argsRaw, state, output, resultView, cwd) {
|
|
5800
|
+
if (state === "running" || state === "pending" || state === "error" || state === "interrupted") return null;
|
|
5801
|
+
const result = record(resultView);
|
|
5802
|
+
if (result?.["card"] === "read") {
|
|
5803
|
+
const lines = validReadLines(result["lines"]);
|
|
5804
|
+
const totalLines = numberValue(result["totalLines"]);
|
|
5805
|
+
const path = stringValue(result["path"]);
|
|
5806
|
+
if (lines === null || totalLines === void 0) return null;
|
|
5807
|
+
return {
|
|
5808
|
+
label: stringValue(result["title"]) ?? (path === void 0 ? void 0 : relativizeToCwd(path, cwd)),
|
|
5809
|
+
lines,
|
|
5810
|
+
totalLines,
|
|
5811
|
+
lang: stringValue(result["lang"])
|
|
5812
|
+
};
|
|
5813
|
+
}
|
|
5814
|
+
if (name.toLowerCase() !== "read" || output === void 0) return null;
|
|
5815
|
+
const path = filePathFromArguments("read", argsRaw);
|
|
5816
|
+
const texts = output.split("\n");
|
|
5817
|
+
return {
|
|
5818
|
+
label: path === void 0 ? void 0 : relativizeToCwd(path, cwd),
|
|
5819
|
+
lines: texts.map((text, index) => ({
|
|
5820
|
+
number: index + 1,
|
|
5821
|
+
text
|
|
5822
|
+
})),
|
|
5823
|
+
totalLines: texts.length,
|
|
5824
|
+
lang: languageForPath(path)
|
|
5825
|
+
};
|
|
5826
|
+
}
|
|
5827
|
+
function validSearchCard(resultView) {
|
|
5828
|
+
const result = record(resultView);
|
|
5829
|
+
if (result?.["card"] !== "search") return null;
|
|
5830
|
+
const truncated = booleanValue(result["truncated"]);
|
|
5831
|
+
const total = numberValue(result["total"]);
|
|
5832
|
+
if (truncated === void 0 || total === void 0) return null;
|
|
5833
|
+
if (result["shape"] === "paths") {
|
|
5834
|
+
const paths = result["paths"];
|
|
5835
|
+
return Array.isArray(paths) && paths.every((path) => typeof path === "string") ? {
|
|
5836
|
+
kind: "paths",
|
|
5837
|
+
paths,
|
|
5838
|
+
truncated,
|
|
5839
|
+
total
|
|
5840
|
+
} : null;
|
|
5841
|
+
}
|
|
5842
|
+
if (result["shape"] !== "matches" || !Array.isArray(result["files"])) return null;
|
|
5843
|
+
const files = [];
|
|
5844
|
+
for (const item of result["files"]) {
|
|
5845
|
+
const file = record(item);
|
|
5846
|
+
const path = stringValue(file?.["path"]);
|
|
5847
|
+
const matchesValue = file?.["matches"];
|
|
5848
|
+
if (path === void 0 || !Array.isArray(matchesValue)) return null;
|
|
5849
|
+
const matches = [];
|
|
5850
|
+
for (const matchValue of matchesValue) {
|
|
5851
|
+
const match = record(matchValue);
|
|
5852
|
+
const lineNumber = numberValue(match?.["lineNumber"]);
|
|
5853
|
+
const line = stringValue(match?.["line"]) ?? (match?.["line"] === "" ? "" : void 0);
|
|
5854
|
+
if (lineNumber === void 0 || line === void 0) return null;
|
|
5855
|
+
matches.push({
|
|
5856
|
+
lineNumber,
|
|
5857
|
+
line
|
|
5858
|
+
});
|
|
5859
|
+
}
|
|
5860
|
+
files.push({
|
|
5861
|
+
path,
|
|
5862
|
+
matches
|
|
5863
|
+
});
|
|
5864
|
+
}
|
|
5865
|
+
return {
|
|
5866
|
+
kind: "matches",
|
|
5867
|
+
files,
|
|
5868
|
+
truncated,
|
|
5869
|
+
total
|
|
5870
|
+
};
|
|
5871
|
+
}
|
|
5872
|
+
function validDiffs(view) {
|
|
5873
|
+
const value = record(view);
|
|
5874
|
+
if (value?.["card"] !== "diff" || !Array.isArray(value["diffs"]) || value["diffs"].length === 0) return null;
|
|
5875
|
+
const diffs = [];
|
|
5876
|
+
for (const item of value["diffs"]) {
|
|
5877
|
+
const hunk = record(item);
|
|
5878
|
+
const path = stringValue(hunk?.["path"]);
|
|
5879
|
+
const oldText = hunk?.["oldText"];
|
|
5880
|
+
const newText = stringValue(hunk?.["newText"]) ?? (hunk?.["newText"] === "" ? "" : void 0);
|
|
5881
|
+
if (path === void 0 || oldText !== null && typeof oldText !== "string" || newText === void 0) return null;
|
|
5882
|
+
diffs.push({
|
|
5883
|
+
path,
|
|
5884
|
+
oldText,
|
|
5885
|
+
newText
|
|
5886
|
+
});
|
|
5887
|
+
}
|
|
5888
|
+
return diffs;
|
|
5889
|
+
}
|
|
5890
|
+
function validWebCard(view) {
|
|
5891
|
+
const result = record(view);
|
|
5892
|
+
if (result?.["card"] !== "web") return null;
|
|
5893
|
+
const truncated = booleanValue(result["truncated"]);
|
|
5894
|
+
if (truncated === void 0) return null;
|
|
5895
|
+
if (result["kind"] === "fetch") {
|
|
5896
|
+
const url = stringValue(result["url"]);
|
|
5897
|
+
const statusCode = numberValue(result["statusCode"]);
|
|
5898
|
+
return url === void 0 || statusCode === void 0 ? null : {
|
|
5899
|
+
kind: "fetch",
|
|
5900
|
+
url,
|
|
5901
|
+
statusCode,
|
|
5902
|
+
truncated
|
|
5903
|
+
};
|
|
5904
|
+
}
|
|
5905
|
+
if (result["kind"] !== "search" || !Array.isArray(result["sources"])) return null;
|
|
5906
|
+
const sources = [];
|
|
5907
|
+
for (const item of result["sources"]) {
|
|
5908
|
+
const source = record(item);
|
|
5909
|
+
const url = stringValue(source?.["url"]);
|
|
5910
|
+
if (url === void 0) return null;
|
|
5911
|
+
const title = stringValue(source?.["title"]);
|
|
5912
|
+
const snippet = stringValue(source?.["snippet"]);
|
|
5913
|
+
const publishedAt = stringValue(source?.["publishedAt"]);
|
|
5914
|
+
sources.push({
|
|
5915
|
+
url,
|
|
5916
|
+
...title === void 0 ? {} : { title },
|
|
5917
|
+
...snippet === void 0 ? {} : { snippet },
|
|
5918
|
+
...publishedAt === void 0 ? {} : { publishedAt }
|
|
5919
|
+
});
|
|
5920
|
+
}
|
|
5921
|
+
const answer = stringValue(result["answer"]);
|
|
5922
|
+
return {
|
|
5923
|
+
kind: "search",
|
|
5924
|
+
sources,
|
|
5925
|
+
truncated,
|
|
5926
|
+
...answer === void 0 ? {} : { answer }
|
|
5927
|
+
};
|
|
5928
|
+
}
|
|
5929
|
+
function genericBody(variant, argsRaw) {
|
|
5930
|
+
if (argsRaw === "" || argsRaw === "{}") return null;
|
|
5931
|
+
if (variant === "read" || variant === "write" || variant === "edit") return null;
|
|
5932
|
+
return formattedArguments(argsRaw);
|
|
5933
|
+
}
|
|
5934
|
+
function leadingFor(state, icon) {
|
|
5935
|
+
if (state === "error") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: "error" });
|
|
5936
|
+
if (state === "interrupted") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: "warning" });
|
|
5937
|
+
return icon;
|
|
5938
|
+
}
|
|
5939
|
+
function toolStatus(state) {
|
|
5940
|
+
if (state === "running" || state === "pending") return "Running";
|
|
5941
|
+
if (state === "error") return "Failed";
|
|
5942
|
+
if (state === "interrupted") return "Stopped";
|
|
5943
|
+
return null;
|
|
5944
|
+
}
|
|
5945
|
+
function ToolCard({ callId, name, argsRaw, state, output, callView, resultView, cwd }) {
|
|
5946
|
+
const [expanded, setExpanded] = (0, react.useState)(false);
|
|
5947
|
+
const variant = classifyTool(name);
|
|
5948
|
+
const terminal = terminalCard(variant, argsRaw, state, output, callView, resultView, cwd);
|
|
5949
|
+
const terminalFailed = terminal !== null && !terminal.running && (terminal.exitCode !== void 0 && terminal.exitCode !== 0 || terminal.signal !== void 0);
|
|
5950
|
+
const visualState = state === "success" && terminalFailed ? "error" : state;
|
|
5951
|
+
const read = readCard(name, argsRaw, visualState, output, resultView, cwd);
|
|
5952
|
+
const search = validSearchCard(resultView);
|
|
5953
|
+
const diffs = validDiffs(resultView) ?? validDiffs(callView);
|
|
5954
|
+
const web = validWebCard(resultView);
|
|
5955
|
+
const args = parseArguments(argsRaw);
|
|
5956
|
+
const code = variant === "code" && args !== null ? stringValue(args["code"]) : void 0;
|
|
5957
|
+
const body = genericBody(variant, argsRaw);
|
|
5958
|
+
const summary = terminal?.description ?? stringValue(record(resultView)?.["title"]) ?? summaryFromArguments(name, variant, argsRaw, callId, cwd);
|
|
5959
|
+
const failureLine = visualState === "error" && output !== void 0 ? firstLine(output) : null;
|
|
5960
|
+
const summaryText = failureLine ?? summary;
|
|
5961
|
+
const expandable = terminal !== null || read !== null || search !== null || diffs !== null || web !== null || code !== void 0 || body !== null || output !== void 0;
|
|
5962
|
+
const open = expanded && expandable;
|
|
5963
|
+
const status = toolStatus(visualState);
|
|
5964
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
5965
|
+
className: "dsh-side-chat-tool",
|
|
5966
|
+
"data-call-id": callId,
|
|
5967
|
+
"data-state": visualState,
|
|
5968
|
+
"data-expanded": open || void 0,
|
|
5969
|
+
children: [status !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5970
|
+
className: "dsh-side-chat-tool-visually-hidden",
|
|
5971
|
+
children: status
|
|
5972
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DisclosureRow, {
|
|
5973
|
+
rowClassName: "dsh-side-chat-tool-row",
|
|
5974
|
+
leadingClassName: "dsh-side-chat-tool-leading",
|
|
5975
|
+
titleClassName: "dsh-side-chat-tool-title",
|
|
5976
|
+
chevronClassName: "dsh-side-chat-tool-chevron",
|
|
5977
|
+
icon: leadingFor(visualState, variantIcon(variant)),
|
|
5978
|
+
title: toolTitle(name, variant),
|
|
5979
|
+
open,
|
|
5980
|
+
expandable,
|
|
5981
|
+
expandOnRowClick: true,
|
|
5982
|
+
keepContentWhenOpen: true,
|
|
5983
|
+
onToggle: () => {
|
|
5984
|
+
setExpanded((current) => !current);
|
|
5985
|
+
},
|
|
5986
|
+
collapsedContent: summaryText !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5987
|
+
className: "dsh-side-chat-tool-separator",
|
|
5988
|
+
"aria-hidden": "true"
|
|
5989
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5990
|
+
className: failureLine === null ? "dsh-side-chat-tool-summary" : "dsh-side-chat-tool-summary dsh-side-chat-tool-error-summary",
|
|
5991
|
+
children: summaryText
|
|
5992
|
+
})] }),
|
|
5993
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5994
|
+
className: "dsh-side-chat-tool-body-wrap",
|
|
5995
|
+
children: terminal !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.TerminalBlock, {
|
|
5996
|
+
command: terminal.command,
|
|
5997
|
+
cwd: terminal.cwd,
|
|
5998
|
+
output: terminal.output,
|
|
5999
|
+
exitCode: terminal.exitCode,
|
|
6000
|
+
signal: terminal.signal,
|
|
6001
|
+
running: terminal.running,
|
|
6002
|
+
maxLines: Infinity,
|
|
6003
|
+
className: "dsh-side-chat-tool-terminal"
|
|
6004
|
+
}) : read !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.ReadBlock, {
|
|
6005
|
+
...read,
|
|
6006
|
+
maxLines: 8,
|
|
6007
|
+
className: "dsh-side-chat-tool-read"
|
|
6008
|
+
}) : search !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.SearchBlock, {
|
|
6009
|
+
...search,
|
|
6010
|
+
maxLines: 8,
|
|
6011
|
+
className: "dsh-side-chat-tool-search"
|
|
6012
|
+
}) : diffs !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DiffBlock, {
|
|
6013
|
+
diffs,
|
|
6014
|
+
maxLines: 8,
|
|
6015
|
+
className: "dsh-side-chat-tool-diff"
|
|
6016
|
+
}) : web !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.WebBlock, {
|
|
6017
|
+
...web,
|
|
6018
|
+
className: "dsh-side-chat-tool-web"
|
|
6019
|
+
}) : code !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.CodeBlock, {
|
|
6020
|
+
code,
|
|
6021
|
+
lang: "typescript",
|
|
6022
|
+
copyLabel: "Copy",
|
|
6023
|
+
copiedLabel: "Copied",
|
|
6024
|
+
className: "dsh-side-chat-tool-code"
|
|
6025
|
+
}) : (body !== null || output !== void 0) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6026
|
+
className: "dsh-side-chat-tool-io-card",
|
|
6027
|
+
children: [
|
|
6028
|
+
body !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6029
|
+
className: "dsh-side-chat-tool-io-section",
|
|
6030
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6031
|
+
className: "dsh-side-chat-tool-io-label",
|
|
6032
|
+
children: "IN"
|
|
6033
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6034
|
+
className: "dsh-side-chat-tool-io-text",
|
|
6035
|
+
children: body
|
|
6036
|
+
})]
|
|
6037
|
+
}),
|
|
6038
|
+
body !== null && output !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6039
|
+
className: "dsh-side-chat-tool-io-divider",
|
|
6040
|
+
"aria-hidden": "true"
|
|
6041
|
+
}),
|
|
6042
|
+
output !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6043
|
+
className: "dsh-side-chat-tool-io-section",
|
|
6044
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6045
|
+
className: "dsh-side-chat-tool-io-label",
|
|
6046
|
+
children: "OUT"
|
|
6047
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6048
|
+
className: "dsh-side-chat-tool-io-text",
|
|
6049
|
+
"data-error": visualState === "error" || void 0,
|
|
6050
|
+
children: output
|
|
6051
|
+
})]
|
|
6052
|
+
})
|
|
6053
|
+
]
|
|
6054
|
+
})
|
|
6055
|
+
})
|
|
6056
|
+
})]
|
|
6057
|
+
});
|
|
6058
|
+
}
|
|
6059
|
+
function resultState(node, output) {
|
|
6060
|
+
if (!node.isError) return "success";
|
|
6061
|
+
const identity = `${node.error?.name ?? ""} ${node.error?.code ?? ""} ${output}`;
|
|
6062
|
+
return /\b(?:aborted|cancelled|canceled)\b/iu.test(identity) ? "interrupted" : "error";
|
|
6063
|
+
}
|
|
6064
|
+
function ToolBlockCard({ block, cwd }) {
|
|
6065
|
+
const settled = "kind" in block;
|
|
6066
|
+
const output = settled ? toolOutputText(block.content) : void 0;
|
|
6067
|
+
const state = settled ? resultState(block, output ?? "") : "running";
|
|
6068
|
+
const name = settled ? block.call?.name ?? block.callId : block.name;
|
|
6069
|
+
const argsRaw = settled ? block.call?.argsRaw ?? "{}" : block.argsRaw;
|
|
6070
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6071
|
+
className: "dsh-side-chat-tool-branch",
|
|
6072
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolCard, {
|
|
6073
|
+
callId: block.callId,
|
|
6074
|
+
name,
|
|
6075
|
+
argsRaw,
|
|
6076
|
+
state,
|
|
6077
|
+
output,
|
|
6078
|
+
callView: block.callView,
|
|
6079
|
+
resultView: settled ? block.resultView : null,
|
|
6080
|
+
cwd
|
|
6081
|
+
}), block.subCalls.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
6082
|
+
className: "dsh-side-chat-tool-subcalls",
|
|
6083
|
+
"data-subcalls": true,
|
|
6084
|
+
children: block.subCalls.map((child) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolBlockCard, {
|
|
6085
|
+
block: child,
|
|
6086
|
+
cwd
|
|
6087
|
+
}, child.callId))
|
|
6088
|
+
})]
|
|
6089
|
+
});
|
|
6090
|
+
}
|
|
6091
|
+
function RunningToolCard({ call, cwd }) {
|
|
6092
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolBlockCard, {
|
|
6093
|
+
block: call,
|
|
6094
|
+
cwd
|
|
6095
|
+
});
|
|
6096
|
+
}
|
|
6097
|
+
//#endregion
|
|
5608
6098
|
//#region src/client/rc6/ArchivedConversation.tsx
|
|
5609
6099
|
function stringify(value) {
|
|
5610
6100
|
if (typeof value === "string") return value;
|
|
@@ -5626,7 +6116,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5626
6116
|
function firstSideChatQuestion(text) {
|
|
5627
6117
|
return /<user_question>([\s\S]*?)<\/user_question>/u.exec(text)?.[1]?.trim() ?? text;
|
|
5628
6118
|
}
|
|
5629
|
-
function AssistantBlocks({ blocks, streaming = false }) {
|
|
6119
|
+
function AssistantBlocks({ blocks, streaming = false, projectedToolCallIds, unprojectedToolState = "pending", cwd }) {
|
|
5630
6120
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: blocks.map((block, index) => {
|
|
5631
6121
|
const key = `${block.kind}-${String(index)}`;
|
|
5632
6122
|
if (block.kind === "text") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MarkdownText, {
|
|
@@ -5638,14 +6128,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5638
6128
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: "Reasoning" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { children: block.text })]
|
|
5639
6129
|
}, key);
|
|
5640
6130
|
if (block.kind === "image") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: "[Image attachment]" }, key);
|
|
5641
|
-
if (block.kind === "tool-call")
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
6131
|
+
if (block.kind === "tool-call") {
|
|
6132
|
+
if (projectedToolCallIds.has(block.callId)) return null;
|
|
6133
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolCard, {
|
|
6134
|
+
callId: block.callId,
|
|
6135
|
+
name: block.name,
|
|
6136
|
+
argsRaw: block.argsRaw,
|
|
6137
|
+
state: unprojectedToolState,
|
|
6138
|
+
cwd
|
|
6139
|
+
}, key);
|
|
6140
|
+
}
|
|
5645
6141
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { children: stringify(block.block) }, key);
|
|
5646
6142
|
}) });
|
|
5647
6143
|
}
|
|
5648
|
-
function MessageRow({ node }) {
|
|
6144
|
+
function MessageRow({ node, projectedToolCallIds, cwd }) {
|
|
5649
6145
|
if (node.kind === "user" || node.kind === "steering") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
|
|
5650
6146
|
className: "dsh-side-chat-message",
|
|
5651
6147
|
"data-role": "user",
|
|
@@ -5665,7 +6161,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5665
6161
|
className: "dsh-side-chat-message-role",
|
|
5666
6162
|
children: "Assistant"
|
|
5667
6163
|
}),
|
|
5668
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AssistantBlocks, {
|
|
6164
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AssistantBlocks, {
|
|
6165
|
+
blocks: node.blocks,
|
|
6166
|
+
projectedToolCallIds,
|
|
6167
|
+
unprojectedToolState: node.interrupted === true ? "interrupted" : "pending",
|
|
6168
|
+
cwd
|
|
6169
|
+
}),
|
|
5669
6170
|
node.interrupted === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5670
6171
|
className: "dsh-side-chat-message-note",
|
|
5671
6172
|
children: "Stopped"
|
|
@@ -5676,14 +6177,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5676
6177
|
className: "dsh-side-chat-message dsh-side-chat-context-message",
|
|
5677
6178
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("summary", { children: ["Context · ", node.provenance.label ?? node.provenance.role] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { children: contentText(node.content) })]
|
|
5678
6179
|
});
|
|
5679
|
-
if (node.kind === "tool-result") return /* @__PURE__ */ (0, react_jsx_runtime.
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("summary", { children: [
|
|
5683
|
-
node.isError ? "Tool failed" : "Tool result",
|
|
5684
|
-
" · ",
|
|
5685
|
-
node.call?.name ?? node.callId
|
|
5686
|
-
] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", { children: contentText(node.content) })]
|
|
6180
|
+
if (node.kind === "tool-result") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolBlockCard, {
|
|
6181
|
+
block: node,
|
|
6182
|
+
cwd
|
|
5687
6183
|
});
|
|
5688
6184
|
if (node.kind === "turn-error") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5689
6185
|
className: "dsh-side-chat-turn-notice",
|
|
@@ -5854,13 +6350,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5854
6350
|
});
|
|
5855
6351
|
}
|
|
5856
6352
|
/** Functional rc.6 conversation surface bound to a non-current child Session. */
|
|
5857
|
-
function ArchivedConversation({ face, inheritedThroughSeq, controller, selection, locale = "en" }) {
|
|
6353
|
+
function ArchivedConversation({ face, inheritedThroughSeq, controller, selection, locale = "en", cwd }) {
|
|
5858
6354
|
const snapshot = (0, react.useSyncExternalStore)((listener) => face.subscribe(listener), () => face.getSnapshot(), () => face.getSnapshot());
|
|
5859
6355
|
const [draft, setDraft] = (0, react.useState)("");
|
|
5860
6356
|
const [sending, setSending] = (0, react.useState)(false);
|
|
5861
6357
|
const draftRef = useAutoGrowingTextarea(draft);
|
|
5862
6358
|
const scrollRef = (0, react.useRef)(null);
|
|
5863
6359
|
const nodes = (0, react.useMemo)(() => snapshot.nodes.filter((node) => node.seq > inheritedThroughSeq), [snapshot.nodes, inheritedThroughSeq]);
|
|
6360
|
+
const runningCalls = snapshot.runningCalls ?? [];
|
|
6361
|
+
const projectedToolCallIds = (0, react.useMemo)(() => /* @__PURE__ */ new Set([...nodes.filter((node) => node.kind === "tool-result").map((node) => node.callId), ...runningCalls.map((call) => call.callId)]), [nodes, runningCalls]);
|
|
5864
6362
|
const annotatedUserNode = selection === void 0 ? void 0 : nodes.find((node) => node.kind === "user" || node.kind === "steering");
|
|
5865
6363
|
(0, react.useEffect)(() => {
|
|
5866
6364
|
const element = scrollRef.current;
|
|
@@ -5903,8 +6401,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5903
6401
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectionQuote, {
|
|
5904
6402
|
selections: [selection],
|
|
5905
6403
|
messages: SIDE_CHAT_MESSAGES[locale]
|
|
5906
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageRow, {
|
|
5907
|
-
|
|
6404
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageRow, {
|
|
6405
|
+
node,
|
|
6406
|
+
projectedToolCallIds,
|
|
6407
|
+
cwd
|
|
6408
|
+
})]
|
|
6409
|
+
}, `${node.kind}-${String(node.seq)}`) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageRow, {
|
|
6410
|
+
node,
|
|
6411
|
+
projectedToolCallIds,
|
|
6412
|
+
cwd
|
|
6413
|
+
}, `${node.kind}-${String(node.seq)}`)),
|
|
5908
6414
|
snapshot.partial !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
|
|
5909
6415
|
className: "dsh-side-chat-message",
|
|
5910
6416
|
"data-role": "assistant",
|
|
@@ -5913,12 +6419,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5913
6419
|
children: "Assistant"
|
|
5914
6420
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AssistantBlocks, {
|
|
5915
6421
|
blocks: snapshot.partial.blocks,
|
|
5916
|
-
streaming: true
|
|
6422
|
+
streaming: true,
|
|
6423
|
+
projectedToolCallIds,
|
|
6424
|
+
unprojectedToolState: "running",
|
|
6425
|
+
cwd
|
|
5917
6426
|
})]
|
|
5918
6427
|
}),
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
6428
|
+
runningCalls.map((call) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RunningToolCard, {
|
|
6429
|
+
call,
|
|
6430
|
+
cwd
|
|
5922
6431
|
}, call.callId)),
|
|
5923
6432
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PendingCards, {
|
|
5924
6433
|
pending: snapshot.pending,
|
|
@@ -6192,6 +6701,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6192
6701
|
title(sessionId) {
|
|
6193
6702
|
return this.ctx.sessions.list.getSnapshot().byId[dshSessionId(sessionId)]?.displayTitle;
|
|
6194
6703
|
}
|
|
6704
|
+
cwd(sessionId) {
|
|
6705
|
+
return this.ctx.sessions.list.getSnapshot().byId[dshSessionId(sessionId)]?.cwd;
|
|
6706
|
+
}
|
|
6195
6707
|
waitForBinding(sessionId) {
|
|
6196
6708
|
const immediate = this.ctx.sessions.binding(sessionId);
|
|
6197
6709
|
if (immediate !== void 0) return Promise.resolve(immediate);
|
|
@@ -6352,6 +6864,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6352
6864
|
}, [currentSessionId]);
|
|
6353
6865
|
const askDisabledReason = state.phase === "closed" ? void 0 : "Close the current Side Chat before starting another one.";
|
|
6354
6866
|
const childFace = state.childSessionId === void 0 ? void 0 : sessions.face(state.childSessionId);
|
|
6867
|
+
const childCwd = state.childSessionId === void 0 ? void 0 : sessions.cwd(state.childSessionId);
|
|
6355
6868
|
const inheritedThroughSeq = state.inheritedThroughSeq;
|
|
6356
6869
|
const locale = navigator.language.toLowerCase().startsWith("zh") ? "zh-CN" : "en";
|
|
6357
6870
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -6406,6 +6919,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6406
6919
|
face: childFace,
|
|
6407
6920
|
inheritedThroughSeq,
|
|
6408
6921
|
controller,
|
|
6922
|
+
cwd: childCwd,
|
|
6409
6923
|
...state.selection === void 0 ? {} : { selection: state.selection },
|
|
6410
6924
|
locale
|
|
6411
6925
|
}) },
|