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