- Add EXECUTOR_SPECIFICATION.md with formal v1.0 protocol spec - Add executor-openapi.yaml (OpenAPI 3.0 specification) - Create @tpmjs/executor-test compliance test package (15 tests) - Update Railway executor to v1.0 compliance (15/15 tests pass) - Update Unsandbox executor to v1.0 compliance (15/15 tests pass) - Update Vercel executor to v1.0 compliance - Add /info endpoint with capability advertisement to all executors - Add structured error codes (PACKAGE_NOT_FOUND, TOOL_NOT_FOUND, etc.) - Add protocolVersion and implementationVersion to /health responses - Add X-TPMJS-Protocol-Version header support - Add EXECUTOR_COMPLIANCE.md with test results documentation |
||
|---|---|---|
| .. | ||
| app | ||
| next.config.js | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vercel.json | ||
TPMJS Executor for Vercel
Deploy your own TPMJS tool executor using Vercel Sandbox for secure, isolated code execution.
Features
- Secure Execution: Tools run in isolated Vercel Sandbox VMs
- Full Control: Your infrastructure, your environment variables
- Privacy: No data passes through TPMJS servers
- One-Click Deploy: Deploy to Vercel in minutes
One-Click Deploy
How It Works
This executor uses Vercel Sandbox to:
- Create an isolated VM for each tool execution
- Install the npm package in the sandbox
- Execute the tool with your parameters
- Return the result and destroy the sandbox
This provides secure, isolated execution without the limitations of Node.js serverless functions.
API Endpoints
GET /api/health
Check executor health status.
curl https://your-executor.vercel.app/api/health
Response:
{
"status": "ok",
"version": "1.0.0",
"info": {
"runtime": "vercel-sandbox",
"region": "iad1",
"timestamp": "2024-01-01T00:00:00.000Z"
}
}
POST /api/execute-tool
Execute a TPMJS tool.
curl -X POST https://your-executor.vercel.app/api/execute-tool \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-api-key" \
-d '{
"packageName": "@tpmjs/hello",
"name": "helloWorld",
"version": "latest",
"params": { "name": "World" }
}'
Response:
{
"success": true,
"output": "Hello, World!",
"executionTimeMs": 2345
}
Configuration
Environment Variables
| Variable | Required | Description |
|---|---|---|
EXECUTOR_API_KEY |
No | API key for authentication. If set, requests must include Authorization: Bearer <key> header. |
Add custom environment variables for your tools (e.g., MY_API_KEY, DATABASE_URL) in your Vercel project settings.
Setting Up API Key Authentication
- Go to your Vercel project settings
- Add an environment variable:
EXECUTOR_API_KEYwith a secure random value - When configuring your executor in TPMJS, enter this key in the "API Key" field
Connecting to TPMJS
- Go to your TPMJS collection or agent settings
- In "Executor Configuration", select "Custom Executor"
- Enter your executor URL:
https://your-executor.vercel.app - Enter your API key (if configured)
- Click "Verify Connection" to test
Local Development
# Install dependencies
npm install
# Login to Vercel (required for sandbox access)
vercel login
# Link to your Vercel project
vercel link
# Pull environment variables
vercel env pull
# Run development server
npm run dev
# Test the health endpoint
curl http://localhost:3000/api/health
Note: Vercel Sandbox requires authentication even in development. Run vercel login and vercel link first.
Security
- Set
EXECUTOR_API_KEYto require authentication for all requests - Tools run in isolated VMs with no access to your Vercel project
- Each execution gets a fresh sandbox instance
- Sandboxes are destroyed after execution completes
Pricing
Vercel Sandbox usage is billed based on compute time. See Vercel Sandbox Pricing for details.
- Hobby: 45 min max runtime
- Pro: 5 hour max runtime
- Region: Currently only available in
iad1