mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-05 00:44:54 +01:00
fix: allow tool.execute.after hook to modify MCP tool output (#3381)
This commit is contained in:
@@ -588,10 +588,7 @@ export namespace SessionPrompt {
|
||||
},
|
||||
)
|
||||
const result = await execute(args, opts)
|
||||
const output = result.content
|
||||
.filter((x: any) => x.type === "text")
|
||||
.map((x: any) => x.text)
|
||||
.join("\n\n")
|
||||
|
||||
await Plugin.trigger(
|
||||
"tool.execute.after",
|
||||
{
|
||||
@@ -602,6 +599,11 @@ export namespace SessionPrompt {
|
||||
result,
|
||||
)
|
||||
|
||||
const output = result.content
|
||||
.filter((x: any) => x.type === "text")
|
||||
.map((x: any) => x.text)
|
||||
.join("\n\n")
|
||||
|
||||
return {
|
||||
title: "",
|
||||
metadata: {},
|
||||
|
||||
Reference in New Issue
Block a user