@galaxy-blackhole/blackhole-harness 0.1.8 → 0.1.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galaxy-blackhole/blackhole-harness",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Galaxy Blackhole harness — boot the DSH host with the blackhole profile (lean npm build)",
@@ -74,8 +74,8 @@ function resolveDirectoryPickerBackend(facts) {
74
74
  return "browse";
75
75
  if (facts.ssh)
76
76
  return "browse";
77
- if (facts.platform === "darwin" || facts.platform === "win32")
78
- return "native";
77
+ if (facts.platform === "darwin") return "native";
78
+ if (facts.platform === "win32") return facts.win32Native === true ? "native" : "browse";
79
79
  if (facts.platform !== "linux" || !facts.linuxChooser)
80
80
  return "browse";
81
81
  return present(facts.env.DISPLAY) || present(facts.env.WAYLAND_DISPLAY) ? "native" : "browse";
@@ -111,6 +111,7 @@ async function apply(ctx) {
111
111
  bindHost: bindHostOf(ctx),
112
112
  allowsRemoteAuthorities: allowsRemoteAuthoritiesOf(ctx),
113
113
  platform: process.platform,
114
+ win32Native: process.env.GBH_TAURI_ROOT !== undefined || process.env.GBH_DESKTOP_PORT !== undefined,
114
115
  ssh: launchedThroughSsh(launchEnvironmentOf(ctx)),
115
116
  env: { DISPLAY: process.env.DISPLAY, WAYLAND_DISPLAY: process.env.WAYLAND_DISPLAY },
116
117
  linuxChooser: hasLinuxChooserBinary(process.env.PATH, canExecute)
@@ -125,6 +125,7 @@ export async function apply(ctx: PickerContext): Promise<void> {
125
125
  bindHost: bindHostOf(ctx),
126
126
  allowsRemoteAuthorities: allowsRemoteAuthoritiesOf(ctx),
127
127
  platform: process.platform,
128
+ win32Native: process.env.GBH_TAURI_ROOT !== undefined || process.env.GBH_DESKTOP_PORT !== undefined,
128
129
  ssh: launchedThroughSsh(launchEnvironmentOf(ctx)),
129
130
  env: { DISPLAY: process.env.DISPLAY, WAYLAND_DISPLAY: process.env.WAYLAND_DISPLAY },
130
131
  linuxChooser: hasLinuxChooserBinary(process.env.PATH, canExecute),
@@ -29,6 +29,8 @@ export interface DirectoryPickerHostFacts {
29
29
  env: DirectoryPickerEnv;
30
30
  /** Có binary chọn thư mục (zenity/kdialog) trên PATH hay không; chỉ xét khi platform là linux. */
31
31
  linuxChooser: boolean;
32
+ /** Windows đang chạy trong desktop shell (Tauri) — native dùng koffi; CLI web phải dùng browse. */
33
+ win32Native?: boolean;
32
34
  }
33
35
 
34
36
  /** Một env chỉ tính khi được đặt và không rỗng (export rỗng là "không đặt" theo quy ước shell). */
@@ -84,7 +86,10 @@ export function isLoopbackHost(host: string): boolean {
84
86
  export function resolveDirectoryPickerBackend(facts: DirectoryPickerHostFacts): DirectoryPickerBackendKind {
85
87
  if (facts.allowsRemoteAuthorities || !isLoopbackHost(facts.bindHost)) return "browse";
86
88
  if (facts.ssh) return "browse";
87
- if (facts.platform === "darwin" || facts.platform === "win32") return "native";
89
+ if (facts.platform === "darwin") return "native";
90
+ // 20/11/2026 — Windows CLI web KHÔNG có koffi/COM dialog sẵn (npm 11 chặn install-script của koffi);
91
+ // chọn native sẽ làm workspace picker im lặng biến mất. Chỉ native khi chạy trong Tauri desktop.
92
+ if (facts.platform === "win32") return facts.win32Native === true ? "native" : "browse";
88
93
  if (facts.platform !== "linux" || !facts.linuxChooser) return "browse";
89
94
  return present(facts.env.DISPLAY) || present(facts.env.WAYLAND_DISPLAY) ? "native" : "browse";
90
95
  }