Show the `logfire_mcp` plugin settings menu in the `clai2` web UI

Merged
MP
2mo ago
+262-285

Part 25 of the clai2 web UI stack (… → #10326 → this PR). Based on #10326. No linked issue: requested by the CLAI maintainer.

Why. One PR per plugin: logfire_mcp now declares its settings menu (settings_menu(), #10312) instead of running termflow widgets in configure(). The same menu, /keys and sign-in steps included, opens in the terminal and in the web UI's plugins panel (#10315), where those steps show as dialogs.

What changes

  • API key row → action using the shared choose_key. The plugin's own _MaskedPrompt, _choose_key, _confirm_replace and the run_coroutine_threadsafe bridge are gone. The old "No API key" choice is now Reset on the row.
  • Which Logfire row → action: the new logfire_destination.choose_destination(dialogs, ...) offers Logfire US, Logfire EU and "Another Logfire…". The last one asks for an address checked by destination_problem. The runners-based pick_destination is unchanged for observability until it's ported.
  • Terminal only: configure stays as a thin override that first switches, once, to the region you last set up. The web UI only highlights that region, because a panel has no "menu opened" moment to do it in.
  • Restored test: the menu reads /keys and the sign-in status off the event loop. It now passes again thanks to #10312's fix.
  • Its tests drive the actions with ScriptedDialogs (#10316) and the terminal path through plugin.configure() with scripted runners. Its PLUGINS.md section says the menu also opens in the web UI.

Verification.

  • Ported in its own herdr worktree and stacked here. The porting agent got 100% branch coverage of the plugin and clean pyright and ruff, and walked the menu in tmux and a headed browser without completing a real sign-in or entering a real secret.
  • With all of #10318 to #10322 and the PRs above it stacked: 765 tests pass across every ported plugin's suite, the logfire and setup suites, web, loader, keys, sign-in, dialogs, reload and startup imports. Pyright is clean on builtin_plugins.
  • I re-checked it in a headed browser against an isolated clai2 --web -m test, with the OS keychain blocked: the rows render, each action's first dialog opens, Esc backs out, and there are no page errors.

What changes for existing users. The terminal menu keeps its rows and choices, with the differences above. The menu now also works in the web UI.

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration, release note, and exact API-check waiver.
  • PR title is fit for the release changelog.