@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.
- package/dist/chat/logic/timeline.d.ts +1 -0
- package/dist/chat/logic/timeline.js +31 -43
- package/dist/chat/ui/rows/MessageRows.d.ts +2 -1
- package/dist/chat/ui/rows/MessageRows.js +223 -62
- package/dist/chat/ui/rows/Rows.js +31 -29
- package/dist/chat/ui/rows/WorkRows.js +103 -51
- package/dist/host.d.ts +1 -0
- package/dist/locales/en/agent-chat.d.ts +2 -0
- package/dist/locales/en/agent-chat.js +2 -0
- package/dist/locales/nl/agent-chat.d.ts +2 -0
- package/dist/locales/nl/agent-chat.js +2 -0
- package/package.json +8 -8
- package/src/chat/logic/timeline.ts +28 -27
- package/src/chat/ui/rows/MessageRows.tsx +67 -20
- package/src/chat/ui/rows/Rows.tsx +1 -1
- package/src/chat/ui/rows/WorkRows.tsx +12 -5
- package/src/host.ts +2 -0
- package/src/locales/en/agent-chat.ts +2 -0
- package/src/locales/nl/agent-chat.ts +2 -0
|
@@ -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
|
|
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
|
|
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={
|
|
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. */
|