@zeyos/zx 5.5.0 → 5.6.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.
- package/CHANGELOG.md +56 -0
- package/dist/types/components/agent-thread/agent-thread.d.ts +583 -0
- package/dist/types/components/approval-card/approval-card.d.ts +596 -0
- package/dist/types/components/avatar/avatar.d.ts +91 -4
- package/dist/types/components/block-view/block-view.d.ts +205 -0
- package/dist/types/components/composer/composer.d.ts +736 -0
- package/dist/types/components/run-status/run-status.d.ts +393 -0
- package/dist/types/components/run-trace/run-trace.d.ts +624 -0
- package/dist/types/components/source-list/source-list.d.ts +177 -0
- package/dist/types/core/messages.d.ts +135 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/internal/agent-model.d.ts +587 -0
- package/dist/types/internal/highlight.d.ts +24 -0
- package/dist/types/internal/presence-loop.d.ts +148 -0
- package/dist/zx-zeyos.esm.js +4648 -4513
- package/dist/zx-zeyos.esm.min.js +2 -2
- package/dist/zx.css +1927 -1
- package/dist/zx.esm.js +15769 -9194
- package/dist/zx.esm.min.js +27 -8
- package/dist/zx.global.js +15769 -9194
- package/dist/zx.global.min.js +27 -8
- package/dist/zx.min.css +1 -1
- package/docs/api.json +1166 -5
- package/docs/llms.md +455 -2
- package/docs/llms.txt +10 -1
- package/package.json +1 -1
- package/src/components/agent-thread/agent-thread.css +417 -0
- package/src/components/agent-thread/agent-thread.js +1365 -0
- package/src/components/approval-card/approval-card.css +289 -0
- package/src/components/approval-card/approval-card.js +1377 -0
- package/src/components/avatar/avatar.css +56 -1
- package/src/components/avatar/avatar.js +148 -26
- package/src/components/block-view/block-view.css +300 -0
- package/src/components/block-view/block-view.js +523 -0
- package/src/components/composer/composer.css +403 -0
- package/src/components/composer/composer.js +1441 -0
- package/src/components/run-status/run-status.css +208 -0
- package/src/components/run-status/run-status.js +782 -0
- package/src/components/run-trace/run-trace.css +443 -0
- package/src/components/run-trace/run-trace.js +1209 -0
- package/src/components/source-list/source-list.css +208 -0
- package/src/components/source-list/source-list.js +355 -0
- package/src/core/messages.js +143 -0
- package/src/index.js +8 -0
- package/src/internal/agent-model.js +488 -0
- package/src/internal/highlight.js +104 -0
- package/src/internal/presence-loop.js +343 -0
- package/styles/zx.css +7 -0
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Composer — the message box of an agent conversation. A filled box on the chrome tone with no
|
|
3
|
+
* frame of its own: the context and attachment chips, the text, and a bar of quiet tools ending in
|
|
4
|
+
* Send. Focus in the text rings the whole box. The `@` suggestions open above it, in the top layer.
|
|
5
|
+
*/
|
|
6
|
+
.zx-composer {
|
|
7
|
+
position: relative;
|
|
8
|
+
display: grid;
|
|
9
|
+
gap: var(--zx-space-2);
|
|
10
|
+
min-inline-size: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.zx-composer__frame {
|
|
14
|
+
position: relative;
|
|
15
|
+
display: grid;
|
|
16
|
+
gap: var(--zx-space-1);
|
|
17
|
+
min-inline-size: 0;
|
|
18
|
+
padding: var(--zx-space-2) var(--zx-space-3);
|
|
19
|
+
border-radius: var(--zx-radius-lg);
|
|
20
|
+
background: var(--zx-color-bg-chrome);
|
|
21
|
+
color: var(--zx-color-text);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.zx-composer__frame:has(.zx-composer__input:focus) {
|
|
25
|
+
box-shadow: var(--zx-focus-ring);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.zx-composer[aria-disabled="true"] .zx-composer__frame {
|
|
29
|
+
opacity: 0.6;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* ------------------------------------------------------------------ text -- */
|
|
33
|
+
|
|
34
|
+
.zx-composer .zx-composer__input {
|
|
35
|
+
display: block;
|
|
36
|
+
inline-size: 100%;
|
|
37
|
+
min-block-size: 0;
|
|
38
|
+
margin: 0;
|
|
39
|
+
padding: var(--zx-space-1);
|
|
40
|
+
overflow-y: hidden;
|
|
41
|
+
border: 0;
|
|
42
|
+
border-radius: 0;
|
|
43
|
+
background: transparent;
|
|
44
|
+
box-shadow: none;
|
|
45
|
+
color: inherit;
|
|
46
|
+
font: inherit;
|
|
47
|
+
font-size: var(--zx-text-md);
|
|
48
|
+
line-height: 1.5;
|
|
49
|
+
resize: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.zx-composer .zx-composer__input[data-scrolls="true"] {
|
|
53
|
+
overflow-y: auto;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.zx-composer .zx-composer__input::placeholder {
|
|
57
|
+
color: var(--zx-color-text-placeholder);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* The box draws the ring; the text inside it draws none of its own. */
|
|
61
|
+
.zx-composer .zx-composer__input:is(:focus, :focus-visible) {
|
|
62
|
+
outline-color: transparent;
|
|
63
|
+
box-shadow: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.zx-composer .zx-composer__input:disabled {
|
|
67
|
+
cursor: not-allowed;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* ------------------------------------------------------------------- bar -- */
|
|
71
|
+
|
|
72
|
+
/* The bar is the container its own narrow form asks about: the composer itself may sit in a
|
|
73
|
+
shrink-to-fit parent, the bar always spans the box. */
|
|
74
|
+
.zx-composer__bar {
|
|
75
|
+
container: zx-composer-bar / inline-size;
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
gap: var(--zx-space-1);
|
|
79
|
+
min-inline-size: 0;
|
|
80
|
+
margin-inline-start: calc(-1 * var(--zx-space-1));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.zx-composer__tools {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex: none;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: var(--zx-space-1);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.zx-composer__tools[hidden] {
|
|
91
|
+
display: none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.zx-composer__spacer {
|
|
95
|
+
flex: 1 1 auto;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.zx-composer__hint {
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
min-inline-size: 0;
|
|
101
|
+
padding-inline-start: var(--zx-space-1);
|
|
102
|
+
color: var(--zx-color-text-muted);
|
|
103
|
+
font-size: var(--zx-text-xs);
|
|
104
|
+
text-overflow: ellipsis;
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* The tools are quiet glyphs until they are pointed at. */
|
|
109
|
+
.zx-composer .zx-composer__tool > .zx-icon {
|
|
110
|
+
color: var(--zx-color-text-subtle);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.zx-composer .zx-composer__tool:hover:not(:disabled) > .zx-icon {
|
|
114
|
+
color: var(--zx-color-text);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.zx-composer .zx-composer__tool:disabled > .zx-icon {
|
|
118
|
+
color: var(--zx-color-text-placeholder);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* A pressed tool is a mode the next message is sent in: the neutral current fill, an edge, and the
|
|
122
|
+
full glyph colour, so the state never rests on colour alone. */
|
|
123
|
+
.zx-composer .zx-composer__tool[aria-pressed="true"] {
|
|
124
|
+
background: var(--zx-color-bg-current);
|
|
125
|
+
box-shadow: inset 0 0 0 1px var(--zx-color-border-strong);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.zx-composer .zx-composer__tool[aria-pressed="true"] > .zx-icon {
|
|
129
|
+
color: var(--zx-color-text);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.zx-composer .zx-composer__tool[aria-pressed="true"]:hover:not(:disabled) {
|
|
133
|
+
background: linear-gradient(var(--zx-color-bg-hover), var(--zx-color-bg-hover)), var(--zx-color-bg-current);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.zx-composer .zx-composer__tool[aria-pressed="true"]:focus-visible {
|
|
137
|
+
box-shadow: inset var(--zx-focus-ring);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Send is a neutral square until there is something to send; then it is the accent. Stop takes
|
|
141
|
+
its place while the agent works. */
|
|
142
|
+
.zx-composer .zx-composer__send {
|
|
143
|
+
flex: none;
|
|
144
|
+
inline-size: var(--zx-control-height);
|
|
145
|
+
block-size: var(--zx-control-height);
|
|
146
|
+
border-radius: var(--zx-radius-lg);
|
|
147
|
+
background: var(--zx-color-bg-current);
|
|
148
|
+
color: var(--zx-color-text);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.zx-composer .zx-composer__send:hover {
|
|
152
|
+
background: var(--zx-color-bg-current);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.zx-composer .zx-composer__send[aria-disabled="true"],
|
|
156
|
+
.zx-composer .zx-composer__send:disabled {
|
|
157
|
+
color: var(--zx-color-text-placeholder);
|
|
158
|
+
cursor: default;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.zx-composer .zx-composer__send[data-mode="send"][aria-disabled="false"]:not(:disabled) {
|
|
162
|
+
background: var(--zx-color-accent-solid);
|
|
163
|
+
color: var(--zx-color-on-accent-solid);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.zx-composer .zx-composer__send[data-mode="send"][aria-disabled="false"]:not(:disabled):hover {
|
|
167
|
+
background: var(--zx-color-accent-solid-hover);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.zx-composer .zx-composer__send[data-mode="stop"] > .zx-icon {
|
|
171
|
+
fill: currentColor;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.zx-composer .zx-composer__send:focus-visible {
|
|
175
|
+
outline-color: transparent;
|
|
176
|
+
box-shadow: var(--zx-focus-ring);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* A solid accent under the accent ring: an inner line in its own ink keeps them apart. */
|
|
180
|
+
.zx-composer .zx-composer__send[data-mode="send"][aria-disabled="false"]:focus-visible {
|
|
181
|
+
box-shadow: inset 0 0 0 1px var(--zx-color-on-accent-solid), var(--zx-focus-ring);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* `sendLabel`: the glyph and a word ("Start task", "Stop" while busy). */
|
|
185
|
+
.zx-composer .zx-composer__send:has(> .zx-composer__send-label) {
|
|
186
|
+
display: inline-flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
gap: var(--zx-space-2);
|
|
190
|
+
inline-size: auto;
|
|
191
|
+
max-inline-size: 100%;
|
|
192
|
+
padding-inline: var(--zx-space-3);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.zx-composer__send-label {
|
|
196
|
+
overflow: hidden;
|
|
197
|
+
font-size: var(--zx-control-font-size);
|
|
198
|
+
font-weight: var(--zx-control-font-weight);
|
|
199
|
+
text-overflow: ellipsis;
|
|
200
|
+
white-space: nowrap;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* In a narrow composer — a phone, a side column — Send goes back to its square: the word is drawn
|
|
204
|
+
no more but stays the button's name, and its tooltip. */
|
|
205
|
+
@container zx-composer-bar (inline-size < 24rem) {
|
|
206
|
+
.zx-composer .zx-composer__send:has(> .zx-composer__send-label) {
|
|
207
|
+
inline-size: var(--zx-control-height);
|
|
208
|
+
padding-inline: 0;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.zx-composer__send-label {
|
|
212
|
+
position: absolute;
|
|
213
|
+
inline-size: 1px;
|
|
214
|
+
block-size: 1px;
|
|
215
|
+
overflow: hidden;
|
|
216
|
+
clip-path: inset(50%);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* ----------------------------------------------------------------- chips -- */
|
|
221
|
+
|
|
222
|
+
.zx-composer__chips {
|
|
223
|
+
display: flex;
|
|
224
|
+
flex-wrap: wrap;
|
|
225
|
+
gap: var(--zx-space-2);
|
|
226
|
+
margin: 0;
|
|
227
|
+
padding: var(--zx-space-1) 0 0;
|
|
228
|
+
list-style: none;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.zx-composer__chips[hidden] {
|
|
232
|
+
display: none;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.zx-composer__chip {
|
|
236
|
+
display: inline-flex;
|
|
237
|
+
align-items: center;
|
|
238
|
+
gap: var(--zx-space-2);
|
|
239
|
+
max-inline-size: 100%;
|
|
240
|
+
min-block-size: calc(var(--zx-control-height) - var(--zx-space-1));
|
|
241
|
+
padding-inline: var(--zx-space-2) var(--zx-space-1);
|
|
242
|
+
border: 1px solid var(--zx-color-border-subtle);
|
|
243
|
+
border-radius: var(--zx-radius-md);
|
|
244
|
+
background: var(--zx-color-bg-surface);
|
|
245
|
+
font-size: var(--zx-text-sm);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* What the message is about reads as the accent's quiet tint; files stay on the surface. */
|
|
249
|
+
.zx-composer__chip[data-kind="context"] {
|
|
250
|
+
border-color: transparent;
|
|
251
|
+
background: var(--zx-color-accent-subtle);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.zx-composer__chip > .zx-icon {
|
|
255
|
+
flex: none;
|
|
256
|
+
color: var(--zx-color-text-subtle);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.zx-composer__chip-label {
|
|
260
|
+
overflow: hidden;
|
|
261
|
+
min-inline-size: 0;
|
|
262
|
+
text-overflow: ellipsis;
|
|
263
|
+
white-space: nowrap;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.zx-composer__chip-meta {
|
|
267
|
+
flex: none;
|
|
268
|
+
color: var(--zx-color-text-muted);
|
|
269
|
+
font-size: var(--zx-text-xs);
|
|
270
|
+
font-variant-numeric: tabular-nums;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.zx-composer .zx-composer__remove {
|
|
274
|
+
inline-size: calc(var(--zx-control-height) - var(--zx-space-2));
|
|
275
|
+
block-size: calc(var(--zx-control-height) - var(--zx-space-2));
|
|
276
|
+
border-radius: var(--zx-radius-sm);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* -------------------------------------------------------------- dropping -- */
|
|
280
|
+
|
|
281
|
+
.zx-composer__drop {
|
|
282
|
+
position: absolute;
|
|
283
|
+
inset: 0;
|
|
284
|
+
display: none;
|
|
285
|
+
place-items: center;
|
|
286
|
+
align-content: center;
|
|
287
|
+
gap: var(--zx-space-1);
|
|
288
|
+
border-radius: inherit;
|
|
289
|
+
background: var(--zx-color-accent-subtle);
|
|
290
|
+
box-shadow: inset 0 0 0 1px var(--zx-color-accent);
|
|
291
|
+
color: var(--zx-color-accent);
|
|
292
|
+
font-size: var(--zx-text-sm);
|
|
293
|
+
font-weight: var(--zx-weight-medium);
|
|
294
|
+
pointer-events: none;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.zx-composer[data-state="dropping"] .zx-composer__drop {
|
|
298
|
+
display: grid;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/* ------------------------------------------------------------------ note -- */
|
|
302
|
+
|
|
303
|
+
.zx-composer__note {
|
|
304
|
+
margin: 0;
|
|
305
|
+
color: var(--zx-color-text-muted);
|
|
306
|
+
font-size: var(--zx-text-xs);
|
|
307
|
+
text-align: center;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/* ----------------------------------------------------------- suggestions -- */
|
|
311
|
+
|
|
312
|
+
.zx-composer__suggestions {
|
|
313
|
+
display: grid;
|
|
314
|
+
gap: 2px;
|
|
315
|
+
inline-size: min(22rem, calc(100vw - var(--zx-space-4)));
|
|
316
|
+
max-block-size: min(18rem, 45vh);
|
|
317
|
+
overflow: auto;
|
|
318
|
+
overscroll-behavior: contain;
|
|
319
|
+
padding: var(--zx-space-1);
|
|
320
|
+
border: 1px solid var(--zx-color-overlay-border);
|
|
321
|
+
border-radius: var(--zx-radius-panel);
|
|
322
|
+
background-color: var(--zx-color-overlay-surface);
|
|
323
|
+
background-clip: padding-box;
|
|
324
|
+
box-shadow: var(--zx-overlay-shadow);
|
|
325
|
+
color: var(--zx-color-text);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.zx-composer__suggestions[hidden] {
|
|
329
|
+
display: none;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
333
|
+
.zx-composer__suggestions {
|
|
334
|
+
border-color: var(--zx-color-border-strong);
|
|
335
|
+
background: var(--zx-color-bg-raised);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.zx-composer__option {
|
|
340
|
+
display: flex;
|
|
341
|
+
align-items: center;
|
|
342
|
+
gap: var(--zx-space-2);
|
|
343
|
+
min-block-size: calc(var(--zx-control-height) - 2px);
|
|
344
|
+
padding: var(--zx-space-1) var(--zx-space-2);
|
|
345
|
+
border-radius: var(--zx-radius-sm);
|
|
346
|
+
line-height: 1.35;
|
|
347
|
+
cursor: pointer;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/* The highlighted suggestion takes the same neutral step as a highlighted option in any list. */
|
|
351
|
+
.zx-composer__option[aria-selected="true"] {
|
|
352
|
+
background: var(--zx-color-overlay-hover);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.zx-composer__option > .zx-icon {
|
|
356
|
+
flex: none;
|
|
357
|
+
color: var(--zx-color-text-subtle);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.zx-composer__option-text {
|
|
361
|
+
display: grid;
|
|
362
|
+
min-inline-size: 0;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.zx-composer__option-label {
|
|
366
|
+
overflow: hidden;
|
|
367
|
+
font-size: var(--zx-text-sm);
|
|
368
|
+
font-weight: var(--zx-weight-medium);
|
|
369
|
+
text-overflow: ellipsis;
|
|
370
|
+
white-space: nowrap;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.zx-composer__option-description {
|
|
374
|
+
overflow: hidden;
|
|
375
|
+
color: var(--zx-color-text-muted);
|
|
376
|
+
font-size: var(--zx-text-xs);
|
|
377
|
+
text-overflow: ellipsis;
|
|
378
|
+
white-space: nowrap;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/* Spoken, not drawn: the number of suggestions. */
|
|
382
|
+
.zx-composer__status {
|
|
383
|
+
position: absolute;
|
|
384
|
+
inline-size: 1px;
|
|
385
|
+
block-size: 1px;
|
|
386
|
+
overflow: hidden;
|
|
387
|
+
clip-path: inset(50%);
|
|
388
|
+
white-space: nowrap;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/* ---------------------------------------------------------------- motion -- */
|
|
392
|
+
|
|
393
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
394
|
+
.zx-composer .zx-composer__send {
|
|
395
|
+
transition:
|
|
396
|
+
background-color var(--zx-dur-fast) var(--zx-ease),
|
|
397
|
+
color var(--zx-dur-fast) var(--zx-ease);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.zx-composer__frame {
|
|
401
|
+
transition: box-shadow var(--zx-dur-fast) var(--zx-ease);
|
|
402
|
+
}
|
|
403
|
+
}
|