/** * `StateClient` — observer for QAR's `state.update` envelopes. * * State updates are per-skill mutations: a `skill` keys the schema and `op` * (`patch` / `replace` / `init`) describes the mutation kind. The payload * shape is typed by QAR (codegen overlay in `src/qar/payloads.ts`); the * filter helper here narrows by skill so consumers can wire one handler * per skill without de-multiplexing themselves. * * `state.update` is bidirectional in QAR's wire model; this surface is * server→client only (the inbound stream). SDK-side emission for * skill-managed state pushes is reserved for a future ticket. */ import type { StateUpdateEnvelope } from '../qar/envelopes.js'; import { KindObserverClient } from './observers.js'; import type { EventSubscription } from './observers.js'; /** Filter for `state.update` envelopes. */ export interface StateFilter { /** Match against `payload.skill` — the skill key whose state is mutating. */ readonly skill?: string; } export type StateHandler = (env: StateUpdateEnvelope) => void; export declare class StateClient extends KindObserverClient<'state.update', StateUpdateEnvelope> { /** * Register a handler invoked for every inbound `state.update` envelope. * * Same multi-handler / fan-out / throw-swallowing semantics as the other * observer surfaces. The two-arg overload accepts a `StateFilter` (only * `skill` for now — `op` would be cheap to add but we'd rather grow the * filter when consumers ask). */ onUpdate(handler: StateHandler): EventSubscription; onUpdate(filter: StateFilter, handler: StateHandler): EventSubscription; } //# sourceMappingURL=StateClient.d.ts.map