- Update all packages to latest versions via pnpm update --latest - Downgrade Prisma 7 to 6 (v7 requires schema migration) - Downgrade Tailwind CSS 4 to 3 (v4 requires PostCSS migration) - Downgrade Storybook 10 to 8 (addons not available in v10) - Pin cheerio to 1.0.0-rc.12 via pnpm override (type exports changed) - Fix AI SDK tool definitions: parameters -> inputSchema - Fix cheerio types in extract-meta and table-extract tools - Add explicit type annotations to tool execute functions - Migrate biome config to v2.3.11 schema All type-checks, tests, and builds pass. |
||
|---|---|---|
| .. | ||
| src | ||
| CHANGELOG.md | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
@tpmjs/hello
Simple example TPMJS tools for AI SDK v6 - demonstrates how to create tools that work with AI agents.
Tools
helloWorldTool
Returns a simple "Hello, World!" greeting with a timestamp.
Parameters: None
Returns:
{
"message": "Hello, World!",
"timestamp": "2024-12-04T..."
}
helloNameTool
Returns a personalized greeting with the provided name.
Parameters:
name(string, required): The name of the person to greet
Returns:
{
"message": "Hello, John!",
"timestamp": "2024-12-04T..."
}
Usage
With AI SDK v6
import { streamText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { helloWorldTool, helloNameTool } from '@tpmjs/hello';
const result = streamText({
model: openai('gpt-4o-mini'),
messages: [{ role: 'user', content: 'Say hello to Alice' }],
tools: {
helloWorld: helloWorldTool,
helloName: helloNameTool,
},
});
Template for Creating TPMJS Tools
This package serves as a template for creating your own TPMJS tools. Key requirements:
- Use AI SDK v6 Beta (
ai@6.0.0-beta.124) - Use Zod 4 for parameter validation
- Export tool objects with
description,parameters, andexecute - Add TPMJS metadata to package.json:
"tpmjs": { "category": "text-analysis", "description": "Your tool description" } - Include the
tpmjskeyword in package.json
Development
# Build
pnpm build
# Type check
pnpm type-check
# Watch mode
pnpm dev