Danger warning on approval cards (red card, reasons, no Always); file shelf in the top-left slot with 'На полку' after a drop

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maksarsanjeev
2026-10-06 22:51:35 +03:00
parent 3857776111
commit 37c01f991a
9 changed files with 296 additions and 6 deletions
+5 -2
View File
@@ -672,7 +672,8 @@ final class HookServer: @unchecked Sendable {
return
}
let command = toolInput["command"] as? String ?? tool
let command = DangerCheck.describe(tool: tool, input: toolInput)
let danger = DangerCheck.reasons(tool: tool, input: toolInput)
if pendingApprovalFD >= 0 {
// Displace the previous request: write "ask" then cancel its source.
@@ -692,7 +693,9 @@ final class HookServer: @unchecked Sendable {
upsertWorkspaceTask(id: pillId, projectName: projectName, cwd: cwd)
state.updateTask(id: pillId, state: .approval)
state.pendingApproval = ApprovalInfo(sessionId: sessionId, tool: tool,
command: command, inputKey: inputKey, pillId: pillId)
command: command, inputKey: inputKey, pillId: pillId,
danger: danger)
if !danger.isEmpty { NotificationCenter.default.post(name: .triggerEmote, object: BotEmote.surprised) }
state.isPinned = true
SoundEngine.shared.play("approval")