paseo-follow-up 2.4.0-beta.7 → 2.4.0-beta.9

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/agents.tsx CHANGED
@@ -6,7 +6,7 @@ import { SettingsAction, SettingsCard, SettingsSection, SettingsSelect, Settings
6
6
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
7
7
  import { agentSettingsRpc, setAgentSettingRpc, setWaitRpc } from "../shared/contracts";
8
8
  import { WAIT_HOST_NOTE, WAIT_NOT_ATTACHED, waitNote, waitSwitchCopy } from "../shared/wait";
9
- import { hasSame, isJobRole, type AgentRole, type AgentSettingsView, type SavedRole } from "../shared/agent-settings";
9
+ import { OUTSIDE_READS, guardedProvider, hasSame, isJobRole, type AgentRole, type AgentSettingsView, type SavedRole } from "../shared/agent-settings";
10
10
  import { NO_PROMPT_MODE, SETTINGS_ORDER, isReset, resetEntry } from "../shared/job-rows";
11
11
  import { JobRows, agentSettingsKey, useAgentSettings, type JobExtra } from "./job-rows";
12
12
  import { Button, errorText, text, type Theme } from "./kit";
@@ -36,6 +36,11 @@ export function AgentSettings({ theme, compact }: Pick<PluginSurfaceProps, "them
36
36
  <SettingsCard>
37
37
  <JobRows theme={theme} compact={compact} order={SETTINGS_ORDER} extra={more} />
38
38
  </SettingsCard>
39
+ {/* A job role on a provider Follow-up can't take tools from: what it no longer reads, and why (invariant 81). */}
40
+ {(data?.roles ?? []).filter(r => isJobRole(r.role) && !guardedProvider(r.provider) && OUTSIDE_READS[r.role]).map(r => {
41
+ const label = data?.catalog?.providers.find(p => p.id === r.provider)?.label ?? r.provider;
42
+ return <Text key={r.role} accessibilityRole="alert" style={[t.meta, { color: c.statusWarning, paddingHorizontal: 4 }]}>{unguardedLine(r.role, label)}</Text>;
43
+ })}
39
44
  {/* Once, after the rows: what can't be picked and why (the pickers only list what can). */}
40
45
  {!!data?.catalog && unavailableLine(data.catalog.providers) && <Text style={[t.meta, { paddingHorizontal: 4 }]}>{unavailableLine(data.catalog.providers)}</Text>}
41
46
  </SettingsSection>;
@@ -116,6 +121,10 @@ function RoleMore({ r, save, busy, theme, compact, invalid }: { r: Role; save: (
116
121
  const roleDefaultText = (role: AgentRole) => role === "recovery" ? "the main agent's setup" : role === "dispatch" ? "the Overseer's agent" : role === "overseer" ? "Claude, newest Opus" : role === "about" ? "Claude Haiku" : "Claude Sonnet, hourly";
117
122
  /** "Not available in Paseo: Claude and Pi (turned off in Paseo); Antigravity (not installed)." Grouped by reason; a
118
123
  * provider whose name is also on a ready one isn't listed, so the line never contradicts the rows. */
124
+ /** "On OpenCode, AI priority doesn't rank, since what it reads was written by other people…" (invariant 81). */
125
+ export const unguardedLine = (role: AgentRole, label: string) =>
126
+ `On ${label}, ${OUTSIDE_READS[role]}, since what they read was written by other people and Follow-up can't take ${label}'s tools away. Pick Claude or Codex for all of it.`;
127
+
119
128
  function unavailableLine(providers: readonly { label: string; available: boolean; reason: string | null }[]): string | null {
120
129
  const ready = new Set(providers.filter(p => p.available).map(p => p.label));
121
130
  const groups = new Map<string, string[]>();
@@ -4,9 +4,10 @@ import { Pressable, Text } from "./text";
4
4
  import { useRpc } from "@getpaseo/plugin/client";
5
5
  import { Icon, ScrollView, useToast } from "@getpaseo/plugin/client/ui";
6
6
  import { dispatchActionsRpc, dispatchRpc, linearQueueRpc, sweepQueueRpc } from "../shared/contracts";
7
- import { changeChip, openedLine, queueRowMeta, raisedRow, sinceBlock, type SinceChange, type SinceLine } from "../shared/brief-since";
7
+ import { changeChip, openedLine, queueRowMeta, sinceBlock, type SinceChange, type SinceLine } from "../shared/brief-since";
8
+ import { nobodyRow, type CompassSince } from "../shared/nobody";
9
+ import { PriorityLine } from "./home-chrome";
8
10
  import { actionIcon, stateIcon } from "../shared/new-view";
9
- import type { RaisedNeed } from "../shared/linear-queue";
10
11
  import type { QueueNeeds } from "./home-view";
11
12
  import type { DispatchAction } from "../shared/dispatch";
12
13
  import { errorText } from "../shared/errors";
@@ -34,7 +35,9 @@ type QueueViewData = {
34
35
  groups: { priority: number; name: string; count: number; issues: QueueIssueRow[] }[];
35
36
  counts: { all: number; noWorkspace: number; changed: number };
36
37
  more: number;
37
- raised: RaisedNeed[];
38
+ raised: unknown[];
39
+ /** What Compass heard since the same point: the one Since block (design §8). */
40
+ compass?: CompassSince | null;
38
41
  };
39
42
  type Filter = "all" | "no-workspace" | "changed";
40
43
  type Nav = { openWorkspace(i: { workspaceId: string }): void } | undefined;
@@ -122,7 +125,7 @@ export function SinceBlock({ theme, compact, openQueue, onStarted, navigation, r
122
125
  <Text style={t.meta}>Couldn't read it: {error}</Text>
123
126
  </View>;
124
127
  // Nothing swept yet and nothing to say: no block (a fresh install before its first sweep, or no Linear).
125
- if (!view || (!view.status.sweptAt && !view.changes.length)) return null;
128
+ if (!view || (!view.status.sweptAt && !view.changes.length && !view.compass?.lines.length)) return null;
126
129
  const now = Date.now();
127
130
  const b = sinceBlock(view, now, view.status.timeZone, raised);
128
131
  const link = <Pressable accessibilityRole="link" accessibilityLabel={`Open your Linear queue: ${b.link}`} onPress={openQueue} hitSlop={compact ? 0 : 8}
@@ -262,39 +265,49 @@ export function QueueScreen({ theme, compact, onHome, navigation }: { theme: The
262
265
  </ScrollView>;
263
266
  }
264
267
 
265
- // ---------- decision Q8: raised issues in Needs you ----------
268
+ // ---------- "Nobody's on it": raised issues and urgent Compass asks in Needs you ----------
266
269
 
267
270
  /**
268
- * The raised issues as Needs-you rows, shaped like Home's: amber ↑, the key, "Raised", then "Low → High · title · no
269
- * workspace yet", New's Start…, and the age where the small x reveals (invariant 59, follow.dismiss `issue`).
271
+ * "Nobody's on it" rows (nobody-s-on-it-is-needs-you), shaped like Home's: an amber ↑ for a raise or the compass glyph
272
+ * for a Compass ask, the key, "Nobody's on it", then "title · due Thu"; under it the reason
273
+ * line with its source, as Home's rows carry AI priority's ("Dana: renewal call Thu · Compass", "Linear Raised Low →
274
+ * Urgent"). One Start… (New on the issue, `{why}` filled) and the two-click Remove of every Needs-you item (invariant
275
+ * 59: follow.dismiss `issue`, which takes the raise and every Compass ask on it).
270
276
  */
271
- export function RaisedRows({ theme, compact, data, onDismissed }: { theme: Theme; compact: boolean; data: QueueNeeds; onDismissed: () => void }) {
277
+ export function NobodyRows({ theme, compact, data, onDismissed }: { theme: Theme; compact: boolean; data: QueueNeeds; onDismissed: () => void }) {
272
278
  const c = theme.colors;
273
279
  // The same Dismiss as every Needs-you item (invariant 59): two clicks in place, one toast with Undo. The worker
274
280
  // pushes the new list on the home feed; without the feed, onDismissed reads it once.
275
281
  const dismiss = useDismiss(onDismissed);
276
282
  const now = Date.now();
277
- return <>{data.raised.map(r => {
278
- const row = raisedRow(r, now, data.timeZone);
283
+ return <>{data.needs.map(r => {
284
+ const row = nobodyRow(r, now, data.timeZone);
285
+ const first = r.reasons[0]!;
286
+ const reason = <PriorityLine reason={first.line} source={first.from === "compass" ? { kind: "compass", label: first.source } : { kind: "linear", label: first.source }} c={c} size={compact ? 12 : 11} lines={compact ? 2 : 1} />;
279
287
  const when = age(r.at, now);
280
288
  const start = <BarBtn c={c} compact={compact} small primary={false} disabled={false} b={{ name: "Start…", icon: "Play", key: null }} onPress={() => openNew({ source: r.key })} />;
281
289
  const x = <DismissX theme={theme} compact={compact} label={`Remove ${r.key}`} onPress={() => dismiss({ issue: r.key })} />;
290
+ const glyph = <View style={{ width: compact ? 18 : 16, alignItems: "center", paddingTop: compact ? 2 : 0 }}><Icon name={row.compass ? "Compass" : "ArrowUp"} size={compact ? 17 : 15} color={c.statusWarning} /></View>;
282
291
  return <RevealScope key={r.key} accessibilityLabel={`Needs you: ${row.label}`}
283
- style={{ flexDirection: "row", alignItems: compact ? "flex-start" : "center", gap: 10, minHeight: compact ? 56 : 38, paddingLeft: compact ? 14 : 16, paddingRight: compact ? 16 : 16, paddingVertical: compact ? 12 : 4,
292
+ style={{ flexDirection: "row", alignItems: compact ? "flex-start" : "center", gap: 10, minHeight: compact ? 56 : 46, paddingLeft: compact ? 14 : 16, paddingRight: compact ? 16 : 16, paddingVertical: compact ? 12 : 5,
284
293
  borderLeftWidth: 2, borderLeftColor: withAlpha(c.statusWarning, 0.9), ...(compact ? { borderBottomWidth: 1, borderBottomColor: withAlpha(c.border, 0.6) } : {}) }}>
285
- <View style={{ width: compact ? 18 : 16, alignItems: "center", paddingTop: compact ? 2 : 0 }}><Icon name="ArrowUp" size={compact ? 17 : 15} color={c.statusWarning} /></View>
294
+ {glyph}
286
295
  {compact ? <View style={{ flex: 1, minWidth: 0, gap: 2 }}>
287
296
  <View style={{ flexDirection: "row", alignItems: "flex-start", gap: 8 }}>
288
297
  <Text numberOfLines={1} style={{ flex: 1, minWidth: 0, color: c.foreground, fontSize: 15, lineHeight: 20, fontWeight: "500" }}>{row.title}</Text>
289
298
  <Text style={{ color: c.foregroundMuted, fontSize: 12, paddingTop: 2, fontVariant: ["tabular-nums"] }}>{when}</Text>
290
299
  </View>
291
300
  <Text numberOfLines={2} style={{ color: c.foregroundMuted, fontSize: 13, lineHeight: 18 }}><Text style={{ color: c.statusWarning, fontWeight: "600" }}>{row.word}</Text> · {row.line}</Text>
301
+ {reason}
292
302
  <View style={{ flexDirection: "row", alignItems: "center", justifyContent: "space-between", marginTop: 6 }}>{start}{x}</View>
293
303
  </View> : <>
294
- <View style={{ flex: 1, minWidth: 0, flexDirection: "row", alignItems: "center", gap: 10 }}>
295
- <Text numberOfLines={1} style={{ flexShrink: 0, color: c.foreground, fontSize: 13, fontWeight: "500" }}>{row.title}</Text>
296
- <Text numberOfLines={1} style={{ flexShrink: 0, color: c.statusWarning, fontSize: 12 }}>{row.word}</Text>
297
- <Text numberOfLines={1} style={{ flex: 1, minWidth: 0, color: c.foregroundMuted, fontSize: 12, marginLeft: -10 }}>{"\u00a0· "}{row.line}</Text>
304
+ <View style={{ flex: 1, minWidth: 0, gap: 1 }}>
305
+ <View style={{ flexDirection: "row", alignItems: "center", gap: 10, minWidth: 0 }}>
306
+ <Text numberOfLines={1} style={{ flexShrink: 0, color: c.foreground, fontSize: 13, fontWeight: "500" }}>{row.title}</Text>
307
+ <Text numberOfLines={1} style={{ flexShrink: 0, color: c.statusWarning, fontSize: 12 }}>{row.word}</Text>
308
+ <Text numberOfLines={1} style={{ flex: 1, minWidth: 0, color: c.foregroundMuted, fontSize: 12, marginLeft: -10 }}>{"\u00a0· "}{row.line}</Text>
309
+ </View>
310
+ <View style={{ paddingRight: 40 }}>{reason}</View>
298
311
  </View>
299
312
  {start}
300
313
  <View style={{ flexDirection: "row", alignItems: "center", gap: 4 }}>
@@ -1,7 +1,7 @@
1
- import { useEffect, useState } from "react";
1
+ import { useEffect, useState, type ReactNode } from "react";
2
2
  import { ActivityIndicator, TextInput, View } from "react-native";
3
- import { useRpc } from "@getpaseo/plugin/client";
4
- import { Icon, SettingsSection, useToast } from "@getpaseo/plugin/client/ui";
3
+ import { openExternalUrl, useRpc } from "@getpaseo/plugin/client";
4
+ import { Icon, SettingsSection, SettingsSelect, useToast } from "@getpaseo/plugin/client/ui";
5
5
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
6
6
  import { Pressable, Text } from "./text";
7
7
  import { Button, SubmitScope, Switch, errorText, text, type Theme } from "./kit";
@@ -10,12 +10,14 @@ import { raised, tint } from "./theme";
10
10
  import { compassFindRpc, compassRpc, readCompassRpc, setCompassRpc } from "../shared/contracts";
11
11
  import {
12
12
  COMPASS, ROLES, ROLE_INFO, type CompassChange, type CompassNote, type CompassSource, type GlossaryEntry, type Place, type Preset, type PresetView, type Role, type Who,
13
+ CADENCES, type CompassSettings,
13
14
  } from "../shared/compass";
15
+ import { type PlanView } from "../shared/morning-brief";
14
16
 
15
17
  export const compassKey = ["follow-up", "compass"];
16
18
 
17
19
  type View_ = {
18
- settings: { sources: CompassSource[]; instructions: string; glossary: GlossaryEntry[] };
20
+ settings: { sources: CompassSource[]; instructions: string; glossary: GlossaryEntry[]; cadence: CompassSettings["cadence"]; routing: CompassSettings["routing"] };
19
21
  readers: { conversation: boolean; history: boolean };
20
22
  presets: PresetView[];
21
23
  blocked: string | null;
@@ -26,6 +28,8 @@ type View_ = {
26
28
  lastRead: { at: string; trigger: string; ok: boolean; notes: number; error: string | null } | null;
27
29
  today: { extractions: number; cap: number };
28
30
  running: boolean;
31
+ /** This week's plan (Settings → Compass reads every priority input in one view). */
32
+ plan?: PlanView;
29
33
  };
30
34
  type Found = { id: string; name: string; place: Place };
31
35
 
@@ -37,21 +41,33 @@ const whoWhere = (s: CompassSource) => s.who.kind === "person" && s.places.lengt
37
41
  const day = (d: string) => new Date(`${d}T12:00:00`).toLocaleDateString([], { weekday: "short", month: "short", day: "numeric" });
38
42
  const whoName = (w: Who) => w.kind === "person" ? w.person.name : w.kind === "people" ? w.people.map(p => p.name).join(", ") : w.kind === "me" ? "You" : "Everyone";
39
43
 
40
- /**
41
- * Settings → Morning brief → Compass (docs/compass.md): the people and places that set the developer's priorities, how
42
- * to read them, and the glossary. One editor for every source; presets only fill its fields. Every change goes through
43
- * the RPC `set_compass` runs, and Read now through `read_compass`.
44
- */
45
- export function CompassSection({ theme, compact }: { theme: Theme; compact: boolean }) {
46
- const c = theme.colors; const t = text(c, compact);
47
- const read = useRpc(compassRpc); const write = useRpc(setCompassRpc); const readNow = useRpc(readCompassRpc);
48
- const cache = useQueryClient(); const toast = useToast();
49
- const query = useQuery({ queryKey: compassKey, queryFn: async () => await read({}) as View_, refetchInterval: q => q.state.data?.running ? 2_000 : 30_000 });
50
- const change = useMutation({
44
+ /** Settings → Compass's one read: the sources, their notes, the plan and the inputs (`follow.compass`, as `compass` reads it). */
45
+ export function useCompassView<T = View_>() {
46
+ const read = useRpc(compassRpc);
47
+ return useQuery({ queryKey: compassKey, queryFn: async () => await read({}) as T, refetchInterval: q => (q.state.data as View_ | undefined)?.running ? 2_000 : 30_000 });
48
+ }
49
+ function useCompassChange() {
50
+ const write = useRpc(setCompassRpc); const cache = useQueryClient(); const toast = useToast();
51
+ return useMutation({
51
52
  mutationFn: async (input: CompassChange) => await write(input) as View_,
52
53
  onSuccess: value => cache.setQueryData(compassKey, value),
53
54
  onError: error => toast.error(errorText(error)),
54
55
  });
56
+ }
57
+
58
+ /**
59
+ * Settings → Compass → What sets your priorities (docs/compass.md, one-place-for-priority-inputs): every input AI
60
+ * priority reads, in one list. First the Compass sources, the people and places the developer picked (one editor for
61
+ * every source; presets only fill its fields), then `after`: the built-in inputs (the Linear queue, DMs and mentions,
62
+ * the calendar, mail, review requests) and the mcpproxy servers Ask could read. Every change goes through the RPC
63
+ * `set_compass` runs, and Read now through `read_compass`.
64
+ */
65
+ export function CompassSection({ theme, compact, after }: { theme: Theme; compact: boolean; after?: ReactNode }) {
66
+ const c = theme.colors; const t = text(c, compact);
67
+ const readNow = useRpc(readCompassRpc);
68
+ const cache = useQueryClient(); const toast = useToast();
69
+ const query = useCompassView();
70
+ const change = useCompassChange();
55
71
  const reading = useMutation({
56
72
  mutationFn: async () => await readNow({}) as { running: boolean; view: View_ },
57
73
  onSuccess: r => cache.setQueryData(compassKey, r.view),
@@ -60,7 +76,7 @@ export function CompassSection({ theme, compact }: { theme: Theme; compact: bool
60
76
  const [editing, setEditing] = useState<string | "new" | null>(null);
61
77
  const data = query.data;
62
78
  const full = !!data && data.settings.sources.length >= COMPASS.sources;
63
- return <SettingsSection title="Compass" info="The people and places that set your priorities. Follow-up reads what they say each workday morning, keeps a note of each priority with their words, and AI priority ranks your work by it. Only the people you pick are read, only through read-only tools, and a fast model with no tools reads it. Agents can set it up too.">
79
+ return <SettingsSection title="What sets your priorities" info="Everything AI priority, Needs you and the brief read, in one list. The people you add are read each workday morning, and during the day while Follow-up is open: Follow-up keeps a note of each priority with their words, and AI priority ranks your work by it. Only the people you pick are read, only through read-only tools, and a fast model with no tools reads them. Nothing is ever posted. Agents can set it up too.">
64
80
  {query.isPending && <ActivityIndicator accessibilityLabel="Loading Compass" color={c.foregroundMuted} style={{ alignSelf: "flex-start", marginVertical: 8 }} />}
65
81
  {query.error && <Text style={[t.meta, { color: c.statusWarning }]}>{`Couldn't load Compass: ${errorText(query.error)}`}</Text>}
66
82
  {data?.blocked && <Line icon="TriangleAlert" tone={c.statusWarning} text={data.blocked} theme={theme} compact={compact} />}
@@ -76,6 +92,7 @@ export function CompassSection({ theme, compact }: { theme: Theme; compact: bool
76
92
  onToggle={on => change.mutate({ source: { id: s.id, enabled: on } })} />)}
77
93
  {editing === "new" && <SourceEditor view={data} first={data.settings.sources.length === 0} busy={change.isPending} theme={theme} compact={compact} onCancel={() => setEditing(null)}
78
94
  onSave={input => change.mutate(input, { onSuccess: () => setEditing(null) })} />}
95
+ {after}
79
96
  </View>}
80
97
  {data && editing !== "new" && <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8 }}>
81
98
  {full
@@ -84,11 +101,42 @@ export function CompassSection({ theme, compact }: { theme: Theme; compact: bool
84
101
  {data.settings.sources.length > 0 && <Button title="Read now" icon="RotateCcw" kind="ghost" theme={theme} compact={compact} loading={reading.isPending || data.running} disabled={!!data.blocked} onPress={() => reading.mutate()} />}
85
102
  {data.settings.sources.length > 0 && <Text style={t.meta}>{statusLine(data)}</Text>}
86
103
  </View>}
87
- {data && <ReadingNotes value={data.settings.instructions} busy={change.isPending} theme={theme} compact={compact} onSave={v => change.mutate({ instructions: v })} />}
88
- {data && <Glossary entries={data.settings.glossary} busy={change.isPending} theme={theme} compact={compact} onSave={g => change.mutate({ glossary: g })} />}
89
104
  </SettingsSection>;
90
105
  }
91
106
 
107
+ /** Settings → Compass → How to read your Compass: the words every source is read with, and the glossary. */
108
+ export function CompassReading({ theme, compact }: { theme: Theme; compact: boolean }) {
109
+ const query = useCompassView(); const change = useCompassChange();
110
+ const data = query.data;
111
+ if (!data) return null;
112
+ return <SettingsSection title="How to read your Compass" info="Words every source is read with; each source's own How to read this comes after them. They change how messages are understood, never what is read.">
113
+ <ReadingNotes value={data.settings.instructions} busy={change.isPending} theme={theme} compact={compact} onSave={v => change.mutate({ instructions: v })} />
114
+ <Glossary entries={data.settings.glossary} busy={change.isPending} theme={theme} compact={compact} onSave={g => change.mutate({ glossary: g })} />
115
+ </SettingsSection>;
116
+ }
117
+
118
+ /** The daytime read's choices (the-brief-has-one-timer): only while Follow-up is open, on workdays 08:00-20:00. */
119
+ const CADENCE_LABEL: Record<CompassSettings["cadence"], string> = { off: "Mornings only", "1h": "Every hour", "2h": "Every 2 hours", "4h": "Every 4 hours" };
120
+ /** Where Compass's suggestions go: an issue nobody started that a source said matters. */
121
+ const ROUTING_LABEL: Record<CompassSettings["routing"]["suggestions"], string> = { "needs-you-and-new": "Needs you and New", "new-only": "New only", off: "Off" };
122
+
123
+ /**
124
+ * When's Compass rows: the daytime read (Off, 1, 2 or 4 h while the app is open) and where suggestions go. The same
125
+ * `set_compass` change an agent sends ({ cadence }, { routing }).
126
+ */
127
+ export function CompassWhen({ theme, compact, part }: { theme: Theme; compact: boolean; part: "cadence" | "routing" }) {
128
+ const query = useCompassView(); const change = useCompassChange();
129
+ const data = query.data;
130
+ if (!data || !data.settings.sources.length) return null;
131
+ const s = data.settings;
132
+ // One row each, so the settings card draws its divider between them.
133
+ if (part === "cadence") return <SettingsSelect label="During the day" hint={s.cadence === "off" ? "Compass reads once, at the morning read. Read now reads at once." : "While Follow-up is open, on workdays from 08:00 to 20:00. Each read takes only what's new, and nothing is read while the app is closed."}
134
+ value={s.cadence} disabled={change.isPending} options={CADENCES.map(v => ({ value: v, label: CADENCE_LABEL[v] }))} onValueChange={cadence => change.mutate({ cadence: cadence as CompassSettings["cadence"] })} />;
135
+ return <SettingsSelect label="Issues nobody's on" hint={s.routing.suggestions === "off" ? "Compass notes still reorder AI priority; none suggests an issue." : s.routing.suggestions === "new-only" ? "Listed first in New's My issues, with why." : `A strong ask due within ${s.routing.urgentWithinWorkdays} workdays goes to Needs you, from a source with Needs you on. The rest are first in New.`}
136
+ value={s.routing.suggestions} disabled={change.isPending} options={(Object.keys(ROUTING_LABEL) as CompassSettings["routing"]["suggestions"][]).map(v => ({ value: v, label: ROUTING_LABEL[v] }))}
137
+ onValueChange={suggestions => change.mutate({ routing: { suggestions: suggestions as CompassSettings["routing"]["suggestions"] } })} />;
138
+ }
139
+
92
140
  /** "Read 09:02 · 3 notes live · 1 not matched to a workspace", or why the last read failed. */
93
141
  function statusLine(v: View_): string {
94
142
  if (v.running) return "Reading…";
@@ -123,6 +171,7 @@ function SourceRow({ view, source, first, busy, onEdit, onToggle, theme, compact
123
171
  <Text style={[t.meta, { color: c.foreground }]}>{ROLE_INFO[r].label}</Text>
124
172
  </View>)}
125
173
  </View>
174
+ {source.enabled && source.roles.includes("plan") && <PlanLine source={source} plan={view.plan} theme={theme} compact={compact} />}
126
175
  {source.instructions ? <RichText plain numberOfLines={2} style={[t.meta, { fontStyle: "italic" }]}>{`“${source.instructions}”`}</RichText> : null}
127
176
  {source.enabled && (live
128
177
  ? <Pressable accessibilityRole="button" accessibilityState={{ expanded: open }} accessibilityLabel={`${open ? "Hide" : "Show"} ${live} note${live === 1 ? "" : "s"} from ${source.label}`} onPress={() => setOpen(o => !o)} hitSlop={compact ? 0 : 6}
@@ -144,6 +193,29 @@ function SourceRow({ view, source, first, busy, onEdit, onToggle, theme, compact
144
193
  </View>;
145
194
  }
146
195
 
196
+ /**
197
+ * This week's plan under the source that posted it ("This week's plan · Week of Nov 23 · posted Sun 18:05 · 14 items, 3
198
+ * without an issue", with Open), or that none has come from it yet. Plans come from Compass on arrival.
199
+ */
200
+ function PlanLine({ source, plan, theme, compact }: { source: CompassSource; plan?: PlanView; theme: Theme; compact: boolean }) {
201
+ const c = theme.colors; const t = text(c, compact);
202
+ if (!plan || plan.mode === "off" || plan.source === "env") return null;
203
+ const mine = plan.found?.source === source.id ? plan.found : plan.previous?.source === source.id && !plan.found ? plan.previous : null;
204
+ const inUse = !!mine && plan.url === mine.url;
205
+ const posted = mine?.postedAt ? new Date(mine.postedAt).toLocaleString([], { weekday: "short", hour: "2-digit", minute: "2-digit", hourCycle: "h23" }) : null;
206
+ const last = inUse && plan.previous?.url === mine?.url && !plan.found;
207
+ const line = inUse ? `Shared ${last ? "last week's plan" : "this week's plan"}${plan.read?.title ? `, ${plan.read.title}` : ""}${posted ? ` · ${posted}` : ""}`
208
+ : mine ? "Shared a plan; a pasted link is in use instead" : "No plan shared yet: the newest claude.ai artifact becomes the plan";
209
+ return <View style={{ flexDirection: "row", alignItems: "flex-start", gap: 6 }}>
210
+ <View style={{ paddingTop: compact ? 4 : 3 }}><Icon name={inUse ? "Check" : "Map"} size={12} color={inUse ? c.statusSuccess : c.foregroundMuted} /></View>
211
+ <RichText plain style={[t.meta, { flexShrink: 1, minWidth: 0 }]}>{line}</RichText>
212
+ {inUse && <Pressable accessibilityRole="link" accessibilityLabel={`Open this week's plan from ${source.label}`} onPress={() => void openExternalUrl(mine!.url).catch(() => undefined)} hitSlop={compact ? 0 : 6}
213
+ style={{ minHeight: compact ? 44 : 20, marginTop: compact ? -12 : 0, justifyContent: compact ? "center" : "flex-start" }}>
214
+ <Text style={[t.meta, { color: c.accent, fontWeight: "600" }]}>Open</Text>
215
+ </Pressable>}
216
+ </View>;
217
+ }
218
+
147
219
  /**
148
220
  * What Compass understood from a source: each live note, the words it quotes, its date and where it went. The quote is
149
221
  * the proof (a-compass-note-quotes-its-source), so it is always shown.
@@ -284,7 +356,6 @@ function ReadingNotes({ value, busy, onSave, theme, compact }: { value: string;
284
356
  useEffect(() => setDraft(value), [value]);
285
357
  const dirty = draft.trim() !== value.trim();
286
358
  return <SubmitScope enabled={dirty && !busy} onSubmit={() => onSave(draft)} style={{ gap: 6 }}>
287
- <Text style={[t.label, { color: c.foreground }]}>How to read your Compass</Text>
288
359
  <TextInput accessibilityLabel="How to read your Compass" multiline value={draft} onChangeText={v => setDraft(v.slice(0, COMPASS.instructions))} placeholder="P0 means today. 'The renewal' is the acme renewal. Customer asks wait for the plan unless they name a date."
289
360
  placeholderTextColor={c.foregroundMuted} style={{ minHeight: 72, padding: 10, borderRadius: 6, borderWidth: 1, borderColor: c.border, color: c.foreground, fontSize: 13, backgroundColor: c.surface0, textAlignVertical: "top" }} />
290
361
  <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8 }}>
@@ -84,9 +84,9 @@ export function useHomeModel(sources: HomeSources): HomeModel {
84
84
  const now = useMinute();
85
85
  // The machine-wide auto-send hold: a string, so a usage poll that changes nothing else doesn't rebuild the model.
86
86
  const hold = useSyncExternalStore(extras.subscribe, () => autoSendHold(extras.usage().resources, Date.now()), () => null);
87
- // Decision Q8: the raised Linear issues count in Needs you, the worker's one number (home feed), so Home's header,
88
- // strip and brief line and the sidebar badge (client/live.tsx) agree (invariant raised-is-needs-you).
89
- const raised = useSyncExternalStore(extras.subscribe, () => extras.queue().raised.length, () => 0);
87
+ // "Nobody's on it" rows (raised issues and urgent Compass asks) count in Needs you, the worker's one number (home
88
+ // feed), so Home's header, strip and brief line and the sidebar badge (client/live.tsx) agree (nobody-s-on-it-is-needs-you).
89
+ const raised = useSyncExternalStore(extras.subscribe, () => extras.queue().needs.length, () => 0);
90
90
  const compass = useSyncExternalStore(extras.subscribe, extras.compass, extras.compass);
91
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]);
92
92
  }
@@ -12,7 +12,7 @@ import { NO_USAGE, USAGE_POLL_MS, type Usage } from "../shared/usage";
12
12
  import type { z } from "zod";
13
13
 
14
14
  export type QueueNeeds = z.infer<typeof queueNeedsSchema>;
15
- const NO_QUEUE: QueueNeeds = { raised: [], timeZone: "UTC", revision: "" };
15
+ const NO_QUEUE: QueueNeeds = { needs: [], timeZone: "UTC", revision: "" };
16
16
  import { onVisible, whileVisible } from "./visibility";
17
17
  import type { ContextRequest } from "../shared/catch-up";
18
18
 
@@ -108,7 +108,9 @@ export function createHomeExtras(client: PluginClientContext) {
108
108
  const pollHome = () => together([
109
109
  poll(PRIORITY_POLL_MS, async () => {
110
110
  const answer = await client.rpc(prioritiesRpc, {});
111
- const queued = setCompass(answer.compass) || setQueue(answer.queue);
111
+ // Set every store the answer carries: `a() || b()` skips b once a changed (a Compass line hid Nobody's on it).
112
+ const compassMoved = setCompass(answer.compass), queueMoved = setQueue(answer.queue);
113
+ const queued = compassMoved || queueMoved;
112
114
  if (JSON.stringify(answer.items) === JSON.stringify(priorities)) return queued;
113
115
  priorities = answer.items; return true;
114
116
  }),
package/client/home.tsx CHANGED
@@ -22,7 +22,7 @@ import { ReferencesLine } from "./linked";
22
22
  import { WhyItMatters } from "./why-it-matters";
23
23
  import { bottomGap, bottomInset, Button, focusSoon, IconButton, space, text, type Theme } from "./kit";
24
24
  import { DispatchRows, NewHost, openNew, useNewOpen } from "./new";
25
- import { QueueScreen, RaisedRows, SinceBlock } from "./brief-since";
25
+ import { NobodyRows, QueueScreen, SinceBlock } from "./brief-since";
26
26
  import type { NewKey } from "./search-key";
27
27
  import { DockedPane } from "./docked-pane";
28
28
  import type { DockState } from "./dock";
@@ -115,11 +115,12 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
115
115
  const { inbox } = deps.sources;
116
116
  const c = theme.colors;
117
117
  const compact = layout.compact;
118
- // Decision Q8: raised Linear issues are Needs-you items with no workspace row. The worker sends them on the home
119
- // feed; the model counts them (model.raised) and they head the group. Catch up's deck and model.needs stay workspaces.
118
+ // "Nobody's on it" (raised issues, urgent Compass asks) are Needs-you items with no workspace row. The worker sends
119
+ // them on the home feed; the model counts them (model.raised) and they head the group. Catch up's deck and
120
+ // model.needs stay workspaces.
120
121
  const model = useHomeModel(deps.sources);
121
122
  const queue = useSyncExternalStore(deps.sources.extras.subscribe, deps.sources.extras.queue, deps.sources.extras.queue);
122
- const raisedKeys = useMemo(() => new Set(queue.raised.map(r => r.key)), [queue.raised]);
123
+ const raisedKeys = useMemo(() => new Set(queue.needs.map(r => r.key)), [queue.needs]);
123
124
  const omnibox = useOmnibox(model, deps.sources);
124
125
  const searchKey = deps.searchKey;
125
126
  const anywhereKey = useSyncExternalStore(searchKey?.subscribe ?? noSubscribe, searchKey?.label ?? noLabel, searchKey?.label ?? noLabel);
@@ -212,7 +213,7 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
212
213
  setSelected(OVERSEER_KEY); setReplyFocus(n => n + 1);
213
214
  // eslint-disable-next-line react-hooks/exhaustive-deps
214
215
  }, [params.ask]);
215
- const briefLine = [pane.counts.needs ? `${pane.counts.needs} need you` : "Nothing needs you", pane.counts.sending ? `${pane.counts.sending} sending` : "", pane.away.count ? `${pane.away.count} done while away` : ""].filter(Boolean).join(" · ");
216
+ const briefLine = [pane.counts.needs ? `${pane.counts.needs} need you` : "Nothing needs you", pane.counts.sending ? `${pane.counts.sending} sending` : "", pane.away.count ? `${pane.away.count} done while away` : "", queue.heard ?? ""].filter(Boolean).join(" · ");
216
217
 
217
218
  const openFull = useCallback((s: Workstream) => {
218
219
  if (!navigation) return;
@@ -286,7 +287,7 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
286
287
  <View style={{ flexDirection: "row", paddingHorizontal: 6 }}><VersionMark theme={theme} touch openSettings={deps.openSettings} /></View></View>
287
288
  : undefined}
288
289
  // Phones: the setup offer goes after the Needs-you group when there is one, so the first ask stays high.
289
- raised={<RaisedRows theme={theme} compact={compact} data={queue} onDismissed={deps.sources.extras.refreshQueue} />}
290
+ raised={<NobodyRows theme={theme} compact={compact} data={queue} onDismissed={deps.sources.extras.refreshQueue} />}
290
291
  afterNeeds={compact && model.needs > 0 && props.onboarding?.offer ? <SetupOffer theme={theme} compact view={props.onboarding} /> : undefined}
291
292
  emptyAction={compact ? <Button theme={theme} compact kind="secondary" icon="Settings" title="Project settings" onPress={deps.openSettings} /> : undefined}
292
293
  top={<ListTop theme={theme} dense={compact} title={compact ? undefined : <ListHeader theme={theme} compact={compact} onSettings={deps.openSettings} onKeys={() => setKeysOpen(v => !v)} onStats={openStats} onNew={() => openNew()} newLabel={newLabel} />}>