paseo-follow-up 1.3.0-beta.4 → 1.4.0-beta.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/OVERVIEW.md CHANGED
@@ -5,6 +5,7 @@ Follow-up watches every pull request a Paseo workspace opens until the work is a
5
5
  ## What you see
6
6
 
7
7
  - Home: every workspace grouped by what it needs from you (Needs you, Follow-up is fixing, Running, Waiting on others, Quiet), with the selected one beside the list so you can allow a permission, answer, merge, reply or sign off in place, and a brief with what Follow-up did while you were away. Above the list: the status counts, provider limits from Smart Session when it's installed, a search over names, branches, PRs, agents and asks, and a sort menu (Priority, Recent, Oldest waiting, Name, By project).
8
+ - The Overseer (1.4 beta), pinned on Home: one agent you talk to about all your workspaces. It forwards your asks to the agent that owns them, asks you when it isn't sure, and starts a new workspace only when you say so.
8
9
  - A workspace panel for the open workspace only, with a Home button: PRs merged, what needs you, what needs fixing, a bar with one segment per PR, and what the agent is doing now. "Open full" on Home docks it beside the agent's chat.
9
10
  - A Needs you card with one button per decision: Send repairs, Merge, Resume, Retry, or Answer.
10
11
  - Questions from the main agent, each with a permanent ref (Q1, Q2…), lettered options, the agent's recommendation and what it does while it waits. Pick an option, add a note and Send it to the agent, or Copy it instead. Answered questions stay listed under their ref, and the question mode setting (Stop, Work around, Keep building) tells agents what to do until you answer.
@@ -34,3 +35,5 @@ This is a trusted, unsandboxed plugin. It reads workspace metadata, saved agent
34
35
  The Needs-you inbox (beta) keeps one flag per root agent in `plugin-data/follow-through/inbox.json`. When a turn starts it reads the newest user message from the agent's recent timeline to tell your messages from automation, and it reads, never writes, Defer's `plugin-data/defer/queue.json`, Smart Session's `plugin-data/smart-session/compactions.json`, Session Guard's `plugin-data/session-guard/state.json` and Paseo's schedule records. An unknown or unreadable format counts as your message, which clears a flag rather than adding one. Signing off also clears Paseo's own unread dot for that agent. The first-run import and the restart check read only Paseo's agent list: an agent's last activity is its unread time or your last message to it, never Paseo's `updatedAt` (which the daemon rewrites in bulk), and they don't fetch timelines, which would load every agent. Closed and archived agents are never imported. Turning the inbox off stops all of this.
35
36
 
36
37
  The brief (beta) is stored on the agent's inbox entry and appended to its timeline as a Follow-up row; re-appending replaces that row, and the restart check ignores the `updatedAt` change the append causes because it never reads `updatedAt`. To build a brief Follow-up reads only what it already has: the agent's `needs_you` call, the permission request's title, the failed turn's error message, Session Guard's note and reset time for a paused agent, and its own PR state. It does not read or quote the agent's reply. While the inbox is on, every root Paseo agent on Claude Code or Codex gets Follow-up's MCP bridge with the `needs_you` tool only (tracked main agents keep their full set), and `plugin-data/follow-through/brief.json` records whether the inbox and the nudge are on and which agents have a permission prompt showing. Clicking an option or Retry sends one message as you; it is logged in the delivery ledger as yours, so it clears the flag. The Stop hook, part of the same reversible provider hooks Follow-up already installs, now also runs for those root Claude Code sessions: if the turn ended without `needs_you`, it blocks the stop once with a one-line request to call it, records that it did in `hook-state`, and never blocks the same turn again. It reads `brief.json`, its own per-turn marker and the time of the agent's last `needs_you` call, and nothing else. Turn it off with *Ask agents to state what they need*; turning the inbox off stops it too.
38
+
39
+ The Overseer (beta) is one Claude agent in a Follow-up workspace under `plugin-data/follow-through/overseer-home`, labelled `follow-up.overseer=1` and created only when you click Start. Its id is kept in `plugin-data/follow-through/overseer.json`. Discovery, tracking, auto-send and Needs you skip its workspace. At the start of each of its turns, the provider hook adds a digest from `plugin-data/follow-through/overseer-digest.json` and records what it showed in `hook-state/overseer-seen-<agent>.json`. The worker builds that file from Paseo's workspace list (metadata only, at most once a minute) and Follow-up's own state. It rewrites the file only when the content changes, and skips it while the resource governor pauses background work. Its tools are `workstreams`, `agent_digest`, `route_candidates`, `send_to_agent` and `start_workspace`. For an agent that isn't loaded, `agent_digest` reads the provider's transcript on disk, read-only (Claude Code's `projects/<cwd>/<session>.jsonl`, Codex's `sessions/**/rollout-*-<thread>.jsonl`; only the last 512 KB, and never the credentials in Paseo's agent record). Without a transcript it uses Follow-up's goal and PR titles. It never reads that agent's timeline. `send_to_agent` writes your words to the delivery ledger first: as yours only when they answer that agent's open ask, otherwise as Follow-up's. It wakes a resting agent only because you asked for it. `start_workspace` runs only after your approval, through a dry run and confirm. The Overseer can't merge, archive or post anywhere.
package/README.md CHANGED
@@ -113,10 +113,25 @@ The Follow-up sidebar row (and ⌘K → **Follow-up: Home**) opens **Home**: eve
113
113
 
114
114
  - ⌘K: **Follow-up: Home**, **Follow-up: Search**, **Follow-up: Sign off & next**, **Follow-up: Later (tomorrow 09:00)**, **Follow-up: Next needs-you**, **Follow-up: Done while you were away**.
115
115
 
116
+ ### The Overseer (1.4 beta)
117
+
118
+ One agent you talk to about all your workspaces. It sits pinned at the top of Home's list, under the morning brief. Click **Start the Overseer** once, and Follow-up creates it in its own workspace, which is never tracked, never shown under Needs you, and never sent repairs. Its row shows whether it is idle, working, or asking you something. Selecting it opens the conversation in the right pane with a reply box, and **Open full** opens its chat.
119
+
120
+ - **It routes your asks; it doesn't do the work.** "Tell the HER-1312 agent to use option A" goes to the agent that owns HER-1312, and the Overseer answers in one line: "Sent to Okta SCIM sync (key HER-1312)". It scores candidates by Linear key, PR number, branch, workspace name, open asks and recent activity. When no candidate stands out, it asks you with a decision (the top two or three plus **New workspace**) instead of guessing.
121
+ - **What it forwards keeps your voice.** A forwarded message starts "From Tom via Overseer:". It clears that agent's Needs-you flag only when it answers the agent's open ask. A new task leaves the ask standing.
122
+ - **New workspaces only on your word.** It starts one, branched off main and named from the task, only after you asked or picked **New workspace**, and only through a dry run and confirm.
123
+ - **Never merges, approves, closes, archives or posts to people.** Those stay yours.
124
+ - **It is cheap to keep.** Each turn begins with a digest of what changed since the last one, built from Paseo's workspace metadata and Follow-up's own state. That's about 800 tokens at 100 workspaces, with resting workspaces in one line. The digest file is rewritten only when its content changes, and not at all while the resource governor pauses background work. The Overseer never reads the timeline of an agent that isn't loaded, because that would load the agent for an hour. Instead it reads the agent's transcript from disk, or Follow-up's cached goal and PRs. Sending to a resting agent wakes it, so that happens only when you ask for it, and the reply says "woke …".
125
+ - **Archived it by accident?** Follow-up starts a new one with a handoff from the old one's last steps.
126
+
127
+ Turn it off under Settings → **Overseer (beta)**.
128
+
129
+ ![Home with the Overseer selected: the pinned row asks which agent should take a broken export, and the pane shows the conversation, the routed task and the decision with two candidates plus New workspace](docs/media/overseer/overseer-dark.png)
130
+
116
131
  Install the beta:
117
132
 
118
133
  ```sh
119
- paseo plugin update follow-through --version 1.3.0-beta.4
134
+ paseo plugin update follow-through --version 1.4.0-beta.0
120
135
  # or, for a fresh install:
121
136
  paseo plugin install npm:paseo-follow-up@beta
122
137
  ```
package/client/brief.tsx CHANGED
@@ -141,14 +141,22 @@ export function BriefCard({ item, theme, layout, agentId, deps, embedded = false
141
141
  </View>;
142
142
 
143
143
  if (b.slim) {
144
- // One line. Permission: Paseo's own prompt below is the control (F9). Fallback: the paragraph is right above.
144
+ // Permission: Paseo's own prompt below is the control (F9). Fallback: the paragraph is right above.
145
+ // The label and age share the top line so the ask always gets the full width; at a narrow panel the move wraps under it.
145
146
  return <View accessibilityRole="summary" accessibilityLabel={`${acts ? "Needs you: " : ""}${b.ask}. ${b.sourceLine}`}
146
- style={{ marginVertical: 10, flexDirection: "row", alignItems: "center", flexWrap: compact ? "wrap" : "nowrap", gap: 8, minHeight: 40, paddingHorizontal: 12, paddingVertical: 8, borderRadius: 10, borderWidth: 1, borderColor: border }}>
147
- <Icon name={ICON[b.kind]} size={14} color={acts ? attention : tone} />
148
- {acts && <Text style={{ color: attention, fontSize: 12, lineHeight: 16, fontWeight: "600" }}>Needs you</Text>}
149
- <Text style={{ flex: 1, minWidth: compact ? 160 : 0, color: acts ? c.foreground : c.foregroundMuted, fontSize: 14, lineHeight: 20, fontWeight: acts ? "600" : "400" }}>{b.ask}</Text>
150
- {!embedded && moves.map(m => <Btn key={m.kind} label={m.label} onPress={() => press(m)} c={c} compact={compact} />)}
151
- <Text style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16, fontVariant: ["tabular-nums"] }}>{ageText}</Text>
147
+ style={{ marginVertical: embedded ? 0 : 10, gap: 4, paddingHorizontal: 12, paddingVertical: 10, borderRadius: 10, borderWidth: 1, borderColor: border }}>
148
+ <View style={{ flexDirection: "row", alignItems: "center", gap: 7 }}>
149
+ <Icon name={ICON[b.kind]} size={14} color={tone} />
150
+ <Text numberOfLines={1} style={{ flexShrink: 1, color: acts ? attention : tone, fontSize: 12, lineHeight: 16, fontWeight: "600" }}>{acts ? "Needs you" : word(b.kind)}</Text>
151
+ <View style={{ flex: 1 }} />
152
+ <Text style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16, fontVariant: ["tabular-nums"] }}>{ageText}</Text>
153
+ </View>
154
+ <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", columnGap: 10, rowGap: 8 }}>
155
+ <Text numberOfLines={3} {...(Platform.OS === "web" ? { title: b.ask } as object : {})}
156
+ style={{ flexGrow: 1, flexShrink: 1, flexBasis: 200, minWidth: 0, color: acts ? c.foreground : c.foregroundMuted, fontSize: 14, lineHeight: 20, fontWeight: acts ? "600" : "400" }}>{b.ask}</Text>
157
+ {!embedded && moves.map(m => <Btn key={m.kind} label={busy === m.kind ? `${m.label}…` : m.label} icon={MOVE_ICON[m.kind]} disabled={!!busy} onPress={() => press(m)} c={c} compact={compact} />)}
158
+ </View>
159
+ {!!error && <Text accessibilityRole="alert" style={{ color: c.statusDanger, fontSize: 13, lineHeight: 18 }}>{error}</Text>}
152
160
  </View>;
153
161
  }
154
162
 
@@ -171,7 +179,7 @@ export function BriefCard({ item, theme, layout, agentId, deps, embedded = false
171
179
  </View>
172
180
 
173
181
  {b.decisions.map((d, i) => <View key={d.id} style={{ gap: 8 }}>
174
- <Text style={{ color: c.foreground, fontSize: 14, lineHeight: 20 }}>{b.decisions.length > 1 ? `${i + 1}. ` : ""}{d.question}</Text>
182
+ {(b.decisions.length > 1 || d.question.trim() !== b.ask.trim()) && <Text style={{ color: c.foreground, fontSize: 14, lineHeight: 20 }}>{b.decisions.length > 1 ? `${i + 1}. ` : ""}{d.question}</Text>}
175
183
  {d.options.length > 0 && <View style={{ gap: 6 }}>
176
184
  {d.options.map(o => <OptionRow key={o.letter} option={o} recommended={d.recommend === o.letter} sending={busy === `${d.id}:${o.letter}`} disabled={!!busy} tight={tight}
177
185
  open={!!open[`${d.id}:${o.letter}`]} onToggle={() => setOpen(v => ({ ...v, [`${d.id}:${o.letter}`]: !v[`${d.id}:${o.letter}`] }))}
@@ -63,6 +63,11 @@ export function DisplaySections({ theme }: Pick<PluginSurfaceProps, "theme">) {
63
63
  </SettingsCard>
64
64
  {settings.values.enable_inbox && !!share.data?.briefStats && <Text style={{ color: theme.colors.foregroundMuted, fontSize: 12, lineHeight: 17, paddingHorizontal: 4 }}>{briefShareText(share.data.briefStats)}</Text>}
65
65
  </SettingsSection>
66
+ <SettingsSection title="Overseer (beta)" info="One agent you can ask about all your work. It sends each task to the agent that owns it and asks you when it isn't sure.">
67
+ <SettingsCard>
68
+ <SettingsSwitch label="Overseer" hint="Off hides its row on Home and stops its digest. An Overseer you already started stays in its workspace; Follow-up never archives it." value={settings.values.enable_overseer} disabled={settings.saving} onValueChange={(enable_overseer) => save({ enable_overseer })} />
69
+ </SettingsCard>
70
+ </SettingsSection>
66
71
  </>
67
72
  );
68
73
  }
@@ -75,8 +75,9 @@ export function useHomeModel(sources: HomeSources): HomeModel {
75
75
  // Only the sort and priorities rebuild the model; agent titles and usage don't touch it.
76
76
  const sort = useSyncExternalStore(extras.subscribe, extras.sort, extras.sort);
77
77
  const priorities = useSyncExternalStore(extras.subscribe, extras.priorities, extras.priorities);
78
+ const overseer = useSyncExternalStore(extras.subscribe, () => extras.overseer()?.workspaceId ?? null, () => null);
78
79
  const now = useMinute();
79
- return useMemo(() => buildHome({ rows: inbox.rows(), tracked: live.all(), paseo: paseo.all(), now: Date.now(), sort, priorities }), [a, b, c, now, sort, priorities, inbox, live, paseo]);
80
+ return useMemo(() => buildHome({ rows: inbox.rows(), tracked: live.all(), paseo: paseo.all(), now: Date.now(), sort, priorities, hidden: overseer ? [overseer] : [] }), [a, b, c, now, sort, priorities, inbox, live, paseo, overseer]);
80
81
  }
81
82
 
82
83
  /** Rebuilds a value at most every `ms` while mounted (used for the brief pane's source ages). */
@@ -18,9 +18,13 @@ import type { Theme } from "./kit";
18
18
 
19
19
  const QUIET_PAGE = 20;
20
20
  export const BRIEF_KEY = "brief";
21
+ export const OVERSEER_KEY = "overseer";
22
+ /** The pinned Overseer row: not started yet (a one-time Start), working, asking, idle, or failed to come back. */
23
+ export type OverseerRowState = { state: "start" | "idle" | "running" | "asks" | "error"; line: string };
21
24
 
22
25
  type Entry =
23
26
  | { type: "brief"; key: string }
27
+ | { type: "overseer"; key: string }
24
28
  | { type: "header"; key: string; group: HomeGroupId; title: string; count: number; open: boolean }
25
29
  | { type: "row"; key: string; s: Workstream }
26
30
  | { type: "fold"; key: string; project: string; count: number; archivable: number; open: boolean }
@@ -50,9 +54,11 @@ export type HomeListProps = {
50
54
  onResult?: (item: OmniboxItem) => void;
51
55
  /** The status strip's filter: only this group, expanded. */
52
56
  filter?: HomeGroupId | null;
57
+ /** The pinned Overseer row under the brief. Absent: the Overseer is off (or this surface has none). */
58
+ overseer?: OverseerRowState | null;
53
59
  };
54
60
 
55
- export function HomeList({ model, theme, dense = false, touch, selectedKey, onSelect, briefLine, renderExpanded, header, footer, top, results, activeResult = 0, onResult, filter = null }: HomeListProps) {
61
+ export function HomeList({ model, theme, dense = false, touch, selectedKey, onSelect, briefLine, renderExpanded, header, footer, top, results, activeResult = 0, onResult, filter = null, overseer = null }: HomeListProps) {
56
62
  const c = theme.colors;
57
63
  const [closed, setClosed] = useState<Set<string>>(new Set(["quiet"]));
58
64
  const [openProjects, setOpenProjects] = useState<Set<string>>(new Set());
@@ -73,6 +79,7 @@ export function HomeList({ model, theme, dense = false, touch, selectedKey, onSe
73
79
  return out;
74
80
  }
75
81
  if (briefLine !== undefined && !filter) out.push({ type: "brief", key: BRIEF_KEY });
82
+ if (overseer && !filter) out.push({ type: "overseer", key: OVERSEER_KEY });
76
83
  for (const g of model.groups) {
77
84
  if (filter && g.id !== filter) continue;
78
85
  const open = !!filter || !closed.has(g.id);
@@ -91,7 +98,7 @@ export function HomeList({ model, theme, dense = false, touch, selectedKey, onSe
91
98
  return out;
92
99
  if (filter && !out.length) out.push({ type: "label", key: "l:empty", text: `Nothing in ${GROUP_TITLE[filter as HomeGroupId]} right now.` });
93
100
  return out;
94
- }, [model, closed, openProjects, pages, briefLine, results, filter]);
101
+ }, [model, closed, openProjects, pages, briefLine, results, filter, !!overseer]);
95
102
 
96
103
  const render = useCallback(({ item }: { item: Entry }) => {
97
104
  switch (item.type) {
@@ -99,6 +106,7 @@ export function HomeList({ model, theme, dense = false, touch, selectedKey, onSe
99
106
  letterSpacing: item.key === "l:archived" ? 0.6 : 0, textTransform: item.key === "l:archived" ? "uppercase" : "none", paddingHorizontal: dense ? 8 : 16, paddingTop: 12, paddingBottom: 4 }}>{item.text}</Text>;
100
107
  case "result": return <ResultRow item={item.item} s={model.byKey.get(item.item.key)} theme={theme} active={item.index === activeResult} dense={dense} touch={touch} onPress={() => onResult?.(item.item)} />;
101
108
  case "brief": return <BriefRow theme={theme} line={briefLine ?? ""} selected={selectedKey === null || selectedKey === BRIEF_KEY} touch={touch} onSelect={onSelect} />;
109
+ case "overseer": return overseer ? <OverseerRow theme={theme} o={overseer} selected={selectedKey === OVERSEER_KEY} touch={touch} onSelect={onSelect} /> : null;
102
110
  case "header": return <GroupHeader theme={theme} title={item.title} count={item.count} open={item.open} tone={item.group === "needs" && item.count ? c.statusWarning : undefined} dense={dense} touch={touch} onPress={() => toggle(item.group)} />;
103
111
  case "fold": return <Pressable accessibilityRole="button" aria-expanded={item.open} accessibilityState={{ expanded: item.open }} accessibilityLabel={`${item.project}, ${item.count}. ${item.open ? "Collapse" : "Expand"}`} onPress={() => toggleProject(item.project)}
104
112
  style={state => ({ flexDirection: "row", alignItems: "center", gap: 8, minHeight: touch ? 44 : dense ? 28 : 34, paddingHorizontal: dense ? 8 : 16, backgroundColor: (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
@@ -119,7 +127,7 @@ export function HomeList({ model, theme, dense = false, touch, selectedKey, onSe
119
127
  </View>;
120
128
  }
121
129
  }
122
- }, [theme, c, dense, touch, selectedKey, onSelect, briefLine, renderExpanded, toggle, toggleProject, activeResult, onResult, model]);
130
+ }, [theme, c, dense, touch, selectedKey, onSelect, briefLine, renderExpanded, toggle, toggleProject, activeResult, onResult, model, overseer?.state, overseer?.line]);
123
131
 
124
132
  const listRef = useRef<FlatList<Entry>>(null);
125
133
  // Keep the keyboard-active result in view.
@@ -156,6 +164,20 @@ function BriefRow({ theme, line, selected, touch, onSelect }: { theme: Theme; li
156
164
  </Pressable>;
157
165
  }
158
166
 
167
+ function OverseerRow({ theme, o, selected, touch, onSelect }: { theme: Theme; o: OverseerRowState; selected: boolean; touch: boolean; onSelect: (key: string) => void }) {
168
+ const c = theme.colors;
169
+ const tone = o.state === "asks" ? c.statusWarning : o.state === "error" ? c.statusDanger : o.state === "running" ? runningColor(c) : c.foregroundMuted;
170
+ return <Pressable accessibilityRole="button" accessibilityState={{ selected }} accessibilityLabel={`Overseer. ${o.line}`} onPress={() => onSelect(OVERSEER_KEY)}
171
+ style={state => ({ flexDirection: "row", alignItems: "center", gap: 10, minHeight: touch ? 52 : 40, paddingLeft: 14, paddingRight: 16, borderBottomWidth: 1, borderBottomColor: c.border,
172
+ // Its ask isn't a Needs-you row (it's yours to route), so the edge marks it the way blocking rows are marked.
173
+ borderLeftWidth: 2, borderLeftColor: o.state === "asks" || o.state === "error" ? withAlpha(tone, 0.9) : "transparent",
174
+ backgroundColor: selected ? c.surface2 : (state as { hovered?: boolean }).hovered ? c.surface1 : "transparent" })}>
175
+ {o.state === "running" ? <Spinner color={tone} size={13} label="Overseer working" /> : <Icon name="MessagesSquare" size={15} color={o.state === "idle" || o.state === "start" ? c.foregroundMuted : tone} />}
176
+ <Text style={{ color: c.foreground, fontSize: 13, fontWeight: "600" }}>Overseer</Text>
177
+ <Text numberOfLines={1} style={{ flex: 1, color: o.state === "asks" || o.state === "error" ? tone : c.foregroundMuted, fontSize: 12 }}>{o.line}</Text>
178
+ </Pressable>;
179
+ }
180
+
159
181
  export function glyphColor(s: Pick<Workstream, "tone">, c: Colors): string {
160
182
  return s.tone === "running" ? runningColor(c) : s.tone === "success" ? c.statusSuccess : headlineColor(s.tone, c);
161
183
  }
@@ -1,5 +1,6 @@
1
1
  import type { PluginClientContext } from "@getpaseo/plugin/client";
2
- import { prioritiesRpc, usageRpc } from "../shared/contracts";
2
+ import { overseerStartRpc, overseerStatusRpc, prioritiesRpc, usageRpc } from "../shared/contracts";
3
+ import type { RpcOutput } from "@getpaseo/plugin";
3
4
  import type { Priority } from "../shared/priorities";
4
5
  import { DEFAULT_SORT, isSortMode, type SortMode } from "../shared/sort";
5
6
  import type { AgentLite } from "../shared/search";
@@ -26,6 +27,7 @@ export function createHomeExtras(client: PluginClientContext) {
26
27
  let sort: SortMode = isSortMode(saved) ? saved : DEFAULT_SORT;
27
28
  let priorities: Priority[] = [];
28
29
  let usage: Usage = NO_USAGE;
30
+ let overseer: RpcOutput<typeof overseerStatusRpc> | null = null;
29
31
  const agents = new Map<string, AgentLite>();
30
32
  let version = 0;
31
33
  let focusToken = 0;
@@ -46,6 +48,11 @@ export function createHomeExtras(client: PluginClientContext) {
46
48
  if (JSON.stringify(next) === JSON.stringify(priorities)) return false;
47
49
  priorities = next; return true;
48
50
  });
51
+ poll(10_000, async () => {
52
+ const next = await client.rpc(overseerStatusRpc, {});
53
+ if (JSON.stringify(next) === JSON.stringify(overseer)) return false;
54
+ overseer = next; return true;
55
+ });
49
56
  poll(USAGE_POLL_MS, async () => {
50
57
  const next = await client.rpc(usageRpc, {});
51
58
  if (JSON.stringify(next) === JSON.stringify(usage)) return false;
@@ -87,6 +94,9 @@ export function createHomeExtras(client: PluginClientContext) {
87
94
  setSort(next: SortMode) { if (next === sort) return; sort = next; storage.set(SORT_KEY, next); emit(); },
88
95
  priorities: () => priorities,
89
96
  usage: () => usage,
97
+ /** The Overseer: off, not started yet, or its agent and workspace. */
98
+ overseer: () => overseer,
99
+ async startOverseer() { overseer = await client.rpc(overseerStartRpc, {}); emit(); return overseer; },
90
100
  agents: () => [...agents.values()],
91
101
  /** Bumped by ⌘K "Follow-up: Search"; the visible search field focuses when it changes. */
92
102
  focusToken: () => focusToken,
package/client/home.tsx CHANGED
@@ -14,7 +14,8 @@ import { Button, IconButton, text, type Theme } from "./kit";
14
14
  import { NeedsYouList } from "./needs-you";
15
15
  import { PrSheet } from "./pr-sheet";
16
16
  import { QuestionSheet } from "./questions";
17
- import { Age, BadgeView, BRIEF_KEY, glyphColor, HomeList, PrChipView } from "./home-list";
17
+ import { Age, BadgeView, BRIEF_KEY, glyphColor, HomeList, OVERSEER_KEY, PrChipView, type OverseerRowState } from "./home-list";
18
+ import { answerLine, overseerRowState } from "../shared/overseer";
18
19
  import { ListTop, SearchField, SortMenu, StatusStrip, UsageMeters, useOmnibox, useSlashToFocus } from "./home-chrome";
19
20
  import { useHomeModel, useTick, type HomeSources } from "./home-data";
20
21
  import { useInbox, UndoBar, useNextRelay } from "./inbox";
@@ -56,6 +57,9 @@ export function FollowHome(props: PluginScreenProps & { deps: HomeDeps }) {
56
57
  const tracked = useSyncExternalStore(deps.sources.live.subscribe, deps.sources.live.version, deps.sources.live.version);
57
58
  const rows = useInbox(inbox, () => inbox.rows());
58
59
  const pane = useMemo(() => briefPane({ model, rows, tracked: deps.sources.live.all(), now: Date.now() }), [model, rows, tracked, deps.sources.live]);
60
+ const overseerStatus = useSyncExternalStore(deps.sources.extras.subscribe, deps.sources.extras.overseer, deps.sources.extras.overseer);
61
+ const overseerInbox = useInbox(inbox, () => inbox.overseer());
62
+ const overseer = overseerRowState(overseerStatus, overseerInbox);
59
63
  const briefLine = [pane.counts.needs ? `${pane.counts.needs} need you` : "Nothing needs you", pane.counts.fixing ? `${pane.counts.fixing} being fixed` : "", pane.away.count ? `${pane.away.count} done while away` : ""].filter(Boolean).join(" · ");
60
64
 
61
65
  const openFull = useCallback((s: Workstream) => {
@@ -72,11 +76,13 @@ export function FollowHome(props: PluginScreenProps & { deps: HomeDeps }) {
72
76
 
73
77
  if (params.view === "log") return <LogView theme={theme} compact={compact} sources={deps.sources} onHome={deps.openHome} onOpen={key => { setSelected(key); deps.openHome(); }} />;
74
78
 
75
- const detail = current
79
+ const detail = selected === OVERSEER_KEY && overseer
80
+ ? <OverseerPane theme={theme} compact={compact} o={overseer} agentId={overseerStatus?.agentId ?? null} deps={deps} navigation={navigation} onBack={compact ? () => setSelected(null) : undefined} />
81
+ : current
76
82
  ? <DetailPane key={current.key} s={current} model={model} theme={theme} compact={compact} deps={deps} openFull={openFull} signOffNext={signOffNext} onBack={compact ? () => setSelected(null) : undefined} />
77
83
  : <BriefPane theme={theme} compact={compact} pane={pane} onSelect={key => setSelected(key)} openLog={deps.openLog} sources={deps.sources} />;
78
84
  const list = <HomeList model={model} theme={theme} dense={compact} touch={compact} selectedKey={selected} onSelect={onSelect} briefLine={briefLine}
79
- results={omnibox.results} activeResult={omnibox.active} onResult={item => setSelected(item.key)} filter={filter}
85
+ results={omnibox.results} activeResult={omnibox.active} onResult={item => setSelected(item.key)} filter={filter} overseer={overseer}
80
86
  top={<ListTop theme={theme} dense={compact} title={<ListHeader theme={theme} compact={compact} onSettings={deps.openSettings} />}>
81
87
  {/* zIndex: on web every View is its own stacking context, so the sort menu only paints and hit-tests above the
82
88
  strip and meters below if this row sits above them. */}
@@ -89,7 +95,7 @@ export function FollowHome(props: PluginScreenProps & { deps: HomeDeps }) {
89
95
  </ListTop>} />;
90
96
 
91
97
  if (compact) return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
92
- {current ? detail : list}
98
+ {current || selected === OVERSEER_KEY && overseer ? detail : list}
93
99
  <View style={{ position: "absolute", left: 12, right: 12, bottom: 12 }}><UndoBar store={inbox} theme={theme} touch /></View>
94
100
  </View>;
95
101
  return <View style={{ flex: 1, flexDirection: "row", backgroundColor: c.surface0 }}>
@@ -135,7 +141,7 @@ const seenSteps = new Map<string, { steps: TailStep[]; at: number }>();
135
141
  * Reading a timeline loads an unloaded agent for an hour (see shared/agent-load.ts), so an agent that isn't loaded
136
142
  * shows the steps Home saw last (marked with when) and waits for an explicit "Load recent steps".
137
143
  */
138
- function useTail(handle: ReturnType<typeof useAgentLive>["handle"], key: string) {
144
+ function useTail(handle: ReturnType<typeof useAgentLive>["handle"], key: string, n = 6) {
139
145
  const [steps, setSteps] = useState<TailStep[] | null>(null);
140
146
  const [error, setError] = useState<string | null>(null);
141
147
  const [seenAt, setSeenAt] = useState<number | null>(null);
@@ -160,12 +166,12 @@ function useTail(handle: ReturnType<typeof useAgentLive>["handle"], key: string)
160
166
  handle.timeline.refetch({ direction: "tail", limit: 40 }).then(page => {
161
167
  if (!live) return;
162
168
  const entries = [...(page as unknown as { entries: { seqStart: number; item: Parameters<typeof tailSteps>[0][number] }[] }).entries].sort((a, b) => a.seqStart - b.seqStart);
163
- const next = tailSteps(entries.map(e => e.item), 6);
169
+ const next = tailSteps(entries.map(e => e.item), n);
164
170
  seenSteps.set(handle.id, { steps: next, at: Date.now() }); setSteps(next); setSeenAt(null); setError(null);
165
171
  }).catch(e => { if (live) { setError(errorText(e)); setSteps(s => s ?? []); } })
166
172
  .finally(() => { if (live) setLoading(false); });
167
173
  return () => { live = false; };
168
- }, [handle, key, wake, unknown]);
174
+ }, [handle, key, wake, unknown, n]);
169
175
  return { steps, error, seenAt, asleep, loading, woken: wake > 0, load: () => setWake(n => n + 1) };
170
176
  }
171
177
 
@@ -260,6 +266,59 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, onB
260
266
  </View>;
261
267
  }
262
268
 
269
+ /**
270
+ * The Overseer's conversation on Home (1.4.0-beta.0): the tail and a reply box, like any agent's detail pane, plus its
271
+ * decision card when it asks which agent should get a task. Before the first start, one Start button.
272
+ */
273
+ function OverseerPane({ theme, compact, o, agentId, deps, navigation, onBack }: { theme: Theme; compact: boolean; o: OverseerRowState; agentId: string | null; deps: HomeDeps; navigation: PluginScreenProps["navigation"]; onBack?: () => void }) {
274
+ const c = theme.colors; const t = text(c);
275
+ const toast = useToast();
276
+ const { inbox, extras } = deps.sources;
277
+ const row = useInbox(inbox, () => inbox.overseer());
278
+ const agent = useAgentLive(agentId);
279
+ const tail = useTail(agent.handle, `${row?.seq ?? 0}:${agent.status ?? ""}`, 8);
280
+ const readBrief = useRpc(inboxBriefRpc);
281
+ const brief = useQuery({ queryKey: ["follow-through", "overseer-brief", agentId, row?.seq ?? 0], queryFn: () => readBrief({ agentId: agentId! }), enabled: !!agentId && !!row?.brief });
282
+ const b = brief.data?.brief?.state === "open" ? brief.data.brief : null;
283
+ const [starting, setStarting] = useState(false);
284
+ const start = async () => {
285
+ if (starting) return; setStarting(true);
286
+ try { await extras.startOverseer(); toast.show("The Overseer is ready", { variant: "success" }); } catch (e) { toast.error(errorText(e)); } finally { setStarting(false); }
287
+ };
288
+ const header = <View style={{ paddingHorizontal: compact ? 16 : 20, paddingTop: 12, paddingBottom: 12, gap: 4, borderBottomWidth: 1, borderBottomColor: c.border }}>
289
+ <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
290
+ {onBack && <IconButton theme={theme} compact icon="ChevronLeft" label="Back to Home" onPress={onBack} />}
291
+ <Icon name="MessagesSquare" size={16} color={c.foreground} />
292
+ <Text accessibilityRole="header" style={[t.title, { flex: 1, fontSize: 16 }]}>Overseer</Text>
293
+ {agentId && navigation && (compact
294
+ ? <IconButton theme={theme} compact icon="PanelRightOpen" label="Open full" onPress={() => navigation.openAgent({ agentId })} />
295
+ : <Button theme={theme} icon="PanelRightOpen" title="Open full" accessibilityHint="Opens the Overseer's whole chat" onPress={() => navigation.openAgent({ agentId })} />)}
296
+ </View>
297
+ </View>;
298
+ if (o.state === "start") return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
299
+ {header}
300
+ <ScrollView contentContainerStyle={{ padding: compact ? 16 : 20, gap: 12 }}>
301
+ <Text style={[t.body, { fontSize: 15, lineHeight: 22 }]}>One Claude agent that knows every workspace's state. Tell it "the PRs look good, assign reviewers on all" or "tell the SCIM agent to use option B", and it finds the right agent and passes it on.</Text>
302
+ <Text style={t.meta}>It never merges, posts to people or archives. It starts a new workspace only when you say so. It runs on Opus in its own workspace, which stays off your lists.</Text>
303
+ <View style={{ flexDirection: "row" }}><Button theme={theme} compact={compact} kind="primary" icon="Play" title="Start the Overseer" loading={starting} onPress={() => void start()} /></View>
304
+ </ScrollView>
305
+ </View>;
306
+ return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
307
+ {header}
308
+ <ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: compact ? 16 : 20, gap: 12, paddingBottom: 24 }} keyboardShouldPersistTaps="handled">
309
+ {o.state === "error" && <Text accessibilityRole="alert" style={[t.body, { color: c.statusDanger }]}>{o.line}</Text>}
310
+ {tail.steps === null ? <Spinner color={c.foregroundMuted} size={12} label="Loading the conversation" />
311
+ : tail.steps.length === 0 ? <Text style={t.meta}>{tail.error ? `Couldn't load the conversation: ${tail.error}` : "Nothing yet. Ask it what needs you, or give it a task for one of your agents."}</Text>
312
+ : tail.steps.map((step, i) => <Step key={i} step={step} c={c} last={i === tail.steps!.length - 1} />)}
313
+ {o.state === "running" && <Spinner color={c.foregroundMuted} size={12} label="The Overseer is working" />}
314
+ {/* Its open ask, after the conversation that led to it. Only something Tom can act on; never "No ask stated". */}
315
+ {b && agentId && (b.kind === "decision" && b.decisions.some(d => d.options.length) || b.kind === "action") ? <BriefCard {...({ embedded: true, item: { data: b }, theme, layout: { compact }, agentId, deps: deps.briefDeps } as unknown as Parameters<typeof BriefCard>[0])} /> : null}
316
+ </ScrollView>
317
+ {agentId && <ReplyBox theme={theme} compact={compact} agentName="the Overseer" placeholder="Ask or give a task: “assign reviewers on all ready PRs”" hint={null}
318
+ onSend={async message => { await agent.handle!.send(message); inbox.refresh(); }} />}
319
+ </View>;
320
+ }
321
+
263
322
  function Step({ step, c, last }: { step: TailStep; c: Colors; last: boolean }) {
264
323
  const t = text(c);
265
324
  if (step.kind === "tool") return <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
@@ -267,7 +326,7 @@ function Step({ step, c, last }: { step: TailStep; c: Colors; last: boolean }) {
267
326
  <Text numberOfLines={1} style={[t.meta, { flex: 1, fontFamily: mono }]}>{step.text}</Text>
268
327
  </View>;
269
328
  if (step.kind === "you") return <View style={{ padding: 10, borderRadius: 8, backgroundColor: c.surface1, gap: 3 }}>
270
- <Text style={t.small}>You</Text><Text numberOfLines={3} style={t.body}>{step.text}</Text>
329
+ <Text style={t.small}>You</Text><Text numberOfLines={3} style={t.body}>{answerLine(step.text) ?? step.text}</Text>
271
330
  </View>;
272
331
  if (step.kind === "error") return <Text numberOfLines={4} style={[t.body, { color: c.statusDanger }]}>{step.text}</Text>;
273
332
  return <Text selectable numberOfLines={last ? 40 : 4} style={[t.body, { lineHeight: 19 }]}>{step.text.replace(/\*\*/g, "")}</Text>;
@@ -300,7 +359,7 @@ function PermissionBlock({ p, theme, compact, busy, primary, onRespond }: { p: P
300
359
  }
301
360
 
302
361
  /** The reply box. Sending is the developer writing to the agent, which clears Needs you (binding rule). */
303
- function ReplyBox({ theme, compact, agentName, onSend }: { theme: Theme; compact: boolean; agentName: string; onSend: (text: string) => Promise<void> }) {
362
+ function ReplyBox({ theme, compact, agentName, onSend, placeholder = "Answer in your own words", hint = "Sending clears Needs you. Sign off & next moves on without a reply." }: { theme: Theme; compact: boolean; agentName: string; onSend: (text: string) => Promise<void>; placeholder?: string; hint?: string | null }) {
304
363
  const c = theme.colors;
305
364
  const toast = useToast();
306
365
  const [value, setValue] = useState("");
@@ -314,12 +373,12 @@ function ReplyBox({ theme, compact, agentName, onSend }: { theme: Theme; compact
314
373
  };
315
374
  return <View style={{ padding: compact ? 12 : 14, borderTopWidth: 1, borderTopColor: c.border, gap: 6 }}>
316
375
  <View style={{ flexDirection: "row", alignItems: "flex-end", gap: 8, borderRadius: 10, borderWidth: 1, borderColor: c.border, backgroundColor: c.surface1, paddingLeft: 12, paddingRight: 6, paddingVertical: 6 }}>
317
- <TextInput accessibilityLabel={`Reply to ${agentName}`} value={value} onChangeText={setValue} placeholder="Answer in your own words" placeholderTextColor={c.foregroundMuted} multiline
376
+ <TextInput accessibilityLabel={`Reply to ${agentName}`} value={value} onChangeText={setValue} placeholder={placeholder} placeholderTextColor={c.foregroundMuted} multiline
318
377
  onKeyPress={e => { const k = e.nativeEvent as unknown as { key: string; metaKey?: boolean; ctrlKey?: boolean }; if (k.key === "Enter" && (k.metaKey || k.ctrlKey)) void send(); }}
319
378
  style={{ flex: 1, minHeight: compact ? 44 : 36, maxHeight: 140, color: c.foreground, fontSize: 14, lineHeight: 20, paddingVertical: 6, ...(Platform.OS === "web" ? { outlineStyle: "none" } as object : {}) }} />
320
379
  <IconButton theme={theme} compact={compact} icon="ArrowUp" label="Send" disabled={!value.trim() || sending} spinning={sending} onPress={() => void send()} color={value.trim() ? c.foreground : undefined} />
321
380
  </View>
322
- <Text style={{ color: c.foregroundMuted, fontSize: 11, lineHeight: 15 }}>Sending clears Needs you. Sign off & next moves on without a reply.</Text>
381
+ {!!hint && <Text style={{ color: c.foregroundMuted, fontSize: 11, lineHeight: 15 }}>{hint}</Text>}
323
382
  </View>;
324
383
  }
325
384
 
@@ -89,6 +89,8 @@ export function createInboxStore(client: PluginClientContext) {
89
89
  enabled: () => enabled && (data?.enabled ?? true),
90
90
  data: () => data,
91
91
  rows: () => (enabled && data?.enabled ? data.rows : []),
92
+ /** The Overseer's own row: never in rows, never counted (1.4.0-beta.0). */
93
+ overseer: () => data?.overseer ?? null,
92
94
  offlineSince: () => offlineSince,
93
95
  cameBack: () => cameBack,
94
96
  clearCameBack() { cameBack = []; emit(); },
package/index.server.ts CHANGED
@@ -39,8 +39,11 @@ import { ListCache } from "./server/list-cache";
39
39
  import { scopeWriter } from "./server/scopes";
40
40
  import { batchArchive, pruneUnsent } from "./server/batch-archive";
41
41
  import { NO_USAGE } from "./shared/usage";
42
- import { conversationGone, DEFAULT_ACTIVE_WINDOW_DAYS } from "./server/agent-load";
42
+ import { activeWindowMs, conversationGone, DEFAULT_ACTIVE_WINDOW_DAYS } from "./server/agent-load";
43
43
  import { ACTIVE_SCOPE_MIGRATION, PRUNE_MIGRATION, autoSendsByDefault, FOLLOW_EVERY_MIGRATION, followsByDefault, followsEvery, migrateFollowEvery, optedOut } from "./shared/settings";
44
+ import { Overseer, OVERSEER_TOOLS, type OverseerPaseo, type OverseerTool } from "./server/overseer";
45
+ import { OVERSEER_LABEL } from "./shared/overseer";
46
+ import { pages, withDaemon } from "./server/daemon";
44
47
  import { BRIEF_KIND, BRIEF_VERSION, prState, validateNeedsYou, type Brief, type NeedsYouRecord } from "./shared/brief";
45
48
 
46
49
  export default function contribute(server: PluginServerContext) {
@@ -81,8 +84,10 @@ export default function contribute(server: PluginServerContext) {
81
84
  };
82
85
  const needsYouPath = (agentId: string) => join(directory, "hook-state", `needs-you-${agentId}.json`);
83
86
  const trackedMain = async (agentId: string) => (await store.snapshot()).workspaces.find(w => w.enable_tracking && !w.archived && w.mainAgentId === agentId) ?? null;
87
+ let overseer: Overseer | null = null;
84
88
  const inbox: Inbox = new Inbox(directory, {
85
89
  enabled: inboxSettings,
90
+ overseer: async () => (await overseer?.state())?.agentId ?? null,
86
91
  briefs: {
87
92
  sink: append,
88
93
  async call(agentId) {
@@ -134,8 +139,10 @@ export default function contribute(server: PluginServerContext) {
134
139
  if (stopped || loadError) return;
135
140
  // Critical memory: the inbox's background reads wait too; hooks still record live events.
136
141
  if (!governor.allowsExtras()) { if (!stopped) inboxTimer = setTimeout(() => void inboxLoop(), 15_000); return; }
137
- try { await writeBriefState().catch(() => undefined); await inbox.tick(); await inbox.observeGuard(); await inbox.observeFollowUp(await store.snapshot()); inboxError = null; }
142
+ try { await writeBriefState().catch(() => undefined); await inbox.tick(); await inbox.reconcilePermissions(); await inbox.observeGuard(); await inbox.observeFollowUp(await store.snapshot()); inboxError = null; }
138
143
  catch (error) { inboxError = error instanceof Error ? error.message : "The Needs-you inbox couldn't update."; }
144
+ // The Overseer's digest for its next turn, and its recreation if it was archived. Never blocks the inbox.
145
+ if (overseer) { await overseer.writeDigest().catch(() => undefined); if (api) await overseer.ensure(api as unknown as OverseerPaseo, { periodic: true }).catch(() => undefined); }
139
146
  if (!stopped) inboxTimer = setTimeout(() => void inboxLoop(), 15_000);
140
147
  };
141
148
  // Hooks run in the background; an inbox failure never blocks the rest of Follow-up.
@@ -465,6 +472,26 @@ export default function contribute(server: PluginServerContext) {
465
472
  server.handle(rpc.requestReviewersRpc, async ({ workspaceId, prKey }) => { await requireReady(); const result = await actions.requestReviewers(workspaceId, prKey); void engine.tick(); return result; });
466
473
 
467
474
  const priorityStore = new PriorityStore(directory);
475
+ // Paseo's workspace descriptors for the Overseer (name, project, branch): metadata only, one paged read. The
476
+ // digest reuses it for a minute; the Overseer's own tool calls refresh it after 10 s.
477
+ type Descriptor = { id: string; name?: string | null; title?: string | null; projectId?: string | null; projectDisplayName?: string | null; projectCustomName?: string | null; activityAt?: string | null; archivingAt?: string | null; gitRuntime?: { currentBranch?: string | null } | null; githubRuntime?: { pullRequest?: { number?: number; title?: string } | null } | null };
478
+ let descriptors: { at: number; value: Promise<Descriptor[]> } | null = null;
479
+ const paseoWorkspaces = async (fresh = false) => {
480
+ if (!descriptors || Date.now() - descriptors.at > (fresh ? 10_000 : 60_000)) { const value = withDaemon(client => pages(cursor => client.fetchWorkspaces({ page: { limit: 100, ...(cursor ? { cursor } : {}) } })) as Promise<Descriptor[]>); descriptors = { at: Date.now(), value }; value.catch(() => { descriptors = null; }); }
481
+ return (await descriptors.value).filter(w => !w.archivingAt).map(w => ({ id: w.id, name: w.title || w.name || "Workspace", project: w.projectCustomName || w.projectDisplayName || null, projectId: w.projectId ?? null, activityAt: w.activityAt ?? null,
482
+ branch: w.gitRuntime?.currentBranch ?? null, pr: w.githubRuntime?.pullRequest?.title ? { number: w.githubRuntime.pullRequest.number ?? null, title: w.githubRuntime.pullRequest.title } : null }));
483
+ };
484
+ const overseerOn = async () => (await inboxSettings()).enable_overseer !== false;
485
+ overseer = new Overseer({ directory, store, inbox, priorities: priorityStore, workspaces: paseoWorkspaces, enabled: overseerOn, paseoHome, tight: async () => !governor.allowsBackground(),
486
+ windowMs: async () => activeWindowMs(await store.snapshot()), provider: process.env.FOLLOW_UP_OVERSEER_PROVIDER || undefined });
487
+ const overseerStatus = async () => { const s = await overseer!.state(); return { enabled: await overseerOn(), agentId: s.agentId, workspaceId: s.workspaceId, startedAt: s.startedAt, generation: s.generation, error: s.error }; };
488
+ server.handle(rpc.overseerStatusRpc, async () => { await requireReady(); return overseerStatus(); });
489
+ server.handle(rpc.overseerStartRpc, async (_input, { paseo }) => { await requireReady(); seen(paseo); await overseer!.start(paseo as unknown as OverseerPaseo); return overseerStatus(); });
490
+ server.handle(rpc.overseerActRpc, async ({ agentId, tool, args }, { paseo }) => {
491
+ await requireReady(); seen(paseo);
492
+ if (!(OVERSEER_TOOLS as readonly string[]).includes(tool)) throw new Error(`Unknown Overseer tool ${tool}.`);
493
+ return overseer!.act(paseo as unknown as OverseerPaseo, agentId, tool as OverseerTool, args);
494
+ });
468
495
  const agentActions = new AgentActions({ store, prActions: actions, engine, inbox, priorities: priorityStore });
469
496
  server.handle(rpc.prioritiesRpc, async () => ({ items: await priorityStore.read() }));
470
497
  // Provider limits are non-essential: at critical memory only the VM meter is served.
@@ -542,6 +569,9 @@ export default function contribute(server: PluginServerContext) {
542
569
  server.on("agent.permission_resolved", async (event, { paseo }) => { seen(paseo); inboxHook(async () => { await inbox.permissionResolved(event.agent, event.requestId); await writeBriefState(); }); }),
543
570
  server.on("agent.closed", async event => inboxHook(() => inbox.closed(event.agent))),
544
571
  server.on("agent.archived", async event => inboxHook(() => inbox.archived([event.agent.id]))),
572
+ // An archived Overseer comes back with a handoff summary (the next inbox tick also checks).
573
+ server.on("agent.archived", async (event, { paseo }) => { seen(paseo); inboxHook(async () => { if (event.agent.id === (await overseer!.state()).agentId) await overseer!.ensure(paseo as unknown as OverseerPaseo); }); }),
574
+ server.on("workspace.archived", async (event, { paseo }) => { seen(paseo); inboxHook(async () => { if (event.workspace.id === (await overseer!.state()).workspaceId) await overseer!.ensure(paseo as unknown as OverseerPaseo); }); }),
545
575
  server.on("workspace.archived", async event => inboxHook(() => inbox.workspaceArchived(event.workspace.id))),
546
576
  server.on("agent.turn_started", async event => {
547
577
  await ready;
@@ -561,6 +591,11 @@ export default function contribute(server: PluginServerContext) {
561
591
  server.before("agent.session_open", async ({ request }, { paseo }) => {
562
592
  await ready;
563
593
  if (loadError || stopped || request.purpose !== "interactive") return request;
594
+ // The Overseer: needs_you (no Stop-hook nudge), the action tools and its routing tools. Never tracked.
595
+ if (request.labels[OVERSEER_LABEL] === "1" && request.provider !== "codex") {
596
+ const env = { ...request.env, FOLLOW_THROUGH_OVERSEER: "1", FOLLOW_THROUGH_BRIEF: "claude" };
597
+ return withSessionMcp({ ...request, env }, directory, clientEntry(), paseoHome, false, process.env, "claude", true, true);
598
+ }
564
599
  const saved = await store.snapshot();
565
600
  let w = saved.workspaces.find(w => w.enable_tracking && !w.archived && (w.mainAgentId === request.agentId || w.batches.some(b => b.recipientAgentId === request.agentId && !b.settledAt && b.tasks.every(t => t.kind === "inventory") && ["sending", "sent", "uncertain", "blocked"].includes(b.state))));
566
601
  if (!w && request.workspaceId && !saved.workspaces.some(w => w.id === request.workspaceId && (w.archived || w.mainAgentId !== request.agentId))) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "paseo-follow-up",
3
3
  "private": false,
4
- "version": "1.3.0-beta.4",
4
+ "version": "1.4.0-beta.0",
5
5
  "description": "Follow every workspace PR stack in Paseo, answer agent questions, batch repairs for the main agent, and see what needs you.",
6
6
  "type": "module",
7
7
  "files": [
package/scripts/build.mjs CHANGED
@@ -3,3 +3,5 @@ const source = await readFile(new URL("../server/mcp.mjs", import.meta.url), "ut
3
3
  await writeFile(new URL("../server/mcp-source.ts", import.meta.url), `// Generated by scripts/build.mjs.\nexport const mcpSource = ${JSON.stringify(source)};\n`);
4
4
  const hook = await readFile(new URL("../server/agent-hook.mjs", import.meta.url), "utf8");
5
5
  await writeFile(new URL("../server/hook-source.ts", import.meta.url), `// Generated by scripts/build.mjs.\nexport const hookSource = ${JSON.stringify(hook)};\n`);
6
+ const overseer = await readFile(new URL("../server/overseer-prompt.md", import.meta.url), "utf8");
7
+ await writeFile(new URL("../server/overseer-prompt-source.ts", import.meta.url), `// Generated by scripts/build.mjs from server/overseer-prompt.md.\nexport const overseerPrompt = ${JSON.stringify(overseer)};\n`);
@@ -22,6 +22,43 @@ export function shouldNudge({ provider, brief, agentId, contributor, recovery, s
22
22
  if (!turn || turn.stopped || !turn.startedAt) return false;
23
23
  return !(called && called.at >= turn.startedAt);
24
24
  }
25
+ /**
26
+ * The Overseer's per-turn digest (1.4.0-beta.0). The daemon rewrites overseer-digest.json only when it changes (one line and a hash
27
+ * per workspace); this diffs it against what the Overseer saw last turn. Pure, so size and paging are testable.
28
+ * Kept to about 3k tokens: at most 20 needs lines and 30 changes, then a pointer to the workstreams tool.
29
+ */
30
+ export function overseerDigest(file, seen, now = Date.now(), { needsMax = 20, changedMax = 30, restingMax = 40, chars = 12_000 } = {}) {
31
+ const all = Array.isArray(file?.rows) ? file.rows : [];
32
+ const rows = all.filter(r => !r.resting);
33
+ const resting = all.filter(r => r.resting);
34
+ const prior = seen && typeof seen.rows === "object" && seen.rows ? seen.rows : null;
35
+ const age = Math.max(0, Math.round((now - Date.parse(file?.at ?? "")) / 1000));
36
+ const lines = [`Follow-up digest (last change ${Number.isFinite(age) ? `${age}s` : "?"} ago): ${file?.total ?? all.length} workspaces, ${file?.needs ?? 0} need Tom. Paging: workstreams(page, group, query).`];
37
+ const needs = rows.filter(r => r.group === "needs");
38
+ if (needs.length) {
39
+ lines.push(`Needs Tom (${needs.length}):`);
40
+ for (const r of needs.slice(0, needsMax)) lines.push(`- ${r.line}`);
41
+ if (needs.length > needsMax) lines.push(`- …${needs.length - needsMax} more: workstreams(group="needs")`);
42
+ } else lines.push("Nothing needs Tom right now.");
43
+ if (!prior) {
44
+ const active = rows.filter(r => r.group === "running" || r.group === "fixing");
45
+ lines.push(`First turn. Running now (${active.length}):`);
46
+ for (const r of active.slice(0, changedMax)) lines.push(`- ${r.line}`);
47
+ if (active.length > changedMax) lines.push(`- …${active.length - changedMax} more: workstreams(group="running")`);
48
+ } else {
49
+ const current = new Set(all.map(r => r.id));
50
+ const changed = rows.filter(r => prior[r.id] !== r.hash && r.group !== "needs");
51
+ const gone = Object.keys(prior).filter(id => !current.has(id));
52
+ lines.push(changed.length || gone.length ? `Changed since your last turn (${changed.length + gone.length}):` : "No other changes since your last turn.");
53
+ for (const r of changed.slice(0, changedMax)) lines.push(`- [${r.group}] ${r.line}`);
54
+ if (changed.length > changedMax) lines.push(`- …${changed.length - changedMax} more changed: workstreams()`);
55
+ if (gone.length) lines.push(`- ${gone.length} workspace${gone.length === 1 ? "" : "s"} archived or removed: ${gone.slice(0, 5).join(", ")}`);
56
+ }
57
+ if (resting.length) lines.push(`Resting (${resting.length}; agents likely unloaded, sending wakes them): ${resting.slice(0, restingMax).map(r => r.line).join("; ")}${resting.length > restingMax ? `; …${resting.length - restingMax} more: workstreams()` : ""}`);
58
+ let text = "";
59
+ for (const l of lines) { if (text.length + l.length + 1 > chars) { text += "- …truncated: use workstreams()\n"; break; } text += l + "\n"; }
60
+ return { text: text.trimEnd(), seen: { at: now, rows: Object.fromEntries(all.map(r => [r.id, r.hash])) } };
61
+ }
25
62
  const quote = value => "'" + value.replaceAll("'", "'\\''") + "'";
26
63
  async function json(path) { return JSON.parse(await readFile(path, "utf8")); }
27
64
  async function save(path, value) {
@@ -59,6 +96,17 @@ async function main() {
59
96
  if (event.agent_id || event.hook_event_name === "SubagentStop") return;
60
97
  const lease = await json(join(directory, "hooks-enabled.json"));
61
98
  if (lease.expiresAt < Date.now() || !lease.clientEntry) return;
99
+ // The Overseer: a fresh digest at the start of every turn; no sidebar bookkeeping and no Stop-hook nudge.
100
+ if (process.env.FOLLOW_THROUGH_OVERSEER === "1") {
101
+ if (event.hook_event_name !== "UserPromptSubmit") return;
102
+ const file = await json(join(directory, "overseer-digest.json")).catch(() => null);
103
+ if (!file || file.agentId !== agentId) return;
104
+ const seenPath = join(directory, "hook-state", `overseer-seen-${agentId}.json`);
105
+ const digest = overseerDigest(file, await json(seenPath).catch(() => null));
106
+ await save(seenPath, digest.seen);
107
+ process.stdout.write(JSON.stringify({ hookSpecificOutput: { hookEventName: "UserPromptSubmit", additionalContext: digest.text } }) + "\n");
108
+ return;
109
+ }
62
110
  // scopes.json is a few KB; this hook runs on every tool call. Older workers don't write it: read state.json.
63
111
  const scopes = await json(join(directory, "scopes.json")).catch(() => null);
64
112
  let workspace = null; let contributor = false;
package/server/daemon.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { isOverseerAgent } from "../shared/overseer";
1
2
  import { mkdir, readFile, writeFile } from "node:fs/promises";
2
3
  import { homedir } from "node:os";
3
4
  import { join } from "node:path";
@@ -184,6 +185,8 @@ export class PaseoGateway implements Gateway {
184
185
  for (const workspace of workspaces.filter(w => !w.archivingAt && (workspaceId ? w.id === workspaceId : (defaults.has(w.projectId ?? "") && !optedOut(state, w.id)) || state.workspaces.some(saved => saved.id === w.id && saved.enable_tracking && !saved.archived)))) {
185
186
  const existing = state.workspaces.find(w => w.id === workspace.id);
186
187
  if (existing?.archived) continue;
188
+ // The Overseer's own workspace is Follow-up's, never tracked or repaired (1.4.0-beta.0).
189
+ if (agents.some(({ agent }) => agent.workspaceId === workspace.id && isOverseerAgent(agent.labels))) continue;
187
190
  const candidates = agents.map(row => row.agent).filter(a => a.workspaceId === workspace.id && !a.archivedAt && !a.labels["follow-through.recovery"]);
188
191
  const roots: Agent[] = [];
189
192
  for (const agent of candidates) if (await isWorkspaceRoot(agent, findParent)) roots.push(agent);