@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
package/src/fingerprint.js
DELETED
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* SSH fingerprint utilities with validation and recovery
|
|
4
|
-
*/
|
|
5
|
-
var __extends = (this && this.__extends) || (function () {
|
|
6
|
-
var extendStatics = function (d, b) {
|
|
7
|
-
extendStatics = Object.setPrototypeOf ||
|
|
8
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
9
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
10
|
-
return extendStatics(d, b);
|
|
11
|
-
};
|
|
12
|
-
return function (d, b) {
|
|
13
|
-
if (typeof b !== "function" && b !== null)
|
|
14
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
15
|
-
extendStatics(d, b);
|
|
16
|
-
function __() { this.constructor = d; }
|
|
17
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
18
|
-
};
|
|
19
|
-
})();
|
|
20
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
21
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
23
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
24
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
25
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
26
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
30
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
31
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
32
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
33
|
-
function step(op) {
|
|
34
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
35
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
36
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
37
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
38
|
-
switch (op[0]) {
|
|
39
|
-
case 0: case 1: t = op; break;
|
|
40
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
41
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
42
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
43
|
-
default:
|
|
44
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
45
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
46
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
47
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
48
|
-
if (t[2]) _.ops.pop();
|
|
49
|
-
_.trys.pop(); continue;
|
|
50
|
-
}
|
|
51
|
-
op = body.call(thisArg, _);
|
|
52
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
53
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
-
exports.SSHKeyMismatchError = void 0;
|
|
58
|
-
exports.getSSHFingerprint = getSSHFingerprint;
|
|
59
|
-
exports.getLocalKeyFingerprint = getLocalKeyFingerprint;
|
|
60
|
-
exports.normalizeFingerprint = normalizeFingerprint;
|
|
61
|
-
exports.validateSSHKeyMatch = validateSSHKeyMatch;
|
|
62
|
-
exports.testSSHKeyConnection = testSSHKeyConnection;
|
|
63
|
-
exports.validateSSHKeyForServer = validateSSHKeyForServer;
|
|
64
|
-
var util_1 = require("util");
|
|
65
|
-
var promises_1 = require("fs/promises");
|
|
66
|
-
var execAsync = (0, util_1.promisify)(require("child_process").exec);
|
|
67
|
-
/**
|
|
68
|
-
* Get SSH fingerprint from remote server
|
|
69
|
-
* @param options - SSH connection options
|
|
70
|
-
* @returns SSH fingerprint or null
|
|
71
|
-
*/
|
|
72
|
-
function getSSHFingerprint(options) {
|
|
73
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
-
var host, _a, port, proc, output, lines, _i, lines_1, line, parts, _b;
|
|
75
|
-
return __generator(this, function (_c) {
|
|
76
|
-
switch (_c.label) {
|
|
77
|
-
case 0:
|
|
78
|
-
host = options.host, _a = options.port, port = _a === void 0 ? 22 : _a;
|
|
79
|
-
_c.label = 1;
|
|
80
|
-
case 1:
|
|
81
|
-
_c.trys.push([1, 4, , 5]);
|
|
82
|
-
proc = Bun.spawn(["ssh-keyscan", "-p", port.toString(), "".concat(host)], {
|
|
83
|
-
stdout: "pipe",
|
|
84
|
-
stderr: "pipe",
|
|
85
|
-
});
|
|
86
|
-
return [4 /*yield*/, new Response(proc.stdout).text()];
|
|
87
|
-
case 2:
|
|
88
|
-
output = _c.sent();
|
|
89
|
-
return [4 /*yield*/, proc.exited];
|
|
90
|
-
case 3:
|
|
91
|
-
_c.sent();
|
|
92
|
-
lines = output.split("\n");
|
|
93
|
-
for (_i = 0, lines_1 = lines; _i < lines_1.length; _i++) {
|
|
94
|
-
line = lines_1[_i];
|
|
95
|
-
if (line.includes(host)) {
|
|
96
|
-
parts = line.split(" ");
|
|
97
|
-
if (parts.length >= 3) {
|
|
98
|
-
return [2 /*return*/, parts[2]]; // Return the fingerprint
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return [2 /*return*/, null];
|
|
103
|
-
case 4:
|
|
104
|
-
_b = _c.sent();
|
|
105
|
-
return [2 /*return*/, null];
|
|
106
|
-
case 5: return [2 /*return*/];
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Get SSH fingerprint from a local private key file
|
|
113
|
-
* @param keyPath - Path to the private key file
|
|
114
|
-
* @returns SSH fingerprint (SHA256 format) or null
|
|
115
|
-
*/
|
|
116
|
-
function getLocalKeyFingerprint(keyPath) {
|
|
117
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
118
|
-
var stdout, match, _a, keyContent, lines, _i, lines_2, line, stdout, match, error_1;
|
|
119
|
-
return __generator(this, function (_b) {
|
|
120
|
-
switch (_b.label) {
|
|
121
|
-
case 0:
|
|
122
|
-
_b.trys.push([0, 10, , 11]);
|
|
123
|
-
_b.label = 1;
|
|
124
|
-
case 1:
|
|
125
|
-
_b.trys.push([1, 3, , 4]);
|
|
126
|
-
return [4 /*yield*/, execAsync("ssh-keygen -lf \"".concat(keyPath, "\""))];
|
|
127
|
-
case 2:
|
|
128
|
-
stdout = (_b.sent()).stdout;
|
|
129
|
-
match = stdout.match(/SHA256:(\S+)/i);
|
|
130
|
-
if (match) {
|
|
131
|
-
return [2 /*return*/, match[1]];
|
|
132
|
-
}
|
|
133
|
-
return [3 /*break*/, 4];
|
|
134
|
-
case 3:
|
|
135
|
-
_a = _b.sent();
|
|
136
|
-
return [3 /*break*/, 4];
|
|
137
|
-
case 4: return [4 /*yield*/, (0, promises_1.readFile)(keyPath, "utf-8")];
|
|
138
|
-
case 5:
|
|
139
|
-
keyContent = _b.sent();
|
|
140
|
-
if (!(keyContent.includes("OPENSSH") && keyContent.includes("ssh-ed25519"))) return [3 /*break*/, 9];
|
|
141
|
-
lines = keyContent.split("\n");
|
|
142
|
-
_i = 0, lines_2 = lines;
|
|
143
|
-
_b.label = 6;
|
|
144
|
-
case 6:
|
|
145
|
-
if (!(_i < lines_2.length)) return [3 /*break*/, 9];
|
|
146
|
-
line = lines_2[_i];
|
|
147
|
-
if (!line.startsWith("ssh-ed25519")) return [3 /*break*/, 8];
|
|
148
|
-
return [4 /*yield*/, execAsync("echo '".concat(line, "' | ssh-keygen -lf -"))];
|
|
149
|
-
case 7:
|
|
150
|
-
stdout = (_b.sent()).stdout;
|
|
151
|
-
match = stdout.match(/SHA256:(\S+)/i);
|
|
152
|
-
if (match) {
|
|
153
|
-
return [2 /*return*/, match[1]];
|
|
154
|
-
}
|
|
155
|
-
_b.label = 8;
|
|
156
|
-
case 8:
|
|
157
|
-
_i++;
|
|
158
|
-
return [3 /*break*/, 6];
|
|
159
|
-
case 9: return [2 /*return*/, null];
|
|
160
|
-
case 10:
|
|
161
|
-
error_1 = _b.sent();
|
|
162
|
-
console.error("[Fingerprint] Failed to get local key fingerprint:", error_1);
|
|
163
|
-
return [2 /*return*/, null];
|
|
164
|
-
case 11: return [2 /*return*/];
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Convert MD5 fingerprint format to SHA256 format (for comparison)
|
|
171
|
-
* Hetzner returns MD5 like "29:cd:c1:c3:84:eb:ca:31:a4:1f:94:69:0c:84:b3:56"
|
|
172
|
-
* We need to handle both formats
|
|
173
|
-
*/
|
|
174
|
-
function normalizeFingerprint(fingerprint) {
|
|
175
|
-
// Remove colons from MD5 format for easier comparison
|
|
176
|
-
return fingerprint.replace(/:/g, "").toLowerCase();
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Validate that a local SSH key matches what's on a remote server
|
|
180
|
-
* @param host - Server hostname or IP
|
|
181
|
-
* @param keyPath - Path to local private key
|
|
182
|
-
* @returns Validation result
|
|
183
|
-
*/
|
|
184
|
-
function validateSSHKeyMatch(host, keyPath) {
|
|
185
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
186
|
-
var localFingerprint, remoteFingerprint, localNormalized, remoteNormalized, match, error_2;
|
|
187
|
-
return __generator(this, function (_a) {
|
|
188
|
-
switch (_a.label) {
|
|
189
|
-
case 0:
|
|
190
|
-
_a.trys.push([0, 3, , 4]);
|
|
191
|
-
return [4 /*yield*/, getLocalKeyFingerprint(keyPath)];
|
|
192
|
-
case 1:
|
|
193
|
-
localFingerprint = _a.sent();
|
|
194
|
-
if (!localFingerprint) {
|
|
195
|
-
return [2 /*return*/, {
|
|
196
|
-
valid: false,
|
|
197
|
-
error: "Could not read local SSH key fingerprint",
|
|
198
|
-
}];
|
|
199
|
-
}
|
|
200
|
-
return [4 /*yield*/, getSSHFingerprint({ host: host })];
|
|
201
|
-
case 2:
|
|
202
|
-
remoteFingerprint = _a.sent();
|
|
203
|
-
if (!remoteFingerprint) {
|
|
204
|
-
return [2 /*return*/, {
|
|
205
|
-
valid: false,
|
|
206
|
-
error: "Could not get remote SSH fingerprint",
|
|
207
|
-
}];
|
|
208
|
-
}
|
|
209
|
-
localNormalized = normalizeFingerprint(localFingerprint);
|
|
210
|
-
remoteNormalized = normalizeFingerprint(remoteFingerprint);
|
|
211
|
-
match = localNormalized === remoteNormalized ||
|
|
212
|
-
localFingerprint === remoteFingerprint ||
|
|
213
|
-
localFingerprint === remoteFingerprint.replace(/:/g, "");
|
|
214
|
-
return [2 /*return*/, {
|
|
215
|
-
valid: match,
|
|
216
|
-
localFingerprint: localFingerprint,
|
|
217
|
-
remoteFingerprint: remoteFingerprint,
|
|
218
|
-
error: match ? undefined : "Fingerprints do not match",
|
|
219
|
-
}];
|
|
220
|
-
case 3:
|
|
221
|
-
error_2 = _a.sent();
|
|
222
|
-
return [2 /*return*/, {
|
|
223
|
-
valid: false,
|
|
224
|
-
error: error_2 instanceof Error ? error_2.message : String(error_2),
|
|
225
|
-
}];
|
|
226
|
-
case 4: return [2 /*return*/];
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Check if we can SSH to a server with a given key
|
|
233
|
-
* @param host - Server hostname or IP
|
|
234
|
-
* @param keyPath - Path to SSH private key
|
|
235
|
-
* @returns true if SSH works
|
|
236
|
-
*/
|
|
237
|
-
function testSSHKeyConnection(host, keyPath) {
|
|
238
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
239
|
-
var _a;
|
|
240
|
-
return __generator(this, function (_b) {
|
|
241
|
-
switch (_b.label) {
|
|
242
|
-
case 0:
|
|
243
|
-
_b.trys.push([0, 2, , 3]);
|
|
244
|
-
return [4 /*yield*/, execAsync("ssh -F /dev/null -i \"".concat(keyPath, "\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=5 ").concat(host, " \"echo ok\""), { timeout: 10000 })];
|
|
245
|
-
case 1:
|
|
246
|
-
_b.sent();
|
|
247
|
-
return [2 /*return*/, true];
|
|
248
|
-
case 2:
|
|
249
|
-
_a = _b.sent();
|
|
250
|
-
return [2 /*return*/, false];
|
|
251
|
-
case 3: return [2 /*return*/];
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* SSH Key Mismatch Error with recovery suggestions
|
|
258
|
-
*/
|
|
259
|
-
var SSHKeyMismatchError = /** @class */ (function (_super) {
|
|
260
|
-
__extends(SSHKeyMismatchError, _super);
|
|
261
|
-
function SSHKeyMismatchError(host, localFingerprint, hetznerFingerprint, keyPath) {
|
|
262
|
-
var _this = this;
|
|
263
|
-
var hetznerShort = hetznerFingerprint.split(":").slice(0, 4).join(":");
|
|
264
|
-
var localShort = localFingerprint.slice(0, 16);
|
|
265
|
-
_this = _super.call(this, "SSH key mismatch for ".concat(host, "\n") +
|
|
266
|
-
" Local key (".concat(keyPath, "): ").concat(localShort, "...\n") +
|
|
267
|
-
" Hetzner key: ".concat(hetznerShort, "...\n\n") +
|
|
268
|
-
"The local private key doesn't match the public key on Hetzner.\n\n" +
|
|
269
|
-
"RECOVERY OPTIONS:\n" +
|
|
270
|
-
"1. Create a new SSH key and upload to Hetzner\n" +
|
|
271
|
-
"2. Regenerate local key to match Hetzner's key\n" +
|
|
272
|
-
"3. Use the correct key path for this server") || this;
|
|
273
|
-
_this.host = host;
|
|
274
|
-
_this.localFingerprint = localFingerprint;
|
|
275
|
-
_this.hetznerFingerprint = hetznerFingerprint;
|
|
276
|
-
_this.keyPath = keyPath;
|
|
277
|
-
_this.name = "SSHKeyMismatchError";
|
|
278
|
-
return _this;
|
|
279
|
-
}
|
|
280
|
-
return SSHKeyMismatchError;
|
|
281
|
-
}(Error));
|
|
282
|
-
exports.SSHKeyMismatchError = SSHKeyMismatchError;
|
|
283
|
-
/**
|
|
284
|
-
* Comprehensive SSH key validation for server creation
|
|
285
|
-
* @param host - Server hostname or IP
|
|
286
|
-
* @param keyPath - Path to local SSH key
|
|
287
|
-
* @param hetznerKeyId - SSH key ID on Hetzner (for comparison)
|
|
288
|
-
* @returns Validation result with recovery suggestions
|
|
289
|
-
*/
|
|
290
|
-
function validateSSHKeyForServer(host, keyPath, hetznerKeyId) {
|
|
291
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
292
|
-
var result, _a, validation;
|
|
293
|
-
return __generator(this, function (_b) {
|
|
294
|
-
switch (_b.label) {
|
|
295
|
-
case 0:
|
|
296
|
-
result = {
|
|
297
|
-
canConnect: false,
|
|
298
|
-
fingerprintMatch: false,
|
|
299
|
-
recovery: [],
|
|
300
|
-
};
|
|
301
|
-
// Test if SSH works at all
|
|
302
|
-
_a = result;
|
|
303
|
-
return [4 /*yield*/, testSSHKeyConnection(host, keyPath)];
|
|
304
|
-
case 1:
|
|
305
|
-
// Test if SSH works at all
|
|
306
|
-
_a.canConnect = _b.sent();
|
|
307
|
-
return [4 /*yield*/, validateSSHKeyMatch(host, keyPath)];
|
|
308
|
-
case 2:
|
|
309
|
-
validation = _b.sent();
|
|
310
|
-
result.localFingerprint = validation.localFingerprint;
|
|
311
|
-
result.remoteFingerprint = validation.remoteFingerprint;
|
|
312
|
-
result.fingerprintMatch = validation.valid;
|
|
313
|
-
if (!result.canConnect) {
|
|
314
|
-
result.error = "Cannot connect to server with this key";
|
|
315
|
-
result.recovery = [
|
|
316
|
-
"1. Check if the server is fully initialized (may still be booting)",
|
|
317
|
-
"2. Verify the SSH key was added to the server's ~/.ssh/authorized_keys",
|
|
318
|
-
"3. Try a different SSH key or regenerate the key pair",
|
|
319
|
-
];
|
|
320
|
-
return [2 /*return*/, result];
|
|
321
|
-
}
|
|
322
|
-
if (!result.fingerprintMatch) {
|
|
323
|
-
result.error = "SSH key fingerprint mismatch";
|
|
324
|
-
result.recovery = [
|
|
325
|
-
"1. Generate a new SSH key pair: `ssh-keygen -t ed25519 -f ~/.ssh/hetzner-new`",
|
|
326
|
-
"2. Upload public key to Hetzner (via GUI or API)",
|
|
327
|
-
"3. Update the server's metadata with the new key path",
|
|
328
|
-
"4. Alternatively: The Hetzner key ID ".concat(hetznerKeyId, " may need key regeneration"),
|
|
329
|
-
];
|
|
330
|
-
return [2 /*return*/, result];
|
|
331
|
-
}
|
|
332
|
-
return [2 /*return*/, result];
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
});
|
|
336
|
-
}
|
package/src/index.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* SSH utility library - modular entry point
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isTmuxInstalled = exports.generateSessionName = exports.detachWebSocket = exports.resizeSession = exports.writeToSession = exports.attachWebSocket = exports.getSessionsByHost = exports.getSessionCount = exports.getSessionInfo = exports.getAllSessionInfo = exports.getAllSessions = exports.getSession = exports.getOrCreateSession = exports.cleanupStaleSessions = exports.closeSession = exports.SSHConnectionPool = exports.getActiveSSHConnections = exports.closeGlobalSSHPool = exports.getSSHPool = exports.getActivePTYSessions = exports.getPTYSession = exports.closePTYSession = exports.readFromPTY = exports.setPTYSize = exports.writeToPTY = exports.createPTYSession = exports.SSHKeyMismatchError = exports.validateSSHKeyForServer = exports.testSSHKeyConnection = exports.validateSSHKeyMatch = exports.normalizeFingerprint = exports.getLocalKeyFingerprint = exports.getSSHFingerprint = exports.clearSecurityEvents = exports.getSecurityEvents = exports.PathTraversalError = exports.sanitizePath = exports.previewFile = exports.listFiles = exports.scpDownload = exports.scpUpload = exports.execViaTmuxParallel = exports.execViaTmux = exports.testSSHConnection = exports.execSSHParallel = exports.execSSH = exports.SSHError = exports.resetTmuxManager = exports.getTmuxManager = exports.TmuxSessionManager = void 0;
|
|
7
|
-
exports.RESOURCE_COMMANDS = exports.getDetailedLocalSessionInfo = exports.killLocalPane = exports.renameLocalWindow = exports.switchLocalPane = exports.switchLocalWindow = exports.waitForTextInPane = exports.getLocalTmuxResourceUsage = exports.cleanupOldLocalSessions = exports.splitLocalPane = exports.listLocalWindowPanes = exports.listLocalSessionWindows = exports.getLocalSessionInfo = exports.killLocalSession = exports.getLocalPaneHistory = exports.captureLocalPane = exports.sendCommandToLocalSession = exports.createLocalTmuxSSHSession = exports.hasLocalSession = exports.listLocalSessions = exports.isLocalTmuxInstalled = exports.generateLocalSessionName = exports.getDetailedSessionInfo = exports.killPane = exports.renameWindow = exports.switchPane = exports.switchWindow = exports.getPaneHistory = exports.capturePane = exports.listWindowPanes = exports.listSessionWindows = exports.splitPane = exports.sendCommandToPane = exports.getTmuxResourceUsage = exports.cleanupOldTmuxSessions = exports.getTmuxSessionInfo = exports.killTmuxSession = exports.createOrAttachTmuxSession = exports.hasTmuxSession = exports.listTmuxSessions = exports.ensureTmux = exports.installTmux = void 0;
|
|
8
|
-
// Tmux Session Manager (multi-node tmux management)
|
|
9
|
-
var tmux_manager_js_1 = require("./tmux-manager.js");
|
|
10
|
-
Object.defineProperty(exports, "TmuxSessionManager", { enumerable: true, get: function () { return tmux_manager_js_1.TmuxSessionManager; } });
|
|
11
|
-
Object.defineProperty(exports, "getTmuxManager", { enumerable: true, get: function () { return tmux_manager_js_1.getTmuxManager; } });
|
|
12
|
-
Object.defineProperty(exports, "resetTmuxManager", { enumerable: true, get: function () { return tmux_manager_js_1.resetTmuxManager; } });
|
|
13
|
-
// Error
|
|
14
|
-
var error_js_1 = require("./error.js");
|
|
15
|
-
Object.defineProperty(exports, "SSHError", { enumerable: true, get: function () { return error_js_1.SSHError; } });
|
|
16
|
-
// Core client
|
|
17
|
-
var client_js_1 = require("./client.js");
|
|
18
|
-
Object.defineProperty(exports, "execSSH", { enumerable: true, get: function () { return client_js_1.execSSH; } });
|
|
19
|
-
// Command execution
|
|
20
|
-
var exec_js_1 = require("./exec.js");
|
|
21
|
-
Object.defineProperty(exports, "execSSHParallel", { enumerable: true, get: function () { return exec_js_1.execSSHParallel; } });
|
|
22
|
-
Object.defineProperty(exports, "testSSHConnection", { enumerable: true, get: function () { return exec_js_1.testSSHConnection; } });
|
|
23
|
-
// Tmux-based command execution (consolidates SSH connections)
|
|
24
|
-
var tmux_exec_js_1 = require("./tmux-exec.js");
|
|
25
|
-
Object.defineProperty(exports, "execViaTmux", { enumerable: true, get: function () { return tmux_exec_js_1.execViaTmux; } });
|
|
26
|
-
Object.defineProperty(exports, "execViaTmuxParallel", { enumerable: true, get: function () { return tmux_exec_js_1.execViaTmuxParallel; } });
|
|
27
|
-
// SCP operations
|
|
28
|
-
var scp_js_1 = require("./scp.js");
|
|
29
|
-
Object.defineProperty(exports, "scpUpload", { enumerable: true, get: function () { return scp_js_1.scpUpload; } });
|
|
30
|
-
Object.defineProperty(exports, "scpDownload", { enumerable: true, get: function () { return scp_js_1.scpDownload; } });
|
|
31
|
-
// File operations
|
|
32
|
-
var files_js_1 = require("./files.js");
|
|
33
|
-
Object.defineProperty(exports, "listFiles", { enumerable: true, get: function () { return files_js_1.listFiles; } });
|
|
34
|
-
Object.defineProperty(exports, "previewFile", { enumerable: true, get: function () { return files_js_1.previewFile; } });
|
|
35
|
-
Object.defineProperty(exports, "sanitizePath", { enumerable: true, get: function () { return files_js_1.sanitizePath; } });
|
|
36
|
-
Object.defineProperty(exports, "PathTraversalError", { enumerable: true, get: function () { return files_js_1.PathTraversalError; } });
|
|
37
|
-
Object.defineProperty(exports, "getSecurityEvents", { enumerable: true, get: function () { return files_js_1.getSecurityEvents; } });
|
|
38
|
-
Object.defineProperty(exports, "clearSecurityEvents", { enumerable: true, get: function () { return files_js_1.clearSecurityEvents; } });
|
|
39
|
-
// Fingerprint utilities
|
|
40
|
-
var fingerprint_js_1 = require("./fingerprint.js");
|
|
41
|
-
Object.defineProperty(exports, "getSSHFingerprint", { enumerable: true, get: function () { return fingerprint_js_1.getSSHFingerprint; } });
|
|
42
|
-
Object.defineProperty(exports, "getLocalKeyFingerprint", { enumerable: true, get: function () { return fingerprint_js_1.getLocalKeyFingerprint; } });
|
|
43
|
-
Object.defineProperty(exports, "normalizeFingerprint", { enumerable: true, get: function () { return fingerprint_js_1.normalizeFingerprint; } });
|
|
44
|
-
Object.defineProperty(exports, "validateSSHKeyMatch", { enumerable: true, get: function () { return fingerprint_js_1.validateSSHKeyMatch; } });
|
|
45
|
-
Object.defineProperty(exports, "testSSHKeyConnection", { enumerable: true, get: function () { return fingerprint_js_1.testSSHKeyConnection; } });
|
|
46
|
-
Object.defineProperty(exports, "validateSSHKeyForServer", { enumerable: true, get: function () { return fingerprint_js_1.validateSSHKeyForServer; } });
|
|
47
|
-
Object.defineProperty(exports, "SSHKeyMismatchError", { enumerable: true, get: function () { return fingerprint_js_1.SSHKeyMismatchError; } });
|
|
48
|
-
// PTY (interactive terminal) operations
|
|
49
|
-
var pty_js_1 = require("./pty.js");
|
|
50
|
-
Object.defineProperty(exports, "createPTYSession", { enumerable: true, get: function () { return pty_js_1.createPTYSession; } });
|
|
51
|
-
Object.defineProperty(exports, "writeToPTY", { enumerable: true, get: function () { return pty_js_1.writeToPTY; } });
|
|
52
|
-
Object.defineProperty(exports, "setPTYSize", { enumerable: true, get: function () { return pty_js_1.setPTYSize; } });
|
|
53
|
-
Object.defineProperty(exports, "readFromPTY", { enumerable: true, get: function () { return pty_js_1.readFromPTY; } });
|
|
54
|
-
Object.defineProperty(exports, "closePTYSession", { enumerable: true, get: function () { return pty_js_1.closePTYSession; } });
|
|
55
|
-
Object.defineProperty(exports, "getPTYSession", { enumerable: true, get: function () { return pty_js_1.getPTYSession; } });
|
|
56
|
-
Object.defineProperty(exports, "getActivePTYSessions", { enumerable: true, get: function () { return pty_js_1.getActivePTYSessions; } });
|
|
57
|
-
// Connection pool management
|
|
58
|
-
var pool_js_1 = require("./pool.js");
|
|
59
|
-
Object.defineProperty(exports, "getSSHPool", { enumerable: true, get: function () { return pool_js_1.getSSHPool; } });
|
|
60
|
-
Object.defineProperty(exports, "closeGlobalSSHPool", { enumerable: true, get: function () { return pool_js_1.closeGlobalSSHPool; } });
|
|
61
|
-
Object.defineProperty(exports, "getActiveSSHConnections", { enumerable: true, get: function () { return pool_js_1.getActiveSSHConnections; } });
|
|
62
|
-
Object.defineProperty(exports, "SSHConnectionPool", { enumerable: true, get: function () { return pool_js_1.SSHConnectionPool; } });
|
|
63
|
-
// Terminal session management
|
|
64
|
-
var sessions_js_1 = require("./sessions.js");
|
|
65
|
-
Object.defineProperty(exports, "closeSession", { enumerable: true, get: function () { return sessions_js_1.closeSession; } });
|
|
66
|
-
Object.defineProperty(exports, "cleanupStaleSessions", { enumerable: true, get: function () { return sessions_js_1.cleanupStaleSessions; } });
|
|
67
|
-
Object.defineProperty(exports, "getOrCreateSession", { enumerable: true, get: function () { return sessions_js_1.getOrCreateSession; } });
|
|
68
|
-
Object.defineProperty(exports, "getSession", { enumerable: true, get: function () { return sessions_js_1.getSession; } });
|
|
69
|
-
Object.defineProperty(exports, "getAllSessions", { enumerable: true, get: function () { return sessions_js_1.getAllSessions; } });
|
|
70
|
-
Object.defineProperty(exports, "getAllSessionInfo", { enumerable: true, get: function () { return sessions_js_1.getAllSessionInfo; } });
|
|
71
|
-
Object.defineProperty(exports, "getSessionInfo", { enumerable: true, get: function () { return sessions_js_1.getSessionInfo; } });
|
|
72
|
-
Object.defineProperty(exports, "getSessionCount", { enumerable: true, get: function () { return sessions_js_1.getSessionCount; } });
|
|
73
|
-
Object.defineProperty(exports, "getSessionsByHost", { enumerable: true, get: function () { return sessions_js_1.getSessionsByHost; } });
|
|
74
|
-
Object.defineProperty(exports, "attachWebSocket", { enumerable: true, get: function () { return sessions_js_1.attachWebSocket; } });
|
|
75
|
-
Object.defineProperty(exports, "writeToSession", { enumerable: true, get: function () { return sessions_js_1.writeToSession; } });
|
|
76
|
-
Object.defineProperty(exports, "resizeSession", { enumerable: true, get: function () { return sessions_js_1.resizeSession; } });
|
|
77
|
-
Object.defineProperty(exports, "detachWebSocket", { enumerable: true, get: function () { return sessions_js_1.detachWebSocket; } });
|
|
78
|
-
// Tmux session management (remote tmux on servers)
|
|
79
|
-
var tmux_js_1 = require("./tmux.js");
|
|
80
|
-
Object.defineProperty(exports, "generateSessionName", { enumerable: true, get: function () { return tmux_js_1.generateSessionName; } });
|
|
81
|
-
Object.defineProperty(exports, "isTmuxInstalled", { enumerable: true, get: function () { return tmux_js_1.isTmuxInstalled; } });
|
|
82
|
-
Object.defineProperty(exports, "installTmux", { enumerable: true, get: function () { return tmux_js_1.installTmux; } });
|
|
83
|
-
Object.defineProperty(exports, "ensureTmux", { enumerable: true, get: function () { return tmux_js_1.ensureTmux; } });
|
|
84
|
-
Object.defineProperty(exports, "listTmuxSessions", { enumerable: true, get: function () { return tmux_js_1.listTmuxSessions; } });
|
|
85
|
-
Object.defineProperty(exports, "hasTmuxSession", { enumerable: true, get: function () { return tmux_js_1.hasTmuxSession; } });
|
|
86
|
-
Object.defineProperty(exports, "createOrAttachTmuxSession", { enumerable: true, get: function () { return tmux_js_1.createOrAttachTmuxSession; } });
|
|
87
|
-
Object.defineProperty(exports, "killTmuxSession", { enumerable: true, get: function () { return tmux_js_1.killTmuxSession; } });
|
|
88
|
-
Object.defineProperty(exports, "getTmuxSessionInfo", { enumerable: true, get: function () { return tmux_js_1.getTmuxSessionInfo; } });
|
|
89
|
-
Object.defineProperty(exports, "cleanupOldTmuxSessions", { enumerable: true, get: function () { return tmux_js_1.cleanupOldTmuxSessions; } });
|
|
90
|
-
Object.defineProperty(exports, "getTmuxResourceUsage", { enumerable: true, get: function () { return tmux_js_1.getTmuxResourceUsage; } });
|
|
91
|
-
Object.defineProperty(exports, "sendCommandToPane", { enumerable: true, get: function () { return tmux_js_1.sendCommandToPane; } });
|
|
92
|
-
Object.defineProperty(exports, "splitPane", { enumerable: true, get: function () { return tmux_js_1.splitPane; } });
|
|
93
|
-
Object.defineProperty(exports, "listSessionWindows", { enumerable: true, get: function () { return tmux_js_1.listSessionWindows; } });
|
|
94
|
-
Object.defineProperty(exports, "listWindowPanes", { enumerable: true, get: function () { return tmux_js_1.listWindowPanes; } });
|
|
95
|
-
Object.defineProperty(exports, "capturePane", { enumerable: true, get: function () { return tmux_js_1.capturePane; } });
|
|
96
|
-
Object.defineProperty(exports, "getPaneHistory", { enumerable: true, get: function () { return tmux_js_1.getPaneHistory; } });
|
|
97
|
-
Object.defineProperty(exports, "switchWindow", { enumerable: true, get: function () { return tmux_js_1.switchWindow; } });
|
|
98
|
-
Object.defineProperty(exports, "switchPane", { enumerable: true, get: function () { return tmux_js_1.switchPane; } });
|
|
99
|
-
Object.defineProperty(exports, "renameWindow", { enumerable: true, get: function () { return tmux_js_1.renameWindow; } });
|
|
100
|
-
Object.defineProperty(exports, "killPane", { enumerable: true, get: function () { return tmux_js_1.killPane; } });
|
|
101
|
-
Object.defineProperty(exports, "getDetailedSessionInfo", { enumerable: true, get: function () { return tmux_js_1.getDetailedSessionInfo; } });
|
|
102
|
-
// Local tmux session management (tmux on local machine with persistent SSH)
|
|
103
|
-
var tmux_local_js_1 = require("./tmux-local.js");
|
|
104
|
-
Object.defineProperty(exports, "generateLocalSessionName", { enumerable: true, get: function () { return tmux_local_js_1.generateLocalSessionName; } });
|
|
105
|
-
Object.defineProperty(exports, "isLocalTmuxInstalled", { enumerable: true, get: function () { return tmux_local_js_1.isLocalTmuxInstalled; } });
|
|
106
|
-
Object.defineProperty(exports, "listLocalSessions", { enumerable: true, get: function () { return tmux_local_js_1.listLocalSessions; } });
|
|
107
|
-
Object.defineProperty(exports, "hasLocalSession", { enumerable: true, get: function () { return tmux_local_js_1.hasLocalSession; } });
|
|
108
|
-
Object.defineProperty(exports, "createLocalTmuxSSHSession", { enumerable: true, get: function () { return tmux_local_js_1.createLocalTmuxSSHSession; } });
|
|
109
|
-
Object.defineProperty(exports, "sendCommandToLocalSession", { enumerable: true, get: function () { return tmux_local_js_1.sendCommandToLocalSession; } });
|
|
110
|
-
Object.defineProperty(exports, "captureLocalPane", { enumerable: true, get: function () { return tmux_local_js_1.captureLocalPane; } });
|
|
111
|
-
Object.defineProperty(exports, "getLocalPaneHistory", { enumerable: true, get: function () { return tmux_local_js_1.getLocalPaneHistory; } });
|
|
112
|
-
Object.defineProperty(exports, "killLocalSession", { enumerable: true, get: function () { return tmux_local_js_1.killLocalSession; } });
|
|
113
|
-
Object.defineProperty(exports, "getLocalSessionInfo", { enumerable: true, get: function () { return tmux_local_js_1.getLocalSessionInfo; } });
|
|
114
|
-
Object.defineProperty(exports, "listLocalSessionWindows", { enumerable: true, get: function () { return tmux_local_js_1.listLocalSessionWindows; } });
|
|
115
|
-
Object.defineProperty(exports, "listLocalWindowPanes", { enumerable: true, get: function () { return tmux_local_js_1.listLocalWindowPanes; } });
|
|
116
|
-
Object.defineProperty(exports, "splitLocalPane", { enumerable: true, get: function () { return tmux_local_js_1.splitLocalPane; } });
|
|
117
|
-
Object.defineProperty(exports, "cleanupOldLocalSessions", { enumerable: true, get: function () { return tmux_local_js_1.cleanupOldLocalSessions; } });
|
|
118
|
-
Object.defineProperty(exports, "getLocalTmuxResourceUsage", { enumerable: true, get: function () { return tmux_local_js_1.getLocalTmuxResourceUsage; } });
|
|
119
|
-
Object.defineProperty(exports, "waitForTextInPane", { enumerable: true, get: function () { return tmux_local_js_1.waitForTextInPane; } });
|
|
120
|
-
Object.defineProperty(exports, "switchLocalWindow", { enumerable: true, get: function () { return tmux_local_js_1.switchLocalWindow; } });
|
|
121
|
-
Object.defineProperty(exports, "switchLocalPane", { enumerable: true, get: function () { return tmux_local_js_1.switchLocalPane; } });
|
|
122
|
-
Object.defineProperty(exports, "renameLocalWindow", { enumerable: true, get: function () { return tmux_local_js_1.renameLocalWindow; } });
|
|
123
|
-
Object.defineProperty(exports, "killLocalPane", { enumerable: true, get: function () { return tmux_local_js_1.killLocalPane; } });
|
|
124
|
-
Object.defineProperty(exports, "getDetailedLocalSessionInfo", { enumerable: true, get: function () { return tmux_local_js_1.getDetailedLocalSessionInfo; } });
|
|
125
|
-
// Resource monitoring commands
|
|
126
|
-
var resources_js_1 = require("./resources.js");
|
|
127
|
-
Object.defineProperty(exports, "RESOURCE_COMMANDS", { enumerable: true, get: function () { return resources_js_1.RESOURCE_COMMANDS; } });
|