@adecore/agents-react 0.70.0 → 0.71.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 (95) hide show
  1. package/dist/chat/logic/fork.js +1 -0
  2. package/dist/chat/logic/thread-cards.js +1 -0
  3. package/dist/chat/logic/timeline.js +7 -0
  4. package/dist/chat/ui/CodeBlock.d.ts +6 -1
  5. package/dist/chat/ui/CodeBlock.js +39 -23
  6. package/dist/chat/ui/intelligent-ui/UiReply.js +11 -2
  7. package/dist/chat/ui/intelligent-ui/key-caps.d.ts +1 -0
  8. package/dist/chat/ui/intelligent-ui/key-caps.js +45 -0
  9. package/dist/chat/ui/intelligent-ui/link-action.d.ts +9 -0
  10. package/dist/chat/ui/intelligent-ui/link-action.js +32 -0
  11. package/dist/chat/ui/intelligent-ui/node-text.js +1 -1
  12. package/dist/chat/ui/intelligent-ui/patch-clip.d.ts +4 -0
  13. package/dist/chat/ui/intelligent-ui/patch-clip.js +64 -0
  14. package/dist/chat/ui/intelligent-ui/registry.js +31 -5
  15. package/dist/chat/ui/intelligent-ui/render-context.d.ts +13 -0
  16. package/dist/chat/ui/intelligent-ui/renderers/alternatives.d.ts +6 -0
  17. package/dist/chat/ui/intelligent-ui/renderers/alternatives.js +296 -0
  18. package/dist/chat/ui/intelligent-ui/renderers/changes.d.ts +4 -0
  19. package/dist/chat/ui/intelligent-ui/renderers/changes.js +266 -0
  20. package/dist/chat/ui/intelligent-ui/renderers/chart.js +522 -371
  21. package/dist/chat/ui/intelligent-ui/renderers/content.d.ts +1 -1
  22. package/dist/chat/ui/intelligent-ui/renderers/content.js +94 -43
  23. package/dist/chat/ui/intelligent-ui/renderers/data.js +478 -245
  24. package/dist/chat/ui/intelligent-ui/renderers/diff.d.ts +4 -0
  25. package/dist/chat/ui/intelligent-ui/renderers/diff.js +427 -0
  26. package/dist/chat/ui/intelligent-ui/renderers/inputs.d.ts +1 -0
  27. package/dist/chat/ui/intelligent-ui/renderers/inputs.js +354 -110
  28. package/dist/chat/ui/intelligent-ui/renderers/keys.d.ts +3 -0
  29. package/dist/chat/ui/intelligent-ui/renderers/keys.js +60 -0
  30. package/dist/chat/ui/intelligent-ui/renderers/links.d.ts +13 -2
  31. package/dist/chat/ui/intelligent-ui/renderers/links.js +65 -85
  32. package/dist/chat/ui/intelligent-ui/renderers/meter.d.ts +4 -0
  33. package/dist/chat/ui/intelligent-ui/renderers/meter.js +371 -0
  34. package/dist/chat/ui/intelligent-ui/renderers/quote.d.ts +3 -0
  35. package/dist/chat/ui/intelligent-ui/renderers/quote.js +123 -0
  36. package/dist/chat/ui/intelligent-ui/renderers/radio.d.ts +3 -0
  37. package/dist/chat/ui/intelligent-ui/renderers/radio.js +205 -0
  38. package/dist/chat/ui/intelligent-ui/renderers/structure.d.ts +2 -0
  39. package/dist/chat/ui/intelligent-ui/renderers/structure.js +156 -45
  40. package/dist/chat/ui/intelligent-ui/renderers/text.js +365 -215
  41. package/dist/chat/ui/intelligent-ui/renderers/tree.d.ts +5 -0
  42. package/dist/chat/ui/intelligent-ui/renderers/tree.js +284 -0
  43. package/dist/chat/ui/intelligent-ui/table-data.d.ts +9 -2
  44. package/dist/chat/ui/intelligent-ui/table-data.js +68 -3
  45. package/dist/chat/ui/intelligent-ui/tones.d.ts +1 -1
  46. package/dist/chat/ui/intelligent-ui/tones.js +7 -7
  47. package/dist/chat/ui/intelligent-ui/use-ui-diffs.d.ts +4 -0
  48. package/dist/chat/ui/intelligent-ui/use-ui-diffs.js +201 -0
  49. package/dist/chat/ui/rows/MessageRows.d.ts +4 -1
  50. package/dist/chat/ui/rows/MessageRows.js +92 -1
  51. package/dist/chat/ui/rows/Rows.js +45 -31
  52. package/dist/host/host.d.ts +2 -1
  53. package/dist/host/timeline-row.d.ts +5 -1
  54. package/dist/locales/en/agent-chat.d.ts +62 -0
  55. package/dist/locales/en/agent-chat.js +63 -1
  56. package/dist/locales/nl/agent-chat.d.ts +62 -0
  57. package/dist/locales/nl/agent-chat.js +63 -1
  58. package/dist/theme.css +6 -0
  59. package/package.json +9 -9
  60. package/src/chat/logic/fork.ts +1 -0
  61. package/src/chat/logic/thread-cards.ts +1 -0
  62. package/src/chat/logic/timeline.ts +4 -0
  63. package/src/chat/ui/CodeBlock.tsx +38 -18
  64. package/src/chat/ui/intelligent-ui/UiReply.tsx +13 -2
  65. package/src/chat/ui/intelligent-ui/key-caps.ts +51 -0
  66. package/src/chat/ui/intelligent-ui/link-action.ts +32 -0
  67. package/src/chat/ui/intelligent-ui/node-text.ts +1 -0
  68. package/src/chat/ui/intelligent-ui/patch-clip.ts +83 -0
  69. package/src/chat/ui/intelligent-ui/registry.ts +31 -4
  70. package/src/chat/ui/intelligent-ui/render-context.ts +21 -0
  71. package/src/chat/ui/intelligent-ui/renderers/alternatives.tsx +76 -0
  72. package/src/chat/ui/intelligent-ui/renderers/changes.tsx +97 -0
  73. package/src/chat/ui/intelligent-ui/renderers/chart.tsx +122 -46
  74. package/src/chat/ui/intelligent-ui/renderers/content.tsx +27 -7
  75. package/src/chat/ui/intelligent-ui/renderers/data.tsx +165 -52
  76. package/src/chat/ui/intelligent-ui/renderers/diff.tsx +144 -0
  77. package/src/chat/ui/intelligent-ui/renderers/inputs.tsx +111 -19
  78. package/src/chat/ui/intelligent-ui/renderers/keys.tsx +26 -0
  79. package/src/chat/ui/intelligent-ui/renderers/links.tsx +40 -24
  80. package/src/chat/ui/intelligent-ui/renderers/meter.tsx +105 -0
  81. package/src/chat/ui/intelligent-ui/renderers/quote.tsx +29 -0
  82. package/src/chat/ui/intelligent-ui/renderers/radio.tsx +130 -0
  83. package/src/chat/ui/intelligent-ui/renderers/structure.tsx +54 -7
  84. package/src/chat/ui/intelligent-ui/renderers/text.tsx +70 -36
  85. package/src/chat/ui/intelligent-ui/renderers/tree.tsx +85 -0
  86. package/src/chat/ui/intelligent-ui/table-data.ts +84 -6
  87. package/src/chat/ui/intelligent-ui/tones.ts +7 -7
  88. package/src/chat/ui/intelligent-ui/use-ui-diffs.ts +119 -0
  89. package/src/chat/ui/rows/MessageRows.tsx +23 -0
  90. package/src/chat/ui/rows/Rows.tsx +3 -0
  91. package/src/host/host.ts +4 -0
  92. package/src/host/timeline-row.ts +3 -0
  93. package/src/locales/en/agent-chat.ts +63 -1
  94. package/src/locales/nl/agent-chat.ts +63 -1
  95. package/src/theme.css +6 -0
@@ -4,6 +4,7 @@ import type {
4
4
  ChatAssistantItem,
5
5
  ChatNoteMessage,
6
6
  ChatQuestionItem,
7
+ ChatSecretItem,
7
8
  ChatThinkingItem,
8
9
  ChatToolItem,
9
10
  ChatUiChoiceOrigin,
@@ -20,6 +21,7 @@ import {
20
21
  ChevronDown,
21
22
  CircleAlert,
22
23
  CircleCheck,
24
+ CircleMinus,
23
25
  CircleX,
24
26
  Clock,
25
27
  File,
@@ -841,6 +843,27 @@ export function ApprovalHistoryRow({ item }: { item: ChatApprovalItem }) {
841
843
  );
842
844
  }
843
845
 
846
+ const SECRET_ICON: Record<ChatSecretItem['outcome'], ReactNode> = {
847
+ saved: <Icon icon={CircleCheck} size={12} className="text-positive" />,
848
+ declined: <Icon icon={CircleMinus} size={12} />,
849
+ 'timed-out': <Icon icon={Clock} size={12} />,
850
+ cancelled: <Icon icon={CircleX} size={12} />
851
+ };
852
+
853
+ /* What became of a request for a secret, one quiet line; the card that asked for it lived elsewhere and the value is never here. */
854
+ export function SecretRow({ item }: { item: ChatSecretItem }) {
855
+ const { t } = useTranslation('agent-chat');
856
+
857
+ return (
858
+ <div data-find-item={item.id} className="-mx-1 mb-0.5 flex h-7 items-center gap-2 px-1 text-xs text-text-faint">
859
+ <span className={ROW_GUTTER}>{SECRET_ICON[item.outcome]}</span>
860
+ <span data-find-field="summary" className="min-w-0 truncate select-text">
861
+ <span className="text-text-muted">{item.label}</span> · {t(`rows.secret.${item.outcome}`)}
862
+ </span>
863
+ </div>
864
+ );
865
+ }
866
+
844
867
  export function QuestionHistoryRow({ item }: { item: ChatQuestionItem }) {
845
868
  const { t } = useTranslation('agent-chat');
846
869
 
@@ -15,6 +15,7 @@ import {
15
15
  NoteRow,
16
16
  QuestionHistoryRow,
17
17
  ReportRow,
18
+ SecretRow,
18
19
  SelectionSwitchRow,
19
20
  SentByAgentRow,
20
21
  SentMessageRow,
@@ -118,6 +119,8 @@ export function Row({ row, chatId, toggleGroup, toggleTurn, toggleSubagent, open
118
119
  return <SentByAgentRow chatId={chatId} id={row.id} tool={row.tool} sent={row.sent} />;
119
120
  case 'compaction':
120
121
  return <CompactionRow preTokens={row.preTokens} postTokens={row.postTokens} />;
122
+ case 'secret':
123
+ return <SecretRow item={row.item} />;
121
124
  case 'unknown':
122
125
  return <UnknownRow id={row.id} waits={row.waits} />;
123
126
  case 'selection-switch':
package/src/host/host.ts CHANGED
@@ -6,6 +6,8 @@ import type {
6
6
  ChatGoalAction,
7
7
  ChatSubagentItem,
8
8
  ChatUiChoicePayload,
9
+ ChatUiDiffPayload,
10
+ ChatUiDiffReading,
9
11
  ChatUiQueryPayload,
10
12
  ChatUiQueryReading,
11
13
  ChatUiLinkPayload,
@@ -543,6 +545,8 @@ export interface ChatHost {
543
545
  subscribe?(scopeId: string, chatId: string, changed: () => void): () => void;
544
546
  link?(scopeId: string, payload: ChatUiLinkPayload): Promise<ChatUiLinkReading>;
545
547
  openLink?(scopeId: string, reading: ChatUiLinkReading): void;
548
+ /* The change of the file an open Diff names, read from git; left out, an open Diff stays the chip a closed one is. */
549
+ diff?(scopeId: string, payload: ChatUiDiffPayload): Promise<ChatUiDiffReading>;
546
550
  openUrl?(scopeId: string, url: string): void;
547
551
  query?(scopeId: string, payload: ChatUiQueryPayload): Promise<ChatUiQueryReading>;
548
552
  sendChoice(scopeId: string, payload: ChatUiChoicePayload): Promise<'sent' | 'queued'>;
@@ -4,6 +4,7 @@ import type {
4
4
  ChatCheckpointDiff,
5
5
  ChatNoteMessage,
6
6
  ChatQuestionItem,
7
+ ChatSecretItem,
7
8
  ChatSubagentItem,
8
9
  ChatThinkingItem,
9
10
  ChatToolItem,
@@ -63,6 +64,8 @@ export type TimelineRow =
63
64
  // A message this chat's agent sent another node with a command of a look, drawn as said instead of as its call.
64
65
  | { kind: 'sent'; id: string; tool: ChatToolItem; sent: CommandLookSent }
65
66
  | { kind: 'compaction'; id: string; preTokens: number | null; postTokens?: number }
67
+ // What became of a request for a secret; the value never reaches the thread.
68
+ | { kind: 'secret'; id: string; item: ChatSecretItem }
66
69
  // An item of a newer host this version cannot read, one muted line with nothing to act on; `waits` for a request that still does.
67
70
  | { kind: 'unknown'; id: string; item: ChatUnknownItem; waits: boolean }
68
71
  // The turn below ran on another model or effort than the turn before it.
@@ -192,6 +192,12 @@ export default {
192
192
  notAnswered: '(not answered)',
193
193
  dismissed: '(dismissed)'
194
194
  },
195
+ secret: {
196
+ saved: 'Saved',
197
+ declined: 'Declined',
198
+ 'timed-out': 'Not answered in time',
199
+ cancelled: 'No longer needed'
200
+ },
195
201
  subagent: {
196
202
  task: 'Task',
197
203
  label: 'Sub-agent',
@@ -712,12 +718,67 @@ export default {
712
718
  },
713
719
  stat: {
714
720
  change: '{{change}} from {{previous}}',
715
- from: 'from {{previous}}'
721
+ from: 'from {{previous}}',
722
+ trend: 'Trend from {{first}} to {{last}}'
723
+ },
724
+ node: {
725
+ status: {
726
+ running: 'Running',
727
+ needsYou: 'Needs you',
728
+ done: 'Done'
729
+ }
730
+ },
731
+ meter: {
732
+ label: 'Meter',
733
+ reading: '{{value}} of {{max}}',
734
+ of: 'of {{max}}',
735
+ mark: 'mark at {{mark}}'
736
+ },
737
+ parts: {
738
+ label: 'Parts of the whole',
739
+ part: '{{label}}: {{value}}, {{share}}'
716
740
  },
717
741
  table: {
718
742
  label: 'Table of {{columns}}',
719
743
  showAll: 'Show all {{total}} rows'
720
744
  },
745
+ changes: {
746
+ label_one: '{{count}} changed file',
747
+ label_other: '{{count}} changed files',
748
+ added_one: '{{count}} line added',
749
+ added_other: '{{count}} lines added',
750
+ removed_one: '{{count}} line removed',
751
+ removed_other: '{{count}} lines removed',
752
+ state: {
753
+ added: 'New',
754
+ modified: 'Changed',
755
+ deleted: 'Deleted',
756
+ renamed: 'Renamed'
757
+ }
758
+ },
759
+ diff: {
760
+ label: 'Changes in {{path}}',
761
+ unchanged: 'No changes',
762
+ partial: 'Only the first lines are shown.',
763
+ showAll: 'Open the whole diff',
764
+ unavailable: 'Could not read this diff'
765
+ },
766
+ alternatives: {
767
+ label_one: '{{count}} option',
768
+ label_other: '{{count}} options',
769
+ recommended: 'Recommended',
770
+ pro: 'For:',
771
+ con: 'Against:'
772
+ },
773
+ tree: {
774
+ label: 'Tree'
775
+ },
776
+ numberField: {
777
+ between: 'A number from {{min}} to {{max}}',
778
+ atLeast: 'A number of at least {{min}}',
779
+ atMost: 'A number of at most {{max}}',
780
+ number: 'A number'
781
+ },
721
782
  chart: {
722
783
  values: 'Values',
723
784
  summary: '{{count}} values, highest {{label}} at {{value}}',
@@ -806,6 +867,7 @@ export default {
806
867
  'access-unavailable': 'The chat that made this no longer has access.',
807
868
  'block-stale': 'This block changed since it was drawn.',
808
869
  busy: 'Too many live blocks reading.',
870
+ 'diffs-unsupported': 'The machine does not show diffs in blocks.',
809
871
  'link-unchecked': 'This link has to be checked again.',
810
872
  'link-unsupported': 'The machine cannot open this link.',
811
873
  'links-unsupported': 'The machine does not open links from blocks.',
@@ -192,6 +192,12 @@ export default {
192
192
  notAnswered: '(niet beantwoord)',
193
193
  dismissed: '(weggeklikt)'
194
194
  },
195
+ secret: {
196
+ saved: 'Opgeslagen',
197
+ declined: 'Geweigerd',
198
+ 'timed-out': 'Niet op tijd beantwoord',
199
+ cancelled: 'Niet meer nodig'
200
+ },
195
201
  subagent: {
196
202
  task: 'Taak',
197
203
  label: 'Sub-agent',
@@ -712,12 +718,67 @@ export default {
712
718
  },
713
719
  stat: {
714
720
  change: '{{change}} vanaf {{previous}}',
715
- from: 'vanaf {{previous}}'
721
+ from: 'vanaf {{previous}}',
722
+ trend: 'Verloop van {{first}} naar {{last}}'
723
+ },
724
+ node: {
725
+ status: {
726
+ running: 'Bezig',
727
+ needsYou: 'Wacht op jou',
728
+ done: 'Klaar'
729
+ }
730
+ },
731
+ meter: {
732
+ label: 'Meter',
733
+ reading: '{{value}} van {{max}}',
734
+ of: 'van {{max}}',
735
+ mark: 'markering bij {{mark}}'
736
+ },
737
+ parts: {
738
+ label: 'Delen van het geheel',
739
+ part: '{{label}}: {{value}}, {{share}}'
716
740
  },
717
741
  table: {
718
742
  label: 'Tabel van {{columns}}',
719
743
  showAll: 'Alle {{total}} rijen tonen'
720
744
  },
745
+ changes: {
746
+ label_one: '{{count}} gewijzigd bestand',
747
+ label_other: '{{count}} gewijzigde bestanden',
748
+ added_one: '{{count}} regel toegevoegd',
749
+ added_other: '{{count}} regels toegevoegd',
750
+ removed_one: '{{count}} regel verwijderd',
751
+ removed_other: '{{count}} regels verwijderd',
752
+ state: {
753
+ added: 'Nieuw',
754
+ modified: 'Gewijzigd',
755
+ deleted: 'Verwijderd',
756
+ renamed: 'Hernoemd'
757
+ }
758
+ },
759
+ diff: {
760
+ label: 'Wijzigingen in {{path}}',
761
+ unchanged: 'Geen wijzigingen',
762
+ partial: 'Alleen de eerste regels staan hier.',
763
+ showAll: 'Hele diff openen',
764
+ unavailable: 'Kon deze diff niet lezen'
765
+ },
766
+ alternatives: {
767
+ label_one: '{{count}} optie',
768
+ label_other: '{{count}} opties',
769
+ recommended: 'Aanbevolen',
770
+ pro: 'Voor:',
771
+ con: 'Tegen:'
772
+ },
773
+ tree: {
774
+ label: 'Boom'
775
+ },
776
+ numberField: {
777
+ between: 'Een getal van {{min}} tot en met {{max}}',
778
+ atLeast: 'Een getal van minstens {{min}}',
779
+ atMost: 'Een getal van hoogstens {{max}}',
780
+ number: 'Een getal'
781
+ },
721
782
  chart: {
722
783
  values: 'Waarden',
723
784
  summary: '{{count}} waarden, hoogste {{label}} met {{value}}',
@@ -806,6 +867,7 @@ export default {
806
867
  'access-unavailable': 'De chat die dit maakte heeft geen toegang meer.',
807
868
  'block-stale': 'Dit blok is veranderd sinds het getekend werd.',
808
869
  busy: 'Er lezen te veel live blokken tegelijk.',
870
+ 'diffs-unsupported': 'De machine toont geen diffs in blokken.',
809
871
  'link-unchecked': 'Deze link moet opnieuw gecontroleerd worden.',
810
872
  'link-unsupported': 'De machine kan deze link niet openen.',
811
873
  'links-unsupported': 'De machine opent geen links uit blokken.',
package/src/theme.css CHANGED
@@ -275,6 +275,12 @@
275
275
  .chat-ui-section-body .chat-ui-flat thead { background-color: var(--chat-ui-tile); }
276
276
  .chat-code pre { margin: 0; padding: round(0.625rem, 1px) round(0.75rem, 1px); user-select: text; background: transparent !important; font-family: var(--font-mono); font-size: var(--text-code); line-height: var(--text-code--line-height); }
277
277
  .chat-code code { font-family: inherit; }
278
+ /* Numbered or marked lines each fill the width, so a mark is a band from edge to edge: the padding moves from the block
279
+ onto its lines. A number is generated content, which a selection never copies. */
280
+ .chat-code pre[data-lined] { padding-inline: 0; }
281
+ .chat-code pre[data-lined] .line { display: inline-block; box-sizing: border-box; min-width: 100%; vertical-align: top; min-height: 1lh; padding-inline: round(0.75rem, 1px); }
282
+ .chat-code pre[data-lined] .line[data-line]::before { content: attr(data-line); display: inline-block; width: calc(var(--chat-code-digits, 1) * 1ch); margin-right: round(0.75rem, 1px); color: var(--text-faint); text-align: right; user-select: none; }
283
+ .chat-code pre[data-lined] .line[data-marked] { background: var(--accent-soft); }
278
284
  .chat-code-actions { position: absolute; top: 4px; right: 4px; border-radius: 6px; background: var(--surface-raised); color: var(--text-muted); box-shadow: 0 0 0 1px var(--border); }
279
285
  .chat-code-error { margin: 0; padding: 0 12px 10px; color: var(--status-error); font-size: var(--text-sm); }
280
286
  @media (hover: hover) and (pointer: fine) {