/** * TeamBrain — a Brain shared through the repo itself, one reviewed file per memory. * * brain_export/brain_import already move memories between machines, but every evidence key is * an absolute path (`/Users/alice/app/src/auth.ts`), so on a teammate's checkout none of them * resolve and every imported memory reads as stale until someone re-anchors it by hand — which * certifies, blind, something another person wrote. The content hash is portable; the path is * not. This module rewrites evidence keys relative to the repo root on the way out and back onto * the local root on the way in, hashes untouched: a memory about a file that is byte-identical on * both machines arrives *fresh*, and one about a file that has moved on arrives honestly stale. * * Layout: `.lemma-brain/memories/.json`, sorted keys, indented. One file per memory so two * people sharing at once never conflict on an add, a deletion is a `git rm`, and every shared * memory goes through the same PR review as the code it describes. `.lemma/` is gitignored by * `lemma init`, and git can't un-ignore a child of an ignored directory, hence a sibling dir. * * Publishing is always explicit (push). Pulling is safe to automate (post-merge hook): it only * adds verifiable memories, and it only ever deletes ones this clone received from the team. */ import { TheBrainV2 } from './TheBrainV2'; export declare const TEAM_DIR = ".lemma-brain"; export interface TeamSkip { id: string; query: string; reason: string; } export interface TeamPushResult { ok: boolean; dir: string; written: string[]; unchanged: number; removed: string[]; skipped: TeamSkip[]; dryRun: boolean; message: string; } export interface TeamPullResult { ok: boolean; dir: string; imported: number; updated: number; unchanged: number; removed: string[]; rejected: TeamSkip[]; fresh: number; stale: number; dryRun: boolean; message: string; } export interface TeamStatus { ok: boolean; dir: string; exists: boolean; inRepo: number; publishable: number; notYetShared: TeamSkip[]; notYetPulled: string[]; message: string; } /** The repo root git reports (already realpath'd), or the given dir outside a repo. */ export declare function repoRoot(cwd?: string): string; /** * Write this project's publishable memories into `.lemma-brain/memories/`. Nothing is committed: * the files show up in `git status` and go through review like any other change. */ export declare function pushTeamBrain(cwd?: string, opts?: { dryRun?: boolean; brain?: TheBrainV2; }): TeamPushResult; /** * Import the repo's shared memories into this machine's Brain, evidence rebased onto this * checkout. Safe to run on every merge/checkout: it is a no-op (no snapshot, no write) when * nothing changed. */ export declare function pullTeamBrain(cwd?: string, opts?: { dryRun?: boolean; brain?: TheBrainV2; }): TeamPullResult; export declare function teamBrainStatus(cwd?: string, opts?: { brain?: TheBrainV2; }): TeamStatus; //# sourceMappingURL=TeamBrain.d.ts.map