/** * Agenticow shared loader + helpers. * * Extracted from `agenticow-tools.ts` so both the MCP tool surface AND the * `SwarmMemoryBranches` service (src/services/swarm-memory-branches.ts) share * one loader, one degradation contract, and one set of path/lineage helpers — * rather than duplicating the optional-dep dance in two places. * * Architectural constraint (ADR-150, mirrors metaharness-tools.ts): * - `agenticow` lives in `optionalDependencies` — never a hard runtime dep. * - When the package is missing, callers get `null` from `loadAgenticow()` * (or a `{degraded:true}` result via `degradedResult`) and MUST fall back * gracefully — never throw a MODULE_NOT_FOUND. * * @module @claude-flow/cli/mcp-tools/agenticow-loader */ export declare const PACKAGE_NAME = "agenticow"; export interface AgenticowApi { open: (file: string, opts?: { dimension?: number; metric?: string; }) => Promise; openBase?: (file: string, opts?: any) => Promise; AgenticMemory: any; } /** * Lazily import `agenticow`. Returns the module on success, or `null` when the * package is not installed (the optional-dep degraded path). Any OTHER load * error (e.g. a corrupt install) is re-thrown so it is not silently masked. */ export declare function loadAgenticow(): Promise; /** Reset the module-level load cache. Test-only seam. */ export declare function __resetAgenticowCache(): void; export declare function degradedResult(reason: string): { success: true; degraded: true; reason: string; }; /** * Resolve a user-supplied memory path against the project cwd, rejecting path * traversal and NUL bytes (D-2 style hardening — same rule the MCP verbs use). */ export declare function resolveMemoryPath(path: string): string; /** * Lineage manifest companion path. agenticow persists the COW chain * (working → checkpoints → base) into `.agenticow.json` next to the * `.rvf` data file. Without it, forks/checkpoints are in-memory only and * disappear when the AgenticMemory handle closes. */ export declare function manifestFor(file: string): string; /** Validate a COW branch/checkpoint label (alnum + a small safe symbol set). */ export declare function validateLabel(label: string): string; /** * Open (or create) a memory file, restoring its COW chain from the lineage * manifest when one exists. When neither the `.rvf` nor the manifest exists, * `dimension` is required to create a fresh base. */ export declare function openWithLineage(api: AgenticowApi, file: string, dimension?: number): Promise; //# sourceMappingURL=agenticow-loader.d.ts.map