Commit graph

9 commits

Author SHA1 Message Date
Ajax Davis
a44f38eda9 test: add comprehensive tests for CLI and scenarios
Add unit tests for:
- CLI TpmClient (api-client.test.ts) - 26 tests covering authentication,
  tool execution, agent/collection/scenario management, error handling
- Scenario evaluation (evaluate.test.ts) - 16 tests for regex assertions
  and verdict determination
- Cosine similarity (similarity.test.ts) - 16 tests for embedding comparison

Add integration tests for scenarios:
- CRUD operations (scenarios-crud.integration.test.ts)
- Run execution and quota management (scenarios-run.integration.test.ts)

Configure vitest for CLI package with @tpmjs/test shared config.
2026-01-25 03:28:28 +10:00
Ajax Davis
f0b55a23f9 feat: add collection info command and improve CLI discovery
- Add `tpm collection info <collection>` command to list all tools in a collection
- Update `run` command examples to show workflow of listing tools first
- Fix unsandbox healthCheck tool to use /cluster endpoint instead of /health
- Update create-basic-tools template with correct tpmjs field format docs
- Change default category from 'ai-ml' to 'utilities' in generator

Published:
- @tpmjs/cli@0.1.5
- @tpmjs/create-basic-tools@1.0.7
- @tpmjs/tools-unsandbox@0.1.3
2026-01-23 05:15:38 +10:00
Ajax Davis
5d00f2a711 feat: add chunked skills.md generation for large collections
Implements batched generation to avoid Vercel 120s timeout for collections
with 60+ tools. Uses per-tool caching and recursive serverless invocations.

- Add ToolSkillsCache and SkillsGenerationJob models to schema
- Create tool-skills-generator.ts for per-tool markdown generation
- Create skills-summary-generator.ts for final pass summary/intro
- Update route handler with chunked generation logic
- Small collections (<20 tools) use original monolithic approach
- Large collections use 10-tool batches with progress tracking
2026-01-21 16:26:06 +10:00
Ajax Davis
9ab8946c9d feat: add skills.md endpoint and CLI run command
- Add /:username/collections/:slug/skills.md endpoint for AI-generated skills docs
- Analyze npm package source code to generate comprehensive capability contracts
- Add `tpm run` CLI command to execute tools from collections via MCP
- Cache generated skills.md in database with 1-week TTL
2026-01-21 14:50:07 +10:00
Ajax Davis
48c41e8733 feat: add use cases marketing product with AI-generated content
Transform qualifying scenarios into marketing-ready use cases with:
- AI-generated titles, descriptions, ROI estimates, business value
- Persona/industry/category taxonomy for targeting
- Browseable feed with filtering and ranking
- SEO-optimized case study pages
- Daily cron job for generation and ranking

Database:
- Add Persona, Industry, Category lookup tables
- Add UseCase model with marketing content fields
- Add junction tables for personas/industries/categories
- Add SocialProof model for cached metrics

API:
- GET /api/use-cases - Global directory with filtering
- GET /api/use-cases/[id] - Individual use case details
- GET /api/public/users/[username]/collections/[slug]/use-cases
- POST /api/cron/use-cases - Nightly generation job

Frontend:
- /use-cases - Global feed with persona dropdown
- /use-cases/[slug] - SEO case study page
- /[username]/collections/[slug]/use-cases - Collection feed
- UseCasesFeed component - Sortable table component
- UseCaseCaseStudy component - Full case study layout
2026-01-20 16:17:35 +10:00
Ajax Davis
3c5c218207 feat(web): add scenarios UI - explorer, detail, and homepage section
- Add global scenarios explorer page at /scenarios
- Add scenario detail page with run history at /scenarios/[id]
- Add collection-scoped scenario detail page
- Add featured scenarios section to homepage
- Add useScenarios hook for data fetching
- Regenerate CLI manifest
2026-01-19 05:57:29 +10:00
Ajax Davis
dc684d3b0e chore(cli): bump version to 0.1.4 for npm publish 2026-01-19 05:50:32 +10:00
Ajax Davis
ea742c9386 feat: add scenarios system for collection testing
Implements the complete scenarios feature for TPMJS:

API endpoints:
- GET/POST /api/scenarios - list/create scenarios
- GET/PATCH/DELETE /api/scenarios/:id - scenario CRUD
- POST /api/scenarios/:id/run - execute scenario
- GET /api/scenarios/:id/runs - run history
- POST /api/scenarios/check-similarity - vector similarity check
- GET /api/scenarios/featured - featured scenarios
- POST /api/collections/:id/scenarios/generate - AI scenario generation
- GET /api/collections/:id/scenarios - list collection scenarios

Services:
- generate-prompt.ts - AI prompt generation using GPT-4o-mini
- similarity.ts - vector embedding and cosine similarity
- evaluate.ts - LLM-based success evaluation
- execute.ts - scenario execution orchestration

CLI commands:
- tpm scenario list [collection] - list scenarios
- tpm scenario run <collection> - run all scenarios
- tpm scenario test <id> - run single scenario
- tpm scenario generate <collection> - generate scenarios
- tpm scenario info <id> - scenario details

Database:
- Scenario, ScenarioEmbedding, ScenarioRun, ScenarioQuota models
- Streak-based quality scoring
- Daily quota management

Migration script included for converting existing useCases.
2026-01-18 09:31:31 +10:00
Ajax Davis
154f000505 feat(cli): add @tpmjs/cli package and browser auth page
- Create comprehensive CLI with oclif framework
- Add commands: auth, tool, agent, collection, mcp, publish
- Add doctor, playground, and update commands
- Add /cli/auth page for browser-based OAuth flow
- Publish to npm as @tpmjs/cli@0.1.2
2026-01-18 06:12:34 +10:00