fix: docs

This commit is contained in:
imccyu
2026-08-12 01:43:12 +08:00
parent 19303da8de
commit 929086fb36
30 changed files with 402 additions and 284 deletions
@@ -0,0 +1,6 @@
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write packages/client/ui-directory-picker-native/README.md
README.md: feb944b38a17086e0fcc6e4da52e1f16a4055166
README.zh.md: 72296b18af69749428157302744063056a6a50de
@@ -0,0 +1,22 @@
# @deepseek-ai/dsh-client-ui-directory-picker-native
English | [中文](README.zh.md)
Native directory-picker surface: the browser half of the native picking interaction. It fills ui-workspace's two directory-flow holes (`conversation.hero.workspace.directoryFlow` and `sidebar.workspaces.directoryFlow`) with a renderless occupant that answers each `open` request by driving the local Host's OS chooser through `ctx.workspaces.pickDirectory()`, then reports exactly one outcome — a picked path, a cancellation, or a failure — back through the owner conversation. The OS dialog itself belongs to [`dsh-host-directory-picker-native`](../../host/directory-picker-native/README.md); mounting this package composes the surface with that backend from one cordis.yml row, so no client code branches on a capability kind.
Both registrations install as one transactional effect through nested `slots.inject()` calls, because either declaring entry may activate later or replace its declaration. The occupant arms once per rising `open` edge, so re-renders — including an adoption that keeps `open` true while `busy` — never launch a second chooser, and the owner withdrawing `open` re-arms the next request. Settlements ride a ref so the answer reaches the owner's latest handlers rather than the ones captured when the chooser opened. An unmount (HMR replacing the occupant) discards the settlement wholesale: the wire carries no per-request abort, so the host-side chooser survives until answered, its answer lands nowhere, and the replacement instance re-arms under the owner's still-open request.
The node half is an empty `apply`: it exists so the plugin appears in the host cordis.yml and Loader, while the browser half ships through `exports["./client"]` and is discovered through the `dsh.client` manifest declaration.
## Model Experience
None, as the directory chooser is browser chrome; 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 cancellation of an open chooser** — the wire has no per-request abort, so a chooser already on the host display cannot be closed from the browser; a discarded settlement is simply ignored.
- **Local Host carriers only** — an OS dialog opens on the machine running the Host, so in-process and remote-browser deployments need the `-browse` composition instead. Platform failures surface through the owner's retryable folder dialog.
@@ -0,0 +1,22 @@
# @deepseek-ai/dsh-client-ui-directory-picker-native
[English](README.md) | 中文
原生目录选择界面:原生选取交互的浏览器半边。它通过 ui-workspace 的两个 directory-flow 洞(`conversation.hero.workspace.directoryFlow` 与 `sidebar.workspaces.directoryFlow`)装入一个无渲染占位者,每次收到 `open` 请求就用 `ctx.workspaces.pickDirectory()` 驱动本地 Host 的操作系统选择框,然后通过 owner 会话回报恰好一个结果——选中的路径、取消、或失败。系统对话框本身属于 [`dsh-host-directory-picker-native`](../../host/directory-picker-native/README.md);挂载本包即用一行 cordis.yml 把界面与该后端组合起来,因此没有任何客户端代码按能力种类分支。
两处注册通过嵌套的 `slots.inject()` 作为一个事务性 effect 安装,因为任一声明方条目都可能稍后激活或替换其声明。占位者在每个 `open` 上升沿只武装一次,所以重渲染(包括采纳期间 `busy` 而 `open` 仍为真)都不会再开第二个选择框;owner 撤回 `open` 会为下一次请求重新武装。结果经由 ref 回报,因此答案落到 owner 最新的处理器上,而不是打开选择框时捕获的那一套。卸载(HMR 替换占位者)会整体丢弃该结果:wire 上没有按请求的中止通道,所以 Host 侧的选择框会一直存在到被回答,它的答案无处可落,替换后的实例则在 owner 仍然打开的请求下重新武装。
node 半边是一个空 `apply`:它的存在只为让插件出现在 host 的 cordis.yml 与 Loader 中,浏览器半边经 `exports["./client"]` 出货,并通过 `dsh.client` 清单声明被发现。
## 模型体验
None, as the directory chooser is browser chrome; nothing here reaches a model request.
#### KV Cache 影响
无;本包既不组装也不发送 provider 请求。
## 已知限制与暂缓事项
- **无法取消已打开的选择框** —— wire 上没有按请求的中止通道,因此已经出现在 Host 显示器上的选择框无法从浏览器关闭;被丢弃的结果只是被忽略。
- **仅限本地 Host 载体** —— 系统对话框开在运行 Host 的机器上,所以进程内与远程浏览器部署需要改用 `-browse` 组合。平台失败通过 owner 的可重试文件夹对话框呈现。