Move project and host queries into native MCP with host-owned OAuth/context, while retaining memory, skills, actions and publication plugins. Add nearby-model queries and explicit chat/task/learning model defaults. Adopt Responses HTTP/SSE and native steer/queue inbox delivery, preserving scoped session ownership, pending input edits and investigation communication. Disable local-provider discovery: Server /health allowed native vLLM to probe /v1/models on port 8000. A native before/after regression prevents recurrence. Validation: 170 focused Bun tests; service/plugin typechecks; native discovery, provider-discovery and input-inbox smoke checks; no paid model inference.
16 lines
843 B
TypeScript
16 lines
843 B
TypeScript
// 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<string, unknown> }).properties ?? {});
|
|
} });
|
|
} });
|