Files
deepseek-harness/packages/host/directory-picker-native/README.zh.md
creatixchu 85ca8be104 feat(host,client): compose directory picking through slots — dual-face -native, no wire advertisement
ui-workspace's two trigger surfaces each declare a single-kind directory-flow
hole (conversation.hero.workspace.directoryFlow / sidebar.workspaces.directoryFlow,
same owner contract) and keep only the trigger and the adoption: the Open-local-
folder entry renders while the surface's hole is occupied, and the occupant
reports one picked path per open through the hole's owner conversation
(open/busy/onPicked/onCancel/onError).

directory-picker-native becomes dual-face: its browser half fills both holes
with a renderless occupant driving host.pickDirectory, so the cordis.yml row
that mounts the backend also composes the client interaction — a mismatch is
impossible and a second flow package fails at client load.

With composition wiring both sides, the host.describe.directoryPicker
advertisement and the client's kind branching lose their last consumer:
the field, WorkspacesService.directoryPickerKind(), the DirectoryPickerKind
wire type, and the picker's per-open describe read are deleted. The connection
fixture now serves a deterministic pickDirectory path so the keyless snapshot
drives the full pick-then-adopt flow. ui-workspace's hand-rolled declaration
deferral is replaced by the deferRegistration helper it duplicated.
2026-07-28 21:51:01 +08:00

1.8 KiB
Raw Blame History

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

English | 中文

目录选择 seam原生 OS 选择器后端NativeDirectoryPickernative 能力注册 ctx.directoryPicker,其 pick(signal) 每次调用打开一个原生选择器并解析出所选绝对路径(取消时为 null)。平台工具不经 shell 调用macOS 使用 osascriptWindows 使用以 STA 模式运行的 PowerShell FolderBrowserDialogLinux 使用 Zenity 并以 KDialog 回退;调用方的中止信号会终止原生进程。只有操作者坐在宿主屏幕前时才可用——远程部署应组合 -browse。命令边界(DirectoryPickerRunner)与平台事实可注入,便于确定性测试。共享的免 shell 子进程运行器位于 dsh-native-command

双面包browser half./client)向 ui-workspace 的两个目录流洞注册一个无渲染的流程占用者——每次 open 请求驱动 host.pickDirectory,并经洞的 owner 会话上报唯一结果(所选路径/取消/失败)。因此一行 cordis.yml 同时组合原生交互的两侧client 侧不含任何能力 kind 分支,挂载第二个流程包会在加载期失败(洞为 single kind

模型体验

无。该后端服务于 GUI 宿主的目录选择;这里没有任何内容进入模型请求。

KV 缓存影响

无;该包既不组装也不发送提供方请求。

已知限制与延期工作

  • Linux 依赖桌面工具——Zenity 与 KDialog 均未安装时,pick 以包含解决建议的错误拒绝;它不会回退为手输路径提示(组合层面的回退是 browse 后端)。