@xpufx/paseo-top 0.4.4 → 0.4.7
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/OVERVIEW.md +18 -0
- package/client/host-ui.tsx +184 -0
- package/client/multi-host-view.tsx +57 -43
- package/client/multi-host.ts +36 -13
- package/client/pill-labels.ts +94 -1
- package/client/pill.tsx +692 -616
- package/client/resources-query.ts +1 -1
- package/client/settings-events.ts +1 -1
- package/client/settings-ui.tsx +86 -9
- package/client/surface.tsx +308 -276
- package/client/telemetry-copy.ts +8 -2
- package/client/telemetry.tsx +372 -321
- package/client/turn-panel.tsx +126 -104
- package/client/vendor/paseo-plugin-helper/{host.ts → core/host.ts} +9 -3
- package/client/vendor/paseo-plugin-helper/core/index.ts +76 -0
- package/client/vendor/paseo-plugin-helper/core/plugin-load-count.ts +89 -0
- package/client/vendor/paseo-plugin-helper/{query-refresh.ts → core/query-refresh.ts} +2 -2
- package/client/vendor/paseo-plugin-helper/{query.ts → core/query.ts} +2 -2
- package/client/vendor/paseo-plugin-helper/{settings.ts → core/settings.ts} +1 -1
- package/client/vendor/paseo-plugin-helper/{shared-settings.ts → core/shared-settings.ts} +2 -2
- package/client/vendor/paseo-plugin-helper/{utils → lifecycle}/clipboard.ts +2 -2
- package/client/vendor/paseo-plugin-helper/lifecycle/flair.ts +26 -0
- package/client/vendor/paseo-plugin-helper/{theme/color-utils.ts → lifecycle/host-color.ts} +95 -38
- package/client/vendor/paseo-plugin-helper/lifecycle/host-theme.tsx +109 -0
- package/client/vendor/paseo-plugin-helper/lifecycle/index.ts +23 -0
- package/client/vendor/paseo-plugin-helper/lifecycle/multi-host.ts +66 -0
- package/client/vendor/paseo-plugin-helper/{panel.tsx → lifecycle/panel.tsx} +7 -7
- package/client/vendor/paseo-plugin-helper/{pill.tsx → lifecycle/pill.tsx} +51 -18
- package/client/vendor/paseo-plugin-helper/lifecycle/providers.tsx +46 -0
- package/client/vendor/paseo-plugin-helper/lifecycle/scroll-owner.ts +26 -0
- package/client/vendor/paseo-plugin-helper/{surface.tsx → lifecycle/surface.tsx} +6 -6
- package/client/vendor/paseo-plugin-helper/ui/color.ts +1 -0
- package/client/vendor/paseo-plugin-helper/ui/content.tsx +1326 -0
- package/client/vendor/paseo-plugin-helper/ui/controls.tsx +1018 -0
- package/client/vendor/paseo-plugin-helper/{components/DataTable.tsx → ui/data.tsx} +50 -58
- package/client/vendor/paseo-plugin-helper/ui/index.ts +44 -0
- package/client/vendor/paseo-plugin-helper/ui/layout.tsx +263 -0
- package/client/vendor/paseo-plugin-helper/ui/modal.tsx +111 -0
- package/client/vendor/paseo-plugin-helper/ui/plugin-reload-banner.tsx +119 -0
- package/client/vendor/paseo-plugin-helper/{settings-screen.tsx → ui/settings-screen.tsx} +3 -3
- package/client/vendor/paseo-plugin-helper/ui/settings.ts +36 -0
- package/client/vendor/paseo-plugin-helper/ui/text.tsx +821 -0
- package/client/vendor/paseo-plugin-helper/ui/theme.tsx +1 -0
- package/client/vendor/permission-audit/client.tsx +706 -0
- package/client/vendor/permission-audit/index.tsx +1 -0
- package/index.client.tsx +58 -37
- package/index.server.ts +256 -234
- package/npm-shrinkwrap.json +44 -0
- package/package.json +8 -4
- package/paseo-plugin.json +2 -0
- package/screenshots/1-paseo-top-modal-system.jpg +0 -0
- package/screenshots/2-paseo-top-modal-workspace.jpg +0 -0
- package/screenshots/3-paseo-top-modal-settings.jpg +0 -0
- package/screenshots/4-paseo-top-modal-about.jpg +0 -0
- package/screenshots/paseo-top-dashboard.jpg +0 -0
- package/screenshots/paseo-top-general-view.jpg +0 -0
- package/server/resources.ts +98 -0
- package/server/vendor/paseo-plugin-helper/custom-pills.ts +70 -0
- package/server/vendor/paseo-plugin-helper/index.ts +2 -0
- package/server/vendor/paseo-plugin-helper/logger.ts +5 -16
- package/server/vendor/paseo-plugin-helper/rpc-guard.ts +2 -2
- package/server/vendor/paseo-plugin-helper/storage-guard.ts +294 -0
- package/server/vendor/paseo-plugin-helper/storage.ts +36 -2
- package/server/vendor/paseo-plugin-helper/telemetry.ts +486 -0
- package/server/vendor/paseo-plugin-helper/tickets.ts +18 -67
- package/server/vendor/permission-audit/index.ts +1 -0
- package/server/vendor/permission-audit/server.ts +839 -0
- package/shared/helper-version.ts +1 -1
- package/shared/multi-host.ts +153 -159
- package/shared/resources.ts +145 -0
- package/shared/vendor/paseo-plugin-helper/async.ts +14 -7
- package/shared/vendor/paseo-plugin-helper/features.ts +244 -0
- package/shared/vendor/paseo-plugin-helper/forge.ts +27 -0
- package/shared/vendor/paseo-plugin-helper/index.ts +1 -0
- package/shared/vendor/paseo-plugin-helper/tickets.ts +122 -28
- package/shared/vendor/permission-audit/filter.ts +61 -0
- package/shared/vendor/permission-audit/index.ts +2 -0
- package/shared/vendor/permission-audit/shared.ts +119 -0
- package/shared/version.ts +1 -1
- package/client/vendor/paseo-plugin-helper/components/AboutSection.tsx +0 -493
- package/client/vendor/paseo-plugin-helper/components/AttentionBeacon.tsx +0 -250
- package/client/vendor/paseo-plugin-helper/components/Badge.tsx +0 -168
- package/client/vendor/paseo-plugin-helper/components/Button.tsx +0 -204
- package/client/vendor/paseo-plugin-helper/components/Card.tsx +0 -257
- package/client/vendor/paseo-plugin-helper/components/CodeBlock.tsx +0 -196
- package/client/vendor/paseo-plugin-helper/components/Collapsible.tsx +0 -277
- package/client/vendor/paseo-plugin-helper/components/CommandBox.tsx +0 -172
- package/client/vendor/paseo-plugin-helper/components/CopyButton.tsx +0 -180
- package/client/vendor/paseo-plugin-helper/components/EmptyState.tsx +0 -97
- package/client/vendor/paseo-plugin-helper/components/HighlightedText.tsx +0 -70
- package/client/vendor/paseo-plugin-helper/components/InlineButton.tsx +0 -88
- package/client/vendor/paseo-plugin-helper/components/InteractiveRow.tsx +0 -142
- package/client/vendor/paseo-plugin-helper/components/KeyValue.tsx +0 -446
- package/client/vendor/paseo-plugin-helper/components/MetricGauge.tsx +0 -247
- package/client/vendor/paseo-plugin-helper/components/ProgressBar.tsx +0 -117
- package/client/vendor/paseo-plugin-helper/components/Responsive.tsx +0 -53
- package/client/vendor/paseo-plugin-helper/components/SearchInput.tsx +0 -132
- package/client/vendor/paseo-plugin-helper/components/SectionHeader.tsx +0 -87
- package/client/vendor/paseo-plugin-helper/components/Select.tsx +0 -283
- package/client/vendor/paseo-plugin-helper/components/StatusDot.tsx +0 -80
- package/client/vendor/paseo-plugin-helper/components/Tabs.tsx +0 -319
- package/client/vendor/paseo-plugin-helper/components/TextInput.tsx +0 -150
- package/client/vendor/paseo-plugin-helper/components/Toggle.tsx +0 -163
- package/client/vendor/paseo-plugin-helper/components/TruncatedText.tsx +0 -157
- package/client/vendor/paseo-plugin-helper/components/index.ts +0 -26
- package/client/vendor/paseo-plugin-helper/custom-pills.tsx +0 -225
- package/client/vendor/paseo-plugin-helper/forge-icon.tsx +0 -79
- package/client/vendor/paseo-plugin-helper/icon.tsx +0 -39
- package/client/vendor/paseo-plugin-helper/index.ts +0 -30
- package/client/vendor/paseo-plugin-helper/layout/ActionBar.tsx +0 -49
- package/client/vendor/paseo-plugin-helper/layout/FormRow.tsx +0 -103
- package/client/vendor/paseo-plugin-helper/layout/Grid.tsx +0 -65
- package/client/vendor/paseo-plugin-helper/layout/ModalBody.tsx +0 -368
- package/client/vendor/paseo-plugin-helper/layout/ModalContent.tsx +0 -51
- package/client/vendor/paseo-plugin-helper/layout/Row.tsx +0 -39
- package/client/vendor/paseo-plugin-helper/layout/Stack.tsx +0 -39
- package/client/vendor/paseo-plugin-helper/layout/index.ts +0 -7
- package/client/vendor/paseo-plugin-helper/styles/index.ts +0 -1
- package/client/vendor/paseo-plugin-helper/styles/recipes.ts +0 -550
- package/client/vendor/paseo-plugin-helper/theme/flair.ts +0 -76
- package/client/vendor/paseo-plugin-helper/theme/host-variables.ts +0 -121
- package/client/vendor/paseo-plugin-helper/theme/index.ts +0 -7
- package/client/vendor/paseo-plugin-helper/theme/provider.tsx +0 -178
- package/client/vendor/paseo-plugin-helper/theme/responsive.ts +0 -213
- package/client/vendor/paseo-plugin-helper/theme/tokens.ts +0 -200
- package/client/vendor/paseo-plugin-helper/theme/useResponsive.ts +0 -57
- package/client/vendor/paseo-plugin-helper/tickets.tsx +0 -766
- /package/client/vendor/paseo-plugin-helper/{command-center.ts → core/command-center.ts} +0 -0
- /package/client/vendor/paseo-plugin-helper/{snapshot.ts → core/snapshot.ts} +0 -0
- /package/client/vendor/paseo-plugin-helper/{utils → lifecycle}/haptics.ts +0 -0
package/client/telemetry.tsx
CHANGED
|
@@ -3,54 +3,42 @@ import { Text, View } from "react-native";
|
|
|
3
3
|
import { useAgent, type PluginTimelineItemProps } from "@getpaseo/plugin/client";
|
|
4
4
|
import { Icon } from "@getpaseo/plugin/client/react-native";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
HostBadge,
|
|
7
|
+
HostCollapsible,
|
|
8
|
+
HostCopyButton,
|
|
9
|
+
HostLayoutProvider,
|
|
10
|
+
HostProgressBar,
|
|
11
|
+
HostRow,
|
|
12
|
+
HostStack,
|
|
13
|
+
HostThemeProvider,
|
|
14
|
+
HostVital,
|
|
15
|
+
getStatusColor,
|
|
16
|
+
} from "./host-ui";
|
|
17
|
+
import { usePluginSettings } from "./vendor/paseo-plugin-helper/core/index";
|
|
18
|
+
import {
|
|
19
|
+
formatBytes,
|
|
20
|
+
formatUptime,
|
|
21
|
+
resolveMetricStatus,
|
|
22
|
+
truncatePath,
|
|
23
|
+
} from "../shared/vendor/paseo-plugin-helper/index";
|
|
16
24
|
import { buildTelemetryCopyText } from "./telemetry-copy";
|
|
17
25
|
import {
|
|
18
26
|
isTimelineEnabled,
|
|
19
27
|
isMcpSurfaceEnabled,
|
|
20
28
|
topSettingsContract,
|
|
21
29
|
TIMELINE_RENDERED_METRICS,
|
|
30
|
+
CPU_THRESHOLDS,
|
|
31
|
+
MEM_THRESHOLDS,
|
|
22
32
|
type MetricId,
|
|
23
33
|
type TopTimelineTelemetryData,
|
|
24
34
|
} from "../shared/resources";
|
|
25
|
-
import {
|
|
35
|
+
import {
|
|
36
|
+
formatCompactTokens,
|
|
37
|
+
type TopAgentSnapshot,
|
|
38
|
+
} from "./pill-labels";
|
|
26
39
|
|
|
27
40
|
export { TIMELINE_RENDERED_METRICS };
|
|
28
41
|
|
|
29
|
-
function Vital({
|
|
30
|
-
icon,
|
|
31
|
-
color,
|
|
32
|
-
children,
|
|
33
|
-
}: {
|
|
34
|
-
icon: string;
|
|
35
|
-
color: string;
|
|
36
|
-
children: React.ReactNode;
|
|
37
|
-
}) {
|
|
38
|
-
return (
|
|
39
|
-
<Row gap={4} align="center">
|
|
40
|
-
<Icon name={icon} size={12} color={color} />
|
|
41
|
-
{/*
|
|
42
|
-
* Color MUST be applied to the label as well as the icon. A <Text> with
|
|
43
|
-
* no `color` falls back to React Native's default black and disappears on
|
|
44
|
-
* dark surfaces (xpufx-org/paseo#208). Reusing the icon's `color` keeps
|
|
45
|
-
* threshold states (e.g. CPU/RAM warning/danger) consistent for both.
|
|
46
|
-
*/}
|
|
47
|
-
<Text numberOfLines={1} style={{ fontSize: 11, fontWeight: "500", color }}>
|
|
48
|
-
{children}
|
|
49
|
-
</Text>
|
|
50
|
-
</Row>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
42
|
export function TopTimelineTelemetryCard({
|
|
55
43
|
item,
|
|
56
44
|
theme,
|
|
@@ -58,6 +46,7 @@ export function TopTimelineTelemetryCard({
|
|
|
58
46
|
timestamp,
|
|
59
47
|
}: PluginTimelineItemProps<TopTimelineTelemetryData>) {
|
|
60
48
|
const data = item.data;
|
|
49
|
+
const compact = layout?.compact ?? false;
|
|
61
50
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
62
51
|
const liveUsage = useAgent(data.agentId, (a: TopAgentSnapshot) => a.lastUsage);
|
|
63
52
|
const inputTokens = data.inputTokens ?? liveUsage?.inputTokens;
|
|
@@ -111,17 +100,19 @@ export function TopTimelineTelemetryCard({
|
|
|
111
100
|
}
|
|
112
101
|
}, [data.outcomeKind, theme.colors]);
|
|
113
102
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
103
|
+
// CPU/RAM colors resolve through the shared canonical thresholds
|
|
104
|
+
// (shared/resources.ts) so the timeline card can never diverge from the
|
|
105
|
+
// pill and dashboard surfaces.
|
|
106
|
+
const cpuColor = useMemo(
|
|
107
|
+
() => getStatusColor(resolveMetricStatus(data.cpuPercent, CPU_THRESHOLDS), theme.colors),
|
|
108
|
+
[data.cpuPercent, theme.colors],
|
|
109
|
+
);
|
|
119
110
|
|
|
120
|
-
const memColor = useMemo(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
111
|
+
const memColor = useMemo(
|
|
112
|
+
() =>
|
|
113
|
+
getStatusColor(resolveMetricStatus(data.memPercent, MEM_THRESHOLDS), theme.colors),
|
|
114
|
+
[data.memPercent, theme.colors],
|
|
115
|
+
);
|
|
125
116
|
|
|
126
117
|
const timeLabel = useMemo(() => {
|
|
127
118
|
try {
|
|
@@ -166,306 +157,358 @@ export function TopTimelineTelemetryCard({
|
|
|
166
157
|
: (data.outcomeError ?? "Canceled")
|
|
167
158
|
: "";
|
|
168
159
|
|
|
160
|
+
// Velocity badge from computed tokensPerSecond.
|
|
161
|
+
const velocityBadge = useMemo(() => {
|
|
162
|
+
if (data.tokensPerSecond == null || !Number.isFinite(data.tokensPerSecond)) return null;
|
|
163
|
+
const tps = Math.round(data.tokensPerSecond);
|
|
164
|
+
let label = `⚡ ${tps} tok/s`;
|
|
165
|
+
if (data.contextPressureLevel === "high") {
|
|
166
|
+
label += " · ⚠️ high ctx";
|
|
167
|
+
} else if (data.contextPressureLevel === "warning") {
|
|
168
|
+
label += " · ⚠️ warn ctx";
|
|
169
|
+
}
|
|
170
|
+
return label;
|
|
171
|
+
}, [data.tokensPerSecond, data.contextPressureLevel]);
|
|
172
|
+
|
|
169
173
|
return (
|
|
170
|
-
<
|
|
171
|
-
<
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
<
|
|
179
|
-
|
|
180
|
-
{
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
174
|
+
<HostThemeProvider theme={theme}>
|
|
175
|
+
<HostLayoutProvider layout={layout}>
|
|
176
|
+
<HostCollapsible
|
|
177
|
+
variant="elevated"
|
|
178
|
+
isExpanded={isExpanded}
|
|
179
|
+
onToggle={setIsExpanded}
|
|
180
|
+
style={data.outcomeKind === "failed" ? { borderColor: theme.colors.statusDanger } : undefined}
|
|
181
|
+
title={
|
|
182
|
+
<HostRow gap={6} align="center" style={styles.headerInlineRow}>
|
|
183
|
+
<Icon name={outcomeConfig.icon} size={14} color={outcomeConfig.color} />
|
|
184
|
+
<Text style={{ fontSize: 12, fontWeight: "600", color: theme.colors.foreground, flexShrink: 0 }}>
|
|
185
|
+
{outcomeConfig.label}
|
|
186
|
+
</Text>
|
|
187
|
+
{data.durationMs != null ? (
|
|
188
|
+
<HostBadge
|
|
189
|
+
label={`${(data.durationMs / 1000).toFixed(1)}s`}
|
|
190
|
+
variant="neutral"
|
|
191
|
+
style={{ flexShrink: 0 }}
|
|
192
|
+
/>
|
|
193
|
+
) : null}
|
|
194
|
+
{show("velocity") && velocityBadge ? (
|
|
195
|
+
<HostBadge
|
|
196
|
+
label={velocityBadge}
|
|
197
|
+
variant={
|
|
198
|
+
data.contextPressureLevel === "high"
|
|
199
|
+
? "danger"
|
|
200
|
+
: data.contextPressureLevel === "warning"
|
|
201
|
+
? "warning"
|
|
202
|
+
: "neutral"
|
|
203
|
+
}
|
|
204
|
+
style={{ flexShrink: 0 }}
|
|
205
|
+
/>
|
|
206
|
+
) : null}
|
|
207
|
+
</HostRow>
|
|
208
|
+
}
|
|
209
|
+
subtitle={
|
|
210
|
+
!isExpanded && data.outcomeKind === "canceled" ? (
|
|
211
|
+
<Text numberOfLines={2} style={{ fontSize: 11, color: theme.colors.statusDanger }}>
|
|
212
|
+
{canceledText}
|
|
213
|
+
</Text>
|
|
214
|
+
) : undefined
|
|
215
|
+
}
|
|
216
|
+
headerRight={
|
|
217
|
+
<HostRow gap={6} align="center" style={styles.headerInlineRow}>
|
|
218
|
+
{timeLabel !== "" ? (
|
|
219
|
+
<Text style={{ fontSize: 10, color: theme.colors.foregroundMuted }}>{timeLabel}</Text>
|
|
220
|
+
) : null}
|
|
221
|
+
<Text
|
|
222
|
+
style={{
|
|
223
|
+
fontSize: 10,
|
|
224
|
+
color: theme.colors.foregroundMuted,
|
|
225
|
+
fontStyle: "italic",
|
|
226
|
+
}}
|
|
227
|
+
>
|
|
228
|
+
via top
|
|
229
|
+
</Text>
|
|
230
|
+
{/*
|
|
231
|
+
* Explicit copy affordance. Web's selection-copy handler only
|
|
232
|
+
* rebuilds clipboard content for `[data-testid="assistant-message"]`
|
|
233
|
+
* selections, so styled timeline items copy nothing
|
|
234
|
+
* (xpufx-org/paseo#278). The helper CopyButton bypasses that gate
|
|
235
|
+
* with the helper's own clipboard path. Empty labels keep the
|
|
236
|
+
* header compact: the icon flips Copy -> Check on success.
|
|
237
|
+
*/}
|
|
238
|
+
<HostCopyButton
|
|
239
|
+
getText={getCopyText}
|
|
240
|
+
label=""
|
|
241
|
+
copiedLabel=""
|
|
242
|
+
accessibilityLabel="Copy timeline card"
|
|
243
|
+
toastMessage="timeline card"
|
|
244
|
+
/>
|
|
245
|
+
</HostRow>
|
|
246
|
+
}
|
|
247
|
+
summary={
|
|
248
|
+
<HostRow wrap gap={compact ? 6 : 8} align="center">
|
|
249
|
+
{show("cpu_ram") && (
|
|
250
|
+
<HostVital icon="Cpu" color={cpuColor}>
|
|
251
|
+
CPU {data.cpuPercent}%
|
|
252
|
+
</HostVital>
|
|
253
|
+
)}
|
|
233
254
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
255
|
+
{show("cpu_ram") && (
|
|
256
|
+
<HostVital icon="Database" color={memColor}>
|
|
257
|
+
RAM {formatBytes(data.memUsedBytes)} ({data.memPercent}%)
|
|
258
|
+
</HostVital>
|
|
259
|
+
)}
|
|
239
260
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
261
|
+
{show("load") && (
|
|
262
|
+
<HostVital icon="Activity" color={theme.colors.foreground}>
|
|
263
|
+
Load {data.loadAvg1m.toFixed(2)}
|
|
264
|
+
</HostVital>
|
|
265
|
+
)}
|
|
245
266
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
267
|
+
{showMcp && (
|
|
268
|
+
<HostVital
|
|
269
|
+
icon="Server"
|
|
270
|
+
color={
|
|
271
|
+
data.mcpTotal == null
|
|
272
|
+
? theme.colors.foregroundMuted
|
|
273
|
+
: (data.mcpHealthy ?? 0) === data.mcpTotal
|
|
274
|
+
? theme.colors.statusSuccess
|
|
275
|
+
: theme.colors.statusWarning
|
|
276
|
+
}
|
|
277
|
+
>
|
|
278
|
+
{data.mcpTotal != null ? `MCP ${data.mcpHealthy ?? 0}/${data.mcpTotal}` : "MCP --"}
|
|
279
|
+
</HostVital>
|
|
280
|
+
)}
|
|
260
281
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
282
|
+
{show("agent_id") && (
|
|
283
|
+
<HostVital icon="Fingerprint" color={theme.colors.foreground}>
|
|
284
|
+
{data.agentId && data.agentId.length > 7
|
|
285
|
+
? data.agentId.slice(0, 7)
|
|
286
|
+
: (data.agentId ?? "--")}
|
|
287
|
+
</HostVital>
|
|
288
|
+
)}
|
|
268
289
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
290
|
+
{show("agent") && (
|
|
291
|
+
<HostVital
|
|
292
|
+
icon="Bot"
|
|
293
|
+
color={data.agentModel ? theme.colors.foreground : theme.colors.foregroundMuted}
|
|
294
|
+
>
|
|
295
|
+
{data.agentModel ?? "model --"}
|
|
296
|
+
</HostVital>
|
|
297
|
+
)}
|
|
277
298
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
299
|
+
{show("agent_provider") && (
|
|
300
|
+
<HostVital
|
|
301
|
+
icon="Globe"
|
|
302
|
+
color={
|
|
303
|
+
data.agentProvider ? theme.colors.foreground : theme.colors.foregroundMuted
|
|
304
|
+
}
|
|
305
|
+
>
|
|
306
|
+
{data.agentProvider ?? "provider --"}
|
|
307
|
+
</HostVital>
|
|
308
|
+
)}
|
|
288
309
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
310
|
+
{show("agent_title") && (
|
|
311
|
+
<HostVital
|
|
312
|
+
icon="Tag"
|
|
313
|
+
color={data.agentTitle ? theme.colors.foreground : theme.colors.foregroundMuted}
|
|
314
|
+
>
|
|
315
|
+
{data.agentTitle ?? "title --"}
|
|
316
|
+
</HostVital>
|
|
317
|
+
)}
|
|
297
318
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
319
|
+
{show("branch") && (
|
|
320
|
+
<HostVital
|
|
321
|
+
icon="GitBranch"
|
|
322
|
+
color={data.branch ? theme.colors.foreground : theme.colors.foregroundMuted}
|
|
323
|
+
>
|
|
324
|
+
{data.branch ?? "branch --"}
|
|
325
|
+
</HostVital>
|
|
326
|
+
)}
|
|
306
327
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
328
|
+
{show("worktree") && (
|
|
329
|
+
<HostVital
|
|
330
|
+
icon="Folder"
|
|
331
|
+
color={data.worktree ? theme.colors.foreground : theme.colors.foregroundMuted}
|
|
332
|
+
>
|
|
333
|
+
{data.worktree ? truncatePath(data.worktree, 20) : "worktree --"}
|
|
334
|
+
</HostVital>
|
|
335
|
+
)}
|
|
315
336
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
337
|
+
{show("uptime") && (
|
|
338
|
+
<HostVital icon="Clock" color={theme.colors.foreground}>
|
|
339
|
+
{data.uptimeSeconds ? formatUptime(data.uptimeSeconds) : "--"}
|
|
340
|
+
</HostVital>
|
|
341
|
+
)}
|
|
321
342
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
343
|
+
{show("changes") && (
|
|
344
|
+
<HostVital icon="GitCommitHorizontal" color={theme.colors.foreground}>
|
|
345
|
+
{(data.gitFilesChanged ?? 0) > 0
|
|
346
|
+
? `±${data.gitFilesChanged} files +${data.gitInsertions ?? 0}/-${data.gitDeletions ?? 0}`
|
|
347
|
+
: "No changes"}
|
|
348
|
+
</HostVital>
|
|
349
|
+
)}
|
|
329
350
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
351
|
+
{show("tokens") && (
|
|
352
|
+
<HostVital
|
|
353
|
+
icon="Coins"
|
|
354
|
+
color={
|
|
355
|
+
totalTokens != null || contextUsedTokens != null
|
|
356
|
+
? theme.colors.foreground
|
|
357
|
+
: theme.colors.foregroundMuted
|
|
358
|
+
}
|
|
359
|
+
>
|
|
360
|
+
{contextUsedTokens != null && contextMaxTokens
|
|
361
|
+
? `${formatCompactTokens(contextUsedTokens)}/${formatCompactTokens(contextMaxTokens)}${contextPercent != null ? ` (${contextPercent}% ctx)` : ""}`
|
|
362
|
+
: totalTokens != null
|
|
363
|
+
? `${formatCompactTokens(totalTokens)} tok`
|
|
364
|
+
: contextUsedTokens != null
|
|
365
|
+
? `${formatCompactTokens(contextUsedTokens)} ctx`
|
|
366
|
+
: "tok --"}
|
|
367
|
+
</HostVital>
|
|
368
|
+
)}
|
|
348
369
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
370
|
+
{show("velocity") && (
|
|
371
|
+
<HostVital
|
|
372
|
+
icon="Zap"
|
|
373
|
+
color={
|
|
374
|
+
data.tokensPerSecond != null && Number.isFinite(data.tokensPerSecond)
|
|
375
|
+
? data.contextPressureLevel === "high"
|
|
376
|
+
? theme.colors.statusDanger
|
|
377
|
+
: data.contextPressureLevel === "warning"
|
|
378
|
+
? theme.colors.statusWarning
|
|
379
|
+
: theme.colors.foreground
|
|
380
|
+
: theme.colors.foregroundMuted
|
|
381
|
+
}
|
|
382
|
+
>
|
|
383
|
+
{data.tokensPerSecond != null && Number.isFinite(data.tokensPerSecond)
|
|
384
|
+
? `${Math.round(data.tokensPerSecond)} tok/s`
|
|
385
|
+
: "vel --"}
|
|
386
|
+
</HostVital>
|
|
387
|
+
)}
|
|
356
388
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
)}
|
|
365
|
-
</Row>
|
|
366
|
-
|
|
367
|
-
{show("tokens") && hasTokenDetails ? (
|
|
368
|
-
<Stack gap={8}>
|
|
369
|
-
<Row justify="space-between" align="center">
|
|
370
|
-
<Row gap={4} align="center">
|
|
371
|
-
<Icon name="Coins" size={12} color={theme.colors.foregroundMuted} />
|
|
372
|
-
<Text style={sectionTitleStyle(theme.colors)}>Tokens & Context</Text>
|
|
373
|
-
</Row>
|
|
374
|
-
{costUsd != null && (
|
|
375
|
-
<Text style={{ fontSize: 10, fontWeight: "600", color: theme.colors.foreground }}>
|
|
376
|
-
${costUsd < 0.01 ? costUsd.toFixed(4) : costUsd.toFixed(2)}
|
|
377
|
-
</Text>
|
|
378
|
-
)}
|
|
379
|
-
</Row>
|
|
389
|
+
{show("tools") && (
|
|
390
|
+
<HostVital icon="Sigma" color={theme.colors.foreground}>
|
|
391
|
+
{data.toolCalls != null
|
|
392
|
+
? `${data.toolCalls}${data.toolErrors ? ` (${data.toolErrors} err)` : ""}`
|
|
393
|
+
: "tools --"}
|
|
394
|
+
</HostVital>
|
|
395
|
+
)}
|
|
380
396
|
|
|
381
|
-
{
|
|
382
|
-
<
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
397
|
+
{show("turns") && (
|
|
398
|
+
<HostVital
|
|
399
|
+
icon="Repeat"
|
|
400
|
+
color={data.turnCount != null ? theme.colors.foreground : theme.colors.foregroundMuted}
|
|
401
|
+
>
|
|
402
|
+
{data.turnCount != null ? `${data.turnCount} turns` : "turns --"}
|
|
403
|
+
</HostVital>
|
|
404
|
+
)}
|
|
405
|
+
</HostRow>
|
|
406
|
+
}
|
|
407
|
+
>
|
|
408
|
+
<HostStack gap={6}>
|
|
409
|
+
{show("tokens") && hasTokenDetails ? (
|
|
410
|
+
<HostStack gap={8}>
|
|
411
|
+
<HostRow justify="between" align="center">
|
|
412
|
+
<HostRow gap={4} align="center">
|
|
413
|
+
<Icon name="Coins" size={12} color={theme.colors.foregroundMuted} />
|
|
414
|
+
<Text style={sectionTitleStyle(theme.colors)}>Tokens & Context</Text>
|
|
415
|
+
</HostRow>
|
|
416
|
+
{costUsd != null && (
|
|
387
417
|
<Text style={{ fontSize: 10, fontWeight: "600", color: theme.colors.foreground }}>
|
|
388
|
-
{
|
|
389
|
-
{formatCompactTokens(contextMaxTokens)} ({contextPercent}%)
|
|
418
|
+
${costUsd < 0.01 ? costUsd.toFixed(4) : costUsd.toFixed(2)}
|
|
390
419
|
</Text>
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
420
|
+
)}
|
|
421
|
+
</HostRow>
|
|
422
|
+
|
|
423
|
+
{contextMaxTokens != null && contextMaxTokens > 0 ? (
|
|
424
|
+
<HostStack gap={4}>
|
|
425
|
+
<HostRow justify="between" align="center">
|
|
426
|
+
<Text style={{ fontSize: 10, color: theme.colors.foregroundMuted }}>
|
|
427
|
+
Context Window
|
|
428
|
+
</Text>
|
|
429
|
+
<Text style={{ fontSize: 10, fontWeight: "600", color: theme.colors.foreground }}>
|
|
430
|
+
{formatCompactTokens(contextUsedTokens ?? 0)} /{" "}
|
|
431
|
+
{formatCompactTokens(contextMaxTokens)} ({contextPercent}%)
|
|
432
|
+
</Text>
|
|
433
|
+
</HostRow>
|
|
434
|
+
<HostProgressBar
|
|
435
|
+
value={contextPercent ?? 0}
|
|
436
|
+
thresholds={{ warning: 70, danger: 85 }}
|
|
437
|
+
height={6}
|
|
438
|
+
/>
|
|
439
|
+
</HostStack>
|
|
440
|
+
) : contextUsedTokens != null ? (
|
|
441
|
+
<Text style={{ fontSize: 10, color: theme.colors.foreground }}>
|
|
442
|
+
{formatCompactTokens(contextUsedTokens)} tokens
|
|
443
|
+
</Text>
|
|
444
|
+
) : null}
|
|
445
|
+
|
|
446
|
+
<HostRow wrap gap={6} align="center">
|
|
447
|
+
{inputTokens != null && (
|
|
448
|
+
<HostBadge label={`In: ${inputTokens.toLocaleString('en-US')}`} variant="neutral" />
|
|
449
|
+
)}
|
|
450
|
+
{outputTokens != null && (
|
|
451
|
+
<HostBadge label={`Out: ${outputTokens.toLocaleString('en-US')}`} variant="neutral" />
|
|
452
|
+
)}
|
|
453
|
+
{cachedTokens != null && (
|
|
454
|
+
<HostBadge label={`Cache: ${cachedTokens.toLocaleString('en-US')}`} variant="neutral" />
|
|
455
|
+
)}
|
|
456
|
+
</HostRow>
|
|
457
|
+
</HostStack>
|
|
458
|
+
) : show("tokens") ? (
|
|
459
|
+
<HostRow justify="between" align="center">
|
|
460
|
+
<Text style={sectionTitleStyle(theme.colors)}>Tokens & Context</Text>
|
|
461
|
+
<Text
|
|
462
|
+
style={{
|
|
463
|
+
fontSize: 10,
|
|
464
|
+
fontStyle: "italic",
|
|
465
|
+
color: theme.colors.foregroundMuted,
|
|
466
|
+
}}
|
|
467
|
+
>
|
|
468
|
+
Not reported by provider
|
|
401
469
|
</Text>
|
|
402
|
-
|
|
470
|
+
</HostRow>
|
|
471
|
+
) : null}
|
|
403
472
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
473
|
+
<HostStack gap={4}>
|
|
474
|
+
<Text style={sectionTitleStyle(theme.colors)}>Turn Details</Text>
|
|
475
|
+
<HostRow wrap gap={12} align="center">
|
|
476
|
+
<HostVital grow={false} icon="Cpu" color={theme.colors.foreground}>
|
|
477
|
+
{data.agentModel ?? "Unknown model"} ({data.agentProvider ?? "default"})
|
|
478
|
+
</HostVital>
|
|
479
|
+
{data.toolCalls != null && (
|
|
480
|
+
<HostVital grow={false} icon="Sigma" color={theme.colors.foreground}>
|
|
481
|
+
{data.toolCalls} calls
|
|
482
|
+
{data.toolErrors ? `, ${data.toolErrors} failed` : ""}
|
|
483
|
+
</HostVital>
|
|
410
484
|
)}
|
|
411
|
-
{
|
|
412
|
-
<
|
|
485
|
+
{(data.gitInsertions != null || data.gitDeletions != null) && (
|
|
486
|
+
<HostVital grow={false} icon="GitCommitHorizontal" color={theme.colors.foreground}>
|
|
487
|
+
+{data.gitInsertions ?? 0} -{data.gitDeletions ?? 0}
|
|
488
|
+
</HostVital>
|
|
413
489
|
)}
|
|
414
|
-
</
|
|
415
|
-
</
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
<
|
|
419
|
-
<Text
|
|
490
|
+
</HostRow>
|
|
491
|
+
</HostStack>
|
|
492
|
+
|
|
493
|
+
{data.outcomeError && (
|
|
494
|
+
<View
|
|
420
495
|
style={{
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
496
|
+
padding: 6,
|
|
497
|
+
borderRadius: 4,
|
|
498
|
+
backgroundColor: theme.colors.surface2,
|
|
499
|
+
borderLeftWidth: 3,
|
|
500
|
+
borderLeftColor: theme.colors.statusDanger,
|
|
424
501
|
}}
|
|
425
502
|
>
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
{data.agentModel ?? "Unknown model"} ({data.agentProvider ?? "default"})
|
|
436
|
-
</Vital>
|
|
437
|
-
{data.toolCalls != null && (
|
|
438
|
-
<Vital icon="Sigma" color={theme.colors.foreground}>
|
|
439
|
-
{data.toolCalls} calls
|
|
440
|
-
{data.toolErrors ? `, ${data.toolErrors} failed` : ""}
|
|
441
|
-
</Vital>
|
|
442
|
-
)}
|
|
443
|
-
{(data.gitInsertions != null || data.gitDeletions != null) && (
|
|
444
|
-
<Vital icon="GitCommitHorizontal" color={theme.colors.foreground}>
|
|
445
|
-
+{data.gitInsertions ?? 0} -{data.gitDeletions ?? 0}
|
|
446
|
-
</Vital>
|
|
447
|
-
)}
|
|
448
|
-
</Row>
|
|
449
|
-
</Stack>
|
|
450
|
-
|
|
451
|
-
{data.outcomeError && (
|
|
452
|
-
<View
|
|
453
|
-
style={{
|
|
454
|
-
padding: 6,
|
|
455
|
-
borderRadius: 4,
|
|
456
|
-
backgroundColor: theme.colors.surface2,
|
|
457
|
-
borderLeftWidth: 3,
|
|
458
|
-
borderLeftColor: theme.colors.statusDanger,
|
|
459
|
-
}}
|
|
460
|
-
>
|
|
461
|
-
<Text numberOfLines={2} style={{ fontSize: 11, color: theme.colors.statusDanger }}>
|
|
462
|
-
{data.outcomeError}
|
|
463
|
-
</Text>
|
|
464
|
-
</View>
|
|
465
|
-
)}
|
|
466
|
-
</Stack>
|
|
467
|
-
</Collapsible>
|
|
468
|
-
</PluginThemeProvider>
|
|
503
|
+
<Text numberOfLines={2} style={{ fontSize: 11, color: theme.colors.statusDanger }}>
|
|
504
|
+
{data.outcomeError}
|
|
505
|
+
</Text>
|
|
506
|
+
</View>
|
|
507
|
+
)}
|
|
508
|
+
</HostStack>
|
|
509
|
+
</HostCollapsible>
|
|
510
|
+
</HostLayoutProvider>
|
|
511
|
+
</HostThemeProvider>
|
|
469
512
|
);
|
|
470
513
|
}
|
|
471
514
|
|
|
@@ -479,6 +522,14 @@ const styles = {
|
|
|
479
522
|
textTransform: "uppercase",
|
|
480
523
|
letterSpacing: 0.5,
|
|
481
524
|
},
|
|
525
|
+
// Header slots are auto-width: a `HostRow`'s base `width: 100%` resolves to
|
|
526
|
+
// zero inside the collapsible's `flex: 1` title column on native Yoga, which
|
|
527
|
+
// collapsed the header and stranded the outcome/time row mid-card
|
|
528
|
+
// (xpufx-org/paseo#1010). Opting these rows out of the full-width default
|
|
529
|
+
// keeps the header on one content-sized line.
|
|
530
|
+
headerInlineRow: {
|
|
531
|
+
width: "auto",
|
|
532
|
+
},
|
|
482
533
|
} as const;
|
|
483
534
|
|
|
484
535
|
function sectionTitleStyle(colors: { foregroundMuted: string }) {
|