@galaxy-blackhole/blackhole-harness 0.1.6 → 0.1.7

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.
@@ -1615,7 +1615,8 @@ var DEFAULT_FEATURE_BUNDLES = [
1615
1615
  "@galaxy-blackhole/gbh-session-titles-bundle"
1616
1616
  ];
1617
1617
  var APP_PROFILE_BUNDLES = [
1618
- "@galaxy-blackhole/gbh-bundle"
1618
+ "@galaxy-blackhole/gbh-bundle",
1619
+ "@galaxy-blackhole/gbh-client-settings-about"
1619
1620
  ];
1620
1621
  var PNPM_WORKSPACE = `packages:
1621
1622
  - .
@@ -59,6 +59,10 @@ export const APP_PROFILE_BUNDLES: readonly string[] = [
59
59
  // moi thu tra theo id (settings/config/slot/typert) deu truot: "Could not save", thieu dong Permission,
60
60
  // preset cordis do. Bundle cua ta sinh tu 17 tep patch cua stock, giu nguyen id/order/disabled/config.
61
61
  "@galaxy-blackhole/gbh-bundle",
62
+ // 20/11/2026 — tab "Thông tin" (About) trong Settings là bundle riêng; profile cũ migrate từ
63
+ // ~/.galaxy/gbh có thể thiếu, khiến Windows/CLI không có tab này. Đưa vào lõi để ensureProfile
64
+ // reconcile cả hồ sơ đã tồn tại (không xoá bundle người dùng đã tắt).
65
+ "@galaxy-blackhole/gbh-client-settings-about",
62
66
  ];
63
67
 
64
68
  /** What `ensureProfile` did to the app home on this boot. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galaxy-blackhole/blackhole-harness",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
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)",
@@ -394,8 +394,20 @@ var WebServer = class extends Service {
394
394
  const candidates = [];
395
395
  if (process.env.GBH_FRONTEND_DIST) candidates.push(process.env.GBH_FRONTEND_DIST);
396
396
  candidates.push(join(process.cwd(), "node_modules", "@deepseek-ai", "dsh-web-frontend", "dist"));
397
+ // CLI có thể chạy từ Desktop: dò ngược từ entry host (apps/cli/lib/main.js) tới
398
+ // node_modules của cây CLI, nơi npm đặt @deepseek-ai/dsh-web-frontend.
399
+ if (process.argv[1]) {
400
+ let current = dirname(resolve(process.argv[1]));
401
+ for (let depth = 0; depth < 16; depth += 1) {
402
+ candidates.push(join(current, "node_modules", "@deepseek-ai", "dsh-web-frontend", "dist"));
403
+ const parent = dirname(current);
404
+ if (parent === current) break;
405
+ current = parent;
406
+ }
407
+ }
397
408
  try { candidates.push(join(dirname(require.resolve("@deepseek-ai/dsh-web-frontend/package.json")), "dist")); } catch {}
398
409
  const dist = candidates.find((candidate) => existsSync(join(candidate, "index.html")));
410
+ if (dist === void 0) this.ctx.logger.warn("[gbh] frontend dist not found; candidates=" + candidates.join(" | "));
399
411
  if (dist !== void 0) {
400
412
  const rel = pathname === "/" ? "index.html" : pathname.replace(/^\//u, "");
401
413
  const target = join(dist, rel);
@@ -305,8 +305,20 @@ var WebServer = class extends Service {
305
305
  const candidates: string[] = [];
306
306
  if (process.env.GBH_FRONTEND_DIST) candidates.push(process.env.GBH_FRONTEND_DIST);
307
307
  candidates.push(join(process.cwd(), "node_modules", "@deepseek-ai", "dsh-web-frontend", "dist"));
308
+ // CLI có thể chạy từ Desktop: dò ngược từ entry host (apps/cli/lib/main.js) tới
309
+ // node_modules của cây CLI, nơi npm đặt @deepseek-ai/dsh-web-frontend.
310
+ if (process.argv[1]) {
311
+ let current = dirname(resolve(process.argv[1]));
312
+ for (let depth = 0; depth < 16; depth += 1) {
313
+ candidates.push(join(current, "node_modules", "@deepseek-ai", "dsh-web-frontend", "dist"));
314
+ const parent = dirname(current);
315
+ if (parent === current) break;
316
+ current = parent;
317
+ }
318
+ }
308
319
  try { candidates.push(join(dirname(require.resolve("@deepseek-ai/dsh-web-frontend/package.json")), "dist")); } catch {}
309
320
  const dist = candidates.find((candidate) => existsSync(join(candidate, "index.html")));
321
+ if (dist === void 0) this.ctx.logger.warn("[gbh] frontend dist not found; candidates=" + candidates.join(" | "));
310
322
  if (dist !== void 0) {
311
323
  const rel = pathname === "/" ? "index.html" : pathname.replace(/^\//u, "");
312
324
  const target = join(dist, rel);
@@ -19,6 +19,8 @@ function darwinCandidates() {
19
19
  ];
20
20
  }
21
21
  async function resolveCatalog(platform = process.platform, exists = defaultExists) {
22
+ if (platform === "win32")
23
+ return [{ id: "explorer", label: "File Explorer", bundle: "explorer.exe" }];
22
24
  if (platform !== "darwin")
23
25
  return [];
24
26
  const found = [];
@@ -38,6 +40,8 @@ async function defaultExists(path) {
38
40
  }
39
41
  }
40
42
  function openCommand(launcher, path) {
43
+ if (launcher.id === "explorer")
44
+ return { command: "explorer.exe", args: [path] };
41
45
  return { command: "open", args: ["-a", launcher.bundle, path] };
42
46
  }
43
47
 
@@ -8,12 +8,12 @@
8
8
  /**
9
9
  * Ma ung dung trong catalog — dung y 5 id ma oracle phuc vu tren macOS.
10
10
  */
11
- export type OpenInAppId = "finder" | "vscode" | "xcode" | "iterm" | "terminal";
11
+ export type OpenInAppId = "finder" | "explorer" | "vscode" | "xcode" | "iterm" | "terminal";
12
12
 
13
13
  /**
14
14
  * Thu tu id trong catalog (giu nguyen thu tu oracle tra ve: finder, vscode, xcode, iterm, terminal).
15
15
  */
16
- export const OPEN_IN_APP_IDS: readonly OpenInAppId[] = ["finder", "vscode", "xcode", "iterm", "terminal"];
16
+ export const OPEN_IN_APP_IDS: readonly OpenInAppId[] = ["finder", "explorer", "vscode", "xcode", "iterm", "terminal"];
17
17
 
18
18
  /**
19
19
  * Mot muc catalog da resolve: bundle .app ton tai tren may.
@@ -52,6 +52,11 @@ export async function resolveCatalog(
52
52
  platform: string = process.platform,
53
53
  exists: (path: string) => Promise<boolean> = defaultExists,
54
54
  ): Promise<OpenInAppLauncher[]> {
55
+ // 20/11/2026 — Windows cũng phải có "Mở dự án" như macOS. explorer.exe luôn tồn tại trên Windows;
56
+ // trước đây catalog chỉ có macOS nên client nhận [] và ẩn nút Open in app trên Windows.
57
+ if (platform === "win32") {
58
+ return [{ id: "explorer", label: "File Explorer", bundle: "explorer.exe" }];
59
+ }
55
60
  if (platform !== "darwin") return [];
56
61
  const found: OpenInAppLauncher[] = [];
57
62
  for (const candidate of darwinCandidates()) {
@@ -82,5 +87,8 @@ async function defaultExists(path: string): Promise<boolean> {
82
87
  * @returns cap lenh + tham so cho node:child_process.
83
88
  */
84
89
  export function openCommand(launcher: OpenInAppLauncher, path: string): { command: string; args: string[] } {
90
+ if (launcher.id === "explorer") {
91
+ return { command: "explorer.exe", args: [path] };
92
+ }
85
93
  return { command: "open", args: ["-a", launcher.bundle, path] };
86
94
  }