feat(agent): describe agent home layouts and try every transcript candidate
Commit

Add an optional agent.HomeLayoutProvider capability: built-in agents with a relocatable home report it through SessionHome and list their session stores beneath it in a declarative HomeLayout. Claude Code keeps projects, Codex sessions and archived_sessions, Copilot CLI session-state, Pi sessions, and Droid sessions beneath its .factory directory.
Add agent.SessionFileCandidatesProvider for agents that may keep one session in several files: Codex and Pi list every dated copy newest first, and Cursor lists its nested layout before its flat one. SessionStore.SessionFileCandidatesIn resolves them, dropping any outside the store.
Attach now takes the first candidate that is a regular file instead of failing on an unusable newest copy, and searches every store of the active home when the session directory lies in one, so archived Codex rollouts are found. Symbolic link handling is unchanged.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Entire-Checkpoint: 01M45WZBW88VTXXBP2FP92QND1