Cloud: re-land repository picker and recovery UI (code in packages, no as!, design tokens)

Merged
TE
5d ago
+10246-238

Summary

Re-lands #30357 after #30791, restoring the repository picker, recovery card, Cloud environment editor, and daemon contracts on the current feat-cmux-next base. The later fixes from #30801, #30831, #30834, #30359, and #30848 are preserved.

Lawrence's revert reason was:

Takes back #30357: CmuxNextApp +76 lines, a banned as! (AgentPaneCloudRepositoryRequest.swift) and new design-token rows turned three feat tip checks red; re-land with the code in a package, no as!, and design tokens.

Conditions met

  • The repository and environment routing, remote start coordination, and pane forwarding live in CmuxNextAgentPane or CmuxNextDaemonService. The four files that held the +76-line app routing change are net 10 lines smaller; the prepush gate against merge-base 088d253582e1 reports app_lines -10 for CmuxNextApp, so the architecture count does not grow.
  • AgentPaneCloudRepositoryRequest uses a typed .object conversion and returns seed.bad_request for malformed parameters. The changed Swift code has no as!, try!, or force-unwrap crash violations.
  • The UI uses existing design tokens. bun scripts/check-design-tokens.ts reports no new rows, and check-default-cursor.py is clean.
  • Remote repository frames carry the attached surface and chat session, while preserving the current daemon credential checks. The two Cloud repository forwarding tests from #30832 are included.
  • cmux-tui/spec/api-compat.surface.json matches sdk-schema.json.

Leo's request: "i want us to be able to do this too", "and this kind of recovery", and "tho i think this kinda thing can be more ergonomic". Swift remains a forwarding shell while behavior lives in the package and daemon layers.

Validation

Current head: 66aa0d7fe0b3253007e0c4140a710579b9e07dd8.

  • Exact-head fleet app compile: passed (job 186b57ae424b80053dd04fbf, app 87.7 seconds; bundled cmux-tui check 40.7 seconds).
  • Exact-head prepush gate against merge-base 088d253582e1: passed; app_lines -10, no new violations.
  • Package convention lint: passed. Forwarding lives in receiver extensions; remote start uses an instantiated value with injected dependencies.
  • Exact-head focused web tests: glass-one-edge, environmentSheet, and agent-pane-jump-latest-steady all passed in 41320298545, including Chromium and WebKit.
  • bun scripts/check-design-tokens.ts: passed with no new rows. check-default-cursor.py: passed.
  • Fleet bun run check: passed at 48f3dec8333af34bec945502c3c2042aa94f0206 in 41318258269.
  • Earlier focused repository recovery, Cloud run, and Session Info tests: all four files passed in 41315890695.
  • API compatibility: passed (fleet step e33af03e34b18bc4d0f1518b).
  • Exact-head focused Rust clippy and all 13 Cloud conversation, repository, and environment tests: passed in 41320590938.
  • Full per-test web verdicts: all eight react-apps-base-check (1–8) jobs finished green at this head in 41320257768. The complete CI run succeeded, including the current-head web lint, formatting, and type-check step.

The repair restores the branch-local attach handlers while retaining the repository surface/session binding, fixes the environment lint, and lets the environment sheet glass draw its sole edge.

Takes back #30791: re-lands #30357 with its code in packages (CmuxNextApp net -10), no as!, and design tokens, which were the revert's three conditions.

Agent session: agent session