Skip to content
dsh.fish
Bundle

dsh-pi-kit

DSH lightweight optimization plugin collection, maintained in one workspace and installed as one bundle.

Source
Pidreamleaves
stars
2 stars
License
MIT
Updated
Updated 10 days ago

Readme

# dsh-pi-kit

中文 | [English](./README.en.md)

DSH 轻量优化插件合集:目前包含 **自动审核** + **提示音** 两个小插件;日常使用零感知,危险操作和等待事件不再错过。

## 插件清单

| 插件 | 解决什么问题 |
|------|-------------|
|  **自动审核** | 工具执行前自动拦截危险命令、放行安全操作、拿不准的交你确认(轻量模型审核,复用 DSH 凭据)
|  **提示音** | 审批、询问、后台任务完成时用不同声音提醒,后台作业完成调用系统通知

## 安装

**一键安装(推荐)**:

```sh
dsh plugin --profile web add dsh-pi-kit
```

dsh 自动完成依赖安装与挂载(读取本包的 `dsh.bundle.patch`,无需手写任何 patch),重启 DSH 生效。

> `web` 是内置 Web GUI profile 名;使用其他 profile 时换成对应名字(`~/.dsh/profiles/` 下的目录名)。
>
> `dsh plugin` 内部调用 pnpm 完成安装;若提示 `pnpm not found`,先 `npm install -g pnpm` 再重试。

**手动安装**(等价的 profile `package.json` 写法):

```json
{
  "dependencies": { "dsh-pi-kit": "^0.1.0" },
  "dsh": { "profile": { "bundles": ["dsh-pi-kit"] } }
}
```

> 单装:`dsh plugin --profile web add dsh-auto-reviewer`(或另两个包);未装设置壳时,设置自动以独立卡片形态出现。
>
> 单插件控制:聚合安装后在 patch 层追加 `- id: <插件 id> disabled: true` 即可停用某个成员。
>
> **严格布局注意**:profile 使用 pnpm 隔离(isolated)布局时,成员包会被收进嵌套目录,`dsh web` 启动可能报 `Cannot find package 'dsh-auto-reviewer'`。在 profile 的 `pnpm-workspace.yaml` 加 `nodeLinker: hoisted` 后重新安装即可。

### 验证与卸载

```sh
# 验证插件行已挂载
dsh --profile web --dump-config

# 卸载(重启 dsh web 生效)
dsh plugin --profile web remove dsh-pi-kit
```

### 从 GitHub 仓库安装(改代码调试)

```sh
git clone https://github.com/Pidreamleaves/dsh-pi-kit.git
cd dsh-pi-kit
pnpm install
pnpm -r build

# 把三个成员包分别链接进 web profile(各自声明 dsh.bundle,自动挂载)
dsh plugin --profile web add link:<绝对路径>/dsh-pi-kit/packages/auto-review
dsh plugin --profile web add link:<绝对路径>/dsh-pi-kit/packages/approval-chime
dsh plugin --profile web add link:<绝对路径>/dsh-pi-kit/packages/pi-kit-settings
```

重启 `dsh web` 生效;改代码后 `pnpm -r build` 并重启即可。

## 使用

- **设置**:「设置 → 插件 → 插件配置 → dsh-pi-kit」,持久化存储
- **自动审核**:默认启用(审核模型 `deepseek-v4-flash`);策略文件 `~/.dsh/auto-review.yml` 首次启动自动生成带注释模板,按示例改即可;审核结果在对话 turn 末尾以彩色徽章汇总(放行绿 / 拦截红 / 提权蓝,点「明细」看每条理由)
- **提示音**:默认启用;完成音默认只提醒后台会话,可在设置中改为所有会话;三种音色均可试听

详见各插件页:`packages/auto-review` · `packages/approval-chime` · `packages/pi-kit-settings`

## 仓库结构

```
dsh-pi-kit/
  cordis.patch.yml      # bundle patch:一次挂载全部成员
  package.json          # bundle 根:依赖全部成员
  packages/
    auto-review/        # 自动审核门卫(Host)
    approval-chime/     # 提示音/通知(Client,Host 半边持 settings 域)
    pi-kit-settings/    # 聚合设置卡壳(Client)
```

## License

[MIT](./LICENSE)

Install

dsh plugin --profile web add github:Pidreamleaves/dsh-pi-kit

Profile: web

  • 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.
Source