dsh-question-timeout-protection 0.1.3 → 0.2.0
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 +34 -17
- package/README_en-US.md +34 -17
- package/dist/client.js +486 -54
- package/dist/index.mjs +249 -33
- package/package.json +8 -8
- package/src/translation/.example_zh-CN.ini +5 -3
- package/src/translation/en-US.ini +5 -3
- package/src/translation/zh-CN.ini +5 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# dsh-question-timeout-protection
|
|
4
4
|
|
|
5
|
-
[](https://github.com/JularDepick/dsh-question-timeout-protection/releases)
|
|
6
6
|
[](./COPYRIGHT)
|
|
7
7
|
[](./LICENSE)
|
|
8
8
|
|
|
@@ -36,7 +36,7 @@ dsh 默认的提问是阻塞式的: 模型问完就一直等, 你离开一会儿
|
|
|
36
36
|
|
|
37
37
|
### 前置条件
|
|
38
38
|
|
|
39
|
-
- dsh
|
|
39
|
+
- dsh 版本落在 `>=0.2.1-rc.1 <0.2.2-rc.0 || >=0.2.2-rc.0 <0.2.3-rc.1` 之内, 不满足会被安装与启动阶段拒绝
|
|
40
40
|
- Node.js >= 20
|
|
41
41
|
|
|
42
42
|
### 方式一: 从 npm 安装
|
|
@@ -47,7 +47,7 @@ dsh 原生支持从 npm 安装插件:
|
|
|
47
47
|
dsh plugin --profile <profile> add dsh-question-timeout-protection
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
按包名安装取 npm 上 latest 标签指向的版本(当前是 0.1.4). 0.1.2 及更早版本声明的 dsh 上限不高于 `0.2.2-rc.2`, 在 dsh `0.2.2-rc.3` 起的宿主上会被安装与启动阶段拒绝; 这时用 `dsh plugin --profile <profile> add dsh-question-timeout-protection@<版本>` 固定版本. 0.1.3 起的版本支持到 `<0.2.3-rc.1`, 也可以按下面的方式二至方式四从源码或 tarball 安装.
|
|
51
51
|
|
|
52
52
|
### 方式二: 从源码构建后安装
|
|
53
53
|
|
|
@@ -60,7 +60,7 @@ dsh plugin --profile <profile> add ./release/<tarball>
|
|
|
60
60
|
dsh plugin --profile <profile> add <绝对路径>
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
`pnpm pack` 会先构建, 完成后把 tarball 移入仓库根目录的 `release/`, 文件名形如 `dsh-question-timeout-protection-0.
|
|
63
|
+
`pnpm pack` 会先构建, 完成后把 tarball 移入仓库根目录的 `release/`, 文件名形如 `dsh-question-timeout-protection-0.2.0.tgz`. 沙箱内生命周期脚本被拦截时改用 `pnpm run pack:release`, 产物相同. `add` 的路径要以 `./` 或 `../` 开头才会按你执行命令的目录解析, 不带前缀会被当成包名去查注册表.
|
|
64
64
|
|
|
65
65
|
### 方式三: 直接从 GitHub 源码安装
|
|
66
66
|
|
|
@@ -98,7 +98,7 @@ dsh plugin --profile <profile> add <绝对路径>
|
|
|
98
98
|
|
|
99
99
|
### 倒计时与临期预警
|
|
100
100
|
|
|
101
|
-
倒计时只在**正在进行的提问**上出现, 按插件自己的截止时间走, 你聚焦输入框或开始打字都不会让它暂停. 剩余时间进入警示秒数时数字变红闪烁; 到了截止时间, 插件撤下自己的倒计时与故障提示, 把卡片还原成宿主自己的等待状态, 等结算回执到达后再决定锁定收起还是交还宿主.
|
|
101
|
+
倒计时只在**正在进行的提问**上出现, 按插件自己的截止时间走, 你聚焦输入框或开始打字都不会让它暂停. 截止时间取自模型调用提问工具时传的顶层 `timeout`(秒); 没传时用本插件的 `timeoutSeconds` 配置(默认 120 秒). 写成题目对象内部的 `timeout` 属于误用, 插件只在顶层缺省时兼容读取题目里的第一个合法值(`-1`、`0` 与小数会被跳过). 剩余时间进入警示秒数时数字变红闪烁; 到了截止时间, 插件撤下自己的倒计时与故障提示, 把卡片还原成宿主自己的等待状态, 等结算回执到达后再决定锁定收起还是交还宿主.
|
|
102
102
|
|
|
103
103
|
历史提问与已结算回答的只读卡片上不会出现倒计时.
|
|
104
104
|
|
|
@@ -106,13 +106,13 @@ dsh plugin --profile <profile> add <绝对路径>
|
|
|
106
106
|
|
|
107
107
|
倒计时右侧的「无限等待」按钮, 点击后本次提问不再有截止时间, 倒计时冻结为「已暂停」, 直到你提交才结束.
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
点击后界面立即冻结倒计时, 同时向服务端登记这次「无限等待」; 登记失败或回执超时时撤回冻结, 不再冻结, 宿主继续计时, 倒计时位置改为显示「无法无限等待」, 这一轮交还宿主.
|
|
110
110
|
|
|
111
111
|
### 自动无限等待
|
|
112
112
|
|
|
113
113
|
工具栏模型选择控件左侧有一个常开开关「问答自动无限等待」. 开启后, 每一条新提问都自动进入无限等待, 正在等待的那条也会立刻冻结, 效果与手动点一次「无限等待」相同.
|
|
114
114
|
|
|
115
|
-
开关状态存在浏览器本地, 刷新后保留. 关闭开关只影响之后的新提问, 已经冻结的提问不会恢复倒计时, 仍由你提交结束.
|
|
115
|
+
开关状态存在浏览器本地, 刷新后保留. 关闭开关只影响之后的新提问, 已经冻结的提问不会恢复倒计时, 仍由你提交结束. 多个标签页开着同一会话时, 在其中一个页面切换开关, 其他页面会在下一次界面扫描时跟上, 正在等待的提问也会随之冻结.
|
|
116
116
|
|
|
117
117
|
这个开关只在卡片增强与无限等待都开启时出现.
|
|
118
118
|
|
|
@@ -124,11 +124,21 @@ dsh plugin --profile <profile> add <绝对路径>
|
|
|
124
124
|
|
|
125
125
|
草稿只存在内存里, 刷新页面后气泡与记录都会消失.
|
|
126
126
|
|
|
127
|
+
### 单选题: 选项与自定义回答
|
|
128
|
+
|
|
129
|
+
宿主的单选题把"输入框里有内容"当成选中了自定义回答, 因此预设选项和自定义内容无法同时成立, 点选项还会清空已输入的内容. 插件改成显式选择: 在自定义输入框左侧挂一枚与预设选项同地位的单选按钮, 是否选中自定义只看这枚按钮, 不看输入框里有没有字.
|
|
130
|
+
|
|
131
|
+
- 选中自定义时: 预设选项的选中底色被压掉, 提交的就是自定义内容, 已选为空
|
|
132
|
+
- 选中某个预设选项时: 已输入的自定义内容不会丢, 输入框下方会出现「已保留自定义内容: …(点这里选用)」, 点它即可切回自定义
|
|
133
|
+
- 选中自定义但输入框为空时, 由宿主自己的校验拦下提交(提示请先作答), 插件不再额外拦截
|
|
134
|
+
- 多选题不受影响, 自定义与选项仍可并存
|
|
135
|
+
- 已输入的自定义内容与「是否选中自定义」会写进 localStorage, 刷新后仍在(按调用标识保留最近 64 个)
|
|
136
|
+
|
|
127
137
|
### 注入到上下文
|
|
128
138
|
|
|
129
|
-
这一项默认开启. 客户端在作答期间始终把草稿快照上报给服务端(
|
|
139
|
+
这一项默认开启. 客户端在作答期间始终把草稿快照上报给服务端(适配器不读兜底范围 `fallback`, 只有配置页的勾选映射读它), 由服务端按这一项决定是否取用: 开启时工具到期取用最新一份, 按题随 pending 结果带回模型上下文, 每道题带自己的已选与补充; 关闭时快照只留在服务端并在调用结束时清掉.
|
|
130
140
|
|
|
131
|
-
|
|
141
|
+
超时说明与草稿放在同一个结果里. 带回草稿时, 说明要求模型自行判断草稿完整度并决定下一步, 判断过程不告知用户, 但要在下一步之后总结报告这次问答的决策结果.
|
|
132
142
|
|
|
133
143
|
关闭这一项后, 插件只收起卡片, 不把草稿交给模型.
|
|
134
144
|
|
|
@@ -139,11 +149,11 @@ dsh plugin --profile <profile> add <绝对路径>
|
|
|
139
149
|
| 配置项 | 取值 | 默认值 | 界面 | 说明 |
|
|
140
150
|
|:---:|:---:|:---:|:---:|:---:|
|
|
141
151
|
| `fallback` | `ui` / `context` / `both` | `both` | 可改一项 | 超时兜底. 界面只给「注入到上下文」勾选, 勾上写 `both`, 不勾写 `ui`. 界面保留草稿恒定开启, 所以不会出现 `context` |
|
|
142
|
-
| `cardEnhancements` | 布尔 | `true` | 固定特性 | 只管装饰: 倒计时与警示闪烁, 单选选项的方形标号填充底色, 提问气泡, 隐藏宿主自带的收起控件与等待文案. 关闭后装饰都不出现, 但超时收尾照常: 该收的卡片仍会被收起与锁定, 草稿仍会按配置上报 |
|
|
152
|
+
| `cardEnhancements` | 布尔 | `true` | 固定特性 | 只管装饰: 倒计时与警示闪烁, 单选选项的方形标号填充底色, 单选题自定义回答的单选按钮与「已保留自定义内容」提示, 提问气泡, 隐藏宿主自带的收起控件与等待文案. 关闭后装饰都不出现, 但超时收尾照常: 该收的卡片仍会被收起与锁定, 草稿仍会按配置上报 |
|
|
143
153
|
| `infiniteWait` | 布尔 | `true` | 固定特性 | 提供「无限等待」按钮与工具栏常开开关, 关闭后两者一并移除 |
|
|
144
154
|
| `draftFallback` | 布尔 | `true` | 固定特性 | 超时收尾开关. 关闭后客户端不再收尾卡片也不再上报草稿, 这一轮交还宿主; 提问仍由插件按时结算 |
|
|
145
155
|
| `warningSeconds` | 数字 | 5 | 不暴露 | 进入红字闪烁的剩余秒数, 取值 1 至 60 |
|
|
146
|
-
| `timeoutSeconds` | 数字 | 120 | 不暴露 | 模型没有显式传等待秒数时用的时长, 取值 1 至 2147483 |
|
|
156
|
+
| `timeoutSeconds` | 数字 | 120 | 不暴露 | 模型没有显式传等待秒数时用的时长, 取值 1 至 2147483; 这是本插件的默认值, 与宿主自带限时提问工具的 120 秒默认值同值但来源不同 |
|
|
147
157
|
|
|
148
158
|
最后两项不在界面暴露, 需要时在该 profile 的 `cordis.patch.yml` 里本插件行的 `config` 中写入, 例如把等待时长改成 300 秒: `config: { timeoutSeconds: 300 }`. 取值越界会在加载期报错. 三个固定特性同样只能经这条路径关闭, 例如 `config: { cardEnhancements: false }`; 该行的其余键必须一并重述, 不能只写改动的键.
|
|
149
159
|
|
|
@@ -151,11 +161,13 @@ dsh plugin --profile <profile> add <绝对路径>
|
|
|
151
161
|
|
|
152
162
|
| 项目 | 版本 |
|
|
153
163
|
|:---:|:---:|
|
|
154
|
-
| dsh | `>=0.2.1-rc.1 <0.2.3-rc.1` |
|
|
164
|
+
| dsh | `>=0.2.1-rc.1 <0.2.2-rc.0 || >=0.2.2-rc.0 <0.2.3-rc.1` |
|
|
155
165
|
| Node.js | >= 20 |
|
|
156
166
|
|
|
157
167
|
宿主 dsh 自身的 Node.js 要求以对应版本的发行说明为准.
|
|
158
168
|
|
|
169
|
+
范围写成两段是为了同时满足两种口径. 宿主自己按 `includePrerelease` 判定, 单段 `>=0.2.1-rc.1 <0.2.3-rc.1` 就够; 而 npm 与 pnpm 校验 peer 依赖时用严格 semver, 带预发布标签的版本只有在区间里出现同一个 `主.次.修订` 三元组的预发布比较器时才放行, 单段范围只点名了 0.2.1 与 0.2.3, 于是 0.2.2-rc.x 会被 peer 侧拒绝. 分成两段并在第二段点名 0.2.2 的预发布后, 两种口径接受的集合一致, 两段并集仍等价于 `>=0.2.1-rc.1 <0.2.3-rc.1`.
|
|
170
|
+
|
|
159
171
|
## 常见问题
|
|
160
172
|
|
|
161
173
|
**超时后我已经输入的内容会丢吗**
|
|
@@ -176,7 +188,7 @@ dsh plugin --profile <profile> add <绝对路径>
|
|
|
176
188
|
|
|
177
189
|
**点了「无限等待」之后会怎样**
|
|
178
190
|
|
|
179
|
-
本次提问不再有截止时间, 模型会一直等, 直到你提交, 或页面与会话结束. 如果状态通道不可用, 按钮不会生效,
|
|
191
|
+
本次提问不再有截止时间, 模型会一直等, 直到你提交, 或页面与会话结束. 如果状态通道不可用, 按钮不会生效, 不再冻结, 倒计时位置显示「无法无限等待」, 这一轮交还宿主继续可作答.
|
|
180
192
|
|
|
181
193
|
**刷新页面后气泡不见了**
|
|
182
194
|
|
|
@@ -198,7 +210,7 @@ dsh plugin --profile <profile> add <绝对路径>
|
|
|
198
210
|
|
|
199
211
|
**依赖宿主提问投影**
|
|
200
212
|
|
|
201
|
-
客户端靠宿主 sessions 服务的 userQuestions 投影判断提问是否进入 continued 态, 草稿上报, 超时收尾与气泡都由它驱动. 该服务缺失或接口改名时插件按会话各打一条 console.warn: 倒计时与卡片装饰仍在,
|
|
213
|
+
客户端靠宿主 sessions 服务的 userQuestions 投影判断提问是否进入 continued 态, 草稿上报, 超时收尾与气泡都由它驱动. 该服务缺失或接口改名时插件按会话各打一条 console.warn: 倒计时与卡片装饰仍在, 卡片仍处于宿主等待状态时草稿照常上报并随工具结果回到模型, 但超时收尾不执行, 气泡不出现.
|
|
202
214
|
|
|
203
215
|
**会话订阅上限**
|
|
204
216
|
|
|
@@ -214,19 +226,24 @@ dsh plugin --profile <profile> add <绝对路径>
|
|
|
214
226
|
|
|
215
227
|
**界面语言**
|
|
216
228
|
|
|
217
|
-
宿主 0.2.2-rc.1 起提供 8 种界面语言, 插件只识别中文与英文标签. 其他语言界面下倒计时, 无限等待按钮与工具栏开关不出现, 插件自绘的气泡与配置页文案回退英文. ja
|
|
229
|
+
宿主 0.2.2-rc.1 起提供 8 种界面语言, 插件只识别中文与英文标签. 其他语言界面下倒计时, 无限等待按钮与工具栏开关不出现, 插件自绘的气泡与配置页文案回退英文. ja 的「回答」与中文同形, 会被插件当成宿主入口短暂隐藏, 但 ja 的关闭按钮文案插件认不出来, 撤座重试用尽后这一轮交还宿主, 入口与卡片一起还原, 因此只有约 3 至 5 秒(取决于扫描触发频率)的过渡期不一致; 其余语言下宿主的「回答」入口与等待文案大多仍然可见. ja 下空草稿超时不会出现插件气泡, 宿主的入口会被短暂隐藏, 交还宿主后同样还原, 仍可点开只读卡片. 卡片关闭在这些语言下点不到宿主的关闭按钮, 撤座重试用尽后这一轮交还宿主: 卡片保持可见可作答(锁定状态会被还原), 由宿主自己的等待状态与「回答」入口承接, 超时结算与草稿上报照常.
|
|
230
|
+
|
|
231
|
+
**PTC 模式下受外层程序预算约束**
|
|
232
|
+
|
|
233
|
+
模型在 `run_code`(PTC 模式)里调用提问工具时, 这一轮提问的寿命受外层程序的 elapsed-time budget 约束: 预算到期时宿主硬停程序并中止在途的提问, 界面上的倒计时会中途消失, 草稿也来不及交给模型. 插件在提问期间登记外层预算, 把等待收敛到「剩余预算减去收尾余量」之内: 提问在预算到期前自己按超时结算, 草稿照常随 pending 结果交给模型, 倒计时也按收敛后的时长显示. 扣除收尾余量后可用时长不足两秒时不开卡片, 直接按预算不足报错并告知模型放宽外层预算, 不会再留下一张可作答的卡片. 「无限等待」不能突破外层预算: 冻结后的提问仍会在预算到期时结束, 只是草稿会被保留. 被中断的提问在工具行上留下只读气泡, 可回看中断那一刻的草稿. run_code 里再嵌套一层 run_code 时按内层预算收敛; 预算起点取程序真正开始派发的时刻, 前置包装造成的延迟不计入; 草稿随 pending 结果进入上下文时按单题与整轮上限截断, 截断会在同一条结果里说明, 避免超长草稿被宿主的工具结果裁剪整段吃掉.
|
|
218
234
|
|
|
219
235
|
**其他**
|
|
220
236
|
|
|
221
237
|
- 插件自行计时, 到期后由插件按超时结算并释放宿主那边的前台等待; 你在超时那一刻之前真正提交的答案优先采用
|
|
222
238
|
- 多标签页同时打开同一会话时, 服务端按调用标识只保留一份草稿快照, 后上报的标签页会覆盖先到的那份
|
|
223
239
|
- 气泡里的草稿记录只保留最近 200 条, 更早的气泡不再可点开
|
|
224
|
-
- 宿主 0.2.2-rc.1 打开卡片时会预选带推荐标记的选项,
|
|
240
|
+
- 宿主 0.2.2-rc.1 打开卡片时会预选带推荐标记的选项, 插件按投影里的选项原文认出这些预选值并按题整组判断: 只有选中集合与预选集合完全相同时才剥, 用户自己点过推荐项(刷新后内存里的交互登记已丢)不会被误剥成空草稿; 多选时点过任一选项后, 其余预选项按宿主自己的提交口径一并保留
|
|
225
241
|
- 只是点了「跳过」而没有选择与输入时, 草稿按空处理, 这次超时由插件关闭卡片
|
|
226
242
|
- 草稿按题合并三处来源, 优先级为宿主持久化记录, 当前显示题的实时值, 插件自己的快照; 读实时值时已选标签取的是宿主给读屏用的文案, 其中的「(推荐)」这类后缀可能被省略
|
|
227
243
|
- 桌面端(macOS)自 dsh 0.2.2-rc.2 起只在带 `data-window-drag` 的页头行内允许拖动窗口, 带 `data-window-drag-controls` 的容器里的控件由宿主自动排除拖动; 覆盖拖动行的自定义浮层要自身声明 `data-window-drag-exclude` 才可交互, 顶部还留了 `--dsh-frame-top-clearance` 的预留带. 插件的草稿浮层挂在 body 上, 既没有声明拖动排除也不读预留带, 因此桌面端贴近窗口顶部时可能落进预留带; 浮层内没有可点控件, 影响限于位置; 网页客户端不受影响
|
|
228
244
|
- 注入给模型的超时说明目前只有中文, 英文界面下模型收到的仍是中文说明
|
|
229
|
-
-
|
|
245
|
+
- 插件收卡片依赖宿主的关闭按钮: 按钮在提交在途时被禁用、或界面语言不是中英(文案对不上)时点不到, 重试若干次后这一轮交还宿主, 卡片保持可见可作答并由宿主自己的等待状态与「回答」入口承接
|
|
246
|
+
- 草稿超过单次上报上限 256 KiB 时界面显示「草稿过长, 未送达」, 这一条不计入连续失败次数, 并按固定间隔(约 5 秒)自动重试, 删减内容后会恢复上报; 连续失败三次后该轮判定通道不可用, 插件不再接管, 卡片交还宿主继续可作答
|
|
230
247
|
|
|
231
248
|
## 更新与卸载
|
|
232
249
|
|
package/README_en-US.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# dsh-question-timeout-protection
|
|
4
4
|
|
|
5
|
-
[](https://github.com/JularDepick/dsh-question-timeout-protection/releases)
|
|
6
6
|
[](./COPYRIGHT)
|
|
7
7
|
[](./LICENSE)
|
|
8
8
|
|
|
@@ -36,7 +36,7 @@ This plugin adds three things: you can see how long is left, you can pause the w
|
|
|
36
36
|
|
|
37
37
|
### Requirements
|
|
38
38
|
|
|
39
|
-
- dsh within `>=0.2.1-rc.1 <0.2.3-rc.1`; installation and startup refuse anything outside it
|
|
39
|
+
- dsh within `>=0.2.1-rc.1 <0.2.2-rc.0 || >=0.2.2-rc.0 <0.2.3-rc.1`; installation and startup refuse anything outside it
|
|
40
40
|
- Node.js >= 20
|
|
41
41
|
|
|
42
42
|
### Option A: install from npm
|
|
@@ -47,7 +47,7 @@ dsh installs plugins from npm natively:
|
|
|
47
47
|
dsh plugin --profile <profile> add dsh-question-timeout-protection
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
Installing by package name takes whatever the npm latest tag points at.
|
|
50
|
+
Installing by package name takes whatever the npm latest tag points at (0.1.4 at the time of writing). Versions 0.1.2 and earlier declare a dsh ceiling no higher than `0.2.2-rc.2`, so installation and startup reject them on dsh `0.2.2-rc.3` and later; pin a version with `dsh plugin --profile <profile> add dsh-question-timeout-protection@<version>`. Versions from 0.1.3 on support up to `<0.2.3-rc.1`, and Options B to D below install them from source or a tarball.
|
|
51
51
|
|
|
52
52
|
### Option B: build from source
|
|
53
53
|
|
|
@@ -60,7 +60,7 @@ dsh plugin --profile <profile> add ./release/<tarball>
|
|
|
60
60
|
dsh plugin --profile <profile> add <absolute path>
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
`pnpm pack` builds first, then moves the tarball into `release/` at the repository root under a name like `dsh-question-timeout-protection-0.
|
|
63
|
+
`pnpm pack` builds first, then moves the tarball into `release/` at the repository root under a name like `dsh-question-timeout-protection-0.2.0.tgz`. Where a sandbox blocks lifecycle scripts, use `pnpm run pack:release` for the same artifact. A path passed to `add` is resolved against your current directory only when it starts with `./` or `../`; otherwise it is treated as a package name and looked up in the registry.
|
|
64
64
|
|
|
65
65
|
### Option C: install from the GitHub source
|
|
66
66
|
|
|
@@ -98,7 +98,7 @@ No build is needed and the pnpm build-script policy does not apply.
|
|
|
98
98
|
|
|
99
99
|
### Countdown and warning
|
|
100
100
|
|
|
101
|
-
The countdown appears only on a **live question**, and it follows the plugin's own deadline: focusing the input or starting to type does not pause it. During the last seconds the number turns red and blinks. Once the deadline passes, the plugin withdraws its countdown and failure hints and restores the card to the host's own wait state; when the settlement arrives it decides whether to lock and withdraw the card or hand it back.
|
|
101
|
+
The countdown appears only on a **live question**, and it follows the plugin's own deadline: focusing the input or starting to type does not pause it. The deadline comes from the top-level `timeout` (seconds) the model passes to the question tool; without one the plugin uses its `timeoutSeconds` setting (120 by default). A `timeout` placed inside a question item is a misuse; the plugin only falls back to the first valid value found there when the top-level one is absent (`-1`, `0` and fractions are skipped). During the last seconds the number turns red and blinks. Once the deadline passes, the plugin withdraws its countdown and failure hints and restores the card to the host's own wait state; when the settlement arrives it decides whether to lock and withdraw the card or hand it back.
|
|
102
102
|
|
|
103
103
|
Historical questions and settled answers never show a countdown.
|
|
104
104
|
|
|
@@ -106,13 +106,13 @@ Historical questions and settled answers never show a countdown.
|
|
|
106
106
|
|
|
107
107
|
The "Wait indefinitely" button sits next to the countdown. Clicking it removes the deadline for this question and freezes the countdown as "Paused" until you submit.
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
Clicking it freezes the countdown immediately and registers the wait with the server; if that registration fails or the reply times out the freeze is withdrawn, the host keeps counting, the countdown slot reads "Cannot wait indefinitely" instead, and that round is handed back to the host.
|
|
110
110
|
|
|
111
111
|
### Auto wait indefinitely
|
|
112
112
|
|
|
113
113
|
The composer toolbar carries an "Auto wait indefinitely" switch to the left of the model selector. When on, every new question enters indefinite wait automatically, and a question already waiting freezes right away, exactly as if you had clicked "Wait indefinitely" once.
|
|
114
114
|
|
|
115
|
-
The switch state lives in browser storage and survives a refresh. Turning it off affects only later questions: frozen questions stay frozen and end when you submit.
|
|
115
|
+
The switch state lives in browser storage and survives a refresh. Turning it off affects only later questions: frozen questions stay frozen and end when you submit. With several tabs on the same session, toggling the switch in one page is picked up by the others on their next scan, and a question that is still waiting freezes too.
|
|
116
116
|
|
|
117
117
|
The switch appears only while card enhancements and indefinite wait are both on.
|
|
118
118
|
|
|
@@ -124,11 +124,21 @@ When the draft is empty, meaning you neither selected nor typed anything, the pl
|
|
|
124
124
|
|
|
125
125
|
The draft lives only in memory, so a page refresh loses the bubbles and their records.
|
|
126
126
|
|
|
127
|
+
### Custom text in single-choice questions
|
|
128
|
+
|
|
129
|
+
The host treats "the custom field has text" as "the custom answer is chosen", so a preset option and custom text cannot both hold, and clicking an option clears what you typed. The plugin makes the choice explicit: a radio button sits to the left of the custom field, on equal footing with the preset options, and only that button decides whether the custom answer is chosen — not whether the field has text.
|
|
130
|
+
|
|
131
|
+
- Custom chosen: the preset options lose their selected fill, the answer carries the custom text and an empty selection
|
|
132
|
+
- A preset option chosen: your custom text is not lost; a "Custom answer kept: … (click to use it)" button appears under the field, and clicking it switches back
|
|
133
|
+
- Custom chosen with an empty field: the host's own validation blocks submission (it asks you to answer first); the plugin adds no extra interception
|
|
134
|
+
- Multiple-choice questions are unaffected; custom text and options still coexist there
|
|
135
|
+
- The typed custom text and whether it is selected are written to localStorage, so they survive a refresh (the most recent 64 calls are kept)
|
|
136
|
+
|
|
127
137
|
### Context injection
|
|
128
138
|
|
|
129
|
-
This is on by default. While you are answering, the client always reports draft snapshots to the server (
|
|
139
|
+
This is on by default. While you are answering, the client always reports draft snapshots to the server (the adapter never reads the `fallback` mode; only the settings page maps its checkbox to it); the server decides whether to use them. When on, expiry takes the latest snapshot and returns it to the model context through the tool's pending result, per question, each keeping its own selections and notes; when off, the snapshot stays on the server and is cleared when the call ends.
|
|
130
140
|
|
|
131
|
-
The timeout notice and the draft share that one result,
|
|
141
|
+
The timeout notice and the draft share that one result. When a draft comes back, the notice tells the model to judge how complete it is and decide the next step, not to reveal that judgement to you, and to summarise the decision about this question after that next step.
|
|
132
142
|
|
|
133
143
|
With this off, the plugin only withdraws the card and hands the model no draft.
|
|
134
144
|
|
|
@@ -139,11 +149,11 @@ The config page sits at the **top of the plugin detail view**, not inside "Compo
|
|
|
139
149
|
| Option | Values | Default | UI | Description |
|
|
140
150
|
|:---:|:---:|:---:|:---:|:---:|
|
|
141
151
|
| `fallback` | `ui` / `context` / `both` | `both` | One switch | Timeout fallback. The page only offers "Inject into context": checked writes `both`, unchecked writes `ui`. Keeping the draft in the UI is always on, so `context` never appears |
|
|
142
|
-
| `cardEnhancements` | boolean | `true` | Fixed | Decoration only: countdown and warning blink, a background fill on the square marker of the selected single-choice option, the question bubble, and hiding the host's collapse controls and wait text. When off no decoration appears, while the timeout wrap-up still runs: the card that should be withdrawn is still withdrawn and locked, and the draft is still reported per the configuration above |
|
|
152
|
+
| `cardEnhancements` | boolean | `true` | Fixed | Decoration only: countdown and warning blink, a background fill on the square marker of the selected single-choice option, the custom-answer radio and its kept-content hint, the question bubble, and hiding the host's collapse controls and wait text. When off no decoration appears, while the timeout wrap-up still runs: the card that should be withdrawn is still withdrawn and locked, and the draft is still reported per the configuration above |
|
|
143
153
|
| `infiniteWait` | boolean | `true` | Fixed | Provides the "Wait indefinitely" button and the toolbar switch; turning it off removes both |
|
|
144
154
|
| `draftFallback` | boolean | `true` | Fixed | Timeout wrap-up switch. When off the client neither withdraws the card nor reports the draft and hands that question back to the host; the plugin still settles the wait on time |
|
|
145
155
|
| `warningSeconds` | number | 5 | Not exposed | Seconds remaining when the red warning starts, from 1 to 60 |
|
|
146
|
-
| `timeoutSeconds` | number | 120 | Not exposed | Wait seconds used when the model does not pass one explicitly, from 1 to 2147483 |
|
|
156
|
+
| `timeoutSeconds` | number | 120 | Not exposed | Wait seconds used when the model does not pass one explicitly, from 1 to 2147483. This is the plugin's own default; the host's built-in timed question tool also defaults to 120, but that is a different source |
|
|
147
157
|
|
|
148
158
|
The last two are not exposed in the UI; write them into this plugin's row under `config` in the profile's `cordis.patch.yml`, for example `config: { timeoutSeconds: 300 }` for a 300-second wait. Out-of-range values fail loudly at load time. The three fixed features are switched off the same way, for example `config: { cardEnhancements: false }`; restate every key that row needs rather than only the changed one.
|
|
149
159
|
|
|
@@ -151,11 +161,13 @@ The last two are not exposed in the UI; write them into this plugin's row under
|
|
|
151
161
|
|
|
152
162
|
| Item | Version |
|
|
153
163
|
|:---:|:---:|
|
|
154
|
-
| dsh | `>=0.2.1-rc.1 <0.2.3-rc.1` |
|
|
164
|
+
| dsh | `>=0.2.1-rc.1 <0.2.2-rc.0 || >=0.2.2-rc.0 <0.2.3-rc.1` |
|
|
155
165
|
| Node.js | >= 20 |
|
|
156
166
|
|
|
157
167
|
The Node.js requirement of the host dsh itself follows the release notes of the matching version.
|
|
158
168
|
|
|
169
|
+
The range is split in two to satisfy both checks. The host evaluates it with `includePrerelease`, where the single `>=0.2.1-rc.1 <0.2.3-rc.1` suffices, but npm and pnpm verify peer dependencies with strict semver: a prerelease version passes only when the range carries a prerelease comparator of the same `major.minor.patch` tuple. The single range names only 0.2.1 and 0.2.3, so 0.2.2-rc.x is rejected on the peer side. Naming the 0.2.2 prerelease in a second segment makes both checks accept the same set, and the union is still equivalent to `>=0.2.1-rc.1 <0.2.3-rc.1`.
|
|
170
|
+
|
|
159
171
|
## FAQ
|
|
160
172
|
|
|
161
173
|
**Will my input be lost when the question times out**
|
|
@@ -176,7 +188,7 @@ Common reasons include: card enhancements are off; that question was a blocking
|
|
|
176
188
|
|
|
177
189
|
**What happens after I click "Wait indefinitely"**
|
|
178
190
|
|
|
179
|
-
This question no longer has a deadline and the model keeps waiting until you submit, or the page or session ends. If the state channel is unavailable the button does not take effect:
|
|
191
|
+
This question no longer has a deadline and the model keeps waiting until you submit, or the page or session ends. If the state channel is unavailable the button does not take effect: nothing stays frozen, the countdown slot reads "Cannot wait indefinitely", and that round is handed back to the host, which keeps it answerable.
|
|
180
192
|
|
|
181
193
|
**The bubble is gone after a refresh**
|
|
182
194
|
|
|
@@ -198,7 +210,7 @@ Cards and tool rows are located through host class-name suffixes, `data-question
|
|
|
198
210
|
|
|
199
211
|
**Depends on the host question projection**
|
|
200
212
|
|
|
201
|
-
The client relies on the userQuestions projection of the host sessions service to tell whether a question entered the continued state; draft reporting, the timeout wrap-up and the bubble all follow it. If that service is missing or the interface is renamed the plugin logs one console.warn per session: the countdown and card decoration stay,
|
|
213
|
+
The client relies on the userQuestions projection of the host sessions service to tell whether a question entered the continued state; draft reporting, the timeout wrap-up and the bubble all follow it. If that service is missing or the interface is renamed the plugin logs one console.warn per session: the countdown and card decoration stay, and while the card still shows the host waiting state the draft is still reported and still rides the tool result back to the model, but the wrap-up does not run and no bubble appears.
|
|
202
214
|
|
|
203
215
|
**Session subscription cap**
|
|
204
216
|
|
|
@@ -214,19 +226,24 @@ Both share one token-protected channel mounted on the host's own HTTP service, s
|
|
|
214
226
|
|
|
215
227
|
**UI languages**
|
|
216
228
|
|
|
217
|
-
dsh 0.2.2-rc.1 ships eight UI languages while the plugin recognises Chinese and English labels only. Under other locales the countdown, the wait-indefinitely button and the toolbar switch are not rendered, and the plugin's own bubble and config page fall back to English. The Japanese "回答" is identical to Chinese and
|
|
229
|
+
dsh 0.2.2-rc.1 ships eight UI languages while the plugin recognises Chinese and English labels only. Under other locales the countdown, the wait-indefinitely button and the toolbar switch are not rendered, and the plugin's own bubble and config page fall back to English. The Japanese "回答" is identical to Chinese and the plugin hides it for a moment, but it cannot recognise the Japanese close button, so once the dismiss retries are used up that round is handed back and both the entry and the card are restored; only a three-to-five second transition stays inconsistent, depending on how often the scan fires. In the remaining locales the host answer entry and its wait text mostly stay visible. Under Japanese, a timeout with an empty draft produces no plugin bubble, and the host entry is hidden only briefly before being restored, so the read-only card can still be reopened. The plugin cannot find the host close button there, so once the dismiss retries are used up that round is handed back to the host: the card stays visible and answerable (its locked state is restored) and the host's own wait status and answer entry take over, while timeout settlement and draft reporting still happen.
|
|
230
|
+
|
|
231
|
+
**Bounded by the enclosing program budget in PTC mode**
|
|
232
|
+
|
|
233
|
+
When the model asks from inside `run_code` (PTC mode), that question lives only as long as the enclosing program's elapsed-time budget: on expiry the host stops the program hard and aborts the in-flight question, so the on-screen countdown disappears mid-way and the draft never reaches the model. The plugin records the enclosing budget while the question is live and shrinks its wait to "remaining budget minus the settle margin": the question settles itself as a timeout before the budget expires, the draft still rides the pending result back to the model, and the countdown shows the shrunk duration. When the usable time left after the settle margin is under two seconds no card is opened; the call fails immediately as budget-insufficient and the model is told to raise the enclosing budget, so no answerable card is left behind. Indefinite wait cannot outlive the enclosing budget: a frozen question still ends when the budget expires, though its draft is kept. An interrupted question leaves a read-only bubble on the tool row so the draft as it stood at that moment can still be read. A run_code nested inside another run_code shrinks the wait to the inner budget; the budget clock starts when the program is actually dispatched, so latency from earlier wrappers does not count against it; when the draft rides the pending result back to the model it is capped per question and per round, and the same result says so, so an oversized draft is not swallowed whole by the host's tool-result pruning.
|
|
218
234
|
|
|
219
235
|
**Other**
|
|
220
236
|
|
|
221
237
|
- The plugin times the wait itself: on expiry it settles the timeout and releases the host-side foreground wait, and an answer you actually submitted before that moment still wins
|
|
222
238
|
- With several tabs on the same session the server keeps one draft snapshot per call id, so a later tab overwrites the one reported earlier
|
|
223
239
|
- Only the latest 200 draft records in bubbles are kept, so older bubbles can no longer be opened
|
|
224
|
-
- dsh 0.2.2-rc.1 pre-selects recommended options when a card opens, and the plugin
|
|
240
|
+
- dsh 0.2.2-rc.1 pre-selects recommended options when a card opens, and the plugin recognises those presets by matching the original option labels from the projection, then decides per question as a whole set: it strips them only when the selection equals the presets exactly, so a recommended option you actually picked (the in-memory interaction record is gone after a refresh) is not stripped into an empty draft; in multiple choice, once you click any option the remaining presets are kept under the host's own submit semantics
|
|
225
241
|
- Skipping every question without any selection or typed text counts as an empty draft, so that timeout closes the card
|
|
226
242
|
- The draft is merged per question from three sources in this order: the host's persisted record, the live value of the question on screen, then the plugin's own snapshot; when the live value is read, selected labels come from the host's screen-reader text, which may drop suffixes such as "(Recommended)"
|
|
227
243
|
- On the macOS desktop app, dsh 0.2.2-rc.2 allows window dragging only inside header rows carrying `data-window-drag`, and the host automatically excludes drag on controls inside a `data-window-drag-controls` container; a custom overlay covering a drag row must declare `data-window-drag-exclude` to stay interactive, and `--dsh-frame-top-clearance` reserves a strip at the top. The plugin's draft panel is attached to the body and declares neither, so near the top of the window it may fall into the reserved strip. The panel holds no clickable controls, so the effect is positional only; the web client is unaffected
|
|
228
244
|
- The timeout notice injected for the model is Chinese-only, so on an English UI the model still receives Chinese text
|
|
229
|
-
-
|
|
245
|
+
- Closing a card relies on the host's close button: when that button is disabled during submission, or the UI language is not Chinese or English (labels do not match), the plugin cannot click it; after a few retries that round is handed back to the host, the card stays visible and answerable, and the host's own wait status and answer entry take over
|
|
246
|
+
- A draft over the 256 KiB per-report limit makes the UI read "Draft too large; not delivered", which does not count towards consecutive failures and retries at a fixed interval (about five seconds), so trimming the text restores reporting; after three consecutive failures that question is judged channel-unavailable, the plugin stops taking it over and the card returns to the host and stays answerable
|
|
230
247
|
|
|
231
248
|
## Update and uninstall
|
|
232
249
|
|