Bundle
dsh-bookmarks-dock
DeepSeek Harness 左侧网址书签栏插件:一键展开常用网址工具栏,自动解析目标站点真实 favicon,展开时页面内容整体右移、不遮挡。
- Source
- songying2024
- License
- MIT
- Updated
- Updated 6 days ago
Readme
# dsh-bookmarks-dock



> **DSH 插件(dsh-plugin)**:本仓库是 DeepSeek Harness 生态的客户端插件,已通过 GitHub 话题标记 `dsh-plugin` 收录。在 GitHub 检索 `topic:dsh-plugin` 即可找到本插件。
在 **DeepSeek Harness(DSH)** Web 界面的最左侧,增加一列「常用网址书签工具栏」。点击星标按钮即可展开/收起,展开时页面内容整体右移、不遮挡,书签图标自动解析目标网站的真实 favicon。
## 功能特性
- **左侧书签工具栏**:固定悬浮「★」按钮(收起态不占位),点击展开 52px 宽书签列。
- **内容右移不遮挡**:展开时给 DSH 三栏外壳加 `margin-left`,中栏随框架 `ResizeObserver` 自动收窄,无横向滚动条,不会盖住原有内容。
- **真实 favicon 自动解析**:Host 端(Node 进程)抓取站点首页 HTML,按浏览器真实加载顺序提取图标并转 base64,不受浏览器网络/CORS 限制;结果缓存于 `localStorage`。
- **书签持久化**:书签存于浏览器 `localStorage`(跨刷新 / 重启保留)。
- **增删便捷**:底部「+」添加网址(名称可选、自动补全 `https://`);悬停书签显示「×」删除。
- **预置常用站点**:首次使用预置百度、GitHub、知乎,删掉即用自定义。
## 目录结构
```
dsh-bookmarks-dock/
├── package.json # 包声明:dsh.bundle.patch + dsh.client + exports
├── cordis.patch.yml # Bundle 贡献的配置层(insert 挂载入口)
├── lib/
│ ├── index.js # Host 半:服务端 favicon 解析路由(webServer)
│ └── client.js # Client 半:书签栏 UI bundle(shell.overlay 槽位)
├── README.md
└── LICENSE
```
## 安装
环境要求:Node 18+,已安装 `@deepseek-ai/dsh`(`npm i -g @deepseek-ai/dsh`)。
```bash
# 1. 把 Bundle 安装进 profile(自动合并 cordis.patch.yml 配置层)
dsh plugin --profile web add ./dsh-bookmarks-dock
# 2. 重启 web 服务使客户端插件表生效
dsh web --port 3080
```
> 从 GitHub 安装:`dsh plugin --profile web add github:songying2024/dsh-bookmarks-dock`(拉取的是源码,需在 profile 的 `pnpm-workspace.yaml` 里授权构建)。
## 使用
1. 启动 `dsh web` 后,界面最左侧会出现一个悬浮「★」按钮。
2. 点击 ★ 展开书签列,页面内容自动右移、不被遮挡。
3. 点击书签图标 → 新标签页打开对应网址。
4. 底部「+」添加网址;悬停书签点击「×」删除。
5. 点击「«」或点空白处收起,布局还原。
## 实现说明
- **双半插件**:Host 半通过 `webServer.register({ kind: "prefix", path: "/dsh-bookmarks-dock" })` 暴露 favicon 解析路由,用 Node 全局 `fetch` + `Buffer` 抓取并按 magic bytes 校验后 base64 编码。
- **客户端注入**:Client buffer 以 `window.__ModuleLoader__.load({ id, factory })` 格式加载,`require("react")` 走平台 seed 表;通过 `ctx.slots.inject("shell.overlay", ...)` 挂载 UI。
- **持久化**:客户端插件以 `dsh.client` 声明,经 `cordis.patch.yml` 的 `insert` 常驻加载(重启不丢失);区别于进程内 `cordis_define` 动态插件。
## License
[MIT](./LICENSE)Install
dsh plugin --profile web add github:songying2024/dsh-bookmarks-dock
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-bookmarks-dock from the hub
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.