@aiwayds/dsh-topics-memory 0.8.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
@@ -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
@@ -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.8.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,7 +38,8 @@
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": {
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',