dsh-plugin-choice-refresh 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pasumao
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # dsh-plugin-choice-refresh
2
+
3
+ ![npm version](https://img.shields.io/npm/v/dsh-plugin-choice-refresh)
4
+ ![License](https://img.shields.io/github/license/Pasumao/dsh-plugin-choice-refresh)
5
+ ![AI Assisted](https://img.shields.io/badge/AI-Assisted-8A2BE2)
6
+
7
+ **dsh 插件市场里唯一的选择增强插件**:给 `ask_user_question` / `ask_user_choice` 的选择卡加上两个按钮——
8
+ 选项都不满意?一键让模型换一批完全不同的。选项太少?一键让模型补充。
9
+
10
+ | 按钮 | 场景 | 效果 |
11
+ | --- | --- | --- |
12
+ | 🔄 **重新生成选项** | 给出的选项都不满意 | 一键让模型换一批完全不同的选项(换角度/风格/维度,5~8 个)重新提问 |
13
+ | ➕ **更多选项** | 选项太少不够选 | 一键让模型在保留原选项的基础上补充新选项(总数 6~10 个)重新提问 |
14
+
15
+ 纯前端交互实现,**不注册新工具、不改核心包**;对原生文字选项和
16
+ [dsh-plugin-image-tools](https://github.com/Pasumao/dsh-plugin-image-tools) 的
17
+ 图片选项卡都生效(图片卡由本插件直接渲染,复用其图片路由)。
18
+
19
+ ## 安装
20
+
21
+ ```powershell
22
+ # npm(推荐)
23
+ dsh plugin --profile web add dsh-plugin-choice-refresh
24
+ # 或 GitHub
25
+ dsh plugin --profile web add github:Pasumao/dsh-plugin-choice-refresh
26
+ ```
27
+
28
+ 装完刷新浏览器即生效(profile 已有 dsh-client-hmr 时会自动热更新,无需重启)。
29
+ 本地开发可改用 `link:` 方式挂载,详见 `设计说明.md`。
30
+
31
+ ## 使用
32
+
33
+ 模型(或按 novel-* 技能等)照常调用 `ask_user_question` / `ask_user_choice`
34
+ 提问时,选择卡底部会多出「重新生成选项」和「更多选项」两个按钮:
35
+
36
+ - 点**重新生成选项**:当前问题被解除,同时向模型注入一条
37
+ `【系统 · 选项刷新】` 用户消息,模型立即换一组选项重新提问;
38
+ - 点**更多选项**:同上,注入 `【系统 · 更多选项】` 消息,模型保留原选项并补充。
39
+
40
+ > 注入消息保持简短(一两行),作为用户消息留在会话里供模型理解指令;
41
+ > 界面会原样显示这条消息。
42
+
43
+ > 说明:刷新/补充由模型理解指令后重新调用提问工具完成,属于「软」增强——
44
+ > 模型偶尔可能调整问题本身。若对结果仍不满意,可再点一次或直接打字说明。
45
+
46
+ ## 自检
47
+
48
+ ```powershell
49
+ cd D:\dsh\plugins\dsh-plugin-choice-refresh
50
+ npm run smoke # selfcheck + smoke-client
51
+ ```
52
+
53
+ ## 兼容性
54
+
55
+ - 需要 DSH web GUI(`conversation.composer` 链条目,priority -300)。
56
+ - 与 `dsh-plugin-image-tools` 共存的图片卡直接兼容;未安装时纯文字选项照常。
57
+ - `plan-review` 意图(计划审阅卡)放行给原生 `PlanReviewPanel`,不受影响。
58
+ - 依赖客户端服务:`slots` / `locale` / `sessions` / `remote`。
59
+
60
+ ## 许可证
61
+
62
+ MIT
@@ -0,0 +1,7 @@
1
+ # dsh-plugin-choice-refresh bundle patch:挂载一行,交给 profile 的
2
+ # dsh.profile.bundles(与 dsh-notify / dsh-plugin-image-tools 同款机制)自动应用。
3
+ # `name` 必须等于 package.json 的 `name`(loader 按该名从 profile 的
4
+ # node_modules 解析插件模块)。
5
+ - insert:
6
+ - id: dsh-plugin-choice-refresh
7
+ name: dsh-plugin-choice-refresh