@chestnut23/dsh-conversation-outline 0.2.0 → 0.2.1

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 CHANGED
@@ -41,12 +41,19 @@ a flash highlight so you cannot miss it. Bilingual zh-CN / en.
41
41
 
42
42
  ## Install
43
43
 
44
- > **Requirements**: DSH ≥ `0.1.5-rc.2` (the current `next` channel / the DSH
45
- > Desktop app). The 0.1.5 line moved the Chat node graph into a session-scoped
46
- > store, so older hosts need the previous plugin release (see the version table
47
- > below).
44
+ > **Requirements**: DSH ≥ `0.1.5-rc.2` (the `next` channel / the DSH Desktop app).
45
+ >
46
+ > | Plugin version | Works with |
47
+ > |---|---|
48
+ > | `0.2.x` | DSH ≥ `0.1.5-rc.2` |
49
+ > | `0.1.2` and earlier | DSH `0.1.0-rc.x` (the Chat node graph still lived in `snapshot.chat`) |
48
50
 
49
51
 
52
+ > **Using the DSH Desktop app?** Run the same command in the app's built-in
53
+ > terminal **without `--profile`** — it targets the `desktop` profile
54
+ > automatically. The first install needs one restart of that DSH; later upgrades
55
+ > hot-reload (no restart).
56
+
50
57
  **Prerequisites**: [DeepSeek Harness](https://github.com/deepseek-ai/DeepSeek-Harness)
51
58
  (`dsh` available) **≥ 0.1.5-rc.2**; Node.js `^22.19` or `>=24`; pnpm 10+.
52
59
  If you run DSH via `npx`, prefix the commands with `npx -p @deepseek-ai/dsh `.
@@ -54,13 +61,12 @@ On an older host, use plugin `0.1.3` — see the
54
61
  [compatibility table](docs/troubleshooting.md#compatibility).
55
62
 
56
63
  ```sh
57
- # 1) GitHub (works right now — recommended)
58
- dsh plugin --profile web add github:lzbaclz/dsh-conversation-outline
59
-
60
- # 2) npm (published under our own scope; the unscoped name belongs to an
61
- # unrelated project — always install the @chestnut23 scope)
64
+ # 1) npm (recommended one command)
62
65
  dsh plugin --profile web add @chestnut23/dsh-conversation-outline
63
66
 
67
+ # 2) GitHub (latest commit, no build step needed)
68
+ dsh plugin --profile web add github:lzbaclz/dsh-conversation-outline
69
+
64
70
  # 3) from source (local development)
65
71
  git clone https://github.com/lzbaclz/dsh-conversation-outline.git
66
72
  cd dsh-conversation-outline
@@ -92,10 +98,15 @@ Upgrade with the same `add` command (optionally pin a version:
92
98
  dsh plugin --profile web add @chestnut23/dsh-conversation-outline@latest # fetch the new version
93
99
  ```
94
100
 
95
- The DSH client-plugin HMR chain watches plugin bundles and reloads them: after an
96
- upgrade you normally need neither an app restart nor a page refresh. Every side
97
- effect (style tag, locale dictionaries, slot registrations) is owned by the plugin
98
- fiber, so a hot reload never leaves stale code behind.
101
+ The DSH composition always mounts the `dsh-client-hmr` chain, which watches
102
+ installed plugin bundles and reloads them:
103
+
104
+ - **Upgrading an installed plugin** (same entry, new file content) is hot no app
105
+ restart, usually not even a page refresh.
106
+ - **Installing a brand-new plugin** (a new roster entry) needs one DSH restart.
107
+
108
+ Every side effect (style tag, locale dictionaries, slot registrations) is owned by
109
+ the plugin fiber, so a hot reload never leaves stale code behind.
99
110
 
100
111
  ## Usage
101
112
 
@@ -119,6 +130,7 @@ pnpm install # installs the pinned @deepseek-ai 0.1.5-rc.2 type packages
119
130
  pnpm typecheck # host + client dual tsc programs
120
131
  pnpm build # tsc(host) → tsc(client) → tsdown bundles lib/client.js
121
132
  pnpm verify # offline smoke: manifest/exports/patch/bundle shape + pure-logic asserts
133
+ pnpm test:dom # headless DOM test: mounts the built rail in jsdom and asserts render/hover/jump
122
134
  ```
123
135
 
124
136
  `pnpm typecheck` needs `lib/types/**` from the `@deepseek-ai/*` packages. Some DSH
package/README.zh.md CHANGED
@@ -38,21 +38,29 @@
38
38
 
39
39
  ## 安装
40
40
 
41
- > **环境要求**:DSH ≥ `0.1.5-rc.2`(当前 `next` 通道 / DSH Desktop 桌面版)。
42
- > 0.1.5 把 Chat 节点图搬进了会话级 store,更早的宿主请使用上一个版本
43
- > (见下方版本对照表)。
41
+ > **环境要求**:DSH ≥ `0.1.5-rc.2`(`next` 通道 / DSH Desktop 桌面版)。
42
+ >
43
+ > | 插件版本 | 适配的 DSH |
44
+ > |---|---|
45
+ > | `0.2.x` | DSH ≥ `0.1.5-rc.2` |
46
+ > | `0.1.2` 及更早 | DSH `0.1.0-rc.x`(Chat 节点图还在 `snapshot.chat` 里) |
44
47
 
45
48
 
49
+ > **用 DSH Desktop 桌面版?** 在应用内终端执行同样的命令、**不用写 `--profile`**
50
+ > (会自动指向 `desktop` profile)。首次安装需要重启一次;以后升级走热更新,无需重启。
51
+
46
52
  **前置要求**:已安装 [DeepSeek Harness](https://github.com/deepseek-ai/DeepSeek-Harness)
47
53
  (`dsh` 命令可用)且版本 **≥ 0.1.5-rc.2**;Node.js `^22.19` 或 `>=24`;pnpm 10+。
48
54
  通过 `npx` 运行 DSH 的话,给下面命令加上 `npx -p @deepseek-ai/dsh ` 前缀。
49
55
  更老的宿主请装插件 `0.1.3`,见[兼容表](docs/troubleshooting.md#compatibility)。
50
56
 
51
57
  ```sh
52
- # 1) GitHub(现在就能装,推荐)
53
- dsh plugin --profile web add github:lzbaclz/dsh-conversation-outline
58
+ # 1) npm(推荐,一条命令)
59
+ dsh plugin --profile web add @chestnut23/dsh-conversation-outline
54
60
 
55
- # 2) npm(发布在你自己的 scope 下;无 scope 的同名包属于另一个无关项目,
61
+ # 2) GitHub(最新提交,无需构建步骤)
62
+ dsh plugin --profile web add github:lzbaclz/dsh-conversation-outline
63
+ # 注意:npm 上无 scope 的同名包属于另一个无关项目,
56
64
  # 务必安装 @chestnut23 scope)
57
65
  dsh plugin --profile web add @chestnut23/dsh-conversation-outline
58
66
 
@@ -98,17 +106,21 @@ pnpm install # 安装钉死版本的 @deepseek-ai 0.1.5-rc.2 类型包
98
106
  pnpm typecheck # host + client 双 tsc program
99
107
  pnpm build # tsc(host) → tsc(client) → tsdown 打包 lib/client.js
100
108
  pnpm verify # 离线冒烟:manifest/exports/patch/产物形状 + 纯逻辑断言
109
+ pnpm test:dom # 无头 DOM 测试:jsdom 里挂载真实组件,断言细条渲染/悬停/点击跳转
101
110
  ```
102
111
 
103
- `pnpm typecheck` 依赖 `@deepseek-ai/*` 包里的 `lib/types/**`。部分安装形态下这些包
104
- **不带声明文件**(Electron 内置副本会裁掉),npm rc 通道发布的类型面也偏薄——这时
105
- typecheck 会报「找不到模块」,但**不影响构建与运行时**。正规做法是让 profile 里的
106
- `@deepseek-ai/*` 指向 DSH 源码 checkout;无论类型环境如何,`pnpm verify` 都会覆盖
107
- 与宿主契约相关的逻辑断言。
112
+ 类型面由 **devDependencies 里钉死版本的 `@deepseek-ai/*` 0.1.5-rc.2 包**提供(npm 上有
113
+ 完整 `lib/types/**`)。注意 DSH Desktop 应用内置的副本**裁掉了声明文件**,所以不要把
114
+ 类型指到 Electron `node_modules`;类型版本与运行时版本保持一致,才能真正校验适配。
115
+
116
+ **热更新**:DSH 组合常驻 `dsh-client-hmr` 链(实测桌面版组合 `- id: client-hmr`,未禁用),
117
+ 它监听已安装插件 bundle 的变化并自动重载:
118
+
119
+ - **升级已装插件** → 热更新,无需重启应用,页面通常自动生效(开发时 `pnpm exec tsdown --watch`
120
+ 改完即生效;手动 `pnpm build` 后刷新页面亦可)
121
+ - **首次新增插件**(名册新增条目)→ 需要重启一次 DSH 服务
108
122
 
109
- 纯客户端改动可热更新:`pnpm exec tsdown --watch` 持续重写 `lib/client.js`,DSH 的客户端
110
- HMR 链(或简单刷新页面)即可生效。host / manifest 改动需要重启服务。scratch profile
111
- 测试配方:[docs/implementation-spec.md §4.2](docs/implementation-spec.md)。
123
+ scratch profile 测试配方:[docs/implementation-spec.md §4.2](docs/implementation-spec.md)。
112
124
 
113
125
  ## 一起聊聊
114
126
 
@@ -7,30 +7,6 @@ import { collectQuestions, filterQuestions, formatTime, isJumpTargetRow, } from
7
7
  * a shape the host did not provide.
8
8
  */
9
9
  const NO_FLOW = { order: [] };
10
- /**
11
- * Resolve one observable Chat source out of a session binding.
12
- *
13
- * The Chat node graph is a session-scoped store, reached exactly the way
14
- * `@deepseek-ai/dsh-client-ui-chat` reaches it:
15
- *
16
- * ```js
17
- * ctx.uiConversation.binding(binding).target('chat') // { getSnapshot, subscribe }
18
- * ```
19
- *
20
- * Reading the provider off `binding.ctx` (rather than the root context) keeps
21
- * this correct under any bus arrangement; a host that does not offer the
22
- * service yields `undefined`, and the rail then renders nothing instead of
23
- * crashing the slot.
24
- */
25
- export function resolveChatFeed(binding) {
26
- // Structural lookup on purpose: the binding's context face is a cordis
27
- // Context in 0.1.5-rc.2 (`AgentContext`), whose `uiConversation` slot the
28
- // service tracker only exposes at runtime, so a structural read is the
29
- // portable way to reach it without value-importing another plugin.
30
- const uiConversation = binding
31
- ?.ctx?.uiConversation;
32
- return uiConversation?.binding?.(binding)?.target?.('chat');
33
- }
34
10
  const JUMP_HEADROOM = 96;
35
11
  const JUMP_TIMEOUT_MS = 1500;
36
12
  const FLASH_MS = 1900;
@@ -73,7 +49,7 @@ function scheduleTimeout(timeoutRef, fn, ms) {
73
49
  }, ms);
74
50
  timeoutRef.current.push(id);
75
51
  }
76
- export function OutlinePanel({ sessions, t, }) {
52
+ export function OutlinePanel({ sessions, resolveChatFeed, t, }) {
77
53
  // Current-session feed: the sessions service owns it (`ISessions.list`), so
78
54
  // subscribe to it here instead of taking a `useSessions` standard-kit prop —
79
55
  // 0.1.5-rc.2 removed that hook from `GlobalStandardProps`.
@@ -87,7 +63,7 @@ export function OutlinePanel({ sessions, t, }) {
87
63
  const session = binding?.session;
88
64
  // Question flow: the session-scoped Chat store. History pagination lives on
89
65
  // the session face, so its two flags are merged in here.
90
- const chat = useMemo(() => resolveChatFeed(binding), [binding]);
66
+ const chat = useMemo(() => resolveChatFeed(binding), [resolveChatFeed, binding]);
91
67
  const subscribe = useCallback((onChange) => (chat ? chat.subscribe(onChange) : () => { }), [chat]);
92
68
  const getSnapshot = useCallback(() => (chat ? chat.getSnapshot() : NO_FLOW), [chat]);
93
69
  const chatSnapshot = useSyncExternalStore(subscribe, getSnapshot);
@@ -4,9 +4,21 @@ import { injectStyle } from "./styles.js";
4
4
  /**
5
5
  * Client entry (implementation-spec §1.1/§2.4): the browser half of the
6
6
  * plugin. Cordis services this fiber waits for before apply() runs.
7
+ *
8
+ * `uiConversation` is declared here on purpose: cordis guards `ctx` with a
9
+ * Proxy that THROWS on an undeclared service read, and the rail reaches the
10
+ * session's Chat store through it. Reading it off another context (e.g.
11
+ * `binding.ctx.uiConversation`) is not allowed even after declaring it — the
12
+ * guard is per-context, so `apply` captures it from its own ctx below.
7
13
  */
8
- export const inject = ['slots', 'sessions', 'locale'];
14
+ export const inject = ['slots', 'sessions', 'locale', 'uiConversation'];
15
+ /**
16
+ * The conversation service captured from this plugin's own context. Set in
17
+ * `apply`; `undefined` only before activation, which the resolver tolerates.
18
+ */
19
+ let pluginUiConversation;
9
20
  export function apply(ctx) {
21
+ pluginUiConversation = ctx.uiConversation;
10
22
  // Locale dictionaries — the typed register form (both shipped locales
11
23
  // required, keys compile-checked). The disposer is owned by the fiber, so
12
24
  // HMR removes the namespace on unload.
@@ -17,11 +29,25 @@ export function apply(ctx) {
17
29
  // slots.inject waits for the layout's declaration of `shell.overlay` and
18
30
  // routes the registration (and its unload cascade) through this fiber.
19
31
  // `locale: NS` gives the component the typed `t` seat; the inject factory
20
- // passes the sessions service face.
32
+ // passes the services the component reads.
21
33
  ctx.slots.inject('shell.overlay', () => ctx.slots.register({
22
34
  name: 'shell.overlay',
23
35
  id: 'dsh-conversation-outline.rail',
24
36
  locale: NS,
25
- inject: () => ({ sessions: ctx.sessions }),
37
+ inject: () => ({ sessions: ctx.sessions, resolveChatFeed }),
26
38
  }, OutlinePanel));
27
39
  }
40
+ /**
41
+ * Resolve one session binding's Chat feed through the conversation service.
42
+ *
43
+ * Returns `undefined` for every failure mode — no service (host without
44
+ * ui-conversation), no binding (no current session), no `chat` target — so the
45
+ * rail renders nothing instead of throwing inside its slot. Throwing here is
46
+ * especially costly: the slot error boundary swallows it and the plugin simply
47
+ * disappears with no visible error.
48
+ */
49
+ export function resolveChatFeed(binding) {
50
+ if (binding === null || binding === undefined)
51
+ return undefined;
52
+ return pluginUiConversation?.binding?.(binding)?.target?.('chat');
53
+ }
package/lib/client.js CHANGED
@@ -108,24 +108,6 @@ window.__ModuleLoader__.load({
108
108
  * a shape the host did not provide.
109
109
  */
110
110
  const NO_FLOW = { order: [] };
111
- /**
112
- * Resolve one observable Chat source out of a session binding.
113
- *
114
- * The Chat node graph is a session-scoped store, reached exactly the way
115
- * `@deepseek-ai/dsh-client-ui-chat` reaches it:
116
- *
117
- * ```js
118
- * ctx.uiConversation.binding(binding).target('chat') // { getSnapshot, subscribe }
119
- * ```
120
- *
121
- * Reading the provider off `binding.ctx` (rather than the root context) keeps
122
- * this correct under any bus arrangement; a host that does not offer the
123
- * service yields `undefined`, and the rail then renders nothing instead of
124
- * crashing the slot.
125
- */
126
- function resolveChatFeed(binding) {
127
- return (binding?.ctx?.uiConversation)?.binding?.(binding)?.target?.("chat");
128
- }
129
111
  const JUMP_HEADROOM = 96;
130
112
  const JUMP_TIMEOUT_MS = 1500;
131
113
  const FLASH_MS = 1900;
@@ -167,11 +149,11 @@ window.__ModuleLoader__.load({
167
149
  }, ms);
168
150
  timeoutRef.current.push(id);
169
151
  }
170
- function OutlinePanel({ sessions, t }) {
152
+ function OutlinePanel({ sessions, resolveChatFeed, t }) {
171
153
  const current = (0, react.useSyncExternalStore)((0, react.useCallback)((onChange) => sessions.list.subscribe(onChange), [sessions]), (0, react.useCallback)(() => sessions.list.getSnapshot(), [sessions])).current;
172
154
  const binding = (0, react.useMemo)(() => current ? sessions.binding(current) : void 0, [sessions, current]);
173
155
  const session = binding?.session;
174
- const chat = (0, react.useMemo)(() => resolveChatFeed(binding), [binding]);
156
+ const chat = (0, react.useMemo)(() => resolveChatFeed(binding), [resolveChatFeed, binding]);
175
157
  const chatSnapshot = (0, react.useSyncExternalStore)((0, react.useCallback)((onChange) => chat ? chat.subscribe(onChange) : () => {}, [chat]), (0, react.useCallback)(() => chat ? chat.getSnapshot() : NO_FLOW, [chat]));
176
158
  const snapshot = (0, react.useMemo)(() => ({
177
159
  ...chatSnapshot,
@@ -866,25 +848,55 @@ window.__ModuleLoader__.load({
866
848
  /**
867
849
  * Client entry (implementation-spec §1.1/§2.4): the browser half of the
868
850
  * plugin. Cordis services this fiber waits for before apply() runs.
851
+ *
852
+ * `uiConversation` is declared here on purpose: cordis guards `ctx` with a
853
+ * Proxy that THROWS on an undeclared service read, and the rail reaches the
854
+ * session's Chat store through it. Reading it off another context (e.g.
855
+ * `binding.ctx.uiConversation`) is not allowed even after declaring it — the
856
+ * guard is per-context, so `apply` captures it from its own ctx below.
869
857
  */
870
858
  const inject = [
871
859
  "slots",
872
860
  "sessions",
873
- "locale"
861
+ "locale",
862
+ "uiConversation"
874
863
  ];
864
+ /**
865
+ * The conversation service captured from this plugin's own context. Set in
866
+ * `apply`; `undefined` only before activation, which the resolver tolerates.
867
+ */
868
+ let pluginUiConversation;
875
869
  function apply(ctx) {
870
+ pluginUiConversation = ctx.uiConversation;
876
871
  ctx.effect(() => ctx.locale.register(NS, dictionaries), "dsh-conversation-outline: locale");
877
872
  injectStyle(ctx);
878
873
  ctx.slots.inject("shell.overlay", () => ctx.slots.register({
879
874
  name: "shell.overlay",
880
875
  id: "dsh-conversation-outline.rail",
881
876
  locale: NS,
882
- inject: () => ({ sessions: ctx.sessions })
877
+ inject: () => ({
878
+ sessions: ctx.sessions,
879
+ resolveChatFeed
880
+ })
883
881
  }, OutlinePanel));
884
882
  }
883
+ /**
884
+ * Resolve one session binding's Chat feed through the conversation service.
885
+ *
886
+ * Returns `undefined` for every failure mode — no service (host without
887
+ * ui-conversation), no binding (no current session), no `chat` target — so the
888
+ * rail renders nothing instead of throwing inside its slot. Throwing here is
889
+ * especially costly: the slot error boundary swallows it and the plugin simply
890
+ * disappears with no visible error.
891
+ */
892
+ function resolveChatFeed(binding) {
893
+ if (binding === null || binding === void 0) return void 0;
894
+ return pluginUiConversation?.binding?.(binding)?.target?.("chat");
895
+ }
885
896
  //#endregion
886
897
  exports.apply = apply;
887
898
  exports.inject = inject;
899
+ exports.resolveChatFeed = resolveChatFeed;
888
900
  return module.exports;
889
901
  }
890
902
  });
package/lib/client.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":["_Fragment"],"sources":["client/outline.js","client/OutlinePanel.js","client/locales.js","client/styles.js","client/index.js"],"sourcesContent":["/**\n * Pure logic for the conversation outline (implementation-spec §2.3).\n *\n * Deliberately has NO DOM access and NO React imports so scripts/verify.mjs can\n * import it directly in Node from the tsc output (lib/client/outline.js) and\n * assert the derivations offline.\n *\n * Input shapes are structural \"lite\" views of the runtime snapshot types\n * (@deepseek-ai/dsh-client-runtime/client) — the real objects are assignable\n * to them, and Node can import this module without the browser type graph.\n */\n/**\n * Resolve a Chat store snapshot into the flow to walk.\n *\n * Never throws: a snapshot that has not produced `order` + `nodes` yet (or a\n * host that handed over something else entirely) yields `undefined`, so the\n * caller renders an empty rail instead of crashing its slot.\n */\nexport function resolveOutlineFlow(snapshot) {\n if (snapshot === null || snapshot === undefined)\n return undefined;\n if (Array.isArray(snapshot.order) && snapshot.nodes !== undefined) {\n return { order: snapshot.order, nodes: snapshot.nodes };\n }\n return undefined;\n}\nconst IMAGE_PLACEHOLDER = '[image]';\n/**\n * Flatten message content blocks into a single display string: text blocks are\n * joined, image blocks become a placeholder, and whitespace is trimmed and\n * collapsed.\n */\nexport function flattenQuestionText(content) {\n return content\n .map((block) => {\n if (block.type === 'text')\n return block.text ?? '';\n if (block.type === 'image')\n return IMAGE_PLACEHOLDER;\n return '';\n })\n .join(' ')\n .trim()\n .replace(/\\s+/g, ' ');\n}\n/** Turn number of a node location: step/turn → location.turn.turn, else undefined. */\nfunction turnOf(location) {\n if (!location)\n return undefined;\n if (location.kind === 'step' || location.kind === 'turn')\n return location.turn?.turn;\n return undefined;\n}\n/**\n * Walk the chat flow in order, keep user/steering nodes, skip empty text, and\n * produce chronological outline items (spec §2.3).\n */\nexport function collectQuestions(snapshot) {\n const flow = resolveOutlineFlow(snapshot);\n if (flow === undefined)\n return [];\n const items = [];\n for (const key of flow.order) {\n const node = flow.nodes.get(key);\n if (!node)\n continue;\n if (node.kind !== 'user' && node.kind !== 'steering')\n continue;\n const data = node.data;\n const text = flattenQuestionText(data?.content ?? []);\n if (!text)\n continue;\n items.push({\n key: node.key,\n kind: node.kind,\n seq: data?.seq ?? 0,\n time: data?.time ?? 0,\n turn: turnOf(node.location),\n text,\n });\n }\n return items;\n}\n/** Case-insensitive substring filter over the flattened question text. */\nexport function filterQuestions(items, query) {\n const q = query.trim().toLowerCase();\n if (!q)\n return items;\n return items.filter((item) => item.text.toLowerCase().includes(q));\n}\n/** Local `HH:MM` from a unix-ms timestamp (spec §2.3). */\nexport function formatTime(ms) {\n const d = new Date(ms);\n const hh = String(d.getHours()).padStart(2, '0');\n const mm = String(d.getMinutes()).padStart(2, '0');\n return `${hh}:${mm}`;\n}\n/** Attributes the chat flow renders a node's identity under. */\nconst JUMP_KEY_ATTRIBUTES = ['data-chat-anchor-key', 'data-chat-flow-key'];\n/**\n * Pure DOM predicate for the jump loop: is this row the target node?\n *\n * Exact match only, against either attribute the flow wrapper carries — the\n * platform's own anchor lookup uses `data-chat-anchor-key`, and its sibling\n * `data-chat-flow-key` holds the same value, so a row is still found when only\n * one of the two is present.\n */\nexport function isJumpTargetRow(row, key) {\n return JUMP_KEY_ATTRIBUTES.some((attribute) => row.getAttribute(attribute) === key);\n}\n","import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';\nimport { collectQuestions, filterQuestions, formatTime, isJumpTargetRow, } from \"./outline.js\";\n/**\n * Stable getSnapshot value while no session (or no feed) is current (uSES\n * contract): an empty flow, so the rail renders nothing instead of throwing on\n * a shape the host did not provide.\n */\nconst NO_FLOW = { order: [] };\n/**\n * Resolve one observable Chat source out of a session binding.\n *\n * The Chat node graph is a session-scoped store, reached exactly the way\n * `@deepseek-ai/dsh-client-ui-chat` reaches it:\n *\n * ```js\n * ctx.uiConversation.binding(binding).target('chat') // { getSnapshot, subscribe }\n * ```\n *\n * Reading the provider off `binding.ctx` (rather than the root context) keeps\n * this correct under any bus arrangement; a host that does not offer the\n * service yields `undefined`, and the rail then renders nothing instead of\n * crashing the slot.\n */\nexport function resolveChatFeed(binding) {\n // Structural lookup on purpose: the binding's context face is a cordis\n // Context in 0.1.5-rc.2 (`AgentContext`), whose `uiConversation` slot the\n // service tracker only exposes at runtime, so a structural read is the\n // portable way to reach it without value-importing another plugin.\n const uiConversation = binding\n ?.ctx?.uiConversation;\n return uiConversation?.binding?.(binding)?.target?.('chat');\n}\nconst JUMP_HEADROOM = 96;\nconst JUMP_TIMEOUT_MS = 1500;\nconst FLASH_MS = 1900;\nconst COPIED_MS = 1500;\n/** Grace period before the hover panel collapses (lets the pointer travel). */\nconst COLLAPSE_DELAY_MS = 240;\n/** Rail capacity; older questions fold into the \"+N\" marker. */\nconst MAX_BARS = 60;\n/**\n * The conversation view's header tablist, scoped to the conversation root:\n * walk up from the scrollport's PARENT (the scrollport itself may contain\n * other tablists, e.g. the trajectory event-details tabs) and return the\n * nearest ancestor containing a `[role=\"tablist\"]`. Never falls back to a\n * document-wide query, so other tablists (trajectory event details,\n * settings, cordis source viewer) are not hit.\n */\nfunction findConversationTablist(scrollport) {\n let node = scrollport.parentElement;\n while (node) {\n const tablist = node.querySelector('[role=\"tablist\"]');\n if (tablist)\n return tablist;\n node = node.parentElement;\n }\n return null;\n}\n/** RAF that prunes itself from the tracking ref once it fires. */\nfunction scheduleRaf(rafRef, fn) {\n const id = requestAnimationFrame(() => {\n rafRef.current = rafRef.current.filter((x) => x !== id);\n fn();\n });\n rafRef.current.push(id);\n}\n/** Timeout that prunes itself from the tracking ref once it fires. */\nfunction scheduleTimeout(timeoutRef, fn, ms) {\n const id = window.setTimeout(() => {\n timeoutRef.current = timeoutRef.current.filter((x) => x !== id);\n fn();\n }, ms);\n timeoutRef.current.push(id);\n}\nexport function OutlinePanel({ sessions, t, }) {\n // Current-session feed: the sessions service owns it (`ISessions.list`), so\n // subscribe to it here instead of taking a `useSessions` standard-kit prop —\n // 0.1.5-rc.2 removed that hook from `GlobalStandardProps`.\n const listSubscribe = useCallback((onChange) => sessions.list.subscribe(onChange), [sessions]);\n const listSnapshot = useCallback(() => sessions.list.getSnapshot(), [sessions]);\n const current = useSyncExternalStore(listSubscribe, listSnapshot).current;\n // One binding per session, shared by the session face and the Chat feed: the\n // binding is the identity `uiConversation.binding()` caches its per-session\n // target on, so both must be resolved from the same object.\n const binding = useMemo(() => (current ? sessions.binding(current) : undefined), [sessions, current]);\n const session = binding?.session;\n // Question flow: the session-scoped Chat store. History pagination lives on\n // the session face, so its two flags are merged in here.\n const chat = useMemo(() => resolveChatFeed(binding), [binding]);\n const subscribe = useCallback((onChange) => (chat ? chat.subscribe(onChange) : () => { }), [chat]);\n const getSnapshot = useCallback(() => (chat ? chat.getSnapshot() : NO_FLOW), [chat]);\n const chatSnapshot = useSyncExternalStore(subscribe, getSnapshot);\n const snapshot = useMemo(() => ({\n ...chatSnapshot,\n hasMore: session?.getSnapshot?.().hasMore ?? false,\n loadingOlder: session?.getSnapshot?.().loadingOlder ?? false,\n }), [chatSnapshot, session]);\n // Two independent sources for the panel being open: `pinned` is a click\n // gesture (sticky until Escape / outside click / session change), `hovered`\n // is pointer presence over the rail or the panel. Deriving `open` from both\n // means a click on the rail opens the panel even when no hover event ever\n // fires (touch, synthetic/automation input, or a pointer that entered the\n // strip without crossing its boundary), and a hover preview still collapses\n // on its own once the pointer leaves.\n const [pinned, setPinned] = useState(false);\n const [hovered, setHovered] = useState(false);\n const open = pinned || hovered;\n const [query, setQuery] = useState('');\n const [copiedKey, setCopiedKey] = useState(null);\n // The question whose jump could not be completed; the panel says so instead\n // of failing silently (the row may sit outside the loaded history window).\n const [jumpFailed, setJumpFailed] = useState(null);\n const timeoutsRef = useRef([]);\n const rafsRef = useRef([]);\n const flashedRowRef = useRef(null);\n const collapseTimerRef = useRef(null);\n const railRef = useRef(null);\n const panelRef = useRef(null);\n // Cancel pending jump work (RAFs/timeouts), the flash highlight, and a\n // scheduled hover collapse.\n const clearPending = useCallback(() => {\n for (const id of rafsRef.current)\n window.cancelAnimationFrame(id);\n for (const id of timeoutsRef.current)\n window.clearTimeout(id);\n rafsRef.current = [];\n timeoutsRef.current = [];\n if (collapseTimerRef.current !== null) {\n window.clearTimeout(collapseTimerRef.current);\n collapseTimerRef.current = null;\n }\n if (flashedRowRef.current) {\n flashedRowRef.current.removeAttribute('data-dsh-outline-flash');\n flashedRowRef.current = null;\n }\n }, []);\n /** Close the panel from any trigger: drop the pin and the hover preview. */\n const closePanel = useCallback(() => {\n setPinned(false);\n setHovered(false);\n cancelCollapseRef.current();\n }, []);\n // Session change → cancel pending work and collapse (navigate closes the\n // panel, spec §2.1; a mid-jump poll must not target the stale session).\n useEffect(() => {\n clearPending();\n setPinned(false);\n setHovered(false);\n setJumpFailed(null);\n }, [current, clearPending]);\n // Escape closes the panel (hover-opened or click-pinned).\n useEffect(() => {\n if (!open)\n return;\n const onKey = (event) => {\n if (event.key === 'Escape')\n closePanel();\n };\n window.addEventListener('keydown', onKey);\n return () => window.removeEventListener('keydown', onKey);\n }, [open, closePanel]);\n // A click anywhere outside the rail and the panel releases a pin, so the\n // panel behaves like every other dismissible overlay on the page.\n useEffect(() => {\n if (!pinned)\n return;\n const onPointerDown = (event) => {\n const target = event.target;\n if (!(target instanceof Node))\n return;\n if (railRef.current?.contains(target) || panelRef.current?.contains(target))\n return;\n closePanel();\n };\n window.addEventListener('mousedown', onPointerDown);\n return () => window.removeEventListener('mousedown', onPointerDown);\n }, [pinned, closePanel]);\n // Unmount cleanup: cancel pending flash/copied timeouts, jump RAFs, collapse\n // timer, and the flash attribute.\n useEffect(() => clearPending, [clearPending]);\n const allItems = useMemo(() => collectQuestions(snapshot), [snapshot]);\n const items = useMemo(() => filterQuestions(allItems, query), [allItems, query]);\n const hasMore = snapshot?.hasMore ?? false;\n const loadingOlder = snapshot?.loadingOlder ?? false;\n // ---- open mechanics: click pins, hover previews, grace period between ---\n const cancelCollapse = useCallback(() => {\n if (collapseTimerRef.current !== null) {\n window.clearTimeout(collapseTimerRef.current);\n collapseTimerRef.current = null;\n }\n }, []);\n // `closePanel` above runs before this declaration; a ref keeps the two\n // callbacks independent of declaration order.\n const cancelCollapseRef = useRef(cancelCollapse);\n cancelCollapseRef.current = cancelCollapse;\n const scheduleCollapse = useCallback(() => {\n cancelCollapse();\n collapseTimerRef.current = window.setTimeout(() => {\n collapseTimerRef.current = null;\n // Only a preview collapses on its own: a pinned panel stays until it is\n // closed, and a pointer still inside the rail or the panel (Chromium\n // raises no further enter events while the pointer sits still) keeps the\n // preview up.\n if (railRef.current?.matches(':hover') || panelRef.current?.matches(':hover'))\n return;\n setHovered(false);\n }, COLLAPSE_DELAY_MS);\n }, [cancelCollapse]);\n /** Pointer entered the rail or the panel: cancel a pending collapse, preview. */\n const onEnter = useCallback(() => {\n cancelCollapse();\n setHovered(true);\n }, [cancelCollapse]);\n /** Pointer left: let the grace period decide, unless the panel is pinned. */\n const onLeave = useCallback(() => {\n if (pinned)\n return;\n scheduleCollapse();\n }, [pinned, scheduleCollapse]);\n /** A click on the rail (or any bar) opens the panel and keeps it open. */\n const togglePin = useCallback(() => {\n cancelCollapse();\n setPinned((value) => !value);\n setHovered(true);\n }, [cancelCollapse]);\n /** The panel's own controls: clicking inside never closes it. */\n const keepOpen = useCallback(() => {\n cancelCollapse();\n setHovered(true);\n }, [cancelCollapse]);\n /** Find the chat row for a node key (pure predicate over DOM rows). */\n const findRow = useCallback((key) => {\n // Exact match on either anchor attribute the chat flow renders for a node:\n // `data-chat-anchor-key` is the one the platform's own anchorElement() uses,\n // `data-chat-flow-key` is its sibling on the same wrapper. No guessing at\n // the key's internals — a wrong row is worse than a reported failure.\n const rows = document.querySelectorAll('[data-chat-anchor-key], [data-chat-flow-key]');\n for (const row of rows) {\n if (isJumpTargetRow(row, key))\n return row;\n }\n return null;\n }, []);\n /** Scroll the row into view (96px headroom) and flash a highlight. */\n const flashAndScroll = useCallback((row) => {\n const scrollport = row.closest('[data-conversation-scroll]') ?? document.querySelector('[data-conversation-scroll]');\n if (scrollport) {\n const flowTop = row.getBoundingClientRect().top - scrollport.getBoundingClientRect().top;\n const reduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n scrollport.scrollTo({\n top: scrollport.scrollTop + flowTop - JUMP_HEADROOM,\n behavior: reduced ? 'auto' : 'smooth',\n });\n }\n // A second jump within FLASH_MS: clear the previous row first.\n if (flashedRowRef.current && flashedRowRef.current !== row) {\n flashedRowRef.current.removeAttribute('data-dsh-outline-flash');\n }\n flashedRowRef.current = row;\n row.setAttribute('data-dsh-outline-flash', 'true');\n scheduleTimeout(timeoutsRef, () => {\n if (flashedRowRef.current === row) {\n row.removeAttribute('data-dsh-outline-flash');\n flashedRowRef.current = null;\n }\n }, FLASH_MS);\n }, []);\n /** Jump-to-message algorithm (spec §2.2). */\n const jumpTo = useCallback((key, label) => {\n // The conversation page must be mounted; abort silently otherwise.\n const scrollport = document.querySelector('[data-conversation-scroll]');\n if (!scrollport)\n return;\n setJumpFailed(null);\n // Ensure the Chat view is active: chat is order 0 — the FIRST tab of the\n // conversation-root tablist, when one exists (setView is idempotent).\n // A profile without extra views has no header tablist at all — that is\n // fine, the rows are already visible.\n const tablist = findConversationTablist(scrollport);\n if (tablist) {\n const firstTab = tablist.querySelector('button[role=\"tab\"]');\n if (firstTab)\n firstTab.click();\n }\n // Poll for the target row regardless of tablist presence — render timing\n // only; the row is guaranteed in the loaded window (it came from the\n // snapshot). Canceled on session change/unmount via clearPending.\n const deadline = Date.now() + JUMP_TIMEOUT_MS;\n const poll = () => {\n const row = findRow(key);\n if (row) {\n flashAndScroll(row);\n closePanel();\n return;\n }\n if (Date.now() < deadline) {\n scheduleRaf(rafsRef, poll);\n }\n else {\n // Never fail silently: the panel states what happened, and the\n // console keeps the key for bug reports.\n console.warn(t('jumpFailed'), { key });\n setJumpFailed(label ?? key);\n }\n };\n scheduleRaf(rafsRef, poll);\n }, [findRow, flashAndScroll, t, closePanel]);\n /** Copy a question's text (clipboard API with execCommand fallback). */\n const copyText = useCallback((text, key) => {\n const done = () => {\n setCopiedKey(key);\n scheduleTimeout(timeoutsRef, () => setCopiedKey((k) => (k === key ? null : k)), COPIED_MS);\n };\n const fallback = () => {\n try {\n const ta = document.createElement('textarea');\n ta.value = text;\n ta.setAttribute('readonly', '');\n ta.style.position = 'fixed';\n ta.style.opacity = '0';\n document.body.appendChild(ta);\n ta.select();\n document.execCommand('copy');\n ta.remove();\n done();\n }\n catch {\n // clipboard unavailable — ignore\n }\n };\n if (navigator.clipboard?.writeText) {\n navigator.clipboard.writeText(text).then(done, fallback);\n }\n else {\n fallback();\n }\n }, []);\n // No current session, or a session with nothing to outline → render nothing\n // (rail included). This is driven by the question list, not by the session's\n // `blank` flag: the flag belongs to the conversation snapshot, while the rail\n // is derived from the Chat flow, and a session whose nodes are not loaded yet\n // must not take the slot down. MUST stay below every hook (this overlay entry\n // stays mounted across session changes, so a conditional hook would crash\n // React — reviewer MUST-FIX #1).\n if (!current || !session || allItems.length === 0)\n return null;\n // Rail bars: chronological top→bottom, capped at MAX_BARS with the overflow\n // folded into a \"+N\" marker (the rail is a minimap, not the full list).\n const start = Math.max(0, allItems.length - MAX_BARS);\n const bars = allItems.slice(start);\n const overflow = start;\n return (_jsxs(_Fragment, { children: [_jsxs(\"div\", { ref: railRef, className: \"dso-rail\", role: \"group\", \"aria-label\": t('title'), tabIndex: 0, onMouseEnter: onEnter, onMouseLeave: onLeave, onFocus: onEnter, onBlur: onLeave, onClick: (event) => {\n // Any click on the strip pins the panel open — the container itself,\n // its padding, or the \"+N\" marker. Bars stop propagation and reach\n // the same pin through the shared jump gesture below.\n if (event.target === event.currentTarget || event.target instanceof HTMLSpanElement) {\n togglePin();\n }\n }, onKeyDown: (event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n togglePin();\n }\n }, \"data-dso-open\": open ? 'true' : undefined, children: [overflow > 0 && (_jsxs(\"span\", { className: \"dso-rail-more\", \"aria-label\": t('moreBars', { count: overflow }), children: [\"+\", overflow] })), bars.map((item, index) => (_jsx(\"button\", { type: \"button\", className: \"dso-bar\", \"aria-label\": t('barLabel', { n: start + index + 1 }), onClick: (event) => {\n event.stopPropagation();\n // The bar's own job is the jump; the panel comes up pinned first\n // so a click always has a visible effect, then jumpTo collapses\n // it once the row is on screen.\n setPinned(true);\n setHovered(true);\n jumpTo(item.key, item.text);\n } }, item.key)))] }), open && (_jsxs(\"div\", { ref: panelRef, className: \"dso-panel\", role: \"region\", \"aria-label\": t('title'), \"data-dso-pinned\": pinned ? 'true' : undefined, onMouseEnter: onEnter, onMouseLeave: onLeave, onFocus: onEnter, onBlur: onLeave, onMouseDown: keepOpen, children: [_jsxs(\"header\", { className: \"dso-panel-header\", children: [_jsx(\"span\", { className: \"dso-panel-title\", children: t('title') }), _jsx(\"span\", { className: \"dso-panel-count\", children: t('count', { count: allItems.length }) }), _jsx(\"button\", { type: \"button\", className: \"dso-panel-close\", \"aria-label\": t('close'), onClick: closePanel, children: \"\\u00D7\" })] }), _jsx(\"input\", { className: \"dso-search\", type: \"search\", value: query, placeholder: t('searchPlaceholder'), \"aria-label\": t('searchPlaceholder'), onChange: (event) => setQuery(event.target.value) }), _jsx(\"div\", { className: \"dso-list\", children: items.length === 0 ? (_jsx(\"div\", { className: \"dso-empty\", children: t('empty') })) : (items.map((item) => (_jsxs(\"div\", { className: \"dso-row\", children: [_jsxs(\"button\", { type: \"button\", className: \"dso-row-main\", onClick: () => jumpTo(item.key, item.text), children: [_jsx(\"span\", { className: \"dso-turn\", children: item.turn !== undefined ? `#${item.turn}` : '' }), _jsx(\"span\", { className: \"dso-text\", children: item.text }), item.kind === 'steering' && _jsx(\"span\", { className: \"dso-steer\", children: t('steerTag') }), _jsx(\"span\", { className: \"dso-time\", children: formatTime(item.time) })] }), _jsx(\"button\", { type: \"button\", className: copiedKey === item.key ? 'dso-copy dso-copied' : 'dso-copy', \"aria-label\": copiedKey === item.key ? t('copied') : t('copy'), onClick: () => copyText(item.text, item.key), children: copiedKey === item.key ? t('copied') : t('copy') })] }, item.key)))) }), jumpFailed !== null && (_jsx(\"p\", { className: \"dso-jump-failed\", role: \"status\", \"data-dso-jump-failed\": \"true\", children: t('jumpFailed') })), hasMore && (_jsx(\"footer\", { className: \"dso-footer\", children: _jsx(\"button\", { type: \"button\", className: \"dso-load-older\", disabled: loadingOlder, onClick: () => {\n void session.loadOlder();\n }, children: loadingOlder ? t('loadingOlder') : t('loadOlder') }) }))] }))] }));\n}\n","export const NS = 'dsh-conversation-outline';\nexport const zh = {\n title: '会话大纲',\n count: '{count} 个问题',\n searchPlaceholder: '搜索问题…',\n empty: '当前会话还没有问题',\n loadOlder: '加载更早',\n loadingOlder: '加载中…',\n copy: '复制',\n copied: '已复制',\n steerTag: '追问',\n close: '关闭',\n jumpFailed: '跳转失败:未找到对应消息',\n barLabel: '跳到第 {n} 个问题',\n moreBars: '还有 {count} 个更早的问题',\n};\nexport const en = {\n title: 'Outline',\n count: '{count} questions',\n searchPlaceholder: 'Search questions…',\n empty: 'No questions in this conversation yet',\n loadOlder: 'Load older',\n loadingOlder: 'Loading…',\n copy: 'Copy',\n copied: 'Copied',\n steerTag: 'steer',\n close: 'Close',\n jumpFailed: 'Jump failed: target message not found',\n barLabel: 'Jump to question {n}',\n moreBars: '{count} more earlier questions',\n};\nexport const dictionaries = { zh, en };\n","/**\n * Outline rail + hover panel CSS (implementation-spec §1.8/§2.1, revised):\n * a thin right-edge rail (conversation minimap) that is always visible while\n * the session has questions, and a preview panel that expands on hover.\n * Plain CSS string injected via an HMR-safe\n * `<style data-plugin=\"dsh-conversation-outline\" data-plugin-css=\"...\">` tag.\n * Stable prefixed class names (`dso_*`), DSH theme vars (`--dsw-alias-*`) —\n * never hashed class names of other packages. No layout shift: the panel is a\n * pure overlay.\n */\nexport const panelCss = `\n/* ---- Right-edge rail (always-visible minimap) --------------------------- */\n.dso-rail {\n position: fixed;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n z-index: 2147483000;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 3px;\n width: 30px;\n max-height: 55vh;\n padding: 8px 10px;\n overflow: hidden;\n cursor: pointer;\n}\n.dso-rail-more {\n flex: none;\n font-size: 9px;\n font-weight: 600;\n line-height: 10px;\n color: var(--dsw-alias-label-tertiary);\n font-variant-numeric: tabular-nums;\n}\n.dso-bar {\n flex: none;\n width: 10px;\n height: 6px;\n padding: 0;\n border: none;\n border-radius: 3px;\n background: color-mix(in srgb, var(--dsw-alias-label-tertiary) 45%, transparent);\n cursor: pointer;\n transition: background 0.12s, transform 0.12s;\n}\n.dso-bar:hover {\n background: var(--dsw-alias-state-business-primary);\n transform: scaleX(1.35);\n}\n.dso-rail:focus-visible,\n.dso-bar:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: 2px;\n}\n/* Clickability affordance: a hovered or pinned strip lights its bars up, so\n it reads as a control rather than as decoration. */\n.dso-rail:hover .dso-bar,\n.dso-rail[data-dso-open] .dso-bar {\n background: color-mix(in srgb, var(--dsw-alias-label-tertiary) 72%, transparent);\n}\n.dso-rail:hover .dso-bar:hover {\n background: var(--dsw-alias-state-business-primary);\n}\n\n/* ---- Hover-expanded preview panel --------------------------------------- */\n.dso-panel {\n position: fixed;\n top: 50%;\n right: 16px;\n transform: translateY(-50%);\n z-index: 2147483000;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: min(340px, calc(100vw - 24px));\n max-height: min(70vh, 600px);\n overflow: hidden;\n border: 1px solid var(--dsw-alias-line-normal);\n border-radius: 16px;\n background: color-mix(in srgb, var(--dsw-alias-bg-module-platform) 92%, transparent);\n backdrop-filter: blur(20px);\n box-shadow: 0 16px 48px color-mix(in srgb, var(--dsw-alias-label-primary) 18%, transparent);\n color: var(--dsw-alias-label-primary);\n animation: dso-panel-in 140ms ease-out;\n}\n/* A pinned panel (clicked open) keeps a defined edge, so it is obvious that it\n no longer collapses when the pointer leaves. */\n.dso-panel[data-dso-pinned] {\n border-color: var(--dsw-alias-state-business-primary);\n}\n@keyframes dso-panel-in {\n from { opacity: 0; transform: translateY(-50%) translateX(12px); }\n to { opacity: 1; transform: translateY(-50%) translateX(0); }\n}\n\n.dso-panel-header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 14px 10px;\n border-bottom: 1px solid var(--dsw-alias-line-normal);\n}\n.dso-panel-title {\n font-size: 14px;\n font-weight: 600;\n color: var(--dsw-alias-label-primary);\n}\n.dso-panel-count {\n flex: 1;\n font-size: 12px;\n color: var(--dsw-alias-label-tertiary);\n}\n.dso-panel-close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border: none;\n border-radius: 6px;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font-size: 16px;\n line-height: 1;\n cursor: pointer;\n transition: background 0.12s;\n}\n.dso-panel-close:hover { background: var(--dsw-alias-interactive-bg-hover-solid); }\n\n.dso-panel-close:focus-visible,\n.dso-search:focus-visible,\n.dso-row-main:focus-visible,\n.dso-copy:focus-visible,\n.dso-load-older:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: 2px;\n}\n\n.dso-search {\n margin: 10px 12px 4px;\n box-sizing: border-box;\n height: 30px;\n padding: 0 10px;\n border: 1px solid var(--dsw-alias-line-normal);\n border-radius: 8px;\n background: var(--dsw-alias-interactive-bg-hover-solid);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n outline: none;\n}\n.dso-search::placeholder { color: var(--dsw-alias-label-tertiary); }\n\n/* ---- Question list ------------------------------------------------------ */\n.dso-list {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 2px;\n padding: 6px;\n}\n/* Row container: two sibling buttons (jump + copy) — no nested interactive\n controls. Hover highlights the whole row. */\n.dso-row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px;\n border-radius: 10px;\n transition: background 0.12s;\n}\n.dso-row:hover { background: var(--dsw-alias-interactive-bg-hover-solid); }\n.dso-row-main {\n flex: 1;\n min-width: 0;\n display: flex;\n align-items: center;\n gap: 6px;\n height: 28px;\n padding: 2px 6px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n text-align: left;\n cursor: pointer;\n transition: background 0.12s;\n}\n.dso-row-main:hover { background: var(--dsw-alias-interactive-bg-hover-solid); }\n\n.dso-turn {\n flex: none;\n min-width: 26px;\n height: 16px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n background: var(--dsw-alias-bg-fill-business);\n color: var(--dsw-alias-label-on-fill);\n font-size: 10px;\n font-weight: 600;\n font-variant-numeric: tabular-nums;\n}\n/* Single-line truncation: shows the opening words of each question —\n anything longer simply ellipsizes (per user request). */\n.dso-text {\n flex: 1;\n min-width: 0;\n font-size: 13px;\n line-height: 18px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dso-time {\n flex: none;\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n color: var(--dsw-alias-label-tertiary);\n}\n.dso-steer {\n flex: none;\n padding: 0 6px;\n border: 1px solid var(--dsw-alias-line-normal);\n border-radius: 999px;\n font-size: 10px;\n color: var(--dsw-alias-label-secondary);\n}\n.dso-copy {\n flex: none;\n padding: 2px 6px;\n border: none;\n border-radius: 6px;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n font-size: 11px;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.12s, color 0.12s, background 0.12s;\n}\n.dso-row:hover .dso-copy,\n.dso-row:focus-within .dso-copy,\n.dso-copy:focus-visible { opacity: 1; }\n.dso-copy:hover { background: var(--dsw-alias-bg-fill-neutral); }\n.dso-copy.dso-copied { color: var(--dsw-alias-state-success); }\n\n.dso-empty {\n padding: 28px 16px;\n text-align: center;\n font-size: 13px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n/* ---- Jump failure notice ------------------------------------------------ */\n.dso-jump-failed {\n margin: 0;\n padding: 8px 14px;\n border-top: 1px solid var(--dsw-alias-line-normal);\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-state-warning, var(--dsw-alias-label-secondary));\n}\n\n/* ---- Footer / load older ------------------------------------------------ */\n.dso-footer {\n display: flex;\n justify-content: center;\n padding: 8px 12px 10px;\n border-top: 1px solid var(--dsw-alias-line-normal);\n}\n.dso-load-older {\n padding: 4px 14px;\n border: none;\n border-radius: 14px;\n background: var(--dsw-alias-interactive-bg-hover-solid);\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n font-size: 12px;\n cursor: pointer;\n}\n.dso-load-older:disabled { cursor: default; opacity: 0.6; }\n\n/* ---- Jump flash highlight ----------------------------------------------- */\n[data-dsh-outline-flash] {\n animation: dso-flash 1.8s ease-out;\n}\n@keyframes dso-flash {\n 0% {\n box-shadow: 0 0 0 0 color-mix(in srgb, var(--dsw-alias-state-business-primary) 50%, transparent);\n background-color: color-mix(in srgb, var(--dsw-alias-state-business-primary) 24%, transparent);\n }\n 70% {\n box-shadow: 0 0 0 6px transparent;\n background-color: color-mix(in srgb, var(--dsw-alias-state-business-primary) 8%, transparent);\n }\n 100% {\n box-shadow: 0 0 0 0 transparent;\n background-color: transparent;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dso-panel { animation: none; }\n .dso-bar { transition: none; }\n [data-dsh-outline-flash] { animation: none; }\n}\n`;\n/** Inject the style tag, owned by the client fiber (removed on dispose/HMR). */\nexport function injectStyle(ctx) {\n ctx.effect(() => {\n const tag = document.createElement('style');\n tag.dataset.plugin = 'dsh-conversation-outline';\n tag.dataset.pluginCss = 'dsh-conversation-outline/panel.css';\n tag.textContent = panelCss;\n document.head.appendChild(tag);\n return () => {\n tag.remove();\n };\n }, 'dsh-conversation-outline: panel css');\n}\n","import { OutlinePanel } from \"./OutlinePanel.js\";\nimport { NS, dictionaries } from \"./locales.js\";\nimport { injectStyle } from \"./styles.js\";\n/**\n * Client entry (implementation-spec §1.1/§2.4): the browser half of the\n * plugin. Cordis services this fiber waits for before apply() runs.\n */\nexport const inject = ['slots', 'sessions', 'locale'];\nexport function apply(ctx) {\n // Locale dictionaries — the typed register form (both shipped locales\n // required, keys compile-checked). The disposer is owned by the fiber, so\n // HMR removes the namespace on unload.\n ctx.effect(() => ctx.locale.register(NS, dictionaries), 'dsh-conversation-outline: locale');\n // Panel CSS as an HMR-safe <style data-plugin> tag (effect-owned).\n injectStyle(ctx);\n // Right-edge rail + hover panel in the frame-wide overlay layer.\n // slots.inject waits for the layout's declaration of `shell.overlay` and\n // routes the registration (and its unload cascade) through this fiber.\n // `locale: NS` gives the component the typed `t` seat; the inject factory\n // passes the sessions service face.\n ctx.slots.inject('shell.overlay', () => ctx.slots.register({\n name: 'shell.overlay',\n id: 'dsh-conversation-outline.rail',\n locale: NS,\n inject: () => ({ sessions: ctx.sessions }),\n }, OutlinePanel));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBA,SAAgB,mBAAmB,UAAU;GACzC,IAAI,aAAa,QAAQ,aAAa,KAAA,GAClC,OAAO,KAAA;GACX,IAAI,MAAM,QAAQ,SAAS,KAAK,KAAK,SAAS,UAAU,KAAA,GACpD,OAAO;IAAE,OAAO,SAAS;IAAO,OAAO,SAAS;GAAM;EAG9D;EACA,MAAM,oBAAoB;;;;;;EAM1B,SAAgB,oBAAoB,SAAS;GACzC,OAAO,QACF,KAAK,UAAU;IAChB,IAAI,MAAM,SAAS,QACf,OAAO,MAAM,QAAQ;IACzB,IAAI,MAAM,SAAS,SACf,OAAO;IACX,OAAO;GACX,CAAC,CAAC,CACG,KAAK,GAAG,CAAC,CACT,KAAK,CAAC,CACN,QAAQ,QAAQ,GAAG;EAC5B;;EAEA,SA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KAAK,YAAY,GAAG;IAC7B,aAAa;KACT,IAAI,OAAO;IACf;GACJ,GAAG,qCAAqC;EAC5C;;;;;;;EChUA,MAAa,SAAS;GAAC;GAAS;GAAY;EAAQ;EACpD,SAAgB,MAAM,KAAK;GAIvB,IAAI,aAAa,IAAI,OAAO,SAAS,IAAI,YAAY,GAAG,kCAAkC;GAE1F,YAAY,GAAG;GAMf,IAAI,MAAM,OAAO,uBAAuB,IAAI,MAAM,SAAS;IACvD,MAAM;IACN,IAAI;IACJ,QAAQ;IACR,eAAe,EAAE,UAAU,IAAI,SAAS;GAC5C,GAAG,YAAY,CAAC;EACpB"}
1
+ {"version":3,"file":"client.js","names":["_Fragment"],"sources":["client/outline.js","client/OutlinePanel.js","client/locales.js","client/styles.js","client/index.js"],"sourcesContent":["/**\n * Pure logic for the conversation outline (implementation-spec §2.3).\n *\n * Deliberately has NO DOM access and NO React imports so scripts/verify.mjs can\n * import it directly in Node from the tsc output (lib/client/outline.js) and\n * assert the derivations offline.\n *\n * Input shapes are structural \"lite\" views of the runtime snapshot types\n * (@deepseek-ai/dsh-client-runtime/client) — the real objects are assignable\n * to them, and Node can import this module without the browser type graph.\n */\n/**\n * Resolve a Chat store snapshot into the flow to walk.\n *\n * Never throws: a snapshot that has not produced `order` + `nodes` yet (or a\n * host that handed over something else entirely) yields `undefined`, so the\n * caller renders an empty rail instead of crashing its slot.\n */\nexport function resolveOutlineFlow(snapshot) {\n if (snapshot === null || snapshot === undefined)\n return undefined;\n if (Array.isArray(snapshot.order) && snapshot.nodes !== undefined) {\n return { order: snapshot.order, nodes: snapshot.nodes };\n }\n return undefined;\n}\nconst IMAGE_PLACEHOLDER = '[image]';\n/**\n * Flatten message content blocks into a single display string: text blocks are\n * joined, image blocks become a placeholder, and whitespace is trimmed and\n * collapsed.\n */\nexport function flattenQuestionText(content) {\n return content\n .map((block) => {\n if (block.type === 'text')\n return block.text ?? '';\n if (block.type === 'image')\n return IMAGE_PLACEHOLDER;\n return '';\n })\n .join(' ')\n .trim()\n .replace(/\\s+/g, ' ');\n}\n/** Turn number of a node location: step/turn → location.turn.turn, else undefined. */\nfunction turnOf(location) {\n if (!location)\n return undefined;\n if (location.kind === 'step' || location.kind === 'turn')\n return location.turn?.turn;\n return undefined;\n}\n/**\n * Walk the chat flow in order, keep user/steering nodes, skip empty text, and\n * produce chronological outline items (spec §2.3).\n */\nexport function collectQuestions(snapshot) {\n const flow = resolveOutlineFlow(snapshot);\n if (flow === undefined)\n return [];\n const items = [];\n for (const key of flow.order) {\n const node = flow.nodes.get(key);\n if (!node)\n continue;\n if (node.kind !== 'user' && node.kind !== 'steering')\n continue;\n const data = node.data;\n const text = flattenQuestionText(data?.content ?? []);\n if (!text)\n continue;\n items.push({\n key: node.key,\n kind: node.kind,\n seq: data?.seq ?? 0,\n time: data?.time ?? 0,\n turn: turnOf(node.location),\n text,\n });\n }\n return items;\n}\n/** Case-insensitive substring filter over the flattened question text. */\nexport function filterQuestions(items, query) {\n const q = query.trim().toLowerCase();\n if (!q)\n return items;\n return items.filter((item) => item.text.toLowerCase().includes(q));\n}\n/** Local `HH:MM` from a unix-ms timestamp (spec §2.3). */\nexport function formatTime(ms) {\n const d = new Date(ms);\n const hh = String(d.getHours()).padStart(2, '0');\n const mm = String(d.getMinutes()).padStart(2, '0');\n return `${hh}:${mm}`;\n}\n/** Attributes the chat flow renders a node's identity under. */\nconst JUMP_KEY_ATTRIBUTES = ['data-chat-anchor-key', 'data-chat-flow-key'];\n/**\n * Pure DOM predicate for the jump loop: is this row the target node?\n *\n * Exact match only, against either attribute the flow wrapper carries — the\n * platform's own anchor lookup uses `data-chat-anchor-key`, and its sibling\n * `data-chat-flow-key` holds the same value, so a row is still found when only\n * one of the two is present.\n */\nexport function isJumpTargetRow(row, key) {\n return JUMP_KEY_ATTRIBUTES.some((attribute) => row.getAttribute(attribute) === key);\n}\n","import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';\nimport { collectQuestions, filterQuestions, formatTime, isJumpTargetRow, } from \"./outline.js\";\n/**\n * Stable getSnapshot value while no session (or no feed) is current (uSES\n * contract): an empty flow, so the rail renders nothing instead of throwing on\n * a shape the host did not provide.\n */\nconst NO_FLOW = { order: [] };\nconst JUMP_HEADROOM = 96;\nconst JUMP_TIMEOUT_MS = 1500;\nconst FLASH_MS = 1900;\nconst COPIED_MS = 1500;\n/** Grace period before the hover panel collapses (lets the pointer travel). */\nconst COLLAPSE_DELAY_MS = 240;\n/** Rail capacity; older questions fold into the \"+N\" marker. */\nconst MAX_BARS = 60;\n/**\n * The conversation view's header tablist, scoped to the conversation root:\n * walk up from the scrollport's PARENT (the scrollport itself may contain\n * other tablists, e.g. the trajectory event-details tabs) and return the\n * nearest ancestor containing a `[role=\"tablist\"]`. Never falls back to a\n * document-wide query, so other tablists (trajectory event details,\n * settings, cordis source viewer) are not hit.\n */\nfunction findConversationTablist(scrollport) {\n let node = scrollport.parentElement;\n while (node) {\n const tablist = node.querySelector('[role=\"tablist\"]');\n if (tablist)\n return tablist;\n node = node.parentElement;\n }\n return null;\n}\n/** RAF that prunes itself from the tracking ref once it fires. */\nfunction scheduleRaf(rafRef, fn) {\n const id = requestAnimationFrame(() => {\n rafRef.current = rafRef.current.filter((x) => x !== id);\n fn();\n });\n rafRef.current.push(id);\n}\n/** Timeout that prunes itself from the tracking ref once it fires. */\nfunction scheduleTimeout(timeoutRef, fn, ms) {\n const id = window.setTimeout(() => {\n timeoutRef.current = timeoutRef.current.filter((x) => x !== id);\n fn();\n }, ms);\n timeoutRef.current.push(id);\n}\nexport function OutlinePanel({ sessions, resolveChatFeed, t, }) {\n // Current-session feed: the sessions service owns it (`ISessions.list`), so\n // subscribe to it here instead of taking a `useSessions` standard-kit prop —\n // 0.1.5-rc.2 removed that hook from `GlobalStandardProps`.\n const listSubscribe = useCallback((onChange) => sessions.list.subscribe(onChange), [sessions]);\n const listSnapshot = useCallback(() => sessions.list.getSnapshot(), [sessions]);\n const current = useSyncExternalStore(listSubscribe, listSnapshot).current;\n // One binding per session, shared by the session face and the Chat feed: the\n // binding is the identity `uiConversation.binding()` caches its per-session\n // target on, so both must be resolved from the same object.\n const binding = useMemo(() => (current ? sessions.binding(current) : undefined), [sessions, current]);\n const session = binding?.session;\n // Question flow: the session-scoped Chat store. History pagination lives on\n // the session face, so its two flags are merged in here.\n const chat = useMemo(() => resolveChatFeed(binding), [resolveChatFeed, binding]);\n const subscribe = useCallback((onChange) => (chat ? chat.subscribe(onChange) : () => { }), [chat]);\n const getSnapshot = useCallback(() => (chat ? chat.getSnapshot() : NO_FLOW), [chat]);\n const chatSnapshot = useSyncExternalStore(subscribe, getSnapshot);\n const snapshot = useMemo(() => ({\n ...chatSnapshot,\n hasMore: session?.getSnapshot?.().hasMore ?? false,\n loadingOlder: session?.getSnapshot?.().loadingOlder ?? false,\n }), [chatSnapshot, session]);\n // Two independent sources for the panel being open: `pinned` is a click\n // gesture (sticky until Escape / outside click / session change), `hovered`\n // is pointer presence over the rail or the panel. Deriving `open` from both\n // means a click on the rail opens the panel even when no hover event ever\n // fires (touch, synthetic/automation input, or a pointer that entered the\n // strip without crossing its boundary), and a hover preview still collapses\n // on its own once the pointer leaves.\n const [pinned, setPinned] = useState(false);\n const [hovered, setHovered] = useState(false);\n const open = pinned || hovered;\n const [query, setQuery] = useState('');\n const [copiedKey, setCopiedKey] = useState(null);\n // The question whose jump could not be completed; the panel says so instead\n // of failing silently (the row may sit outside the loaded history window).\n const [jumpFailed, setJumpFailed] = useState(null);\n const timeoutsRef = useRef([]);\n const rafsRef = useRef([]);\n const flashedRowRef = useRef(null);\n const collapseTimerRef = useRef(null);\n const railRef = useRef(null);\n const panelRef = useRef(null);\n // Cancel pending jump work (RAFs/timeouts), the flash highlight, and a\n // scheduled hover collapse.\n const clearPending = useCallback(() => {\n for (const id of rafsRef.current)\n window.cancelAnimationFrame(id);\n for (const id of timeoutsRef.current)\n window.clearTimeout(id);\n rafsRef.current = [];\n timeoutsRef.current = [];\n if (collapseTimerRef.current !== null) {\n window.clearTimeout(collapseTimerRef.current);\n collapseTimerRef.current = null;\n }\n if (flashedRowRef.current) {\n flashedRowRef.current.removeAttribute('data-dsh-outline-flash');\n flashedRowRef.current = null;\n }\n }, []);\n /** Close the panel from any trigger: drop the pin and the hover preview. */\n const closePanel = useCallback(() => {\n setPinned(false);\n setHovered(false);\n cancelCollapseRef.current();\n }, []);\n // Session change → cancel pending work and collapse (navigate closes the\n // panel, spec §2.1; a mid-jump poll must not target the stale session).\n useEffect(() => {\n clearPending();\n setPinned(false);\n setHovered(false);\n setJumpFailed(null);\n }, [current, clearPending]);\n // Escape closes the panel (hover-opened or click-pinned).\n useEffect(() => {\n if (!open)\n return;\n const onKey = (event) => {\n if (event.key === 'Escape')\n closePanel();\n };\n window.addEventListener('keydown', onKey);\n return () => window.removeEventListener('keydown', onKey);\n }, [open, closePanel]);\n // A click anywhere outside the rail and the panel releases a pin, so the\n // panel behaves like every other dismissible overlay on the page.\n useEffect(() => {\n if (!pinned)\n return;\n const onPointerDown = (event) => {\n const target = event.target;\n if (!(target instanceof Node))\n return;\n if (railRef.current?.contains(target) || panelRef.current?.contains(target))\n return;\n closePanel();\n };\n window.addEventListener('mousedown', onPointerDown);\n return () => window.removeEventListener('mousedown', onPointerDown);\n }, [pinned, closePanel]);\n // Unmount cleanup: cancel pending flash/copied timeouts, jump RAFs, collapse\n // timer, and the flash attribute.\n useEffect(() => clearPending, [clearPending]);\n const allItems = useMemo(() => collectQuestions(snapshot), [snapshot]);\n const items = useMemo(() => filterQuestions(allItems, query), [allItems, query]);\n const hasMore = snapshot?.hasMore ?? false;\n const loadingOlder = snapshot?.loadingOlder ?? false;\n // ---- open mechanics: click pins, hover previews, grace period between ---\n const cancelCollapse = useCallback(() => {\n if (collapseTimerRef.current !== null) {\n window.clearTimeout(collapseTimerRef.current);\n collapseTimerRef.current = null;\n }\n }, []);\n // `closePanel` above runs before this declaration; a ref keeps the two\n // callbacks independent of declaration order.\n const cancelCollapseRef = useRef(cancelCollapse);\n cancelCollapseRef.current = cancelCollapse;\n const scheduleCollapse = useCallback(() => {\n cancelCollapse();\n collapseTimerRef.current = window.setTimeout(() => {\n collapseTimerRef.current = null;\n // Only a preview collapses on its own: a pinned panel stays until it is\n // closed, and a pointer still inside the rail or the panel (Chromium\n // raises no further enter events while the pointer sits still) keeps the\n // preview up.\n if (railRef.current?.matches(':hover') || panelRef.current?.matches(':hover'))\n return;\n setHovered(false);\n }, COLLAPSE_DELAY_MS);\n }, [cancelCollapse]);\n /** Pointer entered the rail or the panel: cancel a pending collapse, preview. */\n const onEnter = useCallback(() => {\n cancelCollapse();\n setHovered(true);\n }, [cancelCollapse]);\n /** Pointer left: let the grace period decide, unless the panel is pinned. */\n const onLeave = useCallback(() => {\n if (pinned)\n return;\n scheduleCollapse();\n }, [pinned, scheduleCollapse]);\n /** A click on the rail (or any bar) opens the panel and keeps it open. */\n const togglePin = useCallback(() => {\n cancelCollapse();\n setPinned((value) => !value);\n setHovered(true);\n }, [cancelCollapse]);\n /** The panel's own controls: clicking inside never closes it. */\n const keepOpen = useCallback(() => {\n cancelCollapse();\n setHovered(true);\n }, [cancelCollapse]);\n /** Find the chat row for a node key (pure predicate over DOM rows). */\n const findRow = useCallback((key) => {\n // Exact match on either anchor attribute the chat flow renders for a node:\n // `data-chat-anchor-key` is the one the platform's own anchorElement() uses,\n // `data-chat-flow-key` is its sibling on the same wrapper. No guessing at\n // the key's internals — a wrong row is worse than a reported failure.\n const rows = document.querySelectorAll('[data-chat-anchor-key], [data-chat-flow-key]');\n for (const row of rows) {\n if (isJumpTargetRow(row, key))\n return row;\n }\n return null;\n }, []);\n /** Scroll the row into view (96px headroom) and flash a highlight. */\n const flashAndScroll = useCallback((row) => {\n const scrollport = row.closest('[data-conversation-scroll]') ?? document.querySelector('[data-conversation-scroll]');\n if (scrollport) {\n const flowTop = row.getBoundingClientRect().top - scrollport.getBoundingClientRect().top;\n const reduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n scrollport.scrollTo({\n top: scrollport.scrollTop + flowTop - JUMP_HEADROOM,\n behavior: reduced ? 'auto' : 'smooth',\n });\n }\n // A second jump within FLASH_MS: clear the previous row first.\n if (flashedRowRef.current && flashedRowRef.current !== row) {\n flashedRowRef.current.removeAttribute('data-dsh-outline-flash');\n }\n flashedRowRef.current = row;\n row.setAttribute('data-dsh-outline-flash', 'true');\n scheduleTimeout(timeoutsRef, () => {\n if (flashedRowRef.current === row) {\n row.removeAttribute('data-dsh-outline-flash');\n flashedRowRef.current = null;\n }\n }, FLASH_MS);\n }, []);\n /** Jump-to-message algorithm (spec §2.2). */\n const jumpTo = useCallback((key, label) => {\n // The conversation page must be mounted; abort silently otherwise.\n const scrollport = document.querySelector('[data-conversation-scroll]');\n if (!scrollport)\n return;\n setJumpFailed(null);\n // Ensure the Chat view is active: chat is order 0 — the FIRST tab of the\n // conversation-root tablist, when one exists (setView is idempotent).\n // A profile without extra views has no header tablist at all — that is\n // fine, the rows are already visible.\n const tablist = findConversationTablist(scrollport);\n if (tablist) {\n const firstTab = tablist.querySelector('button[role=\"tab\"]');\n if (firstTab)\n firstTab.click();\n }\n // Poll for the target row regardless of tablist presence — render timing\n // only; the row is guaranteed in the loaded window (it came from the\n // snapshot). Canceled on session change/unmount via clearPending.\n const deadline = Date.now() + JUMP_TIMEOUT_MS;\n const poll = () => {\n const row = findRow(key);\n if (row) {\n flashAndScroll(row);\n closePanel();\n return;\n }\n if (Date.now() < deadline) {\n scheduleRaf(rafsRef, poll);\n }\n else {\n // Never fail silently: the panel states what happened, and the\n // console keeps the key for bug reports.\n console.warn(t('jumpFailed'), { key });\n setJumpFailed(label ?? key);\n }\n };\n scheduleRaf(rafsRef, poll);\n }, [findRow, flashAndScroll, t, closePanel]);\n /** Copy a question's text (clipboard API with execCommand fallback). */\n const copyText = useCallback((text, key) => {\n const done = () => {\n setCopiedKey(key);\n scheduleTimeout(timeoutsRef, () => setCopiedKey((k) => (k === key ? null : k)), COPIED_MS);\n };\n const fallback = () => {\n try {\n const ta = document.createElement('textarea');\n ta.value = text;\n ta.setAttribute('readonly', '');\n ta.style.position = 'fixed';\n ta.style.opacity = '0';\n document.body.appendChild(ta);\n ta.select();\n document.execCommand('copy');\n ta.remove();\n done();\n }\n catch {\n // clipboard unavailable — ignore\n }\n };\n if (navigator.clipboard?.writeText) {\n navigator.clipboard.writeText(text).then(done, fallback);\n }\n else {\n fallback();\n }\n }, []);\n // No current session, or a session with nothing to outline → render nothing\n // (rail included). This is driven by the question list, not by the session's\n // `blank` flag: the flag belongs to the conversation snapshot, while the rail\n // is derived from the Chat flow, and a session whose nodes are not loaded yet\n // must not take the slot down. MUST stay below every hook (this overlay entry\n // stays mounted across session changes, so a conditional hook would crash\n // React — reviewer MUST-FIX #1).\n if (!current || !session || allItems.length === 0)\n return null;\n // Rail bars: chronological top→bottom, capped at MAX_BARS with the overflow\n // folded into a \"+N\" marker (the rail is a minimap, not the full list).\n const start = Math.max(0, allItems.length - MAX_BARS);\n const bars = allItems.slice(start);\n const overflow = start;\n return (_jsxs(_Fragment, { children: [_jsxs(\"div\", { ref: railRef, className: \"dso-rail\", role: \"group\", \"aria-label\": t('title'), tabIndex: 0, onMouseEnter: onEnter, onMouseLeave: onLeave, onFocus: onEnter, onBlur: onLeave, onClick: (event) => {\n // Any click on the strip pins the panel open — the container itself,\n // its padding, or the \"+N\" marker. Bars stop propagation and reach\n // the same pin through the shared jump gesture below.\n if (event.target === event.currentTarget || event.target instanceof HTMLSpanElement) {\n togglePin();\n }\n }, onKeyDown: (event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n togglePin();\n }\n }, \"data-dso-open\": open ? 'true' : undefined, children: [overflow > 0 && (_jsxs(\"span\", { className: \"dso-rail-more\", \"aria-label\": t('moreBars', { count: overflow }), children: [\"+\", overflow] })), bars.map((item, index) => (_jsx(\"button\", { type: \"button\", className: \"dso-bar\", \"aria-label\": t('barLabel', { n: start + index + 1 }), onClick: (event) => {\n event.stopPropagation();\n // The bar's own job is the jump; the panel comes up pinned first\n // so a click always has a visible effect, then jumpTo collapses\n // it once the row is on screen.\n setPinned(true);\n setHovered(true);\n jumpTo(item.key, item.text);\n } }, item.key)))] }), open && (_jsxs(\"div\", { ref: panelRef, className: \"dso-panel\", role: \"region\", \"aria-label\": t('title'), \"data-dso-pinned\": pinned ? 'true' : undefined, onMouseEnter: onEnter, onMouseLeave: onLeave, onFocus: onEnter, onBlur: onLeave, onMouseDown: keepOpen, children: [_jsxs(\"header\", { className: \"dso-panel-header\", children: [_jsx(\"span\", { className: \"dso-panel-title\", children: t('title') }), _jsx(\"span\", { className: \"dso-panel-count\", children: t('count', { count: allItems.length }) }), _jsx(\"button\", { type: \"button\", className: \"dso-panel-close\", \"aria-label\": t('close'), onClick: closePanel, children: \"\\u00D7\" })] }), _jsx(\"input\", { className: \"dso-search\", type: \"search\", value: query, placeholder: t('searchPlaceholder'), \"aria-label\": t('searchPlaceholder'), onChange: (event) => setQuery(event.target.value) }), _jsx(\"div\", { className: \"dso-list\", children: items.length === 0 ? (_jsx(\"div\", { className: \"dso-empty\", children: t('empty') })) : (items.map((item) => (_jsxs(\"div\", { className: \"dso-row\", children: [_jsxs(\"button\", { type: \"button\", className: \"dso-row-main\", onClick: () => jumpTo(item.key, item.text), children: [_jsx(\"span\", { className: \"dso-turn\", children: item.turn !== undefined ? `#${item.turn}` : '' }), _jsx(\"span\", { className: \"dso-text\", children: item.text }), item.kind === 'steering' && _jsx(\"span\", { className: \"dso-steer\", children: t('steerTag') }), _jsx(\"span\", { className: \"dso-time\", children: formatTime(item.time) })] }), _jsx(\"button\", { type: \"button\", className: copiedKey === item.key ? 'dso-copy dso-copied' : 'dso-copy', \"aria-label\": copiedKey === item.key ? t('copied') : t('copy'), onClick: () => copyText(item.text, item.key), children: copiedKey === item.key ? t('copied') : t('copy') })] }, item.key)))) }), jumpFailed !== null && (_jsx(\"p\", { className: \"dso-jump-failed\", role: \"status\", \"data-dso-jump-failed\": \"true\", children: t('jumpFailed') })), hasMore && (_jsx(\"footer\", { className: \"dso-footer\", children: _jsx(\"button\", { type: \"button\", className: \"dso-load-older\", disabled: loadingOlder, onClick: () => {\n void session.loadOlder();\n }, children: loadingOlder ? t('loadingOlder') : t('loadOlder') }) }))] }))] }));\n}\n","export const NS = 'dsh-conversation-outline';\nexport const zh = {\n title: '会话大纲',\n count: '{count} 个问题',\n searchPlaceholder: '搜索问题…',\n empty: '当前会话还没有问题',\n loadOlder: '加载更早',\n loadingOlder: '加载中…',\n copy: '复制',\n copied: '已复制',\n steerTag: '追问',\n close: '关闭',\n jumpFailed: '跳转失败:未找到对应消息',\n barLabel: '跳到第 {n} 个问题',\n moreBars: '还有 {count} 个更早的问题',\n};\nexport const en = {\n title: 'Outline',\n count: '{count} questions',\n searchPlaceholder: 'Search questions…',\n empty: 'No questions in this conversation yet',\n loadOlder: 'Load older',\n loadingOlder: 'Loading…',\n copy: 'Copy',\n copied: 'Copied',\n steerTag: 'steer',\n close: 'Close',\n jumpFailed: 'Jump failed: target message not found',\n barLabel: 'Jump to question {n}',\n moreBars: '{count} more earlier questions',\n};\nexport const dictionaries = { zh, en };\n","/**\n * Outline rail + hover panel CSS (implementation-spec §1.8/§2.1, revised):\n * a thin right-edge rail (conversation minimap) that is always visible while\n * the session has questions, and a preview panel that expands on hover.\n * Plain CSS string injected via an HMR-safe\n * `<style data-plugin=\"dsh-conversation-outline\" data-plugin-css=\"...\">` tag.\n * Stable prefixed class names (`dso_*`), DSH theme vars (`--dsw-alias-*`) —\n * never hashed class names of other packages. No layout shift: the panel is a\n * pure overlay.\n */\nexport const panelCss = `\n/* ---- Right-edge rail (always-visible minimap) --------------------------- */\n.dso-rail {\n position: fixed;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n z-index: 2147483000;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 3px;\n width: 30px;\n max-height: 55vh;\n padding: 8px 10px;\n overflow: hidden;\n cursor: pointer;\n}\n.dso-rail-more {\n flex: none;\n font-size: 9px;\n font-weight: 600;\n line-height: 10px;\n color: var(--dsw-alias-label-tertiary);\n font-variant-numeric: tabular-nums;\n}\n.dso-bar {\n flex: none;\n width: 10px;\n height: 6px;\n padding: 0;\n border: none;\n border-radius: 3px;\n background: color-mix(in srgb, var(--dsw-alias-label-tertiary) 45%, transparent);\n cursor: pointer;\n transition: background 0.12s, transform 0.12s;\n}\n.dso-bar:hover {\n background: var(--dsw-alias-state-business-primary);\n transform: scaleX(1.35);\n}\n.dso-rail:focus-visible,\n.dso-bar:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: 2px;\n}\n/* Clickability affordance: a hovered or pinned strip lights its bars up, so\n it reads as a control rather than as decoration. */\n.dso-rail:hover .dso-bar,\n.dso-rail[data-dso-open] .dso-bar {\n background: color-mix(in srgb, var(--dsw-alias-label-tertiary) 72%, transparent);\n}\n.dso-rail:hover .dso-bar:hover {\n background: var(--dsw-alias-state-business-primary);\n}\n\n/* ---- Hover-expanded preview panel --------------------------------------- */\n.dso-panel {\n position: fixed;\n top: 50%;\n right: 16px;\n transform: translateY(-50%);\n z-index: 2147483000;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: min(340px, calc(100vw - 24px));\n max-height: min(70vh, 600px);\n overflow: hidden;\n border: 1px solid var(--dsw-alias-line-normal);\n border-radius: 16px;\n background: color-mix(in srgb, var(--dsw-alias-bg-module-platform) 92%, transparent);\n backdrop-filter: blur(20px);\n box-shadow: 0 16px 48px color-mix(in srgb, var(--dsw-alias-label-primary) 18%, transparent);\n color: var(--dsw-alias-label-primary);\n animation: dso-panel-in 140ms ease-out;\n}\n/* A pinned panel (clicked open) keeps a defined edge, so it is obvious that it\n no longer collapses when the pointer leaves. */\n.dso-panel[data-dso-pinned] {\n border-color: var(--dsw-alias-state-business-primary);\n}\n@keyframes dso-panel-in {\n from { opacity: 0; transform: translateY(-50%) translateX(12px); }\n to { opacity: 1; transform: translateY(-50%) translateX(0); }\n}\n\n.dso-panel-header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 14px 10px;\n border-bottom: 1px solid var(--dsw-alias-line-normal);\n}\n.dso-panel-title {\n font-size: 14px;\n font-weight: 600;\n color: var(--dsw-alias-label-primary);\n}\n.dso-panel-count {\n flex: 1;\n font-size: 12px;\n color: var(--dsw-alias-label-tertiary);\n}\n.dso-panel-close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border: none;\n border-radius: 6px;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font-size: 16px;\n line-height: 1;\n cursor: pointer;\n transition: background 0.12s;\n}\n.dso-panel-close:hover { background: var(--dsw-alias-interactive-bg-hover-solid); }\n\n.dso-panel-close:focus-visible,\n.dso-search:focus-visible,\n.dso-row-main:focus-visible,\n.dso-copy:focus-visible,\n.dso-load-older:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: 2px;\n}\n\n.dso-search {\n margin: 10px 12px 4px;\n box-sizing: border-box;\n height: 30px;\n padding: 0 10px;\n border: 1px solid var(--dsw-alias-line-normal);\n border-radius: 8px;\n background: var(--dsw-alias-interactive-bg-hover-solid);\n color: var(--dsw-alias-label-primary);\n font: inherit;\n font-size: 12px;\n outline: none;\n}\n.dso-search::placeholder { color: var(--dsw-alias-label-tertiary); }\n\n/* ---- Question list ------------------------------------------------------ */\n.dso-list {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 2px;\n padding: 6px;\n}\n/* Row container: two sibling buttons (jump + copy) — no nested interactive\n controls. Hover highlights the whole row. */\n.dso-row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px;\n border-radius: 10px;\n transition: background 0.12s;\n}\n.dso-row:hover { background: var(--dsw-alias-interactive-bg-hover-solid); }\n.dso-row-main {\n flex: 1;\n min-width: 0;\n display: flex;\n align-items: center;\n gap: 6px;\n height: 28px;\n padding: 2px 6px;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font: inherit;\n text-align: left;\n cursor: pointer;\n transition: background 0.12s;\n}\n.dso-row-main:hover { background: var(--dsw-alias-interactive-bg-hover-solid); }\n\n.dso-turn {\n flex: none;\n min-width: 26px;\n height: 16px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n background: var(--dsw-alias-bg-fill-business);\n color: var(--dsw-alias-label-on-fill);\n font-size: 10px;\n font-weight: 600;\n font-variant-numeric: tabular-nums;\n}\n/* Single-line truncation: shows the opening words of each question —\n anything longer simply ellipsizes (per user request). */\n.dso-text {\n flex: 1;\n min-width: 0;\n font-size: 13px;\n line-height: 18px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dso-time {\n flex: none;\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n color: var(--dsw-alias-label-tertiary);\n}\n.dso-steer {\n flex: none;\n padding: 0 6px;\n border: 1px solid var(--dsw-alias-line-normal);\n border-radius: 999px;\n font-size: 10px;\n color: var(--dsw-alias-label-secondary);\n}\n.dso-copy {\n flex: none;\n padding: 2px 6px;\n border: none;\n border-radius: 6px;\n background: transparent;\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n font-size: 11px;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.12s, color 0.12s, background 0.12s;\n}\n.dso-row:hover .dso-copy,\n.dso-row:focus-within .dso-copy,\n.dso-copy:focus-visible { opacity: 1; }\n.dso-copy:hover { background: var(--dsw-alias-bg-fill-neutral); }\n.dso-copy.dso-copied { color: var(--dsw-alias-state-success); }\n\n.dso-empty {\n padding: 28px 16px;\n text-align: center;\n font-size: 13px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n/* ---- Jump failure notice ------------------------------------------------ */\n.dso-jump-failed {\n margin: 0;\n padding: 8px 14px;\n border-top: 1px solid var(--dsw-alias-line-normal);\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-state-warning, var(--dsw-alias-label-secondary));\n}\n\n/* ---- Footer / load older ------------------------------------------------ */\n.dso-footer {\n display: flex;\n justify-content: center;\n padding: 8px 12px 10px;\n border-top: 1px solid var(--dsw-alias-line-normal);\n}\n.dso-load-older {\n padding: 4px 14px;\n border: none;\n border-radius: 14px;\n background: var(--dsw-alias-interactive-bg-hover-solid);\n color: var(--dsw-alias-label-secondary);\n font: inherit;\n font-size: 12px;\n cursor: pointer;\n}\n.dso-load-older:disabled { cursor: default; opacity: 0.6; }\n\n/* ---- Jump flash highlight ----------------------------------------------- */\n[data-dsh-outline-flash] {\n animation: dso-flash 1.8s ease-out;\n}\n@keyframes dso-flash {\n 0% {\n box-shadow: 0 0 0 0 color-mix(in srgb, var(--dsw-alias-state-business-primary) 50%, transparent);\n background-color: color-mix(in srgb, var(--dsw-alias-state-business-primary) 24%, transparent);\n }\n 70% {\n box-shadow: 0 0 0 6px transparent;\n background-color: color-mix(in srgb, var(--dsw-alias-state-business-primary) 8%, transparent);\n }\n 100% {\n box-shadow: 0 0 0 0 transparent;\n background-color: transparent;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dso-panel { animation: none; }\n .dso-bar { transition: none; }\n [data-dsh-outline-flash] { animation: none; }\n}\n`;\n/** Inject the style tag, owned by the client fiber (removed on dispose/HMR). */\nexport function injectStyle(ctx) {\n ctx.effect(() => {\n const tag = document.createElement('style');\n tag.dataset.plugin = 'dsh-conversation-outline';\n tag.dataset.pluginCss = 'dsh-conversation-outline/panel.css';\n tag.textContent = panelCss;\n document.head.appendChild(tag);\n return () => {\n tag.remove();\n };\n }, 'dsh-conversation-outline: panel css');\n}\n","import { OutlinePanel } from \"./OutlinePanel.js\";\nimport { NS, dictionaries } from \"./locales.js\";\nimport { injectStyle } from \"./styles.js\";\n/**\n * Client entry (implementation-spec §1.1/§2.4): the browser half of the\n * plugin. Cordis services this fiber waits for before apply() runs.\n *\n * `uiConversation` is declared here on purpose: cordis guards `ctx` with a\n * Proxy that THROWS on an undeclared service read, and the rail reaches the\n * session's Chat store through it. Reading it off another context (e.g.\n * `binding.ctx.uiConversation`) is not allowed even after declaring it — the\n * guard is per-context, so `apply` captures it from its own ctx below.\n */\nexport const inject = ['slots', 'sessions', 'locale', 'uiConversation'];\n/**\n * The conversation service captured from this plugin's own context. Set in\n * `apply`; `undefined` only before activation, which the resolver tolerates.\n */\nlet pluginUiConversation;\nexport function apply(ctx) {\n pluginUiConversation = ctx.uiConversation;\n // Locale dictionaries — the typed register form (both shipped locales\n // required, keys compile-checked). The disposer is owned by the fiber, so\n // HMR removes the namespace on unload.\n ctx.effect(() => ctx.locale.register(NS, dictionaries), 'dsh-conversation-outline: locale');\n // Panel CSS as an HMR-safe <style data-plugin> tag (effect-owned).\n injectStyle(ctx);\n // Right-edge rail + hover panel in the frame-wide overlay layer.\n // slots.inject waits for the layout's declaration of `shell.overlay` and\n // routes the registration (and its unload cascade) through this fiber.\n // `locale: NS` gives the component the typed `t` seat; the inject factory\n // passes the services the component reads.\n ctx.slots.inject('shell.overlay', () => ctx.slots.register({\n name: 'shell.overlay',\n id: 'dsh-conversation-outline.rail',\n locale: NS,\n inject: () => ({ sessions: ctx.sessions, resolveChatFeed }),\n }, OutlinePanel));\n}\n/**\n * Resolve one session binding's Chat feed through the conversation service.\n *\n * Returns `undefined` for every failure mode — no service (host without\n * ui-conversation), no binding (no current session), no `chat` target — so the\n * rail renders nothing instead of throwing inside its slot. Throwing here is\n * especially costly: the slot error boundary swallows it and the plugin simply\n * disappears with no visible error.\n */\nexport function resolveChatFeed(binding) {\n if (binding === null || binding === undefined)\n return undefined;\n return pluginUiConversation?.binding?.(binding)?.target?.('chat');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBA,SAAgB,mBAAmB,UAAU;GACzC,IAAI,aAAa,QAAQ,aAAa,KAAA,GAClC,OAAO,KAAA;GACX,IAAI,MAAM,QAAQ,SAAS,KAAK,KAAK,SAAS,U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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkTxB,SAAgB,YAAY,KAAK;GAC7B,IAAI,aAAa;IACb,MAAM,MAAM,SAAS,cAAc,OAAO;IAC1C,IAAI,QAAQ,SAAS;IACrB,IAAI,QAAQ,YAAY;IACxB,IAAI,cAAc;IAClB,SAAS,KAAK,YAAY,GAAG;IAC7B,aAAa;KACT,IAAI,OAAO;IACf;GACJ,GAAG,qCAAqC;EAC5C;;;;;;;;;;;;;EC1TA,MAAa,SAAS;GAAC;GAAS;GAAY;GAAU;EAAgB;;;;;EAKtE,IAAI;EACJ,SAAgB,MAAM,KAAK;GACvB,uBAAuB,IAAI;GAI3B,IAAI,aAAa,IAAI,OAAO,SAAS,IAAI,YAAY,GAAG,kCAAkC;GAE1F,YAAY,GAAG;GAMf,IAAI,MAAM,OAAO,uBAAuB,IAAI,MAAM,SAAS;IACvD,MAAM;IACN,IAAI;IACJ,QAAQ;IACR,eAAe;KAAE,UAAU,IAAI;KAAU;IAAgB;GAC7D,GAAG,YAAY,CAAC;EACpB;;;;;;;;;;EAUA,SAAgB,gBAAgB,SAAS;GACrC,IAAI,YAAY,QAAQ,YAAY,KAAA,GAChC,OAAO,KAAA;GACX,OAAO,sBAAsB,UAAU,OAAO,CAAC,EAAE,SAAS,MAAM;EACpE"}
@@ -2,7 +2,7 @@ import type { ReactElement } from 'react';
2
2
  import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots';
3
3
  import type { ISessions } from '@deepseek-ai/dsh-api-session-controller/client';
4
4
  import { NS } from './locales.ts';
5
- import type { OutlineSnapshotLike } from './outline.ts';
5
+ import type { OutlineChatFeed } from './outline.ts';
6
6
  /**
7
7
  * Conversation-outline rail + hover panel (implementation-spec §2.1/§2.2,
8
8
  * revised per user feedback): NO top-right badge — instead a thin, always-
@@ -20,32 +20,17 @@ import type { OutlineSnapshotLike } from './outline.ts';
20
20
  export interface OutlinePanelProps {
21
21
  /**
22
22
  * The sessions service face, injected by the registration: resolves the
23
- * binding (its `.session` face carries pagination) and, through its context,
24
- * the session's Chat store.
23
+ * session binding whose `.session` face carries history pagination.
25
24
  */
26
25
  sessions: ISessions;
26
+ /**
27
+ * Chat-feed resolver injected by the registration. It closes over the
28
+ * conversation service captured from the plugin's OWN context, because cordis
29
+ * refuses service reads on a foreign context and throws on undeclared ones.
30
+ * Tolerates `undefined` (no current session) by yielding `undefined`.
31
+ */
32
+ resolveChatFeed: (binding: unknown) => OutlineChatFeed | undefined;
27
33
  /** Typed translate seat for our namespace (declared via `locale: NS`). */
28
34
  t: TranslateNS<typeof NS>;
29
35
  }
30
- /** One observable Chat source: props read through uSES, updates pushed. */
31
- export interface OutlineChatFeed {
32
- getSnapshot: () => OutlineSnapshotLike;
33
- subscribe: (onChange: () => void) => () => void;
34
- }
35
- /**
36
- * Resolve one observable Chat source out of a session binding.
37
- *
38
- * The Chat node graph is a session-scoped store, reached exactly the way
39
- * `@deepseek-ai/dsh-client-ui-chat` reaches it:
40
- *
41
- * ```js
42
- * ctx.uiConversation.binding(binding).target('chat') // { getSnapshot, subscribe }
43
- * ```
44
- *
45
- * Reading the provider off `binding.ctx` (rather than the root context) keeps
46
- * this correct under any bus arrangement; a host that does not offer the
47
- * service yields `undefined`, and the rail then renders nothing instead of
48
- * crashing the slot.
49
- */
50
- export declare function resolveChatFeed(binding: unknown): OutlineChatFeed | undefined;
51
- export declare function OutlinePanel({ sessions, t, }: OutlinePanelProps): ReactElement | null;
36
+ export declare function OutlinePanel({ sessions, resolveChatFeed, t, }: OutlinePanelProps): ReactElement | null;
@@ -1,7 +1,30 @@
1
1
  import type { Context as ClientContext } from '@deepseek-ai/cordis';
2
+ import type { OutlineChatFeed } from './outline.ts';
2
3
  /**
3
4
  * Client entry (implementation-spec §1.1/§2.4): the browser half of the
4
5
  * plugin. Cordis services this fiber waits for before apply() runs.
6
+ *
7
+ * `uiConversation` is declared here on purpose: cordis guards `ctx` with a
8
+ * Proxy that THROWS on an undeclared service read, and the rail reaches the
9
+ * session's Chat store through it. Reading it off another context (e.g.
10
+ * `binding.ctx.uiConversation`) is not allowed even after declaring it — the
11
+ * guard is per-context, so `apply` captures it from its own ctx below.
5
12
  */
6
13
  export declare const inject: string[];
14
+ /** Structural face of the conversation service the rail needs (no value import). */
15
+ export interface UiConversationLike {
16
+ binding?: (source: unknown) => {
17
+ target?: (name: string) => unknown;
18
+ } | undefined;
19
+ }
7
20
  export declare function apply(ctx: ClientContext): void;
21
+ /**
22
+ * Resolve one session binding's Chat feed through the conversation service.
23
+ *
24
+ * Returns `undefined` for every failure mode — no service (host without
25
+ * ui-conversation), no binding (no current session), no `chat` target — so the
26
+ * rail renders nothing instead of throwing inside its slot. Throwing here is
27
+ * especially costly: the slot error boundary swallows it and the plugin simply
28
+ * disappears with no visible error.
29
+ */
30
+ export declare function resolveChatFeed(binding: unknown): OutlineChatFeed | undefined;
@@ -73,6 +73,14 @@ export interface OutlineSnapshotLike {
73
73
  /** The session face is paging older history right now. */
74
74
  loadingOlder?: boolean | undefined;
75
75
  }
76
+ /**
77
+ * One observable Chat source: the rail reads it through `useSyncExternalStore`
78
+ * (reference-stable snapshots) and receives change notifications through it.
79
+ */
80
+ export interface OutlineChatFeed {
81
+ getSnapshot: () => OutlineSnapshotLike;
82
+ subscribe: (onChange: () => void) => () => void;
83
+ }
76
84
  /** The node flow plus its index, after validating the store snapshot. */
77
85
  export interface OutlineFlow {
78
86
  order: readonly string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chestnut23/dsh-conversation-outline",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Codex-style conversation outline for DeepSeek Harness: a floating panel listing every user question in the current conversation with search, load-older and click-to-jump (scroll + highlight). Bilingual zh-CN / en.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -45,7 +45,8 @@
45
45
  "build": "tsc -p tsconfig.json && tsc -p tsconfig.client.json && tsdown",
46
46
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit",
47
47
  "verify": "node scripts/verify.mjs",
48
- "prepublishOnly": "pnpm build && pnpm verify"
48
+ "prepublishOnly": "pnpm build && pnpm verify && pnpm test:dom",
49
+ "test:dom": "node scripts/dom-smoke.mjs"
49
50
  },
50
51
  "peerDependencies": {
51
52
  "react": "^18.2.0"
@@ -56,12 +57,14 @@
56
57
  "@deepseek-ai/dsh-client-locale": "0.1.5-rc.2",
57
58
  "@deepseek-ai/dsh-client-store": "0.1.5-rc.2",
58
59
  "@deepseek-ai/dsh-client-ui-chat": "0.1.5-rc.2",
60
+ "@deepseek-ai/dsh-client-ui-conversation": "0.1.5-rc.2",
59
61
  "@deepseek-ai/dsh-client-ui-layout": "0.1.5-rc.2",
60
62
  "@deepseek-ai/dsh-client-ui-renderer": "0.1.5-rc.2",
61
63
  "@deepseek-ai/dsh-client-ui-slots": "0.1.5-rc.2",
62
64
  "@types/node": "^22.0.0",
63
65
  "@types/react": "~18.3.1",
64
66
  "@types/react-dom": "^19.2.4",
67
+ "jsdom": "^30.0.1",
65
68
  "lightningcss": "^1.33.0",
66
69
  "react": "^18.2.0",
67
70
  "react-dom": "^18.2.0",