dsh-better-ask-user 0.3.0 → 0.3.2

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 CHANGED
@@ -1,72 +1,88 @@
1
- # dsh-better-ask-user
2
-
3
- For DeepSeek Harness 0.2.2-rc.1 only (Node >=24.9.0). It keeps the official
4
- question/answer protocol and replaces the Web card with one that supports:
5
-
6
- - a configurable wait in seconds, including -1 for no timeout;
7
- - extending the wait on every real user input in the card;
8
- - sanitized markdown for question/header/detail/option/reply text;
9
- - narrow-screen, safe-area and long-text layout;
10
- - native pending behavior or automatic default selection after the wait;
11
- - separate timeout behavior for goal-active and inactive sessions;
12
- - the shared PTC deadline exemption for ask_user_question.
13
-
14
- The base tool-ask-user row remains in the preset; this plugin registers an
15
- agent-scoped shadow so the model-facing tool name stays ask_user_question.
16
- The official Web card row (ui-user-questions) is disabled by this bundle; the
17
- client half in this package renders the replacement card.
18
-
19
- ## Row settings
20
-
21
- - questionTimeoutSeconds: default 120; -1 never times out; 1..2147483.
22
- - timeoutBehavior: native (default) or default.
23
- - goalTimeoutBehavior: native (default) or default.
24
-
25
- Changes are volatile and affect newly started questions. The active wait is
26
- owned by the client card's claim; input resets its countdown to the configured
27
- wait. When the countdown expires, native returns the official pending result;
28
- default answers with the host-provided default batch and marks it autoSelected.
29
-
30
- The schema includes the official `timeout` continuation marker so next can
31
- replay pending questions and accept late replies. It is not a per-call timing
32
- override: omit it; the row setting above owns the foreground duration.
33
-
34
- ## Default selection
35
-
36
- Single-select picks the first option. Multi-select picks every option whose
37
- label ends with (Recommended) or (推荐); if none is recommended it picks the
38
- first option. A question with no options is skipped with selected: []. An
39
- auto-selected result is never presented as a user answer; the model-facing
40
- render includes an explicit warning.
41
-
42
- ## Install
43
-
44
- The package is a DSH bundle. Install it with dsh plugin add; its bundle patch
45
- inserts the stable dsh-better-ptc row and disables the official Web card.
46
-
47
- ## Development
48
-
49
- ~~~sh
50
- npm install
51
- npm test
52
- npm run build
53
- ~~~
54
-
55
- Unit tests use boundary fakes for userQuestions/goals; source-compiled client
56
- tests exercise the real card and waterfall. The optional installed-host suite
57
- uses actual DSH tool resolution, prompt assembly, execution, Gateway event
58
- frames, and plan review. Run it against the exact host installation:
59
-
60
- ~~~sh
61
- DSH_PACKAGE_ROOT=/path/to/node_modules/@deepseek-ai/dsh npm test
62
- ~~~
63
-
64
- The Gateway test uses the real in-process wire carrier with JSON serialization,
65
- not a browser or WebSocket end-to-end test. Plan review and permission intents
66
- never use the ordinary question countdown or automatic defaults; they remain
67
- open until an explicit decision or cancellation. The PTC service owns the
68
- exit_plan_mode elapsed-time exemption.
69
-
70
- The client half builds into the DSH client closure format. The release lockfile
71
- resolves the exact dsh-better-ptc 0.2.0 dependency from the official npm registry;
72
- local tarballs were used only before the dependency was published.
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/omdsh-dev/dsh-better-ask-user/main/docs/assets/banner-dark.svg">
4
+ <img src="https://raw.githubusercontent.com/omdsh-dev/dsh-better-ask-user/main/docs/assets/banner-light.svg" width="100%" alt="Part of Better DSH — dsh-better-ask-user">
5
+ </picture>
6
+ </p>
7
+
8
+ <h1 align="center">dsh-better-ask-user</h1>
9
+
10
+ <p align="center">让提问等待变得可见、可控、对移动端友好,同时守住必须由人做的决策。</p>
11
+
12
+ <p align="center">
13
+ <a href="https://www.npmjs.com/package/dsh-better-ask-user"><img src="https://img.shields.io/npm/v/dsh-better-ask-user.svg" alt="npm 版本"></a>
14
+ <a href="LICENSE"><img alt="Apache-2.0" src="https://img.shields.io/github/license/omdsh-dev/dsh-better-ask-user?color=blue"></a>
15
+ <a href="package.json"><img alt="DSH 0.2.2-rc.1" src="https://img.shields.io/badge/DSH-0.2.2--rc.1-4B32C3"></a>
16
+ <a href="https://github.com/omdsh-dev/dsh-better-dsh"><img alt="Part of Better DSH" src="https://img.shields.io/badge/part%20of-dsh--better--dsh-2F80B7"></a>
17
+ </p>
18
+
19
+ <p align="center">
20
+ <a href="https://github.com/omdsh-dev/dsh-better-dsh">Better DSH 插件集合</a> ·
21
+ <a href="#安装">安装</a> ·
22
+ <a href="#它拥有什么">它拥有什么</a> ·
23
+ <a href="#设置">设置</a> ·
24
+ <a href="#与-better-dsh-的关系">与 Better DSH 的关系</a>
25
+ </p>
26
+
27
+ ## 它做什么
28
+
29
+ - `ask_user_question` 等待与输入续期
30
+ - 倒计时 / 进度 / 过期状态
31
+ - Markdown、移动端卡片与键盘操作
32
+ - 普通提问超时默认选择
33
+
34
+ <p align="center">
35
+ <picture>
36
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/omdsh-dev/dsh-better-ask-user/main/docs/assets/ownership-dark.svg">
37
+ <img src="https://raw.githubusercontent.com/omdsh-dev/dsh-better-ask-user/main/docs/assets/ownership-light.svg" width="100%" alt="dsh-better-ask-user 与 Better DSH 的装配关系">
38
+ </picture>
39
+ </p>
40
+
41
+ ## 安装
42
+
43
+ ```sh
44
+ # 只安装这个插件
45
+ dsh plugin --profile <profile> add dsh-better-ask-user@0.3.1 dsh-better-ptc@0.2.0
46
+
47
+ # 或安装 Better DSH(会自动带上所有独立插件)
48
+ dsh plugin --profile <profile> add dsh-better-dsh@0.10.0
49
+ ```
50
+
51
+ > 安装 / 升级 / 换包后必须重启对应 profile;只刷新网页不够。
52
+
53
+ ## 它拥有什么
54
+
55
+ | | |
56
+ |---|---|
57
+ | 稳定行 id | `dsh-better-ask-user` |
58
+ | 入口 / 工具 | `ask_user_question` · 问题卡片 / 等待时间线 · 提问设置页 |
59
+ | 设置 | 等待时长、输入续期、普通 / Goal 超时行为 |
60
+ | npm 包 | `dsh-better-ask-user@0.3.1` |
61
+ | 仓库 | https://github.com/omdsh-dev/dsh-better-ask-user |
62
+
63
+ ## 设置
64
+
65
+ 可以在 Plugins 页的 `dsh-better-ask-user` 行设置,也可以在 Better DSH 详情页的「集成设置」里打开同名页面。两个入口共用同一份配置和同一个设置组件,不会产生第二份存储。
66
+
67
+ - plan-review / approval 始终要求人工决策,不自动批准。
68
+ - 普通提问可配置超时默认选择;旧 goal 的提问配置会一次性迁移。
69
+
70
+ ## 与 Better DSH 的关系
71
+
72
+ - **同一个稳定行**:独立安装或由 `dsh-better-dsh` 装配,行 id 和设置命名空间都不变。
73
+ - **旧入口兼容**:早期 Apollo 集成使用的行配置键仍然注册,指向同一份配置。
74
+ - **可以单独使用**:不安装 Better DSH 也能工作;只是不会得到工程预设、流程技能或后台 job 守卫。
75
+ - **Apache-2.0**:本仓库与 Better DSH 的其他仓库统一使用 Apache License 2.0。
76
+
77
+ ## 开发
78
+
79
+ ```sh
80
+ npm test # 单元 / 组件测试
81
+ npm run smoke # 如仓库提供运行时冒烟
82
+ ```
83
+
84
+ 实现与测试说明见 [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md)。
85
+
86
+ ## 许可
87
+
88
+ [Apache License 2.0](LICENSE)。