dsh-trivium 0.4.18 → 0.4.19
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 +5 -2
- package/README.zh-CN.md +5 -2
- package/lib/client.js +54 -11
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -129,7 +129,7 @@ Trivium is a memory kernel, not a journal, calendar, or chat companion. It store
|
|
|
129
129
|
- **Injection via `agent.inject()`** — not the system prompt, so `persona.complete: true` cannot silently drop the map.
|
|
130
130
|
- **Recall carries paths** — every hit says which node it came from and along which edge.
|
|
131
131
|
- **Failures never block the agent** — store / embedding / extract errors are logged; the main loop continues.
|
|
132
|
-
- **UI follows the host language** — Settings and the Chips (memory whitelist) tab switch with DSH `locale/change` (`zh` / `en`).
|
|
132
|
+
- **UI follows the host language** — Settings and the Chips (memory whitelist) tab switch with DSH `locale/change` (`zh` / `en`). Any other resolved host language — and a browser that names no registered language — falls to English, the same `FALLBACK_LOCALE` the host itself uses.
|
|
133
133
|
- **First-turn map** — the short map is injected once per session. If `session-start` loses a race with the first model step, `pre-step` fills it in; it is not rewritten every step (prefix-cache friendly).
|
|
134
134
|
|
|
135
135
|
## Features
|
|
@@ -245,6 +245,8 @@ Off by default. After you turn **Chips (memory whitelist)** on in Settings, the
|
|
|
245
245
|
|
|
246
246
|
## Changelog
|
|
247
247
|
|
|
248
|
+
**0.4.19** — Fixed the plugin's own UI rendering Simplified Chinese on an English host ([issue #2](https://github.com/QWQcool/dsh-trivium/issues/2)). The `locale` service is now reached through `ctx.inject(["locale"], …)`, so **follow host** no longer depends on composition order, and the plugin fallback is `en` — the host's own `FALLBACK_LOCALE`, and the bucket every other resolved host language lands in. The Settings card and the Chips tab only ever choose between zh and en, so a browser naming no registered language no longer gets a Chinese card. Four tools / short map / find paths unchanged.
|
|
249
|
+
|
|
248
250
|
**0.4.18** — `~/.dsh/trivium.json` is now written atomically (a truncated write used to reset every switch and chip pin silently) and is owner-only on POSIX. `npm test` runs every offline smoke script with isolated settings, and `smoke-p0` pins the hybrid text-index-after-reopen invariant. Four tools / short map / find paths unchanged.
|
|
249
251
|
|
|
250
252
|
**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.
|
|
@@ -288,6 +290,7 @@ Off by default. After you turn **Chips (memory whitelist)** on in Settings, the
|
|
|
288
290
|
| Symptom | What to do |
|
|
289
291
|
|---|---|
|
|
290
292
|
| Settings has no **Trivium memory** | Confirm the **web** profile, then **restart** `dsh web` and open a workspace. Reloading the browser is not enough. |
|
|
293
|
+
| Settings card / Chips tab shows Chinese on an English host | Fixed in 0.4.19 ([issue #2](https://github.com/QWQcool/dsh-trivium/issues/2)). On an older build pick **Settings → Trivium memory → Settings → Plugin language → English**; that is stored in `~/.dsh/trivium.json` and a page reload is enough (no host restart). |
|
|
291
294
|
| Title bar has no **Chips** | Turn on **Chips (memory whitelist)** in Settings (it saves as soon as you toggle). Switch back to the conversation; the tab should appear without restarting. |
|
|
292
295
|
| Injection / extract / embedding / chip tab changes have no effect | Chip / extract / recall toggles save immediately. Embedding URL still uses **Save**. Restart `dsh web` only if the settings page itself is missing. |
|
|
293
296
|
| Session layer shows only a **Next** box | Expected when the nested session layer is on. Boxes follow DSH compaction; a long session is not the same as already compacted (auto-compact is around 80% of the window). To split: `/compact` in the conversation, or **Create checkpoint** (plot only, does not compact the window). Older sessions can use **Update checkpoints** to backfill past compaction / forks. |
|
|
@@ -305,7 +308,7 @@ Local source checkout: `npm install`, then `node scripts/link-dsh.mjs`, then res
|
|
|
305
308
|
## Release info
|
|
306
309
|
|
|
307
310
|
- GitHub: https://github.com/QWQcool/dsh-trivium
|
|
308
|
-
- npm: [`dsh-trivium@0.4.
|
|
311
|
+
- npm: [`dsh-trivium@0.4.19`](https://www.npmjs.com/package/dsh-trivium)
|
|
309
312
|
- Tested host: `@deepseek-ai/dsh@0.1.5-rc.1` (also `0.1.1-rc.2` / `0.1.0-rc.8`)
|
|
310
313
|
- License: MIT (depends on [TriviumDB](https://github.com/YoKONCy/TriviumDB), Apache-2.0)
|
|
311
314
|
|
package/README.zh-CN.md
CHANGED
|
@@ -125,7 +125,7 @@ Trivium 是记忆内核,不是日记、日历或聊天伴侣。它按**节点
|
|
|
125
125
|
- **注入走 `agent.inject()`** — 不写 system prompt,避免 `persona.complete: true` 把地图静默丢掉。
|
|
126
126
|
- **召回带路径** — 每条命中都说明从哪个节点、沿哪条边过来。
|
|
127
127
|
- **失败不挡主循环** — 存储 / embedding / 抽取出错只记日志,Agent 继续。
|
|
128
|
-
- **界面跟随宿主语言** — 设置页和「芯片」标签随 DSH `locale/change` 切换(`zh` / `en
|
|
128
|
+
- **界面跟随宿主语言** — 设置页和「芯片」标签随 DSH `locale/change` 切换(`zh` / `en`),也可在配置设置里锁定。其它已解析的宿主语言、以及浏览器未命名任何注册语言的情况,一律回落英文(与宿主自己的 `FALLBACK_LOCALE` 一致)。
|
|
129
129
|
- **首轮短地图** — 每个会话只注入一次。若 `session-start` 和第一步赛跑输了,`pre-step` 会补上;不会每步重写(前缀缓存友好)。
|
|
130
130
|
|
|
131
131
|
## 功能
|
|
@@ -241,6 +241,8 @@ Trivium 是记忆内核,不是日记、日历或聊天伴侣。它按**节点
|
|
|
241
241
|
|
|
242
242
|
## 更新说明
|
|
243
243
|
|
|
244
|
+
**0.4.19** — 修复插件自身界面在英文宿主上渲染成简体中文([issue #2](https://github.com/QWQcool/dsh-trivium/issues/2))。`locale` 服务改经 `ctx.inject(["locale"], …)` 获取,「跟随宿主」不再依赖插件组合顺序;兜底语言改为 `en`——与宿主自己的 `FALLBACK_LOCALE` 一致,也是其它已解析宿主语言的归宿。设置卡与芯片标签只在 zh / en 之间选择,浏览器未命名任何注册语言时不再给出中文卡。四工具 / 短地图 / find 路径不变。
|
|
245
|
+
|
|
244
246
|
**0.4.18** — `~/.dsh/trivium.json` 改为原子写(此前写到一半被杀会让所有开关和芯片钉选静默回默认),POSIX 下权限收紧为仅属主可读。新增 `npm test` 聚合入口(每个脚本用独立临时设置文件),`smoke-p0` 新增「重开后 hybrid 文本索引仍可用」的断言。四工具 / 短地图 / find 路径行为不变。
|
|
245
247
|
|
|
246
248
|
**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 路径不变。
|
|
@@ -284,6 +286,7 @@ Trivium 是记忆内核,不是日记、日历或聊天伴侣。它按**节点
|
|
|
284
286
|
| 现象 | 处理 |
|
|
285
287
|
|---|---|
|
|
286
288
|
| 设置里没有「Trivium 记忆」 | 确认装的是 web profile,然后**重启** `dsh web`,再打开一个工作区。只刷新浏览器不够。 |
|
|
289
|
+
| 英文宿主下设置卡 / 芯片标签显示中文 | 0.4.19 已修([issue #2](https://github.com/QWQcool/dsh-trivium/issues/2))。旧版本可在 **设置 → Trivium 记忆 → 配置设置 → 插件语言 → English** 手动选一次,会写进 `~/.dsh/trivium.json`,刷新页面即可,不用重启宿主。 |
|
|
287
290
|
| 标题栏没有「芯片」 | 在设置里打开「芯片(记忆白名单)」(拨一下就会保存)。切回对话页,标签应立刻出现,不用重启。 |
|
|
288
291
|
| 改了注入 / 抽取 / embedding / 芯片开关没生效 | 芯片 / 抽取 / 注入拨一下即保存。Embedding URL 仍要点「保存设置」。只有设置页本身没出现时才重启 `dsh web`。 |
|
|
289
292
|
| 会话层只有一个「后续」方框 | 正常(在会话层已打开时)。方框跟 DSH 压缩走,会话长不等于已经压过(默认约窗口 80% 才自动压)。要分段:对话里 `/compact`,或点「生成检查点」(只切图,不压窗口)。旧会话可点「更新检查点」补已经发生过的压缩 / 分叉。 |
|
|
@@ -301,7 +304,7 @@ Trivium 是记忆内核,不是日记、日历或聊天伴侣。它按**节点
|
|
|
301
304
|
## 发布信息
|
|
302
305
|
|
|
303
306
|
- GitHub: https://github.com/QWQcool/dsh-trivium
|
|
304
|
-
- npm: [`dsh-trivium@0.4.
|
|
307
|
+
- npm: [`dsh-trivium@0.4.19`](https://www.npmjs.com/package/dsh-trivium)
|
|
305
308
|
- 测试宿主:`@deepseek-ai/dsh@0.1.5-rc.1`(兼 `0.1.1-rc.2` / `0.1.0-rc.8`)
|
|
306
309
|
- License: MIT(依赖 [TriviumDB](https://github.com/YoKONCy/TriviumDB) 为 Apache-2.0)
|
|
307
310
|
|
package/lib/client.js
CHANGED
|
@@ -324,25 +324,32 @@ window.__ModuleLoader__.load({
|
|
|
324
324
|
},
|
|
325
325
|
};
|
|
326
326
|
|
|
327
|
-
|
|
327
|
+
// Aligned with the host's own `FALLBACK_LOCALE` in
|
|
328
|
+
// `@deepseek-ai/dsh-client-locale`: English is both what DSH opens with when
|
|
329
|
+
// the browser names no registered language and the dictionary consulted after
|
|
330
|
+
// a miss, because that reader is the least likely to read Chinese. The plugin
|
|
331
|
+
// ships zh/en dictionaries only, so any other resolved host language is
|
|
332
|
+
// English here as well — never Chinese.
|
|
333
|
+
const FALLBACK_UI_LOCALE = "en";
|
|
334
|
+
|
|
335
|
+
let uiLocale = FALLBACK_UI_LOCALE;
|
|
328
336
|
let hostLocale = "";
|
|
329
337
|
let pluginLocalePref = "host";
|
|
330
338
|
const localeListeners = new Set();
|
|
331
339
|
|
|
332
340
|
function normalizeLocale(value) {
|
|
333
341
|
const s = String(value || "").toLowerCase();
|
|
334
|
-
if (s
|
|
335
|
-
|
|
336
|
-
return "";
|
|
342
|
+
if (!s) return "";
|
|
343
|
+
return s.startsWith("zh") ? "zh" : FALLBACK_UI_LOCALE;
|
|
337
344
|
}
|
|
338
345
|
|
|
339
346
|
function resolvedUiLocale() {
|
|
340
347
|
if (pluginLocalePref === "zh" || pluginLocalePref === "en") return pluginLocalePref;
|
|
341
|
-
return hostLocale ||
|
|
348
|
+
return hostLocale || FALLBACK_UI_LOCALE;
|
|
342
349
|
}
|
|
343
350
|
|
|
344
351
|
function setUiLocale(next) {
|
|
345
|
-
const loc = normalizeLocale(next) ||
|
|
352
|
+
const loc = normalizeLocale(next) || FALLBACK_UI_LOCALE;
|
|
346
353
|
if (loc === uiLocale) return;
|
|
347
354
|
uiLocale = loc;
|
|
348
355
|
localeListeners.forEach((fn) => {
|
|
@@ -3313,15 +3320,26 @@ window.__ModuleLoader__.load({
|
|
|
3313
3320
|
);
|
|
3314
3321
|
}
|
|
3315
3322
|
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
const sessions = ctx.sessions;
|
|
3323
|
+
/** Read the host locale service when it is reachable. Never throws. */
|
|
3324
|
+
function readHostLocaleFrom(hostCtx) {
|
|
3319
3325
|
try {
|
|
3320
|
-
const
|
|
3321
|
-
|
|
3326
|
+
const svc = hostCtx && hostCtx.locale;
|
|
3327
|
+
const snap = svc && typeof svc.getLocale === "function" ? svc.getLocale() : null;
|
|
3328
|
+
if (snap && snap.active) {
|
|
3329
|
+
setHostLocale(snap.active);
|
|
3330
|
+
return true;
|
|
3331
|
+
}
|
|
3332
|
+
return false;
|
|
3322
3333
|
} catch {
|
|
3323
3334
|
// host may not expose locale
|
|
3335
|
+
return false;
|
|
3324
3336
|
}
|
|
3337
|
+
}
|
|
3338
|
+
|
|
3339
|
+
function apply(ctx) {
|
|
3340
|
+
workspacesList = ctx.workspaces?.list || null;
|
|
3341
|
+
const sessions = ctx.sessions;
|
|
3342
|
+
readHostLocaleFrom(ctx);
|
|
3325
3343
|
try {
|
|
3326
3344
|
ctx.on("locale/change", (snap) => {
|
|
3327
3345
|
if (snap && snap.active) setHostLocale(snap.active);
|
|
@@ -3329,6 +3347,18 @@ window.__ModuleLoader__.load({
|
|
|
3329
3347
|
} catch {
|
|
3330
3348
|
// ignore
|
|
3331
3349
|
}
|
|
3350
|
+
// The locale service is provided by its own plugin during boot, so it can
|
|
3351
|
+
// arrive after this plugin applied, and an undeclared service is not a
|
|
3352
|
+
// supported `ctx` property read. `ctx.inject` starts the callback once the
|
|
3353
|
+
// dependency exists, so "follow host" no longer depends on composition
|
|
3354
|
+
// order. Same pattern as `ctx.inject(["webServer"], …)` in lib/index.js.
|
|
3355
|
+
try {
|
|
3356
|
+
if (typeof ctx.inject === "function") {
|
|
3357
|
+
ctx.inject(["locale"], (localeCtx) => readHostLocaleFrom(localeCtx));
|
|
3358
|
+
}
|
|
3359
|
+
} catch {
|
|
3360
|
+
// host may not support injection
|
|
3361
|
+
}
|
|
3332
3362
|
ctx.slots.inject(
|
|
3333
3363
|
"settings.section",
|
|
3334
3364
|
() =>
|
|
@@ -3351,6 +3381,19 @@ window.__ModuleLoader__.load({
|
|
|
3351
3381
|
|
|
3352
3382
|
exports.apply = apply;
|
|
3353
3383
|
exports.inject = ["slots", "sessions", "workspaces"];
|
|
3384
|
+
// Test-only probe over the locale resolution above (no behaviour of its own).
|
|
3385
|
+
// The client module system resolves package-name specifiers only, so this
|
|
3386
|
+
// choice cannot live in a separate requireable file; scripts/smoke-p13.mjs
|
|
3387
|
+
// loads this bundle with a stubbed __ModuleLoader__/require and reads these.
|
|
3388
|
+
exports.__locale = {
|
|
3389
|
+
FALLBACK_UI_LOCALE,
|
|
3390
|
+
normalizeLocale,
|
|
3391
|
+
resolvedUiLocale,
|
|
3392
|
+
setHostLocale,
|
|
3393
|
+
setPluginLocalePref,
|
|
3394
|
+
readHostLocaleFrom,
|
|
3395
|
+
snapshot: () => ({ uiLocale, hostLocale, pluginLocalePref }),
|
|
3396
|
+
};
|
|
3354
3397
|
return module.exports;
|
|
3355
3398
|
},
|
|
3356
3399
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-trivium",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.19",
|
|
4
4
|
"description": "In-process graph memory for DeepSeek Harness, backed by TriviumDB.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"smoke-p10": "node scripts/smoke-p10.mjs",
|
|
47
47
|
"smoke-p11": "node scripts/smoke-p11.mjs",
|
|
48
48
|
"smoke-p12": "node scripts/smoke-p12.mjs",
|
|
49
|
+
"smoke-p13": "node scripts/smoke-p13.mjs",
|
|
49
50
|
"preuninstall": "node ./lib/purge.js",
|
|
50
51
|
"verify-live-p2": "node scripts/verify-live-p2.mjs"
|
|
51
52
|
},
|