Project Notes (@local/dsh-notes)
A DSH bundle that adds a left-sidebar page of notes pinned per project. Notes you switch on are rendered into the agent's system prompt on every step, so project conventions and personal preferences stay in context without being repeated.
What it does
- Sidebar row (
sidebar.panellist, iddsh-notes, order 21 — right after the host's Context row) and the page it selects (main, keydsh-notes). - Per-project notes. Each browser-selected project has its own list; the project list comes from the host's workspace registry, and any directory that already owns notes stays selectable.
- Injection switch. Every note has its own switch. Only enabled, non-empty notes are injected, and only for agents whose working directory is that project.
- Durable store. Notes live in
<dsh home>/notes/<profile>.json, written atomically (temp file + rename) so a crash cannot truncate them.
Architecture
dsh-notes/
├── package.json dsh.bundle.patch + dsh.client (platform web, immediately)
├── cordis.patch.yml one insert row: @local/dsh-notes
├── index.js Host half
├── client.js Client half (plain-JS React, no build step)
├── locale/{en,zh}.json Plugin Manager title/description
└── icon.svg original artwork (redistribution-safe)
Host half (index.js) injects agents, systemPrompt, webServer,
workspaceRegistry and owns:
| Concern | Extension point |
|---|---|
| Store | JSON file under <dsh home>/notes/, atomic write |
| Panel data | webServer.register({ kind: 'exact' }) on /dsh-notes/api/state (GET) and /dsh-notes/api/notes (POST) |
| Standing context | one systemPrompt.section({ name: 'dsh-notes.project-notes', order: 780 }) registered on each agent's own context, rendering that agent's project only |
The section is attached for agents created later (agent/created) and for
agents already live when the plugin activates, so the current session starts
honouring notes immediately. Attachments are removed on plugin unload.
Client half (client.js) registers the sidebar glyph and the page through
ctx.slots.inject(slot, () => ctx.slots.register(...)), so both disappear with
the host's declaration. Host calls go through document.baseURI-relative URLs.
Styling uses --dsw-alias-* tokens only, so the page follows light/dark.
Behaviour notes
- A project with no enabled notes adds no text: the system prompt is unchanged.
- Notes are prompt input, not session history — editing one affects the next request and never rewrites the log.
- The page saves on a 450 ms debounce and flushes pending keystrokes on unmount and on project switch.
Develop
The install links this directory, so edits apply without reinstalling:
reload the page (Ctrl+R) after changing client.js; Host changes (index.js)
need a Harness restart.
GitHub 安装与验证
仓库:https://github.com/991206772-debug/dsh-notes
桌面版可在插件管理中使用仓库地址安装;命令行版在自己的 Profile 中安装:
dsh plugin --profile web add github:991206772-debug/dsh-notes
公开源码不包含用户配置、笔记、真实会话、凭据或 node_modules。验证使用隔离目录,不主动重载正在运行的 DSH。
许可证
自有源码采用 MIT,署名 991206772-debug。
No comments yet. Be the first to write one.