@ebowwa/terminal 0.2.1 → 0.3.0
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/index.js +6855 -28130
- package/dist/mcp/index.js +7244 -27317
- package/package.json +1 -1
- package/src/api.js +0 -861
- package/src/client.js +0 -92
- package/src/config.js +0 -490
- package/src/error.js +0 -32
- package/src/exec.js +0 -183
- package/src/files.js +0 -521
- package/src/fingerprint.js +0 -336
- package/src/index.js +0 -127
- package/src/manager.js +0 -358
- package/src/mcp/index.js +0 -555
- package/src/mcp/stdio.js +0 -840
- package/src/network-error-detector.js +0 -101
- package/src/pool.js +0 -840
- package/src/pty.js +0 -344
- package/src/resources.js +0 -64
- package/src/scp.js +0 -166
- package/src/sessions.js +0 -895
- package/src/tmux-exec.js +0 -169
- package/src/tmux-local.js +0 -937
- package/src/tmux-manager.js +0 -1026
- package/src/tmux.js +0 -826
- package/src/types.js +0 -5
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Network Error Detection
|
|
4
|
-
* Detects and provides helpful messages for common network issues
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.detectNetworkError = detectNetworkError;
|
|
8
|
-
exports.formatNetworkError = formatNetworkError;
|
|
9
|
-
/**
|
|
10
|
-
* Analyzes SSH connection error and provides detailed diagnosis
|
|
11
|
-
*/
|
|
12
|
-
function detectNetworkError(error, host, serverStatus) {
|
|
13
|
-
var errorMessage = typeof error === "string" ? error : error.message;
|
|
14
|
-
// Pattern 1: Network blocking (ECONNREFUSED on specific IPs)
|
|
15
|
-
var isConnectionRefused = errorMessage.includes("ECONNREFUSED") ||
|
|
16
|
-
errorMessage.includes("Connection refused") ||
|
|
17
|
-
errorMessage.includes("connect ECONNREFUSED");
|
|
18
|
-
var isHetznerOrDatacenterIP = host.startsWith("195.") ||
|
|
19
|
-
host.startsWith("148.") ||
|
|
20
|
-
host.startsWith("116.") ||
|
|
21
|
-
host.startsWith("138.") ||
|
|
22
|
-
host.includes("hetzner") ||
|
|
23
|
-
host.includes("fsn1") ||
|
|
24
|
-
host.includes("nbg1") ||
|
|
25
|
-
host.includes("hel1");
|
|
26
|
-
var serverIsRunning = serverStatus === "running";
|
|
27
|
-
// Network blocking pattern:
|
|
28
|
-
// - ECONNREFUSED (not timeout)
|
|
29
|
-
// - Server is running (per API)
|
|
30
|
-
// - Hetzner/datacenter IP
|
|
31
|
-
if (isConnectionRefused && serverIsRunning && isHetznerOrDatacenterIP) {
|
|
32
|
-
return {
|
|
33
|
-
type: "NETWORK_BLOCKED",
|
|
34
|
-
message: "Network appears to be blocking this server",
|
|
35
|
-
troubleshooting: [
|
|
36
|
-
"✓ Server is running and responding to API",
|
|
37
|
-
"✗ Your network is refusing connections to this IP",
|
|
38
|
-
"",
|
|
39
|
-
"⚠️ COMMON CAUSES:",
|
|
40
|
-
"• Corporate/public WiFi blocks datacenter IPs",
|
|
41
|
-
"• ISP firewall filtering VPS providers",
|
|
42
|
-
"• Router content filtering",
|
|
43
|
-
"",
|
|
44
|
-
"🔧 SOLUTIONS:",
|
|
45
|
-
"1. Try a different network (hotspot, home WiFi, VPN)",
|
|
46
|
-
"2. Check router firewall settings",
|
|
47
|
-
"3. Contact ISP about blocking Hetzner IPs",
|
|
48
|
-
"",
|
|
49
|
-
"💡 TEST: Works from other networks? = Network block confirmed",
|
|
50
|
-
],
|
|
51
|
-
isLikelyNetworkBlock: true,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
// Pattern 2: Server still booting
|
|
55
|
-
if (isConnectionRefused && !serverIsRunning) {
|
|
56
|
-
return {
|
|
57
|
-
type: "SERVER_NOT_READY",
|
|
58
|
-
message: "Server is not ready yet",
|
|
59
|
-
troubleshooting: [
|
|
60
|
-
"Server is still starting up",
|
|
61
|
-
"SSH daemon hasn't started yet",
|
|
62
|
-
"",
|
|
63
|
-
"⏳ Wait 1-2 minutes and try again",
|
|
64
|
-
],
|
|
65
|
-
isLikelyNetworkBlock: false,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
// Pattern 3: Authentication failure
|
|
69
|
-
if (errorMessage.includes("All configured authentication") ||
|
|
70
|
-
errorMessage.includes("Authentication failed")) {
|
|
71
|
-
return {
|
|
72
|
-
type: "AUTH_FAILED",
|
|
73
|
-
message: "SSH authentication failed",
|
|
74
|
-
troubleshooting: [
|
|
75
|
-
"SSH key issue or wrong credentials",
|
|
76
|
-
"Check that the SSH key is configured correctly",
|
|
77
|
-
],
|
|
78
|
-
isLikelyNetworkBlock: false,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
// Default: Unknown error
|
|
82
|
-
return {
|
|
83
|
-
type: "UNKNOWN",
|
|
84
|
-
message: errorMessage,
|
|
85
|
-
troubleshooting: [
|
|
86
|
-
"Check if server is running",
|
|
87
|
-
"Verify network connectivity",
|
|
88
|
-
"Check SSH key configuration",
|
|
89
|
-
],
|
|
90
|
-
isLikelyNetworkBlock: false,
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Format network error for WebSocket/UI display
|
|
95
|
-
*/
|
|
96
|
-
function formatNetworkError(diagnosis) {
|
|
97
|
-
if (diagnosis.isLikelyNetworkBlock) {
|
|
98
|
-
return "\u26A0\uFE0F ".concat(diagnosis.message, "\n\n").concat(diagnosis.troubleshooting.join("\n"));
|
|
99
|
-
}
|
|
100
|
-
return diagnosis.message;
|
|
101
|
-
}
|