dsh-conversation-navigator 0.2.10 → 0.2.11
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.en.md +5 -2
- package/README.md +5 -2
- package/lib/client.js +39 -3
- package/package.json +3 -2
package/README.en.md
CHANGED
|
@@ -102,12 +102,13 @@ Official v0.1.2-rc.1 made a breaking change to the conversation data layer (conv
|
|
|
102
102
|
|
|
103
103
|
| Host `dsh-client-ui-conversation` | Matching plugin version | npm tag |
|
|
104
104
|
|---|---|---|
|
|
105
|
-
| **≥ 0.1.2-rc.1** (has the `uiConversation` service) | **0.2.6 and later** (currently 0.2.
|
|
105
|
+
| **≥ 0.1.2-rc.1** (has the `uiConversation` service) | **0.2.6 and later** (currently 0.2.11) | `latest` (default) |
|
|
106
106
|
| **≤ 0.1.1-rc.2** (no `uiConversation`, legacy `session.chat` snapshot) | **0.2.5 and earlier** | `legacy` |
|
|
107
107
|
|
|
108
108
|
- New hosts can install the latest normally (`dsh plugin --profile web add dsh-conversation-navigator`).
|
|
109
109
|
- Legacy hosts should pin the legacy tag: `npm i dsh-conversation-navigator@legacy` (= 0.2.5).
|
|
110
|
-
- From 0.2.6 the `peerDependencies` range is `>=0.1.2-rc.1 <0.
|
|
110
|
+
- From 0.2.6 the `peerDependencies` range is `>=0.1.2-rc.1 <0.3.0` (both the conversation data layer and the UI primitives package).
|
|
111
|
+
- Icon export compatibility: DSH **0.1.7** silently renamed `IconXxxOutline16` to `IconXxxOutlineRegular / Medium` (0.1.2–0.1.6 only ship the old names). From 0.2.11 the plugin resolves them in one place, preferring the new names and falling back to the old ones, and degrades to placeholder components with a diagnostic error instead of letting the whole slot die on minified React error #130. CI checks the host export contract against released DSH versions (`scripts/check-host-exports.mjs`).
|
|
111
112
|
|
|
112
113
|
## Structure
|
|
113
114
|
|
|
@@ -117,6 +118,8 @@ lib/
|
|
|
117
118
|
client.js # full browser implementation (window.__ModuleLoader__ module format)
|
|
118
119
|
assets/
|
|
119
120
|
screenshots/ # screenshots (README hero + market gallery)
|
|
121
|
+
scripts/
|
|
122
|
+
check-host-exports.mjs # CI: host export contract check (silent removals like icon renames)
|
|
120
123
|
cordis.patch.yml # bundle patch layer (inserts the plugin row)
|
|
121
124
|
example.patch.yml # patch example for manual installs
|
|
122
125
|
```
|
package/README.md
CHANGED
|
@@ -99,12 +99,13 @@ dsh plugin --profile web add ./dsh-conversation-navigator-<version>.tgz
|
|
|
99
99
|
|
|
100
100
|
| 宿主 `dsh-client-ui-conversation` | 对应插件版本 | npm 标签 |
|
|
101
101
|
|---|---|---|
|
|
102
|
-
| **≥ 0.1.2-rc.1**(有 `uiConversation` 服务) | **0.2.6 及以后**(当前 0.2.
|
|
102
|
+
| **≥ 0.1.2-rc.1**(有 `uiConversation` 服务) | **0.2.6 及以后**(当前 0.2.11) | `latest`(默认) |
|
|
103
103
|
| **≤ 0.1.1-rc.2**(无 `uiConversation`,旧 `session.chat` 快照) | **0.2.5 及以前** | `legacy` |
|
|
104
104
|
|
|
105
105
|
- 新宿主直接安装最新版即可(`dsh plugin --profile web add dsh-conversation-navigator`)。
|
|
106
106
|
- 旧宿主请指定旧标签:`npm i dsh-conversation-navigator@legacy`(= 0.2.5)。
|
|
107
|
-
- 0.2.6 起 `peerDependencies`
|
|
107
|
+
- 0.2.6 起 `peerDependencies` 声明 `>=0.1.2-rc.1 <0.3.0`(会话数据层与 UI primitives 两个包)。
|
|
108
|
+
- 图标导出兼容:官方 **0.1.7** 起把 `IconXxxOutline16` 静默改为 `IconXxxOutlineRegular / Medium`(0.1.2~0.1.6 只有旧名)。0.2.11 起插件在**一处集中解析**、新名优先 → 旧名回退,缺失时打印可诊断的报错并退化为占位组件,不再让整个 slot 因 minified React error #130 被判崩溃;CI 对已发布 DSH 版本做宿主导出契约检查(`scripts/check-host-exports.mjs`)。
|
|
108
109
|
|
|
109
110
|
## 目录结构
|
|
110
111
|
|
|
@@ -114,6 +115,8 @@ lib/
|
|
|
114
115
|
client.js # 浏览器端完整实现(window.__ModuleLoader__ 模块格式)
|
|
115
116
|
assets/
|
|
116
117
|
screenshots/ # 截图(README 主图 + 市场截图墙)
|
|
118
|
+
scripts/
|
|
119
|
+
check-host-exports.mjs # CI: 宿主导出契约检查(图标改名这类静默移除)
|
|
117
120
|
cordis.patch.yml # 组合包补丁层(插入插件行)
|
|
118
121
|
example.patch.yml # 手动安装时的补丁示例
|
|
119
122
|
```
|
package/lib/client.js
CHANGED
|
@@ -5,7 +5,43 @@ window.__ModuleLoader__.load({
|
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
7
|
const React = require("react");
|
|
8
|
-
|
|
8
|
+
/* ---------- 宿主导出集中取用(唯一引入点, 便于随 DSH 升级核对) ----------
|
|
9
|
+
DSH 0.1.7 起把图标导出从「尺寸后缀」(IconXxxOutline16) 静默改为「字重后缀」
|
|
10
|
+
(IconXxxOutlineRegular / Medium, 旧名被直接移除)。解构出 undefined 再交给 React
|
|
11
|
+
渲染会抛 minified error #130, 并让整个 slot 被判为崩溃, 故这里按 新名 → 旧名
|
|
12
|
+
依次解析; 缺失时打印可诊断的报错并退化为占位组件, 保证面板本体仍能渲染。 */
|
|
13
|
+
const primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
14
|
+
function MissingIcon() {
|
|
15
|
+
return React.createElement("span", { className: "cnvnav-icon-missing", "aria-hidden": "true" });
|
|
16
|
+
}
|
|
17
|
+
function MissingButton(props) {
|
|
18
|
+
return React.createElement("button", {
|
|
19
|
+
type: "button", className: props.className, onClick: props.onClick,
|
|
20
|
+
disabled: props.disabled, title: props.title,
|
|
21
|
+
}, props.icon === undefined ? null : props.icon, props.children === undefined ? null : props.children);
|
|
22
|
+
}
|
|
23
|
+
function MissingTooltip(props) {
|
|
24
|
+
return React.createElement(React.Fragment, null, props.children === undefined ? null : props.children);
|
|
25
|
+
}
|
|
26
|
+
const pickHostExport = (names, fallback) => {
|
|
27
|
+
for (const name of names) if (primitives[name] !== undefined) return primitives[name];
|
|
28
|
+
return fallback;
|
|
29
|
+
};
|
|
30
|
+
const Button = pickHostExport(["Button"], MissingButton);
|
|
31
|
+
const Tooltip = pickHostExport(["Tooltip"], MissingTooltip);
|
|
32
|
+
/* 图标: Regular(描边 1, DSH 自家插件主用) → Medium(描边 1.3) → 无后缀 → 旧数字后缀 */
|
|
33
|
+
const IconCloseOutline = pickHostExport(["IconCloseOutlineRegular", "IconCloseOutlineMedium", "IconCloseOutline", "IconCloseOutline16"], MissingIcon);
|
|
34
|
+
const IconSearchOutline = pickHostExport(["IconSearchOutlineRegular", "IconSearchOutlineMedium", "IconSearchOutline", "IconSearchOutline16"], MissingIcon);
|
|
35
|
+
/* 缺导出时给出可诊断的报错(而不是渲染期 minified React #130) */
|
|
36
|
+
const missingHostExports = [];
|
|
37
|
+
if (primitives.Button === undefined) missingHostExports.push("Button");
|
|
38
|
+
if (primitives.Tooltip === undefined) missingHostExports.push("Tooltip");
|
|
39
|
+
if (IconCloseOutline === MissingIcon) missingHostExports.push("IconCloseOutline{Regular|Medium|16}");
|
|
40
|
+
if (IconSearchOutline === MissingIcon) missingHostExports.push("IconSearchOutline{Regular|Medium|16}");
|
|
41
|
+
if (missingHostExports.length > 0) {
|
|
42
|
+
console.error("[dsh-conversation-navigator] @deepseek-ai/dsh-client-ui-primitives 缺少导出: " + missingHostExports.join(", ")
|
|
43
|
+
+ " —— 已退化为占位组件渲染; 请核对 DSH 版本与本插件的 peerDependencies。");
|
|
44
|
+
}
|
|
9
45
|
|
|
10
46
|
/* ---------- 自绘图标: Lucide (ISC License, https://lucide.dev)
|
|
11
47
|
24px 网格 / 2px 描边 / 圆角线帽, 与 DSH 官方描边图标同一视觉语言 ---------- */
|
|
@@ -1886,7 +1922,7 @@ window.__ModuleLoader__.load({
|
|
|
1886
1922
|
React.createElement(Button, {
|
|
1887
1923
|
variant: "ghost",
|
|
1888
1924
|
size: "sm",
|
|
1889
|
-
icon: React.createElement(
|
|
1925
|
+
icon: React.createElement(IconSearchOutline, { size: 14 }),
|
|
1890
1926
|
onClick: () => toggleSearch(),
|
|
1891
1927
|
}),
|
|
1892
1928
|
),
|
|
@@ -1955,7 +1991,7 @@ window.__ModuleLoader__.load({
|
|
|
1955
1991
|
React.createElement(Button, {
|
|
1956
1992
|
variant: "ghost",
|
|
1957
1993
|
size: "sm",
|
|
1958
|
-
icon: React.createElement(
|
|
1994
|
+
icon: React.createElement(IconCloseOutline, { size: 14 }),
|
|
1959
1995
|
onClick: () => setState({ open: false }),
|
|
1960
1996
|
}),
|
|
1961
1997
|
),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-conversation-navigator",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"description": "DSH(DeepSeek Harness)会话导航插件:按轮折叠的对话大纲面板,支持节点点击跳转、滚动位置高亮与轨迹视图同款配色。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"node": ">=18"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@deepseek-ai/dsh-client-ui-conversation": ">=0.1.2-rc.1 <0.
|
|
36
|
+
"@deepseek-ai/dsh-client-ui-conversation": ">=0.1.2-rc.1 <0.3.0",
|
|
37
|
+
"@deepseek-ai/dsh-client-ui-primitives": ">=0.1.2-rc.1 <0.3.0"
|
|
37
38
|
},
|
|
38
39
|
"dsh": {
|
|
39
40
|
"bundle": {
|