dsh-remember 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Arborsm
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,111 @@
1
+ # dsh-remember
2
+
3
+ [![ci](https://github.com/Arborsm/dsh-remember/actions/workflows/ci.yml/badge.svg)](https://github.com/Arborsm/dsh-remember/actions/workflows/ci.yml)
4
+ [![npm](https://img.shields.io/npm/v/dsh-remember)](https://www.npmjs.com/package/dsh-remember)
5
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
+
7
+ [中文](README.zh-CN.md)
8
+
9
+ Cross-session long-term memory for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh).
10
+
11
+ While you're away, it looks back at your recent sessions and distills the useful experience into a set of plain Markdown files. Every conversation after that starts with a summary of those memories, and the model greps the originals when it needs details.
12
+
13
+ No vector database, no external service — memories are just files under `~/.dsh-memory/` that you can open, search, and manage with git.
14
+
15
+ ## Features
16
+
17
+ - **Automatic extraction** — idle sessions are scanned, redacted, and distilled in the background
18
+ - **Automatic consolidation** — new experience is merged incrementally; stale, never-cited entries are pruned
19
+ - **Automatic recall** — every prompt carries a memory summary (configurable token cap); the model searches on demand
20
+ - **Readable and controllable** — a sidebar status panel, a memory viewer, and a settings page; pause anytime
21
+ - **Translatable** — one-click translation of the memory files with incremental caching
22
+ - **Portable** — gzip bundle export/import with content-hash dedup
23
+
24
+ ## Screenshots
25
+
26
+ The memory entry at the bottom of the sidebar opens the status panel.
27
+
28
+ <p align="center">
29
+ <img src="docs/shots/01-sidebar-panel.png" width="420" alt="Sidebar entry and status panel">
30
+ </p>
31
+
32
+ The memory viewer: overview, summary, index, and records.
33
+
34
+ <p align="center">
35
+ <img src="docs/shots/02-viewer-overview.png" width="330" alt="Overview">
36
+ <img src="docs/shots/03-viewer-summary.png" width="330" alt="Summary">
37
+ </p>
38
+
39
+ <p align="center">
40
+ <img src="docs/shots/04-viewer-index.png" width="330" alt="Index">
41
+ <img src="docs/shots/05-viewer-records.png" width="330" alt="Records">
42
+ </p>
43
+
44
+ ## Install
45
+
46
+ From npm:
47
+
48
+ ```sh
49
+ dsh plugin --profile <name> add dsh-remember
50
+ ```
51
+
52
+ From source:
53
+
54
+ ```sh
55
+ git clone https://github.com/Arborsm/dsh-remember.git
56
+ cd dsh-remember
57
+ pnpm install && pnpm build
58
+ dsh plugin --profile <name> add .
59
+ ```
60
+
61
+ Restart `dsh web` after installing. During development you can skip installation and load straight from the workspace (run from the dsh checkout root):
62
+
63
+ ```sh
64
+ pnpm dsh web --patch <path/to>/dsh-remember/cordis.dev.yml
65
+ ```
66
+
67
+ Note: `--patch` must come before `--port`, otherwise commander fails with `unknown option '--patch'`.
68
+
69
+ ## Configuration
70
+
71
+ Every field has a default; the plugin works out of the box. Override via `cordis.yml` or the `config:` block of a dev overlay. Field definitions live in `src/config.ts`.
72
+
73
+ Commonly tuned:
74
+
75
+ | Field | Default | Description |
76
+ |---|---|---|
77
+ | `enabled` | `true` | Master switch |
78
+ | `generateMemories` | `true` | Run extraction and consolidation |
79
+ | `useMemories` | `true` | Inject the memory summary into prompts |
80
+ | `extractModel` / `consolidationModel` | `''` | `provider/model`; empty = deployment default |
81
+ | `workspaceDir` / `dbPath` | `''` | Empty = under `~/.dsh-memory/` |
82
+ | `summaryTokenLimit` | `2500` | Token cap for the injected summary |
83
+ | `scanIntervalMinutes` | `15` | Background scan interval |
84
+ | `minRolloutIdleHours` | `1` | Idle time before a session becomes extractable |
85
+ | `maxUnusedDays` | `30` | Retention for never-cited memories |
86
+
87
+ There are 23 fields in total (scheduling, retries, concurrency, consolidator tool deny-list, …) — see `src/config.ts`. All of them are editable on the settings page.
88
+
89
+ ## Memory files
90
+
91
+ ```text
92
+ ~/.dsh-memory/
93
+ ├── memories/ # git workspace
94
+ │ ├── MEMORY.md # index of all memories
95
+ │ ├── memory_summary.md # the summary injected into prompts
96
+ │ ├── rollout_summaries/ # source evidence for each memory
97
+ │ ├── skills/ # distilled skills
98
+ │ └── … # translations, ad-hoc notes, …
99
+ └── memories.sqlite # extraction queue and job state
100
+ ```
101
+
102
+ ## Development
103
+
104
+ ```sh
105
+ pnpm build # build (tsdown, host + browser bundles)
106
+ pnpm typecheck # tsc --noEmit
107
+ pnpm test # node --test
108
+ pnpm shots # regenerate the screenshots above (fixtures + headless Chrome)
109
+ ```
110
+
111
+ Repository layout, conventions, and debugging notes: [AGENT.md](AGENT.md).
@@ -0,0 +1,111 @@
1
+ # dsh-remember
2
+
3
+ [![ci](https://github.com/Arborsm/dsh-remember/actions/workflows/ci.yml/badge.svg)](https://github.com/Arborsm/dsh-remember/actions/workflows/ci.yml)
4
+ [![npm](https://img.shields.io/npm/v/dsh-remember)](https://www.npmjs.com/package/dsh-remember)
5
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
+
7
+ [English](README.md)
8
+
9
+ [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh)的跨会话长期记忆插件。
10
+
11
+ 它在你不使用的时候回顾最近的会话,把里面有价值的经验提炼成一套普通的 Markdown 文件;之后的每一次对话,模型都会带着这份记忆的摘要工作,需要细节时自己去 grep 原文。
12
+
13
+ 没有向量库、没有外部服务,记忆就是 `~/.dsh-memory/` 下可以直接打开、搜索、用 git 管理的文件。
14
+
15
+ ## 特性
16
+
17
+ - **自动提取**:空闲会话在后台被扫描、脱敏、提炼,全程无需干预
18
+ - **自动整理**:新经验被增量合并进记忆文件,过时、无人引用的内容自动淘汰
19
+ - **自动召回**:每次对话注入记忆摘要(可配置 token 上限),模型按需检索
20
+ - **可读可控**:侧栏状态面板、记忆浏览页、设置页,随时查看和暂停
21
+ - **多语言**:记忆可一键翻译,增量缓存,改一行只重翻一段
22
+ - **可迁移**:gzip bundle 导出 / 导入,按内容哈希去重合并
23
+
24
+ ## 截图
25
+
26
+ 侧栏底部的记忆入口,点开是状态面板。
27
+
28
+ <p align="center">
29
+ <img src="docs/shots/01-sidebar-panel.png" width="420" alt="侧栏入口与状态面板">
30
+ </p>
31
+
32
+ 记忆浏览页:概览、摘要、注册表、记录。
33
+
34
+ <p align="center">
35
+ <img src="docs/shots/02-viewer-overview.png" width="330" alt="概览">
36
+ <img src="docs/shots/03-viewer-summary.png" width="330" alt="摘要">
37
+ </p>
38
+
39
+ <p align="center">
40
+ <img src="docs/shots/04-viewer-index.png" width="330" alt="注册表">
41
+ <img src="docs/shots/05-viewer-records.png" width="330" alt="记录">
42
+ </p>
43
+
44
+ ## 安装
45
+
46
+ 从 npm 安装:
47
+
48
+ ```sh
49
+ dsh plugin --profile <name> add dsh-remember
50
+ ```
51
+
52
+ 从源码安装:
53
+
54
+ ```sh
55
+ git clone https://github.com/Arborsm/dsh-remember.git
56
+ cd dsh-remember
57
+ pnpm install && pnpm build
58
+ dsh plugin --profile <name> add .
59
+ ```
60
+
61
+ 安装后重启 `dsh web`。开发期也可以不安装,直接从工作区加载(在 dsh checkout 根目录执行):
62
+
63
+ ```sh
64
+ pnpm dsh web --patch <path/to>/dsh-remember/cordis.dev.yml
65
+ ```
66
+
67
+ 注意 `--patch` 要写在 `--port` 前面,否则 commander 报 `unknown option '--patch'`。
68
+
69
+ ## 配置
70
+
71
+ 所有字段都有默认值,装上即用。覆盖方式:`cordis.yml` 或 dev overlay 的 `config:` 块,字段定义见 `src/config.ts`。
72
+
73
+ 常用项:
74
+
75
+ | 字段 | 默认 | 说明 |
76
+ |---|---|---|
77
+ | `enabled` | `true` | 总开关 |
78
+ | `generateMemories` | `true` | 是否自动提取与整理 |
79
+ | `useMemories` | `true` | 是否向对话注入记忆摘要 |
80
+ | `extractModel` / `consolidationModel` | `''` | `provider/model`,空 = 跟随默认模型 |
81
+ | `workspaceDir` / `dbPath` | `''` | 空 = `~/.dsh-memory/` 下 |
82
+ | `summaryTokenLimit` | `2500` | 注入摘要的 token 上限 |
83
+ | `scanIntervalMinutes` | `15` | 后台扫描间隔 |
84
+ | `minRolloutIdleHours` | `1` | 会话静置多久才可提取 |
85
+ | `maxUnusedDays` | `30` | 无人引用的记忆保留天数 |
86
+
87
+ 完整字段(调度、重试、并发、整理器工具黑名单等)共 23 项,见 `src/config.ts`,均可在设置页图形化修改。
88
+
89
+ ## 记忆文件
90
+
91
+ ```text
92
+ ~/.dsh-memory/
93
+ ├── memories/ # git 工作区
94
+ │ ├── MEMORY.md # 注册表:所有记忆的索引
95
+ │ ├── memory_summary.md # 注入对话的摘要
96
+ │ ├── rollout_summaries/ # 每条记忆的来源证据
97
+ │ ├── skills/ # 沉淀下来的技能
98
+ │ └── … # 译文、临时笔记等
99
+ └── memories.sqlite # 提取队列与作业状态
100
+ ```
101
+
102
+ ## 开发
103
+
104
+ ```sh
105
+ pnpm build # 构建(tsdown,宿主 + 浏览器两个 bundle)
106
+ pnpm typecheck # tsc --noEmit
107
+ pnpm test # node --test
108
+ pnpm shots # 重新生成上面这些截图(夹具 + 无头 Chrome)
109
+ ```
110
+
111
+ 仓库结构、约定与调试方法见 [AGENT.md](AGENT.md)。
@@ -0,0 +1,5 @@
1
+ # Bundle layer: applied when a profile lists dsh-remember. Rows resolve by
2
+ # package name so Node module resolution finds the installed code.
3
+ - insert:
4
+ - id: dsh-memory
5
+ name: dsh-remember