// Loaded only by the opt-in isolated task-agent smoke test, never by the service. import { Plugin, Rpc } from "@opencode/plugin"; import * as Schema from "effect/Schema"; import { z } from "zod"; export default Plugin.define({ id: "test.task-agent-probe", async setup(ctx) { await ctx.rpc.register(Rpc.define({ id: "test.task-agent-probe", methods: { subagent_input: { input: z.object({}), output: z.array(z.string()) }, }, events: {} }), { subagent_input: async () => { const tool = (await ctx.tool.list()).find((item) => item.id === "subagent"); if (!tool) throw new Error("native subagent tool missing"); const input = Schema.isSchema(tool.input) ? Schema.toJsonSchemaDocument(tool.input).schema : tool.input; return Object.keys((input as { properties?: Record }).properties ?? {}); } }); } });