histoire
Version:
A fast story book powered by Vite
20 lines • 1.08 kB
TypeScript
import type { SessionNotification } from '@agentclientprotocol/sdk';
import type { AcpFileChange } from './types.js';
/** Counts line edits with bounded LCS work; large replacements use their changed span. */
export declare function countChangedLines(before: string, after: string): {
added: number;
removed: number;
};
/**
* Projects an agent-reported path relative to the project root.
* @returns `undefined` for the root itself, paths escaping it, or overly long paths.
*/
export declare function projectRelativePath(root: string, file: string): string | undefined;
/** Collects completed agent-reported diffs; Histoire does not mutate source files. */
export declare function createAgentFileChanges(root: string, sanitize: (text: string) => string): {
/** Tracks tool updates belonging to a manager's already validated active session. */
update(notification: SessionNotification): void;
/** Projects only completed tools; pending/failed edit proposals are not changes. */
snapshot(): AcpFileChange[];
};
//# sourceMappingURL=file-changes.d.ts.map