/** * file-author-tracker — JSON-based tracking of which agent created/edited files. * * Stores a per-project JSON log in the global project directory: * ~/.wrongstack/projects//file-authors.json * * Each entry records: file path, action (create|edit), agent id/name, * timestamp, and optional session id. * * Used by the tech-stack agent and other coordination tools to know * who touched what, so warnings can be routed to the right agent. * * @module file-author-tracker */ export interface FileAuthorEntry { /** Absolute or relative file path. */ filePath: string; /** What happened to the file. */ action: 'create' | 'edit' | 'delete'; /** Agent id (e.g. 'leader', 'tech-stack', 'executor'). */ agentId: string; /** Human-readable agent name. */ agentName?: string | undefined; /** Session that performed the action. */ sessionId?: string | undefined; /** ISO8601 timestamp. */ timestamp: string; /** Optional commit hash if known. */ commitHash?: string | undefined; } export interface FileAuthorLog { /** Project root this log belongs to. */ projectRoot: string; /** All entries, newest last. */ entries: FileAuthorEntry[]; /** Last time the log was compacted (old entries archived). */ lastCompactedAt?: string | undefined; } export interface FileAuthorTrackerOptions { /** Directory where the JSON log is stored. Usually the global project dir. */ storageDir: string; /** Project root for reference. */ projectRoot: string; /** Max entries before auto-compaction. Default: 5000. */ maxEntries?: number | undefined; } /** * Record that an agent created, edited, or deleted a file. */ export declare function recordFileAction(opts: FileAuthorTrackerOptions, entry: Omit): Promise; /** * Get the most recent author entry for a given file path. * Returns undefined if no entry exists. */ export declare function getLastAuthor(opts: Pick, filePath: string): Promise; /** * Get all entries for a file, newest last. */ export declare function getFileHistory(opts: Pick, filePath: string): Promise; /** * Get all files last touched by a specific agent. */ export declare function getFilesByAgent(opts: Pick, agentId: string): Promise>; /** * Return the full log (for debugging/auditing). */ export declare function getFullLog(opts: Pick): Promise; /** * Compact the log by archiving old entries to a separate file. * Keeps the most recent `keepCount` entries in the active log. */ export declare function compactLog(opts: Pick, keepCount?: number): Promise<{ archived: number; kept: number; }>; //# sourceMappingURL=file-author-tracker.d.ts.map