import { type NotificationDraftT } from './notification.js'; export interface ApnsEnvelope { payload: Record; /** APNs priority derived from the selected platform interruption level. */ priority: 10 | 5; /** Background is the silent state sync of a `done` lifecycle draft. */ pushType: 'alert' | 'background'; } /** Dispatch-time Project identity resolved by the service. */ export interface ProjectIdentity { /** User-facing sender name; companions fall back to the identifier. */ name?: string | null; /** Generated public or custom signed avatar URL the extension can fetch. */ imageUrl?: string | null; /** Stable cache identity for replacement/removal ordering across signed-URL refreshes. */ avatarRevision?: string | null; } /** What a companion needs to name this Delivery back to the service. */ export interface EnvelopeIds { requestId: string; deliveryId: string; receiptToken?: string | null; /** Server accept time of the Notification Request; companions order the stream by this, not APNs arrival. */ createdAt?: Date | null; /** * Per-Delivery capability to read this request's own content * (`POST /api/v1/delivery-content`). APNs only: the Notification Service * Extension holds no session, so it presents this to fetch a Body that did * not fit and every image preview at arrival. Emitted only for a request * with a Body or media. */ contentToken?: string | null; } /** Service-owned metadata for the original reply-enabled Notification Request. */ export interface ReplyMetadata { /** Immutable account-preference snapshot taken at request acceptance. */ agentAcknowledgementRequired: boolean; } /** Metadata for a silent sync emitted after an Agent Acknowledgement exists. */ export interface AgentAcknowledgementSync { /** Creation time of the persisted acknowledgement; its text never enters a push envelope. */ createdAt: Date; /** Present only for a specific agent-reported native answer version. */ replyId?: string; } /** Service-derived context carried by a done-tier retirement. */ export interface RetirementAnswerContext { answeredVia: string; answer?: string; } /** Encoded width of the per-Delivery receipt token. */ export declare const RECEIPT_TOKEN_LENGTH = 22; /** Encoded width of the per-Delivery content token; the same HMAC truncation as the receipt token. */ export declare const CONTENT_TOKEN_LENGTH = 22; /** * Room an alert push keeps free below the provider ceiling after optional * content is added. Choice descriptions and the Body ride in the push only * when the complete, destination-stamped payload still leaves this much * headroom; otherwise they are omitted and the Companion App fetches them. */ export declare const PUSHED_BODY_HEADROOM_BYTES = 256; /** True when a Companion App may need to fetch something the push does not carry. */ export declare function hasFetchableContent(draft: NotificationDraftT): boolean; /** * Adds the optional content to a rendered APNs alert payload whenever the * whole payload, as it will be sent, stays within `limitBytes` less * {@link PUSHED_BODY_HEADROOM_BYTES}: first each choice's description, then * the Markdown Body. Apply it last, after every other field (including the * destination stamp). `has_body` and `has_choice_descriptions` are unchanged * either way, so a push without them still tells the Companion App to fetch * them. When nothing is left to fetch, the content token is dropped. */ export declare function withPushedApnsContent(payload: Record, draft: NotificationDraftT, limitBytes: number): Record; /** Visible banner fields: the Title and the purpose-written Summary. */ export declare function bannerAlert(draft: NotificationDraftT): { title: string; body: string; }; /** Pure APNs payload assembly shared by rendering and client-side size estimation. */ export declare function buildApnsEnvelope(draft: NotificationDraftT, ids: EnvelopeIds, mediaUrl: string | null, projectIdentity?: ProjectIdentity | null, /** Service-owned close time of this request's reply window. */ replyExpiresAt?: Date | null, retirementAnswerContext?: RetirementAnswerContext | null, replyMetadata?: ReplyMetadata | null, agentAcknowledgementSync?: AgentAcknowledgementSync | null): ApnsEnvelope; /** * APNs sound filename for a resolved ref. Shipped semantic names keep their * bundled `.caf` files; Account custom sounds use `notifai-.wav`. */ export declare function apnsSoundFilename(sound: string): string; /** Collapse id so rapid library mutations replace one pending background push. */ export declare const SOUND_LIBRARY_SYNC_COLLAPSE_ID: "notifai.sound-library"; /** * Silent library-refresh push. Distinct from a `done` retirement: no alert, * sound, badge, or mutable-content, and `notifai.sync=sound_library`. */ export declare function buildSoundLibrarySyncEnvelope(): ApnsEnvelope; /** Collapse id so a burst of Session Message changes replaces one pending push. */ export declare const SESSION_MESSAGES_SYNC_COLLAPSE_ID: "notifai.session-messages"; /** Silent Session Message refresh push, shaped like the sound-library sync. */ export declare function buildSessionMessagesSyncEnvelope(): ApnsEnvelope;