mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-21 17:09:37 +01:00
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:
@@ -28,6 +28,7 @@ import type {
|
||||
ListHttpRequestsResponse,
|
||||
ListWorkspacesResponse,
|
||||
PluginContext,
|
||||
PromptFormResponse,
|
||||
PromptTextResponse,
|
||||
RenderGrpcRequestResponse,
|
||||
RenderHttpRequestResponse,
|
||||
@@ -661,6 +662,13 @@ export class PluginInstance {
|
||||
});
|
||||
return reply.value;
|
||||
},
|
||||
form: async (args) => {
|
||||
const reply: PromptFormResponse = await this.#sendForReply(context, {
|
||||
type: 'prompt_form_request',
|
||||
...args,
|
||||
});
|
||||
return reply.values;
|
||||
},
|
||||
},
|
||||
httpResponse: {
|
||||
find: async (args) => {
|
||||
|
||||
Reference in New Issue
Block a user