@q9labsai/chalk-client 5.0.0 → 5.1.0

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 (233) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +39 -0
  3. package/dist/access/base64-url.d.ts +0 -1
  4. package/dist/access/grant.d.ts +0 -1
  5. package/dist/access/manager.d.ts +0 -1
  6. package/dist/chat-files/http-transport.d.ts +0 -1
  7. package/dist/chat-files/index.d.ts +0 -1
  8. package/dist/chat-files/types.d.ts +0 -1
  9. package/dist/{chunk-2HJIJVE2.js → chunk-3ZN7IXOZ.js} +341 -3
  10. package/dist/{chunk-O2NOZKJP.js → chunk-DWKTGBHR.js} +20 -8
  11. package/dist/{chunk-AVXJ4HQU.js → chunk-K7PNW3KI.js} +156 -35
  12. package/dist/{chunk-CMVO7USN.js → chunk-KHHULLBZ.js} +1 -1
  13. package/dist/{chunk-IPAN4LUZ.js → chunk-RJRSLXVT.js} +863 -409
  14. package/dist/client.d.ts +76 -1
  15. package/dist/collaboration/index.d.ts +0 -1
  16. package/dist/collaboration/types.d.ts +0 -1
  17. package/dist/collaboration/wire.d.ts +0 -1
  18. package/dist/connection/dependencies.d.ts +5 -3
  19. package/dist/connection/diagnostics.d.ts +1 -2
  20. package/dist/connection/index.d.ts +1 -1
  21. package/dist/connection/lifecycle.d.ts +2 -3
  22. package/dist/connection/media-devices.d.ts +0 -1
  23. package/dist/connection/production.d.ts +0 -1
  24. package/dist/connection/types.d.ts +2 -2
  25. package/dist/effect.d.ts +0 -1
  26. package/dist/effect.js +88 -4
  27. package/dist/foreground-deadline.d.ts +0 -1
  28. package/dist/generated/http-api.d.ts +76 -1
  29. package/dist/generated/schemas.d.ts +366 -7
  30. package/dist/generated/sync.d.ts +0 -1
  31. package/dist/generated/whiteboard-v1.d.ts +50 -7
  32. package/dist/index.d.ts +0 -1
  33. package/dist/index.js +7 -5
  34. package/dist/media/camera-uplink.d.ts +0 -1
  35. package/dist/media/capture-error.d.ts +0 -1
  36. package/dist/media/client.d.ts +3 -2
  37. package/dist/media/cloudflare-sfu.d.ts +0 -1
  38. package/dist/media/index.d.ts +0 -1
  39. package/dist/media/index.js +1 -1
  40. package/dist/media/observers.d.ts +0 -1
  41. package/dist/media/plane.d.ts +0 -1
  42. package/dist/media/remote-track-response.d.ts +0 -1
  43. package/dist/media/target.d.ts +0 -1
  44. package/dist/media/tracks.d.ts +0 -1
  45. package/dist/media/transport.d.ts +0 -1
  46. package/dist/media/types.d.ts +0 -1
  47. package/dist/public-invites/client.d.ts +0 -1
  48. package/dist/public-invites/index.d.ts +0 -1
  49. package/dist/public-invites/index.js +2 -2
  50. package/dist/public-invites/types.d.ts +0 -1
  51. package/dist/server/access-refresh.d.ts +0 -1
  52. package/dist/server/{chunk-C4XITY5U.js → chunk-XQOQTCUL.js} +22 -0
  53. package/dist/server/client.d.ts +0 -1
  54. package/dist/server/errors.d.cts +8 -1
  55. package/dist/server/errors.d.ts +8 -2
  56. package/dist/server/index.cjs +31 -7
  57. package/dist/server/index.d.cts +1 -1
  58. package/dist/server/index.d.ts +1 -2
  59. package/dist/server/index.js +10 -7
  60. package/dist/server/server-only.d.ts +0 -1
  61. package/dist/server/server-only.js +1 -1
  62. package/dist/server/transport.d.ts +0 -1
  63. package/dist/server/types.d.ts +0 -1
  64. package/dist/space-client/chat-controller-helpers.d.ts +0 -1
  65. package/dist/space-client/chat-controller.d.ts +0 -1
  66. package/dist/space-client/controller-effects.d.ts +0 -1
  67. package/dist/space-client/core.d.ts +0 -1
  68. package/dist/space-client/effect.d.ts +0 -1
  69. package/dist/space-client/errors.d.ts +4 -2
  70. package/dist/space-client/index.d.ts +1 -2
  71. package/dist/space-client/media-controller.d.ts +3 -2
  72. package/dist/space-client/media-device-selection.d.ts +0 -1
  73. package/dist/space-client/offline-actions-storage.d.ts +0 -1
  74. package/dist/space-client/offline-actions.d.ts +0 -1
  75. package/dist/space-client/participants-controller.d.ts +0 -1
  76. package/dist/space-client/promise-facade.d.ts +0 -1
  77. package/dist/space-client/reactions-controller.d.ts +0 -1
  78. package/dist/space-client/recording-controller.d.ts +0 -1
  79. package/dist/space-client/reload-rejoin.d.ts +0 -1
  80. package/dist/space-client/space-client.d.ts +0 -1
  81. package/dist/space-client/store.d.ts +0 -1
  82. package/dist/space-client/types.d.ts +7 -2
  83. package/dist/space-client/whiteboard-controller.d.ts +0 -1
  84. package/dist/sync/browser.d.ts +0 -1
  85. package/dist/sync/canonical.d.ts +0 -1
  86. package/dist/sync/dial-deadline.d.ts +3 -0
  87. package/dist/sync/errors.d.ts +0 -1
  88. package/dist/sync/index.d.ts +0 -1
  89. package/dist/sync/index.js +1 -1
  90. package/dist/sync/react-native.d.ts +0 -1
  91. package/dist/sync/types.d.ts +0 -1
  92. package/dist/sync/v1-client.d.ts +2 -2
  93. package/dist/sync/v1-codec.d.ts +0 -1
  94. package/dist/sync/v1-collaboration-state.d.ts +1 -1
  95. package/dist/sync/v1-command-scheduler.d.ts +0 -1
  96. package/dist/sync/v1-create.d.ts +0 -1
  97. package/dist/sync/v1-deferred.d.ts +0 -1
  98. package/dist/sync/v1-error.d.ts +0 -1
  99. package/dist/sync/v1-frame-signature.d.ts +0 -1
  100. package/dist/sync/v1-health.d.ts +15 -0
  101. package/dist/sync/v1-live-target-coordinator.d.ts +0 -1
  102. package/dist/sync/v1-persistence.d.ts +0 -1
  103. package/dist/sync/v1-platform-persistence.d.ts +0 -1
  104. package/dist/sync/v1-reducer.d.ts +3 -1
  105. package/dist/sync/v1-types.d.ts +10 -1
  106. package/dist/webhooks/errors.d.ts +0 -1
  107. package/dist/webhooks/generated/event-v1.d.ts +0 -1
  108. package/dist/webhooks/generated/fixtures-v1.d.ts +0 -1
  109. package/dist/webhooks/index.d.ts +0 -1
  110. package/dist/webhooks/processor.d.ts +0 -1
  111. package/dist/webhooks/server-only.d.ts +0 -1
  112. package/dist/webhooks/test.d.ts +0 -1
  113. package/dist/webhooks/types.d.ts +0 -1
  114. package/dist/webhooks/validate.d.ts +0 -1
  115. package/dist/webhooks/verify.d.ts +0 -1
  116. package/dist/whiteboard/file-download-transport.d.ts +0 -1
  117. package/dist/whiteboard/index.d.ts +5 -1
  118. package/dist/whiteboard/types.d.ts +28 -2
  119. package/dist/whiteboard/v1-client.d.ts +3 -2
  120. package/dist/whiteboard/v1-codec.d.ts +0 -1
  121. package/dist/whiteboard/v1-create.d.ts +0 -1
  122. package/dist/whiteboard/v1-multipart.d.ts +0 -1
  123. package/dist/whiteboard/v1-persistence.d.ts +0 -1
  124. package/package.json +4 -2
  125. package/dist/access/base64-url.d.ts.map +0 -1
  126. package/dist/access/grant.d.ts.map +0 -1
  127. package/dist/access/grant.test.helpers.d.ts +0 -10
  128. package/dist/access/grant.test.helpers.d.ts.map +0 -1
  129. package/dist/access/manager.d.ts.map +0 -1
  130. package/dist/chat-files/http-transport.d.ts.map +0 -1
  131. package/dist/chat-files/index.d.ts.map +0 -1
  132. package/dist/chat-files/types.d.ts.map +0 -1
  133. package/dist/client.d.ts.map +0 -1
  134. package/dist/collaboration/index.d.ts.map +0 -1
  135. package/dist/collaboration/types.d.ts.map +0 -1
  136. package/dist/collaboration/wire.d.ts.map +0 -1
  137. package/dist/connection/dependencies.d.ts.map +0 -1
  138. package/dist/connection/diagnostics.d.ts.map +0 -1
  139. package/dist/connection/index.d.ts.map +0 -1
  140. package/dist/connection/lifecycle.d.ts.map +0 -1
  141. package/dist/connection/media-devices.d.ts.map +0 -1
  142. package/dist/connection/production.d.ts.map +0 -1
  143. package/dist/connection/types.d.ts.map +0 -1
  144. package/dist/effect.d.ts.map +0 -1
  145. package/dist/foreground-deadline.d.ts.map +0 -1
  146. package/dist/generated/http-api.d.ts.map +0 -1
  147. package/dist/generated/schemas.d.ts.map +0 -1
  148. package/dist/generated/sync.d.ts.map +0 -1
  149. package/dist/generated/whiteboard-v1.d.ts.map +0 -1
  150. package/dist/index.d.ts.map +0 -1
  151. package/dist/media/camera-uplink.d.ts.map +0 -1
  152. package/dist/media/capture-error.d.ts.map +0 -1
  153. package/dist/media/client.d.ts.map +0 -1
  154. package/dist/media/cloudflare-sfu.d.ts.map +0 -1
  155. package/dist/media/index.d.ts.map +0 -1
  156. package/dist/media/observers.d.ts.map +0 -1
  157. package/dist/media/plane.d.ts.map +0 -1
  158. package/dist/media/remote-track-response.d.ts.map +0 -1
  159. package/dist/media/target.d.ts.map +0 -1
  160. package/dist/media/tracks.d.ts.map +0 -1
  161. package/dist/media/transport.d.ts.map +0 -1
  162. package/dist/media/types.d.ts.map +0 -1
  163. package/dist/public-invites/client.d.ts.map +0 -1
  164. package/dist/public-invites/index.d.ts.map +0 -1
  165. package/dist/public-invites/types.d.ts.map +0 -1
  166. package/dist/server/access-refresh.d.ts.map +0 -1
  167. package/dist/server/client.d.ts.map +0 -1
  168. package/dist/server/errors.d.ts.map +0 -1
  169. package/dist/server/index.d.ts.map +0 -1
  170. package/dist/server/server-only.d.ts.map +0 -1
  171. package/dist/server/transport.d.ts.map +0 -1
  172. package/dist/server/types.d.ts.map +0 -1
  173. package/dist/space-client/chat-controller-helpers.d.ts.map +0 -1
  174. package/dist/space-client/chat-controller.d.ts.map +0 -1
  175. package/dist/space-client/controller-effects.d.ts.map +0 -1
  176. package/dist/space-client/core.d.ts.map +0 -1
  177. package/dist/space-client/core.test.helpers.d.ts +0 -15
  178. package/dist/space-client/core.test.helpers.d.ts.map +0 -1
  179. package/dist/space-client/effect.d.ts.map +0 -1
  180. package/dist/space-client/errors.d.ts.map +0 -1
  181. package/dist/space-client/index.d.ts.map +0 -1
  182. package/dist/space-client/media-controller.d.ts.map +0 -1
  183. package/dist/space-client/media-device-selection.d.ts.map +0 -1
  184. package/dist/space-client/offline-actions-storage.d.ts.map +0 -1
  185. package/dist/space-client/offline-actions.d.ts.map +0 -1
  186. package/dist/space-client/participants-controller.d.ts.map +0 -1
  187. package/dist/space-client/promise-facade.d.ts.map +0 -1
  188. package/dist/space-client/reactions-controller.d.ts.map +0 -1
  189. package/dist/space-client/recording-controller.d.ts.map +0 -1
  190. package/dist/space-client/reload-rejoin.d.ts.map +0 -1
  191. package/dist/space-client/space-client.d.ts.map +0 -1
  192. package/dist/space-client/store.d.ts.map +0 -1
  193. package/dist/space-client/terminal.test.helpers.d.ts +0 -136
  194. package/dist/space-client/terminal.test.helpers.d.ts.map +0 -1
  195. package/dist/space-client/types.d.ts.map +0 -1
  196. package/dist/space-client/whiteboard-controller.d.ts.map +0 -1
  197. package/dist/sync/browser.d.ts.map +0 -1
  198. package/dist/sync/canonical.d.ts.map +0 -1
  199. package/dist/sync/errors.d.ts.map +0 -1
  200. package/dist/sync/index.d.ts.map +0 -1
  201. package/dist/sync/react-native.d.ts.map +0 -1
  202. package/dist/sync/types.d.ts.map +0 -1
  203. package/dist/sync/v1-client.d.ts.map +0 -1
  204. package/dist/sync/v1-codec.d.ts.map +0 -1
  205. package/dist/sync/v1-collaboration-state.d.ts.map +0 -1
  206. package/dist/sync/v1-command-scheduler.d.ts.map +0 -1
  207. package/dist/sync/v1-create.d.ts.map +0 -1
  208. package/dist/sync/v1-deferred.d.ts.map +0 -1
  209. package/dist/sync/v1-error.d.ts.map +0 -1
  210. package/dist/sync/v1-frame-signature.d.ts.map +0 -1
  211. package/dist/sync/v1-live-target-coordinator.d.ts.map +0 -1
  212. package/dist/sync/v1-persistence.d.ts.map +0 -1
  213. package/dist/sync/v1-platform-persistence.d.ts.map +0 -1
  214. package/dist/sync/v1-reducer.d.ts.map +0 -1
  215. package/dist/sync/v1-types.d.ts.map +0 -1
  216. package/dist/webhooks/errors.d.ts.map +0 -1
  217. package/dist/webhooks/generated/event-v1.d.ts.map +0 -1
  218. package/dist/webhooks/generated/fixtures-v1.d.ts.map +0 -1
  219. package/dist/webhooks/index.d.ts.map +0 -1
  220. package/dist/webhooks/processor.d.ts.map +0 -1
  221. package/dist/webhooks/server-only.d.ts.map +0 -1
  222. package/dist/webhooks/test.d.ts.map +0 -1
  223. package/dist/webhooks/types.d.ts.map +0 -1
  224. package/dist/webhooks/validate.d.ts.map +0 -1
  225. package/dist/webhooks/verify.d.ts.map +0 -1
  226. package/dist/whiteboard/file-download-transport.d.ts.map +0 -1
  227. package/dist/whiteboard/index.d.ts.map +0 -1
  228. package/dist/whiteboard/types.d.ts.map +0 -1
  229. package/dist/whiteboard/v1-client.d.ts.map +0 -1
  230. package/dist/whiteboard/v1-codec.d.ts.map +0 -1
  231. package/dist/whiteboard/v1-create.d.ts.map +0 -1
  232. package/dist/whiteboard/v1-multipart.d.ts.map +0 -1
  233. package/dist/whiteboard/v1-persistence.d.ts.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,34 @@
1
+ # Changelog
2
+
3
+ ## 5.1.0
4
+
5
+ - Add shared board views: `ChalkWhiteboardView`, `ChalkWhiteboardViewBounds`, and the whiteboard client's `supportsViews` and `sendView()`, so participants can follow a person's board view or bring everyone to theirs. The board stream also carries a `view` event.
6
+ - Export `isChalkAccessGrantError` and the `ChalkAccessGrantErrorCode` type from the server entry point. `ChalkAPIError.code` now includes the known media-token codes, such as `media_token.expired`.
7
+ - Admission responses add `decision_state` and an optional `decision_action`, so dashboard hosts see public invite knocks and a call that ends shows without a reload. Hosts can admit simultaneous knocks without reconnecting.
8
+ - Public invite reads (`getSpacePublicInvite`, `getSpacePublicInviteArrival`, `listSpacePublicAdmissionRequests`) move from `v1.authenticated.write` (60 per minute) to `v1.authenticated.read` (300 per minute) in the exported `ChalkOperationPolicies`.
9
+ - Calling `leave()` no longer closes media the server already ended.
10
+ - Recover a call when Sync rejects a state update, such as on a state digest mismatch. The client requests one fresh snapshot, validates it before replacing local state, and resumes; commands sent before or during recovery complete once. If that snapshot is rejected too, it stops reconnecting and fails with the new non-recoverable public code `connection.state_digest_recovery_failed`. Handle it like other terminal connection failures and offer a rejoin.
11
+ - Bound each Sync and whiteboard WebSocket opening attempt to 10 seconds by default. The whiteboard, and Sync once the call is live, retry a timed-out attempt through the existing reconnect backoff. During first join the Sync deadline ends with the default 10-second startup wait, so it does not retry a Sync socket that never opens: the join fails when the deadline expires. Late opens from expired attempts are ignored, and a redacted dial-timeout diagnostic is kept after recovery. The transports' existing options allow a longer deadline.
12
+ - Capture a fresh microphone when it is turned on after its previous track ended, instead of reusing the ended track.
13
+ - Report a chat send that Sync refuses for sending too fast as recoverable `command.rate_limited`, and one it refuses while overloaded as recoverable `collaboration.unavailable`, instead of non-recoverable `chat.payload_invalid`.
14
+ - Accept a server-selected media replacement during access refresh, including when the client clock still considers its prior credential valid, so rejoining with an expired media token works. The full participant subject check still runs before the client switches connections.
15
+ - Add optional Sync health to connection snapshots without changing the public status union. Brief pong loss degrades without blocking; sustained silence triggers recovery and stable pongs clear it. Reaction acknowledgements time out after five seconds and are not replayed.
16
+ - Guard media enabling at the controller boundary for every caller. Off intents are retained until Sync confirms them after reconnect, and media publication runs through revisioned workers so a late capture cannot enable a device after Off.
17
+ - Add `media.captureCameraPreview()` to capture an unpublished camera track with the selected device and refresh the inventory after permission is granted. It shares live or pending camera capture; callers release a preview handle.
18
+ - Exhausted media confirmations now return recoverable `media.timeout`; unrelated command retries are not classified as media failures.
19
+ - Reaction acknowledgement timeouts return recoverable `collaboration.unavailable` without claiming whether the reaction arrived.
20
+
21
+ - Preserve access, Sync, SFU, and recovery failure codes and recoverability in join rejections, snapshots, and error events.
22
+ - Add `connection.sync_hello_timeout` for the Sync startup handshake deadline. Handle it alongside `connection.sync_start_failed` and retain a fallback for future codes.
23
+ - Media changes while Sync is not live now return recoverable `connection.invalid_state` with plain connection guidance instead of an internal target error.
24
+
25
+ ## 5.0.0
26
+
27
+ - BREAKING: remove Episode diagnostics, client telemetry, feedback submission, RealtimeKit, public status, Tenant invitations, audit-log and Users API operations, and the regions catalog.
28
+ - BREAKING: replace `createChalkWhiteboardV1FileHttpTransport` with the download-only `createChalkWhiteboardV1FileDownloadTransport`. Remove the retired local file-upload API.
29
+ - Recover stalled whiteboard connections with a heartbeat watchdog. Use monotonic ages even when an injected wall clock moves backward. Persisted operation timestamps still use wall time.
30
+ - BREAKING: custom whiteboard `clock` objects must provide `monotonicNow()` on the same timeline as their `setTimeout` scheduler. A three-method clock now throws at construction. For real-time timers, add `monotonicNow: () => performance.now()`; for a virtual scheduler, return its elapsed time independently of wall-clock corrections.
31
+ - Publish and play shared tab audio separately from microphones, with share-audio state and coupled screen-share lifecycle.
32
+
33
+ - Add optional screen-capture surface/audio hints and actual selected surface/label metadata.
34
+ - Add explicit per-message reactions, versioned live/history state, offline queue support, and the shared 24-emoji set.
package/README.md CHANGED
@@ -175,6 +175,38 @@ Events are `participantJoined`, `participantLeft`, `episodeEnded`,
175
175
  stable codes such as `access.invalid`, `episode.ended`, and
176
176
  `chat.payload_invalid`.
177
177
 
178
+ ### Connection failures
179
+
180
+ `join()` rejections, `connection.lastError`, and `client.on("error")` use the
181
+ same public codes and preserve `recoverable`. Recoverable does not mean joined:
182
+ a failed startup needs another `join()`, while interrupted live connections keep
183
+ recovering in the background. Device warnings below do not fail entry.
184
+
185
+ | Stage | Public error code |
186
+ | ---------------------------------------------------------------------------- | ------------------------------------- |
187
+ | Rejected or invalid access grant | `access.invalid` |
188
+ | Access provider unavailable | `access.unavailable` |
189
+ | Sync could not start | `connection.sync_start_failed` |
190
+ | Sync did not finish its hello/recovery handshake before the startup deadline | `connection.sync_hello_timeout` |
191
+ | SFU/ICE media startup | `connection.media_start_failed` |
192
+ | Sync recovery budget exhausted | `connection.sync_recovery_exhausted` |
193
+ | Media recovery budget exhausted | `connection.media_recovery_exhausted` |
194
+ | Unsupported capture environment | `environment.unsupported` |
195
+ | Unexpected, unclassified exception | `client.internal_error` |
196
+
197
+ `connection.sync_hello_timeout` is an additive public code. Integrations that
198
+ show guidance for `connection.sync_start_failed` should use the same fallback
199
+ for this new timeout code. Keep a default branch for future codes. No existing
200
+ code is renamed or removed; snapshots and error events now retain the
201
+ stage instead of incorrectly reporting `client.internal_error`. Rejected access
202
+ and unsupported-environment rejections also retain their nonrecoverable flag.
203
+ The React failed screen shows safe stage guidance and a public code reference;
204
+ it does not display provider responses or tokens.
205
+
206
+ Media changes that race Sync joining or reconnecting reject with the existing
207
+ `connection.invalid_state` code, `recoverable: true`, and plain connection
208
+ guidance. Wait for the call to connect before retrying the media change.
209
+
178
210
  ### Join capture errors
179
211
 
180
212
  `join()` requests the microphone and camera by default. If both work, capture
@@ -282,3 +314,10 @@ SpaceClient negotiates `collaboration_v2` for the 24-emoji set and per-message r
282
314
  The sharer keeps local playback (`suppressLocalAudioPlayback: false`). Display audio disables echo cancellation, noise suppression and automatic gain control to preserve music; microphone capture and its processing are unchanged. System audio is excluded to avoid sending the call back to itself. Headphones avoid acoustic doubling through the microphone; local playback cannot be preserved while guaranteeing that loudspeakers never leak into it. Chrome documents [local playback control](https://developer.chrome.com/blog/screen-sharing-improvements-in-chrome-109) and [system-audio feedback](https://developer.chrome.com/docs/web-platform/screen-sharing-controls). [Meet documents the same “Also share tab audio” picker control](https://support.google.com/meet/answer/9308856?hl=en). No public X documentation establishing its echo default was found.
283
315
 
284
316
  Shared tab audio is excluded from recordings until the recording format supports it. React Native display capture behavior is unchanged.
317
+
318
+ Media-command confirmation deadlines and exhausted retries use existing
319
+ `media.timeout` with `recoverable: true`. This classification applies only to
320
+ media commands, not other operations with exhausted retries. Reaction
321
+ acknowledgement deadlines use existing `collaboration.unavailable`, recoverable,
322
+ with “Couldn’t confirm your reaction. Try again.” A missing acknowledgement does
323
+ not establish whether anyone received the reaction.
@@ -1,2 +1 @@
1
1
  export declare function decodeBase64Url(value: string): string;
2
- //# sourceMappingURL=base64-url.d.ts.map
@@ -49,4 +49,3 @@ export declare function requireParsedAccessGrant(value: unknown): Promise<Parsed
49
49
  export declare function requireAccessGrant(value: unknown): Promise<AccessGrant>;
50
50
  export declare function isParsedAccessGrant(value: unknown): value is ParsedAccessGrant;
51
51
  export {};
52
- //# sourceMappingURL=grant.d.ts.map
@@ -35,4 +35,3 @@ export declare class ConnectionAccessService extends ConnectionAccessService_bas
35
35
  export declare const makeConnectionAccessLayer: (provider: ConnectionAccessEffectProvider, refreshWindowMs?: number) => Layer.Layer<ConnectionAccessService, never, never>;
36
36
  export declare const makeFakeConnectionAccessLayer: (provider: ConnectionAccessEffectProvider, refreshWindowMs?: number) => Layer.Layer<ConnectionAccessService, never, never>;
37
37
  export {};
38
- //# sourceMappingURL=manager.d.ts.map
@@ -5,4 +5,3 @@ export type ChalkChatFileHttpTransportOptions = {
5
5
  readonly fetch?: typeof globalThis.fetch;
6
6
  };
7
7
  export declare function createChalkChatFileHttpTransport(options: ChalkChatFileHttpTransportOptions): ChalkChatFileTransport;
8
- //# sourceMappingURL=http-transport.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export { createChalkChatFileHttpTransport, type ChalkChatFileHttpTransportOptions } from "./http-transport";
2
2
  export { ChalkChatFileError, type ChalkChatFileErrorCode, type ChalkChatFileFailure, type ChalkChatFileOperation, type ChalkChatFileTransport } from "./types";
3
- //# sourceMappingURL=index.d.ts.map
@@ -34,4 +34,3 @@ export type ChalkChatFileTransport = {
34
34
  readonly expiresAt: string;
35
35
  }>;
36
36
  };
37
- //# sourceMappingURL=types.d.ts.map
@@ -490,6 +490,8 @@ var PrepareRecordingRequestSchema = Schema.Struct({
490
490
  starts_at: DateTimeStringSchema
491
491
  });
492
492
  var PublicAdmissionRequestSchema = Schema.Struct({
493
+ decision_action: Schema.optional(Schema.String),
494
+ decision_state: Schema.String,
493
495
  display_name: Schema.String,
494
496
  expires_at: DateTimeStringSchema,
495
497
  request_handle: Schema.String,
@@ -2277,6 +2279,253 @@ var MediaConnectionNotFoundErrorSchema = MediaConnectionNotFoundErrorWireSchema.
2277
2279
  encode: SchemaGetter.transform((error) => ({ error: error.error }))
2278
2280
  })
2279
2281
  );
2282
+ var MediaTokenExpiredError = class extends Schema.TaggedErrorClass()("MediaTokenExpiredError", {
2283
+ error: Schema.Struct({
2284
+ code: Schema.Literal("media_token.expired"),
2285
+ message: Schema.String
2286
+ })
2287
+ }) {
2288
+ };
2289
+ var MediaTokenExpiredErrorWireSchema = Schema.Struct({
2290
+ error: Schema.Struct({
2291
+ code: Schema.Literal("media_token.expired"),
2292
+ message: Schema.String
2293
+ })
2294
+ });
2295
+ var MediaTokenExpiredErrorSchema = MediaTokenExpiredErrorWireSchema.pipe(
2296
+ Schema.decodeTo(MediaTokenExpiredError, {
2297
+ decode: SchemaGetter.transform((wire) => ({ _tag: "MediaTokenExpiredError", ...wire })),
2298
+ encode: SchemaGetter.transform((error) => ({ error: error.error }))
2299
+ })
2300
+ );
2301
+ var MediaTokenInvalidAudienceError = class extends Schema.TaggedErrorClass()("MediaTokenInvalidAudienceError", {
2302
+ error: Schema.Struct({
2303
+ code: Schema.Literal("media_token.invalid_audience"),
2304
+ message: Schema.String
2305
+ })
2306
+ }) {
2307
+ };
2308
+ var MediaTokenInvalidAudienceErrorWireSchema = Schema.Struct({
2309
+ error: Schema.Struct({
2310
+ code: Schema.Literal("media_token.invalid_audience"),
2311
+ message: Schema.String
2312
+ })
2313
+ });
2314
+ var MediaTokenInvalidAudienceErrorSchema = MediaTokenInvalidAudienceErrorWireSchema.pipe(
2315
+ Schema.decodeTo(MediaTokenInvalidAudienceError, {
2316
+ decode: SchemaGetter.transform((wire) => ({ _tag: "MediaTokenInvalidAudienceError", ...wire })),
2317
+ encode: SchemaGetter.transform((error) => ({ error: error.error }))
2318
+ })
2319
+ );
2320
+ var MediaTokenInvalidHeaderError = class extends Schema.TaggedErrorClass()("MediaTokenInvalidHeaderError", {
2321
+ error: Schema.Struct({
2322
+ code: Schema.Literal("media_token.invalid_header"),
2323
+ message: Schema.String
2324
+ })
2325
+ }) {
2326
+ };
2327
+ var MediaTokenInvalidHeaderErrorWireSchema = Schema.Struct({
2328
+ error: Schema.Struct({
2329
+ code: Schema.Literal("media_token.invalid_header"),
2330
+ message: Schema.String
2331
+ })
2332
+ });
2333
+ var MediaTokenInvalidHeaderErrorSchema = MediaTokenInvalidHeaderErrorWireSchema.pipe(
2334
+ Schema.decodeTo(MediaTokenInvalidHeaderError, {
2335
+ decode: SchemaGetter.transform((wire) => ({ _tag: "MediaTokenInvalidHeaderError", ...wire })),
2336
+ encode: SchemaGetter.transform((error) => ({ error: error.error }))
2337
+ })
2338
+ );
2339
+ var MediaTokenInvalidIssuerError = class extends Schema.TaggedErrorClass()("MediaTokenInvalidIssuerError", {
2340
+ error: Schema.Struct({
2341
+ code: Schema.Literal("media_token.invalid_issuer"),
2342
+ message: Schema.String
2343
+ })
2344
+ }) {
2345
+ };
2346
+ var MediaTokenInvalidIssuerErrorWireSchema = Schema.Struct({
2347
+ error: Schema.Struct({
2348
+ code: Schema.Literal("media_token.invalid_issuer"),
2349
+ message: Schema.String
2350
+ })
2351
+ });
2352
+ var MediaTokenInvalidIssuerErrorSchema = MediaTokenInvalidIssuerErrorWireSchema.pipe(
2353
+ Schema.decodeTo(MediaTokenInvalidIssuerError, {
2354
+ decode: SchemaGetter.transform((wire) => ({ _tag: "MediaTokenInvalidIssuerError", ...wire })),
2355
+ encode: SchemaGetter.transform((error) => ({ error: error.error }))
2356
+ })
2357
+ );
2358
+ var MediaTokenInvalidSignatureError = class extends Schema.TaggedErrorClass()("MediaTokenInvalidSignatureError", {
2359
+ error: Schema.Struct({
2360
+ code: Schema.Literal("media_token.invalid_signature"),
2361
+ message: Schema.String
2362
+ })
2363
+ }) {
2364
+ };
2365
+ var MediaTokenInvalidSignatureErrorWireSchema = Schema.Struct({
2366
+ error: Schema.Struct({
2367
+ code: Schema.Literal("media_token.invalid_signature"),
2368
+ message: Schema.String
2369
+ })
2370
+ });
2371
+ var MediaTokenInvalidSignatureErrorSchema = MediaTokenInvalidSignatureErrorWireSchema.pipe(
2372
+ Schema.decodeTo(MediaTokenInvalidSignatureError, {
2373
+ decode: SchemaGetter.transform((wire) => ({ _tag: "MediaTokenInvalidSignatureError", ...wire })),
2374
+ encode: SchemaGetter.transform((error) => ({ error: error.error }))
2375
+ })
2376
+ );
2377
+ var MediaTokenInvalidSubjectError = class extends Schema.TaggedErrorClass()("MediaTokenInvalidSubjectError", {
2378
+ error: Schema.Struct({
2379
+ code: Schema.Literal("media_token.invalid_subject"),
2380
+ message: Schema.String
2381
+ })
2382
+ }) {
2383
+ };
2384
+ var MediaTokenInvalidSubjectErrorWireSchema = Schema.Struct({
2385
+ error: Schema.Struct({
2386
+ code: Schema.Literal("media_token.invalid_subject"),
2387
+ message: Schema.String
2388
+ })
2389
+ });
2390
+ var MediaTokenInvalidSubjectErrorSchema = MediaTokenInvalidSubjectErrorWireSchema.pipe(
2391
+ Schema.decodeTo(MediaTokenInvalidSubjectError, {
2392
+ decode: SchemaGetter.transform((wire) => ({ _tag: "MediaTokenInvalidSubjectError", ...wire })),
2393
+ encode: SchemaGetter.transform((error) => ({ error: error.error }))
2394
+ })
2395
+ );
2396
+ var MediaTokenInvalidTimeClaimsError = class extends Schema.TaggedErrorClass()("MediaTokenInvalidTimeClaimsError", {
2397
+ error: Schema.Struct({
2398
+ code: Schema.Literal("media_token.invalid_time_claims"),
2399
+ message: Schema.String
2400
+ })
2401
+ }) {
2402
+ };
2403
+ var MediaTokenInvalidTimeClaimsErrorWireSchema = Schema.Struct({
2404
+ error: Schema.Struct({
2405
+ code: Schema.Literal("media_token.invalid_time_claims"),
2406
+ message: Schema.String
2407
+ })
2408
+ });
2409
+ var MediaTokenInvalidTimeClaimsErrorSchema = MediaTokenInvalidTimeClaimsErrorWireSchema.pipe(
2410
+ Schema.decodeTo(MediaTokenInvalidTimeClaimsError, {
2411
+ decode: SchemaGetter.transform((wire) => ({ _tag: "MediaTokenInvalidTimeClaimsError", ...wire })),
2412
+ encode: SchemaGetter.transform((error) => ({ error: error.error }))
2413
+ })
2414
+ );
2415
+ var MediaTokenLifetimeExceededError = class extends Schema.TaggedErrorClass()("MediaTokenLifetimeExceededError", {
2416
+ error: Schema.Struct({
2417
+ code: Schema.Literal("media_token.lifetime_exceeded"),
2418
+ message: Schema.String
2419
+ })
2420
+ }) {
2421
+ };
2422
+ var MediaTokenLifetimeExceededErrorWireSchema = Schema.Struct({
2423
+ error: Schema.Struct({
2424
+ code: Schema.Literal("media_token.lifetime_exceeded"),
2425
+ message: Schema.String
2426
+ })
2427
+ });
2428
+ var MediaTokenLifetimeExceededErrorSchema = MediaTokenLifetimeExceededErrorWireSchema.pipe(
2429
+ Schema.decodeTo(MediaTokenLifetimeExceededError, {
2430
+ decode: SchemaGetter.transform((wire) => ({ _tag: "MediaTokenLifetimeExceededError", ...wire })),
2431
+ encode: SchemaGetter.transform((error) => ({ error: error.error }))
2432
+ })
2433
+ );
2434
+ var MediaTokenMalformedError = class extends Schema.TaggedErrorClass()("MediaTokenMalformedError", {
2435
+ error: Schema.Struct({
2436
+ code: Schema.Literal("media_token.malformed"),
2437
+ message: Schema.String
2438
+ })
2439
+ }) {
2440
+ };
2441
+ var MediaTokenMalformedErrorWireSchema = Schema.Struct({
2442
+ error: Schema.Struct({
2443
+ code: Schema.Literal("media_token.malformed"),
2444
+ message: Schema.String
2445
+ })
2446
+ });
2447
+ var MediaTokenMalformedErrorSchema = MediaTokenMalformedErrorWireSchema.pipe(
2448
+ Schema.decodeTo(MediaTokenMalformedError, {
2449
+ decode: SchemaGetter.transform((wire) => ({ _tag: "MediaTokenMalformedError", ...wire })),
2450
+ encode: SchemaGetter.transform((error) => ({ error: error.error }))
2451
+ })
2452
+ );
2453
+ var MediaTokenNotYetValidError = class extends Schema.TaggedErrorClass()("MediaTokenNotYetValidError", {
2454
+ error: Schema.Struct({
2455
+ code: Schema.Literal("media_token.not_yet_valid"),
2456
+ message: Schema.String
2457
+ })
2458
+ }) {
2459
+ };
2460
+ var MediaTokenNotYetValidErrorWireSchema = Schema.Struct({
2461
+ error: Schema.Struct({
2462
+ code: Schema.Literal("media_token.not_yet_valid"),
2463
+ message: Schema.String
2464
+ })
2465
+ });
2466
+ var MediaTokenNotYetValidErrorSchema = MediaTokenNotYetValidErrorWireSchema.pipe(
2467
+ Schema.decodeTo(MediaTokenNotYetValidError, {
2468
+ decode: SchemaGetter.transform((wire) => ({ _tag: "MediaTokenNotYetValidError", ...wire })),
2469
+ encode: SchemaGetter.transform((error) => ({ error: error.error }))
2470
+ })
2471
+ );
2472
+ var MediaTokenRequiredError = class extends Schema.TaggedErrorClass()("MediaTokenRequiredError", {
2473
+ error: Schema.Struct({
2474
+ code: Schema.Literal("media_token.required"),
2475
+ message: Schema.String
2476
+ })
2477
+ }) {
2478
+ };
2479
+ var MediaTokenRequiredErrorWireSchema = Schema.Struct({
2480
+ error: Schema.Struct({
2481
+ code: Schema.Literal("media_token.required"),
2482
+ message: Schema.String
2483
+ })
2484
+ });
2485
+ var MediaTokenRequiredErrorSchema = MediaTokenRequiredErrorWireSchema.pipe(
2486
+ Schema.decodeTo(MediaTokenRequiredError, {
2487
+ decode: SchemaGetter.transform((wire) => ({ _tag: "MediaTokenRequiredError", ...wire })),
2488
+ encode: SchemaGetter.transform((error) => ({ error: error.error }))
2489
+ })
2490
+ );
2491
+ var MediaTokenSubjectMismatchError = class extends Schema.TaggedErrorClass()("MediaTokenSubjectMismatchError", {
2492
+ error: Schema.Struct({
2493
+ code: Schema.Literal("media_token.subject_mismatch"),
2494
+ message: Schema.String
2495
+ })
2496
+ }) {
2497
+ };
2498
+ var MediaTokenSubjectMismatchErrorWireSchema = Schema.Struct({
2499
+ error: Schema.Struct({
2500
+ code: Schema.Literal("media_token.subject_mismatch"),
2501
+ message: Schema.String
2502
+ })
2503
+ });
2504
+ var MediaTokenSubjectMismatchErrorSchema = MediaTokenSubjectMismatchErrorWireSchema.pipe(
2505
+ Schema.decodeTo(MediaTokenSubjectMismatchError, {
2506
+ decode: SchemaGetter.transform((wire) => ({ _tag: "MediaTokenSubjectMismatchError", ...wire })),
2507
+ encode: SchemaGetter.transform((error) => ({ error: error.error }))
2508
+ })
2509
+ );
2510
+ var MediaTokenUnknownKeyError = class extends Schema.TaggedErrorClass()("MediaTokenUnknownKeyError", {
2511
+ error: Schema.Struct({
2512
+ code: Schema.Literal("media_token.unknown_key"),
2513
+ message: Schema.String
2514
+ })
2515
+ }) {
2516
+ };
2517
+ var MediaTokenUnknownKeyErrorWireSchema = Schema.Struct({
2518
+ error: Schema.Struct({
2519
+ code: Schema.Literal("media_token.unknown_key"),
2520
+ message: Schema.String
2521
+ })
2522
+ });
2523
+ var MediaTokenUnknownKeyErrorSchema = MediaTokenUnknownKeyErrorWireSchema.pipe(
2524
+ Schema.decodeTo(MediaTokenUnknownKeyError, {
2525
+ decode: SchemaGetter.transform((wire) => ({ _tag: "MediaTokenUnknownKeyError", ...wire })),
2526
+ encode: SchemaGetter.transform((error) => ({ error: error.error }))
2527
+ })
2528
+ );
2280
2529
  var MediaUnavailableError = class extends Schema.TaggedErrorClass()("MediaUnavailableError", {
2281
2530
  error: Schema.Struct({
2282
2531
  code: Schema.Literal("media.unavailable"),
@@ -2410,6 +2659,25 @@ var PaginationInvalidPageSizeErrorSchema = PaginationInvalidPageSizeErrorWireSch
2410
2659
  encode: SchemaGetter.transform((error) => ({ error: error.error }))
2411
2660
  })
2412
2661
  );
2662
+ var ParticipantConnectionSupersededError = class extends Schema.TaggedErrorClass()("ParticipantConnectionSupersededError", {
2663
+ error: Schema.Struct({
2664
+ code: Schema.Literal("participant.connection_superseded"),
2665
+ message: Schema.String
2666
+ })
2667
+ }) {
2668
+ };
2669
+ var ParticipantConnectionSupersededErrorWireSchema = Schema.Struct({
2670
+ error: Schema.Struct({
2671
+ code: Schema.Literal("participant.connection_superseded"),
2672
+ message: Schema.String
2673
+ })
2674
+ });
2675
+ var ParticipantConnectionSupersededErrorSchema = ParticipantConnectionSupersededErrorWireSchema.pipe(
2676
+ Schema.decodeTo(ParticipantConnectionSupersededError, {
2677
+ decode: SchemaGetter.transform((wire) => ({ _tag: "ParticipantConnectionSupersededError", ...wire })),
2678
+ encode: SchemaGetter.transform((error) => ({ error: error.error }))
2679
+ })
2680
+ );
2413
2681
  var ParticipantGenerationMismatchError = class extends Schema.TaggedErrorClass()("ParticipantGenerationMismatchError", {
2414
2682
  error: Schema.Struct({
2415
2683
  code: Schema.Literal("participant.generation_mismatch"),
@@ -4113,7 +4381,21 @@ var IssueAccessGrantErrorSchema = Schema.Union([
4113
4381
  AccessForbiddenErrorSchema,
4114
4382
  AccessUnauthenticatedErrorSchema,
4115
4383
  EpisodeInvalidIdErrorSchema,
4384
+ MediaTokenExpiredErrorSchema,
4385
+ MediaTokenInvalidAudienceErrorSchema,
4386
+ MediaTokenInvalidHeaderErrorSchema,
4387
+ MediaTokenInvalidIssuerErrorSchema,
4388
+ MediaTokenInvalidSignatureErrorSchema,
4389
+ MediaTokenInvalidSubjectErrorSchema,
4390
+ MediaTokenInvalidTimeClaimsErrorSchema,
4391
+ MediaTokenLifetimeExceededErrorSchema,
4392
+ MediaTokenMalformedErrorSchema,
4393
+ MediaTokenNotYetValidErrorSchema,
4394
+ MediaTokenRequiredErrorSchema,
4395
+ MediaTokenSubjectMismatchErrorSchema,
4396
+ MediaTokenUnknownKeyErrorSchema,
4116
4397
  MediaUnavailableErrorSchema,
4398
+ ParticipantConnectionSupersededErrorSchema,
4117
4399
  ParticipantGenerationMismatchErrorSchema,
4118
4400
  ParticipantInvalidIdErrorSchema,
4119
4401
  ParticipantNotFoundErrorSchema,
@@ -4619,8 +4901,8 @@ var ChalkOperationPolicies = {
4619
4901
  findTenantByExternalID: { rateLimit: { limit: 300, policy: "v1.authenticated.read", windowSeconds: 60 } },
4620
4902
  getEpisode: { rateLimit: { limit: 300, policy: "v1.authenticated.read", windowSeconds: 60 } },
4621
4903
  getEpisodeAttendance: { rateLimit: { limit: 300, policy: "v1.authenticated.read", windowSeconds: 60 } },
4622
- getSpacePublicInvite: { rateLimit: { limit: 60, policy: "v1.authenticated.write", windowSeconds: 60 } },
4623
- getSpacePublicInviteArrival: { rateLimit: { limit: 60, policy: "v1.authenticated.write", windowSeconds: 60 } },
4904
+ getSpacePublicInvite: { rateLimit: { limit: 300, policy: "v1.authenticated.read", windowSeconds: 60 } },
4905
+ getSpacePublicInviteArrival: { rateLimit: { limit: 300, policy: "v1.authenticated.read", windowSeconds: 60 } },
4624
4906
  getTenant: { rateLimit: { limit: 300, policy: "v1.authenticated.read", windowSeconds: 60 } },
4625
4907
  getWebhookDelivery: { rateLimit: { limit: 300, policy: "v1.webhooks.read", windowSeconds: 60 } },
4626
4908
  getWebhookEndpoint: { rateLimit: { limit: 300, policy: "v1.webhooks.read", windowSeconds: 60 } },
@@ -4630,7 +4912,7 @@ var ChalkOperationPolicies = {
4630
4912
  leaveSpacePublicInviteArrival: { rateLimit: { limit: 60, policy: "v1.authenticated.write", windowSeconds: 60 } },
4631
4913
  listEpisodes: { rateLimit: { limit: 300, policy: "v1.authenticated.read", windowSeconds: 60 } },
4632
4914
  listSpaceLiveEpisodes: { rateLimit: { limit: 300, policy: "v1.authenticated.read", windowSeconds: 60 } },
4633
- listSpacePublicAdmissionRequests: { rateLimit: { limit: 60, policy: "v1.authenticated.write", windowSeconds: 60 } },
4915
+ listSpacePublicAdmissionRequests: { rateLimit: { limit: 300, policy: "v1.authenticated.read", windowSeconds: 60 } },
4634
4916
  listTenants: { rateLimit: { limit: 300, policy: "v1.authenticated.read", windowSeconds: 60 } },
4635
4917
  listWebhookDeliveries: { rateLimit: { limit: 300, policy: "v1.webhooks.read", windowSeconds: 60 } },
4636
4918
  listWebhookEndpoints: { rateLimit: { limit: 300, policy: "v1.webhooks.read", windowSeconds: 60 } },
@@ -4915,13 +5197,27 @@ var defaultGroup = HttpApiGroup.make("default").add(
4915
5197
  success: IssueAccessGrantResponseSchema.pipe(HttpApiSchema.status(201)),
4916
5198
  error: [
4917
5199
  EpisodeInvalidIdErrorSchema.pipe(HttpApiSchema.status(400)),
5200
+ MediaTokenInvalidHeaderErrorSchema.pipe(HttpApiSchema.status(400)),
5201
+ MediaTokenInvalidSubjectErrorSchema.pipe(HttpApiSchema.status(400)),
5202
+ MediaTokenInvalidTimeClaimsErrorSchema.pipe(HttpApiSchema.status(400)),
5203
+ MediaTokenLifetimeExceededErrorSchema.pipe(HttpApiSchema.status(400)),
5204
+ MediaTokenMalformedErrorSchema.pipe(HttpApiSchema.status(400)),
5205
+ MediaTokenRequiredErrorSchema.pipe(HttpApiSchema.status(400)),
4918
5206
  ParticipantInvalidIdErrorSchema.pipe(HttpApiSchema.status(400)),
4919
5207
  RequestInvalidErrorSchema.pipe(HttpApiSchema.status(400)),
4920
5208
  SpaceInvalidIdErrorSchema.pipe(HttpApiSchema.status(400)),
4921
5209
  TenantInvalidIdErrorSchema.pipe(HttpApiSchema.status(400)),
4922
5210
  AccessUnauthenticatedErrorSchema.pipe(HttpApiSchema.status(401)),
5211
+ MediaTokenExpiredErrorSchema.pipe(HttpApiSchema.status(401)),
5212
+ MediaTokenInvalidAudienceErrorSchema.pipe(HttpApiSchema.status(401)),
5213
+ MediaTokenInvalidIssuerErrorSchema.pipe(HttpApiSchema.status(401)),
5214
+ MediaTokenInvalidSignatureErrorSchema.pipe(HttpApiSchema.status(401)),
5215
+ MediaTokenNotYetValidErrorSchema.pipe(HttpApiSchema.status(401)),
5216
+ MediaTokenUnknownKeyErrorSchema.pipe(HttpApiSchema.status(401)),
4923
5217
  AccessForbiddenErrorSchema.pipe(HttpApiSchema.status(403)),
5218
+ MediaTokenSubjectMismatchErrorSchema.pipe(HttpApiSchema.status(403)),
4924
5219
  ParticipantNotFoundErrorSchema.pipe(HttpApiSchema.status(404)),
5220
+ ParticipantConnectionSupersededErrorSchema.pipe(HttpApiSchema.status(409)),
4925
5221
  ParticipantGenerationMismatchErrorSchema.pipe(HttpApiSchema.status(409)),
4926
5222
  RequestPayloadTooLargeErrorSchema.pipe(HttpApiSchema.status(413)),
4927
5223
  RequestRateLimitedErrorSchema.pipe(HttpApiSchema.status(429)),
@@ -6780,6 +7076,45 @@ export {
6780
7076
  MediaConnectionNotFoundError,
6781
7077
  MediaConnectionNotFoundErrorWireSchema,
6782
7078
  MediaConnectionNotFoundErrorSchema,
7079
+ MediaTokenExpiredError,
7080
+ MediaTokenExpiredErrorWireSchema,
7081
+ MediaTokenExpiredErrorSchema,
7082
+ MediaTokenInvalidAudienceError,
7083
+ MediaTokenInvalidAudienceErrorWireSchema,
7084
+ MediaTokenInvalidAudienceErrorSchema,
7085
+ MediaTokenInvalidHeaderError,
7086
+ MediaTokenInvalidHeaderErrorWireSchema,
7087
+ MediaTokenInvalidHeaderErrorSchema,
7088
+ MediaTokenInvalidIssuerError,
7089
+ MediaTokenInvalidIssuerErrorWireSchema,
7090
+ MediaTokenInvalidIssuerErrorSchema,
7091
+ MediaTokenInvalidSignatureError,
7092
+ MediaTokenInvalidSignatureErrorWireSchema,
7093
+ MediaTokenInvalidSignatureErrorSchema,
7094
+ MediaTokenInvalidSubjectError,
7095
+ MediaTokenInvalidSubjectErrorWireSchema,
7096
+ MediaTokenInvalidSubjectErrorSchema,
7097
+ MediaTokenInvalidTimeClaimsError,
7098
+ MediaTokenInvalidTimeClaimsErrorWireSchema,
7099
+ MediaTokenInvalidTimeClaimsErrorSchema,
7100
+ MediaTokenLifetimeExceededError,
7101
+ MediaTokenLifetimeExceededErrorWireSchema,
7102
+ MediaTokenLifetimeExceededErrorSchema,
7103
+ MediaTokenMalformedError,
7104
+ MediaTokenMalformedErrorWireSchema,
7105
+ MediaTokenMalformedErrorSchema,
7106
+ MediaTokenNotYetValidError,
7107
+ MediaTokenNotYetValidErrorWireSchema,
7108
+ MediaTokenNotYetValidErrorSchema,
7109
+ MediaTokenRequiredError,
7110
+ MediaTokenRequiredErrorWireSchema,
7111
+ MediaTokenRequiredErrorSchema,
7112
+ MediaTokenSubjectMismatchError,
7113
+ MediaTokenSubjectMismatchErrorWireSchema,
7114
+ MediaTokenSubjectMismatchErrorSchema,
7115
+ MediaTokenUnknownKeyError,
7116
+ MediaTokenUnknownKeyErrorWireSchema,
7117
+ MediaTokenUnknownKeyErrorSchema,
6783
7118
  MediaUnavailableError,
6784
7119
  MediaUnavailableErrorWireSchema,
6785
7120
  MediaUnavailableErrorSchema,
@@ -6801,6 +7136,9 @@ export {
6801
7136
  PaginationInvalidPageSizeError,
6802
7137
  PaginationInvalidPageSizeErrorWireSchema,
6803
7138
  PaginationInvalidPageSizeErrorSchema,
7139
+ ParticipantConnectionSupersededError,
7140
+ ParticipantConnectionSupersededErrorWireSchema,
7141
+ ParticipantConnectionSupersededErrorSchema,
6804
7142
  ParticipantGenerationMismatchError,
6805
7143
  ParticipantGenerationMismatchErrorWireSchema,
6806
7144
  ParticipantGenerationMismatchErrorSchema,
@@ -44,7 +44,7 @@ function resolveMediaTarget(participantId, stopped, tracks, target) {
44
44
  if (target.participantId !== participantId) return { kind: "result", result: { outcome: "terminal_failure", errorCode: "invalid_participant" } };
45
45
  if (stopped) return { kind: "result", result: { outcome: "terminal_failure", errorCode: "media_stopped" } };
46
46
  const value = tracks.get(target.source);
47
- if (value === void 0) return { kind: "result", result: { outcome: "terminal_failure", errorCode: "source_unavailable" } };
47
+ if (value === void 0) return { kind: "result", result: target.enabled ? { outcome: "terminal_failure", errorCode: "source_unavailable" } : { outcome: "satisfied", errorCode: null } };
48
48
  return { kind: "state", value };
49
49
  }
50
50
 
@@ -282,7 +282,8 @@ var CloudflareSFUClient = class {
282
282
  pendingTrackName: null,
283
283
  desiredEnabled: false,
284
284
  enabled: false,
285
- endedListener: null
285
+ endedListener: null,
286
+ clearing: null
286
287
  };
287
288
  this.#reusableLocalTransceivers.delete(source);
288
289
  this.#reusableLocalPublicationIds.delete(source);
@@ -296,24 +297,35 @@ var CloudflareSFUClient = class {
296
297
  this.#publishSnapshot();
297
298
  this.#emitLocal();
298
299
  }
299
- async clearPreparedLocalTrack(source) {
300
+ async clearPreparedLocalTrack(source, options = {}) {
300
301
  const state = this.#localTracks.get(source);
301
302
  if (!state) return;
303
+ if (state.clearing) return state.clearing;
304
+ state.clearing = this.#clearPreparedTrack(state, options.stopTrack);
305
+ try {
306
+ await state.clearing;
307
+ } finally {
308
+ state.clearing = null;
309
+ }
310
+ }
311
+ async #clearPreparedTrack(state, stopTrack = true) {
312
+ const source = state.source;
302
313
  if (source === "screen_audio") {
303
314
  try {
304
315
  await this.#retireLocalPublication(source);
305
316
  } finally {
306
- this.#removeOwnedLocalTrack(state);
307
- this.#localTracks.delete(source);
317
+ this.#removeOwnedLocalTrack(state, stopTrack);
318
+ if (this.#localTracks.get(source) === state) this.#localTracks.delete(source);
308
319
  this.#publishSnapshot();
309
320
  this.#emitLocal();
310
321
  }
311
322
  return;
312
323
  }
313
324
  if (state.enabled) await this.#setPreparedTrackEnabled(state, false);
325
+ if (this.#localTracks.get(source) !== state) return;
314
326
  if (state.transceiver) this.#reusableLocalTransceivers.set(source, state.transceiver);
315
327
  if (state.providerPublicationId) this.#reusableLocalPublicationIds.set(source, state.providerPublicationId);
316
- this.#removeOwnedLocalTrack(state);
328
+ this.#removeOwnedLocalTrack(state, stopTrack);
317
329
  this.#localTracks.delete(source);
318
330
  this.#publishSnapshot();
319
331
  this.#emitLocal();
@@ -1171,9 +1183,9 @@ var CloudflareSFUClient = class {
1171
1183
  this.#reportError(error);
1172
1184
  }
1173
1185
  }
1174
- #removeOwnedLocalTrack(state) {
1186
+ #removeOwnedLocalTrack(state, stopTrack = true) {
1175
1187
  if (state.endedListener) state.track.removeEventListener("ended", state.endedListener);
1176
- safeStopTrack(state.track, this.#reportError.bind(this));
1188
+ if (stopTrack) safeStopTrack(state.track, this.#reportError.bind(this));
1177
1189
  state.enabled = false;
1178
1190
  state.desiredEnabled = false;
1179
1191
  state.transceiver = null;