aws / aws/amazon-q-developer-cli

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

Offen
#3,748 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
2k
Forks
439
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, die vorhandenen Hook-Ereignisse agentSpawn, userPromptSubmit, preToolUse, postToolUse und stop bis zur TUI-Genehmigungsaufforderung für Tools nachzuverfolgen. Überprüfe zuerst den Genehmigungsablauf und die Konventionen für Hook-Payloads; abgeschlossen ist die Aufgabe, wenn ein neues awaitingApproval-Ereignis ausgelöst wird, sobald die Aufforderung angezeigt wird, und das Arbeitsverzeichnis, den Toolnamen und die im Issue beschriebene Eingabe enthält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
cli, developer-experience
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.