import type { NotifyDeliveryContext, NotifyDeliveryResult, ProcessJobProjection } from "@mono-agent/agent-contracts"; import type { ChannelDriver, ChannelId, MonoAgentAppLogger, RunningChannel } from "./channels.js"; export type { NotifyDeliveryResult } from "@mono-agent/agent-contracts"; /** * Channels whose conversations can receive a proactive notification turn — the * single capability registry behind BOTH artifact-sighting admission and * destination resolution. Keeping one set means a channel can never be * notify-capable for one half of inference and invisible to the other. * WhatsApp is a recognized push scheme but has no notify hook yet, so it is * absent here and its conversations are never offered as candidates. */ export declare const NOTIFY_CAPABLE_CHANNELS: ReadonlySet; /** Whether a channel can receive an inferred native cron/webhook notification. */ export declare function isNotifyCapableChannel(channelId: ChannelId | undefined): channelId is ChannelId; /** The push channel that owns a destination conversationId (requires a `:` form), or undefined. */ export declare function channelIdForConversation(conversationId: string): ChannelId | undefined; export interface ProactiveNotifyInput { /** Destination conversationId, e.g. `telegram:42` or `slack:C1:171.5`. */ readonly conversationId: string; /** The message to deliver. With `verbatim`, posted as-is; otherwise run as a turn. */ readonly text: string; /** * Deliver `text` VERBATIM — post it to the destination unchanged with no model * call, then record it to the conversation's history (native cron/webhook * notification). Without it, `text` is a prompt run as a turn on the * destination's harness (e.g. a Slack interactive trigger). */ readonly verbatim?: boolean; /** Stable host delivery identity for adapters with duplicate suppression. */ readonly deliveryKey?: string; readonly deliveryContext?: NotifyDeliveryContext; /** Secret-free state for a process-job wake and web card update. */ readonly processJob?: ProcessJobProjection; /** Currently running channels, keyed by id (the app's live registry). */ readonly running: ReadonlyMap>; /** * Registered channel drivers, used to map a conversation SCHEME to the id the * owning driver actually runs under. A plugin may be registered under a * custom `id` while declaring a fixed `processJobs.conversationScheme`, so * the scheme alone is not a running-registry key. Omit to key by scheme * directly (the built-in channels, whose id and scheme coincide). */ readonly drivers?: readonly Pick[]; readonly logger?: MonoAgentAppLogger; } /** * Route a proactive notification to the channel that owns its destination * conversation, so the message runs as a real turn on that channel's own harness * (shared session/history) and is delivered through its normal stream. The owning * channel's `notify` hook enforces its adapter allowlist before delivering, so a * non-allowlisted (e.g. payload-supplied) destination is rejected here. Returns a * structured {@link NotifyDeliveryResult}; never throws (the trigger run already * succeeded), so the caller can report the outcome to the model. */ export declare function routeProactiveNotification(input: ProactiveNotifyInput): Promise; //# sourceMappingURL=proactive-notify.d.ts.map