Files
deepseek-harness/packages/host/directory-picker
imccyu ec601ca13d build(vendor): rescope the vendored Cordis packages into @deepseek-ai
Machine-produced by `pnpm run rescope-vendor --apply` plus the regeneration it
prints: `pnpm install` for the lockfile, `pnpm run gen-third-party-notices`,
`verify-translation-pairing --write` for the touched bilingual pairs,
`gen-doc-graphs`, and one typert snapshot whose ids embed character offsets.
`pnpm run rescope-vendor --check` verifies the result.

Renames nine vendored packages (cordis, cosmokit, schemastery and the six
@cordisjs plugins) and every reference that resolves them: manifest names and
dependency keys, module specifiers including declare-module merges, cordis.yml
plugin names, tsconfig paths, every Markdown fence, and `docs/` prose.
Directory names, upstream versions, and dependency ranges are unchanged, so
vendor/README.md still reads as an upstream snapshot; its manifest table gains
an upstream-name column so THIRD_PARTY_NOTICES keeps MIT attribution pointed
at each fork's origin.

The tutorial tier follows the rename end to end: its yaml fences named plugins
the Loader can no longer resolve, its `ts ignore-check` fences disagreed with
the compiled fences beside them, and its prose quoted both. The contracts that
told readers to keep upstream names — the root convention and the vendoring
cookbook's tree comment and manifest invariant — now say to rescope instead.

Two rules read `@deepseek-ai/` as "another workspace plugin": the client bundle
purity gate now names the vendored libraries a browser bundle inlines, and the
files where a bare `cordis` is an agent-preset id keep that product data.
2026-08-10 22:04:13 +08:00
..
2026-08-10 16:34:20 +08:00

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

English | 中文

The web GUI host's workspace-directory picker is a capability seam. The abstract DirectoryPicker service (ctx.directoryPicker) is its Service Definition. Its only method, capability(), returns a discriminated union describing how an operator selects a directory. Backends differ in user interaction, not just implementation: { kind: 'native', pick(signal) } opens one native OS chooser on the host display (-native); { kind: 'browse', list(path?), createDirectory(path, name) } provides listing and creation operations for an in-app browser, which works for remote clients that cannot reach an OS chooser (-browse). Consumers switch on capability().kind; the union derives from the merge-extensible DirectoryPickerCapabilities map, and a new backend adds its variant there through declaration merging. For an unknown kind, consumers hide directory picking rather than fail. The capability object must be stable for the service lifetime. Each backend package also has a browser entrypoint that registers the matching interaction in ui-workspace's directory-flow slots, so one composition row selects both the host capability and the client flow. A composition that should choose at runtime mounts -auto, which inspects the host once at boot and mounts the matching backend row.

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 support — 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 DirectoryPicker Agent Note.