Commit graph

211 commits

Author SHA1 Message Date
Ajax Davis
c962daabce 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
937ffc3194 fix(playground): use explicit white background for textarea 2025-12-11 08:56:51 +10:00
Ajax Davis
8162b1366f 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
d8b5f67a1c 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
bb967ec527 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
8d0cdc1154 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
579bfcfbeb 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
f50f838328 fix(ui): correct CodeBlock test selectors to match component structure
Tests were checking classes on <code> element but variant classes are
applied to the wrapper div with data-language attribute.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-06 02:55:57 +10:00
Ajax Davis
b934cd4c64 Revert "fix(create-basic-tools): correct template path resolution for npx execution"
This reverts commit 96c53ed49a.
2025-12-06 01:48:42 +10:00
Ajax Davis
96c53ed49a fix(create-basic-tools): correct template path resolution for npx execution
Version @tpmjs/create-basic-tools@1.0.6

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 09:06:52 +10:00
Ajax Davis
79547ff52e feat: add markdown-formatter package with defensive patterns
- Create @tpmjs/markdown-formatter with 2 tools:
  - markdownToPlainText: Convert markdown to plain text
  - formatMarkdownTable: Format and align markdown tables
- Includes defensive parameter validation
- Uses AI SDK v6 beta with Zod 4 schemas
- Published v0.2.0 to npm

Testing the full end-to-end workflow:
- Package creation following generator patterns
- Changesets for version management
- npm publishing
- TPMJS registry auto-discovery
2025-12-05 01:31:03 +10:00
Ajax Davis
6765ad9f17 feat(create-basic-tools): add defensive parameter validation to generated tools
- Add defensive checks for required parameters in generated tool code
- Prevents crashes when tools are called with missing/empty params
- Returns descriptive error messages instead of undefined errors
- Update README with explanation of defensive pattern and best practices
- Bump to v1.0.5

Based on learnings from emoji-magic deployment:
- LLMs sometimes make probe calls with empty params
- Defensive checks prevent crashes and provide better error messages
- Even with Zod validation, runtime checks are valuable for robustness
2025-12-05 01:17:08 +10:00
Ajax Davis
6ec6f790d3 fix: remove nonexistent deno.json from Dockerfile 2025-12-05 01:10:42 +10:00
Ajax Davis
750ff2afbe 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
227a7e2dd1 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
74811cc269 fix(emoji-magic): add defensive checks for missing required parameters
- Add validation in both textToEmoji and emojiMood to handle missing text parameter
- Return descriptive error instead of crashing with undefined error
- Bump to v0.2.1
2025-12-05 00:51:24 +10:00
Ajax Davis
eb8a5ff91e 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
578ce944d2 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
9fae5f22b2 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
3cfc141944 chore: release emoji-magic v0.2.0 and create-basic-tools v1.0.4 2025-12-05 00:10:18 +10:00
Ajax Davis
8b7a52ef89 feat: simplify interactive CLI to only ask for package name
- Removed all prompts except package name
- Auto-generate description from package name
- Use sensible defaults: 2 example tools, ai-ml category, MIT license
- Generate exampleTool and anotherTool that users can customize
- Much faster UX - no more 10+ prompts for basic usage
- Updated README with simplified flow example
- Bumped version to 1.0.3

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 23:55:54 +10:00
Ajax Davis
20353987e9 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
75f652e2f2 fix: remove duplicate shebang from source file
- tsup banner already adds shebang, no need in source
- bump version to 1.0.2
- fixes CLI execution errors

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 23:43:03 +10:00
Ajax Davis
051e58c23d 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
c4161f1d35 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
31b29c306f test: mock react-syntax-highlighter to fix ESM compatibility in CodeBlock tests 2025-12-04 20:21:14 +10:00
Ajax Davis
0f758aecca test: mock react-syntax-highlighter to fix ESM compatibility in CodeBlock tests 2025-12-04 20:06:41 +10:00
Ajax Davis
e384951aa8 test: update form input tests to expect bg-surface instead of bg-background 2025-12-04 20:02:55 +10:00
Ajax Davis
e97ecfaa31 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
5b5cffa248 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
722cb6af0b 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
0e907338ed 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
Ajax Davis
f6812b2267 fix: update footer links - correct GitHub URL and contact email
- Change GitHub URL to github.com/tpmjs/tpmjs
- Update contact email to thomasalwyndavis@gmail.com
2025-12-04 19:18:46 +10:00
Ajax Davis
9abff1f203 feat: add reusable ToolHealthBadge and ToolHealthBanner components
- Create ToolHealthBadge component in @tpmjs/ui for broken tool indicator
- Create ToolHealthBanner component in @tpmjs/ui for detailed health warnings
- Integrate both components into playground ToolsSidebar:
  - Badge shows in tool cards in left sidebar
  - Banner shows in tool detail modal
- Update search-registry to include health fields in API responses
- Add package.json exports for new health components

These components provide consistent UI for displaying broken tool status
across the application (tool search, tool detail pages, playground).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 19:12:07 +10:00
Ajax Davis
5b5be16770 fix: display environment variable names correctly in tool modal
Previously env vars were stored as an array but component used Object.entries(),
causing array indices (0, 1, 2...) to appear as variable names instead of actual
names like 'EXA_API_KEY'.

Updated component to:
- Reflect correct array structure in Tool interface
- Iterate directly over array with .map() instead of Object.entries()
- Access envVar.name field for display
- Added support for displaying default values if present

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 18:56:31 +10:00
Ajax Davis
177f8136a0 fix: use lighter background for tool detail modal
- Change modal from bg-background to bg-white/dark:bg-gray-900
- Makes modal stand out clearly from the app background
- Provides better visual hierarchy

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 18:49:59 +10:00
Ajax Davis
07809784db fix: use theme-aware colors for tool detail modal
- Change modal background from bg-surface to bg-background for proper dark mode support
- Use bg-surface for nested elements (env vars, code blocks) to create subtle contrast
- Ensures modal respects the application's dark theme

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 18:43:44 +10:00
Ajax Davis
f50b747e45 feat: add package names and tool detail modal to playground sidebar
- Display package name as secondary text below tool name
- Add clickable tool cards that open detailed modal
- Modal shows comprehensive tool info: description, frameworks, env vars, import URL, tool ID
- Improve modal click handling to only close on backdrop clicks
- Fix accessibility: add type="button" to close button
- Full keyboard support with Escape key and proper ARIA labels

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 18:34:22 +10:00
Ajax Davis
addb6ba06e feat(playground): enhance tool list UI with package names and detail modal
Add two major UX improvements to the ToolsSidebar:

1. Package Name Display
   - Show package name as secondary label below tool name
   - Improves tool identification at a glance

2. Tool Detail Modal
   - Click any tool card to open detailed modal
   - Shows comprehensive information:
     * Tool name, package, version, category
     * Quality score (if available)
     * Full description
     * Supported frameworks (badges)
     * Environment variables (with required flag)
     * Import URL (for manual integration)
     * Tool ID (for debugging)
   - Modal features:
     * Backdrop blur effect
     * Click outside or press Escape to close
     * Close button (X icon) with SVG title
     * Responsive layout (max-w-2xl)
     * Scrollable content (max-h-90vh)
     * Full keyboard accessibility (ARIA labels, tabIndex, Escape key)

3. Enhanced Tool Interface
   - Added optional fields: toolId, qualityScore, frameworks, env, importUrl
   - Maintains backward compatibility with existing API

This gives users full visibility into tool metadata and helps them
understand what each tool does before using it in conversations.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 18:20:33 +10:00
Ajax Davis
56a6128ac6 fix: sanitize invalid JSON schemas with type 'None' to valid object schemas
Add sanitizeJsonSchema() function to fix common schema issues:
- Replaces invalid type 'None' (common in Python tools) with 'object'
- Ensures all schemas have a valid type field
- Recursively sanitizes nested schemas in properties, items, anyOf/oneOf/allOf
- Prevents OpenAI API errors from malformed tool schemas

This fixes the error with @superagent-ai/ai-sdk guard tool which
returns type: 'None' instead of a valid JSON Schema type.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 18:02:10 +10:00
Ajax Davis
2c2eac7992 Revert "feat: add Node.js compatibility layer to Railway executor"
This reverts commit 8562eb5b38.
2025-12-04 17:55:25 +10:00
Ajax Davis
801b0d81b7 fix: use eval instead of regex for TypeScript parsing 2025-12-04 17:50:26 +10:00
Ajax Davis
564543274d fix: use variable for multi-line commit message 2025-12-04 17:47:03 +10:00
Ajax Davis
daedf035af fix: use heredoc for multi-line commit message in workflow 2025-12-04 17:45:56 +10:00
Ajax Davis
fd04674501 fix: support AI SDK jsonSchema() with .jsonSchema property
Added Strategy 2.5 to schema extraction to handle AI SDK v6's
jsonSchema() wrapper which uses `.jsonSchema` property instead
of `.schema`.

This fixes schema validation errors for @tpmjs/hello and other
packages that use jsonSchema() wrapper.

Error was: "No valid schema found" with keys ["_type", "jsonSchema", "validate"]
Fix: Check for inputSchema.jsonSchema as an object property

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 17:44:26 +10:00
Ajax Davis
1642ec07d9 feat: add automated Vercel AI registry sync with OpenAI
Add hourly GitHub Action that syncs tools from Vercel's AI SDK registry:

Features:
- Fetches Vercel AI registry from their GitHub
- Uses OpenAI GPT-4 to intelligently convert tool metadata
- Handles multi-export packages (multiple tools per npm package)
- Automatically commits new tools to manual-tools.ts
- Sends Discord notifications with detailed stats
- Extensive logging at every step

Files added:
- sync-vercel-registry.ts - Main sync script with AI conversion
- .github/workflows/sync-vercel-registry.yml - Hourly GitHub Action
- docs/vercel-registry-sync.md - Complete documentation

Requires OPENAI_API_KEY secret in GitHub repository settings.
2025-12-04 17:43:17 +10:00
Ajax Davis
dc4846c7b1 fix: set env vars in both Deno.env and process.env for Node.js compat
The Node.js compatibility layer (npm: specifier) broke environment
variable passing because tools imported via npm: expect process.env,
not Deno.env.

Root cause: Recent commit added npm: specifier for Node compatibility,
but env injection code only set Deno.env.set(), not process.env.

Fix: Set environment variables in BOTH locations:
- Deno.env.set() for esm.sh imports
- globalThis.process.env for npm: imports

This restores functionality for tools like Firecrawl that require
API keys via environment variables.

Fixes regression from commit 8562eb5.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 17:29:42 +10:00
Ajax Davis
a39f28546a perf: only type-check changed packages in pre-commit hook
Use Turborepo's --filter='...[HEAD]' to only type-check packages
with staged changes instead of all 21 packages. This reduces
pre-commit hook time from ~30s to ~3s for single-package changes.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 17:16:42 +10:00
Ajax Davis
b4e22723bb fix: handle undefined npmKeywords in tool detail page
Add null check before accessing npmKeywords.length to prevent
runtime TypeError when npmKeywords is undefined.

Fixes: Cannot read properties of undefined (reading 'length')

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 17:14:20 +10:00
Ajax Davis
709c2c20db fix: handle undefined githubStars in tool detail page
Use loose equality (!=) instead of strict equality (!==) to check for
both null and undefined values. This prevents runtime TypeError when
githubStars is undefined.

Fixes: Cannot read properties of undefined (reading 'toLocaleString')

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 17:03:58 +10:00