@mearl/cloud-server 2.7.2 → 2.7.3

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.js CHANGED
@@ -1,564 +1,14 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ CONFIG_FILE,
4
+ CloudServer,
5
+ LOG_FILE,
6
+ MODE_FILE
7
+ } from "./chunks/chunk-DCTZIDJ7.js";
2
8
 
3
9
  // src/daemon.ts
4
10
  import { fileURLToPath } from "node:url";
5
11
  import { createDaemon, readRecord, removeRecord } from "@mearl/daemon-core";
6
-
7
- // src/index.ts
8
- import WebSocket, { WebSocketServer } from "ws";
9
- import { createServer as createHttpServer } from "node:http";
10
- import { chmodSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
11
- import { randomBytes } from "node:crypto";
12
- import { networkInterfaces } from "node:os";
13
-
14
- // src/paths.ts
15
- import { join } from "node:path";
16
- import { DAEMON_HOME } from "@mearl/daemon-core";
17
- var CONFIG_DIR = DAEMON_HOME;
18
- var CONFIG_FILE = join(CONFIG_DIR, "cloud-server.json");
19
- var MODE_FILE = join(CONFIG_DIR, "cloud-server-mode.json");
20
- var LOG_FILE = join(CONFIG_DIR, "cloud-server.log");
21
-
22
- // src/index.ts
23
- import {
24
- isAgentHelloMessage,
25
- isConnectorHelloMessage,
26
- isHeartbeatMessage,
27
- isCloudMessage,
28
- isCloudResponse,
29
- resolveCloudConnectorSelector,
30
- MAX_BUFFER_SIZE,
31
- DEFAULT_HEARTBEAT_TIMEOUT,
32
- DEFAULT_REQUEST_TIMEOUT
33
- } from "@mearl/cloud-types";
34
- import { resolveActionTimeoutSec } from "@mearl/client/action-timeouts";
35
- var fetchInstance = null;
36
- async function getFetch() {
37
- if (fetchInstance) {
38
- return fetchInstance;
39
- }
40
- if (typeof globalThis.fetch !== "undefined") {
41
- fetchInstance = globalThis.fetch;
42
- } else {
43
- const { default: fetch } = await import("node-fetch");
44
- fetchInstance = fetch;
45
- }
46
- return fetchInstance;
47
- }
48
- var DEFAULT_PORT = 8080;
49
- var DEFAULT_PATH = "/ws";
50
- var DEFAULT_MAX_CONNECTIONS = 100;
51
- var DEFAULT_MAX_MESSAGE_SIZE = 10 * 1024 * 1024;
52
- var RESPONSE_GRACE_MS = 5e3;
53
- var LEGACY_CONNECTOR_HELLO_GRACE_MS = 1e3;
54
- var CloudServer = class {
55
- options;
56
- connectorWss = null;
57
- agentWss = null;
58
- connectorHttpServer = null;
59
- agentHttpServer = null;
60
- connections = /* @__PURE__ */ new Map();
61
- pendingRequests = /* @__PURE__ */ new Map();
62
- heartbeatTimer = null;
63
- constructor(options = {}) {
64
- const port = options.port ?? DEFAULT_PORT;
65
- this.options = {
66
- port,
67
- agentPort: options.agentPort ?? port + 1,
68
- path: options.path ?? DEFAULT_PATH,
69
- token: options.token,
70
- heartbeatTimeout: options.heartbeatTimeout ?? DEFAULT_HEARTBEAT_TIMEOUT,
71
- maxConnections: options.maxConnections ?? DEFAULT_MAX_CONNECTIONS,
72
- maxMessageSize: options.maxMessageSize ?? DEFAULT_MAX_MESSAGE_SIZE,
73
- requestTimeout: options.requestTimeout ?? DEFAULT_REQUEST_TIMEOUT,
74
- allowRemoteAgent: options.allowRemoteAgent ?? false
75
- };
76
- }
77
- getToken() {
78
- if (!this.options.token) {
79
- this.options.token = this.generateRandomToken();
80
- }
81
- return this.options.token;
82
- }
83
- generateRandomToken() {
84
- return randomBytes(24).toString("base64url");
85
- }
86
- async start() {
87
- const token = this.getToken();
88
- await this.createListener(this.options.agentPort, "127.0.0.1", true);
89
- await this.createListener(this.options.port, "0.0.0.0", false);
90
- const localWsUrl = `ws://localhost:${this.options.agentPort}${this.options.path}?token=${token}`;
91
- let publicWsUrl;
92
- const sandboxUrl = await this.getSandboxPublicUrl(this.options.port);
93
- if (sandboxUrl) {
94
- try {
95
- const parsedUrl = new URL(sandboxUrl);
96
- parsedUrl.protocol = "wss:";
97
- parsedUrl.pathname = this.options.path;
98
- parsedUrl.search = `?token=${token}`;
99
- publicWsUrl = parsedUrl.toString();
100
- } catch {
101
- const httpsUrl = sandboxUrl.replace("https://", "wss://");
102
- publicWsUrl = `${httpsUrl}${this.options.path}?token=${token}`;
103
- }
104
- } else {
105
- const publicHost = process.env.CLOUD_SERVER_HOST || this.getPublicIP();
106
- publicWsUrl = `ws://${publicHost}:${this.options.port}${this.options.path}?token=${token}`;
107
- }
108
- if (publicWsUrl.startsWith("ws://") && !publicWsUrl.startsWith("ws://localhost")) {
109
- console.warn(
110
- "[CloudServer] Connector traffic is using unencrypted ws://. Use a TLS-terminating proxy and wss:// when the connection crosses a trusted network."
111
- );
112
- }
113
- const connectorCommand = `npx @mearl/cloud-connector start "${publicWsUrl}"`;
114
- console.log(
115
- `[CloudServer] Connector listener on 0.0.0.0:${this.options.port} (network); agent listener on 127.0.0.1:${this.options.agentPort} (local only)`
116
- );
117
- console.log(`[CloudServer] Connect from local machine:`);
118
- console.log(` ${connectorCommand}`);
119
- this.startHeartbeatCheck();
120
- const info = {
121
- pid: process.pid,
122
- port: this.options.port,
123
- path: this.options.path,
124
- token,
125
- localUrl: localWsUrl,
126
- publicUrl: publicWsUrl,
127
- connectorCommand,
128
- startedAt: (/* @__PURE__ */ new Date()).toISOString()
129
- };
130
- this.writeConfigFile(info);
131
- return info;
132
- }
133
- /**
134
- * Stand up one HTTP+WebSocket listener. `fromLocal` tags every connection
135
- * accepted here so handleRequest can pin command-issuing authority to the
136
- * loopback listener.
137
- */
138
- createListener(port, host, fromLocal) {
139
- return new Promise((resolve, reject) => {
140
- const httpServer = createHttpServer((req, res) => {
141
- console.log(`[CloudServer] HTTP request: ${req.method} ${req.url}`);
142
- res.writeHead(404, { "Content-Type": "text/plain" });
143
- res.end("Not Found - This is a WebSocket server");
144
- });
145
- const wss = new WebSocketServer({
146
- server: httpServer,
147
- path: this.options.path,
148
- maxPayload: this.options.maxMessageSize
149
- });
150
- wss.on("connection", (ws, req) => {
151
- console.log(
152
- `[CloudServer] New ${fromLocal ? "agent" : "connector"} connection from ${req.socket.remoteAddress}, path: ${req.url}`
153
- );
154
- this.handleConnection(ws, req, fromLocal);
155
- });
156
- wss.on("error", (error) => {
157
- console.error("[CloudServer] WebSocket server error:", error.message);
158
- });
159
- httpServer.on("error", (error) => {
160
- console.error("[CloudServer] HTTP server error:", error.message);
161
- reject(error);
162
- });
163
- if (fromLocal) {
164
- this.agentWss = wss;
165
- this.agentHttpServer = httpServer;
166
- } else {
167
- this.connectorWss = wss;
168
- this.connectorHttpServer = httpServer;
169
- }
170
- httpServer.listen(port, host, () => {
171
- resolve();
172
- });
173
- });
174
- }
175
- stop() {
176
- return new Promise((resolve) => {
177
- if (this.heartbeatTimer) {
178
- clearInterval(this.heartbeatTimer);
179
- this.heartbeatTimer = null;
180
- }
181
- for (const [ws] of this.connections) {
182
- ws.close();
183
- }
184
- this.connections.clear();
185
- for (const pending of this.pendingRequests.values()) {
186
- clearTimeout(pending.timer);
187
- }
188
- this.pendingRequests.clear();
189
- this.agentWss?.close();
190
- this.connectorWss?.close();
191
- this.agentWss = null;
192
- this.connectorWss = null;
193
- const servers = [this.agentHttpServer, this.connectorHttpServer].filter(
194
- (s) => s !== null
195
- );
196
- this.agentHttpServer = null;
197
- this.connectorHttpServer = null;
198
- if (servers.length === 0) {
199
- resolve();
200
- return;
201
- }
202
- let remaining = servers.length;
203
- for (const s of servers) {
204
- s.close(() => {
205
- if (--remaining <= 0) resolve();
206
- });
207
- }
208
- });
209
- }
210
- handleConnection(ws, req, fromLocal) {
211
- if (this.connections.size >= this.options.maxConnections) {
212
- ws.close(1008, "Server is full");
213
- return;
214
- }
215
- if (this.options.token) {
216
- const url = new URL(req.url || "", `http://${req.headers.host}`);
217
- const token = url.searchParams.get("token");
218
- if (token !== this.options.token) {
219
- ws.close(1008, "Unauthorized");
220
- return;
221
- }
222
- }
223
- const connId = `${Date.now()}_${Math.random().toString(36).slice(2, 10)}`;
224
- const connection = {
225
- ws,
226
- id: connId,
227
- lastHeartbeat: Date.now(),
228
- connectedAt: Date.now(),
229
- role: fromLocal ? "agent" : "pending",
230
- fromLocal,
231
- messageBuffer: ""
232
- };
233
- this.connections.set(ws, connection);
234
- console.log(`[CloudServer] Client connected: ${connId} (total: ${this.connections.size})`);
235
- ws.on("message", (data) => {
236
- const conn = this.connections.get(ws);
237
- if (!conn) return;
238
- conn.messageBuffer += data.toString("utf-8");
239
- if (conn.messageBuffer.length > MAX_BUFFER_SIZE) {
240
- console.error(
241
- `[CloudServer] Message buffer exceeds limit for ${connId}, closing connection`
242
- );
243
- ws.close(1008, "Message too large");
244
- return;
245
- }
246
- let newlineIndex;
247
- while ((newlineIndex = conn.messageBuffer.indexOf("\n")) !== -1) {
248
- const line = conn.messageBuffer.slice(0, newlineIndex);
249
- conn.messageBuffer = conn.messageBuffer.slice(newlineIndex + 1);
250
- if (!line.trim()) continue;
251
- try {
252
- const message = JSON.parse(line);
253
- this.handleMessage(ws, message);
254
- } catch (error) {
255
- console.error(`[CloudServer] Failed to parse message from ${connId}:`, line, error);
256
- }
257
- }
258
- });
259
- ws.on("close", () => {
260
- this.connections.delete(ws);
261
- this.rejectPendingForWs(ws);
262
- console.log(`[CloudServer] Client disconnected: ${connId} (total: ${this.connections.size})`);
263
- });
264
- ws.on("error", (error) => {
265
- console.error(`[CloudServer] Connection error for ${connId}:`, error.message);
266
- });
267
- }
268
- handleMessage(ws, message) {
269
- const conn = this.connections.get(ws);
270
- if (!conn) return;
271
- if (isHeartbeatMessage(message)) {
272
- if (message.type === "ping") {
273
- ws.send(
274
- JSON.stringify({ type: "pong", timestamp: Date.now() }) + "\n"
275
- );
276
- conn.lastHeartbeat = Date.now();
277
- } else if (message.type === "pong") {
278
- conn.lastHeartbeat = Date.now();
279
- }
280
- return;
281
- }
282
- if (isAgentHelloMessage(message)) {
283
- this.handleAgentHello(ws);
284
- return;
285
- }
286
- if (isConnectorHelloMessage(message)) {
287
- this.handleConnectorHello(ws, message);
288
- return;
289
- }
290
- if (isCloudResponse(message)) {
291
- this.handleResponse(ws, message);
292
- return;
293
- }
294
- if (isCloudMessage(message)) {
295
- this.handleRequest(ws, message);
296
- return;
297
- }
298
- }
299
- handleAgentHello(ws) {
300
- const conn = this.connections.get(ws);
301
- if (!conn) return;
302
- if (!conn.fromLocal && !this.options.allowRemoteAgent) {
303
- ws.close(1008, "Agent must be local");
304
- return;
305
- }
306
- conn.role = "agent";
307
- delete conn.connector;
308
- }
309
- handleConnectorHello(ws, message) {
310
- const conn = this.connections.get(ws);
311
- if (!conn || conn.fromLocal) {
312
- ws.close(1008, "Connector must use the connector listener");
313
- return;
314
- }
315
- for (const [otherWs, other] of this.connections) {
316
- if (otherWs !== ws && other.role === "connector" && other.connector?.connectorId === message.connectorId) {
317
- this.connections.delete(otherWs);
318
- this.rejectPendingForWs(otherWs);
319
- otherWs.close(1e3, "Connector replaced by a newer connection");
320
- }
321
- }
322
- conn.role = "connector";
323
- conn.connector = {
324
- connectorId: message.connectorId,
325
- name: message.name,
326
- ...message.version ? { version: message.version } : {}
327
- };
328
- console.log(
329
- `[CloudServer] Connector registered: ${message.name} (${message.connectorId}, v${message.version ?? "unknown"})`
330
- );
331
- }
332
- handleRequest(ws, message) {
333
- const { id, action, data } = message;
334
- const conn = this.connections.get(ws);
335
- if (!conn) return;
336
- if (conn.role !== "agent") {
337
- console.warn(
338
- `[CloudServer] Rejected agent request from non-local connection ${conn.id} (action: ${action})`
339
- );
340
- ws.send(
341
- JSON.stringify({
342
- id,
343
- success: false,
344
- error: this.options.allowRemoteAgent && !conn.fromLocal ? "Remote agents must identify themselves with an agent_hello message before issuing commands." : "Agent requests are only accepted on the local interface (127.0.0.1). Run @mearl/client on the same machine as cloud-server, or start the server with --allow-remote-agent to override."
345
- }) + "\n"
346
- );
347
- return;
348
- }
349
- if (action === "connector_list") {
350
- const response = {
351
- id,
352
- success: true,
353
- data: this.getConnectorList()
354
- };
355
- ws.send(JSON.stringify(response) + "\n");
356
- return;
357
- }
358
- const target = this.resolveConnector(message.connector);
359
- if ("error" in target) {
360
- ws.send(JSON.stringify({ id, success: false, error: target.error }) + "\n");
361
- return;
362
- }
363
- const routeId = randomBytes(12).toString("base64url");
364
- const requestedTimeoutSec = Number(message.timeoutSec);
365
- const timeoutSec = Number.isFinite(requestedTimeoutSec) && requestedTimeoutSec > 0 ? Math.min(requestedTimeoutSec, 3600) : resolveActionTimeoutSec(action, data, this.options.requestTimeout);
366
- const timer = setTimeout(
367
- () => {
368
- this.pendingRequests.delete(routeId);
369
- if (ws.readyState === WebSocket.OPEN) {
370
- ws.send(JSON.stringify({ id, success: false, error: "Request timeout" }) + "\n");
371
- }
372
- },
373
- timeoutSec * 1e3 + RESPONSE_GRACE_MS
374
- );
375
- this.pendingRequests.set(routeId, {
376
- agentRequestId: id,
377
- agentWs: ws,
378
- connectorWs: target.ws,
379
- timer
380
- });
381
- target.ws.send(
382
- JSON.stringify({
383
- id: routeId,
384
- action,
385
- data,
386
- browser: message.browser,
387
- timeoutSec
388
- }) + "\n"
389
- );
390
- }
391
- handleResponse(ws, response) {
392
- const conn = this.connections.get(ws);
393
- if (!conn) return;
394
- if (conn.role !== "connector") return;
395
- const pending = this.pendingRequests.get(response.id);
396
- if (!pending || pending.connectorWs !== ws) return;
397
- this.pendingRequests.delete(response.id);
398
- clearTimeout(pending.timer);
399
- if (pending.agentWs.readyState === WebSocket.OPEN) {
400
- pending.agentWs.send(
401
- JSON.stringify({ ...response, id: pending.agentRequestId }) + "\n"
402
- );
403
- }
404
- }
405
- connectorInfo(ws, conn) {
406
- const pendingRequests = Array.from(this.pendingRequests.values()).filter(
407
- (pending) => pending.connectorWs === ws
408
- ).length;
409
- return {
410
- connectorId: conn.connector?.connectorId ?? conn.id,
411
- name: conn.connector?.name ?? `legacy-${conn.id.slice(-8)}`,
412
- ...conn.connector?.version ? { version: conn.connector.version } : {},
413
- connectedAt: new Date(conn.connectedAt).toISOString(),
414
- lastHeartbeatAt: new Date(conn.lastHeartbeat).toISOString(),
415
- pendingRequests,
416
- ...!conn.connector ? { legacy: true } : {}
417
- };
418
- }
419
- getConnectorConnections() {
420
- const connectors = [];
421
- for (const [ws, conn] of this.connections) {
422
- if (conn.role === "pending" && Date.now() - conn.connectedAt >= LEGACY_CONNECTOR_HELLO_GRACE_MS) {
423
- conn.role = "connector";
424
- }
425
- if (conn.role !== "connector" || ws.readyState !== WebSocket.OPEN) continue;
426
- connectors.push({ ws, conn, info: this.connectorInfo(ws, conn) });
427
- }
428
- return connectors.sort((a, b) => a.info.name.localeCompare(b.info.name));
429
- }
430
- getConnectorList() {
431
- const connectors = this.getConnectorConnections().map(({ info }) => info);
432
- return { count: connectors.length, connectors };
433
- }
434
- resolveConnector(selector) {
435
- const connectors = this.getConnectorConnections();
436
- if (connectors.length === 0) return { error: "No local connector available" };
437
- const available = connectors.map(({ info }) => `${info.name} [${info.connectorId}]`).join(", ");
438
- if (!selector) {
439
- if (connectors.length === 1) {
440
- return { ws: connectors[0].ws, info: connectors[0].info };
441
- }
442
- return {
443
- error: `Multiple cloud connectors are connected (${connectors.length}). Pass --connector <id|name>. Available: ${available}`
444
- };
445
- }
446
- const selection = resolveCloudConnectorSelector(
447
- connectors.map(({ info }) => info),
448
- selector
449
- );
450
- if (selection.status === "matched") {
451
- const matched = connectors.find(({ info }) => info === selection.connector);
452
- return { ws: matched.ws, info: matched.info };
453
- }
454
- if (selection.status === "ambiguous") {
455
- return {
456
- error: `Cloud connector selector "${selector}" is ambiguous. Available: ${available}`
457
- };
458
- }
459
- return {
460
- error: `No cloud connector matches "${selector}". Available: ${available}`
461
- };
462
- }
463
- rejectPendingForWs(ws) {
464
- this.pendingRequests.forEach((pending, id) => {
465
- if (pending.agentWs !== ws && pending.connectorWs !== ws) return;
466
- clearTimeout(pending.timer);
467
- this.pendingRequests.delete(id);
468
- if (pending.connectorWs === ws && pending.agentWs !== ws && pending.agentWs.readyState === WebSocket.OPEN) {
469
- pending.agentWs.send(
470
- JSON.stringify({
471
- id: pending.agentRequestId,
472
- success: false,
473
- error: "Connector connection closed"
474
- }) + "\n"
475
- );
476
- }
477
- });
478
- }
479
- startHeartbeatCheck() {
480
- if (this.heartbeatTimer) return;
481
- this.heartbeatTimer = setInterval(() => {
482
- const now = Date.now();
483
- const timeoutMs = this.options.heartbeatTimeout * 1e3;
484
- for (const [ws, conn] of this.connections) {
485
- if (now - conn.lastHeartbeat > timeoutMs) {
486
- console.log(`[CloudServer] Client ${conn.id} heartbeat timeout, closing connection`);
487
- ws.close(1e3, "Heartbeat timeout");
488
- }
489
- }
490
- }, 3e4);
491
- }
492
- getPublicIP() {
493
- const interfaces = networkInterfaces();
494
- for (const name of Object.keys(interfaces)) {
495
- const iface = interfaces[name];
496
- if (!iface) continue;
497
- for (const addr of iface) {
498
- if (addr.family === "IPv4" && !addr.internal) {
499
- return addr.address;
500
- }
501
- }
502
- }
503
- return "localhost";
504
- }
505
- async getSandboxPublicUrl(port) {
506
- if (!process.env.AONE_SANDBOX_ID) {
507
- return null;
508
- }
509
- const mappingApiUrl = "http://localhost:58596/api/port-mapping";
510
- try {
511
- const fetch = await getFetch();
512
- const response = await fetch(`${mappingApiUrl}?port=${port}`);
513
- if (!response.ok) {
514
- return null;
515
- }
516
- const data = await response.json();
517
- if (data.success && data.url) {
518
- return data.url;
519
- }
520
- } catch (error) {
521
- console.error(
522
- `[CloudServer] Failed to query sandbox port mapping:`,
523
- error instanceof Error ? error.message : String(error)
524
- );
525
- }
526
- return null;
527
- }
528
- writeConfigFile(info) {
529
- try {
530
- if (!existsSync(CONFIG_DIR)) {
531
- mkdirSync(CONFIG_DIR, { recursive: true, mode: 448 });
532
- }
533
- const config = { server: info.localUrl, ...info };
534
- writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2), {
535
- encoding: "utf-8",
536
- mode: 384
537
- });
538
- if (process.platform !== "win32") {
539
- chmodSync(CONFIG_DIR, 448);
540
- chmodSync(CONFIG_FILE, 384);
541
- }
542
- console.log(`[CloudServer] Config written to: ${CONFIG_FILE}`);
543
- } catch (error) {
544
- console.error("[CloudServer] Failed to write config file:", error);
545
- }
546
- }
547
- getStats() {
548
- let agents = 0;
549
- for (const conn of this.connections.values()) {
550
- if (conn.role === "agent") agents++;
551
- }
552
- return {
553
- connections: this.connections.size,
554
- agents,
555
- connectors: this.getConnectorConnections().length,
556
- pendingRequests: this.pendingRequests.size
557
- };
558
- }
559
- };
560
-
561
- // src/daemon.ts
562
12
  var SCRIPT_PATH = fileURLToPath(import.meta.url);
563
13
  function formatConnectInfo(record) {
564
14
  const config = record;
@@ -624,7 +74,7 @@ async function runForeground(options) {
624
74
  }
625
75
 
626
76
  // src/mode.ts
627
- import { mkdirSync as mkdirSync2, readFileSync, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
77
+ import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
628
78
  import { dirname } from "node:path";
629
79
  var CLOUD_SERVER_MODE_ENV = "MEARL_CLOUD_MODE";
630
80
  function isCloudServerMode(value) {
@@ -643,8 +93,8 @@ function readStoredMode(storage) {
643
93
  function writeStoredMode(mode, storage) {
644
94
  const modeFile = storage.modeFile ?? MODE_FILE;
645
95
  const writeText = storage.writeText ?? ((filePath, value) => {
646
- mkdirSync2(dirname(filePath), { recursive: true });
647
- writeFileSync2(filePath, value, { encoding: "utf8", mode: 384 });
96
+ mkdirSync(dirname(filePath), { recursive: true });
97
+ writeFileSync(filePath, value, { encoding: "utf8", mode: 384 });
648
98
  });
649
99
  writeText(modeFile, `${JSON.stringify({ mode })}
650
100
  `);
@@ -668,9 +118,9 @@ function resolveCloudServerMode(env = process.env, storage = {}) {
668
118
  }
669
119
 
670
120
  // src/qoder.ts
671
- import { randomBytes as randomBytes2 } from "node:crypto";
121
+ import { randomBytes } from "node:crypto";
672
122
  function createQoderPairingInfo(options = {}) {
673
- const pairingCode = (options.createCode ?? (() => randomBytes2(24).toString("base64url")))();
123
+ const pairingCode = (options.createCode ?? (() => randomBytes(24).toString("base64url")))();
674
124
  if (!/^[A-Za-z0-9_-]{16,128}$/.test(pairingCode)) {
675
125
  throw new Error("Qoder pairing code must be 16-128 URL-safe characters");
676
126
  }
@@ -723,7 +173,7 @@ async function runQoderCloudServerCommand(command2, dependencies) {
723
173
  }
724
174
 
725
175
  // src/cli.ts
726
- var CLOUD_SERVER_VERSION = true ? "2.7.2" : "unknown";
176
+ var CLOUD_SERVER_VERSION = true ? "2.7.3" : "unknown";
727
177
  var argv = process.argv.slice(2);
728
178
  if (argv.includes("--version") || argv.includes("-v")) {
729
179
  console.log(CLOUD_SERVER_VERSION);