import { Settings } from "../config/settings"; import { type EnsureChatDaemonResult } from "../sdk/bus/chat-daemon-control"; import { type BoundSlackThread } from "../sdk/bus/slack-thread-binding"; import { type EnsureTelegramDaemonDetailedResult } from "../sdk/bus/telegram-daemon"; import { type TelegramSetupPreflight, type TelegramSetupTimers } from "../sdk/bus/telegram-setup"; import type { ActivatedPreparedSession } from "../sdk/session-activation"; export type NotifyAction = "setup" | "status" | "health" | "test" | "recovery" | "bind-thread" | "activate-thread" | "daemon-internal"; export type NotifySetupProvider = "telegram" | "discord" | "slack"; export interface NotifyCommandArgs { action: NotifyAction; smoke?: boolean; rawArgs: string[]; provider?: NotifySetupProvider; token?: string; chatId?: string; discordBotToken?: string; discordApplicationId?: string; discordGuildId?: string; discordParentChannelId?: string; slackBotToken?: string; slackAppToken?: string; slackWorkspaceId?: string; slackChannelId?: string; slackAuthorizedUserId?: string; redact?: boolean; forceDaemonLock?: boolean; probe?: boolean; message?: string; sessionId?: string; threadTs?: string; } export interface NotifyCommandDeps { fetchImpl?: typeof fetch; apiBase?: string; settings?: Settings; setupToken?: string; pollTimeoutMs?: number; pollIntervalMs?: number; setupChatId?: string; setupRedact?: boolean; setupInteractive?: boolean; threadedModePrompt?: (message: string) => Promise; tokenPrompt?: () => Promise; setExitCode?: (code: number) => void; exitProcess?: (code: number) => void; valuePrompt?: (label: string, masked: boolean) => Promise; /** Optional daemon ownership facts collected by an embedding host. */ setupPreflight?: TelegramSetupPreflight; /** Injectable timers and cancellation for setup pairing. */ setupTimers?: TelegramSetupTimers; setupAbortSignal?: AbortSignal; setupPidAlive?: (pid: number) => boolean; /** Injectable process-start provenance reader for ambient Telegram setup preflight. */ setupPidIncarnation?: (pid: number) => string | undefined; ensureProviderDaemon?: (provider: "discord" | "slack", settings: Settings) => Promise; ensureTelegramDaemon?: (settings: Settings) => Promise; bindSlackThread?: (input: { settings: Settings; sessionId: string; threadTs: string; }) => Promise; activatePreparedSession?: (input: { settings: Settings; sessionId: string; }) => Promise; } export declare function parseNotifyArgs(args: string[]): NotifyCommandArgs | undefined; export declare function runNotifyCommand(cmd: NotifyCommandArgs, deps?: NotifyCommandDeps): Promise; export declare function runNotifyCliCommand(cmd: NotifyCommandArgs, deps?: NotifyCommandDeps): Promise; type TokenPromptInput = NodeJS.ReadStream & { isRaw?: boolean; setRawMode?: (mode: boolean) => unknown; pause?: () => unknown; }; type TokenPromptOutput = Pick; export declare function promptForToken(input?: TokenPromptInput, output?: TokenPromptOutput): Promise; export interface BindThreadInvocation { sessionId: string; threadTs: string; } /** * Enforce the exact `bind-thread` grammar at every entrypoint. * * The command accepts only a session and a root; a positional argument, an * unrelated notify flag, or a target/credential input is a rejection rather than * something silently ignored, so no other invocation shape can reach the * binding authority. */ export declare function assertStrictBindThreadInvocation(cmd: NotifyCommandArgs): BindThreadInvocation; /** Confirmation carries identifiers only: no tokens, message bodies, or control secrets. */ export declare function formatBoundSlackThread(bound: BoundSlackThread): string; export interface ActivateThreadInvocation { sessionId: string; } /** * Enforce the exact `activate-thread` grammar at every entrypoint. * * Activation names one prepared session and nothing else: the root it adopts is * already the applied binding, so a supplied root, target, or credential is a * rejection rather than something silently ignored. */ export declare function assertStrictActivateThreadInvocation(cmd: NotifyCommandArgs): ActivateThreadInvocation; /** Confirmation carries identifiers only: no endpoints, tokens, or thread content. */ export declare function formatActivatedSession(activated: ActivatedPreparedSession): string; export declare function printNotifyHelp(): void; export {};