import { OpenAPIHono } from "@hono/zod-openapi";
import { createProtectedRoute, noAuth } from "@inkeep/agents-core/middleware";

//#region src/routes/workflowProcess.ts
const workflowProcessHandler = new OpenAPIHono();
workflowProcessHandler.openapi(createProtectedRoute({
	method: "get",
	path: "/api/workflow/process",
	tags: ["Workflows"],
	summary: "Process workflow jobs",
	description: "Keeps the workflow worker active to process queued jobs (called by cron)",
	permission: noAuth(),
	responses: { 200: { description: "Processing complete" } }
}), async (c) => {
	await new Promise((resolve) => setTimeout(resolve, 5e4));
	return c.json({
		processed: true,
		timestamp: (/* @__PURE__ */ new Date()).toISOString()
	});
});

//#endregion
export { workflowProcessHandler };