Skip to content
dsh.fish
Bundle

dsh-session-note

A small DeepSeek Harness plugin: a per-session sticky note with Host persistence and a Client overlay.

Source
makechange
License
MIT
Updated
Updated 4 days ago

Readme

# dsh-session-note

给 DeepSeek Harness 用的入门插件:当前会话右下角一块便签,按 `sessionId` 存在 Host 上,刷新还在。

这不是侧栏。它只走官方 slot `shell.overlay`,外加一条自己的 HTTP 路由。

## 它教你什么

1. `package.json` 里的 `dsh.bundle` + `dsh.client`
2. `cordis.patch.yml` 往组合里 **insert** 一行
3. Host `apply(ctx)` 注册 `/session-note/api`
4. Client `apply(ctx)` 往 `shell.overlay` 塞 UI
5. 用 `dsh plugin --profile web add` 装进 profile,而不是会话里动态批准

## 文件

| 文件 | 干什么 |
|---|---|
| `package.json` | 包名、`dsh.bundle`、`dsh.client`、`exports["./client"]` |
| `cordis.patch.yml` | 安装后插入插件行 `id: session-note` |
| `src/index.ts` | Host:读写 `$DSH_HOME/storages/session-notes.json` |
| `src/client/index.tsx` | Client:右下角卡片,`fetch` 调 Host |
| `tsdown.config.ts` | Node ESM + 浏览器 lazy-CJS(`__ModuleLoader__` 握手) |

## 安装

别人不需要 `git clone`。有 DSH 之后执行:

```sh
dsh plugin --profile web add github:makechange/dsh-session-note
```

pnpm 10 及以上第一次可能会拒绝跑 git 依赖的 `prepare`。把下面写进 `~/.dsh/profiles/web/pnpm-workspace.yaml`,再执行一次同样的 `add`:

```yaml
allowBuilds:
  dsh-session-note: true
```

然后重启 `dsh web`。打开一个会话,右下角应出现「会话便签」。拖标题栏可以挪开;点 × 会收成「便签」小按钮,再点小按钮展开。位置和收起状态记在浏览器里,刷新还在。保存后看:

- `~/.dsh/profiles/web/package.json` 的 `dsh.profile.bundles` 多了 `dsh-session-note`
- `~/.dsh/storages/session-notes.json` 有对应 `sessionId`

更新:

```sh
dsh plugin --profile web update dsh-session-note
```

卸载:

```sh
dsh plugin --profile web remove dsh-session-note
```

本地改源码(你自己开发)仍然可以链本地目录:

```sh
pnpm install
pnpm build
dsh plugin --profile web add /path/to/dsh-session-note
```

## 刻意没做的

- 不 portal、不挤开对话区
- 不包装 `workspaces.openPath`
- 不给模型注册 tool(下一步可以加 `note_set` / `note_get`)

Install

dsh plugin --profile web add github:makechange/dsh-session-note#d198de5bac5a107df17685d5ab4c4dbbc270723a

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