description: "Native-OS-chooser backend of the directory-picker seam: opens one platform chooser per pick for operators sitting at the web GUI host's display."
English | 中文
An operator at the host's display picks a workspace directory through a native OS chooser: dsh-host-directory-picker-native opens one platform directory chooser per pick and resolves the chosen absolute path (null on cancel). macOS drives osascript, Linux uses Zenity with a KDialog fallback, and Windows opens the modern IFileOpenDialog in a spawned child process. Only viable when the operator sits at the host's display — remote deployments compose the browse backend instead. One composition row also registers the matching browser-side interaction in the workspace flow, so it selects both sides.
Compose this backend when the operator works at the host's display and a native chooser is the right interaction. A workspace flow that opens a directory picker calls pick(signal) once per open request; the returned promise resolves with the chosen absolute path, or null when the operator cancels.
Choose this backend for a workstation-local operator on macOS, Windows, or desktop Linux. Choose the browse backend when clients cannot reach an OS chooser — remote browsers, SSH-forwarded sessions, or unattended hosts. When the situation varies, the adaptive chooser resolves it at boot.
Each call opens one native chooser on the host display and waits for the operator; aborting the caller's signal terminates the chooser process instead of leaving it open. On Linux the chooser needs either Zenity or KDialog installed; with neither present, pick rejects with an actionable error instead of falling back to a typed-path prompt. The browser half of this package registers a renderless flow occupant into the workspace flow — every open request drives directoryPicker/pick and reports the one outcome (picked path, cancel, or failure).
A cancel returns null, not an error. Missing platform tooling, a failed chooser launch, or an aborted pick surfaces as a rejection the UI can present; the browse backend remains the composition-level fallback for deployments where native picking is unreliable.
Read these when the backend contract is not enough: the seam definition first, then the alternative backend and the chooser that selects between them.
native capability contract and the typed error vocabulary.None, as the GUI-host picking backend registers nothing model-facing.
None; this package neither assembles nor sends a provider request.
These limits define when the native interaction is unavailable or fragile. They are current package constraints, not a task backlog.
pick rejects with an actionable error; it does not fall back to a typed-path prompt (the browse backend is that fallback at the composition level).Show so the dialog can take the foreground from a background host; where synthesized input is suppressed (secure desktops, restricted remote sessions, an elevated foreground window), the dialog may still open behind other windows. The technique is validated on Windows 11 only.Runtime invariant: No companion is published. Each pick is one stateless subprocess round trip; the chooser outcome is only the returned path.