@xiangyixie/dsh-superagent 0.16.7 → 0.16.9
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 +6 -114
- 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.9 — 2026-11-17
|
|
12
|
+
|
|
13
|
+
### 变化
|
|
14
|
+
|
|
15
|
+
- **去掉输入区的「放进工作区」附件按钮。** 单会话面板不再需要手动上传文件;
|
|
16
|
+
超级智能体直接在工作区里读写文件。隐藏的 file input、上传调用、`busy`
|
|
17
|
+
状态和附件图标一并删除,输入卡右下角只保留发送/停止。
|
|
18
|
+
- 输入行改为右对齐,去掉左侧工具区,避免留下空白占位。
|
|
19
|
+
|
|
20
|
+
## 0.16.8 — 2026-11-17
|
|
21
|
+
|
|
22
|
+
### 变化
|
|
23
|
+
|
|
24
|
+
- **去掉输入区的「排队 / 插话」选择。** 用户不再需要决定投递方式:空闲时发送
|
|
25
|
+
正常开启一轮,回合进行中发送自动使用 `steer` 立即交给超级智能体,适合连续
|
|
26
|
+
快速发多条消息;对应 `mode` 状态、`Menu` 选择器和 chip 样式一并删除。
|
|
27
|
+
- 输入区只剩附件与发送/停止两个控件;附件按钮从「+」换成宿主回形针图标,
|
|
28
|
+
不再看起来像新建会话,提示文案保持「放进工作区」。
|
|
29
|
+
|
|
11
30
|
## 0.16.7 — 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.9` → 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.9
|
|
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.9` 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.9` → 安装。
|
|
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.9
|
|
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.9` 重装,并在宿主日志里找 `[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.9` → 安装。
|
|
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.9
|
|
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.9` 重装,并在宿主日志里找 `[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
|
@@ -64,9 +64,8 @@ window.__ModuleLoader__.load({
|
|
|
64
64
|
const MarkdownText = pick('MarkdownText')
|
|
65
65
|
const UserMessageBubble = pick('UserMessageBubble')
|
|
66
66
|
const StateDot = pick('StateDot')
|
|
67
|
-
const Menu = pick('Menu')
|
|
68
67
|
const Tooltip = pick('Tooltip')
|
|
69
|
-
const MISSING_PRIMITIVES = ['Button', 'FishLogo', 'MarkdownText', 'UserMessageBubble', 'StateDot', '
|
|
68
|
+
const MISSING_PRIMITIVES = ['Button', 'FishLogo', 'MarkdownText', 'UserMessageBubble', 'StateDot', 'Tooltip']
|
|
70
69
|
.filter(name => !pick(name))
|
|
71
70
|
if (!ui) {
|
|
72
71
|
console.warn('[dsh-superagent] host primitives module is absent; assistant text renders as plain text')
|
|
@@ -76,13 +75,11 @@ window.__ModuleLoader__.load({
|
|
|
76
75
|
const ICONS = {
|
|
77
76
|
spark: ui?.IconSparkleRegular ?? ui?.IconSparkleMedium,
|
|
78
77
|
send: ui?.IconSendOutlineRegular ?? ui?.IconSendOutlineMedium,
|
|
79
|
-
plus: ui?.IconPlusOutlineRegular ?? ui?.IconPlusOutlineMedium,
|
|
80
78
|
stop: ui?.IconStopFillRegular ?? ui?.IconStopFillMedium,
|
|
81
79
|
clock: ui?.IconClockOutlineRegular ?? ui?.IconClockOutlineMedium,
|
|
82
80
|
check: ui?.IconCheckOutlineRegular ?? ui?.IconCheckOutlineMedium,
|
|
83
81
|
close: ui?.IconCloseOutlineRegular ?? ui?.IconCloseOutlineMedium,
|
|
84
82
|
folder: ui?.IconFolderCloseRegular ?? ui?.IconFolderCloseMedium,
|
|
85
|
-
chevron: ui?.IconChevronDownOutlineRegular ?? ui?.IconChevronDownOutlineMedium,
|
|
86
83
|
panel: ui?.IconPanelLeftOutlineRegular ?? ui?.IconPanelLeftOutlineMedium,
|
|
87
84
|
}
|
|
88
85
|
// MarkdownText reads `labels.code` on every fenced block, so the host
|
|
@@ -99,11 +96,7 @@ window.__ModuleLoader__.load({
|
|
|
99
96
|
},
|
|
100
97
|
footnotes: '脚注',
|
|
101
98
|
}
|
|
102
|
-
/** Composer delivery
|
|
103
|
-
const MODES = [
|
|
104
|
-
{ id: 'queue', label: '排队' },
|
|
105
|
-
{ id: 'steer', label: '插话' },
|
|
106
|
-
]
|
|
99
|
+
/** Composer delivery behaviour: idle sends start a turn, running sends steer. */
|
|
107
100
|
const RAIL_KEY = 'dsh-superagent.rail-open'
|
|
108
101
|
function readRailOpen() {
|
|
109
102
|
try {
|
|
@@ -197,13 +190,11 @@ window.__ModuleLoader__.load({
|
|
|
197
190
|
.dsa-input{box-sizing:border-box;width:100%;min-height:36px;max-height:336px;padding:4px 8px 0 14px;border:0;outline:none;background:transparent;color:var(--dsw-alias-label-primary,#f9fafb);font:inherit;font-size:var(--dsh-content-font-size,14px);line-height:calc(24px + var(--dsh-content-font-delta,0px));resize:none;overflow-y:auto}
|
|
198
191
|
.dsa-input::placeholder{color:var(--dsw-alias-label-caption,rgb(129,133,140))}
|
|
199
192
|
.dsa-card[data-hero=true] .dsa-input{min-height:52px}
|
|
200
|
-
.dsa-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:
|
|
201
|
-
.dsa-
|
|
193
|
+
.dsa-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:12px;padding:2px 8px 6px;min-width:0}
|
|
194
|
+
.dsa-trailing{display:flex;align-items:center;min-width:0;gap:12px}
|
|
202
195
|
.dsa-trailing{margin-left:auto;flex:none}
|
|
203
196
|
.dsa-add{display:grid;place-items:center;flex:none;width:28px;height:28px;border:0;border-radius:999px;background:var(--dsw-specific-selector,rgba(255,255,255,.08));color:var(--dsw-alias-label-primary,#f9fafb);cursor:pointer}
|
|
204
197
|
.dsa-add:hover{background:var(--dsw-alias-interactive-bg-hover-solid,rgba(255,255,255,.14))}
|
|
205
|
-
.dsa-chip{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 8px;border:0;border-radius:var(--dsw-radius-sm,8px);background-color:transparent;color:var(--dsw-alias-label-secondary,rgb(207,211,214));font-size:13px;line-height:20px;font-weight:500;white-space:nowrap;cursor:pointer;appearance:none}
|
|
206
|
-
.dsa-chip:hover,.dsa-chip[aria-expanded=true]{background-color:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.08))}
|
|
207
198
|
.dsa-send{display:grid;place-items:center;flex:none;width:34px;height:34px;border:0;border-radius:999px;background:var(--dsw-alias-button-info-fill,#3964fe);color:var(--dsw-alias-label-on-color,#fff);cursor:pointer;transform:translateY(-2px);transition:background-color 100ms ease}
|
|
208
199
|
.dsa-send:hover:not(:disabled){background:var(--dsw-alias-button-info-hover,#2f57e6)}
|
|
209
200
|
.dsa-send:disabled{opacity:.4;cursor:default}
|
|
@@ -322,7 +313,6 @@ window.__ModuleLoader__.load({
|
|
|
322
313
|
messages: [],
|
|
323
314
|
approvals: [],
|
|
324
315
|
runs: [],
|
|
325
|
-
mode: 'queue',
|
|
326
316
|
toast: null,
|
|
327
317
|
canceling: false,
|
|
328
318
|
approvalBusy: {},
|
|
@@ -653,52 +643,10 @@ window.__ModuleLoader__.load({
|
|
|
653
643
|
}))
|
|
654
644
|
}
|
|
655
645
|
|
|
656
|
-
/**
|
|
657
|
-
* Delivery-mode picker. The host Menu carries the theme, radius, row height,
|
|
658
|
-
* hover fill, check mark, shadow, keyboard handling, outside dismiss and
|
|
659
|
-
* focus return; without it the chip still never falls back to a native
|
|
660
|
-
* `<select>` (it just cycles on click).
|
|
661
|
-
*/
|
|
662
|
-
function Chooser(props) {
|
|
663
|
-
const label = MODES.find(entry => entry.id === props.mode)?.label ?? '排队'
|
|
664
|
-
if (!Menu) {
|
|
665
|
-
return h('button', {
|
|
666
|
-
type: 'button',
|
|
667
|
-
className: 'dsa-chip',
|
|
668
|
-
'aria-label': `发送方式:${label},点击切换`,
|
|
669
|
-
onClick: () => props.onMode(props.mode === 'queue' ? 'steer' : 'queue'),
|
|
670
|
-
}, h('span', null, label), h(Icon, { of: 'chevron', size: 12 }))
|
|
671
|
-
}
|
|
672
|
-
return h(Menu, {
|
|
673
|
-
open: props.open,
|
|
674
|
-
anchor: h('button', {
|
|
675
|
-
type: 'button',
|
|
676
|
-
className: 'dsa-chip',
|
|
677
|
-
'aria-haspopup': 'menu',
|
|
678
|
-
'aria-expanded': props.open ? 'true' : 'false',
|
|
679
|
-
'aria-label': `发送方式:${label}`,
|
|
680
|
-
onClick: () => props.onOpenChange(!props.open),
|
|
681
|
-
}, h('span', null, label), h(Icon, { of: 'chevron', size: 12 })),
|
|
682
|
-
items: MODES,
|
|
683
|
-
selectedId: props.mode,
|
|
684
|
-
side: 'top',
|
|
685
|
-
align: 'start',
|
|
686
|
-
portal: true,
|
|
687
|
-
onClose: () => props.onOpenChange(false),
|
|
688
|
-
onSelect: id => {
|
|
689
|
-
props.onOpenChange(false)
|
|
690
|
-
if (id !== props.mode) props.onMode(id)
|
|
691
|
-
},
|
|
692
|
-
})
|
|
693
|
-
}
|
|
694
|
-
|
|
695
646
|
function Composer(props) {
|
|
696
647
|
const { hero, disabled, onSend } = props
|
|
697
648
|
const [text, setText] = react.useState('')
|
|
698
|
-
const [busy, setBusy] = react.useState(false)
|
|
699
|
-
const [chooser, setChooser] = react.useState(false)
|
|
700
649
|
const areaRef = react.useRef(null)
|
|
701
|
-
const fileRef = react.useRef(null)
|
|
702
650
|
|
|
703
651
|
const grow = () => {
|
|
704
652
|
const area = areaRef.current
|
|
@@ -707,31 +655,6 @@ window.__ModuleLoader__.load({
|
|
|
707
655
|
area.style.height = `${Math.min(area.scrollHeight, 336)}px`
|
|
708
656
|
}
|
|
709
657
|
|
|
710
|
-
/** Files are copied into the workspace by the console, then the path is typed. */
|
|
711
|
-
const attach = async files => {
|
|
712
|
-
const list = Array.from(files || []).filter(Boolean)
|
|
713
|
-
if (list.length === 0) return
|
|
714
|
-
setBusy(true)
|
|
715
|
-
for (const file of list) {
|
|
716
|
-
try {
|
|
717
|
-
const bytes = new Uint8Array(await file.arrayBuffer())
|
|
718
|
-
let binary = ''
|
|
719
|
-
for (let index = 0; index < bytes.length; index += 1) binary += String.fromCharCode(bytes[index])
|
|
720
|
-
const data = await call('/upload', {
|
|
721
|
-
method: 'POST',
|
|
722
|
-
body: JSON.stringify({ sessionId: props.model.sessionId, name: file.name, data: btoa(binary) }),
|
|
723
|
-
})
|
|
724
|
-
if (data?.path) {
|
|
725
|
-
setText(current => `${current}${current && !current.endsWith(' ') ? ' ' : ''}${data.path} `)
|
|
726
|
-
}
|
|
727
|
-
} catch (error) {
|
|
728
|
-
props.onError?.(`${file.name}:${error.message}`)
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
setBusy(false)
|
|
732
|
-
grow()
|
|
733
|
-
}
|
|
734
|
-
|
|
735
658
|
const submit = () => {
|
|
736
659
|
const value = text.trim()
|
|
737
660
|
if (!value || disabled) return
|
|
@@ -761,30 +684,6 @@ window.__ModuleLoader__.load({
|
|
|
761
684
|
},
|
|
762
685
|
}),
|
|
763
686
|
h('div', { className: 'dsa-row' },
|
|
764
|
-
h('div', { className: 'dsa-tools' },
|
|
765
|
-
h('input', {
|
|
766
|
-
ref: fileRef,
|
|
767
|
-
type: 'file',
|
|
768
|
-
multiple: true,
|
|
769
|
-
style: { display: 'none' },
|
|
770
|
-
onChange: event => {
|
|
771
|
-
attach(event.target.files)
|
|
772
|
-
event.target.value = ''
|
|
773
|
-
},
|
|
774
|
-
}),
|
|
775
|
-
tipped('放进工作区', h('button', {
|
|
776
|
-
type: 'button',
|
|
777
|
-
className: 'dsa-add',
|
|
778
|
-
disabled: busy,
|
|
779
|
-
'aria-label': '放进工作区',
|
|
780
|
-
onClick: () => fileRef.current?.click(),
|
|
781
|
-
}, h(Icon, { of: 'plus', size: 16 })), 'top'),
|
|
782
|
-
h(Chooser, {
|
|
783
|
-
mode: props.mode ?? 'queue',
|
|
784
|
-
open: chooser,
|
|
785
|
-
onOpenChange: setChooser,
|
|
786
|
-
onMode: props.onMode,
|
|
787
|
-
})),
|
|
788
687
|
h('div', { className: 'dsa-trailing' },
|
|
789
688
|
props.running
|
|
790
689
|
? tipped('停止本轮', h('button', {
|
|
@@ -895,7 +794,6 @@ window.__ModuleLoader__.load({
|
|
|
895
794
|
const runningCount = Array.isArray(model.runs)
|
|
896
795
|
? model.runs.filter(run => run.status === 'running').length
|
|
897
796
|
: 0
|
|
898
|
-
const notify = text => dispatch({ type: 'toast', text })
|
|
899
797
|
return h('div', { className: 'dsa-root', 'data-rail': railOpen ? 'open' : 'closed' },
|
|
900
798
|
h(Header, {
|
|
901
799
|
railOpen,
|
|
@@ -908,14 +806,11 @@ window.__ModuleLoader__.load({
|
|
|
908
806
|
empty
|
|
909
807
|
? h(Hero, {
|
|
910
808
|
model,
|
|
911
|
-
mode: model.mode,
|
|
912
809
|
disabled: model.sending,
|
|
913
810
|
running: model.typing,
|
|
914
811
|
canceling: model.canceling,
|
|
915
812
|
onStop: () => dispatch({ type: 'cancel' }),
|
|
916
813
|
onSend: text => dispatch({ type: 'send', text }),
|
|
917
|
-
onMode: mode => dispatch({ type: 'mode', mode }),
|
|
918
|
-
onError: notify,
|
|
919
814
|
})
|
|
920
815
|
: h(Transcript, { model, scrollRef: model.scrollRef }),
|
|
921
816
|
h(Approvals, {
|
|
@@ -925,14 +820,11 @@ window.__ModuleLoader__.load({
|
|
|
925
820
|
}),
|
|
926
821
|
empty ? null : h(Composer, {
|
|
927
822
|
model,
|
|
928
|
-
mode: model.mode,
|
|
929
823
|
disabled: model.sending || model.capabilities?.chat === false,
|
|
930
824
|
running: model.typing,
|
|
931
825
|
canceling: model.canceling,
|
|
932
826
|
onStop: () => dispatch({ type: 'cancel' }),
|
|
933
827
|
onSend: text => dispatch({ type: 'send', text }),
|
|
934
|
-
onMode: mode => dispatch({ type: 'mode', mode }),
|
|
935
|
-
onError: notify,
|
|
936
828
|
})),
|
|
937
829
|
h(Rail, { model })))
|
|
938
830
|
}
|
|
@@ -1026,10 +918,11 @@ window.__ModuleLoader__.load({
|
|
|
1026
918
|
typing: true,
|
|
1027
919
|
messages: [...current.messages, { id, role: 'user', text, at: Date.now(), pending: true }],
|
|
1028
920
|
}))
|
|
921
|
+
const mode = modelRef.current.typing ? 'steer' : 'queue'
|
|
1029
922
|
try {
|
|
1030
923
|
await call('/message', {
|
|
1031
924
|
method: 'POST',
|
|
1032
|
-
body: JSON.stringify({ text, mode
|
|
925
|
+
body: JSON.stringify({ text, mode, sessionId }),
|
|
1033
926
|
})
|
|
1034
927
|
} catch (error) {
|
|
1035
928
|
patch(current => ({
|
|
@@ -1071,7 +964,6 @@ window.__ModuleLoader__.load({
|
|
|
1071
964
|
patch(current => ({ ...current, phase: 'loading', reason: '' }))
|
|
1072
965
|
setAttempt(value => value + 1)
|
|
1073
966
|
},
|
|
1074
|
-
mode: action => patch(current => ({ ...current, mode: action.mode })),
|
|
1075
967
|
toast: action => patch(current => ({ ...current, toast: { kind: 'err', text: String(action.text ?? '') } })),
|
|
1076
968
|
}
|
|
1077
969
|
|