aws / aws/amazon-q-developer-cli

[Feature Request] Add hook event for tool approval prompt (e.g., awaitingApproval)

Aperta
#3,748 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
2k
Fork
439
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Problem

When the assistant requires user approval to execute a tool, there is no hook event to notify the user that approval is pending. This makes it difficult to know when Kiro is waiting for input, especially when working in another window or away from the terminal.

## Current Behavior

The existing hook events are:
- `agentSpawn` - agent initialization
- `userPromptSubmit` - user submits a prompt
- `preToolUse` - before tool execution (after approval)
- `postToolUse` - after tool execution
- `stop` - assistant finishes responding

None of these fire when the approval prompt is displayed.

## Proposed Solution

Add a new hook event (e.g., `awaitingApproval`) that fires when the TUI displays a tool approval prompt. The hook event could include:

```json
{
"hook_event_name": "awaitingApproval",
"cwd": "/current/working/directory",
"tool_name": "fs_write",
"tool_input": { ... }
}
```

## Use Case

Users can configure a notification (e.g., macOS `say` command, terminal bell, desktop notification) to alert them when Kiro needs approval:

```json
{
"hooks": {
"awaitingApproval": [
{
"command": "say 'Approval required'"
}
]
}
}
```

## Context

In the previous CUI mode, users could use iTerm2 Triggers to detect approval prompts via regex matching on terminal output. With the TUI, terminal output is no longer directly matchable, making a built-in hook the only viable approach.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia tracciando gli eventi hook esistenti agentSpawn, userPromptSubmit, preToolUse, postToolUse e stop fino al prompt di approvazione degli strumenti della TUI. Verifica prima il flusso di approvazione e le convenzioni dei payload degli hook; il lavoro è completato quando viene emesso un nuovo evento awaitingApproval alla visualizzazione del prompt e include la directory di lavoro, il nome dello strumento e l'input descritto nell'issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
cli, developer-experience
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.