import type { ProjectMemoryLoad } from "@sema-agent/core"; interface ProjectMemoryCtx { cwd: string; handsEnabled: boolean; isSubagent: boolean; agentName?: string; sessionId?: string; phase?: "fresh" | "resume" | "post-compact" | "post-clear"; } /** * Build a `loadProjectMemory` for the host lane. Returns null (skip) unless hands are enabled AND cwd is a local * directory. Reads the instruction-file chain (AGENTS.md → CLAUDE.md → .claude/CLAUDE.md, S-1) + (non-subagent) * `git log -5` / `git status`, redacts secrets, and caps the total. A subagent gets a trimmed instruction file and * no git narrative (cost control, H7). When an instruction file is hit the return is a `ProjectMemoryLoad` * declaring it in `instructionSources` (path + sha256 over the raw bounded-read window) so core's * instructions-change lane can probe it mid-run. * * Session snapshot cache (S-2): keyed on ctx.sessionId — a session keeps ONE stable instruction snapshot * (mid-run file edits surface via the probe as tail attachments, never a silently re-rendered prefix). * `phase: "post-compact"` forces a re-read (core re-renders the prefix there anyway). No entry for * sessionless one-shot runs. (post-clear never arrives from core — [ref] — so it is not a cache key here.) */ export declare function makeLoadProjectMemory(opts: { logger?: { debug?: (msg: string, data: Record) => void; }; maxBytes?: number; /** TEST-ONLY: shrink the snapshot-cache bound so the settle-time trim is observable without 256 sessions. */ cacheMax?: number; }): (ctx: ProjectMemoryCtx) => Promise; /** * ② The `RunnerDeps.probeInstructionSources` seam: re-fingerprint the declared instruction files mid-run so * core's instructions-change lane can append a tail attachment when one changes. Same read posture as the * loader (lstat symlink gate → bounded read of the first `INSTRUCTION_READ_CAP` bytes → sha256) — any drift * here would fabricate phantom "changed" signals every turn. Per-source failure → `contentHash: null` * (source gone/unreadable); any unexpected top-level failure → `null` (probe abstains; core also races this * against a 2s ceiling and treats a throw as null, but we stay honest on our side of the seam). */ export declare function makeProbeInstructionSources(): NonNullable; export {}; //# sourceMappingURL=project-memory.d.ts.map