@remnic/connector-omi 9.69.23 → 9.69.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -10
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -162,6 +162,6 @@ declare const wearableConnectorRegistration: WearableConnectorRegistration;
|
|
|
162
162
|
* this module registers it as a side effect; calling this again is safe
|
|
163
163
|
* (returns false when already registered).
|
|
164
164
|
*/
|
|
165
|
-
declare
|
|
165
|
+
declare const ensureOmiConnectorRegistered: () => boolean;
|
|
166
166
|
|
|
167
167
|
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, resolveOmiApiKey, timezoneOffsetIso, wearableConnectorRegistration, zonedDayBounds, zonedDayStartIso };
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
getWearableConnector
|
|
5
|
+
selfRegisterWearableConnector
|
|
7
6
|
} from "@remnic/core";
|
|
8
7
|
|
|
9
8
|
// src/client.ts
|
|
@@ -426,14 +425,7 @@ var wearableConnectorRegistration = {
|
|
|
426
425
|
displayName: "Omi",
|
|
427
426
|
factory: createOmiConnector
|
|
428
427
|
};
|
|
429
|
-
|
|
430
|
-
if (getWearableConnector(OMI_SOURCE_ID) !== void 0) {
|
|
431
|
-
return false;
|
|
432
|
-
}
|
|
433
|
-
registerWearableConnector(wearableConnectorRegistration);
|
|
434
|
-
return true;
|
|
435
|
-
}
|
|
436
|
-
ensureOmiConnectorRegistered();
|
|
428
|
+
var ensureOmiConnectorRegistered = selfRegisterWearableConnector(wearableConnectorRegistration);
|
|
437
429
|
export {
|
|
438
430
|
OMI_DEFAULT_BASE_URL,
|
|
439
431
|
OMI_SOURCE_ID,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/client.ts","../src/normalize.ts"],"sourcesContent":["/**\n * @remnic/connector-omi — Omi AI wearable connector.\n *\n * À-la-carte optional companion of @remnic/core (computed-specifier\n * discovery; importing this module self-registers idempotently).\n *\n * Requires an Omi Developer API key from Settings → Developer →\n * Create Key:\n * - key via `REMNIC_OMI_API_KEY` / `OMI_API_KEY` env (or `apiKey`)\n *\n * Legacy External Integration app installs remain supported when both\n * `wearables.sources.omi.appId` and `wearables.sources.omi.userId`\n * are configured.\n */\n\nimport {\n registerWearableConnector,\n getWearableConnector,\n type WearableConnectorFactoryOptions,\n type WearableConnectorRegistration,\n type WearableFetchOptions,\n type WearableFetchPage,\n type WearableNativeMemoryPage,\n type WearableSourceConnector,\n} from \"@remnic/core\";\n\nimport { OmiClient } from \"./client.js\";\nimport {\n conversationToWearable,\n memoryToNativeMemory,\n OMI_SOURCE_ID,\n zonedDayBounds,\n} from \"./normalize.js\";\n\nexport { OmiApiError, OmiClient, OMI_DEFAULT_BASE_URL } from \"./client.js\";\nexport type {\n OmiClientOptions,\n OmiConversation,\n OmiConversationsPage,\n OmiMemoriesPage,\n OmiMemory,\n OmiTranscriptSegment,\n} from \"./client.js\";\nexport {\n conversationToWearable,\n memoryToNativeMemory,\n nextIsoDate,\n OMI_SOURCE_ID,\n timezoneOffsetIso,\n zonedDayBounds,\n zonedDayStartIso,\n} from \"./normalize.js\";\n\nexport function resolveOmiApiKey(\n configuredKey: string | undefined,\n env: NodeJS.ProcessEnv = process.env,\n): string | undefined {\n if (typeof configuredKey === \"string\" && configuredKey.trim().length > 0) {\n return configuredKey.trim();\n }\n for (const name of [\"REMNIC_OMI_API_KEY\", \"OMI_API_KEY\"]) {\n const value = env[name];\n if (typeof value === \"string\" && value.trim().length > 0) {\n return value.trim();\n }\n }\n return undefined;\n}\n\nfunction parseOffsetCursor(cursor: string | null | undefined): number {\n if (typeof cursor !== \"string\" || cursor.length === 0) return 0;\n const parsed = Number(cursor);\n return Number.isInteger(parsed) && parsed > 0 ? parsed : 0;\n}\n\nexport function createOmiConnector(\n options: WearableConnectorFactoryOptions,\n): WearableSourceConnector {\n // Construction is lazy so `wearables status` works without\n // credentials; the client constructor throws the actionable\n // missing-credential messages at call time.\n let client: OmiClient | null = null;\n const getClient = (): OmiClient => {\n if (!client) {\n client = new OmiClient({\n apiKey: resolveOmiApiKey(options.settings.apiKey) ?? \"\",\n appId: options.settings.appId ?? \"\",\n userId: options.settings.userId ?? \"\",\n baseUrl: options.settings.baseUrl,\n });\n }\n return client;\n };\n\n return {\n id: OMI_SOURCE_ID,\n displayName: \"Omi\",\n async verifyAuth(signal?: AbortSignal) {\n return getClient().verifyAuth(signal);\n },\n async fetchConversations(opts: WearableFetchOptions): Promise<WearableFetchPage> {\n const bounds = zonedDayBounds(opts.date, opts.timezone);\n const page = await getClient().listConversations({\n startIso: bounds.startIso,\n endIso: bounds.endIso,\n offset: parseOffsetCursor(opts.cursor),\n signal: opts.signal,\n });\n return {\n conversations: page.conversations\n .filter((conversation) => conversation.discarded !== true)\n .map(conversationToWearable),\n nextCursor: page.nextOffset !== null ? String(page.nextOffset) : null,\n };\n },\n async fetchNativeMemories(opts: {\n cursor?: string | null;\n signal?: AbortSignal;\n }): Promise<WearableNativeMemoryPage> {\n const page = await getClient().listMemories({\n offset: parseOffsetCursor(opts.cursor),\n signal: opts.signal,\n });\n const memories = [];\n for (const memory of page.memories) {\n const mapped = memoryToNativeMemory(memory);\n if (mapped !== null) memories.push(mapped);\n }\n return {\n memories,\n nextCursor: page.nextOffset !== null ? String(page.nextOffset) : null,\n };\n },\n };\n}\n\nexport const wearableConnectorRegistration: WearableConnectorRegistration = {\n id: OMI_SOURCE_ID,\n displayName: \"Omi\",\n factory: createOmiConnector,\n};\n\n/**\n * Idempotently register the connector with the core registry. Importing\n * this module registers it as a side effect; calling this again is safe\n * (returns false when already registered).\n */\nexport function ensureOmiConnectorRegistered(): boolean {\n if (getWearableConnector(OMI_SOURCE_ID) !== undefined) {\n return false;\n }\n registerWearableConnector(wearableConnectorRegistration);\n return true;\n}\n\nensureOmiConnectorRegistered();\n","/**\n * Minimal Omi Developer API client (raw fetch, no SDK).\n *\n * Current contract verified against docs.omi.me in 2026-07:\n *\n * - base `https://api.omi.me`, auth `Authorization: Bearer omi_dev_...`\n * (Developer API key from Settings → Developer → Create Key)\n * - `GET /v1/dev/user/conversations` with `limit`/`offset`\n * pagination, `start_date`/`end_date` (ISO 8601), and\n * `include_transcript=true`\n * - `GET /v1/dev/user/memories` with `limit`/`offset`\n * - responses are arrays; every optional field may be absent\n * - errors are FastAPI-shaped `{\"detail\": \"...\"}`\n *\n * The older app-scoped Integrations API remains supported when both\n * `appId` and `userId` are configured.\n *\n * The API key is never logged and never appears in thrown error\n * messages.\n */\n\nexport const OMI_DEFAULT_BASE_URL = \"https://api.omi.me\";\n\nconst DEFAULT_TIMEOUT_MS = 30_000;\nconst MAX_RETRIES = 3;\nconst MAX_RETRY_DELAY_MS = 30_000;\n/** Page size for both conversations and memories (API max is 1000). */\nconst PAGE_SIZE = 100;\n\nexport interface OmiTranscriptSegment {\n text?: string;\n speaker?: string;\n speaker_id?: number | string | null;\n speaker_name?: string | null;\n is_user?: boolean;\n person_id?: string | null;\n start?: number;\n end?: number;\n}\n\nexport interface OmiConversation {\n id: string;\n created_at?: string;\n started_at?: string;\n finished_at?: string;\n structured?: {\n title?: string;\n overview?: string;\n category?: string;\n action_items?: Array<{ description?: string; completed?: boolean }>;\n };\n transcript_segments?: OmiTranscriptSegment[];\n geolocation?: { address?: string | null } | null;\n status?: string;\n discarded?: boolean;\n}\n\nexport interface OmiMemory {\n id: string;\n content?: string;\n category?: string;\n tags?: string[];\n created_at?: string;\n}\n\nexport interface OmiConversationsPage {\n conversations: OmiConversation[];\n nextOffset: number | null;\n}\n\nexport interface OmiMemoriesPage {\n memories: OmiMemory[];\n nextOffset: number | null;\n}\n\nexport interface OmiClientOptions {\n apiKey: string;\n appId?: string;\n userId?: string;\n baseUrl?: string;\n fetchImpl?: typeof fetch;\n timeoutMs?: number;\n sleep?: (ms: number) => Promise<void>;\n}\n\ntype OmiApiMode = \"developer\" | \"integration\";\n\nexport class OmiApiError extends Error {\n constructor(\n message: string,\n readonly status?: number,\n /** FastAPI `detail` string when the body carried one. */\n readonly detail?: string,\n ) {\n super(message);\n this.name = \"OmiApiError\";\n }\n}\n\nexport class OmiClient {\n private readonly apiKey: string;\n private readonly appId?: string;\n private readonly userId?: string;\n private readonly mode: OmiApiMode;\n private readonly baseUrl: string;\n private readonly fetchImpl: typeof fetch;\n private readonly timeoutMs: number;\n private readonly sleep: (ms: number) => Promise<void>;\n\n constructor(options: OmiClientOptions) {\n if (typeof options.apiKey !== \"string\" || options.apiKey.trim().length === 0) {\n throw new OmiApiError(\n \"Omi API key is missing. Set wearables.sources.omi.apiKey or the \" +\n \"OMI_API_KEY environment variable (create a Developer API key in \" +\n \"Settings → Developer → Create Key in the Omi app).\",\n );\n }\n\n const appId =\n typeof options.appId === \"string\" && options.appId.trim().length > 0\n ? options.appId.trim()\n : undefined;\n const userId =\n typeof options.userId === \"string\" && options.userId.trim().length > 0\n ? options.userId.trim()\n : undefined;\n if ((appId === undefined) !== (userId === undefined)) {\n throw new OmiApiError(\n \"Omi legacy integration mode requires both wearables.sources.omi.appId \" +\n \"and wearables.sources.omi.userId. Omit both to use the Developer \" +\n \"API key-only process.\",\n );\n }\n\n this.apiKey = options.apiKey.trim();\n this.appId = appId;\n this.userId = userId;\n this.mode = appId !== undefined && userId !== undefined ? \"integration\" : \"developer\";\n this.baseUrl = stripTrailingSlashes(options.baseUrl ?? OMI_DEFAULT_BASE_URL);\n this.fetchImpl = options.fetchImpl ?? fetch;\n this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n this.sleep =\n options.sleep ?? ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms)));\n }\n\n /** One page of completed conversations inside [startIso, endIso). */\n async listConversations(params: {\n startIso: string;\n endIso: string;\n offset?: number;\n signal?: AbortSignal;\n }): Promise<OmiConversationsPage> {\n const offset = params.offset ?? 0;\n const search = new URLSearchParams({\n limit: String(PAGE_SIZE),\n offset: String(offset),\n start_date: params.startIso,\n end_date: params.endIso,\n });\n let payload: unknown;\n if (this.mode === \"developer\") {\n search.set(\"include_transcript\", \"true\");\n payload = await this.requestJson(\n `/v1/dev/user/conversations?${search.toString()}`,\n params.signal,\n );\n } else {\n search.set(\"uid\", this.userId ?? \"\");\n search.set(\"include_discarded\", \"false\");\n // -1 = unlimited; the legacy API default silently truncates\n // transcripts to their first 100 segments.\n search.set(\"max_transcript_segments\", \"-1\");\n // Repeated param (FastAPI List[str]) — comma-joining does NOT work.\n search.append(\"statuses\", \"completed\");\n payload = await this.requestJson(\n `/v2/integrations/${encodeURIComponent(this.appId ?? \"\")}/conversations?${search.toString()}`,\n params.signal,\n );\n }\n const conversations =\n this.mode === \"developer\"\n ? payload\n : (payload as { conversations?: unknown }).conversations;\n if (!Array.isArray(conversations)) {\n throw new OmiApiError(\n this.mode === \"developer\"\n ? \"Omi API returned an unexpected conversations shape (expected array)\"\n : \"Omi API returned an unexpected conversations shape (missing conversations array)\",\n );\n }\n const valid = conversations.filter(\n (entry): entry is OmiConversation =>\n entry !== null &&\n typeof entry === \"object\" &&\n typeof (entry as { id?: unknown }).id === \"string\",\n )\n .filter(isCompletedOrStatuslessConversation)\n .filter((conversation) =>\n startsInsideHalfOpenWindow(conversation, params.startIso, params.endIso),\n );\n return {\n conversations: valid,\n nextOffset: conversations.length === PAGE_SIZE ? offset + PAGE_SIZE : null,\n };\n }\n\n /** One page of Omi memories (provider-extracted facts). */\n async listMemories(params: {\n offset?: number;\n signal?: AbortSignal;\n } = {}): Promise<OmiMemoriesPage> {\n const offset = params.offset ?? 0;\n const search = new URLSearchParams({\n limit: String(PAGE_SIZE),\n offset: String(offset),\n });\n let payload: unknown;\n if (this.mode === \"developer\") {\n payload = await this.requestJson(\n `/v1/dev/user/memories?${search.toString()}`,\n params.signal,\n );\n } else {\n search.set(\"uid\", this.userId ?? \"\");\n payload = await this.requestJson(\n `/v2/integrations/${encodeURIComponent(this.appId ?? \"\")}/memories?${search.toString()}`,\n params.signal,\n );\n }\n const memories =\n this.mode === \"developer\" ? payload : (payload as { memories?: unknown }).memories;\n if (!Array.isArray(memories)) {\n throw new OmiApiError(\n this.mode === \"developer\"\n ? \"Omi API returned an unexpected memories shape (expected array)\"\n : \"Omi API returned an unexpected memories shape (missing memories array)\",\n );\n }\n const valid = memories.filter(\n (entry): entry is OmiMemory =>\n entry !== null &&\n typeof entry === \"object\" &&\n typeof (entry as { id?: unknown }).id === \"string\",\n );\n return {\n memories: valid,\n nextOffset: memories.length === PAGE_SIZE ? offset + PAGE_SIZE : null,\n };\n }\n\n async verifyAuth(signal?: AbortSignal): Promise<{ ok: boolean; detail?: string }> {\n try {\n const search = new URLSearchParams({\n limit: \"1\",\n offset: \"0\",\n });\n if (this.mode === \"developer\") {\n search.set(\"include_transcript\", \"false\");\n await this.requestJson(\n `/v1/dev/user/conversations?${search.toString()}`,\n signal,\n );\n } else {\n search.set(\"uid\", this.userId ?? \"\");\n search.set(\"max_transcript_segments\", \"1\");\n await this.requestJson(\n `/v2/integrations/${encodeURIComponent(this.appId ?? \"\")}/conversations?${search.toString()}`,\n signal,\n );\n }\n return { ok: true };\n } catch (err) {\n if (err instanceof OmiApiError && err.status !== undefined) {\n // The auth chain yields distinct, actionable detail strings.\n // Legacy integration mode can also surface app/user capability\n // failures, so keep those hints mode-specific.\n const hint =\n err.status === 401\n ? \"missing/malformed Authorization header\"\n : err.status === 403\n ? this.mode === \"developer\"\n ? \"Developer API key rejected or missing conversation access\"\n : \"key rejected, app not enabled for this uid, or missing read_conversations capability\"\n : err.status === 404\n ? this.mode === \"developer\"\n ? \"Developer API endpoint not found — check the configured baseUrl\"\n : \"app not found — check wearables.sources.omi.appId\"\n : undefined;\n return {\n ok: false,\n detail: [err.detail, hint].filter(Boolean).join(\" — \") || err.message,\n };\n }\n // OmiApiError messages are our own constructed strings (already\n // scrubbed — network text is reduced to name + code inside\n // requestJson); foreign errors reduce to name + errno code so raw\n // Node text (paths, loader stacks) never reaches operator\n // surfaces.\n return {\n ok: false,\n detail: err instanceof OmiApiError ? err.message : describeNetworkError(err),\n };\n }\n }\n\n private async requestJson(pathAndQuery: string, signal?: AbortSignal): Promise<unknown> {\n let lastError: unknown;\n for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {\n signal?.throwIfAborted();\n const timeoutSignal = AbortSignal.timeout(this.timeoutMs);\n const combined = signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal;\n let response: Response;\n try {\n response = await this.fetchImpl(`${this.baseUrl}${pathAndQuery}`, {\n method: \"GET\",\n headers: {\n Authorization: `Bearer ${this.apiKey}`,\n Accept: \"application/json\",\n },\n signal: combined,\n });\n } catch (err) {\n if (signal?.aborted) throw err;\n lastError = err;\n if (attempt < MAX_RETRIES) {\n await this.sleep(backoffMs(attempt));\n continue;\n }\n throw new OmiApiError(\n `Omi API request failed after ${MAX_RETRIES + 1} attempts: ${describeNetworkError(err)}`,\n );\n }\n\n if (response.status === 429 || response.status >= 500) {\n lastError = new OmiApiError(\n `Omi API responded ${response.status}`,\n response.status,\n await readDetail(response),\n );\n if (attempt < MAX_RETRIES) {\n await this.sleep(retryDelayMs(response, attempt));\n continue;\n }\n throw lastError;\n }\n if (!response.ok) {\n throw new OmiApiError(\n `Omi API responded ${response.status} for ${pathAndQuery.split(\"?\")[0]}`,\n response.status,\n await readDetail(response),\n );\n }\n try {\n return await response.json();\n } catch {\n throw new OmiApiError(\"Omi API returned a non-JSON body\");\n }\n }\n throw lastError instanceof Error ? lastError : new OmiApiError(\"Omi API request failed\");\n }\n}\n\n/**\n * Network/timeout failures wrap Node error text that can carry loader\n * paths or stack fragments; sync errors reach MCP clients verbatim, so\n * only the error name + code survive.\n */\nfunction describeNetworkError(err: unknown): string {\n if (!(err instanceof Error)) return \"unexpected non-Error failure\";\n const code = (err as NodeJS.ErrnoException).code;\n return typeof code === \"string\" && code.length > 0 ? `${err.name} (${code})` : err.name;\n}\n\n/** Loop instead of `/\\/+$/` — CodeQL js/polynomial-redos on user-set URLs. */\nfunction stripTrailingSlashes(value: string): string {\n let end = value.length;\n while (end > 0 && value.charCodeAt(end - 1) === 0x2f) end--;\n return value.slice(0, end);\n}\n\nfunction startsInsideHalfOpenWindow(\n conversation: OmiConversation,\n startIso: string,\n endIso: string,\n): boolean {\n const startMs = Date.parse(startIso);\n const endMs = Date.parse(endIso);\n if (!Number.isFinite(startMs) || !Number.isFinite(endMs)) return true;\n\n const conversationIso =\n typeof conversation.started_at === \"string\"\n ? conversation.started_at\n : conversation.created_at;\n if (typeof conversationIso !== \"string\" || conversationIso.length === 0) {\n return true;\n }\n const conversationMs = Date.parse(conversationIso);\n if (!Number.isFinite(conversationMs)) return true;\n return conversationMs >= startMs && conversationMs < endMs;\n}\n\nfunction isCompletedOrStatuslessConversation(conversation: OmiConversation): boolean {\n if (typeof conversation.status !== \"string\" || conversation.status.length === 0) {\n return true;\n }\n return conversation.status === \"completed\";\n}\n\nasync function readDetail(response: Response): Promise<string | undefined> {\n try {\n const body = (await response.clone().json()) as { detail?: unknown };\n return typeof body?.detail === \"string\" ? body.detail : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction backoffMs(attempt: number): number {\n return Math.min(MAX_RETRY_DELAY_MS, 1_000 * 2 ** attempt);\n}\n\nfunction retryDelayMs(response: Response, attempt: number): number {\n const headerValue = response.headers.get(\"retry-after\");\n if (headerValue !== null) {\n const parsed = Number(headerValue);\n if (Number.isFinite(parsed) && parsed > 0) {\n return Math.min(MAX_RETRY_DELAY_MS, Math.ceil(parsed * 1_000));\n }\n }\n return backoffMs(attempt);\n}\n","/**\n * Normalize Omi conversations into Remnic's provider-agnostic\n * `WearableConversation` shape, plus the timezone-aware day-window\n * helpers the Omi API needs (its date filters are ISO datetimes).\n *\n * Legacy Omi integration segments carry `is_user` for the wearer,\n * opaque `SPEAKER_NN` diarization labels, optional `person_id`s\n * (user-defined people), and start/end offsets in seconds relative to\n * the conversation start. The current Developer API returns\n * `speaker_name`/`speaker_id` instead; normalize both shapes.\n */\n\nimport type {\n WearableConversation,\n WearableNativeMemory,\n WearableTranscriptSegment,\n} from \"@remnic/core\";\n\nimport type { OmiConversation, OmiMemory } from \"./client.js\";\n\nexport const OMI_SOURCE_ID = \"omi\";\n\n/** \"GMT+05:30\" → \"+05:30\"; plain \"GMT\" → \"+00:00\". */\nexport function timezoneOffsetIso(instant: Date, timezone: string): string {\n try {\n const parts = new Intl.DateTimeFormat(\"en-US\", {\n timeZone: timezone,\n timeZoneName: \"longOffset\",\n }).formatToParts(instant);\n const name = parts.find((part) => part.type === \"timeZoneName\")?.value ?? \"GMT\";\n const match = name.match(/GMT([+-]\\d{2}:\\d{2})?/);\n return match?.[1] ?? \"+00:00\";\n } catch {\n return \"+00:00\";\n }\n}\n\n/** ISO instant for local midnight of `date` in `timezone`. */\nexport function zonedDayStartIso(date: string, timezone: string): string {\n // Two-pass offset resolution: guess from midday (stable away from DST\n // transitions), then re-derive at the candidate midnight itself.\n let offset = timezoneOffsetIso(new Date(`${date}T12:00:00Z`), timezone);\n const candidate = new Date(`${date}T00:00:00${offset}`);\n const refined = timezoneOffsetIso(candidate, timezone);\n if (refined !== offset) {\n offset = refined;\n }\n return `${date}T00:00:00${offset}`;\n}\n\nexport function nextIsoDate(date: string): string {\n const parsed = new Date(`${date}T00:00:00Z`);\n parsed.setUTCDate(parsed.getUTCDate() + 1);\n return parsed.toISOString().slice(0, 10);\n}\n\n/** Half-open [start, end) ISO bounds of a local day. */\nexport function zonedDayBounds(\n date: string,\n timezone: string,\n): { startIso: string; endIso: string } {\n return {\n startIso: zonedDayStartIso(date, timezone),\n endIso: zonedDayStartIso(nextIsoDate(date), timezone),\n };\n}\n\nexport function conversationToWearable(\n conversation: OmiConversation,\n): WearableConversation {\n const startedAtMs = conversation.started_at\n ? Date.parse(conversation.started_at)\n : Number.NaN;\n const segments: WearableTranscriptSegment[] = [];\n for (const segment of conversation.transcript_segments ?? []) {\n const text = typeof segment.text === \"string\" ? segment.text.trim() : \"\";\n if (text.length === 0) continue;\n const isWearer = segment.is_user === true;\n const personId =\n typeof segment.person_id === \"string\" && segment.person_id.length > 0\n ? segment.person_id\n : undefined;\n const speakerId =\n typeof segment.speaker_id === \"string\" || typeof segment.speaker_id === \"number\"\n ? String(segment.speaker_id)\n : undefined;\n const label =\n typeof segment.speaker_name === \"string\" && segment.speaker_name.trim().length > 0\n ? segment.speaker_name.trim()\n : typeof segment.speaker === \"string\" && segment.speaker.trim().length > 0\n ? segment.speaker.trim()\n : undefined;\n const startIso =\n !Number.isNaN(startedAtMs) && typeof segment.start === \"number\"\n ? new Date(startedAtMs + segment.start * 1_000).toISOString()\n : undefined;\n const endIso =\n !Number.isNaN(startedAtMs) && typeof segment.end === \"number\"\n ? new Date(startedAtMs + segment.end * 1_000).toISOString()\n : undefined;\n segments.push({\n text,\n // person_id is the most stable key when the user has tagged the\n // speaker as a known person in Omi. The Developer API's\n // speaker_id is the next best stable key, then the diarization\n // label.\n speakerKey: isWearer ? \"user\" : (personId ?? speakerId ?? label ?? \"unknown\"),\n ...(label !== undefined ? { speakerName: label } : {}),\n ...(isWearer ? { isWearer: true } : {}),\n ...(startIso !== undefined ? { startIso } : {}),\n ...(endIso !== undefined ? { endIso } : {}),\n });\n }\n\n const title = conversation.structured?.title?.trim();\n const overview = conversation.structured?.overview?.trim();\n const address = conversation.geolocation?.address;\n\n return {\n id: conversation.id,\n source: OMI_SOURCE_ID,\n ...(title && title.length > 0 ? { title } : {}),\n ...(overview && overview.length > 0 ? { summary: overview } : {}),\n startIso: conversation.started_at ?? conversation.created_at ?? \"\",\n ...(conversation.finished_at !== undefined\n ? { endIso: conversation.finished_at }\n : {}),\n ...(typeof address === \"string\" && address.length > 0\n ? { location: address }\n : {}),\n segments,\n };\n}\n\nexport function memoryToNativeMemory(memory: OmiMemory): WearableNativeMemory | null {\n const content = typeof memory.content === \"string\" ? memory.content.trim() : \"\";\n if (content.length === 0) return null;\n return {\n id: memory.id,\n content,\n ...(memory.created_at !== undefined ? { createdIso: memory.created_at } : {}),\n ...(Array.isArray(memory.tags) && memory.tags.length > 0\n ? { tags: memory.tags }\n : {}),\n };\n}\n"],"mappings":";;;AAeA;AAAA,EACE;AAAA,EACA;AAAA,OAOK;;;ACHA,IAAM,uBAAuB;AAEpC,IAAM,qBAAqB;AAC3B,IAAM,cAAc;AACpB,IAAM,qBAAqB;AAE3B,IAAM,YAAY;AA4DX,IAAM,cAAN,cAA0B,MAAM;AAAA,EACrC,YACE,SACS,QAEA,QACT;AACA,UAAM,OAAO;AAJJ;AAEA;AAGT,SAAK,OAAO;AAAA,EACd;AAAA,EANW;AAAA,EAEA;AAKb;AAEO,IAAM,YAAN,MAAgB;AAAA,EACJ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEjB,YAAY,SAA2B;AACrC,QAAI,OAAO,QAAQ,WAAW,YAAY,QAAQ,OAAO,KAAK,EAAE,WAAW,GAAG;AAC5E,YAAM,IAAI;AAAA,QACR;AAAA,MAGF;AAAA,IACF;AAEA,UAAM,QACJ,OAAO,QAAQ,UAAU,YAAY,QAAQ,MAAM,KAAK,EAAE,SAAS,IAC/D,QAAQ,MAAM,KAAK,IACnB;AACN,UAAM,SACJ,OAAO,QAAQ,WAAW,YAAY,QAAQ,OAAO,KAAK,EAAE,SAAS,IACjE,QAAQ,OAAO,KAAK,IACpB;AACN,QAAK,UAAU,YAAgB,WAAW,SAAY;AACpD,YAAM,IAAI;AAAA,QACR;AAAA,MAGF;AAAA,IACF;AAEA,SAAK,SAAS,QA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YAAI,WAAW,KAAM,UAAS,KAAK,MAAM;AAAA,MAC3C;AACA,aAAO;AAAA,QACL;AAAA,QACA,YAAY,KAAK,eAAe,OAAO,OAAO,KAAK,UAAU,IAAI;AAAA,MACnE;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,gCAA+D;AAAA,EAC1E,IAAI;AAAA,EACJ,aAAa;AAAA,EACb,SAAS;AACX;AAOO,SAAS,+BAAwC;AACtD,MAAI,qBAAqB,aAAa,MAAM,QAAW;AACrD,WAAO;AAAA,EACT;AACA,4BAA0B,6BAA6B;AACvD,SAAO;AACT;AAEA,6BAA6B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/client.ts","../src/normalize.ts"],"sourcesContent":["/**\n * @remnic/connector-omi — Omi AI wearable connector.\n *\n * À-la-carte optional companion of @remnic/core (computed-specifier\n * discovery; importing this module self-registers idempotently).\n *\n * Requires an Omi Developer API key from Settings → Developer →\n * Create Key:\n * - key via `REMNIC_OMI_API_KEY` / `OMI_API_KEY` env (or `apiKey`)\n *\n * Legacy External Integration app installs remain supported when both\n * `wearables.sources.omi.appId` and `wearables.sources.omi.userId`\n * are configured.\n */\n\nimport {\n selfRegisterWearableConnector,\n type WearableConnectorFactoryOptions,\n type WearableConnectorRegistration,\n type WearableFetchOptions,\n type WearableFetchPage,\n type WearableNativeMemoryPage,\n type WearableSourceConnector,\n} from \"@remnic/core\";\n\nimport { OmiClient } from \"./client.js\";\nimport {\n conversationToWearable,\n memoryToNativeMemory,\n OMI_SOURCE_ID,\n zonedDayBounds,\n} from \"./normalize.js\";\n\nexport { OmiApiError, OmiClient, OMI_DEFAULT_BASE_URL } from \"./client.js\";\nexport type {\n OmiClientOptions,\n OmiConversation,\n OmiConversationsPage,\n OmiMemoriesPage,\n OmiMemory,\n OmiTranscriptSegment,\n} from \"./client.js\";\nexport {\n conversationToWearable,\n memoryToNativeMemory,\n nextIsoDate,\n OMI_SOURCE_ID,\n timezoneOffsetIso,\n zonedDayBounds,\n zonedDayStartIso,\n} from \"./normalize.js\";\n\nexport function resolveOmiApiKey(\n configuredKey: string | undefined,\n env: NodeJS.ProcessEnv = process.env,\n): string | undefined {\n if (typeof configuredKey === \"string\" && configuredKey.trim().length > 0) {\n return configuredKey.trim();\n }\n for (const name of [\"REMNIC_OMI_API_KEY\", \"OMI_API_KEY\"]) {\n const value = env[name];\n if (typeof value === \"string\" && value.trim().length > 0) {\n return value.trim();\n }\n }\n return undefined;\n}\n\nfunction parseOffsetCursor(cursor: string | null | undefined): number {\n if (typeof cursor !== \"string\" || cursor.length === 0) return 0;\n const parsed = Number(cursor);\n return Number.isInteger(parsed) && parsed > 0 ? parsed : 0;\n}\n\nexport function createOmiConnector(\n options: WearableConnectorFactoryOptions,\n): WearableSourceConnector {\n // Construction is lazy so `wearables status` works without\n // credentials; the client constructor throws the actionable\n // missing-credential messages at call time.\n let client: OmiClient | null = null;\n const getClient = (): OmiClient => {\n if (!client) {\n client = new OmiClient({\n apiKey: resolveOmiApiKey(options.settings.apiKey) ?? \"\",\n appId: options.settings.appId ?? \"\",\n userId: options.settings.userId ?? \"\",\n baseUrl: options.settings.baseUrl,\n });\n }\n return client;\n };\n\n return {\n id: OMI_SOURCE_ID,\n displayName: \"Omi\",\n async verifyAuth(signal?: AbortSignal) {\n return getClient().verifyAuth(signal);\n },\n async fetchConversations(opts: WearableFetchOptions): Promise<WearableFetchPage> {\n const bounds = zonedDayBounds(opts.date, opts.timezone);\n const page = await getClient().listConversations({\n startIso: bounds.startIso,\n endIso: bounds.endIso,\n offset: parseOffsetCursor(opts.cursor),\n signal: opts.signal,\n });\n return {\n conversations: page.conversations\n .filter((conversation) => conversation.discarded !== true)\n .map(conversationToWearable),\n nextCursor: page.nextOffset !== null ? String(page.nextOffset) : null,\n };\n },\n async fetchNativeMemories(opts: {\n cursor?: string | null;\n signal?: AbortSignal;\n }): Promise<WearableNativeMemoryPage> {\n const page = await getClient().listMemories({\n offset: parseOffsetCursor(opts.cursor),\n signal: opts.signal,\n });\n const memories = [];\n for (const memory of page.memories) {\n const mapped = memoryToNativeMemory(memory);\n if (mapped !== null) memories.push(mapped);\n }\n return {\n memories,\n nextCursor: page.nextOffset !== null ? String(page.nextOffset) : null,\n };\n },\n };\n}\n\nexport const wearableConnectorRegistration: WearableConnectorRegistration = {\n id: OMI_SOURCE_ID,\n displayName: \"Omi\",\n factory: createOmiConnector,\n};\n\n/**\n * Idempotently register the connector with the core registry. Importing\n * this module registers it as a side effect; calling this again is safe\n * (returns false when already registered).\n */\nexport const ensureOmiConnectorRegistered =\n selfRegisterWearableConnector(wearableConnectorRegistration);\n","/**\n * Minimal Omi Developer API client (raw fetch, no SDK).\n *\n * Current contract verified against docs.omi.me in 2026-07:\n *\n * - base `https://api.omi.me`, auth `Authorization: Bearer omi_dev_...`\n * (Developer API key from Settings → Developer → Create Key)\n * - `GET /v1/dev/user/conversations` with `limit`/`offset`\n * pagination, `start_date`/`end_date` (ISO 8601), and\n * `include_transcript=true`\n * - `GET /v1/dev/user/memories` with `limit`/`offset`\n * - responses are arrays; every optional field may be absent\n * - errors are FastAPI-shaped `{\"detail\": \"...\"}`\n *\n * The older app-scoped Integrations API remains supported when both\n * `appId` and `userId` are configured.\n *\n * The API key is never logged and never appears in thrown error\n * messages.\n */\n\nexport const OMI_DEFAULT_BASE_URL = \"https://api.omi.me\";\n\nconst DEFAULT_TIMEOUT_MS = 30_000;\nconst MAX_RETRIES = 3;\nconst MAX_RETRY_DELAY_MS = 30_000;\n/** Page size for both conversations and memories (API max is 1000). */\nconst PAGE_SIZE = 100;\n\nexport interface OmiTranscriptSegment {\n text?: string;\n speaker?: string;\n speaker_id?: number | string | null;\n speaker_name?: string | null;\n is_user?: boolean;\n person_id?: string | null;\n start?: number;\n end?: number;\n}\n\nexport interface OmiConversation {\n id: string;\n created_at?: string;\n started_at?: string;\n finished_at?: string;\n structured?: {\n title?: string;\n overview?: string;\n category?: string;\n action_items?: Array<{ description?: string; completed?: boolean }>;\n };\n transcript_segments?: OmiTranscriptSegment[];\n geolocation?: { address?: string | null } | null;\n status?: string;\n discarded?: boolean;\n}\n\nexport interface OmiMemory {\n id: string;\n content?: string;\n category?: string;\n tags?: string[];\n created_at?: string;\n}\n\nexport interface OmiConversationsPage {\n conversations: OmiConversation[];\n nextOffset: number | null;\n}\n\nexport interface OmiMemoriesPage {\n memories: OmiMemory[];\n nextOffset: number | null;\n}\n\nexport interface OmiClientOptions {\n apiKey: string;\n appId?: string;\n userId?: string;\n baseUrl?: string;\n fetchImpl?: typeof fetch;\n timeoutMs?: number;\n sleep?: (ms: number) => Promise<void>;\n}\n\ntype OmiApiMode = \"developer\" | \"integration\";\n\nexport class OmiApiError extends Error {\n constructor(\n message: string,\n readonly status?: number,\n /** FastAPI `detail` string when the body carried one. */\n readonly detail?: string,\n ) {\n super(message);\n this.name = \"OmiApiError\";\n }\n}\n\nexport class OmiClient {\n private readonly apiKey: string;\n private readonly appId?: string;\n private readonly userId?: string;\n private readonly mode: OmiApiMode;\n private readonly baseUrl: string;\n private readonly fetchImpl: typeof fetch;\n private readonly timeoutMs: number;\n private readonly sleep: (ms: number) => Promise<void>;\n\n constructor(options: OmiClientOptions) {\n if (typeof options.apiKey !== \"string\" || options.apiKey.trim().length === 0) {\n throw new OmiApiError(\n \"Omi API key is missing. Set wearables.sources.omi.apiKey or the \" +\n \"OMI_API_KEY environment variable (create a Developer API key in \" +\n \"Settings → Developer → Create Key in the Omi app).\",\n );\n }\n\n const appId =\n typeof options.appId === \"string\" && options.appId.trim().length > 0\n ? options.appId.trim()\n : undefined;\n const userId =\n typeof options.userId === \"string\" && options.userId.trim().length > 0\n ? options.userId.trim()\n : undefined;\n if ((appId === undefined) !== (userId === undefined)) {\n throw new OmiApiError(\n \"Omi legacy integration mode requires both wearables.sources.omi.appId \" +\n \"and wearables.sources.omi.userId. Omit both to use the Developer \" +\n \"API key-only process.\",\n );\n }\n\n this.apiKey = options.apiKey.trim();\n this.appId = appId;\n this.userId = userId;\n this.mode = appId !== undefined && userId !== undefined ? \"integration\" : \"developer\";\n this.baseUrl = stripTrailingSlashes(options.baseUrl ?? OMI_DEFAULT_BASE_URL);\n this.fetchImpl = options.fetchImpl ?? fetch;\n this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n this.sleep =\n options.sleep ?? ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms)));\n }\n\n /** One page of completed conversations inside [startIso, endIso). */\n async listConversations(params: {\n startIso: string;\n endIso: string;\n offset?: number;\n signal?: AbortSignal;\n }): Promise<OmiConversationsPage> {\n const offset = params.offset ?? 0;\n const search = new URLSearchParams({\n limit: String(PAGE_SIZE),\n offset: String(offset),\n start_date: params.startIso,\n end_date: params.endIso,\n });\n let payload: unknown;\n if (this.mode === \"developer\") {\n search.set(\"include_transcript\", \"true\");\n payload = await this.requestJson(\n `/v1/dev/user/conversations?${search.toString()}`,\n params.signal,\n );\n } else {\n search.set(\"uid\", this.userId ?? \"\");\n search.set(\"include_discarded\", \"false\");\n // -1 = unlimited; the legacy API default silently truncates\n // transcripts to their first 100 segments.\n search.set(\"max_transcript_segments\", \"-1\");\n // Repeated param (FastAPI List[str]) — comma-joining does NOT work.\n search.append(\"statuses\", \"completed\");\n payload = await this.requestJson(\n `/v2/integrations/${encodeURIComponent(this.appId ?? \"\")}/conversations?${search.toString()}`,\n params.signal,\n );\n }\n const conversations =\n this.mode === \"developer\"\n ? payload\n : (payload as { conversations?: unknown }).conversations;\n if (!Array.isArray(conversations)) {\n throw new OmiApiError(\n this.mode === \"developer\"\n ? \"Omi API returned an unexpected conversations shape (expected array)\"\n : \"Omi API returned an unexpected conversations shape (missing conversations array)\",\n );\n }\n const valid = conversations.filter(\n (entry): entry is OmiConversation =>\n entry !== null &&\n typeof entry === \"object\" &&\n typeof (entry as { id?: unknown }).id === \"string\",\n )\n .filter(isCompletedOrStatuslessConversation)\n .filter((conversation) =>\n startsInsideHalfOpenWindow(conversation, params.startIso, params.endIso),\n );\n return {\n conversations: valid,\n nextOffset: conversations.length === PAGE_SIZE ? offset + PAGE_SIZE : null,\n };\n }\n\n /** One page of Omi memories (provider-extracted facts). */\n async listMemories(params: {\n offset?: number;\n signal?: AbortSignal;\n } = {}): Promise<OmiMemoriesPage> {\n const offset = params.offset ?? 0;\n const search = new URLSearchParams({\n limit: String(PAGE_SIZE),\n offset: String(offset),\n });\n let payload: unknown;\n if (this.mode === \"developer\") {\n payload = await this.requestJson(\n `/v1/dev/user/memories?${search.toString()}`,\n params.signal,\n );\n } else {\n search.set(\"uid\", this.userId ?? \"\");\n payload = await this.requestJson(\n `/v2/integrations/${encodeURIComponent(this.appId ?? \"\")}/memories?${search.toString()}`,\n params.signal,\n );\n }\n const memories =\n this.mode === \"developer\" ? payload : (payload as { memories?: unknown }).memories;\n if (!Array.isArray(memories)) {\n throw new OmiApiError(\n this.mode === \"developer\"\n ? \"Omi API returned an unexpected memories shape (expected array)\"\n : \"Omi API returned an unexpected memories shape (missing memories array)\",\n );\n }\n const valid = memories.filter(\n (entry): entry is OmiMemory =>\n entry !== null &&\n typeof entry === \"object\" &&\n typeof (entry as { id?: unknown }).id === \"string\",\n );\n return {\n memories: valid,\n nextOffset: memories.length === PAGE_SIZE ? offset + PAGE_SIZE : null,\n };\n }\n\n async verifyAuth(signal?: AbortSignal): Promise<{ ok: boolean; detail?: string }> {\n try {\n const search = new URLSearchParams({\n limit: \"1\",\n offset: \"0\",\n });\n if (this.mode === \"developer\") {\n search.set(\"include_transcript\", \"false\");\n await this.requestJson(\n `/v1/dev/user/conversations?${search.toString()}`,\n signal,\n );\n } else {\n search.set(\"uid\", this.userId ?? \"\");\n search.set(\"max_transcript_segments\", \"1\");\n await this.requestJson(\n `/v2/integrations/${encodeURIComponent(this.appId ?? \"\")}/conversations?${search.toString()}`,\n signal,\n );\n }\n return { ok: true };\n } catch (err) {\n if (err instanceof OmiApiError && err.status !== undefined) {\n // The auth chain yields distinct, actionable detail strings.\n // Legacy integration mode can also surface app/user capability\n // failures, so keep those hints mode-specific.\n const hint =\n err.status === 401\n ? \"missing/malformed Authorization header\"\n : err.status === 403\n ? this.mode === \"developer\"\n ? \"Developer API key rejected or missing conversation access\"\n : \"key rejected, app not enabled for this uid, or missing read_conversations capability\"\n : err.status === 404\n ? this.mode === \"developer\"\n ? \"Developer API endpoint not found — check the configured baseUrl\"\n : \"app not found — check wearables.sources.omi.appId\"\n : undefined;\n return {\n ok: false,\n detail: [err.detail, hint].filter(Boolean).join(\" — \") || err.message,\n };\n }\n // OmiApiError messages are our own constructed strings (already\n // scrubbed — network text is reduced to name + code inside\n // requestJson); foreign errors reduce to name + errno code so raw\n // Node text (paths, loader stacks) never reaches operator\n // surfaces.\n return {\n ok: false,\n detail: err instanceof OmiApiError ? err.message : describeNetworkError(err),\n };\n }\n }\n\n private async requestJson(pathAndQuery: string, signal?: AbortSignal): Promise<unknown> {\n let lastError: unknown;\n for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {\n signal?.throwIfAborted();\n const timeoutSignal = AbortSignal.timeout(this.timeoutMs);\n const combined = signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal;\n let response: Response;\n try {\n response = await this.fetchImpl(`${this.baseUrl}${pathAndQuery}`, {\n method: \"GET\",\n headers: {\n Authorization: `Bearer ${this.apiKey}`,\n Accept: \"application/json\",\n },\n signal: combined,\n });\n } catch (err) {\n if (signal?.aborted) throw err;\n lastError = err;\n if (attempt < MAX_RETRIES) {\n await this.sleep(backoffMs(attempt));\n continue;\n }\n throw new OmiApiError(\n `Omi API request failed after ${MAX_RETRIES + 1} attempts: ${describeNetworkError(err)}`,\n );\n }\n\n if (response.status === 429 || response.status >= 500) {\n lastError = new OmiApiError(\n `Omi API responded ${response.status}`,\n response.status,\n await readDetail(response),\n );\n if (attempt < MAX_RETRIES) {\n await this.sleep(retryDelayMs(response, attempt));\n continue;\n }\n throw lastError;\n }\n if (!response.ok) {\n throw new OmiApiError(\n `Omi API responded ${response.status} for ${pathAndQuery.split(\"?\")[0]}`,\n response.status,\n await readDetail(response),\n );\n }\n try {\n return await response.json();\n } catch {\n throw new OmiApiError(\"Omi API returned a non-JSON body\");\n }\n }\n throw lastError instanceof Error ? lastError : new OmiApiError(\"Omi API request failed\");\n }\n}\n\n/**\n * Network/timeout failures wrap Node error text that can carry loader\n * paths or stack fragments; sync errors reach MCP clients verbatim, so\n * only the error name + code survive.\n */\nfunction describeNetworkError(err: unknown): string {\n if (!(err instanceof Error)) return \"unexpected non-Error failure\";\n const code = (err as NodeJS.ErrnoException).code;\n return typeof code === \"string\" && code.length > 0 ? `${err.name} (${code})` : err.name;\n}\n\n/** Loop instead of `/\\/+$/` — CodeQL js/polynomial-redos on user-set URLs. */\nfunction stripTrailingSlashes(value: string): string {\n let end = value.length;\n while (end > 0 && value.charCodeAt(end - 1) === 0x2f) end--;\n return value.slice(0, end);\n}\n\nfunction startsInsideHalfOpenWindow(\n conversation: OmiConversation,\n startIso: string,\n endIso: string,\n): boolean {\n const startMs = Date.parse(startIso);\n const endMs = Date.parse(endIso);\n if (!Number.isFinite(startMs) || !Number.isFinite(endMs)) return true;\n\n const conversationIso =\n typeof conversation.started_at === \"string\"\n ? conversation.started_at\n : conversation.created_at;\n if (typeof conversationIso !== \"string\" || conversationIso.length === 0) {\n return true;\n }\n const conversationMs = Date.parse(conversationIso);\n if (!Number.isFinite(conversationMs)) return true;\n return conversationMs >= startMs && conversationMs < endMs;\n}\n\nfunction isCompletedOrStatuslessConversation(conversation: OmiConversation): boolean {\n if (typeof conversation.status !== \"string\" || conversation.status.length === 0) {\n return true;\n }\n return conversation.status === \"completed\";\n}\n\nasync function readDetail(response: Response): Promise<string | undefined> {\n try {\n const body = (await response.clone().json()) as { detail?: unknown };\n return typeof body?.detail === \"string\" ? body.detail : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction backoffMs(attempt: number): number {\n return Math.min(MAX_RETRY_DELAY_MS, 1_000 * 2 ** attempt);\n}\n\nfunction retryDelayMs(response: Response, attempt: number): number {\n const headerValue = response.headers.get(\"retry-after\");\n if (headerValue !== null) {\n const parsed = Number(headerValue);\n if (Number.isFinite(parsed) && parsed > 0) {\n return Math.min(MAX_RETRY_DELAY_MS, Math.ceil(parsed * 1_000));\n }\n }\n return backoffMs(attempt);\n}\n","/**\n * Normalize Omi conversations into Remnic's provider-agnostic\n * `WearableConversation` shape, plus the timezone-aware day-window\n * helpers the Omi API needs (its date filters are ISO datetimes).\n *\n * Legacy Omi integration segments carry `is_user` for the wearer,\n * opaque `SPEAKER_NN` diarization labels, optional `person_id`s\n * (user-defined people), and start/end offsets in seconds relative to\n * the conversation start. The current Developer API returns\n * `speaker_name`/`speaker_id` instead; normalize both shapes.\n */\n\nimport type {\n WearableConversation,\n WearableNativeMemory,\n WearableTranscriptSegment,\n} from \"@remnic/core\";\n\nimport type { OmiConversation, OmiMemory } from \"./client.js\";\n\nexport const OMI_SOURCE_ID = \"omi\";\n\n/** \"GMT+05:30\" → \"+05:30\"; plain \"GMT\" → \"+00:00\". */\nexport function timezoneOffsetIso(instant: Date, timezone: string): string {\n try {\n const parts = new Intl.DateTimeFormat(\"en-US\", {\n timeZone: timezone,\n timeZoneName: \"longOffset\",\n }).formatToParts(instant);\n const name = parts.find((part) => part.type === \"timeZoneName\")?.value ?? \"GMT\";\n const match = name.match(/GMT([+-]\\d{2}:\\d{2})?/);\n return match?.[1] ?? \"+00:00\";\n } catch {\n return \"+00:00\";\n }\n}\n\n/** ISO instant for local midnight of `date` in `timezone`. */\nexport function zonedDayStartIso(date: string, timezone: string): string {\n // Two-pass offset resolution: guess from midday (stable away from DST\n // transitions), then re-derive at the candidate midnight itself.\n let offset = timezoneOffsetIso(new Date(`${date}T12:00:00Z`), timezone);\n const candidate = new Date(`${date}T00:00:00${offset}`);\n const refined = timezoneOffsetIso(candidate, timezone);\n if (refined !== offset) {\n offset = refined;\n }\n return `${date}T00:00:00${offset}`;\n}\n\nexport function nextIsoDate(date: string): string {\n const parsed = new Date(`${date}T00:00:00Z`);\n parsed.setUTCDate(parsed.getUTCDate() + 1);\n return parsed.toISOString().slice(0, 10);\n}\n\n/** Half-open [start, end) ISO bounds of a local day. */\nexport function zonedDayBounds(\n date: string,\n timezone: string,\n): { startIso: string; endIso: string } {\n return {\n startIso: zonedDayStartIso(date, timezone),\n endIso: zonedDayStartIso(nextIsoDate(date), timezone),\n };\n}\n\nexport function conversationToWearable(\n conversation: OmiConversation,\n): WearableConversation {\n const startedAtMs = conversation.started_at\n ? Date.parse(conversation.started_at)\n : Number.NaN;\n const segments: WearableTranscriptSegment[] = [];\n for (const segment of conversation.transcript_segments ?? []) {\n const text = typeof segment.text === \"string\" ? segment.text.trim() : \"\";\n if (text.length === 0) continue;\n const isWearer = segment.is_user === true;\n const personId =\n typeof segment.person_id === \"string\" && segment.person_id.length > 0\n ? segment.person_id\n : undefined;\n const speakerId =\n typeof segment.speaker_id === \"string\" || typeof segment.speaker_id === \"number\"\n ? String(segment.speaker_id)\n : undefined;\n const label =\n typeof segment.speaker_name === \"string\" && segment.speaker_name.trim().length > 0\n ? segment.speaker_name.trim()\n : typeof segment.speaker === \"string\" && segment.speaker.trim().length > 0\n ? segment.speaker.trim()\n : undefined;\n const startIso =\n !Number.isNaN(startedAtMs) && typeof segment.start === \"number\"\n ? new Date(startedAtMs + segment.start * 1_000).toISOString()\n : undefined;\n const endIso =\n !Number.isNaN(startedAtMs) && typeof segment.end === \"number\"\n ? new Date(startedAtMs + segment.end * 1_000).toISOString()\n : undefined;\n segments.push({\n text,\n // person_id is the most stable key when the user has tagged the\n // speaker as a known person in Omi. The Developer API's\n // speaker_id is the next best stable key, then the diarization\n // label.\n speakerKey: isWearer ? \"user\" : (personId ?? speakerId ?? label ?? \"unknown\"),\n ...(label !== undefined ? { speakerName: label } : {}),\n ...(isWearer ? { isWearer: true } : {}),\n ...(startIso !== undefined ? { startIso } : {}),\n ...(endIso !== undefined ? { endIso } : {}),\n });\n }\n\n const title = conversation.structured?.title?.trim();\n const overview = conversation.structured?.overview?.trim();\n const address = conversation.geolocation?.address;\n\n return {\n id: conversation.id,\n source: OMI_SOURCE_ID,\n ...(title && title.length > 0 ? { title } : {}),\n ...(overview && overview.length > 0 ? { summary: overview } : {}),\n startIso: conversation.started_at ?? conversation.created_at ?? \"\",\n ...(conversation.finished_at !== undefined\n ? { endIso: conversation.finished_at }\n : {}),\n ...(typeof address === \"string\" && address.length > 0\n ? { location: address }\n : {}),\n segments,\n };\n}\n\nexport function memoryToNativeMemory(memory: OmiMemory): WearableNativeMemory | null {\n const content = typeof memory.content === \"string\" ? memory.content.trim() : \"\";\n if (content.length === 0) return null;\n return {\n id: memory.id,\n content,\n ...(memory.created_at !== undefined ? { createdIso: memory.created_at } : {}),\n ...(Array.isArray(memory.tags) && memory.tags.length > 0\n ? { tags: memory.tags }\n : {}),\n };\n}\n"],"mappings":";;;AAeA;AAAA,EACE;AAAA,OAOK;;;ACFA,IAAM,uBAAuB;AAEpC,IAAM,qBAAqB;AAC3B,IAAM,cAAc;AACpB,IAAM,qBAAqB;AAE3B,IAAM,YAAY;AA4DX,IAAM,cAAN,cAA0B,MAAM;AAAA,EACrC,YACE,SACS,QAEA,QACT;AACA,UAAM,OAAO;AAJJ;AAEA;AAGT,SAAK,OAAO;AAAA,EACd;AAAA,EANW;AAAA,EAEA;AAKb;AAEO,IAAM,YAAN,MAAgB;AAAA,EACJ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEjB,YAAY,SAA2B;AACrC,QAAI,OAAO,QAAQ,WAAW,YAAY,QAAQ,OAAO,KAAK,EAAE,WAAW,GAAG;AAC5E,YAAM,IAAI;AAAA,QACR;AAAA,MAGF;AAAA,IACF;AAEA,UAAM,QACJ,OAAO,QAAQ,UAAU,YAAY,QAAQ,MAAM,KAAK,EAAE,SAAS,IAC/D,QAAQ,MAAM,KAAK,IACnB;AACN,UAAM,SACJ,OAAO,QAAQ,WAAW,YAAY,QAAQ,OAAO,KAAK,EAAE,SA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,MAAM;AAAA,QACrC,QAAQ,KAAK;AAAA,MACf,CAAC;AACD,YAAM,WAAW,CAAC;AAClB,iBAAW,UAAU,KAAK,UAAU;AAClC,cAAM,SAAS,qBAAqB,MAAM;AAC1C,YAAI,WAAW,KAAM,UAAS,KAAK,MAAM;AAAA,MAC3C;AACA,aAAO;AAAA,QACL;AAAA,QACA,YAAY,KAAK,eAAe,OAAO,OAAO,KAAK,UAAU,IAAI;AAAA,MACnE;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,gCAA+D;AAAA,EAC1E,IAAI;AAAA,EACJ,aAAa;AAAA,EACb,SAAS;AACX;AAOO,IAAM,+BACX,8BAA8B,6BAA6B;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/connector-omi",
|
|
3
|
-
"version": "9.69.
|
|
3
|
+
"version": "9.69.24",
|
|
4
4
|
"description": "Omi AI wearable connector for Remnic — pull, clean, and remember necklace transcripts via the Omi Developer API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"provenance": true
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@remnic/core": "^9.69.
|
|
22
|
+
"@remnic/core": "^9.69.24"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"tsup": "^8.0.0",
|
|
26
26
|
"typescript": "^5.7.0",
|
|
27
27
|
"tsx": "^4.0.0",
|
|
28
|
-
"@remnic/core": "9.69.
|
|
28
|
+
"@remnic/core": "9.69.24"
|
|
29
29
|
},
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"repository": {
|