@deepseek-ai/dsh-client-ui-directory-picker-native 0.1.6-alpha.1 → 0.1.6-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +8 -5
- package/README.zh.md +7 -4
- package/lib/client.js +3 -1
- package/lib/types/client/flow.d.ts +2 -2
- package/lib/types/client/index.d.ts +1 -9
- package/package.json +6 -5
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/client/ui-directory-picker-native/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 73115c441399fca56d0fd208307240226faf653a
|
|
6
|
+
README.zh.md: 5cf92adfb43eb3b0e3b7cc4e441b503e9a0757af
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Native directory-picker surface: the browser half that drives the
|
|
2
|
+
description: "Native directory-picker surface: the browser half that drives the local Desktop or Host OS chooser for workspace-directory flows; for users and maintainers choosing a picking interaction."
|
|
3
3
|
kind: "package-reference"
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
|
|
|
9
9
|
|
|
10
10
|
## Summary
|
|
11
11
|
|
|
12
|
-
This package provides the native directory-picking surface for the Web GUI: when a workspace flow asks for a directory, a renderless browser occupant opens the operating system's own chooser on the machine
|
|
12
|
+
This package provides the native directory-picking surface for the Web GUI: when a workspace flow asks for a directory, a renderless browser occupant opens the operating system's own chooser on the local machine and reports the single outcome — a picked path, a cancellation, or a failure. It fills the two directory-flow slots declared by `ui-workspace`, composing the client side of the native picking interaction in one `cordis.yml` row. Choose it when the browser runs on the same machine as the Host; in-process and remote-browser deployments need the [`-browse`](../ui-directory-picker-browse/README.md) surface instead.
|
|
13
13
|
|
|
14
14
|
## Table of Contents
|
|
15
15
|
|
|
@@ -27,6 +27,8 @@ This package provides the native directory-picking surface for the Web GUI: when
|
|
|
27
27
|
|
|
28
28
|
Mount this plugin alongside `ui-workspace` and the host backend [`dsh-host-directory-picker-native`](../../host/directory-picker-native/README.md); one `cordis.yml` row then composes the whole native picking interaction. When a workspace add or picker flow opens a directory request, the user sees the operating system's folder dialog; the picked path is adopted by the workspace flow, and cancelling closes the dialog.
|
|
29
29
|
|
|
30
|
+
In the local Electron application, this flow uses the narrow preload directory-picker bridge. Cancellation and failure never retry through the Host chooser. Ordinary Web uses the Host call; the separate browse composition always lists Host directories.
|
|
31
|
+
|
|
30
32
|
### When to choose it
|
|
31
33
|
|
|
32
34
|
Choose this surface when the browser runs on the same machine as the Host, so an OS dialog can open there. Choose the [`-browse`](../ui-directory-picker-browse/README.md) surface when the browser is remote or in-process and no local chooser exists. The two surfaces fill the same slots, so switching is a composition change, not a code change.
|
|
@@ -39,7 +41,7 @@ Choose this surface when the browser runs on the same machine as the Host, so an
|
|
|
39
41
|
<details>
|
|
40
42
|
<summary>Implementation internals — click to expand</summary>
|
|
41
43
|
|
|
42
|
-
Both slot registrations install as one transactional effect through nested `ctx.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 never launch a second chooser; settlements ride a ref so the answer reaches the owner's latest handlers. An unmount (HMR replacing the occupant) discards the settlement wholesale: the wire carries no per-request abort, so the
|
|
44
|
+
Both slot registrations install as one transactional effect through nested `ctx.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 never launch a second chooser; settlements ride a ref so the answer reaches the owner's latest handlers. An unmount (HMR replacing the occupant) discards the settlement wholesale: the wire carries no per-request abort, so the native chooser survives until answered and its answer lands nowhere. The node half is an empty `apply` that keeps the plugin on the host roster.
|
|
43
45
|
|
|
44
46
|
</details>
|
|
45
47
|
|
|
@@ -73,8 +75,9 @@ None; this package neither assembles nor sends a provider request.
|
|
|
73
75
|
|
|
74
76
|
These limits define when the native chooser fits. They are current package constraints, not a general picker comparison or a task backlog.
|
|
75
77
|
|
|
76
|
-
- **No cancellation of an open chooser** — the wire has no per-request abort, so a chooser already on the
|
|
77
|
-
- **Local
|
|
78
|
+
- **No cancellation of an open chooser** — the wire has no per-request abort, so a chooser already on the local display cannot be closed from the browser; a discarded settlement is ignored.
|
|
79
|
+
- **Local carriers only** — the Electron dialog selects local paths; ordinary Web opens the Host chooser. Remote-browser and in-process deployments use the `-browse` composition. Platform failures surface through the owner's retryable folder dialog.
|
|
80
|
+
- **Linux automatic selection** — without zenity or kdialog, the Host selects browse even in Desktop; the Electron dialog is not used.
|
|
78
81
|
|
|
79
82
|
<a id="dev-note"></a>
|
|
80
83
|
### Dev Note
|
package/README.zh.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "
|
|
2
|
+
description: "原生目录选择表面:驱动本地 Desktop 或 Host 操作系统选择器的浏览器半部,用于工作区目录流程;供选择拾取交互的用户与维护者阅读。"
|
|
3
3
|
kind: "package-reference"
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ kind: "package-reference"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
本包提供 Web GUI
|
|
12
|
+
本包提供 Web GUI 的原生目录拾取表面:当工作区流程请求一个目录时,一个无渲染的浏览器填充会在本地机器上打开操作系统自带的选择器,并回报唯一结果——拾取的路径、取消或失败。它填充 `ui-workspace` 声明的两个目录流程 slot,用一行 `cordis.yml` 组合出原生拾取交互的客户端一侧。当浏览器与 Host 运行在同一台机器上时选择它;进程内与远程浏览器部署则需要 [`-browse`](../ui-directory-picker-browse/README.zh.md) 表面。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -27,6 +27,8 @@ kind: "package-reference"
|
|
|
27
27
|
|
|
28
28
|
与 `ui-workspace` 及 Host 后端 [`dsh-host-directory-picker-native`](../../host/directory-picker-native/README.zh.md) 一起挂载本插件;一行 `cordis.yml` 随即组合出完整的原生拾取交互。当工作区添加或选择器流程发起目录请求时,用户看到操作系统的文件夹对话框;拾取的路径被工作区流程采纳,取消则关闭对话框。
|
|
29
29
|
|
|
30
|
+
在本地 Electron 应用中,此流程使用 preload 提供的窄目录选择接口。取消和失败都不会改用 Host 选择器重试。普通 Web 使用 Host 调用;独立的浏览组合始终列出 Host 目录。
|
|
31
|
+
|
|
30
32
|
### 何时选择
|
|
31
33
|
|
|
32
34
|
当浏览器与 Host 运行在同一台机器上、操作系统对话框可以在那里打开时,选择此表面。当浏览器为远程或进程内、没有本地选择器时,选择 [`-browse`](../ui-directory-picker-browse/README.zh.md) 表面。两个表面填充相同的 slot,因此切换只是组合改动,而非代码改动。
|
|
@@ -73,8 +75,9 @@ kind: "package-reference"
|
|
|
73
75
|
|
|
74
76
|
这些限制界定了原生选择器的适用时机。它们是当前包约束,不是通用选择器对比或任务积压。
|
|
75
77
|
|
|
76
|
-
- **无法取消已打开的选择器**——wire
|
|
77
|
-
-
|
|
78
|
+
- **无法取消已打开的选择器**——wire 没有按请求中止的机制,因此已显示在本地的选择器无法从浏览器关闭;被丢弃的结算会被忽略。
|
|
79
|
+
- **仅限本地承载**——Electron 对话框选择本地路径;普通 Web 打开 Host 选择器。远程浏览器与进程内部署使用 `-browse` 组合。平台失败经由持有方的可重试文件夹对话框呈现。
|
|
80
|
+
- **Linux 自动选择**——缺少 zenity 或 kdialog 时,Host 即使在 Desktop 中也选择浏览模式,不使用 Electron 对话框。
|
|
78
81
|
|
|
79
82
|
<a id="dev-note"></a>
|
|
80
83
|
### 开发备注
|
package/lib/client.js
CHANGED
|
@@ -60,7 +60,9 @@ window.__ModuleLoader__.load({
|
|
|
60
60
|
* @param ctx - client root context.
|
|
61
61
|
*/
|
|
62
62
|
function apply(ctx) {
|
|
63
|
-
const
|
|
63
|
+
const desktop = globalThis.__DSH_DIRECTORY_PICKER__;
|
|
64
|
+
const pick = desktop === void 0 ? () => ctx.uiWorkspace.pickDirectory() : () => desktop.pick();
|
|
65
|
+
const injected = () => ({ pick });
|
|
64
66
|
ctx.slots.inject("conversation.hero.workspace.directoryFlow", () => ctx.slots.inject("sidebar.workspaces.directoryFlow", function* () {
|
|
65
67
|
yield ctx.slots.register({
|
|
66
68
|
name: "conversation.hero.workspace.directoryFlow",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { DirectoryFlowOwnerProps } from '@deepseek-ai/dsh-client-ui-workspace/client';
|
|
3
|
-
/** Injected face: the
|
|
3
|
+
/** Injected face: the native chooser call the flow drives (bound in apply's closure). */
|
|
4
4
|
export interface NativeFlowInjected {
|
|
5
|
-
/**
|
|
5
|
+
/** Open the local desktop or Host single-directory chooser. */
|
|
6
6
|
pick: () => Promise<string | null>;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Browser half of the native directory-picker backend: fills ui-workspace's
|
|
3
|
-
* two directory-flow holes with a renderless occupant that answers each
|
|
4
|
-
* `open` by driving `directoryPicker/pick` (the node half's OS chooser) and
|
|
5
|
-
* reporting the one outcome — picked path, cancellation, or failure — back
|
|
6
|
-
* through the owner conversation. Mounting this package therefore composes
|
|
7
|
-
* both sides of the native interaction with one cordis.yml row; no client
|
|
8
|
-
* code branches on a capability kind.
|
|
9
|
-
*/
|
|
1
|
+
/** Native directory flow using the local desktop bridge or the Host's OS chooser. */
|
|
10
2
|
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
11
3
|
/** Required services (cordis fiber inject): the slot registry and workspace UI service. */
|
|
12
4
|
export declare const inject: string[];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-directory-picker-native",
|
|
3
|
-
"description": "Native directory-picker surface: the renderless workspace directory-flow occupant driving the
|
|
4
|
-
"version": "0.1.6-alpha.
|
|
3
|
+
"description": "Native directory-picker surface: the renderless workspace directory-flow occupant driving the local Desktop or Host OS chooser",
|
|
4
|
+
"version": "0.1.6-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -43,9 +43,10 @@
|
|
|
43
43
|
"@types/react": "~18.3.1",
|
|
44
44
|
"react": "^18.2.0",
|
|
45
45
|
"react-dom": "^18.2.0",
|
|
46
|
-
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.6-alpha.
|
|
47
|
-
"@deepseek-ai/
|
|
48
|
-
"@deepseek-ai/dsh-client-ui-workspace": "^0.1.6-alpha.
|
|
46
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.6-alpha.2",
|
|
47
|
+
"@deepseek-ai/dsh-client-test-runtime": "^0.1.6-alpha.2",
|
|
48
|
+
"@deepseek-ai/dsh-client-ui-workspace": "^0.1.6-alpha.2",
|
|
49
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
49
50
|
},
|
|
50
51
|
"files": [
|
|
51
52
|
"lib/index.js",
|