tpmjs/apps/playground
Ajax Davis fdd1b2c304 fix: sanitize tool names for OpenAI API compatibility in playground
Add sanitizeToolName function to convert package names to OpenAI-compatible
format that matches pattern ^[a-zA-Z0-9_-]+$. Removes @ symbols, replaces
/ with _, and replaces other invalid characters with _.

This fixes the error: "Invalid 'tools[0].name': string does not match pattern"
when loading tools in the playground chat interface.

Example transformations:
- @tpmjs/hello-helloWorldTool → tpmjs_hello-helloWorldTool
- firecrawl-aisdk-scrapeTool → firecrawl-aisdk-scrapeTool

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 06:29:33 +10:00
..
src fix: sanitize tool names for OpenAI API compatibility in playground 2025-12-04 06:29:33 +10:00
.env.local.example feat: implement playground app with AI SDK v6 tool execution 2025-12-04 02:51:02 +10:00
next-env.d.ts feat: implement playground app with AI SDK v6 tool execution 2025-12-04 02:51:02 +10:00
next.config.ts feat: implement playground app with AI SDK v6 tool execution 2025-12-04 02:51:02 +10:00
package.json feat: implement playground app with AI SDK v6 tool execution 2025-12-04 02:51:02 +10:00
postcss.config.mjs feat: implement playground app with AI SDK v6 tool execution 2025-12-04 02:51:02 +10:00
tailwind.config.ts feat: implement playground app with AI SDK v6 tool execution 2025-12-04 02:51:02 +10:00
tsconfig.json feat: implement playground app with AI SDK v6 tool execution 2025-12-04 02:51:02 +10:00