1.6 KiB
1.6 KiB
kind, description
| kind | description |
|---|---|
| upgrade-guide | JSONL persistence uses a namespace plugin import; direct service-class construction and class type annotations must use the persistence service instead. |
Mount JSONL persistence through its plugin
English | 中文
Change
@deepseek-ai/dsh-session-persistence-jsonl exports a function plugin through named name, Config, and apply exports, with no default export. Default imports, direct construction, subclassing, instanceof, and class type annotations are affected. The plugin retains listeners and handles through the consumer unloads triggered by removing this provider; concurrent root disposal remains unordered. The sessionPersistence service API, YAML configuration, and stored files remain unchanged.
Migration
- Replace the default import with
import * as JsonlSessionPersistence from '@deepseek-ai/dsh-session-persistence-jsonl'. Existingctx.plugin(JsonlSessionPersistence, config)calls remain valid; replace direct construction with this mounting call. For dynamic imports, use the module namespace returned byawait import(...)instead of its.default. Consumers declareinject: ['sessionPersistence']and accessctx.sessionPersistence. - Use the
SessionPersistencetype from@deepseek-ai/dsh-session-persistencefor service annotations. Replace concrete-classinstanceofchecks and subclasses with consumers of that service; the concrete JSONL class is private. - Await plugin startup and confirm a session can be created, flushed, and reopened. Register asynchronous consumer cleanup in the scope that injects
sessionPersistenceso backend unloading waits for it.