mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-24 20:25:36 -04:00
6a91a682e4
Adds a plugin.list HTTP endpoint that reports currently loaded plugins, wires it through protocol, server, and generated clients, and merges it into sdk-next's plugin API. Also updates the sample plugin to register a primary agent instead of a subagent for local testing.
14 lines
458 B
TypeScript
14 lines
458 B
TypeScript
import { PluginV2 } from "@opencode-ai/core/plugin"
|
|
import { Effect } from "effect"
|
|
import { HttpApiBuilder } from "effect/unstable/httpapi"
|
|
import { Api } from "../api"
|
|
import { response } from "../location"
|
|
|
|
export const PluginHandler = HttpApiBuilder.group(Api, "server.plugin", (handlers) =>
|
|
handlers.handle("plugin.list", () =>
|
|
Effect.gen(function* () {
|
|
return yield* response(PluginV2.Service.use((plugin) => plugin.list()))
|
|
}),
|
|
),
|
|
)
|