mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 14:03:49 +00:00
21 lines
571 B
TypeScript
21 lines
571 B
TypeScript
import type { CustomToolFactory } from "@mariozechner/pi-coding-agent";
|
|
import { Type } from "@sinclair/typebox";
|
|
|
|
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, _onUpdate, _ctx, _signal) {
|
|
const { name } = params as { name: string };
|
|
return {
|
|
content: [{ type: "text", text: `Hello, ${name}!` }],
|
|
details: { greeted: name },
|
|
};
|
|
},
|
|
});
|
|
|
|
export default factory;
|