@nopeek/agent-bridge 0.7.1 → 0.7.2
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/bridge.d.ts +1 -1
- package/dist/bridge.js +1 -1
- package/dist/control.d.ts +1 -0
- package/dist/control.js +17 -0
- package/package.json +1 -1
package/dist/bridge.d.ts
CHANGED
package/dist/bridge.js
CHANGED
|
@@ -17,7 +17,7 @@ import { resolveBrain } from "./brain.js";
|
|
|
17
17
|
import { provisionSoul, provisionHermesProfile } from "./backends.js";
|
|
18
18
|
import { reportCapabilities } from "./capabilities.js";
|
|
19
19
|
import { isBrainBackend } from "./config.js";
|
|
20
|
-
export const VERSION = "0.7.
|
|
20
|
+
export const VERSION = "0.7.2";
|
|
21
21
|
/** How often to re-probe + report brain availability to the server. */
|
|
22
22
|
const CAPABILITIES_INTERVAL_MS = 5 * 60_000;
|
|
23
23
|
export class PairError extends Error {
|
package/dist/control.d.ts
CHANGED
package/dist/control.js
CHANGED
|
@@ -9,6 +9,7 @@ export class ControlSocket {
|
|
|
9
9
|
handlers;
|
|
10
10
|
ws = null;
|
|
11
11
|
stopped = false;
|
|
12
|
+
heartbeat = null;
|
|
12
13
|
delay = 2_000;
|
|
13
14
|
/** Log tag — with several sockets running, lines must say whose they are. */
|
|
14
15
|
tag;
|
|
@@ -47,6 +48,18 @@ export class ControlSocket {
|
|
|
47
48
|
this.ws = ws;
|
|
48
49
|
ws.onopen = () => {
|
|
49
50
|
console.log(`${this.tag} socket open, awaiting auth.ok`);
|
|
51
|
+
// Heartbeat: the server closes sockets idle >60s; the SDK pings every
|
|
52
|
+
// 25s and so do we — otherwise the control socket flaps once a minute
|
|
53
|
+
// and adopt/config pushes can land in a reconnect gap.
|
|
54
|
+
this.heartbeat = setInterval(() => {
|
|
55
|
+
try {
|
|
56
|
+
ws.send(JSON.stringify({ type: "ping" }));
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
/* mid-close */
|
|
60
|
+
}
|
|
61
|
+
}, 25_000);
|
|
62
|
+
this.heartbeat.unref?.();
|
|
50
63
|
};
|
|
51
64
|
ws.onmessage = (ev) => {
|
|
52
65
|
let frame;
|
|
@@ -63,6 +76,10 @@ export class ControlSocket {
|
|
|
63
76
|
// onclose always follows; log there.
|
|
64
77
|
};
|
|
65
78
|
ws.onclose = (ev) => {
|
|
79
|
+
if (this.heartbeat) {
|
|
80
|
+
clearInterval(this.heartbeat);
|
|
81
|
+
this.heartbeat = null;
|
|
82
|
+
}
|
|
66
83
|
const was = this.connected;
|
|
67
84
|
this.connected = false;
|
|
68
85
|
if (this.stopped)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nopeek/agent-bridge",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Run your own agents as E2EE NoPeek bots. Pairs with one-time codes (multiple accounts per computer), runs every bot each account owns, and pipes messages to any command or webhook.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|