@a9i5k4/dsh-auto-memory 0.1.8 → 0.1.9

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/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # dsh-auto-memory — DSH Auto Memory Plugin / DSH 自动记忆插件
2
2
 
3
- An auto-memory plugin for the DeepSeek Harness Web GUI: three-layer memory (user-level / project notes / daily logs) with automatic injection and retrieval, daily reflections, smart period greetings, a calendar view and settings page, and inheritance of memories from other AI tools.
3
+ An auto-memory plugin for the DeepSeek Harness Web GUI: three-layer memory (user-level / project notes / daily logs) with automatic injection and retrieval, daily reflections, AI period greetings with three-level drawers, auto-consolidation after every turn, smart search, a calendar view and settings page, and inheritance of memories from other AI tools.
4
4
 
5
- DSH Web GUI 的记忆插件:三层记忆自动注入与检索、每日反思、智能时段问候、日历视图与设置页,支持继承其他 AI 工具的历史记忆。
5
+ DSH Web GUI 的记忆插件:三层记忆自动注入与检索、每日反思、AI 时段问候与三级抽屉、每轮自动沉淀、智能检索、日历视图与设置页,支持继承其他 AI 工具的历史记忆。
6
6
 
7
7
  [**English**](README.md) | [中文版](README.zh-CN.md)
8
8
 
@@ -15,25 +15,52 @@ DSH Web GUI 的记忆插件:三层记忆自动注入与检索、每日反思
15
15
  | Layer | Location | Description |
16
16
  |---|---|---|
17
17
  | User-level memory | `~/.dsh/memory/MEMORY.md` | Cross-project rules & preferences |
18
- | Project notes | `{workspace}/.dsh-memory/MEMORY.md` | Project conventions & decisions |
19
- | Daily logs | `{workspace}/.dsh-memory/YYYY-MM-DD.md` | Append-only work log |
20
- | Reflections | `{workspace}/.dsh-memory/reflections/YYYY-MM-DD.md` | Daily reflection (structured, kept in background) |
18
+ | Project notes | `~/.dsh/memory/workspaces/{workspace}/MEMORY.md` | Project conventions & decisions (centralized) |
19
+ | Daily logs | `~/.dsh/memory/workspaces/{workspace}/YYYY-MM-DD.md` | Append-only work log (centralized) |
20
+ | Reflections | `~/.dsh/memory/workspaces/{workspace}/reflections/YYYY-MM-DD.md` | Daily reflection (structured, kept in background) |
21
21
 
22
- - **Auto injection**: injects a `<memory_system>` block into every system prompt (user rules + project notes + recent reflections + recent N days of log tails + pending calendar items + writing discipline)
22
+ > **Centralized storage (WorkBuddy-style)**: all workspace memories live under one root `~/.dsh/memory/workspaces/`, one subdirectory per workspace (readable by any model in any session via injection + cross-workspace `memory_recall`). Legacy per-workspace `.dsh-memory/` folders are auto-migrated on first run after upgrade (the old copies are kept, not deleted).
23
+
24
+ - **Auto injection (at the end of the system prompt)**: every prompt gets a `<memory_system>` block (user rules + project notes + recent reflections + recent N days of log tails + pending calendar items + writing discipline); it is placed at the very end of the system prompt so the model reads the memory discipline right before replying
23
25
  - **Visible memory ops**: when the AI updates or searches memory, it says so in plain text in the chat reply (e.g. "Logged X to today's journal", "I checked memory and found..."), not hidden inside tool calls
24
26
 
25
- ### Smart Period Greetings (Overview page)
27
+ ### Auto-Consolidation memory writes itself after every turn (v0.1.9)
28
+
29
+ Every finished conversation turn is automatically evaluated (via a small subagent) and anything worth keeping is written for you — no reliance on the model remembering to log:
30
+
31
+ - **Today's log** gets entries like `- 21:03 [自动沉淀] …` — no manual `memory_log` needed for routine work
32
+ - **Long-term value is promoted**: project decisions/architecture → project notes (with a `## YYYY-MM-DD` heading); cross-project rules → user-level memory
33
+ - **Small talk is skipped** (content threshold `autoConsolidateMinChars`), each turn is deduplicated by turn number, subagent turns are ignored
34
+ - **Agent traces in the GUI**: the overview shows "Auto-consolidated N points today (latest HH:MM)"; the panel refreshes on open, every 30s while open, and via the ⟳ button
35
+ - **`memory_consolidate` tool**: read recent logs and distill long-term decisions / architecture / user preferences into MEMORY.md on demand ("dream-like" consolidation)
36
+ - Configurable in `~/.dsh/dsh-auto-memory.json`: `autoConsolidate` (default true), `autoConsolidateMinChars` (default 60)
26
37
 
27
- The first thing you see when opening the memory panel is a friendly period greeting, not technical info:
38
+ ### AI Greetings & Three-level Drawers (Overview page, v0.1.9)
28
39
 
29
- - **Multiple times a day**: morning shows "yesterday summary + early morning", forenoon shows the morning's work, noon/afternoon/evening follow suit
30
- - **Smart timing**: if you were away for more than 1 hour (off work / stepped away) and come back, it automatically shows "Welcome back" with what was finished meanwhile
31
- - **Drawer layout**: the outer layer stays casual and greeting-like; each period is a drawer tap to expand the professional details
40
+ The first thing you see when opening the memory panel is an **AI-generated** period greeting, not a template and not technical info:
41
+
42
+ - **AI-written greeting**: a subagent writes a warm, casual greeting for the current period (morning / forenoon / noon / afternoon / evening), mentioning your most important work of the day; generated once per period per day and cached in `.dsh-memory/greetings/` — no repeated API cost
43
+ - **Drawer titles are the AI summaries**: the "Today afternoon / Today evening" window titles are replaced with the AI's casual summary text itself
44
+ - **Three-level drawer structure**:
45
+ - Level 1: period drawer, titled with the AI summary
46
+ - Level 2: inside it, small drawers — one per work item the AI distilled (with a point count)
47
+ - Level 3: expand a work item to read its detail points
48
+ - **Summaries are cached**: structured results live in `.dsh-memory/summaries/`; opening the panel reads the cache (offline-friendly, no regeneration); the ⟳ refresh button or returning after >1h away forces a fresh generation; every summary shows its generation time
49
+ - **Smart timing**: if you were away for more than 1 hour and come back, the greeting says "Welcome back" with what was finished meanwhile
32
50
  - **Daily reflection stays in background**: structured reflections (results / lessons / next steps) are kept, while the front page only shows a light greeting
33
51
 
52
+ ### Smart Search (Search tab, v0.1.9)
53
+
54
+ The Search tab adds a **Smart search** button next to the keyword search:
55
+
56
+ - The AI expands your natural-language query into 3-6 keywords (e.g. "last time publishing npm hit a snag" → 发布 / 踩坑 / GitHub / npm / 推送)
57
+ - Scans all three memory layers plus reflections with those keywords
58
+ - The AI then composes a **conversational answer** in natural language, citing where each fact came from (log date / project note / user-level memory) — it never fabricates facts not present in memory
59
+ - Raw keyword hits with their sources are listed under the answer
60
+
34
61
  ### Calendar View (Four Quadrants)
35
62
 
36
- New 「Calendar」tab (liquid-glass monthly view):
63
+ 「Calendar」tab (liquid-glass monthly view):
37
64
 
38
65
  - Monthly grid, today highlighted, click any date to add an item
39
66
  - **Four-quadrant colors**: Urgent & Important (red) / Important (blue) / Urgent (orange) / Neither (gray)
@@ -43,16 +70,119 @@ New 「Calendar」tab (liquid-glass monthly view):
43
70
 
44
71
  ### Agent Tools
45
72
 
46
- `memory_log` / `memory_note` / `memory_user` / `memory_recall` / `memory_external` / `memory_maintain` / `memory_status` / `memory_reflect` / `calendar_add` / `calendar_list` / `calendar_done` / `calendar_remove`
73
+ `memory_log` / `memory_note` / `memory_user` / `memory_recall` / `memory_external` / `memory_maintain` / `memory_status` / `memory_reflect` / `memory_consolidate` / `calendar_add` / `calendar_list` / `calendar_done` / `calendar_remove`
47
74
 
48
75
  ### UI
49
76
 
50
77
  - Sidebar 「Memory」entry → floating panel (Overview / Logs / Notes / Reflections / Connect / Calendar / Search)
51
- - Settings page (Settings → Auto Memory): storage paths, injection budget, reflection style, **UI language (中文 / English)**
78
+ - Settings page (Settings → Auto Memory): storage paths, injection budget, reflection style, UI language (中文 / English), **panel font size (Small / Normal / Large / Extra large, default Large)** — applies immediately, no save needed
52
79
  - **External memory inheritance**: import memories accumulated by other AI tools (CodeBuddy / Claude Code / Codex / project convention files)
53
80
 
54
81
  ---
55
82
 
83
+ ## Demos
84
+
85
+ ### 1. Auto-consolidation in action
86
+
87
+ You finish a conversation turn — no memory commands needed. The moment the turn ends, the plugin writes a topic-grouped entry into today's log:
88
+
89
+ ```
90
+ ── Chat ──────────────────────────────────────────────────
91
+
92
+ You: 我把抽屉的 bug 修好了,顺便加了字号功能,设置页可以调,默认大号。
93
+
94
+ AI: 已把 X 记入今日日志。 (回复末尾加粗转述,记忆操作对用户可见)
95
+
96
+ ── Turn ends → auto-consolidation writes to .dsh-memory/2026-08-14.md ──
97
+
98
+ ## 修复抽屉bug与字号功能(22:30)
99
+ - 修复了抽屉 bug
100
+ - 新增界面字号功能(设置页,默认大号)
101
+ ```
102
+
103
+ Long-term decisions are promoted to project notes with a `## YYYY-MM-DD` heading automatically. If the AI call fails, the entry is queued and retried by the 5-minute polling loop.
104
+
105
+ ### 2. AI greeting & three-level drawers
106
+
107
+ Click the 「Memory」 button — the floating panel opens with an AI-written greeting, cross-workspace summaries, and drawers titled by the AI summaries themselves:
108
+
109
+ ```
110
+ ┌──────────────────────────────────────────────────────┐
111
+ │ 自动记忆 ⤾ ⟳ ✕ │
112
+ ├──────────────────────────────────────────────────────┤
113
+ │ 概览 │ 日志 │ 笔记 │ 反思 │ 接续 │ 日历 │ 检索 │ 工作区 │
114
+ ├──────────────────────────────────────────────────────┤
115
+ │ 晚上好 · 晚上 │
116
+ │ │
117
+ │ 晚上好,这一晚上你收获满满呀。把 Ark9Tools 扩展框架整个 │
118
+ │ 捋了一遍,冒烟测试 18 项全过,还一口气把 dsh-auto-memory │
119
+ │ 推到 0.1.9… │
120
+ │ │
121
+ │ ┌ 工作区总结(跨工作区) ────────────────────────────┐ │
122
+ │ │ dsh_debug · 8-10 ~ 8-14 │ │
123
+ │ │ 主要在做 dsh-auto-memory 插件,逐步发布 v0.1.x… │ │
124
+ │ │ · 8-14: v0.1.9 系列功能落地 │ │
125
+ │ │ · 8-13: 中文乱码与 no-branches 修复 │ │
126
+ │ └────────────────────────────────────────────────┘ │
127
+ │ │
128
+ │ ▼ 下午把 dsh-auto-memory 完整发布出去了… │
129
+ │ 今日下午 · 10 条日志 · 生成于 21:28 │
130
+ │ ▸ 发布与收尾 (3 项) │
131
+ │ ▸ 修复发布过程中的坑 (2 项) │
132
+ │ │
133
+ │ ▼ 晚上搭建了扩展框架… │
134
+ │ 今日晚上 · 7 条日志 · 生成于 21:28 │
135
+ │ ▸ EventBus 与服务容器 (4 项) │
136
+ └──────────────────────────────────────────────────────┘
137
+ ```
138
+
139
+ Tap any small drawer (▸) to read its detail points. Greetings and summaries are cached per period — reopening the panel costs no API calls; the ⟳ button forces fresh generation.
140
+
141
+ ### 3. Smart search
142
+
143
+ Type a natural-language question in the Search tab and hit 「智能检索」:
144
+
145
+ ```
146
+ ┌──────────────────────────────────────────────────────┐
147
+ │ 检索: [上次发布 npm 包踩了什么坑 ] [检索] [智能检索]│
148
+ ├──────────────────────────────────────────────────────┤
149
+ │ ┌ 智能回答 ───────────────────────────────────────┐ │
150
+ │ │ 上次发布踩了三个坑:GitHub 中文 description 乱码 │ │
151
+ │ │ (PowerShell GBK,改用 Node fetch);第一次 push │ │
152
+ │ │ 实际没成功(凭据管理器拦截,需 -c credential.helper=);│ │
153
+ │ │ npm 2FA 需要 Automation 令牌。以上来自 │ │
154
+ │ │ 2026-08-14 日志。 │ │
155
+ │ └────────────────────────────────────────────────┘ │
156
+ │ 关键词: 发布 / 踩坑 / GitHub / npm / 推送 │
157
+ │ · [2026-08-14.md] 发布完成:①GitHub 仓库已建… │
158
+ │ · [reflections/2026-08-14.md] 成果回顾:… │
159
+ └──────────────────────────────────────────────────────┘
160
+ ```
161
+
162
+ The AI expands your query into 3-6 keywords, scans all memory layers, then composes a conversational answer citing its sources — never fabricating facts.
163
+
164
+ ### 4. AI-maintained calendar
165
+
166
+ Mention a deadline in chat — the AI writes it into the calendar and says so in plain text:
167
+
168
+ ```
169
+ ── Chat ──────────────────────────────────────────────────
170
+
171
+ You: 周五 10 点要交周报,别忘了。
172
+
173
+ AI: 已把『2026-08-15 10:00 交周报』记入日历(重要不紧急)。
174
+
175
+ ── Calendar tab · 2026 年 8 月 ──────────────────────────
176
+
177
+ 一 二 三 四 五 六 日
178
+ 11 12 13 14 [15]
179
+ ● 交周报
180
+ ```
181
+
182
+ Pending items are injected into every future session's system prompt until completed — the AI reminds you without being asked.
183
+
184
+ ---
185
+
56
186
  ## Installation (one command)
57
187
 
58
188
  > Prerequisite: install [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) and start `dsh web` at least once.
@@ -102,11 +232,24 @@ Defaults (JSON file `~/.dsh/dsh-auto-memory.json`):
102
232
  "recentDaysInjected": 3,
103
233
  "reflectEnabled": true,
104
234
  "reflectStyle": "auto",
105
- "locale": "zh"
235
+ "locale": "zh",
236
+ "autoConsolidate": true,
237
+ "autoConsolidateMinChars": 60,
238
+ "memoryRoot": "~/.dsh/memory/workspaces",
239
+ "dayBoundaryMinutes": 450
106
240
  }
107
241
  ```
108
242
 
109
- Adjustable in the GUI (Settings → Auto Memory), including the UI language (zh / en).
243
+ Adjustable in the GUI (Settings → Auto Memory), including the UI language (zh / en), the panel font size and the day boundary.
244
+
245
+ ### v0.1.9 hardening (budget / boundary / picker)
246
+
247
+ - **Daily write budget with auto-compaction**: user memory ≤ 4000 chars/day, project notes ≤ 3000 chars/day (shared across sessions, reset at the day boundary). Going over the budget never rejects the write — the framework compacts the pre-today sections with an AI pass (merge duplicates, drop stale entries, keep hard facts) and then writes; if AI is unavailable, the oldest sections are archived to `archived-user.md` / `archive/notes-archived.md` (nothing is lost). Compaction is throttled to once per 10 minutes.
248
+ - **Day boundary (late-night belongs to yesterday)**: `dayBoundaryMinutes` (default 450 = 07:30). Work logged before the boundary is appended to the previous day's log, and the daily reflection for the previous day starts only after the boundary — no more "it's 00:30, tell me what you did yesterday" right after midnight.
249
+ - **Native OS folder picker**: the "Browse…" button next to the memory root opens the real system folder picker (via the DSH directory-picker native backend); falls back to the in-app browser when no native picker is available. Changing the root auto-migrates existing workspace memory folders to the new location (old files are kept) and all path variables follow the new config on the next refresh.
250
+ - **30-day distillation**: `memory_maintain` distills logs older than 30 days with an AI pass into the project notes, archives the originals under `archive/`, and removes them from the active log list.
251
+ - **First-turn injection guarantee**: a `pre-step` hook awaits the memory state refresh before the first step, so the model sees memory from the very first token (previously the async load could leave the first turn empty).
252
+ - **Per-step reminder with timestamp**: the injected discipline block carries a live `HH:MM:SS` timestamp that refreshes on every prompt assembly, and a 15-second heartbeat file proves the background loop is alive.
110
253
 
111
254
  ---
112
255
 
@@ -130,4 +273,4 @@ Adjustable in the GUI (Settings → Auto Memory), including the UI language (zh
130
273
 
131
274
  - GitHub: https://github.com/Aik358/dsh-auto-memory
132
275
  - npm: `@a9i5k4/dsh-auto-memory`
133
- - License: BSD-3-Clause
276
+ - License: BSD-3-Clause
package/README.zh-CN.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # dsh-auto-memory — DSH 自动记忆插件
2
2
 
3
- DSH Web GUI 的记忆插件:三层记忆(用户级 / 项目笔记 / 每日日志)自动注入与检索、每日反思、智能时段问候、日历视图与设置页,支持继承其他 AI 工具的历史记忆。
3
+ DSH Web GUI 的记忆插件:三层记忆(用户级 / 项目笔记 / 每日日志)自动注入与检索、每日反思、AI 时段问候与三级抽屉、每轮自动沉淀、智能检索、日历视图与设置页,支持继承其他 AI 工具的历史记忆。
4
4
 
5
5
  [English](README.md) | [中文版](README.zh-CN.md)
6
6
 
@@ -13,25 +13,52 @@ DSH Web GUI 的记忆插件:三层记忆(用户级 / 项目笔记 / 每日
13
13
  | 层 | 位置 | 说明 |
14
14
  |---|---|---|
15
15
  | 用户级记忆 | `~/.dsh/memory/MEMORY.md` | 跨项目规则/偏好(用户明确要求时写) |
16
- | 项目笔记 | `{工作区}/.dsh-memory/MEMORY.md` | 项目长期约定、决策、架构要点 |
17
- | 每日日志 | `{工作区}/.dsh-memory/YYYY-MM-DD.md` | append-only 工作日志 |
18
- | 反思 | `{工作区}/.dsh-memory/reflections/YYYY-MM-DD.md` | 每日反思(后台结构化积累) |
16
+ | 项目笔记 | `~/.dsh/memory/workspaces/{工作区}/MEMORY.md` | 项目长期约定、决策、架构要点(集中式) |
17
+ | 每日日志 | `~/.dsh/memory/workspaces/{工作区}/YYYY-MM-DD.md` | append-only 工作日志(集中式) |
18
+ | 反思 | `~/.dsh/memory/workspaces/{工作区}/reflections/YYYY-MM-DD.md` | 每日反思(后台结构化积累) |
19
19
 
20
- - **自动注入**:每次组装系统提示词时注入 `<memory_system>` 块(用户规则 + 项目笔记 + 最近反思 + 最近 N 天日志尾部 + 未完成日历事项 + 写入纪律)
20
+ > **集中式存储(WorkBuddy 式)**:所有工作区的记忆统一存放在一个根目录 `~/.dsh/memory/workspaces/` 下,每工作区一个子目录——任何模型、任何会话都能通过注入 + 跨工作区 `memory_recall` 读取。旧版分散在各工作区 `.dsh-memory/` 的记忆会在升级后首次运行时自动迁移(旧副本保留不删)。
21
+
22
+ - **自动注入(放在系统提示词末尾)**:每次组装系统提示词时注入 `<memory_system>` 块(用户规则 + 项目笔记 + 最近反思 + 最近 N 天日志尾部 + 未完成日历事项 + 写入纪律),并置于提示词**最末尾**——模型在回复前最后读到记忆纪律,遵循度更高
21
23
  - **记忆操作可见**:更新/检索记忆时,AI 会在对话正文中明文说明(如"已把 X 记入今日日志""我查了记忆,发现…"),不藏在工具调用里
22
24
 
23
- ### 智能时段问候(概览页)
25
+ ### 每轮自动沉淀 — 记忆自己写自己(v0.1.9)
26
+
27
+ 每轮对话结束时自动评估本轮内容(经小型 subagent 判断+提炼),值得记的自动写入,无需你手动调 memory_log,也不依赖模型记得写:
28
+
29
+ - **今日日志**自动追加 `- 21:03 [自动沉淀] …` 条目
30
+ - **长期价值自动升格**:项目决策/架构 → 项目笔记(带 `## YYYY-MM-DD` 日期标题);跨项目规则 → 用户级记忆
31
+ - **寒暄轮自动跳过**(内容门槛 `autoConsolidateMinChars`);按 turn 去重,每轮只写一次;子代理轮次不参与
32
+ - **GUI 有 Agent 参与痕迹**:概览页显示"今日已自动沉淀 N 条要点(最近 HH:MM)";面板打开即刷新、打开期间每 30 秒自动重拉、⟳ 按钮手动刷新
33
+ - **`memory_consolidate` 工具**:AI 读最近日志发散提炼,把有长期价值的决策/架构/用户偏好固化进 MEMORY.md("做梦式"固化)
34
+ - 可在 `~/.dsh/dsh-auto-memory.json` 配置:`autoConsolidate`(默认开)、`autoConsolidateMinChars`(默认 60)
24
35
 
25
- 打开记忆面板第一眼看到的是生活化的时段问候,而不是严肃的技术信息:
36
+ ### AI 时段问候与三级抽屉(概览页,v0.1.9)
26
37
 
27
- - **一天多次**:早晨显示"昨天摘要 + 今天早晨"、上午显示上午的工作、中午/下午/晚上依次类推
38
+ 打开记忆面板第一眼看到的是 **AI 生成**的生活化问候,不是模板、不是严肃的技术信息:
39
+
40
+ - **AI 写问候**:subagent 按当前时段(早上/上午/中午/下午/晚上)写一句温暖随口的问候,自然提起今天最重要的 1-2 件工作;每天每时段生成一次并缓存到 `.dsh-memory/greetings/`,不重复消耗 API
41
+ - **抽屉标题就是 AI 总结**:"今日下午 / 今日晚上" 的大窗口标题替换为 AI 总结的原文(如"下午这段你干得真不少呢,最能看到成果的就是 dsh-auto-memory 这一条线…")
42
+ - **三级抽屉结构**:
43
+ - 第一层:时段抽屉,标题即 AI 总结
44
+ - 第二层:拉开后是若干小抽屉——AI 归纳的每项工作(带细点数)
45
+ - 第三层:展开某项工作,阅读其细点
46
+ - **总结有缓存**:结构化结果存 `.dsh-memory/summaries/`;打开面板读缓存(离线可看、不重复生成);⟳ 刷新键或暂离超 1 小时回来才强制重新生成;每份总结显示生成时间
28
47
  - **智能时机**:离开超过 1 小时(下班/暂离)再打开,自动显示"欢迎回来"并列出期间的完成事项
29
- - **抽屉式展开**:外层保持生活化问候风格;每个时段做成抽屉,点开才显示专业的工作明细
30
48
  - **每日反思**:后台保留结构化反思(成果/教训/要点),前台只有轻松问候
31
49
 
50
+ ### 智能检索(检索页,v0.1.9)
51
+
52
+ 检索页在「检索」旁新增「**智能检索**」按钮:
53
+
54
+ - AI 把你的自然语言查询扩散成 3-6 个关键词(如"上次发布 npm 踩的坑" → 发布 / 踩坑 / GitHub / npm / 推送)
55
+ - 用这些关键词扫描三层记忆 + 反思
56
+ - AI 再**综合成一段自然语言回答**,注明每条信息来自哪份记忆(日志日期/项目笔记/用户级),**绝不编造记忆里没有的事实**
57
+ - 回答下方列出关键词与原始命中明细(来源 + 原文)
58
+
32
59
  ### 日历视图(四象限)
33
60
 
34
- 新增「日历」页签(液态玻璃风格月视图):
61
+ 「日历」页签(液态玻璃风格月视图):
35
62
 
36
63
  - 月视图网格,今日高亮,点击任意日期添加事项
37
64
  - **四象限色标**:重要紧急(红)/ 重要不紧急(蓝)/ 紧急不重要(橙)/ 不重要不紧急(灰)
@@ -41,16 +68,119 @@ DSH Web GUI 的记忆插件:三层记忆(用户级 / 项目笔记 / 每日
41
68
 
42
69
  ### Agent 工具
43
70
 
44
- `memory_log` / `memory_note` / `memory_user` / `memory_recall` / `memory_external` / `memory_maintain` / `memory_status` / `memory_reflect` / `calendar_add` / `calendar_list` / `calendar_done` / `calendar_remove`
71
+ `memory_log` / `memory_note` / `memory_user` / `memory_recall` / `memory_external` / `memory_maintain` / `memory_status` / `memory_reflect` / `memory_consolidate` / `calendar_add` / `calendar_list` / `calendar_done` / `calendar_remove`
45
72
 
46
73
  ### 界面
47
74
 
48
75
  - 侧边栏「记忆」入口 → 浮层面板(概览/日志/笔记/反思/接续/日历/检索)
49
- - 设置页(设置 → 自动记忆):存储位置、注入预算、反思风格、**界面语言(中文 / English)**
76
+ - 设置页(设置 → 自动记忆):存储位置、注入预算、反思风格、界面语言(中文 / English)、**界面字号(小/标准/大/特大,默认大)**——切换立即生效,无需保存
50
77
  - **外部记忆继承**:接入其他 AI 工具(CodeBuddy / Claude Code / Codex / 项目约定文件)积累的记忆
51
78
 
52
79
  ---
53
80
 
81
+ ## 演示
82
+
83
+ ### 1. 每轮自动沉淀
84
+
85
+ 你结束一轮对话,什么都不用做——本轮一结束,插件自动把按主题分组的条目写进今日日志:
86
+
87
+ ```
88
+ ── 对话 ──────────────────────────────────────────────────
89
+
90
+ 你: 我把抽屉的 bug 修好了,顺便加了字号功能,设置页可以调,默认大号。
91
+
92
+ AI: 已把 X 记入今日日志。 (回复末尾加粗转述,记忆操作对用户可见)
93
+
94
+ ── 本轮结束 → 自动沉淀写入 .dsh-memory/2026-08-14.md ──
95
+
96
+ ## 修复抽屉bug与字号功能(22:30)
97
+ - 修复了抽屉 bug
98
+ - 新增界面字号功能(设置页,默认大号)
99
+ ```
100
+
101
+ 长期决策会自动升格进项目笔记(带 `## YYYY-MM-DD` 日期标题)。如果 AI 调用失败,条目会进入重试队列,由每 5 分钟的轮询兜底补写。
102
+
103
+ ### 2. AI 问候与三级抽屉
104
+
105
+ 点击侧边栏「记忆」按钮——浮层面板弹出,AI 写的问候语、跨工作区总结、以及标题就是 AI 总结的抽屉:
106
+
107
+ ```
108
+ ┌──────────────────────────────────────────────────────┐
109
+ │ 自动记忆 ⤾ ⟳ ✕ │
110
+ ├──────────────────────────────────────────────────────┤
111
+ │ 概览 │ 日志 │ 笔记 │ 反思 │ 接续 │ 日历 │ 检索 │ 工作区 │
112
+ ├──────────────────────────────────────────────────────┤
113
+ │ 晚上好 · 晚上 │
114
+ │ │
115
+ │ 晚上好,这一晚上你收获满满呀。把 Ark9Tools 扩展框架整个 │
116
+ │ 捋了一遍,冒烟测试 18 项全过,还一口气把 dsh-auto-memory │
117
+ │ 推到 0.1.9… │
118
+ │ │
119
+ │ ┌ 工作区总结(跨工作区) ────────────────────────────┐ │
120
+ │ │ dsh_debug · 8-10 ~ 8-14 │ │
121
+ │ │ 主要在做 dsh-auto-memory 插件,逐步发布 v0.1.x… │ │
122
+ │ │ · 8-14: v0.1.9 系列功能落地 │ │
123
+ │ │ · 8-13: 中文乱码与 no-branches 修复 │ │
124
+ │ └────────────────────────────────────────────────┘ │
125
+ │ │
126
+ │ ▼ 下午把 dsh-auto-memory 完整发布出去了… │
127
+ │ 今日下午 · 10 条日志 · 生成于 21:28 │
128
+ │ ▸ 发布与收尾 (3 项) │
129
+ │ ▸ 修复发布过程中的坑 (2 项) │
130
+ │ │
131
+ │ ▼ 晚上搭建了扩展框架… │
132
+ │ 今日晚上 · 7 条日志 · 生成于 21:28 │
133
+ │ ▸ EventBus 与服务容器 (4 项) │
134
+ └──────────────────────────────────────────────────────┘
135
+ ```
136
+
137
+ 点击任意小抽屉(▸)阅读该项工作的细点。问候与总结按时段缓存——再次打开面板不消耗 API;⟳ 按钮强制重新生成。
138
+
139
+ ### 3. 智能检索
140
+
141
+ 在检索页输入自然语言问题,点「智能检索」:
142
+
143
+ ```
144
+ ┌──────────────────────────────────────────────────────┐
145
+ │ 检索: [上次发布 npm 包踩了什么坑 ] [检索] [智能检索]│
146
+ ├──────────────────────────────────────────────────────┤
147
+ │ ┌ 智能回答 ───────────────────────────────────────┐ │
148
+ │ │ 上次发布踩了三个坑:GitHub 中文 description 乱码 │ │
149
+ │ │ (PowerShell GBK,改用 Node fetch);第一次 push │ │
150
+ │ │ 实际没成功(凭据管理器拦截,需 -c credential.helper=);│ │
151
+ │ │ npm 2FA 需要 Automation 令牌。以上来自 │ │
152
+ │ │ 2026-08-14 日志。 │ │
153
+ │ └────────────────────────────────────────────────┘ │
154
+ │ 关键词: 发布 / 踩坑 / GitHub / npm / 推送 │
155
+ │ · [2026-08-14.md] 发布完成:①GitHub 仓库已建… │
156
+ │ · [reflections/2026-08-14.md] 成果回顾:… │
157
+ └──────────────────────────────────────────────────────┘
158
+ ```
159
+
160
+ AI 把你的查询扩散成 3-6 个关键词,扫描全部记忆层,再综合成一段自然语言回答并注明来源——绝不编造记忆里没有的事实。
161
+
162
+ ### 4. AI 维护日历
163
+
164
+ 对话里提一句 deadline,AI 就写进日历并明文转述:
165
+
166
+ ```
167
+ ── 对话 ──────────────────────────────────────────────────
168
+
169
+ 你: 周五 10 点要交周报,别忘了。
170
+
171
+ AI: 已把『2026-08-15 10:00 交周报』记入日历(重要不紧急)。
172
+
173
+ ── 日历页签 · 2026 年 8 月 ──────────────────────────────
174
+
175
+ 一 二 三 四 五 六 日
176
+ 11 12 13 14 [15]
177
+ ● 交周报
178
+ ```
179
+
180
+ 未完成事项会注入之后每次会话的系统提示词——AI 不用你提醒就会主动提及。
181
+
182
+ ---
183
+
54
184
  ## 安装(NPM 一键)
55
185
 
56
186
  > 前提:已安装 DeepSeek Harness(dsh)并至少启动过一次 `dsh web`。
@@ -100,11 +230,24 @@ pnpm add @a9i5k4/dsh-auto-memory
100
230
  "recentDaysInjected": 3,
101
231
  "reflectEnabled": true,
102
232
  "reflectStyle": "auto",
103
- "locale": "zh"
233
+ "locale": "zh",
234
+ "autoConsolidate": true,
235
+ "autoConsolidateMinChars": 60,
236
+ "memoryRoot": "~/.dsh/memory/workspaces",
237
+ "dayBoundaryMinutes": 450
104
238
  }
105
239
  ```
106
240
 
107
- 可在 GUI(设置 → 自动记忆)中调整,包括界面语言(zh / en)。
241
+ 可在 GUI(设置 → 自动记忆)中调整,包括界面语言(zh / en)、界面字号与日界。
242
+
243
+ ### v0.1.9 加固(预算 / 日界 / 目录选择器)
244
+
245
+ - **每日写入预算 + 超限自动压缩**:用户级记忆 ≤4000 字/天、项目笔记 ≤3000 字/天(所有会话共享一天额度,日界重置)。超限不拒绝写入——框架先把「今天之前」的旧内容交给 AI 压缩(合并重复、删除过期、保留硬信息)腾出空间再写;AI 不可用时把最早段落归档到 `archived-user.md` / `archive/notes-archived.md`,信息不丢。压缩 10 分钟节流。
246
+ - **日界(凌晨的活儿归昨晚)**:`dayBoundaryMinutes`(默认 450 = 早上 7:30)。日界之前的活儿记入前一天日志,前一天的每日反思也要等过了日界才开始——凌晨不再一过午夜就催「昨天干了什么」。
247
+ - **系统原生文件夹选择器**:记忆根目录旁的「浏览…」按钮直接弹系统的文件夹选择器(经 DSH directory-picker 原生后端);无原生选择器时自动回退内嵌浏览。更换根目录时自动把已有工作区记忆迁移到新位置(旧文件保留),所有路径变量在下一次刷新时跟随新配置。
248
+ - **30 天蒸馏**:`memory_maintain` 把 30 天前的旧日志交给 AI 提炼进项目笔记,原文保底归档到 `archive/`,并从活跃日志列表移除。
249
+ - **首轮注入保障**:`pre-step` 钩子在第一步放行前等待记忆状态刷新,模型从第一个 token 起就能看到记忆(此前异步加载可能让首轮注入为空)。
250
+ - **每步带时间戳的提醒**:注入的纪律块携带实时 `HH:MM:SS` 时间戳,每次组装提示词都刷新;另有 15 秒心跳文件证明后台轮询存活。
108
251
 
109
252
  ---
110
253
 
@@ -128,4 +271,4 @@ pnpm add @a9i5k4/dsh-auto-memory
128
271
 
129
272
  - GitHub: https://github.com/Aik358/dsh-auto-memory
130
273
  - npm: `@a9i5k4/dsh-auto-memory`
131
- - License: BSD-3-Clause
274
+ - License: BSD-3-Clause