import type { Entry } from '../core/EntrySchema.js'; import type { ProfileManager } from '../core/ProfileManager.js'; import type { SyncStatusStore, SyncStatusFile } from '../status/SyncStatusStore.js'; import type { ContextResumeOptions, ContextResumeResult } from '../context/ContextRestoreService.js'; import type { Clock } from '../shared/Clock.js'; import type { AuditTrail } from '../audit/AuditTrail.js'; import { type PolicyConfig } from '../policy/PolicyEngine.js'; /** * Minimal interface required by BrainContract for sync operations. * The real SyncEngine must be wrapped to match this shape (see cli.ts adapter). */ export interface SyncEngine { pull(): Promise<{ pulled: boolean; status: string; }>; push(): Promise<{ pushed: boolean; status: string; }>; } export interface QueryFilter { category?: string; source?: string; since?: string; contentQuery?: string; tags?: string[]; } export interface BrainContractConfig { profileManager: ProfileManager; statusStore: SyncStatusStore; clock?: Clock; syncEngine?: SyncEngine | null; auditTrail?: AuditTrail; policyConfig?: PolicyConfig; } /** * Thin Contract v0.1 — Public API for aigentry-brain. * * 8 operations: append, query, syncStatus, erase, contextResume, health, appendBatch, eraseBatch */ export declare class BrainContract { private profileManager; private statusStore; private restoreService; private syncEngine; private auditTrail; private policyEngine; constructor(config: BrainContractConfig); /** Append a new entry (or update existing by id). */ append(partial: Partial & { category: string; content: string; source: string; }): Promise; /** Query entries with optional filters. Returns active (non-deleted) entries. */ query(filter?: QueryFilter): Promise; /** Get current sync status. */ syncStatus(): Promise; /** Soft-delete an entry by id. Returns true if deleted, false if not found. */ erase(id: string): Promise; /** Restore context from synced profile for AI consumption. */ contextResume(options: ContextResumeOptions): Promise; /** Get system health report. */ health(): Promise<{ profileAccessible: boolean; entryCount: number; syncStatus: string; uptimeMs: number; }>; /** Append multiple entries in a single operation (single read + N mutations + single write). */ appendBatch(items: Array & { category: string; content: string; source: string; }>): Promise; /** Pull changes from remote repository. */ syncPull(): Promise<{ pulled: boolean; status: string; }>; /** Push local changes to remote repository. */ syncPush(): Promise<{ pushed: boolean; status: string; }>; /** Soft-delete multiple entries by id. Returns count of successfully deleted. */ eraseBatch(ids: string[]): Promise<{ deleted: number; total: number; }>; }