mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 14:03:49 +00:00
20 lines
No EOL
528 B
TypeScript
20 lines
No EOL
528 B
TypeScript
import { Type } from "@sinclair/typebox";
|
|
import type { CustomToolFactory } from "@mariozechner/pi-coding-agent";
|
|
|
|
const factory: CustomToolFactory = (pi) => ({
|
|
name: "hello",
|
|
label: "Hello",
|
|
description: "A simple greeting tool",
|
|
parameters: Type.Object({
|
|
name: Type.String({ description: "Name to greet" }),
|
|
}),
|
|
|
|
async execute(toolCallId, params) {
|
|
return {
|
|
content: [{ type: "text", text: `Hello, ${params.name}!` }],
|
|
details: { greeted: params.name },
|
|
};
|
|
},
|
|
});
|
|
|
|
export default factory; |