@a9i5k4/dsh-auto-memory 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,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, Aik358
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # dsh-auto-memory — DSH 自动记忆插件
2
+
3
+ DSH Web GUI 的记忆插件:三层记忆(用户级 / 项目笔记 / 每日日志)自动注入与检索、每日反思、可视化面板与设置页,支持继承其他 AI 工具的历史记忆。
4
+
5
+ ## ✨ 功能
6
+
7
+ | 层 | 位置 | 说明 |
8
+ |---|---|---|
9
+ | 用户级记忆 | `~/.dsh/memory/MEMORY.md` | 跨项目规则/偏好(用户明确要求时写) |
10
+ | 项目笔记 | `{工作区}/.dsh-memory/MEMORY.md` | 项目长期约定、决策、架构要点 |
11
+ | 每日日志 | `{工作区}/.dsh-memory/YYYY-MM-DD.md` | append-only 工作日志 |
12
+ | 反思 | `{工作区}/.dsh-memory/reflections/YYYY-MM-DD.md` | 每日反思(自动提示生成) |
13
+
14
+ - **自动注入**:每次组装系统提示词时注入 `<memory_system>` 块(用户规则 + 项目笔记 + 最近反思 + 最近 N 天日志尾部 + 写入纪律)
15
+ - **每日反思**:检测到"昨天有日志但未生成反思"时,会话首轮自动请求 agent 生成昨日反思
16
+ - **Agent 工具**:`memory_log` / `memory_note` / `memory_user` / `memory_recall` / `memory_external` / `memory_maintain` / `memory_status` / `memory_reflect`
17
+ - **GUI**:侧边栏「记忆」入口 → 浮层面板(概览/日志/笔记/反思/接续/检索);设置页(设置 → 自动记忆)
18
+ - **外部记忆继承**:接入其他 AI 工具(CodeBuddy / Claude Code / Codex / 项目约定文件)积累的记忆
19
+
20
+ ## 🚀 安装(NPM 一键)
21
+
22
+ > 前提:已安装 DeepSeek Harness(dsh)并至少启动过一次 `dsh web`。
23
+
24
+ 在 **profile 目录**(`~/.dsh/profiles/web`)下执行:
25
+
26
+ ```bash
27
+ cd ~/.dsh/profiles/web
28
+ pnpm add @a9i5k4/dsh-auto-memory
29
+ ```
30
+
31
+ 然后编辑该目录下的 `package.json`,在 `dsh.profile.bundles` 数组里追加:
32
+
33
+ ```json
34
+ "@a9i5k4/dsh-auto-memory"
35
+ ```
36
+
37
+ 保存后**重启 dsh web**,插件即生效(侧边栏出现「记忆」入口)。
38
+
39
+ > 没有 pnpm?用 npm 也行:`npm install @a9i5k4/dsh-auto-memory`
40
+
41
+ ## 🤖 AI 时代安装(把这句话直接丢给 AI)
42
+
43
+ > 现在是 AI 时代,你可以直接把下面这句话复制给你的 AI 助手(DeepSeek / Claude / Codex 等),它会帮你完成安装:
44
+
45
+ ```
46
+ 请在 DeepSeek Harness 的 web profile 目录 ~/.dsh/profiles/web 下安装 npm 包
47
+ @a9i5k4/dsh-auto-memory(执行 pnpm add @a9i5k4/dsh-auto-memory 或 npm install),
48
+ 然后在 package.json 的 dsh.profile.bundles 数组追加 "@a9i5k4/dsh-auto-memory",
49
+ 最后重启 dsh web 使插件生效。
50
+ ```
51
+
52
+ ## ⚙️ 配置
53
+
54
+ 默认值(JSON 文件 `~/.dsh/dsh-auto-memory.json`):
55
+
56
+ ```json
57
+ {
58
+ "userMemoryDir": "~/.dsh/memory",
59
+ "projectMemoryDir": ".dsh-memory",
60
+ "injectEnabled": true,
61
+ "injectBudgetChars": 2400,
62
+ "recentDaysInjected": 3,
63
+ "reflectEnabled": true,
64
+ "reflectStyle": "auto"
65
+ }
66
+ ```
67
+
68
+ 可在 GUI(设置 → 自动记忆)中调整。
69
+
70
+ ## 📁 结构
71
+
72
+ - `lib/index.js` — Host 半:引擎、注入、工具、路由(零运行时依赖,仅 node 内置模块)
73
+ - `lib/client.js` — 浏览器半:记忆面板 + 设置页
74
+ - `cordis.patch.yml` — 插件行(`auto-memory`)
75
+
76
+ ## ⚠️ 限制
77
+
78
+ - 记忆文件为明文 Markdown;不存密钥,除非用户明确要求。
79
+ - `memory_recall` 的历史会话检索依赖部署的 session-query 索引,未启用时仅本地检索。
80
+ - 插件集变更需重启 dsh 生效。
81
+
82
+ ## 📦 发布信息
83
+
84
+ - GitHub: https://github.com/Aik358/dsh-auto-memory
85
+ - npm: `@a9i5k4/dsh-auto-memory`
86
+ - License: BSD-3-Clause
@@ -0,0 +1,9 @@
1
+ # dsh-auto-memory bundle patch: inserts the dual-face plugin row into the web
2
+ # profile roster. Applied as a profile bundle layer (the `dsh.bundle.patch`
3
+ # manifest field). The node half (exports ".") runs in the host process
4
+ # (memory engine, /api/dsh-auto-memory routes, agent tools, prompt injection);
5
+ # the `dsh.client` declaration in package.json makes the browser half
6
+ # (exports "./client", served at /plugins/<id>/client.js) load in the web GUI.
7
+ - insert:
8
+ - id: auto-memory
9
+ name: '@a9i5k4/dsh-auto-memory'