dsh-memory-metabolism 0.2.0 → 0.2.1

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
@@ -6,22 +6,24 @@ Local-first Markdown memory for DeepSeek Harness, with a full-page memory workbe
6
6
 
7
7
  *Screenshots use demo data.*
8
8
 
9
- Status: 0.2.0. The Markdown store, workbench, chat and organizer are usable; retention/write thresholds remain tunable.
9
+ Status: 0.2.1. The Markdown store, workbench, chat and organizer are usable; retention/write thresholds remain tunable.
10
10
 
11
11
  ## Why
12
12
 
13
13
  DSH sessions change workspaces. Project memory should not disappear when the working directory changes, and a memory assistant should not need the main chat window or a separate agent session to edit it.
14
14
 
15
- This plugin keeps memory as plain Markdown under one data directory shared by all profiles. Project memory is keyed by a stable project key, not by the current directory. The memory assistant runs inside the plugin with a fixed, restricted tool set.
15
+ This plugin keeps memory as plain Markdown. Global memory lives in the shared data directory; project memory lives in the project's own `.deepseek-harness/MEMORY.md`, with `project.json` and a small registry for identity and migration. The memory assistant runs inside the plugin with a fixed, restricted tool set.
16
16
 
17
17
  ## Features
18
18
 
19
- - Full-page workbench in the sidebar: overview cards, a metabolism flow, chat threads, organizer drawer and chat settings.
19
+ - Full-page workbench: overview cards, a metabolism flow and a directly editable memory list in the main pane; the assistant lives in a collapsible right sidebar.
20
20
  - Independent chat threads: new, switch, rename, fork and delete. Each thread has its own history and project.
21
21
  - Restricted assistant: it can only call five memory tools (search, read, status, consolidate, apply). It cannot run commands, read files or touch the main chat.
22
22
  - Streaming replies over SSE, with visible tool chips and a stop button.
23
- - Global, project, reference and working scopes; project keys are stable across workspaces.
23
+ - Global and project are persistence scopes. Reference documents are a separate library; working notes are session scratch, not long-term injection.
24
24
  - Write gate, FSRS-style retention, BM25 + MMR retrieval and duplicate reports.
25
+ - Background organizer on `turn/end`: writes a daily evidence log, then sends extracted proposals through the same write gate (candidate by default).
26
+ - Diagnostics drawer with read-only injection preview, recent injection trace, organizer state and recent errors.
25
27
  - Settings dashboard for memory entries, candidates, injection trace, import and thresholds.
26
28
  - Theme-aware base surfaces. Progress bars and gauges use a fixed cyan/yellow/purple/green/red display palette so they stay legible on any DSH skin.
27
29
  - No database, no cloud service, no telemetry.
@@ -64,28 +66,33 @@ Resolution order:
64
66
  3. The git root directory name.
65
67
  4. The current directory name.
66
68
 
67
- The key is not tied to the directory path, so moving a project does not lose its memory. CJK directory names are preserved as project keys.
69
+ Project memory follows the project directory. The key is metadata, not a central bucket: `<project>/.deepseek-harness/MEMORY.md`. Moving or copying the project brings the file along; if two different roots claim the same key, the second gets a hash suffix instead of sharing memory. Legacy central `projects/<key>` files are merged into the project on first registration, with a backup.
68
70
 
69
71
  ## Data layout
70
72
 
71
73
  ~/.dsh/memory-metabolism/
72
74
  global/MEMORY.md
73
- projects/<key>/MEMORY.md
75
+ meta/projects.json # project root registry
74
76
  reference/<name>.md
75
- working/MEMORY.md
76
77
  archive/
77
78
  backups/
78
79
  meta/index.json
79
80
  chats/index.json
80
81
  chats/<id>.json
81
82
 
83
+ <project>/.deepseek-harness/
84
+ MEMORY.md
85
+ project.json # project id, key, display name, root
86
+ memory/YYYY-MM-DD.md # daily evidence (import/auto organizer)
87
+
82
88
  Memory is human-editable Markdown. Entry ids live in hidden HTML comments. Chat logs are local JSON and are not injected into memory.
83
89
 
84
90
  ## Configuration
85
91
 
86
92
  | Key | Default | Meaning |
87
93
  | --- | --- | --- |
88
- | dataDir | ~/.dsh/memory-metabolism | Shared data directory |
94
+ | dataDir | ~/.dsh/memory-metabolism | Shared global/reference/archive directory |
95
+ | projectStorage | local | `local` stores project memory in the project; `central` keeps the legacy bucket |
89
96
  | maxInjectionChars | 6000 | Per-file injection budget |
90
97
  | retrieveTopK | 8 | Retrieval depth |
91
98
  | writeThreshold | 0.65 | Direct-write threshold |
@@ -96,13 +103,17 @@ Memory is human-editable Markdown. Entry ids live in hidden HTML comments. Chat
96
103
  | assistantMaxInputChars | 120000 | Document limit for chat attachments |
97
104
  | chatHistoryChars | 24000 | Prior chat text sent back to the model |
98
105
  | chatMaxRounds | 6 | Tool-call rounds per chat turn |
106
+ | autoOrganize | true | Run the background organizer after a request settles |
107
+ | autoOrganizeModel | empty | Organizer model; empty falls back to `assistantModel` |
108
+ | autoOrganizeDelayMs | 2500 | Quiet period before the organizer runs |
99
109
 
100
- The workbench settings drawer edits the chat-specific values. The settings dashboard edits memory thresholds.
110
+ The workbench settings drawer edits chat-specific values and provides file entries for memory, persona, conventions and logs. The settings dashboard edits memory thresholds.
101
111
 
102
112
  ## Privacy and security
103
113
 
104
114
  - Memory, chat logs and metadata stay under the data directory you choose.
105
115
  - The workbench sends the current message, recent chat history, a compact memory summary and the attached text to the configured DSH model provider.
116
+ - With auto-organize enabled, the settled request transcript is sent to the organizer model and a local daily log is written under `.deepseek-harness/memory/`. Disable it if transcripts contain secrets.
106
117
  - The assistant's tool list is fixed at five memory operations. It has no filesystem, shell, network or main-session tools.
107
118
  - HTTP routes require the x-memory-metabolism header and pass the host request gate when one exists.
108
119
  - Do not paste credentials, tokens or passwords into memory or chat. The console does not redact them.
package/README.zh.md CHANGED
@@ -6,21 +6,21 @@
6
6
 
7
7
  *截图为演示数据。*
8
8
 
9
- 状态:0.2.0。记忆存储、工作台、聊天和整理已可用;写入阈值和留存参数仍可调整。
9
+ 状态:0.2.1。记忆存储、工作台、聊天和整理已可用;写入阈值和留存参数仍可调整。
10
10
 
11
11
  ## 为什么
12
12
 
13
13
  DSH 会话会换工作区。项目记忆不应该跟着当前目录消失,记忆助手也不应该必须借用主聊天窗口或另开一个 DSH 会话。
14
14
 
15
- 插件把记忆保存为同一数据目录下的纯 Markdown,所有 profile 共用。项目记忆按稳定的 project key 分片,不跟 cwd 绑定。记忆助手在插件内部运行,只有固定的记忆工具。
15
+ 插件把记忆保存为纯 Markdown。全局记忆在共享数据目录;项目记忆在项目自己的 `.deepseek-harness/MEMORY.md`,并带 `project.json` 和中央根目录登记表。记忆助手在插件内部运行,只有固定的记忆工具。
16
16
 
17
17
  ## 功能
18
18
 
19
- - 左侧边栏的全页工作台:概览卡片、代谢流程、对话线程、整理抽屉、聊天设置。
19
+ - 全页工作台:主区是概览卡片、代谢流程和可直接操作的记忆列表;助手收在右侧可折叠栏里。
20
20
  - 独立对话线程:新建、切换、重命名、Fork、删除;每线程独立历史与项目。
21
21
  - 受限助手:只能调用 5 个记忆工具(搜索、读取、状态、重复检查、应用)。不能跑命令、读文件或碰主聊天。
22
22
  - SSE 流式回复、工具 chip、停止生成。
23
- - 全局、项目、reference、工作记忆四种作用域;项目 key 跨工作区稳定。
23
+ - 只有 global / project 两种持久化作用域。reference 是独立文档库;working 是会话临时草稿,不长期注入。
24
24
  - 写入门、FSRS 风格留存、BM25 + MMR 召回、重复报告。
25
25
  - 设置页记忆面板:条目、候选、注入 trace、导入、阈值。
26
26
  - 底层颜色跟随 DSH 皮肤;进度条/仪表使用固定的青、黄、紫、绿、红显示色板,换皮肤也可读。
@@ -64,28 +64,33 @@ npm:
64
64
  3. git 根目录名。
65
65
  4. 当前目录名。
66
66
 
67
- 项目 key 不跟路径绑定,移动项目不会丢记忆。中文目录名会原样保留。
67
+ 项目记忆跟着项目目录走。key 只是元数据,不是中央桶;移动或复制项目时 `MEMORY.md` 一起走。两个不同根目录抢同一个 key 时,第二个会加 hash 后缀,不共享记忆。旧的中央 `projects/<key>` 会在首次登记时合并进项目,并保留备份。
68
68
 
69
69
  ## 数据目录
70
70
 
71
71
  ~/.dsh/memory-metabolism/
72
72
  global/MEMORY.md
73
- projects/<key>/MEMORY.md
73
+ meta/projects.json # 项目根目录登记表
74
74
  reference/<name>.md
75
- working/MEMORY.md
76
75
  archive/
77
76
  backups/
78
77
  meta/index.json
79
78
  chats/index.json
80
79
  chats/<id>.json
81
80
 
81
+ <项目>/.deepseek-harness/
82
+ MEMORY.md
83
+ project.json # 项目 id、key、显示名、根路径
84
+ memory/YYYY-MM-DD.md # 每日证据日志
85
+
82
86
  记忆是可手改的 Markdown,条目 id 在隐藏 HTML 注释里。聊天日志是本地 JSON,不注入记忆。
83
87
 
84
88
  ## 配置
85
89
 
86
90
  | 键 | 默认 | 含义 |
87
91
  | --- | --- | --- |
88
- | dataDir | ~/.dsh/memory-metabolism | 共享数据目录 |
92
+ | dataDir | ~/.dsh/memory-metabolism | 全局/参考/归档共享目录 |
93
+ | projectStorage | local | `local` 项目内存储;`central` 保留旧中央分片 |
89
94
  | maxInjectionChars | 6000 | 每个文件的注入预算 |
90
95
  | retrieveTopK | 8 | 召回条数 |
91
96
  | writeThreshold | 0.65 | 直接写入阈值 |