refactor(plugin): return tool output directly

This commit is contained in:
Dax Raad 2026-07-04 17:09:51 +00:00 committed by 𝓛𝓲𝓽𝓽𝓵𝓮 𝓕𝓻𝓪𝓷𝓴
commit 8f7c6c33d9
21 changed files with 235 additions and 172 deletions

View file

@ -108,7 +108,7 @@ describe("PluginV2", () => {
description: "Plugin tool",
input: Schema.Struct({}),
output: Schema.Struct({ ok: Schema.Boolean }),
execute: () => Effect.succeed({ ok: true }),
execute: () => Effect.succeed({ structured: { ok: true }, content: [] }),
}),
})
.pipe(Effect.orDie),
@ -146,7 +146,8 @@ describe("PluginV2", () => {
description: "Echo",
input: Schema.Struct({ text: Schema.String }),
output: Schema.Struct({ text: Schema.String }),
execute: ({ text }) => Effect.sync(() => executed.push({ text })).pipe(Effect.as({ text })),
execute: ({ text }) =>
Effect.sync(() => executed.push({ text })).pipe(Effect.as({ structured: { text }, content: [] })),
}),
})
.pipe(Effect.orDie)