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