dsh-tdai-memory 0.2.14 → 0.3.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/README.md CHANGED
@@ -76,6 +76,8 @@ tdai-memory:
76
76
  llm: # L1/L2/L3 extraction model (OpenAI-compatible)
77
77
  baseUrl: 'https://opencode.ai/zen/go/v1'
78
78
  model: 'mimo-v2.5' # deepseek-v4-flash produces invalid extraction JSON
79
+ sendSessionHeader: true # send x-opencode-session on LLM requests (required by OpenCode Go & similar gateways)
80
+ sessionId: '' # fixed session id; empty = persistent auto id under the data dir
79
81
  embedding: # vectors (OpenAI-compatible /v1/embeddings)
80
82
  baseUrl: 'http://127.0.0.1:8088/v1'
81
83
  model: 'Qwen3-Embedding-0.6B'
@@ -106,19 +108,19 @@ settings page (记忆 / Memory) or directly in `settings.yaml` under
106
108
  > - This plugin is a standard **profile bundle** (`dsh.bundle.patch`):
107
109
  > `dsh plugin --profile web add dsh-tdai-memory` installs and mounts it in
108
110
  > one step — no manual `cordis.patch.yml` edits needed.
109
- > - DSH exposes the registered `tdai-memory` settings namespace directly; the
110
- > plugin does not modify files in the host installation.
111
- > - Settings changes apply **after a restart** (TdaiCore is built at startup).
112
- > - Version 0.2.13 and newer require DSH `0.1.0-rc.7` or newer and are tested
113
- > against `0.1.0-rc.7`, `0.1.0-rc.8`, and `0.1.1-rc.1`.
114
- > - DSH `0.1.0-rc.6` users must pin `dsh-tdai-memory@0.2.11`, the last release
115
- > carrying the legacy settings-allowlist compatibility patch.
116
-
117
- `node-llama-cpp` is an optional peer used only by the fully local embedding
118
- backend. It is intentionally not installed by default because its native build
119
- requires explicit pnpm build approval. Remote OpenAI-compatible embeddings do
120
- not need it. Users who select the local backend should install and approve
121
- `node-llama-cpp` in the target DSH profile separately.
111
+ > - DSH exposes the registered `tdai-memory` settings namespace directly; the
112
+ > plugin does not modify files in the host installation.
113
+ > - Settings changes apply **after a restart** (TdaiCore is built at startup).
114
+ > - Version 0.2.13 and newer require DSH `0.1.0-rc.7` or newer and are tested
115
+ > against `0.1.0-rc.7`, `0.1.0-rc.8`, and `0.1.1-rc.1`.
116
+ > - DSH `0.1.0-rc.6` users must pin `dsh-tdai-memory@0.2.11`, the last release
117
+ > carrying the legacy settings-allowlist compatibility patch.
118
+
119
+ `node-llama-cpp` is an optional peer used only by the fully local embedding
120
+ backend. It is intentionally not installed by default because its native build
121
+ requires explicit pnpm build approval. Remote OpenAI-compatible embeddings do
122
+ not need it. Users who select the local backend should install and approve
123
+ `node-llama-cpp` in the target DSH profile separately.
122
124
 
123
125
  ## Known trade-offs
124
126
 
package/README.zh.md CHANGED
@@ -16,13 +16,13 @@
16
16
  - **自动召回注入**:每次组装提示词时,按当前用户消息检索相关记忆 + 画像,作为动态上下文注入(模型"凭空想起")
17
17
  - **工具**:`tdai_memory_search`(L1 结构化检索)、`tdai_conversation_search`(L0 原文检索)
18
18
 
19
- 数据目录复用现有 `~/.memory-tencentdb/memory-tdai`,**旧记忆无缝继承**。
20
-
21
- `node-llama-cpp` 仅供完全本地的 embedding 后端使用,现在声明为可选 peer,默认安装不会再触发原生构建脚本。使用 OpenAI 兼容远程 embedding 时不需要它;选择本地后端的用户需在目标 DSH profile 中单独安装并批准 `node-llama-cpp` 的构建。
22
-
23
- 从 `0.2.13` 起最低支持 DSH `0.1.0-rc.7`,已针对 `0.1.0-rc.7`、
24
- `0.1.0-rc.8` 和 `0.1.1-rc.1` 测试。仍使用 DSH `0.1.0-rc.6` 的用户请锁定
25
- `dsh-tdai-memory@0.2.11`;这是最后一个包含旧 settings 白名单兼容补丁的版本。
19
+ 数据目录复用现有 `~/.memory-tencentdb/memory-tdai`,**旧记忆无缝继承**。
20
+
21
+ `node-llama-cpp` 仅供完全本地的 embedding 后端使用,现在声明为可选 peer,默认安装不会再触发原生构建脚本。使用 OpenAI 兼容远程 embedding 时不需要它;选择本地后端的用户需在目标 DSH profile 中单独安装并批准 `node-llama-cpp` 的构建。
22
+
23
+ 从 `0.2.13` 起最低支持 DSH `0.1.0-rc.7`,已针对 `0.1.0-rc.7`、
24
+ `0.1.0-rc.8` 和 `0.1.1-rc.1` 测试。仍使用 DSH `0.1.0-rc.6` 的用户请锁定
25
+ `dsh-tdai-memory@0.2.11`;这是最后一个包含旧 settings 白名单兼容补丁的版本。
26
26
 
27
27
  ## 架构(移植方式)
28
28
 
@@ -63,6 +63,8 @@ tdai-memory:
63
63
  llm: # L1/L2/L3 提取模型(OpenAI 兼容)
64
64
  baseUrl: 'https://opencode.ai/zen/go/v1'
65
65
  model: 'mimo-v2.5' # deepseek-v4-flash 对提取 JSON 输出不合格
66
+ sendSessionHeader: true # 给 LLM 请求带 x-opencode-session(OpenCode Go 等网关要求)
67
+ sessionId: '' # 固定会话 ID;留空 = 数据目录下自动持久化 ID(重启不变)
66
68
  embedding: # 向量(OpenAI 兼容 /v1/embeddings)
67
69
  baseUrl: 'http://127.0.0.1:8088/v1'
68
70
  model: 'Qwen3-Embedding-0.6B'
package/client.js CHANGED
@@ -64,6 +64,11 @@ window.__ModuleLoader__.load({
64
64
  fieldLlmModel: "模型",
65
65
  fieldLlmMaxTokens: "最大输出 Tokens",
66
66
  fieldLlmTimeoutMs: "超时(毫秒)",
67
+ fieldLlmSendSessionHeader: "发送会话标识头(x-opencode-session)",
68
+ fieldLlmSessionHeaderName: "会话标识头名称",
69
+ fieldLlmSessionId: "固定会话 ID(留空 = 自动持久化)",
70
+ hintLlmSendSessionHeader: "OpenCode Go 等网关要求每个 LLM 请求带稳定的会话标识;请求不带可能报错(2026-09-06 起)。值:优先用固定 ID,否则在数据目录生成持久 ID(重启不变)。",
71
+ hintLlmSessionId: "后台抽取请求的固定会话标识;留空则自动生成并持久化到数据目录的 session-id 文件。",
67
72
  fieldEmbeddingBaseUrl: "Base URL",
68
73
  fieldEmbeddingApiKey: "API Key",
69
74
  fieldEmbeddingModel: "模型",
@@ -103,6 +108,11 @@ window.__ModuleLoader__.load({
103
108
  fieldLlmModel: "Model",
104
109
  fieldLlmMaxTokens: "Max output tokens",
105
110
  fieldLlmTimeoutMs: "Timeout (ms)",
111
+ fieldLlmSendSessionHeader: "Send session-id header (x-opencode-session)",
112
+ fieldLlmSessionHeaderName: "Session-id header name",
113
+ fieldLlmSessionId: "Fixed session id (empty = persistent auto)",
114
+ hintLlmSendSessionHeader: "OpenCode Go and similar gateways require a stable session id on every LLM request; requests without it may error (from 2026-09-06). Value: the fixed id below, else a persistent per-instance id stored under the data dir.",
115
+ hintLlmSessionId: "Fixed session id for background extraction requests; leave empty for a persistent auto id under the data dir (survives restarts).",
106
116
  fieldEmbeddingBaseUrl: "Base URL",
107
117
  fieldEmbeddingApiKey: "API Key",
108
118
  fieldEmbeddingModel: "Model",
@@ -135,6 +145,9 @@ window.__ModuleLoader__.load({
135
145
  { path: ["llm", "model"], label: "fieldLlmModel", type: "text", group: "groupLlm" },
136
146
  { path: ["llm", "maxTokens"], label: "fieldLlmMaxTokens", type: "number", group: "groupLlm" },
137
147
  { path: ["llm", "timeoutMs"], label: "fieldLlmTimeoutMs", type: "number", group: "groupLlm" },
148
+ { path: ["llm", "sendSessionHeader"], label: "fieldLlmSendSessionHeader", type: "checkbox", group: "groupLlm" },
149
+ { path: ["llm", "sessionHeaderName"], label: "fieldLlmSessionHeaderName", type: "text", group: "groupLlm" },
150
+ { path: ["llm", "sessionId"], label: "fieldLlmSessionId", type: "text", group: "groupLlm" },
138
151
  { path: ["embedding", "baseUrl"], label: "fieldEmbeddingBaseUrl", type: "text", group: "groupEmbedding" },
139
152
  { path: ["embedding", "apiKey"], label: "fieldEmbeddingApiKey", type: "password", secret: true, group: "groupEmbedding" },
140
153
  { path: ["embedding", "model"], label: "fieldEmbeddingModel", type: "text", group: "groupEmbedding" },