dsh-memu-memory 1.4.2 → 1.4.3
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 +169 -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 +79 -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 +1015 -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 +1586 -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 +124 -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 +1521 -1429
package/docs/host-adaptation.md
CHANGED
|
@@ -1,360 +1,339 @@
|
|
|
1
|
-
# 宿主版本适配手册 — dsh-memu-memory
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
>
|
|
7
|
-
> `docs/host-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
| `
|
|
31
|
-
| `agent/
|
|
32
|
-
| `
|
|
33
|
-
| `ctx.get('
|
|
34
|
-
| `ctx.get('
|
|
35
|
-
| `ctx.get('
|
|
36
|
-
| `ctx.get('
|
|
37
|
-
| `ctx.get('
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
| `
|
|
49
|
-
| `ctx.slots.inject('
|
|
50
|
-
| `ctx.
|
|
51
|
-
| `ctx.inject(['
|
|
52
|
-
| `ctx.
|
|
53
|
-
| `ctx.
|
|
54
|
-
| `ctx.
|
|
55
|
-
| `ctx.
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
git
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
'packages/core/
|
|
96
|
-
'packages/
|
|
97
|
-
'packages/
|
|
98
|
-
'packages/
|
|
99
|
-
'packages/
|
|
100
|
-
'packages/client/
|
|
101
|
-
'packages/client/
|
|
102
|
-
'packages/client/ui-
|
|
103
|
-
'packages/
|
|
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
|
-
|
|
133
|
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
- `
|
|
152
|
-
- `
|
|
153
|
-
- `
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
profiles/
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
-
|
|
220
|
-
- `
|
|
221
|
-
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
- `
|
|
234
|
-
- `
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
-
|
|
256
|
-
-
|
|
257
|
-
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
- `
|
|
270
|
-
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
-
|
|
277
|
-
|
|
278
|
-
-
|
|
279
|
-
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
2.
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
## 7. 版本记录
|
|
342
|
-
|
|
343
|
-
**已迁出**:逐构建的核对台账、逐宿主面的形状矩阵、破坏性变更账本统一写在
|
|
344
|
-
`docs/host-versions.md` §13.1–§13.3,本文件不再保存副本(原表断在 `0.2.2-rc.1`,而 §2 的
|
|
345
|
-
「核对结果」列又把 `connection.requestRejection` 说成「未变」——同一事实两处新旧不一,正是迁移的原因)。
|
|
346
|
-
本文只负责**怎么核对**:流程在 §3,真机搭法在 §4,陷阱在 §6。
|
|
347
|
-
|
|
348
|
-
---
|
|
349
|
-
|
|
350
|
-
## 8. 维护本文件
|
|
351
|
-
|
|
352
|
-
本文件讲流程,事实进 `docs/host-versions.md`。每适配一个新宿主:
|
|
353
|
-
|
|
354
|
-
1. 在 `docs/host-versions.md` §13.1 加一行(commit 取自 tag,核对方式据实填),并按 §13.7 的规则
|
|
355
|
-
决定是否要动 §13.2/§13.3。`npm run check` 的 Gate 4 会拦住漏行、漏证据等级和失效的探测点引用。
|
|
356
|
-
2. 若新增了宿主能力探测,补一条单测(例如 `tests/salient-wake.test.mjs` 的 `scheduleFlavor`),
|
|
357
|
-
并在 §13.2 注册这个面。
|
|
358
|
-
3. 若发现新的装载门或客户端契约,补进本文 §2 / §3 的清单,事实本身写进 §13.2。
|
|
359
|
-
4. 若某个旧结论被证明是错的,直接改 `docs/host-versions.md` 的正文并在 CHANGELOG 里说明,
|
|
360
|
-
不要留两套说法——**也不要在这份流程文档里另抄一份结论**。
|
|
1
|
+
# 宿主版本适配手册 — dsh-memu-memory
|
|
2
|
+
|
|
3
|
+
本手册提供可重复的宿主适配流程:固定目标构建,读取公开接口,在隔离环境验证,再根据证据修改插件。
|
|
4
|
+
|
|
5
|
+
> 这份文档只讲**宿主版本之间的适配流程**。逐构建的核对台账、逐宿主面的形状矩阵、破坏性变更账本在
|
|
6
|
+
> `docs/host-versions.md`(§13);改记忆语义、RPC、UI 的常规流程在 `docs/contributing.md`;
|
|
7
|
+
> 宿主 API 的当前事实速查在 `docs/host-api.md`。同一事实只写一次,冲突时以 §13 为准。
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. 适配原则
|
|
12
|
+
|
|
13
|
+
- 核对工具面、注入、RPC、设置页、侧栏、新会话入口与后台整理,不将单个测试结果外推到全部能力。
|
|
14
|
+
- 宿主差异按方法或字段存在性探测,不使用版本号比较决定运行分支。
|
|
15
|
+
- `ctx.schedule` 存在会话级与宿主级形状;日期唤醒只支持后者,不支持时保留降级信号。
|
|
16
|
+
- 各构建的 API 形状与验证等级以 `docs/host-versions.md` 为准。
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 2. memu 的宿主面清单(每次升级逐项过)
|
|
21
|
+
|
|
22
|
+
> 下表的「0.2.2-rc.1 核对结果」只是**当初那一版**的快照,不随后续宿主更新。**逐版本的当前答案在
|
|
23
|
+
> `docs/host-versions.md` §13.2**;两处冲突以 §13.2 为准。本节回答「有哪些面要过」,§13 回答「每个面在各版本长什么样」。
|
|
24
|
+
|
|
25
|
+
### 2.1 Node 半侧
|
|
26
|
+
|
|
27
|
+
| 面 | memu 里的落点 | 0.2.2-rc.1 核对结果 |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| `ctx.tools.register` + `defineTool` | `lib/tools.js` `toolBase()` | 工具注册与 `request/header` 的模型可见工具表需分别核对 |
|
|
30
|
+
| `agent/pre-step` | `lib/inject.js` `registerInjection()` | 未变;payload 新增 `modelSelection`(本插件不读) |
|
|
31
|
+
| `agent/status` / `session/event` / `session/disposed` | `lib/inject.js`、`lib/inbound.js` | 未变 |
|
|
32
|
+
| `ctx.get('agents')`(`list()` / `get()` / `create()`) | `lib/preset-scope.js`、`lib/private.js`、`lib/curator.js` | 未变;`Agent.ctx` 仍在 |
|
|
33
|
+
| `ctx.get('sessionQuery')`(`listSessions` / `readSession` / `observeSession` / `readTitleSnapshots`) | `lib/rpc.js`、`lib/private.js`、`lib/curator.js` | 包源码未变 |
|
|
34
|
+
| `ctx.get('workspaceRegistry')` / `domain/changed` | `lib/rpc.js`、`lib/cycle.js` | 未变 |
|
|
35
|
+
| `ctx.get('subagents').startActivation` | `lib/curator.js` | **0.2.2-rc.2 起形状变了**:`SubagentActivationSpec` 扁平化(`parent`/`cwd`/`prompt`/`agentOptions` 平铺顶层,移除 `request` 外层),同批新增树内省方法 `rootOf`/`namesOf`/`resolveName`/`waitForTreeWork`。插件按 §3.4 用标记方法做结构探测选形态,另带零副作用 `TypeError` 单次回退兜底(两代宿主都在任何副作用之前抛 `TypeError`);覆盖两代契约的用例在 `tests/curator-contract.test.mjs`。结果 `stopReason`/`output` 未变 |
|
|
36
|
+
| `ctx.get('attachments').readImage` | `lib/media.js` | 未变 |
|
|
37
|
+
| `ctx.get('schedule')` | `lib/salient-wake.js` | **变了**:见 §6.1 |
|
|
38
|
+
| `connection.requestRejection` / `authorizeLibrary` / `webServer.register` | `lib/rpc.js` | rc.1 当时是 `kind:'prefix'` + `handler`,守卫走 `requestRejection`;**`requestRejection` 自 `0.2.3-alpha.1` 起已从宿主移除,`authorizeLibrary` 任何版本都没有** → §13.3 |
|
|
39
|
+
| `ctx.interval` / `ctx.effect` / `ctx.on(..., {prepend})` | `lib/cycle.js`、`lib/index.js`、注入/监听 | cordis 4.1 未破坏这些用法 |
|
|
40
|
+
| `buildForkSeed`(动态 import `@deepseek-ai/dsh-session`) | `lib/private.js` | 仍从包根导出 |
|
|
41
|
+
| `createUserMessage({source:{kind:'plugin:dsh-memu-memory', form:'recall'}})` | `lib/inject.js` | 未变;`plugin:` 前缀仍被宿主接受 |
|
|
42
|
+
|
|
43
|
+
### 2.2 Client 半侧
|
|
44
|
+
|
|
45
|
+
| 面 | memu 里的落点 | 0.2.2-rc.1 核对结果 |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| `window.__ModuleLoader__.load({id, factory})` | `lib/client.js` 包壳 | 未变;宿主启动图里有 `dsh-memu-memory` |
|
|
48
|
+
| `ctx.slots.inject('settings.section')` + `register` | `lib/client.js` `apply()` | 未变;设置页出现「MemU 记忆」 |
|
|
49
|
+
| `ctx.slots.inject('sidebar.right.pane.tab')` + `register` | 同上 | 未变;右侧栏出现「MemU 记忆」 |
|
|
50
|
+
| `ctx.inject(['sidebarRightTabs'])` + `sidebarRightTabs.register({id,kind,title,guide})` | 同上 | 未变 |
|
|
51
|
+
| `ctx.inject(['betterSidebar'])`(可选第三方) | 同上 | 仍按可选服务处理 |
|
|
52
|
+
| `ctx.locale.register(NS, {zh,en})` / `bind` | 同上 | 运行时仍只要求两条基线语言 |
|
|
53
|
+
| `ctx.connection.rpc.call(prefix, method, payload)` | 同上 | 未变 |
|
|
54
|
+
| `ctx.sessions.list`(`byId` / `ids` 快照) | 同上 | 契约未变 |
|
|
55
|
+
| `ctx.get('sidebarRight').mounted` / `uiSession.adapter.current` | 同上 | 未变(仍作为当前会话来源) |
|
|
56
|
+
| `dsh.client` 清单(`platform:'web'`、`inject`、`immediately`) | `package.json` | 字段仍被识别;`inject` 里没有启动图行的包会被忽略(不是错误) |
|
|
57
|
+
|
|
58
|
+
### 2.3 装载与打包
|
|
59
|
+
|
|
60
|
+
| 面 | 检查点 |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `engines.dsh` / `peerDependencies` | 宿主门禁在 `engines.dsh` 存在时只看它;**不要收窄、不要加下界到新版本**,否则旧宿主整包不加载 |
|
|
63
|
+
| `dsh.bundle.patch` | `cordis.patch.yml` 的 `insert` 行仍被 include 1.1 接受;显式 `id` 必须保留(匿名行在父配置重写后会重启) |
|
|
64
|
+
| `files` / `exports` | 新增运行时文件必须两处都进;`lib/` 是提交内容(除图谱 bundle 外直接发布源码;图谱源码变更需重建产物) |
|
|
65
|
+
| `dsh.client` | `platform:'web'` + `exports['./client']`;客户端包只在 `platform` 匹配时进入启动图 |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 3. 新宿主发布时的标准流程
|
|
70
|
+
|
|
71
|
+
### 3.1 固定目标构建
|
|
72
|
+
|
|
73
|
+
先确认「新版本」到底是哪个构建:npm `dist-tags`(`latest` / `next` / `alpha`)与用户实际安装的 launcher `versions/<v>` 可能不是同一个。优先用**用户机器上真实存在的那个版本目录**做真机验证。
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npm view @deepseek-ai/dsh dist-tags
|
|
77
|
+
ls "<launcher>/versions/" # 真机事实
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
源码事实用 tag 固定,不要用浮动 master:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
cd "<host-source>"
|
|
84
|
+
git fetch origin tag dsh-v0.2.2-rc.1 --no-tags
|
|
85
|
+
git rev-parse dsh-v0.2.2-rc.1^{commit}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 3.2 只 diff memu 用到的包
|
|
89
|
+
|
|
90
|
+
先看规模,再读文件。测试目录的变更不算事实:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
git diff --stat dsh-v0.2.2-rc.5 dsh-v0.2.3-alpha.1 -- \
|
|
94
|
+
'packages/core/tools/src/**' 'packages/core/session/src/**' \
|
|
95
|
+
'packages/core/agent/src/**' 'packages/core/agent-loop/src/**' \
|
|
96
|
+
'packages/llm/llm/src/**' 'packages/session-query/*/src/**' \
|
|
97
|
+
'packages/schedule/schedule/src/**' 'packages/subagent/subagent/src/**' \
|
|
98
|
+
'packages/attachment/attachment/src/**' 'packages/host/webserver/src/**' \
|
|
99
|
+
'packages/client/modules/src/**' 'packages/client/locale/src/**' \
|
|
100
|
+
'packages/client/connection/src/**' 'packages/client/ui-settings/src/**' \
|
|
101
|
+
'packages/client/ui-chat/src/**' 'packages/client/remote-connection/src/**' \
|
|
102
|
+
'packages/client/ui-sidebar-right/src/**' 'packages/workspace/*/src/**' \
|
|
103
|
+
'packages/session/*/src/**' 'packages/api/session-controller/src/**'
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
路径必须兼容**两层包目录**:本仓库既有 `packages/core/tools/src/**`,也有
|
|
107
|
+
`packages/session-query/session-query/src/**` 和 `packages/workspace/workspace/src/**`。
|
|
108
|
+
检索清单应同时覆盖单层与嵌套的包目录,避免遗漏公开接口。
|
|
109
|
+
|
|
110
|
+
再跑一次全量比对,确认上面这张清单没有漏掉真正改动的包:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
git diff --stat <旧tag> <新tag> -- 'packages/*/src/**' 'packages/*/*/src/**' \
|
|
114
|
+
':(exclude)packages/*/vendor/**' ':(exclude)packages/*/*/vendor/**' > logs/host-source-diff.log 2>&1
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
两个数字差得远 = 清单漏了包,把漏掉的包补进上面那条命令再来一遍。读的时候按
|
|
118
|
+
「导出/契约/服务方法/事件 payload」四类看,不要逐行读实现;测试目录的变更不算事实。
|
|
119
|
+
**跨 tag 往往只有 `package.json` 版本号变化**:`0.2.2-alpha.3 → 0.2.2-rc.1` 在 memu 用到的全部
|
|
120
|
+
`src` 上就是零改动(vendor 代码在 alpha.3 已定型)。
|
|
121
|
+
|
|
122
|
+
### 3.3 四个装载门
|
|
123
|
+
|
|
124
|
+
1. `engines.dsh` 与 peers 是否仍满足(不要改门禁)。
|
|
125
|
+
2. `dsh.bundle.patch` 的 `insert` 行是否仍被解析(`--dump-config` 看得到 `dsh-memu-memory`)。
|
|
126
|
+
3. `dsh.client` 是否仍进入启动图(页面里的 `window.__DSH_BOOT__` / `plugins/??…`)。
|
|
127
|
+
4. 工具 DSL 是否仍接受 `lib/tools.js` 的 schema(真机 `request/header` 的工具名是最硬的证据)。
|
|
128
|
+
|
|
129
|
+
### 3.4 服务 / 事件 / 字段
|
|
130
|
+
|
|
131
|
+
按 §2 的表逐项问「这个名字还在吗、参数形状变了吗、返回值形状变了吗」。形状变化用**能力探测**处理:
|
|
132
|
+
|
|
133
|
+
- 首选「新方法存在与否」(如 `schedule.edit`);
|
|
134
|
+
- 其次「返回值是数组还是 `{items}`」;
|
|
135
|
+
- 最后才是「字段可选性」(`?.` + 默认值)。
|
|
136
|
+
|
|
137
|
+
不要写 `if (version >= '0.2.2')`。版本号解析在 Node 半边也拿不到客户端宿主版本,客户端更拿不到。
|
|
138
|
+
|
|
139
|
+
### 3.5 真机四件套
|
|
140
|
+
|
|
141
|
+
1. `--dump-config`:确认插件行在组合里。
|
|
142
|
+
2. 浏览器:页面能开、`style[data-dsh-memu-memory="ui"]` 在、设置页有「MemU 记忆」、右侧栏有「MemU 记忆」、新会话弹窗能关。
|
|
143
|
+
3. 页面内 RPC:`fetch('/dsh-memu-memory/getSettingsState', …)` 返回 `{ok:true}`。
|
|
144
|
+
4. Headless + mock LLM:执行真实宿主回合,检查预期工具名进入请求头、guide 按首轮规则投放,以及 `turn/end completed`。
|
|
145
|
+
|
|
146
|
+
搭法见 §4。**四条都跑过才算「适配完成」**;只跑 `npm test` 不算(它用 fake 宿主)。
|
|
147
|
+
|
|
148
|
+
### 3.6 记录
|
|
149
|
+
|
|
150
|
+
- `README.md` / `README.zh.md` 的兼容性表加「verified on …」。
|
|
151
|
+
- `docs/host-api.md` 更新对应小节;新发现的事实写进 §6.9。
|
|
152
|
+
- `CHANGELOG.md` 写清「验证了哪个构建、哪些面、哪些没测」。
|
|
153
|
+
- 在 `docs/host-versions.md` §13.1 记录构建、commit、核对等级和未覆盖面。
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## 4. 真机环境搭法(Windows)
|
|
158
|
+
|
|
159
|
+
### 4.1 用 launcher 的安装,不要临时 npm 装
|
|
160
|
+
|
|
161
|
+
`<launcher>/versions/<v>/node_modules/@deepseek-ai/dsh/lib/bin.js` 是完整宿主。临时 `npm install @deepseek-ai/dsh` 会拖入可选 AWS SDK(几百个包、几分钟到几十分钟),还容易被文件锁打断(`ENOTEMPTY` 半装)。适配验证优先用 launcher 已装版本。
|
|
162
|
+
|
|
163
|
+
### 4.2 隔离 home + 最小 profile
|
|
164
|
+
|
|
165
|
+
不要碰 `~/.dsh` 的真实记忆库。用 launcher 的独立 home:
|
|
166
|
+
|
|
167
|
+
```text
|
|
168
|
+
<launcher>/homes/0.2.2-rc.1/
|
|
169
|
+
profiles/memory-example/ # 只放 dsh-memu-memory
|
|
170
|
+
profiles/memory-example-headless/ # base + headless + memu,跑真实回合
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
profile 的 `package.json` 只列 memu;`@deepseek-ai/dsh-base` / `dsh-web-app` 由宿主安装解析。把插件**复制**到 `profiles/<p>/node_modules/dsh-memu-memory`(不要 junction,Windows 权限与清理更麻烦;复制也避免测试时改到源码)。
|
|
174
|
+
|
|
175
|
+
### 4.3 配一个本地假模型
|
|
176
|
+
|
|
177
|
+
`profiles/<p>/cordis.patch.yml`:
|
|
178
|
+
|
|
179
|
+
```yaml
|
|
180
|
+
- id: llm-pi-ai
|
|
181
|
+
name: '@deepseek-ai/dsh-llm-pi-ai'
|
|
182
|
+
config:
|
|
183
|
+
providers:
|
|
184
|
+
memu-mock:
|
|
185
|
+
displayName: MemU Mock
|
|
186
|
+
api: openai-completions
|
|
187
|
+
baseURL: http://127.0.0.1:8090/v1
|
|
188
|
+
headers:
|
|
189
|
+
Authorization: Bearer local-mock
|
|
190
|
+
models:
|
|
191
|
+
- id: dsh-mock-llm
|
|
192
|
+
name: MemU Mock (eval only)
|
|
193
|
+
contextWindow: 128000
|
|
194
|
+
maxTokens: 4096
|
|
195
|
+
reasoningEfforts: false
|
|
196
|
+
- id: agent-default-model
|
|
197
|
+
config:
|
|
198
|
+
provider: memu-mock
|
|
199
|
+
model: dsh-mock-llm
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
`- id/config` 是**整份替换**,不是合并;`provider`/`model` 必须写在 `config:` 下。非推理模型必须 `reasoningEfforts: false`,否则 `INVALID_CONFIG`(回合在发请求前中止,看起来像“没反应”)。
|
|
203
|
+
|
|
204
|
+
启动假端点:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
node scripts/mock-llm.mjs --port 8090 --log ./mock.jsonl
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### 4.4 Web 宿主与浏览器
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
DSH_HOME="<launcher>/homes/0.2.2-rc.1" \
|
|
214
|
+
node "<launcher>/versions/0.2.2-rc.1/node_modules/@deepseek-ai/dsh/lib/bin.js" \
|
|
215
|
+
memory-example --no-open --port 39430
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
- stdout 只打印一行 `dsh web: http://…/?token=…`;用唯一日志文件接住,别让后续启动把它截断。
|
|
219
|
+
- `GET /?token=…` 返回 303 换会话 cookie;curl 要 `-L -c/-b`。
|
|
220
|
+
- 页面里的 `plugins/??<pkg>/client.js&rev=…` 是**组合 URL**;直接请求 `/plugins/<pkg>/client.js` 可能 404,属正常。
|
|
221
|
+
- Playwright 管理的浏览器不可用时,可显式指定已安装浏览器的可执行文件,例如系统 Chrome:
|
|
222
|
+
`chromium.launch({ executablePath: 'C:/Program Files/Google/Chrome/Application/chrome.exe' })`。
|
|
223
|
+
- 首次启动会叠三个弹窗:宿主「预览版说明」、宿主「开始使用 / 登录或 API Key」、本插件的新会话弹窗。断言前先按文本关掉;它们不是插件缺陷。
|
|
224
|
+
- 本插件的新会话弹窗是 `[data-dsh-memu-memory-gate]` 下的 `[role=dialog]`,出现是设计行为。
|
|
225
|
+
|
|
226
|
+
### 4.5 读会话日志
|
|
227
|
+
|
|
228
|
+
会话日志在 `<home>/sessions/<project>/<sessionId>/session.v4.jsonl.zstd`,是**多个 zstd frame 拼接**;Node 的 `zstdDecompressSync` 一次性调用只解第一帧。用 `scripts/drive-session.mjs` 里的 `scanZstdFrames` 逐帧解。
|
|
229
|
+
|
|
230
|
+
断言的锚点:
|
|
231
|
+
|
|
232
|
+
- `request/header` → `data.header.tools` 的名字(数 `memu_*`);
|
|
233
|
+
- `user/message` → `source.kind === 'plugin:dsh-memu-memory'`、`source.form`、正文前缀 `<memory-guide` / `===== memory anchor =====`;
|
|
234
|
+
- `turn/end` → `data.reason.kind === 'completed'`。
|
|
235
|
+
|
|
236
|
+
### 4.6 Headless 跑一轮
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
DSH_HOME="<launcher>/homes/0.2.2-rc.1" \
|
|
240
|
+
node "<launcher>/versions/0.2.2-rc.1/node_modules/@deepseek-ai/dsh/lib/bin.js" \
|
|
241
|
+
memory-example-headless --json "Please remember that the sample project uses UTC timestamps."
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
headless 会禁用 `deepseek-account`;没有配假模型时会以 `MISSING_CREDENTIAL` 结束(不是插件问题)。
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## 5. 0.2.2-rc.1 的验证范围与复核方法
|
|
249
|
+
|
|
250
|
+
该构建的核对等级与结构指纹见 `docs/host-versions.md` §13.1。以下列出可复用的观察点。
|
|
251
|
+
|
|
252
|
+
### 5.1 页面 / RPC
|
|
253
|
+
|
|
254
|
+
- 通过一次性 token 换取 cookie 后检查页面可访问。
|
|
255
|
+
- 确认客户端启动图包含插件及所需 inject 依赖。
|
|
256
|
+
- 检查 `style[data-dsh-memu-memory="ui"]` 与浏览器控制台。
|
|
257
|
+
- 页面内调用 `/dsh-memu-memory/getSettingsState`,检查 HTTP 状态和 `{ok, value}` envelope。
|
|
258
|
+
|
|
259
|
+
### 5.2 UI 入口
|
|
260
|
+
|
|
261
|
+
确认设置页、右侧栏和新会话弹窗均可操作;将宿主首启弹窗与插件弹窗分别处理。
|
|
262
|
+
|
|
263
|
+
### 5.3 宿主回合(headless + mock)
|
|
264
|
+
|
|
265
|
+
检查 `request/header` 的 provider、model 与目标工具名;通过唯一消息 id 核对 guide 的投放;以 `turn/end.data.reason.kind === 'completed'` 判断成功。mock 端点只记录标记与计数,不输出会话正文或凭据。
|
|
266
|
+
|
|
267
|
+
### 5.4 结构兼容与未覆盖面
|
|
268
|
+
|
|
269
|
+
- `0.2.2-rc.1` 的 `assertAssistantSettlementShape` 要求 `assistant/message.data.stream` 为数组;种子清理应保留空数组。运行 `node scripts/check-seed-compat.mjs --session-pkg <host-session-lib>` 检查种子结构,再验证完整整理作业。
|
|
270
|
+
- 桌面壳的原生标题栏、全局整理的完整作业、日期唤醒的实际投递,以及旧库迁移需要单独验证;源码或 mock 结果不能代替这些覆盖。
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## 5.5 源码核对中的接口差异
|
|
275
|
+
|
|
276
|
+
`0.2.2-rc.5`、`0.2.3-alpha.1`、`0.2.3-alpha.2` 的逐面结论与 commit 见 `docs/host-versions.md` §13.1–§13.3。
|
|
277
|
+
|
|
278
|
+
- `@deepseek-ai/dsh-session-query` 使用嵌套目录 `packages/session-query/session-query/src/**`,检索时需覆盖该层级。
|
|
279
|
+
- `0.2.3-alpha.1` 起通过 `connection.admit(request)` 获取 `{peer}` 或 `{rejection}`;`isTrustedApiRequest` 是模块级函数,不能假定它挂在 service 上。插件按公开方法的存在性探测;无守卫时保留一次性 warn 与既有降级契约。
|
|
280
|
+
- `readColdSessionLog` 内部通过 `persistence.open(id, 'read')` 读取持久日志;插件保留候选模块探测与 `COLD_LOG_READER_UNAVAILABLE` 信号,不重复实现冷读适配器。
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## 6. 已知陷阱与取舍
|
|
285
|
+
|
|
286
|
+
### 6.1 `ctx.schedule` 两代 API
|
|
287
|
+
|
|
288
|
+
| 构建 | 方法形状 | 状态 |
|
|
289
|
+
|---|---|---|
|
|
290
|
+
| `0.2.2+` | `create(request)`、`list(request) -> {items}`、`edit({id, action:'delete'})` | memu 的日期唤醒使用这一代 |
|
|
291
|
+
| `0.2.0`–`0.2.1` | `create(sessionId, request)`、`list({sessionId}) -> 数组`、`delete({sessionId, id})` | 结构探测为 `session`,跳过并只 warn 一次 |
|
|
292
|
+
|
|
293
|
+
识别用 `scheduleFlavor()`(`lib/salient-wake.js`):有 `edit` → `global`;否则有 `delete` → `session`。**不要**用版本号;宿主可能回移/改名服务。
|
|
294
|
+
|
|
295
|
+
旧宿主上的行为是**有意降级**:返回 `{skipped:'schedule-api'}`,写一条 `stage:'schedule-api'` 的活动日志,被动注入仍然工作。不要为了“让旧宿主也能排程”去改 `create` 的参数形状——旧 API 的 `list` 必须逐会话调用,混用会把请求发给错误的目标。
|
|
296
|
+
|
|
297
|
+
### 6.2 首启弹窗不是插件故障
|
|
298
|
+
|
|
299
|
+
宿主会按本地状态弹「预览版说明」「开始使用」。它们都有全屏 mask,会拦截 Playwright 点击。先按文本点「继续」/关闭,再做断言。将环境弹窗与插件交互问题分别记录。
|
|
300
|
+
|
|
301
|
+
### 6.3 zstd 只解第一帧
|
|
302
|
+
|
|
303
|
+
`zlib.zstdDecompressSync` 一次性调用只返回第一帧;会话日志是多帧拼接。用 `scanZstdFrames`(`scripts/drive-session.mjs`)逐帧解,否则只能观察到日志的部分事件。
|
|
304
|
+
|
|
305
|
+
### 6.4 客户端启动图是组合 URL
|
|
306
|
+
|
|
307
|
+
页面里的 `plugins/??pkg/client.js,@…&rev=…` 是组合请求;单个包的直链 404 不代表没加载。看 `window.__DSH_BOOT__` 或启动图 JSON。
|
|
308
|
+
|
|
309
|
+
### 6.5 profile patch 的层级
|
|
310
|
+
|
|
311
|
+
`- id/config` 整份替换;`agent-default-model` 的 `provider`/`model` 在 `config` 下,不在条目顶层。写错层级不会报错,只会继续用默认 provider(然后 `MISSING_CREDENTIAL`)。
|
|
312
|
+
|
|
313
|
+
### 6.6 临时 npm 安装的代价
|
|
314
|
+
|
|
315
|
+
`@deepseek-ai/dsh` 的可选依赖会拖入 AWS SDK;`--omit=optional` 也未必完全跳过。用 launcher 已装版本,省时且与用户一致。
|
|
316
|
+
|
|
317
|
+
### 6.7 能力探测优先于版本判断
|
|
318
|
+
|
|
319
|
+
本插件已有的例子:`scheduleFlavor()`、`sessionQuery.observeSession` 存在性、`betterSidebar` 存在性、`sidebarRight.mounted` / `uiSession.adapter.current` 的逐级回退。新差异优先补一条这样的探测,而不是引入 `semver`。
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## 7. 版本记录
|
|
324
|
+
|
|
325
|
+
逐构建的核对台账、宿主形状矩阵与破坏性变更统一维护在 `docs/host-versions.md` §13.1–§13.3。本文只维护适配流程、隔离环境方法与已知接口约束,不复制执行记录。
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## 8. 维护本文件
|
|
330
|
+
|
|
331
|
+
本文件讲流程,事实进 `docs/host-versions.md`。每适配一个新宿主:
|
|
332
|
+
|
|
333
|
+
1. 在 `docs/host-versions.md` §13.1 加一行(commit 取自 tag,核对方式据实填),并按 §13.7 的规则
|
|
334
|
+
决定是否要动 §13.2/§13.3。`npm run check` 的 Gate 4 会拦住漏行、漏证据等级和失效的探测点引用。
|
|
335
|
+
2. 若新增了宿主能力探测,补一条单测(例如 `tests/salient-wake.test.mjs` 的 `scheduleFlavor`),
|
|
336
|
+
并在 §13.2 注册这个面。
|
|
337
|
+
3. 若发现新的装载门或客户端契约,补进本文 §2 / §3 的清单,事实本身写进 §13.2。
|
|
338
|
+
4. 若某个旧结论被证明是错的,直接改 `docs/host-versions.md` 的正文并在 CHANGELOG 里说明,
|
|
339
|
+
不要留两套说法——**也不要在这份流程文档里另抄一份结论**。
|