export interface NotifyDeps { /** Override env (tests). Defaults to process.env. */ env?: NodeJS.ProcessEnv; /** Override fetch (tests). Defaults to global fetch. */ fetch?: typeof fetch; /** Override sleep (tests bypass backoff). */ sleep?: (ms: number) => Promise; } export interface NotifyOptions { text: string; /** Explicit target. When omitted, falls back to `SLACK_HOME_CHANNEL`. */ target?: string; /** Optional thread to reply in (overrides target's :thread_ts suffix). */ threadTs?: string; /** Max total wait incl. retries. Default 10s. */ timeoutMs?: number; } export type NotifyErrorCode = "MISSING_TEXT" | "MISSING_TOKEN" | "MISSING_TARGET" | "BAD_TARGET" | "BAD_HOME_CHANNEL" | "OPEN_FAILED" | "POST_FAILED" | "RATE_LIMITED" | "TIMEOUT" | "NETWORK_ERROR"; export type NotifyResult = { ok: true; channel: string; ts: string; /** True when we had to call conversations.open to map U… → D…. */ openedIm: boolean; } | { ok: false; code: NotifyErrorCode; reason: string; }; /** * Send a Slack message. Library entry point — never throws. Returns a * structured result so callers (cron / `/slack send` skill / CLI) decide * how to surface or persist failures. */ export declare function notify(opts: NotifyOptions, deps?: NotifyDeps): Promise;