agent-ssh 0.4.2

Arrange agent terminal layouts and reconnect through provider attachment plans
Documentation
# Passive Windows capture boundary

As of 0.3.7, `save` reads Windows Terminal native periodic checkpoints. It never invokes the old title-challenge/tab-selection collector, never reads screen contents and never requires idle physical input.

Enable `firstWindowPreference=persistedLayout` or `persistedLayoutAndContent` in Terminal settings. The legacy `persistedWindowLayout` value is also supported. Native updates are approximately five minutes apart. If a checkpoint is still updating, old, or does not contain exactly the live panes, `save` waits automatically for up to six minutes and reports elapsed time. Press Ctrl+C to cancel before a snapshot is written. Disabled persistence, malformed data, ambiguous bindings, and unsupported layouts fail immediately. Save reports the accepted checkpoint's age. Layout-only changes can remain stale until the next checkpoint. This setting also enables native startup restoration; avoid configuring a second automatic startup restorer.

Waiting stays bound to the original window and process incarnation, even if its caption changes. A replacement or closed window cannot become the save target. An interrupted read-only collector can finish separately within its bounded sampling time; abrupt termination can leave its private temporary metadata directory.

Interactive stderr shows elapsed-time progress. Redirected stderr receives one plain waiting notice; snapshot output stays on stdout.

The adapter resolves stable layouts and Preview named-workspace indirections, replays explicit split ratios/focus actions, and binds persisted connection session GUIDs exactly to live WT_SESSION values read from recognized x64 processes. It reads only that identity from the process environment; no environment block is exported or saved. The x64 process-parameter offsets and native state format are compatibility surfaces, not a stable live API. Missing/ambiguous bindings, unexpected actions, unsupported distributions/architectures and multiple HWNDs sharing a process fail without invasive fallback.

TCP provenance uses GetExtendedTcpTable OWNER_MODULE_ALL endpoint tuples, PID and socket creation time. A remote observation independently proves the exact tuple against an established socket owned by an sshd ancestor. Raw local TCP state alone does not prove interface health. Existing tmux clients remain exact socket/session references. Direct Marshal Codex launchers additionally retain verified conversation IDs, cwd, process incarnation and the deployed managed-resume program; they do not pretend to be tmux sessions.

Version 3 recovery preserves the complete tree. Unavailable or already-running targets become labelled shell panes at the same positions; other panes can recover. No duplicate local or direct-remote Codex interface is launched over an observed live owner. Legacy version 1/2 provider layouts retain their existing explicit partial-load semantics.

Root PowerShell panes are included even when Terminal launched them with arguments. Nested utility shells and the collector are excluded. A root shell with startup arguments is saved as an unavailable recovery target; those arguments are neither replayed nor included in its recovery reason. A recognized Codex or SSH child remains the preferred recovery target for that pane.

The historical capture-windows.ps1 and watchdog helpers remain in source for the read-only ProcessesOnly local ownership census and older fixture coverage. They are not used for save layout capture.