Commit graph

695 commits

Author SHA1 Message Date
Ajax Davis
96fb52d047 feat: add createBlogPostTool and accept both q/query params in search API 2026-01-03 19:21:05 +10:00
Ajax Davis
515a461bbf fix: add helpful error message for API key decryption failure 2026-01-03 19:20:07 +10:00
Ajax Davis
3f15153dcf fix: wrap Prisma calls in try-catch for agent tests 2026-01-03 18:49:35 +10:00
Ajax Davis
aba7c976c1 fix: update AI SDK message serialization to follow best practices
- Use ModelMessage type instead of any[] for type safety
- Format assistant messages with tool calls using ToolCallPart in content array
- Format tool messages with ToolResultPart using proper output structure
- Add ToolCallCard component for sexy debug display of tool calls in chat
- Remove debug console.log statements

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-03 18:47:02 +10:00
Ajax Davis
fbcd7150c9 fix: skip agent integration tests when server unavailable 2026-01-03 17:21:18 +10:00
Ajax Davis
d2c149c6be feat: add agent logs and stats endpoints
- Add GET /api/agents/[id]/logs - conversation activity logs with filtering
- Add GET /api/agents/[id]/stats - aggregated statistics (conversations, tokens, tools)
- Add comprehensive agent endpoint tests (agents.test.ts)
- Fix TypeScript errors in logs route with proper Prisma type inference

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-03 17:14:17 +10:00
Ajax Davis
c0f9e9884d Add agent logs and stats endpoints 2026-01-03 17:05:45 +10:00
Ajax Davis
3a0a125b6d feat: generic env variable CRUD - any key name, not locked to providers
- Changed schema from AIProvider enum to arbitrary keyName string
- Updated API routes for generic key storage
- Simple CRUD UI with optional .env import
2026-01-03 14:35:19 +10:00
Ajax Davis
9371a11eb0 refactor: traditional API key UI with optional .env import 2026-01-03 14:28:43 +10:00
Ajax Davis
1469e36f3f refactor: simplify API keys page - just paste .env and save 2026-01-03 14:24:32 +10:00
Ajax Davis
1d771efef6 fix: add build config to root vercel.json for tpmjs project 2026-01-03 14:22:07 +10:00
Ajax Davis
19884af03e fix: add build:web script to only build web and dependencies for Vercel 2026-01-03 14:18:28 +10:00
Ajax Davis
2a6d4c6c2e fix: use turbo filter for Vercel build to exclude playground/storybook 2026-01-03 14:11:19 +10:00
Ajax Davis
471fbba786 fix: exclude playground and storybook from Vercel build filter 2026-01-03 14:02:14 +10:00
Ajax Davis
cc3a991661 debug: add comprehensive logging to api-keys POST endpoint
- Log each step: auth, body parsing, schema validation, encryption, db upsert
- Check for API_KEY_ENCRYPTION_SECRET presence before encrypt
- Log timing, error details with stack traces
- Return specific error messages for each failure point
2026-01-03 13:49:23 +10:00
Ajax Davis
1b1c4f6474 feat: redesign API keys settings page with .env paste support
- Add Quick Import section to paste entire .env files
- Auto-detect supported providers (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.)
- Add per-provider inline inputs with auto-save on blur/debounce
- Show save status indicators (loading spinner, checkmark)
- Simplify UI with compact provider rows
- Add supported models reference section

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-03 13:27:48 +10:00
Ajax Davis
4f95046249 fix: correct tools search API response mapping and add collection search
- Map tools search response from data.results.tools to expected format
- Map package.npmPackageName to top-level npmPackageName for UI
- Add search parameter support to collections API
2026-01-03 03:34:17 +10:00
Ajax Davis
5a0a21fd60 feat: add tools and collections management UI to agent detail page
- Add Tools section with search/add/remove functionality
- Add Collections section with search/add/remove functionality
- Add GET endpoints to /api/agents/[id]/tools and /api/agents/[id]/collections
- Use debounced search with dropdown for adding tools/collections
- Include click-outside handling to close dropdowns
2026-01-03 03:10:53 +10:00
Ajax Davis
bfed830187 feat: add interactive tutorial slideshows for Agents and MCP
- Add /docs/tutorials page with tutorial index
- Create step-by-step Agents tutorial (7 slides)
  - API key setup
  - Agent creation
  - Tool attachment
  - Chat interface usage
- Create step-by-step MCP tutorial (8 slides)
  - What is MCP
  - Creating collections
  - Configuring Claude Desktop
  - Configuring Cursor
  - Using tools

Each tutorial features:
- Progress bar and slide indicators
- Previous/Next navigation
- Direct links to relevant dashboard pages
2026-01-02 21:21:13 +10:00
Ajax Davis
0b1bb7725d feat: add dedicated Agents documentation page at /docs/agents
- Create separate /docs/agents page with comprehensive documentation
- Clean up main /docs page by removing duplicate Agents content
- Add link card in main docs pointing to Agents documentation
- Fix Badge variant from "destructive" to "error"
- Fix Footer import (AppFooter)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-02 20:40:23 +10:00
Ajax Davis
552f319583 feat: add AI Agents feature with multi-provider support and documentation
- Add Agent, AgentCollection, AgentTool, UserApiKey, Conversation, Message models to Prisma schema
- Create agent types and Zod schemas in @tpmjs/types
- Implement AES-256 API key encryption utilities
- Add CRUD API endpoints for agents, tools, collections, and user API keys
- Create conversation streaming endpoint with SSE events
- Build agent tool builder to merge collections and individual tools
- Add dashboard pages: agents list, new agent form, agent detail/edit, chat interface
- Add API keys settings page for managing provider keys
- Add comprehensive Agents documentation section to /docs
- Update navigation to include Agents link in header and mobile menu
- Add new icons: terminal, puzzle, message, key, info, send

Supported providers: OpenAI, Anthropic, Google, Groq, Mistral
2026-01-02 20:08:52 +10:00
Ajax Davis
4cbd84edb8 fix: use hardcoded sandbox URL in MCP handler 2026-01-02 12:27:12 +10:00
Ajax Davis
9c4004628f debug: add MCP logging 2026-01-02 12:13:31 +10:00
Ajax Davis
698165c0d7 fix: evaluate SANDBOX_EXECUTOR_URL at runtime 2026-01-02 12:06:38 +10:00
Ajax Davis
2e37faf385 fix: use correct executor endpoint and field names 2026-01-02 11:49:48 +10:00
Ajax Davis
8230ab0eec feat: add transport parameter to MCP endpoint
- Move endpoint from /api/collections/[id]/mcp to /api/collections/[id]/mcp/[transport]
- Support both 'http' and 'sse' transports
- HTTP: standard JSON-RPC over HTTP
- SSE: Server-Sent Events for streaming responses
- Add test script for validating MCP endpoints
2026-01-02 10:50:34 +10:00
Ajax Davis
828801f463 feat: add MCP endpoint for collections
Add Model Context Protocol (MCP) server endpoint for collections,
allowing users to connect Claude Desktop, Cursor, and other MCP
clients to use tools from their collections.

- POST /api/collections/[id]/mcp - JSON-RPC endpoint for MCP
- GET /api/collections/[id]/mcp - Server info for discovery
- Tool name conversion (e.g., @tpmjs/hello → tpmjs-hello--helloWorldTool)
- Handlers for initialize, tools/list, tools/call methods
- Executes tools via existing sandbox executor

Only public collections are accessible (no auth required).
2026-01-02 04:25:33 +10:00
Ajax Davis
abd9682f5e fix: add AppHeader to dashboard pages for consistent navigation
- Add AppHeader component to dashboard main page
- Add AppHeader to collections list page (loading, error, and main states)
- Add AppHeader to collection detail page (loading, error, and main states)

Ensures top navigation menu is visible on all dashboard pages for
both authenticated and unauthenticated users.
2026-01-02 02:52:17 +10:00
Ajax Davis
137de1c353 feat: add collections feature for organizing tools
- Add Collection and CollectionTool models to Prisma schema
- Create Zod validation schemas for collections
- Implement full CRUD API routes for collections
- Add tool management endpoints (add/remove tools)
- Create UI components: CollectionCard, CollectionForm, CollectionList,
  AddToolSearch, CollectionToolList
- Add /dashboard/collections pages for list and detail views
- Add new icons to @tpmjs/ui: folder, plus, trash, edit, box, search,
  loader, arrowLeft, alertCircle, globe
- Add xs size variant to Icon component
- Add Collections link to dashboard page

Features:
- Full CRUD for named collections
- Public/private visibility toggle
- Tool search to add tools to collections
- Ownership-based access control
- Collection limit: 50 per user
- Tool limit: 100 per collection
2026-01-02 02:35:32 +10:00
Ajax Davis
f8740fb7ff fix: add biome-ignore comments and config overrides for lint issues
- Add ToolSearchResult interface with biome-ignore for dynamic tool types
- Add biome-ignore comments for UIMessage.parts type casting
- Add biome config overrides for complexity warnings in MessageBubble.tsx
- Add biome config override for MobileMenu.tsx a11y rule
- Add biome config override for railway-executor complexity
- Fix unused template literal in railway-executor
- All lint tasks now pass with 0 errors

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-02 01:51:46 +10:00
Ajax Davis
e4b84fb1cd feat: add minimal header to auth pages
- Create AuthHeader component with logo and contextual auth link
- Show "Sign Up" on sign-in page and vice versa
- Keep centered form layout with header at top

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-02 01:28:04 +10:00
Ajax Davis
87a9517ec3 fix: check for __Secure- prefixed session cookie in middleware
better-auth uses __Secure- prefix for session cookies on HTTPS,
but middleware was only checking for the unprefixed cookie name

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-02 01:11:09 +10:00
Ajax Davis
499f163c31 fix: improve auth sign-in handling and cookie configuration
- Add onSuccess/onError callbacks to signIn.email() for better response handling
- Add trustedOrigins configuration for production domain
- Configure explicit cookie attributes (sameSite, secure, httpOnly)
- Enable session cookie caching for better performance
- Handle edge case where signIn returns neither data nor error

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-02 01:04:29 +10:00
Ajax Davis
522c198041 fix: add Prisma client to web app for Vercel monorepo compatibility
- Add @prisma/client and prisma as direct dependencies
- Add postinstall and build scripts to generate Prisma client
- Points to schema in packages/db
2026-01-02 00:37:00 +10:00
Ajax Davis
4451eddc91 fix: use custom domain for auth baseURL in production
VERCEL_URL returns deployment URL (tpmjs-xxx.vercel.app) not custom domain.
This was causing session cookies to be set for wrong domain.
Now prioritizes BETTER_AUTH_URL, then checks VERCEL_ENV=production to use tpmjs.com.
2026-01-02 00:12:55 +10:00
Ajax Davis
1c9a328929 fix: change label to span for display-only text in dashboard 2026-01-01 23:52:36 +10:00
Ajax Davis
b57d21ca65 fix: remove unused router import from auth pages 2026-01-01 23:43:18 +10:00
Ajax Davis
4f417af2ab fix: simplify auth client and use window.location for redirects 2026-01-01 23:33:44 +10:00
Ajax Davis
de41d42349 fix: use callbackURL and onSuccess/onError for Better Auth sign-in/sign-up 2026-01-01 23:07:59 +10:00
Ajax Davis
1d417d9a22 fix: auto-detect baseURL for Better Auth in production 2026-01-01 22:59:56 +10:00
Ajax Davis
25d74e5c2e fix: improve auth error logging and display 2026-01-01 22:46:47 +10:00
Ajax Davis
59ff53c5ba fix: lazy init Resend to avoid build-time errors 2026-01-01 22:43:39 +10:00
Ajax Davis
763650e976 fix: auto sign-in user after email verification 2026-01-01 22:33:09 +10:00
Ajax Davis
ed3a215ee8 feat: add sign in/dashboard links to header navigation
- Add Sign In button to desktop header (shows Dashboard when logged in)
- Add Sign In/Sign Up links to mobile menu
- Fix auth config to use BETTER_AUTH_SECRET and BETTER_AUTH_URL env vars

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-01 20:55:55 +10:00
Ajax Davis
6060492169 feat: add Better Auth with email/password authentication
- Add User, Session, Account, Verification models to Prisma schema
- Create auth configuration with Prisma adapter
- Add Resend email integration for verification emails
- Create sign-in, sign-up, and verify-email pages
- Create user dashboard with profile display
- Add middleware for /dashboard route protection
- Add better-auth and resend dependencies

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-01 20:45:10 +10:00
Ajax Davis
09fd0a5833 feat: add 55 new business tools and improve existing implementations
New tools added across multiple domains:
- Sales: lead-score, proposal-outline, objection-response
- Marketing: competitor-brief, campaign-brief, social-post-draft, email-subject-score, audience-persona, content-calendar-plan, pricing-page-copy
- HR: job-description-draft, interview-questions, performance-review-draft, onboarding-checklist, compensation-band, survey-analyze, org-chart-format, offer-letter-draft, exit-interview-summarize, policy-doc-format
- Legal: contract-clause-scan, nda-template-draft, tos-readability, risk-clause-highlight, invoice-terms-extract, gdpr-data-map, copyright-notice, trademark-check
- Finance: expense-categorize, invoice-data-extract, budget-variance, cash-flow-project, revenue-breakdown, ratio-analysis, tax-deduction-scan, reconciliation-match
- Customer Experience: feedback-themes, churn-risk-score, nps-analysis, ticket-categorize, response-template-suggest, health-score-calculate, renewal-forecast
- Education: lesson-plan-outline, quiz-generate, rubric-create, syllabus-format, progress-report-draft, learning-objective-write, curriculum-map

Also includes improvements to 68 existing tool implementations.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-01 19:23:32 +10:00
Ajax Davis
d1aad1b3ea fix: move tools-export.json to public/ for Vercel compatibility 2026-01-01 17:46:36 +10:00
Ajax Davis
d00ab8afbb feat: add /tool-ideas page with 10K AI-generated tools
- Add virtualized list using react-virtuoso for smooth scrolling
- Filter by category, verb, quality score, and search
- Expandable cards with parameters, returns, AI guidance
- Add redirect from /tools-ideas to /tool-ideas

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-01 17:13:46 +10:00
Ajax Davis
1560f38f85 fix(slo-draft): add min/max constraints to target schema
Helps AI SDK validate that target percentages are between 0-100 before calling the tool
2026-01-01 10:59:36 +10:00
Ajax Davis
03405ad754 fix: improve tool search with camelCase tokenization and exact name matching
- Split camelCase/PascalCase into words (sitemapReadTool → sitemap read tool)
- Add +100 score boost for exact tool name matches
- Fixes issue where searching exact tool name returned 0 results
2026-01-01 10:51:51 +10:00