dsh-trivium 0.4.16 → 0.4.17

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
@@ -16,7 +16,7 @@ The kernel stays close to DSH: no extra process, no extra nav by default. Pin me
16
16
 
17
17
  ## Installation
18
18
 
19
- > Prerequisite: install [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) and start `dsh web` at least once. Tested host: `@deepseek-ai/dsh@0.1.1-rc.2` (`dsh-llm` / `dsh-tools` peers also accept `0.1.0-rc.8`).
19
+ > Prerequisite: install [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) and start `dsh web` at least once. Tested host: `@deepseek-ai/dsh@0.1.5-rc.1` (`dsh-llm` / `dsh-tools` peers also accept `0.1.1-rc.2` and `0.1.0-rc.8`).
20
20
 
21
21
  ```sh
22
22
  dsh plugin --profile web add dsh-trivium
@@ -242,6 +242,12 @@ Off by default. After you turn **Chips (memory whitelist)** on in Settings, the
242
242
 
243
243
  ## Changelog
244
244
 
245
+ **0.4.17** — Storage bump to `triviumdb@0.8.8` (engine behavior unchanged from 0.4.16). Host adaptation for `@deepseek-ai/dsh@0.1.5-rc.1`: `session.header.seedLength` was removed, so the session-layer fork cut now reads `session.inheritedEventCount`. Four tools / short map / find paths unchanged.
246
+
247
+ **0.4.16** — Storage bump to `triviumdb@0.8.4`: the engine constructor now takes an options object (`{ dim }`) instead of numeric positional args, and TQL rows return string ids that the plugin coerces back to numbers. Four tools / short map / find paths unchanged.
248
+
249
+ **0.4.15** — Storage bump to `triviumdb@0.8.2`. The settings API rejects non-loopback requests and unlisted `cwd` values; the extract buffer is cleared after a run and `savePending` no longer blocks the turn.
250
+
245
251
  **0.4.14** — Storage bump to `triviumdb@0.8.1` (harder WAL/locks, optional read-only share, ARM64 fixes). Four tools / short map / find paths unchanged.
246
252
 
247
253
  **0.4.13** — Title-bar tab is **Chips** (short); the Settings switch stays **Chips (memory whitelist)**. Toggling the session layer refreshes the Chips tab immediately. Settings / Chips screenshots updated.
@@ -294,8 +300,8 @@ Local source checkout: `npm install`, then `node scripts/link-dsh.mjs`, then res
294
300
  ## Release info
295
301
 
296
302
  - GitHub: https://github.com/QWQcool/dsh-trivium
297
- - npm: [`dsh-trivium@0.4.14`](https://www.npmjs.com/package/dsh-trivium)
298
- - Tested host: `@deepseek-ai/dsh@0.1.1-rc.2` (also `0.1.0-rc.8`)
303
+ - npm: [`dsh-trivium@0.4.17`](https://www.npmjs.com/package/dsh-trivium)
304
+ - Tested host: `@deepseek-ai/dsh@0.1.5-rc.1` (also `0.1.1-rc.2` / `0.1.0-rc.8`)
299
305
  - License: MIT (depends on [TriviumDB](https://github.com/YoKONCy/TriviumDB), Apache-2.0)
300
306
 
301
307
  ---
package/README.zh-CN.md CHANGED
@@ -14,7 +14,7 @@ DeepSeek Harness 的进程内图记忆插件:按节点和边记,默认少注
14
14
 
15
15
  ## 安装
16
16
 
17
- > 前提:已安装 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 并至少启动过一次 `dsh web`。当前测试宿主:`@deepseek-ai/dsh@0.1.1-rc.2`(`dsh-llm` / `dsh-tools` peer 兼容 `0.1.0-rc.8` 与 `0.1.1-rc.2`)。
17
+ > 前提:已安装 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 并至少启动过一次 `dsh web`。当前测试宿主:`@deepseek-ai/dsh@0.1.5-rc.1`(`dsh-llm` / `dsh-tools` peer 兼容 `0.1.1-rc.2` 与 `0.1.0-rc.8`)。
18
18
 
19
19
  ```sh
20
20
  dsh plugin --profile web add dsh-trivium
@@ -238,6 +238,12 @@ Trivium 是记忆内核,不是日记、日历或聊天伴侣。它按**节点
238
238
 
239
239
  ## 更新说明
240
240
 
241
+ **0.4.17** — 存储升到 `triviumdb@0.8.8`(引擎行为相对 0.4.16 不变)。适配宿主 `@deepseek-ai/dsh@0.1.5-rc.1`:`session.header.seedLength` 被移除,会话层 fork 切点改读 `session.inheritedEventCount`。四工具 / 短地图 / find 路径不变。
242
+
243
+ **0.4.16** — 存储升到 `triviumdb@0.8.4`:引擎构造函数改为 options 对象(`{ dim }`),不再收数字位置参数;TQL 行 id 变字符串,插件内部归一为数字。四工具 / 短地图 / find 路径不变。
244
+
245
+ **0.4.15** — 存储升到 `triviumdb@0.8.2`。设置 API 拒绝非回环请求与未登记 `cwd`;抽取后清空缓冲,`savePending` 不再阻塞当轮。
246
+
241
247
  **0.4.14** — 存储升到 `triviumdb@0.8.1`(WAL/锁更硬、可选只读共享、ARM64 修复)。四工具 / 短地图 / find 路径不变。
242
248
 
243
249
  **0.4.13** — 标题栏只显示 **芯片**;设置里的开关仍叫 **芯片(记忆白名单)**。会话层开关立刻刷新芯片页。设置 / 芯片截图更新。
@@ -290,8 +296,8 @@ Trivium 是记忆内核,不是日记、日历或聊天伴侣。它按**节点
290
296
  ## 发布信息
291
297
 
292
298
  - GitHub: https://github.com/QWQcool/dsh-trivium
293
- - npm: [`dsh-trivium@0.4.14`](https://www.npmjs.com/package/dsh-trivium)
294
- - 测试宿主:`@deepseek-ai/dsh@0.1.1-rc.2`(兼 `0.1.0-rc.8`)
299
+ - npm: [`dsh-trivium@0.4.17`](https://www.npmjs.com/package/dsh-trivium)
300
+ - 测试宿主:`@deepseek-ai/dsh@0.1.5-rc.1`(兼 `0.1.1-rc.2` / `0.1.0-rc.8`)
295
301
  - License: MIT(依赖 [TriviumDB](https://github.com/YoKONCy/TriviumDB) 为 Apache-2.0)
296
302
 
297
303
  ---
package/lib/client.js CHANGED
@@ -3283,7 +3283,10 @@ window.__ModuleLoader__.load({
3283
3283
  open: (id) => sessions.open(id),
3284
3284
  seedLengthOf: (id) => {
3285
3285
  try {
3286
- const seed = sessions.binding?.(id)?.session?.header?.seedLength;
3286
+ const face = sessions.binding?.(id)?.session;
3287
+ // DSH 0.1.5 dropped header.seedLength; the live session exposes
3288
+ // the fork-inherited prefix length as inheritedEventCount.
3289
+ const seed = face?.inheritedEventCount ?? face?.header?.seedLength;
3287
3290
  const n = Number(seed);
3288
3291
  return Number.isFinite(n) && n > 0 ? n : null;
3289
3292
  } catch {
package/lib/index.js CHANGED
@@ -68,6 +68,19 @@ function sessionKey(session) {
68
68
  return String(session?.id || session?.header?.id || "");
69
69
  }
70
70
 
71
+ /**
72
+ * Fork-inherited prefix length. DSH 0.1.5 moved this off the header
73
+ * (`header.seedLength` is now rejected as an invalid field) onto the live
74
+ * session as `inheritedEventCount`; keep the header read as a fallback for
75
+ * older hosts.
76
+ */
77
+ function sessionSeedLength(session) {
78
+ const live = session?.inheritedEventCount;
79
+ if (Number.isFinite(Number(live))) return Number(live);
80
+ const legacy = session?.header?.seedLength;
81
+ return Number.isFinite(Number(legacy)) ? Number(legacy) : 0;
82
+ }
83
+
71
84
  function bufOf(session) {
72
85
  const id = sessionKey(session);
73
86
  if (!buffers.has(id)) {
@@ -296,15 +309,15 @@ export function apply(ctx, config = {}) {
296
309
  const session = agent.session;
297
310
  const sessionId = sessionKey(session);
298
311
  if (sessionId && sessionLayerEnabledOf(optionsOf())) {
299
- const seedLen = session?.header?.seedLength;
312
+ const seedLen = sessionSeedLength(session);
300
313
  ensureTail(db, sessionId, {
301
- atSeq: Number.isFinite(Number(seedLen)) && seedLen > 0 ? seedLen - 1 : 0,
314
+ atSeq: seedLen > 0 ? seedLen - 1 : 0,
302
315
  });
303
316
  if (session?.header?.parentSession) {
304
317
  syncForkLineage(db, {
305
318
  childSessionId: sessionId,
306
319
  parentSessionId: session.header.parentSession,
307
- atSeq: Number.isFinite(Number(seedLen)) && seedLen > 0 ? seedLen - 1 : undefined,
320
+ atSeq: seedLen > 0 ? seedLen - 1 : undefined,
308
321
  });
309
322
  }
310
323
  }
package/lib/store.js CHANGED
@@ -114,6 +114,8 @@ export async function openWorkspaceDb(cwd) {
114
114
  if (dbs.has(key)) return dbs.get(key);
115
115
  mkdirSync(join(key, ".dsh"), { recursive: true });
116
116
  const Engine = loadEngine();
117
+ // triviumdb 0.8.3+ removed numeric positional constructor args
118
+ // (TDB_API_MIGRATION_REQUIRED); dim now rides an options object.
117
119
  const db = new Engine(dbPathFor(key), { dim: DIM });
118
120
  try {
119
121
  db.createIndex("type");
@@ -191,6 +193,8 @@ function normalizeTql(rows) {
191
193
  return rows
192
194
  .map((row) => {
193
195
  const node = row?._ || row?.["*"] || row?.a || Object.values(row || {})[0];
196
+ // triviumdb 0.8.x serializes TQL row ids as strings; coerce so the rest
197
+ // of the plugin keeps comparing numbers.
194
198
  if (!node) return null;
195
199
  const id = Number(node.id);
196
200
  if (!Number.isFinite(id)) return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-trivium",
3
- "version": "0.4.16",
3
+ "version": "0.4.17",
4
4
  "description": "In-process graph memory for DeepSeek Harness, backed by TriviumDB.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -55,7 +55,7 @@
55
55
  "@deepseek-ai/dsh-tools": ">=0.1.0-rc.8 <0.1.1 || >=0.1.1-rc.2 <0.2.0"
56
56
  },
57
57
  "dependencies": {
58
- "triviumdb": "^0.8.4"
58
+ "triviumdb": "^0.8.8"
59
59
  },
60
60
  "keywords": [
61
61
  "dsh-plugin",