/** * Shared renderer for the bracket-envelope grammar used across agent-facing * text surfaces: delivery prompts (`server/runtime/delivery-prompt.ts`), * `anima message read` transcripts, and the history/inbox/outbox CLI. * * Grammar: `[key=value key=value ...]` — fields space-joined in caller order * (order is part of the surface contract), absent fields omitted entirely * (never rendered empty), values raw unless explicitly quoted. * * This module owns the HOW (joining, omission, quoting, time trimming). * Each surface keeps its own WHAT: which fields, in which order, at which * time granularity. Envelope semantics are frozen; tests pin the bytes. */ export interface EnvelopeField { key: string; /** `undefined`, `null`, and `''` all mean "omit this field". */ value: string | number | boolean | undefined | null; /** Quote the value with {@link quoteEnvelopeValue} (e.g. feishu `chat_name`). */ quoted?: boolean; } export declare function renderEnvelope(fields: EnvelopeField[]): string; /** The one quoting rule for envelope values: backslash-escape `\` and `"`, wrap in quotes. */ export declare function quoteEnvelopeValue(value: string): string; /** * Delivery-envelope timestamps render at second granularity; sub-second * precision is noise for reading context (message_ts carries exact identity). * Transcript and history surfaces deliberately keep raw ISO timestamps. */ export declare function envelopeTime(timestamp: string): string; /** * Renders an instant in the user's local time as `YYYY-MM-DDTHH:mm:ss±HH:MM`. * Zone-based (DST-correct at the instant); falls back to a fixed offset when * the zone name is unusable, then to the raw timestamp. */ export declare function formatUserLocalTime(timestamp: string, timezone: { name: string; offsetSeconds?: number; }): string; /** Pagination footer shared by transcript and history surfaces. */ export declare function renderPageFooter(page: { hasMore: boolean; nextCursor?: string | null; }): string; //# sourceMappingURL=envelope.d.ts.map