/** * `BulletinClient` — observer for QAR's `bulletin.post` envelopes. * * Bulletins are the wire shape behind multi-agent coordination: agents * publish findings on a shared board so peers can react without coupling * directly. The SDK side is read-only — consumers (Studio, dashboards) opt * into the stream; agents do not push bulletins from the client. * * The payload is `JsonObject`-shaped (the upstream type tightens once * QAR's bulletin work tightens). The filter helper below matches * against the two well-known fields QAR's runtime emits today * (`topic`, `agent_id`); they're optional and best-effort — a bulletin * lacking the field never matches the filter. */ import type { BulletinPostEnvelope } from '../qar/envelopes.js'; import { KindObserverClient } from './observers.js'; import type { EventSubscription } from './observers.js'; /** * Best-effort filter for `bulletin.post` envelopes. Each field, when set, * must equal the same-named field in the envelope payload. Bulletins whose * payload omits a filtered field do not match. */ export interface BulletinFilter { /** Match against `payload.topic` (QAR convention for board partitioning). */ readonly topic?: string; /** Match against `payload.agent_id` (the agent that posted the finding). */ readonly agent_id?: string; } export type BulletinHandler = (env: BulletinPostEnvelope) => void; export declare class BulletinClient extends KindObserverClient<'bulletin.post', BulletinPostEnvelope> { /** * Register a handler invoked for every inbound `bulletin.post` envelope. * * Multiple handlers per client are allowed; they fire in registration order. * A handler that throws is logged and the dispatch loop continues — the WS * stream is not affected. The returned `EventSubscription`'s `close()` * deregisters the handler. * * The two-arg overload accepts a `BulletinFilter`; only envelopes whose * payload matches every set field invoke the handler. */ onFinding(handler: BulletinHandler): EventSubscription; onFinding(filter: BulletinFilter, handler: BulletinHandler): EventSubscription; } //# sourceMappingURL=BulletinClient.d.ts.map