dsh-memu-memory 1.4.2 → 1.4.4
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/AGENTS.md +108 -110
- package/CHANGELOG.md +173 -868
- package/LICENSE +21 -21
- package/README.md +368 -374
- package/README.zh.md +354 -360
- package/assets/icon.svg +7 -7
- package/cordis.patch.yml +8 -8
- package/docs/active-memory-ab.md +279 -385
- package/docs/binding-lifecycle.md +99 -99
- package/docs/client-conventions.md +75 -75
- package/docs/contributing.md +217 -217
- package/docs/emotion-model-spec.md +247 -281
- package/docs/env-and-commands.md +149 -152
- package/docs/host-adaptation.md +339 -360
- package/docs/host-api.md +131 -137
- package/docs/host-versions.md +117 -120
- package/docs/mcp-porting.md +146 -146
- package/docs/memory-semantics.md +271 -259
- package/docs/pending-work.md +44 -51
- package/docs/troubleshooting.md +909 -854
- package/lib/active-memory.js +160 -165
- package/lib/activity-log.js +207 -207
- package/lib/auto-link/apply.js +248 -249
- package/lib/auto-link/candidates.js +163 -163
- package/lib/auto-link/decide.js +300 -300
- package/lib/auto-link/normalize.js +99 -99
- package/lib/auto-link/policy.js +42 -42
- package/lib/auto-link/suppression.js +101 -101
- package/lib/auto-link/terminology.js +311 -311
- package/lib/backup.js +1254 -1254
- package/lib/binding-diagnostics.js +634 -634
- package/lib/budget.js +118 -118
- package/lib/client.js +9820 -9751
- package/lib/commitment.js +178 -138
- package/lib/consolidation-ledger.js +434 -438
- package/lib/consolidation-receipt.js +386 -387
- package/lib/consolidation-snapshot.js +420 -405
- package/lib/consolidation-worker.js +240 -241
- package/lib/context.js +33 -33
- package/lib/curator-evidence.js +131 -131
- package/lib/curator-policy.js +198 -202
- package/lib/curator.js +1813 -1811
- package/lib/cycle.js +524 -513
- package/lib/diagnostics.js +524 -524
- package/lib/embedding-catalog.js +1051 -1055
- package/lib/embedding-download.js +637 -607
- package/lib/embedding-runtime.js +946 -946
- package/lib/engine.js +1103 -1103
- package/lib/entity-repair.js +285 -285
- package/lib/environment-check.js +394 -394
- package/lib/fork-model.js +312 -312
- package/lib/freshness.js +128 -121
- package/lib/global-graph.js +389 -389
- package/lib/graph.js +1193 -1193
- package/lib/host-surface.js +30 -30
- package/lib/inbound.js +284 -281
- package/lib/index.js +506 -511
- package/lib/inject.js +2639 -2619
- package/lib/lexicon-scope.js +143 -143
- package/lib/lexicon.js +1183 -1192
- package/lib/lifecycle-audit.js +37 -0
- package/lib/local-embedding-entry.js +145 -145
- package/lib/local-embedding-manager.js +306 -306
- package/lib/local-embedding-protocol.js +210 -210
- package/lib/local-embedding-worker.js +682 -682
- package/lib/local-vector-service.js +506 -453
- package/lib/maintenance-ledger.js +138 -0
- package/lib/maintenance-review.js +103 -0
- package/lib/maintenance-runner.js +267 -0
- package/lib/managed-runtime.js +118 -118
- package/lib/media.js +607 -513
- package/lib/memory.js +5035 -4941
- package/lib/memu-config.js +213 -213
- package/lib/memu.js +565 -565
- package/lib/migrate.js +200 -200
- package/lib/mood.js +300 -300
- package/lib/paths.js +453 -457
- package/lib/port-surface.js +82 -82
- package/lib/preset-mount.js +85 -0
- package/lib/preset-scope.js +126 -126
- package/lib/private-links.js +567 -567
- package/lib/private.js +2198 -2209
- package/lib/prompts/global-curator.md +135 -135
- package/lib/prompts/image-caption.md +1 -1
- package/lib/prompts/private-consolidation.coding.md +39 -39
- package/lib/prompts/private-consolidation.md +32 -32
- package/lib/prompts/private-consolidation.mixed.md +37 -37
- package/lib/prompts/private-consolidation.rp.md +47 -47
- package/lib/prompts/private-policy.coding.md +35 -35
- package/lib/prompts/private-policy.md +36 -36
- package/lib/prompts/private-policy.mixed.md +29 -29
- package/lib/prompts/private-policy.rp.md +43 -43
- package/lib/prompts/system-guide.coding.md +20 -20
- package/lib/prompts/system-guide.md +25 -25
- package/lib/prompts/system-guide.mixed.md +22 -22
- package/lib/prompts/system-guide.rp.md +23 -23
- package/lib/prompts.js +331 -331
- package/lib/recall-cache.js +212 -212
- package/lib/remote-summary.js +123 -123
- package/lib/rpc.js +2531 -2532
- package/lib/salient-wake.js +438 -438
- package/lib/snippet.js +125 -125
- package/lib/state.js +1948 -1928
- package/lib/stats.js +236 -236
- package/lib/temporal.js +345 -348
- package/lib/text-retrieval.js +992 -1001
- package/lib/text-similarity.js +305 -305
- package/lib/tokenizer-v2.js +271 -271
- package/lib/tools.js +1098 -1091
- package/lib/turn-log.js +545 -545
- package/lib/vector-migration.js +928 -930
- package/lib/vector-profile.js +1353 -1359
- package/lib/visibility.js +59 -59
- package/lib/webui/graph-LICENSE.txt +1 -1
- package/lib/webui/graph-view.bundle.js +2 -2
- package/lib/webui/graph-view.js +1171 -1175
- package/lib/webui/mark.svg +7 -7
- package/lib/webui/standalone.css +1178 -1178
- package/lib/webui/standalone.js +238 -238
- package/lib/webui.js +136 -136
- package/lib/worker-pool.js +1020 -979
- package/package.json +153 -153
- package/requirements.lock +34 -34
- package/scripts/acceptance-local.mjs +946 -946
- package/scripts/active-memory-ab-live.mjs +653 -655
- package/scripts/active-memory-ab.mjs +1302 -1302
- package/scripts/audit-memory-lifecycle.mjs +55 -0
- package/scripts/bench-recall.mjs +142 -142
- package/scripts/build-graph.mjs +44 -45
- package/scripts/chain-matrix.mjs +541 -541
- package/scripts/check-all.mjs +68 -74
- package/scripts/check-doc-drift.mjs +547 -547
- package/scripts/check-graph-browser.mjs +261 -261
- package/scripts/check-i18n.mjs +81 -83
- package/scripts/check-idle-compositing.mjs +61 -61
- package/scripts/check-seed-compat.mjs +115 -118
- package/scripts/check-text-format.mjs +55 -0
- package/scripts/curator-pair-calibrate.mjs +259 -259
- package/scripts/diagnose-bindings.mjs +176 -176
- package/scripts/drive-session.mjs +863 -864
- package/scripts/engine-smoke.mjs +69 -69
- package/scripts/entity-dedupe.mjs +110 -110
- package/scripts/lexicon-calibrate.mjs +230 -230
- package/scripts/lexicon-dedupe.mjs +318 -318
- package/scripts/local-runtime-install.mjs +142 -142
- package/scripts/local-runtime-verify.mjs +56 -56
- package/scripts/local-vector-verify.mjs +93 -93
- package/scripts/make-readme-shots.mjs +59 -59
- package/scripts/migrate-visibility.mjs +94 -94
- package/scripts/mock-llm.mjs +938 -903
- package/scripts/preview.mjs +58 -58
- package/scripts/prune-sessions.mjs +31 -34
- package/scripts/prune-turnlogs.mjs +29 -30
- package/scripts/prune-vectors.mjs +24 -24
- package/scripts/rebuild-auto-links.mjs +252 -252
- package/scripts/recall-bench.mjs +820 -820
- package/scripts/repetition-ab-scenarios.mjs +93 -93
- package/scripts/repetition-detector-snapshot.mjs +314 -314
- package/scripts/repetition-eval-live.mjs +360 -360
- package/scripts/repetition-eval.mjs +702 -702
- package/scripts/replay.mjs +705 -575
- package/scripts/setup.mjs +46 -46
- package/scripts/simulate-injection.mjs +299 -301
- package/tests/absorb-review.test.mjs +354 -354
- package/tests/activation.test.mjs +89 -89
- package/tests/active-memory-ab.test.mjs +745 -745
- package/tests/active-memory.test.mjs +129 -129
- package/tests/activity-log.test.mjs +126 -126
- package/tests/activity-wiring.test.mjs +155 -155
- package/tests/appendix-b.test.mjs +217 -217
- package/tests/appendix-b2.test.mjs +166 -166
- package/tests/audit-batch3.test.mjs +247 -247
- package/tests/audit-regression.test.mjs +275 -275
- package/tests/audit-safety.test.mjs +227 -227
- package/tests/auto-link-candidates.test.mjs +245 -245
- package/tests/auto-link-decide.test.mjs +512 -512
- package/tests/auto-link-migration.test.mjs +133 -133
- package/tests/backend-compensation.test.mjs +272 -272
- package/tests/backup.test.mjs +793 -793
- package/tests/binding-diagnostics.test.mjs +720 -720
- package/tests/browser.test.mjs +476 -476
- package/tests/client-export.test.mjs +521 -521
- package/tests/client-render.test.mjs +2008 -1728
- package/tests/coalesce.test.mjs +113 -113
- package/tests/commitment.test.mjs +243 -144
- package/tests/config.test.mjs +159 -159
- package/tests/consolidation-credential.test.mjs +330 -330
- package/tests/consolidation-feed.test.mjs +122 -122
- package/tests/consolidation-fork.test.mjs +1587 -1539
- package/tests/consolidation-ledger.test.mjs +389 -389
- package/tests/consolidation-snapshot.test.mjs +567 -505
- package/tests/consolidation-value.test.mjs +89 -89
- package/tests/context-scope.test.mjs +40 -40
- package/tests/cross-library-recall.test.mjs +269 -269
- package/tests/cue.test.mjs +58 -58
- package/tests/curator-absorb.test.mjs +444 -444
- package/tests/curator-calibrate.test.mjs +173 -173
- package/tests/curator-clusters.test.mjs +306 -306
- package/tests/curator-commit.test.mjs +325 -325
- package/tests/curator-contract.test.mjs +191 -191
- package/tests/curator-evidence.test.mjs +102 -102
- package/tests/curator-link.test.mjs +317 -317
- package/tests/curator-pairing.test.mjs +339 -339
- package/tests/curator-probe.test.mjs +490 -490
- package/tests/curator-review-mode.test.mjs +315 -315
- package/tests/curator.test.mjs +152 -152
- package/tests/cycle.test.mjs +567 -568
- package/tests/diagnostics.test.mjs +278 -278
- package/tests/disclosure.test.mjs +249 -249
- package/tests/doc-drift.test.mjs +342 -342
- package/tests/drive-session.test.mjs +152 -152
- package/tests/dynamic-rrf.test.mjs +182 -182
- package/tests/dynamic-threshold.test.mjs +52 -52
- package/tests/embedding-catalog.test.mjs +374 -374
- package/tests/embedding-download.test.mjs +529 -486
- package/tests/embedding-runtime.test.mjs +449 -449
- package/tests/emotion-chain.test.mjs +84 -84
- package/tests/emotion-contract.test.mjs +445 -445
- package/tests/engine.test.mjs +108 -108
- package/tests/entity-merge.test.mjs +278 -278
- package/tests/environment-check.test.mjs +187 -187
- package/tests/fact-version.test.mjs +146 -146
- package/tests/fixtures/active-memory-ab/README.md +56 -56
- package/tests/fixtures/active-memory-ab/cases/01-clean-dense-turn.json +351 -351
- package/tests/fixtures/active-memory-ab/cases/02-clean-thin-turn.json +122 -122
- package/tests/fixtures/active-memory-ab/cases/03-clean-starved-small.json +125 -125
- package/tests/fixtures/active-memory-ab/cases/04-clean-large-thin.json +137 -137
- package/tests/fixtures/active-memory-ab/cases/05-clean-half-step.json +166 -166
- package/tests/fixtures/active-memory-ab/cases/06-clean-duplicate-reread.json +197 -197
- package/tests/fixtures/active-memory-ab/cases/07-clean-recent-recall.json +125 -125
- package/tests/fixtures/active-memory-ab/cases/08-global-relevant.json +111 -111
- package/tests/fixtures/active-memory-ab/cases/09-global-irrelevant-conflict.json +158 -158
- package/tests/fixtures/active-memory-ab/cases/10-no-human-turn.json +97 -97
- package/tests/fixtures/active-memory-ab/cases/11-clean-scale-100.json +137 -137
- package/tests/fixtures/active-memory-ab/cases/12-clean-scale-1000.json +137 -137
- package/tests/fixtures/active-memory-ab/cases/13-clean-scale-5000.json +137 -137
- package/tests/fixtures/active-memory-ab/cases/14-clean-scale-20000.json +137 -137
- package/tests/fixtures/active-memory-ab/lead-ai-reviewed-reference.json +191 -191
- package/tests/fixtures/active-memory-ab/manifest.json +199 -199
- package/tests/fixtures/curator-pairs/labeled.v1.jsonl +90 -90
- package/tests/fixtures/lexicon-stub-hooks.mjs +15 -15
- package/tests/fixtures/lexicon-stub.mjs +284 -284
- package/tests/fixtures/mock-llm/reply.txt +1 -1
- package/tests/fixtures/recall-bench/01-paraphrase.json +183 -183
- package/tests/fixtures/recall-bench/02-exact.json +152 -152
- package/tests/fixtures/recall-bench/03-negation.json +172 -172
- package/tests/fixtures/recall-bench/04-no-answer.json +161 -161
- package/tests/fixtures/recall-bench/05-conflict.json +193 -193
- package/tests/fixtures/recall-bench/06-boundary.json +272 -272
- package/tests/fixtures/recall-bench/07-secret.json +190 -190
- package/tests/fixtures/recall-bench/08-coding.json +163 -163
- package/tests/fixtures/recall-bench-gold-candidates/01-paraphrase.json +193 -193
- package/tests/fixtures/recall-bench-gold-candidates/02-exact.json +197 -197
- package/tests/fixtures/recall-bench-gold-candidates/03-negation.json +244 -244
- package/tests/fixtures/recall-bench-gold-candidates/04-no-answer.json +189 -189
- package/tests/fixtures/recall-bench-gold-candidates/05-conflict.json +245 -245
- package/tests/fixtures/recall-bench-gold-candidates/06-boundary.json +279 -279
- package/tests/fixtures/recall-bench-gold-candidates/07-secret.json +224 -224
- package/tests/fixtures/recall-bench-gold-candidates/08-coding.json +218 -218
- package/tests/fixtures/repetition-eval/01-zh-rp.json +92 -92
- package/tests/fixtures/repetition-eval/02-en.json +96 -96
- package/tests/fixtures/repetition-eval/03-code.json +90 -90
- package/tests/fixtures/repetition-eval/04-names.json +115 -115
- package/tests/fixtures/repetition-eval/05-user-quote.json +95 -95
- package/tests/fixtures/repetition-eval/06-agreement.json +85 -85
- package/tests/fixtures/tokenizer-cases.mjs +27 -27
- package/tests/fork-model.test.mjs +345 -345
- package/tests/freshness.test.mjs +140 -140
- package/tests/global-graph.test.mjs +106 -106
- package/tests/global-lifecycle.test.mjs +149 -149
- package/tests/graph-cascade.test.mjs +363 -363
- package/tests/graph-view.test.mjs +414 -414
- package/tests/graph.test.mjs +371 -371
- package/tests/help-page.test.mjs +416 -416
- package/tests/hook-order.test.mjs +72 -72
- package/tests/humanlike.test.mjs +232 -232
- package/tests/hybrid-recall.test.mjs +610 -610
- package/tests/inbound.test.mjs +441 -441
- package/tests/inject-conflict.test.mjs +173 -173
- package/tests/inject-guide.test.mjs +513 -513
- package/tests/inject.test.mjs +384 -384
- package/tests/injection-budget-settings.test.mjs +35 -35
- package/tests/injection-budget.test.mjs +165 -165
- package/tests/injection-chain.test.mjs +442 -442
- package/tests/injection-intent-budget.test.mjs +92 -92
- package/tests/injection-rollback.test.mjs +428 -428
- package/tests/issue2-chain.test.mjs +169 -169
- package/tests/lexical-bm25.test.mjs +171 -171
- package/tests/lexicon-calibrate.test.mjs +48 -48
- package/tests/lexicon-dedupe.test.mjs +171 -171
- package/tests/lexicon-frequency.test.mjs +195 -195
- package/tests/lexicon-inject.test.mjs +459 -459
- package/tests/lexicon-perf.test.mjs +464 -464
- package/tests/lexicon-scope.test.mjs +256 -256
- package/tests/lexicon-ui.test.mjs +667 -667
- package/tests/lexicon.test.mjs +922 -922
- package/tests/lifecycle-audit.test.mjs +56 -0
- package/tests/loader-register.mjs +3 -3
- package/tests/loader.mjs +17 -17
- package/tests/local-embedding-entry.test.mjs +95 -95
- package/tests/local-embedding-env.test.mjs +51 -51
- package/tests/local-embedding-manager.test.mjs +494 -494
- package/tests/local-embedding-protocol.test.mjs +121 -121
- package/tests/local-embedding-worker.test.mjs +440 -440
- package/tests/local-vector-service.test.mjs +41 -0
- package/tests/maintenance-status.test.mjs +77 -0
- package/tests/maintenance.test.mjs +438 -0
- package/tests/managed-memory.test.mjs +1234 -1234
- package/tests/managed-runtime.test.mjs +72 -72
- package/tests/media-injection.test.mjs +225 -0
- package/tests/media.test.mjs +135 -135
- package/tests/memory-chain.test.mjs +169 -169
- package/tests/memory-fields.test.mjs +134 -134
- package/tests/memu-resident-route.test.mjs +130 -130
- package/tests/memu-resident.test.mjs +33 -33
- package/tests/migration-payload.test.mjs +40 -42
- package/tests/mock-llm.test.mjs +263 -225
- package/tests/mood.test.mjs +109 -109
- package/tests/multiprocess.test.mjs +29 -29
- package/tests/negation-polarity.test.mjs +135 -135
- package/tests/new-session-gate.test.mjs +617 -617
- package/tests/open-loop-date.test.mjs +416 -416
- package/tests/ops-hardening.test.mjs +209 -209
- package/tests/package-shipping.test.mjs +88 -88
- package/tests/pending-injection.test.mjs +107 -107
- package/tests/port-surface.test.mjs +138 -138
- package/tests/preset-mount.test.mjs +132 -0
- package/tests/preset-scope.test.mjs +212 -212
- package/tests/private-links.test.mjs +493 -493
- package/tests/prompt-semantics.test.mjs +51 -51
- package/tests/prompts.test.mjs +315 -315
- package/tests/query-decompose.test.mjs +62 -62
- package/tests/react-snapshot.test.mjs +24 -24
- package/tests/recall-bench.test.mjs +317 -317
- package/tests/recall-cache.test.mjs +292 -292
- package/tests/recall-corpus-eligibility.test.mjs +51 -51
- package/tests/recall-dedup.test.mjs +446 -446
- package/tests/recall-intent.test.mjs +172 -172
- package/tests/regression-sweep.test.mjs +311 -311
- package/tests/reminder-fairness.test.mjs +55 -0
- package/tests/remote.test.mjs +140 -140
- package/tests/rename.test.mjs +30 -30
- package/tests/repetition-detector-snapshot.test.mjs +231 -231
- package/tests/repetition-eval-live.test.mjs +177 -177
- package/tests/repetition-eval.test.mjs +373 -373
- package/tests/salience-domain.test.mjs +173 -173
- package/tests/salient-date.test.mjs +142 -142
- package/tests/salient-wake.test.mjs +389 -389
- package/tests/settings-beat.test.mjs +222 -222
- package/tests/settings-coverage.test.mjs +97 -97
- package/tests/settings-plumbing.test.mjs +79 -79
- package/tests/short-term.test.mjs +182 -166
- package/tests/sidebar-beat.test.mjs +213 -213
- package/tests/sidebar-refresh.test.mjs +123 -123
- package/tests/sidebar.test.mjs +102 -74
- package/tests/simulate-injection.test.mjs +76 -76
- package/tests/slot-similarity.test.mjs +153 -153
- package/tests/snippet.test.mjs +79 -79
- package/tests/source-kind.test.mjs +52 -52
- package/tests/speaker-provenance.test.mjs +120 -120
- package/tests/stale-maintenance.test.mjs +206 -131
- package/tests/state-gc.test.mjs +34 -34
- package/tests/state.test.mjs +155 -155
- package/tests/stats.test.mjs +112 -112
- package/tests/storage.test.mjs +125 -125
- package/tests/stubs/child-process-spy.mjs +14 -14
- package/tests/stubs/dsh-llm-pi-ai.js +13 -13
- package/tests/stubs/dsh-llm.js +5 -5
- package/tests/stubs/dsh-schedule.js +140 -140
- package/tests/stubs/dsh-session-query.js +26 -26
- package/tests/stubs/dsh-session.js +7 -7
- package/tests/stubs/dsh-tools.js +101 -101
- package/tests/temporal-repair.test.mjs +78 -0
- package/tests/temporal.test.mjs +124 -124
- package/tests/text-format.test.mjs +24 -0
- package/tests/tokenizer-v2.test.mjs +142 -142
- package/tests/tool-schema.test.mjs +126 -126
- package/tests/tools.test.mjs +810 -810
- package/tests/turn-log.test.mjs +487 -487
- package/tests/ui-defaults.test.mjs +57 -57
- package/tests/update-fields.test.mjs +138 -138
- package/tests/vector-gc.test.mjs +37 -37
- package/tests/vector-migration.test.mjs +810 -810
- package/tests/vector-profile.test.mjs +449 -449
- package/tests/visibility-migration.test.mjs +152 -152
- package/tests/webui-auth.test.mjs +963 -963
- package/tests/webui.test.mjs +421 -421
- package/tests/windows-env.test.mjs +89 -89
- package/tests/worker-lifecycle.test.mjs +1522 -1429
package/docs/host-api.md
CHANGED
|
@@ -1,137 +1,131 @@
|
|
|
1
|
-
# 宿主事实与 API 速查 — dsh-memu-memory
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
> §6.3「取 sessionId 的三种形状」是排错高频项,放在 `docs/troubleshooting.md` 附录 D。
|
|
6
|
-
|
|
7
|
-
## 6. 宿主事实与 API
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
### 6.1 DSH 没有 embedding 能力
|
|
11
|
-
|
|
12
|
-
`ctx.llm`(`LlmRuntime
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- `
|
|
27
|
-
- `
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
})
|
|
53
|
-
schedule.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
- `
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
schedule.
|
|
68
|
-
schedule.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
ctx.slots.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
| `0.2.2-alpha.3` | 2026-11-03 | vendor(cordis 4.1 / timer 1.2 / include 1.1)与新 schedule API 在这一版定型 |
|
|
133
|
-
| `0.2.2-rc.1` | 2026-11-05 | 真机通过:13 个 `memu_*` 工具、guide 注入 1 次、设置页/侧栏/RPC/新会话弹窗、0 console error;alpha.3→rc.1 在 memu 用到的宿主 `src` 上零改动 |
|
|
134
|
-
|
|
135
|
-
当前客户端启动图事实(0.2.2-rc.1 页面实测):`{"id":"dsh-memu-memory","inject":["@deepseek-ai/dsh-client-store","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-client-ui-sidebar-right"],"immediately":true}`;`inject` 里没有启动图行的包会被忽略,不是错误。
|
|
136
|
-
|
|
137
|
-
---
|
|
1
|
+
# 宿主事实与 API 速查 — dsh-memu-memory
|
|
2
|
+
|
|
3
|
+
本文汇总插件使用的宿主接口与能力探测方式。逐构建的核对等级见 `docs/host-versions.md`,适配流程见 `docs/host-adaptation.md`。
|
|
4
|
+
|
|
5
|
+
> §6.3「取 sessionId 的三种形状」是排错高频项,放在 `docs/troubleshooting.md` 附录 D。
|
|
6
|
+
|
|
7
|
+
## 6. 宿主事实与 API 速查
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### 6.1 DSH 没有 embedding 能力
|
|
11
|
+
|
|
12
|
+
`ctx.llm`(`LlmRuntime`)提供 stream、provider 和模型发现,不提供 embed 接口。宿主的 API gateway 是 RPC 通道,不是 OpenAI 兼容 embedding REST 服务;插件不能将共享 `/api` 用作向量服务。
|
|
13
|
+
|
|
14
|
+
本地向量能力由插件配置的受管运行时或独立 OpenAI 兼容 embedding 服务提供,不依赖宿主模型路由。外部服务可以使用单独的 baseURL 与凭据;远程 MemU 配置使用 `~/.memu/config.env`,不读取宿主 keychain。安装与配置见 `docs/env-and-commands.md`。
|
|
15
|
+
|
|
16
|
+
### 6.2 工作区注册表在宿主侧可读
|
|
17
|
+
|
|
18
|
+
`ctx.workspaceRegistry`:`list()`(同步)/ `get(id)` / `resolveByPath(path)` / `delete(id)` / `realpathNormalize`;`Workspace.path` 是 create 时 `fs.realpath` 规范化的值,与 `normalizeCwd` 同口径;`status()` 返回 `ok | missing-dir`,只查不改。
|
|
19
|
+
|
|
20
|
+
**关键**:从 DSH 删工作区**不删任何磁盘数据**(目录和 session log 都在),只取消注册。所以**记忆库归档必须看 registry 里还在不在,绝不能用 `fs.existsSync`**——文件夹被删 ≠ 从 DSH 移除,反之亦然。订阅 `ctx.on("domain/changed", ...)`(`dsh-storage-domain`),`change.domain === "workspace"` 时 `deleted` / order-put 就是移除信号。客户端侧服务名 `workspaceController`、命名空间 `workspace`,**没有 remote `list()`**,只有 `follow(signal)`。
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### 6.4 读历史会话与标题
|
|
24
|
+
|
|
25
|
+
- `ctx.sessionQuery.listSessions()` / `readSession()` / `observeSession()`。
|
|
26
|
+
- `SessionRecord` 只有 `{ header, live, persisted, formatStatus }`,**没有 title**。
|
|
27
|
+
- 标题走 `readTitleSnapshots(ids)` → 每项 `{ sessionId, status, value: { session, title? } }`,文本在 `value.title.title`;`status === "rejected"` 的项只有 `reason`。未命名会话没有 title 事件,UI 必须准备短 id 回退。
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### 6.5 fork、followup 与「等它跑完」
|
|
31
|
+
|
|
32
|
+
- 会话 fork:`ctx.sessions.fork(source, boundary?, childSessionId?)`——**source 必须 live**,同步返回 `Session`,不自己启动 agent,没有 parent/delivery。错误码 `SESSION_NOT_FOUND | SESSION_NOT_LIVE | SESSION_ALREADY_EXISTS | INVALID_BOUNDARY`。
|
|
33
|
+
- 历史会话整理走**种子重建**:`sessionQuery.readSession(id)` → `{ session, events, inheritedEventCount }` → `buildForkSeed(events, lastSeq)`(`@deepseek-ai/dsh-session`,可选 peer,动态 import)→ `ctx.agents.create({ sessionId, meta: { cwd, parentSession, isSeeded, agentPreset }, inheritedEventCount: lastSeq + 1, seed, agentOptions, signal })` → `{ agent, dispose }`。
|
|
34
|
+
- **fork 不继承父 Agent 的 options**:`agentOptions` 必须显式传顶层字段(不是 `meta`)。活跃会话取 `ctx.get("agents").get(id).session.requestHeader().config`;关闭会话取事件里最后一条 `request/header` 的 `data.header.config`。至少要有 `provider` / `model`(可带 `reasoningEffort`、`maxTokens`);两处都没有就不要创建 fork,否则标准预设会在首步因 `{{model}}` 无值而死。
|
|
35
|
+
- `agent.followup(msg)` 只入队并唤醒 driver,**返回 void**;`await agent.whenIdle()` 只表示 driver 停了,**不代表这一轮成功**。followup 前订阅 `ctx.on("session/event", (session, event) => ...)`,只认 `session === agent.session` 且 `event.type === "turn/end"`;`whenIdle` 后检查 `event.data.reason.kind === "completed"`,`error` / `aborted` / 没有 `turn/end` 都按失败处理,不能推进整理游标。fork 整理必须 `whenIdle` 后再 `dispose`。
|
|
36
|
+
- **followup 会把消息画在输入框上方**(可编辑/可删)——这就是「整理提示出现在待发栏」的原因。**v0.4 起所有整理走 fork(§3.11),后台作业一律不碰 followup**。
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### 6.6 定时器
|
|
40
|
+
|
|
41
|
+
`ctx.interval`(cordis 随作用域回收;没有才退回 unref 的 `setInterval`)是插件级周期清扫用的那一把。`ctx.schedule` 是**宿主任务表**,有两代 API,先探测再调用(`lib/salient-wake.js` 的 `scheduleFlavor()`)。
|
|
42
|
+
|
|
43
|
+
**0.2.2+ 宿主级任务表(日期唤醒使用这一代;2026-11-05 在 rc.1 核对)**
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
schedule.create({
|
|
47
|
+
title, // ≤120 字,非空
|
|
48
|
+
prompt, // 每次触发发送的正文
|
|
49
|
+
timing: { kind: 'at', at: { date: 'YYYY-MM-DD', time: 'HH:mm', time_zone: 'IANA|UTC' } },
|
|
50
|
+
target: { kind: 'session', sessionId }, // 省略则首次投递时新建会话
|
|
51
|
+
})
|
|
52
|
+
schedule.list({ limit: 500 }) // -> { items, shown, total, limit, offset },不是数组
|
|
53
|
+
schedule.edit({ id, action: 'delete' }) // 已结束的任务同样可以删
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- `ScheduleTiming` 另有 `after/at/every/daily/weekly/cron/rrule`;`at` 是 `AtInput = string | {date,time,time_zone}`,结构化形式三个字段都必填。
|
|
57
|
+
- 任务状态是 `active | paused | ended`;`paused` 是用户的显式暂停,不恢复。
|
|
58
|
+
- 投递是 `agent.followup(...)`,**会新开一整回合**,冷会话由 `sessionController.resolveAgent` 自动 resume;`source.kind === 'schedule'`,所以本插件的注入管线(只认真实 `user` 消息)不会在那一回合跑召回——prompt 必须自带全部上下文。
|
|
59
|
+
- `ctx.get('schedule')` 是**可选服务**:desktop / web 组合里有,别的宿主可能是 `undefined` 或抛错,必须 warn 后降级,不能让周期失败。
|
|
60
|
+
- 投递是 at-least-once,receipt 只证明进了 inbox;任务持久化在宿主的 `storages/schedule.json`,用户在宿主 schedule UI 里看得见、也能手删。
|
|
61
|
+
- subagent 会话被 `validateTarget` 拒绝(错误码 `subagent_session`),已归档会话是 `invalid_rule`。
|
|
62
|
+
|
|
63
|
+
**0.2.0–0.2.1 会话级提醒(日期唤醒不支持,探测后跳过)**
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
schedule.create(sessionId, { title, prompt, at: { ... } })
|
|
67
|
+
schedule.list({ sessionId }) // -> 数组
|
|
68
|
+
schedule.delete({ sessionId, id })
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
- 任务绑定单个会话;没有 `edit`,状态只有 `active | inactive`。`scheduleFlavor()` 用「有没有 `edit`」区分两代:有 → `global`,否则有 `delete` → `session`。
|
|
72
|
+
- 旧宿主上 `runSalientWakePass()` 返回 `{ skipped: 'schedule-api' }`,写一条 `stage:'schedule-api'` 的活动日志并只 warn 一次;被动注入不受影响。**不要**把新 API 的 `{title,prompt,timing,target}` 直接喂给旧 API——旧 `list` 必须逐会话调用。
|
|
73
|
+
|
|
74
|
+
事件:`ctx.on("agent/status", { agent, status })`,`AgentStatus = idle | running`;另有 `session/created`、`session/disposed`、`session/flush`;事件类型含 `turn/start`、`turn/end`(`step/*`、`user/message…`)与 `compaction/*`。**`turn/end` 不 await flush,不要在那里读存储;判 fork 成败只读事件对象本身。**
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### 6.7 RPC、slot 与注入折叠
|
|
78
|
+
|
|
79
|
+
```js
|
|
80
|
+
ctx.inject([connection, webServer], c => c.effect(() =>
|
|
81
|
+
c.webServer.register({ kind: prefix, path: /dsh-memu-memory, handler })));
|
|
82
|
+
// handler 内做 connection.requestRejection + envelope 编解码
|
|
83
|
+
ctx.slots.inject(settings.section, ...) // 设置页
|
|
84
|
+
ctx.inject([sidebarRightTabs], ...) + ctx.slots.register({ name: sidebar.right.pane.tab, key })
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
- 客户端当前 session:`sidebar.right.pane.tab` body 的 `sessionId` prop;客户端会话列表:`ctx.sessions.list`(`ObservableSnapshot`)。
|
|
88
|
+
- **库级授权回调(管理/standalone)**:宿主可提供 `c.connection.authorizeLibrary(req, { libraryId, operation })`。插件只接受严格的 `true`;缺失、`false`、非 `true` 或抛错都按 403 处理。嵌入式请求必须携带 `sessionId`,服务端用持久绑定的 `getSessionBinding(sessionId).libraryId` 与目标 `libraryId` 精确比较;显式 `libraryId`、URL、query 或客户端 token 都不是凭据。`operation` 目前为 `read`、`write`、`archive`、`delete`、`rename`、`restore`、`import`、`export`、`attachment.read`、`review.manage`。HTTP handler 先调用 `requestRejection(req)`;ZIP import 在迭代 request body / `importMediaStream` 前完成库授权。
|
|
89
|
+
- `listReviews`/`resolveReview` 是双作用域端点。带私有 `libraryId` 时遵循同一 session/callback 约束;无 `libraryId`(全局审核队列)时:嵌入式请求(携带 `sessionId`)可读队列,但 `resolveReview` 写操作要求该 `sessionId` 存在且绑定仍然有效(空/悬空 sessionId 一律 403);无 `sessionId` 的 standalone/管理请求必须通过 `authorizeLibrary(req, { libraryId: null, operation: 'review.manage' })`,宿主未实现该 operation 时 fail-closed(403)。`browseWall` 必须明确单库,不能无目标枚举私有库。
|
|
90
|
+
- **注入折叠是宿主自带的,不要自己做。** `dsh-client-ui-chat` 用 `ContextInjectionRow`(一个 `DisclosureRow`)渲染所有带 `source.kind` 的消息:折叠标题 `message.contextInjection`(跨会话召回为 `message.contextRecall`)。宿主认识的 `KNOWN_FORMS = instructions | catalog | snapshot | notice | relay | recall`;表外的 form 走 opaque,仍会折叠。
|
|
91
|
+
- producer label 就是 **kind 原文**(如 `plugin:dsh-memu-memory`),不可自定义。`form: recall` 只有在 `kind: session-reference` + `references[].label` 时才走专门的召回正文;本插件用 `recall` 只是拿一个折叠行,要一行可读的折叠摘要就用 `form: notice` + `source.summary`。
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### 6.8 预设工具面与 guide 的验证边界
|
|
96
|
+
|
|
97
|
+
工具注册、模型可见工具表和 guide 投放是三个独立事实,验证时需要分别观察。
|
|
98
|
+
|
|
99
|
+
#### 标准会话
|
|
100
|
+
|
|
101
|
+
检查 `request/header.data.header.tools` 中实际发送给模型的工具名,不使用插件注册表代替该字段。guide 与动态记忆均为独立 plugin 消息,不属于 system prompt 段。应以唯一消息 id 统计投放,同一消息在快照中的重复出现不算重复注入。
|
|
102
|
+
|
|
103
|
+
#### 独立预设
|
|
104
|
+
|
|
105
|
+
最终工具名单由预设 bundle、宿主 scope 与工具限制共同决定;不能根据预设名称推断是否含有 `memu_*`。普通会话的注入监听与后台 fork/worker 的预设挂载、工具限制需要分别验证。验证使用隔离示例预设,不依赖特定用户的预设名称或历史会话。
|
|
106
|
+
|
|
107
|
+
#### 适配层与未覆盖范围
|
|
108
|
+
|
|
109
|
+
`lib/preset-scope.js` 兼容 `{ agent, owner, ctx }` record、裸 agent 以及 `agents.get(sessionId)?.ctx` 回退。若宿主只返回裸 agent 且无法取得 context,应保留可观察的降级信号;fake agent 的结构用例不能替代宿主运行验证。
|
|
110
|
+
|
|
111
|
+
#### 不可推断
|
|
112
|
+
|
|
113
|
+
- 工具已注册不代表已向当前模型暴露;缺少 `request/header` 工具表时保留未知状态。
|
|
114
|
+
- guide 消息存在不代表 `memu_*` 工具存在;规则消息的适用条件与工具面分别检查。
|
|
115
|
+
- 后台整理应检查 `restrictWorkerTools` 后的最终工具表,不能只看预设自带工具或 attach 结果。
|
|
116
|
+
|
|
117
|
+
复核方法:对 `<home>/sessions/<bucket>/<sessionId>/session.v4.jsonl.zstd` 逐 frame 解压,只提取请求工具名、消息 id 和 guide/anchor 标记;不打印会话正文,不将快照中的重复记录计作多次投放。
|
|
118
|
+
|
|
119
|
+
### 6.9 宿主版本适配记录
|
|
120
|
+
|
|
121
|
+
完整流程与真机命令见 `docs/host-adaptation.md`;这里只留结论。
|
|
122
|
+
|
|
123
|
+
| 宿主构建 | 日期 | 结论 |
|
|
124
|
+
|---|---|---|
|
|
125
|
+
| `0.2.1-rc.3` | 2026-10-27 | 本文档的基线事实;但 §6.6 当时的 schedule 形状实际属于 `0.2.2`,1.2.6 已更正 |
|
|
126
|
+
| `0.2.2-alpha.3` | 2026-11-03 | vendor(cordis 4.1 / timer 1.2 / include 1.1)与新 schedule API 在这一版定型 |
|
|
127
|
+
| `0.2.2-rc.1` | 2026-11-05 | 已核对模型工具表、首轮 guide、设置页、侧栏、RPC 与新会话弹窗;alpha.3→rc.1 在插件使用的宿主 `src` 上未发现差异 |
|
|
128
|
+
|
|
129
|
+
当前客户端启动图事实(0.2.2-rc.1 页面实测):`{"id":"dsh-memu-memory","inject":["@deepseek-ai/dsh-client-store","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-client-ui-sidebar-right"],"immediately":true}`;`inject` 里没有启动图行的包会被忽略,不是错误。
|
|
130
|
+
|
|
131
|
+
---
|
package/docs/host-versions.md
CHANGED
|
@@ -1,120 +1,117 @@
|
|
|
1
|
-
# 宿主跨版本事实台账 — dsh-memu-memory
|
|
2
|
-
|
|
3
|
-
> **本文件是「哪个 DSH 构建被核对到哪一步、每个宿主面长什么样」的唯一归属。**
|
|
4
|
-
> 流程(怎么核对新宿主、真机怎么搭)在 `docs/host-adaptation.md`;宿主 API 的当前形状速查在
|
|
5
|
-
> `docs/host-api.md`;故障症状在 `docs/troubleshooting.md`。同一事实只写一次:那三份文件里凡是
|
|
6
|
-
> 逐版本的答案都指向本文,不再各存一份副本。
|
|
7
|
-
>
|
|
8
|
-
>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
|
21
|
-
|
|
22
|
-
| `0.2.
|
|
23
|
-
| `0.2.
|
|
24
|
-
| `0.2.
|
|
25
|
-
| `0.2.2-
|
|
26
|
-
| `0.2.2-rc.
|
|
27
|
-
| `0.2.2-rc.
|
|
28
|
-
| `0.2.2-rc.
|
|
29
|
-
| `0.2.
|
|
30
|
-
| `0.2.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
|
43
|
-
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
|
60
|
-
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
|
|
79
|
-
-
|
|
80
|
-
- `dsh.
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
|
90
|
-
|
|
91
|
-
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
`
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
6. `npm run check` 的 Gate 4 会拦:文档提到了没有台账行的构建、台账行缺证据等级、探测点符号
|
|
119
|
-
被改名、代码里混进**带预发布号的宿主构建名**(裸 `0.2.0` 不算——本仓库里它是别的工件的版本,
|
|
120
|
-
比如 tokenizers crate)、指纹引用了未注册的面ID、`package.json` 的 `dshReleases` 与台账不一致。
|
|
1
|
+
# 宿主跨版本事实台账 — dsh-memu-memory
|
|
2
|
+
|
|
3
|
+
> **本文件是「哪个 DSH 构建被核对到哪一步、每个宿主面长什么样」的唯一归属。**
|
|
4
|
+
> 流程(怎么核对新宿主、真机怎么搭)在 `docs/host-adaptation.md`;宿主 API 的当前形状速查在
|
|
5
|
+
> `docs/host-api.md`;故障症状在 `docs/troubleshooting.md`。同一事实只写一次:那三份文件里凡是
|
|
6
|
+
> 逐版本的答案都指向本文,不再各存一份副本。
|
|
7
|
+
>
|
|
8
|
+
> 构建、证据等级与结构指纹集中维护,其他文档引用本文,避免兼容结论重复后产生漂移。
|
|
9
|
+
|
|
10
|
+
## 13.1 核对台账
|
|
11
|
+
|
|
12
|
+
一构建一行。「核对方式」只有三种取值:`真机`(跑过 `docs/host-adaptation.md` §3.5 四件套)、
|
|
13
|
+
`源码`(对该 tag 逐面重读 `git show <tag>:<path>`)、`未测`。**跨补丁线即使结论相同也另起一行**:
|
|
14
|
+
一行结论是**在那个 commit 上读出来的**,"这条线也一样"这句话必须由该行自己写一遍并带上依据。
|
|
15
|
+
「判定」:`exact` = 本行单独核对过;`line` = 同补丁线另一 tag 的结论沿用(必须在备注点名是哪个);
|
|
16
|
+
`nearest` = 未核对,按最近一行执行。**这三档只是人工记账口径,代码不读它**(见 §13.6)。
|
|
17
|
+
|
|
18
|
+
| 宿主构建 | commit | 核对方式 | 判定 | 日期 | 结构指纹 | 未覆盖面 / 依据 |
|
|
19
|
+
|---|---|---|---|---|---|---|
|
|
20
|
+
| `0.2.0-rc.1` | `4878cdabd8` | 源码 | exact | 2026-11-26 | `rpcGuard=requestRejection;schedule=session;activation=nested;coldLog=session-query` | 真机、客户端面;早于 `engines.dsh` 下界,只作历史基线 |
|
|
21
|
+
| `0.2.1-rc.3` | `1f81c047fc` | 源码 | exact | 2026-11-26 | `rpcGuard=requestRejection;schedule=session;activation=nested;coldLog=session-query` | 真机;`docs/host-api.md` 的 2026-10-27 基线 |
|
|
22
|
+
| `0.2.1-rc.5` | `b830ec950f` | 源码 | exact | 2026-11-26 | `rpcGuard=requestRejection;schedule=session;activation=nested;coldLog=session-query` | 真机;0.2.1 线尾 |
|
|
23
|
+
| `0.2.2-alpha.3` | `05b1cae8db` | 源码 | exact | 2026-11-03 | `rpcGuard=requestRejection;schedule=global;activation=nested;coldLog=session-query` | 真机;schedule 新形状在此定型 |
|
|
24
|
+
| `0.2.2-rc.1` | `66491b05e3` | 真机 | exact | 2026-11-05 | `rpcGuard=requestRejection;schedule=global;activation=nested;coldLog=session-query` | 桌面壳标题栏、`startActivation` 全作业(§5.4) |
|
|
25
|
+
| `0.2.2-rc.2` | `ddac96760b` | 源码 | exact | 2026-11-26 | `rpcGuard=requestRejection;schedule=global;activation=flat;coldLog=session-query` | 真机;**扁平 `SubagentActivationSpec` 首发** |
|
|
26
|
+
| `0.2.2-rc.3` | `38a6a5c965` | 源码 | exact | 2026-11-26 | `rpcGuard=requestRejection;schedule=global;activation=flat;coldLog=session-query` | 真机;逐面重读与 rc.2 逐项相同(同线,但本行自带依据) |
|
|
27
|
+
| `0.2.2-rc.4` | `3f321d32bf` | 源码 | exact | 2026-11-26 | `rpcGuard=requestRejection;schedule=global;activation=flat;coldLog=session-query` | 未覆盖:真机运行 |
|
|
28
|
+
| `0.2.2-rc.5` | `9c2670d3bc` | 源码 | exact | 2026-11-26 | `rpcGuard=requestRejection;schedule=global;activation=flat;coldLog=session-query` | **真机四件套未跑** |
|
|
29
|
+
| `0.2.3-alpha.1` | `d98f5d6851` | 源码 | exact | 2026-11-26 | `rpcGuard=admit;schedule=global;activation=flat;coldLog=session-query` | 真机;**`requestRejection` 在此移除** |
|
|
30
|
+
| `0.2.3-alpha.2` | `4b399c39a6` | 源码 | exact | 2026-11-26 | `rpcGuard=admit;schedule=global;activation=flat;coldLog=session-query` | 真机;源码仓库 HEAD |
|
|
31
|
+
|
|
32
|
+
**这张表怎么读**:指纹相同 = 本插件的行为相同;指纹不同 = 必须看 §13.3 的那一行。
|
|
33
|
+
`0.2.2-rc.5` 与 `0.2.3-alpha.1` 只差一个 `rpcGuard`,但那正是「RPC 有没有越权守卫」的差别。
|
|
34
|
+
|
|
35
|
+
## 13.2 宿主面事实矩阵
|
|
36
|
+
|
|
37
|
+
一面一行。「落点」列是插件里的探测点,`scripts/check-doc-drift.mjs` Gate 4c 会核对它仍然存在;
|
|
38
|
+
「形状」列的取值域见 §13.3。新增一个探测面 = 加一行 + 在 §13.1 的指纹里带上它的键。
|
|
39
|
+
|
|
40
|
+
| 面ID | 宿主表面 | 探测判据 | 落点 | 缺失时的降级与信号 | 形状 |
|
|
41
|
+
|---|---|---|---|---|---|
|
|
42
|
+
| `rpcGuard` | RPC 入口的来源判定 | `requestRejection` → `admit` → `isTrustedApiRequest`(三级,均按存在性) | `lib/rpc.js:requestRejectionOf` | 三者都没有 = 放行 + 一次性 warn(不 fail closed) | `requestRejection` ≤0.2.2-rc.5 / `admit` ≥0.2.3-alpha.1 |
|
|
43
|
+
| `schedule` | `ctx.schedule` 定时器 | `typeof schedule.edit === 'function'` → 全局级,否则 `delete` → 会话级 | `lib/salient-wake.js:scheduleFlavor` | 都没有 = 跳过日期唤醒 + 一行日志,不每轮撞同一错误 | `session` ≤0.2.1-rc.5 / `global` ≥0.2.2-alpha.3 |
|
|
44
|
+
| `activation` | `subagents.startActivation` 规格 | `rootOf` 或 `namesOf` 存在 → 扁平;否则嵌套 | `lib/curator.js:activationUsesFlatSpec` | 形状猜错被 `TypeError` 拒绝时换另一形状重试一次 | `nested` ≤0.2.2-rc.1 / `flat` ≥0.2.2-rc.2 |
|
|
45
|
+
| `coldLog` | 冷读会话日志 | 候选模块逐个 import + 导出存在性 | `lib/consolidation-snapshot.js:COLD_LOG_MODULES` | 全部失败 = 只读活视图 + `COLD_LOG_READER_UNAVAILABLE` | `session-query`(0.2.0 → 0.2.3 全部命中第一候选) |
|
|
46
|
+
| `tools` | `defineTool` + `ctx.tools.register` | 方法存在性 | `lib/tools.js:toolBase` | 注册不上就少几个工具,不崩 | 全构建一致 |
|
|
47
|
+
| `preStep` | `agent/pre-step` payload | `payload.agent` 形状,不读版本号 | `lib/inject.js:registerInjection` | 取不到 session 就跳过注入并留 `lastRecallError` | 全构建一致(0.2.2 起多带 `modelSelection`,本插件不读) |
|
|
48
|
+
| `userMessage` | `createUserMessage` | 函数存在性 | `lib/inject.js:registerInjection` | 没有就无法注入,走 fail-open + warn | 全构建一致 |
|
|
49
|
+
| `sessions` | `sessionQuery` 的 list/read/observe | 方法存在性 | `lib/rpc.js:authorizeWithCapability` | 缺方法 = 该视图降级为空 + 可见告警 | 全构建一致 |
|
|
50
|
+
| `workspace` | `workspaceRegistry` + `domain/changed` | 服务与方法存在性 | `lib/rpc.js` + `lib/cycle.js:runLibraryHousekeeping` | 拿不到注册表 = 不归档(1.3.14 的在用判据兜住) | 全构建一致 |
|
|
51
|
+
| `attachment` | `attachments.readImage` | 方法存在性 | `lib/media.js:readImage` | 缺 = 图片不入库,正文照常 | 全构建一致 |
|
|
52
|
+
|
|
53
|
+
## 13.3 破坏性变更账本
|
|
54
|
+
|
|
55
|
+
只登记**确实改变插件行为**的项。「探测失效后果」写的是不修会怎样——这一列是这套探测存在的理由。
|
|
56
|
+
|
|
57
|
+
| 变更 | 首个构建 | 上一构建 | 新形状 | 旧形状 | 插件的探测分支 | 探测失效的后果 | 守卫用例 |
|
|
58
|
+
|---|---|---|---|---|---|---|---|
|
|
59
|
+
| `SubagentActivationSpec` 扁平化,同批新增树内省方法 | `0.2.2-rc.2` (`ddac96760b`) | `0.2.2-rc.1` (`66491b05e3`) | `parent`/`cwd`/`prompt`/`agentOptions` 平铺顶层;新增 `rootOf`/`namesOf`/`resolveName`/`waitForTreeWork` | `{ parent, request: { … } }` | `activationUsesFlatSpec()` 按标记方法选形,另带零副作用 `TypeError` 单次回退 | 每个整理 fork 种子被宿主拒收,整理静默停摆 | `tests/curator-contract.test.mjs` |
|
|
60
|
+
| `ctx.schedule` 会话级 → 宿主级 | `0.2.2-alpha.3` (`05b1cae8db`) | `0.2.1-rc.5` (`b830ec950f`) | `create(request)`、`list()→{items}`、`edit({id, action:'delete'})` | `create(sessionId, request)`、`list({sessionId})→数组`、`delete({sessionId,id})` | `scheduleFlavor()` 返回 `global`/`session`/`null` | 把 sessionId 当 request 传 → 排到错误目标或每次 sweep 抛错 | `tests/salient-wake.test.mjs` |
|
|
61
|
+
| `connection.requestRejection` 移除 | `0.2.3-alpha.1` (`d98f5d6851`) | `0.2.2-rc.5` (`9c2670d3bc`) | 只剩 `admit(request): {peer} \| {rejection:401\|403\|503}`;`isTrustedApiRequest` 只在模块层 | `requestRejection(req)` 返回 401/403/undefined | `requestRejectionOf()` 三级探测(`admit` 一级新增) | **全部 RPC 路由对任何来源放行**,而日志一句错都没有 | `tests/webui-auth.test.mjs` |
|
|
62
|
+
| `decision.messages` 只在首次尝试追加 | 全构建(`agent-loop/src/agent.ts` 的 `firstAttempt`) | — | 压缩后重试不再重放 decision 消息 | — | 插件按「紧跟人类消息之后」落点,不依赖重放 | 以为规则消息每步都在,实际只在首轮 | `tests/injection-chain.test.mjs` |
|
|
63
|
+
|
|
64
|
+
**稳定接口事实**:
|
|
65
|
+
|
|
66
|
+
1. `@deepseek-ai/dsh-session-query` 的目录**从 0.2.0 起就是嵌套的**
|
|
67
|
+
(`packages/session-query/session-query/src/cold-read.ts`)。检索时应覆盖嵌套包目录,
|
|
68
|
+
插件的 `COLD_LOG_MODULES` 保留对应候选。
|
|
69
|
+
2. `connection.authorizeLibrary` **在任何已核对的宿主上都不存在**。
|
|
70
|
+
它是插件预留的可选授权钩子,不能作为已核对宿主中的现有能力来依赖。
|
|
71
|
+
|
|
72
|
+
## 13.4 装载与门禁
|
|
73
|
+
|
|
74
|
+
- 宿主在 `engines.dsh` 存在时**只看它**做加载门禁(`app-boot/plugin-compatibility.ts`),
|
|
75
|
+
`peerDependencies` 里的 `@deepseek-ai/dsh-*` 不参与拦截。本插件 `engines.dsh` = `>=0.2.0-rc.1`。
|
|
76
|
+
- **红线:不收窄、不加下界、不 fail closed。** 门禁写错 = 插件整包不加载,且界面上没有提示。
|
|
77
|
+
- `dsh.compatibility.dshReleases` 是给人(和市场页)看的记录,**宿主产物里没有消费者**;值沿用
|
|
78
|
+
§13.1 里判定为 `exact`/`line` 的构建,Gate 4f 保证两处不打架。
|
|
79
|
+
- 装或更新插件后必须**重启宿主**:兼容检查发生在组装 profile 时,不在更新时。
|
|
80
|
+
- `dsh.bundle.patch` 指向 `cordis.patch.yml`,其 `insert` 行必须保留显式 `id`(匿名行在父配置
|
|
81
|
+
重写后会重启)。
|
|
82
|
+
- 新增运行时文件必须同时进 `package.json` 的 `files` 与 `exports`:本仓库 `lib/` 就是发布物。
|
|
83
|
+
|
|
84
|
+
## 13.5 未决与假设
|
|
85
|
+
|
|
86
|
+
| 假设 | 若错会怎样 | 怎么验证 |
|
|
87
|
+
|---|---|---|
|
|
88
|
+
| 0.2.3 线只改了 `rpcGuard`,其余面不变 | 新宿主上某条链路静默降级 | 在 `0.2.3-alpha.2` 上跑一次 §3.5 四件套,台账行改 `真机` |
|
|
89
|
+
| `admit(req)` 接受 Node `IncomingMessage`(`headers`/`method`/`url`/`socket` 字段够用) | 守卫恒放行或恒拒绝 | 真机一次 `curl` 对照;用例只证明插件侧的探测顺序 |
|
|
90
|
+
| `sessionPersistence` 的公开读侧与 `readColdSessionLog` 内部实现一致 | 冷读退化成活视图 → 快照冻结 | `docs/troubleshooting.md` §3.29 的路线;保留候选探测与降级信号 |
|
|
91
|
+
| 预设工具面在真机上的可见边界 | 整理 worker 少工具 | `docs/host-api.md` §6.8 |
|
|
92
|
+
|
|
93
|
+
## 13.6 运行时结构指纹
|
|
94
|
+
|
|
95
|
+
台账是人工记账,代码不读版本号(AGENTS.md §1 规则 1)。为了让「这台宿主实际走了哪条分支」可核对,
|
|
96
|
+
`getState()` 返回一个只读 `hostSurface` 块(`lib/host-surface.js`),内容就是 §13.2 各探测面在本次
|
|
97
|
+
装载中真正命中的形状,键与台账的指纹列一一对应:
|
|
98
|
+
`{ rpcGuard:'admit', schedule:'global', activation:'flat', coldLog:'session-query' }`。
|
|
99
|
+
|
|
100
|
+
用法:将运行时指纹与 §13.1 对应构建比较;不一致时重新核对目标构建与能力探测结果。
|
|
101
|
+
值全部来自既有探测函数(`requestRejectionOf` 的三级判断、`scheduleFlavor`、
|
|
102
|
+
`activationUsesFlatSpec`、`COLD_LOG_MODULES` 的命中项),本模块不做任何分支、不读版本号,
|
|
103
|
+
没探到的面显示 `unknown`。WebUI 的诊断页顶部环境自检卡把它与引擎/向量代际并列显示。
|
|
104
|
+
|
|
105
|
+
## 13.7 维护本文件
|
|
106
|
+
|
|
107
|
+
1. **新构建发布**:先跑 `docs/host-adaptation.md` §3.1–§3.5;然后在本表加一行(commit 用
|
|
108
|
+
`git rev-parse --short <tag>^{commit}`,不要写 HEAD),核对方式据实填。
|
|
109
|
+
2. 逐面重读时只对 §13.2 已注册的面取证;证据命令是 `git show <tag>:<path>`,**不要用当前
|
|
110
|
+
checkout 回答旧 tag 的问题**(§13.3 的两条误判就是这么来的)。
|
|
111
|
+
3. 只有出现**新的探测分支**才动 §13.2/§13.3;指纹没变的新构建只加一行台账。
|
|
112
|
+
4. 新增宿主面 = §13.2 一行 + §13.1 每行指纹补一个键 + 一条探测用例。
|
|
113
|
+
5. 废弃旧构建要连根删:台账行、矩阵里的形状、`package.json` 的 `dshReleases`、README 兼容段落
|
|
114
|
+
一起清,不留"引用了不存在事实"的行。
|
|
115
|
+
6. `npm run check` 的 Gate 4 会拦:文档提到了没有台账行的构建、台账行缺证据等级、探测点符号
|
|
116
|
+
被改名、代码里混进**带预发布号的宿主构建名**(裸 `0.2.0` 不算——本仓库里它是别的工件的版本,
|
|
117
|
+
比如 tokenizers crate)、指纹引用了未注册的面ID、`package.json` 的 `dshReleases` 与台账不一致。
|