feat(grok): capture exit_plan_mode into the v2 proposed-plan card (#8358)

Completes the deferred half of #8358: Grok's plan-approval gate now works
on the v2 runtime. The XAi extension regains main's exit-plan helpers
(request schemas, plan-markdown extraction, the abandoned-with-feedback
response, and the plan.md session-path sniffing), and the v2 ACP adapter
grows a captureProposedPlan primitive that emits a completed
proposed-plan artifact for the active turn — one plan id per turn, so
plan.md rewrites and the exit gate update a single card.

The Grok flavor wires both ends: tool calls that write plan.md under a
Grok session dir surface the plan while plan mode is still active, and
x.ai/exit_plan_mode (plus the underscore alias) captures the final plan —
request content first, then the sniffed plan.md contents, then the
empty-state placeholder — and abandons the native gate so the turn does
not hang, mirroring the Claude ExitPlanMode pattern.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
99b6026662Julius Marminge committed on 9/18/2026, 12:49:51 AM· committed by Julius Marmingeparent59cbb6f
4 files changedLine totals unavailable