@adecore/agents-react 0.48.1 → 0.48.3

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.
@@ -160,9 +160,9 @@ export function ToggleLine({
160
160
  }) {
161
161
  const classes = clsx(
162
162
  // Fix the width so long commands reach the truncation inside the negative margins.
163
- 'group/line -mx-1 mb-0.5 flex h-7 w-[calc(100%+8px)] items-center gap-2 rounded-md px-1 text-left text-xs text-text-muted',
163
+ 'group/line -mx-1 mb-0.5 flex h-7 w-[calc(100%+8px)] items-center gap-2 rounded-md px-1 text-left text-xs',
164
164
  onToggle !== undefined && 'hover:bg-surface-hover',
165
- failed && 'text-status-error',
165
+ failed ? 'text-status-error' : 'text-text-muted',
166
166
  className
167
167
  );
168
168
 
@@ -208,7 +208,7 @@ export function ToggleLine({
208
208
  }
209
209
 
210
210
  return (
211
- <button className={classes} onClick={onToggle}>
211
+ <button className={classes} onClick={onToggle} aria-expanded={open}>
212
212
  {content}
213
213
  </button>
214
214
  );
@@ -536,16 +536,23 @@ export function WorkGroupRow({
536
536
  expanded: boolean;
537
537
  onToggle(): void;
538
538
  }) {
539
+ const { t } = useTranslation('agent-chat');
540
+ const running = tools.filter((tool) => tool.state === 'running').length;
539
541
  const failed = tools.some((tool) => tool.state === 'error');
540
542
 
541
543
  return (
542
544
  <div>
543
545
  <ToggleLine
544
- icon={look === undefined ? toolIcon(tools[0]!.name) : <look.Mark size={12} />}
545
- label={look?.brand === undefined ? summary : withBrand(summary, [look.brand])}
546
+ icon={running > 0 ? <Spinner size={12} /> : look === undefined ? toolIcon(tools[0]!.name) : <look.Mark size={12} />}
547
+ label={
548
+ <span className="tabular-nums">
549
+ {running > 0 ? t('group.toolCalls', { count: tools.length }) : look?.brand === undefined ? summary : withBrand(summary, [look.brand])}
550
+ </span>
551
+ }
546
552
  open={expanded}
547
553
  onToggle={onToggle}
548
554
  failed={failed}
555
+ trailing={running > 0 && <span className="shrink-0 text-text-faint tabular-nums">{t('group.running', { count: running })}</span>}
549
556
  time={tools[0]!.createdAt}
550
557
  />
551
558
  </div>
package/src/host.ts CHANGED
@@ -522,6 +522,8 @@ export interface ChatHost {
522
522
  useThreadCards(scopeId: string, chatId: string): readonly ThreadCard[];
523
523
  /* A header over every reply with its author and how long ago it began; null names the agent for a screen reader only. */
524
524
  useReplyAuthor(scopeId: string, chatId: string): ReplyAuthor | null;
525
+ /* Who speaks in what the host told the agent in front of a prompt, drawn as a message under its name; left out, that stays a note. */
526
+ saidBy?: ReplyAuthor;
525
527
  /* The pages agents publish, drawn in the thread above their reply; null draws none. */
526
528
  visuals: VisualHost | null;
527
529
  /* Programs drawn as tools of their own; left out, every shell call reads as itself. */
@@ -259,6 +259,8 @@ export default {
259
259
  }
260
260
  },
261
261
  group: {
262
+ running_one: '{{count}} running',
263
+ running_other: '{{count}} running',
262
264
  tools: {
263
265
  Read_one: 'Read {{count}} file',
264
266
  Read_other: 'Read {{count}} files',
@@ -259,6 +259,8 @@ export default {
259
259
  }
260
260
  },
261
261
  group: {
262
+ running_one: '{{count}} actief',
263
+ running_other: '{{count}} actief',
262
264
  tools: {
263
265
  Read_one: '{{count}} bestand gelezen',
264
266
  Read_other: '{{count}} bestanden gelezen',