feat: add ctx.prompt.form() API for multi-field form dialogs

Add PromptFormRequest and PromptFormResponse types to enable plugins to
display forms with multiple input fields. Implement the form() method in
the prompt context and wire up frontend event handling to show and collect
form responses from users.
This commit is contained in:
Gregory Schier
2026-01-09 19:35:47 -08:00
parent 4c8f768624
commit fa3e6e6508
6 changed files with 68 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -11,6 +11,8 @@ import type {
ListHttpRequestsRequest,
ListHttpRequestsResponse,
OpenWindowRequest,
PromptFormRequest,
PromptFormResponse,
PromptTextRequest,
PromptTextResponse,
RenderGrpcRequestRequest,
@@ -37,6 +39,7 @@ export interface Context {
};
prompt: {
text(args: PromptTextRequest): Promise<PromptTextResponse['value']>;
form(args: PromptFormRequest): Promise<PromptFormResponse['values']>;
};
store: {
set<T>(key: string, value: T): Promise<void>;