@koinzhang/paseo-plugin-activity 0.5.0 → 0.7.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.
- package/CHANGELOG.md +78 -1
- package/README.md +15 -8
- package/client/activity-heatmap.tsx +126 -93
- package/client/agent-creations.tsx +216 -0
- package/client/attention-pill.tsx +16 -5
- package/client/attention-popover.tsx +19 -23
- package/client/color-mix.test.ts +27 -0
- package/client/color-mix.ts +38 -0
- package/client/design-tokens.test.ts +39 -0
- package/client/design-tokens.ts +168 -0
- package/client/fit-text.test.ts +41 -0
- package/client/fit-text.ts +33 -0
- package/client/formatted-time.tsx +4 -4
- package/client/global-surface.tsx +316 -275
- package/client/header-button.ts +136 -0
- package/client/hourly-activity-timeline.tsx +425 -0
- package/client/measured-width.ts +72 -0
- package/client/panel-visibility.test.ts +25 -0
- package/client/panel-visibility.ts +45 -0
- package/client/panel.tsx +83 -108
- package/client/provider-dropdown.tsx +131 -0
- package/client/provider-filter.test.ts +17 -13
- package/client/provider-filter.ts +5 -7
- package/client/range.test.ts +44 -0
- package/client/range.ts +14 -0
- package/client/rank-color.test.ts +108 -14
- package/client/rank-color.ts +261 -48
- package/client/ranking-bars.tsx +291 -0
- package/client/ui.tsx +339 -0
- package/client/usage-popover.tsx +62 -134
- package/client/usage-stats.tsx +137 -8
- package/client/use-agent-turn-end.ts +2 -1
- package/client/use-app-language.ts +17 -0
- package/client/web.ts +73 -18
- package/client/workspace/agent-row.tsx +18 -25
- package/client/workspace/agents-section.tsx +23 -20
- package/client/workspace/constants.ts +6 -6
- package/client/workspace/display-menu.tsx +5 -4
- package/client/workspace/filters.test.ts +1 -1
- package/client/workspace/filters.ts +4 -2
- package/client/workspace/panel.tsx +176 -104
- package/client/workspace/rank-section.tsx +157 -44
- package/client/workspace/terminals-section.tsx +13 -9
- package/index.client.tsx +40 -20
- package/index.server.ts +63 -31
- package/package.json +2 -2
- package/paseo-plugin.json +2 -1
- package/server/agents.ts +20 -2
- package/server/background-sync.test.ts +43 -0
- package/server/background-sync.ts +43 -4
- package/server/handlers-query.test.ts +252 -1
- package/server/handlers.ts +174 -13
- package/server/ingest.test.ts +8 -0
- package/server/messages.test.ts +96 -1
- package/server/prompt-dedupe.ts +52 -0
- package/server/rpc-cache.test.ts +74 -0
- package/server/rpc-cache.ts +48 -0
- package/server/store.test.ts +122 -0
- package/server/store.ts +313 -19
- package/server/ttl-cache.ts +3 -0
- package/shared/activity.test.ts +159 -6
- package/shared/activity.ts +140 -5
- package/shared/classify.test.ts +1 -0
- package/shared/classify.ts +4 -1
- package/shared/explorer-agent-display.test.ts +61 -0
- package/shared/explorer-agent-display.ts +21 -2
- package/shared/format.test.ts +28 -3
- package/shared/format.ts +25 -2
- package/shared/i18n.test.ts +34 -0
- package/shared/i18n.ts +363 -0
- package/shared/insights.test.ts +162 -80
- package/shared/insights.ts +136 -61
- package/shared/usage.test.ts +330 -0
- package/shared/usage.ts +471 -0
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
} from "react-native";
|
|
12
12
|
import type { AgentAttentionKind, WorkspaceTheme } from "./constants.ts";
|
|
13
13
|
import { RunningIndicator } from "./running-indicator.tsx";
|
|
14
|
+
import { CONTROL, ICON_SIZE } from "../design-tokens.ts";
|
|
15
|
+
import { useMessages } from "../use-app-language.ts";
|
|
14
16
|
|
|
15
17
|
export type AgentRowStyles = {
|
|
16
18
|
agentListRow: ViewStyle;
|
|
@@ -60,6 +62,7 @@ export function AgentRow({
|
|
|
60
62
|
/** Omit to hide the archive control (attention popover). */
|
|
61
63
|
onArchiveToggle?: () => void;
|
|
62
64
|
}): ReactNode {
|
|
65
|
+
const m = useMessages();
|
|
63
66
|
const [hovered, setHovered] = useState(false);
|
|
64
67
|
// Web: hover-reveal. Native has no hover — keep the action visible.
|
|
65
68
|
// mouseenter/leave (not nested Pressable hover) so title/action don't flicker.
|
|
@@ -81,17 +84,11 @@ export function AgentRow({
|
|
|
81
84
|
? theme.colors.statusSuccess
|
|
82
85
|
: theme.colors.foregroundMuted;
|
|
83
86
|
const stateLabels: string[] = [];
|
|
84
|
-
if (!archived && running) stateLabels.push(
|
|
85
|
-
if (subAgentCount > 0)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (
|
|
89
|
-
stateLabels.push(
|
|
90
|
-
permissionCount === 1 ? "1 pending permission" : `${permissionCount} pending permissions`,
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
if (!archived && attentionKind === "error") stateLabels.push("failed");
|
|
94
|
-
if (!archived && attentionKind === "finished") stateLabels.push("turn finished, unread");
|
|
87
|
+
if (!archived && running) stateLabels.push(m.workspace.state.running);
|
|
88
|
+
if (subAgentCount > 0) stateLabels.push(m.workspace.state.subagents(subAgentCount));
|
|
89
|
+
if (permissionCount > 0) stateLabels.push(m.workspace.state.permissions(permissionCount));
|
|
90
|
+
if (!archived && attentionKind === "error") stateLabels.push(m.workspace.state.failed);
|
|
91
|
+
if (!archived && attentionKind === "finished") stateLabels.push(m.workspace.state.finished);
|
|
95
92
|
const stateSuffix = stateLabels.length > 0 ? `, ${stateLabels.join(", ")}` : "";
|
|
96
93
|
const showRunning = running && !archived;
|
|
97
94
|
const showSubAgentCount = !showRunning && subAgentCount > 0;
|
|
@@ -102,7 +99,7 @@ export function AgentRow({
|
|
|
102
99
|
<View style={styles.agentIconWrap}>
|
|
103
100
|
<Icon
|
|
104
101
|
name={archived ? "BotOff" : "Bot"}
|
|
105
|
-
size={
|
|
102
|
+
size={ICON_SIZE.leading}
|
|
106
103
|
color={botColor}
|
|
107
104
|
/>
|
|
108
105
|
{showRunning ? (
|
|
@@ -111,9 +108,7 @@ export function AgentRow({
|
|
|
111
108
|
</View>
|
|
112
109
|
) : showSubAgentCount ? (
|
|
113
110
|
<View
|
|
114
|
-
accessibilityLabel={
|
|
115
|
-
subAgentCount === 1 ? "1 subagent" : `${subAgentCount} subagents`
|
|
116
|
-
}
|
|
111
|
+
accessibilityLabel={m.workspace.state.subagents(subAgentCount)}
|
|
117
112
|
style={styles.subAgentBadge}
|
|
118
113
|
>
|
|
119
114
|
<Text style={styles.subAgentBadgeText}>{subAgentLabel}</Text>
|
|
@@ -132,12 +127,10 @@ export function AgentRow({
|
|
|
132
127
|
</View>
|
|
133
128
|
{permissionCount > 0 ? (
|
|
134
129
|
<View
|
|
135
|
-
accessibilityLabel={
|
|
136
|
-
permissionCount === 1 ? "1 pending permission" : `${permissionCount} pending permissions`
|
|
137
|
-
}
|
|
130
|
+
accessibilityLabel={m.workspace.state.permissions(permissionCount)}
|
|
138
131
|
style={styles.permissionBadge}
|
|
139
132
|
>
|
|
140
|
-
<Icon name="ShieldAlert" size={
|
|
133
|
+
<Icon name="ShieldAlert" size={ICON_SIZE.badge} color={theme.colors.statusWarning} />
|
|
141
134
|
{permissionCount > 1 ? (
|
|
142
135
|
<Text style={styles.permissionBadgeText}>{permissionCount}</Text>
|
|
143
136
|
) : null}
|
|
@@ -146,24 +139,24 @@ export function AgentRow({
|
|
|
146
139
|
{onArchiveToggle ? (
|
|
147
140
|
<Pressable
|
|
148
141
|
accessibilityRole="button"
|
|
149
|
-
accessibilityLabel={archived ?
|
|
142
|
+
accessibilityLabel={archived ? m.workspace.unarchive(label) : m.workspace.archive(label)}
|
|
150
143
|
accessibilityState={{ disabled: actionDisabled }}
|
|
151
144
|
disabled={actionDisabled || !showAction}
|
|
152
|
-
hitSlop={
|
|
145
|
+
hitSlop={CONTROL.hitSlop}
|
|
153
146
|
onPress={onArchiveToggle}
|
|
154
147
|
pointerEvents={showAction ? "auto" : "none"}
|
|
155
148
|
style={[styles.titleAction, { opacity: showAction ? 1 : 0 }]}
|
|
156
149
|
>
|
|
157
150
|
{busy ? (
|
|
158
151
|
<ActivityIndicator
|
|
159
|
-
size={
|
|
152
|
+
size={ICON_SIZE.inline}
|
|
160
153
|
color={theme.colors.foregroundMuted}
|
|
161
|
-
style={{ width:
|
|
154
|
+
style={{ width: ICON_SIZE.inline, height: ICON_SIZE.inline }}
|
|
162
155
|
/>
|
|
163
156
|
) : (
|
|
164
157
|
<Icon
|
|
165
158
|
name={archived ? "ArchiveRestore" : "Archive"}
|
|
166
|
-
size={
|
|
159
|
+
size={ICON_SIZE.inline}
|
|
167
160
|
color={theme.colors.foregroundMuted}
|
|
168
161
|
/>
|
|
169
162
|
)}
|
|
@@ -176,7 +169,7 @@ export function AgentRow({
|
|
|
176
169
|
return (
|
|
177
170
|
<Pressable
|
|
178
171
|
accessibilityRole="link"
|
|
179
|
-
accessibilityLabel={
|
|
172
|
+
accessibilityLabel={`${m.common.openConversation(label)}${stateSuffix}`}
|
|
180
173
|
onPress={onOpen}
|
|
181
174
|
style={styles.agentListRow}
|
|
182
175
|
{...hoverProps}
|
|
@@ -26,6 +26,8 @@ import {
|
|
|
26
26
|
} from "./constants.ts";
|
|
27
27
|
import { formatAgentMeta } from "./filters.ts";
|
|
28
28
|
import type { WorkspaceTheme } from "./constants.ts";
|
|
29
|
+
import { CONTROL, ICON_SIZE } from "../design-tokens.ts";
|
|
30
|
+
import { useMessages } from "../use-app-language.ts";
|
|
29
31
|
|
|
30
32
|
export type AgentsSectionStyles = AgentRowStyles & {
|
|
31
33
|
agentsSection: ViewStyle;
|
|
@@ -160,6 +162,7 @@ export function AgentsSection({
|
|
|
160
162
|
/** Bump when workspace changes to collapse search. */
|
|
161
163
|
resetKey: string;
|
|
162
164
|
}): ReactNode {
|
|
165
|
+
const m = useMessages();
|
|
163
166
|
const [agentSearchOpen, setAgentSearchOpen] = useState(false);
|
|
164
167
|
const [searchSlotWidth, setSearchSlotWidth] = useState(0);
|
|
165
168
|
const [pageIndex, setPageIndex] = useState(0);
|
|
@@ -225,8 +228,8 @@ export function AgentsSection({
|
|
|
225
228
|
else active.push(item);
|
|
226
229
|
}
|
|
227
230
|
const groups: Array<[string, AgentUsageItem[]]> = [];
|
|
228
|
-
if (active.length > 0) groups.push([
|
|
229
|
-
if (archived.length > 0) groups.push([
|
|
231
|
+
if (active.length > 0) groups.push([m.workspace.options.status.active, active]);
|
|
232
|
+
if (archived.length > 0) groups.push([m.workspace.options.status.archived, archived]);
|
|
230
233
|
return groups;
|
|
231
234
|
}
|
|
232
235
|
const map = new Map<string, AgentUsageItem[]>();
|
|
@@ -238,7 +241,7 @@ export function AgentsSection({
|
|
|
238
241
|
return [...map.entries()].sort((a, b) =>
|
|
239
242
|
providerLabel(a[0]).localeCompare(providerLabel(b[0])),
|
|
240
243
|
);
|
|
241
|
-
}, [agentGroup, pageItems]);
|
|
244
|
+
}, [agentGroup, pageItems, m]);
|
|
242
245
|
|
|
243
246
|
const subAgentCounts = useMemo(
|
|
244
247
|
() => countSubAgentsByParent(agentItems, statusFilters),
|
|
@@ -270,7 +273,7 @@ export function AgentsSection({
|
|
|
270
273
|
<View style={styles.agentsSection}>
|
|
271
274
|
<View style={styles.agentsHeaderWrap}>
|
|
272
275
|
<View style={styles.agentsHeaderRow}>
|
|
273
|
-
<Text style={styles.sectionTitle}>
|
|
276
|
+
<Text style={styles.sectionTitle}>{m.common.agents}</Text>
|
|
274
277
|
<View
|
|
275
278
|
style={styles.agentsHeaderSearchSlot}
|
|
276
279
|
onLayout={(event) => {
|
|
@@ -295,28 +298,28 @@ export function AgentsSection({
|
|
|
295
298
|
},
|
|
296
299
|
]}
|
|
297
300
|
>
|
|
298
|
-
<Icon name="Search" size={
|
|
301
|
+
<Icon name="Search" size={ICON_SIZE.inline} color={theme.colors.foregroundMuted} />
|
|
299
302
|
<TextInput
|
|
300
303
|
ref={searchInputRef as never}
|
|
301
304
|
value={searchQuery}
|
|
302
305
|
onChangeText={onSearchQueryChange}
|
|
303
|
-
placeholder=
|
|
306
|
+
placeholder={m.workspace.searchPlaceholder}
|
|
304
307
|
placeholderTextColor={theme.colors.foregroundMuted}
|
|
305
308
|
autoCapitalize="none"
|
|
306
309
|
autoCorrect={false}
|
|
307
310
|
returnKeyType="search"
|
|
308
311
|
editable={agentSearchOpen}
|
|
309
312
|
style={styles.searchInput}
|
|
310
|
-
accessibilityLabel=
|
|
313
|
+
accessibilityLabel={m.workspace.searchLabel}
|
|
311
314
|
/>
|
|
312
315
|
</Animated.View>
|
|
313
316
|
</View>
|
|
314
317
|
<View style={styles.headerActions}>
|
|
315
318
|
<Pressable
|
|
316
319
|
accessibilityRole="button"
|
|
317
|
-
accessibilityLabel={agentSearchOpen ?
|
|
320
|
+
accessibilityLabel={agentSearchOpen ? m.workspace.closeSearch : m.workspace.openSearch}
|
|
318
321
|
accessibilityState={{ expanded: agentSearchOpen }}
|
|
319
|
-
hitSlop={
|
|
322
|
+
hitSlop={CONTROL.hitSlop}
|
|
320
323
|
onPress={() => {
|
|
321
324
|
if (agentSearchOpen) closeAgentSearch();
|
|
322
325
|
else openAgentSearch();
|
|
@@ -325,20 +328,20 @@ export function AgentsSection({
|
|
|
325
328
|
>
|
|
326
329
|
<Icon
|
|
327
330
|
name={agentSearchOpen ? "X" : "Search"}
|
|
328
|
-
size={
|
|
331
|
+
size={ICON_SIZE.action}
|
|
329
332
|
color={theme.colors.foregroundMuted}
|
|
330
333
|
/>
|
|
331
334
|
</Pressable>
|
|
332
335
|
<View ref={triggerRef} collapsable={false}>
|
|
333
336
|
<Pressable
|
|
334
337
|
accessibilityRole="button"
|
|
335
|
-
accessibilityLabel=
|
|
338
|
+
accessibilityLabel={m.workspace.displayOptions}
|
|
336
339
|
accessibilityState={{ expanded: menuOpen }}
|
|
337
|
-
hitSlop={
|
|
340
|
+
hitSlop={CONTROL.hitSlop}
|
|
338
341
|
onPress={onToggleMenu}
|
|
339
342
|
style={styles.titleAction}
|
|
340
343
|
>
|
|
341
|
-
<Icon name="Settings2" size={
|
|
344
|
+
<Icon name="Settings2" size={ICON_SIZE.action} color={theme.colors.foregroundMuted} />
|
|
342
345
|
</Pressable>
|
|
343
346
|
</View>
|
|
344
347
|
</View>
|
|
@@ -357,38 +360,38 @@ export function AgentsSection({
|
|
|
357
360
|
: pageItems.map(renderAgentRow)}
|
|
358
361
|
{visibleAgentItems.length === 0 ? (
|
|
359
362
|
<Text style={styles.empty}>
|
|
360
|
-
{statusFiltersEmpty ?
|
|
363
|
+
{statusFiltersEmpty ? m.workspace.noFilters : m.workspace.noMatches}
|
|
361
364
|
</Text>
|
|
362
365
|
) : null}
|
|
363
366
|
{showPager ? (
|
|
364
367
|
<View style={styles.pagerRow}>
|
|
365
368
|
<Pressable
|
|
366
369
|
accessibilityRole="button"
|
|
367
|
-
accessibilityLabel=
|
|
370
|
+
accessibilityLabel={m.workspace.previousPage}
|
|
368
371
|
accessibilityState={{ disabled: safePage === 0 }}
|
|
369
372
|
disabled={safePage === 0}
|
|
370
|
-
hitSlop={
|
|
373
|
+
hitSlop={CONTROL.hitSlop}
|
|
371
374
|
onPress={() => setPageIndex((p) => Math.max(0, p - 1))}
|
|
372
375
|
style={[styles.pagerButton, safePage === 0 ? styles.pagerButtonDisabled : null]}
|
|
373
376
|
>
|
|
374
|
-
<Icon name="ChevronLeft" size={
|
|
377
|
+
<Icon name="ChevronLeft" size={ICON_SIZE.action} color={theme.colors.foregroundMuted} />
|
|
375
378
|
</Pressable>
|
|
376
379
|
<Text style={styles.pagerLabel}>
|
|
377
380
|
{safePage + 1} / {pageCount}
|
|
378
381
|
</Text>
|
|
379
382
|
<Pressable
|
|
380
383
|
accessibilityRole="button"
|
|
381
|
-
accessibilityLabel=
|
|
384
|
+
accessibilityLabel={m.workspace.nextPage}
|
|
382
385
|
accessibilityState={{ disabled: safePage >= pageCount - 1 }}
|
|
383
386
|
disabled={safePage >= pageCount - 1}
|
|
384
|
-
hitSlop={
|
|
387
|
+
hitSlop={CONTROL.hitSlop}
|
|
385
388
|
onPress={() => setPageIndex((p) => Math.min(pageCount - 1, p + 1))}
|
|
386
389
|
style={[
|
|
387
390
|
styles.pagerButton,
|
|
388
391
|
safePage >= pageCount - 1 ? styles.pagerButtonDisabled : null,
|
|
389
392
|
]}
|
|
390
393
|
>
|
|
391
|
-
<Icon name="ChevronRight" size={
|
|
394
|
+
<Icon name="ChevronRight" size={ICON_SIZE.action} color={theme.colors.foregroundMuted} />
|
|
392
395
|
</Pressable>
|
|
393
396
|
</View>
|
|
394
397
|
) : null}
|
|
@@ -85,7 +85,6 @@ export const SEARCH_TITLE_GAP = 8;
|
|
|
85
85
|
/** Host MenuFlyout overlap between root surface and submenu (`SUBMENU_OVERLAP`). */
|
|
86
86
|
export const MENU_SUBMENU_OVERLAP = 5;
|
|
87
87
|
export const MENU_WIDTH = 232;
|
|
88
|
-
export const MENU_OPTION_ICON_SIZE = 14;
|
|
89
88
|
/** Approx list-row height (padding + title/meta) for stable Skills/MCP section size. */
|
|
90
89
|
export const RANK_ROW_ESTIMATE = 42;
|
|
91
90
|
/** Visible agents per page in Explorer; pager hidden when pageCount ≤ 1. */
|
|
@@ -131,11 +130,12 @@ export const LIFECYCLE_FILTER_OPTIONS: ReadonlyArray<
|
|
|
131
130
|
{ id: "closed", label: "Closed", icon: "CircleOff" },
|
|
132
131
|
];
|
|
133
132
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
id: T
|
|
137
|
-
|
|
138
|
-
|
|
133
|
+
/** Swap option labels for localized copy (066); ids / icons unchanged. */
|
|
134
|
+
export function localizeOptions<T extends string>(
|
|
135
|
+
options: ReadonlyArray<MenuOption & { id: T }>,
|
|
136
|
+
labels: Record<T, string>,
|
|
137
|
+
): ReadonlyArray<MenuOption & { id: T }> {
|
|
138
|
+
return options.map((option) => ({ ...option, label: labels[option.id] ?? option.label }));
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
/** 0 = attention-worthy, then running / idle / initializing / closed (unknown). */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Icon } from "@getpaseo/plugin/client/react-native";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import { Pressable, Text, View, type TextStyle, type ViewStyle } from "react-native";
|
|
4
|
-
import {
|
|
4
|
+
import { type MenuOption } from "./constants.ts";
|
|
5
|
+
import { ICON_SIZE } from "../design-tokens.ts";
|
|
5
6
|
|
|
6
7
|
export type MenuStyles = {
|
|
7
8
|
menuPage: ViewStyle;
|
|
@@ -57,7 +58,7 @@ export function MenuSubTrigger({
|
|
|
57
58
|
{value}
|
|
58
59
|
</Text>
|
|
59
60
|
) : null}
|
|
60
|
-
<Icon name="ChevronRight" size={
|
|
61
|
+
<Icon name="ChevronRight" size={ICON_SIZE.inline} color={chevronColor} />
|
|
61
62
|
</View>
|
|
62
63
|
</Pressable>
|
|
63
64
|
</View>
|
|
@@ -98,14 +99,14 @@ export function MenuOptionList({
|
|
|
98
99
|
]}
|
|
99
100
|
>
|
|
100
101
|
<View style={styles.menuLeadingSlot}>
|
|
101
|
-
<Icon name={option.icon} size={
|
|
102
|
+
<Icon name={option.icon} size={ICON_SIZE.inline} color={iconColor} />
|
|
102
103
|
</View>
|
|
103
104
|
<Text style={styles.menuOptionLabel} numberOfLines={1}>
|
|
104
105
|
{option.label}
|
|
105
106
|
</Text>
|
|
106
107
|
{selected ? (
|
|
107
108
|
<View style={styles.menuTrailing}>
|
|
108
|
-
<Icon name="Check" size={
|
|
109
|
+
<Icon name="Check" size={ICON_SIZE.action} color={checkColor} />
|
|
109
110
|
</View>
|
|
110
111
|
) : null}
|
|
111
112
|
</Pressable>
|
|
@@ -42,7 +42,7 @@ test("formatAgentMeta joins selected fields; prompt last", () => {
|
|
|
42
42
|
assert.equal(formatAgentMeta(item, fields(), byId, "en-US"), null);
|
|
43
43
|
assert.equal(
|
|
44
44
|
formatAgentMeta(item, fields("messages", "prompt"), byId, "en-US", "ship it"),
|
|
45
|
-
"5
|
|
45
|
+
"5 prompts · ship it",
|
|
46
46
|
);
|
|
47
47
|
assert.equal(
|
|
48
48
|
formatAgentMeta(item, fields("prompt"), byId, "en-US", null),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { matchesAgentTitleSearch } from "../../shared/agent-title-search.ts";
|
|
2
2
|
import { formatActivityTime } from "../../shared/format.ts";
|
|
3
|
+
import { messagesFor } from "../../shared/i18n.ts";
|
|
3
4
|
import { providerLabel, type AgentUsageItem } from "../../shared/usage.ts";
|
|
4
5
|
import {
|
|
5
6
|
type AgentShowField,
|
|
@@ -23,9 +24,10 @@ export function formatAgentMeta(
|
|
|
23
24
|
promptPreview?: string | null,
|
|
24
25
|
): string | null {
|
|
25
26
|
const parts: string[] = [];
|
|
27
|
+
const { units } = messagesFor(locale);
|
|
26
28
|
if (showFields.has("provider")) parts.push(providerLabel(item.provider));
|
|
27
|
-
if (showFields.has("calls")) parts.push(
|
|
28
|
-
if (showFields.has("messages")) parts.push(
|
|
29
|
+
if (showFields.has("calls")) parts.push(units.calls(item.callCount));
|
|
30
|
+
if (showFields.has("messages")) parts.push(units.prompts(item.messageCount));
|
|
29
31
|
if (showFields.has("updated")) {
|
|
30
32
|
const at = agentUpdatedAt(item, byId);
|
|
31
33
|
if (at) parts.push(formatActivityTime(at, locale));
|