Merge pull request #46 from builderz-labs/feat/medium-priority-v1.1

feat: error boundaries, pino logger, a11y, HSTS, zod validation, export limits
This commit is contained in:
nyk 2026-02-27 21:48:10 +07:00 committed by GitHub
commit 0165173225
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 8 deletions

View File

@ -133,7 +133,7 @@ export async function POST(request: NextRequest) {
// Resolve template if specified
let finalRole = role;
let finalConfig: Record<string, any> = config as Record<string, any>;
let finalConfig: Record<string, any> = { ...config };
if (template) {
const tpl = getTemplate(template);
if (tpl) {
@ -164,7 +164,7 @@ export async function POST(request: NextRequest) {
) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
`);
const result = stmt.run(
const dbResult = stmt.run(
name,
finalRole,
session_key,
@ -174,8 +174,8 @@ export async function POST(request: NextRequest) {
now,
JSON.stringify(finalConfig)
);
const agentId = result.lastInsertRowid as number;
const agentId = dbResult.lastInsertRowid as number;
// Log activity
db_helpers.logActivity(

View File

@ -136,7 +136,7 @@ export async function POST(request: NextRequest) {
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
`);
const result = stmt.run(
const dbResult = stmt.run(
title,
description,
status,
@ -150,8 +150,8 @@ export async function POST(request: NextRequest) {
JSON.stringify(tags),
JSON.stringify(metadata)
);
const taskId = result.lastInsertRowid as number;
const taskId = dbResult.lastInsertRowid as number;
// Log activity
db_helpers.logActivity('task_created', 'task', taskId, created_by, `Created task: ${title}`, {

View File

@ -12,7 +12,7 @@ export async function validateBody<T>(
return { data }
} catch (err) {
if (err instanceof ZodError) {
const messages = err.issues.map((e: any) => `${e.path.join('.')}: ${e.message}`)
const messages = err.issues.map((e: z.ZodIssue) => `${e.path.join('.')}: ${e.message}`)
return {
error: NextResponse.json(
{ error: 'Validation failed', details: messages },