/** * ConduitClient — High-level agent messaging that wraps a Transport adapter. * * This is the WHAT layer: send messages, subscribe to events, manage presence. * The Transport adapter (HttpTransport, LocalTransport, etc.) handles the HOW. * * @see docs/specs/SIGNALDOCK-UNIFIED-AGENT-REGISTRY.md Section 4.3 * @task T177 */ import type { AgentCredential, Conduit, ConduitMessage, ConduitSendOptions, ConduitSendResult, ConduitState, ConduitTopicPublishOptions, ConduitTopicSubscribeOptions, ConduitUnsubscribe, Transport } from '@cleocode/contracts'; /** ConduitClient wraps a Transport, adding high-level messaging semantics. */ export declare class ConduitClient implements Conduit { private transport; private credential; private state; /** Create a ConduitClient backed by the given transport and credential. */ constructor(transport: Transport, credential: AgentCredential); /** The agent ID from the bound credential. */ get agentId(): string; /** Current connection state (disconnected → connecting → connected | error). */ getState(): ConduitState; /** Connect the underlying transport using the bound credential. */ connect(): Promise; /** Send a message to another agent, optionally within a thread. */ send(to: string, content: string, options?: ConduitSendOptions): Promise; /** One-shot poll for new messages. Delegates to the transport's poll method. */ poll(options?: { limit?: number; since?: string; }): Promise; /** Subscribe to incoming messages. Uses real-time transport when available, else polls. */ onMessage(handler: (message: ConduitMessage) => void): ConduitUnsubscribe; /** Send an empty heartbeat to maintain presence on the relay. */ heartbeat(): Promise; /** Check whether a remote agent is currently online via the cloud API. */ isOnline(agentId: string): Promise; /** * Subscribe this agent to a named topic for broadcast messages. * * Delegates to the underlying transport's `subscribeTopic()` method. * Only `LocalTransport` supports topic operations in this release; * calling this on transports that lack the method throws. * * @param topicName - Topic name, e.g. `"epic-T1149.wave-2"`. * @param options - Optional subscription filter. * @throws When the underlying transport does not support topic subscriptions. * @task T1252 */ subscribeTopic(topicName: string, options?: ConduitTopicSubscribeOptions): Promise; /** * Publish a message to a named topic (broadcast to all subscribers). * * @param topicName - Target topic name. * @param content - Human-readable message content. * @param options - Message kind and optional structured payload. * @returns Send result with the assigned message ID. * @throws When the underlying transport does not support topic publishing. * @task T1252 */ publishToTopic(topicName: string, content: string, options?: ConduitTopicPublishOptions): Promise; /** * Register a real-time handler for messages on a named topic. * * @param topicName - Topic name to watch. * @param handler - Callback invoked for each message. * @returns Unsubscribe function that stops delivery to this handler. * @throws When the underlying transport does not support topic handlers. * @task T1252 */ onTopic(topicName: string, handler: (message: ConduitMessage) => void): ConduitUnsubscribe; /** * Unsubscribe this agent from a named topic. * * @param topicName - Topic name to leave. * @throws When the underlying transport does not support topic unsubscription. * @task T1252 */ unsubscribeTopic(topicName: string): Promise; /** Disconnect the transport and reset state to disconnected. */ disconnect(): Promise; } //# sourceMappingURL=conduit-client.d.ts.map