dsh-sansheng-liubu/docs/combined-package.md

45 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 单包版本 `ds-bot-sansheng`
## 为什么有它
DSH 原生按包加载插件:`ds-bot` 是底座,`dsh-sansheng-sansheng` 是治理层。为了满足“只更新一个包”的安装体验,`scripts/build-combined.mjs` 把两者合并成一个可安装包 `ds-bot-sansheng`:
- 宿主半:DS-Bot 的 `index.js` + 三省六部的 `sansheng/index.js`,由同一个补丁挂载为两个插件行;
- 客户端半:把 `ds-bot/client.js` 与 `sansheng/client.js` 合并为一个客户端入口,先应用三省六部(写入共存标记),再应用 DS-Bot;
- 补丁:`bot`、`web-search-auto`、`sansheng` 三行;`web` 的搜索配置保留。
它仍然是一个 fork:DS-Bot 上游升级后,需要重新运行构建脚本并做宿主冒烟测试。
## 构建
```powershell
node scripts/build-combined.mjs
```
生成 `.scratch/combined/`,再打包:
```powershell
pnpm --dir .scratch/combined pack --pack-destination dist
```
产物:`dist/ds-bot-sansheng-0.2.8.tgz`。
## 安装
1. 从 Gitea Release 下载 `ds-bot-sansheng-0.2.8.tgz`;
2. 在 DSH 插件页安装该 tgz(或 `dsh plugin --profile <name> add file:<abs path>`);
3. 把 profile 的 `dsh.profile.bundles` 里旧的 `ds-bot`、`dsh-sansheng-sansheng` 替换为 `ds-bot-sansheng`;
4. 彻底重启 DSH。
## 已验证
在独立测试 profile(独立 `DSH_HOME`)安装本单包并启动 Web:
- 启动无未激活插件;
- `__SANSENG_WORKBENCH__=true`;
- 原生项目树/聊天保留,DS-Bot 全局 shell 未接管;
- 右栏「三省 → 角色」页签可打开,未初始化项目显示初始化入口;
- 浏览器控制台无页面错误。
真实模型 E2E、长工具流和日常 desktop profile 未验证。