Bundle
@dsh-external/dsh-prompt-toolkit
DSH Web 提示词工作台:把输入框里的草稿整理成一条可直接执行的命令(引擎 fork 自 WestFox-AwA/dsh-prompt-optimizer,BSD-3-Clause,署名保留;界面与交互为本项目自有)
- Source
- Ethereal-ljq
- License
- BSD-3-Clause
- Updated
- Updated last month
Readme
# dsh-prompt-toolkit DSH Web 的提示词工作台:把输入框里的草稿按所选档位整理成一条可直接执行的命令。 插件不接管键盘事件,默认不执行任何操作。在输入框左侧胶囊上点击 `✦` 后开始优化, 结果写回输入框,是否发送由使用者决定。 ## 安装 DSH 插件安装在某个 profile 中,不提供全局安装。 ```bash # 从 GitHub 安装 dsh plugin --profile web add github:Ethereal-ljq/dsh-prompt-toolkit # 本地开发:安装正在修改的工作副本 dsh plugin --profile web add /path/to/dsh-prompt-toolkit ``` 安装会同时完成 `dsh.profile.bundles` 的注册,无需手工维护该列表。 **安装或升级后必须重启该 profile 的 web。** bundle 层在 web 启动时入栈,刷新页面不生效。 本包不需要构建:`lib/client.js` 是提交进仓库的构建产物,包内也没有 `prepare` 脚本, 因此从 git 来源安装同样可以直接运行。 ## 界面与操作 插件在页面上提供两处内容:输入框所在行的胶囊,以及右侧栏中的两个 tab (优化面板 / 收藏夹)。 胶囊分为两段,中间以分隔线区分,悬停时仅高亮指向的一段: - 左侧 `✦`:执行优化,读取当前草稿并把结果写回输入框(不发送)。 - 右侧「优化 · 普通 ▾」:显示当前档位;点击展开设置菜单,内容为档位 / 上下文 / 优化模型 / 帮助。存在产出时,菜单中额外出现「查看产出」。 优化完成后,面板提供以下动作。左侧一组的动作不修改输入框,右侧一组会写入输入框: | | 动作 | 说明 | |---|---|---| | 左 | 停止 / 丢弃 | 运行中显示「停止」,完成后显示「丢弃」。关闭面板,不修改输入框 | | 左 | 复制 | 将当前产出(含手动编辑过的版本)复制到剪贴板 | | 左 | 收藏本条 / 收藏夹 | 存入本地收藏夹;点击收藏夹中的条目可写回输入框 | | 右 | 重新生成 | 可指定修正方向(例如"更短"),基于上一版产出重跑 | | 右 | 填入输入框 | 仅写入,不发送 | | 右 | 填入并发送 | 唯一的发送入口 | 设置菜单中的上下文控件用于选择优化时读入多少会话历史; 「优化模型」与对话模型相互独立,可以单独指定。 ## 与上游的关系 引擎(宿主半边与提示词层)fork 自 [WestFox-AwA/dsh-prompt-optimizer](https://github.com/WestFox-AwA/dsh-prompt-optimizer), 原作者「啃轮胎的西狐」,BSD-3-Clause,署名与许可一并保留(见 [LICENSE](LICENSE))。 界面与交互为本项目自有。 包名与上游相同(`@dsh-external/dsh-prompt-toolkit`),两者不能同时安装。 ## 数据落在哪 | 文件 | 内容 | |---|---| | `$DSH_HOME/prompt-toolkit.json` | 设置(档位 / 模型 / 上下文 / 按会话的档位) | | `$DSH_HOME/prompt-toolkit-favorites.json` | 收藏夹 | | `$DSH_HOME/prompt-toolkit-beacon.jsonl` | 客户端动作遥测,用于事后排查;上限 512KB,超出后截断 | 运行期文件写入 `DSH_HOME`,不写入插件目录:安装进 profile 之后插件目录可能只读。 ## 开发 设计约束、模块划分、构建与测试方式见 [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md)。
Install
dsh plugin --profile web add github:Ethereal-ljq/dsh-prompt-toolkit
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-external-dsh-prompt-toolkit from the hub
- This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.