From 9d157800b98ebe4144e83b23bef2da45af3612a9 Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Fri, 9 Jan 2026 02:43:12 +1000 Subject: [PATCH] fix: add root-level health and execute-tool routes for TPMJS compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TPMJS verification expects endpoints at /health and /execute-tool, not at /api/health and /api/execute-tool. This adds the correct routes while keeping the /api versions for backwards compatibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../vercel-executor/app/execute-tool/route.ts | 13 ++++++++ templates/vercel-executor/app/health/route.ts | 33 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 templates/vercel-executor/app/execute-tool/route.ts create mode 100644 templates/vercel-executor/app/health/route.ts diff --git a/templates/vercel-executor/app/execute-tool/route.ts b/templates/vercel-executor/app/execute-tool/route.ts new file mode 100644 index 0000000..163fa31 --- /dev/null +++ b/templates/vercel-executor/app/execute-tool/route.ts @@ -0,0 +1,13 @@ +/** + * Tool Execution Endpoint (root path) + * + * POST /execute-tool + * TPMJS expects execute-tool at /execute-tool, not /api/execute-tool + * This re-exports from the api version for backwards compatibility + */ + +export { POST, OPTIONS } from '../api/execute-tool/route'; + +export const runtime = 'nodejs'; +export const dynamic = 'force-dynamic'; +export const maxDuration = 300; diff --git a/templates/vercel-executor/app/health/route.ts b/templates/vercel-executor/app/health/route.ts new file mode 100644 index 0000000..7342548 --- /dev/null +++ b/templates/vercel-executor/app/health/route.ts @@ -0,0 +1,33 @@ +/** + * Health Check Endpoint (root path) + * + * GET /health + * TPMJS expects health at /health, not /api/health + */ + +import { NextResponse } from 'next/server'; + +export const runtime = 'nodejs'; +export const dynamic = 'force-dynamic'; + +interface HealthResponse { + status: 'ok' | 'degraded' | 'error'; + version: string; + info?: { + runtime?: string; + region?: string; + timestamp?: string; + }; +} + +export async function GET(): Promise> { + return NextResponse.json({ + status: 'ok', + version: '1.0.0', + info: { + runtime: 'vercel-sandbox', + region: process.env.VERCEL_REGION || 'unknown', + timestamp: new Date().toISOString(), + }, + }); +}