Commit graph

631 commits

Author SHA1 Message Date
Ajax Davis
a1f45fa33a fix: switch scenario evaluator to gpt-4.1-mini
Changed default evaluator from claude-3-5-haiku-latest to gpt-4.1-mini
since OPENAI_API_KEY is configured in production but ANTHROPIC_API_KEY
is not.
2026-01-19 05:20:05 +10:00
Ajax Davis
c52e6eaf24 docs: add scenarios user guide and API reference
- Add /docs/scenarios page with comprehensive user guide
  - Overview of what scenarios are
  - Common archetypes for different tool types
  - CLI commands: generate, list, run, test, info
  - Quality scoring explanation
  - CI/CD integration examples
  - Rate limits documentation

- Add /docs/api/scenarios page with API reference
  - List scenarios endpoint
  - Get scenario details
  - List collection scenarios
  - Create scenario
  - Generate scenarios with AI
  - Run scenario
  - Get run history
  - Check prompt similarity
  - Featured scenarios
  - Error responses
2026-01-18 09:53:36 +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
aa438078f9 feat: add hidden /features page for development 2026-01-18 02:13:23 +10:00
Ajax Davis
028c87056a chore: temporarily disable FeaturesSection 2026-01-18 02:11:18 +10:00
Ajax Davis
5abc85dafc fix: replace non-existent icon names to fix production crash
Changed invalid icon names that were causing viewBox undefined error:
- shield → key
- zap → star
- users → user
- code → terminal
2026-01-18 02:06:17 +10:00
Ajax Davis
69cec40fe1 docs: add MCP double-dash naming convention explanation 2026-01-18 01:53:09 +10:00
Ajax Davis
21b2c46516 fix(hllm): update package configuration and exports 2026-01-18 01:52:36 +10:00
Ajax Davis
08cd131088 feat(web): add interactive animated features section to homepage
- Add FeaturesSection with animated counters, terminal demo, and flow diagram
- Add ToolConnectionViz canvas animation showing tools → TPMJS → agents flow
- Add interactive tool grid with hover effects
- Add feature cards with scroll-triggered reveal animations
- Add FEATURES.md documenting all platform capabilities
2026-01-18 01:52:02 +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
257aa55282 fix(auth): use correct better-auth method for password reset
Change forgetPassword to requestPasswordReset per better-auth docs.
2026-01-17 11:33:49 +10:00
Ajax Davis
7e401c82eb chore: update lockfile for judge package 2026-01-17 11:21:58 +10:00
Ajax Davis
7f907660c8 fix(auth): use better-auth client for password reset
- Use authClient.forgetPassword() instead of raw fetch
- Use authClient.resetPassword() instead of raw fetch
- Fixes 404 error on /api/auth/forget-password
2026-01-17 11:17:47 +10:00
Ajax Davis
3cd2fc9674 fix(auth): implement password reset functionality
- Add sendResetPasswordEmail function to email.ts
- Configure sendResetPassword in better-auth config
- Create /reset-password page to handle password reset after email link click
2026-01-17 11:09:24 +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
6fbb104380 fix(mcp): use actual tool name from DB instead of parsed name
The tool name shortening logic was correctly finding the tool in the
database but then passing the reconstructed parsed.toolName (which may
have an incorrect 'Tool' suffix) to the executor instead of using the
actual tool name from the database record.

This caused 'tool not found' errors when executing tools via MCP SSE
even though the tools were listed correctly.
2026-01-17 09:21:32 +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
github-actions[bot]
4973679cbf chore: sync 1 new tools from Vercel AI registry
Added 1 tools from Vercel AI SDK registry:
- Total tools in registry: 13
- Already synced: 12
- Newly added: 1
- Errors: 0

🤖 Automated by GitHub Actions
Run: https://github.com/tpmjs/tpmjs/actions/runs/21078181125
2026-01-16 19:24:41 +00:00
Ajax Davis
2f02f0f412 fix(agents): simplify copy dropdown with agent-specific options
- Remove MCP server options from agent copy dropdown
- Add: Agent UID, Chat URL (with random convo ID), cURL command
- Fix dropdown styling with proper sizing and monospace fonts
2026-01-17 05:18:21 +10:00
Ajax Davis
f943e8e685 fix(agents): link directly to /username/agents/uid instead of redirect 2026-01-17 05:10:25 +10:00
Ajax Davis
860d13f44f fix(chat): only auto-scroll when messages change, not on every render 2026-01-17 05:00: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
3e0923fc4a feat(api): add GET endpoint for collection tools 2026-01-17 04:27:46 +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
5014822b67 feat(web): redesign agent chat interface with style guide
- Add three-panel layout: conversations, chat, tools
- Create ChatToolsPanel for viewing available tools
- Create ToolDetailsModal for tool information
- Create ChatSettingsDrawer for editing agent settings
- Update styling to match style guide (fieldsets, dashed borders)
- Add tools toggle and settings buttons to header
2026-01-17 04:01:06 +10:00
Ajax Davis
014da0171e fix: link collections to public URLs on agent page
- Add slug and owner username to collection data in API response
- Make collection items clickable links to /@username/collections/slug
2026-01-17 03:25:54 +10:00
Ajax Davis
64ee34d35f fix: handle missing tool results in conversation history
AI SDK requires every tool call to have a matching tool result.
When a tool call's result is missing (e.g., due to network error or
interrupted execution), the conversation would break and users couldn't
send new messages.

This fix:
- Builds a set of tool call IDs that have corresponding tool results
- Only includes tool calls in assistant messages that have matching results
- Falls back to text-only content if all tool calls are missing results
2026-01-17 03:15:28 +10:00
Ajax Davis
de26322e18 fix: exclude existing collection tools from search results
- Pass excludeIds param to search API to filter out already-added tools
- Increase search limit to 50 (was 10) for large packages
- Increase max API limit to 100 (was 50)
- Add notIn filter to database query for efficient exclusion
2026-01-17 02:52:30 +10:00
Ajax Davis
cdadbc86d3 fix: improve collection tool search and dropdown UX
- Add package name match boost to search ranking (50 points for package name matches)
- Keep dropdown open when adding tools for faster bulk additions
- Close dropdown only when all results have been added
2026-01-17 02:40:15 +10:00
Ajax Davis
77204577c1 feat(web): redesign agent API reference with design system
- Replace minimal tabs with comprehensive API documentation
- Add fieldset-style containers with dashed borders per design system
- Document all 4 endpoints: send message, list, get, delete conversations
- Add authentication section with clear instructions
- Add parameter tables with types, defaults, and descriptions
- Document SSE event types for streaming responses
- Add conversation ID explanation section
- Use lowercase headings and monospace fonts per design guide
- Code examples in cURL, TypeScript, and Python
2026-01-17 01:39:53 +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
839e1b3bef feat: show MCP URLs and API access info on public collection/agent pages
- Always show McpUrlSection on public collection pages (not just owners)
- Add note for non-owners about providing their own credentials
- Add API usage example for non-owners on collections
- Add AgentApiSection component for public agent pages
- Show conversation API endpoint and usage example
- Make Chat button available to everyone on public agent pages
2026-01-16 16:57:50 +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
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
baea035adc fix: correct component API usage in SectionComponents
- Fix Drawer, Modal, Popover, Tooltip, DropdownMenu imports and usage
- Use controlled component pattern with open/onClose props
- Fix Breadcrumbs to use BreadcrumbItem children instead of items prop
- Fix Slider onChange to handle ChangeEvent properly
- Fix Pagination prop name from currentPage to page
- Fix EmptyState icon from invalid "inbox" to valid "box"
- Fix StatCard props to use value (number), label, and subtext
2026-01-16 12:06:27 +10:00
Ajax Davis
0489f5cfdb feat(web): implement SWR for instant data fetching
- Add SWR package and global SWRProvider
- Create reusable hooks: useTools, useAgents, useCollections,
  useStats, useLikeStatus, useBundleSize, useActivity
- Update tool-search page to use useTools hook
- Update agents page to use useAgents hook
- Update BundleSize component to use useBundleSize hook
- Update LikeButton with optimistic updates via useLikeStatus
- Add simple about page with creator info
2026-01-16 11:42:55 +10:00
Ajax Davis
7483e697fc feat(web): enhance style guide with left nav and all components
- Add sticky left-hand navigation with scroll-spy for active section
- Add 20+ missing UI components to style guide showcase
- Include Accordion, Breadcrumbs, Drawer, Modal, Pagination, etc.
- Add state components: EmptyState, ErrorState, LoadingState
- Remove Playground link from header and mobile menu
- Comment out Architecture Diagram on homepage temporarily
2026-01-16 11:04:08 +10:00
Ajax Davis
76955bde18 refactor(web): replace inline SVGs with Icon components
- changelog: Replace puzzle and github SVGs with Icon, use Button for CTA
- sdk: Replace 4 github SVGs with Icon component
- Use design system tokens for version badge colors
2026-01-16 09:43:42 +10:00
Ajax Davis
0770d88815 refactor(web): replace raw HTML with design system components
- Replace raw <label> with Label component in auth pages, profile settings, tool-ideas
- Replace raw <button> with Button in CopyButton, CopyDropdown, ExecutorConfigPanel, PackageManagerSelector, ToolPlayground
- Replace raw <textarea> with Textarea in ToolPlayground
- Replace inline SVG with Icon component in error.tsx
2026-01-16 08:51:31 +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