Implement CLI send flows and refactor plugin event handling

This commit is contained in:
Gregory Schier
2026-02-17 15:41:09 -08:00
parent 1f588d0498
commit a4f96fca11
29 changed files with 1587 additions and 252 deletions

View File

@@ -33,7 +33,7 @@ import type {
ListFoldersResponse,
ListHttpRequestsRequest,
ListHttpRequestsResponse,
ListWorkspacesResponse,
ListOpenWorkspacesResponse,
PluginContext,
PromptFormResponse,
PromptTextResponse,
@@ -942,9 +942,9 @@ export class PluginInstance {
workspace: {
list: async () => {
const payload = {
type: 'list_workspaces_request',
type: 'list_open_workspaces_request',
} as InternalEventPayload;
const response = await this.#sendForReply<ListWorkspacesResponse>(context, payload);
const response = await this.#sendForReply<ListOpenWorkspacesResponse>(context, payload);
return response.workspaces.map((w) => {
// Internal workspace info includes label field not in public API
type WorkspaceInfoInternal = typeof w & { label?: string };