@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.
Files changed (48) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/types/components/agent-thread/agent-thread.d.ts +583 -0
  3. package/dist/types/components/approval-card/approval-card.d.ts +596 -0
  4. package/dist/types/components/avatar/avatar.d.ts +91 -4
  5. package/dist/types/components/block-view/block-view.d.ts +205 -0
  6. package/dist/types/components/composer/composer.d.ts +736 -0
  7. package/dist/types/components/run-status/run-status.d.ts +393 -0
  8. package/dist/types/components/run-trace/run-trace.d.ts +624 -0
  9. package/dist/types/components/source-list/source-list.d.ts +177 -0
  10. package/dist/types/core/messages.d.ts +135 -0
  11. package/dist/types/index.d.ts +8 -0
  12. package/dist/types/internal/agent-model.d.ts +587 -0
  13. package/dist/types/internal/highlight.d.ts +24 -0
  14. package/dist/types/internal/presence-loop.d.ts +148 -0
  15. package/dist/zx-zeyos.esm.js +4648 -4513
  16. package/dist/zx-zeyos.esm.min.js +2 -2
  17. package/dist/zx.css +1927 -1
  18. package/dist/zx.esm.js +15769 -9194
  19. package/dist/zx.esm.min.js +27 -8
  20. package/dist/zx.global.js +15769 -9194
  21. package/dist/zx.global.min.js +27 -8
  22. package/dist/zx.min.css +1 -1
  23. package/docs/api.json +1166 -5
  24. package/docs/llms.md +455 -2
  25. package/docs/llms.txt +10 -1
  26. package/package.json +1 -1
  27. package/src/components/agent-thread/agent-thread.css +417 -0
  28. package/src/components/agent-thread/agent-thread.js +1365 -0
  29. package/src/components/approval-card/approval-card.css +289 -0
  30. package/src/components/approval-card/approval-card.js +1377 -0
  31. package/src/components/avatar/avatar.css +56 -1
  32. package/src/components/avatar/avatar.js +148 -26
  33. package/src/components/block-view/block-view.css +300 -0
  34. package/src/components/block-view/block-view.js +523 -0
  35. package/src/components/composer/composer.css +403 -0
  36. package/src/components/composer/composer.js +1441 -0
  37. package/src/components/run-status/run-status.css +208 -0
  38. package/src/components/run-status/run-status.js +782 -0
  39. package/src/components/run-trace/run-trace.css +443 -0
  40. package/src/components/run-trace/run-trace.js +1209 -0
  41. package/src/components/source-list/source-list.css +208 -0
  42. package/src/components/source-list/source-list.js +355 -0
  43. package/src/core/messages.js +143 -0
  44. package/src/index.js +8 -0
  45. package/src/internal/agent-model.js +488 -0
  46. package/src/internal/highlight.js +104 -0
  47. package/src/internal/presence-loop.js +343 -0
  48. package/styles/zx.css +7 -0
@@ -0,0 +1,443 @@
1
+ /*
2
+ * RunTrace — what an agent did during a run. Quiet type and no box: a one-line summary that opens
3
+ * into a timeline, each step a glyph on a hairline that joins them, its words, and its state or
4
+ * duration at the end of the line. A tool call opens to its arguments and result in mono; a step's
5
+ * links to the application's own things sit under its words.
6
+ */
7
+ .zx-run-trace {
8
+ display: grid;
9
+ grid-template-columns: minmax(0, 1fr);
10
+ gap: var(--zx-space-1);
11
+ min-inline-size: 0;
12
+ color: var(--zx-color-text);
13
+ font-size: var(--zx-text-sm);
14
+ }
15
+
16
+ .zx-run-trace[data-empty] {
17
+ display: none;
18
+ }
19
+
20
+ /* ------------------------------------------------------------------ summary -- */
21
+
22
+ .zx-run-trace__summary {
23
+ display: flex;
24
+ align-items: center;
25
+ gap: var(--zx-space-2);
26
+ inline-size: fit-content;
27
+ max-inline-size: calc(100% + var(--zx-space-2));
28
+ min-block-size: var(--zx-space-6);
29
+ margin-inline-start: calc(-1 * var(--zx-space-2));
30
+ padding: 2px var(--zx-space-2);
31
+ border: 0;
32
+ border-radius: var(--zx-radius-md);
33
+ background: none;
34
+ color: var(--zx-color-text-muted);
35
+ font: inherit;
36
+ font-size: var(--zx-text-sm);
37
+ text-align: start;
38
+ cursor: pointer;
39
+ }
40
+
41
+ .zx-run-trace__summary:hover {
42
+ background: var(--zx-color-bg-hover);
43
+ color: var(--zx-color-text);
44
+ }
45
+
46
+ .zx-run-trace__summary:focus-visible {
47
+ outline-color: transparent;
48
+ box-shadow: var(--zx-focus-ring);
49
+ }
50
+
51
+ .zx-run-trace__summary-state {
52
+ display: inline-flex;
53
+ flex: 0 0 auto;
54
+ }
55
+
56
+ .zx-run-trace__summary-state[hidden],
57
+ .zx-run-trace__summary-doing[hidden] {
58
+ display: none;
59
+ }
60
+
61
+ /* On a narrow screen the summary wraps rather than lose its end. */
62
+ .zx-run-trace__summary-text,
63
+ .zx-run-trace__summary-doing {
64
+ min-inline-size: 0;
65
+ }
66
+
67
+ .zx-run-trace__summary-doing {
68
+ overflow: hidden;
69
+ text-overflow: ellipsis;
70
+ white-space: nowrap;
71
+ }
72
+
73
+ .zx-run-trace__chevron {
74
+ display: inline-flex;
75
+ flex: 0 0 auto;
76
+ justify-content: center;
77
+ min-inline-size: 14px;
78
+ color: var(--zx-color-text-subtle);
79
+ }
80
+
81
+ .zx-run-trace__summary[aria-expanded="true"] > .zx-run-trace__chevron {
82
+ rotate: 90deg;
83
+ }
84
+
85
+ /* ------------------------------------------------------------------ steps -- */
86
+
87
+ .zx-run-trace__steps,
88
+ .zx-run-trace__retries {
89
+ display: grid;
90
+ margin: 0;
91
+ padding: 0;
92
+ list-style: none;
93
+ }
94
+
95
+ .zx-run-trace__steps[hidden] {
96
+ display: none;
97
+ }
98
+
99
+ /* A retry sits under the step it repeats, its glyph in line with that step's words. */
100
+ .zx-run-trace__retries {
101
+ padding-inline-start: calc(var(--zx-space-6) + var(--zx-space-3));
102
+ }
103
+
104
+ .zx-run-trace__step {
105
+ position: relative;
106
+ min-inline-size: 0;
107
+ }
108
+
109
+ /* The hairline from one step's glyph to the next. */
110
+ .zx-run-trace__step:not(:last-child)::before {
111
+ content: "";
112
+ position: absolute;
113
+ inset-block: calc(var(--zx-space-1) + var(--zx-space-6) + 2px) calc(2px - var(--zx-space-1));
114
+ inset-inline-start: calc(var(--zx-space-6) / 2 - 0.5px);
115
+ inline-size: 1px;
116
+ background: var(--zx-color-border-subtle);
117
+ }
118
+
119
+ /* The row's hover fill reaches past the glyph and the words, which stay in line with the summary. */
120
+ /* Without kind glyphs (a plan), a step leads with its text and keeps its status at the end. */
121
+ .zx-run-trace[data-tiles="none"] .zx-run-trace__tile {
122
+ display: none;
123
+ }
124
+
125
+ .zx-run-trace[data-tiles="none"] .zx-run-trace__row {
126
+ grid-template-columns: minmax(0, 1fr) auto auto;
127
+ }
128
+
129
+ .zx-run-trace__row {
130
+ display: grid;
131
+ grid-template-columns: var(--zx-space-6) minmax(0, 1fr) auto auto;
132
+ align-items: start;
133
+ column-gap: var(--zx-space-2);
134
+ inline-size: calc(100% + 2 * var(--zx-space-2));
135
+ margin-inline: calc(-1 * var(--zx-space-2));
136
+ padding: var(--zx-space-1) var(--zx-space-2);
137
+ border: 0;
138
+ border-radius: var(--zx-radius-md);
139
+ background: none;
140
+ color: inherit;
141
+ font: inherit;
142
+ text-align: start;
143
+ }
144
+
145
+ button.zx-run-trace__row {
146
+ cursor: pointer;
147
+ }
148
+
149
+ button.zx-run-trace__row:hover {
150
+ background: var(--zx-color-bg-hover);
151
+ }
152
+
153
+ .zx-run-trace__row:focus-visible {
154
+ outline-color: transparent;
155
+ box-shadow: var(--zx-focus-ring);
156
+ }
157
+
158
+ .zx-run-trace__row[aria-expanded="true"] > .zx-run-trace__chevron {
159
+ rotate: 180deg;
160
+ }
161
+
162
+ .zx-run-trace__row > .zx-run-trace__chevron {
163
+ align-items: center;
164
+ min-block-size: var(--zx-space-6);
165
+ }
166
+
167
+ .zx-run-trace__step[data-state="revealed"] > .zx-run-trace__row {
168
+ background: var(--zx-color-accent-subtle);
169
+ }
170
+
171
+ .zx-run-trace__tile {
172
+ display: inline-grid;
173
+ place-items: center;
174
+ inline-size: var(--zx-space-6);
175
+ block-size: var(--zx-space-6);
176
+ border-radius: var(--zx-radius-full);
177
+ background: var(--zx-color-bg-muted);
178
+ color: var(--zx-color-text-muted);
179
+ }
180
+
181
+ .zx-run-trace__step[aria-current="step"] > .zx-run-trace__row .zx-run-trace__tile {
182
+ background: var(--zx-color-info-bg);
183
+ color: var(--zx-color-info);
184
+ }
185
+
186
+ .zx-run-trace__step:is([data-status="failed"], [data-status="blocked"]) > .zx-run-trace__row .zx-run-trace__tile {
187
+ background: var(--zx-color-danger-bg);
188
+ color: var(--zx-color-danger);
189
+ }
190
+
191
+ /* The count follows the label on its line, the way a person reads "Queried invoices · 42 rows";
192
+ it wraps under the label only when the column is too narrow for both. */
193
+ .zx-run-trace__text {
194
+ display: flex;
195
+ flex-wrap: wrap;
196
+ align-items: baseline;
197
+ column-gap: var(--zx-space-2);
198
+ min-inline-size: 0;
199
+ padding-block-start: 2px;
200
+ padding-inline-start: var(--zx-space-1);
201
+ }
202
+
203
+ .zx-run-trace__line {
204
+ display: flex;
205
+ flex-wrap: wrap;
206
+ align-items: center;
207
+ gap: var(--zx-space-1) var(--zx-space-2);
208
+ min-block-size: var(--zx-space-6);
209
+ min-inline-size: 0;
210
+ }
211
+
212
+ .zx-run-trace__label {
213
+ min-inline-size: 0;
214
+ font-weight: var(--zx-weight-medium);
215
+ line-height: 1.4;
216
+ }
217
+
218
+ .zx-run-trace__step[aria-current="step"] > .zx-run-trace__row .zx-run-trace__label {
219
+ color: var(--zx-color-text-muted);
220
+ }
221
+
222
+ /* Count, who, when, and tokens: one muted line after the label, wrapping only when narrow. */
223
+ .zx-run-trace__meta {
224
+ color: var(--zx-color-text-muted);
225
+ line-height: 1.4;
226
+ }
227
+
228
+ .zx-run-trace__clock {
229
+ font-variant-numeric: tabular-nums;
230
+ }
231
+
232
+ /* A step's links: quiet, underlined like links, under the step's words. They are siblings of the
233
+ row, so the row's button never holds another control. */
234
+ .zx-run-trace__refs {
235
+ display: flex;
236
+ flex-wrap: wrap;
237
+ gap: 0 var(--zx-space-3);
238
+ margin: calc(-1 * var(--zx-space-1)) 0 var(--zx-space-1);
239
+ padding: 0;
240
+ padding-inline-start: calc(var(--zx-space-6) + var(--zx-space-3));
241
+ list-style: none;
242
+ }
243
+
244
+ .zx-run-trace__ref {
245
+ display: inline-flex;
246
+ align-items: center;
247
+ gap: var(--zx-space-1);
248
+ min-block-size: var(--zx-space-6);
249
+ max-inline-size: 100%;
250
+ padding: 0 2px;
251
+ border: 0;
252
+ border-radius: var(--zx-radius-sm);
253
+ background: none;
254
+ color: var(--zx-color-text-muted);
255
+ font: inherit;
256
+ font-size: var(--zx-text-sm);
257
+ text-align: start;
258
+ cursor: pointer;
259
+ }
260
+
261
+ .zx-run-trace__ref-label {
262
+ min-inline-size: 0;
263
+ overflow-wrap: anywhere;
264
+ text-decoration: underline;
265
+ text-decoration-color: var(--zx-color-border-strong);
266
+ text-underline-offset: 3px;
267
+ }
268
+
269
+ .zx-run-trace__ref-icon {
270
+ display: inline-flex;
271
+ flex: 0 0 auto;
272
+ color: var(--zx-color-text-subtle);
273
+ }
274
+
275
+ .zx-run-trace__ref:hover {
276
+ color: var(--zx-color-text);
277
+ }
278
+
279
+ .zx-run-trace__ref:hover > .zx-run-trace__ref-label {
280
+ text-decoration-color: currentColor;
281
+ }
282
+
283
+ .zx-run-trace__ref:focus-visible {
284
+ outline-color: transparent;
285
+ box-shadow: var(--zx-focus-ring);
286
+ }
287
+
288
+ .zx-run-trace__retry {
289
+ flex: 0 0 auto;
290
+ padding-inline: var(--zx-space-1);
291
+ border-radius: var(--zx-radius-sm);
292
+ background: var(--zx-color-bg-muted);
293
+ color: var(--zx-color-text-muted);
294
+ font-size: var(--zx-text-xs);
295
+ font-weight: var(--zx-weight-medium);
296
+ }
297
+
298
+ /* A hand-off: two agents joined by a dotted line. */
299
+ .zx-run-trace__handoff {
300
+ display: inline-flex;
301
+ flex: 0 0 auto;
302
+ align-items: center;
303
+ }
304
+
305
+ .zx-run-trace__handoff-line {
306
+ inline-size: var(--zx-space-3);
307
+ margin-inline: 2px;
308
+ border-block-start: 2px dotted var(--zx-color-border-strong);
309
+ }
310
+
311
+ /* The step's state: a glyph, and its word or its duration. */
312
+ .zx-run-trace__end {
313
+ display: inline-flex;
314
+ align-items: center;
315
+ gap: var(--zx-space-1);
316
+ min-block-size: var(--zx-space-6);
317
+ color: var(--zx-color-text-muted);
318
+ font-size: var(--zx-text-xs);
319
+ font-variant-numeric: tabular-nums;
320
+ white-space: nowrap;
321
+ }
322
+
323
+ .zx-run-trace__step:is([data-status="failed"], [data-status="blocked"]) > .zx-run-trace__row .zx-run-trace__word {
324
+ color: var(--zx-color-danger);
325
+ }
326
+
327
+ .zx-run-trace__sr {
328
+ position: absolute;
329
+ inline-size: 1px;
330
+ block-size: 1px;
331
+ overflow: hidden;
332
+ clip-path: inset(50%);
333
+ white-space: nowrap;
334
+ }
335
+
336
+ /* ------------------------------------------------------------------ disclosure -- */
337
+
338
+ /* The disclosure starts under the step's words. */
339
+ .zx-run-trace__body {
340
+ display: grid;
341
+ gap: var(--zx-space-2);
342
+ min-inline-size: 0;
343
+ margin-block: var(--zx-space-1) var(--zx-space-3);
344
+ padding-inline-start: calc(var(--zx-space-6) + var(--zx-space-3));
345
+ }
346
+
347
+ .zx-run-trace__body[hidden] {
348
+ display: none;
349
+ }
350
+
351
+ .zx-run-trace__tool,
352
+ .zx-run-trace__note {
353
+ margin: 0;
354
+ color: var(--zx-color-text-muted);
355
+ font-size: var(--zx-text-xs);
356
+ }
357
+
358
+ .zx-run-trace__tool-name {
359
+ color: var(--zx-color-text);
360
+ font-family: var(--zx-font-mono);
361
+ }
362
+
363
+ .zx-run-trace__section {
364
+ display: grid;
365
+ gap: var(--zx-space-1);
366
+ min-inline-size: 0;
367
+ }
368
+
369
+ .zx-run-trace__section-head {
370
+ display: flex;
371
+ align-items: center;
372
+ justify-content: space-between;
373
+ gap: var(--zx-space-2);
374
+ }
375
+
376
+ .zx-run-trace__section-title {
377
+ color: var(--zx-color-text-muted);
378
+ font-size: var(--zx-text-xs);
379
+ font-weight: var(--zx-weight-medium);
380
+ }
381
+
382
+ .zx-run-trace__code {
383
+ max-block-size: 20rem;
384
+ margin: 0;
385
+ padding: var(--zx-space-2) var(--zx-space-3);
386
+ overflow: auto;
387
+ border-radius: var(--zx-radius-md);
388
+ background: var(--zx-color-bg-muted);
389
+ color: var(--zx-color-text);
390
+ font-family: var(--zx-font-mono);
391
+ font-size: var(--zx-text-xs);
392
+ line-height: 1.6;
393
+ overflow-wrap: anywhere;
394
+ white-space: pre-wrap;
395
+ }
396
+
397
+ .zx-run-trace__code[data-tone="danger"] {
398
+ background: var(--zx-color-danger-bg);
399
+ }
400
+
401
+ .zx-run-trace__code:focus-visible {
402
+ outline-color: transparent;
403
+ box-shadow: var(--zx-focus-ring);
404
+ }
405
+
406
+ .zx-run-trace__more {
407
+ justify-self: start;
408
+ }
409
+
410
+ /* ------------------------------------------------------------------ motion -- */
411
+
412
+ /* Only the running step moves: its glyph breathes. Under reduced motion it holds still, and its
413
+ words still say what it is doing. */
414
+ @media (prefers-reduced-motion: no-preference) {
415
+ .zx-run-trace__chevron {
416
+ transition: rotate var(--zx-dur-fast) var(--zx-ease);
417
+ }
418
+
419
+ .zx-run-trace__summary,
420
+ .zx-run-trace__row {
421
+ transition:
422
+ background-color var(--zx-dur-base) var(--zx-ease),
423
+ color var(--zx-dur-fast) var(--zx-ease);
424
+ }
425
+
426
+ .zx-run-trace__ref,
427
+ .zx-run-trace__ref-label {
428
+ transition:
429
+ color var(--zx-dur-fast) var(--zx-ease),
430
+ text-decoration-color var(--zx-dur-fast) var(--zx-ease);
431
+ }
432
+
433
+ .zx-run-trace__step[aria-current="step"] > .zx-run-trace__row .zx-status-icon,
434
+ .zx-run-trace[data-state="running"] > .zx-run-trace__summary .zx-status-icon {
435
+ animation: zx-run-trace-pulse 1.6s var(--zx-ease) infinite;
436
+ }
437
+ }
438
+
439
+ @keyframes zx-run-trace-pulse {
440
+ 50% {
441
+ opacity: 0.35;
442
+ }
443
+ }