@ozaiya/openclaw-channel 0.10.28 → 0.10.30
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/src/api.d.ts +6 -2
- package/dist/src/api.js +7 -3
- package/dist/src/api.js.map +1 -1
- package/dist/src/channel.js +19 -2
- package/dist/src/channel.js.map +1 -1
- package/dist/src/crypto.d.ts +13 -0
- package/dist/src/crypto.js +21 -0
- package/dist/src/crypto.js.map +1 -1
- package/dist/src/gateway.js +150 -36
- package/dist/src/gateway.js.map +1 -1
- package/dist/src/h264Packetizer.d.ts +55 -0
- package/dist/src/h264Packetizer.js +153 -0
- package/dist/src/h264Packetizer.js.map +1 -0
- package/dist/src/sandboxScreenCdp.d.ts +15 -0
- package/dist/src/sandboxScreenCdp.js +41 -2
- package/dist/src/sandboxScreenCdp.js.map +1 -1
- package/dist/src/sandboxScreenH264.d.ts +26 -0
- package/dist/src/sandboxScreenH264.js +184 -0
- package/dist/src/sandboxScreenH264.js.map +1 -0
- package/dist/src/sandboxScreenRtc.d.ts +19 -6
- package/dist/src/sandboxScreenRtc.js +181 -59
- package/dist/src/sandboxScreenRtc.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WebRTC P2P transport for the bot sandbox computer view (RustDesk-style direct tier).
|
|
3
3
|
*
|
|
4
|
-
* Normally the bot screen is relayed: browser → server → gateway
|
|
5
|
-
*
|
|
6
|
-
* the
|
|
7
|
-
*
|
|
4
|
+
* Normally the bot screen is relayed: browser → server → gateway, with BOTH legs
|
|
5
|
+
* proxied (Cloudflare) — that double hop is the dominant latency. This adds a direct
|
|
6
|
+
* tier: the viewer and this plugin negotiate a WebRTC DataChannel (P2P when the NAT
|
|
7
|
+
* allows it, TURN via coturn otherwise — one lean UDP hop) and the CDP JPEG frames +
|
|
8
|
+
* takeover input ride that channel, skipping the cloud relay entirely. Frames are
|
|
9
|
+
* stateless self-contained JPEGs, so they render cleanly over the DataChannel
|
|
10
|
+
* (unlike the old stateful VNC/RFB stream, which stalled).
|
|
8
11
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
+
* On top of the DataChannel, when the gateway has a working ffmpeg (enableVideo)
|
|
13
|
+
* and the viewer's offer includes an m=video section, we ALSO answer with a
|
|
14
|
+
* sendonly H.264 media track — the JPEG poll then feeds an ffmpeg transcoder and
|
|
15
|
+
* the video rides RTP/SRTP with native browser decode (mirrors the machine-screen
|
|
16
|
+
* daemon's proven werift media mode). Inter-frame compression carries ~20fps where
|
|
17
|
+
* independent JPEGs managed ~10 on the same uplink. Ladder: H.264 media track →
|
|
18
|
+
* JPEG DataChannel → JPEG relay.
|
|
19
|
+
*
|
|
20
|
+
* Transport ladder fallback is automatic: if the channel never opens or drops, the
|
|
21
|
+
* relay (kept connected as the signaling pipe) resumes carrying frames. Signaling
|
|
22
|
+
* rides the existing sandbox-screen relay WS as JSON **text**; the server never has
|
|
23
|
+
* to parse anything.
|
|
12
24
|
*
|
|
13
25
|
* The viewer is the OFFERER (mirrors the machine-screen path); this plugin is the
|
|
14
|
-
* ANSWERER.
|
|
15
|
-
*
|
|
26
|
+
* ANSWERER. The peer connection is built lazily when the offer arrives, so codec
|
|
27
|
+
* config can depend on what the viewer offered. `werift` is pure-TS (no native
|
|
28
|
+
* build) and loaded lazily, so a gateway without it simply keeps using the relay.
|
|
16
29
|
*/
|
|
17
30
|
import { createRequire } from "node:module";
|
|
18
31
|
const esmRequire = createRequire(import.meta.url);
|
|
@@ -28,6 +41,27 @@ function getWerift() {
|
|
|
28
41
|
}
|
|
29
42
|
return weriftModule;
|
|
30
43
|
}
|
|
44
|
+
let packetizerModule;
|
|
45
|
+
function getPacketizer() {
|
|
46
|
+
if (packetizerModule === undefined) {
|
|
47
|
+
try {
|
|
48
|
+
// Static import would make werift a hard dependency of the plugin entry;
|
|
49
|
+
// resolved lazily so a werift-less install still loads (relay-only).
|
|
50
|
+
packetizerModule = esmRequire("./h264Packetizer.js");
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
packetizerModule = null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return packetizerModule;
|
|
57
|
+
}
|
|
58
|
+
const H264_RTCP_FEEDBACK = [
|
|
59
|
+
{ type: "nack" },
|
|
60
|
+
{ type: "nack", parameter: "pli" },
|
|
61
|
+
{ type: "goog-remb" },
|
|
62
|
+
{ type: "transport-cc" },
|
|
63
|
+
{ type: "ccm", parameter: "fir" },
|
|
64
|
+
];
|
|
31
65
|
/**
|
|
32
66
|
* Create an answerer WebRTC session for one viewer. Returns null when werift is
|
|
33
67
|
* unavailable so the caller transparently falls back to the relay pipe.
|
|
@@ -41,73 +75,132 @@ export function createSandboxRtcSession(opts) {
|
|
|
41
75
|
const iceServers = opts.iceServers && opts.iceServers.length
|
|
42
76
|
? opts.iceServers
|
|
43
77
|
: [{ urls: "stun:stun.l.google.com:19302" }];
|
|
44
|
-
let pc;
|
|
78
|
+
let pc = null;
|
|
45
79
|
let dc = null;
|
|
46
80
|
let active = false;
|
|
47
81
|
let closed = false;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
pc.onIceCandidate.subscribe((candidate) => {
|
|
56
|
-
if (!candidate || closed)
|
|
82
|
+
let mediaReady = false;
|
|
83
|
+
let videoTrack = null;
|
|
84
|
+
let packetizer = null;
|
|
85
|
+
let tsBaseNs = null;
|
|
86
|
+
const earlyIce = []; // candidates that beat the offer
|
|
87
|
+
const setMediaReady = (ready) => {
|
|
88
|
+
if (mediaReady === ready)
|
|
57
89
|
return;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
90
|
+
mediaReady = ready;
|
|
91
|
+
opts.onMediaStateChange?.(ready);
|
|
92
|
+
};
|
|
93
|
+
/** Build the peer once the offer is known (codec config depends on it). */
|
|
94
|
+
function buildPeer(offerSdp) {
|
|
95
|
+
const pkt = getPacketizer();
|
|
96
|
+
const wantsVideo = !!opts.enableVideo && /\bm=video\b/.test(offerSdp) && !!pkt;
|
|
97
|
+
const config = { iceServers };
|
|
98
|
+
if (wantsVideo) {
|
|
99
|
+
config.codecs = {
|
|
100
|
+
video: [
|
|
101
|
+
new werift.RTCRtpCodecParameters({
|
|
102
|
+
mimeType: "video/H264",
|
|
103
|
+
clockRate: 90000,
|
|
104
|
+
rtcpFeedback: H264_RTCP_FEEDBACK,
|
|
105
|
+
parameters: "level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f",
|
|
106
|
+
}),
|
|
107
|
+
],
|
|
108
|
+
};
|
|
109
|
+
config.headerExtensions = {
|
|
110
|
+
video: [werift.useSdesMid(), werift.useAbsSendTime(), werift.useTransportWideCC()],
|
|
111
|
+
};
|
|
72
112
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
113
|
+
pc = new werift.RTCPeerConnection(config);
|
|
114
|
+
if (wantsVideo && pkt) {
|
|
115
|
+
videoTrack = new werift.MediaStreamTrack({ kind: "video" });
|
|
116
|
+
const transceiver = pc.addTransceiver(videoTrack, { direction: "sendonly" });
|
|
117
|
+
packetizer = new pkt.H264Packetizer();
|
|
118
|
+
// Viewer lost frames it can't recover via NACK — with a ≤1s GOP the next
|
|
119
|
+
// IDR lands soon, so PLI is informational here.
|
|
120
|
+
transceiver.sender.onPictureLossIndication.subscribe(() => {
|
|
121
|
+
opts.log?.info?.("[sandbox-rtc] PLI from viewer (next keyframe ≤1s away)");
|
|
122
|
+
});
|
|
123
|
+
opts.log?.info?.("[sandbox-rtc] answering with sendonly H.264 track");
|
|
124
|
+
}
|
|
125
|
+
pc.onIceCandidate.subscribe((candidate) => {
|
|
126
|
+
if (!candidate || closed)
|
|
79
127
|
return;
|
|
80
|
-
opts.
|
|
128
|
+
opts.sendSignal(JSON.stringify({
|
|
129
|
+
type: "rtc-ice",
|
|
130
|
+
candidate: JSON.stringify({
|
|
131
|
+
candidate: candidate.candidate,
|
|
132
|
+
sdpMid: candidate.sdpMid ?? null,
|
|
133
|
+
sdpMLineIndex: candidate.sdpMLineIndex ?? null,
|
|
134
|
+
}),
|
|
135
|
+
}));
|
|
81
136
|
});
|
|
82
|
-
|
|
83
|
-
if (
|
|
137
|
+
pc.connectionStateChange.subscribe((state) => {
|
|
138
|
+
if (closed)
|
|
84
139
|
return;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (!closed)
|
|
140
|
+
if (state === "connected") {
|
|
141
|
+
if (videoTrack)
|
|
142
|
+
setMediaReady(true);
|
|
143
|
+
}
|
|
144
|
+
else if (state === "failed" || state === "closed" || state === "disconnected") {
|
|
145
|
+
setMediaReady(false);
|
|
146
|
+
// Terminal failure before the channel ever opened → let the caller keep
|
|
147
|
+
// the relay alive (it does anyway). 'disconnected' may recover.
|
|
148
|
+
if ((state === "failed" || state === "closed") && !active)
|
|
95
149
|
opts.onClosed();
|
|
96
150
|
}
|
|
97
151
|
});
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
152
|
+
pc.onDataChannel.subscribe((channel) => {
|
|
153
|
+
dc = channel;
|
|
154
|
+
opts.log?.info?.(`[sandbox-rtc] onDataChannel readyState=${channel.readyState}`);
|
|
155
|
+
channel.onMessage.subscribe((msg) => {
|
|
156
|
+
if (closed)
|
|
157
|
+
return;
|
|
158
|
+
// Preserve text vs binary: text = JSON control (input/viewport), binary =
|
|
159
|
+
// the app's compact input encoding.
|
|
160
|
+
if (typeof msg === "string")
|
|
161
|
+
opts.onData(msg);
|
|
162
|
+
else
|
|
163
|
+
opts.onData(Buffer.isBuffer(msg) ? msg : Buffer.from(msg));
|
|
164
|
+
});
|
|
165
|
+
const markOpen = () => {
|
|
166
|
+
if (active || closed)
|
|
167
|
+
return;
|
|
168
|
+
active = true;
|
|
169
|
+
opts.log?.info?.("[sandbox-rtc] DataChannel open — P2P carrying the screencast");
|
|
170
|
+
opts.onActive();
|
|
171
|
+
};
|
|
172
|
+
channel.stateChanged.subscribe((state) => {
|
|
173
|
+
if (state === "open")
|
|
174
|
+
markOpen();
|
|
175
|
+
else if (state === "closed") {
|
|
176
|
+
active = false;
|
|
177
|
+
if (!closed)
|
|
178
|
+
opts.onClosed();
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
// werift may hand over an ALREADY-open channel (more likely over the slower
|
|
182
|
+
// TURN-relayed path) — stateChanged won't re-fire 'open', so check now.
|
|
183
|
+
if (channel.readyState === "open")
|
|
184
|
+
markOpen();
|
|
185
|
+
});
|
|
186
|
+
}
|
|
103
187
|
async function handleOffer(sdp) {
|
|
188
|
+
if (!pc)
|
|
189
|
+
buildPeer(sdp);
|
|
104
190
|
await pc.setRemoteDescription({ type: "offer", sdp });
|
|
105
191
|
const answer = await pc.createAnswer();
|
|
106
192
|
await pc.setLocalDescription(answer);
|
|
107
193
|
opts.sendSignal(JSON.stringify({ type: "rtc-answer", sdp: pc.localDescription?.sdp ?? answer.sdp }));
|
|
194
|
+
for (const c of earlyIce.splice(0)) {
|
|
195
|
+
pc.addIceCandidate(c).catch(() => { });
|
|
196
|
+
}
|
|
108
197
|
}
|
|
109
198
|
async function handleIce(candidate) {
|
|
110
199
|
const parsed = typeof candidate === "string" ? JSON.parse(candidate) : candidate;
|
|
200
|
+
if (!pc) {
|
|
201
|
+
earlyIce.push(parsed);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
111
204
|
await pc.addIceCandidate(parsed);
|
|
112
205
|
}
|
|
113
206
|
return {
|
|
@@ -128,20 +221,49 @@ export function createSandboxRtcSession(opts) {
|
|
|
128
221
|
handleIce(msg.candidate).catch((e) => opts.log?.warn?.(`[sandbox-rtc] ice error: ${String(e)}`));
|
|
129
222
|
}
|
|
130
223
|
},
|
|
131
|
-
sendToViewer: (
|
|
224
|
+
sendToViewer: (data) => {
|
|
132
225
|
if (!active || !dc)
|
|
133
226
|
return;
|
|
134
227
|
try {
|
|
135
|
-
dc.send(
|
|
228
|
+
dc.send(data);
|
|
136
229
|
}
|
|
137
230
|
catch {
|
|
138
231
|
/* channel closing */
|
|
139
232
|
}
|
|
140
233
|
},
|
|
141
234
|
isActive: () => active,
|
|
235
|
+
getBufferedAmount: () => {
|
|
236
|
+
try {
|
|
237
|
+
return Number(dc?.bufferedAmount ?? 0) || 0;
|
|
238
|
+
}
|
|
239
|
+
catch {
|
|
240
|
+
return 0;
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
isMediaReady: () => mediaReady && !closed,
|
|
244
|
+
sendVideoFrame: (accessUnit) => {
|
|
245
|
+
if (closed || !mediaReady || !videoTrack || !packetizer)
|
|
246
|
+
return false;
|
|
247
|
+
const now = process.hrtime.bigint();
|
|
248
|
+
if (tsBaseNs === null)
|
|
249
|
+
tsBaseNs = now;
|
|
250
|
+
// 90 kHz RTP timestamp from a monotonic clock — inter-frame spacing stays
|
|
251
|
+
// accurate regardless of the (backpressure-varying) capture rate.
|
|
252
|
+
const rtpTs = Number(((now - tsBaseNs) * 90000n) / 1000000000n) >>> 0;
|
|
253
|
+
try {
|
|
254
|
+
for (const p of packetizer.packetize(accessUnit, rtpTs)) {
|
|
255
|
+
videoTrack.writeRtp(p);
|
|
256
|
+
}
|
|
257
|
+
return true;
|
|
258
|
+
}
|
|
259
|
+
catch {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
},
|
|
142
263
|
close: () => {
|
|
143
264
|
closed = true;
|
|
144
265
|
active = false;
|
|
266
|
+
setMediaReady(false);
|
|
145
267
|
try {
|
|
146
268
|
dc?.close?.();
|
|
147
269
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandboxScreenRtc.js","sourceRoot":"","sources":["../../src/sandboxScreenRtc.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sandboxScreenRtc.js","sourceRoot":"","sources":["../../src/sandboxScreenRtc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAElD,IAAI,YAAqB,CAAC;AAC1B,SAAS,SAAS;IAChB,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,IAAI,CAAC;YACH,YAAY,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;QACtC,CAAC;QAAC,MAAM,CAAC;YACP,YAAY,GAAG,IAAI,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO,YAAmB,CAAC;AAC7B,CAAC;AAED,IAAI,gBAAyB,CAAC;AAC9B,SAAS,aAAa;IACpB,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACnC,IAAI,CAAC;YACH,yEAAyE;YACzE,qEAAqE;YACrE,gBAAgB,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC;QACvD,CAAC;QAAC,MAAM,CAAC;YACP,gBAAgB,GAAG,IAAI,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,OAAO,gBAA+D,CAAC;AACzE,CAAC;AAED,MAAM,kBAAkB,GAAG;IACzB,EAAE,IAAI,EAAE,MAAM,EAAE;IAChB,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE;IAClC,EAAE,IAAI,EAAE,WAAW,EAAE;IACrB,EAAE,IAAI,EAAE,cAAc,EAAE;IACxB,EAAE,IAAI,EAAE,KAAK,E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