@deepseek-ai/dsh-host-directory-picker-auto 0.1.3-alpha.2 → 0.1.5-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 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/host/directory-picker-auto/README.md
5
- README.md: b4d1c44c84c555f92a42e277571e2f01fc6ae7ee
6
- README.zh.md: 39eeeb0ff8ebec8757be52c9029e6d05688be8f2
5
+ README.md: 49079bba2b0e3597b9a560dd39b394b081b2f904
6
+ README.zh.md: c09dd158db40d697453cd06f48e327d627f4b3fe
package/README.md CHANGED
@@ -29,7 +29,7 @@ Compose this plugin instead of a concrete backend when the same composition must
29
29
 
30
30
  ### How the choice is made
31
31
 
32
- `native` requires every signal that the operator can see the host display and the native backend can serve it: a loopback-only bind (read from the injected `webServer`; an all-interfaces bind admits remote browsers no OS chooser can reach), no SSH launch (`SSH_CONNECTION`/`SSH_TTY` unset or blank), and a servable display session — assumed on darwin and win32; on linux, `DISPLAY`/`WAYLAND_DISPLAY` plus a zenity or kdialog binary on `PATH`; never on any other platform. Anything ambiguous resolves to `browse`, which works everywhere.
32
+ `native` requires every signal that the operator can see the host display and the native backend can serve it: a loopback-only bind (read from the injected `webServer`; an all-interfaces bind admits remote browsers no OS chooser can reach), no SSH launch (the shared [launch-environment](../../util/launch-environment/README.md) predicate ignores project/user `.env` values and checks only inherited non-empty `SSH_CONNECTION`/`SSH_TTY`), and a servable display session — assumed on darwin and win32; on linux, `DISPLAY`/`WAYLAND_DISPLAY` plus a zenity or kdialog binary on `PATH`; never on any other platform. Anything ambiguous resolves to `browse`, which works everywhere.
33
33
 
34
34
  ### What you get
35
35
 
package/README.zh.md CHANGED
@@ -29,7 +29,7 @@ kind: "package-reference"
29
29
 
30
30
  ### 选择是如何作出的
31
31
 
32
- `native` 要求「操作者看得到宿主屏幕、且原生后端能服务它」的全部信号:仅回环的绑定(从注入的 `webServer` 读取;全网卡绑定会接入任何 OS 选择器都触及不到的远程浏览器);非 SSH 启动(`SSH_CONNECTION`/`SSH_TTY` 未设置或为空);以及可服务的显示会话——darwin 与 win32 上视为存在;linux 上要求 `DISPLAY`/`WAYLAND_DISPLAY`,外加 `PATH` 上有 zenity 或 kdialog 二进制;其余任何平台上都不成立。任何含糊情形都判定为处处可用的 `browse`。
32
+ `native` 要求「操作者看得到宿主屏幕、且原生后端能服务它」的全部信号:仅回环的绑定(从注入的 `webServer` 读取;全网卡绑定会接入任何 OS 选择器都触及不到的远程浏览器);非 SSH 启动(共用的 [launch-environment](../../util/launch-environment/README.zh.md) 判断忽略项目与用户 `.env` 中的值,只检查继承的非空 `SSH_CONNECTION`/`SSH_TTY`);以及可服务的显示会话——darwin 与 win32 上视为存在;linux 上要求 `DISPLAY`/`WAYLAND_DISPLAY`,外加 `PATH` 上有 zenity 或 kdialog 二进制;其余任何平台上都不成立。任何含糊情形都判定为处处可用的 `browse`。
33
33
 
34
34
  ### 你会得到什么
35
35
 
package/lib/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { launchEnvironmentOf, launchedThroughSsh } from "@deepseek-ai/dsh-launch-environment";
1
2
  import { accessSync, constants } from "node:fs";
2
3
  import { delimiter, join } from "node:path";
3
4
  //#region lib/types/probe.js
@@ -62,7 +63,7 @@ const present = (value) => value !== void 0 && value !== "";
62
63
  */
63
64
  function resolveDirectoryPickerBackend(facts) {
64
65
  if (facts.bindHost !== "127.0.0.1") return "browse";
65
- if (present(facts.env.SSH_CONNECTION) || present(facts.env.SSH_TTY)) return "browse";
66
+ if (facts.ssh) return "browse";
66
67
  if (facts.platform === "darwin" || facts.platform === "win32") return "native";
67
68
  if (facts.platform !== "linux" || !facts.linuxChooser) return "browse";
68
69
  return present(facts.env.DISPLAY) || present(facts.env.WAYLAND_DISPLAY) ? "native" : "browse";
@@ -117,6 +118,7 @@ async function apply(ctx) {
117
118
  const backend = resolveDirectoryPickerBackend({
118
119
  bindHost: ctx.webServer.host,
119
120
  platform: process.platform,
121
+ ssh: launchedThroughSsh(launchEnvironmentOf(ctx)),
120
122
  env: process.env,
121
123
  linuxChooser: hasLinuxChooserBinary(process.env.PATH, canExecute)
122
124
  });
@@ -9,14 +9,16 @@ import type { Config as HttpServerConfig } from '@deepseek-ai/dsh-host-webserver
9
9
  /** Concrete interaction backend the resolver chooses between. */
10
10
  export type DirectoryPickerBackendKind = 'native' | 'browse';
11
11
  /** Environment keys the resolution reads (a `process.env` subset). */
12
- export type DirectoryPickerEnv = Readonly<Partial<Record<'SSH_CONNECTION' | 'SSH_TTY' | 'DISPLAY' | 'WAYLAND_DISPLAY', string>>>;
12
+ export type DirectoryPickerEnv = Readonly<Partial<Record<'DISPLAY' | 'WAYLAND_DISPLAY', string>>>;
13
13
  /** Host facts the backend choice is a pure function of, sampled once at boot. */
14
14
  export interface DirectoryPickerHostFacts {
15
15
  /** Effective webserver bind host (the schema's closed loopback/all-interfaces union). */
16
16
  bindHost: HttpServerConfig['host'];
17
17
  /** Host process platform. */
18
18
  platform: NodeJS.Platform;
19
- /** Environment sample; SSH marks a remote operator, DISPLAY/WAYLAND_DISPLAY a Linux display. */
19
+ /** SSH launch fact from the inherited process layer, independent of `.env` values. */
20
+ ssh: boolean;
21
+ /** Environment sample; DISPLAY/WAYLAND_DISPLAY marks a Linux display. */
20
22
  env: DirectoryPickerEnv;
21
23
  /** Whether a Linux chooser binary the native backend can drive (zenity/kdialog) is on PATH; consulted only when `platform` is linux. */
22
24
  linuxChooser: boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-host-directory-picker-auto",
3
3
  "description": "Adaptive chooser of the directory-picker seam: resolves the host situation at boot and mounts the native or browse backend for the DeepSeek Harness web GUI host",
4
- "version": "0.1.3-alpha.2",
4
+ "version": "0.1.5-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -29,21 +29,24 @@
29
29
  "peerDependencies": {
30
30
  "@deepseek-ai/cordis": "^4.0.2",
31
31
  "@deepseek-ai/cordis-plugin-loader": "^1.0.3",
32
- "@deepseek-ai/dsh-client-ui-directory-picker-browse": "^0.1.3-alpha.2",
33
- "@deepseek-ai/dsh-client-ui-directory-picker-native": "^0.1.3-alpha.2",
34
- "@deepseek-ai/dsh-host-directory-picker-browse": "^0.1.3-alpha.2",
35
- "@deepseek-ai/dsh-host-directory-picker-native": "^0.1.3-alpha.2",
36
- "@deepseek-ai/dsh-host-webserver": "^0.1.3-alpha.2"
32
+ "@deepseek-ai/dsh-client-ui-directory-picker-browse": "^0.1.5-alpha.2",
33
+ "@deepseek-ai/dsh-client-ui-directory-picker-native": "^0.1.5-alpha.2",
34
+ "@deepseek-ai/dsh-host-directory-picker-browse": "^0.1.5-alpha.2",
35
+ "@deepseek-ai/dsh-host-webserver": "^0.1.5-alpha.2",
36
+ "@deepseek-ai/dsh-host-directory-picker-native": "^0.1.5-alpha.2"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@deepseek-ai/cordis": "^4.0.2",
40
40
  "@deepseek-ai/cordis-plugin-include": "^1.0.7",
41
41
  "@deepseek-ai/cordis-plugin-loader": "^1.0.3",
42
- "@deepseek-ai/dsh-client-ui-directory-picker-native": "^0.1.3-alpha.2",
43
- "@deepseek-ai/dsh-client-ui-directory-picker-browse": "^0.1.3-alpha.2",
44
- "@deepseek-ai/dsh-host-directory-picker": "^0.1.3-alpha.2",
45
- "@deepseek-ai/dsh-host-directory-picker-native": "^0.1.3-alpha.2",
46
- "@deepseek-ai/dsh-host-webserver": "^0.1.3-alpha.2",
47
- "@deepseek-ai/dsh-host-directory-picker-browse": "^0.1.3-alpha.2"
42
+ "@deepseek-ai/dsh-client-ui-directory-picker-browse": "^0.1.5-alpha.2",
43
+ "@deepseek-ai/dsh-client-ui-directory-picker-native": "^0.1.5-alpha.2",
44
+ "@deepseek-ai/dsh-host-directory-picker": "^0.1.5-alpha.2",
45
+ "@deepseek-ai/dsh-host-directory-picker-browse": "^0.1.5-alpha.2",
46
+ "@deepseek-ai/dsh-host-directory-picker-native": "^0.1.5-alpha.2",
47
+ "@deepseek-ai/dsh-host-webserver": "^0.1.5-alpha.2"
48
+ },
49
+ "dependencies": {
50
+ "@deepseek-ai/dsh-launch-environment": "^0.1.5-alpha.2"
48
51
  }
49
52
  }