import { WearableConversation, WearableNativeMemory, WearableConnectorFactoryOptions, WearableSourceConnector, WearableConnectorRegistration } from '@remnic/core'; import { ConnectorApiError } from '@remnic/core/http-retry'; /** * Minimal Omi Developer API client (raw fetch, no SDK). * * Current contract verified against docs.omi.me in 2026-07: * * - base `https://api.omi.me`, auth `Authorization: Bearer omi_dev_...` * (Developer API key from Settings → Developer → Create Key) * - `GET /v1/dev/user/conversations` with `limit`/`offset` * pagination, `start_date`/`end_date` (ISO 8601), and * `include_transcript=true` * - `GET /v1/dev/user/memories` with `limit`/`offset` * - responses are arrays; every optional field may be absent * - errors are FastAPI-shaped `{"detail": "..."}` * * The older app-scoped Integrations API remains supported when both * `appId` and `userId` are configured. * * The API key is never logged and never appears in thrown error * messages. */ declare const OMI_DEFAULT_BASE_URL = "https://api.omi.me"; interface OmiTranscriptSegment { text?: string; speaker?: string; speaker_id?: number | string | null; speaker_name?: string | null; is_user?: boolean; person_id?: string | null; start?: number; end?: number; } interface OmiConversation { id: string; created_at?: string; started_at?: string; finished_at?: string; structured?: { title?: string; overview?: string; category?: string; action_items?: Array<{ description?: string; completed?: boolean; }>; }; transcript_segments?: OmiTranscriptSegment[]; geolocation?: { address?: string | null; } | null; status?: string; discarded?: boolean; } interface OmiMemory { id: string; content?: string; category?: string; tags?: string[]; created_at?: string; } interface OmiConversationsPage { conversations: OmiConversation[]; nextOffset: number | null; } interface OmiMemoriesPage { memories: OmiMemory[]; nextOffset: number | null; } interface OmiClientOptions { apiKey: string; appId?: string; userId?: string; baseUrl?: string; fetchImpl?: typeof fetch; timeoutMs?: number; sleep?: (ms: number) => Promise; } declare class OmiApiError extends ConnectorApiError { constructor(message: string, status?: number, detail?: string); } declare class OmiClient { private readonly apiKey; private readonly appId?; private readonly userId?; private readonly mode; private readonly baseUrl; private readonly fetchImpl; private readonly timeoutMs; private readonly sleep; constructor(options: OmiClientOptions); /** One page of completed conversations inside [startIso, endIso). */ listConversations(params: { startIso: string; endIso: string; offset?: number; signal?: AbortSignal; }): Promise; /** One page of Omi memories (provider-extracted facts). */ listMemories(params?: { offset?: number; signal?: AbortSignal; }): Promise; verifyAuth(signal?: AbortSignal): Promise<{ ok: boolean; detail?: string; }>; private requestJson; } /** * Normalize Omi conversations into Remnic's provider-agnostic * `WearableConversation` shape, plus the timezone-aware day-window * helpers the Omi API needs (its date filters are ISO datetimes). * * Legacy Omi integration segments carry `is_user` for the wearer, * opaque `SPEAKER_NN` diarization labels, optional `person_id`s * (user-defined people), and start/end offsets in seconds relative to * the conversation start. The current Developer API returns * `speaker_name`/`speaker_id` instead; normalize both shapes. */ declare const OMI_SOURCE_ID = "omi"; /** "GMT+05:30" → "+05:30"; an unknown zone falls back to "+00:00" so a bad config never crashes the sync. */ declare function timezoneOffsetIso(instant: Date, timezone: string): string; declare function nextIsoDate(date: string): string; /** * Half-open [start, end) local-midnight ISO bounds of a local day, in the * offset-datetime form the Omi API's date filters expect. Field names and * format map to the Omi API; the DST-aware window math is core's * `activityDayWindow`. */ declare function omiDayWindow(date: string, timezone: string): { startIso: string; endIso: string; }; /** * @deprecated Compatibility wrapper (pre-core-refactor export); delegates to * `omiDayWindow`. Returns the resolved start bound, not a rebuilt midnight. */ declare function zonedDayStartIso(date: string, timezone: string): string; /** @deprecated Compatibility wrapper (pre-core-refactor export); delegates to `omiDayWindow`. */ declare function zonedDayBounds(date: string, timezone: string): { startIso: string; endIso: string; }; declare function conversationToWearable(conversation: OmiConversation): WearableConversation; declare function memoryToNativeMemory(memory: OmiMemory): WearableNativeMemory | null; /** * @remnic/connector-omi — Omi AI wearable connector. * * À-la-carte optional companion of @remnic/core (computed-specifier * discovery; importing this module self-registers idempotently). * * Requires an Omi Developer API key from Settings → Developer → * Create Key: * - key via `REMNIC_OMI_API_KEY` / `OMI_API_KEY` env (or `apiKey`) * * Legacy External Integration app installs remain supported when both * `wearables.sources.omi.appId` and `wearables.sources.omi.userId` * are configured. */ declare function resolveOmiApiKey(configuredKey: string | undefined, env?: NodeJS.ProcessEnv): string | undefined; declare function createOmiConnector(options: WearableConnectorFactoryOptions): WearableSourceConnector; declare const wearableConnectorRegistration: WearableConnectorRegistration; /** * Idempotently register the connector with the core registry. Importing * this module registers it as a side effect; calling this again is safe * (returns false when already registered). */ declare const ensureOmiConnectorRegistered: () => boolean; export { OMI_DEFAULT_BASE_URL, OMI_SOURCE_ID, OmiApiError, OmiClient, type OmiClientOptions, type OmiConversation, type OmiConversationsPage, type OmiMemoriesPage, type OmiMemory, type OmiTranscriptSegment, conversationToWearable, createOmiConnector, ensureOmiConnectorRegistered, memoryToNativeMemory, nextIsoDate, omiDayWindow, resolveOmiApiKey, timezoneOffsetIso, wearableConnectorRegistration, zonedDayBounds, zonedDayStartIso };