$ rezi
Widgets

ToolApprovalDialog

Dialog for reviewing and approving tool execution (developer tooling).

Dialog for reviewing and approving tool execution (developer tooling).

Usage

ui.toolApprovalDialog({
  id: "approval",
  open: state.pendingApproval !== null,
  request: state.pendingApproval,
  onPress: (action) =>
    action === "allow"
      ? executeTool(state.pendingApproval)
      : app.update((s) => ({ ...s, pendingApproval: null })),
  onAllowForSession: () => allowForSession(state.pendingApproval),
  onClose: () => app.update((s) => ({ ...s, pendingApproval: null })),
})

Props

PropTypeDefaultDescription
idstringrequiredWidget identifier
requestToolRequestrequiredTool request details
openbooleanrequiredVisible state
widthnumber50Dialog width in cells (clamped to viewport width)
heightnumber15Dialog height in cells (clamped to viewport height)
focusedAction"allow" | "deny" | "allowSession"-Focused action button
onPress(action: "allow" | "deny") => voidrequiredAllow/deny callback
onAllowForSession() => void-Allow for session callback
onClose() => voidrequiredClose callback

Notes

  • ToolRequest includes metadata like toolId, toolName, riskLevel, and optional fileChanges.
  • fileChanges entries include path, changeType, and optional preview/oldPath for renames.
  • Default dialog size is 50x15 cells when width/height are omitted.

On this page