RPC types are defined in src/types/rpc.ts and snapshot-related fields in src/types/snapshot.ts.
Core concepts
IObservatorySnapshot: aggregated payload sent to the client panel.IObservatoryServerFunctions: host-side handlers (snapshot and command handling).IObservatoryClientFunctions: iframe-side event receiver methods.
Typical flow
- Runtime registries update state as instrumented events happen.
- Host plugin builds a fresh snapshot.
- Snapshot is sent over the bridge to the Observatory client.
- Client store updates panel views.
Stability note
Treat snapshot fields as an internal-but-documented contract for this module version line. When changing fields, update docs and tests in the same PR.
Payload inspector contracts
- Snapshot field:
payload(IPayloadInspectorSnapshot). keyslists payload entries withbucket,origin(ssr|csr),bytes, and a truncatedpreview.- Feature flag:
features.payloadInspector.
State / cookie contracts
- Snapshot field:
stateCookies(array ofIStateCookieEntry). - Each entry has
kind(useState|useCookie),key,origin, a truncatedpreview, and optional cookie option metadata. - Feature flag:
features.stateCookieTracker.
Pinia contracts
- Snapshot field:
piniaStores(array ofIPiniaStoreEntry). - Each store includes
state,timeline,dependencies, andhydrationTimeline. timelinecontains both action and mutation events withbeforeState,afterState, anddiff.
KeepAlive / Suspense contracts
- Snapshot field:
keepAlive(IKeepAliveSnapshot). eventsis an array ofIKeepAliveEntry(kindkeep-alive|suspense,phase, timings, optional cache metadata).cacheis an array ofIKeepAliveCacheEntry(statusactive|cached|evicted,hits).- Feature flag:
features.keepAliveTracker.
Pinia commands
clearPiniaStores: clears tracker timelines and dependency edges for all stores.editPiniaState(storeId, path, value): patches nested state paths in a store.
