@iml1s/claw-link 0.2.0 → 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.
@@ -56,6 +56,15 @@ class RelayClient {
56
56
  this.relayUrl = relayUrl;
57
57
  this.gatewayToken = gatewayToken;
58
58
  }
59
+ /** Returns current connection info for RPC callers / agent skills. */
60
+ getConnectionInfo() {
61
+ return {
62
+ connectionString: buildConnectionString(this.relayUrl, this.sessionId, this.gatewayToken),
63
+ sessionId: this.sessionId,
64
+ relayUrl: this.relayUrl,
65
+ relayConnected: this.relayWs?.readyState === ws_1.default.OPEN,
66
+ };
67
+ }
59
68
  connect() {
60
69
  this.isDisconnecting = false;
61
70
  console.log(`[RelayClient] Connecting to Relay Server at ${this.relayUrl}...`);
@@ -64,7 +73,7 @@ class RelayClient {
64
73
  this.relayWs.on('open', () => {
65
74
  console.log('[RelayClient] Connected to Relay Server.');
66
75
  if (!this.hasPrintedQrCode) {
67
- this.displayQrCode();
76
+ this.displayQrCode().catch(() => { });
68
77
  this.hasPrintedQrCode = true;
69
78
  }
70
79
  this.ensureLocalGatewayConnected();
@@ -191,7 +200,7 @@ class RelayClient {
191
200
  type: 'terminal',
192
201
  small: true,
193
202
  });
194
- console.log(qrAscii);
203
+ console.log('\n' + qrAscii);
195
204
  }
196
205
  catch (e) {
197
206
  console.log('(Failed to render QR code)');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iml1s/claw-link",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Cloud relay bridge plugin for OpenClaw — connects mobile devices to local gateways via a relay server.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -43,4 +43,4 @@
43
43
  "typescript": "^5.0.0",
44
44
  "vitest": "^2.1.8"
45
45
  }
46
- }
46
+ }