@chestnut23/dsh-conversation-outline 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/README.zh.md +7 -1
- package/docs/troubleshooting.md +30 -0
- package/lib/client/OutlinePanel.js +54 -15
- package/lib/client/outline.js +24 -2
- package/lib/client.js +62 -8
- package/lib/client.js.map +1 -1
- package/lib/types/client/OutlinePanel.d.ts +36 -6
- package/lib/types/client/outline.d.ts +46 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ dsh plugin --profile web list
|
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
Upgrade with the same `add` command (optionally pin a version:
|
|
79
|
-
`@chestnut23/dsh-conversation-outline@0.1.
|
|
79
|
+
`@chestnut23/dsh-conversation-outline@0.1.3`).
|
|
80
80
|
|
|
81
81
|
## Usage
|
|
82
82
|
|
|
@@ -102,6 +102,14 @@ pnpm build # tsc(host) → tsc(client) → tsdown bundles lib/client.js
|
|
|
102
102
|
pnpm verify # offline smoke: manifest/exports/patch/bundle shape + pure-logic asserts
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
+
`pnpm typecheck` needs `lib/types/**` from the `@deepseek-ai/*` packages. Some DSH
|
|
106
|
+
installations ship those packages **without** declaration files (the Electron bundle
|
|
107
|
+
prunes them), and the npm `rc` channels publish a reduced type surface — in that case
|
|
108
|
+
typecheck reports missing modules while the build and runtime are unaffected. The
|
|
109
|
+
supported fix is to run against a DSH source checkout (or a profile whose
|
|
110
|
+
`@deepseek-ai/*` links resolve to one); `pnpm verify` covers the contract-shaped logic
|
|
111
|
+
either way.
|
|
112
|
+
|
|
105
113
|
Client-only changes hot-reload: `pnpm exec tsdown --watch` rewrites `lib/client.js`, and
|
|
106
114
|
the DSH client HMR chain (or a plain page refresh) picks it up. Host/manifest changes
|
|
107
115
|
need a service restart. Scratch-profile testing recipe:
|
package/README.zh.md
CHANGED
|
@@ -71,7 +71,7 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
71
71
|
dsh plugin --profile web list
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
升级用同一条 `add` 命令(可钉版本:`@chestnut23/dsh-conversation-outline@0.1.
|
|
74
|
+
升级用同一条 `add` 命令(可钉版本:`@chestnut23/dsh-conversation-outline@0.1.3`)。
|
|
75
75
|
|
|
76
76
|
## 使用
|
|
77
77
|
|
|
@@ -94,6 +94,12 @@ pnpm build # tsc(host) → tsc(client) → tsdown 打包 lib/client.js
|
|
|
94
94
|
pnpm verify # 离线冒烟:manifest/exports/patch/产物形状 + 纯逻辑断言
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
+
`pnpm typecheck` 依赖 `@deepseek-ai/*` 包里的 `lib/types/**`。部分安装形态下这些包
|
|
98
|
+
**不带声明文件**(Electron 内置副本会裁掉),npm 的 rc 通道发布的类型面也偏薄——这时
|
|
99
|
+
typecheck 会报「找不到模块」,但**不影响构建与运行时**。正规做法是让 profile 里的
|
|
100
|
+
`@deepseek-ai/*` 指向 DSH 源码 checkout;无论类型环境如何,`pnpm verify` 都会覆盖
|
|
101
|
+
与宿主契约相关的逻辑断言。
|
|
102
|
+
|
|
97
103
|
纯客户端改动可热更新:`pnpm exec tsdown --watch` 持续重写 `lib/client.js`,DSH 的客户端
|
|
98
104
|
HMR 链(或简单刷新页面)即可生效。host / manifest 改动需要重启服务。scratch profile
|
|
99
105
|
测试配方:[docs/implementation-spec.md §4.2](docs/implementation-spec.md)。
|
package/docs/troubleshooting.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Troubleshooting
|
|
2
2
|
|
|
3
|
+
## The rail is missing entirely, and the console shows a slot error
|
|
4
|
+
|
|
5
|
+
Since 0.1.3 the plugin reads the Chat node graph from the session-scoped Chat store
|
|
6
|
+
(`uiConversation…target('chat')`), which is where DSH ≥ 0.1.5-rc.2 keeps it, and falls
|
|
7
|
+
back to `ConversationSnapshot.chat` for older builds.
|
|
8
|
+
|
|
9
|
+
Before 0.1.3 the plugin read `snapshot.chat` unconditionally. On DSH versions that no
|
|
10
|
+
longer carry it, that threw on every render and the shell's slot error boundary replaced
|
|
11
|
+
the whole overlay entry with an empty `[data-slot-error="shell.overlay"]` div — the rail
|
|
12
|
+
simply never appeared, with no visible error:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
TypeError: can't access property "order", snapshot.chat is undefined
|
|
16
|
+
slot entry crashed in 'shell.overlay'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Fix: update the plugin to **0.1.3 or later**. To confirm what your host is running:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
dsh --version # the CLI/app version
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
If you are on an older host and cannot update, pin the plugin to `0.1.2` (that release
|
|
26
|
+
still expects the nested `chat` object). Do not mix: 0.1.3 works on both generations.
|
|
27
|
+
|
|
28
|
+
Note: on a host that has its own turn navigation rail, that built-in rail (one tick per
|
|
29
|
+
turn, dark bar = current turn) sits in the same edge and can be mistaken for this
|
|
30
|
+
plugin's rail. The plugin's rail is the one whose hover/click opens a panel with a search
|
|
31
|
+
box and a question list.
|
|
32
|
+
|
|
3
33
|
## I installed but see nothing
|
|
4
34
|
|
|
5
35
|
1. **Restart the DSH Web service** — the plugin roster is cached at boot. Installing
|
|
@@ -1,8 +1,39 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore, } from 'react';
|
|
3
3
|
import { collectQuestions, filterQuestions, formatTime, isJumpTargetRow, } from "./outline.js";
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Stable getSnapshot value while no session (or no feed) is current (uSES
|
|
6
|
+
* contract): an empty flow, so the rail renders nothing instead of throwing on
|
|
7
|
+
* a shape the host did not provide.
|
|
8
|
+
*/
|
|
9
|
+
const NO_FLOW = { order: [] };
|
|
10
|
+
/**
|
|
11
|
+
* Resolve one observable Chat source out of a session binding for the two
|
|
12
|
+
* contract generations DSH shipped:
|
|
13
|
+
*
|
|
14
|
+
* - `binding.ctx.uiConversation.binding(binding).target('chat')` — 0.1.5-rc.2
|
|
15
|
+
* and later, where the Chat node graph is a session-scoped store and
|
|
16
|
+
* `ConversationSnapshot` no longer carries `chat`;
|
|
17
|
+
* - the session face itself — earlier builds, whose snapshot still exposes
|
|
18
|
+
* `chat` (and which `resolveOutlineFlow` prefers when it is present).
|
|
19
|
+
*
|
|
20
|
+
* Reading the provider off `binding.ctx` rather than the root context keeps it
|
|
21
|
+
* correct under any bus arrangement, and a host without the service degrades to
|
|
22
|
+
* the legacy face instead of crashing the slot.
|
|
23
|
+
*/
|
|
24
|
+
export function resolveChatFeed(session, binding) {
|
|
25
|
+
if (session === undefined || binding === undefined)
|
|
26
|
+
return undefined;
|
|
27
|
+
const uiConversation = binding.ctx?.uiConversation;
|
|
28
|
+
const chat = uiConversation?.binding?.(session)?.target?.('chat');
|
|
29
|
+
if (chat !== undefined)
|
|
30
|
+
return chat;
|
|
31
|
+
// Legacy fallback: on builds whose ConversationSnapshot still nests `chat`,
|
|
32
|
+
// the session face itself is the observable carrying it. The cast is
|
|
33
|
+
// deliberate — that generation is not describable by this build's types, and
|
|
34
|
+
// `resolveOutlineFlow` reads whatever shape it finds defensively.
|
|
35
|
+
return session;
|
|
36
|
+
}
|
|
6
37
|
const JUMP_HEADROOM = 96;
|
|
7
38
|
const JUMP_TIMEOUT_MS = 1500;
|
|
8
39
|
const FLASH_MS = 1900;
|
|
@@ -45,14 +76,20 @@ function scheduleTimeout(timeoutRef, fn, ms) {
|
|
|
45
76
|
}, ms);
|
|
46
77
|
timeoutRef.current.push(id);
|
|
47
78
|
}
|
|
48
|
-
export function OutlinePanel({ sessions, useSessions, t }) {
|
|
79
|
+
export function OutlinePanel({ sessions, useSessions, t, }) {
|
|
49
80
|
const current = useSessions((s) => s.current);
|
|
50
81
|
const session = current ? sessions.binding(current)?.session : undefined;
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
82
|
+
// Question flow: the Chat store (0.1.5-rc.2+) or the session snapshot's own
|
|
83
|
+
// `chat` (earlier builds). Pagination still lives on the session face in both.
|
|
84
|
+
const chat = useMemo(() => resolveChatFeed(session, current ? sessions.binding(current) : undefined), [session, sessions, current]);
|
|
85
|
+
const subscribe = useCallback((onChange) => (chat ? chat.subscribe(onChange) : () => { }), [chat]);
|
|
86
|
+
const getSnapshot = useCallback(() => (chat ? chat.getSnapshot() : NO_FLOW), [chat]);
|
|
87
|
+
const chatSnapshot = useSyncExternalStore(subscribe, getSnapshot);
|
|
88
|
+
const snapshot = useMemo(() => ({
|
|
89
|
+
...chatSnapshot,
|
|
90
|
+
hasMore: session?.getSnapshot?.().hasMore ?? false,
|
|
91
|
+
loadingOlder: session?.getSnapshot?.().loadingOlder ?? false,
|
|
92
|
+
}), [chatSnapshot, session]);
|
|
56
93
|
// Two independent sources for the panel being open: `pinned` is a click
|
|
57
94
|
// gesture (sticky until Escape / outside click / session change), `hovered`
|
|
58
95
|
// is pointer presence over the rail or the panel. Deriving `open` from both
|
|
@@ -136,9 +173,8 @@ export function OutlinePanel({ sessions, useSessions, t }) {
|
|
|
136
173
|
// Unmount cleanup: cancel pending flash/copied timeouts, jump RAFs, collapse
|
|
137
174
|
// timer, and the flash attribute.
|
|
138
175
|
useEffect(() => clearPending, [clearPending]);
|
|
139
|
-
const allItems = useMemo(() =>
|
|
176
|
+
const allItems = useMemo(() => collectQuestions(snapshot), [snapshot]);
|
|
140
177
|
const items = useMemo(() => filterQuestions(allItems, query), [allItems, query]);
|
|
141
|
-
const blank = snapshot?.blank ?? true;
|
|
142
178
|
const hasMore = snapshot?.hasMore ?? false;
|
|
143
179
|
const loadingOlder = snapshot?.loadingOlder ?? false;
|
|
144
180
|
// ---- open mechanics: click pins, hover previews, grace period between ---
|
|
@@ -294,11 +330,14 @@ export function OutlinePanel({ sessions, useSessions, t }) {
|
|
|
294
330
|
fallback();
|
|
295
331
|
}
|
|
296
332
|
}, []);
|
|
297
|
-
// No current session, or a
|
|
298
|
-
//
|
|
299
|
-
//
|
|
300
|
-
//
|
|
301
|
-
|
|
333
|
+
// No current session, or a session with nothing to outline → render nothing
|
|
334
|
+
// (rail included). This is driven by the question list, not by the session's
|
|
335
|
+
// `blank` flag: the flag belongs to the conversation snapshot, while the rail
|
|
336
|
+
// is derived from the Chat flow, and a session whose nodes are not loaded yet
|
|
337
|
+
// must not take the slot down. MUST stay below every hook (this overlay entry
|
|
338
|
+
// stays mounted across session changes, so a conditional hook would crash
|
|
339
|
+
// React — reviewer MUST-FIX #1).
|
|
340
|
+
if (!current || !session || allItems.length === 0)
|
|
302
341
|
return null;
|
|
303
342
|
// Rail bars: chronological top→bottom, capped at MAX_BARS with the overflow
|
|
304
343
|
// folded into a "+N" marker (the rail is a minimap, not the full list).
|
package/lib/client/outline.js
CHANGED
|
@@ -9,6 +9,25 @@
|
|
|
9
9
|
* (@deepseek-ai/dsh-client-runtime/client) — the real objects are assignable
|
|
10
10
|
* to them, and Node can import this module without the browser type graph.
|
|
11
11
|
*/
|
|
12
|
+
/**
|
|
13
|
+
* Resolve one snapshot into the flow to walk, preferring the nested `chat`
|
|
14
|
+
* object and falling back to the top-level store fields.
|
|
15
|
+
*
|
|
16
|
+
* Never throws: a snapshot carrying neither shape yields `undefined`, so the
|
|
17
|
+
* caller renders an empty rail instead of crashing its slot.
|
|
18
|
+
*/
|
|
19
|
+
export function resolveOutlineFlow(snapshot) {
|
|
20
|
+
if (snapshot === null || snapshot === undefined)
|
|
21
|
+
return undefined;
|
|
22
|
+
const chat = snapshot.chat;
|
|
23
|
+
if (chat !== undefined && Array.isArray(chat.order) && chat.nodes !== undefined) {
|
|
24
|
+
return { order: chat.order, nodes: chat.nodes };
|
|
25
|
+
}
|
|
26
|
+
if (Array.isArray(snapshot.order) && snapshot.nodes !== undefined) {
|
|
27
|
+
return { order: snapshot.order, nodes: snapshot.nodes };
|
|
28
|
+
}
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
12
31
|
const IMAGE_PLACEHOLDER = '[image]';
|
|
13
32
|
/**
|
|
14
33
|
* Flatten message content blocks into a single display string: text blocks are
|
|
@@ -41,9 +60,12 @@ function turnOf(location) {
|
|
|
41
60
|
* produce chronological outline items (spec §2.3).
|
|
42
61
|
*/
|
|
43
62
|
export function collectQuestions(snapshot) {
|
|
63
|
+
const flow = resolveOutlineFlow(snapshot);
|
|
64
|
+
if (flow === undefined)
|
|
65
|
+
return [];
|
|
44
66
|
const items = [];
|
|
45
|
-
for (const key of
|
|
46
|
-
const node =
|
|
67
|
+
for (const key of flow.order) {
|
|
68
|
+
const node = flow.nodes.get(key);
|
|
47
69
|
if (!node)
|
|
48
70
|
continue;
|
|
49
71
|
if (node.kind !== 'user' && node.kind !== 'steering')
|
package/lib/client.js
CHANGED
|
@@ -18,6 +18,25 @@ window.__ModuleLoader__.load({
|
|
|
18
18
|
* (@deepseek-ai/dsh-client-runtime/client) — the real objects are assignable
|
|
19
19
|
* to them, and Node can import this module without the browser type graph.
|
|
20
20
|
*/
|
|
21
|
+
/**
|
|
22
|
+
* Resolve one snapshot into the flow to walk, preferring the nested `chat`
|
|
23
|
+
* object and falling back to the top-level store fields.
|
|
24
|
+
*
|
|
25
|
+
* Never throws: a snapshot carrying neither shape yields `undefined`, so the
|
|
26
|
+
* caller renders an empty rail instead of crashing its slot.
|
|
27
|
+
*/
|
|
28
|
+
function resolveOutlineFlow(snapshot) {
|
|
29
|
+
if (snapshot === null || snapshot === void 0) return void 0;
|
|
30
|
+
const chat = snapshot.chat;
|
|
31
|
+
if (chat !== void 0 && Array.isArray(chat.order) && chat.nodes !== void 0) return {
|
|
32
|
+
order: chat.order,
|
|
33
|
+
nodes: chat.nodes
|
|
34
|
+
};
|
|
35
|
+
if (Array.isArray(snapshot.order) && snapshot.nodes !== void 0) return {
|
|
36
|
+
order: snapshot.order,
|
|
37
|
+
nodes: snapshot.nodes
|
|
38
|
+
};
|
|
39
|
+
}
|
|
21
40
|
const IMAGE_PLACEHOLDER = "[image]";
|
|
22
41
|
/**
|
|
23
42
|
* Flatten message content blocks into a single display string: text blocks are
|
|
@@ -41,9 +60,11 @@ window.__ModuleLoader__.load({
|
|
|
41
60
|
* produce chronological outline items (spec §2.3).
|
|
42
61
|
*/
|
|
43
62
|
function collectQuestions(snapshot) {
|
|
63
|
+
const flow = resolveOutlineFlow(snapshot);
|
|
64
|
+
if (flow === void 0) return [];
|
|
44
65
|
const items = [];
|
|
45
|
-
for (const key of
|
|
46
|
-
const node =
|
|
66
|
+
for (const key of flow.order) {
|
|
67
|
+
const node = flow.nodes.get(key);
|
|
47
68
|
if (!node) continue;
|
|
48
69
|
if (node.kind !== "user" && node.kind !== "steering") continue;
|
|
49
70
|
const data = node.data;
|
|
@@ -86,8 +107,32 @@ window.__ModuleLoader__.load({
|
|
|
86
107
|
}
|
|
87
108
|
//#endregion
|
|
88
109
|
//#region lib/client/OutlinePanel.js
|
|
89
|
-
/**
|
|
90
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Stable getSnapshot value while no session (or no feed) is current (uSES
|
|
112
|
+
* contract): an empty flow, so the rail renders nothing instead of throwing on
|
|
113
|
+
* a shape the host did not provide.
|
|
114
|
+
*/
|
|
115
|
+
const NO_FLOW = { order: [] };
|
|
116
|
+
/**
|
|
117
|
+
* Resolve one observable Chat source out of a session binding for the two
|
|
118
|
+
* contract generations DSH shipped:
|
|
119
|
+
*
|
|
120
|
+
* - `binding.ctx.uiConversation.binding(binding).target('chat')` — 0.1.5-rc.2
|
|
121
|
+
* and later, where the Chat node graph is a session-scoped store and
|
|
122
|
+
* `ConversationSnapshot` no longer carries `chat`;
|
|
123
|
+
* - the session face itself — earlier builds, whose snapshot still exposes
|
|
124
|
+
* `chat` (and which `resolveOutlineFlow` prefers when it is present).
|
|
125
|
+
*
|
|
126
|
+
* Reading the provider off `binding.ctx` rather than the root context keeps it
|
|
127
|
+
* correct under any bus arrangement, and a host without the service degrades to
|
|
128
|
+
* the legacy face instead of crashing the slot.
|
|
129
|
+
*/
|
|
130
|
+
function resolveChatFeed(session, binding) {
|
|
131
|
+
if (session === void 0 || binding === void 0) return void 0;
|
|
132
|
+
const chat = (binding.ctx?.uiConversation)?.binding?.(session)?.target?.("chat");
|
|
133
|
+
if (chat !== void 0) return chat;
|
|
134
|
+
return session;
|
|
135
|
+
}
|
|
91
136
|
const JUMP_HEADROOM = 96;
|
|
92
137
|
const JUMP_TIMEOUT_MS = 1500;
|
|
93
138
|
const FLASH_MS = 1900;
|
|
@@ -132,7 +177,17 @@ window.__ModuleLoader__.load({
|
|
|
132
177
|
function OutlinePanel({ sessions, useSessions, t }) {
|
|
133
178
|
const current = useSessions((s) => s.current);
|
|
134
179
|
const session = current ? sessions.binding(current)?.session : void 0;
|
|
135
|
-
const
|
|
180
|
+
const chat = (0, react.useMemo)(() => resolveChatFeed(session, current ? sessions.binding(current) : void 0), [
|
|
181
|
+
session,
|
|
182
|
+
sessions,
|
|
183
|
+
current
|
|
184
|
+
]);
|
|
185
|
+
const chatSnapshot = (0, react.useSyncExternalStore)((0, react.useCallback)((onChange) => chat ? chat.subscribe(onChange) : () => {}, [chat]), (0, react.useCallback)(() => chat ? chat.getSnapshot() : NO_FLOW, [chat]));
|
|
186
|
+
const snapshot = (0, react.useMemo)(() => ({
|
|
187
|
+
...chatSnapshot,
|
|
188
|
+
hasMore: session?.getSnapshot?.().hasMore ?? false,
|
|
189
|
+
loadingOlder: session?.getSnapshot?.().loadingOlder ?? false
|
|
190
|
+
}), [chatSnapshot, session]);
|
|
136
191
|
const [pinned, setPinned] = (0, react.useState)(false);
|
|
137
192
|
const [hovered, setHovered] = (0, react.useState)(false);
|
|
138
193
|
const open = pinned || hovered;
|
|
@@ -191,9 +246,8 @@ window.__ModuleLoader__.load({
|
|
|
191
246
|
return () => window.removeEventListener("mousedown", onPointerDown);
|
|
192
247
|
}, [pinned, closePanel]);
|
|
193
248
|
(0, react.useEffect)(() => clearPending, [clearPending]);
|
|
194
|
-
const allItems = (0, react.useMemo)(() =>
|
|
249
|
+
const allItems = (0, react.useMemo)(() => collectQuestions(snapshot), [snapshot]);
|
|
195
250
|
const items = (0, react.useMemo)(() => filterQuestions(allItems, query), [allItems, query]);
|
|
196
|
-
const blank = snapshot?.blank ?? true;
|
|
197
251
|
const hasMore = snapshot?.hasMore ?? false;
|
|
198
252
|
const loadingOlder = snapshot?.loadingOlder ?? false;
|
|
199
253
|
const cancelCollapse = (0, react.useCallback)(() => {
|
|
@@ -314,7 +368,7 @@ window.__ModuleLoader__.load({
|
|
|
314
368
|
if (navigator.clipboard?.writeText) navigator.clipboard.writeText(text).then(done, fallback);
|
|
315
369
|
else fallback();
|
|
316
370
|
}, []);
|
|
317
|
-
if (!current || !session ||
|
|
371
|
+
if (!current || !session || allItems.length === 0) return null;
|
|
318
372
|
const start = Math.max(0, allItems.length - MAX_BARS);
|
|
319
373
|
const bars = allItems.slice(start);
|
|
320
374
|
const overflow = start;
|
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 */\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 items = [];\n for (const key of snapshot.chat.order) {\n const node = snapshot.chat.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/** Stable getSnapshot value while no session is current (uSES contract). */\nconst NO_SESSION = null;\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, useSessions, t }) {\n const current = useSessions((s) => s.current);\n const session = current ? sessions.binding(current)?.session : undefined;\n // Conversation snapshot subscription (spec §1.5): live updates while the\n // session runs, load-older, blank detection — all ride this one store.\n const subscribe = useCallback((onChange) => (session ? session.subscribe(onChange) : () => { }), [session]);\n const getSnapshot = useCallback(() => (session ? session.getSnapshot() : NO_SESSION), [session]);\n const snapshot = useSyncExternalStore(subscribe, getSnapshot);\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(() => (snapshot ? collectQuestions(snapshot) : []), [snapshot]);\n const items = useMemo(() => filterQuestions(allItems, query), [allItems, query]);\n const blank = snapshot?.blank ?? true;\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 blank session → render nothing (rail included).\n // MUST stay below every hook: this overlay entry stays mounted across\n // session changes, and blank flips false on the first accepted prompt, so a\n // conditional hook would crash React (reviewer MUST-FIX #1).\n if (!current || !session || blank)\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":";;;;;;;;;;;;;;;;;;;;EAWA,MAAM,oBAAoB;;;;;;EAM1B,SAAgB,oBAAoB,SAAS;GACzC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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 one snapshot into the flow to walk, preferring the nested `chat`\n * object and falling back to the top-level store fields.\n *\n * Never throws: a snapshot carrying neither shape 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 const chat = snapshot.chat;\n if (chat !== undefined && Array.isArray(chat.order) && chat.nodes !== undefined) {\n return { order: chat.order, nodes: chat.nodes };\n }\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 for the two\n * contract generations DSH shipped:\n *\n * - `binding.ctx.uiConversation.binding(binding).target('chat')` — 0.1.5-rc.2\n * and later, where the Chat node graph is a session-scoped store and\n * `ConversationSnapshot` no longer carries `chat`;\n * - the session face itself — earlier builds, whose snapshot still exposes\n * `chat` (and which `resolveOutlineFlow` prefers when it is present).\n *\n * Reading the provider off `binding.ctx` rather than the root context keeps it\n * correct under any bus arrangement, and a host without the service degrades to\n * the legacy face instead of crashing the slot.\n */\nexport function resolveChatFeed(session, binding) {\n if (session === undefined || binding === undefined)\n return undefined;\n const uiConversation = binding.ctx?.uiConversation;\n const chat = uiConversation?.binding?.(session)?.target?.('chat');\n if (chat !== undefined)\n return chat;\n // Legacy fallback: on builds whose ConversationSnapshot still nests `chat`,\n // the session face itself is the observable carrying it. The cast is\n // deliberate — that generation is not describable by this build's types, and\n // `resolveOutlineFlow` reads whatever shape it finds defensively.\n return session;\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, useSessions, t, }) {\n const current = useSessions((s) => s.current);\n const session = current ? sessions.binding(current)?.session : undefined;\n // Question flow: the Chat store (0.1.5-rc.2+) or the session snapshot's own\n // `chat` (earlier builds). Pagination still lives on the session face in both.\n const chat = useMemo(() => resolveChatFeed(session, current ? sessions.binding(current) : undefined), [session, sessions, current]);\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,MAAM,OAAO,SAAS;GACtB,IAAI,SAAS,KAAA,KAAa,MAAM,QAAQ,KAAK,KAAK,KAAK,KAAK,UAAU,KAAA,GAClE,OAAO;IAAE,OAAO,KAAK;IAAO,OAAO,KAAK;GAAM;GAElD,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,SAAS,OAAO,UAAU;GACtB,IAAI,CAAC,UACD,OAAO,KAAA;GACX,IAAI,SAAS,SAAS,UAAU,SAAS,SAAS,QAC9C,OAAO,SAAS,MAAM;EAE9B;;;;;EAKA,SAAgB,iBAA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CAAkC;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"}
|
|
@@ -2,22 +2,52 @@ import type { ReactElement } from 'react';
|
|
|
2
2
|
import type { GlobalStandardProps, TranslateNS } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
3
|
import type { ISessions } from '@deepseek-ai/dsh-client-runtime/client';
|
|
4
4
|
import { NS } from './locales.ts';
|
|
5
|
+
import type { OutlineSnapshotLike } from './outline.ts';
|
|
5
6
|
/**
|
|
6
7
|
* Conversation-outline rail + hover panel (implementation-spec §2.1/§2.2,
|
|
7
8
|
* revised per user feedback): NO top-right badge — instead a thin, always-
|
|
8
9
|
* visible right-edge rail (one bar per question, like a conversation minimap).
|
|
9
10
|
* Hovering the rail expands a preview panel listing each question's opening
|
|
10
|
-
* words (single-line truncated); clicking
|
|
11
|
+
* words (single-line truncated); clicking the rail or a bar opens/pins it, and
|
|
12
|
+
* clicking a row jumps to that message.
|
|
11
13
|
*
|
|
12
14
|
* Rendered by the shell as a `shell.overlay` entry (frame-wide, click-through
|
|
13
|
-
* layer). Props come from the composed
|
|
14
|
-
*
|
|
15
|
-
*
|
|
15
|
+
* layer). Props come from the composed contract — the global standard kit
|
|
16
|
+
* (`useSessions`) and the typed `t` seat for our locale namespace — plus the
|
|
17
|
+
* Chat feed the registration resolves per session (see §data sources).
|
|
16
18
|
*/
|
|
17
19
|
export interface OutlinePanelProps extends GlobalStandardProps {
|
|
18
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* The sessions service face, injected by the registration: resolves the
|
|
22
|
+
* binding (its `.session` face carries pagination) and, through its context,
|
|
23
|
+
* the session's Chat store.
|
|
24
|
+
*/
|
|
19
25
|
sessions: ISessions;
|
|
20
26
|
/** Typed translate seat for our namespace (declared via `locale: NS`). */
|
|
21
27
|
t: TranslateNS<typeof NS>;
|
|
22
28
|
}
|
|
23
|
-
|
|
29
|
+
/** One observable Chat source: props read through uSES, updates pushed. */
|
|
30
|
+
export interface OutlineChatFeed {
|
|
31
|
+
getSnapshot: () => OutlineSnapshotLike;
|
|
32
|
+
subscribe: (onChange: () => void) => () => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Resolve one observable Chat source out of a session binding for the two
|
|
36
|
+
* contract generations DSH shipped:
|
|
37
|
+
*
|
|
38
|
+
* - `binding.ctx.uiConversation.binding(binding).target('chat')` — 0.1.5-rc.2
|
|
39
|
+
* and later, where the Chat node graph is a session-scoped store and
|
|
40
|
+
* `ConversationSnapshot` no longer carries `chat`;
|
|
41
|
+
* - the session face itself — earlier builds, whose snapshot still exposes
|
|
42
|
+
* `chat` (and which `resolveOutlineFlow` prefers when it is present).
|
|
43
|
+
*
|
|
44
|
+
* Reading the provider off `binding.ctx` rather than the root context keeps it
|
|
45
|
+
* correct under any bus arrangement, and a host without the service degrades to
|
|
46
|
+
* the legacy face instead of crashing the slot.
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolveChatFeed(session: OutlineChatFeed | undefined, binding: {
|
|
49
|
+
ctx?: {
|
|
50
|
+
uiConversation?: unknown;
|
|
51
|
+
};
|
|
52
|
+
} | undefined): OutlineChatFeed | undefined;
|
|
53
|
+
export declare function OutlinePanel({ sessions, useSessions, t, }: OutlinePanelProps): ReactElement | null;
|
|
@@ -41,15 +41,55 @@ export interface OutlineChatNode {
|
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
44
|
+
/** One Chat target: the node flow and its index, nested under `chat`. */
|
|
45
|
+
export interface OutlineChatLike {
|
|
46
|
+
order: readonly string[];
|
|
47
|
+
nodes: {
|
|
48
|
+
get(key: string): OutlineChatNode | undefined;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Snapshot shape accepted by collectQuestions.
|
|
53
|
+
*
|
|
54
|
+
* Two generations of the DSH contract are accepted, because the Chat node graph
|
|
55
|
+
* moved between them:
|
|
56
|
+
*
|
|
57
|
+
* - `chat.order` / `chat.nodes` — the layout this plugin was written against,
|
|
58
|
+
* still what `@deepseek-ai/dsh-client-runtime` exposes as
|
|
59
|
+
* `ConversationSnapshot.chat`;
|
|
60
|
+
* - `order` / `nodes` at the top level — the session-scoped Chat store that
|
|
61
|
+
* `@deepseek-ai/dsh-client-ui-chat` publishes from 0.1.5-rc.2 on, where
|
|
62
|
+
* `ConversationSnapshot` no longer carries `chat` at all.
|
|
63
|
+
*
|
|
64
|
+
* Both are optional so "this session has no chat yet" is a valid input rather
|
|
65
|
+
* than a crash: the rail then has nothing to outline.
|
|
66
|
+
*/
|
|
45
67
|
export interface OutlineSnapshotLike {
|
|
46
|
-
chat
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
68
|
+
chat?: Partial<OutlineChatLike> | undefined;
|
|
69
|
+
order?: readonly string[] | undefined;
|
|
70
|
+
nodes?: {
|
|
71
|
+
get(key: string): OutlineChatNode | undefined;
|
|
72
|
+
} | undefined;
|
|
73
|
+
/** Older history still exists outside the loaded window (session face). */
|
|
74
|
+
hasMore?: boolean | undefined;
|
|
75
|
+
/** The session face is paging older history right now. */
|
|
76
|
+
loadingOlder?: boolean | undefined;
|
|
77
|
+
}
|
|
78
|
+
/** The node flow plus its index, after resolving both contract generations. */
|
|
79
|
+
export interface OutlineFlow {
|
|
80
|
+
order: readonly string[];
|
|
81
|
+
nodes: {
|
|
82
|
+
get(key: string): OutlineChatNode | undefined;
|
|
51
83
|
};
|
|
52
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Resolve one snapshot into the flow to walk, preferring the nested `chat`
|
|
87
|
+
* object and falling back to the top-level store fields.
|
|
88
|
+
*
|
|
89
|
+
* Never throws: a snapshot carrying neither shape yields `undefined`, so the
|
|
90
|
+
* caller renders an empty rail instead of crashing its slot.
|
|
91
|
+
*/
|
|
92
|
+
export declare function resolveOutlineFlow(snapshot: OutlineSnapshotLike | null | undefined): OutlineFlow | undefined;
|
|
53
93
|
/** One row of the outline: a user question (or mid-turn steer). */
|
|
54
94
|
export interface OutlineItem {
|
|
55
95
|
key: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chestnut23/dsh-conversation-outline",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
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",
|