/** * UUIDv7 generator — RFC 9562 §5.7. * * QAR uses UUIDv7 for `message_id` so envelopes sort lexicographically by emit * time. The wire format is the standard 8-4-4-4-12 hex grouping; bits laid out * as: 48-bit Unix timestamp (ms) · 4-bit version · 12-bit rand_a · 2-bit * variant · 62-bit rand_b. The random portions are pulled from * `globalThis.crypto.getRandomValues` (Node 19+ and every modern browser) so * the output is suitable for protocol use, not just `Math.random`. The * isomorphic source matters: `@qodo/sdk` ships a browser WS adapter, and a * module-scope `node:crypto` import would break browser bundling. * * Returned as `string`; cast at the boundary with `asMessageId` / `asSessionId` * when you need a branded id. */ import type { MessageId, SessionId, TaskId } from '../qar/ids.js'; /** Generate a fresh UUIDv7. */ export declare function uuidv7(): string; /** Brand-cast a string id as `MessageId`. */ export declare function asMessageId(id: string): MessageId; /** Brand-cast a string id as `SessionId`. */ export declare function asSessionId(id: string): SessionId; /** * Brand-cast a string id as `TaskId`. * * Used by `TaskClient.tasks.start` to derive the `task_id` synchronously from * the outbound `task.start.message_id`. The wire contract codifies * `task_id == task.start.message_id`, so the SDK doesn't need to wait * for the first inbound envelope to know the id. */ export declare function asTaskId(id: string): TaskId; //# sourceMappingURL=uuid.d.ts.map