Fix agent tool result typing

This commit is contained in:
Haitao Pan 2026-05-05 11:46:02 +08:00
parent 88f26bdbee
commit 856c9a6f3d
2 changed files with 5 additions and 5 deletions

4
dist/index.js vendored
View File

@ -107,7 +107,7 @@ function createXWorkmateArtifactsTool(api, ctx) {
config: ctx.config ?? api.config,
pluginConfig: api.pluginConfig,
});
return { content: [{ type: "text", text: payload.manifestMarkdown }] };
return { content: [{ type: "text", text: payload.manifestMarkdown }], details: {} };
}
if (action === "read") {
const payload = await readXWorkmateArtifact({
@ -125,7 +125,7 @@ function createXWorkmateArtifactsTool(api, ctx) {
: `\`${artifact.relativePath}\` is larger than maxInlineBytes; use the workspace path to download it directly.`,
].join("\n")
: payload.manifestMarkdown;
return { content: [{ type: "text", text }] };
return { content: [{ type: "text", text }], details: {} };
}
throw new Error("action must be list or read");
},

View File

@ -126,7 +126,7 @@ function createXWorkmateArtifactsTool(
config: ctx.config ?? api.config,
pluginConfig: api.pluginConfig,
});
return { content: [{ type: "text", text: payload.manifestMarkdown }] };
return { content: [{ type: "text", text: payload.manifestMarkdown }], details: {} };
}
if (action === "read") {
const payload = await readXWorkmateArtifact({
@ -144,9 +144,9 @@ function createXWorkmateArtifactsTool(
: `\`${artifact.relativePath}\` is larger than maxInlineBytes; use the workspace path to download it directly.`,
].join("\n")
: payload.manifestMarkdown;
return { content: [{ type: "text", text }] };
return { content: [{ type: "text", text }], details: {} };
}
throw new Error("action must be list or read");
},
} as AnyAgentTool;
} as unknown as AnyAgentTool;
}