zas-agent 0.5.0 → 0.5.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/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.5.1] - 2026-09-03
11
+
12
+ ### Fixed
13
+
14
+ - `zas_receive_direct` could not connect. The WebRTC engine in Node reports
15
+ an empty description object where a browser reports none, and the
16
+ receiver read that as a stale connection restart, so it dropped the very
17
+ first offer: it never answered, and both ends waited out the thirty
18
+ second clock. 0.5.0 could not receive a file at all. It can now.
19
+
10
20
  ## [0.5.0] - 2026-09-03
11
21
 
12
22
  ### Added
package/dist/cli.js CHANGED
@@ -1048,6 +1048,9 @@ function pathOf(pair) {
1048
1048
  if (pair.local === "relay" || pair.remote === "relay") return "relay";
1049
1049
  return pair.local === "host" && pair.remote === "host" ? "lan" : "wan";
1050
1050
  }
1051
+ function hasRemoteDescription(pc) {
1052
+ return !!pc.remoteDescription?.sdp;
1053
+ }
1051
1054
  function session(ice, onPhase, onDiag, iceTransportPolicy = "all") {
1052
1055
  const initialIce = ice ?? DIRECT_ICE;
1053
1056
  const pc = new RTCPeerConnection({
@@ -1092,7 +1095,7 @@ function session(ice, onPhase, onDiag, iceTransportPolicy = "all") {
1092
1095
  diag.ms = Date.now() - startedAt;
1093
1096
  diag.iceState = String(pc.iceConnectionState ?? "");
1094
1097
  diag.gatherState = String(pc.iceGatheringState ?? "");
1095
- diag.hadRemoteDesc = !!pc.remoteDescription;
1098
+ diag.hadRemoteDesc = hasRemoteDescription(pc);
1096
1099
  diag.turnUrlsConfigured = countTurnUrls(pc.getConfiguration().iceServers);
1097
1100
  onDiag?.(diag);
1098
1101
  onPhase(p);
@@ -1481,8 +1484,8 @@ function startReceiver(opts) {
1481
1484
  accept: (msg) => {
1482
1485
  if (s.isTerminal()) return;
1483
1486
  s.signaled();
1484
- if (msg.kind === "offer" && (!pc.remoteDescription || pc.signalingState === "stable")) {
1485
- const isRestart = !!pc.remoteDescription;
1487
+ if (msg.kind === "offer" && (!hasRemoteDescription(pc) || pc.signalingState === "stable")) {
1488
+ const isRestart = hasRemoteDescription(pc);
1486
1489
  const offerGeneration = msg.generation ?? (isRestart ? generation + 1 : 1);
1487
1490
  if (isRestart && msg.generation !== void 0 && offerGeneration <= generation) return;
1488
1491
  generation = offerGeneration;
@@ -3327,7 +3330,7 @@ var JobRunner = class {
3327
3330
 
3328
3331
  // src/server.ts
3329
3332
  function agentVersion() {
3330
- return true ? "0.5.0" : "0.0.0-dev";
3333
+ return true ? "0.5.1" : "0.0.0-dev";
3331
3334
  }
3332
3335
  var AGENT_CUE = " The owner sees every item this agent sends with the >_ agent mark and this agent's name, on every device.";
3333
3336
  var PAIR_ANNOUNCE_MS = 15e3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zas-agent",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "MCP server that lets a coding agent send files and notes into your Zas channels, and send or receive files live through Directo.",
5
5
  "type": "module",
6
6
  "license": "MIT",