/** * MAMA Core API initialization. * * Extracted from cli/commands/start.ts to keep the orchestrator thin. * All logic and function signatures are unchanged. * * Responsibilities: * 1. Dynamically require mama-core (initDB, getAdapter, mamaCore) * 2. Wire up connectorExtractionFn through the configured backend (lazy-init + lifecycle) * 3. Normalize the MAMA API shape into mamaApi * 4. Build search() / searchForContext() wrapper functions with fallback handling * 5. Build loadCheckpointForContext / listDecisionsForContext wrappers * 6. Assemble and return the mamaApiClient object */ import type { MAMAConfig } from '../config/types.js'; import type { IModelRunner } from '../../agent/model-runner.js'; import type { MamaApiClient } from '../../gateways/context-injector.js'; import type { MAMAApiSetInput } from '../../agent/types.js'; /** * Result returned by initMamaCore. */ export interface MamaCoreInitResult { mamaApi: MAMAApiSetInput; mamaApiClient: MamaApiClient; connectorExtractionFn: ((prompt: string) => Promise) | null; stopExtraction: () => Promise; } export interface BackendExtractionSession { extractParsed(prompt: string): Promise; extractRaw(prompt: string): Promise; stop(): Promise; } export declare function createBackendExtractionSession(createRunner: () => IModelRunner, parseResponse: (response: string) => unknown): BackendExtractionSession; /** * Initialize the MAMA Core API. * * Reads `config.database.path`, boots the mama-core DB, sets up the * connector extraction process (if supported), normalises the API shape, * and returns the three values that the rest of runAgentLoop() consumes. */ export declare function initMamaCore(config: MAMAConfig, createExtractionRunner?: () => IModelRunner): Promise; //# sourceMappingURL=mama-core-init.d.ts.map