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:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user