Files
apes-sidebar/README.md
T
workbuddy-mac13 20d8b9056a
CI / ci (push) Canceled after 0s
CI / ci-windows (push) Canceled after 0s
CI / plugin-mount (push) Canceled after 0s
feat(apesi): 以上游 v0.34.0-alpha.1 为基线重建定制侧边栏
基线:upstream omdsh-dev/DSH-better-sidebar @ 96d6ef4(main,npm 0.34.0-alpha.1,MIT)
宿主:DSH 0.2.3-alpha.2 / cordis 4.2.0-alpha.1(Desktop Beta 2.0.24-beta.2 实测)

改动(改名 + 身份对齐,不改架构):
- package.json:name → dsh-apes-sidebar,version 2.0.0,peer 升 ^0.2.3-alpha.2,cordis 钉 ^4.2.0-alpha.1
- dsh.plugin.json:id → dsh-external/dsh-apes-sidebar,engines.dsh >=0.2.3-alpha.2 <0.3.0
- cordis.patch.yml:挂载行 id better-sidebar → apes-sidebar
- tsdown.config.ts:客户端 factory id → dsh-apes-sidebar / dsh-external/dsh-apes-sidebar
- src/index.ts:SIDEBAR_PACKAGE_NAME → dsh-apes-sidebar(loader 行自查找)
- settings 命名空间保留 dsh-better-sidebar(用户既有偏好不丢)

文档:README.md(我们自己的)、NOTICE.md(上游 MIT 出处)、docs/apesi/(规则 + 第一代材料 + 重建记录)

实测:boot 18–29s,include:apes-sidebar ready,无重复 factory 注册 / 无 loader 行告警 / 无 React #130
2026-11-28 19:08:52 +08:00

79 lines
3.3 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.
# dsh-apes-sidebar
ApeSi 定制侧边栏 —— 基于 [dsh-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar) 的自有 fork。
> 上游项目 5.3k star,MIT 许可。本仓库是它的下游分支,**以上游最新版本为基线**,叠加 ApeSi 侧品牌/适配层。
> 上游 README 见 [`README_upstream.md`](README_upstream.md) / [`README_ZH_upstream.md`](README_ZH_upstream.md)。
## 基线
| 项 | 值 |
|---|---|
| 上游仓库 | `omdsh-dev/DSH-better-sidebar`(MIT) |
| 上游基线 commit | `96d6ef4`(main,2026-11-27) |
| 上游 npm 版本 | `0.34.0-alpha.1` |
| 宿主要求 | DSH `>=0.2.3-alpha.2 <0.3.0`(Desktop Beta 2.0.24-beta.2 内核 `0.2.3-alpha.2` 实测通过) |
| 本包版本 | `2.0.0` |
## 与上游的差异(ApeSi 定制层)
1. **包身份改名**:`dsh-better-sidebar` → `dsh-apes-sidebar`
- `package.json` name、`dsh.plugin.json` id(`dsh-external/dsh-apes-sidebar`)
- 客户端 bundle 的 `__ModuleLoader__` factory id(`tsdown.config.ts`)
- 宿主侧 loader 行自查找常量 `SIDEBAR_PACKAGE_NAME`(`src/index.ts`)
- 挂载行 id:`better-sidebar` → `apes-sidebar`(`cordis.patch.yml`)
2. **peer / engine 约束**:peer 统一升到 `^0.2.3-alpha.2`,`cordis` 钉 `^4.2.0-alpha.1`,`engines.dsh` 收到 `>=0.2.3-alpha.2`
3. **settings 命名空间保留** `dsh-better-sidebar`(`SIDEBAR_PREFS_NS`):用户既有偏好不因改名丢失
> 历史包袱:上一代 fork(基于上游 v0.19.1,代号 `dsh-apes-sidebar` v1.2.0,见 `figmar/apes-sidebar`)的净定制几乎为零 ——
> 历代提交都是宿主适配(图标 API、settings API、React #130)与文档;这些适配在 0.2.3 线已由上游自己完成,
> 因此本版本**直接以上游最新为基线**,不再背历史适配债。
## 安装
```bash
# 桌面版 profile(App 独占管理,必须在 App 内插件页安装;CLI 需用 --profile web)
dsh plugin --profile desktop add dsh-apes-sidebar
```
本地开发安装(file: 依赖):
```bash
cd ~/.dsh-beta/profiles/desktop
pnpm add "dsh-apes-sidebar@file:/Users/figmarlite/dsh-plugins/dsh-apes-sidebar-v2"
# 并把包名追加进 package.json 的 dsh.profile.bundles
```
## 构建
```bash
pnpm install # 首次约 4 分钟(106 个 devDeps)
pnpm build # tsc + tsdown → lib/
```
构建产物:`lib/index.js`(宿主半边)、`lib/client.js` + `lib/client-registry.js`(浏览器半边)、
`lib/client-{terminal,editor,mermaid,locale}.js`(懒加载 chunk)。
## 目录
| 路径 | 说明 |
|---|---|
| `src/` | 插件源码(上游结构,未改架构) |
| `src/client/` | 浏览器半边:文件树 / 编辑器 / 终端 / 变更 / 侧边对话 / 子代理 / 浏览器 |
| `docs/` | 上游设计文档(30+ 份) |
| `docs/apesi/` | ApeSi 侧规则、wiki、验证记录 |
| `cordis.patch.yml` | 挂载行(id `apes-sidebar`) |
## 与其它自有插件的关系
本包提供侧边栏**底座与 API**(`ctx.betterSidebar` 服务)。工作区自有扩展:
- `dsh-wb-sidebar`:WorkBuddy/Tutti 风格 Tasks / Agents / Profile 三页(依赖本包的服务)
- `dsh-brand-apesi`:ApeSi 品牌(左侧栏品牌槽位)
- `dsh-session-changes`:会话变更视图
- `dsh-apesi-dshoffice`:Office 文档桥接
## 许可
上游 MIT,见 [`LICENSE`](LICENSE);fork 归属声明见 [`NOTICE.md`](NOTICE.md)。