Commit graph

286 commits

Author SHA1 Message Date
Ajax Davis
8b532ffa79 chore: prepare for Hacker News launch
- Add MIT LICENSE file
- Fix YOUR_ORG placeholders in README and DEPLOYMENT docs
- Fix Node.js version mismatch in release workflow (21 → 22)
- Delete 17 internal debug/development docs
- Rewrite hero section for clarity (explain what TPMJS is in seconds)
- Add "What is TPMJS?" section to landing page
- Fix hardcoded emails to hello@tpmjs.com
- Fix hardcoded dates to December 2024
- Add package metadata (author, license, repository) to all published packages
- Clean up AI-sounding language throughout
- Add comprehensive LAUNCH_REVIEW.md with checklist

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-28 11:46:59 +10:00
Ajax Davis
81efba0de5 fix: add schema extraction to manual tools sync
- Try Railway executor first for dynamic schema extraction
- Fall back to converting parameters from manual-tools.ts to JSON Schema
- This ensures Vercel AI registry tools get schemas during sync
2025-12-17 20:52:19 +10:00
Ajax Davis
861e8c2b7e fix: add backwards compatibility for exportName in tpmjs schema
The TpmjsToolDefinitionSchema now accepts both 'name' and 'exportName' fields,
transforming exportName to name for backward compatibility with published packages
that still use the old field name.

Also fix type errors in sync routes for auto-discovered tools.
2025-12-17 19:56:01 +10:00
Ajax Davis
e84eda7525 refactor: rename exportName to name across entire codebase
- Database: Migrate column export_name to name in tools table
- Prisma schema: Update Tool model to use name field
- Sync routes: Update keyword and changes sync to use name
- Railway executor: Update API endpoints to use name parameter
- API routes: Update all tool routes to use name field
- Web app: Update all pages and components
- Playground: Update tool loader and sidebar
- create-basic-tools: Update types and generators
- Scripts: Update sync and test scripts

Database migration was done via direct SQL:
  ALTER TABLE tools RENAME COLUMN export_name TO name;

The unique constraint remains on (package_id, name).

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-17 17:19:21 +10:00
Ajax Davis
deb9e3ae06 refactor: rename exportName to name in ManualTool interface and sync scripts
- Update ManualTool interface to use `name` field instead of `exportName`
- Update all manual tool definitions to use `name:` property
- Update sync-manual-tools.ts to reference `manualTool.name`
- Update sync-vercel-registry.ts to generate `name` field
- Add biome-ignore comments for Prisma Json type casts

The database column remains `exportName` but the TypeScript spec uses `name`.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-17 16:43:16 +10:00
Ajax Davis
56e688a13c refactor: rename exportName to name in ManualTool interface
- Update ManualTool interface to use `name` instead of `exportName`
- Update all tool definitions in manual-tools.ts
- Update sync-manual-tools.ts to use manualTool.name
- Update sync-vercel-registry.ts OpenAI prompt and output generation
- Database column `exportName` remains unchanged (stores the value)
2025-12-17 16:43:15 +10:00
github-actions[bot]
78bdc37583 chore: sync 1 new tools from Vercel AI registry
Added 1 tools from Vercel AI SDK registry:
- Total tools in registry: 11
- Already synced: 10
- Newly added: 1
- Errors: 0

🤖 Automated by GitHub Actions
Run: https://github.com/tpmjs/tpmjs/actions/runs/20293730295
2025-12-17 06:23:14 +00:00
Ajax Davis
5e795bc086 fix: require name field in TPMJS spec, add workflow permissions
Breaking change for TPMJS spec:
- Remove `exportName` field support from TpmjsToolDefinitionSchema
- Make `name` field required (replaces deprecated `exportName`)
- Update create-basic-tools to generate `name` field
- Update sync routes to use `name` from validated schema
- Add `permissions: contents: write` to Vercel registry sync workflow

Packages using the old `exportName` field must update to use `name`.
2025-12-17 16:20:20 +10:00
Ajax Davis
b7ea9bf4d6 fix(types): support both 'name' and 'exportName' for backward compatibility
The TpmjsToolDefinitionSchema now accepts either 'name' (new) or 'exportName'
(legacy) to ensure existing published packages continue to work.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-17 14:56:56 +10:00
Ajax Davis
5fc584fc66 feat(tpmjs-spec): add auto-discovery of tools and rename exportName to name
Major changes to the TPMJS specification:

1. Auto-Discovery: The `tools` array is now optional. If omitted, TPMJS
   automatically scans package exports and registers any export with
   `description` and `execute` properties (standard AI SDK tool format).

2. Renamed `exportName` to `name` in tool definitions for cleaner spec.

3. Added `/list-exports` endpoint to Railway executor that:
   - Lists all exports from a package
   - Identifies valid AI SDK tools
   - Extracts descriptions for auto-discovered tools

4. Added `toolDiscoverySource` field to track 'auto' vs 'manual' discovery.

5. Updated tool page UI with:
   - Auto-discovery warning banner
   - Badge showing discovery source

6. Updated all documentation pages (docs, spec, publish) to reflect:
   - Optional tools array with auto-discovery
   - Use of `name` instead of `exportName`
   - Auto-extraction of schema and description

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-17 14:02:26 +10:00
Ajax Davis
70d112982e docs: update documentation to reflect auto-extraction of inputSchema
- Update spec page to show simplified required fields (category, tools)
- Mark parameters, returns, aiAgent as deprecated (now auto-extracted)
- Add schema extraction section explaining the process
- Update publish page with simplified examples
- Update FAQ with schema extraction question
- Update how-it-works with validation & schema extraction step
- Update docs page with auto-extraction callout and simplified spec
2025-12-17 13:25:44 +10:00
Ajax Davis
06271e079f feat(schema-extraction): auto-extract inputSchema via executor during sync
- Add inputSchema, schemaSource, schemaExtractedAt fields to Tool model
- Create schema extraction helper that calls executor's /load-and-describe
- Update sync routes to extract schema synchronously after tool upsert
- Reduce changes feed batch size from 100 to 30 for extraction time
- Update /api/tools/update-schema to store full JSON Schema
- Add /api/tools/extract-schema endpoint for manual re-extraction
- Update tool page UI with schema source badge and re-extract button
- Add deprecation comments to parameters, returns, aiAgent in types

Authors no longer need to define inputSchema in package.json - it's now
automatically extracted from the tool at sync time. Falls back to
author-provided parameters if extraction fails.
2025-12-17 12:56:25 +10:00
Ajax Davis
00441c30db feat(railway-executor): add 2-minute TTL cache for esm.sh modules
- Add TTL-based module cache (2 minutes) for imported esm.sh packages
- Cache non-factory tools to avoid re-downloading on each request
- Factory functions are cached but always re-imported to get fresh env vars
- Automatic cleanup of expired cache entries every minute
- Enhanced /cache/stats endpoint shows TTL info and expiration times
2025-12-17 11:42:12 +10:00
Ajax Davis
489d0125ac Revert "feat(package-executor): add 2-minute in-memory cache for execution results"
This reverts commit fb1ed57471.
2025-12-17 11:40:04 +10:00
Ajax Davis
7bd0caea97 docs: add comprehensive guide for building dynamic tool systems 2025-12-17 11:31:38 +10:00
Ajax Davis
30e9bb41b7 feat(package-executor): add 2-minute in-memory cache for execution results
- Cache successful execution results with 2-minute TTL
- Automatic cleanup of expired entries every minute
- Cache hit returns 0ms execution time to indicate cached response
- Add getCacheStats() helper for debugging
- clearCache() now clears both local and remote sandbox cache
2025-12-17 11:29:22 +10:00
Ajax Davis
00718382fc docs: add PRD for AI-generated OG images 2025-12-17 11:06:57 +10:00
Ajax Davis
0e5d4d6e3b feat: add Vercel Analytics to web and playground apps
- Install @vercel/analytics in both apps
- Add <Analytics /> component to root layouts
- Enables automatic page view tracking on Vercel
2025-12-17 11:04:02 +10:00
Ajax Davis
1b0fad9baf fix: add npmPublishedAt to API response and add null safety for dates 2025-12-16 12:49:53 +10:00
Ajax Davis
7bb293b6de fix: make sitemap dynamic to avoid DB calls during CI build 2025-12-16 12:38:42 +10:00
Ajax Davis
d75c489a68 feat: add @tpmjs/unsandbox package for secure code execution
Initial release of @tpmjs/unsandbox - AI SDK tools for secure code execution
in 42+ programming languages via unsandbox.com. Re-exports tools from
@thomasdavis/unsandbox with TPMJS registry metadata.
2025-12-16 12:07:46 +10:00
Ajax Davis
3bb8033c69 chore: update dependencies and add unsandbox package 2025-12-16 12:00:22 +10:00
Ajax Davis
7d7b5ab8b6 refactor: implement REST API best practices for /api/tools endpoint
- Add standardized ApiResponse interface with consistent structure
- Implement proper request validation with detailed error messages
- Add response metadata (version, timestamp, requestId, processingTime)
- Include proper HTTP status codes and error handling
- Add validation for pagination parameters (limit: 1-1000, offset: >=0)
- Add health status enum validation
- Include response headers (X-Request-ID, X-Processing-Time, Cache-Control)
- Improve error logging with structured context
- Add count field to pagination response
- Follow REST API industry standards and best practices
2025-12-16 11:54:59 +10:00
Ajax Davis
0e084de1c5 feat: increase tools API limit to 1000 and optimize response payload
- Increase max limit from 50 to 1000 for bulk tool fetching
- Exclude large fields (npmReadme, npmAuthor, npmMaintainers) from API response
- Reduces payload size while maintaining all necessary tool metadata
2025-12-16 11:31:18 +10:00
Ajax Davis
feeb3cf3e8 refactor: move schema updates to executor
- Executor now updates TPM.js database directly when loading tools
- Update /api/tools/update-schema to use packageName+exportName lookup
- Remove schema update logic from HLLM proxy (no longer needed)
2025-12-15 13:07:42 +10:00
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