@ebowwa/terminal 0.3.1 → 0.3.2

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.
Files changed (77) hide show
  1. package/package.json +8 -70
  2. package/dist/api.d.ts +0 -7
  3. package/dist/client.d.ts +0 -14
  4. package/dist/config.d.ts +0 -85
  5. package/dist/cpufeatures-vxqw2k6s.node +0 -0
  6. package/dist/error.d.ts +0 -7
  7. package/dist/exec.d.ts +0 -46
  8. package/dist/files.d.ts +0 -123
  9. package/dist/fingerprint.d.ts +0 -66
  10. package/dist/index.d.ts +0 -20
  11. package/dist/manager.d.ts +0 -102
  12. package/dist/mcp/cpufeatures-vxqw2k6s.node +0 -0
  13. package/dist/mcp/index.d.ts +0 -8
  14. package/dist/mcp/sshcrypto-gez6h7ch.node +0 -0
  15. package/dist/mcp/stdio.d.ts +0 -8
  16. package/dist/network-error-detector.d.ts +0 -18
  17. package/dist/pool.d.ts +0 -142
  18. package/dist/pty.d.ts +0 -58
  19. package/dist/resources.d.ts +0 -62
  20. package/dist/scp.d.ts +0 -29
  21. package/dist/sessions.d.ts +0 -100
  22. package/dist/sshcrypto-gez6h7ch.node +0 -0
  23. package/dist/tmux-exec.d.ts +0 -49
  24. package/dist/tmux-local.d.ts +0 -272
  25. package/dist/tmux-manager.d.ts +0 -327
  26. package/dist/tmux.d.ts +0 -212
  27. package/dist/types.d.ts +0 -17
  28. package/mcp/README.md +0 -181
  29. package/mcp/package.json +0 -40
  30. package/mcp/stdio.js +0 -555
  31. package/mcp/test-fix.sh +0 -273
  32. package/mcp/wrapper.mjs +0 -10
  33. package/src/api.js +0 -861
  34. package/src/api.ts +0 -752
  35. package/src/client.js +0 -92
  36. package/src/client.ts +0 -55
  37. package/src/config.js +0 -490
  38. package/src/config.ts +0 -489
  39. package/src/error.js +0 -32
  40. package/src/error.ts +0 -13
  41. package/src/exec.js +0 -183
  42. package/src/exec.ts +0 -128
  43. package/src/files.js +0 -521
  44. package/src/files.ts +0 -636
  45. package/src/fingerprint.js +0 -336
  46. package/src/fingerprint.ts +0 -263
  47. package/src/index.js +0 -127
  48. package/src/index.ts +0 -148
  49. package/src/manager.js +0 -358
  50. package/src/manager.ts +0 -319
  51. package/src/mcp/index.js +0 -555
  52. package/src/mcp/index.ts +0 -467
  53. package/src/mcp/stdio.js +0 -840
  54. package/src/mcp/stdio.ts +0 -708
  55. package/src/network-error-detector.js +0 -101
  56. package/src/network-error-detector.ts +0 -121
  57. package/src/pool.js +0 -840
  58. package/src/pool.ts +0 -662
  59. package/src/pty.js +0 -344
  60. package/src/pty.ts +0 -285
  61. package/src/resources.js +0 -64
  62. package/src/resources.ts +0 -72
  63. package/src/scp.js +0 -166
  64. package/src/scp.ts +0 -109
  65. package/src/sessions.js +0 -895
  66. package/src/sessions.ts +0 -861
  67. package/src/tmux-exec.js +0 -169
  68. package/src/tmux-exec.ts +0 -96
  69. package/src/tmux-local.js +0 -937
  70. package/src/tmux-local.ts +0 -839
  71. package/src/tmux-manager.js +0 -1026
  72. package/src/tmux-manager.ts +0 -962
  73. package/src/tmux.js +0 -826
  74. package/src/tmux.ts +0 -711
  75. package/src/types.js +0 -5
  76. package/src/types.ts +0 -19
  77. package/tsconfig.json +0 -28
@@ -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
- }
@@ -1,121 +0,0 @@
1
- /**
2
- * Network Error Detection
3
- * Detects and provides helpful messages for common network issues
4
- */
5
-
6
- export interface NetworkErrorDetails {
7
- type: "SERVER_NOT_READY" | "NETWORK_BLOCKED" | "AUTH_FAILED" | "UNKNOWN";
8
- message: string;
9
- troubleshooting: string[];
10
- isLikelyNetworkBlock: boolean;
11
- }
12
-
13
- /**
14
- * Analyzes SSH connection error and provides detailed diagnosis
15
- */
16
- export function detectNetworkError(
17
- error: Error | string,
18
- host: string,
19
- serverStatus?: string
20
- ): NetworkErrorDetails {
21
- const errorMessage = typeof error === "string" ? error : error.message;
22
-
23
- // Pattern 1: Network blocking (ECONNREFUSED on specific IPs)
24
- const isConnectionRefused =
25
- errorMessage.includes("ECONNREFUSED") ||
26
- errorMessage.includes("Connection refused") ||
27
- errorMessage.includes("connect ECONNREFUSED");
28
-
29
- const isHetznerOrDatacenterIP =
30
- host.startsWith("195.") ||
31
- host.startsWith("148.") ||
32
- host.startsWith("116.") ||
33
- host.startsWith("138.") ||
34
- host.includes("hetzner") ||
35
- host.includes("fsn1") ||
36
- host.includes("nbg1") ||
37
- host.includes("hel1");
38
-
39
- const serverIsRunning = serverStatus === "running";
40
-
41
- // Network blocking pattern:
42
- // - ECONNREFUSED (not timeout)
43
- // - Server is running (per API)
44
- // - Hetzner/datacenter IP
45
- if (isConnectionRefused && serverIsRunning && isHetznerOrDatacenterIP) {
46
- return {
47
- type: "NETWORK_BLOCKED",
48
- message: "Network appears to be blocking this server",
49
- troubleshooting: [
50
- "✓ Server is running and responding to API",
51
- "✗ Your network is refusing connections to this IP",
52
- "",
53
- "⚠️ COMMON CAUSES:",
54
- "• Corporate/public WiFi blocks datacenter IPs",
55
- "• ISP firewall filtering VPS providers",
56
- "• Router content filtering",
57
- "",
58
- "🔧 SOLUTIONS:",
59
- "1. Try a different network (hotspot, home WiFi, VPN)",
60
- "2. Check router firewall settings",
61
- "3. Contact ISP about blocking Hetzner IPs",
62
- "",
63
- "💡 TEST: Works from other networks? = Network block confirmed",
64
- ],
65
- isLikelyNetworkBlock: true,
66
- };
67
- }
68
-
69
- // Pattern 2: Server still booting
70
- if (isConnectionRefused && !serverIsRunning) {
71
- return {
72
- type: "SERVER_NOT_READY",
73
- message: "Server is not ready yet",
74
- troubleshooting: [
75
- "Server is still starting up",
76
- "SSH daemon hasn't started yet",
77
- "",
78
- "⏳ Wait 1-2 minutes and try again",
79
- ],
80
- isLikelyNetworkBlock: false,
81
- };
82
- }
83
-
84
- // Pattern 3: Authentication failure
85
- if (
86
- errorMessage.includes("All configured authentication") ||
87
- errorMessage.includes("Authentication failed")
88
- ) {
89
- return {
90
- type: "AUTH_FAILED",
91
- message: "SSH authentication failed",
92
- troubleshooting: [
93
- "SSH key issue or wrong credentials",
94
- "Check that the SSH key is configured correctly",
95
- ],
96
- isLikelyNetworkBlock: false,
97
- };
98
- }
99
-
100
- // Default: Unknown error
101
- return {
102
- type: "UNKNOWN",
103
- message: errorMessage,
104
- troubleshooting: [
105
- "Check if server is running",
106
- "Verify network connectivity",
107
- "Check SSH key configuration",
108
- ],
109
- isLikelyNetworkBlock: false,
110
- };
111
- }
112
-
113
- /**
114
- * Format network error for WebSocket/UI display
115
- */
116
- export function formatNetworkError(diagnosis: NetworkErrorDetails): string {
117
- if (diagnosis.isLikelyNetworkBlock) {
118
- return `⚠️ ${diagnosis.message}\n\n${diagnosis.troubleshooting.join("\n")}`;
119
- }
120
- return diagnosis.message;
121
- }