mirror of
https://gitee.com/zhangsken/opencode.git
synced 2026-10-16 10:30:01 +08: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.
19 lines
499 B
TypeScript
19 lines
499 B
TypeScript
export * as Plugin from "./plugin"
|
|
|
|
import { Schema } from "effect"
|
|
import { define, inventory } from "./event"
|
|
|
|
export const ID = Schema.String.pipe(Schema.brand("Plugin.ID"))
|
|
export type ID = typeof ID.Type
|
|
|
|
export interface Info extends Schema.Schema.Type<typeof Info> {}
|
|
export const Info = Schema.Struct({
|
|
id: ID,
|
|
}).annotate({ identifier: "Plugin.Info" })
|
|
|
|
const Added = define({
|
|
type: "plugin.added",
|
|
schema: { id: ID },
|
|
})
|
|
export const Event = { Added, Definitions: inventory(Added) }
|