feat(core): add plugin list endpoint
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.
This commit is contained in:
parent
f8626865b9
commit
6a91a682e4
13 changed files with 998 additions and 883 deletions
13
packages/server/src/handlers/plugin.ts
Normal file
13
packages/server/src/handlers/plugin.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
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()))
|
||||
}),
|
||||
),
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue