import type { DeliveryOutcome, GlobalAgentMessage, ListedRuntimeObject, PermissionClassLabel, RuntimeAddress, RuntimeKind, RuntimeMessagingAdapter } from "./messaging-contract.js"; /** WS-10 §10.1's model-facing send, after the tool layer has validated `to` (≤300 chars, no newline, `"*"` forbidden). */ export interface SendMessageRequest { from: RuntimeAddress; /** The raw target string as the model wrote it. Resolution is the directory's job, never the caller's. */ to: string; body: string; summary?: string; notifyWhenIdle?: boolean; /** The tool call this send came from — WS-10 §12 derives the message id from (sender, tool call). */ originToolCallId?: string; } /** WS-15 §6.2. Lane B implements; the spine pins the signature. */ export interface GlobalMessaging { /** WS-10 §10.2: what this sender can reach right now. Never enumerates exited transcripts on disk. */ listReachable(scope: { from: RuntimeAddress; }): Promise; send(request: SendMessageRequest): Promise; deliver(message: GlobalAgentMessage): Promise; /** WS-10 §14's 12-hour idle subscription. */ notifyWhenIdle(target: RuntimeAddress, request: { from: RuntimeAddress; messageId: string; }): Promise; /** WS-10 §13's inbound class for a given object, as the policy matrix reads it. */ senderPermissionClass(address: RuntimeAddress): Promise; /** One adapter per runtime kind; registering the same kind twice replaces it. */ registerAdapter(kind: RuntimeKind, adapter: RuntimeMessagingAdapter): void; }