Commit graph

112 commits

Author SHA1 Message Date
Ajax Davis
b682bf0d7b chore: version packages 2025-12-31 21:07:20 +10:00
Ajax Davis
1ea9b83039 feat: fully implement 5 research tools with production-ready functionality
Research tools now have complete implementations:

- **page-brief**: Uses @mozilla/readability + jsdom for content extraction,
  sbd for sentence parsing, comprehensive error handling with timeout and
  network error detection

- **compare-pages**: Uses natural library TF-IDF for text similarity,
  detects agreements via high-similarity sentences, identifies conflicts
  using negation pattern analysis

- **source-credibility**: Uses tldts for domain parsing, cheerio for HTML
  analysis, calculates 6 credibility signals (HTTPS, domain reputation,
  author, date, citations, contact info), weighted scoring system

- **claim-checklist**: Uses sbd for sentence boundary detection, regex
  patterns for claim identification (statistics, quotes, historical,
  scientific, factual), priority levels and evidence suggestions

- **timeline-from-text**: Uses chrono-node for date parsing, sbd for
  context extraction, calculates confidence scores, identifies gaps >30 days

All tools follow AI SDK v6 pattern (tool() + jsonSchema()), include proper
TypeScript types, input validation, comprehensive error handling, and
Node.js 18+ fetch requirement verification.

Updated blocks.yml with comprehensive philosophy and domain rules for
quality validation.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-31 21:04:07 +10:00
Ajax Davis
6990906c6e chore: version packages 2025-12-31 20:31:57 +10:00
Ajax Davis
072489fd50 fix: use 'tpmjs' keyword instead of deprecated 'tpmjs-tool'
- Add 'research' to valid TPMJS_CATEGORIES
- Update all tutorial slides to reference 'tpmjs' keyword
- Deprecate 'tpmjs-tool' keyword for package discovery
2025-12-31 20:28:37 +10:00
Ajax Davis
81405982ce chore: version packages 2025-12-31 19:52:33 +10:00
Ajax Davis
aaf3cdd424 feat: add 5 research tools and blocks framework setup
- Add @tpmjs/tools-page-brief for URL content extraction
- Add @tpmjs/tools-compare-pages for cross-source validation
- Add @tpmjs/tools-source-credibility for credibility scoring
- Add @tpmjs/tools-claim-checklist for factual claim extraction
- Add @tpmjs/tools-timeline-from-text for timeline generation
- Move createBlogPost to packages/tools/official/
- Add blocks.yml for Blocks framework validation
- Update pnpm-workspace.yaml to include official tools
2025-12-31 19:47:02 +10:00
Ajax Davis
e9a7a689a1 perf: reduce Neon compute usage with cron + caching optimizations
- Reduce cron frequency: changes 2min→4hr, keyword 15min→6hr, metrics hourly→daily
- Add Prisma directUrl for connection pooling support
- Add Vercel KV caching to /api/tools endpoint (graceful degradation if not configured)
- Add X-Cache header to indicate cache hit/miss
- Add NEON_COMPUTE_OPTIMIZATION.md with full strategy guide

These changes should reduce Neon CU usage from 100+ to ~20-30 CU-hrs/month.
2025-12-31 12:14:00 +10:00
Ajax Davis
f24eebc196 feat: add npm-like features to tool detail page and update keyword to tpmjs
- Add download trend sparkline chart showing 30-day download history
- Add bundle size component with minified/gzipped sizes via bundlephobia proxy
- Add more install commands: yarn, bun, deno (in addition to npm, pnpm)
- Change discovery keyword from "tpmjs-tool" to "tpmjs" across entire codebase
- Update sync endpoints to use new keyword
- Update all documentation and package.json files

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-29 21:30:42 +10:00
Ajax Davis
cd895c10cb feat: add historical stats tracking with daily snapshots
- Add StatsSnapshot model to store daily registry metrics
- Create /api/sync/stats-snapshot endpoint for daily cron captures
- Add GET endpoint to retrieve historical snapshots (up to 365 days)
- Update stats page with Historical Trends section showing:
  - Tools & packages growth over time
  - Health status trends
  - Daily executions history
  - NPM downloads trends
- Add cron job running at midnight UTC daily
- Fix PostgreSQL GROUP BY issue in quality distribution query
2025-12-28 17:19:46 +10:00
Ajax Davis
a3cf662b1c feat: add mobile responsiveness across all pages
- Add hamburger menu icon and MobileMenu slide-out drawer component
- Update AppHeader with responsive nav (hidden on mobile, hamburger shown)
- Apply responsive styles to all 14 pages:
  - Responsive headings (text-2xl sm:text-3xl md:text-4xl)
  - Responsive grid gaps (gap-4 md:gap-6)
  - Explicit mobile grid columns (grid-cols-1 md:grid-cols-X)
  - Flex stacking on mobile (flex-col sm:flex-row)
- Add mobile nav dropdown to docs page
- Update README to correctly frame TPMJS as a discovery registry first,
  with agent integration as secondary/optional
2025-12-28 12:39:02 +10:00
Ajax Davis
91e00afde4 feat: add Discord link to header 2025-12-28 12:08:26 +10:00
Ajax Davis
c0c805b7b1 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
6f2218f88d 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
ada3ffb341 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
84d1e382a1 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
3b77f74d4b 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
aadd304ca5 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
0062cfee8d 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
5cc223af6e 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
fb1ed57471 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
098d25b6e0 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
ff17182e04 chore: update dependencies and add unsandbox package 2025-12-16 12:00:22 +10:00
Ajax Davis
b2984d1f61 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
5df484718a 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
25e83a1809 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
0a856dda39 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
db482855d3 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
196cbacf62 chore: bump registry-search and registry-execute to 0.1.1 2025-12-12 10:09:54 +10:00
Ajax Davis
46088f09c3 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
aa1001a0ee 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
dcab29baa2 chore: version packages for release 2025-12-12 09:50:42 +10:00
Ajax Davis
463889b7c4 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
1a2128d3ae 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
2a16218871 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
07b23e6ef6 fix(ui): allow deep import for react-syntax-highlighter styles 2025-12-11 10:10:58 +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
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
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
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
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
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