@xiangyixie/dsh-superagent 0.16.2 → 0.16.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/CHANGELOG.md +19 -0
- package/README.en.md +3 -3
- package/README.md +3 -3
- package/README.zh.md +3 -3
- package/lib/client.js +59 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,25 @@ along with the next code release. A doc-only version leaves `lib/` and `bin/`
|
|
|
8
8
|
byte-identical to the version before it, and the pinned install line in the
|
|
9
9
|
README is updated to the version being released.
|
|
10
10
|
|
|
11
|
+
## 0.16.3 — 2026-11-17
|
|
12
|
+
|
|
13
|
+
### 修复
|
|
14
|
+
|
|
15
|
+
- **assistant 正文恢复了 Markdown 渲染。** 根因不是渲染分支,而是组件探测:
|
|
16
|
+
`MarkdownText` 是 `React.memo` 包装的对象,`Button` 是 `React.forwardRef`
|
|
17
|
+
对象,0.16.1 起用 `typeof x === 'function'` 判断,两者都被误判为「宿主没导出」,
|
|
18
|
+
于是正文一直走 `.dsa-md-plain` 纯文本兜底(表格、加粗、行内代码原样露出)。
|
|
19
|
+
现在同时接受 function、`react.memo` 和 `react.forward_ref`,流式与完成态的
|
|
20
|
+
正文都走宿主 `MarkdownText`。
|
|
21
|
+
- **降级不再静默。** 缺少宿主组件时在控制台打印一次缺失清单;单条消息降级为
|
|
22
|
+
纯文本时打印带消息 id 的 `console.error`;`MarkdownText` 运行期抛错由错误
|
|
23
|
+
边界接住并记录,正文继续以纯文本显示。
|
|
24
|
+
|
|
25
|
+
### 已知待办(本轮未改)
|
|
26
|
+
|
|
27
|
+
- 委派提示词里把 Run ID、token 统计、并行上限这类内部信息写进了面向用户的
|
|
28
|
+
输出,措辞需要单独调整。
|
|
29
|
+
|
|
11
30
|
## 0.16.2 — 2026-11-17
|
|
12
31
|
|
|
13
32
|
### 变化
|
package/README.en.md
CHANGED
|
@@ -36,12 +36,12 @@ Three steps. The desktop app and the CLI install the same plugin; each step says
|
|
|
36
36
|
|
|
37
37
|
### 1. Install
|
|
38
38
|
|
|
39
|
-
Desktop: **Plugins** → **Add plugin** → enter `@xiangyixie/dsh-superagent@0.16.
|
|
39
|
+
Desktop: **Plugins** → **Add plugin** → enter `@xiangyixie/dsh-superagent@0.16.3` → install.
|
|
40
40
|
|
|
41
41
|
CLI:
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
dsh plugin --profile web add @xiangyixie/dsh-superagent@0.16.
|
|
44
|
+
dsh plugin --profile web add @xiangyixie/dsh-superagent@0.16.3
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
**Restart DSH** afterwards — plugins are loaded once at host startup. You can also add the [plugin index](https://raw.githubusercontent.com/LittleChenLiya/dsh-superagent/main/plugin-index.json) on the **Discover** page for one-click installs; upgrades are always remove-then-add.
|
|
@@ -1666,7 +1666,7 @@ appears to "hang" until the ignored-abort child returns.
|
|
|
1666
1666
|
|
|
1667
1667
|
| What you see | What it means | What to do |
|
|
1668
1668
|
| --- | --- | --- |
|
|
1669
|
-
| `superagent_*` tools do not exist | The bundle row is not mounted, or the host refused to load the plugin. | Run `--dump-config` and check for the `@xiangyixie/dsh-superagent` block; reinstall with `dsh plugin --profile <p> add @xiangyixie/dsh-superagent@0.16.
|
|
1669
|
+
| `superagent_*` tools do not exist | The bundle row is not mounted, or the host refused to load the plugin. | Run `--dump-config` and check for the `@xiangyixie/dsh-superagent` block; reinstall with `dsh plugin --profile <p> add @xiangyixie/dsh-superagent@0.16.3` and read the host log for `[dsh-superagent]` lines. |
|
|
1670
1670
|
| `Cannot find module .../lib/control.js` (or `watch.js` / `report.js` / `wizard.js`), or `[dsh-superagent] dsh-superagent failed to load because a file it imports is missing: ...` in the host log | The copy in that profile is incomplete — an `add` that was interrupted leaves a partial extraction. From 0.14.3 the entry point names the missing file itself. The published package is not the cause: every version ships all thirty-four `lib/` files. | Delete the plugin's directory under the profile's `node_modules` (scoped `@xiangyixie/dsh-superagent`, or unscoped `dsh-superagent` from an older tarball install) and run the same `add` command again, with the version number. Do not copy files in by hand. |
|
|
1671
1671
|
| `[error] the model provider rejected the API key` | The key env var is missing in the process that started the host. | Export `DEEPSEEK_API_KEY` (the default route) or the variable your route names, then restart `dsh`. |
|
|
1672
1672
|
| `MISSING_CREDENTIAL ... no API key for provider route "..."` | The profile's route has no credential in the environment. | Set the env var named for that route and restart. The error line names the route, so use that, not this page. |
|
package/README.md
CHANGED
|
@@ -36,12 +36,12 @@ dsh-superagent 把这件事接过去:你说一句目标,它负责拆、负
|
|
|
36
36
|
|
|
37
37
|
### 1. 装
|
|
38
38
|
|
|
39
|
-
桌面端:侧边栏 **插件** → **Add plugin** → 输入 `@xiangyixie/dsh-superagent@0.16.
|
|
39
|
+
桌面端:侧边栏 **插件** → **Add plugin** → 输入 `@xiangyixie/dsh-superagent@0.16.3` → 安装。
|
|
40
40
|
|
|
41
41
|
命令行:
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
dsh plugin --profile web add @xiangyixie/dsh-superagent@0.16.
|
|
44
|
+
dsh plugin --profile web add @xiangyixie/dsh-superagent@0.16.3
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
装完**重启 DSH**(插件只在宿主启动时加载一次)。也可以从「发现」页添加[插件索引](https://raw.githubusercontent.com/LittleChenLiya/dsh-superagent/main/plugin-index.json)一键安装;升级一律先 `remove` 再 `add`。
|
|
@@ -1090,7 +1090,7 @@ SHA-256)。`--format html` 把同样的内容写成一个自包含
|
|
|
1090
1090
|
|
|
1091
1091
|
| 你看到的 | 含义 | 怎么办 |
|
|
1092
1092
|
| --- | --- | --- |
|
|
1093
|
-
| `superagent_*` 工具不存在 | bundle 行没挂上,或者宿主拒绝加载插件。 | 跑 `--dump-config` 查 `@xiangyixie/dsh-superagent` 块;用 `dsh plugin --profile <p> add @xiangyixie/dsh-superagent@0.16.
|
|
1093
|
+
| `superagent_*` 工具不存在 | bundle 行没挂上,或者宿主拒绝加载插件。 | 跑 `--dump-config` 查 `@xiangyixie/dsh-superagent` 块;用 `dsh plugin --profile <p> add @xiangyixie/dsh-superagent@0.16.3` 重装,并在宿主日志里找 `[dsh-superagent]` 行。 |
|
|
1094
1094
|
| `Cannot find module .../lib/control.js`(或 `watch.js` / `report.js` / `wizard.js`),或宿主日志里的 `[dsh-superagent] dsh-superagent failed to load because a file it imports is missing: ...` | 那个 profile 里的副本不完整——被中断的 `add` 会留下残缺的解包结果。0.14.3 起的入口会直接点名缺哪个文件。已发布的包不是原因:每个版本都带全部三十四个 `lib/` 文件。 | 删掉 profile 的 `node_modules` 下该插件的目录(带 scope 的 `@xiangyixie/dsh-superagent`,或旧 tarball 安装留下的无 scope 的 `dsh-superagent`),再用同一条 `add` 命令重装,并带上版本号。不要手工拷贝文件进去。 |
|
|
1095
1095
|
| `[error] the model provider rejected the API key` | 启动宿主的那个进程里缺 key 环境变量。 | 导出 `DEEPSEEK_API_KEY`(默认路由)或你那条路由声明的变量,然后重启 `dsh`。 |
|
|
1096
1096
|
| `MISSING_CREDENTIAL ... no API key for provider route "..."` | profile 的路由在环境里没有凭据。 | 设置该路由对应的环境变量并重启。错误行里写了路由名,以它为准,不要照本文。 |
|
package/README.zh.md
CHANGED
|
@@ -36,12 +36,12 @@ dsh-superagent 把这件事接过去:你说一句目标,它负责拆、负
|
|
|
36
36
|
|
|
37
37
|
### 1. 装
|
|
38
38
|
|
|
39
|
-
桌面端:侧边栏 **插件** → **Add plugin** → 输入 `@xiangyixie/dsh-superagent@0.16.
|
|
39
|
+
桌面端:侧边栏 **插件** → **Add plugin** → 输入 `@xiangyixie/dsh-superagent@0.16.3` → 安装。
|
|
40
40
|
|
|
41
41
|
命令行:
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
dsh plugin --profile web add @xiangyixie/dsh-superagent@0.16.
|
|
44
|
+
dsh plugin --profile web add @xiangyixie/dsh-superagent@0.16.3
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
装完**重启 DSH**(插件只在宿主启动时加载一次)。也可以从「发现」页添加[插件索引](https://raw.githubusercontent.com/LittleChenLiya/dsh-superagent/main/plugin-index.json)一键安装;升级一律先 `remove` 再 `add`。
|
|
@@ -1090,7 +1090,7 @@ SHA-256)。`--format html` 把同样的内容写成一个自包含
|
|
|
1090
1090
|
|
|
1091
1091
|
| 你看到的 | 含义 | 怎么办 |
|
|
1092
1092
|
| --- | --- | --- |
|
|
1093
|
-
| `superagent_*` 工具不存在 | bundle 行没挂上,或者宿主拒绝加载插件。 | 跑 `--dump-config` 查 `@xiangyixie/dsh-superagent` 块;用 `dsh plugin --profile <p> add @xiangyixie/dsh-superagent@0.16.
|
|
1093
|
+
| `superagent_*` 工具不存在 | bundle 行没挂上,或者宿主拒绝加载插件。 | 跑 `--dump-config` 查 `@xiangyixie/dsh-superagent` 块;用 `dsh plugin --profile <p> add @xiangyixie/dsh-superagent@0.16.3` 重装,并在宿主日志里找 `[dsh-superagent]` 行。 |
|
|
1094
1094
|
| `Cannot find module .../lib/control.js`(或 `watch.js` / `report.js` / `wizard.js`),或宿主日志里的 `[dsh-superagent] dsh-superagent failed to load because a file it imports is missing: ...` | 那个 profile 里的副本不完整——被中断的 `add` 会留下残缺的解包结果。0.14.3 起的入口会直接点名缺哪个文件。已发布的包不是原因:每个版本都带全部三十四个 `lib/` 文件。 | 删掉 profile 的 `node_modules` 下该插件的目录(带 scope 的 `@xiangyixie/dsh-superagent`,或旧 tarball 安装留下的无 scope 的 `dsh-superagent`),再用同一条 `add` 命令重装,并带上版本号。不要手工拷贝文件进去。 |
|
|
1095
1095
|
| `[error] the model provider rejected the API key` | 启动宿主的那个进程里缺 key 环境变量。 | 导出 `DEEPSEEK_API_KEY`(默认路由)或你那条路由声明的变量,然后重启 `dsh`。 |
|
|
1096
1096
|
| `MISSING_CREDENTIAL ... no API key for provider route "..."` | profile 的路由在环境里没有凭据。 | 设置该路由对应的环境变量并重启。错误行里写了路由名,以它为准,不要照本文。 |
|
package/lib/client.js
CHANGED
|
@@ -52,13 +52,27 @@ window.__ModuleLoader__.load({
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
const h = react ? react.createElement : null
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const
|
|
55
|
+
// React.memo / React.forwardRef components are objects, not functions.
|
|
56
|
+
// Checking typeof alone silently rejected MarkdownText and Button and made
|
|
57
|
+
// assistant prose fall back to raw text.
|
|
58
|
+
const isComponent = value => typeof value === 'function'
|
|
59
|
+
|| (value !== null && typeof value === 'object'
|
|
60
|
+
&& (value.$$typeof === Symbol.for('react.memo') || value.$$typeof === Symbol.for('react.forward_ref')))
|
|
61
|
+
const pick = name => (isComponent(ui?.[name]) ? ui[name] : null)
|
|
62
|
+
const Button = pick('Button')
|
|
63
|
+
const FishLogo = pick('FishLogo')
|
|
64
|
+
const MarkdownText = pick('MarkdownText')
|
|
65
|
+
const UserMessageBubble = pick('UserMessageBubble')
|
|
66
|
+
const StateDot = pick('StateDot')
|
|
67
|
+
const Menu = pick('Menu')
|
|
68
|
+
const Tooltip = pick('Tooltip')
|
|
69
|
+
const MISSING_PRIMITIVES = ['Button', 'FishLogo', 'MarkdownText', 'UserMessageBubble', 'StateDot', 'Menu', 'Tooltip']
|
|
70
|
+
.filter(name => !pick(name))
|
|
71
|
+
if (!ui) {
|
|
72
|
+
console.warn('[dsh-superagent] host primitives module is absent; assistant text renders as plain text')
|
|
73
|
+
} else if (MISSING_PRIMITIVES.length > 0) {
|
|
74
|
+
console.warn(`[dsh-superagent] host primitives unavailable: ${MISSING_PRIMITIVES.join(', ')}; those spots fall back to plain rendering`)
|
|
75
|
+
}
|
|
62
76
|
const ICONS = {
|
|
63
77
|
spark: ui?.IconSparkleRegular ?? ui?.IconSparkleMedium,
|
|
64
78
|
send: ui?.IconSendOutlineRegular ?? ui?.IconSendOutlineMedium,
|
|
@@ -101,6 +115,35 @@ window.__ModuleLoader__.load({
|
|
|
101
115
|
return react.cloneElement(node, { key, title: label })
|
|
102
116
|
}
|
|
103
117
|
|
|
118
|
+
const MARKDOWN_FALLBACKS = new Set()
|
|
119
|
+
function noteMarkdownFallback(id, reason) {
|
|
120
|
+
if (MARKDOWN_FALLBACKS.has(id)) return
|
|
121
|
+
MARKDOWN_FALLBACKS.add(id)
|
|
122
|
+
console.error(`[dsh-superagent] assistant message ${id} fell back to plain text: ${reason}`)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// A throw inside MarkdownText must be visible, not silently swallowed by
|
|
126
|
+
// React. This logs once and keeps the prose on screen as plain text.
|
|
127
|
+
const MarkdownBoundary = react && typeof react.Component === 'function'
|
|
128
|
+
? class MarkdownBoundary extends react.Component {
|
|
129
|
+
constructor(props) {
|
|
130
|
+
super(props)
|
|
131
|
+
this.state = { failed: false }
|
|
132
|
+
}
|
|
133
|
+
static getDerivedStateFromError() {
|
|
134
|
+
return { failed: true }
|
|
135
|
+
}
|
|
136
|
+
componentDidCatch(error) {
|
|
137
|
+
noteMarkdownFallback(this.props.messageId, error?.message ?? String(error))
|
|
138
|
+
}
|
|
139
|
+
render() {
|
|
140
|
+
return this.state.failed
|
|
141
|
+
? h('div', { className: 'dsa-md-plain' }, this.props.text)
|
|
142
|
+
: this.props.children
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
: null
|
|
146
|
+
|
|
104
147
|
/**
|
|
105
148
|
* One class sheet for the panel. Every value is copied from the host's own
|
|
106
149
|
* modules: header 76px / 10-28-0-20, sidebar rows 32px / radius 12 / 5px 9px,
|
|
@@ -542,14 +585,19 @@ window.__ModuleLoader__.load({
|
|
|
542
585
|
})))
|
|
543
586
|
}
|
|
544
587
|
if (message.text) {
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
key: 'text',
|
|
588
|
+
if (MarkdownText) {
|
|
589
|
+
const node = h(MarkdownText, {
|
|
548
590
|
text: message.text,
|
|
549
591
|
streaming: message.streaming === true,
|
|
550
592
|
labels: MARKDOWN_LABELS,
|
|
551
593
|
})
|
|
552
|
-
|
|
594
|
+
children.push(MarkdownBoundary
|
|
595
|
+
? h(MarkdownBoundary, { key: 'text', messageId: message.id, text: message.text }, node)
|
|
596
|
+
: react.cloneElement(node, { key: 'text' }))
|
|
597
|
+
} else {
|
|
598
|
+
noteMarkdownFallback(message.id, 'host MarkdownText export is unavailable')
|
|
599
|
+
children.push(h('div', { key: 'text', className: 'dsa-md-plain' }, message.text))
|
|
600
|
+
}
|
|
553
601
|
}
|
|
554
602
|
return h('div', { className: 'dsa-assistant' }, children)
|
|
555
603
|
}
|