Commit graph

261 commits

Author SHA1 Message Date
Ajax Davis
3f54f16573 feat: auto-update TPM.js database with tool schemas on execution
- Add /api/tools/update-schema endpoint to TPM.js to update tool parameters
- When a tool is executed, fetch its schema from the executor
- Update TPM.js database with the discovered schema (async, non-blocking)
- This ensures /api/tools returns correct inputSchema for all tools
2025-12-15 12:52:58 +10:00
Ajax Davis
9642f0b7e7 fix: disable tool caching entirely to ensure fresh env vars
Temporary fix - always re-import tools so env vars are fresh each request
2025-12-15 12:36:26 +10:00
Ajax Davis
8a79396a0a fix: inject env vars before factory calls and skip caching factory tools
- Move env var injection to happen BEFORE cache check and factory function calls
- This ensures process.env is set when factory functions like Valyu's webSearch() read from it
- Skip caching factory-created tools since they may read env vars at creation time
- Fixes issue where Valyu tools fail with 'VALYU_API_KEY is required' even when key is provided
2025-12-15 12:34:22 +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
Ajax Davis
1b655571cc docs: add guide for overriding execute functions in npm tools
Focused documentation on customizing tool execution when importing
tools from npm packages. Covers 10 patterns:

- Simple override with spread
- Wrap with pre/post processing
- Transform inputs/outputs
- Add authentication/API keys
- Conditional execution
- Retry logic
- Timeout handling
- Rate limiting
- Validation layer
- Wrapper factory for reusable patterns

Includes TypeScript typing guidance and real-world examples.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-14 12:48:06 +10:00
Ajax Davis
9d44630675 docs: add comprehensive AI SDK 6 tool execution documentation
- Document override patterns (complete, conditional, schema-only)
- Document extension patterns (pre/post processing, retry, caching, validation)
- Add custom middleware implementation guide
- Add factory pattern for maximum flexibility
- Include complete examples combining TPMJS tools with custom tools
- Cover best practices for error handling, timeouts, rate limiting, security
- Add API reference for registrySearchTool and registryExecuteTool

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-14 12:39:28 +10:00
Ajax Davis
0b93014242 fix: update SDK playground link to playground.tpmjs.com 2025-12-14 12:27:52 +10:00
Ajax Davis
f0566ea8c0 fix: standardize Twitter handle to @tpmjs_registry in schema 2025-12-14 12:24:52 +10:00
Ajax Davis
87b2ef3ad5 feat: add SVG favicon and apple-touch-icon
- Add modern SVG favicon with TPMJS "T" logo
- Add apple-touch-icon for iOS devices
- Update metadata to reference new icons

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-14 12:18:04 +10:00
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
48aa12f351 fix(ui): fix checkbox tick not visible in light/dark mode
The checkmark SVG was nested inside a span, making peer-checked
selectors ineffective since peer only works on siblings.

Fix by moving the checkmark and indeterminate SVGs to be direct
siblings of the hidden input element, allowing Tailwind's peer-checked
and peer-data-[indeterminate] selectors to properly toggle visibility.
2025-12-12 12:51:37 +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
2b81b6536e docs(registry-execute): recommend wrapper pattern for API keys
Replace system prompt approach with cleaner tool wrapper pattern
that auto-injects pre-configured API keys
2025-12-12 11:39:45 +10:00
Ajax Davis
246a5429af docs(sdk): add API keys documentation section
- Add 'Passing API Keys to Tools' section to registry-execute README
- Add 'Understanding requiredEnvVars' section to registry-search README
- Include example of pre-configuring keys for agents
- Document tools that don't require keys
- Bump both packages to 0.1.2
2025-12-12 11:35:51 +10:00
Ajax Davis
5c935dca69 fix(createblogpost): convert to proper AI SDK tool
- Wrap function with tool() from 'ai' package
- Add jsonSchema() for input validation
- Rename export from createBlogPost to createBlogPostTool
- Update package.json with proper tpmjs.tools format
- Bump version to 0.3.0

Fixes executor error: 'Cannot destructure property title of t'
2025-12-12 10:38:46 +10:00
Ajax Davis
45480260d0 chore: bump registry-search and registry-execute to 0.1.1 2025-12-12 10:09:54 +10:00
Ajax Davis
84f40f2bb4 docs: update READMEs to use AI SDK v6 streamText API
- Replace deprecated Agent class with streamText
- Add anthropic provider import
- Add system prompt example
2025-12-12 10:09:17 +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
2b8b1547e9 chore: version packages for release 2025-12-12 09:50:42 +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
e85bbe8638 docs: update health system docs with packageName fix pattern 2025-12-12 06:15:12 +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
bd4878576e docs: add comprehensive tool health system documentation
Documents the health check architecture, error classification logic,
common debugging scenarios, and lessons learned from production issues
like the startTime bug.
2025-12-12 06:08: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
81bc2c96c2 docs(broken-tools): update resolution status after health check fix 2025-12-12 04:58:07 +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
ac98491928 fix(ui): allow deep import for react-syntax-highlighter styles 2025-12-11 10:10:58 +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