/** * Restart-report DM: after an *intentional* restart (manual / * auto-update), the primary daemon (bot-0) privately messages the owner a * summary — dashboard link, unfinished-session count, version, and (for an * update) the changelog. This replaces re-posting streaming cards into the * groups on restart (those stay silent now). See core/maintenance.ts and the * daemon startup wiring. */ import { type GithubAuthResolveOptions } from './github-auth.js'; import type { RestartKind } from '../services/restart-intent-store.js'; import { type Locale } from '../i18n/index.js'; export declare const GITHUB_REPO = "deepcoldy/botmux"; export interface RestartReportInput { kind: RestartKind; /** Current (post-restart) botmux version. */ version: string; /** Unfinished sessions across all bots. */ sessionCount: number; dashboardUrl?: string; /** Local host:port direct link — set only when `dashboardUrl` routes through * the central platform, so the owner can still reach the dashboard if the * platform is down. */ dashboardLocalUrl?: string; /** Version delta for update/rollback; changelog is update-only. */ oldVersion?: string; newVersion?: string; changelog?: string; } /** The human-facing markdown body of the report. Pure — unit tested. */ export declare function buildRestartReportText(input: RestartReportInput, locale?: Locale): string; /** Wrap the report body in a minimal Lark interactive card (JSON string). */ export declare function buildRestartReportCard(input: RestartReportInput, locale?: Locale): string; export declare function releasesUrl(version: string): string; export interface RestartReportWiring { /** Primary bot (bot-0) app id — the DM sender. */ primaryLarkAppId: string; /** Owner to DM (bot-0's first resolved allowedUser); undefined → skip the DM. */ ownerOpenId: string | undefined; dashboardUrl: string | undefined; /** Local host:port direct fallback link (set only when dashboardUrl is a * central-platform link). */ dashboardLocalUrl?: string | undefined; /** Send the interactive card as a p2p DM to the owner. */ sendCard: (openId: string, cardJson: string) => Promise; githubAuth?: GithubAuthResolveOptions; /** Injectable clock for deterministic tests. */ now?: number | (() => number); log?: (msg: string) => void; wait?: (ms: number) => Promise; /** Optional caller/test ceiling. Production leaves this unset so a durable * prepared intent is followed until it commits, aborts, or becomes stale. */ preparedCommitWaitMs?: number; } /** * If an intentional-restart breadcrumb is pending, DM the owner a restart * summary (exactly once — the breadcrumb is consumed). A crash / pm2 * auto-restart leaves no breadcrumb, so this stays silent. Call only on the * primary daemon after sessions are restored. */ export declare function sendRestartReportIfPending(w: RestartReportWiring): Promise; /** Best-effort GitHub release notes for a version. null on any failure (offline, * rate-limited, release not yet published) — caller falls back to a link. */ export declare function fetchChangelog(newVersion: string, opts?: { auth?: GithubAuthResolveOptions; fetchImpl?: typeof fetch; timeoutMs?: number; }): Promise; //# sourceMappingURL=restart-report.d.ts.map