/** * Connector framework initialization for MAMA OS. * * Extracted from cli/commands/start.ts to keep the orchestrator thin. * All logic and function signatures are unchanged. * * Responsibilities: * 1. Loads ~/.mama/connectors.json * 2. Auto-enables claude-code connector (local, no auth needed) * 3. Builds per-source channel config map * (kagemusha channels are distributed by source prefix) * 4. Instantiates each enabled connector (loadConnector + init + register) * 5. Runs M0 LLM extraction kill switch plus deterministic raw-backed memory indexing * 6. Starts connectorScheduler.startBatch() with unified 60-min polling * 7. Returns rawStore + enabledConnectorNames + connectorSchedulerStop for the caller * * Direct LLM connector-to-memory extraction is disabled in M0. The surviving * write paths here are entityObservationStore.upsertEntityObservations() and * deterministic raw-backed memory indexing with source evidence links. */ import { type RawStore } from '../../connectors/framework/raw-store.js'; import type { ConnectorConfigLoadResult } from '../../connectors/config-loader.js'; /** * Resolve the unified connector batch poll cadence in minutes (M2.4). * * UNSET or empty/whitespace -> 60 (the historical default; a documented default, NOT a * fallback-after-failure). A SET value must parse to a finite number > 0, otherwise this throws at * startup (no-fallback: never silently default a bad value). Fractional values are allowed (for * example "0.25" == 15s) so live verification can force a short cadence. */ export declare function resolvePollMinutes(raw: string | undefined): number; /** * Result returned by initConnectors. */ export interface ConnectorInitResult { rawStoreForApi: RawStore | undefined; enabledConnectorNames: string[]; /** Stop function for connectorScheduler; undefined if no connectors are active. */ connectorSchedulerStop: (() => void) | undefined; } export interface ConnectorInitOptions { /** Validated connector configuration captured once by the startup owner. */ connectorConfigLoadResult: ConnectorConfigLoadResult; /** * M2.4 freshness nudge. Called best-effort whenever a poll batch indexes >= 1 item into * connector_event_index, so the trigger loop can tick soon instead of waiting for its next * interval. Late-bound by the caller (the loop is constructed AFTER initConnectors returns), so * this is a stable forwarder that no-ops until the loop exists. Pure timing signal. */ nudge?: () => void; } /** * Initialize the connector framework. * * Reads ~/.mama/connectors.json, registers enabled connectors, * wires connector polling with the M0 LLM extraction kill switch, and starts polling. * * @deprecated The legacy direct LLM connector-to-memory extraction argument is ignored in M0. * Callers should pass null and rely on the raw/entity-observation connector pipeline. */ export declare function initConnectors( /** @deprecated Direct LLM connector-to-memory extraction is disabled in M0. */ _connectorExtractionFn: ((prompt: string) => Promise) | null, options: ConnectorInitOptions): Promise; //# sourceMappingURL=connector-init.d.ts.map