@ahggg/dsh-side-chat 0.7.1 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/README.md +3 -3
  2. package/README.zh-CN.md +3 -3
  3. package/lib/client/apply.d.ts +0 -1
  4. package/lib/client/apply.js +0 -1
  5. package/lib/client/contracts.d.ts +0 -1
  6. package/lib/client/contracts.js +0 -1
  7. package/lib/client/index.d.ts +0 -1
  8. package/lib/client/index.js +0 -1
  9. package/lib/client/model-preference.d.ts +0 -1
  10. package/lib/client/model-preference.js +0 -1
  11. package/lib/client/panel/SelectionQuote.d.ts +0 -1
  12. package/lib/client/panel/SelectionQuote.js +0 -1
  13. package/lib/client/panel/SendIcon.d.ts +0 -1
  14. package/lib/client/panel/SendIcon.js +0 -1
  15. package/lib/client/panel/SideChatBody.d.ts +0 -1
  16. package/lib/client/panel/SideChatBody.js +0 -1
  17. package/lib/client/panel/SideChatErrorState.d.ts +0 -1
  18. package/lib/client/panel/SideChatErrorState.js +0 -1
  19. package/lib/client/panel/SideChatHeader.d.ts +0 -1
  20. package/lib/client/panel/SideChatHeader.js +0 -1
  21. package/lib/client/panel/SideChatModelSelect.d.ts +0 -1
  22. package/lib/client/panel/SideChatModelSelect.js +0 -1
  23. package/lib/client/panel/SideChatPanel.d.ts +0 -1
  24. package/lib/client/panel/SideChatPanel.js +0 -1
  25. package/lib/client/panel/StopIcon.d.ts +0 -1
  26. package/lib/client/panel/StopIcon.js +0 -1
  27. package/lib/client/panel/messages.d.ts +0 -1
  28. package/lib/client/panel/messages.js +0 -1
  29. package/lib/client/panel/use-auto-growing-textarea.d.ts +0 -1
  30. package/lib/client/panel/use-auto-growing-textarea.js +0 -1
  31. package/lib/client/parent-composer/ParentConversationAnnotations.d.ts +0 -1
  32. package/lib/client/parent-composer/ParentConversationAnnotations.js +26 -3
  33. package/lib/client/parent-composer/add-to-conversation.d.ts +15 -54
  34. package/lib/client/parent-composer/add-to-conversation.js +308 -63
  35. package/lib/client/parent-composer/annotation-persistence.d.ts +1 -2
  36. package/lib/client/parent-composer/annotation-persistence.js +43 -41
  37. package/lib/client/parent-composer/composer-reference.d.ts +81 -0
  38. package/lib/client/parent-composer/composer-reference.js +89 -0
  39. package/lib/client/parent-composer/referenced-conversation.d.ts +2 -3
  40. package/lib/client/parent-composer/referenced-conversation.js +36 -25
  41. package/lib/client/rc6/ArchivedConversation.d.ts +2 -3
  42. package/lib/client/rc6/ArchivedConversation.js +6 -5
  43. package/lib/client/rc6/Rc6SideChatOverlay.d.ts +0 -1
  44. package/lib/client/rc6/Rc6SideChatOverlay.js +12 -2
  45. package/lib/client/rc6/SideChatTool.d.ts +1 -2
  46. package/lib/client/rc6/SideChatTool.js +18 -9
  47. package/lib/client/rc6/context.d.ts +9 -3
  48. package/lib/client/rc6/context.js +0 -1
  49. package/lib/client/rc6/primitive-labels.d.ts +7 -0
  50. package/lib/client/rc6/primitive-labels.js +60 -0
  51. package/lib/client/rc6/remote-adapter.d.ts +0 -1
  52. package/lib/client/rc6/remote-adapter.js +4 -3
  53. package/lib/client/rc6/runtime-compat.d.ts +120 -0
  54. package/lib/client/rc6/runtime-compat.js +187 -0
  55. package/lib/client/rc6/sessions-adapter.d.ts +9 -4
  56. package/lib/client/rc6/sessions-adapter.js +74 -46
  57. package/lib/client/selection/ConversationAnnotationMarkers.d.ts +0 -1
  58. package/lib/client/selection/ConversationAnnotationMarkers.js +0 -1
  59. package/lib/client/selection/SelectionActions.d.ts +5 -2
  60. package/lib/client/selection/SelectionActions.js +66 -50
  61. package/lib/client/selection/selection-controller.d.ts +0 -1
  62. package/lib/client/selection/selection-controller.js +0 -1
  63. package/lib/client/selection/selection-limits.d.ts +0 -1
  64. package/lib/client/selection/selection-limits.js +0 -1
  65. package/lib/client/selection/selection-normalizer.d.ts +0 -1
  66. package/lib/client/selection/selection-normalizer.js +0 -1
  67. package/lib/client/side-chat-controller.d.ts +0 -1
  68. package/lib/client/side-chat-controller.js +0 -1
  69. package/lib/client.js +1173 -8744
  70. package/lib/host/archived-fork-service.d.ts +0 -1
  71. package/lib/host/archived-fork-service.js +71 -26
  72. package/lib/host/index.d.ts +0 -1
  73. package/lib/host/index.js +0 -1
  74. package/lib/index.d.ts +0 -1
  75. package/lib/index.js +0 -1
  76. package/lib/remote.d.ts +0 -1
  77. package/lib/remote.js +0 -1
  78. package/lib/shared/archived-wire.d.ts +0 -1
  79. package/lib/shared/archived-wire.js +0 -1
  80. package/lib/shared/constants.d.ts +0 -1
  81. package/lib/shared/constants.js +0 -1
  82. package/lib/shared/contracts.d.ts +0 -1
  83. package/lib/shared/contracts.js +0 -1
  84. package/lib/shared/error-codes.d.ts +0 -1
  85. package/lib/shared/error-codes.js +0 -1
  86. package/lib/shared/observable.d.ts +0 -1
  87. package/lib/shared/observable.js +0 -1
  88. package/lib/typert.d.ts +0 -1
  89. package/lib/typert.js +64 -51
  90. package/package.json +60 -38
  91. package/lib/client/apply.d.ts.map +0 -1
  92. package/lib/client/apply.js.map +0 -1
  93. package/lib/client/contracts.d.ts.map +0 -1
  94. package/lib/client/contracts.js.map +0 -1
  95. package/lib/client/index.d.ts.map +0 -1
  96. package/lib/client/index.js.map +0 -1
  97. package/lib/client/model-preference.d.ts.map +0 -1
  98. package/lib/client/model-preference.js.map +0 -1
  99. package/lib/client/panel/SelectionQuote.d.ts.map +0 -1
  100. package/lib/client/panel/SelectionQuote.js.map +0 -1
  101. package/lib/client/panel/SendIcon.d.ts.map +0 -1
  102. package/lib/client/panel/SendIcon.js.map +0 -1
  103. package/lib/client/panel/SideChatBody.d.ts.map +0 -1
  104. package/lib/client/panel/SideChatBody.js.map +0 -1
  105. package/lib/client/panel/SideChatErrorState.d.ts.map +0 -1
  106. package/lib/client/panel/SideChatErrorState.js.map +0 -1
  107. package/lib/client/panel/SideChatHeader.d.ts.map +0 -1
  108. package/lib/client/panel/SideChatHeader.js.map +0 -1
  109. package/lib/client/panel/SideChatModelSelect.d.ts.map +0 -1
  110. package/lib/client/panel/SideChatModelSelect.js.map +0 -1
  111. package/lib/client/panel/SideChatPanel.d.ts.map +0 -1
  112. package/lib/client/panel/SideChatPanel.js.map +0 -1
  113. package/lib/client/panel/StopIcon.d.ts.map +0 -1
  114. package/lib/client/panel/StopIcon.js.map +0 -1
  115. package/lib/client/panel/messages.d.ts.map +0 -1
  116. package/lib/client/panel/messages.js.map +0 -1
  117. package/lib/client/panel/use-auto-growing-textarea.d.ts.map +0 -1
  118. package/lib/client/panel/use-auto-growing-textarea.js.map +0 -1
  119. package/lib/client/parent-composer/ParentConversationAnnotations.d.ts.map +0 -1
  120. package/lib/client/parent-composer/ParentConversationAnnotations.js.map +0 -1
  121. package/lib/client/parent-composer/add-to-conversation.d.ts.map +0 -1
  122. package/lib/client/parent-composer/add-to-conversation.js.map +0 -1
  123. package/lib/client/parent-composer/annotation-persistence.d.ts.map +0 -1
  124. package/lib/client/parent-composer/annotation-persistence.js.map +0 -1
  125. package/lib/client/parent-composer/referenced-conversation.d.ts.map +0 -1
  126. package/lib/client/parent-composer/referenced-conversation.js.map +0 -1
  127. package/lib/client/rc6/ArchivedConversation.d.ts.map +0 -1
  128. package/lib/client/rc6/ArchivedConversation.js.map +0 -1
  129. package/lib/client/rc6/Rc6SideChatOverlay.d.ts.map +0 -1
  130. package/lib/client/rc6/Rc6SideChatOverlay.js.map +0 -1
  131. package/lib/client/rc6/SideChatTool.d.ts.map +0 -1
  132. package/lib/client/rc6/SideChatTool.js.map +0 -1
  133. package/lib/client/rc6/context.d.ts.map +0 -1
  134. package/lib/client/rc6/context.js.map +0 -1
  135. package/lib/client/rc6/remote-adapter.d.ts.map +0 -1
  136. package/lib/client/rc6/remote-adapter.js.map +0 -1
  137. package/lib/client/rc6/sessions-adapter.d.ts.map +0 -1
  138. package/lib/client/rc6/sessions-adapter.js.map +0 -1
  139. package/lib/client/selection/ConversationAnnotationMarkers.d.ts.map +0 -1
  140. package/lib/client/selection/ConversationAnnotationMarkers.js.map +0 -1
  141. package/lib/client/selection/SelectionActions.d.ts.map +0 -1
  142. package/lib/client/selection/SelectionActions.js.map +0 -1
  143. package/lib/client/selection/selection-controller.d.ts.map +0 -1
  144. package/lib/client/selection/selection-controller.js.map +0 -1
  145. package/lib/client/selection/selection-limits.d.ts.map +0 -1
  146. package/lib/client/selection/selection-limits.js.map +0 -1
  147. package/lib/client/selection/selection-normalizer.d.ts.map +0 -1
  148. package/lib/client/selection/selection-normalizer.js.map +0 -1
  149. package/lib/client/side-chat-controller.d.ts.map +0 -1
  150. package/lib/client/side-chat-controller.js.map +0 -1
  151. package/lib/client.js.map +0 -1
  152. package/lib/host/archived-fork-service.d.ts.map +0 -1
  153. package/lib/host/archived-fork-service.js.map +0 -1
  154. package/lib/host/index.d.ts.map +0 -1
  155. package/lib/host/index.js.map +0 -1
  156. package/lib/index.d.ts.map +0 -1
  157. package/lib/index.js.map +0 -1
  158. package/lib/remote.d.ts.map +0 -1
  159. package/lib/remote.js.map +0 -1
  160. package/lib/shared/archived-wire.d.ts.map +0 -1
  161. package/lib/shared/archived-wire.js.map +0 -1
  162. package/lib/shared/constants.d.ts.map +0 -1
  163. package/lib/shared/constants.js.map +0 -1
  164. package/lib/shared/contracts.d.ts.map +0 -1
  165. package/lib/shared/contracts.js.map +0 -1
  166. package/lib/shared/error-codes.d.ts.map +0 -1
  167. package/lib/shared/error-codes.js.map +0 -1
  168. package/lib/shared/observable.d.ts.map +0 -1
  169. package/lib/shared/observable.js.map +0 -1
  170. package/lib/typert.d.ts.map +0 -1
  171. package/lib/typert.js.map +0 -1
package/README.md CHANGED
@@ -8,10 +8,10 @@ Ask a focused follow-up about selected text without leaving your current DeepSee
8
8
 
9
9
  ## Install
10
10
 
11
- Install DSH rc.7 if it is not already available. Refresh only this package's registry metadata before adding it, so pnpm cannot reuse an older `latest` value immediately after a release:
11
+ Install DSH 0.1.2-rc.1 if it is not already available. Refresh only this package's registry metadata before adding it, so pnpm cannot reuse an older `latest` value immediately after a release:
12
12
 
13
13
  ```powershell
14
- npm install --global @deepseek-ai/dsh@0.1.0-rc.7
14
+ npm install --global @deepseek-ai/dsh@0.1.2-rc.1
15
15
  pnpm cache delete "@ahggg/dsh-side-chat"
16
16
  dsh plugin --profile web add @ahggg/dsh-side-chat@latest
17
17
  ```
@@ -27,7 +27,7 @@ Open the URL printed by DSH. The plugin loads automatically in the Web client.
27
27
 
28
28
  ### Local linked development
29
29
 
30
- When `dsh plugin --profile web list` shows the plugin coming from a `link:` workspace, DSH loads the Git-ignored `lib/client.js`, not `src/`. Rebuild after switching branches or changing client source, then restart the `dsh web` process:
30
+ When `dsh plugin --profile web list` shows the plugin coming from a `link:` workspace, DSH loads the committed `lib/client.js`, not `src/`. Rebuild after switching branches or changing client source, then restart the `dsh web` process:
31
31
 
32
32
  ```powershell
33
33
  pnpm install --frozen-lockfile
package/README.zh-CN.md CHANGED
@@ -8,10 +8,10 @@
8
8
 
9
9
  ## 安装
10
10
 
11
- 如果尚未安装 DSH rc.7,先安装它。添加插件前只刷新这个包的 registry metadata,避免刚发布新版本时 pnpm 仍复用旧的 `latest`:
11
+ 如果尚未安装 DSH 0.1.2-rc.1,先安装它。添加插件前只刷新这个包的 registry metadata,避免刚发布新版本时 pnpm 仍复用旧的 `latest`:
12
12
 
13
13
  ```powershell
14
- npm install --global @deepseek-ai/dsh@0.1.0-rc.7
14
+ npm install --global @deepseek-ai/dsh@0.1.2-rc.1
15
15
  pnpm cache delete "@ahggg/dsh-side-chat"
16
16
  dsh plugin --profile web add @ahggg/dsh-side-chat@latest
17
17
  ```
@@ -27,7 +27,7 @@ dsh web --port 3080
27
27
 
28
28
  ### 本地链接调试
29
29
 
30
- 当 `dsh plugin --profile web list` 显示插件来自 `link:` 工作区时,DSH 加载的是被 Git 忽略的 `lib/client.js`,而不是 `src/`。切换分支或修改客户端源码后,需要重新构建并重启 `dsh web` 进程:
30
+ 当 `dsh plugin --profile web list` 显示插件来自 `link:` 工作区时,DSH 加载的是已提交的 `lib/client.js`,而不是 `src/`。切换分支或修改客户端源码后,需要重新构建并重启 `dsh web` 进程:
31
31
 
32
32
  ```powershell
33
33
  pnpm install --frozen-lockfile
@@ -2,4 +2,3 @@ import type { Context } from '@deepseek-ai/cordis';
2
2
  export declare const name = "side-chat-client";
3
3
  export declare const inject: string[];
4
4
  export declare function apply(ctx: Context): Promise<void>;
5
- //# sourceMappingURL=apply.d.ts.map
@@ -41,4 +41,3 @@ export async function apply(ctx) {
41
41
  }
42
42
  }, 'dsh-side-chat.clientLifecycle');
43
43
  }
44
- //# sourceMappingURL=apply.js.map
@@ -75,4 +75,3 @@ export type SideChatActionResult<T = void> = {
75
75
  readonly ok: false;
76
76
  readonly error: SideChatWireError;
77
77
  };
78
- //# sourceMappingURL=contracts.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=contracts.js.map
@@ -8,4 +8,3 @@ export { captureDomConversationSelection, restoreDomConversationSelection, type
8
8
  export { selectionFitsLimit, summarizeSelection, utf8ByteLength } from './selection/selection-limits.js';
9
9
  export { assertSelectionCurrent, finalizeConversationSelection, normalizeSelectedText, SelectionValidationError, type ConversationSelectionInput, } from './selection/selection-normalizer.js';
10
10
  export type { ConversationSelection, SelectionFragment, SelectionRect, SideChatModelSelection, SideChatState, } from '../shared/contracts.js';
11
- //# sourceMappingURL=index.d.ts.map
@@ -6,4 +6,3 @@ export { SelectionActions } from './selection/SelectionActions.js';
6
6
  export { captureDomConversationSelection, restoreDomConversationSelection, } from './selection/selection-controller.js';
7
7
  export { selectionFitsLimit, summarizeSelection, utf8ByteLength } from './selection/selection-limits.js';
8
8
  export { assertSelectionCurrent, finalizeConversationSelection, normalizeSelectedText, SelectionValidationError, } from './selection/selection-normalizer.js';
9
- //# sourceMappingURL=index.js.map
@@ -11,4 +11,3 @@ export declare class SideChatModelPreferences {
11
11
  set(selection: SideChatModelSelection): void;
12
12
  }
13
13
  export {};
14
- //# sourceMappingURL=model-preference.d.ts.map
@@ -57,4 +57,3 @@ export class SideChatModelPreferences {
57
57
  }
58
58
  }
59
59
  }
60
- //# sourceMappingURL=model-preference.js.map
@@ -9,4 +9,3 @@ export declare function SelectionQuote({ selections, messages, onRemove, }: {
9
9
  readonly messages: SideChatMessages;
10
10
  readonly onRemove?: () => void;
11
11
  }): import("react/jsx-runtime").JSX.Element;
12
- //# sourceMappingURL=SelectionQuote.d.ts.map
@@ -70,4 +70,3 @@ export function SelectionQuote({ selections, messages, onRemove, }) {
70
70
  setExpanded(value => !value);
71
71
  }, children: [_jsxs("svg", { className: "dsh-side-chat-quote-icon", viewBox: "0 0 24 24", "aria-hidden": "true", children: [_jsx("path", { d: "M21 15a4 4 0 0 1-4 4H7l-4 4V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4Z" }), _jsx("path", { d: "M8 8h8M8 12h5" })] }), _jsx("strong", { children: messages.selectionAttachments(selections.length) })] }), onRemove !== undefined && (_jsx("button", { type: "button", className: "dsh-side-chat-quote-remove", "aria-label": messages.removeSelection, onClick: onRemove, children: "\u00D7" }))] }), _jsx("div", { ref: detailsRef, className: "dsh-side-chat-quote-details", role: "tooltip", children: selections.map((selection, index) => (_jsxs("div", { className: "dsh-side-chat-quote-detail", children: [_jsx("div", { className: "dsh-side-chat-quote-details-header", children: _jsxs("strong", { children: [String(index + 1), ". ", messages.selectionPreviewLabel, ":"] }) }), _jsx("pre", { children: selection.text }), selection.comment !== undefined && (_jsxs("div", { className: "dsh-side-chat-quote-comment", children: [_jsxs("strong", { children: [messages.selectionCommentLabel, ":"] }), _jsx("pre", { children: selection.comment })] }))] }, `${String(index)}-${selection.text}`))) })] }));
72
72
  }
73
- //# sourceMappingURL=SelectionQuote.js.map
@@ -1,3 +1,2 @@
1
1
  /** Arrow used by DSH's native 34px primary send button. */
2
2
  export declare function SendIcon(): import("react/jsx-runtime").JSX.Element;
3
- //# sourceMappingURL=SendIcon.d.ts.map
@@ -3,4 +3,3 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  export function SendIcon() {
4
4
  return (_jsx("svg", { viewBox: "0 0 16 16", width: "16", height: "16", "aria-hidden": "true", children: _jsx("path", { d: "M8.3125 0.980183C8.66767 1.0531 8.97902 1.20418 9.2627 1.43233C9.48724 1.61297 9.73029 1.85793 9.97949 2.10714L14.707 6.83468L13.293 8.24874L9 3.95577V15.0417H7V3.95577L2.70703 8.24874L1.29297 6.83468L6.02051 2.10714C6.26971 1.85793 6.51277 1.61297 6.7373 1.43233C6.97662 1.23986 7.28445 1.04402 7.6875 0.980183C7.8973 0.947006 8.1031 0.95516 8.3125 0.980183Z", fill: "currentColor" }) }));
5
5
  }
6
- //# sourceMappingURL=SendIcon.js.map
@@ -3,4 +3,3 @@ import type { ReactNode } from 'react';
3
3
  export declare function SideChatBody({ children }: {
4
4
  readonly children: ReactNode;
5
5
  }): import("react/jsx-runtime").JSX.Element;
6
- //# sourceMappingURL=SideChatBody.d.ts.map
@@ -3,4 +3,3 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  export function SideChatBody({ children }) {
4
4
  return _jsx("div", { className: "dsh-side-chat-body", children: children });
5
5
  }
6
- //# sourceMappingURL=SideChatBody.js.map
@@ -6,4 +6,3 @@ export declare function SideChatErrorState({ error, messages, onRetry, }: {
6
6
  readonly messages: SideChatMessages;
7
7
  readonly onRetry: () => void;
8
8
  }): import("react/jsx-runtime").JSX.Element;
9
- //# sourceMappingURL=SideChatErrorState.d.ts.map
@@ -3,4 +3,3 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  export function SideChatErrorState({ error, messages, onRetry, }) {
4
4
  return (_jsxs("section", { className: "dsh-side-chat-error", role: "alert", children: [_jsx("strong", { children: error.code === 'side_chat_destroy_failed' ? messages.closeError : messages.genericError }), _jsx("p", { children: error.message }), error.recoverable && _jsx("button", { type: "button", onClick: onRetry, children: messages.retry })] }));
5
5
  }
6
- //# sourceMappingURL=SideChatErrorState.js.map
@@ -8,4 +8,3 @@ export declare function SideChatHeader({ phase, messages, addToConversationDisab
8
8
  readonly onFocusParent: () => void;
9
9
  readonly onClose: () => void;
10
10
  }): import("react/jsx-runtime").JSX.Element;
11
- //# sourceMappingURL=SideChatHeader.d.ts.map
@@ -5,4 +5,3 @@ function AddToConversationIcon() {
5
5
  export function SideChatHeader({ phase, messages, addToConversationDisabled = false, onAddToConversation, onFocusParent, onClose, }) {
6
6
  return (_jsxs("header", { className: "dsh-side-chat-header", children: [_jsx("button", { type: "button", className: "dsh-side-chat-heading", onClick: onFocusParent, children: _jsx("strong", { children: messages.title }) }), _jsxs("div", { className: "dsh-side-chat-header-actions", children: [onAddToConversation !== undefined && (_jsxs("button", { type: "button", className: "dsh-side-chat-add-to-conversation", disabled: addToConversationDisabled, onClick: onAddToConversation, children: [_jsx(AddToConversationIcon, {}), _jsx("span", { children: messages.addToConversation })] })), _jsx("button", { type: "button", className: "dsh-side-chat-close", "aria-label": messages.close, disabled: phase === 'closing', onClick: onClose, children: "\u00D7" })] })] }));
7
7
  }
8
- //# sourceMappingURL=SideChatHeader.js.map
@@ -14,4 +14,3 @@ export interface SideChatModelSelectProps {
14
14
  }
15
15
  /** Side Chat projection of DSH Web's native composer model selector. */
16
16
  export declare function SideChatModelSelect({ directory, selection, locked, validateInitialSelection, locale, onInitialize, onSelect, }: SideChatModelSelectProps): import("react/jsx-runtime").JSX.Element;
17
- //# sourceMappingURL=SideChatModelSelect.d.ts.map
@@ -244,4 +244,3 @@ export function SideChatModelSelect({ directory, selection, locked, validateInit
244
244
  return (_jsxs("button", { ref: itemRef(), type: "button", role: "menuitemradio", "aria-checked": selected, className: `dsh-side-chat-model-option${selected ? ' dsh-side-chat-model-selected' : ''}`, disabled: selecting, onClick: () => { chooseEffort(level.effort); }, children: [_jsxs("span", { className: "dsh-side-chat-model-option-copy", children: [_jsx("span", { className: "dsh-side-chat-model-name", children: level.label }), level.description !== undefined && (_jsx("span", { className: "dsh-side-chat-model-description", children: level.description }))] }), _jsx("span", { className: "dsh-side-chat-model-check", children: selected ? _jsx(IconCheckOutline16, {}) : null })] }, level.key));
245
245
  }))] })), toast !== null && (_jsx(Toast, { text: toast.text, icon: _jsx(IconWarningOutline16, {}), anchor: rootRef.current?.closest('[data-composer-card]') ?? null, onDone: () => { setToast(null); } }, toast.seq))] }));
246
246
  }
247
- //# sourceMappingURL=SideChatModelSelect.js.map
@@ -16,4 +16,3 @@ export interface SideChatPanelProps {
16
16
  readonly onRemoveSelection?: () => void;
17
17
  }
18
18
  export declare function SideChatPanel({ state, locale, embeddedConversation, modelControl, onDraftChange, onFirstSend, onClose, onRetry, onFocusParent, onAddToConversation, addToConversationDisabled, onRemoveSelection, }: SideChatPanelProps): import("react/jsx-runtime").JSX.Element;
19
- //# sourceMappingURL=SideChatPanel.d.ts.map
@@ -32,4 +32,3 @@ export function SideChatPanel({ state, locale = 'en', embeddedConversation, mode
32
32
  }
33
33
  } }), _jsxs("div", { className: "dsh-side-chat-draft-actions", children: [modelControl, _jsx("button", { type: "submit", className: "dsh-side-chat-send-button", "aria-label": messages.send, disabled: submitting || state.draft.trim().length === 0, children: _jsx(SendIcon, {}) })] })] })), _jsxs("footer", { className: "dsh-side-chat-footer", children: [_jsx("span", { children: messages.temporary }), _jsx("span", { children: messages.referenceOnly }), _jsx("span", { children: messages.cannotReopen }), _jsx("span", { children: messages.sharedWorkspace })] }), _jsx("div", { className: "dsh-side-chat-announcer", "aria-live": "polite", children: state.phase === 'running' ? 'Side Chat running' : `Side Chat ${state.phase}` })] }));
34
34
  }
35
- //# sourceMappingURL=SideChatPanel.js.map
@@ -1,3 +1,2 @@
1
1
  /** Rounded-square stop glyph used by DSH's native primary action button. */
2
2
  export declare function StopIcon(): import("react/jsx-runtime").JSX.Element;
3
- //# sourceMappingURL=StopIcon.d.ts.map
@@ -3,4 +3,3 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  export function StopIcon() {
4
4
  return (_jsx("svg", { viewBox: "0 0 16 16", width: "16", height: "16", "aria-hidden": "true", children: _jsx("rect", { x: "3", y: "3", width: "10", height: "10", rx: "3", fill: "currentColor" }) }));
5
5
  }
6
- //# sourceMappingURL=StopIcon.js.map
@@ -20,4 +20,3 @@ export interface SideChatMessages {
20
20
  readonly closeError: string;
21
21
  }
22
22
  export declare const SIDE_CHAT_MESSAGES: Readonly<Record<'en' | 'zh-CN', SideChatMessages>>;
23
- //# sourceMappingURL=messages.d.ts.map
@@ -42,4 +42,3 @@ export const SIDE_CHAT_MESSAGES = Object.freeze({
42
42
  closeError: '无法关闭侧边对话',
43
43
  }),
44
44
  });
45
- //# sourceMappingURL=messages.js.map
@@ -1,3 +1,2 @@
1
1
  /** Keep a textarea one line tall until its content reaches the CSS max-height. */
2
2
  export declare function useAutoGrowingTextarea(value: string): import("react").RefObject<HTMLTextAreaElement>;
3
- //# sourceMappingURL=use-auto-growing-textarea.d.ts.map
@@ -18,4 +18,3 @@ export function useAutoGrowingTextarea(value) {
18
18
  }, [value]);
19
19
  return ref;
20
20
  }
21
- //# sourceMappingURL=use-auto-growing-textarea.js.map
@@ -26,4 +26,3 @@ export declare function annotatedUserMessageRenderer(Original: UserNodeRenderer)
26
26
  /** Mount the composer capsule and a thin wrapper around DSH's user renderers. */
27
27
  export declare function mountParentConversationAnnotations(ctx: Rc6ClientContext, removeAnnotations: () => void): () => void;
28
28
  export {};
29
- //# sourceMappingURL=ParentConversationAnnotations.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { createElement } from 'react';
2
+ import { createElement, useLayoutEffect, useRef } from 'react';
3
3
  import { SIDE_CHAT_MESSAGES } from '../panel/messages.js';
4
4
  import { SelectionQuote } from '../panel/SelectionQuote.js';
5
5
  import { conversationAnnotations, parseAnnotatedConversationPrompt, } from './add-to-conversation.js';
@@ -7,12 +7,36 @@ import { parseReferencedConversationPrompt, } from './referenced-conversation.js
7
7
  function currentLocale() {
8
8
  return navigator.language.toLowerCase().startsWith('zh') ? 'zh-CN' : 'en';
9
9
  }
10
+ const ANNOTATION_CHIP_WIDTH_PROPERTY = '--dsh-side-chat-parent-annotation-width';
10
11
  /** The interactive annotation capsule occupying the reserved first composer row. */
11
12
  export function ParentComposerAnnotations({ input, onRemove, locale = currentLocale(), }) {
12
13
  const annotations = conversationAnnotations(input);
14
+ const dockRef = useRef(null);
15
+ useLayoutEffect(() => {
16
+ const dock = dockRef.current;
17
+ const seat = dock?.closest('[data-composer-seat]');
18
+ const chip = dock?.querySelector('.dsh-side-chat-quote-chip');
19
+ if (seat === undefined || chip === undefined || seat === null || chip === null)
20
+ return;
21
+ // The durable host reference stays in Lexical's document flow. Match its
22
+ // occupied width to this visible overlay so the caret starts at the edge
23
+ // users see instead of after the longer internal serialization label.
24
+ const syncWidth = () => {
25
+ const width = chip.getBoundingClientRect().width;
26
+ if (width > 0)
27
+ seat.style.setProperty(ANNOTATION_CHIP_WIDTH_PROPERTY, `${String(width)}px`);
28
+ };
29
+ syncWidth();
30
+ const observer = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(syncWidth);
31
+ observer?.observe(chip);
32
+ return () => {
33
+ observer?.disconnect();
34
+ seat.style.removeProperty(ANNOTATION_CHIP_WIDTH_PROPERTY);
35
+ };
36
+ }, [annotations.length, locale]);
13
37
  if (annotations.length === 0)
14
38
  return null;
15
- return (_jsx("div", { className: "dsh-side-chat-parent-annotation-dock", children: _jsx(SelectionQuote, { selections: annotations, messages: SIDE_CHAT_MESSAGES[locale], onRemove: onRemove }) }));
39
+ return (_jsx("div", { ref: dockRef, className: "dsh-side-chat-parent-annotation-dock", children: _jsx(SelectionQuote, { selections: annotations, messages: SIDE_CHAT_MESSAGES[locale], onRemove: onRemove }) }));
16
40
  }
17
41
  function contentText(content) {
18
42
  return content.map((block) => {
@@ -135,4 +159,3 @@ export function mountParentConversationAnnotations(ctx, removeAnnotations) {
135
159
  removeDock();
136
160
  };
137
161
  }
138
- //# sourceMappingURL=ParentConversationAnnotations.js.map
@@ -1,5 +1,6 @@
1
- import type { Context } from '@deepseek-ai/cordis';
2
1
  import type { ConversationSelection, SideChatPromptPart } from '../../shared/contracts.js';
2
+ import type { ParentComposerInput, ParentComposerInputSnapshot, SelectionReferenceSource } from './composer-reference.js';
3
+ export type { ParentComposerInput, ParentComposerInputSnapshot, ParentComposerOccurrence, ParentConversationService, SelectionReferenceSource, } from './composer-reference.js';
3
4
  export declare const SELECTION_REFERENCE_LABEL = "__dsh_side_chat_annotations__";
4
5
  export interface ConversationAnnotation {
5
6
  readonly text: string;
@@ -10,55 +11,6 @@ export interface ConversationSelectionAnnotation extends ConversationAnnotation
10
11
  readonly annotationIndex: number;
11
12
  readonly selection: ConversationSelection;
12
13
  }
13
- export interface ParentComposerOccurrence {
14
- readonly occurrenceId: number;
15
- readonly source: string;
16
- readonly ref: string;
17
- readonly offset: number;
18
- /** Present in newer DSH input snapshots; older rc.6 fixtures omit it. */
19
- readonly length?: number;
20
- /** Draft-persistence projection cached by newer DSH versions. */
21
- readonly clipboardText?: string;
22
- }
23
- export interface ParentComposerInputSnapshot {
24
- readonly draft: string;
25
- readonly draftRev: number;
26
- readonly occurrences: readonly ParentComposerOccurrence[];
27
- }
28
- export interface ParentComposerInput {
29
- readonly state: {
30
- getSnapshot(): ParentComposerInputSnapshot;
31
- subscribe?(listener: () => void): () => void;
32
- };
33
- setDraft(text: string): void;
34
- insertReference(reference: {
35
- readonly source: string;
36
- readonly ref: string;
37
- readonly label: string;
38
- readonly appearance?: 'session' | 'file' | 'folder';
39
- readonly clipboardText: string;
40
- }, span: {
41
- readonly start: number;
42
- readonly end: number;
43
- readonly draftRev: number;
44
- }): boolean;
45
- }
46
- export interface ParentConversationService {
47
- readonly input: {
48
- for(scope: Context): ParentComposerInput;
49
- };
50
- }
51
- export interface SelectionReferenceSource {
52
- readonly trigger: '@';
53
- readonly name: string;
54
- readonly order: number;
55
- candidates(): Promise<readonly never[]>;
56
- onPick(): undefined;
57
- readonly codec: {
58
- clipboardText(ref: string): string;
59
- serialize(ref: string, signal: AbortSignal): Promise<string>;
60
- };
61
- }
62
14
  export declare function decodeSelectionReference(ref: string): readonly ConversationAnnotation[];
63
15
  /** Read all plugin annotations represented by the current DSH input occurrence. */
64
16
  export declare function conversationAnnotations(snapshot: ParentComposerInputSnapshot): readonly ConversationAnnotation[];
@@ -70,14 +22,24 @@ export declare function removeConversationAnnotations(input: ParentComposerInput
70
22
  export declare const selectionReferenceSource: SelectionReferenceSource;
71
23
  /** Add one passage to the parent composer's aggregated annotation occurrence. */
72
24
  export declare function addSelectionToConversation(input: ParentComposerInput, selection: ConversationSelection, comment?: string): boolean;
25
+ /** Remove one unsent selected-passage annotation, retaining the aggregate when needed. */
26
+ export declare function removeConversationAnnotation(input: ParentComposerInput, annotationIndex: number): boolean;
73
27
  /** Replace the optional comment on one unsent selected-passage annotation. */
74
28
  export declare function updateConversationAnnotation(input: ParentComposerInput, annotationIndex: number, comment?: string): boolean;
29
+ export interface ConversationAnnotationRecoveryRecord {
30
+ readonly ref: string;
31
+ readonly displayDraft: string;
32
+ readonly mirrorDraft: string;
33
+ readonly baseDraft: string;
34
+ }
35
+ /** Describe both the display draft and DSH's persisted clipboard projection. */
36
+ export declare function conversationAnnotationRecoveryRecord(snapshot: ParentComposerInputSnapshot): ConversationAnnotationRecoveryRecord | undefined;
75
37
  /** Return the valid aggregated reference currently occupying the leading draft slot. */
76
38
  export declare function conversationAnnotationReference(snapshot: ParentComposerInputSnapshot): string | undefined;
77
- /** Remove a recognized plugin-owned prefix restored without its occurrence. */
39
+ /** Remove the plugin-owned prefix when rc.6 restored its draft without occurrences. */
78
40
  export declare function removeOrphanedConversationAnnotationPlaceholder(input: ParentComposerInput): boolean;
79
- /** Rehydrate a lost occurrence only over an exact stored plugin projection. */
80
- export declare function restoreConversationAnnotationReference(input: ParentComposerInput, ref: string): boolean;
41
+ /** Rehydrate a lost occurrence over either its display draft or exact mirror projection. */
42
+ export declare function restoreConversationAnnotationReference(input: ParentComposerInput, ref: string, expectedMirrorDraft?: string, expectedBaseDraft?: string): boolean;
81
43
  export interface AnnotatedConversationPrompt {
82
44
  readonly annotations: readonly ConversationAnnotation[];
83
45
  readonly message: string;
@@ -86,4 +48,3 @@ export interface AnnotatedConversationPrompt {
86
48
  export declare function parseAnnotatedConversationPrompt(text: string): AnnotatedConversationPrompt | undefined;
87
49
  /** Add the selected quote to the first child prompt. */
88
50
  export declare function buildSideChatPrompt(selection: ConversationSelection | undefined, question: string): readonly SideChatPromptPart[];
89
- //# sourceMappingURL=add-to-conversation.d.ts.map