@q9labsai/chalk-client 5.0.1 → 5.2.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 (236) hide show
  1. package/CHANGELOG.md +159 -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 +3 -1
  9. package/dist/{chunk-IPAN4LUZ.js → chunk-BCO3AZUB.js} +1463 -583
  10. package/dist/{chunk-AVXJ4HQU.js → chunk-D2GXPX2P.js} +298 -47
  11. package/dist/{chunk-CMVO7USN.js → chunk-DHGAKJXP.js} +1 -1
  12. package/dist/{chunk-O2NOZKJP.js → chunk-DWKTGBHR.js} +20 -8
  13. package/dist/{chunk-2HJIJVE2.js → chunk-HO4745TX.js} +591 -5
  14. package/dist/client.d.ts +277 -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 +8 -3
  19. package/dist/connection/diagnostics.d.ts +3 -3
  20. package/dist/connection/index.d.ts +1 -1
  21. package/dist/connection/lifecycle.d.ts +3 -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 +4 -2
  25. package/dist/effect.d.ts +0 -1
  26. package/dist/effect.js +146 -4
  27. package/dist/foreground-deadline.d.ts +0 -1
  28. package/dist/generated/http-api.d.ts +273 -1
  29. package/dist/generated/schemas.d.ts +732 -7
  30. package/dist/generated/sync.d.ts +74 -4
  31. package/dist/generated/whiteboard-v1.d.ts +114 -9
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.js +21 -15
  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 +1 -2
  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 +15 -3
  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/connect-diagnostics.d.ts +10 -0
  87. package/dist/sync/dial-deadline.d.ts +3 -0
  88. package/dist/sync/errors.d.ts +0 -1
  89. package/dist/sync/index.d.ts +0 -1
  90. package/dist/sync/index.js +1 -1
  91. package/dist/sync/react-native.d.ts +0 -1
  92. package/dist/sync/types.d.ts +1 -1
  93. package/dist/sync/v1-client.d.ts +4 -2
  94. package/dist/sync/v1-codec.d.ts +0 -1
  95. package/dist/sync/v1-collaboration-state.d.ts +1 -1
  96. package/dist/sync/v1-command-scheduler.d.ts +0 -1
  97. package/dist/sync/v1-create.d.ts +0 -1
  98. package/dist/sync/v1-deferred.d.ts +0 -1
  99. package/dist/sync/v1-error.d.ts +0 -1
  100. package/dist/sync/v1-frame-signature.d.ts +0 -1
  101. package/dist/sync/v1-health.d.ts +15 -0
  102. package/dist/sync/v1-live-target-coordinator.d.ts +0 -1
  103. package/dist/sync/v1-persistence.d.ts +0 -1
  104. package/dist/sync/v1-platform-persistence.d.ts +0 -1
  105. package/dist/sync/v1-reducer.d.ts +3 -1
  106. package/dist/sync/v1-types.d.ts +14 -1
  107. package/dist/webhooks/errors.d.ts +0 -1
  108. package/dist/webhooks/generated/event-v1.d.ts +0 -1
  109. package/dist/webhooks/generated/fixtures-v1.d.ts +0 -1
  110. package/dist/webhooks/index.d.ts +0 -1
  111. package/dist/webhooks/processor.d.ts +0 -1
  112. package/dist/webhooks/server-only.d.ts +0 -1
  113. package/dist/webhooks/test.d.ts +0 -1
  114. package/dist/webhooks/types.d.ts +0 -1
  115. package/dist/webhooks/validate.d.ts +0 -1
  116. package/dist/webhooks/verify.d.ts +0 -1
  117. package/dist/whiteboard/file-download-transport.d.ts +0 -1
  118. package/dist/whiteboard/index.d.ts +2 -1
  119. package/dist/whiteboard/types.d.ts +54 -5
  120. package/dist/whiteboard/v1-client.d.ts +5 -2
  121. package/dist/whiteboard/v1-codec.d.ts +5 -2
  122. package/dist/whiteboard/v1-create.d.ts +0 -1
  123. package/dist/whiteboard/v1-multipart.d.ts +1 -2
  124. package/dist/whiteboard/v1-persistence.d.ts +0 -1
  125. package/dist/whiteboard/view-bounds.d.ts +5 -0
  126. package/dist/whiteboard/view-versions.d.ts +9 -0
  127. package/package.json +4 -2
  128. package/dist/access/base64-url.d.ts.map +0 -1
  129. package/dist/access/grant.d.ts.map +0 -1
  130. package/dist/access/grant.test.helpers.d.ts +0 -10
  131. package/dist/access/grant.test.helpers.d.ts.map +0 -1
  132. package/dist/access/manager.d.ts.map +0 -1
  133. package/dist/chat-files/http-transport.d.ts.map +0 -1
  134. package/dist/chat-files/index.d.ts.map +0 -1
  135. package/dist/chat-files/types.d.ts.map +0 -1
  136. package/dist/client.d.ts.map +0 -1
  137. package/dist/collaboration/index.d.ts.map +0 -1
  138. package/dist/collaboration/types.d.ts.map +0 -1
  139. package/dist/collaboration/wire.d.ts.map +0 -1
  140. package/dist/connection/dependencies.d.ts.map +0 -1
  141. package/dist/connection/diagnostics.d.ts.map +0 -1
  142. package/dist/connection/index.d.ts.map +0 -1
  143. package/dist/connection/lifecycle.d.ts.map +0 -1
  144. package/dist/connection/media-devices.d.ts.map +0 -1
  145. package/dist/connection/production.d.ts.map +0 -1
  146. package/dist/connection/types.d.ts.map +0 -1
  147. package/dist/effect.d.ts.map +0 -1
  148. package/dist/foreground-deadline.d.ts.map +0 -1
  149. package/dist/generated/http-api.d.ts.map +0 -1
  150. package/dist/generated/schemas.d.ts.map +0 -1
  151. package/dist/generated/sync.d.ts.map +0 -1
  152. package/dist/generated/whiteboard-v1.d.ts.map +0 -1
  153. package/dist/index.d.ts.map +0 -1
  154. package/dist/media/camera-uplink.d.ts.map +0 -1
  155. package/dist/media/capture-error.d.ts.map +0 -1
  156. package/dist/media/client.d.ts.map +0 -1
  157. package/dist/media/cloudflare-sfu.d.ts.map +0 -1
  158. package/dist/media/index.d.ts.map +0 -1
  159. package/dist/media/observers.d.ts.map +0 -1
  160. package/dist/media/plane.d.ts.map +0 -1
  161. package/dist/media/remote-track-response.d.ts.map +0 -1
  162. package/dist/media/target.d.ts.map +0 -1
  163. package/dist/media/tracks.d.ts.map +0 -1
  164. package/dist/media/transport.d.ts.map +0 -1
  165. package/dist/media/types.d.ts.map +0 -1
  166. package/dist/public-invites/client.d.ts.map +0 -1
  167. package/dist/public-invites/index.d.ts.map +0 -1
  168. package/dist/public-invites/types.d.ts.map +0 -1
  169. package/dist/server/access-refresh.d.ts.map +0 -1
  170. package/dist/server/client.d.ts.map +0 -1
  171. package/dist/server/errors.d.ts.map +0 -1
  172. package/dist/server/index.d.ts.map +0 -1
  173. package/dist/server/server-only.d.ts.map +0 -1
  174. package/dist/server/transport.d.ts.map +0 -1
  175. package/dist/server/types.d.ts.map +0 -1
  176. package/dist/space-client/chat-controller-helpers.d.ts.map +0 -1
  177. package/dist/space-client/chat-controller.d.ts.map +0 -1
  178. package/dist/space-client/controller-effects.d.ts.map +0 -1
  179. package/dist/space-client/core.d.ts.map +0 -1
  180. package/dist/space-client/core.test.helpers.d.ts +0 -15
  181. package/dist/space-client/core.test.helpers.d.ts.map +0 -1
  182. package/dist/space-client/effect.d.ts.map +0 -1
  183. package/dist/space-client/errors.d.ts.map +0 -1
  184. package/dist/space-client/index.d.ts.map +0 -1
  185. package/dist/space-client/media-controller.d.ts.map +0 -1
  186. package/dist/space-client/media-device-selection.d.ts.map +0 -1
  187. package/dist/space-client/offline-actions-storage.d.ts.map +0 -1
  188. package/dist/space-client/offline-actions.d.ts.map +0 -1
  189. package/dist/space-client/participants-controller.d.ts.map +0 -1
  190. package/dist/space-client/promise-facade.d.ts.map +0 -1
  191. package/dist/space-client/reactions-controller.d.ts.map +0 -1
  192. package/dist/space-client/recording-controller.d.ts.map +0 -1
  193. package/dist/space-client/reload-rejoin.d.ts.map +0 -1
  194. package/dist/space-client/space-client.d.ts.map +0 -1
  195. package/dist/space-client/store.d.ts.map +0 -1
  196. package/dist/space-client/terminal.test.helpers.d.ts +0 -136
  197. package/dist/space-client/terminal.test.helpers.d.ts.map +0 -1
  198. package/dist/space-client/types.d.ts.map +0 -1
  199. package/dist/space-client/whiteboard-controller.d.ts.map +0 -1
  200. package/dist/sync/browser.d.ts.map +0 -1
  201. package/dist/sync/canonical.d.ts.map +0 -1
  202. package/dist/sync/errors.d.ts.map +0 -1
  203. package/dist/sync/index.d.ts.map +0 -1
  204. package/dist/sync/react-native.d.ts.map +0 -1
  205. package/dist/sync/types.d.ts.map +0 -1
  206. package/dist/sync/v1-client.d.ts.map +0 -1
  207. package/dist/sync/v1-codec.d.ts.map +0 -1
  208. package/dist/sync/v1-collaboration-state.d.ts.map +0 -1
  209. package/dist/sync/v1-command-scheduler.d.ts.map +0 -1
  210. package/dist/sync/v1-create.d.ts.map +0 -1
  211. package/dist/sync/v1-deferred.d.ts.map +0 -1
  212. package/dist/sync/v1-error.d.ts.map +0 -1
  213. package/dist/sync/v1-frame-signature.d.ts.map +0 -1
  214. package/dist/sync/v1-live-target-coordinator.d.ts.map +0 -1
  215. package/dist/sync/v1-persistence.d.ts.map +0 -1
  216. package/dist/sync/v1-platform-persistence.d.ts.map +0 -1
  217. package/dist/sync/v1-reducer.d.ts.map +0 -1
  218. package/dist/sync/v1-types.d.ts.map +0 -1
  219. package/dist/webhooks/errors.d.ts.map +0 -1
  220. package/dist/webhooks/generated/event-v1.d.ts.map +0 -1
  221. package/dist/webhooks/generated/fixtures-v1.d.ts.map +0 -1
  222. package/dist/webhooks/index.d.ts.map +0 -1
  223. package/dist/webhooks/processor.d.ts.map +0 -1
  224. package/dist/webhooks/server-only.d.ts.map +0 -1
  225. package/dist/webhooks/test.d.ts.map +0 -1
  226. package/dist/webhooks/types.d.ts.map +0 -1
  227. package/dist/webhooks/validate.d.ts.map +0 -1
  228. package/dist/webhooks/verify.d.ts.map +0 -1
  229. package/dist/whiteboard/file-download-transport.d.ts.map +0 -1
  230. package/dist/whiteboard/index.d.ts.map +0 -1
  231. package/dist/whiteboard/types.d.ts.map +0 -1
  232. package/dist/whiteboard/v1-client.d.ts.map +0 -1
  233. package/dist/whiteboard/v1-codec.d.ts.map +0 -1
  234. package/dist/whiteboard/v1-create.d.ts.map +0 -1
  235. package/dist/whiteboard/v1-multipart.d.ts.map +0 -1
  236. package/dist/whiteboard/v1-persistence.d.ts.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,159 @@
1
+ # Changelog
2
+
3
+ ## 5.2.0
4
+
5
+ ### board-draw-policy
6
+
7
+ Add a call-wide drawing policy for the board: everyone, only hosts, or picked people.
8
+ Hosts set it with `setDrawPolicy` on the whiteboard transport and pick people with the
9
+ existing `setDrawPermission`. Sync computes each person's permission and sends it with
10
+ the policy over the new `draw_policy_v1` extension, so the summary and
11
+ `useWhiteboard().access` now carry `canDraw`, `drawPolicy` and the host's per-person
12
+ choices. The React board follows that permission instead of the role capability, and
13
+ hosts get a "Who can draw" section with a person picker in the board menu.
14
+
15
+ The whiteboard client now steps its hello down only when Sync can't decode it (close
16
+ 1009). A rejected token or a late hello (close 1008) is retried at the same level up to
17
+ four times, so a brief token problem no longer hides the drawing policy for the rest of
18
+ the connection. On a Sync without the drawing policy, a host's waiting policy change is
19
+ refused as `unavailable`, and also reported on the summary, instead of being replayed.
20
+
21
+ ### confirmed-call-entry
22
+
23
+ Count a person in a call only after they have fully entered it. The built-in
24
+ browser and React Native Sync clients ask Sync for entry confirmation on the Sync
25
+ URL (`entry_confirmation=1`). When Sync's `welcome` grants it, the client sends
26
+ `entered` once Sync is live and media has started, so a failed connection no
27
+ longer leaves a ghost participant or an attendance record. Against an older Sync,
28
+ the client sends the previous hello and Sync confirms entry at hello as before.
29
+
30
+ `confirmEntered()` on a custom `createSyncClient` implementation is optional.
31
+ Implementing it, and building `V1SyncClient` with `entryConfirmation: true`, adds
32
+ the confirmed entry above. Without it, the client never asks for entry
33
+ confirmation and Sync confirms the entry at hello, as in 5.0.x. `V1SyncClient`
34
+ asks only when it is built with `entryConfirmation: true`.
35
+
36
+ When entry fails, the client cancels the pending admission through the new
37
+ `cancelEpisodeParticipantJoin` endpoint (`POST .../participants/:participant_id/cancel-join`),
38
+ and a retry keeps the same person. If Sync reports `entry timeout` because the
39
+ pending seat expired before entry, the connection fails as a retryable
40
+ `sync_start_failed` instead of rejected access, and the client does not reconnect
41
+ the expired seat with the same grant.
42
+
43
+ The admission contract declares the 409 `participant.not_active` response when
44
+ a retried admission names a participant that has already left. The public
45
+ `AdmitEpisodeParticipantError` union stays compatible with 5.1.0; this response
46
+ uses the existing `HttpClientError` channel, with its code in the response body.
47
+ The dashboard reads that code and retries once with a fresh join key.
48
+
49
+ Sync assigns each entry a participant-local generation and returns it in
50
+ `welcome`. The client resumes that generation through the `entry_generation`
51
+ WebSocket query, even after refreshing its credential. Confirmation advances
52
+ ownership only forward and voids older pending Leaves. Acceptance and completion
53
+ both fence a Leave against the confirmed generation, so reattaching the same
54
+ seat cannot let the previous mount remove it. Previous Sync ignores this query.
55
+ Legacy sockets receive a server generation internally without changing their
56
+ welcome frame, and still confirm at hello. Participants created before seat
57
+ storage acquire it on their first live hello. When recovery replaces the Sync
58
+ client, it confirms the replacement entry before reporting recovery complete.
59
+ Completed startup also survives reconnecting from an older Sync to an upgraded
60
+ one. Recovery can finish while a previous entry's Leave is pending, and an
61
+ uncertain confirmation reply checks that entry's generation before acknowledging it.
62
+ A claimed Leave blocks later entry
63
+ admission until its provider work settles. An entry admitted before that claim
64
+ defers the older provider work until confirmation or its two-minute startup
65
+ lease expires, preventing old cleanup from closing the new entry's media.
66
+
67
+ Rollout: apply the database migrations first, then upgrade Sync, then the API and
68
+ this client. This client also works with an older Sync, and published 5.0.x
69
+ clients keep hello confirmation with the new Sync.
70
+
71
+ ### follow-view-owner
72
+
73
+ Converge Follow views on one Episode owner, recover from its canonical snapshot,
74
+ and preserve real camera moves during recovery and tab switches. Zoom controls
75
+ and keyboard moves now consistently leave Follow and lead the person's view.
76
+
77
+ Keep all 500 active people's views using internal schema-generated limits in the client and React caches. The client's public bounds, event unions and decoded-frame unions are unchanged. The client now exports `ChalkWhiteboardViewVersions`, which the React SDK uses to order view moves, and whiteboard view events now carry `ownerId`, `ownerSequence` and `originEpoch`, so both releases are minor.
78
+
79
+ ### honest-chat-file-errors
80
+
81
+ Report chat attachment network and browser access failures without blaming storage.
82
+ Keep token acquisition failures separate with a diagnostic stage while preserving
83
+ the published error codes and original cause. Preserve recoverable access and
84
+ connection failures through SpaceClient, including signed storage uploads. Show
85
+ the storage-unavailable message only when a readable 503 response confirms
86
+ `chat.storage_unavailable`.
87
+
88
+ ### problem-reporting
89
+
90
+ Add the problem-report API contract and reusable report dialog, with opt-in diagnostics,
91
+ editable delivery failures and bounded Unicode input. Call details and failed or ended
92
+ call screens can expose reporting when an integration supplies a delivery callback.
93
+ Use `reportUnavailableReason` to show expired access inside an editable report.
94
+ Live report drafts survive call termination. Integrations with their own terminal
95
+ screens can use `onOpenReportProblem` to keep one app-owned dialog across those screens.
96
+ Give `ReportProblemDialog` a `focusScope` containing the current call or terminal screen,
97
+ so closing it returns focus to its usable opener, or to a visible current control
98
+ when the opener has disappeared. Hidden, inert and disabled targets are skipped.
99
+
100
+ ### recording-auto-render
101
+
102
+ Expose recording expiry reasons through additive failure fields while preserving the existing export status enum.
103
+
104
+ Add the Tenant recording_render_mode setting, defaulting to on_demand, with opt-in automatic MP4 rendering.
105
+
106
+ ### recording-transcription-expiry
107
+
108
+ Recordings now report when their transcription source expires, as
109
+ `transcription_preparation.expires_at`. A transcript can be requested only
110
+ while `transcription_preparation.status` is `ready` and this time is ahead. It
111
+ is never later than `source.expires_at`, and it can be much earlier, because a
112
+ Space's transcription source window is often shorter than its video retention. The field is
113
+ absent when transcription is disabled or no transcription source exists yet.
114
+
115
+ ### space-activity-read
116
+
117
+ Add `spaces.listSpaceActivity` (`GET /v1/tenants/{tenant_id}/space-activity`) and
118
+ its generated schemas and types. One read returns, for up to 300 Spaces, whether each
119
+ is archived, the live Episode with its full participant count and first five Participants, the latest
120
+ Episode with its status and start and end times, and up to five Participants who
121
+ most recently joined that Episode. It needs `episodes:read`; an unknown or other
122
+ Tenant's Space returns `404` for the whole batch. Existing operations are unchanged.
123
+
124
+ ### sync-connect-diagnostics
125
+
126
+ Report Sync connection failures with the existing `connection.sync_hello_timeout` code without adding values to the public `ErrorCode` union. Add the current attempt's safe diagnostics to client errors, telemetry, and the call failure reference: opening/hello stage, close code and bounded reason, whether the socket opened, and elapsed time. Earlier attempts remain in the diagnostic history. Browsers do not expose DNS, TCP, or TLS progress. Unrecognized peer reasons are redacted. This is a compatible patch for the next client and React releases; released 5.1.0 files are unchanged.
127
+
128
+ ## 5.1.0
129
+
130
+ - 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.
131
+ - 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`.
132
+ - 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.
133
+ - 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`.
134
+ - Calling `leave()` no longer closes media the server already ended.
135
+ - 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.
136
+ - 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.
137
+ - Capture a fresh microphone when it is turned on after its previous track ended, instead of reusing the ended track.
138
+ - 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`.
139
+ - 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.
140
+ - 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.
141
+ - 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.
142
+ - 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.
143
+ - Exhausted media confirmations now return recoverable `media.timeout`; unrelated command retries are not classified as media failures.
144
+ - Reaction acknowledgement timeouts return recoverable `collaboration.unavailable` without claiming whether the reaction arrived.
145
+
146
+ - Preserve access, Sync, SFU, and recovery failure codes and recoverability in join rejections, snapshots, and error events.
147
+ - 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.
148
+ - Media changes while Sync is not live now return recoverable `connection.invalid_state` with plain connection guidance instead of an internal target error.
149
+
150
+ ## 5.0.0
151
+
152
+ - BREAKING: remove Episode diagnostics, client telemetry, feedback submission, RealtimeKit, public status, Tenant invitations, audit-log and Users API operations, and the regions catalog.
153
+ - BREAKING: replace `createChalkWhiteboardV1FileHttpTransport` with the download-only `createChalkWhiteboardV1FileDownloadTransport`. Remove the retired local file-upload API.
154
+ - 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.
155
+ - 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.
156
+ - Publish and play shared tab audio separately from microphones, with share-audio state and coupled screen-share lifecycle.
157
+
158
+ - Add optional screen-capture surface/audio hints and actual selected surface/label metadata.
159
+ - 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
@@ -1,16 +1,19 @@
1
1
  import type { ChalkChatAttachment, ChalkChatAttachmentMimeType } from "../collaboration/types";
2
2
  export type ChalkChatFileOperation = "initiate_upload" | "finalize_upload" | "get_download";
3
+ export declare const CHAT_FILE_REACHABILITY_MESSAGE = "Could not reach the chat attachment service (network or browser access failure).";
3
4
  export type ChalkChatFileErrorCode = "access.invalid" | "unavailable" | "permission_denied" | "invalid_payload" | "conflict" | "not_found" | "expired" | "file_transfer_failed";
4
5
  export type ChalkChatFileFailure = {
5
6
  readonly operation: ChalkChatFileOperation;
6
7
  readonly code: ChalkChatFileErrorCode;
7
8
  readonly recoverable: boolean;
8
9
  readonly message: string;
10
+ readonly stage?: "token" | "request";
9
11
  };
10
12
  export declare class ChalkChatFileError extends Error {
11
13
  readonly operation: ChalkChatFileOperation;
12
14
  readonly code: ChalkChatFileErrorCode;
13
15
  readonly recoverable: boolean;
16
+ readonly stage: "token" | "request";
14
17
  constructor(failure: ChalkChatFileFailure, options?: ErrorOptions);
15
18
  }
16
19
  export type ChalkChatFileTransport = {
@@ -34,4 +37,3 @@ export type ChalkChatFileTransport = {
34
37
  readonly expiresAt: string;
35
38
  }>;
36
39
  };
37
- //# sourceMappingURL=types.d.ts.map