import { r as readAuditLog } from './audit-log-BXVi9iyE.js';
import { json } from '@sveltejs/kit';
import 'node:fs';
import 'node:path';

//#region src/routes/api/project/audit/+server.ts
/**
* GET /api/project/audit
*
* Returns the trailing N audit entries from
* `<projectPath>/.cleo/audit/studio-actions.jsonl` (newest first).
*
* Query string:
*   - `limit` — max entries to return (default 50, cap 500).
*
* @task T990
* @wave 1E
*/
var GET = ({ url, locals }) => {
	const raw = url.searchParams.get("limit");
	let limit = 50;
	if (raw) {
		const parsed = Number.parseInt(raw, 10);
		if (Number.isFinite(parsed) && parsed > 0) limit = Math.min(parsed, 500);
	}
	return json({
		success: true,
		data: {
			entries: readAuditLog(locals.projectCtx.projectPath, limit),
			projectPath: locals.projectCtx.projectPath
		}
	});
};

export { GET };
//# sourceMappingURL=_server.ts-Cz0zgaUV.js.map
