@animastor/web-book-session
v0.1.0
Published
Book session identity contour for the Animastor web frontend. Single owner of the bookId/buildId identity signals, loadBook (the sanctioned identity mutator), the persisted localStorage session (write path + key contract), and the per-user stash/restore p
Maintainers
Readme
@animastor/web-book-session
Book session identity contour for the Animastor web frontend — the single owner of the open-book identity and its persistence.
Owns
bookId/buildIdsignals — one source of truth, no forkloadBook(id, build)— the only sanctioned identity mutator (persist on non-empty id, clear on empty —animastor:currentBook)stashBookSessionForUser(uid)/restoreStashedBookSessionForUser(uid)— per-user stash pair (animastor:currentBook:user:<uid>) used by authStore on logout/loginsetGenerationBuildId(build)— the controlled adapter through which the generation flow updatesbuildId(one signal, two legal writers:loadBook+ this adapter)readPersistedBookSession()— read-only view of the persisted session (used by fileStore'srestoreBookSession; the write path stays here)
Does NOT own
phase/errorMessage— shared session status (dual-writer contract); host-owned in generateStorerestoreBookSession()— File-flow orchestration; stays in fileStore- auth login/logout lifecycle — stays in authStore (this package never
imports authStore; the direction is
authStore → this package) - generation orchestration, playback, navigation — host side
Dependency rules (guard-pinned)
- Runtime dependency:
@preact/signalsONLY. - No imports of host stores,
api/client,app/*,pages/*, or any other@animastor/*package. - No module-global mutable state beyond the two exported signals.
Consumers reach the identity through the host's generateStore
compatibility re-exports — the consumer import surface is unchanged.
