diff --git a/app.go b/app.go
index 672b391..a0d3a74 100644
--- a/app.go
+++ b/app.go
@@ -62,6 +62,28 @@ func (a *App) ListProcessors() (resp []ListProcessorsResponse) {
return resp
}
+func (a *App) TriggerTextProcess(action string) {
+ runtime.EventsEmit(a.ctx, "request-text-process", RequestTextProcess{
+ Action: action,
+ })
+}
+
+func (a *App) PromptUser(label string, resp func(string)) {
+ runtime.EventsOnce(a.ctx, "prompt-response", func(data ...interface{}) {
+ if len(data) == 0 {
+ return
+ }
+ ans, ok := data[0].(string)
+ if !ok {
+ return
+ }
+ resp(ans)
+ })
+ runtime.EventsEmit(a.ctx, "prompt-request", PromptRequest{
+ Label: label,
+ })
+}
+
func (a *App) ProcessText(req ProcessTextRequest) {
filter, ok := TextFilters[req.Action]
if !ok {
diff --git a/frontend/index.html b/frontend/index.html
index 4951b76..43a2da8 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -10,6 +10,15 @@
Cmd+P: open command palette. Shift+Cmd+P: rerun last command.
+