Add cmd-k to delete current line
All checks were successful
Build / build (push) Successful in 2m31s

This commit is contained in:
Leon Mika 2026-03-14 21:52:13 +11:00
parent 3e8d101eec
commit d64779f660
10 changed files with 166 additions and 0 deletions

22
app.go
View file

@ -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 {