/** * @fileoverview Normalizes a raw `NtfyMessage` poll envelope into the shape the * MCP surfaces hand back: Unix-second timestamps converted to ISO 8601 strings * and long bodies truncated to a bounded length unless the caller opts out. * Lives in the service layer so `ntfy_fetch_messages` and the `ntfy://{topic}` * resource — peers, not dependents — normalize identically instead of one * importing the other's internals. * @module services/ntfy/message-shape */ import type { MessageEvent, NtfyAction, NtfyAttachment, NtfyMessage, Priority } from './types.js'; /** Character budget for a returned message body; the rest is reported as a count. */ export declare const MESSAGE_TRUNCATE_AT = 500; /** A `NtfyMessage` with ISO 8601 timestamps and a length-bounded body. */ export interface ShapedNtfyMessage { actions?: NtfyAction[] | undefined; attachment?: NtfyAttachment | undefined; click?: string | undefined; event: MessageEvent; expires?: string | undefined; id: string; message?: string | undefined; /** Count of characters dropped from `message`; absent when nothing was cut. */ messageTruncated?: number | undefined; priority?: Priority | undefined; sequence_id?: string | undefined; tags?: string[] | undefined; time: string; title?: string | undefined; topic: string; } /** * Normalize one polled message. Callers filter the connection-level `open` / * `keepalive` frames out before shaping, so the narrower `MessageEvent` holds. * * @param raw - The upstream poll envelope. * @param opts.truncateBody - Cap the body at `MESSAGE_TRUNCATE_AT` (default * `true`). Pass `false` to return the whole body with no `messageTruncated` * count — only safe where the result set is pinned to a single message. */ export declare function shapeMessage(raw: NtfyMessage, opts?: { truncateBody?: boolean; }): ShapedNtfyMessage; //# sourceMappingURL=message-shape.d.ts.map