KeepLost/harniverse--packages-client-store ↗★ 1

@deepseek-ai/dsh-client-store

无React依赖的可观察与快照存储契约及共享引擎。 适合需要框架中立状态管理的客户端开发者,支持会话级实例。

套件
@deepseek-ai/dsh-client-store
相容性
待驗證
Harness 依賴範圍
workspace:^
Cordis 依賴範圍
workspace:^
版本
0.1.0-rc.5
授權
BSD-3-Clause
最近更新
2026年9月25日

同名套件的其他儲存庫

安裝

此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗

@deepseek-ai/dsh-client-store

English | 中文

React-free observable and snapshot-store primitives shared by Client controllers and renderer adapters. The package owns the framework-neutral store contracts (StoreSpec/StoreHandle/BakedActions, plus StorePersistence for validated projections) and the engine behind them: createSnapshotStore (zustand vanilla + subscribeWithSelector + Immer produce updates + dev freeze) with synchronous or animation-frame-batched publication, shallowEqual, and defineStore, which bakes an init/persist/actions literal into a handle whose create(scopeKey?) yields per-session or root-scope instances with draft-stripped actions and clearPersisted cleanup. Optional persist accepts either a whole-state key or a StorePersistence with select/restore. Engine products are bare observables — getSnapshot/subscribe/update/set, no selector hook; hook synthesis stays in web-react, which binds useStore from these sources at the binding site. ui-slots re-exports the slot-facing contract types; the runtime package re-exports the engine values for existing importers.

Model Experience

None, as this package provides browser-side state primitives and registers nothing model-facing.

KV Cache effect

None; the stores neither assemble nor send model requests.

Known Limitations and Deferred Work

  • Persistence is browser-local — persisted stores use JSON in localStorage; non-browser runtimes disable persistence, and the package provides no cross-device synchronization.
  • The persist key is the storage identity — multiple live instances created under the same resolved key share (and cross-pollute) one localStorage entry; instance uniqueness per key is the caller's responsibility (the framework caches one instance per handle × scope key).