Commit graph

196 commits

Author SHA1 Message Date
Ajax Davis
9ab8946c9d feat: add skills.md endpoint and CLI run command
- Add /:username/collections/:slug/skills.md endpoint for AI-generated skills docs
- Analyze npm package source code to generate comprehensive capability contracts
- Add `tpm run` CLI command to execute tools from collections via MCP
- Cache generated skills.md in database with 1-week TTL
2026-01-21 14:50:07 +10:00
Ajax Davis
a7c7c08f44 fix: guard overlay positioning refs 2026-01-20 16:52:18 +10:00
Ajax Davis
48c41e8733 feat: add use cases marketing product with AI-generated content
Transform qualifying scenarios into marketing-ready use cases with:
- AI-generated titles, descriptions, ROI estimates, business value
- Persona/industry/category taxonomy for targeting
- Browseable feed with filtering and ranking
- SEO-optimized case study pages
- Daily cron job for generation and ranking

Database:
- Add Persona, Industry, Category lookup tables
- Add UseCase model with marketing content fields
- Add junction tables for personas/industries/categories
- Add SocialProof model for cached metrics

API:
- GET /api/use-cases - Global directory with filtering
- GET /api/use-cases/[id] - Individual use case details
- GET /api/public/users/[username]/collections/[slug]/use-cases
- POST /api/cron/use-cases - Nightly generation job

Frontend:
- /use-cases - Global feed with persona dropdown
- /use-cases/[slug] - SEO case study page
- /[username]/collections/[slug]/use-cases - Collection feed
- UseCasesFeed component - Sortable table component
- UseCaseCaseStudy component - Full case study layout
2026-01-20 16:17:35 +10:00
Ajax Davis
192284ad07 fix: update UI test expectations to match actual component classes
Fixed test expectations in Badge, Button, Card, Checkbox, Input,
Select, and Textarea components to match the actual Tailwind utility
classes being applied.

Changes:
- Badge: font-medium, rounded-none, transition-colors
- Card: border-dashed, rounded-none
- Button: rounded-none, focus-visible:ring-2
- Input: font-mono, rounded-none, focus-visible:ring-2
- Select: rounded-none, transition-colors
- Textarea: font-mono, rounded-none, transition-colors
- Checkbox: transition-colors, rounded-none

All 856 tests now pass.
2026-01-20 13:54:25 +10:00
Ajax Davis
f5d7364c96 fix: resolve tailwind config import issues
- Inline tailwind config to resolve Turbopack import issues with @tpmjs/config
- Add exports field to @tpmjs/config package.json for proper module resolution
- Add @tpmjs/config to transpilePackages in Next.js config

Note: page.tsx has a pre-existing Turbopack parsing error at line 604
that needs to be addressed separately (it existed before these changes).
2026-01-20 12:12:16 +10:00
Ajax Davis
ffc5807ba0 feat: add E2B sandbox tools and update documentation navigation
- Add new e2b tool package for cloud sandbox code execution
- Update docs navigation with descriptions and developers guide section
- Configure blocks.yml for e2b tool discovery
2026-01-20 08:05:19 +10:00
Ajax Davis
3c5c218207 feat(web): add scenarios UI - explorer, detail, and homepage section
- Add global scenarios explorer page at /scenarios
- Add scenario detail page with run history at /scenarios/[id]
- Add collection-scoped scenario detail page
- Add featured scenarios section to homepage
- Add useScenarios hook for data fetching
- Regenerate CLI manifest
2026-01-19 05:57:29 +10:00
Ajax Davis
dc684d3b0e chore(cli): bump version to 0.1.4 for npm publish 2026-01-19 05:50:32 +10:00
Ajax Davis
ea742c9386 feat: add scenarios system for collection testing
Implements the complete scenarios feature for TPMJS:

API endpoints:
- GET/POST /api/scenarios - list/create scenarios
- GET/PATCH/DELETE /api/scenarios/:id - scenario CRUD
- POST /api/scenarios/:id/run - execute scenario
- GET /api/scenarios/:id/runs - run history
- POST /api/scenarios/check-similarity - vector similarity check
- GET /api/scenarios/featured - featured scenarios
- POST /api/collections/:id/scenarios/generate - AI scenario generation
- GET /api/collections/:id/scenarios - list collection scenarios

Services:
- generate-prompt.ts - AI prompt generation using GPT-4o-mini
- similarity.ts - vector embedding and cosine similarity
- evaluate.ts - LLM-based success evaluation
- execute.ts - scenario execution orchestration

CLI commands:
- tpm scenario list [collection] - list scenarios
- tpm scenario run <collection> - run all scenarios
- tpm scenario test <id> - run single scenario
- tpm scenario generate <collection> - generate scenarios
- tpm scenario info <id> - scenario details

Database:
- Scenario, ScenarioEmbedding, ScenarioRun, ScenarioQuota models
- Streak-based quality scoring
- Daily quota management

Migration script included for converting existing useCases.
2026-01-18 09:31:31 +10:00
Ajax Davis
154f000505 feat(cli): add @tpmjs/cli package and browser auth page
- Create comprehensive CLI with oclif framework
- Add commands: auth, tool, agent, collection, mcp, publish
- Add doctor, playground, and update commands
- Add /cli/auth page for browser-based OAuth flow
- Publish to npm as @tpmjs/cli@0.1.2
2026-01-18 06:12:34 +10:00
Ajax Davis
21b2c46516 fix(hllm): update package configuration and exports 2026-01-18 01:52:36 +10:00
Ajax Davis
c677110bfe fix(ui): resolve table dark mode styling issues
- Update Table component to use bg-surface instead of hardcoded bg-white
- Fix TableRow hover and selected states to use design system tokens
- Update virtualized tables in agents, collections, and tool-search pages
2026-01-18 01:51:41 +10:00
Ajax Davis
1234b383e7 feat(judge): add AI conversation quality evaluation tool
- Evaluates conversations across 10 metrics:
  taskCompletion, accuracy, relevance, clarity, efficiency,
  userIntentAlignment, actionability, progress, errorHandling, completeness
- Returns weighted overall score (0-10)
- Provides verdict (pass/retry/fail) with reasons
- Detects conversation loops and stuck states
- Lists must-dos, suggestions, and next steps
- Designed for frequent use in agentic loops
2026-01-17 10:49:40 +10:00
Ajax Davis
aad8b58031 fix(hllm): use correct base URL hllm.dev instead of hllm.ai 2026-01-17 10:10:31 +10:00
Ajax Davis
9ebb5ee02e fix(hllm): ensure tool descriptions meet 20 char minimum
- Updated deleteApiKey description from 'Delete an API key.' (18 chars)
  to 'Delete an existing API key from the account.' (44 chars)
- Bumped version to 0.1.1
2026-01-17 08:50:48 +10:00
Ajax Davis
0fa4374d9e feat(tools): add @tpmjs/tools-hllm package
Add HLLM API client tools for AI agents with 36 tools:
- Topology execution (executeTopology)
- Chat sessions (list, create, get, update, delete)
- Session messages (add, clear)
- Prompt library (CRUD + usage tracking)
- User profile and stats
- Environment variables
- File management
- Models listing
- Execution logs and agent metrics
- TPMJS tools (list, describe, execute)
- Prompt generation and improvement
- Data export/import
- Health check and public stats
- API keys management

Published as @tpmjs/tools-hllm@0.1.0
2026-01-17 08:35:27 +10:00
Ajax Davis
c46a02247a fix(agents): correct model id to 5.1-mini 2026-01-17 07:42:50 +10:00
Ajax Davis
ba451a6b4b feat(agents): add gpt-5.1-mini to OpenAI models 2026-01-17 07:24:23 +10:00
Ajax Davis
3cde10faf4 feat(tools): add utility.sleep tool with cute nap messages 2026-01-17 07:13:35 +10:00
Ajax Davis
f8302c92d6 feat(agents): render tool parameters in modal
- Add parameters to tool API responses (agents + collections)
- Update ToolInfo interface to include parameters
- Render parameters grouped by required/optional
- Show parameter name, type, description, and default value
- Style with design system patterns (fieldsets, badges, etc.)
2026-01-17 04:35:25 +10:00
Ajax Davis
301d08303e feat(agents): add GPT-4.1 models and expandable collections
- Add GPT-4.1 and GPT-4.1-mini to OpenAI provider models
- Set gpt-4.1-mini as default model for new agents
- Make collections in chat tools panel expandable/clickable
- Fix type error in ChatToolsPanel
2026-01-17 04:18:56 +10:00
Ajax Davis
a7a0cbb988 fix(sprites-list): add 'warm' to valid sprite statuses
The Sprites API can return 'warm' status for sprites that are warming up.
This was causing sprites-list to throw 'Invalid sprite status: warm' error.
2026-01-16 18:00:58 +10:00
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
144f07ea75 fix(ui): use tsc for declarations to avoid memory issues in CI
The rollup-plugin-dts used by tsup runs out of memory with 54 entry points.
Split build into two steps:
1. tsup for ESM bundles
2. tsc --emitDeclarationOnly for .d.ts files
2026-01-16 08:21:41 +10:00
Ajax Davis
f0d271720c feat(ui): add state components and apply design system compliance
Add new reusable components:
- EmptyState: for empty list/search states with icon, title, description
- ErrorState: for error displays with optional retry button
- LoadingState: for loading states with Spinner and message
- PageHeader: for consistent page headers with title, description, actions

Apply components across pages:
- agents, collections, tool-search pages use new state components
- stats page uses LoadingState and ErrorState
- faq page uses Icon for chevrons
- health page uses Table components
- dashboard agent forms use Input, Select, Textarea, Label
- Replace custom div spinners with Spinner component
2026-01-16 08:16:05 +10:00
Ajax Davis
499a38ce1b refactor: apply style guide compliance across auth, dashboard, and tool pages
- Replace hardcoded color classes with design system tokens (error, success, warning, info)
- Replace raw HTML inputs with Input component from @tpmjs/ui
- Replace raw HTML buttons with Button component
- Add eye/eyeOff icons for password visibility toggle
- Add mail icon for verify-email page
- Fix text colors to use semantic tokens (text-error, text-success, text-warning)
- Fix background colors to use opacity tokens (bg-error/10, bg-success/10)
- All pages now properly support dark mode through CSS custom properties
2026-01-16 06:49:47 +10:00
Ajax Davis
066e599293 feat(ui): add comprehensive design system with 14 new components
New UI Components:
- Modal/Dialog with sizes, focus trap, backdrop
- Toast/Notification with variants, stacking, actions
- Drawer/Sheet with directions and widths
- Popover with triggers and positioning
- Tooltip with delays and placements
- DropdownMenu with items, dividers, keyboard nav
- Breadcrumbs with separators and collapsing
- Pagination with full/simple/minimal variants
- Accordion with single/multi expand modes
- Skeleton with text/avatar/card/table variants
- InstallSnippet with package manager toggle
- QualityScore with tier badges
- ToolCard for registry display

Design System Enhancements:
- Complete token specification (shadows, radius, z-index, opacity)
- Full dark mode palette in globals.css
- Updated component variants for dark mode support

Style Guide Expansion:
- Split into 21 modular section files
- Pattern library: navigation, forms, feedback, tables, search
- Governance: a11y checklists, content guidelines, icon system
- Interactive examples throughout
2026-01-16 05:51:12 +10:00
Ajax Davis
3b5bc83c52 fix(create-basic-tools): fix clack select types 2026-01-16 02:46:07 +10:00
Ajax Davis
3456b26c9d feat(collections): add AI-generated use cases
Add "Example Use Cases" section to collection pages that generates
practical workflow examples showing how tools can work together.

- Add useCases and useCasesGeneratedAt fields to Collection model
- Create use-cases-generator.ts using Vercel AI SDK with gpt-4.1-mini
- Add POST /api/collections/[id]/use-cases/generate endpoint
- Add AI_GENERATION_RATE_LIMIT (5 req/hour per IP)
- Create UseCasesSection component with generate/regenerate UI
- Generate 6 use cases: 3 simple (1-2 tools) + 3 complex (3-5 tools)
- Include useCases in public collection API response
2026-01-16 02:33:57 +10:00
Ajax Davis
c21ed5b41e feat(exe-dev): add exe.dev VM management tools v0.2.3
Add 15 MCP tools for managing exe.dev virtual machines:
- list, create, deleteVm, restart - VM lifecycle management
- exec - execute commands on VMs via SSH
- shareShow, shareSetPublic, shareSetPrivate - visibility control
- sharePort - configure HTTP proxy port
- shareAddUser, shareRemoveUser - user access management
- shareAddLink, shareRemoveLink - shareable link management
- whoami - user account info
- shelleyInstall - install Shelley agent

Key fixes in v0.2.3:
- Properly quote SSH args to prevent local shell interpretation
- Add -- separator for commands to prevent flag parsing issues
- Support base64-encoded SSH key via EXE_DEV_SSH_KEY env var
2026-01-15 09:49:08 +10:00
Ajax Davis
ad46943270 feat(unsandbox): add 3 more tools - runAsync, listJobs, deleteJob
Complete unsandbox API coverage with 7 total tools:
- executeCodeAsync: async code execution
- execute: sync code execution
- run: sync with shebang auto-detect
- runAsync: async with shebang auto-detect
- getJob: get job status/results
- listJobs: list all active jobs
- deleteJob: cancel a job
2026-01-15 06:43:40 +10:00
Ajax Davis
4461bf70c8 feat(unsandbox): add code execution tools for unsandbox API
- Add 4 new tools: executeCodeAsync, getJob, execute, run
- Support 42+ programming languages
- Features: network isolation modes, input files, compiled artifacts, WASM
- Add entity definitions for code execution results
- All tools pass schema and shape validation
2026-01-15 06:38:45 +10:00
Ajax Davis
54d39c38fa docs(sprites-exec): add port 8080 convention note to description
Updated tool description to mention that web servers must listen on
port 8080 as per Sprites convention for public URLs.
2026-01-15 06:17:37 +10:00
Ajax Davis
27e7d45646 feat(sprites): add sprites-url-get and sprites-url-set tools
New tools for managing sprite URL access settings:
- sprites-url-get: Get the public URL and auth settings for a sprite
- sprites-url-set: Set URL auth to 'public' or 'sprite' (private)

Both published as @tpmjs/tools-sprites-url-get and @tpmjs/tools-sprites-url-set v0.1.0
2026-01-15 04:56:52 +10:00
Ajax Davis
e4c09a475f fix: correct API endpoints for sprites tools v0.1.3/v0.1.4
Fixed URL endpoints based on Sprites API documentation:
- sprites-sessions: /exec/sessions -> /exec (v0.1.3)
- sprites-policy-get: /policies -> /policy/network (v0.1.3)
- sprites-policy-set: /policies -> /policy/network with rules[] body (v0.1.3)
- sprites-checkpoint-create: /checkpoints -> /checkpoint singular (v0.1.4)

Also fixed checkpoint-create to properly parse NDJSON streaming
response format with type/data/time fields.
2026-01-15 04:30:52 +10:00
Ajax Davis
e6857e245e fix: wrap shell operators in sh -c for sprites-exec v0.1.5
Commands containing shell operators (&&, ||, |, ;, >, etc.) were being
parsed incorrectly, causing errors like "The update command takes no
arguments". Now detects shell operators and wraps the entire command
in `sh -c "..."` for proper execution.
2026-01-15 03:57:40 +10:00
Ajax Davis
a548edc0db chore: bump sprites-list to 0.1.3 (add cold status support) 2026-01-15 01:06:38 +10:00
Ajax Davis
c1655dd318 fix: pass explicit version to executor to avoid Deno cache issues
The executor was using version: 'latest' which caused Deno to cache
old versions of packages. Now we pass the explicit version from the
database to ensure the correct version is always loaded.

Also fixed sprites-list to recognize 'cold' as a valid sprite status.
2026-01-15 00:59:05 +10:00
Ajax Davis
69ae0dda2f fix: add error handling for agent env vars save and sprites-exec JSON errors
- Agent env vars: auto-save now awaits response and shows alert on failure
- sprites-exec v0.1.4: detect JSON error responses (e.g., auth failures) before binary parsing
2026-01-14 23:48:43 +10:00
Ajax Davis
b5fa46f6be fix: sprites-exec tool to use correct API format
- Use query parameters instead of JSON body for cmd
- Parse command string into repeatable cmd params
- Handle binary response format (stdout=0x01, stderr=0x02, exit=0x03)
- Add shell command documentation to README
2026-01-14 17:13:58 +10:00
Ajax Davis
ce3596ea22 feat: add READMEs to sprites packages and fix blocks.yml schema
- Add README documentation for all 11 sprites packages
- Fix blocks.yml to be compatible with blocks CLI validator
- Add project wrapper and type fields to blocks.yml
- Bump sprites packages to v0.1.2
2026-01-14 16:22:39 +10:00
Ajax Davis
2cd2b10cd0 refactor: replace exportName with name throughout codebase
- Update TpmjsToolDefinitionSchema to only use 'name' field
- Add 'sandbox' as valid category for sprites tools
- Update all package.json files to use 'name' instead of 'exportName'
- Update documentation and source files accordingly
- Add 11 new sprites tools for sandbox/code-execution
2026-01-14 14:18:36 +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
77e697db56 fix: make username compulsory and improve MCP error messages
- Add profile settings page for username management
- Add username prompt in dashboard when not set
- Improve MCP endpoint to show specific error for missing user vs collection
- Make sign-up flow retry username PATCH and redirect to setup if fails
- Add backfill script for existing users without usernames
- Add Profile link to dashboard sidebar
2026-01-14 04:21:41 +10:00
Ajax Davis
95cb0a96f0 feat: add fork-based ownership and fix MCP non-scoped package names
Fork-based ownership:
- Add forkedFromId, forkCount fields to Collection and Agent models
- Add fork-status API endpoints for collections and agents
- Add ForkButton and ForkedFromBadge UI components
- Update clone endpoints to set forkedFromId and increment forkCount
- Add COLLECTION_FORKED and AGENT_FORKED activity types
- Enforce owner-only access for MCP tool execution and agent chat

MCP fix:
- Fix parseToolName to handle non-scoped packages like firecrawl-aisdk
- Try both scoped (@scope/name) and literal (name-with-hyphens) interpretations
- Pass collection envVars to tool executor for API key support
2026-01-13 10:23:28 +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
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
41cbeefabb fix: increase tool execution timeout to 5 minutes
Tools like discord-read that fetch data from external APIs need more time.
Previous 10-30 second timeout was causing silent failures.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-12 04:16:15 +10:00
Ajax Davis
938a382aab feat: add environment variables support for agents and collections
- Add envVars field to Agent and Collection models in Prisma schema
- Add envVars to UpdateAgentSchema and UpdateCollectionSchema types
- Implement env vars merging logic (agent overrides collection)
- Pass env vars through tool executor to sandbox
- Add UI for managing env vars in agent and collection settings pages
- Update API routes to handle envVars PATCH updates
- Refactor discord tool execute functions for biome compatibility

This allows users to configure tool-specific environment variables (like
DISCORD_BOT_TOKEN) at both the collection and agent level, with agent
settings taking precedence over collection settings.
2026-01-12 01:35:29 +10:00