Commit graph

178 commits

Author SHA1 Message Date
Ajax Davis
c20ee3df04 feat: add HN launch readiness features
Launch checklist implementation:
- Add Privacy Policy page (/privacy) with GDPR compliance
- Add Terms of Service page (/terms)
- Add custom 404 and error pages with helpful navigation
- Add FAQ page (/faq) covering common questions
- Add SEO meta tags with OpenGraph/Twitter cards
- Add JSON-LD structured data (Organization, WebSite, SoftwareApplication)
- Add sitemap.ts and robots.ts for search engines
- Add security headers (HSTS, CSP, X-Frame-Options) in vercel.json
- Add security.txt at /.well-known/security.txt
- Add API rate limiting (100 req/min default, 20 req/min strict)
- Add empty states in tool search for better UX
- Update AppHeader with FAQ link
- Update AppFooter with Privacy/Terms links
- Update biome.json to allow dangerouslySetInnerHTML for JSON-LD in page files

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-14 11:56:42 +10:00
Ajax Davis
6482c31f17 style(playground): polish UI design for better consistency and alignment
- ChatInput: Redesign with rounded container, better button alignment, helper text
- ChatHeader: Consistent bg-surface, refined typography and spacing
- ChatMessages: Improved empty state with icon badge and suggestion box
- MessageBubble: Cleaner message cards, collapsible tool input/output, status badges
- ToolsSidebar: Header/content separation, keyboard accessibility, wider width
- SettingsSidebar: Matching header style, dashed empty state, footer info section

All components now use consistent theme tokens (bg-surface, bg-background, etc.)
and follow the same visual patterns for headers, cards, and spacing.
2025-12-12 12:39:18 +10:00
Ajax Davis
4413ac00f6 feat(playground): load all tools and add hide broken toggle
- Paginate through all tools from registry API (was limited to 20)
- Add 'Hide broken tools' checkbox (enabled by default)
- Filter out tools with BROKEN import or execution health
2025-12-12 12:28:02 +10:00
Ajax Davis
aa1a5cd246 fix: point Playground link to playground.tpmjs.com 2025-12-12 12:21:04 +10:00
Ajax Davis
097f35f69f docs(sdk): add 'Passing API Keys' section with wrapper pattern 2025-12-12 11:41:41 +10:00
Ajax Davis
b4acee2895 docs(sdk): improve diagram tooltips and fix GitHub button labels
- Make tooltips more verbose with detailed explanations for each node
- Add tooltip for 'Your Tools' node
- Change GitHub button labels from 'GitHub' to 'Source'
- Fix missing </p> closing tags
2025-12-12 10:04:46 +10:00
Ajax Davis
f536ebcee9 fix: rename SDK packages to lowercase for npm compatibility
- @tpmjs/registrySearch -> @tpmjs/registry-search
- @tpmjs/registryExecute -> @tpmjs/registry-execute

npm package names cannot contain capital letters
2025-12-12 09:52:48 +10:00
Ajax Davis
ed53b68c75 feat(sdk): replace ASCII diagram with interactive D3 visualization
- Create SDKFlowDiagram component with animated D3 graphics
- Add flowing particle animations along connection paths
- Add hover interactions with tooltips for each node
- Add entrance animations with staggered timing
- Add subtle glow effects and shadows
- Responsive design that adapts to screen width
- Sleek minimal black and white aesthetic with depth effects
2025-12-12 09:43:40 +10:00
Ajax Davis
9577a5979a fix(sdk): update code example to use AI SDK v6 streamText API
- Replace deprecated Agent class with streamText function
- Add @ai-sdk/anthropic import for model provider
- Change instructions to system parameter
- Add example prompt showing tool usage
2025-12-12 09:12:20 +10:00
Ajax Davis
311b331eee fix(sdk): move package links to hero, separate install commands 2025-12-12 08:15:38 +10:00
Ajax Davis
9bd47c0fad feat(sdk): add npm and GitHub links to package sections 2025-12-12 07:55:30 +10:00
Ajax Davis
ee825aa97c feat: add @tpmjs/registrySearch and @tpmjs/registryExecute SDK packages
- Create @tpmjs/registrySearch package for searching tool registry
- Create @tpmjs/registryExecute package for executing tools via sandbox
- Support self-hosted registries via TPMJS_API_URL and TPMJS_EXECUTOR_URL env vars
- Add /sdk documentation page with usage examples and architecture
- Add SDK link to navigation menu
- Include design doc for registry SDK architecture

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-12 07:29:06 +10:00
Ajax Davis
8f27d1cfa7 fix(executor): declare packageName/exportName before try block
Same issue as startTime - these variables were destructured inside the
try block but referenced in the catch block for health reporting. If
JSON parsing or any early error occurred, the catch block would crash
with 'packageName is not defined'.

Now declares them with 'unknown' defaults before try, then assigns
the actual values inside.
2025-12-12 06:14:08 +10:00
Ajax Davis
c8e590419e fix(executor): move startTime declaration before try block
The startTime variable was declared inside the try block but referenced
in the catch block, causing 'startTime is not defined' errors when
exceptions occurred before line 404 (e.g., during req.json() parsing).

Moving the declaration before the try ensures it's in scope for the
catch block's executionTimeMs calculation.
2025-12-12 05:53:47 +10:00
Ajax Davis
1ae6923d1a refactor(health): move health reporting to Railway executor
Health status is now reported from the executor - the single point where
all tools run. This ensures consistent health tracking regardless of
client (playground, direct API, etc).

- Add reportToolHealth() to Railway executor
- Report success/failure after every tool execution
- Remove health reporting from playground (executor handles it)
- Executor calls /api/tools/report-health which has all the logic
2025-12-12 05:23:27 +10:00
Ajax Davis
3d00dee042 refactor(health): centralize health status logic in web app API
- Remove direct DB updates from playground
- Add /api/tools/report-health endpoint with all health logic
- Playground now reports results to web app API
- All env var / validation error detection is in one place
- Health status updates based on execution success and error type
- Fix type errors with proper null checks
2025-12-12 05:17:04 +10:00
Ajax Davis
4b337c8fe0 fix(health-check): treat env var errors from executor 500 responses as HEALTHY
The executor returns HTTP 500 for all tool errors, including missing env vars.
Before: 500 response = BROKEN
After: Check error message for env/validation patterns before marking BROKEN

This ensures tools that require API keys (like @parallel-web/ai-sdk-tools)
show importHealth: HEALTHY since the tool loads correctly - it just needs config.
2025-12-12 04:56:02 +10:00
Ajax Davis
e09596a7fa fix(executor): pass execution context with abortSignal to tool execute()
Some AI SDK tools (like @parallel-web/ai-sdk-tools) expect execute(params, context)
where context contains { abortSignal, messages, toolCallId }. Previously we only
passed params which caused 'Cannot destructure abortSignal' errors.

Also:
- Improved playground system prompt for better tool execution
- Playground /api/tools now proxies to web app with response transformation
- Added broken-tools.md documenting tool failure categories

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-12 04:43:20 +10:00
Ajax Davis
04e7315185 fix(search-registry): remove health status from search results
Removes importHealth, executionHealth, healthCheckError, and lastHealthCheck
fields from tool search results. Models were refusing to call tools marked
as BROKEN, even when the issue was just a missing env var.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-12 03:14:36 +10:00
Ajax Davis
4a49bb458e fix(health-check): only mark tools broken for infrastructure failures
Simplify execution health check logic:
- If executor responds (2xx or 4xx), tool is HEALTHY
- Only mark BROKEN for 5xx errors or network/timeout failures
- Validation errors (URL format, missing fields) mean tool IS working
- Remove brittle pattern matching for specific error messages

The previous approach tried to match specific error patterns to determine
if an error was "acceptable". This was fragile. The new approach:
- Import check: can we load and describe the tool?
- Execution check: did the tool execute at all?

If a tool throws a validation error, it executed successfully - it's
correctly rejecting invalid test input. Only infrastructure failures
(executor down, network timeout) indicate a truly broken tool.
2025-12-11 12:22:21 +10:00
Ajax Davis
d744b12115 fix(health-check): treat input validation errors as healthy
Tools that reject invalid test inputs (like invalid URLs) are actually
working correctly - they're validating input as expected. Previously
the health check marked these as BROKEN because the test used dummy
values like 'test' which failed Zod validation.

Now input validation errors (invalid URL, invalid format, type mismatch,
etc.) are treated as HEALTHY, similar to how we already treat missing
environment variables.
2025-12-11 12:13:58 +10:00
Ajax Davis
3e574ac243 fix(playground): update tool health status on successful execution
When a tool is marked as BROKEN but executes successfully in the
playground, update its health status to HEALTHY. This ensures
stale health check data doesn't persist when tools are working.

Also fixes noImplicitAnyLet lint error by refactoring to const.
2025-12-11 12:00:17 +10:00
Ajax Davis
2405ac279d fix(tool-search): add published date, center copy button
- Add formatTimeAgo utility function for relative time display
- Show "Published X ago" at bottom of each tool card using npmPublishedAt
- Center CodeBlock copy button vertically for better alignment
- Update Tool interface to include npmPublishedAt from API
2025-12-11 11:37:42 +10:00
Ajax Davis
1469b0a060 fix(security): update Next.js to 16.0.8 to address CVE-2025-66478 2025-12-11 11:14:43 +10:00
Ajax Davis
cab13f6df2 fix: add keyboard handler and role for a11y compliance 2025-12-11 09:58:20 +10:00
Ajax Davis
022d363ccb fix(ci): resolve lint and architecture errors blocking Vercel deploy
- Add eslint-disable and biome-ignore for a11y rules in tool-search page
- Escape quotes in how-it-works page for react/no-unescaped-entities
- Exclude Deno-based railway-executor from dependency cruiser
- Extract sortTools helper to reduce cognitive complexity
2025-12-11 09:46:27 +10:00
Ajax Davis
833a023688 fix(tool-search): fix download sorting and enable text selection
- Add nullish coalescing for downloads (handle null/undefined values)
- Add select-text class to Link and Card for text selection
2025-12-11 09:33:45 +10:00
Ajax Davis
a99b572ac2 feat(tool-search): add sort dropdown with Most Downloaded and Recent options
- Add sortBy state with 'downloads' as default (most downloaded)
- Add 'recent' sort option to sort by createdAt
- Sorting keeps broken tools at bottom regardless of sort order
- Add createdAt field to Tool interface
2025-12-11 09:27:16 +10:00
Ajax Davis
70f2e421f9 fix(tool-details): correct data model and add AI SDK usage examples
- Update interface to match actual API response (Tool has package relation)
- Fix package name display in installation section (was showing undefined)
- Add step-by-step usage instructions:
  1. Install package
  2. Import the tool
  3. Use with AI SDK (generateText example)
- Update all sidebar sections to use pkg.* for package-level data
- Remove deprecated tpmjsMetadata references
- Clean up unused Tags section
2025-12-11 09:08:54 +10:00
Ajax Davis
4479189df8 fix(playground): use explicit white background for textarea 2025-12-11 08:56:51 +10:00
Ajax Davis
150d48d0ba feat(ui): reimagine Spinner as brutalist grid-based loader
- Replace orbital spinner with 3x3 grid of blocks
- Diagonal wave animation matches dithering aesthetic
- Sharp squares, no rounded corners (brutalist)
- Inline horizontal layout with monospace text
- Consistent styling across all loading states

The new loader evokes "tools being constructed" - fitting
for a tool registry. Uses staggered opacity/scale animation
creating a wave pattern across the grid.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-11 08:19:44 +10:00
Ajax Davis
1e58537a65 feat(ui): add Spinner component with orbital animation
- Create new Spinner component with three orbiting dots
- Use inline CSS keyframes for reliable animation
- Support multiple size variants (xs, sm, md, lg, xl)
- Increase spinner sizes in loading states across the app
- Add biome-ignore directives for pre-existing lint issues
- Fix accessibility: change span onClick to button element

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-11 07:47:32 +10:00
Ajax Davis
89c0d552f6 fix(tool-search): remove tabs and show all tools by default
- Remove Tabs component and activeTab state
- Show all tools in a single grid view
- Simplify API calls by removing unnecessary count fetches
- Add missing Script import in layout.tsx
2025-12-11 06:25:04 +10:00
Ajax Davis
e6d7fc6209 feat(playground): add timing display for each message step
Shows duration for text generation and tool execution in chat messages.
Tracks when each part starts and completes, displays timing in the UI.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-06 03:42:09 +10:00
Ajax Davis
6ebe7353ab fix(web): disable caching on homepage with force-dynamic
Ensures fresh data is always fetched from database on homepage load.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-06 03:08:39 +10:00
Ajax Davis
31ff2fa87f fix: remove nonexistent deno.json from Dockerfile 2025-12-05 01:10:42 +10:00
Ajax Davis
ade550dcf4 fix: use manual volume at /data for Deno cache
Simplified Docker configuration to use manually mounted volume at /data
instead of complex pre-caching strategy. This approach:

- Uses ENV DENO_DIR=/data to point to manually created Railway volume
- Keeps Dockerfile simple and maintainable
- Adds --allow-read/--allow-write permissions for cache access
- Removes railway.toml volume configuration (manual setup instead)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 01:05:07 +10:00
Ajax Davis
d843d7b78d Revert "feat: add persistent Deno cache to Railway executor for faster tool loading"
This reverts commit eb8a5ff91e.
2025-12-05 01:04:39 +10:00
Ajax Davis
47577a43e5 feat: add persistent Deno cache to Railway executor for faster tool loading
- Set DENO_DIR=/app/.deno_cache to persist module cache
- Pre-cache common dependencies (zod-to-json-schema, ai, zod) during build
- Add Railway volume configuration for /app/.deno_cache
- Improve logging to show cache hits vs network downloads
- Add --allow-read and --allow-write permissions for cache access

This dramatically reduces tool loading time after the first import.
Dependencies are downloaded once and reused across all subsequent requests.

Example: ctx-zip with 200+ dependencies will only download once instead
of on every chat request.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 00:50:10 +10:00
Ajax Davis
1bd484797f fix: add 120s timeout per tool and increase route maxDuration to 300s
- Add AbortController timeout (120s) to Railway fetch requests
- Gracefully handle timeout errors and report to health check system
- Increase /api/chat maxDuration from 60s to 300s (5 minutes)
- Prevents entire chat from timing out when one tool has large dependencies
- Tools that timeout are logged and skipped, allowing others to load

Fixes issue where tools like ctx-zip with many dependencies would
cause the entire chat request to timeout after 60 seconds.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 00:43:13 +10:00
Ajax Davis
e3b6ff6d25 fix: make Prisma import lazy in playground to prevent module initialization failures
- Remove top-level Prisma import from dynamic-tool-loader.ts
- Use dynamic import in reportToolFailure function instead
- Prevents entire module from failing if DATABASE_URL is missing
- Fixes API route timeout issue caused by module initialization failure

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 00:27:16 +10:00
Ajax Davis
83afeef2dc feat: add @tpmjs/create-basic-tools generator promotion to website
- Add prominent callout box on homepage in 'Publish Your Tool' section
- Add featured generator section on /publish page with full documentation link
- Include command example and links to GitHub README and NPM
- Highlight key features: 2-3 tools, complete setup, production-ready

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 23:48:36 +10:00
Ajax Davis
38c85bd904 feat: add @tpmjs/create-basic-tools CLI generator
- Interactive CLI generator for scaffolding TPMJS tool packages
- Generates packages with minimum 2 tools (ideally 2-3)
- Zod 4 schemas - uses Zod directly (not jsonSchema wrapper)
- One file per tool in src/tools/<toolName>.ts
- TPMJS validated against official schemas from @tpmjs/types
- Complete package generation ready to publish to npm
- Works both standalone and in monorepo packages/ folders

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 23:34:37 +10:00
Ajax Davis
8b000cf0ca feat: add beta experimental section for dynamic tool loading to how-it-works page
- Add comprehensive section explaining BM25 search with context awareness
- Show comparison of traditional vs dynamic tool loading approaches
- Document Deno sandboxed execution environment on Railway
- Preview future collections feature for tool organization
- Include call-to-action to try the playground
2025-12-04 20:26:38 +10:00
Ajax Davis
129f45353a test: mock react-syntax-highlighter to fix ESM compatibility in CodeBlock tests 2025-12-04 20:21:14 +10:00
Ajax Davis
5c2cc529ef test: update form input tests to expect bg-surface instead of bg-background 2025-12-04 20:02:55 +10:00
Ajax Davis
c751a056a9 feat: add How It Works documentation page
- Create comprehensive /how-it-works page explaining TPMJS architecture
- Add detailed sections on developer workflow, AI agent integration, and system internals
- Include quality scoring formula, health checks, and data flow diagrams
- Add navigation link to AppHeader between Tools and Playground
- Style consistently with existing pages (Publish, Playground)
- Fix: remove debug console.log from ToolsSidebar

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 19:58:54 +10:00
Ajax Davis
cbcb1e49c7 fix: don't mark tools as broken for missing environment variables
Tools that fail due to missing environment variables (API keys, etc.)
are not actually broken - they just need configuration. Added detection
for common env var error patterns and mark these tools as HEALTHY
instead of BROKEN.

Error patterns detected:
- 'is required'
- 'is not set'
- 'missing environment'
- 'API key required/not provided'
- etc.

This fixes false positives where tools like @superagent-ai/ai-sdk
were marked as broken when they just need SUPERAGENT_API_KEY configured.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 19:52:22 +10:00
Ajax Davis
b02c464960 fix: add CSS variables for status colors to playground
Added error, warning, success, and info color CSS variables to
playground globals.css so that Badge component variants display
with correct colors. The error variant will now show red as expected.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 19:47:24 +10:00
Ajax Davis
4ba39e07f8 fix: add health fields to /api/tools/search response
The search endpoint was missing importHealth, executionHealth,
healthCheckError, and lastHealthCheck fields in the response. This caused
the playground (which uses search-registry tool) to not receive health
data for displaying broken tool badges.

Added all four health fields to the tool mapping in the search response.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 19:41:50 +10:00