Commit graph

26 commits

Author SHA1 Message Date
Ajax Davis
6714f9dc63 feat: add workflow for syncing individual packages 2026-01-10 18:38:19 +10:00
Ajax Davis
5f48cb50df fix: update sync-manual workflow to Node 22 and pnpm 9 2026-01-10 17:28:39 +10:00
Ajax Davis
f0177a4a17 fix: update health checks to use existing public endpoints
- Replace non-existent /api/collections/public and /api/agents/public
  with /api/stats which is a public endpoint
- Remove sync_status check (endpoint doesn't exist)
- Update health page labels to match new check names

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-10 03:17:14 +10:00
Ajax Davis
93cdb60a45 feat: add comprehensive endpoint health monitoring
- Add GitHub Action workflow that runs every 5 minutes testing:
  - Basic health endpoint
  - Database connectivity (tools API)
  - Collections and Agents public APIs
  - MCP HTTP transport (initialize + tools/list)
  - MCP SSE transport
  - MCP server info endpoint
  - Tool health stats

- Add /api/health/report endpoint for storing health check results
- Add EndpointHealthReport Prisma model for persistence
- Add /health status page with:
  - Real-time status banner
  - Uptime percentage
  - Per-service health stats
  - Recent health check history
  - Auto-refresh every 30 seconds

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-10 03:08:11 +10:00
Ajax Davis
3cd65587c5 ci: add Claude-powered documentation auto-update workflow 2026-01-09 01:47:21 +10:00
Thomas Davis
7435a39a3d "Claude Code Review workflow" 2026-01-09 01:44:40 +10:00
Thomas Davis
33287d931f "Claude PR Assistant workflow" 2026-01-09 01:44:38 +10:00
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
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
2a989c5527 fix: use variable for multi-line commit message 2025-12-04 17:47:03 +10:00
Ajax Davis
b41382f365 fix: use heredoc for multi-line commit message in workflow 2025-12-04 17:45:56 +10:00
Ajax Davis
f9dfc67de4 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
958697f788 feat: add GitHub Action for daily health check cron and backfill script
- Create .github/workflows/health-check.yml to run daily at 2am UTC
- Add scripts/backfill-health-checks.ts to populate health data for existing tools
- Remove health-check from vercel.json crons (now using GitHub Actions)

The GitHub Action workflow follows the same pattern as other sync operations
and calls the /api/sync/health-check endpoint with proper authentication.

The backfill script:
- Fetches all tools from database
- Runs batch health checks with concurrency control (5 tools at a time)
- Shows detailed progress and summary statistics
- Lists broken tools with error details

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 16:36:55 +10:00
Ajax Davis
141a64d888 feat: implement multi-tool package architecture with manual tool registry
BREAKING CHANGE: Complete refactoring from single-tool to multi-tool package support

Database Schema:
- Split Tool model into Package (1) and Tool (many) with one-to-many relationship
- Package stores npm metadata and package-level tpmjs fields (category, env, frameworks, tier)
- Tool stores individual tool exports with tool-level metadata (exportName, description, parameters, returns, aiAgent)
- Unique constraint on (packageId, exportName) to prevent duplicate tools
- Cascade deletes when packages are removed

Type System:
- Updated tpmjs field schema to support tools array
- Each tool has exportName, description, parameters, returns, aiAgent
- Package-level fields: category, env, frameworks shared across all tools
- Backward compatible with legacy single-tool format (auto-migrates to exportName: "default")

API Updates:
- Updated all /api/tools routes to query Tool model with Package relations
- Updated /api/tools/[slug] to accept package/export path segments
- Updated tool-executor-agent to use actual exportName instead of hardcoded "default"
- Updated metrics sync to calculate quality scores per Tool

Frontend Updates:
- Updated tool search page to display exportName as primary heading
- Updated tool detail pages to show package name as secondary info
- Removed tag-based filtering (tags moved to package level)

Manual Tool Registry:
- Added manual-tools.ts with 23 curated tools from major providers
- Created sync-manual-tools.ts script to sync manual tools to database
- Added MANUAL_TOOLS.md documentation for manual tool system
- Added GitHub workflow for automated daily sync
- Includes tools from: Vercel, Exa, Firecrawl, AWS Bedrock, Perplexity, Tavily, Superagent, Valyu

Playground Updates:
- Updated tool loader to load multiple tools per package
- Added sanitizeToolName for OpenAI API compatibility

Sync System Updates:
- Updated changes feed sync to handle multi-tool packages
- Updated keyword sync to upsert multiple tools per package
- Added orphaned tool deletion when tools removed from package.json

Migration Strategy:
- Database uses same Neon instance for dev and prod
- Schema updated via prisma db push (no migration files yet)
- All data repopulates from npm via sync system

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 06:39:58 +10:00
Ajax Davis
277c9f74cd feat: add author name to skipped packages in Discord notifications
API Changes:
- Track author name along with package name and reason
- Extract author from pkg.author (string or object with name field)
- Default to "unknown" if author info not available

Workflow Changes:
- Display author in format: "package-name (by author) - reason"

Example Discord output:
📋 Skipped Packages
tpmjs-threejs-tool (by john-doe) - invalid tpmjs field
@scope/package-1 (by jane-smith) - missing tpmjs field

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 09:18:16 +10:00
Ajax Davis
63cd815bf4 feat: add skip reasons to Discord notifications
API Changes:
- Track skip reason along with package name
- Changed skippedPackages from string[] to Array<{name, reason}>
- Reasons: "package not found", "missing tpmjs field", "invalid tpmjs field"

Workflow Changes:
- Format skipped packages as "package-name - reason"
- Display one package per line in Discord notification

Example Discord output:
📋 Skipped Packages
@scope/package-1 - missing tpmjs field
package-2 - invalid tpmjs field

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 08:59:33 +10:00
Ajax Davis
0b30c62ff9 feat: add skipped packages list to Discord notifications
API Changes:
- Track skipped package names in keyword sync endpoint
- Include skippedPackages array in API response

Workflow Changes:
- Extract skipped package names from sync response
- Display skipped packages in Discord notification as comma-separated list
- Only show "📋 Skipped Packages" field when packages are skipped
- Dynamic field construction using jq

Example Discord output:
📋 Skipped Packages
package-name-1, package-name-2, package-name-3

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 08:57:30 +10:00
Ajax Davis
484190720a fix: make example field optional and fix Discord webhook JSON escaping
Database Changes:
- Made `example` field optional in Prisma schema (String?)
- Added default empty arrays for `frameworks` and `tags`
- Allows tools to be synced without example field

Workflow Changes:
- Use jq to properly construct Discord webhook JSON
- Fixes "invalid JSON" error caused by unescaped special characters
- Properly escapes error messages with newlines and quotes

This fixes sync errors for packages missing the example field and
ensures Discord notifications are sent successfully.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 08:32:14 +10:00
Ajax Davis
da12d1fc5b feat: add detailed error logging to keyword sync workflow
API Changes:
- Return errorMessages array in sync response (first 5 errors)

Workflow Changes:
- Display error messages in GitHub Actions logs with formatting
- Include error details in Discord notifications (first 3 errors)
- Shows errors in both console output and Discord embed

Example output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️  SYNC ERRORS (4 total):
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  • Failed to process pkg1: Invalid tpmjs field
  • Failed to process pkg2: Network timeout
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 08:22:04 +10:00
Ajax Davis
37fcc4b42c feat: add Discord webhook notifications to keyword search sync workflow
- Captures sync API response and parses JSON results
- Sends formatted Discord embed with sync metrics:
  - Packages found, processed, skipped, errors
  - Duration and link to workflow logs
- Color-coded status: green for success, yellow for errors
- Runs on every sync (manual and scheduled)

Requires DISCORD_WEBHOOK secret to be set in GitHub repository.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 08:18:15 +10:00
Ajax Davis
3940e51299 fix: split sync workflow into separate files to fix job skipping issue
The previous combined workflow had flawed conditional logic that caused
sync-keyword and sync-metrics jobs to be skipped. GitHub Actions doesn't
populate github.event.schedule with the cron expression, so the equality
checks never matched.

Replaced with three separate workflow files:
- sync-changes.yml: Runs every 2 minutes
- sync-keyword.yml: Runs every 15 minutes
- sync-metrics.yml: Runs every hour

Each workflow can be manually triggered via workflow_dispatch.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 04:36:38 +10:00
Ajax Davis
408102602c docs: add comprehensive NPM package sync documentation and GitHub Actions workflow
**Documentation (CLAUDE.md):**
- Document all three sync endpoints (changes feed, keyword search, metrics)
- Explain Vercel Cron configuration and schedules
- Detail quality score calculation algorithm
- Add database schema documentation for sync tables
- Provide manual sync trigger examples with curl
- Include monitoring and debugging instructions
- Document error handling patterns (partial/complete failures)
- Add package discovery flow diagram
- List future improvements and potential enhancements

**GitHub Actions Workflow (.github/workflows/sync.yml):**
- Add backup sync automation via GitHub Actions cron
- Support manual trigger via workflow_dispatch with sync type selection
- Run changes feed every 2 minutes
- Run keyword search every 15 minutes
- Run metrics sync every hour
- Use concurrency control to prevent overlapping runs
- Call production Vercel endpoints with CRON_SECRET auth

**Key Features:**
- Dual automation strategy: Vercel Cron (primary) + GitHub Actions (backup)
- Idempotent endpoints allow both systems to run simultaneously
- Manual trigger capability for debugging and testing
- Comprehensive documentation for future maintenance

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 20:46:57 +10:00
Ajax Davis
de9bcb89f0 fix: add build step to lint job in CI workflow
The lint job needs packages to be built first because @tpmjs/ui's
lint script runs eslint, which is a local dependency that needs
the package to be built before it can be executed.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 18:36:44 +10:00
Ajax Davis
3eef94ed4b fix(ci): build packages before architecture check and make deadcode non-blocking
- Add build step to architecture job (needs dist/ to resolve imports)
- Make find-deadcode non-blocking with || true (warnings only)
- Architecture check now runs after build to resolve package imports

Fixes CI failures where dependency-cruiser couldn't resolve package
imports because dist/ files weren't built yet.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 18:31:12 +10:00
Ajax Davis
99998e5186 feat: configure Vercel to wait for CI before deploying
- Update GitHub Actions CI workflow to use Node 22
- Add architecture and deadcode checks to CI pipeline
- Create Vercel deployment guard script
- Add comprehensive deployment documentation
- Update README with CI badge and quality gates info
- Configure vercel.json for deployment settings

Vercel will now only deploy to production after all CI checks pass:
- Linting & formatting
- Type checking
- Tests
- Build verification
- Architecture validation
- Dead code detection

See DEPLOYMENT.md for configuration instructions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 17:42:23 +10:00
Ajax Davis
78e6b9f4b5 feat: add complete monorepo structure and all packages
This completes the initial monorepo setup with all packages and configuration.

Packages added:
- @tpmjs/ui - React component library with .ts-only components
- @tpmjs/utils - Utility functions (cn, format)
- @tpmjs/types - TypeScript types and Zod schemas
- @tpmjs/env - Environment variable validation
- @tpmjs/test - Shared Vitest configuration
- @tpmjs/mocks - MSW mock server
- @tpmjs/config - Shared configurations (Biome, ESLint, Tailwind, TypeScript)

Applications added:
- @tpmjs/web - Next.js 16 App Router

Infrastructure:
- Turborepo configuration with build pipeline
- pnpm workspace setup
- GitHub Actions CI/CD
- Changesets for versioning
- Lefthook pre-commit hooks
- VSCode workspace settings
- Comprehensive documentation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 21:59:40 +10:00