@mkterswingman/5mghost-yonder 0.0.4 → 0.0.5
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/dist/cli/setup.d.ts +5 -0
- package/dist/cli/setup.js +17 -16
- package/package.json +1 -1
package/dist/cli/setup.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export declare function canOpenBrowserForEnv(input: {
|
|
2
|
+
platform: NodeJS.Platform;
|
|
3
|
+
env: NodeJS.ProcessEnv;
|
|
4
|
+
stdinIsTTY: boolean;
|
|
5
|
+
}): boolean;
|
|
1
6
|
export declare function getNoBrowserSessionNotice(): string;
|
|
2
7
|
export declare function getNoBrowserPatHint(authUrl: string): string[];
|
|
3
8
|
export declare function getCookieSetupDeferredHint(): string[];
|
package/dist/cli/setup.js
CHANGED
|
@@ -40,27 +40,28 @@ function tryRegisterMcp(cmd, label) {
|
|
|
40
40
|
return false;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
* Cloud environments (SSH, Docker, cloud IDE) typically can't.
|
|
46
|
-
*/
|
|
47
|
-
function canOpenBrowser() {
|
|
48
|
-
// Explicit override
|
|
49
|
-
if (process.env.YT_MCP_NO_BROWSER === "1")
|
|
50
|
-
return false;
|
|
51
|
-
// Check for display (Linux/macOS GUI)
|
|
52
|
-
if (process.platform === "linux" && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY) {
|
|
43
|
+
export function canOpenBrowserForEnv(input) {
|
|
44
|
+
if (input.env.YT_MCP_NO_BROWSER === "1") {
|
|
53
45
|
return false;
|
|
54
46
|
}
|
|
55
|
-
|
|
56
|
-
if (process.env.CODESPACES || process.env.GITPOD_WORKSPACE_ID || process.env.CLOUD_SHELL) {
|
|
47
|
+
if (input.env.CODESPACES || input.env.GITPOD_WORKSPACE_ID || input.env.CLOUD_SHELL) {
|
|
57
48
|
return false;
|
|
58
49
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return false;
|
|
50
|
+
if (input.platform === "linux") {
|
|
51
|
+
return Boolean(input.env.DISPLAY || input.env.WAYLAND_DISPLAY);
|
|
62
52
|
}
|
|
63
|
-
|
|
53
|
+
// Why: desktop Windows/macOS sessions can launch browsers even when the host app pipes stdio.
|
|
54
|
+
if (input.platform === "win32" || input.platform === "darwin") {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
return input.stdinIsTTY;
|
|
58
|
+
}
|
|
59
|
+
function canOpenBrowser() {
|
|
60
|
+
return canOpenBrowserForEnv({
|
|
61
|
+
platform: process.platform,
|
|
62
|
+
env: process.env,
|
|
63
|
+
stdinIsTTY: Boolean(process.stdin.isTTY),
|
|
64
|
+
});
|
|
64
65
|
}
|
|
65
66
|
function openUrl(url) {
|
|
66
67
|
try {
|