import { e as executeCliAction } from './cli-action-DQcaqcfn.js';
import { json } from '@sveltejs/kit';
import './spawn-cli-wI1lBJhm.js';
import 'node:child_process';

//#region src/routes/api/project/[id]/+server.ts
/**
* DELETE /api/project/[id]
*
* Removes a project from the global nexus.db registry by calling:
*   `cleo nexus projects remove <id> --json`
*
* Returns a LAFS envelope on success or a 4xx with structured error envelope on CLI failure.
*
* @task T722
*/
var DELETE = async ({ params }) => {
	const projectId = params.id;
	if (!projectId?.trim()) return json({
		success: false,
		error: {
			code: "E_MISSING_ID",
			message: "Missing project id"
		}
	}, { status: 400 });
	return executeCliAction([
		"nexus",
		"projects",
		"remove",
		projectId,
		"--json"
	], {
		errorCode: "E_DELETE_FAILED",
		meta: { projectId }
	});
};

export { DELETE };
//# sourceMappingURL=_server.ts-DSAv66wD.js.map
