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:
Dax Raad 2026-07-01 00:53:22 -04:00
commit 6a91a682e4
13 changed files with 998 additions and 883 deletions

File diff suppressed because it is too large Load diff

View file

@ -4,6 +4,8 @@ import type {
LocationGetOutput,
AgentListInput,
AgentListOutput,
PluginListInput,
PluginListOutput,
SessionListInput,
SessionListOutput,
SessionCreateInput,
@ -310,6 +312,20 @@ export function make(options: ClientOptions) {
requestOptions,
),
},
plugin: {
list: (input?: PluginListInput, requestOptions?: RequestOptions) =>
request<PluginListOutput>(
{
method: "GET",
path: `/api/plugin`,
query: { location: input?.["location"] },
successStatus: 200,
declaredStatuses: [401, 400],
empty: false,
},
requestOptions,
),
},
session: {
list: (input?: SessionListInput, requestOptions?: RequestOptions) =>
request<SessionListOutput>(

View file

@ -168,6 +168,21 @@ export type AgentListOutput = {
}>
}
export type PluginListInput = {
readonly location?: {
readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined
}["location"]
}
export type PluginListOutput = {
readonly location: {
readonly directory: string
readonly workspaceID?: string
readonly project: { readonly id: string; readonly directory: string }
}
readonly data: ReadonlyArray<{ readonly id: string }>
}
export type SessionListInput = {
readonly workspace?: {
readonly workspace?: string | undefined