@soyeht/soyeht 0.2.5 → 0.2.7
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/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/src/service.ts +15 -7
- package/src/version.ts +1 -1
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
package/src/service.ts
CHANGED
|
@@ -78,15 +78,20 @@ const DEFAULT_GATEWAY_PORT = 18789;
|
|
|
78
78
|
|
|
79
79
|
function detectLanIp(): string | null {
|
|
80
80
|
const nets = networkInterfaces();
|
|
81
|
+
const candidates: string[] = [];
|
|
81
82
|
for (const ifaces of Object.values(nets)) {
|
|
82
83
|
if (!ifaces) continue;
|
|
83
84
|
for (const iface of ifaces) {
|
|
84
|
-
// Skip loopback and internal, only IPv4
|
|
85
85
|
if (iface.internal || iface.family !== "IPv4") continue;
|
|
86
|
-
|
|
86
|
+
candidates.push(iface.address);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
return null;
|
|
89
|
+
if (candidates.length === 0) return null;
|
|
90
|
+
// Prefer typical LAN ranges over VPN/container ranges
|
|
91
|
+
const preferred = candidates.find((ip) => ip.startsWith("192.168."))
|
|
92
|
+
?? candidates.find((ip) => ip.startsWith("10."))
|
|
93
|
+
?? candidates[0];
|
|
94
|
+
return preferred;
|
|
90
95
|
}
|
|
91
96
|
|
|
92
97
|
function detectGatewayPort(cfg: Record<string, unknown>): number {
|
|
@@ -147,12 +152,15 @@ async function showPairingQr(api: OpenClawPluginApi, v2deps: SecurityV2Deps): Pr
|
|
|
147
152
|
if (rendered) {
|
|
148
153
|
// Write QR directly to stdout to avoid logger prefixes breaking ANSI escape codes
|
|
149
154
|
process.stdout.write("\n" + rendered + "\n\n");
|
|
150
|
-
api.logger.info(`[soyeht] Scan the QR code above with the Soyeht app
|
|
151
|
-
api.logger.info(`[soyeht] Fingerprint: ${fingerprint}`);
|
|
152
|
-
api.logger.info(`[soyeht] QR expires in ${AUTO_PAIRING_TTL_MS / 1000}s — restart plugin to generate a new one`);
|
|
155
|
+
api.logger.info(`[soyeht] Scan the QR code above with the Soyeht app`);
|
|
153
156
|
} else {
|
|
154
|
-
api.logger.warn("[soyeht] QR code too large for terminal rendering.
|
|
157
|
+
api.logger.warn("[soyeht] QR code too large for terminal rendering.");
|
|
155
158
|
}
|
|
159
|
+
|
|
160
|
+
// Always log the pairing URL as fallback — user can copy-paste into the app
|
|
161
|
+
api.logger.info(`[soyeht] If QR doesn't scan, copy the line below and paste in the app:`);
|
|
162
|
+
process.stdout.write("\n" + qrText + "\n\n");
|
|
163
|
+
api.logger.info(`[soyeht] Expires in ${AUTO_PAIRING_TTL_MS / 1000}s — restart plugin to generate a new one`);
|
|
156
164
|
}
|
|
157
165
|
|
|
158
166
|
// ---------------------------------------------------------------------------
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PLUGIN_VERSION = "0.2.
|
|
1
|
+
export const PLUGIN_VERSION = "0.2.7";
|