// tools/session-checkpoint.ts — Manual trigger for session checkpoint (SPEC-563).
import { sessionTracker } from '../engine/session/session-tracker.js';
import { writeCheckpoint } from '../engine/session/checkpoint-writer.js';
import { compactResult } from './output-formatter.js';
/**
 * Handle the session_checkpoint tool.
 * Writes a checkpoint immediately regardless of the call-count threshold.
 */
export async function handleSessionCheckpoint(args) {
    const snapshot = sessionTracker.getSnapshot();
    await writeCheckpoint(args.projectPath, snapshot);
    return compactResult(`Session checkpoint written to ${args.projectPath}/planu/session-context.md\n` +
        `Calls recorded: ${String(snapshot.callCount)}, ` +
        `files tracked: ${String(snapshot.modifiedFiles.length)}.`);
}
//# sourceMappingURL=session-checkpoint.js.map