@agents24/chat-react 0.3.2 → 0.4.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 (58) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +21 -66
  3. package/compatibility.json +54 -0
  4. package/dist/active-content.d.ts +10 -0
  5. package/dist/{chunk-EWZO4QJI.js → chunk-CHAU7FNW.js} +3 -3
  6. package/dist/chunk-CHAU7FNW.js.map +1 -0
  7. package/dist/{chunk-FFO6KEB4.js → chunk-LI67M74F.js} +98 -12
  8. package/dist/chunk-LI67M74F.js.map +1 -0
  9. package/dist/chunk-NLEOWTZG.js +1327 -0
  10. package/dist/chunk-NLEOWTZG.js.map +1 -0
  11. package/dist/index.cjs +66 -1852
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.ts +0 -6
  14. package/dist/index.js +6 -1841
  15. package/dist/index.js.map +1 -1
  16. package/dist/latest-thread-scroller.d.ts +7 -7
  17. package/dist/mcp-oauth.d.ts +3 -1
  18. package/dist/renderers.d.ts +3 -3
  19. package/dist/styles.css +407 -0
  20. package/dist/templates/agent-chat-app.d.ts +18 -0
  21. package/dist/templates/agent-chat-layout.d.ts +69 -0
  22. package/dist/templates/agent-chat-shell.d.ts +1 -1
  23. package/dist/templates/index.cjs +1904 -18
  24. package/dist/templates/index.cjs.map +1 -1
  25. package/dist/templates/index.d.ts +2 -0
  26. package/dist/templates/index.js +529 -11
  27. package/dist/templates/index.js.map +1 -1
  28. package/dist/types.d.ts +12 -380
  29. package/dist/ui/agent-chat-actions.d.ts +1 -2
  30. package/dist/ui/agent-chat-composer.d.ts +2 -1
  31. package/dist/ui/agent-chat-message.d.ts +3 -3
  32. package/dist/ui/agent-response-timeline.d.ts +2 -2
  33. package/dist/ui/attachment.d.ts +9 -9
  34. package/dist/ui/bubble.d.ts +4 -4
  35. package/dist/ui/index.cjs +137 -43
  36. package/dist/ui/index.cjs.map +1 -1
  37. package/dist/ui/index.js +62 -1220
  38. package/dist/ui/index.js.map +1 -1
  39. package/dist/ui/marker.d.ts +3 -3
  40. package/dist/ui/mcp-connect-required-card.d.ts +1 -1
  41. package/dist/ui/message-response.d.ts +1 -1
  42. package/dist/ui/message.d.ts +6 -6
  43. package/package.json +27 -8
  44. package/dist/chunk-EWZO4QJI.js.map +0 -1
  45. package/dist/chunk-FFO6KEB4.js.map +0 -1
  46. package/dist/chunk-UU7OXHL3.js +0 -11
  47. package/dist/chunk-UU7OXHL3.js.map +0 -1
  48. package/dist/context-window.d.ts +0 -38
  49. package/dist/controller-actions.d.ts +0 -45
  50. package/dist/controller-helpers.d.ts +0 -27
  51. package/dist/controller-hitl.d.ts +0 -22
  52. package/dist/controller-options.d.ts +0 -15
  53. package/dist/controller-thread-events.d.ts +0 -7
  54. package/dist/controller.d.ts +0 -5
  55. package/dist/message-lifecycle.d.ts +0 -15
  56. package/dist/model.d.ts +0 -30
  57. package/dist/sse.d.ts +0 -5
  58. package/dist/transport.d.ts +0 -43
@@ -0,0 +1,407 @@
1
+ :root {
2
+ --a24-background: #ffffff;
3
+ --a24-surface: #f7f7f8;
4
+ --a24-surface-hover: #efeff1;
5
+ --a24-text: #18181b;
6
+ --a24-muted: #71717a;
7
+ --a24-border: rgba(24, 24, 27, 0.12);
8
+ --a24-accent: #18181b;
9
+ --a24-accent-text: #ffffff;
10
+ --a24-danger: #b42318;
11
+ --a24-focus: #71717a;
12
+ color-scheme: light;
13
+ }
14
+
15
+ @media (prefers-color-scheme: dark) {
16
+ :root {
17
+ --a24-background: #111113;
18
+ --a24-surface: #19191c;
19
+ --a24-surface-hover: #232328;
20
+ --a24-text: #f4f4f5;
21
+ --a24-muted: #a1a1aa;
22
+ --a24-border: rgba(244, 244, 245, 0.14);
23
+ --a24-accent: #f4f4f5;
24
+ --a24-accent-text: #18181b;
25
+ --a24-focus: #a1a1aa;
26
+ color-scheme: dark;
27
+ }
28
+ }
29
+
30
+ [data-agents24-chat-layout] *,
31
+ [data-agents24-chat-layout] *::before,
32
+ [data-agents24-chat-layout] *::after { box-sizing: border-box; }
33
+
34
+ .a24-chat {
35
+ background: var(--a24-background);
36
+ color: var(--a24-text);
37
+ display: grid;
38
+ font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
39
+ grid-template-columns: minmax(15rem, 17rem) minmax(0, 1fr);
40
+ height: 100%;
41
+ min-height: 32rem;
42
+ overflow: hidden;
43
+ position: relative;
44
+ width: 100%;
45
+ }
46
+
47
+ .a24-sr-only {
48
+ clip: rect(0, 0, 0, 0);
49
+ clip-path: inset(50%);
50
+ height: 1px;
51
+ overflow: hidden;
52
+ position: absolute;
53
+ white-space: nowrap;
54
+ width: 1px;
55
+ }
56
+
57
+ .a24-skip-link {
58
+ background: var(--a24-accent);
59
+ border-radius: .5rem;
60
+ color: var(--a24-accent-text);
61
+ left: .75rem;
62
+ padding: .6rem .8rem;
63
+ position: absolute;
64
+ top: .75rem;
65
+ transform: translateY(-200%);
66
+ z-index: 80;
67
+ }
68
+ .a24-skip-link:focus { transform: translateY(0); }
69
+
70
+ .a24-button,
71
+ .a24-icon-button,
72
+ .a24-thread__open {
73
+ appearance: none;
74
+ border: 0;
75
+ cursor: pointer;
76
+ font: inherit;
77
+ }
78
+ .a24-chat button { touch-action: manipulation; }
79
+ .a24-button:focus-visible,
80
+ .a24-icon-button:focus-visible,
81
+ .a24-thread__open:focus-visible,
82
+ .a24-chat button:focus-visible,
83
+ .a24-chat input:focus-visible,
84
+ .a24-chat select:focus-visible,
85
+ .a24-chat textarea:focus-visible {
86
+ outline: 2px solid var(--a24-focus);
87
+ outline-offset: 2px;
88
+ }
89
+ .a24-button:disabled,
90
+ .a24-icon-button:disabled { cursor: not-allowed; opacity: .5; }
91
+ .a24-button {
92
+ align-items: center;
93
+ border-radius: .5rem;
94
+ display: inline-flex;
95
+ font-size: .875rem;
96
+ font-weight: 600;
97
+ gap: .5rem;
98
+ justify-content: center;
99
+ min-height: 2.5rem;
100
+ padding: .55rem .8rem;
101
+ }
102
+ .a24-button svg,
103
+ .a24-icon-button svg { height: 1rem; width: 1rem; }
104
+ .a24-button--primary { background: var(--a24-accent); color: var(--a24-accent-text); }
105
+ .a24-button--quiet { background: transparent; color: var(--a24-muted); }
106
+ .a24-button--quiet:hover { background: var(--a24-surface-hover); color: var(--a24-text); }
107
+ .a24-icon-button {
108
+ align-items: center;
109
+ background: transparent;
110
+ border-radius: .5rem;
111
+ color: var(--a24-muted);
112
+ display: inline-flex;
113
+ height: 2.25rem;
114
+ justify-content: center;
115
+ width: 2.25rem;
116
+ }
117
+ .a24-icon-button:hover { background: var(--a24-surface-hover); color: var(--a24-text); }
118
+
119
+ .a24-sidebar {
120
+ background: var(--a24-surface);
121
+ border-inline-end: 1px solid var(--a24-border);
122
+ min-height: 0;
123
+ position: relative;
124
+ z-index: 40;
125
+ }
126
+ .a24-sidebar__inner {
127
+ display: flex;
128
+ flex-direction: column;
129
+ height: 100%;
130
+ min-height: 0;
131
+ padding: max(.75rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) max(.75rem, env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left));
132
+ }
133
+ .a24-sidebar__top { align-items: center; display: flex; gap: .5rem; }
134
+ .a24-sidebar__new { flex: 1; }
135
+ .a24-sidebar__mobile-close { display: none; }
136
+ .a24-search {
137
+ align-items: center;
138
+ background: var(--a24-background);
139
+ border: 1px solid var(--a24-border);
140
+ border-radius: .5rem;
141
+ color: var(--a24-muted);
142
+ display: flex;
143
+ gap: .5rem;
144
+ margin: .75rem 0;
145
+ min-height: 2.25rem;
146
+ padding: 0 .65rem;
147
+ }
148
+ .a24-search svg { height: .95rem; width: .95rem; }
149
+ .a24-search input { background: transparent; border: 0; color: var(--a24-text); min-width: 0; outline: none; width: 100%; }
150
+ .a24-thread-list { display: flex; flex: 1; flex-direction: column; gap: .25rem; min-height: 0; overflow-y: auto; }
151
+ .a24-thread { align-items: center; border-radius: .5rem; display: flex; min-width: 0; position: relative; }
152
+ .a24-thread:hover,
153
+ .a24-thread[data-selected] { background: var(--a24-background); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
154
+ .a24-thread__open { background: transparent; color: var(--a24-text); min-width: 0; padding: .6rem .5rem; text-align: start; width: 100%; }
155
+ .a24-thread__title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
156
+ .a24-thread__status { color: var(--a24-muted); display: block; font-size: .75rem; margin-top: .15rem; }
157
+ .a24-thread__delete { flex: 0 0 auto; height: 2rem; opacity: 0; width: 2rem; }
158
+ .a24-thread:hover .a24-thread__delete,
159
+ .a24-thread:focus-within .a24-thread__delete { opacity: 1; }
160
+ .a24-sidebar__hint { color: var(--a24-muted); font-size: .875rem; margin: .75rem .5rem; }
161
+ .a24-sidebar__more { margin-top: .5rem; width: 100%; }
162
+
163
+ .a24-chat__body { display: flex; min-height: 0; min-width: 0; flex-direction: column; }
164
+ .a24-header {
165
+ align-items: center;
166
+ border-bottom: 1px solid var(--a24-border);
167
+ display: flex;
168
+ flex: 0 0 auto;
169
+ gap: .65rem;
170
+ min-height: 4rem;
171
+ padding: max(.55rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) .55rem max(1rem, env(safe-area-inset-left));
172
+ }
173
+ .a24-header__menu { display: none; }
174
+ .a24-avatar { border-radius: .6rem; height: 2.25rem; object-fit: cover; width: 2.25rem; }
175
+ .a24-avatar--fallback { align-items: center; background: var(--a24-accent); color: var(--a24-accent-text); display: inline-flex; font-weight: 700; justify-content: center; }
176
+ .a24-header__identity { min-width: 0; }
177
+ .a24-header h1 { font-size: .95rem; line-height: 1.25rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
178
+ .a24-connection { align-items: center; color: var(--a24-muted); display: flex; font-size: .72rem; gap: .25rem; }
179
+ .a24-connection svg { height: .75rem; width: .75rem; }
180
+ .a24-connection[data-state="connected"] { color: #17803d; }
181
+ .a24-connection[data-state="offline"],
182
+ .a24-connection[data-state="expired"] { color: var(--a24-danger); }
183
+ .a24-header__actions { align-items: center; display: flex; gap: .4rem; margin-inline-start: auto; }
184
+
185
+ .a24-main { flex: 1; min-height: 0; overflow: hidden; position: relative; }
186
+ .a24-state { align-items: center; display: flex; flex-direction: column; height: 100%; justify-content: center; margin: auto; max-width: 28rem; padding: 2rem; text-align: center; }
187
+ .a24-state__icon { align-items: center; background: var(--a24-surface); border-radius: .75rem; color: var(--a24-muted); display: flex; height: 3rem; justify-content: center; width: 3rem; }
188
+ .a24-state__icon svg { height: 1.25rem; width: 1.25rem; }
189
+ .a24-state h2 { font-size: 1.1rem; margin: 1rem 0 .25rem; }
190
+ .a24-state p { color: var(--a24-muted); font-size: .9rem; line-height: 1.5; margin: 0 0 1rem; }
191
+
192
+ /* Shell and transcript primitives are deliberately self-contained. Customer
193
+ apps must not need Tailwind or source scanning to render the default UI. */
194
+ .a24-shell {
195
+ display: flex;
196
+ flex: 1;
197
+ flex-direction: column;
198
+ height: 100%;
199
+ min-height: 0;
200
+ min-width: 0;
201
+ position: relative;
202
+ width: 100%;
203
+ }
204
+ .a24-shell--empty { overflow: visible; padding: 0 1rem; }
205
+ .a24-shell__empty { display: flex; flex: 1; flex-direction: column; height: 100%; justify-content: center; position: relative; z-index: 10; }
206
+ .a24-shell__empty-content { align-items: center; display: flex; flex-direction: column; padding: 2rem 0 7rem; text-align: center; width: 100%; }
207
+ .a24-shell__empty-title { font-size: clamp(1.6rem, 4vw, 2rem); font-weight: 650; letter-spacing: -.025em; margin: 0; padding: 0 0 1.5rem; }
208
+ .a24-shell__empty-composer,
209
+ .a24-shell__composer-inner { margin: 0 auto; max-width: 48rem; padding: 0 1rem; width: 100%; }
210
+ .a24-shell__content { display: flex; flex-direction: column; gap: 2rem; margin: 0 auto; max-width: 48rem; min-height: 100%; padding: 3rem 1rem 8rem; width: 100%; }
211
+ .a24-shell__composer-overlay {
212
+ background: linear-gradient(to bottom, transparent 0%, color-mix(in srgb, var(--a24-background) 85%, transparent) 42%, var(--a24-background) 68%);
213
+ bottom: 0;
214
+ left: 0;
215
+ overflow: visible;
216
+ padding: 2.5rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
217
+ pointer-events: none;
218
+ position: absolute;
219
+ right: 0;
220
+ z-index: 20;
221
+ }
222
+ .a24-shell__scroll-button { display: flex; justify-content: center; left: 0; padding-bottom: .75rem; pointer-events: auto; position: absolute; right: 0; top: 0; transform: translateY(-100%); }
223
+ .a24-shell__composer-inner { pointer-events: auto; }
224
+
225
+ .a24-scroller { display: flex; flex: 1; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; position: relative; width: 100%; }
226
+ .a24-scroller__viewport { flex: 1; height: 100%; min-height: 0; min-width: 0; overscroll-behavior: contain; overflow-y: auto; scrollbar-gutter: stable; width: 100%; }
227
+ .a24-scroller__content { display: flex; flex-direction: column; gap: 2rem; min-height: 100%; }
228
+ .a24-scroller__item { flex: 0 0 auto; min-width: 0; overflow: visible; }
229
+ .a24-scroller__button {
230
+ align-items: center;
231
+ appearance: none;
232
+ background: var(--a24-background);
233
+ border: 1px solid var(--a24-border);
234
+ border-radius: 999px;
235
+ bottom: 1rem;
236
+ box-shadow: 0 6px 18px rgba(0,0,0,.12);
237
+ color: var(--a24-text);
238
+ display: flex;
239
+ font: inherit;
240
+ height: 2.25rem;
241
+ justify-content: center;
242
+ left: 50%;
243
+ position: absolute;
244
+ transform: translateX(-50%);
245
+ transition: opacity 160ms ease, transform 160ms ease;
246
+ width: 2.25rem;
247
+ z-index: 50;
248
+ }
249
+ .a24-scroller__button[data-active="false"] { opacity: 0; pointer-events: none; transform: translate(-50%, .5rem); }
250
+ .a24-scroller__button[data-active="true"] { opacity: 1; }
251
+
252
+ .a24-outline { display: none; pointer-events: none; position: absolute; top: 46%; transform: translateY(-50%); width: 4rem; z-index: 10; }
253
+ .a24-outline__rail { display: flex; flex-direction: column; pointer-events: auto; }
254
+ .a24-outline__button { align-items: center; appearance: none; background: transparent; border: 0; display: flex; height: .55rem; padding: 0; position: relative; width: 4rem; }
255
+ .a24-outline__bar { background: var(--a24-muted); border-radius: 999px; display: block; height: 2px; }
256
+ .a24-outline__preview { background: var(--a24-background); border: 1px solid var(--a24-border); border-radius: .75rem; box-shadow: 0 8px 28px rgba(0,0,0,.14); color: var(--a24-text); opacity: 0; padding: .75rem; position: absolute; text-align: start; width: 16rem; }
257
+ .a24-outline[data-side="left"] { left: .25rem; }
258
+ .a24-outline[data-side="right"] { right: .25rem; }
259
+ .a24-outline[data-side="left"] .a24-outline__button { justify-content: flex-start; }
260
+ .a24-outline[data-side="right"] .a24-outline__button { justify-content: flex-end; }
261
+ .a24-outline[data-side="left"] .a24-outline__preview { left: 100%; margin-left: .5rem; }
262
+ .a24-outline[data-side="right"] .a24-outline__preview { margin-right: .5rem; right: 100%; }
263
+ .a24-outline__button:hover .a24-outline__preview,
264
+ .a24-outline__button:focus-visible .a24-outline__preview { opacity: 1; }
265
+
266
+ .a24-composer { margin: 0 auto; max-width: 48rem; overflow: visible; position: relative; width: 100%; }
267
+ .a24-composer__surface {
268
+ background: var(--a24-background);
269
+ border: 1px solid var(--a24-border);
270
+ border-radius: 999px;
271
+ box-shadow: 0 6px 24px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.08);
272
+ padding: .3rem .45rem;
273
+ position: relative;
274
+ transition: border-color 160ms ease, box-shadow 160ms ease;
275
+ width: 100%;
276
+ }
277
+ .a24-composer__surface:focus-within { border-color: color-mix(in srgb, var(--a24-text) 28%, transparent); box-shadow: 0 8px 30px rgba(0,0,0,.1), 0 0 0 3px color-mix(in srgb, var(--a24-focus) 12%, transparent); }
278
+ .a24-composer__surface[data-expanded] { border-radius: 1.1rem; padding: .5rem; }
279
+ .a24-composer__grid { align-items: center; display: grid; width: 100%; }
280
+ .a24-composer__attach-slot,
281
+ .a24-composer__submit-slot { align-items: center; display: flex; justify-content: center; }
282
+ .a24-composer__textarea-slot { min-width: 0; width: 100%; }
283
+ .a24-composer__textarea {
284
+ appearance: none;
285
+ background: transparent;
286
+ border: 0;
287
+ color: var(--a24-text);
288
+ display: block;
289
+ font: inherit;
290
+ font-size: .94rem;
291
+ line-height: 1.45;
292
+ margin: 0;
293
+ min-height: 2.25rem;
294
+ outline: 0;
295
+ padding: .48rem .25rem;
296
+ resize: none;
297
+ width: 100%;
298
+ }
299
+ .a24-composer__textarea::placeholder { color: var(--a24-muted); opacity: .78; }
300
+ .a24-composer__attach,
301
+ .a24-composer__submit,
302
+ .a24-composer__attachment-remove {
303
+ align-items: center;
304
+ appearance: none;
305
+ border: 0;
306
+ border-radius: 999px;
307
+ cursor: pointer;
308
+ display: inline-flex;
309
+ flex: 0 0 auto;
310
+ font: inherit;
311
+ justify-content: center;
312
+ }
313
+ .a24-composer__attach { background: var(--a24-surface); color: var(--a24-muted); height: 2rem; width: 2rem; }
314
+ .a24-composer__attach:hover { background: var(--a24-surface-hover); color: var(--a24-text); }
315
+ .a24-composer__submit { background: var(--a24-accent); color: var(--a24-accent-text); height: 2.25rem; transition: opacity 160ms ease, transform 160ms ease; width: 2.25rem; }
316
+ .a24-composer__submit:not(:disabled):hover { transform: scale(1.04); }
317
+ .a24-composer__attach:disabled,
318
+ .a24-composer__submit:disabled { cursor: not-allowed; opacity: .42; }
319
+ .a24-composer__attach svg,
320
+ .a24-composer__submit svg { height: 1rem; width: 1rem; }
321
+ .a24-composer__attachments { display: flex; gap: .5rem; min-width: 0; padding: .25rem; }
322
+ .a24-composer__attachments[data-layout="overlay"] { bottom: 100%; left: 0; margin-bottom: .4rem; overflow-x: auto; position: absolute; right: 0; }
323
+ .a24-composer__attachment { align-items: center; background: var(--a24-background); border: 1px solid var(--a24-border); border-radius: .55rem; color: var(--a24-text); display: flex; font-size: .82rem; gap: .4rem; max-width: min(20rem, calc(100vw - 2rem)); min-height: 2rem; padding: .25rem .4rem; }
324
+ .a24-composer__attachment-remove { background: transparent; color: var(--a24-muted); height: 1.25rem; width: 1.25rem; }
325
+ .a24-composer__toolbar { align-items: center; display: flex; gap: .4rem; min-width: 0; }
326
+ .a24-composer__toolbar--external { margin-top: .5rem; padding: 0 .25rem; }
327
+
328
+ .a24-hitl { background: transparent; border: 0; display: flex; flex-direction: column; gap: .55rem; padding: .25rem 0; }
329
+ .a24-hitl--resolved { color: var(--a24-muted); font-size: .85rem; }
330
+ .a24-hitl__title { color: var(--a24-text); font-size: .9rem; font-weight: 650; line-height: 1.45; }
331
+ .a24-hitl__comment { background: var(--a24-background); border: 1px solid var(--a24-border); border-radius: .55rem; color: var(--a24-text); font: inherit; min-height: 5rem; padding: .65rem .75rem; resize: vertical; width: 100%; }
332
+ .a24-hitl__error { color: var(--a24-danger); font-size: .85rem; }
333
+ .a24-hitl__actions { align-items: center; display: flex; flex-wrap: wrap; gap: .45rem; }
334
+ .a24-hitl__action { appearance: none; background: transparent; border: 1px solid var(--a24-border); border-radius: .5rem; color: var(--a24-text); cursor: pointer; font: inherit; font-size: .82rem; font-weight: 600; min-height: 2.25rem; padding: .4rem .7rem; }
335
+ .a24-hitl__action[data-primary] { background: var(--a24-accent); border-color: var(--a24-accent); color: var(--a24-accent-text); }
336
+ .a24-hitl__action:disabled { cursor: not-allowed; opacity: .55; }
337
+
338
+ .a24-chat [data-slot="message"] { display: flex; font-size: .9rem; gap: .5rem; max-width: 80%; min-width: 0; width: 100%; }
339
+ .a24-chat [data-slot="message"].is-user { justify-content: flex-end; margin-inline-start: auto; }
340
+ .a24-chat [data-slot="message"].is-assistant { max-width: 100%; }
341
+ .a24-chat :is([data-slot="message-content"], [data-slot="bubble-content"]) { display: flex; flex-direction: column; gap: .5rem; line-height: 1.55; max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
342
+ .a24-chat :is([data-slot="message-content"], [data-slot="bubble-content"]) > :first-child { margin-top: 0; }
343
+ .a24-chat :is([data-slot="message-content"], [data-slot="bubble-content"]) > :last-child { margin-bottom: 0; }
344
+ .a24-chat .is-user > :is([data-slot="message-content"], [data-slot="bubble-content"]) { background: var(--a24-surface); border-radius: .65rem; padding: .7rem 1rem; }
345
+ .a24-chat [data-slot="message-actions"] { align-items: center; display: flex; gap: .2rem; }
346
+ .a24-chat [data-slot="attachment-group"] { display: flex; flex-wrap: wrap; gap: .5rem; }
347
+ .a24-chat [data-slot="attachment"] { align-items: center; border: 1px solid var(--a24-border); border-radius: .6rem; display: flex; gap: .5rem; max-width: 100%; min-width: 10rem; padding: .45rem; }
348
+ .a24-chat [data-slot="attachment-media"] { align-items: center; background: var(--a24-surface); border-radius: .4rem; display: flex; height: 2.25rem; justify-content: center; overflow: hidden; width: 2.25rem; }
349
+ .a24-chat [data-slot="attachment-content"] { min-width: 0; }
350
+ .a24-chat [data-slot="attachment-title"],
351
+ .a24-chat [data-slot="attachment-description"] { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
352
+ .a24-chat [data-slot="attachment-description"] { color: var(--a24-muted); font-size: .72rem; }
353
+
354
+ .a24-chat textarea { color: var(--a24-text); font: inherit; }
355
+ .a24-chat input[type="file"].hidden { display: none; }
356
+ .a24-chat button { font-family: inherit; }
357
+ .a24-model-select { align-items: center; color: var(--a24-muted); display: inline-flex; font-size: .8rem; gap: .2rem; position: relative; }
358
+ .a24-model-select select { appearance: none; background: transparent; border: 0; color: inherit; cursor: pointer; font: inherit; padding: .25rem 1.2rem .25rem .25rem; }
359
+ .a24-model-select svg { pointer-events: none; position: absolute; right: .1rem; width: .8rem; }
360
+ .a24-source-link,
361
+ .a24-citation { color: #075f9a; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .18em; }
362
+ .a24-output-attachment { background: var(--a24-surface); border: 1px solid var(--a24-border); border-radius: .5rem; display: inline-flex; font-size: .8rem; padding: .45rem .65rem; }
363
+ .a24-ui-blocks { border: 1px solid var(--a24-border); border-radius: .65rem; padding: .75rem; }
364
+ .a24-ui-blocks h3,
365
+ .a24-ui-blocks h4,
366
+ .a24-ui-blocks p { margin: 0; }
367
+ .a24-ui-blocks h3 { font-size: .9rem; margin-bottom: .65rem; }
368
+ .a24-ui-blocks__row { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
369
+ .a24-ui-block { background: var(--a24-surface); border-radius: .5rem; min-width: 0; padding: .65rem; }
370
+ .a24-ui-block h4 { color: var(--a24-muted); font-size: .72rem; font-weight: 600; }
371
+ .a24-ui-block p { font-size: 1rem; font-weight: 600; margin-top: .25rem; overflow-wrap: anywhere; }
372
+ .a24-ui-table-scroll { max-width: 100%; overflow-x: auto; }
373
+ .a24-ui-block table { border-collapse: collapse; font-size: .75rem; width: 100%; }
374
+ .a24-ui-block th,
375
+ .a24-ui-block td { border-bottom: 1px solid var(--a24-border); padding: .35rem; text-align: start; }
376
+ .a24-sidebar-backdrop { display: none; }
377
+
378
+ @media (max-width: 720px) {
379
+ .a24-chat { grid-template-columns: minmax(0, 1fr); min-height: 26rem; }
380
+ .a24-sidebar { bottom: 0; box-shadow: 8px 0 28px rgba(0,0,0,.16); left: 0; max-width: min(88vw, 19rem); position: absolute; top: 0; transform: translateX(-105%); transition: transform 180ms ease; width: 100%; }
381
+ [dir="rtl"] .a24-sidebar { left: auto; right: 0; transform: translateX(105%); }
382
+ .a24-sidebar[data-open] { transform: translateX(0); }
383
+ .a24-sidebar__mobile-close { display: inline-flex; }
384
+ .a24-sidebar-backdrop { background: rgba(0,0,0,.36); border: 0; display: block; inset: 0; position: absolute; z-index: 30; }
385
+ .a24-header__menu { display: inline-flex; }
386
+ .a24-header__collapse { display: none; }
387
+ .a24-thread__delete { opacity: 1; }
388
+ .a24-shell__content { gap: 1.5rem; padding: 2rem 1rem 7.5rem; }
389
+ .a24-shell__composer-overlay {
390
+ padding: 2rem max(.5rem, env(safe-area-inset-right)) max(.65rem, env(safe-area-inset-bottom)) max(.5rem, env(safe-area-inset-left));
391
+ }
392
+ .a24-shell__composer-inner { padding: 0 .25rem; }
393
+ .a24-shell__empty-content { padding-bottom: 5.5rem; }
394
+ .a24-shell__empty-composer { padding: 0; }
395
+ .a24-composer__surface { box-shadow: 0 4px 18px rgba(0,0,0,.1); }
396
+ .a24-chat [data-slot="message"] { max-width: 92%; }
397
+ }
398
+
399
+ @media (min-width: 960px) {
400
+ .a24-outline[data-visible] { display: block; }
401
+ }
402
+
403
+ @media (prefers-reduced-motion: reduce) {
404
+ .a24-chat *,
405
+ .a24-chat *::before,
406
+ .a24-chat *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
407
+ }
@@ -0,0 +1,18 @@
1
+ import type { AgentClient } from "@agents24/client";
2
+ import { type Agents24ProviderProps } from "@agents24/react";
3
+ import type { ChatMcpOauthCompletion } from "../types";
4
+ import { type AgentChatLayoutAgent, type AgentChatLayoutProps } from "./agent-chat-layout";
5
+ export type AgentChatAppProps = Omit<AgentChatLayoutProps, "activeThreadId" | "agent" | "connectionState" | "isLoadingOlder" | "isLoadingThreads" | "isRunning" | "messages" | "onDeleteThread" | "onHitlAction" | "onLoadOlder" | "onNewThread" | "onOpenThread" | "onRetryConnection" | "onStop" | "onSubmit" | "state" | "streamingMessageId" | "threads"> & {
6
+ agent?: AgentChatLayoutAgent;
7
+ client: AgentClient;
8
+ createAbortController?: Agents24ProviderProps["createAbortController"];
9
+ createId?: Agents24ProviderProps["createId"];
10
+ completeMcpAuthorization?: (input: {
11
+ completion: ChatMcpOauthCompletion;
12
+ codeVerifier: string;
13
+ serverId: string;
14
+ }) => Promise<void>;
15
+ mcpRedirectUri?: string;
16
+ storage?: Agents24ProviderProps["storage"];
17
+ };
18
+ export declare function AgentChatApp({ client, createAbortController, createId, storage, ...props }: AgentChatAppProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,69 @@
1
+ import * as React from "react";
2
+ import type { ChatHitlPart, ChatMessage } from "../types";
3
+ import { type AgentChatComposerSubmit } from "../ui/agent-chat-composer";
4
+ export type AgentChatConnectionState = "connected" | "connecting" | "reconnecting" | "offline" | "expired";
5
+ export type AgentChatViewState = "ready" | "loading" | "streaming" | "reconnecting" | "paused" | "offline" | "denied" | "quota" | "failed" | "expired";
6
+ export type AgentChatLayoutThread = {
7
+ id: string;
8
+ title?: string | null;
9
+ updatedAt?: string | null;
10
+ status?: string | null;
11
+ };
12
+ export type AgentChatLayoutModel = {
13
+ id: string;
14
+ label: string;
15
+ };
16
+ export type AgentChatLayoutAgent = {
17
+ name: string;
18
+ description?: string | null;
19
+ avatarUrl?: string | null;
20
+ };
21
+ export type AgentChatLayoutSlots = {
22
+ assistantBody?: (input: {
23
+ isStreaming: boolean;
24
+ message: ChatMessage;
25
+ }) => React.ReactNode;
26
+ empty?: React.ReactNode;
27
+ headerActions?: React.ReactNode;
28
+ messageActions?: (message: ChatMessage) => React.ReactNode;
29
+ threadActions?: (thread: AgentChatLayoutThread) => React.ReactNode;
30
+ };
31
+ export type AgentChatLayoutProps = {
32
+ activeThreadId?: string | null;
33
+ agent: AgentChatLayoutAgent;
34
+ allowAttachments?: boolean;
35
+ className?: string;
36
+ connectionState?: AgentChatConnectionState;
37
+ dir?: "ltr" | "rtl";
38
+ errorMessage?: string | null;
39
+ hasMoreThreads?: boolean;
40
+ isDeletingThread?: boolean;
41
+ isLoadingOlder?: boolean;
42
+ isLoadingThreads?: boolean;
43
+ isRunning?: boolean;
44
+ messages: ChatMessage[];
45
+ modelId?: string | null;
46
+ models?: AgentChatLayoutModel[];
47
+ onDeleteThread?: (threadId: string) => Promise<void> | void;
48
+ onHitlAction?: (part: ChatHitlPart, action: string, comment?: string) => Promise<void> | void;
49
+ onLoadMoreThreads?: () => Promise<void> | void;
50
+ onLoadOlder?: () => Promise<void> | void;
51
+ onModelChange?: (modelId: string) => void;
52
+ onNewThread: () => void;
53
+ onOpenThread: (threadId: string) => Promise<void> | void;
54
+ onRetryConnection?: () => Promise<void> | void;
55
+ onStop?: () => void;
56
+ onSubmit: (message: AgentChatComposerSubmit) => Promise<void> | void;
57
+ placeholder?: string;
58
+ slots?: AgentChatLayoutSlots;
59
+ state?: AgentChatViewState;
60
+ streamingMessageId?: string | null;
61
+ threads: AgentChatLayoutThread[];
62
+ title?: string;
63
+ };
64
+ export declare function AgentChatStatePanel({ errorMessage, onRetry, state, }: {
65
+ errorMessage?: string | null;
66
+ onRetry?: () => Promise<void> | void;
67
+ state: Exclude<AgentChatViewState, "ready" | "streaming" | "paused">;
68
+ }): import("react/jsx-runtime").JSX.Element;
69
+ export declare function AgentChatLayout({ activeThreadId, agent, allowAttachments, className, connectionState, dir, errorMessage, hasMoreThreads, isDeletingThread, isLoadingOlder, isLoadingThreads, isRunning, messages, modelId, models, onDeleteThread, onHitlAction, onLoadMoreThreads, onLoadOlder, onModelChange, onNewThread, onOpenThread, onRetryConnection, onStop, onSubmit, placeholder, slots, state, streamingMessageId, threads, title, }: AgentChatLayoutProps): import("react/jsx-runtime").JSX.Element;
@@ -34,4 +34,4 @@ export type AgentChatShellProps<TMessage extends AgentChatShellMessage> = {
34
34
  };
35
35
  export declare function getAgentChatShellScrollState(viewport: Pick<HTMLElement, "clientHeight" | "scrollHeight" | "scrollTop">): AgentChatShellScrollState;
36
36
  export declare function buildAgentChatOutlineItems<TMessage extends AgentChatShellMessage>(messages: TMessage[], getLabel?: (message: TMessage, index: number) => string, getResponsePreview?: (message: TMessage) => string): LatestThreadScrollerOutlineItem[];
37
- export declare function AgentChatShell<TMessage extends AgentChatShellMessage>({ className, composer, composerOverlayClassName, composerOverlayHeight, contentClassName, defaultComposerOverlayHeight, dir, emptyInputAttachmentCount, emptyTitle, hideComposer, isLoadingOlder, messages, onLoadOlder, onScrollStateChange, outlineItems, outlineSide, renderEmptyState, renderMessage, renderOlderLoader, }: AgentChatShellProps<TMessage>): React.JSX.Element;
37
+ export declare function AgentChatShell<TMessage extends AgentChatShellMessage>({ className, composer, composerOverlayClassName, composerOverlayHeight, contentClassName, defaultComposerOverlayHeight, dir, emptyInputAttachmentCount, emptyTitle, hideComposer, isLoadingOlder, messages, onLoadOlder, onScrollStateChange, outlineItems, outlineSide, renderEmptyState, renderMessage, renderOlderLoader, }: AgentChatShellProps<TMessage>): import("react/jsx-runtime").JSX.Element;