Something went wrong. Try again.
fork of prime agent with changes i want but are not upstreamable probqbly (and some fixes)
Something went wrong. Try again.
640 B · 26 lines
TypeScript
at main
123456789101112131415161718192021222324252627/** * Hello Tool - Minimal custom tool example */
import { Type } from "@earendil-works/pi-ai";import { defineTool, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
const helloTool = defineTool({ name: "hello", label: "Hello", description: "A simple greeting tool", parameters: Type.Object({ name: Type.String({ description: "Name to greet" }), }),
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) { return { content: [{ type: "text", text: `Hello, ${params.name}!` }], details: { greeted: params.name }, }; },});
export default function (pi: ExtensionAPI) { pi.registerTool(helloTool);}