@iml1s/claw-link 0.1.1 → 0.2.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/relay-client.js +8 -5
- package/openclaw.plugin.json +1 -1
- package/package.json +3 -3
package/dist/relay-client.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.buildRegisterUrl = buildRegisterUrl;
|
|
|
8
8
|
exports.buildJoinUrlFromRegister = buildJoinUrlFromRegister;
|
|
9
9
|
exports.buildConnectionString = buildConnectionString;
|
|
10
10
|
const ws_1 = __importDefault(require("ws"));
|
|
11
|
-
const
|
|
11
|
+
const qrcode_1 = __importDefault(require("qrcode"));
|
|
12
12
|
const node_crypto_1 = require("node:crypto");
|
|
13
13
|
function buildRegisterUrl(relayUrl, sessionId) {
|
|
14
14
|
const registerUrl = new URL(relayUrl);
|
|
@@ -183,15 +183,18 @@ class RelayClient {
|
|
|
183
183
|
}
|
|
184
184
|
return Buffer.alloc(0);
|
|
185
185
|
}
|
|
186
|
-
displayQrCode() {
|
|
186
|
+
async displayQrCode() {
|
|
187
187
|
const connectionString = buildConnectionString(this.relayUrl, this.sessionId, this.gatewayToken);
|
|
188
188
|
console.log('\nScan this QR Code with your mobile app to connect:\n');
|
|
189
189
|
try {
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
const qrAscii = await qrcode_1.default.toString(connectionString, {
|
|
191
|
+
type: 'terminal',
|
|
192
|
+
small: true,
|
|
193
|
+
});
|
|
194
|
+
console.log(qrAscii);
|
|
192
195
|
}
|
|
193
196
|
catch (e) {
|
|
194
|
-
console.log('(
|
|
197
|
+
console.log('(Failed to render QR code)');
|
|
195
198
|
}
|
|
196
199
|
console.log(`\nConnection String: ${connectionString}\n`);
|
|
197
200
|
}
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iml1s/claw-link",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.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",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"test": "vitest run"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"qrcode
|
|
31
|
+
"qrcode": "^1.5.4",
|
|
32
32
|
"ws": "^8.16.0"
|
|
33
33
|
},
|
|
34
34
|
"openclaw": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^20.0.0",
|
|
41
|
-
"@types/qrcode
|
|
41
|
+
"@types/qrcode": "^1.5.6",
|
|
42
42
|
"@types/ws": "^8.5.10",
|
|
43
43
|
"typescript": "^5.0.0",
|
|
44
44
|
"vitest": "^2.1.8"
|