@agentconnect.md/computer 2.8.0-rc.22 → 2.8.0-rc.23
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/agentconnect-computer.mjs +33 -15
- package/package.json +1 -1
|
@@ -87124,7 +87124,7 @@ var serviceEntry = () => managedEntry() ?? resolve2(process.argv[1]);
|
|
|
87124
87124
|
|
|
87125
87125
|
// src/version.ts
|
|
87126
87126
|
init_define_AGENTCONNECT_COMPUTER_WINDOWS_SOURCES();
|
|
87127
|
-
var COMPUTER_DAEMON_VERSION = true ? "2.8.0-rc.
|
|
87127
|
+
var COMPUTER_DAEMON_VERSION = true ? "2.8.0-rc.23" : JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
87128
87128
|
|
|
87129
87129
|
// src/http-server.ts
|
|
87130
87130
|
var CONTROL_HEADER = "x-agentconnect-computer";
|
|
@@ -98262,7 +98262,7 @@ function canPairTcpCandidates(local, remote) {
|
|
|
98262
98262
|
return localType === "active" && remoteType === "passive" || localType === "passive" && remoteType === "active" || localType === "so" && remoteType === "so";
|
|
98263
98263
|
}
|
|
98264
98264
|
function candidateLocalPreference({
|
|
98265
|
-
candidateType,
|
|
98265
|
+
candidateType: candidateType2,
|
|
98266
98266
|
transport = "udp",
|
|
98267
98267
|
tcptype,
|
|
98268
98268
|
otherPreference = 8191
|
|
@@ -98271,27 +98271,27 @@ function candidateLocalPreference({
|
|
|
98271
98271
|
return otherPreference;
|
|
98272
98272
|
}
|
|
98273
98273
|
const tcpType = normalizeTcpType(tcptype) ?? "active";
|
|
98274
|
-
const directionPreference =
|
|
98274
|
+
const directionPreference = candidateType2 === "srflx" || candidateType2 === "prflx" ? REFLEXIVE_DIRECTION_PREFERENCE[tcpType] : ACTIVE_PASSIVE_DIRECTION_PREFERENCE[tcpType];
|
|
98275
98275
|
return (1 << 13) * directionPreference + otherPreference;
|
|
98276
98276
|
}
|
|
98277
|
-
function candidateTypePreference(
|
|
98277
|
+
function candidateTypePreference(candidateType2, transport = "udp") {
|
|
98278
98278
|
const table = normalizeTransport(transport) === "tcp" ? TCP_TYPE_PREFERENCE : UDP_TYPE_PREFERENCE;
|
|
98279
|
-
return table[
|
|
98279
|
+
return table[candidateType2] ?? 0;
|
|
98280
98280
|
}
|
|
98281
|
-
function candidateFoundation(
|
|
98282
|
-
const key = `${
|
|
98281
|
+
function candidateFoundation(candidateType2, candidateTransport, baseAddress) {
|
|
98282
|
+
const key = `${candidateType2}|${candidateTransport}|${baseAddress}`;
|
|
98283
98283
|
return createHash32("md5").update(key, "ascii").digest("hex").slice(7);
|
|
98284
98284
|
}
|
|
98285
|
-
function candidatePriority(
|
|
98285
|
+
function candidatePriority(candidateType2, options = 65535) {
|
|
98286
98286
|
const candidateComponent = 1;
|
|
98287
98287
|
const transport = typeof options === "number" ? "udp" : normalizeTransport(options.transport);
|
|
98288
98288
|
const localPref = typeof options === "number" ? options : options.localPreference ?? candidateLocalPreference({
|
|
98289
|
-
candidateType,
|
|
98289
|
+
candidateType: candidateType2,
|
|
98290
98290
|
transport,
|
|
98291
98291
|
tcptype: options.tcptype,
|
|
98292
98292
|
otherPreference: options.otherPreference
|
|
98293
98293
|
});
|
|
98294
|
-
const typePref = candidateTypePreference(
|
|
98294
|
+
const typePref = candidateTypePreference(candidateType2, transport);
|
|
98295
98295
|
return (1 << 24) * typePref + (1 << 8) * localPref + (256 - candidateComponent);
|
|
98296
98296
|
}
|
|
98297
98297
|
function remoteTcpTypeForIncoming(localTcpType) {
|
|
@@ -109869,6 +109869,7 @@ var GATHER_TIMEOUT_MS = 3e3;
|
|
|
109869
109869
|
var TURN_GATHER_TIMEOUT_MS = 8e3;
|
|
109870
109870
|
var STUN_GATHER_TIMEOUT_MS = 2e3;
|
|
109871
109871
|
var MAX_REMOTE_CANDIDATES = 64;
|
|
109872
|
+
var RELEASE_DELAY_MS = 100;
|
|
109872
109873
|
var ANSWER_TIMEOUT_MS2 = 3e4;
|
|
109873
109874
|
var SILENCE_TIMEOUT_MS = 1e4;
|
|
109874
109875
|
var h264 = () => new RTCRtpCodecParameters({
|
|
@@ -109943,12 +109944,17 @@ var RtcSessions = class {
|
|
|
109943
109944
|
pc,
|
|
109944
109945
|
lastSeen: Date.now(),
|
|
109945
109946
|
candidates: [],
|
|
109946
|
-
gathered: false
|
|
109947
|
+
gathered: false,
|
|
109948
|
+
...transport === "stun" ? { held: [] } : {}
|
|
109947
109949
|
};
|
|
109948
109950
|
pc.onIceCandidate.subscribe((candidate) => {
|
|
109949
109951
|
if (!candidate) return void (session.gathered = true);
|
|
109950
109952
|
const { candidate: line, sdpMid, sdpMLineIndex } = candidate.toJSON();
|
|
109951
|
-
session.
|
|
109953
|
+
(session.held && candidateType(line) === "srflx" ? session.held : session.candidates).push({
|
|
109954
|
+
candidate: line,
|
|
109955
|
+
sdpMid,
|
|
109956
|
+
sdpMLineIndex
|
|
109957
|
+
});
|
|
109952
109958
|
});
|
|
109953
109959
|
pc.iceGatheringStateChange.subscribe((state) => {
|
|
109954
109960
|
if (state === "complete") session.gathered = true;
|
|
@@ -110013,7 +110019,7 @@ var RtcSessions = class {
|
|
|
110013
110019
|
const candidates = session.candidates.length;
|
|
110014
110020
|
return {
|
|
110015
110021
|
id: session.id,
|
|
110016
|
-
sdp: transport === "direct" && advertise ? onlyCandidatesFor(sdp, advertise) : sdp,
|
|
110022
|
+
sdp: transport === "direct" && advertise ? onlyCandidatesFor(sdp, advertise) : transport === "stun" ? withoutReflexive(sdp) : sdp,
|
|
110017
110023
|
candidates
|
|
110018
110024
|
};
|
|
110019
110025
|
}
|
|
@@ -110024,19 +110030,26 @@ var RtcSessions = class {
|
|
|
110024
110030
|
addCandidate(client, id, candidate) {
|
|
110025
110031
|
const session = this.owned(client, id);
|
|
110026
110032
|
if (session.transport === "direct") throw new Error("an ICE-lite session takes no trickled candidates");
|
|
110027
|
-
if (!candidate || candidate.candidate === "") return;
|
|
110033
|
+
if (!candidate || candidate.candidate === "") return this.release(session);
|
|
110028
110034
|
const remote = session.remoteCandidates = (session.remoteCandidates ?? 0) + 1;
|
|
110029
110035
|
if (remote > MAX_REMOTE_CANDIDATES) throw new Error("too many candidates");
|
|
110030
110036
|
void session.pc.addIceCandidate({
|
|
110031
110037
|
candidate: candidate.candidate,
|
|
110032
110038
|
sdpMid: candidate.sdpMid ?? void 0,
|
|
110033
110039
|
sdpMLineIndex: candidate.sdpMLineIndex ?? void 0
|
|
110040
|
+
}).then(() => {
|
|
110041
|
+
if (isPublicIpv4(candidate.candidate)) setTimeout(() => this.release(session), RELEASE_DELAY_MS).unref();
|
|
110034
110042
|
}).catch((error63) => this.options.log(`viewer ${client}: candidate refused: ${error63.message}`));
|
|
110035
110043
|
}
|
|
110044
|
+
release(session) {
|
|
110045
|
+
if (!session.held) return;
|
|
110046
|
+
session.candidates.push(...session.held);
|
|
110047
|
+
session.held = void 0;
|
|
110048
|
+
}
|
|
110036
110049
|
/** The desktop's own candidates after the first `after`, and whether gathering is done, for the browser to trickle in. */
|
|
110037
110050
|
candidates(client, id, after) {
|
|
110038
110051
|
const session = this.owned(client, id);
|
|
110039
|
-
return { candidates: session.candidates.slice(after), done: session.gathered };
|
|
110052
|
+
return { candidates: session.candidates.slice(after), done: session.gathered && !session.held };
|
|
110040
110053
|
}
|
|
110041
110054
|
owned(client, id) {
|
|
110042
110055
|
const session = this.sessions.get(id);
|
|
@@ -110093,6 +110106,11 @@ function iceReport(pc, trickled) {
|
|
|
110093
110106
|
).join(", ") || "none";
|
|
110094
110107
|
return `ICE ${connection.state}; local ${local}; remote ${remote} (${trickled} trickled); pairs sent/answered/received ${pairs}`;
|
|
110095
110108
|
}
|
|
110109
|
+
var candidateType = (line) => / typ (\w+)/.exec(line)?.[1];
|
|
110110
|
+
var isPublicIpv4 = (line) => ["srflx", "prflx", "relay"].includes(candidateType(line) ?? "") && /^\d+\.\d+\.\d+\.\d+$/.test(line.split(" ")[4] ?? "");
|
|
110111
|
+
var withoutReflexive = (sdp) => sdp.split("\r\n").filter(
|
|
110112
|
+
(line) => line !== "a=end-of-candidates" && !(line.startsWith("a=candidate:") && candidateType(line) === "srflx")
|
|
110113
|
+
).join("\r\n");
|
|
110096
110114
|
var onlyCandidatesFor = (sdp, address) => sdp.split("\r\n").filter((line) => !line.startsWith("a=candidate:") || line.split(" ")[4] === address).join("\r\n");
|
|
110097
110115
|
|
|
110098
110116
|
// src/stream/screen-stream.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentconnect.md/computer",
|
|
3
|
-
"version": "2.8.0-rc.
|
|
3
|
+
"version": "2.8.0-rc.23",
|
|
4
4
|
"description": "AgentConnect computer daemon: drives a desktop through Cua Driver and serves the computer_* tools over MCP; installed and upgraded by agentconnect computer",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|