@factiii/runner 0.9.5 → 0.9.6

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.
Files changed (2) hide show
  1. package/dist/cli.js +14 -5
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -23834,14 +23834,21 @@ function toRtcIceServers(servers) {
23834
23834
  for (const server of servers) {
23835
23835
  const urls = Array.isArray(server.urls) ? server.urls : [server.urls];
23836
23836
  for (const url2 of urls) {
23837
- const turn = /^(turns?):(.+)$/.exec(url2);
23837
+ const turn = /^(turns?):([^:?]+)(?::(\d+))?(?:\?transport=(udp|tcp))?$/.exec(
23838
+ url2
23839
+ );
23838
23840
  if (!turn || !server.username || !server.credential) {
23839
23841
  out.push(url2);
23840
23842
  continue;
23841
23843
  }
23842
- const user = encodeURIComponent(server.username);
23843
- const pass = encodeURIComponent(server.credential);
23844
- out.push(`${turn[1]}:${user}:${pass}@${turn[2]}`);
23844
+ const [, scheme, hostname, port, transport] = turn;
23845
+ out.push({
23846
+ hostname,
23847
+ port: Number(port ?? (scheme === "turns" ? 5349 : 3478)),
23848
+ username: server.username,
23849
+ password: server.credential,
23850
+ relayType: scheme === "turns" ? import_node_datachannel.RelayType.TurnTls : transport === "tcp" ? import_node_datachannel.RelayType.TurnTcp : import_node_datachannel.RelayType.TurnUdp
23851
+ });
23845
23852
  }
23846
23853
  }
23847
23854
  return out.length > 0 ? out : fallback;
@@ -24128,7 +24135,9 @@ async function startDaemon(config) {
24128
24135
  try {
24129
24136
  const iceServers = toRtcIceServers(data.iceServers);
24130
24137
  console.log(
24131
- `[webrtc] ICE servers: ${iceServers.map((u) => u.replace(/:[^:@]+@/, ":***@")).join(", ")}`
24138
+ `[webrtc] ICE servers: ${iceServers.map(
24139
+ (u) => typeof u === "string" ? u : `${u.relayType}:${u.hostname}:${u.port} user=${u.username?.slice(0, 8)}\u2026`
24140
+ ).join(", ")}`
24132
24141
  );
24133
24142
  const peer = new import_node_datachannel.PeerConnection("runner", { iceServers });
24134
24143
  const iceCandidateHandler = (msg) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factiii/runner",
3
- "version": "0.9.5",
3
+ "version": "0.9.6",
4
4
  "description": "Factiii Runner, run Board AI agents on a machine you control. Pairs with the Factiii web/mobile clients over WebRTC.",
5
5
  "license": "ISC",
6
6
  "keywords": [