Commit graph

472 commits

Author SHA1 Message Date
Ajax Davis
5c9f1a1d0a chore: update dependencies with compatibility fixes
- Update all packages to latest versions via pnpm update --latest
- Downgrade Prisma 7 to 6 (v7 requires schema migration)
- Downgrade Tailwind CSS 4 to 3 (v4 requires PostCSS migration)
- Downgrade Storybook 10 to 8 (addons not available in v10)
- Pin cheerio to 1.0.0-rc.12 via pnpm override (type exports changed)
- Fix AI SDK tool definitions: parameters -> inputSchema
- Fix cheerio types in extract-meta and table-extract tools
- Add explicit type annotations to tool execute functions
- Migrate biome config to v2.3.11 schema

All type-checks, tests, and builds pass.
2026-01-09 22:49:41 +10:00
Ajax Davis
cb157611df revert: restore maxDuration=300 for conversation routes
The maxDuration=60 change was causing all API routes to hang/timeout
on Vercel deployments. While the Hobby plan limit is 60s, setting
maxDuration=60 in certain route files appears to cause a deployment
issue where no API routes respond.

Reverting to maxDuration=300 to restore functionality. The actual
runtime timeout will be enforced by Vercel's plan limits anyway.
2026-01-09 20:01:18 +10:00
Ajax Davis
bc5eb61086 revert: restore framework=nextjs in vercel.json 2026-01-09 18:18:04 +10:00
Ajax Davis
849802bfeb fix: set framework to null for monorepo Vercel deployment 2026-01-09 18:11:26 +10:00
Ajax Davis
8c6185e6bb fix: update MCP copy URLs to use new /api/mcp/{username}/{slug} format
- Update getCollectionCopyOptions to require username and slug params
- Update getAgentCopyOptions to require username param
- Add slug and username to public collections/agents API responses
- Remove deprecated /mcp/collections/{id} and /mcp/agents/{uid} URL formats
2026-01-09 08:14:39 +10:00
Ajax Davis
ad3457ab32 chore: trigger deployment 2026-01-09 08:00:08 +10:00
Ajax Davis
4c5972adc4 fix: reduce maxDuration to 60s for Vercel Hobby plan compatibility
Routes with maxDuration=300 were silently failing on Vercel's edge
routing layer - requests never reached the serverless function (no
logs appeared). Vercel Hobby plan has a 60s max function duration.

Affected routes:
- /api/agents/[id]/conversation/[conversationId]
- /api/agents/[username]/[uid]/conversation/[conversationId]
- /api/mcp/[username]/[slug]/[transport]

The issue caused these routes to hang indefinitely until client timeout.
2026-01-09 07:06:54 +10:00
Ajax Davis
9b6a4a625e fix: use sync rate limiter for conversation routes
The distributed rate limiter (checkRateLimitDistributed) was causing
timeouts in production, likely due to @vercel/kv connection issues.
Switch to sync in-memory rate limiter (checkRateLimit) which works
reliably across all other endpoints.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 05:23:18 +10:00
Ajax Davis
3612d12c90 fix: add timeout to Vercel KV rate limiter to prevent hanging
The rate limiter was calling @vercel/kv without a timeout, which could
hang indefinitely if KV is not configured or responding. This adds a
2-second timeout to prevent requests from timing out.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 04:51:33 +10:00
Ajax Davis
9c52203e54 fix: add ID-based conversation route for dashboard chat
The dashboard chat page was calling /api/agents/{uid}/conversation/...
but the only conversation route expected /api/agents/{username}/{uid}/...

This adds a new route at /api/agents/[id]/conversation/[conversationId]
that accepts agent ID directly, and updates the chat page to use it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 03:42:04 +10:00
Ajax Davis
9d157800b9 fix: add root-level health and execute-tool routes for TPMJS compatibility
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 <noreply@anthropic.com>
2026-01-09 02:43:12 +10:00
Ajax Davis
9bcc1a8c15 fix(executor): use correct Vercel Sandbox SDK API
Key fixes:
- Use await result.stdout() / stderr() instead of result.stdout property
- Use sandbox.writeFiles([{ path, content: Buffer }]) correctly
- Use object form of runCommand with cmd, args, cwd, env
- Proper error handling and result parsing
2026-01-09 02:21:51 +10:00
Ajax Davis
e2153120f9 fix(executor): add missing @types/react dependency 2026-01-09 01:54:18 +10:00
Ajax Davis
3cd65587c5 ci: add Claude-powered documentation auto-update workflow 2026-01-09 01:47:21 +10:00
Thomas Davis
d65031bbeb Merge pull request #13 from tpmjs/add-claude-github-actions-1767887076208
Add Claude Code GitHub Workflow
2026-01-09 01:44:59 +10:00
Thomas Davis
7435a39a3d "Claude Code Review workflow" 2026-01-09 01:44:40 +10:00
Thomas Davis
33287d931f "Claude PR Assistant workflow" 2026-01-09 01:44:38 +10:00
Ajax Davis
f86ac2c6b0 fix(executor): correct @vercel/sandbox version to 1.1.5 2026-01-09 01:40:16 +10:00
Ajax Davis
846676ba15 refactor(executor): use Vercel Sandbox SDK for isolated VM execution
- Replace community Deno runtime with @vercel/sandbox SDK
- Next.js API routes create ephemeral sandbox VMs per execution
- Each tool execution: create VM → npm install → run → cleanup
- node22 runtime in sandbox handles npm packages natively
- Region pinned to iad1 (only region with Sandbox support)
- Proper authentication support via EXECUTOR_API_KEY

This provides true isolation - each tool runs in its own VM that's
destroyed after execution. More secure than shared serverless.
2026-01-09 01:35:22 +10:00
Ajax Davis
300083aff9 refactor(executor): switch vercel template from Next.js to Deno runtime
- Replace Next.js app router with pure Deno API functions
- Use vercel-deno@3.0.0 community runtime for native HTTP imports
- Deno natively supports importing from esm.sh URLs
- Simplified template: just api/health.ts and api/execute-tool.ts
- Remove unnecessary React/Next.js dependencies
- Update README with new architecture documentation

This matches the Railway executor's Deno-based approach but runs on
the user's own Vercel account. The Deno runtime enables dynamic
imports from esm.sh without any special setup.
2026-01-09 01:15:47 +10:00
Ajax Davis
346a3f6da0 docs: add step-by-step custom executor tutorial
- Create comprehensive tutorial at /docs/tutorials/custom-executor
- Walk through from zero to running custom executor in 6 steps
- Cover prerequisites, Vercel deployment, environment config
- Include verification, testing, and connection to collections
- Add troubleshooting section for common issues
- Link tutorial from tutorials index and executors reference page
2026-01-09 00:55:54 +10:00
Ajax Davis
b6a553341a style: fix formatting, add complexity ignores, use optional chain 2026-01-09 00:34:15 +10:00
Ajax Davis
bc36d366bc feat: add hot-swappable executor support for collections and agents
- Add executor configuration to Collection and Agent models in Prisma schema
- Create ExecutorConfigPanel component for selecting default or custom executors
- Add executor resolution logic with cascade (Agent → Collection → System Default)
- Create /api/executors/verify endpoint to test custom executor connectivity
- Add executor documentation page at /docs/executors with API specification
- Create deployable Vercel executor template in templates/vercel-executor/
- Update MCP handlers and agent tool execution to use configurable executors
- Add executor types and schemas to @tpmjs/types package

Users can now deploy their own executor instances and configure collections
or agents to use custom executors instead of the TPMJS default executor.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 00:19:22 +10:00
Ajax Davis
84d894e920 chore: remove deprecated UUID-based API endpoints
Remove old endpoints that have been replaced by pretty URL versions:
- /api/collections/[id]/mcp/[transport] → /api/mcp/[username]/[slug]/[transport]
- /api/agents/[id]/conversation/[conversationId] → /api/agents/[username]/[uid]/conversation/[conversationId]

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-08 21:14:20 +10:00
Ajax Davis
346b0e83ea feat: add pretty URL API endpoints for MCP servers and agent conversations
- Add /api/mcp/[username]/[slug]/[transport] endpoint for MCP servers
  - Supports HTTP and SSE transports
  - Uses username/slug format instead of collection UUID
  - Maintains full JSON-RPC protocol support

- Add /api/agents/[username]/[uid]/conversation/[conversationId] endpoint
  - Uses username/uid format instead of agent UUID
  - Full SSE streaming support for AI responses

- Update collection detail page with new MCP URL section
  - Shows HTTP and SSE transport URLs
  - Includes Claude Desktop config snippet
  - Copy-to-clipboard functionality

- Add fetchAgentByUsernameAndUidWithTools() to build-tools.ts

- Update sharing docs with new API endpoint URLs

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-08 21:07:31 +10:00
Ajax Davis
eaaa40f130 feat: add usernames, pretty URLs, cloning, and sharing docs
## Usernames
- Add username field to User model (unique, URL-friendly)
- Add slug field to Collection model (unique per user)
- Update sign-up flow to require username with availability checking
- Create username check API endpoint

## Pretty URLs
- Add route group (profile) with pretty URL pages:
  - /{username} - User profile
  - /{username}/agents/{uid} - Agent detail
  - /{username}/agents/{uid}/chat - Chat redirect
  - /{username}/collections/{slug} - Collection detail
- Add client-side redirects from old /agents/[id] and /collections/[id] URLs

## Cloning
- Add clone API endpoints for agents and collections
- Create CloneButton component
- Add AGENT_CLONED and COLLECTION_CLONED activity types

## Documentation
- Add /docs/sharing page explaining all shareable URLs
- Document cloning functionality and visibility settings

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-08 20:47:08 +10:00
Ajax Davis
1ff0e49e41 fix: use theme-aware bg-surface instead of hardcoded bg-white
- Replace bg-white with bg-surface for proper light/dark mode support
- bg-surface maps to white in light mode, dark gray in dark mode
- Fixes broken dark mode appearance from previous commit

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-08 17:27:02 +10:00
Ajax Davis
6f44a021cc fix: improve light mode contrast for dashboard inputs and panels
- Replace bg-background with bg-white for form inputs and panel containers
- Fixes gray-on-gray contrast issues in light mode
- Updated pages: agent detail, agent chat, new agent, API keys settings

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-08 17:17:44 +10:00
Ajax Davis
00b79c1f1a fix: improve design contrast by using white backgrounds for cards
- Replace bg-background with bg-white for cards and panels across dashboard
- Add hover:shadow-sm for better visual feedback on interactive elements
- Apply fixes to: collections, agents, likes pages, and dashboard overview
- Cards now properly stand out against the light gray page background

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-08 16:55:16 +10:00
Ajax Davis
337d70f663 fix: use correct icon name 'copy' instead of 'clipboard' 2026-01-08 05:08:29 +10:00
Ajax Davis
836ebbf828 feat: add copy button to debug JSON view 2026-01-08 04:55:53 +10:00
Ajax Davis
e02fbc3cd7 fix: correct message ordering and add debug JSON tab
- Fix chronological ordering by saving ASSISTANT message before TOOL messages
- Collect tool results during streaming, save after assistant message
- Add "Debug JSON" tab to view raw messages array
- Shows all message fields including toolCalls, toolResult, tokens

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-08 04:49:13 +10:00
Ajax Davis
6f8617fead fix: properly persist and render tool calls in agent chat
- Capture tool call inputs from onChunk and onStepFinish callbacks
- Store toolCalls array in ASSISTANT messages with proper format
- Update chat page to combine ASSISTANT toolCalls (input) with TOOL messages (output)
- Show complete tool call cards with both input args and output results
- Display token usage in assistant messages for debugging
- Handle pending tool calls from ASSISTANT messages without results

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-08 04:32:25 +10:00
Ajax Davis
d6de3e025a feat: implement user activity stream and multiple API improvements
Activity Stream:
- Add UserActivity model with ActivityType enum to track user actions
- Create activity logging service with fire-and-forget pattern
- Add /api/user/activity endpoint with cursor pagination
- Add cleanup cron job for 90-day activity retention
- Integrate activity logging into 18 mutation API routes
- Add DashboardActivityStream component with virtualized rendering

API Improvements:
- Add distributed rate limiting via Vercel KV (with in-memory fallback)
- Add rate limiting to chat endpoint (30 req/min)
- Optimize BM25 search with database-level pre-filtering
- Fix JSON parse crash in search endpoint
- Add pagination to collection tools response (toolsLimit/toolsOffset)
- Add take limits to agent detail query to prevent excessive data fetch
- Fix hardcoded tool count calculation in agents dashboard

Schema Extraction:
- Add schemaExtractionAttemptAt and schemaExtractionError fields
- Separate rate limiting for failed (1 min) vs successful (1 hour) attempts
- Allow retry of failed extractions

Standardization:
- Create api-response.ts with standardized response helpers
- Add apiSuccess, apiError, apiNotFound, apiForbidden, etc.
- Update agents routes to use standardized format

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-08 04:11:01 +10:00
Ajax Davis
9f254a5ae8 feat: show tooltip for like button when not logged in
- LikeButton now shows 'Sign in to like' tooltip instead of redirecting
- Added interactive LikeButton to tools table (was static display)
- All three public list pages (tools, collections, agents) now have like functionality
2026-01-08 01:20:16 +10:00
Ajax Davis
f7a6df06c5 feat: use path segments for chat URLs instead of query params
- /agents/[id]/chat/[chatId] instead of /agents/[id]/chat?c=...
- /dashboard/agents/[id]/chat/[chatId] instead of ?c=...
- Base chat routes redirect to new chat with generated ID
- Cleaner URL structure for bookmarking and sharing
2026-01-08 00:54:33 +10:00
Ajax Davis
dc5a2292fc feat: include conversation ID in URL immediately on chat page load
- Public chat page: redirect to include ?c= parameter on mount
- Dashboard chat page: sync URL with active conversation ID
- New conversations get ID in URL immediately, not after first message
2026-01-08 00:31:39 +10:00
Ajax Davis
cefd237005 style: add spacer between primary nav and dropdown menus in header 2026-01-08 00:25:44 +10:00
Ajax Davis
f40fedae8d feat: add Chat button and redesign chat page with sidebar layout
- Add Chat button to public agent detail page
- Redesign chat page with collapsible sidebar:
  - Left sidebar shows agent config, tools, and collections
  - Right side shows chat interface
  - Toggle button to show/hide sidebar
  - Sidebar displays provider, model, temperature, system prompt
  - Links to individual tools and collections
2026-01-08 00:08:20 +10:00
Ajax Davis
3bad010833 fix: preserve conversation ID in URL for chat history persistence 2026-01-07 23:57:42 +10:00
Ajax Davis
1594f98cc1 feat: add chat history with scroll-up loading to public agent chat
- Update conversation API to support cursor-based pagination (before/after params)
- Default behavior now returns most recent messages first
- Add react-virtuoso for efficient virtualized message rendering
- Implement scroll-up loading of older messages
- Show loading indicator when fetching history
2026-01-07 23:44:07 +10:00
Ajax Davis
2c0e5f99d8 feat: add build info to /api/health for deployment verification
- Return commitSha, commitMessage, and deploymentUrl from Vercel env vars
- Document verification workflow in CLAUDE.md
2026-01-07 23:25:12 +10:00
Ajax Davis
8e572714ae feat: add public chat page for agents
- Create public chat page at /agents/[id]/chat with unique conversation ID per page load
- Add Chat column to public agents table with link to start new conversations
- Full chat UI with streaming responses, tool call visualization, and error handling
- Uses agent owner's API keys so no authentication required for users
2026-01-07 23:06:05 +10:00
Ajax Davis
d24be7acbf feat: add public visibility toggle to agent edit page
- Add isPublic field to form state and save handler
- Add Switch toggle in edit mode to control visibility
- Display public/private status in view mode with icon
2026-01-07 22:31:33 +10:00
Ajax Davis
2fe2fcef5c fix: add admin endpoint to make existing agents public 2026-01-07 22:24:32 +10:00
Ajax Davis
4b392a2eed fix: add description column to tools page and make agents public by default
- Add description column to tools registry table
- Change agent isPublic default from false to true in Prisma schema
- Update CreateAgentSchema Zod default to true
2026-01-07 22:07:36 +10:00
Ajax Davis
361a49f3d7 feat: redesign public pages with virtualized tables
- Add sonner for toast notifications
- Create CopyButton component for simple copy actions
- Create CopyDropdown component with entity-specific copy options
- Create PackageManagerSelector with localStorage persistence
- Redesign tools page with TableVirtuoso, sort by downloads/likes/recent/name
- Redesign collections page with TableVirtuoso and infinite scroll
- Redesign agents page with TableVirtuoso and infinite scroll
- All tables have fast client-side filtering and copy functionality
2026-01-07 21:55:13 +10:00
Ajax Davis
54dedc3056 feat: add like/love system for tools, collections, and agents
- Add ToolLike, CollectionLike, AgentLike junction tables with likeCount fields
- Create like/unlike API endpoints for all entity types
- Add user likes endpoints and public listings endpoints
- Create LikeButton component with optimistic UI updates
- Add collapsible Likes section in dashboard sidebar
- Create dashboard likes pages (overview, tools, collections, agents)
- Add public collections and agents pages with detail views
- Update AppHeader and MobileMenu with Collections/Agents navigation
- Auto-like on collection/agent creation
- Add heart icons to UI package

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-07 21:04:31 +10:00
Ajax Davis
b8b4e44b50 fix: mobile UI bugs and documentation improvements
- docs: add clarifying comment for AI SDK provider imports on /docs and /sdk pages
- fix: remove duplicate footer on /docs page (was rendered in both page and root layout)
- fix: prevent "Official" badge from overflowing on mobile tool cards (/home)
- fix: center Specification/Full Example toggle buttons on mobile (/spec)
- fix: ecosystem diagram layout on mobile - increase height and reposition legend (/integrations)
2026-01-07 20:58:33 +10:00
github-actions[bot]
114798ce9e chore: sync 1 new tools from Vercel AI registry
Added 1 tools from Vercel AI SDK registry:
- Total tools in registry: 12
- Already synced: 11
- Newly added: 1
- Errors: 0

🤖 Automated by GitHub Actions
Run: https://github.com/tpmjs/tpmjs/actions/runs/20778503544
2026-01-07 10:32:56 +00:00