/** * `ArtifactsClient` — observer for QAR's `artifact.add` envelopes. * * Artifacts are durable outputs from a task or sub-agent: files, * structured records, references the consumer can fetch later. The wire * payload is `JsonObject`-shaped today; consumers narrow against their * agent's known artifact schema. The filter helper below matches against * the two fields QAR's runtime exposes consistently (`kind`, `agent_id`). * * Observer-only **today**, bidirectional on the wire. QAR's * `BIDIRECTIONAL_KINDS` whitelist accepts `artifact.add` in either * direction; the SDK aligns its taxonomy in `envelopes.ts` accordingly. * The current SDK surface does not expose a client emitter — tool * handlers that need to write artifacts route them through the agent * loop on the QAR side. A future addition may surface * `ArtifactsClient.emit(...)` without a wire-contract change. */ import type { ArtifactAddEnvelope } from '../qar/envelopes.js'; import { KindObserverClient } from './observers.js'; import type { EventSubscription } from './observers.js'; /** * Best-effort filter for `artifact.add` envelopes. Each field, when set, * must equal the same-named field in the envelope payload. */ export interface ArtifactFilter { /** Match against `payload.kind` (artifact schema discriminator). */ readonly kind?: string; /** Match against `payload.agent_id` (the agent that produced the artifact). */ readonly agent_id?: string; } export type ArtifactHandler = (env: ArtifactAddEnvelope) => void; export declare class ArtifactsClient extends KindObserverClient<'artifact.add', ArtifactAddEnvelope> { /** * Register a handler invoked for every inbound `artifact.add` envelope. * * Same multi-handler / fan-out / throw-swallowing semantics as the other * observer surfaces. The two-arg overload accepts an `ArtifactFilter`; * only envelopes whose payload matches every set field invoke the handler. */ onArtifact(handler: ArtifactHandler): EventSubscription; onArtifact(filter: ArtifactFilter, handler: ArtifactHandler): EventSubscription; } //# sourceMappingURL=ArtifactsClient.d.ts.map