dsh-tdai-memory 0.3.3 → 0.3.4

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
@@ -11,13 +11,11 @@ Part of the [DeepSeek Harness Enhancement Suite](https://github.com/Scorp1o117/d
11
11
  A port of **TencentDB Agent Memory** (Tencent Cloud's open-source four-layer
12
12
  memory system, originally an OpenClaw plugin) into DeepSeek Harness.
13
13
 
14
- ## Compatibility (v0.3.3)
14
+ ## Compatibility (v0.3.4)
15
15
 
16
- Verified in a DSH `0.1.5-rc.3` (`next`) disposable Web profile; DSH
17
- `0.1.5-rc.2` remains `latest`. The rc.3 host currently references an
18
- unpublished `dsh-client-ui-sidebar-documentpreview@0.1.5-rc.3`, so the smoke
19
- profile temporarily used that unrelated UI package at rc.2. A clean rc.3
20
- installation is blocked upstream. Alpha releases remain `unknown`.
16
+ Targets DSH `0.1.7-rc.1` (`next`); npm `latest` is `0.1.5-rc.3`.
17
+ Settings now live in the Profile patch, and the browser uses `configForms`.
18
+ Older hosts require an older plugin release; alpha builds remain `unknown`.
21
19
 
22
20
  ## Features
23
21
 
@@ -58,23 +56,14 @@ Hard-won wiring details:
58
56
 
59
57
  ## Configuration (profile patch + settings)
60
58
 
61
- Configuration is **settings-namespace driven**: the profile patch is the base
62
- layer, and the `tdai-memory:` section of `$DSH_HOME/settings.yaml` overrides it
63
- (LLM/embedding keys live in settings.yaml). The **Web UI Settings → 记忆**
59
+ Configuration is stored in the `tdai-memory` entry of the active Profile patch.
60
+ On first launch, DSH imports the old `$DSH_HOME/settings.yaml` values into that
61
+ entry. The **Web UI Settings → 记忆**
64
62
  section edits every field (v0.2.0, write-only keys); TdaiCore is built at
65
63
  startup, so changes apply **after a restart**.
66
64
 
67
- ```yaml
68
- # $DSH_HOME/settings.yaml
69
- tdai-memory:
70
- llm:
71
- apiKey: 'sk-...'
72
- embedding:
73
- apiKey: 'local-no-key'
74
- ```
75
-
76
- ```yaml
77
- # profile patch (base layer)
65
+ ```yaml
66
+ # $DSH_HOME/profiles/web/cordis.patch.yml
78
67
  - id: tdai-memory
79
68
  name: 'dsh-tdai-memory'
80
69
  config:
@@ -105,12 +94,11 @@ then mount it in `$DSH_HOME/profiles/web/cordis.patch.yml`:
105
94
  - insert:
106
95
  - id: tdai-memory
107
96
  name: 'dsh-tdai-memory'
108
- config: {} # keys can live in settings.yaml instead
97
+ config: {} # fill through Settings → 记忆
109
98
  ```
110
99
 
111
- and restart `dsh web`. LLM/embedding API keys can be set in the Web UI
112
- settings page (记忆 / Memory) or directly in `settings.yaml` under
113
- `tdai-memory:`.
100
+ and restart `dsh web`. LLM/embedding API keys can be set in the Web UI
101
+ settings page (记忆 / Memory) or in the `tdai-memory` Profile patch entry.
114
102
 
115
103
  > **Note for users**
116
104
  > - This plugin is a standard **profile bundle** (`dsh.bundle.patch`):
package/README.zh.md CHANGED
@@ -8,12 +8,11 @@
8
8
 
9
9
  把 **TencentDB Agent Memory**(腾讯云开源的四层记忆系统,原为 OpenClaw 插件)移植进 DeepSeek Harness。
10
10
 
11
- ## 兼容性(v0.3.3)
11
+ ## 兼容性(v0.3.4)
12
12
 
13
- 已在 DSH `0.1.5-rc.3`(`next`)的一次性 Web Profile 中验证;`0.1.5-rc.2`
14
- 仍是 `latest`。rc.3 宿主目前引用尚未发布的
15
- `dsh-client-ui-sidebar-documentpreview@0.1.5-rc.3`,烟测仅将这一无关的 UI
16
- 包临时回退为 rc.2;rc.3 原样安装仍受上游阻塞。alpha 版本继续标记 `unknown`。
13
+ 适配 DSH `0.1.7-rc.1`(npm `next`);npm `latest` 是 `0.1.5-rc.3`。
14
+ 设置保存在当前 Profile patch,Web 端使用 `configForms`。
15
+ 旧宿主请使用插件旧版;alpha 构建仍标记 `unknown`。
17
16
 
18
17
  ## 能力
19
18
 
package/client.js CHANGED
@@ -47,7 +47,7 @@ window.__ModuleLoader__.load({
47
47
 
48
48
  // ── locale ────────────────────────────────────────────────────────────
49
49
  var NS = "tdaiMemory";
50
- var inject = ["slots", "locale", "settingsScope", "connection"];
50
+ var inject = ["slots", "locale", "configForms", "connection"];
51
51
  var zh = {
52
52
  nav: "记忆",
53
53
  intro: "TDAI 记忆配置:L0 捕获 → L1 结构化提取 → 召回注入。密钥只写不读。TdaiCore 在启动时构建,修改后需重启生效。",
@@ -345,7 +345,7 @@ window.__ModuleLoader__.load({
345
345
  function apply(ctx) {
346
346
  var t = ctx.locale.bind(NS);
347
347
  ctx.effect(function () { return ctx.locale.register(NS, { zh: zh, en: en }); }, "dsh-tdai-memory: dictionaries");
348
- var scope = ctx.settingsScope.bind({ namespace: "tdai-memory" });
348
+ var scope = ctx.configForms.get("tdai-memory");
349
349
  var api = ctx.connection.api;
350
350
  ctx.slots.inject("settings.section", function () {
351
351
  return ctx.slots.register({
package/index.js CHANGED
@@ -37,7 +37,7 @@ const Config = z.object({
37
37
  /** TDAI data directory; default: ~/.memory-tencentdb/memory-tdai. */
38
38
  dataDir: z.string().default(""),
39
39
  /** LLM used for L1/L2/L3 extraction (OpenAI-compatible). Falls back to TDAI_LLM_* env. */
40
- llm: z.object({
40
+ llm: z.object({
41
41
  baseUrl: z.string().default(""),
42
42
  apiKey: z.string().default("").role("secret"),
43
43
  model: z.string().default(""),
@@ -52,34 +52,34 @@ const Config = z.object({
52
52
  sessionHeaderName: z.string().default("x-opencode-session"),
53
53
  /** Fixed session id for LLM requests; empty = persistent auto id. */
54
54
  sessionId: z.string().default(""),
55
- }),
55
+ }).default({}),
56
56
  /** Embedding endpoint (OpenAI-compatible /v1/embeddings). */
57
- embedding: z.object({
57
+ embedding: z.object({
58
58
  baseUrl: z.string().default("http://127.0.0.1:8088/v1"),
59
59
  apiKey: z.string().default("").role("secret"),
60
60
  model: z.string().default("Qwen3-Embedding-0.6B"),
61
61
  dimensions: z.number().default(1024),
62
62
  sendDimensions: z.boolean().default(false),
63
- }),
63
+ }).default({}),
64
64
  /** Capture conversations into L0. */
65
65
  captureEnabled: z.boolean().default(true),
66
66
  /** L1 extraction pipeline (facts from conversations). */
67
- extraction: z.object({
67
+ extraction: z.object({
68
68
  enabled: z.boolean().default(true),
69
69
  /** Conflict detection before storing; extra LLM call, disable if flaky.
70
70
  * Off by default: dedup LLM output parsing is flaky (README matches). */
71
71
  enableDedup: z.boolean().default(false),
72
- }),
72
+ }).default({}),
73
73
  /** Recall injection settings. */
74
- recall: z.object({
74
+ recall: z.object({
75
75
  enabled: z.boolean().default(true),
76
76
  maxResults: z.number().default(5),
77
77
  scoreThreshold: z.number().default(0.3),
78
78
  timeoutMs: z.number().default(3000),
79
- }),
79
+ }).default({}),
80
80
  /** Register the two search tools. */
81
81
  toolsEnabled: z.boolean().default(true),
82
- });
82
+ }).volatile();
83
83
 
84
84
  /**
85
85
  * Whether a derived message is real human input.
@@ -390,18 +390,9 @@ function apply(ctx, config) {
390
390
  // `installSettingsSection` export (the provider now lives at ctx.settings).
391
391
  // Inline the same logic via ctx.inject(["settings"]) — works on both
392
392
  // 0.1.1 (module export wrapper) and 0.1.2 (ctx.settings) hosts.
393
- ctx.inject(["settings"], (sctx) => {
394
- const scope = sctx.settings.register(NS, Config, { base: config });
395
- const fire = () => {
396
- builtOnce = true;
397
- void build(scope.get());
398
- };
399
- sctx.effect(() => () => {});
400
- fire();
401
- scope.watch(() => {
402
- ctx.logger.warn("[tdai-memory] settings updated; restart to apply (TdaiCore is built at startup)");
403
- });
404
- });
393
+ ctx.on("settings/document-updated", (id) => {
394
+ if (id === NS) ctx.logger.warn("[tdai-memory] settings updated; restart to apply (TdaiCore is built at startup)");
395
+ });
405
396
 
406
397
  // Fallback when no settings service ever mounts: build from the entry
407
398
  // config. One-shot — if the settings mount arrives later, its build
@@ -410,7 +401,7 @@ function apply(ctx, config) {
410
401
  setTimeout(() => {
411
402
  if (!builtOnce) {
412
403
  builtOnce = true;
413
- void build(config);
404
+ void build(typeof config.get === "function" ? config.get() : config);
414
405
  }
415
406
  }, 500);
416
407
 
package/package.json CHANGED
@@ -1,90 +1,94 @@
1
- {
2
- "name": "dsh-tdai-memory",
3
- "version": "0.3.3",
4
- "description": "DeepSeek Harness 的 TencentDB Agent Memory 移植:L0 对话捕获 → L1 结构化记忆提取 → L2 场景/L3 画像,自动召回注入 + 记忆/对话搜索工具;复用现有 ~/.memory-tencentdb/memory-tdai 数据;附 Web UI 设置栏。",
5
- "type": "module",
6
- "main": "index.js",
7
- "exports": {
8
- ".": "./index.js",
9
- "./client": "./client.js",
10
- "./package.json": "./package.json"
11
- },
12
- "dsh": {
13
- "bundle": {
14
- "patch": "./cordis.patch.yml"
15
- },
1
+ {
2
+ "name": "dsh-tdai-memory",
3
+ "version": "0.3.4",
4
+ "description": "DeepSeek Harness 的 TencentDB Agent Memory 移植:L0 对话捕获 → L1 结构化记忆提取 → L2 场景/L3 画像,自动召回注入 + 记忆/对话搜索工具;复用现有 ~/.memory-tencentdb/memory-tdai 数据;附 Web UI 设置栏。",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "exports": {
8
+ ".": "./index.js",
9
+ "./client": "./client.js",
10
+ "./package.json": "./package.json"
11
+ },
12
+ "dsh": {
13
+ "bundle": {
14
+ "patch": "./cordis.patch.yml"
15
+ },
16
16
  "client": {
17
17
  "platform": "web"
18
18
  },
19
19
  "compatibility": {
20
- "dsh": ">=0.1.0-rc.7 <0.2.0",
20
+ "dsh": ">=0.1.7-rc.1 <0.2.0",
21
21
  "dshReleases": {
22
- "0.1.5-rc.2": "compatible",
23
- "0.1.5-rc.3": "compatible",
22
+ "0.1.5-rc.2": "incompatible",
23
+ "0.1.5-rc.3": "incompatible",
24
24
  "0.1.6-alpha.1": "unknown",
25
25
  "0.1.6-alpha.2": "unknown",
26
- "0.1.7-alpha.1": "unknown"
26
+ "0.1.7-alpha.1": "unknown",
27
+ "0.1.7-alpha.2": "unknown",
28
+ "0.1.7-rc.1": "compatible"
27
29
  },
28
30
  "node": ">=22.18",
29
- "profiles": ["web"]
31
+ "profiles": [
32
+ "web"
33
+ ]
34
+ }
35
+ },
36
+ "homepage": "https://github.com/Scorp1o117/dsh-tdai-memory",
37
+ "files": [
38
+ "index.js",
39
+ "recall-inject.js",
40
+ "client.js",
41
+ "cordis.patch.yml",
42
+ "vendor",
43
+ "README.md",
44
+ "README.zh.md",
45
+ "LICENSE",
46
+ "THIRD-PARTY-NOTICES.md"
47
+ ],
48
+ "keywords": [
49
+ "dsh",
50
+ "dsh-plugin",
51
+ "deepseek-harness",
52
+ "memory",
53
+ "tencentdb",
54
+ "agent-memory",
55
+ "rag",
56
+ "vector-search",
57
+ "persona"
58
+ ],
59
+ "license": "MIT",
60
+ "engines": {
61
+ "node": ">=22.18"
62
+ },
63
+ "repository": {
64
+ "type": "git",
65
+ "url": "git+https://github.com/Scorp1o117/dsh-tdai-memory.git"
66
+ },
67
+ "bugs": {
68
+ "url": "https://github.com/Scorp1o117/dsh-tdai-memory/issues"
69
+ },
70
+ "dependencies": {
71
+ "@ai-sdk/openai": "^3.0.53",
72
+ "@deepseek-ai/schemastery": "^3.18.4",
73
+ "@node-rs/jieba": "^2.0.1",
74
+ "@tencentdb-agent-memory/tcvdb-text": "^0.1.1",
75
+ "ai": "^6.0.164",
76
+ "json5": "^2.2.3",
77
+ "sqlite-vec": "0.1.7-alpha.2",
78
+ "undici": "^8.1.0"
79
+ },
80
+ "peerDependencies": {
81
+ "react": "^18.2.0",
82
+ "@deepseek-ai/dsh-tools": "^0.1.7-rc.1",
83
+ "@deepseek-ai/dsh-settings": "^0.1.7-rc.1",
84
+ "node-llama-cpp": "^3.19.1"
85
+ },
86
+ "peerDependenciesMeta": {
87
+ "node-llama-cpp": {
88
+ "optional": true
30
89
  }
31
- },
32
- "homepage": "https://github.com/Scorp1o117/dsh-tdai-memory",
33
- "files": [
34
- "index.js",
35
- "recall-inject.js",
36
- "client.js",
37
- "cordis.patch.yml",
38
- "vendor",
39
- "README.md",
40
- "README.zh.md",
41
- "LICENSE",
42
- "THIRD-PARTY-NOTICES.md"
43
- ],
44
- "keywords": [
45
- "dsh",
46
- "dsh-plugin",
47
- "deepseek-harness",
48
- "memory",
49
- "tencentdb",
50
- "agent-memory",
51
- "rag",
52
- "vector-search",
53
- "persona"
54
- ],
55
- "license": "MIT",
56
- "engines": {
57
- "node": ">=22.18"
58
- },
59
- "repository": {
60
- "type": "git",
61
- "url": "git+https://github.com/Scorp1o117/dsh-tdai-memory.git"
62
- },
63
- "bugs": {
64
- "url": "https://github.com/Scorp1o117/dsh-tdai-memory/issues"
65
- },
66
- "dependencies": {
67
- "@ai-sdk/openai": "^3.0.53",
68
- "@deepseek-ai/schemastery": "^3.18.1",
69
- "@node-rs/jieba": "^2.0.1",
70
- "@tencentdb-agent-memory/tcvdb-text": "^0.1.1",
71
- "ai": "^6.0.164",
72
- "json5": "^2.2.3",
73
- "sqlite-vec": "0.1.7-alpha.2",
74
- "undici": "^8.1.0"
75
- },
76
- "peerDependencies": {
77
- "react": "^18.2.0",
78
- "@deepseek-ai/dsh-tools": "^0.1.0-rc.7 || ^0.1.1-rc.1 || ^0.1.2-rc.1 || ^0.1.5-rc.1",
79
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.7 || ^0.1.1-rc.1 || ^0.1.2-rc.1 || ^0.1.5-rc.1",
80
- "node-llama-cpp": "^3.19.1"
81
- },
82
- "peerDependenciesMeta": {
83
- "node-llama-cpp": {
84
- "optional": true
85
- }
86
- },
87
- "scripts": {
88
- "test": "node tests/settings-scope-compat.test.mjs && node tests/install-contract.test.mjs"
89
- }
90
- }
90
+ },
91
+ "scripts": {
92
+ "test": "node tests/settings-scope-compat.test.mjs && node tests/install-contract.test.mjs"
93
+ }
94
+ }