@adecore/agents-react 0.69.1 → 0.70.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.
- package/dist/agents/provider-paths.js +3 -1
- package/dist/chat/activity.d.ts +2 -0
- package/dist/chat/activity.js +18 -4
- package/dist/chat/logic/fork.js +1 -0
- package/dist/chat/logic/thread-cards.js +1 -0
- package/dist/chat/logic/timeline.js +10 -0
- package/dist/chat/logic/tools.d.ts +1 -0
- package/dist/chat/logic/tools.js +4 -0
- package/dist/chat/ui/ChatActivity.js +20 -17
- package/dist/chat/ui/rows/MessageRows.d.ts +6 -2
- package/dist/chat/ui/rows/MessageRows.js +152 -48
- package/dist/chat/ui/rows/Rows.js +178 -161
- package/dist/chat/ui/rows/WorkRows.js +125 -112
- package/dist/chat/ui/rows/WorkflowRow.js +2 -2
- package/dist/chat/waiting-on.js +3 -3
- package/dist/host/timeline-row.d.ts +5 -1
- package/dist/locales/en/agent-chat.d.ts +10 -0
- package/dist/locales/en/agent-chat.js +10 -0
- package/dist/locales/nl/agent-chat.d.ts +10 -0
- package/dist/locales/nl/agent-chat.js +10 -0
- package/dist/theme.css +3 -0
- package/dist/usage/format.js +4 -2
- package/package.json +9 -9
- package/src/agents/provider-paths.ts +4 -1
- package/src/chat/activity.ts +21 -5
- package/src/chat/logic/fork.ts +1 -0
- package/src/chat/logic/thread-cards.ts +1 -0
- package/src/chat/logic/timeline.ts +8 -0
- package/src/chat/logic/tools.ts +5 -0
- package/src/chat/ui/ChatActivity.tsx +14 -8
- package/src/chat/ui/rows/MessageRows.tsx +26 -2
- package/src/chat/ui/rows/Rows.tsx +4 -1
- package/src/chat/ui/rows/WorkRows.tsx +5 -4
- package/src/chat/ui/rows/WorkflowRow.tsx +2 -2
- package/src/chat/waiting-on.ts +3 -6
- package/src/host/timeline-row.ts +3 -0
- package/src/locales/en/agent-chat.ts +10 -0
- package/src/locales/nl/agent-chat.ts +10 -0
- package/src/theme.css +3 -0
- package/src/usage/format.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adecore/agents-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.1",
|
|
4
4
|
"description": "React agent chat threads, composers, approvals, provider accounts and usage views.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -72,12 +72,12 @@
|
|
|
72
72
|
"test:visuals": "bun --config=integration.bunfig.toml --conditions=source test ./src/chat/visual-viewport.integration.test.ts"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@adecore/agent-contracts": "0.
|
|
76
|
-
"@adecore/editor": "0.
|
|
77
|
-
"@adecore/editor-react": "0.
|
|
78
|
-
"@adecore/intelligent-ui": "0.
|
|
79
|
-
"@adecore/merge": "0.
|
|
80
|
-
"@adecore/utils": "0.
|
|
75
|
+
"@adecore/agent-contracts": "0.70.1",
|
|
76
|
+
"@adecore/editor": "0.70.1",
|
|
77
|
+
"@adecore/editor-react": "0.70.1",
|
|
78
|
+
"@adecore/intelligent-ui": "0.70.1",
|
|
79
|
+
"@adecore/merge": "0.70.1",
|
|
80
|
+
"@adecore/utils": "0.70.1",
|
|
81
81
|
"@codemirror/commands": "^6.11.1",
|
|
82
82
|
"@codemirror/language": "^6.13.1",
|
|
83
83
|
"@codemirror/state": "^6.7.6",
|
|
@@ -101,14 +101,14 @@
|
|
|
101
101
|
"zustand": "^5.1.0"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
|
-
"@adecore/ui": "^0.
|
|
104
|
+
"@adecore/ui": "^0.70.1",
|
|
105
105
|
"i18next": "^26.4.2 || ^27.0.0",
|
|
106
106
|
"react": "^19.3.0",
|
|
107
107
|
"react-dom": "^19.3.0",
|
|
108
108
|
"react-i18next": "^17.0.15 || ^18.0.0"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
|
-
"@adecore/ui": "0.
|
|
111
|
+
"@adecore/ui": "0.70.1",
|
|
112
112
|
"@types/bun": "^1.4.4",
|
|
113
113
|
"@types/react": "^19.3.0",
|
|
114
114
|
"@types/react-dom": "^19.3.0",
|
|
@@ -21,7 +21,10 @@ export const PROVIDER_PATHS: Record<UsageProvider, string> = {
|
|
|
21
21
|
codex: 'M21.55 10.004a5.416 5.416 0 00-.478-4.501c-1.217-2.09-3.662-3.166-6.05-2.66A5.59 5.59 0 0010.831 1C8.39.995 6.224 2.546 5.473 4.838A5.553 5.553 0 001.76 7.496a5.487 5.487 0 00.691 6.5 5.416 5.416 0 00.477 4.502c1.217 2.09 3.662 3.165 6.05 2.66A5.586 5.586 0 0013.168 23c2.443.006 4.61-1.546 5.361-3.84a5.554 5.554 0 003.715-2.66 5.488 5.488 0 00-.693-6.497v.001zm-8.381 11.558a4.199 4.199 0 01-2.675-.954c.034-.018.093-.05.132-.074l4.44-2.53a.71.71 0 00.364-.623v-6.176l1.877 1.069c.02.01.033.029.036.05v5.115c-.003 2.274-1.87 4.118-4.174 4.123zM4.192 17.78a4.059 4.059 0 01-.498-2.763c.032.019.09.055.131.078l4.44 2.53c.225.13.504.13.73 0l5.42-3.088v2.138a.068.068 0 01-.027.057L9.9 19.288c-1.999 1.136-4.552.46-5.707-1.51h-.001zM3.023 8.216A4.15 4.15 0 015.198 6.41l-.002.151v5.06a.711.711 0 00.364.624l5.42 3.087-1.876 1.07a.067.067 0 01-.063.005l-4.489-2.559c-1.995-1.14-2.679-3.658-1.53-5.63h.001zm15.417 3.54l-5.42-3.088L14.896 7.6a.067.067 0 01.063-.006l4.489 2.557c1.998 1.14 2.683 3.662 1.529 5.633a4.163 4.163 0 01-2.174 1.807V12.38a.71.71 0 00-.363-.623zm1.867-2.773a6.04 6.04 0 00-.132-.078l-4.44-2.53a.731.731 0 00-.729 0l-5.42 3.088V7.325a.068.068 0 01.027-.057L14.1 4.713c2-1.137 4.555-.46 5.707 1.513.487.833.664 1.809.499 2.757h.001zm-11.741 3.81l-1.877-1.068a.065.065 0 01-.036-.051V6.559c.001-2.277 1.873-4.122 4.181-4.12.976 0 1.92.338 2.671.954-.034.018-.092.05-.131.073l-4.44 2.53a.71.71 0 00-.365.623l-.003 6.173v.001zm1.02-2.168L12 9.25l2.414 1.375v2.75L12 14.75l-2.415-1.375v-2.75z',
|
|
22
22
|
nanogpt: 'M5 20V4h2.6l8.8 11.2V4H19v16h-2.6L7.6 8.8V20z',
|
|
23
23
|
grok: 'M6.469 8.776 16.512 23h-4.464L2.005 8.776H6.47Zm-.004 7.9 2.233 3.164L6.467 23H2l4.465-6.324ZM22 2.582V23h-3.659V7.764L22 2.582ZM22 1l-9.952 14.095-2.233-3.163L17.533 1H22Z',
|
|
24
|
-
copilot: siGithubcopilot.path
|
|
24
|
+
copilot: siGithubcopilot.path,
|
|
25
|
+
// The mark Google lists in the ACP registry (`antigravity-acp/icon.svg`), scaled from 16 to 24 units.
|
|
26
|
+
antigravity:
|
|
27
|
+
'M21.2178 22.0227C22.4906 22.9773 24.3996 22.341 22.6496 20.591C17.3997 15.4999 18.5132 1.5 11.9905 1.5C5.4678 1.5 6.5814 15.4999 1.3314 20.591C-0.5777 22.5 1.4905 22.9773 2.7632 22.0227C7.695 18.6818 7.3769 12.7955 11.9905 12.7955C16.6041 12.7955 16.286 18.6818 21.2178 22.0227Z'
|
|
25
28
|
};
|
|
26
29
|
|
|
27
30
|
/* The CLIs drawn with the logo of the usage page rather than their agent mark. */
|
package/src/chat/activity.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
import { scheduledWakeupAt } from '@adecore/agent-contracts';
|
|
2
|
+
import { formatElapsedShort, formatMoment } from '@adecore/ui/format';
|
|
1
3
|
import i18next from 'i18next';
|
|
2
4
|
import type { ChatThreadInfo } from '../chat-sink';
|
|
3
5
|
|
|
4
6
|
/* A command or monitor as a client holds it; a newer host may run a kind this version does not know. */
|
|
5
7
|
export type ChatThreadBackgroundTask = NonNullable<ChatThreadInfo['background']>[number];
|
|
6
8
|
|
|
7
|
-
/* What a person reads for a task: what it does, else the command, else its kind. */
|
|
9
|
+
/* What a person reads for a task: what it does, else the command, else its kind. A wakeup reads as one in their words. */
|
|
8
10
|
export function backgroundTaskName(task: ChatThreadBackgroundTask): string {
|
|
11
|
+
if (scheduledWakeupAt(task) !== null) {
|
|
12
|
+
return i18next.t('agent-chat:activity.wakeup');
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
if (task.description || task.command) {
|
|
10
16
|
return task.description || task.command || '';
|
|
11
17
|
}
|
|
@@ -13,9 +19,19 @@ export function backgroundTaskName(task: ChatThreadBackgroundTask): string {
|
|
|
13
19
|
return task.kind === 'shell' || task.kind === 'monitor' ? i18next.t(`agent-chat:activity.${task.kind}`) : i18next.t('agent-chat:activity.other');
|
|
14
20
|
}
|
|
15
21
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
22
|
+
/* How long a task has run, or for a wakeup when it fires. */
|
|
23
|
+
export function backgroundTaskTime(task: ChatThreadBackgroundTask, now: number): string {
|
|
24
|
+
const wakesAt = scheduledWakeupAt(task);
|
|
25
|
+
|
|
26
|
+
return wakesAt === null
|
|
27
|
+
? formatElapsedShort(Math.max(0, now - task.startedAt))
|
|
28
|
+
: i18next.t('agent-chat:activity.wakesAt', { time: formatMoment(wakesAt, now) });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function backgroundCounts(tasks: readonly ChatThreadBackgroundTask[]): { shells: number; monitors: number; wakeups: number; others: number } {
|
|
32
|
+
const wakeups = tasks.filter((task) => scheduledWakeupAt(task) !== null).length;
|
|
33
|
+
const shells = tasks.filter((task) => task.kind === 'shell' && scheduledWakeupAt(task) === null).length;
|
|
34
|
+
const monitors = tasks.filter((task) => task.kind === 'monitor' && scheduledWakeupAt(task) === null).length;
|
|
19
35
|
|
|
20
|
-
return { shells, monitors, others: tasks.length - shells - monitors };
|
|
36
|
+
return { shells, monitors, wakeups, others: tasks.length - shells - monitors - wakeups };
|
|
21
37
|
}
|
package/src/chat/logic/fork.ts
CHANGED
|
@@ -207,6 +207,10 @@ export function agentTurnLabel(turn: ChatThreadTurn): string {
|
|
|
207
207
|
return about(i18next.t('agent-chat:turn.wokenByMessage', { count: turn.messageFrom.length }));
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
+
if (turn.wakeup === true) {
|
|
211
|
+
return i18next.t('agent-chat:activity.wakeup');
|
|
212
|
+
}
|
|
213
|
+
|
|
210
214
|
if (!turn.label) {
|
|
211
215
|
return i18next.t('agent-chat:turn.continued');
|
|
212
216
|
}
|
|
@@ -439,6 +443,10 @@ function rowsForItems(items: ChatThreadItem[], options: TimelineOptions, childre
|
|
|
439
443
|
...(item.postTokens === undefined ? {} : { postTokens: item.postTokens })
|
|
440
444
|
});
|
|
441
445
|
|
|
446
|
+
break;
|
|
447
|
+
case 'secret':
|
|
448
|
+
rows.push({ kind: 'secret', id: item.id, item });
|
|
449
|
+
|
|
442
450
|
break;
|
|
443
451
|
case 'unknown':
|
|
444
452
|
rows.push({ kind: 'unknown', id: item.id, item, waits: waitsOnTheHost(item) });
|
package/src/chat/logic/tools.ts
CHANGED
|
@@ -119,6 +119,11 @@ export function exitCodeOf(output: string): { code: number | null; rest: string
|
|
|
119
119
|
return { code: Number(match[1]), rest: output.slice(match[0].length) };
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
/* A call a person stopped ended in error without failing, so it reads as neutral. */
|
|
123
|
+
export function toolFailed(tool: ChatToolItem): boolean {
|
|
124
|
+
return tool.state === 'error' && tool.stopped !== true;
|
|
125
|
+
}
|
|
126
|
+
|
|
122
127
|
export function hasOutput(output: string | null): output is string {
|
|
123
128
|
return output !== null && output.trim() !== '';
|
|
124
129
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { taskIdOfRow, type ChatSubagentItem } from '@adecore/agent-contracts';
|
|
1
|
+
import { scheduledWakeupAt, taskIdOfRow, type ChatSubagentItem } from '@adecore/agent-contracts';
|
|
2
2
|
import { Icon, IconButton, Popover, ScrollArea, Surface, useNow } from '@adecore/ui';
|
|
3
|
-
import { formatElapsedShort } from '@adecore/ui/format';
|
|
4
3
|
import clsx from 'clsx';
|
|
5
|
-
import { Activity, MessageCircleQuestionMark, Square, SquareTerminal, TriangleAlert } from 'lucide-react';
|
|
4
|
+
import { Activity, Clock, MessageCircleQuestionMark, Square, SquareTerminal, TriangleAlert } from 'lucide-react';
|
|
6
5
|
import { useState, type ReactNode } from 'react';
|
|
7
6
|
import { useTranslation } from 'react-i18next';
|
|
8
7
|
import { useShallow } from 'zustand/shallow';
|
|
@@ -12,7 +11,7 @@ import { useHostTask, useHostTasks } from '../../host/host-hooks';
|
|
|
12
11
|
import { useChatScope } from '../../scope';
|
|
13
12
|
import { useChatRow, useChats } from '../../state/chats';
|
|
14
13
|
import { useChatActions } from '../actions';
|
|
15
|
-
import { backgroundCounts, backgroundTaskName, type ChatThreadBackgroundTask } from '../activity';
|
|
14
|
+
import { backgroundCounts, backgroundTaskName, backgroundTaskTime, type ChatThreadBackgroundTask } from '../activity';
|
|
16
15
|
import { badgeCountOf, entryTimeOf, flyoutSubagents, progressOf, statusWordOf, subagentTitle, summaryWordOf, taskRowStateOf } from '../subagent-list';
|
|
17
16
|
import { useSubagentSupport } from '../subagent-support';
|
|
18
17
|
import { canOpenSubagent, crumbOf, openFromMain, useSubagentTrail, type SubagentStep } from '../subagent-view';
|
|
@@ -64,7 +63,7 @@ export function ChatActivity({ chatId, workflows: showsWorkflows = true }: { cha
|
|
|
64
63
|
return null;
|
|
65
64
|
}
|
|
66
65
|
|
|
67
|
-
const { shells, monitors, others } = backgroundCounts(background);
|
|
66
|
+
const { shells, monitors, wakeups, others } = backgroundCounts(background);
|
|
68
67
|
const Slot = host.SubagentSlot;
|
|
69
68
|
const counting = progress.active > 0 && progress.total > 1;
|
|
70
69
|
|
|
@@ -97,10 +96,11 @@ export function ChatActivity({ chatId, workflows: showsWorkflows = true }: { cha
|
|
|
97
96
|
{workflows.length > 0 && <WorkflowFlyout chatId={chatId} calls={workflows} />}
|
|
98
97
|
{background.length > 0 && (
|
|
99
98
|
<Flyout
|
|
100
|
-
icon={<Icon icon={shells > 0 ? SquareTerminal : Activity} size={14} />}
|
|
99
|
+
icon={<Icon icon={shells > 0 ? SquareTerminal : wakeups === background.length ? Clock : Activity} size={14} />}
|
|
101
100
|
label={[
|
|
102
101
|
shells > 0 && t('activity.shells', { count: shells }),
|
|
103
102
|
monitors > 0 && t('activity.monitors', { count: monitors }),
|
|
103
|
+
wakeups > 0 && t('activity.wakeups', { count: wakeups }),
|
|
104
104
|
others > 0 && t('activity.others', { count: others })
|
|
105
105
|
]
|
|
106
106
|
.filter(Boolean)
|
|
@@ -273,10 +273,16 @@ function BackgroundTaskRows({ chatId, tasks }: { chatId: string; tasks: readonly
|
|
|
273
273
|
return tasks.map((task) => (
|
|
274
274
|
<ActivityRow
|
|
275
275
|
key={task.id}
|
|
276
|
-
icon={
|
|
276
|
+
icon={
|
|
277
|
+
<Icon
|
|
278
|
+
icon={scheduledWakeupAt(task) !== null ? Clock : task.kind === 'shell' ? SquareTerminal : Activity}
|
|
279
|
+
size={14}
|
|
280
|
+
className="shrink-0 text-text-faint"
|
|
281
|
+
/>
|
|
282
|
+
}
|
|
277
283
|
title={backgroundTaskName(task)}
|
|
278
284
|
detail={task.description ? task.command : null}
|
|
279
|
-
time={
|
|
285
|
+
time={backgroundTaskTime(task, now)}
|
|
280
286
|
>
|
|
281
287
|
<IconButton icon={Square} size="xs" label={t('activity.stop')} className="mr-1.5" onClick={() => stop(task.id)} />
|
|
282
288
|
</ActivityRow>
|
|
@@ -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,7 +21,9 @@ import {
|
|
|
20
21
|
ChevronDown,
|
|
21
22
|
CircleAlert,
|
|
22
23
|
CircleCheck,
|
|
24
|
+
CircleMinus,
|
|
23
25
|
CircleX,
|
|
26
|
+
Clock,
|
|
24
27
|
File,
|
|
25
28
|
Info,
|
|
26
29
|
MessageCircleQuestionMark,
|
|
@@ -739,14 +742,14 @@ function OpenChatButton({ chatId, label }: { chatId: string; label: 'openFork' |
|
|
|
739
742
|
* The header of a turn the agent started itself, in place of a message of the person. What the
|
|
740
743
|
* sub-agent came back with lives on its own row, which the header opens when the CLI named it.
|
|
741
744
|
*/
|
|
742
|
-
export function AgentTurnRow({ label, onOpen }: { label: string; onOpen?: () => void }) {
|
|
745
|
+
export function AgentTurnRow({ label, wakeup = false, onOpen }: { label: string; wakeup?: boolean; onOpen?: () => void }) {
|
|
743
746
|
const line = 'mb-0.5 flex h-7 w-full items-center gap-2 text-left text-xs text-text-muted';
|
|
744
747
|
|
|
745
748
|
// A header with nowhere to go is text to read and copy; one that opens a row is a button.
|
|
746
749
|
const content = (
|
|
747
750
|
<>
|
|
748
751
|
<span className={ROW_GUTTER}>
|
|
749
|
-
<Icon icon={Bot} size={12} />
|
|
752
|
+
<Icon icon={wakeup ? Clock : Bot} size={12} />
|
|
750
753
|
</span>
|
|
751
754
|
<span className={clsx('min-w-0 truncate', onOpen === undefined && 'select-text')}>{label}</span>
|
|
752
755
|
</>
|
|
@@ -840,6 +843,27 @@ export function ApprovalHistoryRow({ item }: { item: ChatApprovalItem }) {
|
|
|
840
843
|
);
|
|
841
844
|
}
|
|
842
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
|
+
|
|
843
867
|
export function QuestionHistoryRow({ item }: { item: ChatQuestionItem }) {
|
|
844
868
|
const { t } = useTranslation('agent-chat');
|
|
845
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,
|
|
@@ -61,7 +62,7 @@ export function Row({ row, chatId, toggleGroup, toggleTurn, toggleSubagent, open
|
|
|
61
62
|
case 'turn-start': {
|
|
62
63
|
const toolUseId = row.turn.taskToolUseId;
|
|
63
64
|
|
|
64
|
-
return <AgentTurnRow label={row.label} onOpen={toolUseId ? () => openSubagent(toolUseId) : undefined} />;
|
|
65
|
+
return <AgentTurnRow label={row.label} wakeup={row.turn.wakeup === true} onOpen={toolUseId ? () => openSubagent(toolUseId) : undefined} />;
|
|
65
66
|
}
|
|
66
67
|
case 'assistant':
|
|
67
68
|
return <AssistantRow chatId={chatId} item={row.item} />;
|
|
@@ -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':
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
readImagePath,
|
|
26
26
|
shellCommand,
|
|
27
27
|
toolCallLines,
|
|
28
|
+
toolFailed,
|
|
28
29
|
toolStartedAt,
|
|
29
30
|
toolSummary,
|
|
30
31
|
toolSummaryIsPath,
|
|
@@ -355,7 +356,7 @@ function DiffBody({ tool, entries, patched, chatId }: { tool: ChatToolItem; entr
|
|
|
355
356
|
className="max-h-64"
|
|
356
357
|
viewportClassName={clsx(
|
|
357
358
|
'whitespace-pre-wrap font-mono text-code select-text',
|
|
358
|
-
tool
|
|
359
|
+
toolFailed(tool) ? 'text-chat-removed' : 'text-chat-output'
|
|
359
360
|
)}
|
|
360
361
|
>
|
|
361
362
|
<OutputText text={text} whole={whole} stored={tool.outputRef !== undefined} />
|
|
@@ -376,7 +377,7 @@ function ToolOutput({ tool, chatId }: { tool: ChatToolItem; chatId: string | und
|
|
|
376
377
|
return null;
|
|
377
378
|
}
|
|
378
379
|
|
|
379
|
-
const failed = tool
|
|
380
|
+
const failed = toolFailed(tool);
|
|
380
381
|
const { code, rest } = failed ? exitCodeOf(text) : { code: null, rest: text };
|
|
381
382
|
|
|
382
383
|
return (
|
|
@@ -491,7 +492,7 @@ export function WorkRow({
|
|
|
491
492
|
path={detail === undefined && toolSummaryIsPath(tool.name, tool.input)}
|
|
492
493
|
open={open && opens}
|
|
493
494
|
onToggle={opens ? () => setOpen((o) => !o) : undefined}
|
|
494
|
-
failed={failed ?? tool
|
|
495
|
+
failed={failed ?? toolFailed(tool)}
|
|
495
496
|
time={tool.createdAt}
|
|
496
497
|
/>
|
|
497
498
|
{image !== null && ReadImage !== null && <ReadImage path={image} />}
|
|
@@ -578,7 +579,7 @@ export function WorkGroupRow({
|
|
|
578
579
|
const { t } = useTranslation('agent-chat');
|
|
579
580
|
const { commandLooks, toolLooks } = useChatHost();
|
|
580
581
|
const running = tools.filter((tool) => tool.state === 'running').length;
|
|
581
|
-
const failed = tools.filter(
|
|
582
|
+
const failed = tools.filter(toolFailed).length;
|
|
582
583
|
const latest = tools.findLast((tool) => tool.state === 'running');
|
|
583
584
|
|
|
584
585
|
return (
|
|
@@ -8,7 +8,7 @@ import { useChatHost } from '../../../host/host';
|
|
|
8
8
|
import { useChatScope } from '../../../scope';
|
|
9
9
|
import { useChats } from '../../../state/chats';
|
|
10
10
|
import { useChatActions } from '../../actions';
|
|
11
|
-
import { hasToolBody } from '../../logic/tools';
|
|
11
|
+
import { hasToolBody, toolFailed } from '../../logic/tools';
|
|
12
12
|
import { workflowCounts, workflowDescription, workflowPhases, type WorkflowCounts, type WorkflowPhaseView } from '../../logic/workflow';
|
|
13
13
|
import { useSubagentSupport } from '../../subagent-support';
|
|
14
14
|
import type { SubagentStep } from '../../subagent-view';
|
|
@@ -103,7 +103,7 @@ export function WorkflowRow({
|
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
|
|
106
|
-
const failed = tool
|
|
106
|
+
const failed = toolFailed(tool);
|
|
107
107
|
|
|
108
108
|
const header = (
|
|
109
109
|
<>
|
package/src/chat/waiting-on.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { formatMoment } from '@adecore/ui/format';
|
|
2
2
|
import i18next from 'i18next';
|
|
3
3
|
import type { ChatThreadInfo } from '../chat-sink';
|
|
4
|
-
import { backgroundTaskName, type ChatThreadBackgroundTask } from './activity';
|
|
4
|
+
import { backgroundTaskName, backgroundTaskTime, type ChatThreadBackgroundTask } from './activity';
|
|
5
5
|
|
|
6
6
|
/* An open task the chat delegated: whether its child waits out a limit, and that child's info where the client has it. */
|
|
7
7
|
export interface WaitingChild {
|
|
@@ -81,10 +81,7 @@ export function waitingOnLabel(waiting: WaitingOn, now: number): string {
|
|
|
81
81
|
case 'paused':
|
|
82
82
|
return waiting.until === undefined ? t('waitingOn.paused') : t('waitingOn.pausedUntil', { time: formatMoment(waiting.until, now) });
|
|
83
83
|
case 'command':
|
|
84
|
-
return t('waitingOn.command', {
|
|
85
|
-
command: backgroundTaskName(waiting.task),
|
|
86
|
-
age: formatElapsedShort(Math.max(0, now - waiting.task.startedAt))
|
|
87
|
-
});
|
|
84
|
+
return t('waitingOn.command', { command: backgroundTaskName(waiting.task), age: backgroundTaskTime(waiting.task, now) });
|
|
88
85
|
case 'background':
|
|
89
86
|
if (waiting.subagents === 0 && waiting.workflows === 0) {
|
|
90
87
|
return t('waitingOn.background');
|
package/src/host/timeline-row.ts
CHANGED
|
@@ -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',
|
|
@@ -495,6 +501,10 @@ export default {
|
|
|
495
501
|
other: 'Background task',
|
|
496
502
|
others_one: '{{count}} background task',
|
|
497
503
|
others_other: '{{count}} background tasks',
|
|
504
|
+
wakeup: 'Scheduled wakeup',
|
|
505
|
+
wakeups_one: '{{count}} scheduled wakeup',
|
|
506
|
+
wakeups_other: '{{count}} scheduled wakeups',
|
|
507
|
+
wakesAt: 'wakes at {{time}}',
|
|
498
508
|
stop: 'Stop',
|
|
499
509
|
stopFailed: 'Could not stop task'
|
|
500
510
|
},
|
|
@@ -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',
|
|
@@ -495,6 +501,10 @@ export default {
|
|
|
495
501
|
other: 'Achtergrondtaak',
|
|
496
502
|
others_one: '{{count}} achtergrondtaak',
|
|
497
503
|
others_other: '{{count}} achtergrondtaken',
|
|
504
|
+
wakeup: 'Geplande wekker',
|
|
505
|
+
wakeups_one: '{{count}} geplande wekker',
|
|
506
|
+
wakeups_other: '{{count}} geplande wekkers',
|
|
507
|
+
wakesAt: 'gaat af om {{time}}',
|
|
498
508
|
stop: 'Stoppen',
|
|
499
509
|
stopFailed: 'Kon de taak niet stoppen'
|
|
500
510
|
},
|
package/src/theme.css
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
--chart-copilot: #64748b;
|
|
18
18
|
--chart-nanogpt: #34c759;
|
|
19
19
|
--chart-grok: #ff2d55;
|
|
20
|
+
--chart-antigravity: #5856d6;
|
|
20
21
|
/* What a chat's context holds, one color per part; the rest is the system's and stays gray. */
|
|
21
22
|
--chart-context-tools: #4d7ce6;
|
|
22
23
|
--chart-context-files: #9a63e0;
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
--chart-copilot: #94a3b8;
|
|
46
47
|
--chart-nanogpt: #30d158;
|
|
47
48
|
--chart-grok: #ff375f;
|
|
49
|
+
--chart-antigravity: #5e5ce6;
|
|
48
50
|
--chart-context-tools: #8aa7f5;
|
|
49
51
|
--chart-context-files: #b98af3;
|
|
50
52
|
--chart-context-conversation: #6dd08b;
|
|
@@ -79,6 +81,7 @@
|
|
|
79
81
|
--color-chart-copilot: var(--chart-copilot);
|
|
80
82
|
--color-chart-nanogpt: var(--chart-nanogpt);
|
|
81
83
|
--color-chart-grok: var(--chart-grok);
|
|
84
|
+
--color-chart-antigravity: var(--chart-antigravity);
|
|
82
85
|
--color-chart-context-tools: var(--chart-context-tools);
|
|
83
86
|
--color-chart-context-files: var(--chart-context-files);
|
|
84
87
|
--color-chart-context-conversation: var(--chart-context-conversation);
|
package/src/usage/format.ts
CHANGED
|
@@ -32,7 +32,8 @@ export const PROVIDER_LABELS: Record<UsageProvider, string> = {
|
|
|
32
32
|
nanogpt: 'NanoGPT',
|
|
33
33
|
grok: 'Grok',
|
|
34
34
|
copilot: 'GitHub Copilot',
|
|
35
|
-
'anthropic-claude-api': 'Claude API'
|
|
35
|
+
'anthropic-claude-api': 'Claude API',
|
|
36
|
+
antigravity: 'Antigravity'
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
export const PROVIDER_COLORS: Record<UsageProvider, string> = {
|
|
@@ -41,7 +42,8 @@ export const PROVIDER_COLORS: Record<UsageProvider, string> = {
|
|
|
41
42
|
nanogpt: 'var(--chart-nanogpt)',
|
|
42
43
|
grok: 'var(--chart-grok)',
|
|
43
44
|
copilot: 'var(--chart-copilot)',
|
|
44
|
-
'anthropic-claude-api': 'var(--chart-claude-api)'
|
|
45
|
+
'anthropic-claude-api': 'var(--chart-claude-api)',
|
|
46
|
+
antigravity: 'var(--chart-antigravity)'
|
|
45
47
|
};
|
|
46
48
|
|
|
47
49
|
/*
|