fn build_permission_options(
ctx: &ToolPermissionContext,
) -> Vec<PermissionOption>Expand description
Construct the contextual option list for a permission prompt.
Derives “Allow always for X” / “Allow always & add dirs” / “Allow
always & switch mode” entries from ctx.suggestions; adds the
synthesized “Allow with edits” for editable tools and the universal
“Tell the agent something else” escape hatch.
Wire reality (captured 2026-05-18; see baselines/sdk/2.1.117/):
Readoutside workspace ->addRuleswith{toolName, ruleContent}. macOS sends BOTH//tmp/**AND//private/tmp/**– these collapse into ONE display option whose action carries BOTH rules.Write/Editoutside workspace ->setMode -> acceptEdits+addDirectories(NOT addRules). Different variant mix.ExitPlanMode->suggestions: [](empty). Plain Permission.