@stapel/chat-react 0.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 (195) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/MODULE.md +118 -0
  3. package/README.md +126 -0
  4. package/dist/api/chatApi.d.ts +49 -0
  5. package/dist/api/chatApi.d.ts.map +1 -0
  6. package/dist/api/chatApi.js +46 -0
  7. package/dist/api/chatApi.js.map +1 -0
  8. package/dist/api/extensions.d.ts +19 -0
  9. package/dist/api/extensions.d.ts.map +1 -0
  10. package/dist/api/extensions.js +19 -0
  11. package/dist/api/extensions.js.map +1 -0
  12. package/dist/api/generated/schema.d.ts +547 -0
  13. package/dist/api/generated/schema.d.ts.map +1 -0
  14. package/dist/api/generated/schema.js +2 -0
  15. package/dist/api/generated/schema.js.map +1 -0
  16. package/dist/api/types.d.ts +75 -0
  17. package/dist/api/types.d.ts.map +1 -0
  18. package/dist/api/types.js +2 -0
  19. package/dist/api/types.js.map +1 -0
  20. package/dist/default/ConversationListPanel.d.ts +22 -0
  21. package/dist/default/ConversationListPanel.d.ts.map +1 -0
  22. package/dist/default/ConversationListPanel.js +49 -0
  23. package/dist/default/ConversationListPanel.js.map +1 -0
  24. package/dist/default/ConversationThreadPanel.d.ts +21 -0
  25. package/dist/default/ConversationThreadPanel.d.ts.map +1 -0
  26. package/dist/default/ConversationThreadPanel.js +51 -0
  27. package/dist/default/ConversationThreadPanel.js.map +1 -0
  28. package/dist/default/ErrorAlert.d.ts +8 -0
  29. package/dist/default/ErrorAlert.d.ts.map +1 -0
  30. package/dist/default/ErrorAlert.js +26 -0
  31. package/dist/default/ErrorAlert.js.map +1 -0
  32. package/dist/default/StartChatButton.d.ts +17 -0
  33. package/dist/default/StartChatButton.d.ts.map +1 -0
  34. package/dist/default/StartChatButton.js +18 -0
  35. package/dist/default/StartChatButton.js.map +1 -0
  36. package/dist/default/index.d.ts +21 -0
  37. package/dist/default/index.d.ts.map +1 -0
  38. package/dist/default/index.js +18 -0
  39. package/dist/default/index.js.map +1 -0
  40. package/dist/flows/errors.d.ts +12 -0
  41. package/dist/flows/errors.d.ts.map +1 -0
  42. package/dist/flows/errors.js +13 -0
  43. package/dist/flows/errors.js.map +1 -0
  44. package/dist/flows/freshness.d.ts +69 -0
  45. package/dist/flows/freshness.d.ts.map +1 -0
  46. package/dist/flows/freshness.js +227 -0
  47. package/dist/flows/freshness.js.map +1 -0
  48. package/dist/flows/registry.d.ts +26 -0
  49. package/dist/flows/registry.d.ts.map +1 -0
  50. package/dist/flows/registry.js +24 -0
  51. package/dist/flows/registry.js.map +1 -0
  52. package/dist/headless/ChatProvider.d.ts +22 -0
  53. package/dist/headless/ChatProvider.d.ts.map +1 -0
  54. package/dist/headless/ChatProvider.js +18 -0
  55. package/dist/headless/ChatProvider.js.map +1 -0
  56. package/dist/headless/ConversationList.d.ts +51 -0
  57. package/dist/headless/ConversationList.d.ts.map +1 -0
  58. package/dist/headless/ConversationList.js +47 -0
  59. package/dist/headless/ConversationList.js.map +1 -0
  60. package/dist/headless/ConversationThread.d.ts +50 -0
  61. package/dist/headless/ConversationThread.d.ts.map +1 -0
  62. package/dist/headless/ConversationThread.js +64 -0
  63. package/dist/headless/ConversationThread.js.map +1 -0
  64. package/dist/headless/MessageComposer.d.ts +39 -0
  65. package/dist/headless/MessageComposer.d.ts.map +1 -0
  66. package/dist/headless/MessageComposer.js +45 -0
  67. package/dist/headless/MessageComposer.js.map +1 -0
  68. package/dist/headless/StartDirectChat.d.ts +40 -0
  69. package/dist/headless/StartDirectChat.d.ts.map +1 -0
  70. package/dist/headless/StartDirectChat.js +46 -0
  71. package/dist/headless/StartDirectChat.js.map +1 -0
  72. package/dist/i18n/errorsMap.d.ts +10 -0
  73. package/dist/i18n/errorsMap.d.ts.map +1 -0
  74. package/dist/i18n/errorsMap.js +20 -0
  75. package/dist/i18n/errorsMap.js.map +1 -0
  76. package/dist/i18n/es.d.ts +23 -0
  77. package/dist/i18n/es.d.ts.map +1 -0
  78. package/dist/i18n/es.js +75 -0
  79. package/dist/i18n/es.js.map +1 -0
  80. package/dist/i18n/generated/errors.es.gen.d.ts +16 -0
  81. package/dist/i18n/generated/errors.es.gen.d.ts.map +1 -0
  82. package/dist/i18n/generated/errors.es.gen.js +58 -0
  83. package/dist/i18n/generated/errors.es.gen.js.map +1 -0
  84. package/dist/i18n/generated/errors.gen.d.ts +359 -0
  85. package/dist/i18n/generated/errors.gen.d.ts.map +1 -0
  86. package/dist/i18n/generated/errors.gen.js +183 -0
  87. package/dist/i18n/generated/errors.gen.js.map +1 -0
  88. package/dist/i18n/generated/errors.ru.gen.d.ts +16 -0
  89. package/dist/i18n/generated/errors.ru.gen.d.ts.map +1 -0
  90. package/dist/i18n/generated/errors.ru.gen.js +58 -0
  91. package/dist/i18n/generated/errors.ru.gen.js.map +1 -0
  92. package/dist/i18n/keys.d.ts +78 -0
  93. package/dist/i18n/keys.d.ts.map +1 -0
  94. package/dist/i18n/keys.js +130 -0
  95. package/dist/i18n/keys.js.map +1 -0
  96. package/dist/i18n/ru.d.ts +28 -0
  97. package/dist/i18n/ru.d.ts.map +1 -0
  98. package/dist/i18n/ru.js +80 -0
  99. package/dist/i18n/ru.js.map +1 -0
  100. package/dist/index.d.ts +61 -0
  101. package/dist/index.d.ts.map +1 -0
  102. package/dist/index.js +55 -0
  103. package/dist/index.js.map +1 -0
  104. package/dist/model/context.d.ts +11 -0
  105. package/dist/model/context.d.ts.map +1 -0
  106. package/dist/model/context.js +16 -0
  107. package/dist/model/context.js.map +1 -0
  108. package/dist/model/limits.d.ts +12 -0
  109. package/dist/model/limits.d.ts.map +1 -0
  110. package/dist/model/limits.js +12 -0
  111. package/dist/model/limits.js.map +1 -0
  112. package/dist/model/mutations.d.ts +66 -0
  113. package/dist/model/mutations.d.ts.map +1 -0
  114. package/dist/model/mutations.js +156 -0
  115. package/dist/model/mutations.js.map +1 -0
  116. package/dist/model/queries.d.ts +33 -0
  117. package/dist/model/queries.d.ts.map +1 -0
  118. package/dist/model/queries.js +93 -0
  119. package/dist/model/queries.js.map +1 -0
  120. package/dist/model/queryKeys.d.ts +8 -0
  121. package/dist/model/queryKeys.d.ts.map +1 -0
  122. package/dist/model/queryKeys.js +26 -0
  123. package/dist/model/queryKeys.js.map +1 -0
  124. package/dist/model/readMarker.d.ts +25 -0
  125. package/dist/model/readMarker.d.ts.map +1 -0
  126. package/dist/model/readMarker.js +31 -0
  127. package/dist/model/readMarker.js.map +1 -0
  128. package/dist/model/runtime.d.ts +50 -0
  129. package/dist/model/runtime.d.ts.map +1 -0
  130. package/dist/model/runtime.js +27 -0
  131. package/dist/model/runtime.js.map +1 -0
  132. package/dist/model/threadWindow.d.ts +95 -0
  133. package/dist/model/threadWindow.d.ts.map +1 -0
  134. package/dist/model/threadWindow.js +100 -0
  135. package/dist/model/threadWindow.js.map +1 -0
  136. package/dist/nav/manifest.d.ts +23 -0
  137. package/dist/nav/manifest.d.ts.map +1 -0
  138. package/dist/nav/manifest.js +15 -0
  139. package/dist/nav/manifest.js.map +1 -0
  140. package/dist/realtime/chatSocket.d.ts +93 -0
  141. package/dist/realtime/chatSocket.d.ts.map +1 -0
  142. package/dist/realtime/chatSocket.js +199 -0
  143. package/dist/realtime/chatSocket.js.map +1 -0
  144. package/dist/realtime/frames.d.ts +123 -0
  145. package/dist/realtime/frames.d.ts.map +1 -0
  146. package/dist/realtime/frames.js +123 -0
  147. package/dist/realtime/frames.js.map +1 -0
  148. package/dist/realtime/streams.d.ts +49 -0
  149. package/dist/realtime/streams.d.ts.map +1 -0
  150. package/dist/realtime/streams.js +52 -0
  151. package/dist/realtime/streams.js.map +1 -0
  152. package/llms.txt +89 -0
  153. package/manifest.json +733 -0
  154. package/nav-manifest.json +25 -0
  155. package/package.json +114 -0
  156. package/src/analytics/generated/events.json +7 -0
  157. package/src/api/chatApi.ts +142 -0
  158. package/src/api/extensions.ts +18 -0
  159. package/src/api/generated/schema.ts +549 -0
  160. package/src/api/types.ts +87 -0
  161. package/src/default/ConversationListPanel.tsx +163 -0
  162. package/src/default/ConversationThreadPanel.tsx +245 -0
  163. package/src/default/ErrorAlert.tsx +43 -0
  164. package/src/default/StartChatButton.tsx +78 -0
  165. package/src/default/index.ts +20 -0
  166. package/src/flows/errors.ts +16 -0
  167. package/src/flows/freshness.ts +315 -0
  168. package/src/flows/registry.ts +36 -0
  169. package/src/headless/ChatProvider.tsx +23 -0
  170. package/src/headless/ConversationList.tsx +92 -0
  171. package/src/headless/ConversationThread.tsx +107 -0
  172. package/src/headless/MessageComposer.tsx +86 -0
  173. package/src/headless/StartDirectChat.tsx +75 -0
  174. package/src/i18n/errorsMap.ts +31 -0
  175. package/src/i18n/es.ts +95 -0
  176. package/src/i18n/generated/errors.es.gen.ts +64 -0
  177. package/src/i18n/generated/errors.gen.ts +214 -0
  178. package/src/i18n/generated/errors.json +408 -0
  179. package/src/i18n/generated/errors.ru.gen.ts +64 -0
  180. package/src/i18n/keys.ts +152 -0
  181. package/src/i18n/ru.ts +98 -0
  182. package/src/index.ts +189 -0
  183. package/src/model/context.tsx +25 -0
  184. package/src/model/limits.ts +11 -0
  185. package/src/model/mutations.ts +208 -0
  186. package/src/model/queries.ts +120 -0
  187. package/src/model/queryKeys.ts +32 -0
  188. package/src/model/readMarker.ts +32 -0
  189. package/src/model/runtime.ts +90 -0
  190. package/src/model/threadWindow.ts +173 -0
  191. package/src/nav/manifest.ts +36 -0
  192. package/src/realtime/chatSocket.ts +304 -0
  193. package/src/realtime/frames.ts +229 -0
  194. package/src/realtime/streams.ts +85 -0
  195. package/tsconfig.json +26 -0
package/manifest.json ADDED
@@ -0,0 +1,733 @@
1
+ {
2
+ "$generated": "by scripts/gen-manifest.mjs — do not edit; drift-gated (pnpm gen:manifest:check)",
3
+ "package": "@stapel/chat-react",
4
+ "version": "0.1.0",
5
+ "backend": {
6
+ "module": "stapel-chat",
7
+ "contract": ">=0.2 <0.3"
8
+ },
9
+ "layers": [
10
+ "api",
11
+ "model",
12
+ "flows",
13
+ "headless",
14
+ "i18n"
15
+ ],
16
+ "flows": {},
17
+ "machines": [],
18
+ "operations": {
19
+ "chat_api_v1_conversations_create": {
20
+ "method": "POST",
21
+ "path": "/chat/api/v1/conversations",
22
+ "tag": "Chat",
23
+ "request": "CreateConversationRequest",
24
+ "response": "ConversationResponse"
25
+ },
26
+ "chat_api_v1_conversations_list": {
27
+ "method": "GET",
28
+ "path": "/chat/api/v1/conversations",
29
+ "tag": "Chat",
30
+ "request": null,
31
+ "response": "PaginatedConversationResponseList"
32
+ },
33
+ "chat_api_v1_conversations_messages_create": {
34
+ "method": "POST",
35
+ "path": "/chat/api/v1/conversations/{conversation_id}/messages",
36
+ "tag": "Chat",
37
+ "request": "SendMessageRequest",
38
+ "response": "MessageResponse"
39
+ },
40
+ "chat_api_v1_conversations_messages_list": {
41
+ "method": "GET",
42
+ "path": "/chat/api/v1/conversations/{conversation_id}/messages",
43
+ "tag": "Chat",
44
+ "request": null,
45
+ "response": "PaginatedMessageResponseList"
46
+ },
47
+ "chat_api_v1_conversations_read_create": {
48
+ "method": "POST",
49
+ "path": "/chat/api/v1/conversations/{conversation_id}/read",
50
+ "tag": "Chat",
51
+ "request": "MarkReadRequest",
52
+ "response": null
53
+ },
54
+ "chat_api_v1_conversations_retrieve": {
55
+ "method": "GET",
56
+ "path": "/chat/api/v1/conversations/{conversation_id}",
57
+ "tag": "Chat",
58
+ "request": null,
59
+ "response": "ConversationResponse"
60
+ },
61
+ "chat_api_v1_support_conversations_assign_create": {
62
+ "method": "POST",
63
+ "path": "/chat/api/v1/support/conversations/{conversation_id}/assign",
64
+ "tag": "Chat support",
65
+ "request": null,
66
+ "response": "ConversationResponse"
67
+ },
68
+ "chat_api_v1_support_conversations_reopen_create": {
69
+ "method": "POST",
70
+ "path": "/chat/api/v1/support/conversations/{conversation_id}/reopen",
71
+ "tag": "Chat support",
72
+ "request": null,
73
+ "response": "ConversationResponse"
74
+ },
75
+ "chat_api_v1_support_conversations_resolve_create": {
76
+ "method": "POST",
77
+ "path": "/chat/api/v1/support/conversations/{conversation_id}/resolve",
78
+ "tag": "Chat support",
79
+ "request": null,
80
+ "response": "ConversationResponse"
81
+ },
82
+ "chat_api_v1_support_queue_list": {
83
+ "method": "GET",
84
+ "path": "/chat/api/v1/support/queue",
85
+ "tag": "Chat support",
86
+ "request": null,
87
+ "response": "PaginatedConversationResponseList"
88
+ }
89
+ },
90
+ "hooks": {
91
+ "useConversation": {
92
+ "kind": "query",
93
+ "operation": "conversation",
94
+ "queryKey": [
95
+ "chat",
96
+ "conversation",
97
+ "{conversationId}"
98
+ ]
99
+ },
100
+ "useLoadOlderMessages": {
101
+ "kind": "mutation",
102
+ "operation": "messages",
103
+ "invalidates": [
104
+ [
105
+ "chat",
106
+ "thread",
107
+ "{conversationId}"
108
+ ]
109
+ ]
110
+ },
111
+ "useMarkRead": {
112
+ "kind": "mutation",
113
+ "operation": "markRead",
114
+ "invalidates": [
115
+ [
116
+ "chat",
117
+ "conversations"
118
+ ],
119
+ [
120
+ "chat",
121
+ "read-marker",
122
+ "{conversationId}"
123
+ ]
124
+ ]
125
+ },
126
+ "useSendMessage": {
127
+ "kind": "mutation",
128
+ "operation": "sendMessage",
129
+ "invalidates": [
130
+ [
131
+ "chat",
132
+ "conversations"
133
+ ]
134
+ ]
135
+ },
136
+ "useStartDirectChat": {
137
+ "kind": "mutation",
138
+ "operation": "createConversation",
139
+ "invalidates": [
140
+ [
141
+ "chat",
142
+ "conversation",
143
+ "{conversationId}"
144
+ ],
145
+ [
146
+ "chat",
147
+ "conversations"
148
+ ]
149
+ ]
150
+ },
151
+ "useThread": {
152
+ "kind": "query",
153
+ "operation": "messages"
154
+ }
155
+ },
156
+ "errors": {
157
+ "error.400.bad_request": {
158
+ "status": 400,
159
+ "params": [],
160
+ "remediation": "fix_input"
161
+ },
162
+ "error.400.captcha_invalid": {
163
+ "status": 400,
164
+ "params": [],
165
+ "remediation": "retry"
166
+ },
167
+ "error.400.captcha_required": {
168
+ "status": 400,
169
+ "params": [],
170
+ "remediation": "retry"
171
+ },
172
+ "error.400.chat_attachments_disabled": {
173
+ "status": 400,
174
+ "params": [],
175
+ "remediation": "fix_input"
176
+ },
177
+ "error.400.chat_body_too_long": {
178
+ "status": 400,
179
+ "params": [],
180
+ "remediation": "fix_input"
181
+ },
182
+ "error.400.chat_empty_message": {
183
+ "status": 400,
184
+ "params": [],
185
+ "remediation": "fix_input"
186
+ },
187
+ "error.400.chat_invalid_direct": {
188
+ "status": 400,
189
+ "params": [],
190
+ "remediation": "fix_input"
191
+ },
192
+ "error.400.chat_invalid_kind": {
193
+ "status": 400,
194
+ "params": [],
195
+ "remediation": "fix_input"
196
+ },
197
+ "error.400.chat_invalid_reply": {
198
+ "status": 400,
199
+ "params": [],
200
+ "remediation": "fix_input"
201
+ },
202
+ "error.400.chat_kind_disabled": {
203
+ "status": 400,
204
+ "params": [],
205
+ "remediation": "fix_input"
206
+ },
207
+ "error.400.chat_not_support": {
208
+ "status": 400,
209
+ "params": [],
210
+ "remediation": "fix_input"
211
+ },
212
+ "error.400.expected_list": {
213
+ "status": 400,
214
+ "params": [],
215
+ "remediation": "fix_input"
216
+ },
217
+ "error.400.field.blank": {
218
+ "status": 400,
219
+ "params": [
220
+ "field"
221
+ ],
222
+ "remediation": "fix_input"
223
+ },
224
+ "error.400.field.does_not_exist": {
225
+ "status": 400,
226
+ "params": [
227
+ "field"
228
+ ],
229
+ "remediation": "fix_input"
230
+ },
231
+ "error.400.field.invalid": {
232
+ "status": 400,
233
+ "params": [
234
+ "field"
235
+ ],
236
+ "remediation": "fix_input"
237
+ },
238
+ "error.400.field.invalid_choice": {
239
+ "status": 400,
240
+ "params": [
241
+ "field"
242
+ ],
243
+ "remediation": "fix_input"
244
+ },
245
+ "error.400.field.max_length": {
246
+ "status": 400,
247
+ "params": [
248
+ "field",
249
+ "max_length"
250
+ ],
251
+ "remediation": "fix_input"
252
+ },
253
+ "error.400.field.max_value": {
254
+ "status": 400,
255
+ "params": [
256
+ "field",
257
+ "max_value"
258
+ ],
259
+ "remediation": "fix_input"
260
+ },
261
+ "error.400.field.min_length": {
262
+ "status": 400,
263
+ "params": [
264
+ "field",
265
+ "min_length"
266
+ ],
267
+ "remediation": "fix_input"
268
+ },
269
+ "error.400.field.min_value": {
270
+ "status": 400,
271
+ "params": [
272
+ "field",
273
+ "min_value"
274
+ ],
275
+ "remediation": "fix_input"
276
+ },
277
+ "error.400.field.null": {
278
+ "status": 400,
279
+ "params": [
280
+ "field"
281
+ ],
282
+ "remediation": "fix_input"
283
+ },
284
+ "error.400.field.required": {
285
+ "status": 400,
286
+ "params": [
287
+ "field"
288
+ ],
289
+ "remediation": "fix_input"
290
+ },
291
+ "error.400.field.unique": {
292
+ "status": 400,
293
+ "params": [
294
+ "field"
295
+ ],
296
+ "remediation": "fix_input"
297
+ },
298
+ "error.400.invalid_ad_id": {
299
+ "status": 400,
300
+ "params": [],
301
+ "remediation": "fix_input"
302
+ },
303
+ "error.400.validation_error": {
304
+ "status": 400,
305
+ "params": [],
306
+ "remediation": "fix_input"
307
+ },
308
+ "error.400.verification_failed": {
309
+ "status": 400,
310
+ "params": [],
311
+ "remediation": "verify"
312
+ },
313
+ "error.400.verification_invalid_factor": {
314
+ "status": 400,
315
+ "params": [],
316
+ "remediation": "verify"
317
+ },
318
+ "error.401.unauthorized": {
319
+ "status": 401,
320
+ "params": [],
321
+ "remediation": "reauthenticate"
322
+ },
323
+ "error.402.payment_required": {
324
+ "status": 402,
325
+ "params": [],
326
+ "remediation": "retry"
327
+ },
328
+ "error.403.chat_not_operator": {
329
+ "status": 403,
330
+ "params": [],
331
+ "remediation": "retry"
332
+ },
333
+ "error.403.chat_not_participant": {
334
+ "status": 403,
335
+ "params": [],
336
+ "remediation": "retry"
337
+ },
338
+ "error.403.forbidden": {
339
+ "status": 403,
340
+ "params": [],
341
+ "remediation": "retry"
342
+ },
343
+ "error.403.network_blocked": {
344
+ "status": 403,
345
+ "params": [],
346
+ "remediation": "contact_support"
347
+ },
348
+ "error.403.verification_enrollment_required": {
349
+ "status": 403,
350
+ "params": [],
351
+ "remediation": "verify"
352
+ },
353
+ "error.403.verification_required": {
354
+ "status": 403,
355
+ "params": [],
356
+ "remediation": "verify"
357
+ },
358
+ "error.404.ad_not_found": {
359
+ "status": 404,
360
+ "params": [],
361
+ "remediation": "retry"
362
+ },
363
+ "error.404.chat_conversation_not_found": {
364
+ "status": 404,
365
+ "params": [],
366
+ "remediation": "retry"
367
+ },
368
+ "error.404.not_found": {
369
+ "status": 404,
370
+ "params": [],
371
+ "remediation": "retry"
372
+ },
373
+ "error.404.verification_challenge_not_found": {
374
+ "status": 404,
375
+ "params": [],
376
+ "remediation": "verify"
377
+ },
378
+ "error.405.method_not_allowed": {
379
+ "status": 405,
380
+ "params": [],
381
+ "remediation": "retry"
382
+ },
383
+ "error.406.not_acceptable": {
384
+ "status": 406,
385
+ "params": [],
386
+ "remediation": "retry"
387
+ },
388
+ "error.408.request_timeout": {
389
+ "status": 408,
390
+ "params": [],
391
+ "remediation": "retry"
392
+ },
393
+ "error.409.chat_already_assigned": {
394
+ "status": 409,
395
+ "params": [],
396
+ "remediation": "fix_input"
397
+ },
398
+ "error.409.conflict": {
399
+ "status": 409,
400
+ "params": [],
401
+ "remediation": "fix_input"
402
+ },
403
+ "error.410.gone": {
404
+ "status": 410,
405
+ "params": [],
406
+ "remediation": "retry"
407
+ },
408
+ "error.413.payload_too_large": {
409
+ "status": 413,
410
+ "params": [],
411
+ "remediation": "retry"
412
+ },
413
+ "error.415.unsupported_media_type": {
414
+ "status": 415,
415
+ "params": [],
416
+ "remediation": "retry"
417
+ },
418
+ "error.422.unprocessable_entity": {
419
+ "status": 422,
420
+ "params": [],
421
+ "remediation": "wait_and_retry"
422
+ },
423
+ "error.423.locked": {
424
+ "status": 423,
425
+ "params": [],
426
+ "remediation": "wait_and_retry"
427
+ },
428
+ "error.423.verification_locked": {
429
+ "status": 423,
430
+ "params": [],
431
+ "remediation": "wait_and_retry"
432
+ },
433
+ "error.429.rate_limit": {
434
+ "status": 429,
435
+ "params": [
436
+ "retry_after_minutes"
437
+ ],
438
+ "remediation": "wait_and_retry"
439
+ },
440
+ "error.429.too_many_requests": {
441
+ "status": 429,
442
+ "params": [],
443
+ "remediation": "wait_and_retry"
444
+ },
445
+ "error.500.internal": {
446
+ "status": 500,
447
+ "params": [],
448
+ "remediation": "contact_support"
449
+ },
450
+ "error.503.mandate_unavailable": {
451
+ "status": 503,
452
+ "params": [],
453
+ "remediation": "retry"
454
+ }
455
+ },
456
+ "events": {
457
+ "defined": [],
458
+ "flows": []
459
+ },
460
+ "demos": [
461
+ {
462
+ "id": "chat.conversations",
463
+ "title": "Conversation list",
464
+ "description": "The headless ConversationList renders the caller's threads with server-computed unread counts, behind a LoadState a skin cannot flatten. Covers the provider that wires the runtime.",
465
+ "component": "ConversationList",
466
+ "covers": [
467
+ "ChatProvider"
468
+ ],
469
+ "tokens": [
470
+ "card-bg",
471
+ "card-border"
472
+ ],
473
+ "variants": [
474
+ "default"
475
+ ],
476
+ "source": "demo/ConversationList.demo.tsx"
477
+ },
478
+ {
479
+ "id": "chat.start",
480
+ "title": "Message the seller",
481
+ "description": "The headless StartDirectChat opens the direct thread with a person — get-or-create, keyed by the participant pair, so pressing twice cannot fan out into two threads. Blocked states carry a readable reason instead of a grey button.",
482
+ "component": "StartDirectChat",
483
+ "tokens": [
484
+ "card-bg",
485
+ "card-border"
486
+ ],
487
+ "variants": [
488
+ "default",
489
+ "no-seller",
490
+ "own-listing"
491
+ ],
492
+ "source": "demo/StartDirectChat.demo.tsx"
493
+ },
494
+ {
495
+ "id": "chat.thread",
496
+ "title": "Conversation thread",
497
+ "description": "The headless ConversationThread renders a contiguous, seq-ordered window over the message journal, and MessageComposer appends to it over REST with a stated reason whenever sending is blocked.",
498
+ "component": "ConversationThread",
499
+ "covers": [
500
+ "MessageComposer"
501
+ ],
502
+ "tokens": [
503
+ "card-bg",
504
+ "card-border"
505
+ ],
506
+ "variants": [
507
+ "default"
508
+ ],
509
+ "source": "demo/ConversationThread.demo.tsx"
510
+ }
511
+ ],
512
+ "i18nKeys": [
513
+ "chat.composer.blocked.empty",
514
+ "chat.composer.blocked.too_long",
515
+ "chat.composer.placeholder",
516
+ "chat.composer.send",
517
+ "chat.composer.sending",
518
+ "chat.error.unknown",
519
+ "chat.kind.direct",
520
+ "chat.kind.group",
521
+ "chat.kind.support",
522
+ "chat.list.empty",
523
+ "chat.list.end",
524
+ "chat.list.load_more",
525
+ "chat.list.loading",
526
+ "chat.list.open",
527
+ "chat.list.retry",
528
+ "chat.list.title",
529
+ "chat.list.unread",
530
+ "chat.nav.conversations",
531
+ "chat.start.blocked.self",
532
+ "chat.start.blocked.unknown_seller",
533
+ "chat.start.button",
534
+ "chat.start.starting",
535
+ "chat.thread.beginning",
536
+ "chat.thread.empty",
537
+ "chat.thread.load_older",
538
+ "chat.thread.loading",
539
+ "chat.thread.retry",
540
+ "chat.thread.system",
541
+ "chat.transport.idle",
542
+ "chat.transport.live",
543
+ "chat.transport.polling",
544
+ "error.400.bad_request",
545
+ "error.400.captcha_invalid",
546
+ "error.400.captcha_required",
547
+ "error.400.chat_attachments_disabled",
548
+ "error.400.chat_body_too_long",
549
+ "error.400.chat_empty_message",
550
+ "error.400.chat_invalid_direct",
551
+ "error.400.chat_invalid_kind",
552
+ "error.400.chat_invalid_reply",
553
+ "error.400.chat_kind_disabled",
554
+ "error.400.chat_not_support",
555
+ "error.400.expected_list",
556
+ "error.400.field.blank",
557
+ "error.400.field.does_not_exist",
558
+ "error.400.field.invalid",
559
+ "error.400.field.invalid_choice",
560
+ "error.400.field.max_length",
561
+ "error.400.field.max_value",
562
+ "error.400.field.min_length",
563
+ "error.400.field.min_value",
564
+ "error.400.field.null",
565
+ "error.400.field.required",
566
+ "error.400.field.unique",
567
+ "error.400.invalid_ad_id",
568
+ "error.400.validation_error",
569
+ "error.400.verification_failed",
570
+ "error.400.verification_invalid_factor",
571
+ "error.401.unauthorized",
572
+ "error.402.payment_required",
573
+ "error.403.chat_not_operator",
574
+ "error.403.chat_not_participant",
575
+ "error.403.forbidden",
576
+ "error.403.network_blocked",
577
+ "error.403.verification_enrollment_required",
578
+ "error.403.verification_required",
579
+ "error.404.ad_not_found",
580
+ "error.404.chat_conversation_not_found",
581
+ "error.404.not_found",
582
+ "error.404.verification_challenge_not_found",
583
+ "error.405.method_not_allowed",
584
+ "error.406.not_acceptable",
585
+ "error.408.request_timeout",
586
+ "error.409.chat_already_assigned",
587
+ "error.409.conflict",
588
+ "error.410.gone",
589
+ "error.413.payload_too_large",
590
+ "error.415.unsupported_media_type",
591
+ "error.422.unprocessable_entity",
592
+ "error.423.locked",
593
+ "error.423.verification_locked",
594
+ "error.429.rate_limit",
595
+ "error.429.too_many_requests",
596
+ "error.500.internal",
597
+ "error.503.mandate_unavailable"
598
+ ],
599
+ "exports": {
600
+ "runtime": [
601
+ "CHAT_DEFAULT_MAX_BODY_LENGTH",
602
+ "CHAT_ERRORS",
603
+ "CHAT_ERROR_CODES",
604
+ "CHAT_FLOWS",
605
+ "CHAT_I18N_KEYS",
606
+ "CHAT_WS_CLOSE_NOT_PARTICIPANT",
607
+ "CHAT_WS_CLOSE_UNAUTHENTICATED",
608
+ "CHAT_WS_REPLAY_LIMIT",
609
+ "CHAT_WS_RESYNC",
610
+ "CONVERSATION_LIST_INTERVAL_MS",
611
+ "ChatProvider",
612
+ "ChatRuntimeContext",
613
+ "ConversationList",
614
+ "ConversationThread",
615
+ "EMPTY_THREAD_WINDOW",
616
+ "MessageComposer",
617
+ "StartDirectChat",
618
+ "THREAD_INTERVAL_MS",
619
+ "THREAD_PAGE",
620
+ "browserWebSocketFactory",
621
+ "canOpenWebSocket",
622
+ "chatConversationStream",
623
+ "chatErrorBundleEn",
624
+ "chatI18nBundleEn",
625
+ "chatInboxStream",
626
+ "chatQueryKeys",
627
+ "chatSocketUrl",
628
+ "chatStreamId",
629
+ "createChatApi",
630
+ "createChatRuntime",
631
+ "createChatSocket",
632
+ "createFlowMachine",
633
+ "decodeServerFrame",
634
+ "deriveChatSocketBase",
635
+ "explainChatError",
636
+ "flowEndpoints",
637
+ "isErrorCode",
638
+ "mergeMessage",
639
+ "mergeNewerPage",
640
+ "mergeOlderPage",
641
+ "navEntries",
642
+ "nextReadMarker",
643
+ "parseServerFrame",
644
+ "registerChatI18n",
645
+ "threadFirstSeq",
646
+ "threadLastSeq",
647
+ "threadWindowFromPage",
648
+ "toFlowError",
649
+ "useChatAnalytics",
650
+ "useChatApi",
651
+ "useChatFreshness",
652
+ "useChatRuntime",
653
+ "useConversation",
654
+ "useConversations",
655
+ "useFlow",
656
+ "useLoadOlderMessages",
657
+ "useMarkRead",
658
+ "useSendMessage",
659
+ "useStartDirectChat",
660
+ "useThread"
661
+ ],
662
+ "types": [
663
+ "AnchorDirection",
664
+ "ChatAckFrame",
665
+ "ChatApi",
666
+ "ChatClientFrame",
667
+ "ChatConnectionState",
668
+ "ChatConversationStream",
669
+ "ChatErrorCode",
670
+ "ChatErrorFrame",
671
+ "ChatErrorSpec",
672
+ "ChatFlowId",
673
+ "ChatFlowSpec",
674
+ "ChatFreshness",
675
+ "ChatFreshnessOptions",
676
+ "ChatHelloFrame",
677
+ "ChatI18nKey",
678
+ "ChatInboxStream",
679
+ "ChatMessage",
680
+ "ChatMessageFrame",
681
+ "ChatPingFrame",
682
+ "ChatPongFrame",
683
+ "ChatRealtimeConfig",
684
+ "ChatRealtimeOptions",
685
+ "ChatReconnectOptions",
686
+ "ChatReplayDoneFrame",
687
+ "ChatRuntime",
688
+ "ChatSendFrame",
689
+ "ChatServerFrame",
690
+ "ChatSignal",
691
+ "ChatSignalKeyMap",
692
+ "ChatSocket",
693
+ "ChatSocketConnection",
694
+ "ChatSocketHandlers",
695
+ "ChatSocketOptions",
696
+ "ChatSocketRefusal",
697
+ "ChatSocketStatus",
698
+ "ChatStreamKey",
699
+ "ChatThreadWindow",
700
+ "ChatTransport",
701
+ "ChatWebSocketFactory",
702
+ "ChatWelcomeFrame",
703
+ "Conversation",
704
+ "ConversationKind",
705
+ "ConversationListBag",
706
+ "ConversationListParams",
707
+ "ConversationPage",
708
+ "ConversationThreadBag",
709
+ "CreateChatRuntimeOptions",
710
+ "CreateConversationRequest",
711
+ "FlowEndpoint",
712
+ "FlowError",
713
+ "FlowMachine",
714
+ "FlowMachineOptions",
715
+ "FlowStateBase",
716
+ "MarkReadRequest",
717
+ "MessageComposerBag",
718
+ "MessageHistoryParams",
719
+ "MessageKind",
720
+ "MessagePage",
721
+ "Participant",
722
+ "ParticipantRole",
723
+ "Remediation",
724
+ "Schemas",
725
+ "SendMessageRequest",
726
+ "SendMessageVariables",
727
+ "StartDirectChatBag",
728
+ "StartDirectChatVariables",
729
+ "SupportStatus",
730
+ "ThreadMergeResult"
731
+ ]
732
+ }
733
+ }