/** * The main brain: observations and decisions in the GLOBAL `cleo.db`, which * the account's `home:` stream syncs across devices (T13370). * * Writes go through the global accessors in `store/memory-accessor.ts`, each * in one capture frame, so capture records them and the sealer seals them * onto the home stream. Reads tag every entry `scope: 'global'` so project * memory commands can list them alongside project entries. * * The project-scope pipeline (writer thread, extraction gate, graph nodes, * embeddings) stays project-only: it is bound to a project store. * * @task T13720 * @module memory/global-brain */ import type { BrainCompactHit, FetchedBrainEntry, ObserveBrainResult } from '@cleocode/contracts'; /** * Save an observation to the main brain (global store). * * @param params - Observation text plus optional title, type, agent and source type. * @returns The new observation's id, type and creation time, tagged `scope: 'global'`; when the * same text is already in the main brain, that entry's id with `stored: false` (T13949). * @example * ```ts * const { id } = await observeGlobalBrain({ text: 'pnpm 11 reads only pnpm_config_*' }); * ``` */ export declare function observeGlobalBrain(params: { text: string; title?: string; type?: string; agent?: string; sourceType?: string; }): Promise; /** * Store a decision in the main brain (global store) with the next `Dnnn` id. * A colliding id from another device is re-minted by sync's collision settle. * * @param params - Decision, rationale and optional lifecycle fields. * @returns The new decision's id and creation time, tagged `scope: 'global'`. * @example * ```ts * const { id } = await storeGlobalDecision({ decision: 'Use pnpm', rationale: 'workspaces' }); * ``` */ export declare function storeGlobalDecision(params: { decision: string; rationale: string; alternatives?: string[]; adrPath?: string | null; confirmationState?: 'proposed' | 'accepted' | 'superseded'; decidedBy?: 'owner' | 'council' | 'agent'; }): Promise<{ id: string; type: string; decision: string; createdAt: string; scope: 'global'; }>; /** * Search the main brain's current observations and decisions by substring. * * shortcut: LIKE match, no FTS or ranking; add the global store to the hybrid * search when the main brain grows past a few thousand rows. * * @param query - Text to match against titles and bodies. * @param opts - Result limit, table filter and whether to include retired entries. * @returns Compact hits, newest first, each tagged `scope: 'global'`. */ export declare function findGlobalBrain(query: string, opts?: { limit?: number; tables?: readonly string[]; includeHistory?: boolean; }): Promise; /** * The main brain's accepted, current decisions, newest first (briefing guidance). * * @param limit - Maximum decisions returned. * @returns Compact hits tagged `scope: 'global'`. */ export declare function listAcceptedGlobalDecisions(limit: number): Promise; /** * Fetch full main-brain rows by id (observations and decisions). * * @param ids - Entry ids; ids that are neither `O-…` nor `D…` are skipped. * @returns The rows found, tagged `scope: 'global'`. */ export declare function fetchGlobalBrain(ids: readonly string[]): Promise; //# sourceMappingURL=global-brain.d.ts.map