import { type Database } from "./database.js"; export declare const NATIVE_PUSH_RULES: readonly ["needs_input", "reply_ready", "failed", "agent", "call", "call_members"]; export type NativePushRule = (typeof NATIVE_PUSH_RULES)[number]; export type NativePushDeviceRow = { platform: "ios" | "android"; appId: string; environment: "development" | "production"; token: string; rules: NativePushRule[]; /** iOS PushKit token that agent calls ring (1107). */ voipToken: string | null; updatedAt: string; }; export declare function getNativePushDevice(db: Database, authSessionId: string): Promise; export declare function registerNativePushDevice(db: Database, input: { authSessionId: string; platform: "ios" | "android"; appId: string; environment: "development" | "production"; token: string; rules: readonly NativePushRule[]; /** * iOS PushKit token; without it an iOS phone keeps no call rules. */ voipToken?: string | null | undefined; }): Promise; export declare function unregisterNativePushDevice(db: Database, authSessionId: string): Promise; /** * Push to the person who started a session, on every device that wants * `rule`. Runs under the session's workspace RLS context. Returns how many * deliveries were queued; repeated `dedupeKey`s are ignored. */ export declare function enqueueNativePush(db: Database, input: { accountId: string; workspaceId: string; sessionId: string; rule: NativePushRule; dedupeKey: string; title?: string | null; body: string; eventType?: string; }): Promise; export type ClaimedNativePushDelivery = { deliveryId: string; platform: "ios" | "android"; appId: string; environment: "development" | "production"; token: string; /** The PushKit token, for a call ring on iOS. */ voipToken: string | null; payload: { rule: NativePushRule; eventType?: string; /** Absent from a notice about something other than a chat (1503), which carries `link`. */ sessionId?: string; workspaceId: string; subjectId: string; title?: string; body?: string; /** * An agent notification's subtitle, facts and urgency (0664); a question or * approval carries urgency when its person asked for time-sensitive ones (0718). */ subtitle?: string; facts?: Array<{ label: string; value: string; }>; urgency?: "normal" | "time_sensitive"; /** The session event the push is about, so a tap lands on it (0664). */ sequence?: number; /** A call ring (rule `call`, 1107): the call and when it stops ringing. */ callId?: string; ringUntil?: string; /** * The end of a call's ring that was settled elsewhere (rule `call`, 1344): * an Android phone stops ringing, with this reason. */ callEnded?: "answeredElsewhere" | "declinedElsewhere" | "remoteEnded"; /** * An approval whose MCP server asks the person a question (1113): it is * answered in the app, where the question is shown, never on the lock * screen. */ serverQuestionKind?: "confirm" | "form"; /** * Where a tap goes for a notice about something other than a chat (1503), * such as a subscription account that needs signing in again: a path in * the web app. */ link?: string; }; attempts: number; }; export declare function claimNativePushDeliveries(db: Database, input: { claimId: string; limit?: number; claimSeconds?: number; }): Promise; export type NativePushOutcome = "delivered" | "retry" | "failed" | "unregistered"; export declare function settleNativePushDelivery(db: Database, input: { claimId: string; deliveryId: string; outcome: NativePushOutcome; error?: string | null; retrySeconds?: number; }): Promise; export declare function pruneNativePushDeliveries(db: Database, input?: { retentionHours?: number; limit?: number; }): Promise;