fix(coding-agent): built-in tools work like extension tools

Export readToolDefinition / createReadToolDefinition and the equivalent built-in ToolDefinition APIs from @mariozechner/pi-coding-agent.
This commit is contained in:
Mario Zechner
2026-03-22 04:20:28 +01:00
parent 80f527ec22
commit 235b247f1f
32 changed files with 2594 additions and 1408 deletions

View File

@@ -135,7 +135,7 @@ export default function (pi: ExtensionAPI) {
},
// Custom rendering of the tool call (shown before/during execution)
renderCall(args, theme) {
renderCall(args, theme, _context) {
let text = theme.fg("toolTitle", theme.bold("rg "));
text += theme.fg("accent", `"${args.pattern}"`);
if (args.path) {
@@ -148,7 +148,7 @@ export default function (pi: ExtensionAPI) {
},
// Custom rendering of the tool result
renderResult(result, { expanded, isPartial }, theme) {
renderResult(result, { expanded, isPartial }, theme, _context) {
const details = result.details as RgDetails | undefined;
// Handle streaming/partial results