Commit graph

34 commits

Author SHA1 Message Date
Ajax Davis
23d5159b28 refactor: replace raw HTML elements with design system components
- Replace <select>, <input>, <label>, <textarea> with UI components
- Update various dashboard and docs pages
- Simplify unsandbox package.json
- Add DESIGN_SYSTEM.md documentation
- Add Claude skills configuration
2026-01-16 16:52:44 +10:00
Ajax Davis
7d9321d9c6 feat: allow public access to agents and collections with caller credentials
Users can now access other users' PUBLIC agents and collections by providing
their own credentials in the request:

For agents:
- Provide `providerApiKey` for LLM access
- Provide `env` object with tool environment variables
- Owner's stored credentials are never shared

For collections (MCP):
- Provide `env` in params for tool environment variables
- Owner's stored credentials are never shared

Returns clear errors listing missing required env vars if not provided.

Files changed:
- packages/types/src/agent.ts: Add providerApiKey to SendMessageSchema
- apps/web/src/lib/agents/env-helpers.ts: New helper functions for env vars
- apps/web/src/lib/agents/build-tools.ts: Accept callerEnvVars parameter
- apps/web/src/app/api/agents/[id]/conversation/[conversationId]/route.ts:
  Allow public agent access with caller credentials
- apps/web/src/lib/mcp/handlers.ts: Accept callerEnvVars, validate requirements
- apps/web/src/app/api/mcp/[username]/[slug]/[transport]/route.ts:
  Allow public collection access, pass isOwner flag
- apps/web/src/app/docs/platform-guide/page.tsx: Update access model docs
2026-01-16 14:59:00 +10:00
Ajax Davis
fdb61ed010 docs(web): add viewing parent updates documentation
Document how users can view the parent agent/collection to see:
- Current tools and collections the parent has
- How to manually update fork with parent changes
- API endpoint for fetching parent data programmatically
2026-01-16 14:06:36 +10:00
Ajax Davis
82a734b3bd docs(web): add API access model documentation to Platform Guide
Add comprehensive documentation explaining:
- Fork-to-use access model for agents and collections
- API access behavior for agents (403 errors, owner pays for LLM)
- MCP access behavior for collections (403 errors, caller pays)
- Common access error codes (401, 403, 400, 429)
- Environment variable and API key requirements
2026-01-16 13:41:31 +10:00
Ajax Davis
fd87edd9e9 docs(web): add comprehensive Platform Guide documentation
Add new /docs/platform-guide page covering all platform features:
- User accounts: authentication, profiles, usernames
- Collections: creation, tools, MCP integration, env vars
- Agents: configuration, LLM providers, chat interface
- Forking: how to fork agents and collections
- API keys: scopes, rate limits, usage tracking
- Reference: platform limits and URL patterns
2026-01-16 13:22:31 +10:00
Ajax Davis
b1dd3371cd feat: add social proof features and comprehensive documentation
Priority 2 - Social Proof:
- Add ToolRating and ToolReview models to Prisma schema
- Add rating aggregates (averageRating, ratingCount, reviewCount) to Tool model
- Create /api/tools/[id]/rate endpoint for tool ratings
- Create /api/tools/[id]/reviews endpoint for tool reviews
- Create /api/tools/trending endpoint for trending tools
- Add Rating component with interactive star rating
- Add ReviewCard component with user avatars and review display
- Add star and starFilled icons to UI package
- Update ToolDetailClient to show ratings

Priority 3 - Documentation:
- Create /docs/api/tools API documentation page
- Create /docs/api/agents API documentation page
- Create /docs/api/collections API documentation page
- Create /docs/api/authentication documentation page
- Create /docs/quickstart getting started tutorial
- Create /docs/sdk SDK reference documentation
2026-01-14 12:11:47 +10:00
Ajax Davis
2fb790a847 docs: update all URL references to new username/slug format
Update all documentation, code, and tests to use the new endpoint formats:

- MCP: /api/mcp/{username}/{collection-slug}/{transport}
- Agent: /api/{username}/agents/{agent-uid}/conversation/{id}

Changes include:
- Update MCP URLs in collections page, docs, and test script
- Update agent API URLs in chat page, docs, tests, and cron job
- Add API key authentication requirements to all examples
- Update ARCHITECTURE.md with correct endpoint formats
- Update discord cron job to fetch owner username for new URL format
2026-01-13 23:14:36 +10:00
Ajax Davis
a3f1f3935e feat: add API key authentication system and update documentation
API Key System:
- Add TpmjsApiKey, ApiUsageRecord, ApiUsageSummary models to schema
- Create API key utilities (generate, hash, mask with tpmjs_sk_ prefix)
- Implement dual auth middleware (session + API key)
- Add rate limiting with Vercel KV
- Create CRUD endpoints for API key management
- Add usage tracking and analytics endpoint
- Build API key management UI in dashboard
- Build usage dashboard with charts

Route Protection:
- Require auth for MCP endpoints (mcp:execute scope)
- Require auth for agent chat (agent:chat scope)
- Require auth for bridge connections (bridge:connect scope)

Documentation Updates:
- Update all curl/fetch examples with Authorization header
- Document API key format, scopes, and rate limits
- Update PRD-MCP-BRIDGE.md, MCP-AGGREGATOR-DESIGN.md
- Update API docs page with auth requirements
- Update HOW_TO_PUBLISH_A_TOOL.md
2026-01-13 04:45:52 +10:00
Ajax Davis
b4be05e004 feat: replace ASCII diagram with D3.js visualization in bridge tutorial 2026-01-13 01:54:12 +10:00
Ajax Davis
c8c1a12f22 feat: complete MCP Bridge implementation
- Add @tpmjs/mcp-client package for connecting to MCP servers
- Add @tpmjs/bridge CLI for bridging local MCP servers to TPMJS
- Add @tpmjs/test-file-writer test MCP server
- Add BridgeConnection and CollectionBridgeTool database models
- Add /api/bridge endpoints for bridge communication
- Add /api/collections/[id]/bridge-tools API for managing bridge tools
- Update MCP handlers to include bridge tools in tools/list
- Add bridge status UI at /dashboard/settings/bridge
- Add interactive bridge tutorial at /docs/tutorials/bridge
2026-01-13 00:59:34 +10:00
Ajax Davis
079c328bfc fix: remove random color highlighting and improve contrast on architecture page
- Remove accent variant from Cell component, simplify to muted boolean
- Remove primary variant from ArchBox component
- Replace all text-primary with text-foreground for consistency
- Remove blue-tinted borders from sections
- Update all cells to use consistent styling

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-11 04:06:40 +10:00
Ajax Davis
74c7e63b9f refactor: update architecture page to use TPMJS design system
Replaced custom lime/zinc colors with proper theme variables:
- bg-background, bg-surface, bg-surface-secondary
- text-foreground, text-foreground-secondary, text-foreground-tertiary
- border-border, border-primary
- Uses Badge component from @tpmjs/ui
- Uses Container component for layout
- Maintains the nested box layout style

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-11 03:09:23 +10:00
Ajax Davis
0012eba137 feat: add architecture documentation page with chip-style diagrams
Create visual architecture documentation at /docs/architecture with:
- Platform overview showing user products, API layer, infrastructure
- Tool execution pipeline flow diagram
- Executor system comparison (default vs custom)
- Collections and Agents data model
- Tool discovery and sync pipeline
- Database entity relationships

Uses NVIDIA-inspired chip diagram aesthetic with nested boxes,
grid layouts, and lime/yellow accent colors on dark background.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-11 02:51:05 +10:00
Ajax Davis
55ec58065e feat: add API getting started documentation page
- Comprehensive REST API and MCP protocol documentation
- Interactive examples with cURL commands
- Covers tools, search, collections, agents, and stats endpoints
- MCP protocol with initialize, tools/list, and tools/call examples
- Response format, error handling, and pagination docs
2026-01-11 00:49:15 +10:00
Ajax Davis
a5630e4f41 fix: resolve MCP route timeout and agent route conflict
- Add 10s database query timeout wrapper to prevent indefinite hangs
- Wrap all Prisma calls in MCP handlers with timeout protection
- Reduce maxDuration from 300s to 60s for MCP routes
- Move public conversation route from /api/agents/[username]/[uid] to
  /api/chat/[username]/[uid] to resolve Next.js route parameter conflict
- Update sharing docs to reflect new chat API path

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-10 01:45:17 +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
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
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
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
Ajax Davis
287d84163f fix: resolve type errors and lint issues for CI
- Fix SkeletonWithRelations type mapping in batch-processor.ts by explicitly mapping only the required fields
- Escape unescaped entities in tutorial pages (apostrophes and quotes)
2026-01-07 15:40:50 +10:00
Ajax Davis
6b48ab224d fix: replace outdated changelog section with link to dedicated page
Closes #10

- Remove hardcoded v1.0.0 changelog entry from docs page
- Add link to the dedicated /changelog page instead
- Prevents documentation from becoming stale

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-07 13:43:43 +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
fada29ecbe feat: add npm-like features to tool detail page and update keyword to tpmjs
- Add download trend sparkline chart showing 30-day download history
- Add bundle size component with minified/gzipped sizes via bundlephobia proxy
- Add more install commands: yarn, bun, deno (in addition to npm, pnpm)
- Change discovery keyword from "tpmjs-tool" to "tpmjs" across entire codebase
- Update sync endpoints to use new keyword
- Update all documentation and package.json files

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-29 21:30:42 +10:00
Ajax Davis
effd242b07 feat: add AI-generated OG images with OpenAI and Vercel Blob caching
- Add /api/og/[...path] endpoint for dynamic OG image generation
- Use OpenAI gpt-image-1 for image generation with page-specific prompts
- Cache images in Vercel Blob storage with 30-day TTL
- Extract page content for contextual prompts (static pages, tool details)
- Update all page metadata to use dynamic OG image URLs
- Refactor tool detail page to server component for generateMetadata support
- Fall back to static /public/og-image.png on generation errors
2025-12-28 18:21:11 +10:00
Ajax Davis
99bd0fb061 feat: add mobile responsiveness across all pages
- Add hamburger menu icon and MobileMenu slide-out drawer component
- Update AppHeader with responsive nav (hidden on mobile, hamburger shown)
- Apply responsive styles to all 14 pages:
  - Responsive headings (text-2xl sm:text-3xl md:text-4xl)
  - Responsive grid gaps (gap-4 md:gap-6)
  - Explicit mobile grid columns (grid-cols-1 md:grid-cols-X)
  - Flex stacking on mobile (flex-col sm:flex-row)
- Add mobile nav dropdown to docs page
- Update README to correctly frame TPMJS as a discovery registry first,
  with agent integration as secondary/optional
2025-12-28 12:39:02 +10:00
Ajax Davis
e84eda7525 refactor: rename exportName to name across entire codebase
- Database: Migrate column export_name to name in tools table
- Prisma schema: Update Tool model to use name field
- Sync routes: Update keyword and changes sync to use name
- Railway executor: Update API endpoints to use name parameter
- API routes: Update all tool routes to use name field
- Web app: Update all pages and components
- Playground: Update tool loader and sidebar
- create-basic-tools: Update types and generators
- Scripts: Update sync and test scripts

Database migration was done via direct SQL:
  ALTER TABLE tools RENAME COLUMN export_name TO name;

The unique constraint remains on (package_id, name).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-17 17:19:21 +10:00
Ajax Davis
5fc584fc66 feat(tpmjs-spec): add auto-discovery of tools and rename exportName to name
Major changes to the TPMJS specification:

1. Auto-Discovery: The `tools` array is now optional. If omitted, TPMJS
   automatically scans package exports and registers any export with
   `description` and `execute` properties (standard AI SDK tool format).

2. Renamed `exportName` to `name` in tool definitions for cleaner spec.

3. Added `/list-exports` endpoint to Railway executor that:
   - Lists all exports from a package
   - Identifies valid AI SDK tools
   - Extracts descriptions for auto-discovered tools

4. Added `toolDiscoverySource` field to track 'auto' vs 'manual' discovery.

5. Updated tool page UI with:
   - Auto-discovery warning banner
   - Badge showing discovery source

6. Updated all documentation pages (docs, spec, publish) to reflect:
   - Optional tools array with auto-discovery
   - Use of `name` instead of `exportName`
   - Auto-extraction of schema and description

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-17 14:02:26 +10:00
Ajax Davis
70d112982e docs: update documentation to reflect auto-extraction of inputSchema
- Update spec page to show simplified required fields (category, tools)
- Mark parameters, returns, aiAgent as deprecated (now auto-extracted)
- Add schema extraction section explaining the process
- Update publish page with simplified examples
- Update FAQ with schema extraction question
- Update how-it-works with validation & schema extraction step
- Update docs page with auto-extraction callout and simplified spec
2025-12-17 13:25:44 +10:00
Ajax Davis
a60c02576f docs: add execution API documentation to /docs page
- Document POST /api/tools/execute/[...slug] endpoint
- Show URL formats (by tool ID and by package/export name)
- Document request body parameters (prompt, parameters)
- List SSE events (chunk, tokens, complete, error)
- Add curl and JavaScript code examples
- Document rate limiting (10 requests/minute per IP)
- Add to sidebar navigation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-14 13:43:51 +10:00
Ajax Davis
33c20db291 feat(web): add changelog page displaying release history for all packages
- Parse CHANGELOG.md files from SDK and tool packages at build time
- Display version history with major/minor/patch badges
- Group by SDK packages (ui, types, utils, env) and Tool packages
- Add changelog link to navigation header
- Fix unescaped apostrophes in docs page

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-14 13:31:10 +10:00
Ajax Davis
8605a54310 feat(docs): add comprehensive documentation page with sidebar navigation
- Create /docs page with complete TPMJS documentation
- Add sidebar navigation with section tracking
- Document SDK reference (registrySearchTool, registryExecuteTool)
- Document REST API endpoints
- Document publishing guide and TPMJS specification
- Add advanced sections (override execute, custom wrappers, self-hosting)
- Include FAQ and troubleshooting sections
- Add Docs link to main navigation header

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-14 13:00:21 +10:00