UNPKG

@phren/cli

Version:

Knowledge layer for AI agents - CLI, MCP server, and data layer

17 lines (16 loc) • 1.13 kB
/** Prompts a bullet stays suppressed for after it was injected. */ export declare const REPEAT_WINDOW = 12; /** One session's injection history: its prompt counter and, per bullet hash, the prompt it was last injected at. */ export interface RecallSeen { prompt: number; seen: Record<string, number>; } /** Hash of the chunk selection chose, ignoring metadata comments, case and whitespace. */ export declare function bulletHash(chunk: string): string; export declare function readRecallSeen(phrenPath: string, sessionId: string): RecallSeen; /** Hashes injected within the last `window` prompts before the current one (`state.prompt`). */ export declare function recentlyInjected(state: RecallSeen, window?: number): Set<string>; /** Atomic and best-effort; drops entries that have left the window. */ export declare function writeRecallSeen(phrenPath: string, sessionId: string, state: RecallSeen, window?: number): void; /** After a compact or clear the injected bullets are gone from the agent's context, so they may come back. */ export declare function clearRecallSeen(phrenPath: string, sessionId: string): void;