@tianshu-ai/local-bridge 0.7.0 → 0.7.1
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/connection.js +82 -0
- package/dist/connection.js.map +1 -1
- package/package.json +1 -1
package/dist/connection.js
CHANGED
|
@@ -7,6 +7,19 @@ import WebSocket from "ws";
|
|
|
7
7
|
import { MSG, textResult } from "./protocol.js";
|
|
8
8
|
const RECONNECT_BASE_MS = 1000;
|
|
9
9
|
const RECONNECT_MAX_MS = 30_000;
|
|
10
|
+
// Heartbeat: proactively detect "half-open" / silently-dead sockets
|
|
11
|
+
// that never fire a `close` event (Wi-Fi switch, laptop sleep, NAT
|
|
12
|
+
// timeout, server process vanished without a TCP FIN). We send a WS
|
|
13
|
+
// ping every HEARTBEAT_MS; the server auto-replies with pong (RFC
|
|
14
|
+
// default in the `ws` lib). If we go DEAD_AFTER_MS without ANY sign of
|
|
15
|
+
// life (no pong, no message, nothing buffered to send, no tool call in
|
|
16
|
+
// flight) we consider the socket dead and terminate it — that fires
|
|
17
|
+
// `close`, which runs the normal reconnect-with-backoff path.
|
|
18
|
+
const HEARTBEAT_MS = 25_000;
|
|
19
|
+
// A socket is declared dead after ~2.5 missed heartbeats of total
|
|
20
|
+
// silence. Kept comfortably above HEARTBEAT_MS so one slow round-trip
|
|
21
|
+
// doesn't nuke a healthy link.
|
|
22
|
+
const DEAD_AFTER_MS = 65_000;
|
|
10
23
|
export class BridgeConnection {
|
|
11
24
|
opts;
|
|
12
25
|
ws = null;
|
|
@@ -14,6 +27,13 @@ export class BridgeConnection {
|
|
|
14
27
|
attempt = 0;
|
|
15
28
|
toolsByName = new Map();
|
|
16
29
|
log;
|
|
30
|
+
// Liveness tracking. `lastActivityAt` bumps on any inbound frame,
|
|
31
|
+
// pong, or successful send. `inFlight` counts tool calls currently
|
|
32
|
+
// executing — a busy connection is by definition alive + must not be
|
|
33
|
+
// torn down mid-task.
|
|
34
|
+
lastActivityAt = 0;
|
|
35
|
+
inFlight = 0;
|
|
36
|
+
heartbeatTimer = null;
|
|
17
37
|
constructor(opts) {
|
|
18
38
|
this.opts = opts;
|
|
19
39
|
this.log = opts.log ?? ((m) => console.log(m));
|
|
@@ -26,6 +46,7 @@ export class BridgeConnection {
|
|
|
26
46
|
}
|
|
27
47
|
stop() {
|
|
28
48
|
this.closed = true;
|
|
49
|
+
this.stopHeartbeat();
|
|
29
50
|
try {
|
|
30
51
|
this.ws?.send(JSON.stringify({ type: MSG.unregister }));
|
|
31
52
|
}
|
|
@@ -35,6 +56,51 @@ export class BridgeConnection {
|
|
|
35
56
|
this.ws?.close();
|
|
36
57
|
this.ws = null;
|
|
37
58
|
}
|
|
59
|
+
/** Is this connection currently doing work? True while one or more
|
|
60
|
+
* tool calls are executing, or while there are bytes still queued
|
|
61
|
+
* to send (e.g. a large tool result mid-flight). Used by the
|
|
62
|
+
* heartbeat so we never tear down a busy socket. */
|
|
63
|
+
isBusy() {
|
|
64
|
+
return this.inFlight > 0 || (this.ws?.bufferedAmount ?? 0) > 0;
|
|
65
|
+
}
|
|
66
|
+
// ── heartbeat ────────────────────────────────────────────────
|
|
67
|
+
startHeartbeat(ws) {
|
|
68
|
+
this.stopHeartbeat();
|
|
69
|
+
this.heartbeatTimer = setInterval(() => {
|
|
70
|
+
if (this.ws !== ws || ws.readyState !== WebSocket.OPEN)
|
|
71
|
+
return;
|
|
72
|
+
// A busy or recently-active socket is alive by definition —
|
|
73
|
+
// don't judge it dead, just keep pinging.
|
|
74
|
+
const silentFor = Date.now() - this.lastActivityAt;
|
|
75
|
+
if (silentFor >= DEAD_AFTER_MS && !this.isBusy()) {
|
|
76
|
+
this.log(`no response for ${Math.round(silentFor / 1000)}s — assuming dead link, forcing reconnect`);
|
|
77
|
+
// terminate() (not close()) drops a half-open socket
|
|
78
|
+
// immediately; the 'close' handler then runs reconnect.
|
|
79
|
+
try {
|
|
80
|
+
ws.terminate();
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
/* ignore */
|
|
84
|
+
}
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
// Otherwise probe: server auto-pongs, bumping lastActivityAt.
|
|
88
|
+
try {
|
|
89
|
+
ws.ping();
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
/* ignore — a failed ping surfaces via error/close */
|
|
93
|
+
}
|
|
94
|
+
}, HEARTBEAT_MS);
|
|
95
|
+
// Don't let the heartbeat keep the process alive on its own.
|
|
96
|
+
this.heartbeatTimer.unref?.();
|
|
97
|
+
}
|
|
98
|
+
stopHeartbeat() {
|
|
99
|
+
if (this.heartbeatTimer) {
|
|
100
|
+
clearInterval(this.heartbeatTimer);
|
|
101
|
+
this.heartbeatTimer = null;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
38
104
|
connect() {
|
|
39
105
|
const headers = {};
|
|
40
106
|
if (this.opts.token)
|
|
@@ -43,6 +109,7 @@ export class BridgeConnection {
|
|
|
43
109
|
this.ws = ws;
|
|
44
110
|
ws.on("open", () => {
|
|
45
111
|
this.attempt = 0;
|
|
112
|
+
this.lastActivityAt = Date.now();
|
|
46
113
|
this.log(`connected to ${this.opts.server}`);
|
|
47
114
|
const reg = {
|
|
48
115
|
type: MSG.register,
|
|
@@ -51,8 +118,14 @@ export class BridgeConnection {
|
|
|
51
118
|
tools: this.opts.tools.map((t) => t.descriptor),
|
|
52
119
|
};
|
|
53
120
|
ws.send(JSON.stringify(reg));
|
|
121
|
+
this.startHeartbeat(ws);
|
|
122
|
+
});
|
|
123
|
+
// Any pong is a sign of life. (Server auto-pongs our pings.)
|
|
124
|
+
ws.on("pong", () => {
|
|
125
|
+
this.lastActivityAt = Date.now();
|
|
54
126
|
});
|
|
55
127
|
ws.on("message", (raw) => {
|
|
128
|
+
this.lastActivityAt = Date.now();
|
|
56
129
|
let msg;
|
|
57
130
|
try {
|
|
58
131
|
msg = JSON.parse(raw.toString());
|
|
@@ -78,6 +151,7 @@ export class BridgeConnection {
|
|
|
78
151
|
}
|
|
79
152
|
});
|
|
80
153
|
ws.on("close", () => {
|
|
154
|
+
this.stopHeartbeat();
|
|
81
155
|
this.ws = null;
|
|
82
156
|
if (this.closed)
|
|
83
157
|
return;
|
|
@@ -121,6 +195,10 @@ export class BridgeConnection {
|
|
|
121
195
|
this.send({ type: MSG.response, id: req.id, error: { code: -32602, message: `unknown tool: ${params.name}` } });
|
|
122
196
|
return;
|
|
123
197
|
}
|
|
198
|
+
// Mark the connection busy for the duration of the tool call so
|
|
199
|
+
// the heartbeat never tears it down mid-task (a slow tool =
|
|
200
|
+
// silence on the wire, but the link is fine).
|
|
201
|
+
this.inFlight += 1;
|
|
124
202
|
try {
|
|
125
203
|
const result = await tool.run(params.arguments ?? {});
|
|
126
204
|
this.send({ type: MSG.response, id: req.id, result });
|
|
@@ -132,6 +210,10 @@ export class BridgeConnection {
|
|
|
132
210
|
result: textResult(`tool "${params.name}" failed: ${err instanceof Error ? err.message : String(err)}`, true),
|
|
133
211
|
});
|
|
134
212
|
}
|
|
213
|
+
finally {
|
|
214
|
+
this.inFlight = Math.max(0, this.inFlight - 1);
|
|
215
|
+
this.lastActivityAt = Date.now();
|
|
216
|
+
}
|
|
135
217
|
}
|
|
136
218
|
}
|
|
137
219
|
//# sourceMappingURL=connection.js.map
|
package/dist/connection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,EAAE;AACF,0EAA0E;AAC1E,mEAAmE;AACnE,2DAA2D;AAE3D,OAAO,SAAS,MAAM,IAAI,CAAC;AAC3B,OAAO,EAAE,GAAG,EAAE,UAAU,EAAuE,MAAM,eAAe,CAAC;AAWrH,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAC/B,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEhC,MAAM,OAAO,gBAAgB;
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":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EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,iBAAiB,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;YAChH,OAAO;QACT,CAAC;QACD,gEAAgE;QAChE,4DAA4D;QAC5D,8CAA8C;QAC9C,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC;QACnB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;YACtD,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QACxD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,IAAI,CAAC;gBACR,IAAI,EAAE,GAAG,CAAC,QAAQ;gBAClB,EAAE,EAAE,GAAG,CAAC,EAAE;gBACV,MAAM,EAAE,UAAU,CAAC,SAAS,MAAM,CAAC,IAAI,aAAa,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC;aAC9G,CAAC,CAAC;QACL,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;YAC/C,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACnC,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tianshu-ai/local-bridge",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Local bridge for tianshu — dial into a tianshu server over WebSocket and expose your machine's tools (browser, files, shell) to the agent via reverse-MCP.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|