@adecore/agents-react 0.20.1 → 0.21.1

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 (113) hide show
  1. package/dist/chat/logic/generated-image.d.ts +27 -0
  2. package/dist/chat/logic/generated-image.js +32 -0
  3. package/dist/chat/logic/timeline-target.d.ts +13 -1
  4. package/dist/chat/logic/timeline-target.js +26 -0
  5. package/dist/chat/logic/timeline.js +16 -10
  6. package/dist/chat/subagent-conversation.d.ts +2 -1
  7. package/dist/chat/subagent-conversation.js +7 -1
  8. package/dist/chat/timeline-flash.d.ts +3 -1
  9. package/dist/chat/timeline-flash.js +2 -2
  10. package/dist/chat/ui/ImageView.d.ts +8 -2
  11. package/dist/chat/ui/ImageView.js +12 -6
  12. package/dist/chat/ui/SubagentTimeline.js +6 -2
  13. package/dist/chat/ui/Timeline.js +67 -7
  14. package/dist/chat/ui/intelligent-ui/UiBlockFrame.d.ts +23 -0
  15. package/dist/chat/ui/intelligent-ui/UiBlockFrame.js +103 -0
  16. package/dist/chat/ui/intelligent-ui/UiFallbackPart.d.ts +10 -0
  17. package/dist/chat/ui/intelligent-ui/UiFallbackPart.js +11 -0
  18. package/dist/chat/ui/intelligent-ui/UiReply.d.ts +15 -0
  19. package/dist/chat/ui/intelligent-ui/UiReply.js +329 -0
  20. package/dist/chat/ui/intelligent-ui/block-local.d.ts +11 -0
  21. package/dist/chat/ui/intelligent-ui/block-local.js +42 -0
  22. package/dist/chat/ui/intelligent-ui/chart-data.d.ts +16 -0
  23. package/dist/chat/ui/intelligent-ui/chart-data.js +46 -0
  24. package/dist/chat/ui/intelligent-ui/node-text.d.ts +15 -0
  25. package/dist/chat/ui/intelligent-ui/node-text.js +106 -0
  26. package/dist/chat/ui/intelligent-ui/registry.d.ts +2 -0
  27. package/dist/chat/ui/intelligent-ui/registry.js +51 -0
  28. package/dist/chat/ui/intelligent-ui/render-context.d.ts +53 -0
  29. package/dist/chat/ui/intelligent-ui/render-context.js +3 -0
  30. package/dist/chat/ui/intelligent-ui/renderers/chart.d.ts +3 -0
  31. package/dist/chat/ui/intelligent-ui/renderers/chart.js +123 -0
  32. package/dist/chat/ui/intelligent-ui/renderers/choices.d.ts +4 -0
  33. package/dist/chat/ui/intelligent-ui/renderers/choices.js +45 -0
  34. package/dist/chat/ui/intelligent-ui/renderers/content.d.ts +14 -0
  35. package/dist/chat/ui/intelligent-ui/renderers/content.js +59 -0
  36. package/dist/chat/ui/intelligent-ui/renderers/data.d.ts +7 -0
  37. package/dist/chat/ui/intelligent-ui/renderers/data.js +80 -0
  38. package/dist/chat/ui/intelligent-ui/renderers/inputs.d.ts +8 -0
  39. package/dist/chat/ui/intelligent-ui/renderers/inputs.js +72 -0
  40. package/dist/chat/ui/intelligent-ui/renderers/links.d.ts +10 -0
  41. package/dist/chat/ui/intelligent-ui/renderers/links.js +87 -0
  42. package/dist/chat/ui/intelligent-ui/renderers/structure.d.ts +6 -0
  43. package/dist/chat/ui/intelligent-ui/renderers/structure.js +32 -0
  44. package/dist/chat/ui/intelligent-ui/renderers/text.d.ts +8 -0
  45. package/dist/chat/ui/intelligent-ui/renderers/text.js +61 -0
  46. package/dist/chat/ui/intelligent-ui/reply-parts.d.ts +9 -0
  47. package/dist/chat/ui/intelligent-ui/reply-parts.js +18 -0
  48. package/dist/chat/ui/intelligent-ui/table-data.d.ts +31 -0
  49. package/dist/chat/ui/intelligent-ui/table-data.js +79 -0
  50. package/dist/chat/ui/intelligent-ui/tones.d.ts +7 -0
  51. package/dist/chat/ui/intelligent-ui/tones.js +31 -0
  52. package/dist/chat/ui/intelligent-ui/use-later.d.ts +1 -0
  53. package/dist/chat/ui/intelligent-ui/use-later.js +16 -0
  54. package/dist/chat/ui/intelligent-ui/use-ui-links.d.ts +9 -0
  55. package/dist/chat/ui/intelligent-ui/use-ui-links.js +126 -0
  56. package/dist/chat/ui/intelligent-ui/use-ui-queries.d.ts +21 -0
  57. package/dist/chat/ui/intelligent-ui/use-ui-queries.js +272 -0
  58. package/dist/chat/ui/reply-context.d.ts +8 -0
  59. package/dist/chat/ui/reply-context.js +1 -0
  60. package/dist/chat/ui/rows/GeneratedImageRow.d.ts +5 -0
  61. package/dist/chat/ui/rows/GeneratedImageRow.js +121 -0
  62. package/dist/chat/ui/rows/MessageRows.js +21 -4
  63. package/dist/chat/ui/rows/Rows.js +4 -2
  64. package/dist/chat/ui/rows/SubagentRow.js +5 -0
  65. package/dist/chat/ui/rows/WorkRows.d.ts +4 -1
  66. package/dist/chat/ui/rows/WorkRows.js +4 -3
  67. package/dist/host.d.ts +11 -1
  68. package/dist/locales/en/agent-chat.json +101 -0
  69. package/dist/locales/nl/agent-chat.json +101 -0
  70. package/dist/state/chats.js +13 -0
  71. package/dist/theme.css +19 -0
  72. package/package.json +128 -7
  73. package/src/chat/logic/generated-image.ts +48 -0
  74. package/src/chat/logic/timeline-target.ts +41 -1
  75. package/src/chat/logic/timeline.ts +19 -10
  76. package/src/chat/subagent-conversation.ts +13 -2
  77. package/src/chat/timeline-flash.ts +5 -3
  78. package/src/chat/ui/ImageView.tsx +51 -8
  79. package/src/chat/ui/SubagentTimeline.tsx +24 -1
  80. package/src/chat/ui/Timeline.tsx +97 -21
  81. package/src/chat/ui/intelligent-ui/UiBlockFrame.tsx +219 -0
  82. package/src/chat/ui/intelligent-ui/UiFallbackPart.tsx +21 -0
  83. package/src/chat/ui/intelligent-ui/UiReply.tsx +541 -0
  84. package/src/chat/ui/intelligent-ui/block-local.ts +51 -0
  85. package/src/chat/ui/intelligent-ui/chart-data.ts +67 -0
  86. package/src/chat/ui/intelligent-ui/node-text.ts +119 -0
  87. package/src/chat/ui/intelligent-ui/registry.ts +53 -0
  88. package/src/chat/ui/intelligent-ui/render-context.ts +84 -0
  89. package/src/chat/ui/intelligent-ui/renderers/chart.tsx +319 -0
  90. package/src/chat/ui/intelligent-ui/renderers/choices.tsx +102 -0
  91. package/src/chat/ui/intelligent-ui/renderers/content.tsx +140 -0
  92. package/src/chat/ui/intelligent-ui/renderers/data.tsx +181 -0
  93. package/src/chat/ui/intelligent-ui/renderers/inputs.tsx +144 -0
  94. package/src/chat/ui/intelligent-ui/renderers/links.tsx +158 -0
  95. package/src/chat/ui/intelligent-ui/renderers/structure.tsx +84 -0
  96. package/src/chat/ui/intelligent-ui/renderers/text.tsx +124 -0
  97. package/src/chat/ui/intelligent-ui/reply-parts.ts +22 -0
  98. package/src/chat/ui/intelligent-ui/table-data.ts +104 -0
  99. package/src/chat/ui/intelligent-ui/tones.ts +37 -0
  100. package/src/chat/ui/intelligent-ui/use-later.ts +17 -0
  101. package/src/chat/ui/intelligent-ui/use-ui-links.ts +143 -0
  102. package/src/chat/ui/intelligent-ui/use-ui-queries.ts +308 -0
  103. package/src/chat/ui/reply-context.ts +7 -0
  104. package/src/chat/ui/rows/GeneratedImageRow.tsx +244 -0
  105. package/src/chat/ui/rows/MessageRows.tsx +60 -4
  106. package/src/chat/ui/rows/Rows.tsx +4 -2
  107. package/src/chat/ui/rows/SubagentRow.tsx +5 -0
  108. package/src/chat/ui/rows/WorkRows.tsx +20 -5
  109. package/src/host.ts +27 -1
  110. package/src/locales/en/agent-chat.json +101 -0
  111. package/src/locales/nl/agent-chat.json +101 -0
  112. package/src/state/chats.ts +13 -0
  113. package/src/theme.css +19 -0
@@ -435,6 +435,25 @@
435
435
  "zoomOut": "Uitzoomen",
436
436
  "reset": "Herstellen"
437
437
  },
438
+ "generatedImage": {
439
+ "label": "Gegenereerde afbeelding",
440
+ "generating": "Afbeelding wordt gemaakt",
441
+ "failed": "Afbeelding maken mislukt",
442
+ "empty": "De afbeelding kwam leeg terug",
443
+ "notImage": "Het resultaat is geen afbeelding",
444
+ "tooLarge": "De afbeelding is groter dan {{size}}",
445
+ "dimensions": "{{width}} × {{height}}",
446
+ "transparent": "transparant",
447
+ "actions": "Acties voor de afbeelding",
448
+ "more": "Meer acties",
449
+ "copyPrompt": "Prompt kopiëren",
450
+ "open": "Openen",
451
+ "openLarge": "Groot openen",
452
+ "save": "Opslaan in project…",
453
+ "saved": "Opgeslagen",
454
+ "savedTo": "Opgeslagen in <file>{{path}}</file>",
455
+ "renderFailed": "Deze afbeelding kon niet worden getoond"
456
+ },
438
457
  "account": {
439
458
  "pill": "{{provider}}-account {{account}}"
440
459
  },
@@ -460,5 +479,87 @@
460
479
  "code": {
461
480
  "actions": "Codeacties",
462
481
  "copyFailed": "De code kon niet worden gekopieerd. Probeer het opnieuw."
482
+ },
483
+ "blocks": {
484
+ "label": "Interactief blok",
485
+ "progress": {
486
+ "label": "Voortgang",
487
+ "of": "{{value}} van {{max}}"
488
+ },
489
+ "step": {
490
+ "done": "Klaar",
491
+ "running": "Bezig",
492
+ "pending": "Wacht",
493
+ "failed": "Mislukt",
494
+ "skipped": "Overgeslagen"
495
+ },
496
+ "stat": {
497
+ "change": "{{change}} vanaf {{previous}}",
498
+ "from": "vanaf {{previous}}"
499
+ },
500
+ "table": {
501
+ "label": "Tabel van {{columns}}",
502
+ "showAll": "Alle {{total}} rijen tonen"
503
+ },
504
+ "chart": {
505
+ "values": "Waarden",
506
+ "summary": "{{count}} waarden, hoogste {{label}} met {{value}}",
507
+ "summarySeries": "{{count}} categorieën, hoogste {{series}} bij {{label}} met {{value}}"
508
+ },
509
+ "image": {
510
+ "label": "Afbeelding",
511
+ "unavailable": "De afbeelding is niet beschikbaar"
512
+ },
513
+ "sources": "Bronnen",
514
+ "citation": "Bron {{number}}: {{title}}",
515
+ "outsideProject": "Buiten het project, als tekst getoond",
516
+ "options": "Opties",
517
+ "choices": "Keuzes",
518
+ "checklist": "Checklijst",
519
+ "choice": {
520
+ "waiting": "Beschikbaar zodra het antwoord klaar is",
521
+ "reading": "Beschikbaar zodra de live gegevens gelezen zijn",
522
+ "unavailable": "Niet beschikbaar",
523
+ "sent": "Verstuurd",
524
+ "queued": "In de wachtrij",
525
+ "failed": "Versturen lukte niet. Probeer het opnieuw.",
526
+ "ready": "De keuzes staan klaar"
527
+ },
528
+ "answered": "Beantwoord met “{{label}}”",
529
+ "chose": "Gekozen: “{{label}}”",
530
+ "choseOlder": "Gekozen: “{{label}}”, bij het antwoord van {{time}}",
531
+ "fixes_one": "{{count}} correctie",
532
+ "fixes_other": "{{count}} correcties",
533
+ "shownAsText": "Als tekst getoond",
534
+ "unknownComponent": "Deze versie kan {{component}} niet tekenen",
535
+ "renderFailed": "Dit deel kon niet getekend worden",
536
+ "unreadable": "Het blok kon niet gelezen worden",
537
+ "live": {
538
+ "label": "Live",
539
+ "read": "gelezen {{time}}",
540
+ "sources": "Leest {{sources}}",
541
+ "failed": "{{source}} lezen lukte niet",
542
+ "refused": "Geen toegang tot {{source}}",
543
+ "notRead": "Niet gelezen",
544
+ "reasons": {
545
+ "access-unavailable": "De toegang van de chat die dit schreef is niet meer beschikbaar.",
546
+ "block-stale": "Dit blok is veranderd sinds het getekend werd.",
547
+ "busy": "Er lezen nu te veel live blokken tegelijk.",
548
+ "link-unchecked": "Deze link moet opnieuw gecontroleerd worden.",
549
+ "link-unsupported": "Dit is geen link die de machine kan openen.",
550
+ "links-unsupported": "De machine opent geen links uit blokken.",
551
+ "no-unique-match": "De bron vond voor die naam niet precies één overeenkomst.",
552
+ "outside-project": "Dit valt buiten het project waarin de agent dit schreef.",
553
+ "query-undeclared": "Dit blok leest die bron niet.",
554
+ "refresh-limit": "Deze bron leest hooguit eens per tien seconden.",
555
+ "result-too-large": "Wat de bron teruggaf is te groot.",
556
+ "snapshot-too-large": "De eerste metingen waren te groot om te bewaren.",
557
+ "source-unregistered": "De machine kent deze bron niet.",
558
+ "stale-read": "Lees de bron opnieuw voordat je kiest.",
559
+ "target-unavailable": "Waar dit naar verwijst is niet meer beschikbaar.",
560
+ "timed-out": "De bron deed er te lang over om te antwoorden.",
561
+ "unreadable": "De bron kon niet gelezen worden."
562
+ }
563
+ }
463
564
  }
464
565
  }
@@ -159,6 +159,19 @@ export function applyEvent(state: ChatState, event: ChatEvent): ChatState {
159
159
  }
160
160
  case 'delta': {
161
161
  const item = state.items[event.itemId];
162
+ if (event.uiQueries && item?.kind === 'assistant') {
163
+ // The text first, as the daemon's thread applies it, then the metadata on what it grew into.
164
+ const { uiQueries, ...text } = event;
165
+ const grown = event.text === '' ? state : applyEvent(state, text);
166
+ const reply = grown.items[event.itemId] ?? item;
167
+ return { ...grown, items: { ...grown.items, [event.itemId]: { ...reply, uiQueries } as ChatItem } };
168
+ }
169
+ if (event.ui !== undefined && event.text === '') {
170
+ if (item?.kind === 'assistant' && item.streaming && event.textLength === item.text.length) {
171
+ return { ...state, items: { ...state.items, [event.itemId]: { ...item, ui: event.ui } } };
172
+ }
173
+ return state;
174
+ }
162
175
  if (item?.kind === 'assistant' || item?.kind === 'thinking') {
163
176
  const grown = { ...item, text: item.text + event.text };
164
177
  // The first text is structure after all, since an empty reply that is not streaming has no row.
package/src/theme.css CHANGED
@@ -117,6 +117,11 @@
117
117
  }
118
118
  @keyframes chat-shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }
119
119
 
120
+ /* What shows through a transparent image: a checkerboard of two grounds, so its edges read in both themes. */
121
+ .chat-checkerboard {
122
+ background: repeating-conic-gradient(var(--surface-sunken) 0 25%, var(--surface-raised) 0 50%) 0 0 / 16px 16px;
123
+ }
124
+
120
125
  /* A word of a reply that just arrived. The duration is REVEAL_FADE_MS in chat/ui/reveal.ts, which
121
126
  keeps the spans until it is over; ease-in-out, because ease-out jumps up and then trails. */
122
127
  .chat-fade { animation: chat-fade 300ms ease-in-out both; }
@@ -129,6 +134,20 @@
129
134
  @starting-style { opacity: 0; }
130
135
  }
131
136
  @keyframes chat-fade { from { opacity: 0; } to { opacity: 1; } }
137
+ /* A node of an intelligent UI block that lands inside another, such as a step or a row: 160ms like
138
+ the card's own children, but only a fade, so a parent arriving with its children rises once. */
139
+ .chat-ui-nodes > * {
140
+ transition: opacity 160ms ease-out;
141
+ @starting-style { opacity: 0; }
142
+ }
143
+ /* A value a live reading changed lights up in the accent once and settles back in 800ms. */
144
+ .chat-ui-changed { animation: chat-ui-changed 800ms ease-out; }
145
+ @keyframes chat-ui-changed { from { color: var(--accent); } }
146
+ @media (prefers-reduced-motion: reduce) {
147
+ .chat-ui-changed { animation: none; }
148
+ }
149
+ /* A source row a citation revealed. The row only takes focus from code, since its own button takes a click. */
150
+ .chat-ui-source:focus { animation: chat-flash 1600ms ease-out both; }
132
151
  /* A visual still on its way says so only once it takes long enough to be noticed. */
133
152
  .chat-visual-wait { animation: chat-fade 200ms ease-out 600ms both; }
134
153