dsh-trivium 0.4.9 → 0.4.10
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 +9 -13
- package/README.zh-CN.md +9 -13
- package/lib/purge.js +116 -0
- package/lib/settings.js +57 -9
- package/lib/store.js +6 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -49,23 +49,17 @@ Restart **dsh web**. For a source checkout, `git pull` then run `node scripts/li
|
|
|
49
49
|
|
|
50
50
|
## Uninstall
|
|
51
51
|
|
|
52
|
+
Stop **dsh web** first so the `.tdb` is not locked, then:
|
|
53
|
+
|
|
52
54
|
```sh
|
|
53
55
|
dsh plugin --profile web remove dsh-trivium
|
|
54
56
|
```
|
|
55
57
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
Uninstall does **not** delete memory files. To wipe them, delete:
|
|
58
|
+
`remove` deletes this plugin’s files: `~/.dsh/trivium.json`, and in every workspace the plugin has opened, `.dsh/trivium.tdb` plus `trivium-pending.json`. Other files under `.dsh/` stay. Updating with `dsh plugin add dsh-trivium` does **not** wipe memory.
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|---|---|
|
|
62
|
-
| `<workspace>/.dsh/trivium.tdb` | Graph memory for that workspace (nodes, edges, session-graph boxes) |
|
|
63
|
-
| `<workspace>/.dsh/trivium-pending.json` | Failed-extract replay queue; skip if missing |
|
|
64
|
-
| `~/.dsh/trivium.json` | Injection policy, extract switch, embedding, per-session chip pins |
|
|
60
|
+
Restart **dsh web** afterward: Settings no longer shows **Trivium memory**, the title bar no longer shows **Chips**, and the four tools are unregistered.
|
|
65
61
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Disable without uninstall: in that profile’s `cordis.patch.yml` add:
|
|
62
|
+
Workspaces never opened after this version may still have an old `.tdb`; delete that file by hand if you find one. Disable without uninstall (data stays): in that profile’s `cordis.patch.yml` add:
|
|
69
63
|
|
|
70
64
|
```yaml
|
|
71
65
|
- id: dsh-trivium
|
|
@@ -218,6 +212,8 @@ Off by default. After you turn **Chips** on in Settings and restart, the title b
|
|
|
218
212
|
|
|
219
213
|
## Changelog
|
|
220
214
|
|
|
215
|
+
**0.4.10** — `dsh plugin remove` deletes known workspace `.tdb` files and `~/.dsh/trivium.json`. Plugin update does not wipe. Disable-in-place still keeps data.
|
|
216
|
+
|
|
221
217
|
**0.4.9** — Chips tab and session-layer canvas are both off by default. Title bar shows **Chips** only after the Settings switch; session boxes sit under that switch. Kernel (four tools, short map, in-process `.tdb`) unchanged.
|
|
222
218
|
|
|
223
219
|
**0.4.8** — Write + inject hygiene gate (secrets, mojibake, stutter, JSON envelopes, base64 residue). Settings / session graph follow DSH language. Settings can check npm for updates. One-shot strict import also discovers Claude Code `CLAUDE.md` and Codex `AGENTS.md`. First-turn short map is guaranteed if `session-start` races the first step.
|
|
@@ -249,7 +245,7 @@ Off by default. After you turn **Chips** on in Settings and restart, the title b
|
|
|
249
245
|
| `ctx_find` returns nothing | A new session injects the short map only; the model must call the tool. You can also **Add** on the chip strip or tell the model “remember: …”. Chitchat and one-off file edits are not auto-written. |
|
|
250
246
|
| `.tdb` is locked / will not open | Run one `dsh web`. Do not run two Node processes that both linked this plugin. |
|
|
251
247
|
| Embedding is filled but search is no more accurate | Failures fall back to keyword + graph. Check that `~/.dsh/trivium.json` has an OpenAI-compatible URL (the `/v1` kind). Restart after changing it. |
|
|
252
|
-
| Memory still there after uninstall
|
|
248
|
+
| Memory still there after uninstall | Stop `dsh web` before `dsh plugin remove`. Leftover `.tdb` is a workspace never opened on 0.4.10+; delete `.dsh/trivium.tdb` in that folder. Disable-in-place does not wipe. |
|
|
253
249
|
| Check for updates fails | That request only hits the npm registry for the latest version. Memory is unaffected; try again later. |
|
|
254
250
|
| Old conversations will not open after rc.8 | That is DSH’s own session-store format change, not a broken `.tdb`. Graph memory still works via `ctx_find`; leftover boxes on unmatched old sessions are plot residue. |
|
|
255
251
|
|
|
@@ -260,7 +256,7 @@ Local source checkout: `npm install`, then `node scripts/link-dsh.mjs`, then res
|
|
|
260
256
|
## Release info
|
|
261
257
|
|
|
262
258
|
- GitHub: https://github.com/QWQcool/dsh-trivium
|
|
263
|
-
- npm: [`dsh-trivium@0.4.
|
|
259
|
+
- npm: [`dsh-trivium@0.4.10`](https://www.npmjs.com/package/dsh-trivium)
|
|
264
260
|
- Tested host: `@deepseek-ai/dsh@0.1.1-rc.2` (also `0.1.0-rc.8`)
|
|
265
261
|
- License: MIT (depends on [TriviumDB](https://github.com/YoKONCy/TriviumDB), Apache-2.0)
|
|
266
262
|
|
package/README.zh-CN.md
CHANGED
|
@@ -47,23 +47,17 @@ dsh plugin --profile web add dsh-trivium
|
|
|
47
47
|
|
|
48
48
|
## 卸载
|
|
49
49
|
|
|
50
|
+
先停掉 **dsh web**,避免 `.tdb` 被占用,然后:
|
|
51
|
+
|
|
50
52
|
```sh
|
|
51
53
|
dsh plugin --profile web remove dsh-trivium
|
|
52
54
|
```
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
卸载**不会**自动删记忆文件。要彻底清掉再手动删:
|
|
56
|
+
`remove` 会删掉本插件的文件:`~/.dsh/trivium.json`,以及它打开过的每个工作区里的 `.dsh/trivium.tdb` 和 `trivium-pending.json`。`.dsh/` 下其它文件不动。用 `dsh plugin add dsh-trivium` 升级**不会**清记忆。
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|---|---|
|
|
60
|
-
| `<workspace>/.dsh/trivium.tdb` | 该工作区的图记忆(节点、边、会话图方框) |
|
|
61
|
-
| `<workspace>/.dsh/trivium-pending.json` | 抽取失败待重放的队列;没有则跳过 |
|
|
62
|
-
| `~/.dsh/trivium.json` | 注入策略、抽取开关、embedding、各会话芯片钉选 |
|
|
58
|
+
然后再重启 **dsh web**:设置里不再有「Trivium 记忆」,标题栏不再有「芯片」,四个工具不再注册。
|
|
63
59
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
临时关掉、先不卸载:在该 profile 的 `cordis.patch.yml` 里加:
|
|
60
|
+
从未用本版打开过的工作区,可能还留着旧 `.tdb`;看到就手动删那个文件。只想停用、不卸载(数据还在):在该 profile 的 `cordis.patch.yml` 里加:
|
|
67
61
|
|
|
68
62
|
```yaml
|
|
69
63
|
- id: dsh-trivium
|
|
@@ -216,6 +210,8 @@ Trivium 是记忆内核,不是日记、日历或聊天伴侣。它按**节点
|
|
|
216
210
|
|
|
217
211
|
## 更新说明
|
|
218
212
|
|
|
213
|
+
**0.4.10** — `dsh plugin remove` 会删掉已知工作区的 `.tdb` 和 `~/.dsh/trivium.json`。升级安装不清记忆。配置里 disabled 仍保留数据。
|
|
214
|
+
|
|
219
215
|
**0.4.9** — 芯片标签和会话层画布都默认关。设置里打开芯片后标题栏才出现「芯片」;情节方框嵌在其下。内核(四工具、短地图、进程内 `.tdb`)不变。
|
|
220
216
|
|
|
221
217
|
**0.4.8** — 写入 + 注入卫生闸门(密钥、乱码、复读、JSON envelope、base64 残骸)。设置页 / 会话图跟随 DSH 语言。设置页可检查 npm 更新。一次性严导入同时发现 Claude Code `CLAUDE.md` 与 Codex `AGENTS.md`。若 `session-start` 和第一步赛跑,首轮短地图仍会补上。
|
|
@@ -247,7 +243,7 @@ Trivium 是记忆内核,不是日记、日历或聊天伴侣。它按**节点
|
|
|
247
243
|
| `ctx_find` 什么都没有 | 新会话默认只注入短地图,模型要自己调工具。也可以在芯片条「新增」或对模型说「记住:…」。闲聊和一次性改文件不会自动入库。 |
|
|
248
244
|
| 报 `.tdb` 被占用 / 打不开 | 只开一个 `dsh web`。不要同时跑两份链接了本插件的 Node 进程。 |
|
|
249
245
|
| embedding 填了但检索没变准 | 失败会退回关键词 + 图。看 `~/.dsh/trivium.json` 里 URL 是否 OpenAI 兼容(含 `/v1` 那种)。改完重启。 |
|
|
250
|
-
| 卸载后记忆还在
|
|
246
|
+
| 卸载后记忆还在 | 先停 `dsh web` 再 `dsh plugin remove`。剩下的 `.tdb` 是从未用 0.4.10 打开过的工作区,到该文件夹删 `.dsh/trivium.tdb`。只在配置里 disabled 不会清文件。 |
|
|
251
247
|
| 检查更新失败 | 只请求 npm registry 拿最新版本号,不影响记忆;过一会儿再点即可。 |
|
|
252
248
|
| rc.8 之后旧对话打不开 | 那是 DSH 自己的会话库格式变了,不是 `.tdb` 坏了。图记忆仍可 `ctx_find`;对不上号的旧方框可当情节残留。 |
|
|
253
249
|
|
|
@@ -258,7 +254,7 @@ Trivium 是记忆内核,不是日记、日历或聊天伴侣。它按**节点
|
|
|
258
254
|
## 发布信息
|
|
259
255
|
|
|
260
256
|
- GitHub: https://github.com/QWQcool/dsh-trivium
|
|
261
|
-
- npm: [`dsh-trivium@0.4.
|
|
257
|
+
- npm: [`dsh-trivium@0.4.10`](https://www.npmjs.com/package/dsh-trivium)
|
|
262
258
|
- 测试宿主:`@deepseek-ai/dsh@0.1.1-rc.2`(兼 `0.1.0-rc.8`)
|
|
263
259
|
- License: MIT(依赖 [TriviumDB](https://github.com/YoKONCy/TriviumDB) 为 Apache-2.0)
|
|
264
260
|
|
package/lib/purge.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/** Wipe plugin files on real uninstall. Never run this on dsh web restart. */
|
|
2
|
+
|
|
3
|
+
import { existsSync, readdirSync, unlinkSync } from "node:fs";
|
|
4
|
+
import { basename, join, resolve } from "node:path";
|
|
5
|
+
import { listedWorkspaces, settingsFilePath } from "./settings.js";
|
|
6
|
+
import { closeAll, listOpenWorkspaces } from "./store.js";
|
|
7
|
+
|
|
8
|
+
export function isTriviumArtifactName(name) {
|
|
9
|
+
const n = String(name || "");
|
|
10
|
+
return n === "trivium-pending.json" || n === "trivium.tdb" || n.startsWith("trivium.tdb");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* `dsh plugin remove` / `pnpm remove` should wipe.
|
|
15
|
+
* `pnpm add` / update / ci reinstall the same package and must keep memory.
|
|
16
|
+
*/
|
|
17
|
+
export function shouldWipeOnUninstall(env = process.env, argv = process.argv) {
|
|
18
|
+
if (argv.includes("--force-purge")) return true;
|
|
19
|
+
const event = String(env.npm_lifecycle_event || "").toLowerCase();
|
|
20
|
+
if (event && event !== "preuninstall" && event !== "uninstall") return false;
|
|
21
|
+
|
|
22
|
+
const cmd = String(env.npm_command || "").toLowerCase();
|
|
23
|
+
if (cmd === "remove" || cmd === "uninstall") return true;
|
|
24
|
+
if (cmd === "install" || cmd === "add" || cmd === "update" || cmd === "upgrade" || cmd === "ci" || cmd === "dedupe") {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const cooked = String(env.npm_config_argv || "").toLowerCase();
|
|
29
|
+
if (/\b(remove|uninstall)\b/.test(cooked) && !/\b(install|add|update|upgrade)\b/.test(cooked)) return true;
|
|
30
|
+
if (/\b(install|add|update|upgrade|ci)\b/.test(cooked)) return false;
|
|
31
|
+
|
|
32
|
+
// Unknown command: keep memory. Upgrades must never delete the store.
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function collectPurgeCwds(extraCwds = []) {
|
|
37
|
+
const seen = new Set();
|
|
38
|
+
const out = [];
|
|
39
|
+
const add = (cwd) => {
|
|
40
|
+
const key = String(cwd || "").trim();
|
|
41
|
+
if (!key) return;
|
|
42
|
+
const resolved = resolve(key);
|
|
43
|
+
if (seen.has(resolved)) return;
|
|
44
|
+
seen.add(resolved);
|
|
45
|
+
out.push(resolved);
|
|
46
|
+
};
|
|
47
|
+
for (const cwd of listedWorkspaces()) add(cwd);
|
|
48
|
+
for (const row of listOpenWorkspaces()) add(row.cwd);
|
|
49
|
+
for (const cwd of extraCwds) add(cwd);
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function unlinkQuiet(path, files, errors) {
|
|
54
|
+
try {
|
|
55
|
+
unlinkSync(path);
|
|
56
|
+
files.push(path);
|
|
57
|
+
} catch (err) {
|
|
58
|
+
if (err && err.code !== "ENOENT") errors.push({ path, message: String(err.message || err) });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function purgeWorkspaceArtifacts(cwd, files, errors) {
|
|
63
|
+
const dir = join(resolve(cwd), ".dsh");
|
|
64
|
+
if (!existsSync(dir)) return;
|
|
65
|
+
let names = [];
|
|
66
|
+
try {
|
|
67
|
+
names = readdirSync(dir);
|
|
68
|
+
} catch (err) {
|
|
69
|
+
errors.push({ path: dir, message: String(err.message || err) });
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
for (const name of names) {
|
|
73
|
+
if (!isTriviumArtifactName(name)) continue;
|
|
74
|
+
unlinkQuiet(join(dir, name), files, errors);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Delete known workspace traces and ~/.dsh/trivium.json. Leaves other .dsh files alone. */
|
|
79
|
+
export function purgeAllTraces({ extraCwds = [], close = closeAll } = {}) {
|
|
80
|
+
const settingsFile = settingsFilePath();
|
|
81
|
+
const workspaces = collectPurgeCwds(extraCwds);
|
|
82
|
+
try {
|
|
83
|
+
close();
|
|
84
|
+
} catch {
|
|
85
|
+
// ignore
|
|
86
|
+
}
|
|
87
|
+
const files = [];
|
|
88
|
+
const errors = [];
|
|
89
|
+
for (const cwd of workspaces) purgeWorkspaceArtifacts(cwd, files, errors);
|
|
90
|
+
unlinkQuiet(settingsFile, files, errors);
|
|
91
|
+
return { ok: errors.length === 0, workspaces, files, errors, settingsFile };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function shouldRunCli() {
|
|
95
|
+
return basename(String(process.argv[1] || "")) === "purge.js";
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function runUninstallPurge(env = process.env, argv = process.argv, log = console) {
|
|
99
|
+
if (!shouldWipeOnUninstall(env, argv)) {
|
|
100
|
+
log.info?.("[dsh-trivium] skip data wipe (install/update, not remove)");
|
|
101
|
+
return { skipped: true };
|
|
102
|
+
}
|
|
103
|
+
const result = purgeAllTraces();
|
|
104
|
+
const n = result.files.length;
|
|
105
|
+
log.info?.(`[dsh-trivium] removed ${n} plugin file${n === 1 ? "" : "s"} from ${result.workspaces.length} workspace(s)`);
|
|
106
|
+
if (result.errors.length) {
|
|
107
|
+
log.warn?.("[dsh-trivium] some files could not be deleted (stop dsh web and delete leftovers):");
|
|
108
|
+
for (const err of result.errors) log.warn?.(` ${err.path}: ${err.message}`);
|
|
109
|
+
}
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (shouldRunCli()) {
|
|
114
|
+
const result = runUninstallPurge();
|
|
115
|
+
if (result?.errors?.length) process.exitCode = 1;
|
|
116
|
+
}
|
package/lib/settings.js
CHANGED
|
@@ -1,19 +1,68 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
2
|
+
import { homedir, tmpdir } from "node:os";
|
|
3
|
+
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
4
4
|
import { looksHttpUrl } from "./embed.js";
|
|
5
5
|
|
|
6
6
|
export const SETTINGS_FILE = join(homedir(), ".dsh", "trivium.json");
|
|
7
7
|
|
|
8
|
+
/** Tests may set DSH_TRIVIUM_SETTINGS to a temp file so we never touch the live home config. */
|
|
9
|
+
export function settingsFilePath() {
|
|
10
|
+
const override = String(process.env.DSH_TRIVIUM_SETTINGS || "").trim();
|
|
11
|
+
return override ? resolve(override) : SETTINGS_FILE;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function persistSettings(next) {
|
|
15
|
+
const file = settingsFilePath();
|
|
16
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
17
|
+
writeFileSync(file, JSON.stringify(next, null, 2), "utf8");
|
|
18
|
+
return next;
|
|
19
|
+
}
|
|
20
|
+
|
|
8
21
|
export function readUiSettings() {
|
|
9
22
|
try {
|
|
10
|
-
const raw = JSON.parse(readFileSync(
|
|
23
|
+
const raw = JSON.parse(readFileSync(settingsFilePath(), "utf8"));
|
|
11
24
|
return raw && typeof raw === "object" ? raw : {};
|
|
12
25
|
} catch {
|
|
13
26
|
return {};
|
|
14
27
|
}
|
|
15
28
|
}
|
|
16
29
|
|
|
30
|
+
export function listedWorkspaces() {
|
|
31
|
+
const raw = readUiSettings().workspaces;
|
|
32
|
+
if (!Array.isArray(raw)) return [];
|
|
33
|
+
const seen = new Set();
|
|
34
|
+
const out = [];
|
|
35
|
+
for (const item of raw) {
|
|
36
|
+
const cwd = String(item || "").trim();
|
|
37
|
+
if (!cwd) continue;
|
|
38
|
+
const key = resolve(cwd);
|
|
39
|
+
if (seen.has(key)) continue;
|
|
40
|
+
seen.add(key);
|
|
41
|
+
out.push(key);
|
|
42
|
+
}
|
|
43
|
+
return out;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function isInsideDir(parent, child) {
|
|
47
|
+
const rel = relative(resolve(parent), resolve(child));
|
|
48
|
+
return rel === "" || (rel !== ".." && !rel.startsWith(".." + sep));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Remember a workspace so uninstall can delete its .tdb. No-op if already listed. */
|
|
52
|
+
export function rememberWorkspace(cwd) {
|
|
53
|
+
const key = String(cwd || "").trim();
|
|
54
|
+
if (!key) return listedWorkspaces();
|
|
55
|
+
const resolved = resolve(key);
|
|
56
|
+
if (!process.env.DSH_TRIVIUM_SETTINGS && isInsideDir(tmpdir(), resolved)) {
|
|
57
|
+
return listedWorkspaces();
|
|
58
|
+
}
|
|
59
|
+
const prev = readUiSettings();
|
|
60
|
+
const workspaces = listedWorkspaces();
|
|
61
|
+
if (workspaces.includes(resolved)) return workspaces;
|
|
62
|
+
persistSettings({ ...prev, workspaces: [...workspaces, resolved] });
|
|
63
|
+
return [...workspaces, resolved];
|
|
64
|
+
}
|
|
65
|
+
|
|
17
66
|
export function recallModeOf(opts = {}) {
|
|
18
67
|
const mode = opts.recallMode;
|
|
19
68
|
if (mode === "auto" || mode === "anchor" || mode === "off") return mode;
|
|
@@ -42,7 +91,6 @@ export function applyRecallMode(target, mode) {
|
|
|
42
91
|
}
|
|
43
92
|
|
|
44
93
|
export function writeUiSettings(patch) {
|
|
45
|
-
mkdirSync(join(homedir(), ".dsh"), { recursive: true });
|
|
46
94
|
const prev = readUiSettings();
|
|
47
95
|
const next = { ...prev };
|
|
48
96
|
let mode = recallModeOf(prev);
|
|
@@ -76,8 +124,9 @@ export function writeUiSettings(patch) {
|
|
|
76
124
|
} else if (prev.pinsBySession && typeof prev.pinsBySession === "object") {
|
|
77
125
|
next.pinsBySession = prev.pinsBySession;
|
|
78
126
|
}
|
|
79
|
-
|
|
80
|
-
|
|
127
|
+
if (Array.isArray(patch.workspaces)) next.workspaces = patch.workspaces;
|
|
128
|
+
else if (Array.isArray(prev.workspaces)) next.workspaces = prev.workspaces;
|
|
129
|
+
return persistSettings(next);
|
|
81
130
|
}
|
|
82
131
|
|
|
83
132
|
export function pinsOf(sessionId) {
|
|
@@ -96,11 +145,10 @@ export function writePins(sessionId, ids) {
|
|
|
96
145
|
if (!key) return nextIds;
|
|
97
146
|
if (!nextIds.length) delete pinsBySession[key];
|
|
98
147
|
else pinsBySession[key] = nextIds;
|
|
99
|
-
|
|
100
|
-
writeFileSync(SETTINGS_FILE, JSON.stringify({ ...prev, pinsBySession }, null, 2), "utf8");
|
|
148
|
+
persistSettings({ ...prev, pinsBySession });
|
|
101
149
|
return nextIds;
|
|
102
150
|
}
|
|
103
151
|
|
|
104
152
|
export function settingsFileExists() {
|
|
105
|
-
return existsSync(
|
|
153
|
+
return existsSync(settingsFilePath());
|
|
106
154
|
}
|
package/lib/store.js
CHANGED
|
@@ -2,6 +2,7 @@ import { mkdirSync } from "node:fs";
|
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { join, resolve } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { rememberWorkspace } from "./settings.js";
|
|
5
6
|
import { DIM, EDGE_LABELS, BUSINESS_EDGES, NODE_TYPES, indexTextFor, nowIso, weightOf, zeroVector } from "./schema.js";
|
|
6
7
|
import { clipToTokenBudget, estimateTokens } from "./tokens.js";
|
|
7
8
|
import { isStalePayload, parseUntilFromText, queryMentionsUntil, resolveUntilAt } from "./until.js";
|
|
@@ -78,6 +79,11 @@ export async function openWorkspaceDb(cwd) {
|
|
|
78
79
|
ensureWorkspaceRoot(db, cwd);
|
|
79
80
|
rebuildTextIndex(db);
|
|
80
81
|
dbs.set(key, db);
|
|
82
|
+
try {
|
|
83
|
+
rememberWorkspace(key);
|
|
84
|
+
} catch {
|
|
85
|
+
// listing is best-effort; opening the store still succeeds
|
|
86
|
+
}
|
|
81
87
|
return db;
|
|
82
88
|
}
|
|
83
89
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-trivium",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.10",
|
|
4
4
|
"description": "In-process graph memory for DeepSeek Harness, backed by TriviumDB.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
"smoke-p7": "node scripts/smoke-p7.mjs",
|
|
43
43
|
"smoke-p8": "node scripts/smoke-p8.mjs",
|
|
44
44
|
"smoke-p10": "node scripts/smoke-p10.mjs",
|
|
45
|
+
"smoke-p11": "node scripts/smoke-p11.mjs",
|
|
46
|
+
"preuninstall": "node ./lib/purge.js",
|
|
45
47
|
"verify-live-p2": "node scripts/verify-live-p2.mjs"
|
|
46
48
|
},
|
|
47
49
|
"engines": {
|