@koinzhang/paseo-plugin-activity 0.7.0 → 0.8.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +33 -2
  2. package/README.md +6 -6
  3. package/client/activity-heatmap.tsx +1 -1
  4. package/client/agent-creations.tsx +4 -3
  5. package/client/attention-pill.tsx +1 -1
  6. package/client/design-tokens.ts +14 -2
  7. package/client/global-surface.tsx +12 -5
  8. package/client/hourly-activity-timeline.tsx +27 -10
  9. package/client/panel.tsx +11 -3
  10. package/client/pill.tsx +1 -1
  11. package/client/provider-dropdown.tsx +6 -3
  12. package/client/ranking-bars.tsx +8 -5
  13. package/client/sidebar-item.tsx +15 -0
  14. package/client/ui.tsx +17 -5
  15. package/client/usage-popover.tsx +10 -3
  16. package/client/workspace/agent-row.tsx +11 -4
  17. package/client/workspace/agents-section.tsx +32 -50
  18. package/client/workspace/constants.ts +2 -0
  19. package/client/workspace/display-menu.tsx +1 -1
  20. package/client/workspace/panel.tsx +7 -1
  21. package/client/workspace/rank-section.tsx +4 -3
  22. package/client/workspace/running-indicator-motion.ts +3 -0
  23. package/client/workspace/running-indicator.test.ts +15 -0
  24. package/client/workspace/running-indicator.tsx +3 -2
  25. package/client/workspace/terminals-section.tsx +12 -4
  26. package/index.client.tsx +13 -11
  27. package/index.server.ts +20 -38
  28. package/package.json +3 -3
  29. package/paseo-plugin.json +1 -1
  30. package/server/agents.test.ts +2 -0
  31. package/server/handlers.ts +6 -0
  32. package/server/host-types.ts +8 -7
  33. package/server/ingest.test.ts +2 -0
  34. package/server/messages.test.ts +1 -1
  35. package/server/turn-ingest.test.ts +303 -0
  36. package/server/turn-ingest.ts +75 -0
  37. package/shared/insights.ts +1 -1
@@ -1,9 +1,8 @@
1
- import { Icon, TextInput } from "@getpaseo/plugin/client/react-native";
1
+ import { Icon, TextInput } from "@getpaseo/plugin/client/ui";
2
2
  import { useEffect, useMemo, useRef, useState, type ReactNode, type RefObject } from "react";
3
3
  import {
4
4
  Animated,
5
5
  Easing,
6
- Pressable,
7
6
  Text,
8
7
  View,
9
8
  type TextStyle,
@@ -18,6 +17,7 @@ import {
18
17
  countSubAgentsByParent,
19
18
  isAgentRunning,
20
19
  SEARCH_ANIM_MS,
20
+ SEARCH_CLOSE_ANIM_MS,
21
21
  SEARCH_TITLE_GAP,
22
22
  type AgentGroup,
23
23
  type AgentShowField,
@@ -26,7 +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";
29
+ import { ICON_SIZE } from "../design-tokens.ts";
30
+ import { IconButton } from "../ui.tsx";
30
31
  import { useMessages } from "../use-app-language.ts";
31
32
 
32
33
  export type AgentsSectionStyles = AgentRowStyles & {
@@ -201,8 +202,8 @@ export function AgentsSection({
201
202
  if (!agentSearchOpen) return;
202
203
  Animated.timing(searchProgress, {
203
204
  toValue: 0,
204
- duration: SEARCH_ANIM_MS,
205
- easing: Easing.in(Easing.cubic),
205
+ duration: SEARCH_CLOSE_ANIM_MS,
206
+ easing: Easing.out(Easing.cubic),
206
207
  useNativeDriver: false,
207
208
  }).start(({ finished }) => {
208
209
  if (!finished) return;
@@ -315,34 +316,24 @@ export function AgentsSection({
315
316
  </Animated.View>
316
317
  </View>
317
318
  <View style={styles.headerActions}>
318
- <Pressable
319
- accessibilityRole="button"
320
- accessibilityLabel={agentSearchOpen ? m.workspace.closeSearch : m.workspace.openSearch}
321
- accessibilityState={{ expanded: agentSearchOpen }}
322
- hitSlop={CONTROL.hitSlop}
319
+ <IconButton
320
+ icon={agentSearchOpen ? "X" : "Search"}
321
+ label={agentSearchOpen ? m.workspace.closeSearch : m.workspace.openSearch}
322
+ expanded={agentSearchOpen}
323
323
  onPress={() => {
324
324
  if (agentSearchOpen) closeAgentSearch();
325
325
  else openAgentSearch();
326
326
  }}
327
- style={styles.titleAction}
328
- >
329
- <Icon
330
- name={agentSearchOpen ? "X" : "Search"}
331
- size={ICON_SIZE.action}
332
- color={theme.colors.foregroundMuted}
333
- />
334
- </Pressable>
327
+ color={theme.colors.foregroundMuted}
328
+ />
335
329
  <View ref={triggerRef} collapsable={false}>
336
- <Pressable
337
- accessibilityRole="button"
338
- accessibilityLabel={m.workspace.displayOptions}
339
- accessibilityState={{ expanded: menuOpen }}
340
- hitSlop={CONTROL.hitSlop}
330
+ <IconButton
331
+ icon="Settings2"
332
+ label={m.workspace.displayOptions}
333
+ expanded={menuOpen}
341
334
  onPress={onToggleMenu}
342
- style={styles.titleAction}
343
- >
344
- <Icon name="Settings2" size={ICON_SIZE.action} color={theme.colors.foregroundMuted} />
345
- </Pressable>
335
+ color={theme.colors.foregroundMuted}
336
+ />
346
337
  </View>
347
338
  </View>
348
339
  </View>
@@ -365,34 +356,25 @@ export function AgentsSection({
365
356
  ) : null}
366
357
  {showPager ? (
367
358
  <View style={styles.pagerRow}>
368
- <Pressable
369
- accessibilityRole="button"
370
- accessibilityLabel={m.workspace.previousPage}
371
- accessibilityState={{ disabled: safePage === 0 }}
372
- disabled={safePage === 0}
373
- hitSlop={CONTROL.hitSlop}
359
+ <IconButton
360
+ icon="ChevronLeft"
361
+ label={m.workspace.previousPage}
374
362
  onPress={() => setPageIndex((p) => Math.max(0, p - 1))}
375
- style={[styles.pagerButton, safePage === 0 ? styles.pagerButtonDisabled : null]}
376
- >
377
- <Icon name="ChevronLeft" size={ICON_SIZE.action} color={theme.colors.foregroundMuted} />
378
- </Pressable>
363
+ color={theme.colors.foregroundMuted}
364
+ disabled={safePage === 0}
365
+ style={safePage === 0 ? styles.pagerButtonDisabled : undefined}
366
+ />
379
367
  <Text style={styles.pagerLabel}>
380
368
  {safePage + 1} / {pageCount}
381
369
  </Text>
382
- <Pressable
383
- accessibilityRole="button"
384
- accessibilityLabel={m.workspace.nextPage}
385
- accessibilityState={{ disabled: safePage >= pageCount - 1 }}
386
- disabled={safePage >= pageCount - 1}
387
- hitSlop={CONTROL.hitSlop}
370
+ <IconButton
371
+ icon="ChevronRight"
372
+ label={m.workspace.nextPage}
388
373
  onPress={() => setPageIndex((p) => Math.min(pageCount - 1, p + 1))}
389
- style={[
390
- styles.pagerButton,
391
- safePage >= pageCount - 1 ? styles.pagerButtonDisabled : null,
392
- ]}
393
- >
394
- <Icon name="ChevronRight" size={ICON_SIZE.action} color={theme.colors.foregroundMuted} />
395
- </Pressable>
374
+ color={theme.colors.foregroundMuted}
375
+ disabled={safePage >= pageCount - 1}
376
+ style={safePage >= pageCount - 1 ? styles.pagerButtonDisabled : undefined}
377
+ />
396
378
  </View>
397
379
  ) : null}
398
380
  </View>
@@ -81,6 +81,8 @@ export type MenuOption = { id: string; label: string; icon: string };
81
81
  /** Agents header row / search pill height — keep fixed to avoid layout jump. */
82
82
  export const AGENT_HEADER_HEIGHT = 28;
83
83
  export const SEARCH_ANIM_MS = 220;
84
+ /** Closing stays faster than opening (084). */
85
+ export const SEARCH_CLOSE_ANIM_MS = 160;
84
86
  export const SEARCH_TITLE_GAP = 8;
85
87
  /** Host MenuFlyout overlap between root surface and submenu (`SUBMENU_OVERLAP`). */
86
88
  export const MENU_SUBMENU_OVERLAP = 5;
@@ -1,4 +1,4 @@
1
- import { Icon } from "@getpaseo/plugin/client/react-native";
1
+ import { Icon } from "@getpaseo/plugin/client/ui";
2
2
  import type { ReactNode } from "react";
3
3
  import { Pressable, Text, View, type TextStyle, type ViewStyle } from "react-native";
4
4
  import { type MenuOption } from "./constants.ts";
@@ -4,7 +4,7 @@ import {
4
4
  useRpc,
5
5
  useSettings,
6
6
  } from "@getpaseo/plugin/client";
7
- import { useToast } from "@getpaseo/plugin/client/react-native";
7
+ import { useToast } from "@getpaseo/plugin/client/ui";
8
8
  import { useQuery, useQueryClient } from "@tanstack/react-query";
9
9
  import { useEffect, useMemo, useRef, useState } from "react";
10
10
  import { useRegisterOpenAgent } from "../open-agent.ts";
@@ -429,6 +429,9 @@ export function WorkspaceActivityPanel({
429
429
  gap: 12,
430
430
  paddingVertical: ROW_PADDING.dense,
431
431
  },
432
+ listRowPressed: {
433
+ backgroundColor: theme.colors.surface2,
434
+ },
432
435
  timelineMarker: {
433
436
  width: 18,
434
437
  alignSelf: "stretch" as const,
@@ -535,6 +538,9 @@ export function WorkspaceActivityPanel({
535
538
  gap: 10,
536
539
  paddingVertical: ROW_PADDING.dense,
537
540
  },
541
+ terminalRowPressed: {
542
+ backgroundColor: theme.colors.surface2,
543
+ },
538
544
  terminalPreview: {
539
545
  marginLeft: 28,
540
546
  marginBottom: 4,
@@ -1,4 +1,4 @@
1
- import { Icon } from "@getpaseo/plugin/client/react-native";
1
+ import { Icon } from "@getpaseo/plugin/client/ui";
2
2
  import type { ReactNode } from "react";
3
3
  import { Pressable, Text, View, type TextStyle, type ViewStyle } from "react-native";
4
4
  import { formatDisplayName } from "../../shared/format.ts";
@@ -26,6 +26,7 @@ export type RankSectionStyles = {
26
26
  headerActions: ViewStyle;
27
27
  panel: ViewStyle;
28
28
  listRow: ViewStyle;
29
+ listRowPressed: ViewStyle;
29
30
  timelineMarker: ViewStyle;
30
31
  timelineLineTop: ViewStyle;
31
32
  timelineLineBottom: ViewStyle;
@@ -126,7 +127,7 @@ export function RankSection({
126
127
  accessibilityState={{ disabled: !canOpen }}
127
128
  disabled={!canOpen}
128
129
  onPress={canOpen ? () => openAgent({ agentId: item.agentId }) : undefined}
129
- style={styles.listRow}
130
+ style={({ pressed }) => [styles.listRow, pressed ? styles.listRowPressed : null]}
130
131
  >
131
132
  <View style={styles.timelineMarker}>
132
133
  {index > 0 ? <View style={styles.timelineLineTop} /> : null}
@@ -169,7 +170,7 @@ export function RankSection({
169
170
  accessibilityState={{ disabled: !canOpen }}
170
171
  disabled={!canOpen}
171
172
  onPress={canOpen ? () => openAgent({ agentId: item.agentId }) : undefined}
172
- style={styles.listRow}
173
+ style={({ pressed }) => [styles.listRow, pressed ? styles.listRowPressed : null]}
173
174
  >
174
175
  <View style={styles.timelineMarker}>
175
176
  {index > 0 ? <View style={styles.timelineLineTop} /> : null}
@@ -0,0 +1,3 @@
1
+ export function shouldUseNativeDriver(platform: string): boolean {
2
+ return platform !== "web";
3
+ }
@@ -0,0 +1,15 @@
1
+ import assert from "node:assert/strict";
2
+ import { test } from "node:test";
3
+ import { shouldUseNativeDriver } from "./running-indicator-motion.ts";
4
+
5
+ test("running ring uses JS animation on web (088)", () => {
6
+ assert.equal(shouldUseNativeDriver("web"), false);
7
+ });
8
+
9
+ test("running ring keeps native animation on iOS", () => {
10
+ assert.equal(shouldUseNativeDriver("ios"), true);
11
+ });
12
+
13
+ test("running ring keeps native animation on Android", () => {
14
+ assert.equal(shouldUseNativeDriver("android"), true);
15
+ });
@@ -1,6 +1,7 @@
1
1
  import { useEffect, useRef, type ReactNode } from "react";
2
- import { Animated, Easing, type ViewStyle } from "react-native";
2
+ import { Animated, Easing, Platform, type ViewStyle } from "react-native";
3
3
  import type { WorkspaceTheme } from "./constants.ts";
4
+ import { shouldUseNativeDriver } from "./running-indicator-motion.ts";
4
5
 
5
6
  const SPIN_SIZE = 10;
6
7
  const SPIN_DURATION_MS = 800;
@@ -21,7 +22,7 @@ export function RunningIndicator({
21
22
  toValue: 1,
22
23
  duration: SPIN_DURATION_MS,
23
24
  easing: Easing.linear,
24
- useNativeDriver: false,
25
+ useNativeDriver: shouldUseNativeDriver(Platform.OS),
25
26
  }),
26
27
  );
27
28
  animation.start();
@@ -1,5 +1,5 @@
1
1
  import { usePaseo } from "@getpaseo/plugin/client";
2
- import { Icon } from "@getpaseo/plugin/client/react-native";
2
+ import { Icon } from "@getpaseo/plugin/client/ui";
3
3
  import { useQuery } from "@tanstack/react-query";
4
4
  import { useEffect, useState, type ReactNode } from "react";
5
5
  import {
@@ -14,7 +14,7 @@ import {
14
14
  import { collapseHomePath } from "../../shared/home-path.ts";
15
15
  import { TERMINAL_PREVIEW_LINES, TERMINAL_REFETCH_MS } from "./constants.ts";
16
16
  import { terminalPreviewLines } from "./terminal-preview.ts";
17
- import { CONTROL, ICON_SIZE } from "../design-tokens.ts";
17
+ import { CONTROL, ICON_SIZE, PRESS } from "../design-tokens.ts";
18
18
  import { useMessages } from "../use-app-language.ts";
19
19
 
20
20
  export type TerminalListItem = {
@@ -30,6 +30,7 @@ export type TerminalsSectionStyles = {
30
30
  sectionTitle: TextStyle;
31
31
  panel: ViewStyle;
32
32
  terminalRow: ViewStyle;
33
+ terminalRowPressed: ViewStyle;
33
34
  listMain: ViewStyle;
34
35
  listTitle: TextStyle;
35
36
  listMeta: TextStyle;
@@ -100,7 +101,10 @@ export function TerminalsSection({
100
101
  }
101
102
  accessibilityState={{ expanded }}
102
103
  onPress={() => setExpandedId(expanded ? null : item.id)}
103
- style={styles.terminalRow}
104
+ style={({ pressed }) => [
105
+ styles.terminalRow,
106
+ pressed ? styles.terminalRowPressed : null,
107
+ ]}
104
108
  {...(Platform.OS === "web"
105
109
  ? ({
106
110
  onMouseEnter: () => setHoveredId(item.id),
@@ -126,7 +130,11 @@ export function TerminalsSection({
126
130
  hitSlop={CONTROL.hitSlop}
127
131
  onPress={() => onClose(item)}
128
132
  pointerEvents={showClose ? "auto" : "none"}
129
- style={[styles.titleAction, { opacity: showClose ? 1 : 0 }]}
133
+ style={({ pressed }) => [
134
+ styles.titleAction,
135
+ { opacity: showClose ? 1 : 0 },
136
+ pressed ? { opacity: PRESS.opacity, transform: [{ scale: PRESS.scale }] } : null,
137
+ ]}
130
138
  >
131
139
  {busy ? (
132
140
  <ActivityIndicator size="small" color={mutedColor} />
package/index.client.tsx CHANGED
@@ -4,11 +4,12 @@ import { UsagePanel } from "./client/panel.tsx";
4
4
  import { contributeAttentionPills } from "./client/attention-pill.tsx";
5
5
  import { contributeHeaderButtons } from "./client/header-button.ts";
6
6
  import { contributePills } from "./client/pill.tsx";
7
+ import { ACTIVITY_SCREEN_ID, ActivitySidebarItem } from "./client/sidebar-item.tsx";
7
8
  import { WorkspaceActivityPanel } from "./client/workspace-panel.tsx";
8
9
  import { currentAppLanguage, watchAppLanguage } from "./client/use-app-language.ts";
9
10
  import { messagesFor } from "./shared/i18n.ts";
10
11
 
11
- const GLOBAL_SURFACE_ID = "activity";
12
+ const GLOBAL_SCREEN_ID = ACTIVITY_SCREEN_ID;
12
13
 
13
14
  /** Command titles follow the app language; the host has no update(), so re-register on change. */
14
15
  function addScopedCommands(client: PluginClientContext): () => void {
@@ -40,19 +41,21 @@ function addScopedCommands(client: PluginClientContext): () => void {
40
41
  }
41
42
 
42
43
  export default function contribute(client: PluginClientContext) {
43
- client.addSurface(GLOBAL_SURFACE_ID, GlobalUsageSurface);
44
- client.addSidebarItem({
45
- id: "activity",
44
+ client.addScreen({
45
+ id: GLOBAL_SCREEN_ID,
46
46
  title: "Activity",
47
- icon: "Activity",
48
- surface: GLOBAL_SURFACE_ID,
47
+ Component: GlobalUsageSurface,
48
+ });
49
+ client.addSidebarHeaderItem({
50
+ id: GLOBAL_SCREEN_ID,
51
+ title: "Activity",
52
+ Component: ActivitySidebarItem,
49
53
  });
50
54
 
51
- client.addWorkspacePanel({
55
+ client.addAgentPanel({
52
56
  id: "usage",
53
57
  title: "Activity",
54
58
  icon: "Activity",
55
- context: "agent",
56
59
  Component: UsagePanel,
57
60
  });
58
61
 
@@ -60,7 +63,6 @@ export default function contribute(client: PluginClientContext) {
60
63
  id: "workspace-activity",
61
64
  title: "Activity",
62
65
  icon: "Activity",
63
- context: "workspace",
64
66
  locations: ["explorer"],
65
67
  Component: WorkspaceActivityPanel,
66
68
  });
@@ -71,8 +73,8 @@ export default function contribute(client: PluginClientContext) {
71
73
  icon: "Activity",
72
74
  keywords: ["activity", "tool", "usage", "provider", "all", "global", "sidebar"],
73
75
  context: "global",
74
- onSelect({ openSurface }) {
75
- openSurface(GLOBAL_SURFACE_ID);
76
+ onSelect({ openScreen }) {
77
+ openScreen({ screenId: GLOBAL_SCREEN_ID });
76
78
  },
77
79
  });
78
80
 
package/index.server.ts CHANGED
@@ -20,10 +20,9 @@ import {
20
20
  createUnarchiveAgentHandler,
21
21
  } from "./server/handlers.ts";
22
22
  import { agentRowFromHook } from "./server/agents.ts";
23
- import { ingestTimeline, ingestUserMessages } from "./server/ingest.ts";
24
- import { resolveAgentModel } from "./server/resolve-model.ts";
25
23
  import { createRpcCache } from "./server/rpc-cache.ts";
26
24
  import { createUsageStore } from "./server/store.ts";
25
+ import { ingestTurnAfter } from "./server/turn-ingest.ts";
27
26
  import {
28
27
  usageActivityByHourRpc,
29
28
  usageActivityByDayRpc,
@@ -97,17 +96,17 @@ export default function contribute(server: PluginServerContext) {
97
96
  server.handle(usageHostInfoRpc, () => ({ homeDir: homedir() }));
98
97
  server.handle(usageReadSkillRpc, createReadSkillHandler());
99
98
 
100
- const removeCreated = server.on("agent.created", (event, context) => {
99
+ const removeCreated = server.addHook("agent.create.after", async (event, context) => {
101
100
  void background.request(context.paseo);
102
101
  try {
103
102
  store.upsertAgents([agentRowFromHook(event.agent)]);
104
103
  console.log(`[activity] agent.created id=${event.agent.id}`);
105
104
  } catch (error) {
106
- console.error("[activity] failed to ingest agent.created", error);
105
+ console.error("[activity] failed to ingest agent.create.after", error);
107
106
  }
108
107
  });
109
108
 
110
- const removeArchived = server.on("agent.archived", (event, context) => {
109
+ const removeArchived = server.addHook("agent.archive.after", async (event, context) => {
111
110
  void background.request(context.paseo);
112
111
  try {
113
112
  store.upsertAgents([
@@ -118,45 +117,28 @@ export default function contribute(server: PluginServerContext) {
118
117
  ]);
119
118
  console.log(`[activity] agent.archived id=${event.agent.id}`);
120
119
  } catch (error) {
121
- console.error("[activity] failed to ingest agent.archived", error);
120
+ console.error("[activity] failed to ingest agent.archive.after", error);
122
121
  }
123
122
  });
124
123
 
125
- const removeTurnEnded = server.on("agent.turn_ended", (event, context) => {
124
+ const removeTurnEnded = server.addHook("agent.turn.after", async (event, context) => {
126
125
  void background.request(context.paseo);
127
- void (async () => {
128
- try {
129
- const existing = store.getAgent(event.agent.id);
130
- store.upsertAgents([
131
- agentRowFromHook(event.agent, {
132
- createdAt: existing?.createdAt,
133
- archivedAt: existing?.archivedAt,
134
- }),
135
- ]);
136
- const model = await resolveAgentModel(context.paseo, event.agent.id);
137
- store.upsertUserMessages(
138
- ingestUserMessages(event.timeline, event.agent, { model }),
139
- );
140
- store.pruneReplayDuplicateMessages(event.agent.id);
141
- // event.timeline is the whole history; calls already stored in a terminal
142
- // status cannot change from a live snapshot, so only the rest are upserted.
143
- const settled = store.terminalCallIds(event.agent.id);
144
- const pending = event.timeline.filter(
145
- (item) => item.type !== "tool_call" || !settled.has(item.callId),
126
+ const signal = context.signal;
127
+ try {
128
+ const rows = await ingestTurnAfter(store, context.paseo, event.agent, event.turnId, {
129
+ homeDir: homedir(),
130
+ signal,
131
+ });
132
+ if (rows > 0 && !signal.aborted) {
133
+ console.log(
134
+ `[activity] turn.after agent=${event.agent.id} rows=${rows} total=${store.count()}`,
146
135
  );
147
- const rows = ingestTimeline(pending, event.agent, null, {
148
- homeDir: homedir(),
149
- });
150
- if (rows.length > 0) {
151
- store.upsertMany(rows);
152
- console.log(
153
- `[activity] turn_ended agent=${event.agent.id} rows=${rows.length} total=${store.count()}`,
154
- );
155
- }
156
- } catch (error) {
157
- console.error("[activity] failed to ingest agent.turn_ended", error);
158
136
  }
159
- })();
137
+ } catch (error) {
138
+ if (!signal.aborted) {
139
+ console.error("[activity] failed to ingest agent.turn.after", error);
140
+ }
141
+ }
160
142
  });
161
143
 
162
144
  return () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koinzhang/paseo-plugin-activity",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "Local usage analytics and workspace agent ops for Paseo: tools, agents, messages, models, Explorer fleet list, and terminals.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -22,10 +22,10 @@
22
22
  ],
23
23
  "scripts": {
24
24
  "typecheck": "tsc --noEmit",
25
- "test": "node --experimental-strip-types --test server/background-sync.test.ts server/handlers-query.test.ts client/attention-agents.test.ts client/latest-user-message.test.ts client/pill-data-cache.test.ts client/hidden-pill-recheck.test.ts client/agent-directory.test.ts client/workspace/list-host-agents.test.ts client/workspace/constants.test.ts client/workspace/filters.test.ts client/workspace/host-archive-sync.test.ts client/rank-color.test.ts client/color-mix.test.ts client/design-tokens.test.ts client/fit-text.test.ts client/provider-filter.test.ts client/range.test.ts client/panel-visibility.test.ts client/workspace/terminal-preview.test.ts shared/activity.test.ts shared/insights.test.ts shared/i18n.test.ts shared/classify.test.ts shared/usage.test.ts shared/format.test.ts shared/explorer-agent-display.test.ts shared/agent-title-search.test.ts shared/list-agent-pages.test.ts shared/agent-page-size.test.ts server/store.test.ts server/ingest.test.ts server/skill-path.test.ts server/mcp-servers.test.ts server/agents.test.ts server/migrate-data.test.ts server/messages.test.ts server/resolve-model.test.ts server/rpc-cache.test.ts"
25
+ "test": "node --experimental-strip-types --test server/background-sync.test.ts server/handlers-query.test.ts client/attention-agents.test.ts client/latest-user-message.test.ts client/pill-data-cache.test.ts client/hidden-pill-recheck.test.ts client/agent-directory.test.ts client/workspace/list-host-agents.test.ts client/workspace/constants.test.ts client/workspace/filters.test.ts client/workspace/host-archive-sync.test.ts client/rank-color.test.ts client/color-mix.test.ts client/design-tokens.test.ts client/fit-text.test.ts client/provider-filter.test.ts client/range.test.ts client/panel-visibility.test.ts client/workspace/terminal-preview.test.ts client/workspace/running-indicator.test.ts shared/activity.test.ts shared/insights.test.ts shared/i18n.test.ts shared/classify.test.ts shared/usage.test.ts shared/format.test.ts shared/explorer-agent-display.test.ts shared/agent-title-search.test.ts shared/list-agent-pages.test.ts shared/agent-page-size.test.ts server/store.test.ts server/ingest.test.ts server/skill-path.test.ts server/mcp-servers.test.ts server/agents.test.ts server/migrate-data.test.ts server/messages.test.ts server/resolve-model.test.ts server/turn-ingest.test.ts server/rpc-cache.test.ts"
26
26
  },
27
27
  "devDependencies": {
28
- "@getpaseo/plugin": "0.9.0-beta.2",
28
+ "@getpaseo/plugin": "0.17.4",
29
29
  "@tanstack/react-query": "^5.90.11",
30
30
  "@types/node": "^24.13.5",
31
31
  "@types/react": "~19.2.0",
package/paseo-plugin.json CHANGED
@@ -2,6 +2,6 @@
2
2
  "id": "activity",
3
3
  "description": "Local usage analytics and workspace agent ops: Explorer fleet list, live attention, and terminals",
4
4
  "requirements": {
5
- "paseo": ">=0.9.0"
5
+ "paseo": ">=0.17.4"
6
6
  }
7
7
  }
@@ -57,6 +57,8 @@ describe("agentRowFromHook", () => {
57
57
  provider: "claude",
58
58
  cwd: "/tmp",
59
59
  title: "Hello",
60
+ background: false,
61
+ metadata: {},
60
62
  },
61
63
  { createdAt: "2026-09-18T00:00:00.000Z" },
62
64
  );
@@ -606,6 +606,8 @@ function agentFromSnapshot(agent: {
606
606
  provider: string;
607
607
  cwd: string;
608
608
  title?: string | null;
609
+ background?: PluginHookAgent["background"];
610
+ metadata?: PluginHookAgent["metadata"];
609
611
  }): PluginHookAgent {
610
612
  return {
611
613
  id: agent.id,
@@ -614,6 +616,8 @@ function agentFromSnapshot(agent: {
614
616
  provider: agent.provider,
615
617
  cwd: agent.cwd,
616
618
  title: agent.title ?? null,
619
+ background: agent.background ?? false,
620
+ metadata: agent.metadata ?? {},
617
621
  };
618
622
  }
619
623
 
@@ -678,6 +682,8 @@ export async function resyncAgents(
678
682
  cwd: string;
679
683
  updatedAt?: string;
680
684
  lastUserMessageAt?: string | null;
685
+ background?: PluginHookAgent["background"];
686
+ metadata?: PluginHookAgent["metadata"];
681
687
  } }>,
682
688
  options: { incremental?: boolean } = {},
683
689
  ): Promise<HistoryScanResult> {
@@ -1,14 +1,15 @@
1
- import type { PluginHookContext, PluginLifecycleEvents } from "@getpaseo/plugin/server";
1
+ import type { PluginHookContext } from "@getpaseo/plugin/server";
2
2
 
3
3
  /**
4
4
  * Host types re-derived from the plugin SDK.
5
5
  *
6
6
  * Plugins must only import host-provided specifiers (`@getpaseo/plugin*`, zod,
7
- * react, react-native, @tanstack/react-query, node builtins): Paseo compiles
8
- * plugin sources without installing dependencies, so direct `@getpaseo/protocol`
9
- * or `@getpaseo/client` imports fail the runtime-boundary build.
7
+ * react, react-native, @tanstack/react-query, node builtins) or dependencies the
8
+ * plugin installs itself: Paseo compiles plugin sources without installing
9
+ * dependencies, so `@getpaseo/protocol` and `@getpaseo/client` imports fail the
10
+ * runtime-boundary build unless they resolve from the plugin's node_modules.
10
11
  */
11
- export type AgentTimelineItem =
12
- PluginLifecycleEvents["agent.turn_ended"]["timeline"][number];
13
-
14
12
  export type PaseoApi = PluginHookContext["paseo"];
13
+
14
+ type AgentHandle = ReturnType<PaseoApi["agents"]["ref"]>;
15
+ export type AgentTimelineItem = Awaited<ReturnType<AgentHandle["timeline"]["refetch"]>>["entries"][number]["item"];
@@ -12,6 +12,8 @@ const agent: PluginHookAgent = {
12
12
  provider: "claude",
13
13
  cwd: "/repo",
14
14
  title: "test agent",
15
+ background: false,
16
+ metadata: {},
15
17
  };
16
18
 
17
19
  const FIXED_NOW = "2026-09-18T12:00:00.000Z";
@@ -13,7 +13,7 @@ import { computeStreaks } from "../shared/activity.ts";
13
13
 
14
14
  type PaseoApi = PluginHandlerContext["paseo"];
15
15
 
16
- const agent = { id: "a1", workspaceId: "w1", parentAgentId: null, provider: "codex", cwd: "/tmp", title: null };
16
+ const agent = { id: "a1", workspaceId: "w1", parentAgentId: null, provider: "codex", cwd: "/tmp", title: null, background: false, metadata: {} };
17
17
  const now = "2026-09-19T12:00:00.000Z";
18
18
  const earlier = "2026-09-18T12:00:00.000Z";
19
19
  const message = { type: "user_message" as const, messageId: "m1", text: "private body" };