@galaxy-stack/blackhole-cli 2.4.0 → 3.0.1
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.md +82 -47
- package/dist/application.d.ts.map +1 -1
- package/dist/application.js +13 -2
- package/dist/application.js.map +1 -1
- package/dist/cli-meta.d.ts +8 -0
- package/dist/cli-meta.d.ts.map +1 -1
- package/dist/cli-meta.js +11 -0
- package/dist/cli-meta.js.map +1 -1
- package/dist/cli.js +26 -9
- package/dist/cli.js.map +1 -1
- package/dist/config-command.d.ts +11 -14
- package/dist/config-command.d.ts.map +1 -1
- package/dist/config-command.js +41 -118
- package/dist/config-command.js.map +1 -1
- package/dist/doctor.d.ts +8 -2
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +11 -15
- package/dist/doctor.js.map +1 -1
- package/dist/file-index.d.ts +50 -0
- package/dist/file-index.d.ts.map +1 -1
- package/dist/file-index.js +124 -0
- package/dist/file-index.js.map +1 -1
- package/dist/harness/boot.d.ts +87 -0
- package/dist/harness/boot.d.ts.map +1 -0
- package/dist/harness/boot.js +111 -0
- package/dist/harness/boot.js.map +1 -0
- package/dist/harness/catalogs.d.ts +50 -0
- package/dist/harness/catalogs.d.ts.map +1 -0
- package/dist/harness/catalogs.js +34 -0
- package/dist/harness/catalogs.js.map +1 -0
- package/dist/harness/chat.d.ts +90 -0
- package/dist/harness/chat.d.ts.map +1 -0
- package/dist/harness/chat.js +260 -0
- package/dist/harness/chat.js.map +1 -0
- package/dist/harness/client.d.ts +72 -0
- package/dist/harness/client.d.ts.map +1 -0
- package/dist/harness/client.js +173 -0
- package/dist/harness/client.js.map +1 -0
- package/dist/harness/command.d.ts +22 -0
- package/dist/harness/command.d.ts.map +1 -0
- package/dist/harness/command.js +142 -0
- package/dist/harness/command.js.map +1 -0
- package/dist/harness/composer.d.ts +46 -0
- package/dist/harness/composer.d.ts.map +1 -0
- package/dist/harness/composer.js +127 -0
- package/dist/harness/composer.js.map +1 -0
- package/dist/harness/conversation.d.ts +75 -0
- package/dist/harness/conversation.d.ts.map +1 -0
- package/dist/harness/conversation.js +196 -0
- package/dist/harness/conversation.js.map +1 -0
- package/dist/harness/help.d.ts +56 -0
- package/dist/harness/help.d.ts.map +1 -0
- package/dist/harness/help.js +85 -0
- package/dist/harness/help.js.map +1 -0
- package/dist/harness/history.d.ts +108 -0
- package/dist/harness/history.d.ts.map +1 -0
- package/dist/harness/history.js +268 -0
- package/dist/harness/history.js.map +1 -0
- package/dist/harness/labels.d.ts +164 -0
- package/dist/harness/labels.d.ts.map +1 -0
- package/dist/harness/labels.js +271 -0
- package/dist/harness/labels.js.map +1 -0
- package/dist/harness/locate.d.ts +28 -0
- package/dist/harness/locate.d.ts.map +1 -0
- package/dist/harness/locate.js +73 -0
- package/dist/harness/locate.js.map +1 -0
- package/dist/harness/menus.d.ts +74 -0
- package/dist/harness/menus.d.ts.map +1 -0
- package/dist/harness/menus.js +140 -0
- package/dist/harness/menus.js.map +1 -0
- package/dist/harness/model-name.d.ts +73 -0
- package/dist/harness/model-name.d.ts.map +1 -0
- package/dist/harness/model-name.js +101 -0
- package/dist/harness/model-name.js.map +1 -0
- package/dist/harness/node-runtime.d.ts +64 -0
- package/dist/harness/node-runtime.d.ts.map +1 -0
- package/dist/harness/node-runtime.js +109 -0
- package/dist/harness/node-runtime.js.map +1 -0
- package/dist/harness/parts.d.ts +239 -0
- package/dist/harness/parts.d.ts.map +1 -0
- package/dist/harness/parts.js +266 -0
- package/dist/harness/parts.js.map +1 -0
- package/dist/harness/preset.d.ts +124 -0
- package/dist/harness/preset.d.ts.map +1 -0
- package/dist/harness/preset.js +197 -0
- package/dist/harness/preset.js.map +1 -0
- package/dist/harness/process.d.ts +55 -0
- package/dist/harness/process.d.ts.map +1 -0
- package/dist/harness/process.js +124 -0
- package/dist/harness/process.js.map +1 -0
- package/dist/harness/screen.d.ts +33 -0
- package/dist/harness/screen.d.ts.map +1 -0
- package/dist/harness/screen.js +1070 -0
- package/dist/harness/screen.js.map +1 -0
- package/dist/harness/sessions.d.ts +55 -0
- package/dist/harness/sessions.d.ts.map +1 -0
- package/dist/harness/sessions.js +92 -0
- package/dist/harness/sessions.js.map +1 -0
- package/dist/harness/skills.d.ts +90 -0
- package/dist/harness/skills.d.ts.map +1 -0
- package/dist/harness/skills.js +133 -0
- package/dist/harness/skills.js.map +1 -0
- package/dist/harness/slash-palette.d.ts +32 -0
- package/dist/harness/slash-palette.d.ts.map +1 -0
- package/dist/harness/slash-palette.js +48 -0
- package/dist/harness/slash-palette.js.map +1 -0
- package/dist/harness/slash.d.ts +113 -0
- package/dist/harness/slash.d.ts.map +1 -0
- package/dist/harness/slash.js +187 -0
- package/dist/harness/slash.js.map +1 -0
- package/dist/harness/trajectory.d.ts +74 -0
- package/dist/harness/trajectory.d.ts.map +1 -0
- package/dist/harness/trajectory.js +270 -0
- package/dist/harness/trajectory.js.map +1 -0
- package/dist/harness/tui.d.ts +28 -0
- package/dist/harness/tui.d.ts.map +1 -0
- package/dist/harness/tui.js +143 -0
- package/dist/harness/tui.js.map +1 -0
- package/dist/manual-config.d.ts +23 -10
- package/dist/manual-config.d.ts.map +1 -1
- package/dist/manual-config.js +45 -37
- package/dist/manual-config.js.map +1 -1
- package/dist/migrate.d.ts +32 -0
- package/dist/migrate.d.ts.map +1 -0
- package/dist/migrate.js +155 -0
- package/dist/migrate.js.map +1 -0
- package/dist/options.d.ts +5 -1
- package/dist/options.d.ts.map +1 -1
- package/dist/options.js +23 -4
- package/dist/options.js.map +1 -1
- package/dist/setup.d.ts +14 -10
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +25 -92
- package/dist/setup.js.map +1 -1
- package/dist/timeline.d.ts.map +1 -1
- package/dist/timeline.js +11 -0
- package/dist/timeline.js.map +1 -1
- package/dist/web/command.d.ts +5 -1
- package/dist/web/command.d.ts.map +1 -1
- package/dist/web/command.js +34 -6
- package/dist/web/command.js.map +1 -1
- package/dist/web/credentials.d.ts +7 -5
- package/dist/web/credentials.d.ts.map +1 -1
- package/dist/web/credentials.js +13 -48
- package/dist/web/credentials.js.map +1 -1
- package/dist/web/doctor.d.ts +1 -1
- package/dist/web/doctor.d.ts.map +1 -1
- package/dist/web/doctor.js +49 -61
- package/dist/web/doctor.js.map +1 -1
- package/dist/web/options.d.ts +26 -2
- package/dist/web/options.d.ts.map +1 -1
- package/dist/web/options.js +54 -18
- package/dist/web/options.js.map +1 -1
- package/dist/web/paths.d.ts +1 -1
- package/dist/web/paths.d.ts.map +1 -1
- package/dist/web/paths.js +2 -2
- package/dist/web/paths.js.map +1 -1
- package/dist/web/web.d.ts +56 -16
- package/dist/web/web.d.ts.map +1 -1
- package/dist/web/web.js +184 -168
- package/dist/web/web.js.map +1 -1
- package/package.json +4 -3
- package/web/brand/lib/client.js +4 -4
- package/web/patches/gbh-ui.patch.yml +6 -24
package/dist/web/web.js
CHANGED
|
@@ -1,209 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `blackhole web`: open the Galaxy Blackhole web GUI.
|
|
3
|
+
*
|
|
4
|
+
* The GUI is the blackhole-tauri harness (the same app the desktop shell loads),
|
|
5
|
+
* not the legacy in-process DSH build this package used to bundle. The launcher
|
|
6
|
+
* prints one authenticated URL; that URL is what this command opens, and its
|
|
7
|
+
* token must be exchanged by a navigation before any request is trusted.
|
|
8
|
+
*/
|
|
1
9
|
import { spawn } from "node:child_process";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
10
|
+
import { createServer } from "node:net";
|
|
11
|
+
import { homedir } from "node:os";
|
|
12
|
+
import { join } from "node:path";
|
|
13
|
+
import { findTauriRoot, systemLocateEnvironment } from "../harness/locate.js";
|
|
14
|
+
import { resolveNodeRuntime, systemNodeLookup } from "../harness/node-runtime.js";
|
|
15
|
+
import { BOOT_PHASES, bootPhaseFor, createBootReporter } from "../harness/boot.js";
|
|
16
|
+
import { resolveGalaxyKey } from "./credentials.js";
|
|
17
|
+
import { promoteLegacyCredential } from "../config-command.js";
|
|
7
18
|
import { galaxyCredentialsPath } from "@galaxy-stack/ai-coder-core/adapters/node/config/galaxy-credentials";
|
|
8
19
|
import { openUrl } from "./open-browser.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return JSON.stringify(value);
|
|
12
|
-
}
|
|
20
|
+
/** The URL the launcher prints once the harness serves. */
|
|
21
|
+
const READY_URL = /https?:\/\/127\.0\.0\.1:\d+\/\?token=[A-Za-z0-9._~+/=-]+/u;
|
|
13
22
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* documents/GALAXY_CREDENTIALS_SETTINGS_SYNC_PLAN.md), so the web GUI resolves the
|
|
19
|
-
* same references the CLI and the extension write. An explicit path beats the
|
|
20
|
-
* computed one, which keeps tests and relocated homes working.
|
|
23
|
+
* The line a busy FIXED port prints. A fixed default only earns its keep if a collision is stated
|
|
24
|
+
* out loud: silence would send the user to a URL nobody printed.
|
|
25
|
+
* @param port - the port that could not be bound.
|
|
26
|
+
* @returns one sentence with both ways out.
|
|
21
27
|
*/
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
rows.push("# Galaxy credentials: one shared document for the desktop app, the CLI, the extension, and this GUI.");
|
|
25
|
-
rows.push("- id: credentials");
|
|
26
|
-
rows.push(" config:");
|
|
27
|
-
rows.push(" path: " + yamlScalar(process.env.GALAXY_CREDENTIALS_PATH ?? galaxyCredentialsPath()));
|
|
28
|
-
rows.push("");
|
|
29
|
-
if (options.model !== undefined) {
|
|
30
|
-
rows.push("- id: agent-default-model");
|
|
31
|
-
rows.push(" config:");
|
|
32
|
-
rows.push(" provider: galaxy");
|
|
33
|
-
rows.push(" model: " + yamlScalar(options.model));
|
|
34
|
-
}
|
|
35
|
-
if (options.preset !== undefined) {
|
|
36
|
-
rows.push("- id: agent-preset-registry");
|
|
37
|
-
rows.push(" config:");
|
|
38
|
-
rows.push(" default: " + yamlScalar(options.preset));
|
|
39
|
-
}
|
|
40
|
-
mkdirSync(home, { recursive: true });
|
|
41
|
-
const path = overlayPath(home);
|
|
42
|
-
writeFileSync(path, rows.join("\n") + "\n", "utf8");
|
|
43
|
-
return path;
|
|
28
|
+
export function busyPortMessage(port) {
|
|
29
|
+
return "cổng " + String(port) + " đang bận — dùng --port <cổng khác>, hoặc --port 0 để lấy cổng ngẫu nhiên.";
|
|
44
30
|
}
|
|
45
31
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* code thought the slot was free, tried to create it, and collided with the thing it could not see.
|
|
32
|
+
* Probes whether this process could bind the port right now.
|
|
33
|
+
* @param port - the TCP port to try; 0 always counts as free because the OS picks one.
|
|
34
|
+
* @param host - bind host; the harness is loopback-only, so the probe is too.
|
|
35
|
+
* @returns true when the port is free.
|
|
51
36
|
*/
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
37
|
+
export function isPortFree(port, host = "127.0.0.1") {
|
|
38
|
+
if (port === 0)
|
|
39
|
+
return Promise.resolve(true);
|
|
40
|
+
return new Promise((resolveProbe) => {
|
|
41
|
+
const probe = createServer();
|
|
42
|
+
probe.once("error", () => {
|
|
43
|
+
probe.close();
|
|
44
|
+
resolveProbe(false);
|
|
45
|
+
});
|
|
46
|
+
probe.once("listening", () => {
|
|
47
|
+
probe.close(() => resolveProbe(true));
|
|
48
|
+
});
|
|
49
|
+
probe.listen(port, host);
|
|
50
|
+
});
|
|
65
51
|
}
|
|
66
|
-
/** Link the gbh brand client package into the profile node_modules (best effort). */
|
|
67
52
|
/**
|
|
68
|
-
*
|
|
53
|
+
* Plan the harness boot.
|
|
69
54
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
55
|
+
* The launcher is a Node program, so the runtime is Node — never Bun: a machine that installed this
|
|
56
|
+
* CLI already has Node, and the harness kernel refuses anything below Node 26 anyway. Bun is only a
|
|
57
|
+
* build-time tool of the desktop checkout (it bundles the client plugins), never a boot dependency.
|
|
58
|
+
* @param options - parsed command options.
|
|
59
|
+
* @param environment - checkout, PATH and Node facts; defaults to this machine.
|
|
60
|
+
* @returns everything the spawn needs.
|
|
61
|
+
* @throws with an actionable message when Node >= 26 or the checkout is missing.
|
|
73
62
|
*/
|
|
74
|
-
export function
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (existsAsEntry(link) && !alreadyLinked())
|
|
89
|
-
rmSync(link, { force: true, recursive: true });
|
|
90
|
-
if (existsAsEntry(link))
|
|
91
|
-
return link;
|
|
92
|
-
try {
|
|
93
|
-
symlinkSync(target, link, process.platform === "win32" ? "junction" : "dir");
|
|
94
|
-
return link;
|
|
95
|
-
}
|
|
96
|
-
catch {
|
|
97
|
-
cpSync(target, link, { recursive: true, dereference: true });
|
|
98
|
-
return link;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
102
|
-
/*
|
|
103
|
-
* A skin that cannot be installed must say why: silence here once cost an afternoon of guessing why the interface
|
|
104
|
-
* was not ours.
|
|
105
|
-
*/
|
|
106
|
-
process.stderr.write("galaxy web: cannot link the brand into " + dir + ": " + (error instanceof Error ? error.message : String(error)) + "\n");
|
|
107
|
-
return undefined;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
/** Resolve the DSH command, patch list, and environment for gbh web. */
|
|
111
|
-
export function planWeb(options) {
|
|
112
|
-
const runtime = resolveDsh();
|
|
113
|
-
const home = options.home !== undefined ? options.home : defaultHome();
|
|
114
|
-
const patches = [bundledPatchPath(), uiPatchPath()];
|
|
115
|
-
if (options.brand) {
|
|
116
|
-
if (ensureBrandLink(home) === undefined) {
|
|
117
|
-
/* The skin is cosmetic: a browser with the plain UI beats a server that never starts. */
|
|
118
|
-
process.stderr.write("galaxy web: brand plugin unavailable; starting without the branded skin.\n");
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
patches.push(brandPatchPath());
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
patches.push(writeOverlay(options, home));
|
|
125
|
-
for (const extra of options.patches)
|
|
126
|
-
patches.push(resolve(extra));
|
|
127
|
-
const args = [...runtime.baseArgs, "--profile", options.profile];
|
|
128
|
-
for (const patch of patches)
|
|
63
|
+
export function planWeb(options, environment = { locate: systemLocateEnvironment(), nodes: systemNodeLookup() }) {
|
|
64
|
+
const root = findTauriRoot(environment.locate);
|
|
65
|
+
if (root === undefined)
|
|
66
|
+
throw new Error("Không tìm thấy blackhole-tauri. Đặt GBH_TAURI_ROOT tới bản checkout của nó.");
|
|
67
|
+
// Throws with the requirement, the fix and every binary it refused — no silent exit.
|
|
68
|
+
const node = resolveNodeRuntime(environment.nodes);
|
|
69
|
+
const home = options.home ?? ((process.env.GBH_HOME ?? "").trim() || join(homedir(), ".galaxy", "blackhole"));
|
|
70
|
+
// ONE port, the one the caller asked for. `--auto-port` is deliberately NOT passed: it is what made
|
|
71
|
+
// the printed URL change on every boot, and a fixed default is only fixed if a busy port fails loudly
|
|
72
|
+
// instead of sliding to a random one. `--port 0` still means "OS picks", which is the opt-in path.
|
|
73
|
+
const args = [join(root, "apps", "cli", "src", "main.ts"), "host", "--port", String(options.port)];
|
|
74
|
+
if (options.profile !== undefined && options.profile.length > 0)
|
|
75
|
+
args.push("--profile", options.profile);
|
|
76
|
+
for (const patch of options.patches)
|
|
129
77
|
args.push("--patch", patch);
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
return {
|
|
140
|
-
command: runtime.command,
|
|
141
|
-
args,
|
|
78
|
+
// GBH_NODE pins the same runtime for the launcher's own kernel lookup, so the version printed by
|
|
79
|
+
// --dry-run is the version that boots the harness.
|
|
80
|
+
const env = { ...process.env, GBH_HOME: home, GBH_NODE: node.bin };
|
|
81
|
+
// GBH_CREDENTIALS moves the shared document for the harness; read the same file here.
|
|
82
|
+
const credentials = (process.env.GBH_CREDENTIALS ?? "").trim() || galaxyCredentialsPath();
|
|
83
|
+
const key = resolveGalaxyKey(env, credentials);
|
|
84
|
+
return Object.freeze({
|
|
85
|
+
command: node.bin,
|
|
86
|
+
args: Object.freeze(args),
|
|
142
87
|
env,
|
|
143
|
-
patches,
|
|
144
88
|
home,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
89
|
+
root,
|
|
90
|
+
source: "blackhole-tauri " + root,
|
|
91
|
+
nodeVersion: node.version,
|
|
92
|
+
nodeSource: node.source,
|
|
93
|
+
...(key === undefined ? {} : { keySource: key.source }),
|
|
94
|
+
});
|
|
148
95
|
}
|
|
149
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* Boot the Galaxy Blackhole web GUI and open its authenticated URL.
|
|
98
|
+
* @param options - parsed command options.
|
|
99
|
+
* @returns the launcher exit code.
|
|
100
|
+
*/
|
|
150
101
|
export async function runWeb(options) {
|
|
151
|
-
|
|
102
|
+
let plan;
|
|
103
|
+
try {
|
|
104
|
+
// The harness reads the shared document only; a key left in the legacy DSH store is promoted
|
|
105
|
+
// once before boot. A dry run never writes.
|
|
106
|
+
if (!options.dryRun)
|
|
107
|
+
promoteLegacyCredential();
|
|
108
|
+
plan = planWeb(options);
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
process.stderr.write("blackhole web: " + (error instanceof Error ? error.message : String(error)) + "\n");
|
|
112
|
+
return 1;
|
|
113
|
+
}
|
|
152
114
|
if (options.dryRun) {
|
|
153
115
|
process.stdout.write("cwd: " + process.cwd() + "\n");
|
|
154
|
-
process.stdout.write("
|
|
155
|
-
process.stdout.write("
|
|
156
|
-
process.stdout.write("
|
|
157
|
-
process.stdout.write("
|
|
158
|
-
|
|
159
|
-
process.stdout.write(" " + patch + "\n");
|
|
160
|
-
process.stdout.write(shellQuote(plan.command) + " " + plan.args.map(shellQuote).join(" ") + "\n");
|
|
116
|
+
process.stdout.write("GBH_HOME=" + plan.home + "\n");
|
|
117
|
+
process.stdout.write("harness: " + plan.source + "\n");
|
|
118
|
+
process.stdout.write("node: " + plan.nodeVersion + " (" + plan.command + ", " + plan.nodeSource + ")\n");
|
|
119
|
+
process.stdout.write("galaxy key: " + (plan.keySource === undefined ? "NOT SET (hộp thoại GBH sẽ hỏi)" : "set via " + plan.keySource) + "\n");
|
|
120
|
+
process.stdout.write([plan.command, ...plan.args].map(value => JSON.stringify(value)).join(" ") + "\n");
|
|
161
121
|
return 0;
|
|
162
122
|
}
|
|
123
|
+
if (options.brand === false) {
|
|
124
|
+
process.stderr.write("blackhole web: giao diện Galaxy Blackhole là mặc định của harness; --no-brand không còn tác dụng.\n");
|
|
125
|
+
}
|
|
163
126
|
if (plan.keySource === undefined) {
|
|
164
|
-
process.stderr.write("
|
|
165
|
-
"The Galaxy Blackhole dialog will ask for it on first load and store it there.\n");
|
|
127
|
+
process.stderr.write("blackhole web: chưa có API key trong ~/.galaxy/credentials.yaml hoặc biến môi trường; hộp thoại của app sẽ hỏi ở lần mở đầu.\n");
|
|
166
128
|
}
|
|
167
|
-
|
|
129
|
+
// The harness exits with "port busy" on its own, but that line is swallowed with the rest of its log
|
|
130
|
+
// when --verbose is off — the user would just see nothing. Ask here, so the answer names the port and
|
|
131
|
+
// both ways out. 0 is exempt: the OS hands out a free port.
|
|
132
|
+
if (!(await isPortFree(options.port))) {
|
|
133
|
+
process.stderr.write("blackhole web: " + busyPortMessage(options.port) + "\n");
|
|
134
|
+
return 1;
|
|
135
|
+
}
|
|
136
|
+
// One line of outcome, and only that line: the harness's own log (inspector devtools URL, plugin
|
|
137
|
+
// probes, mount notes) is noise for someone who just wants the GUI. --verbose or GBH_LOG=debug
|
|
138
|
+
// relays it, relabelled gbh.
|
|
139
|
+
const verbose = options.verbose || (process.env.GBH_LOG ?? "").trim().toLowerCase() === "debug";
|
|
140
|
+
const boot = verbose ? undefined : createBootReporter(process.stdout, BOOT_PHASES[0].label);
|
|
141
|
+
let phaseIndex = 0;
|
|
142
|
+
const advance = (phase) => {
|
|
143
|
+
if (phase === undefined)
|
|
144
|
+
return;
|
|
145
|
+
const index = BOOT_PHASES.findIndex(entry => entry.id === phase.id);
|
|
146
|
+
if (index <= phaseIndex)
|
|
147
|
+
return;
|
|
148
|
+
phaseIndex = index;
|
|
149
|
+
boot?.step(phase.label);
|
|
150
|
+
};
|
|
151
|
+
const child = spawn(plan.command, [...plan.args], { cwd: process.cwd(), env: plan.env, stdio: ["ignore", "pipe", "pipe"] });
|
|
168
152
|
let seen = "";
|
|
169
|
-
let
|
|
170
|
-
|
|
171
|
-
|
|
153
|
+
let settled = false;
|
|
154
|
+
/** Relay one launcher line, reading the harness's stock prefixes as gbh. */
|
|
155
|
+
const relayLine = (line, sink) => {
|
|
156
|
+
sink.write(line.replace(/^dsh (?=web:|inspector:|\b)/u, "gbh ").replace(/^\[bh\] ready /u, "gbh ready ") + "\n");
|
|
157
|
+
};
|
|
158
|
+
/** Fold one complete line into the boot: progress, optional relay, and the ready URL. */
|
|
159
|
+
const handleLine = (line, sink) => {
|
|
160
|
+
seen = (seen + line + "\n").slice(-16384);
|
|
161
|
+
advance(bootPhaseFor(line));
|
|
162
|
+
// The ready line is printed once, below, as this command's own result: relaying the host's copy
|
|
163
|
+
// as well would print the same URL twice under --verbose.
|
|
164
|
+
if (sink !== undefined && !READY_URL.test(line))
|
|
165
|
+
relayLine(line, sink);
|
|
166
|
+
if (settled)
|
|
172
167
|
return;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
168
|
+
const match = READY_URL.exec(seen);
|
|
169
|
+
if (match === null)
|
|
170
|
+
return;
|
|
171
|
+
settled = true;
|
|
172
|
+
boot?.clear();
|
|
173
|
+
// The token is the point of this line: it is the only way into this boot's session.
|
|
174
|
+
process.stdout.write("gbh web: " + match[0] + "\n");
|
|
175
|
+
if (options.open)
|
|
176
|
+
openUrl(match[0]);
|
|
177
|
+
};
|
|
178
|
+
/** A chunk reader that only ever hands complete lines to handleLine. */
|
|
179
|
+
const reader = (sink) => {
|
|
180
|
+
let buffer = "";
|
|
181
|
+
return (chunk) => {
|
|
182
|
+
buffer += chunk;
|
|
183
|
+
const lines = buffer.split(/\r?\n/u);
|
|
184
|
+
buffer = lines.pop() ?? "";
|
|
185
|
+
for (const line of lines)
|
|
186
|
+
handleLine(line, sink);
|
|
187
|
+
};
|
|
179
188
|
};
|
|
180
189
|
child.stdout?.setEncoding("utf8");
|
|
181
|
-
child.stdout?.on("data", (
|
|
182
|
-
process.stdout.write(chunk);
|
|
183
|
-
scan(chunk);
|
|
184
|
-
});
|
|
190
|
+
child.stdout?.on("data", reader(verbose ? process.stdout : undefined));
|
|
185
191
|
child.stderr?.setEncoding("utf8");
|
|
186
|
-
child.stderr?.on("data", (
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
child.kill("SIGTERM");
|
|
192
|
-
};
|
|
193
|
-
process.on("SIGTERM", onSigterm);
|
|
194
|
-
const code = await new Promise((resolvePromise) => {
|
|
192
|
+
child.stderr?.on("data", reader(verbose ? process.stderr : undefined));
|
|
193
|
+
const onTerm = () => { if (!child.killed)
|
|
194
|
+
child.kill("SIGTERM"); };
|
|
195
|
+
process.on("SIGTERM", onTerm);
|
|
196
|
+
const code = await new Promise(resolvePromise => {
|
|
195
197
|
child.on("error", (error) => {
|
|
196
|
-
process.stderr.write("
|
|
198
|
+
process.stderr.write("blackhole web: không chạy được " + plan.command + ": " + error.message + "\n");
|
|
197
199
|
resolvePromise(1);
|
|
198
200
|
});
|
|
199
201
|
child.on("close", (exitCode, signal) => {
|
|
202
|
+
// Exit 3 is the host's "port busy" (apps/cli/src/main.ts EXIT.portBusy). Its own line was
|
|
203
|
+
// swallowed above, so the one port the user asked for is named again here — the race between the
|
|
204
|
+
// probe and the bind is exactly the case this covers.
|
|
205
|
+
if (exitCode === 3 && !settled)
|
|
206
|
+
process.stderr.write("blackhole web: " + busyPortMessage(options.port) + "\n");
|
|
207
|
+
// A boot that dies before printing a URL must never be silent: the launcher's last lines are the
|
|
208
|
+
// only place that names the cause (no Node >= 26 for the kernel, a broken profile, …), and they
|
|
209
|
+
// were swallowed along with the rest of its log when --verbose is off.
|
|
210
|
+
if (!settled && exitCode !== 0 && exitCode !== 3) {
|
|
211
|
+
const tail = seen.trim();
|
|
212
|
+
if (tail.length > 0) {
|
|
213
|
+
process.stderr.write("blackhole web: harness thoát mã " + String(exitCode) + ":\n" + tail.split(/\r?\n/u).slice(-12).join("\n") + "\n");
|
|
214
|
+
}
|
|
215
|
+
}
|
|
200
216
|
if (exitCode !== null)
|
|
201
217
|
resolvePromise(exitCode);
|
|
202
218
|
else
|
|
203
219
|
resolvePromise(signal === "SIGINT" ? 130 : 1);
|
|
204
220
|
});
|
|
205
221
|
});
|
|
206
|
-
process.off("SIGTERM",
|
|
222
|
+
process.off("SIGTERM", onTerm);
|
|
207
223
|
return code;
|
|
208
224
|
}
|
|
209
225
|
//# sourceMappingURL=web.js.map
|
package/dist/web/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web/web.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,KAAK,EAA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L,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galaxy-stack/blackhole-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Galaxy Code CLI and terminal UI for the Galaxy agent runtime",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,10 +35,11 @@
|
|
|
35
35
|
"ink": "7.1.1",
|
|
36
36
|
"react": "^19.3.0",
|
|
37
37
|
"string-width": "^8.2.2",
|
|
38
|
-
"wrap-ansi": "^9.0.2"
|
|
38
|
+
"wrap-ansi": "^9.0.2",
|
|
39
|
+
"ws": "^8.21.3"
|
|
39
40
|
},
|
|
40
41
|
"optionalDependencies": {
|
|
41
|
-
"@deepseek-ai/dsh": "
|
|
42
|
+
"@deepseek-ai/dsh": "0.2.1-alpha.4"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@types/node": "^22.19.15",
|