Files
deepseek-harness/packages/host/directory-picker
creatixchu cd7aa3c7d8 fix(host,client): gate the picker affordance on the advertised kind; reject non-absolute browse paths
ds-review-bot round 2. The workspace UI never consulted the advertised
directoryPicker kind: under a browse (or merge-added) backend it still
rendered 'Open local folder…' and called pickDirectory(), which the host
answers with directory-picker-unavailable. The create flow now reads
directoryPickerKind() per menu open and renders the dialog affordance only
under 'dialog' — browse (until its in-app browser UI lands) and unknown
kinds hide the entry, realizing the seam's documented default; a keyless
workspace-flow snapshot pins the hidden entry over the browse fixture.

The browse backend also resolved wire paths, silently rebasing '' or
relative parents under the host process cwd; both primitives now reject
non-absolute explicit paths with their business codes, and the seam JSDoc
carries the contract.
2026-07-28 17:39:15 +08:00
..

@deepseek-ai/dsh-host-directory-picker

English | 中文

The workspace-directory picking seam for the web-GUI host: an abstract DirectoryPicker service (ctx.directoryPicker) whose single contract method capability() returns a discriminated capability describing how an operator selects a directory. Backends differ in interaction shape, not just mechanism, so the seam models the shapes explicitly instead of one method set: { kind: 'dialog', pick(signal) } opens one native OS chooser on the host display (-dialog); { kind: 'browse', list(path?), createDirectory(path, name) } serves listing/creation primitives an in-app browser drives, which works for remote clients no OS dialog can reach (-browse). Consumers switch on capability().kind; the union derives from the merge-extensible DirectoryPickerCapabilities map (a new backend declaration-merges its shape there), and the documented default for an unknown kind is to hide the picking affordance rather than fail. The capability object must be stable for the service lifetime.

Browse primitives fail with the typed DirectoryPickerError (directory-unreadable / directory-exists / directory-create-failed, each carrying the subject path), which the consuming gateway maps 1:1 onto wire error codes. DirectoryEntry rows carry a host-owned hidden flag (POSIX dot convention) so display policy stays client-side; DirectoryListing.crumbs is the ancestor chain from the filesystem root, every crumb a jump target. Design rationale, the ctx.fs separation, and the policy decisions live in the directory-picker capability seam Agent Note.

Model Experience

None, as the seam serves the GUI host's directory selection; nothing here reaches a model request.

KV Cache effect

None; this package neither assembles nor sends a provider request.

Known Limitations and Deferred Work

  • No multi-root vocabulary — the browse contract exposes one ancestry chain per listing; per-deployment root scoping (and Windows drive-root enumeration above a drive) waits for a consumer that needs it, per the seam Agent Note.