/** * Validate that a runId is a safe path segment. * Rejects empty strings, strings containing path separators (/ or \), * strings containing '..', and absolute paths. * This is a security guard: a malicious runId must never escape .bober/runs. */ export declare function safeSegment(runId: string): boolean; /** * Check whether the run directory exists for the given runId. * Returns false if not found — never throws. * Mirrors approval-state.ts:pendingExists. */ export declare function hasRunDir(projectRoot: string, runId: string): Promise; /** * Append a guidance entry to .bober/runs//guidance.jsonl. * * Security: validates runId is a safe path segment BEFORE building any path. * Throws with a clear message if runId is unsafe (caller should surface to user). * * Existence: the run directory must already exist (guard with hasRunDir if * you want an unknown-run check; appendGuidance itself creates the dir for * robustness, but callers in chat-session.ts should guard first for UX). */ export declare function appendGuidance(projectRoot: string, runId: string, text: string): Promise; /** * Drain pending (unconsumed) guidance entries for a runId. * * Reads all lines, collects the text of entries where consumed !== true, * then atomically rewrites the file with ALL entries marked consumed:true * (temp-file + rename, mirrors run-state.ts:41-52). * * Returns the drained texts in order. * Missing file → returns [] (never throws — safe to call on every pipeline sprint). * Second drain → returns [] (all entries already marked consumed). */ export declare function drainGuidance(projectRoot: string, runId: string): Promise; //# sourceMappingURL=guidance.d.ts.map