This commit is contained in:
mrfelfel
2026-07-18 19:41:33 +03:30
parent 87ba0d253d
commit dfb0e857f1
158 changed files with 20278 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
import { r as requireApiToken } from '../../../chunks/apiAuth_DcNSM7D5.mjs';
import { i as isAdminAuthenticated } from '../../../chunks/adminAuth_CY4OwU1a.mjs';
import { r as runTassAgent } from '../../../chunks/tassAgent_jxZgSz7r.mjs';
export { renderers } from '../../../renderers.mjs';
const POST = async (context) => {
if (!isAdminAuthenticated(context)) {
const unauthorized = requireApiToken(context);
if (unauthorized) {
return unauthorized;
}
}
try {
const contentType = context.request.headers.get("content-type") ?? "";
const payload = contentType.includes("application/json") ? await context.request.json() : {};
const limit = Math.min(Math.max(Number(payload.limit ?? 3), 1), 10);
const result = await runTassAgent(limit);
return new Response(JSON.stringify({ ok: true, ...result }), {
headers: { "content-type": "application/json; charset=utf-8" }
});
} catch (error) {
return new Response(JSON.stringify({ ok: false, error: error instanceof Error ? error.message : "Agent failed" }), {
status: 500,
headers: { "content-type": "application/json; charset=utf-8" }
});
}
};
const _page = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
__proto__: null,
POST
}, Symbol.toStringTag, { value: 'Module' }));
const page = () => _page;
export { page };