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.
This commit is contained in:
parent
e59752034e
commit
3c3f33037d
1 changed files with 70 additions and 0 deletions
70
.pi/extensions/pi-worktree.ts
Normal file
70
.pi/extensions/pi-worktree.ts
Normal file
|
|
@ -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." }],
|
||||
};
|
||||
},
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue