description: "Adaptive chooser of the directory-picker seam: resolves the web GUI host's situation once at boot and mounts the matching native or browse backend."
English | 中文
dsh-host-directory-picker-auto picks the right directory-picking interaction for every boot: it resolves the host's situation once at boot and mounts the matching backend — native or browse — together with its browser half, as real Loader entries in the in-memory root tree. The resolution is one pure boot-time sample: native requires a loopback-only bind, a non-SSH launch, and a servable display session; anything ambiguous resolves to browse, which works everywhere. Pinning an interaction means composing that backend directly. The mounted capability stays stable for the service lifetime, as the seam requires.
Compose this plugin instead of a concrete backend when the same composition must serve hosts that differ: local workstation sessions where a native chooser works, and remote or headless sessions where only the in-app browser works. The chooser inspects the host once at boot and mounts the matching interaction.
native requires every signal that the operator can see the host display and the native backend can serve it: a loopback-only bind (read from the injected webServer; an all-interfaces bind admits remote browsers no OS chooser can reach), no SSH launch (the shared launch-environment predicate ignores project/user .env values and checks only inherited non-empty SSH_CONNECTION/SSH_TTY), and a servable display session — assumed on darwin and win32; on linux, DISPLAY/WAYLAND_DISPLAY plus a zenity or kdialog binary on PATH; never on any other platform. Anything ambiguous resolves to browse, which works everywhere.
The resolved interaction arrives as an ordinary Loader entry: the backend registers ctx.directoryPicker, and its browser half is discovered by the client module table exactly as a config row's would be, so the seam's one-row-swaps-both-faces invariant holds. Unloading the chooser removes the entry, unloading both faces with it. The sample happens exactly once per boot, so the mounted capability stays stable for the service lifetime.
Pinning is not a config field here: compose the -native or -browse row directly instead of this one — that is the seam's documented swap point. Mounting the chooser and a backend row together fails loud (duplicate directoryPicker service, duplicate client flow in the single holes).
A wrong native choice degrades to the backend's existing retryable failure dialog rather than a broken composition; composing -browse directly selects the safe interaction for deployments whose situation the probe cannot prove.
Read these when the chooser's contract is not enough: the seam definition first, then the two backends it mounts.
None, as the GUI host's directory-selection chooser only mounts a backend row and registers nothing model-facing.
None; this package neither assembles nor sends a provider request.
These limits define when the boot-time sample can misjudge the host. They are current package constraints, not a task backlog.
SSH_* markers; a Darwin process outside an Aqua session still counts as displayed; and a workstation-local launch later reached through ssh -L arrives from 127.0.0.1, resolves native, and opens the chooser on the unattended workstation. A wrong native choice degrades to the backend's existing retryable failure dialog, and composing -browse directly selects the safe interaction for such deployments.PATH only — a zenity/kdialog reachable some other way (shell alias, non-PATH install) still resolves browse; installing either binary on PATH restores native eligibility at the next boot.Runtime invariant: No companion is published. The sole effect is one boot-time Loader-entry mount owned by the plugin fiber; the store is authoritative.