From 3c3f33037d3796e5307f05bb425a9a83ddf6eb80 Mon Sep 17 00:00:00 2001 From: David Kong Date: Fri, 24 Jul 2026 18:47:56 +1000 Subject: [PATCH] feat: register all four worktree tools with placeholder implementations Register git_worktree_list, git_worktree_create, git_worktree_switch, and git_worktree_remove with correct TypeBox schemas. Each tool returns 'Not implemented yet.' as a placeholder response. --- .pi/extensions/pi-worktree.ts | 70 +++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .pi/extensions/pi-worktree.ts diff --git a/.pi/extensions/pi-worktree.ts b/.pi/extensions/pi-worktree.ts new file mode 100644 index 0000000..552d659 --- /dev/null +++ b/.pi/extensions/pi-worktree.ts @@ -0,0 +1,70 @@ +import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; +import { Type } from "typebox"; + +export default function (pi: ExtensionAPI) { + pi.registerTool({ + name: "git_worktree_list", + label: "Git Worktree List", + description: "List all linked worktrees in the current repo with branch, path, and status.", + parameters: Type.Object({}), + async execute() { + return { + content: [{ type: "text", text: "Not implemented yet." }], + }; + }, + }); + + pi.registerTool({ + name: "git_worktree_create", + label: "Git Worktree Create", + description: "Create a linked worktree for a branch in the current repo.", + parameters: Type.Object({ + path: Type.String({ description: "Path for the new worktree" }), + branch: Type.Optional( + Type.String({ + description: "Branch name (new or existing). Defaults to 'main'.", + }) + ), + create_branch: Type.Optional( + Type.Boolean({ + description: "Create a new branch? Defaults to true if branch doesn't exist.", + }) + ), + }), + async execute() { + return { + content: [{ type: "text", text: "Not implemented yet." }], + }; + }, + }); + + pi.registerTool({ + name: "git_worktree_switch", + label: "Git Worktree Switch", + description: "Switch pi's working directory to a linked worktree.", + parameters: Type.Object({ + target: Type.String({ + description: "Path or branch name of the target worktree", + }), + }), + async execute() { + return { + content: [{ type: "text", text: "Not implemented yet." }], + }; + }, + }); + + pi.registerTool({ + name: "git_worktree_remove", + label: "Git Worktree Remove", + description: "Remove a linked worktree.", + parameters: Type.Object({ + path: Type.String({ description: "Path of the worktree to remove" }), + }), + async execute() { + return { + content: [{ type: "text", text: "Not implemented yet." }], + }; + }, + }); +}