dsh-better-ask-user 0.2.0 → 0.3.1
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 +75 -40
- package/lib/client.js +337 -258
- package/package.json +22 -14
- package/src/ask-tool.js +7 -1
- package/src/client/AskHistoryRow.module.css +20 -10
- package/src/client/AskHistoryRow.tsx +18 -6
- package/src/client/PlanReviewPanel.module.css +254 -38
- package/src/client/PlanReviewPanel.tsx +9 -3
- package/src/client/QuestionComposer.module.css +504 -77
- package/src/client/QuestionComposer.tsx +51 -27
- package/src/client/QuestionReplyView.module.css +95 -31
- package/src/client/QuestionReplyView.tsx +25 -15
- package/src/client/QuestionWaitBar.module.css +39 -19
- package/src/client/QuestionWaitBar.tsx +0 -2
- package/src/client/contract/slots.ts +19 -4
- package/src/client/index.ts +9 -8
- package/src/client/locales.ts +4 -0
- package/src/client/settings-locales.ts +22 -20
- package/src/client/settings.module.css +108 -108
- package/src/client/settings.tsx +101 -125
- package/src/index.js +2 -14
package/README.md
CHANGED
|
@@ -1,53 +1,88 @@
|
|
|
1
|
-
|
|
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>
|
|
2
7
|
|
|
3
|
-
|
|
4
|
-
question/answer protocol and replaces the Web card with one that supports:
|
|
8
|
+
<h1 align="center">dsh-better-ask-user</h1>
|
|
5
9
|
|
|
6
|
-
|
|
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.
|
|
10
|
+
<p align="center">让提问等待变得可见、可控、对移动端友好,同时守住必须由人做的决策。</p>
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
18
|
|
|
19
|
-
|
|
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>
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
- timeoutBehavior: native (default) or default.
|
|
23
|
-
- goalTimeoutBehavior: native (default) or default.
|
|
27
|
+
## 它做什么
|
|
24
28
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
- `ask_user_question` 等待与输入续期
|
|
30
|
+
- 倒计时 / 进度 / 过期状态
|
|
31
|
+
- Markdown、移动端卡片与键盘操作
|
|
32
|
+
- 普通提问超时默认选择
|
|
29
33
|
|
|
30
|
-
|
|
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>
|
|
31
40
|
|
|
32
|
-
|
|
33
|
-
label ends with (Recommended) or (推荐); if none is recommended it picks the
|
|
34
|
-
first option. A question with no options is skipped with selected: []. An
|
|
35
|
-
auto-selected result is never presented as a user answer; the model-facing
|
|
36
|
-
render includes an explicit warning.
|
|
41
|
+
## 安装
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
```sh
|
|
44
|
+
# 只安装这个插件
|
|
45
|
+
dsh plugin --profile <profile> add dsh-better-ask-user@0.3.1 dsh-better-ptc@0.2.0
|
|
39
46
|
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
# 或安装 Better DSH(会自动带上所有独立插件)
|
|
48
|
+
dsh plugin --profile <profile> add dsh-better-dsh@0.10.0
|
|
49
|
+
```
|
|
42
50
|
|
|
43
|
-
|
|
51
|
+
> 安装 / 升级 / 换包后必须重启对应 profile;只刷新网页不够。
|
|
44
52
|
|
|
45
|
-
|
|
46
|
-
npm install
|
|
47
|
-
npm test
|
|
48
|
-
npm run build
|
|
49
|
-
~~~
|
|
53
|
+
## 它拥有什么
|
|
50
54
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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)。
|