paseo-follow-up 2.4.0-beta.5 → 2.4.0-beta.6

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/client/brief.tsx CHANGED
@@ -8,7 +8,7 @@ import { deliveryStatus } from "../shared/queue";
8
8
  import { Icon, TextInput, copyText, useToast } from "@getpaseo/plugin/client/ui";
9
9
  import { BRIEF_KIND, briefCardAsk, BRIEF_VERSION, askedDecisions, cardPicks, notedCount, pickedCount, briefSchema, collapsedLine, outcomeLabel, extrasFit, hasOriginal, nothingNeededLine, isTight, pastRows, pastTone, selectsFirst, sendBar, shownBrief, pastAsk, liveBrief, newAnswerId, type Brief, type BriefDecision, type BriefMove } from "../shared/brief";
10
10
  import { needsYou } from "../shared/attention";
11
- import { age } from "../shared/inbox";
11
+ import { age, briefOutlived } from "../shared/inbox";
12
12
  import { noReviewReposVersion, onNoReviewRepos } from "../shared/pr-workflow";
13
13
  import { briefKey, HEADLINE_WORD } from "../shared/headline";
14
14
  /** The card's kind word comes from the same table as the pill and the Needs-you row. */
@@ -41,7 +41,7 @@ export type BriefDeps = {
41
41
  /** The workspace's list form (shared/list.ts); the PR sheet reads the full one itself. */
42
42
  workspace(id: string): ListWorkspace | undefined;
43
43
  /** The agent's Needs-you inbox row, so a card knows whether its brief is an ask (briefAsks). */
44
- row?(agentId: string): { needs?: unknown } | null;
44
+ row?(agentId: string): { needs?: unknown; status?: string; turnStartedAt?: string | null } | null;
45
45
  /** Opens Follow-up's panel for a workspace whose record this client hasn't loaded yet. */
46
46
  openPanel(workspaceId: string): void;
47
47
  /** Done's Undo window, so the composer pill says Done (and its Undo cancels the same toast) until it ends. */
@@ -385,7 +385,9 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
385
385
  // The check itself failed (or there's no agent to ask): don't leave a dead card. The server still validates every
386
386
  // action against the stored brief, and a moot refusal reconciles, so acting on the row is safe.
387
387
  const unverifiable = live.isError || !agentId;
388
- const shown = row.state !== "open" ? { brief: row, actionable: false } : unverifiable && checked.brief.state === "open" ? { ...checked, actionable: true } : checked;
388
+ const verified = row.state !== "open" ? { brief: row, actionable: false } : unverifiable && checked.brief.state === "open" ? { ...checked, actionable: true } : checked;
389
+ // A running agent's newer turn outlived a finish that asked nothing: it reads as the turn before, not "Finished".
390
+ const shown = agentId && briefOutlived(verified.brief, deps.row?.(agentId)) ? { brief: { ...verified.brief, state: "superseded" as const }, actionable: false } : verified;
389
391
  const b = shown.brief;
390
392
  // One predicate decides whether the brief's own words draw (briefCardShown, inside briefCardAsk): beside what Needs you
391
393
  // holds, a brief without an ask points at it instead (a-brief-without-an-ask-never-sits-beside-needs-you).
@@ -365,6 +365,7 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
365
365
  const dismiss = useDismiss();
366
366
  const openChat = () => { if (!navigation) return; if (s.agentId) navigation.openAgent({ agentId: s.agentId }); else if (s.workspaceId) navigation.openWorkspace({ workspaceId: s.workspaceId }); };
367
367
  const word = cardWord(card);
368
+ const compassLine = s.compass ?? (s.priority?.source?.kind === "compass" ? s.priority.reason : null);
368
369
  const color = card.item?.kind === "merge" ? mergedColor(c) : card.kind === "finished" ? c.foregroundMuted : c.statusWarning;
369
370
  const q = card.kind === "question" ? ws?.questions.find(x => x.id === card.questionId) ?? null : null;
370
371
  const nth = sameWorkspace.indexOf(card.key);
@@ -392,6 +393,11 @@ function CardView({ card, w, theme, compact, deps, navigation, gone, more, setMo
392
393
  </View>
393
394
  {ws && <SummaryLine key={ws.id} workspace={ws} theme={theme} compact={compact} />}
394
395
  {full && <ReferencesLine workspace={full} theme={theme} compact={compact} />}
396
+ {/* One muted line of pinned context (docs/compass.md): the note's own words, never a second reason. */}
397
+ {compassLine && <View style={{ flexDirection: "row", alignItems: "center", gap: 5, minWidth: 0 }}>
398
+ <Icon name="Compass" size={12} color={c.foregroundMuted} />
399
+ <Text numberOfLines={1} style={[t.meta, { flex: 1, minWidth: 0, color: c.foregroundMuted }]}>{`Compass · ${compassLine}`}</Text>
400
+ </View>}
395
401
  </View>;
396
402
 
397
403
  const goneBanner = gone && <View accessibilityRole="alert" style={{ flexDirection: "row", alignItems: "center", gap: 8, padding: 12, borderRadius: 10, backgroundColor: c.surface1, borderWidth: 1, borderColor: c.border }}>
package/client/header.tsx CHANGED
@@ -10,6 +10,7 @@ import { VersionMark } from "./updates";
10
10
  import { IconSwap, Spinner } from "./motion";
11
11
  import { segmentPaint, type Colors } from "./theme";
12
12
  import { ReferencesLine } from "./linked";
13
+ import { WhyItMatters } from "./why-it-matters";
13
14
  import { SummaryLine } from "./about";
14
15
 
15
16
  /** PR status older than this means the poll has stopped working; say so instead of looking current. */
@@ -56,7 +57,7 @@ function LiveGlyph({ icon, colors }: { icon: LiveIcon; colors: Colors }) {
56
57
  }
57
58
  }
58
59
 
59
- export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings, onRefresh, refreshing, onAuto, autoPending, notice, onOpenPr, resize, hideTitle = false, onHome, more }: {
60
+ export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings, onRefresh, refreshing, onAuto, autoPending, notice, onOpenPr, resize, hideTitle = false, onHome, more, openAgent }: {
60
61
  workspace: Workspace; theme: Theme; compact: boolean; now: number; onSettings: (category?: SettingsCategory) => void; onRefresh: () => void; refreshing: boolean; onAuto: (next: boolean) => void; autoPending: boolean; notice: string | null; onOpenPr?: (key: string) => void;
61
62
  /** Expand to the larger view, or collapse back to the panel. Absent where the panel is already as wide as it gets. */
62
63
  resize?: { icon: "Maximize2" | "Minimize2"; label: string; onPress: () => void } | null;
@@ -66,6 +67,8 @@ export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings,
66
67
  onHome?: () => void;
67
68
  /** The More button (client/panel-menu.tsx), before the gear. */
68
69
  more?: ReactNode;
70
+ /** Why it matters' Ask the Overseer opens the Overseer's chat with the draft in it. */
71
+ openAgent?: (agentId: string) => void;
69
72
  }) {
70
73
  const c = theme.colors; const t = text(c, compact);
71
74
  const parts = headline(w, now);
@@ -112,6 +115,7 @@ export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings,
112
115
  {/* Spec and Linked: their own line, as on desktop and Home. The 44px bar can't hold them beside Home, the version
113
116
  and settings at 390pt without pushing settings off-screen. */}
114
117
  <ReferencesLine workspace={w} theme={theme} compact />
118
+ <WhyItMatters workspace={w} theme={theme} compact openAgent={openAgent} />
115
119
  <Text accessibilityLiveRegion="polite" style={[t.ask, { color: c.foregroundMuted }]}>
116
120
  {parts.map((part, i) => <Text key={part.text} style={toneOf(part.tone) ? { color: toneOf(part.tone) } : { color: c.foreground }}>{i ? <Text style={{ color: c.foregroundMuted, fontWeight: "400" }}>{" · "}</Text> : null}{part.text}</Text>)}
117
121
  </Text>
@@ -129,6 +133,7 @@ export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings,
129
133
  {!compact && !hideTitle && <SummaryLine workspace={w} theme={theme} compact={false} />}
130
134
  {/* The references line: Spec and Linked, one line, only when there's a spec or anything linked. */}
131
135
  <ReferencesLine workspace={w} theme={theme} compact={compact} />
136
+ <WhyItMatters workspace={w} theme={theme} compact={compact} openAgent={openAgent} />
132
137
  <Text accessibilityLiveRegion="polite" style={[t.meta, { color: c.foregroundMuted, marginTop: 2 }]}>
133
138
  {parts.map((part, i) => <Text key={part.text} style={toneOf(part.tone) ? { color: toneOf(part.tone), fontWeight: "600" } : { color: c.foreground }}>{i ? <Text style={{ color: c.foregroundMuted, fontWeight: "400" }}>{" · "}</Text> : null}{part.text}</Text>)}
134
139
  </Text>
@@ -396,7 +396,17 @@ export function AskRow({ ask, theme, active, dense, touch, sending, onPress }: {
396
396
  }
397
397
 
398
398
  /** The muted reason and source chip a fresh external priority adds to a row. */
399
+ /**
400
+ * The reason line: why a row ranks where it does, with its source. A Compass reason leads with the compass glyph and
401
+ * names Compass after it ("Dana: client call Tue · Compass"); other sources keep their chip.
402
+ */
399
403
  export function PriorityLine({ reason, source, c, size = 12, lines = 1 }: { reason: string; source: { kind: keyof typeof PRIORITY_SOURCE_LABEL; label: string } | null; c: Colors; size?: number; lines?: number }) {
404
+ if (source?.kind === "compass") return <View style={{ flexDirection: "row", alignItems: "center", gap: 5, minWidth: 0 }}>
405
+ <Icon name="Compass" size={size} color={c.foregroundMuted} />
406
+ <Text numberOfLines={lines} style={{ flex: 1, minWidth: 0, color: c.foregroundMuted, fontSize: size }}>
407
+ <Text style={{ fontStyle: "italic" }}>{reason}</Text>{" · Compass"}
408
+ </Text>
409
+ </View>;
400
410
  return <View style={{ flexDirection: "row", alignItems: "center", gap: 6, minWidth: 0 }}>
401
411
  {source && <View style={{ paddingHorizontal: 5, height: 16, justifyContent: "center", borderRadius: 3, backgroundColor: c.surface2 }}>
402
412
  <Text numberOfLines={1} style={{ color: c.foregroundMuted, fontSize: 10, lineHeight: 13 }}>{PRIORITY_SOURCE_LABEL[source.kind]}</Text>
@@ -87,7 +87,8 @@ export function useHomeModel(sources: HomeSources): HomeModel {
87
87
  // Decision Q8: the raised Linear issues count in Needs you, the worker's one number (home feed), so Home's header,
88
88
  // strip and brief line and the sidebar badge (client/live.tsx) agree (invariant raised-is-needs-you).
89
89
  const raised = useSyncExternalStore(extras.subscribe, () => extras.queue().raised.length, () => 0);
90
- return useMemo(() => buildHome({ rows: inbox.rows(), tracked: live.all(), paseo: paseo.all(), now: Date.now(), sort, priorities, hidden: overseer ? [overseer] : [], hold, raised }), [a, b, c, now, sort, priorities, inbox, live, paseo, overseer, hold, raised]);
90
+ const compass = useSyncExternalStore(extras.subscribe, extras.compass, extras.compass);
91
+ return useMemo(() => buildHome({ rows: inbox.rows(), tracked: live.all(), paseo: paseo.all(), now: Date.now(), sort, priorities, hidden: overseer ? [overseer] : [], hold, compass, raised }), [a, b, c, now, sort, priorities, inbox, live, paseo, overseer, hold, raised, compass]);
91
92
  }
92
93
 
93
94
  /** Rebuilds a value at most every `ms` while mounted (used for the brief pane's source ages). */
@@ -346,6 +346,8 @@ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMe
346
346
  const title = <>{marks(s.title, hit?.titleRanges, c)}{s.agent ? <Text style={{ color: c.foregroundMuted, fontWeight: "400" }}>{" › "}{marks(s.agent, hit?.agentRanges, c)}</Text> : null}</>;
347
347
  // Phones: "Working" under every row of a "Running 9" group says nothing the header didn't; one line per row instead.
348
348
  const generic = touch && !s.word && s.line === "Working";
349
+ // The reason line: AI priority's, else the workspace's first live Compass note (a live note is a reason).
350
+ const why = s.priority?.reason ? { reason: s.priority.reason, source: s.priority.source } : s.compass ? { reason: s.compass, source: { kind: "compass" as const, label: "Compass" } } : null;
349
351
  // Send now: outlined (filled is only for what waits on the developer), and only where the server would take it.
350
352
  const sendNow = s.sendNow && onSendNow && !dense ? <SendNowButton s={s} theme={theme} touch={touch} onSendNow={onSendNow} /> : null;
351
353
  // A Later row says when it comes back on screen; the label also keeps how long it has waited.
@@ -373,7 +375,7 @@ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMe
373
375
  : (!!s.word || !!s.line) && !generic && <Text numberOfLines={2} style={{ color: c.foregroundMuted, fontSize: 13, lineHeight: 18 }}>
374
376
  {s.word && s.group === "needs" ? <Text style={{ color, fontWeight: "600" }}>{s.word}</Text> : null}{s.word && s.group === "needs" && s.line ? " · " : ""}{line}
375
377
  </Text>}
376
- {!!s.priority?.reason && <PriorityLine reason={s.priority.reason} source={s.priority.source} c={c} size={12} lines={2} />}
378
+ {!!why && <PriorityLine reason={why.reason} source={why.source} c={c} size={12} lines={2} />}
377
379
  {!!s.pr && <Text numberOfLines={1} style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 17, fontVariant: ["tabular-nums"], ...(older ? { opacity: 0.6 } : {}) }}><PrSummaryText s={s} c={c} /></Text>}
378
380
  {sendNow && <View style={{ flexDirection: "row", marginTop: 6 }}>{sendNow}</View>}
379
381
  </View> : dense ? <View style={{ flex: 1, minWidth: 0, gap: 1 }}>
@@ -382,11 +384,11 @@ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMe
382
384
  : (!!s.word || !!s.line) && <Text numberOfLines={2} style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>
383
385
  {s.word && s.group === "needs" ? <Text style={{ color, fontWeight: "600" }}>{s.word}</Text> : null}{s.word && s.group === "needs" && s.line ? " · " : ""}{line}
384
386
  </Text>}
385
- {!!s.priority?.reason && <PriorityLine reason={s.priority.reason} source={s.priority.source} c={c} size={11} lines={2} />}
387
+ {!!why && <PriorityLine reason={why.reason} source={why.source} c={c} size={11} lines={2} />}
386
388
  {touch && (s.pr || s.badges.length > 0) && <View style={{ flexDirection: "row", flexWrap: "wrap", gap: 6, marginTop: 4 }}>
387
389
  {s.badges.map(b => <BadgeView key={b.text} b={b} c={c} />)}<PrChipView s={s} c={c} />
388
390
  </View>}
389
- </View> : <View style={{ flex: 1, minWidth: 0, gap: 1, paddingVertical: s.priority?.reason ? 4 : 0 }}><View style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
391
+ </View> : <View style={{ flex: 1, minWidth: 0, gap: 1, paddingVertical: why ? 4 : 0 }}><View style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
390
392
  {/* The title keeps its width (up to 55 %) and the chips yield; only beside Send now, which can't, does it shrink. */}
391
393
  <Text numberOfLines={1} style={{ flexShrink: sendNow ? 1 : 0, minWidth: 0, maxWidth: "55%", color: muted ? c.foregroundMuted : c.foreground, fontSize: 13, fontWeight: muted ? "400" : "500" }}>{title}</Text>
392
394
  {/* A Needs-you row's word (Permission, Question…) is why it's there: it keeps its place, the chips yield first. */}
@@ -398,7 +400,7 @@ const Row = memo(function Row({ s, theme, dense, touch, selected, onSelect, onMe
398
400
  </Text>
399
401
  <ChipRail s={s} c={c} dim={older} />
400
402
  {sendNow}
401
- </View>{!!s.priority?.reason && <View style={{ paddingRight: 40 }}><PriorityLine reason={s.priority.reason} source={s.priority.source} c={c} /></View>}</View>}
403
+ </View>{!!why && <View style={{ paddingRight: 40 }}><PriorityLine reason={why.reason} source={why.source} c={c} /></View>}</View>}
402
404
  {!touch && <RowTime s={s} c={c} size={dense ? 11 : 12} />}
403
405
  </Pressable>;
404
406
  }, (a, b) => a.sig === b.sig && a.selected === b.selected && a.theme === b.theme && a.dense === b.dense && a.touch === b.touch && a.onSelect === b.onSelect && a.onMenu === b.onMenu && a.menuOpen === b.menuOpen && a.hit === b.hit && a.onSendNow === b.onSendNow && a.selectedBg === b.selectedBg);
@@ -59,6 +59,9 @@ export function createHomeExtras(client: PluginClientContext) {
59
59
  * feed (on 0.15, carried by the priorities poll). Home's model, the sidebar badge and the brief pane all read it.
60
60
  */
61
61
  let queue: QueueNeeds = NO_QUEUE;
62
+ /** Each workspace's first live Compass note as one line (Home rows, Catch up), from the worker with the priorities. */
63
+ let compass: Record<string, string> = {};
64
+ const setCompass = (next: Record<string, string> | undefined) => { if (!next || JSON.stringify(next) === JSON.stringify(compass)) return false; compass = next; return true; };
62
65
  const setQueue = (next: QueueNeeds | undefined) => { if (!next || JSON.stringify(next) === JSON.stringify(queue)) return false; queue = next; return true; };
63
66
  const setContext = (next: ContextRequest[]) => { if (JSON.stringify(next) === JSON.stringify(context)) return false; context = next; return true; };
64
67
  const readContext = async () => setContext((await client.rpc(contextListRpc, {})).requests);
@@ -105,7 +108,7 @@ export function createHomeExtras(client: PluginClientContext) {
105
108
  const pollHome = () => together([
106
109
  poll(PRIORITY_POLL_MS, async () => {
107
110
  const answer = await client.rpc(prioritiesRpc, {});
108
- const queued = setQueue(answer.queue);
111
+ const queued = setCompass(answer.compass) || setQueue(answer.queue);
109
112
  if (JSON.stringify(answer.items) === JSON.stringify(priorities)) return queued;
110
113
  priorities = answer.items; return true;
111
114
  }),
@@ -137,7 +140,7 @@ export function createHomeExtras(client: PluginClientContext) {
137
140
  if (event.context) setContext(event.context);
138
141
  if (event.dispatches) dispatches = event.dispatches;
139
142
  if (event.prStats !== undefined) prStatsOn = event.prStats;
140
- setQueue(event.queue);
143
+ setQueue(event.queue); setCompass(event.compass);
141
144
  if (event.usage) usage = { ...event.usage, resources: usage.resources };
142
145
  if (!event.rank.running) { for (const done of rankWaiters) done(); rankWaiters.clear(); }
143
146
  // Smart Session's files can't be watched: read the meters once a minute instead.
@@ -270,6 +273,8 @@ export function createHomeExtras(client: PluginClientContext) {
270
273
  prStatsOn: () => prStatsOn,
271
274
  /** The raised Linear issues in Needs you and the queue's revision (Q8), from the worker. */
272
275
  queue: () => queue,
276
+ /** Each workspace's first live Compass note as one line. */
277
+ compass: () => compass,
273
278
  /** A dismissal on a 0.15 host (or with the feed down): read the answer once now; the feed pushes it itself. */
274
279
  refreshQueue: () => { if (home && !homePolls) return; void client.rpc(prioritiesRpc, {}).then(a => { if (!stopped && setQueue(a.queue)) emit(); }).catch(() => undefined); },
275
280
  /** Reads the asks once (Catch up opening or moving on, so a 0.15 host or a dropped feed is never stale for long). */
package/client/home.tsx CHANGED
@@ -19,6 +19,7 @@ import { prLinksByNumber } from "../shared/presentation";
19
19
  import { BriefCard, type BriefDeps } from "./brief";
20
20
  import { SummaryLine } from "./about";
21
21
  import { ReferencesLine } from "./linked";
22
+ import { WhyItMatters } from "./why-it-matters";
22
23
  import { bottomGap, bottomInset, Button, focusSoon, IconButton, space, text, type Theme } from "./kit";
23
24
  import { DispatchRows, NewHost, openNew, useNewOpen } from "./new";
24
25
  import { QueueScreen, RaisedRows, SinceBlock } from "./brief-since";
@@ -261,7 +262,7 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
261
262
  const detail = selected === OVERSEER_KEY && overseer
262
263
  ? <OverseerPane theme={theme} compact={compact} o={overseer} focus={replyFocus} pending={pendingAsk} agentId={overseerStatus?.agentId ?? null} model={overseerStatus?.model ?? null} restartWith={overseerStatus?.restartWith ?? null} configured={overseerStatus?.configured ?? null} deps={deps} navigation={navigation} onBack={compact && !route ? () => setSelected(null) : undefined} />
263
264
  : current
264
- ? <DetailPane key={current.key} s={current} model={model} theme={theme} compact={compact} deps={deps} openFull={openFull} signOffNext={signOffNext} ask={ask?.key === current.key ? ask : null} onBack={compact && !route ? () => setSelected(null) : undefined} />
265
+ ? <DetailPane key={current.key} s={current} model={model} theme={theme} compact={compact} deps={deps} openFull={openFull} signOffNext={signOffNext} ask={ask?.key === current.key ? ask : null} onBack={compact && !route ? () => setSelected(null) : undefined} openAgent={navigation ? agentId => navigation.openAgent({ agentId }) : undefined} />
265
266
  : <BriefPane theme={theme} compact={compact} pane={pane} catchUp={deps.openCatchUp} deckSize={deckSize} onSelect={key => route ? route(key) : setSelected(key)} openLog={deps.openLog} sources={deps.sources}
266
267
  queue={deps.openQueue ? <SinceBlock theme={theme} compact={compact} openQueue={deps.openQueue} onStarted={() => deps.sources.extras.refreshDispatches()} navigation={navigation} raised={raisedKeys} revision={queue.revision} /> : null} />;
267
268
  // Nothing followed at all: no sort, no meters, just the empty state and its action.
@@ -480,9 +481,11 @@ function DetailSendNow({ s, theme, compact, deps }: { s: Workstream; theme: Them
480
481
  </View>;
481
482
  }
482
483
 
483
- function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask, onBack }: {
484
+ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask, onBack, openAgent }: {
484
485
  s: Workstream; model: HomeModel; theme: Theme; compact: boolean; deps: HomeDeps;
485
486
  openFull: (s: Workstream) => void; signOffNext: (s: Workstream) => void; onBack?: () => void;
487
+ /** Why it matters' Ask the Overseer opens the Overseer's chat with the draft in it. */
488
+ openAgent?: (agentId: string) => void;
486
489
  /** The row menu's Answer: open this question's card (n changes on every pick, so the same question reopens). */
487
490
  ask?: { id: string; n: number } | null;
488
491
  }) {
@@ -553,6 +556,7 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
553
556
  {/* The Summary: what this workspace is for, right under its name. */}
554
557
  {!writing && s.workspaceId && w && <View style={{ marginTop: 4 }}><SummaryLine key={s.workspaceId} workspace={w} theme={theme} compact /></View>}
555
558
  {!writing && s.workspaceId && w && <View style={{ marginTop: 6 }}><ReferencesLine key={`refs:${s.workspaceId}`} workspace={w} theme={theme} compact /></View>}
559
+ {!writing && s.workspaceId && w && <View style={{ marginTop: 6 }}><WhyItMatters key={`why:${s.workspaceId}`} workspace={w} theme={theme} compact openAgent={openAgent} /></View>}
556
560
  {!writing && <View style={{ flexDirection: "row", alignItems: "center", gap: 6, minHeight: 44 }}>
557
561
  <Icon name={s.icon} size={14} color={color} />
558
562
  {/* Read as one line, with the PR summary in words: a nested Text can't carry its own label. */}
@@ -572,6 +576,7 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
572
576
  </View>
573
577
  {s.workspaceId && w && <SummaryLine key={s.workspaceId} workspace={w} theme={theme} compact={false} />}
574
578
  {s.workspaceId && w && <ReferencesLine key={`refs:${s.workspaceId}`} workspace={w} theme={theme} compact={false} />}
579
+ {s.workspaceId && w && <WhyItMatters key={`why:${s.workspaceId}`} workspace={w} theme={theme} compact={false} openAgent={openAgent} />}
575
580
  <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 6 }}>
576
581
  {!!s.word && <Text style={{ color, fontSize: 12, fontWeight: "600" }}>{s.word}</Text>}
577
582
  <Text style={t.meta}>{[laterText, s.at ? age(s.at, Date.now()) === "now" ? "just now" : `${age(s.at, Date.now())} ago` : "", s.project].filter(Boolean).join(" · ")}</Text>
@@ -3,7 +3,7 @@ import { FINISH_ASK } from "../shared/status";
3
3
  import { View, type StyleProp, type ViewStyle } from "react-native";
4
4
  import { Pressable, Text } from "./text";
5
5
  import { Icon, useToast } from "@getpaseo/plugin/client/ui";
6
- import { useRpc } from "@getpaseo/plugin/client";
6
+ import { openExternalUrl, useRpc } from "@getpaseo/plugin/client";
7
7
  import { useMutation, useQueryClient } from "@tanstack/react-query";
8
8
  import { answerQuestionRpc, checkPrActionRpc, controlRpc, queueActionRpc, sendRpc } from "../shared/contracts";
9
9
  import { agentName, needsYou, workspaceSnoozed, type NeedItem } from "../shared/attention";
@@ -119,7 +119,11 @@ export function NeedsYouList({ workspace: w, theme, compact, actions, now = Date
119
119
  {openMain && <Button theme={theme} compact={compact} icon="MessageSquare" title="Open agent" accessibilityLabel="Open main agent" onPress={openMain} />}
120
120
  </>;
121
121
  // The agent said only a person can move it: ask the reviewer again (the PR sheet's reviewers), or hand it back.
122
- case "person": return item.review && item.prKey && actions.openPr
122
+ // Only a part of it (one thread waits on the reviewer's call): the developer's first move is to read that part on the PR.
123
+ case "person": if (item.part) return item.pr
124
+ ? <Button theme={theme} compact={compact} icon="ExternalLink" title={`Open #${item.pr.number}`} accessibilityLabel={`Open #${item.pr.number} to see ${item.detail || item.title}`} accessibilityHint="Opens in your browser" onPress={() => void openExternalUrl(item.pr!.url).catch(() => undefined)} />
125
+ : null;
126
+ return item.review && item.prKey && actions.openPr
123
127
  ? <Button theme={theme} compact={compact} icon="UserPlus" title="Ask for re-review" accessibilityLabel={`Ask for a re-review: ${item.title}`} onPress={() => actions.openPr!(item.prKey!, "reviewers")} />
124
128
  : null;
125
129
  case "check": return <Button theme={theme} compact={compact} icon="RefreshCw" title="Check state" loading={inspect.isPending} disabled={busy} onPress={() => inspect.mutate(item.actionId)} />;
@@ -146,13 +150,15 @@ export function NeedsYouList({ workspace: w, theme, compact, actions, now = Date
146
150
  };
147
151
  // A second, quieter action after the primary and its PR link, so the link never wraps onto a line of its own.
148
152
  const secondary = (item: NeedItem) => item.kind === "person"
149
- ? <Button theme={theme} compact={compact} kind="ghost" icon="RotateCcw" title="Send to agent" accessibilityLabel={`Send it back to ${agentName(w)}: ${item.title}`} loading={retryTask.isPending} disabled={busy} onPress={() => retryTask.mutate(item.taskKey)} />
153
+ ? <Button theme={theme} compact={compact} kind="ghost" icon="RotateCcw" title={compact ? "Hand back" : "Hand back to agent"} accessibilityLabel={`Hand it back to ${agentName(w)}: ${item.title}`} loading={retryTask.isPending} disabled={busy} onPress={() => retryTask.mutate(item.taskKey)} />
150
154
  : null;
151
155
  return <PrLinksProvider prs={prLinksByNumber(w.prs)}><View>
152
156
  {items.map((item, index) => {
153
157
  const g = glyph(item, c);
154
158
  // A row about one PR opens it in one click, beside its action and never instead of it.
155
- const link = item.pr ? <PrLinkButton link={item.pr} theme={theme} compact={compact} /> : null;
159
+ // A person part's own action is Open #N, so it doesn't draw the link a second time.
160
+ let link = item.pr ? <PrLinkButton link={item.pr} theme={theme} compact={compact} /> : null;
161
+ if (item.kind === "person" && item.part && item.pr) link = null;
156
162
  const act = action(item);
157
163
  // A stack's Merge names its scope on the row ("Merges #1628, #1629, then #1630"); a click-time blocker shows here too.
158
164
  const merging = item.kind === "merge" ? mergeControl(item.prKey, { theme, compact }) : null;
package/client/panel.tsx CHANGED
@@ -377,7 +377,7 @@ export function WorkspaceView({ theme, layout, workspace: w, navigation, loadErr
377
377
  const openPr = (key: string) => setSheet({ key, intent: null });
378
378
  // The expand button only appears while the panel is narrow; a wide panel or the larger view keeps its collapse button.
379
379
  const resizeShown = compact ? null : resize?.icon === "Maximize2" && wide ? null : resize;
380
- const header = <WorkspaceHeader workspace={w} theme={theme} compact={compact} now={now} onSettings={openSettings} onRefresh={() => update.mutate()} refreshing={update.isPending} onAuto={next => auto.mutate(next)} autoPending={auto.isPending} notice={loadError ?? null} onOpenPr={openPr} resize={resizeShown} hideTitle={large} onHome={compact ? openOverview : undefined}
380
+ const header = <WorkspaceHeader workspace={w} theme={theme} compact={compact} now={now} onSettings={openSettings} onRefresh={() => update.mutate()} refreshing={update.isPending} onAuto={next => auto.mutate(next)} autoPending={auto.isPending} notice={loadError ?? null} onOpenPr={openPr} resize={resizeShown} hideTitle={large} onHome={compact ? openOverview : undefined} openAgent={openAgent}
381
381
  more={sources ? <PanelMore w={w} sources={sources} theme={theme} compact={compact} openAgent={openAgent} openQuestion={setQuestion} showMenu={setMoreMenu} /> : undefined} />;
382
382
  const shipped = <ShippedCard workspace={w} theme={theme} compact={compact} now={now} />;
383
383
  const needs = <NeedsYouBlock workspace={w} theme={theme} compact={compact} now={now} brief={ask?.brief ?? null} briefCard={ask?.card ?? null} actions={{ openAgent, openPr: (key, intent) => setSheet({ key, intent }), openQuestion: setQuestion }} />;
@@ -0,0 +1,194 @@
1
+ import { useState } from "react";
2
+ import { TextInput, View } from "react-native";
3
+ import { useRpc } from "@getpaseo/plugin/client";
4
+ import { Icon, copyText, useToast } from "@getpaseo/plugin/client/ui";
5
+ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
6
+ import { Pressable, Text } from "./text";
7
+ import { Button, IconButton, SubmitScope, errorText, text, type Theme } from "./kit";
8
+ import { RichText } from "./rich-text";
9
+ import { useChatComposer } from "./put-in-chat";
10
+ import { putInChat } from "../shared/put-in-chat";
11
+ import { compassNoteRpc, compassRpc, listRpc } from "../shared/contracts";
12
+ import { HAND_LABEL, HAND_SOURCE, STRENGTHS, noteWho, type CompassNote, type CompassSource, type NoteAction, type Place } from "../shared/compass";
13
+ import { PRIORITY_SOURCE_LABEL, type PrioritySourceKind } from "../shared/priorities";
14
+ import { compassKey } from "./compass-settings";
15
+
16
+ type View_ = {
17
+ settings: { sources: CompassSource[] };
18
+ notes: CompassNote[];
19
+ priority?: { rank: number; of: number; reason: string; source: { kind: PrioritySourceKind; label: string } | null } | null;
20
+ overseer?: string | null;
21
+ };
22
+
23
+ const ordinal = (n: number) => `${n}${n % 100 >= 11 && n % 100 <= 13 ? "th" : ["th", "st", "nd", "rd"][n % 10] ?? "th"}`;
24
+ const when = (iso: string) => new Date(iso).toLocaleString([], { weekday: "short", hour: "2-digit", minute: "2-digit", hourCycle: "h23" });
25
+ const dayOf = (d: string) => new Date(`${d}T12:00:00`).toLocaleDateString([], { weekday: "short", month: "short", day: "numeric" });
26
+ const where = (p: Place | undefined) => !p ? null : p.kind === "conversation" ? (p.sub === "dm" ? "in your DM" : `in #${p.name}`) : `in ${p.name}`;
27
+ const STRENGTH_LABEL = { high: "High", normal: "Normal", low: "Low" } as const;
28
+ /** Dates the editor offers, relative to today: the words a person would use, as dates. */
29
+ function dateChoices(now = new Date()): { label: string; day: string | null }[] {
30
+ const iso = (d: Date) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
31
+ const plus = (n: number) => { const d = new Date(now); d.setDate(d.getDate() + n); return d; };
32
+ const friday = plus((5 - now.getDay() + 7) % 7 || 7);
33
+ return [{ label: "Today", day: iso(now) }, { label: "Tomorrow", day: iso(plus(1)) }, { label: "Friday", day: iso(friday) }, { label: "In a week", day: iso(plus(7)) }, { label: "No date", day: null }];
34
+ }
35
+
36
+ /**
37
+ * Why it matters (docs/compass.md): under the panel's goal, where AI priority puts this workspace and the Compass notes
38
+ * behind it. It is not a second Summary: the Summary says what the work is, this says why it ranks where it does. Each
39
+ * note shows its words, who said them, where and until when, with Ask the Overseer and a menu (Tell the agent, Edit,
40
+ * Move, Unpin). Nothing here reaches an agent without a click (compass-reaches-an-agent-only-by-a-click).
41
+ */
42
+ export function WhyItMatters({ workspace, theme, compact, openAgent }: { workspace: { id: string; title: string }; theme: Theme; compact: boolean; openAgent?: (agentId: string) => void }) {
43
+ const c = theme.colors; const t = text(c, compact);
44
+ const read = useRpc(compassRpc);
45
+ const query = useQuery({ queryKey: [...compassKey, workspace.id], queryFn: async () => await read({ workspace: workspace.id }) as View_, staleTime: 60_000 });
46
+ const [more, setMore] = useState(false);
47
+ const v = query.data;
48
+ const notes = v?.notes ?? [];
49
+ if (!v || (!v.priority && !notes.length)) return null;
50
+ const shown = more ? notes : notes.slice(0, 1);
51
+ const echo = v.priority?.source?.kind === "compass" && notes.length > 0;
52
+ return <View accessibilityRole="summary" accessibilityLabel="Why it matters" style={{ gap: 8, paddingVertical: 8, paddingHorizontal: compact ? 12 : 10, borderRadius: 8, backgroundColor: c.surface1, borderWidth: 1, borderColor: c.border }}>
53
+ <View style={{ flexDirection: "row", alignItems: "center", gap: 6 }}>
54
+ <Icon name="Compass" size={12} color={c.foregroundMuted} />
55
+ <Text style={[t.small, { color: c.foregroundMuted, fontWeight: "600" }]}>Why it matters</Text>
56
+ </View>
57
+ {v.priority && <Text style={[t.meta, { color: c.foreground }]}>
58
+ {/* "1st of 1" says nothing: with one workspace ranked, it is simply the top. */}
59
+ <Text style={{ fontWeight: "600", fontVariant: ["tabular-nums"] }}>{v.priority.of > 1 ? `${ordinal(v.priority.rank)} of ${v.priority.of}` : "Top"}</Text>
60
+ {/* A Compass reason restates the notes right below it, so the line keeps only the rank; another source's reason
61
+ is news here and stays. */}
62
+ <Text style={{ color: c.foregroundMuted }}>{echo ? " in AI priority" : " in AI priority · "}</Text>
63
+ {!echo && <Text style={{ fontStyle: "italic" }}>{v.priority.reason}</Text>}
64
+ {v.priority.source && v.priority.source.kind !== "compass" ? <Text style={{ color: c.foregroundMuted }}>{` · ${PRIORITY_SOURCE_LABEL[v.priority.source.kind]}`}</Text> : null}
65
+ </Text>}
66
+ {shown.map(n => <NoteCard key={n.id} note={n} view={v} workspace={workspace} theme={theme} compact={compact} openAgent={openAgent} />)}
67
+ {notes.length > 1 && <Pressable accessibilityRole="button" accessibilityState={{ expanded: more }} onPress={() => setMore(m => !m)} hitSlop={compact ? 0 : 6}
68
+ style={{ alignSelf: "flex-start", minHeight: compact ? 44 : 20, justifyContent: "center" }}>
69
+ <Text style={[t.meta, { color: c.foreground, fontWeight: "600" }]}>{more ? "Show less" : `+${notes.length - 1} more`}</Text>
70
+ </Pressable>}
71
+ </View>;
72
+ }
73
+
74
+ function NoteCard({ note: n, view: v, workspace, theme, compact, openAgent }: { note: CompassNote; view: View_; workspace: { id: string; title: string }; theme: Theme; compact: boolean; openAgent?: (agentId: string) => void }) {
75
+ const c = theme.colors; const t = text(c, compact);
76
+ const toast = useToast(); const cache = useQueryClient();
77
+ const act = useRpc(compassNoteRpc);
78
+ const [open, setOpen] = useState<"menu" | "edit" | "move" | "unpin" | null>(null);
79
+ const [full, setFull] = useState(false);
80
+ const composer = useChatComposer(v.overseer ?? null);
81
+ const source = v.settings.sources.find(s => s.id === n.source);
82
+ const place = source?.places.find(p => `${p.kind}:${p.id}` === n.place);
83
+ const label = n.source === HAND_SOURCE ? HAND_LABEL : source?.label ?? "A removed source";
84
+ const meta = [label, when(n.at), where(place), n.until ? `until ${dayOf(n.until)}` : null].filter(Boolean).join(" · ");
85
+ const change = useMutation({
86
+ mutationFn: async (a: NoteAction) => await act(a) as { told: { agentId: string } | null },
87
+ onSuccess: (r, a) => {
88
+ setOpen(null);
89
+ void cache.invalidateQueries({ queryKey: compassKey });
90
+ if (a.action === "tell") toast.show("Sent to the main agent", { variant: "success" });
91
+ else if (a.action === "unpin") toast.show("Unpinned. It leaves AI priority now.", { variant: "success" });
92
+ else if (a.action === "edit" && a.workspace) toast.show("Moved", { variant: "success" });
93
+ void r;
94
+ },
95
+ onError: e => toast.error(errorText(e)),
96
+ });
97
+ // Ask the Overseer: the note goes into its message box, unsent, so the developer decides (docs/compass.md).
98
+ const ask = async () => {
99
+ const words = `About ${workspace.title}: ${noteWho(n)}${n.quote ? `, ${when(n.at)}: "${n.quote}"` : `: ${n.what}`}. What should I do?`;
100
+ try {
101
+ if (!composer) throw new Error("no composer");
102
+ await putInChat(composer, words);
103
+ if (v.overseer) openAgent?.(v.overseer);
104
+ } catch {
105
+ await copyText(words).catch(() => undefined);
106
+ toast.show("Copied. Paste it to the Overseer.", { variant: "success" });
107
+ }
108
+ };
109
+ const busy = change.isPending;
110
+ const action = (title: string, icon: string, onPress: () => void, kind: "ghost" | "secondary" = "ghost") =>
111
+ <Button key={title} title={title} icon={icon} kind={kind} theme={theme} compact={compact} disabled={busy} onPress={onPress} />;
112
+ return <View style={{ gap: 3, paddingLeft: 10, borderLeftWidth: 2, borderLeftColor: c.border }}>
113
+ {/* ⋯ rides on the note's own line: a row of its own cost a phone 44 px per note. */}
114
+ <View style={{ flexDirection: "row", alignItems: "flex-start", gap: 4 }}>
115
+ <View style={{ flex: 1, minWidth: 0 }}><RichText plain style={[t.body, { color: c.foreground }]}>{n.what}</RichText></View>
116
+ <View style={{ marginVertical: compact ? -10 : -4, marginRight: compact ? -10 : -4 }}>
117
+ <IconButton icon="Ellipsis" label={open === "menu" ? "Hide note actions" : "More actions for this note"} onPress={() => setOpen(o => o ? null : "menu")} theme={theme} compact={compact} />
118
+ </View>
119
+ </View>
120
+ {n.quote && <Pressable accessibilityRole="button" accessibilityLabel={full ? "Show less of the quote" : "Show the whole quote"} onPress={() => setFull(f => !f)}>
121
+ <RichText plain numberOfLines={full ? undefined : 2} style={[t.meta, { fontStyle: "italic" }]}>{`“${n.quote}”`}</RichText>
122
+ </Pressable>}
123
+ <Text style={[t.meta, { fontVariant: ["tabular-nums"] }]}>{meta}</Text>
124
+ {(n.link || v.overseer) && <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 4, marginLeft: compact ? -12 : -8 }}>
125
+ {n.link && action("Open message", "ExternalLink", () => { void import("@getpaseo/plugin/client").then(m => m.openExternalUrl(n.link!)).catch(() => undefined); })}
126
+ {v.overseer && action("Ask the Overseer", "MessageSquare", () => void ask())}
127
+ </View>}
128
+ {open === "menu" && <View style={{ flexDirection: "row", flexWrap: "wrap", gap: 4, marginLeft: compact ? -12 : -8 }}>
129
+ {action("Tell the agent", "Send", () => change.mutate({ action: "tell", id: n.id }))}
130
+ {action("Edit", "Pencil", () => setOpen("edit"))}
131
+ {action("Move to another workspace", "ArrowRightLeft", () => setOpen("move"))}
132
+ {action("Unpin", "PinOff", () => setOpen("unpin"))}
133
+ </View>}
134
+ {open === "edit" && <NoteEditor note={n} busy={busy} theme={theme} compact={compact} onCancel={() => setOpen(null)} onSave={a => change.mutate({ action: "edit", id: n.id, ...a })} />}
135
+ {open === "move" && <MovePicker current={workspace.id} busy={busy} theme={theme} compact={compact} onCancel={() => setOpen(null)} onPick={id => change.mutate({ action: "edit", id: n.id, workspace: id })} />}
136
+ {open === "unpin" && <View style={{ gap: 6 }}>
137
+ <Text style={t.meta}>Unpin this note? It leaves AI priority now. A later message about it brings a new note.</Text>
138
+ <View style={{ flexDirection: "row", gap: 8 }}>
139
+ <Button title="Unpin" kind="primary" theme={theme} compact={compact} loading={busy} onPress={() => change.mutate({ action: "unpin", id: n.id })} />
140
+ <Button title="Cancel" kind="ghost" theme={theme} compact={compact} onPress={() => setOpen(null)} />
141
+ </View>
142
+ </View>}
143
+ </View>;
144
+ }
145
+
146
+ /** Edit a note's date and strength. A date is the words a person would use; the note keeps its quote. */
147
+ function NoteEditor({ note: n, busy, onSave, onCancel, theme, compact }: { note: CompassNote; busy: boolean; onSave: (a: { until?: string | null; strength?: CompassNote["strength"] }) => void; onCancel: () => void; theme: Theme; compact: boolean }) {
148
+ const c = theme.colors; const t = text(c, compact);
149
+ const [until, setUntil] = useState<string | null>(n.until);
150
+ const [strength, setStrength] = useState(n.strength);
151
+ const chip = (label: string, on: boolean, onPress: () => void) => <Pressable key={label} accessibilityRole="radio" accessibilityState={{ checked: on }} onPress={onPress}
152
+ style={{ minHeight: compact ? 44 : 28, paddingHorizontal: 10, borderRadius: 999, justifyContent: "center", borderWidth: 1, borderColor: on ? c.accent : c.border, backgroundColor: on ? c.surface2 : "transparent" }}>
153
+ <Text style={{ color: on ? c.foreground : c.foregroundMuted, fontSize: 12, fontWeight: "500" }}>{label}</Text>
154
+ </Pressable>;
155
+ const dates = dateChoices();
156
+ const dirty = until !== n.until || strength !== n.strength;
157
+ const save = () => onSave({ ...(until !== n.until ? { until } : {}), ...(strength !== n.strength ? { strength } : {}) });
158
+ return <SubmitScope enabled={dirty && !busy} onSubmit={save} style={{ gap: 8, paddingTop: 4 }}>
159
+ <Text style={[t.meta, { color: c.foreground, fontWeight: "600" }]}>Until</Text>
160
+ <View style={{ flexDirection: "row", flexWrap: "wrap", gap: 6 }}>
161
+ {dates.map(d => chip(d.label, until === d.day, () => setUntil(d.day)))}
162
+ {until && !dates.some(d => d.day === until) && chip(dayOf(until), true, () => undefined)}
163
+ </View>
164
+ <Text style={[t.meta, { color: c.foreground, fontWeight: "600" }]}>How much it matters</Text>
165
+ <View style={{ flexDirection: "row", flexWrap: "wrap", gap: 6 }}>{STRENGTHS.map(s => chip(STRENGTH_LABEL[s], strength === s, () => setStrength(s)))}</View>
166
+ <View style={{ flexDirection: "row", gap: 8 }}>
167
+ <Button title="Save" kind="primary" shortcut theme={theme} compact={compact} loading={busy} disabled={!dirty} onPress={save} />
168
+ <Button title="Cancel" kind="ghost" theme={theme} compact={compact} onPress={onCancel} />
169
+ </View>
170
+ </SubmitScope>;
171
+ }
172
+
173
+ /** Pick the workspace a note is about: the workspaces Follow-up tracks, by title. */
174
+ function MovePicker({ current, busy, onPick, onCancel, theme, compact }: { current: string; busy: boolean; onPick: (id: string) => void; onCancel: () => void; theme: Theme; compact: boolean }) {
175
+ const c = theme.colors; const t = text(c, compact);
176
+ const list = useRpc(listRpc);
177
+ const [q, setQ] = useState("");
178
+ const all = useQuery({ queryKey: ["follow-up", "compass-move"], staleTime: 60_000, queryFn: async () => (await list({})).workspaces.filter(w => !w.archived && w.id !== current).map(w => ({ id: w.id, title: w.title })) });
179
+ const found = (all.data ?? []).filter(w => w.title.toLowerCase().includes(q.trim().toLowerCase())).slice(0, 6);
180
+ return <View style={{ gap: 6, paddingTop: 4 }}>
181
+ <View style={{ flexDirection: "row", gap: 8, alignItems: "center" }}>
182
+ <TextInput autoFocus accessibilityLabel="Search workspaces" value={q} onChangeText={setQ} placeholder="Move to which workspace?" placeholderTextColor={c.foregroundMuted}
183
+ style={{ flex: 1, minWidth: 0, minHeight: compact ? 44 : 32, paddingHorizontal: 10, borderRadius: 6, borderWidth: 1, borderColor: c.border, color: c.foreground, fontSize: 13, backgroundColor: c.surface0 }} />
184
+ <Button title="Cancel" kind="ghost" theme={theme} compact={compact} onPress={onCancel} />
185
+ </View>
186
+ {all.isPending && <Text style={t.meta}>Loading workspaces…</Text>}
187
+ {all.error && <Text style={[t.meta, { color: c.statusWarning }]}>{`Couldn't list workspaces: ${errorText(all.error)}`}</Text>}
188
+ {found.map(w => <Pressable key={w.id} accessibilityRole="button" disabled={busy} onPress={() => onPick(w.id)}
189
+ style={state => ({ minHeight: compact ? 44 : 32, paddingHorizontal: 10, justifyContent: "center", borderRadius: 6, backgroundColor: (state as { hovered?: boolean }).hovered ? c.surface2 : "transparent" })}>
190
+ <RichText plain style={t.body}>{w.title}</RichText>
191
+ </Pressable>)}
192
+ {all.data && !found.length && <Text style={t.meta}>{q.trim() ? `No workspace matches "${q.trim()}".` : "No other workspace to move it to."}</Text>}
193
+ </View>;
194
+ }
package/index.server.ts CHANGED
@@ -40,6 +40,7 @@ import { BackgroundAgents, backgroundAgentsFile } from "./server/background-agen
40
40
  import { mayEnroll, recordedRecoveryAgent } from "./server/tasks";
41
41
  import { Store } from "./server/store";
42
42
  import { PriorityStore } from "./server/priorities";
43
+ import { freshPriorities } from "./shared/priorities";
43
44
  import { UsageReader } from "./server/usage";
44
45
  import { Engine, agentWorkspace, findWorkspace } from "./server/engine";
45
46
  import { turnStarted, turnEnded, agentTrackedWorkspace } from "./server/turn-events";
@@ -919,10 +920,10 @@ export default function contribute(server: PluginServerContext) {
919
920
  return withImages(action === "send" || action === "resend" ? images : undefined, refs => engine.answer(workspaceId, questionId, choice, words, action, actorOf(context), refs));
920
921
  });
921
922
  handle(rpc.declareDoneRpc, async ({ agentId, summary }, { paseo }) => { await requireReady(); return engine.declareDone(agentId, summary, await callerWorkspaceId(agentId, paseo, false)); });
922
- handle(rpc.acknowledgeRpc, async ({ agentId, batchId, outcome, result, humanOnly }, { paseo }) => {
923
+ handle(rpc.acknowledgeRpc, async ({ agentId, batchId, outcome, result, humanOnly, waitingOn }, { paseo }) => {
923
924
  await requireReady();
924
925
  const agent = (await paseo.agents.ref(agentId).refresh())?.agent;
925
- try { return await engine.acknowledge(agentId, batchId, outcome, result, await callerWorkspaceId(agentId, paseo), humanOnly); }
926
+ try { return await engine.acknowledge(agentId, batchId, outcome, result, await callerWorkspaceId(agentId, paseo), humanOnly, waitingOn); }
926
927
  catch (error) {
927
928
  if (agent?.workspaceId) await store.mutate(state => {
928
929
  const w = state.workspaces.find(w => w.id === agent.workspaceId);
@@ -1523,10 +1524,35 @@ export default function contribute(server: PluginServerContext) {
1523
1524
  };
1524
1525
  },
1525
1526
  allowed: chatAllowed, tight: () => !governor.allowsBackground(),
1527
+ // Tell the agent (compass-reaches-an-agent-only-by-a-click): one queued message to the workspace's main agent.
1528
+ tell: async (workspaceId, text, by) => {
1529
+ const w = (await store.snapshot()).workspaces.find(x => x.id === workspaceId && !x.archived);
1530
+ if (!w?.mainAgentId) return null;
1531
+ enqueueMessage(w.mainAgentId, text, `compass-${randomUUID()}`, by === "developer" ? "developer" : by);
1532
+ return { agentId: w.mainAgentId };
1533
+ },
1526
1534
  onChange: () => { ranker?.markDue(); feeds.home(); }, log: line => console.warn(line),
1527
1535
  });
1528
- handle(rpc.compassRpc, async ({ workspace }) => { await requireReady(); return compass!.view({ workspace }); });
1536
+ handle(rpc.compassRpc, async ({ workspace }) => {
1537
+ await requireReady();
1538
+ const view = await compass!.view({ workspace });
1539
+ if (!workspace) return view;
1540
+ // Why it matters (the panel) and compass {workspace}: where AI priority puts this workspace ("2nd of 14"), and
1541
+ // the Overseer to ask about a note (its agent while it runs; none when off).
1542
+ const { byWorkspace } = freshPriorities(await priorityStore.read(), Date.now());
1543
+ const ranked = [...byWorkspace.values()].sort((a, b) => b.score - a.score);
1544
+ const at = ranked.findIndex(p => p.workspaceId === workspace);
1545
+ const p = at >= 0 ? ranked[at] : null;
1546
+ const o = await overseerStatus().catch(() => null);
1547
+ return { ...view, priority: p ? { rank: at + 1, of: ranked.length, reason: p.reason, source: p.sources[0] ? { kind: p.sources[0].kind, label: p.sources[0].label } : null } : null, overseer: o?.enabled && o.agentId ? o.agentId : null };
1548
+ });
1529
1549
  handle(rpc.compassFindRpc, async ({ kind, query }) => { await requireReady(); return compass!.find(kind, query); });
1550
+ handle(rpc.compassNoteRpc, async (input, context) => {
1551
+ await requireReady();
1552
+ const ids = new Set((await store.snapshot()).workspaces.filter(w => !w.archived).map(w => w.id));
1553
+ return compass!.note(input, actorBy(actorOf(context)), { workspaceExists: id => ids.has(id) });
1554
+ });
1555
+ handle(rpc.whySuggestedRpc, async input => { await requireReady(); return compass!.why(input); });
1530
1556
  handle(rpc.setCompassRpc, async (input, context) => {
1531
1557
  await requireReady();
1532
1558
  const ids = new Set((await store.snapshot()).workspaces.map(w => w.id));
@@ -1676,7 +1702,7 @@ export default function contribute(server: PluginServerContext) {
1676
1702
  // The directory's agent list (metadata only): a claim never loads or refreshes the main agent.
1677
1703
  agentInfo: async agentId => { const row = gateway.directory.cached(agentId) ?? (await gateway.directory.read()).agents.find(r => r.agent.id === agentId)?.agent; return row ? { status: row.status, activeTurn: row.activeTurn, pendingPermissions: row.pendingPermissions, archivedAt: row.archivedAt } : null; } });
1678
1704
  // 0.15 polls priorities once a minute; the raised issues (Q8) ride the same answer instead of a read of their own.
1679
- handle(rpc.prioritiesRpc, async () => ({ items: await priorityStore.read(), queue: await linearQueue?.needs().catch(() => undefined) }));
1705
+ handle(rpc.prioritiesRpc, async () => ({ items: await priorityStore.read(), queue: await linearQueue?.needs().catch(() => undefined), compass: await compass?.lines().catch(() => undefined) }));
1680
1706
  // The chat's created cards: the engine's directory snapshot as it stands (never waits on or asks the daemon, wakes
1681
1707
  // nothing) and the store. Before the engine's first read the cards just show no state yet.
1682
1708
  // The engine's snapshot as it stands, plus remembered archived agents; ids it lacks are looked up once, not awaited.
@@ -1764,9 +1790,9 @@ export default function contribute(server: PluginServerContext) {
1764
1790
  const [items, rank, overseerView] = await Promise.all([priorityStore.read(), ranker!.status(), overseerStatus()]);
1765
1791
  // The worker's live resources change every tick: the client reads those once when Home opens (follow.usage).
1766
1792
  const meters = governor.allowsExtras() ? await usage.read() : NO_USAGE;
1767
- return { priorities: items, rank, overseer: overseerView, usage: { available: meters.available, source: meters.source, accounts: meters.accounts }, usageLive: !!usageWatch, context: await contextRequests.list(), prStats: await prStats.anyOn(), dispatches: await homeDispatches(), queue: await linearQueue?.needs().catch(() => undefined) };
1793
+ return { priorities: items, rank, overseer: overseerView, usage: { available: meters.available, source: meters.source, accounts: meters.accounts }, usageLive: !!usageWatch, context: await contextRequests.list(), prStats: await prStats.anyOn(), dispatches: await homeDispatches(), queue: await linearQueue?.needs().catch(() => undefined), compass: await compass?.lines().catch(() => undefined) };
1768
1794
  },
1769
- key: v => JSON.stringify([v.priorities, v.rank, v.overseer, usageKey(v.usage), v.usageLive, v.context, v.prStats, v.dispatches, v.queue]),
1795
+ key: v => JSON.stringify([v.priorities, v.rank, v.overseer, usageKey(v.usage), v.usageLive, v.context, v.prStats, v.dispatches, v.queue, v.compass]),
1770
1796
  // Smart Session's files are watched only while someone looks at Home (server/usage.ts watch()).
1771
1797
  onFirst: () => { usageWatch = usage.watch(() => void homeFeed.changed()); },
1772
1798
  onLast: () => { usageWatch?.close(); usageWatch = null; },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "paseo-follow-up",
3
3
  "private": false,
4
- "version": "2.4.0-beta.5",
4
+ "version": "2.4.0-beta.6",
5
5
  "description": "Follows every workspace your coding agents work in until it's done: one list of what needs you.",
6
6
  "type": "module",
7
7
  "files": [