@aiwayds/dsh-topics-memory 0.7.0 → 0.8.1

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
@@ -4,7 +4,7 @@ English | [中文](README.zh.md)
4
4
 
5
5
  A dsh plugin: maintains "working topic memory" as an [OKF (Open Knowledge Format v0.2)](https://github.com/GoogleCloudPlatform/open-knowledge-format) knowledge bundle, persisted in a local git repository (optionally synced to a private GitHub repo), with conclusions traceable through git history, sessions automatically observed and distilled into knowledge, and relevant topics injected to the model before every turn.
6
6
 
7
- > **Requires dsh >= 0.1.2-alpha.4** (adapted to the dsh 0.1.2-alpha.4 settings namespace and LLM seam; the rc line is no longer supported).
7
+ > **Requires dsh >= 0.1.2-rc.1** — this plugin targets the dsh RC/stable line only (CI and releases resolve the newest of the `latest`/`next` dist-tags at runtime). **The alpha line is no longer supported.**
8
8
 
9
9
  ## The problem it solves
10
10
 
@@ -58,6 +58,24 @@ First thing after installing: run `/topics onboard`. The bundle lives at `~/.dsh
58
58
 
59
59
  0.6.0 renames the plugin: `@aiwayds/dsh-llmwiki-memory` → `@aiwayds/dsh-topics-memory`, the `/wiki` command family → `/topics`, and the settings namespace `llmwiki` → `topics`. Install the new package (and remove the old one from your profile) — on first start the plugin migrates everything automatically: the data directory `~/.dsh/llmwiki` is renamed to `~/.dsh/topics`, and user-tuned values in the old `llmwiki` settings namespace are copied into `topics`. No manual steps; if a migration step fails the plugin falls back to the old locations and keeps working.
60
60
 
61
+ ## Uninstall
62
+
63
+ Remove the plugin from a profile:
64
+
65
+ ```sh
66
+ dsh plugin --profile <name> remove @aiwayds/dsh-topics-memory
67
+ ```
68
+
69
+ The host reconciles the profile automatically: the `dsh.profile.bundles` entry is spliced and the patch layer is dropped.
70
+
71
+ What stays on disk (kept on purpose — this is your memory):
72
+
73
+ - `~/.dsh/topics/` — the whole topic bundle: topic markdown, `meta/`, and the embedded `.git` repo (the full history; it may carry an `origin` remote — GitHub sync stops with the plugin). To archive the bundle elsewhere, copy or clone this directory as-is.
74
+ - `~/.dsh/settings.yaml` `topics:` section — user overrides. Reinstalling silently reactivates sync including any configured `repo`; delete the section first if you want a clean start.
75
+ - The legacy `llmwiki:` settings section left by the 0.5.x → 0.6.x migration is never auto-deleted; remove it by hand once nothing needs it.
76
+
77
+ Purge everything: back up `~/.dsh/topics` first, then `rm -rf ~/.dsh/topics`.
78
+
61
79
  ## Configuration
62
80
 
63
81
  First-time setup belongs to `/topics onboard`; day-to-day tuning is `/topics set <key> <value>` (writes the `topics` namespace in `settings.yaml`, effective from the next session). All keys and defaults:
package/README.zh.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  一个 dsh 插件:把「工作 topic 记忆」维护成 [OKF 标准(Open Knowledge Format v0.2)](https://github.com/GoogleCloudPlatform/open-knowledge-format)的知识 bundle,持久化在本地 git 仓库(可选同步到 GitHub 私有仓库),利用 git 历史提供结论可追溯性,自动观察会话沉淀知识,并在每轮对话前向模型注入相关 Topic。
6
6
 
7
- > **Requires dsh >= 0.1.2-alpha.4**(适配 dsh 0.1.2-alpha.4 的 settings 命名空间与 LLM seam;不再兼容 rc 线宿主)。
7
+ > **要求 dsh >= 0.1.2-rc.1** — 本插件只跟随 dsh RC/stable 线(CI 与发版在运行时解析 latest/next 中更新的 dist-tag)。**不再支持 alpha 线。**
8
8
 
9
9
  ## 它解决什么问题
10
10
 
@@ -58,6 +58,24 @@ Bundle 默认在 `~/.dsh/topics/`(`$DSH_TOPICS_HOME` 可覆盖)。装好后
58
58
  2. 跑 `/topics onboard`,在 ask-user 面板里走完 模式 / 仓库 / 蒸馏模型 / 注入档位 / 自动观察 五个决定——末步确认才写入;
59
59
  3. 正常干活:相关结论每轮自动注入;说「记住…」让模型 `topic_save`;`/topics status` 看健康,`/topics stats` 看注入命中。
60
60
 
61
+ ## 卸载
62
+
63
+ 从 profile 移除插件:
64
+
65
+ ```sh
66
+ dsh plugin --profile <name> remove @aiwayds/dsh-topics-memory
67
+ ```
68
+
69
+ 宿主会自动收敛:`dsh.profile.bundles` 条目被移除,patch 层随包消失。
70
+
71
+ 以下内容有意保留在磁盘上(这是你的记忆本体):
72
+
73
+ - `~/.dsh/topics/` —— 整个话题包:话题 markdown、`meta/`、以及内嵌的 `.git` 仓库(完整历史;可能带有 `origin` 远端 —— GitHub 同步随插件停止)。要异地归档就原样拷贝/克隆这个目录。
74
+ - `~/.dsh/settings.yaml` 的 `topics:` 段 —— 用户覆盖项。注意:重装会静默恢复同步(包括已配置的 `repo`);想干净重来就先删这一段。
75
+ - 0.5.x → 0.6.x 迁移留下的 `llmwiki:` 旧设置段不会被自动删除;确认无用后手动移除。
76
+
77
+ 彻底清除:先备份 `~/.dsh/topics`,再 `rm -rf ~/.dsh/topics`。
78
+
61
79
  ## 配置
62
80
 
63
81
  首次配置交给 `/topics onboard`;日常微调用 `/topics set <key> <value>`(写 `settings.yaml` 的 `topics` namespace,下次会话启动生效)。全部键与默认值:
package/lib/index.js CHANGED
@@ -470,8 +470,11 @@ export function apply(ctx) {
470
470
  observer.onSessionEvent('dispose', 'agent/disposed', undefined);
471
471
  }
472
472
  sync.dispose();
473
- void sync.commitMeta().then(() => sync.flush()).catch(() => undefined);
474
- return settleBounded(exitDistill, EXIT_DISTILL_TIMEOUT_MS);
473
+ // The exit flush (final meta commit + ledger flush) rides the SAME
474
+ // bounded window as the exit distill — fire-and-forget here loses the
475
+ // exit race that window was built to win.
476
+ const exitFlush = sync.commitMeta().then(() => sync.flush()).catch(() => undefined);
477
+ return settleBounded(exitDistill === undefined ? exitFlush : Promise.allSettled([exitDistill, exitFlush]), EXIT_DISTILL_TIMEOUT_MS);
475
478
  };
476
479
  }, 'topics: lifecycle');
477
480
  // ---- /topics command (optional peer) ----
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiwayds/dsh-topics-memory",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "dsh-plugin: OKF v0.2 topic memory for dsh - local-first git-tracked bundle, hot-path LLM-free injection, two-stage observer with background distill",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -38,16 +38,17 @@
38
38
  "build": "tsc -p tsconfig.json",
39
39
  "check": "tsc --noEmit -p tsconfig.json",
40
40
  "pretest": "tsc -p tsconfig.json",
41
- "test": "node --test test/yaml.test.mjs test/okf.test.mjs test/retrieval.test.mjs test/digest.test.mjs test/ilog.test.mjs test/store.test.mjs test/paths.test.mjs test/git.test.mjs test/sync.test.mjs test/tools.test.mjs test/dedup.test.mjs test/commands.test.mjs test/onboard.test.mjs test/delegation.test.mjs test/observer.test.mjs test/distill.test.mjs test/viz.test.mjs test/corpus.test.mjs test/llm-scope.test.mjs test/settings-migration.test.mjs test/quality.test.mjs test/replay-gate.test.mjs"
41
+ "test": "node --test test/yaml.test.mjs test/okf.test.mjs test/retrieval.test.mjs test/digest.test.mjs test/ilog.test.mjs test/store.test.mjs test/paths.test.mjs test/git.test.mjs test/sync.test.mjs test/tools.test.mjs test/dedup.test.mjs test/commands.test.mjs test/onboard.test.mjs test/delegation.test.mjs test/observer.test.mjs test/distill.test.mjs test/viz.test.mjs test/corpus.test.mjs test/llm-scope.test.mjs test/settings-migration.test.mjs test/quality.test.mjs test/replay-gate.test.mjs",
42
+ "smoke": "node scripts/smoke-boot.mjs"
42
43
  },
43
44
  "dependencies": {},
44
45
  "peerDependencies": {
45
46
  "@deepseek-ai/cordis": "^4.0.2",
46
- "@deepseek-ai/dsh-tools": ">=0.1.2-alpha.4",
47
- "@deepseek-ai/dsh-llm": ">=0.1.2-alpha.4",
48
- "@deepseek-ai/dsh-settings": ">=0.1.2-alpha.4",
49
- "@deepseek-ai/dsh-commands": ">=0.1.2-alpha.4",
50
- "@deepseek-ai/dsh-util-values": ">=0.1.2-alpha.4",
47
+ "@deepseek-ai/dsh-tools": ">=0.1.2-rc.1",
48
+ "@deepseek-ai/dsh-llm": ">=0.1.2-rc.1",
49
+ "@deepseek-ai/dsh-settings": ">=0.1.2-rc.1",
50
+ "@deepseek-ai/dsh-commands": ">=0.1.2-rc.1",
51
+ "@deepseek-ai/dsh-util-values": ">=0.1.2-rc.1",
51
52
  "@deepseek-ai/schemastery": "^3.18.2"
52
53
  },
53
54
  "peerDependenciesMeta": {
@@ -75,21 +76,21 @@
75
76
  },
76
77
  "devDependencies": {
77
78
  "@deepseek-ai/cordis": "4.0.2",
78
- "@deepseek-ai/dsh-agent": "0.1.2-alpha.4",
79
- "@deepseek-ai/dsh-attachment": "0.1.2-alpha.4",
80
- "@deepseek-ai/dsh-brand": "0.1.2-alpha.4",
81
- "@deepseek-ai/dsh-code-runtime": "0.1.2-alpha.4",
82
- "@deepseek-ai/dsh-commands": "0.1.2-alpha.4",
83
- "@deepseek-ai/dsh-invariants": "0.1.2-alpha.4",
84
- "@deepseek-ai/dsh-llm": "0.1.2-alpha.4",
85
- "@deepseek-ai/dsh-scope": "0.1.2-alpha.4",
86
- "@deepseek-ai/dsh-session": "0.1.2-alpha.4",
87
- "@deepseek-ai/dsh-settings": "0.1.2-alpha.4",
88
- "@deepseek-ai/dsh-system-prompt": "0.1.2-alpha.4",
89
- "@deepseek-ai/dsh-timeout": "0.1.2-alpha.4",
90
- "@deepseek-ai/dsh-tools": "0.1.2-alpha.4",
91
- "@deepseek-ai/dsh-user-approval": "0.1.2-alpha.4",
92
- "@deepseek-ai/dsh-util-values": "0.1.2-alpha.4",
79
+ "@deepseek-ai/dsh-agent": "0.1.2-rc.1",
80
+ "@deepseek-ai/dsh-attachment": "0.1.2-rc.1",
81
+ "@deepseek-ai/dsh-brand": "0.1.2-rc.1",
82
+ "@deepseek-ai/dsh-code-runtime": "0.1.2-rc.1",
83
+ "@deepseek-ai/dsh-commands": "0.1.2-rc.1",
84
+ "@deepseek-ai/dsh-invariants": "0.1.2-rc.1",
85
+ "@deepseek-ai/dsh-llm": "0.1.2-rc.1",
86
+ "@deepseek-ai/dsh-scope": "0.1.2-rc.1",
87
+ "@deepseek-ai/dsh-session": "0.1.2-rc.1",
88
+ "@deepseek-ai/dsh-settings": "0.1.2-rc.1",
89
+ "@deepseek-ai/dsh-system-prompt": "0.1.2-rc.1",
90
+ "@deepseek-ai/dsh-timeout": "0.1.2-rc.1",
91
+ "@deepseek-ai/dsh-tools": "0.1.2-rc.1",
92
+ "@deepseek-ai/dsh-user-approval": "0.1.2-rc.1",
93
+ "@deepseek-ai/dsh-util-values": "0.1.2-rc.1",
93
94
  "@deepseek-ai/schemastery": "3.18.2",
94
95
  "@types/node": "^22.19.0",
95
96
  "typescript": "^5.9.2"
package/src/index.ts CHANGED
@@ -535,8 +535,14 @@ export function apply(ctx: Context): void {
535
535
  observer.onSessionEvent('dispose', 'agent/disposed', undefined)
536
536
  }
537
537
  sync.dispose()
538
- void sync.commitMeta().then(() => sync.flush()).catch(() => undefined)
539
- return settleBounded(exitDistill, EXIT_DISTILL_TIMEOUT_MS)
538
+ // The exit flush (final meta commit + ledger flush) rides the SAME
539
+ // bounded window as the exit distill — fire-and-forget here loses the
540
+ // exit race that window was built to win.
541
+ const exitFlush = sync.commitMeta().then(() => sync.flush()).catch(() => undefined)
542
+ return settleBounded(
543
+ exitDistill === undefined ? exitFlush : Promise.allSettled([exitDistill, exitFlush]),
544
+ EXIT_DISTILL_TIMEOUT_MS,
545
+ )
540
546
  }
541
547
  },
542
548
  'topics: lifecycle',