import type { SessionRouterDeps } from "../router"; import type { ChatDaemonCommandBindInput, ChatDaemonCommandOutcome } from "./chat-daemon-command-channel"; import type { ChatDaemonKind } from "./chat-daemon-control"; import type { DiscordProvider } from "./discord-provider"; import { type SlackProviderClient } from "./slack-provider"; export interface ChatDaemonRuntimeConfig { identity: string; notifications: { discord?: { botToken: string; applicationId: string; guildId: string; parentChannelId: string; }; slack?: { botToken: string; appToken: string; workspaceId: string; channelId: string; authorizedUserId?: string; }; }; presentation?: { redact: boolean; verbosity: "lean" | "verbose"; }; } export type ChatDeliveryPhase = "pre_send" | "ambiguous"; /** An authorized SDK command could not be conclusively delivered. */ export declare class ChatDeliveryError extends Error { readonly phase: ChatDeliveryPhase; constructor(phase: ChatDeliveryPhase); } export interface ChatDaemonRuntimeDeps { createDiscordProvider?: (config: NonNullable) => DiscordProvider; createSlackProvider?: (config: NonNullable) => SlackProviderClient; routerDeps?: SessionRouterDeps; } /** * Worker-owned session discovery and event fanout. It connects only through the * public SDK transport and retains SDK credentials solely in live client objects. */ export declare class ChatDaemonRuntime { #private; private readonly input; private readonly deps; constructor(input: { kind: ChatDaemonKind; agentDir: string; config: ChatDaemonRuntimeConfig; }, deps?: ChatDaemonRuntimeDeps); start(): Promise; transportHealthy(): boolean; /** Reconcile indexed attachments and optionally wait for their replay tails. */ reconcile(options?: { waitForReplay?: boolean; }): Promise; stop(): Promise; /** Adopt an operator-supplied Slack root through the provider's presentation store. */ bindExistingRoot(request: ChatDaemonCommandBindInput): Promise; }