/** * Claude Code channel delivery of run notices — the run-monitor App's automatic messages, sent by * the server instead of an iframe. Every MCP client has its own server instance (one per legacy * session in the daemon, one per `--in-process` connection), so "which client" is answered by * where the tool call ran: a session watches exactly the runs its own `run`, `resume`, and * `status` calls named. A restarted host re-attaches the same way — the agent asks, calls * `status`, and delivery resumes from that point. Nothing is persisted and nothing is replayed: * the tail starts at the current end of the run's event log, and the status response already * carried whatever happened before. * * Contract (Claude Code channels reference): the server declares * `capabilities.experimental["claude/channel"]` and emits `notifications/claude/channel` with * `content` plus identifier-keyed `meta`. Hosts without a handler drop the notification. Claude * Code registers a channel only over the legacy handshake, so modern instances never construct * this class. Terminal and paused notices come from the durable event-log tail, which follows a * run across daemon supersession exactly as `resources/subscribe` does; permission and setup * notices come from the in-process broker and lifecycle hooks. */ import type { McpServer } from "@modelcontextprotocol/server"; import type { RunStoreRouter } from "./project-registry.js"; import { type RunNotice } from "./run-notices.js"; import type { WorkflowPermissionBroker } from "./workflow-permissions.js"; export declare const CLAUDE_CHANNEL_CAPABILITY = "claude/channel"; export declare const CLAUDE_CHANNEL_NOTIFICATION = "notifications/claude/channel"; /** Claude Code silently drops meta keys that are not identifiers; keep every key on this shape. */ export type ClaudeChannelNotificationParams = { content: string; meta: { run_id: string; kind: RunNotice["kind"]; status: RunNotice["status"]; event_id: string; }; }; export declare function channelNotificationParams(runId: string, notice: RunNotice): ClaudeChannelNotificationParams; export declare class ClaudeChannelNotifier { private readonly mcp; private readonly router; /** Runs this session named; permission and setup notices are filtered on it. */ private readonly attached; /** Open event-log tails, one per attached run that has a journal and is not yet terminal. */ private readonly streams; private readonly detach; private closed; constructor(mcp: McpServer, router: RunStoreRouter, broker: WorkflowPermissionBroker); /** * Attach a run this session just admitted, resumed, or inspected. Idempotent once the tail is * open; a later call re-arms a tail that could not open or broke. A run that is already * terminal is not watched: the response the caller is about to read says so. */ watch(runId: string): void; close(): void; private drain; private forget; private send; } //# sourceMappingURL=channel-notifier.d.ts.map