import { WearableConversation, WearableConnectorFactoryOptions, WearableSourceConnector, WearableConnectorRegistration } from '@remnic/core'; import { ConnectorApiError } from '@remnic/core/http-retry'; /** * Minimal Limitless Developer API client (raw fetch, no SDK). * * Contract verified against https://www.limitless.ai/developers/docs/api * (2026-06): base https://api.limitless.ai, header `X-API-Key`, * `GET /v1/lifelogs` with cursor pagination at `meta.lifelogs.nextCursor` * and a hard per-page max of 10. Rate limit is 180 req/min; 429 bodies * carry `retryAfter` (a string, in seconds). * * The API key is never logged and never included in thrown error * messages. */ declare const LIMITLESS_DEFAULT_BASE_URL = "https://api.limitless.ai"; /** Hard API maximum for `limit` on /v1/lifelogs. */ declare const LIFELOGS_MAX_PAGE_SIZE = 10; interface LimitlessContentNode { type: string; content?: string; startTime?: string; endTime?: string; startOffsetMs?: number; endOffsetMs?: number; children?: LimitlessContentNode[]; speakerName?: string | null; speakerIdentifier?: "user" | null; } interface LimitlessLifelog { id: string; title?: string; markdown?: string | null; startTime?: string; endTime?: string; isStarred?: boolean; updatedAt?: string; contents?: LimitlessContentNode[]; } interface LifelogsPage { lifelogs: LimitlessLifelog[]; nextCursor: string | null; } interface LimitlessClientOptions { apiKey: string; baseUrl?: string; /** Injectable for tests. Defaults to global fetch. */ fetchImpl?: typeof fetch; /** Per-request timeout (ms). */ timeoutMs?: number; /** Injectable sleep for tests. */ sleep?: (ms: number) => Promise; } declare class LimitlessApiError extends ConnectorApiError { constructor(message: string, status?: number); } declare class LimitlessClient { private readonly apiKey; private readonly baseUrl; private readonly fetchImpl; private readonly timeoutMs; private readonly sleep; constructor(options: LimitlessClientOptions); /** One page of lifelogs for a single day. */ listLifelogs(params: { date: string; timezone: string; cursor?: string | null; signal?: AbortSignal; }): Promise; /** Cheap auth probe. */ verifyAuth(signal?: AbortSignal): Promise<{ ok: boolean; detail?: string; }>; private requestJson; } /** * Normalize Limitless lifelogs into Remnic's provider-agnostic * `WearableConversation` shape. * * Spoken dialogue lives in `blockquote` content nodes (possibly nested * under headings via `children`); heading nodes structure the lifelog * and are not utterances. The wearer is marked by * `speakerIdentifier === "user"`; everyone else carries a * `speakerName` ("Speaker 2" or a saved name). */ declare const LIMITLESS_SOURCE_ID = "limitless"; declare function lifelogToConversation(lifelog: LimitlessLifelog): WearableConversation; /** * @remnic/connector-limitless — Limitless.ai Pendant connector. * * À-la-carte optional companion of @remnic/core: installing core alone * never pulls this in; core discovers it at runtime via a * computed-specifier dynamic import (see wearables/registry.ts) or via * a direct import of this module, which self-registers idempotently. * * API key: `wearables.sources.limitless.apiKey`, else the * `REMNIC_LIMITLESS_API_KEY` / `LIMITLESS_API_KEY` environment * variables (checked in that order). */ declare function resolveLimitlessApiKey(configuredKey: string | undefined, env?: NodeJS.ProcessEnv): string | undefined; declare function createLimitlessConnector(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 ensureLimitlessConnectorRegistered: () => boolean; export { LIFELOGS_MAX_PAGE_SIZE, LIMITLESS_DEFAULT_BASE_URL, LIMITLESS_SOURCE_ID, type LifelogsPage, LimitlessApiError, LimitlessClient, type LimitlessClientOptions, type LimitlessContentNode, type LimitlessLifelog, createLimitlessConnector, ensureLimitlessConnectorRegistered, lifelogToConversation, resolveLimitlessApiKey, wearableConnectorRegistration };