@codingfrees/uap-device-control 0.1.11 → 0.1.13
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.
|
@@ -407,7 +407,7 @@ import path4 from "node:path";
|
|
|
407
407
|
// package.json
|
|
408
408
|
var package_default = {
|
|
409
409
|
name: "@codingfrees/uap-device-control",
|
|
410
|
-
version: "0.1.
|
|
410
|
+
version: "0.1.13",
|
|
411
411
|
description: "Cross-platform outbound UAP Device Control client",
|
|
412
412
|
type: "module",
|
|
413
413
|
bin: {
|
|
@@ -1539,7 +1539,12 @@ async function createBrowserBridge(stateDirectory, requestedPort = 8800, log) {
|
|
|
1539
1539
|
return send(response, 200, { token, port: actualPort(server) }, origin);
|
|
1540
1540
|
}
|
|
1541
1541
|
const current = authorize(request2, origin, pairing);
|
|
1542
|
-
if (url.pathname === "/browser/status" && request2.method === "POST")
|
|
1542
|
+
if (url.pathname === "/browser/status" && request2.method === "POST") {
|
|
1543
|
+
const wasOffline = Date.now() - lastSeen >= 45e3;
|
|
1544
|
+
lastSeen = Date.now();
|
|
1545
|
+
if (wasOffline) log?.({ event: "browser.bridge", status: "connected" });
|
|
1546
|
+
return send(response, 200, { paired: true, online: true, permissionsGranted }, current.origin);
|
|
1547
|
+
}
|
|
1543
1548
|
if (url.pathname === "/browser/unpair" && request2.method === "POST") {
|
|
1544
1549
|
pairing = void 0;
|
|
1545
1550
|
pairingCode = createPairingCode();
|
|
@@ -1599,9 +1604,6 @@ async function createBrowserBridge(stateDirectory, requestedPort = 8800, log) {
|
|
|
1599
1604
|
get port() {
|
|
1600
1605
|
return actualPort(server);
|
|
1601
1606
|
},
|
|
1602
|
-
get paired() {
|
|
1603
|
-
return Boolean(pairing);
|
|
1604
|
-
},
|
|
1605
1607
|
capabilities: BROWSER_CONTROL_CAPABILITIES,
|
|
1606
1608
|
get pairingCode() {
|
|
1607
1609
|
return pairingCode;
|
|
@@ -1748,7 +1750,7 @@ async function runRemote(options) {
|
|
|
1748
1750
|
return void 0;
|
|
1749
1751
|
});
|
|
1750
1752
|
if (browser) {
|
|
1751
|
-
options.log?.({ event: "browser.bridge", status: "ready", port: browser.port,
|
|
1753
|
+
options.log?.({ event: "browser.bridge", status: "ready", port: browser.port, pairingStored: !browser.pairingCode });
|
|
1752
1754
|
if (browser.pairingCode) options.log?.({ event: "browser.bridge", status: "pairing-required", port: browser.port, pairingCode: browser.pairingCode });
|
|
1753
1755
|
}
|
|
1754
1756
|
const engine = new DeviceAgentEngine({
|
|
@@ -2193,7 +2195,7 @@ function formatCliEvent(event, json2 = false) {
|
|
|
2193
2195
|
return "\u2705 " + tool + " \xB7 completed" + summary2;
|
|
2194
2196
|
}
|
|
2195
2197
|
if (event.event === "browser.bridge") {
|
|
2196
|
-
if (status === "ready") return "\u{1F310} Browser bridge ready \xB7 127.0.0.1:" + String(event.port) + (event.
|
|
2198
|
+
if (status === "ready") return "\u{1F310} Browser bridge ready \xB7 127.0.0.1:" + String(event.port) + (event.pairingStored ? " \xB7 pairing saved \xB7 extension offline" : " \xB7 waiting for pairing");
|
|
2197
2199
|
if (status === "pairing-required") return "\u26A0\uFE0F Browser extension not connected; remote control continues without browser tools \xB7 pairing code " + String(event.pairingCode) + " \xB7 port " + String(event.port);
|
|
2198
2200
|
if (status === "unavailable") return "\u26A0\uFE0F Browser control unavailable; remote control continues with files, terminal and processes";
|
|
2199
2201
|
if (status === "paired") return "\u2705 UAP Browser Extension paired";
|