@frequencytalk/agent 0.2.2 → 0.2.3

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.
@@ -3940,7 +3940,12 @@ var MediaServerToClientSchema = z11.discriminatedUnion("type", [
3940
3940
  // fleet upgrade: a running container keeps its image until it is recycled. A sender
3941
3941
  // uses wire v2 only when 2 is listed. ABSENT means [1] (a container from before 0.107.0),
3942
3942
  // which is why the field is optional: its absence is the signal, not a missing value.
3943
- wireVersions: z11.array(z11.number().int().positive()).optional()
3943
+ wireVersions: z11.array(z11.number().int().positive()).optional(),
3944
+ // This container's datapath answers link-probe control packets (nativeTransport.ts,
3945
+ // LINK_PROBE; contract §19 "The link meter"). Negotiated for the same reason as
3946
+ // wireVersions: a container that does not know the packet drops it on shape, silently,
3947
+ // and a client that probed anyway would read that silence as a dead link. Absent means no.
3948
+ linkProbe: z11.boolean().optional()
3944
3949
  }).optional()
3945
3950
  }),
3946
3951
  z11.object({ type: z11.literal("authError"), message: z11.string() }),
@@ -4360,6 +4365,19 @@ var ERROR_CODES = {
4360
4365
  },
4361
4366
  // --- Missing resources --------------------------------------------------------------
4362
4367
  NOT_FOUND: { status: 404, summary: "The addressed resource does not exist, or is not visible to this caller." },
4368
+ // --- Internal: where media runs (admin console only; docs/work-orders/cost-controls.md) ---
4369
+ HOST_ADMIN_REFUSED: {
4370
+ status: 409,
4371
+ summary: "A provider or media-host change was refused: a disabled provider, one with no active host, a host with live containers, or an on-demand host (provisioner/hostAdmin.ts). The message says which."
4372
+ },
4373
+ SWING_REFUSED: {
4374
+ status: 409,
4375
+ summary: "A live frequency could not be moved to another media host: no running container, a swing already in progress, no other active host, or the new container did not come up (provisioner/swing.ts). The message says which."
4376
+ },
4377
+ STANDBY_REFUSED: {
4378
+ status: 409,
4379
+ summary: "An on-demand standby media host could not be started or stopped in its current state (provisioner/standby.ts). The message says why."
4380
+ },
4363
4381
  USER_NOT_FOUND: { status: 404, summary: "No user matches the supplied handle, Station ID or email." },
4364
4382
  INVITE_INVALID: { status: 404, summary: "The invite or invite link is unknown, expired, revoked, or fully used." },
4365
4383
  NO_BILLING_ACCOUNT: { status: 404, summary: "No billing account exists for this organization yet." },
@@ -4865,6 +4883,10 @@ var KNOWN_SHARD_FLAGS = VIDEO_SHARD_FLAG.keyframe | VIDEO_SHARD_FLAG.recoveryPoi
4865
4883
  // ../shared/dist/share/assembler.js
4866
4884
  var MAX_FORWARD_JUMP = 1 << 16;
4867
4885
 
4886
+ // ../shared/dist/share/linkProbe.js
4887
+ var LINK_PROBE_PAD_DATAGRAM_BYTES = SHARE_WEBTRANSPORT_DATAGRAM_MAX_BYTES;
4888
+ var PAD_PAYLOAD_BYTES = LINK_PROBE_PAD_DATAGRAM_BYTES - HEADER.LENGTH;
4889
+
4868
4890
  // ../shared/dist/share/rateControl.js
4869
4891
  var MOTION_RUNGS = [2160, 1440, 1080, 900, 720, 540];
4870
4892
  var FRAME_BYTES_TARGET = Math.floor(MAX_FRAME_BYTES * 0.75);
@@ -5354,6 +5376,7 @@ var NativeSession = class {
5354
5376
  }
5355
5377
  /** One 20 ms Opus frame onto the stream: sealed under the home channel, and each relay, as the contract requires. */
5356
5378
  sendOpusFrame(opus, relayChannelIds = []) {
5379
+ if (this.closedWith) throw new Error(`native: signalling closed (${this.closedWith.code} ${this.closedWith.reason}) while talking; close() and open() again`);
5357
5380
  if (!this.producing) throw new Error("native: not talking; call startTalking first");
5358
5381
  const payload = audioPayload(this.producing.streamId, this.timestamp, opus);
5359
5382
  this.timestamp = this.timestamp + 960 >>> 0;
@@ -5361,6 +5384,10 @@ var NativeSession = class {
5361
5384
  }
5362
5385
  stopTalking() {
5363
5386
  if (!this.producing) return;
5387
+ if (this.closedWith) {
5388
+ this.producing = null;
5389
+ return;
5390
+ }
5364
5391
  this.send({ type: "closeNativeStream", streamId: this.producing.streamId });
5365
5392
  this.producing = null;
5366
5393
  }