paseo-follow-up 2.0.1 → 2.0.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +8 -43
  2. package/client/brief.tsx +9 -4
  3. package/client/home.tsx +11 -3
  4. package/client/linked.tsx +1 -1
  5. package/client/live-copies.ts +19 -1
  6. package/client/live.tsx +16 -12
  7. package/client/merge-button.tsx +1 -1
  8. package/client/needs-you.tsx +1 -1
  9. package/client/pill.tsx +13 -9
  10. package/client/questions.tsx +8 -7
  11. package/client/spec.tsx +1 -1
  12. package/client/workspace-data.ts +36 -19
  13. package/package.json +2 -1
  14. package/server/cow.ts +62 -13
  15. package/server/daemon.ts +18 -33
  16. package/server/deployments.ts +55 -20
  17. package/server/directory.ts +29 -10
  18. package/server/feeds.ts +3 -2
  19. package/server/inbox.ts +37 -18
  20. package/server/list-cache.ts +21 -10
  21. package/server/pr-workflow.ts +14 -1
  22. package/shared/activity.ts +1 -1
  23. package/shared/attention.ts +8 -7
  24. package/shared/brief.ts +5 -5
  25. package/shared/contracts.ts +3 -2
  26. package/shared/follow-up.ts +2 -2
  27. package/shared/home.ts +4 -3
  28. package/shared/inbox.ts +11 -2
  29. package/shared/list.ts +86 -0
  30. package/shared/merge-click.ts +1 -1
  31. package/shared/model.ts +8 -7
  32. package/shared/overseer.ts +3 -3
  33. package/shared/poll.ts +1 -1
  34. package/shared/pr-actions.ts +7 -6
  35. package/shared/presentation.ts +6 -5
  36. package/shared/questions.ts +9 -7
  37. package/shared/reviewers.ts +1 -1
  38. package/shared/row-menu.ts +1 -1
  39. package/shared/search.ts +3 -3
  40. package/shared/send-decision.ts +2 -1
  41. package/shared/sending.ts +1 -1
  42. package/shared/status-invariants.ts +1 -1
  43. package/shared/status.ts +1 -1
  44. package/shared/task-rows.ts +4 -2
  45. package/shared/task-status.ts +2 -1
  46. package/shared/task-trigger.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -4,49 +4,14 @@ What changed in each version of Follow-up, newest first. Follow-up shows the cur
4
4
 
5
5
  ## 2.0.1 (2026-11-14)
6
6
 
7
- Follow-up 2.0.1 turns fixes into plain tasks you can see and steer, makes merging one click, and runs much lighter on your machine.
8
-
9
- ### Tasks you can see and steer
10
-
11
- - What Follow-up finds on your PRs (conflicts, review comments, failing checks, restacks) is now a task in the workspace's Tasks, with one plain state: Queued, Sent, Needs you or Done.
12
- - The top of Tasks says who the next message goes to, when it goes and why it waits, with Preview and Send now. Turn Auto-send off on a task to keep it for yourself.
13
- - Follow-up checks GitHub instead of asking you to Retry: what's cleared is done, and what's still open goes in the next message. It asks you only when a task went out twice with no change.
14
- - Home's "Follow-up is fixing" is now "Sending": each message on its way, with when and why it goes out.
15
-
16
- ### Merging and review
17
-
18
- - One click on Merge merges, and the button names everything it merges first ("Merge 3 PRs"). A blocker found at click time merges nothing and says why.
19
- - Set a repository to No review in Settings → Shipping PRs, or with "Let the agent merge in" on a no-reviewers row: agents merge their own PRs once checks pass, and Follow-up never asks you for reviewers there.
20
- - A PR without reviewers asks once in Needs you, naming the suggested reviewer.
21
- - Every Needs you row about a PR opens it in one click.
22
-
23
- ### Answering agents
24
-
25
- - "Add note" on a decision card sends your pick with a note ("A, but keep the BOM off").
26
- - On Paseo 0.16, Put in chat adds your answer to the end of the agent's message box. An answer you copied or put in the chat reads "not sent yet" everywhere until it reaches the agent.
27
- - An open question shows once, under one name, in the panel and on Home.
28
-
29
- ### New
30
-
31
- - Rename with AI from a workspace's menu or ⌘K: Follow-up suggests a short name, and Undo puts the old one back.
32
- - Report a bug, an idea or feedback from Settings, ⌘K or any error message. Your agent writes it up, removes private names and shows you the issue before it goes to GitHub.
33
- - When an agent creates another agent or a workspace, the chat shows a card for it with its live status.
34
- - Search results look like your list's rows, with your words highlighted. The sidebar view has a filter and Home's sort, the same on every device, and right-click opens a workspace's menu.
35
- - Home remembers which groups you folded (Needs you always opens), and the phone keeps your settings category and folded sections.
36
-
37
- ### Lighter and faster
38
-
39
- - On Paseo 0.16, Home, the sidebar and the pills update the moment something changes instead of checking every 15 to 60 seconds, and an open Follow-up sends almost nothing while you aren't using it.
40
- - Follow-up uses about half the CPU and much less memory, reads about 50 times less from disk, keeps one connection to Paseo and uses far less of your GitHub API limit.
41
- - Pull requests keep their last known status when GitHub is unreachable or out of API budget, instead of turning Unknown.
42
-
43
- ### Settings and fixes
44
-
45
- - The deploy check is a per-repository setting on your machine: Settings → Following → PR workflow shows it for each repository, or Not set up.
46
- - With Follow every workspace off, only the projects you switch on are followed.
47
- - Follow-up pauses only when you stop the main agent, not after a compaction, a replaced turn or a reload.
48
- - A merged PR reads "Merged", not "PR closed", and a PR merged long ago no longer comes back to Needs you.
49
- - "No ask stated" and "Nothing needed" no longer linger in Needs you above real work.
7
+ Fixes are easier to follow, merging takes one click, and Follow-up runs much lighter.
8
+
9
+ - **Tasks:** what Follow-up finds on your PRs (conflicts, review comments, failing checks) is now a task with one clear state, and Tasks shows what goes to the agent next and when.
10
+ - **One-click merge,** and a No review setting per repository that lets agents merge their own PRs.
11
+ - **Answers:** add a note to your pick on a decision card, or put your answer straight into the agent's message box.
12
+ - **New:** Rename with AI, Report a bug from Settings or any error, and a card in the chat for each agent or workspace an agent creates.
13
+ - **Lighter:** about half the CPU and much less memory, and on Paseo 0.16 changes show up live instead of by polling.
14
+ - Plus many smaller fixes.
50
15
 
51
16
  <details><summary>Full changelog since 2.0.0</summary>
52
17
 
package/client/brief.tsx CHANGED
@@ -14,7 +14,8 @@ const word = (kind: Brief["kind"]) => HEADLINE_WORD[briefKey(kind)];
14
14
  import { answerQuestionRpc, briefActionRpc, browserStatusRpc, inboxBriefRpc } from "../shared/contracts";
15
15
  import { errorText, mootNote } from "../shared/errors";
16
16
  import { OTHER, OTHER_LABEL, briefAnswerStatus, isOther, type Question } from "../shared/questions";
17
- import type { Workspace } from "../shared/model";
17
+ import type { ListQuestion, ListWorkspace } from "../shared/list";
18
+ import { useDetailGate, useWorkspace } from "./workspace-data";
18
19
  import { SubmitScope, submitHint, text, useNow } from "./kit";
19
20
  import { PrLinksProvider, RichText } from "./rich-text";
20
21
  import { useMergeButtons } from "./merge-button";
@@ -32,7 +33,8 @@ export type BriefDeps = {
32
33
  signOff(agentId: string): void;
33
34
  openNext(from: string): void;
34
35
  openAgent(agentId: string): void;
35
- workspace(id: string): Workspace | undefined;
36
+ /** The workspace's list form (shared/list.ts); the PR sheet reads the full one itself. */
37
+ workspace(id: string): ListWorkspace | undefined;
36
38
  /** Opens Follow-up's panel for a workspace whose record this client hasn't loaded yet. */
37
39
  openPanel(workspaceId: string): void;
38
40
  /** Done's Undo window, so the composer pill says Done (and its Undo cancels the same toast) until it ends. */
@@ -275,7 +277,7 @@ function Reveal({ label, openLabel, open, onPress, c, compact }: { label: string
275
277
  * A card that's no longer open keeps its question (1.4.0). Answered: the ask, each decision with what was picked, and
276
278
  * "Show full question" opens the original read-only. Superseded or signed off: the one muted line, plus "Show original".
277
279
  */
278
- function Past({ b, c, now, compact, height, pending = false, onResend, resending = false, questions = [] }: { b: Brief; c: Colors; now: number; compact: boolean; height: number; pending?: boolean; onResend?: () => void; resending?: boolean; questions?: readonly Question[] }) {
280
+ function Past({ b, c, now, compact, height, pending = false, onResend, resending = false, questions = [] }: { b: Brief; c: Colors; now: number; compact: boolean; height: number; pending?: boolean; onResend?: () => void; resending?: boolean; questions?: readonly ListQuestion[] }) {
279
281
  const [expanded, setExpanded] = useState(false);
280
282
  const answered = b.state === "answered";
281
283
  // Its questions' answers as every surface reads them (briefAnswerStatus): copied or in the message box is "not sent
@@ -390,6 +392,9 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
390
392
  const notes = useNotes(b.id);
391
393
  const notesOpen = useNotesOpen(b.id);
392
394
  const [sheet, setSheet] = useState<{ key: string; intent: "merge" | "reviewers" } | null>(null);
395
+ // The PR sheet draws review and deploy detail the list form leaves out: one read of the full workspace while it's open.
396
+ const detail = useWorkspace(undefined, row.workspaceId ?? "", { enabled: !!sheet });
397
+ useDetailGate(detail.failure, !!sheet, () => setSheet(null));
393
398
  const browser = useQuery({ queryKey: browserKey, queryFn: () => browserRead({}), enabled: !!sheet, staleTime: 0, refetchOnMount: "always" });
394
399
  // Send again on an undelivered answer: the same answerId, so the server resends that answer and never a second one.
395
400
  const resend = () => {
@@ -547,7 +552,7 @@ function BriefCardBody({ item, theme, layout, agentId, deps, embedded = false, s
547
552
  <Icon name="Info" size={12} color={c.foregroundMuted} />
548
553
  <Text style={{ flex: 1, color: c.foregroundMuted, fontSize: 12, lineHeight: 16 }}>{b.sourceLine}</Text>
549
554
  </View>}
550
- {workspace && sheet && <PrSheet workspace={workspace} prKey={sheet.key} intent={sheet.intent} theme={theme} compact={compact} browserReady={browser.data?.ready ?? false} onClose={() => setSheet(null)} />}
555
+ {detail.workspace && sheet && <PrSheet workspace={detail.workspace} prKey={sheet.key} intent={sheet.intent} theme={theme} compact={compact} browserReady={browser.data?.ready ?? false} onClose={() => setSheet(null)} />}
551
556
  </View>;
552
557
  }
553
558
 
package/client/home.tsx CHANGED
@@ -38,6 +38,8 @@ import { useRowMenu } from "./row-actions";
38
38
  import { laterChoices } from "../shared/row-menu";
39
39
  import { PrLinksProvider, RichText } from "./rich-text";
40
40
  import { TOAST_ANCHOR, ToastHost, useQuestionOpener } from "./toasts";
41
+ import { openRowCopy, useDetailGate, useWorkspace } from "./workspace-data";
42
+ import type { ListWorkspace } from "../shared/list";
41
43
 
42
44
  export const HOME_SCREEN = "follow-up";
43
45
 
@@ -303,7 +305,11 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
303
305
  const toast = useToast();
304
306
  const { inbox, live } = deps.sources;
305
307
  const row = useInbox(inbox, () => s.agentId ? inbox.rows().find(r => r.agentId === s.agentId) ?? null : null);
306
- const w = useSyncExternalStore(live.subscribe, () => s.workspaceId ? live.get(s.workspaceId) : undefined, () => undefined);
308
+ // The open row paints from the list form at once; its PR sheet and question sheet draw detail the list leaves out,
309
+ // so they wait for the full workspace, read once (useWorkspace). Until it answers, the list form draws the rest.
310
+ const { workspace: full, failure } = useWorkspace(live, s.workspaceId ?? "");
311
+ const listed = useSyncExternalStore(live.subscribe, () => s.workspaceId ? live.get(s.workspaceId) : undefined, () => undefined);
312
+ const w: ListWorkspace | undefined = openRowCopy<ListWorkspace>(listed, full);
307
313
  const agent = useAgentLive(s.agentId);
308
314
  const readBrief = useRpc(inboxBriefRpc);
309
315
  const control = useRpc(controlRpc);
@@ -314,6 +320,8 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
314
320
  const browser = useQuery({ queryKey: browserKey, queryFn: () => browserRead({}), enabled: !!sheet, staleTime: 0, refetchOnMount: "always" });
315
321
  const [question, setQuestion] = useState<string | null>(() => ask?.id ?? null);
316
322
  useEffect(() => { if (ask) setQuestion(ask.id); }, [ask?.n]); // eslint-disable-line react-hooks/exhaustive-deps
323
+ useDetailGate(failure, !!sheet, () => setSheet(null));
324
+ useDetailGate(failure, !!question, () => setQuestion(null));
317
325
  useQuestionOpener(w?.id, setQuestion);
318
326
  const [laterOpen, setLaterOpen] = useState(false);
319
327
  const [busy, setBusy] = useState<string | null>(null);
@@ -485,8 +493,8 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
485
493
  }} />
486
494
  </View>}
487
495
  {laterModal}
488
- {w && sheet && <PrSheet workspace={w} prKey={sheet.key} intent={sheet.intent} theme={theme} compact={compact} browserReady={browser.data?.ready ?? false} onClose={() => setSheet(null)} />}
489
- {w && <QuestionSheet workspace={w} questionId={question} theme={theme} compact={compact} onClose={() => setQuestion(null)} />}
496
+ {full && sheet && <PrSheet workspace={full} prKey={sheet.key} intent={sheet.intent} theme={theme} compact={compact} browserReady={browser.data?.ready ?? false} onClose={() => setSheet(null)} />}
497
+ {full && <QuestionSheet workspace={full} questionId={question} theme={theme} compact={compact} onClose={() => setQuestion(null)} />}
490
498
  </View>;
491
499
  }
492
500
 
package/client/linked.tsx CHANGED
@@ -6,7 +6,7 @@ import { Icon, Modal, TextInput, copyText, useToast } from "@getpaseo/plugin/cli
6
6
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
7
7
  import { linkedIndexRpc, linkedItemsRpc, setLinkedItemsRpc } from "../shared/contracts";
8
8
  import type { LinkedKind, LinkedView, LinkedViewItem } from "../shared/linked";
9
- import type { Workspace } from "../shared/model";
9
+ import type { ListWorkspace as Workspace } from "../shared/list";
10
10
  import { CHIP_MAX, LINKED_EMPTY, linkedChip, linkedGroups, linkedRow, linkedSpec, pasteToAdd, referencesShown, type LinkedChipModel, type RowGlyph } from "../shared/linked-display";
11
11
  import { BRAND_ICONS } from "./brand-icons";
12
12
  import { Button, CardRow, IconButton, errorText, space, text, type Theme } from "./kit";
@@ -1,7 +1,8 @@
1
1
  import type { Workspace } from "../shared/model";
2
+ import { errorText } from "../shared/errors";
2
3
 
3
4
  /** A copy only replaces one it is newer than (updatedAt): a late diff or poll never undoes a fresher read. */
4
- export const newer = (held: Workspace | undefined, w: Workspace) => !held || Date.parse(w.updatedAt) >= Date.parse(held.updatedAt) ? w : held;
5
+ export const newer = <T extends { updatedAt: string }>(held: T | undefined, w: T): T => !held || Date.parse(w.updatedAt) >= Date.parse(held.updatedAt) ? w : held;
5
6
  export const opened = new Set<(w: Workspace) => void>();
6
7
  /**
7
8
  * A fresh read of one workspace (useWorkspace's read, a merge's read before its toast) reaches every live store, so
@@ -9,3 +10,20 @@ export const opened = new Set<(w: Workspace) => void>();
9
10
  * Home's Needs you kept "#151 is approved" beside a "Merged" button until the next feed push or poll.
10
11
  */
11
12
  export function acceptWorkspace(w: Workspace): void { for (const accept of opened) accept(w); }
13
+
14
+ /** Why a read left nothing to show: its error, or its answer's. Null while it reads, once it has the workspace, or while disabled. */
15
+ export function detailFailure(q: { enabled: boolean; workspace: Workspace | null; error: unknown; reply: { workspace: Workspace | null; error: string | null } | undefined }): string | null {
16
+ if (!q.enabled || q.workspace) return null;
17
+ if (q.error) return errorText(q.error);
18
+ if (q.reply) return q.reply.error ?? "Follow-up has no record of this workspace.";
19
+ return null;
20
+ }
21
+
22
+ /**
23
+ * What a list surface draws (Home's open row, the pill's popover): the newer of its list copy and its full read
24
+ * (updatedAt). After the full read, a list change listed later (a merge, a turn) draws at once instead of waiting for
25
+ * the re-read it triggers; the sheets keep the full read. 2.0.1: the open row drew `full ?? listed` and lagged.
26
+ */
27
+ export function openRowCopy<T extends { updatedAt: string }>(listed: T | null | undefined, full: T | null | undefined): T | undefined {
28
+ return listed && full ? newer(listed, full) : full ?? listed ?? undefined;
29
+ }
package/client/live.tsx CHANGED
@@ -5,6 +5,7 @@ import type { PluginButtonIconProps, PluginClientContext, PluginSidebarItemProps
5
5
  import { Icon, SidebarRow } from "@getpaseo/plugin/client/ui";
6
6
  import { listRpc, workspacesFeed } from "../shared/contracts";
7
7
  import { openFeed, type Feed } from "./feeds";
8
+ import { isArchivedEntry, listEntry, type ArchivedListWorkspace, type ListEntry, type ListWorkspace } from "../shared/list";
8
9
  import type { Workspace } from "../shared/model";
9
10
  import { activeNeeds, needsYou } from "../shared/attention";
10
11
  import { useSidebarViewActive } from "./inbox";
@@ -22,9 +23,10 @@ const POLL_MS = 15_000;
22
23
 
23
24
  /** One shared poll of tracked workspaces for the pills, header-button dots and the sidebar count. */
24
25
  export function createLiveStore(client: PluginClientContext) {
25
- let workspaces = new Map<string, Workspace>();
26
- /** Archived ones, only for search ("Archived" at the bottom of results). */
27
- let archived: Workspace[] = [];
26
+ /** Each followed workspace in its list form (shared/list.ts); a surface that draws detail reads it with follow.get. */
27
+ let workspaces = new Map<string, ListWorkspace>();
28
+ /** Archived ones, only for search ("Archived" at the bottom of results): name and PRs only. */
29
+ let archived: ArchivedListWorkspace[] = [];
28
30
  let version = 0;
29
31
  const listeners = new Set<() => void>();
30
32
  let timer: ReturnType<typeof setTimeout> | null = null;
@@ -32,19 +34,19 @@ export function createLiveStore(client: PluginClientContext) {
32
34
  let stopped = false;
33
35
  /** The worker's list revision this store holds; each poll asks only for what changed since (1.3.0-beta.4). */
34
36
  let revision: number | undefined;
35
- let all = new Map<string, Workspace>();
37
+ let all = new Map<string, ListEntry>();
36
38
  const emit = () => { version++; for (const l of listeners) l(); };
37
39
  let feed: Feed | null = null;
38
40
  const pushed = () => feed?.live === true;
39
- const apply = (result: { full?: boolean; workspaces: Workspace[]; removed?: string[]; revision?: number }) => {
41
+ const apply = (result: { full?: boolean; workspaces: ListEntry[]; removed?: string[]; revision?: number }) => {
40
42
  const diff = result.full === false;
41
43
  if (diff && !result.workspaces.length && !result.removed?.length) return;
42
- const next = diff ? new Map(all) : new Map<string, Workspace>();
44
+ const next = diff ? new Map(all) : new Map<string, ListEntry>();
43
45
  for (const id of result.removed ?? []) next.delete(id);
44
46
  for (const w of result.workspaces) next.set(w.id, diff ? newer(all.get(w.id), w) : w);
45
47
  all = next; revision = result.revision;
46
- workspaces = new Map([...all.values()].filter(w => !w.archived).map(w => [w.id, w]));
47
- archived = [...all.values()].filter(w => w.archived);
48
+ workspaces = new Map([...all.values()].filter((w): w is ListWorkspace => !isArchivedEntry(w)).map(w => [w.id, w]));
49
+ archived = [...all.values()].filter(isArchivedEntry);
48
50
  emit();
49
51
  };
50
52
  // Paseo 0.15: poll the revision diff. 0.16: the worker pushes the same diff (follow.workspaces-feed), and nothing polls.
@@ -58,12 +60,14 @@ export function createLiveStore(client: PluginClientContext) {
58
60
  };
59
61
  // The feed went down (the worker restarted): read now and poll until it is back.
60
62
  feed = openFeed(client, workspacesFeed, {}, { event: event => { if (!stopped) apply(event); }, down: () => { if (timer) clearTimeout(timer); void poll(); }, up: () => { if (timer) clearTimeout(timer); timer = null; } });
63
+ // The store keeps list forms only: a read's full workspace is projected (shared/list.ts listEntry) before it's held.
61
64
  const accept = (w: Workspace) => {
62
65
  const held = all.get(w.id);
63
- if (!held || newer(held, w) !== w || held === w) return;
64
- all = new Map(all).set(w.id, w);
65
- workspaces = new Map([...all.values()].filter(x => !x.archived).map(x => [x.id, x]));
66
- archived = [...all.values()].filter(x => x.archived);
66
+ if (!held || Date.parse(w.updatedAt) < Date.parse(held.updatedAt)) return;
67
+ const entry = listEntry(w);
68
+ all = new Map(all).set(w.id, entry);
69
+ workspaces = new Map([...all.values()].filter((x): x is ListWorkspace => !isArchivedEntry(x)).map(x => [x.id, x]));
70
+ archived = [...all.values()].filter(isArchivedEntry);
67
71
  emit();
68
72
  };
69
73
  opened.add(accept);
@@ -6,7 +6,7 @@ import { confirmPrActionRpc, getRpc, preparePrActionRpc } from "../shared/contra
6
6
  import { readWorkspace } from "./workspace-data";
7
7
  import { workspaceKey } from "./keys";
8
8
  import { mergeClick, mergeScope, mergeWords, type MergeClickResult, type MergeScope } from "../shared/merge-click";
9
- import type { Workspace } from "../shared/model";
9
+ import type { ListWorkspace as Workspace } from "../shared/list";
10
10
  import { Button, errorText, text, type ButtonKind, type Theme } from "./kit";
11
11
  import { Text } from "./text";
12
12
  import { View } from "react-native";
@@ -8,7 +8,7 @@ import { answerQuestionRpc, checkPrActionRpc, controlRpc, sendRpc } from "../sha
8
8
  import { agentName, needsYou, workspaceSnoozed, type NeedItem } from "../shared/attention";
9
9
  import { laterLabel } from "./inbox";
10
10
  import { sameText } from "../shared/home";
11
- import type { Workspace } from "../shared/model";
11
+ import type { ListWorkspace as Workspace } from "../shared/list";
12
12
  import { Button, Card, CardRow, Chip, PrLinkButton, errorText, text, type Theme } from "./kit";
13
13
  import type { Colors } from "./theme";
14
14
  import { QuestionBody, meanwhile } from "./questions";
package/client/pill.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import { useState, useSyncExternalStore } from "react";
2
2
  import { browserKey } from "./keys";
3
- import { useWorkspace } from "./workspace-data";
3
+ import { openRowCopy, useDetailGate, useWorkspace } from "./workspace-data";
4
4
  import { ScrollView, View } from "react-native";
5
5
  import { Pressable, Text } from "./text";
6
6
  import { useQuery } from "@tanstack/react-query";
@@ -12,7 +12,7 @@ import { briefQuestionIds, echoedItems, HEADLINE_ICON, todoLine, HEADLINE_TONE,
12
12
  import { snoozeUntil, type InboxRow } from "../shared/inbox";
13
13
  import { laterChoices } from "../shared/row-menu";
14
14
  import { isOpen as questionOpen } from "../shared/questions";
15
- import type { Workspace } from "../shared/model";
15
+ import type { ListWorkspace } from "../shared/list";
16
16
  import { Button, errorText, text, type Theme } from "./kit";
17
17
  import { headlineColor, withAlpha } from "./theme";
18
18
  import { useInbox } from "./inbox";
@@ -29,10 +29,10 @@ const UNDO_TITLE: Record<string, string> = { sign_off: "Signed off", later: "Mov
29
29
 
30
30
 
31
31
  type Deps = { inbox: InboxStore; live: LiveStore; openPanel: (workspaceId: string) => void; openNext: (from: string) => void };
32
- type Target = { agentId: string; workspaceId: string; row: InboxRow | null; workspace: Workspace | null; items: NeedItem[] };
32
+ type Target = { agentId: string; workspaceId: string; row: InboxRow | null; workspace: ListWorkspace | null; items: NeedItem[] };
33
33
 
34
34
  /** Every agent that may carry the pill: inbox rows with a workspace, plus each tracked workspace's main agent. */
35
- export function targets(rows: InboxRow[], workspaces: Workspace[], now: number): Map<string, Target> {
35
+ export function targets(rows: InboxRow[], workspaces: ListWorkspace[], now: number): Map<string, Target> {
36
36
  const out = new Map<string, Target>();
37
37
  for (const row of rows) if (row.workspaceId) out.set(row.agentId, { agentId: row.agentId, workspaceId: row.workspaceId, row, workspace: null, items: [] });
38
38
  for (const w of workspaces) {
@@ -148,13 +148,17 @@ export function PillPopover(props: PluginButtonContentProps & { deps: Deps }) {
148
148
  const { target, state, now } = useTarget(deps, agentId, props.workspaceId);
149
149
  const browserRead = useRpc(browserStatusRpc);
150
150
  const main = !!target.workspace && target.workspace.mainAgentId === agentId;
151
- // The live store already holds this workspace; the popover reads it once on open (Paseo can leave a stray mounted
152
- // copy, so nothing here polls it: 1.4.0).
151
+ // The live store holds this workspace's list form; the popover reads it in full once on open (Paseo can leave a stray
152
+ // mounted copy, so nothing here polls it: 1.4.0).
153
153
  const query = useWorkspace(deps.live, props.workspaceId, { enabled: main });
154
154
  const browser = useQuery({ queryKey: browserKey, queryFn: () => browserRead({}), enabled: main, staleTime: 0, refetchOnMount: "always" });
155
155
  const [sheet, setSheet] = useState<{ key: string; intent: "merge" | "reviewers" } | null>(null);
156
156
  const [question, setQuestion] = useState<string | null>(null);
157
- const w = main ? query.workspace ?? target.workspace : null;
157
+ // The popover paints from the list form at once; its PR sheet and question sheet wait for this read's full workspace.
158
+ const full = main ? query.workspace : null;
159
+ const w: ListWorkspace | null = main ? openRowCopy<ListWorkspace>(target.workspace, full) ?? null : null;
160
+ useDetailGate(query.failure, !!sheet, () => setSheet(null));
161
+ useDetailGate(query.failure, !!question, () => setQuestion(null));
158
162
  const row = target.row;
159
163
  const flagged = state?.mode === "flag";
160
164
  const running = !!row && ["running", "initializing"].includes(row.status);
@@ -232,8 +236,8 @@ export function PillPopover(props: PluginButtonContentProps & { deps: Deps }) {
232
236
  : <NeedsYouList workspace={w} theme={props.theme} compact={touch} flush untitled={echoed}
233
237
  actions={{ after: () => deps.live.refresh(), openPr: (key, intent) => setSheet({ key, intent }), openQuestion: setQuestion }} />}
234
238
  {asking && items.some(i => i.kind !== "question" && !echoed.has(i.key)) && <Text numberOfLines={2} style={t.small}>Also: {items.filter(i => i.kind !== "question" && !echoed.has(i.key)).map(i => i.title).join(" · ")}</Text>}
235
- <PrSheet workspace={w} prKey={sheet?.key ?? null} intent={sheet?.intent ?? null} theme={props.theme} compact={touch} browserReady={browser.data?.ready ?? false} onClose={() => { setSheet(null); deps.live.refresh(); }} />
236
- <QuestionSheet workspace={w} questionId={question} theme={props.theme} compact={touch} onClose={() => { setQuestion(null); deps.live.refresh(); }} />
239
+ {full && <PrSheet workspace={full} prKey={sheet?.key ?? null} intent={sheet?.intent ?? null} theme={props.theme} compact={touch} browserReady={browser.data?.ready ?? false} onClose={() => { setSheet(null); deps.live.refresh(); }} />}
240
+ {full && <QuestionSheet workspace={full} questionId={question} theme={props.theme} compact={touch} onClose={() => { setQuestion(null); deps.live.refresh(); }} />}
237
241
  </View>}
238
242
  {main && !w && query.error && <Text style={t.meta}>Couldn't read Follow-up: {errorText(query.error)}</Text>}
239
243
 
@@ -9,6 +9,7 @@ import { Icon, Modal, ScrollView, TextInput, copyText, useToast } from "@getpase
9
9
  import { useMutation, useQueryClient } from "@tanstack/react-query";
10
10
  import { answerQuestionRpc } from "../shared/contracts";
11
11
  import type { Workspace } from "../shared/model";
12
+ import type { ListQuestion, ListWorkspace } from "../shared/list";
12
13
  import { OTHER, OTHER_LABEL, answerHeading, answerLabel, answerStatus, answerMessage, isOpen, isOther, questionState, type Question } from "../shared/questions";
13
14
  import { ago } from "../shared/attention";
14
15
  import { mootNote, sentence } from "../shared/errors";
@@ -24,14 +25,14 @@ import { putInChatOrCopy } from "../shared/put-in-chat";
24
25
  import { useChatComposer } from "./put-in-chat";
25
26
  import { clearPendingAnswer, failPendingAnswer, pendingKey, setPendingAnswer, usePendingAnswer, usePendingAnswers, type PendingAnswer } from "./pending-answers";
26
27
 
27
- const who = (w: Workspace, agentId: string | null) => !agentId || agentId === w.mainAgentId ? "the main agent" : "a root session";
28
+ const who = (w: Pick<ListWorkspace, "mainAgentId">, agentId: string | null) => !agentId || agentId === w.mainAgentId ? "the main agent" : "a root session";
28
29
 
29
30
  /**
30
31
  * What the agent is doing while the question is open, in the developer's terms. `pending` is required, so every
31
32
  * surface that describes a question also says when the developer's answer didn't reach Paseo, or is on its way;
32
33
  * pass null only where the surface shows that itself (QuestionBody's Not sent · Retry line).
33
34
  */
34
- export function meanwhile(w: Workspace, q: Question, pending: PendingAnswer | null | undefined): { icon: string; color: (c: Colors) => string; text: string } {
35
+ export function meanwhile(w: ListWorkspace, q: ListQuestion, pending: PendingAnswer | null | undefined): { icon: string; color: (c: Colors) => string; text: string } {
35
36
  if (pending?.error) return { icon: "CircleAlert", color: c => c.statusDanger, text: `Your answer wasn't sent: ${sentence(pending.error)} Open it to retry; your words are kept.` };
36
37
  if (pending) return { icon: "Send", color: c => c.foregroundMuted, text: "Sending your answer…" };
37
38
  if (q.taskId && !q.options.length) return { icon: "Clock", color: c => c.foregroundMuted, text: "A task is blocked on this. The agent works on the rest." };
@@ -44,7 +45,7 @@ export function meanwhile(w: Workspace, q: Question, pending: PendingAnswer | nu
44
45
  }
45
46
  }
46
47
 
47
- function deliveryLine(w: Workspace, q: Question, now: number): { icon: string; tone: "success" | "warning" | "muted" | "spinner"; text: string } | null {
48
+ function deliveryLine(w: ListWorkspace, q: ListQuestion, now: number): { icon: string; tone: "success" | "warning" | "muted" | "spinner"; text: string } | null {
48
49
  const d = q.answer?.delivery;
49
50
  if (!d) return null;
50
51
  switch (d.state) {
@@ -87,7 +88,7 @@ const inputStyle = (c: Colors, compact: boolean, lines: number) => ({ minHeight:
87
88
  * away; Copy records it and puts a reply on the clipboard instead. Used by the dialog and the pill.
88
89
  */
89
90
  export function QuestionBody({ workspace: w, question: q, theme, compact, now = Date.now(), dense = false, bodyMaxHeight, openAgent, onAnswered, onDetails, onClose, inline = false }: {
90
- workspace: Workspace; question: Question; theme: Theme; compact: boolean; now?: number; dense?: boolean; bodyMaxHeight?: number; openAgent?: (agentId: string) => void; onAnswered?: () => void; onDetails?: () => void;
91
+ workspace: ListWorkspace; question: ListQuestion; theme: Theme; compact: boolean; now?: number; dense?: boolean; bodyMaxHeight?: number; openAgent?: (agentId: string) => void; onAnswered?: () => void; onDetails?: () => void;
91
92
  /** Inside the Needs you block: its header says the title and when it was asked, its footer what the agent does meanwhile. */
92
93
  inline?: boolean;
93
94
  /** The dialog's close: Send and Copy close it at once and report the outcome as a toast. */
@@ -181,9 +182,9 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
181
182
  const pr = q.prKey ? w.prs.find(p => p.key === q.prKey) : null;
182
183
  const task = q.taskId ? w.obligations.find(o => o.id === q.taskId) : null;
183
184
  const deliveryColor = delivery?.tone === "success" ? c.statusSuccess : delivery?.tone === "warning" ? c.statusWarning : c.foregroundMuted;
184
- const context = (!!q.background || !!q.links.length || pr || (task && !(inline && task.title.trim() === q.title.trim()))) && <View style={{ gap: 8 }}>
185
+ const context = (!!q.background || !!q.links?.length || pr || (task && !(inline && task.title.trim() === q.title.trim()))) && <View style={{ gap: 8 }}>
185
186
  {!!q.background && <RichText selectable linkColor={c.foreground} numberOfLines={dense ? 3 : undefined} style={t.meta}>{q.background}</RichText>}
186
- {!dense && q.links.map((link, i) => <View key={i} style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
187
+ {!dense && q.links?.map((link, i) => <View key={i} style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
187
188
  <Icon name={link.url ? "Globe" : "FileText"} size={13} color={c.foregroundMuted} />
188
189
  {link.url ? <Pressable accessibilityRole="link" accessibilityLabel={`Open ${link.label || link.url}`} onPress={() => { void openExternalUrl(link.url!).catch(() => undefined); }} hitSlop={4}
189
190
  style={state => ({ flexShrink: 1, opacity: state.pressed ? 0.7 : 1 })}>
@@ -317,7 +318,7 @@ export function QuestionSheet({ workspace: w, questionId, theme, compact, onClos
317
318
  }
318
319
 
319
320
  /** The pill steps through open questions ("1 of 3") and answers them without leaving the chat. */
320
- export function QuestionStepper({ workspace: w, theme, compact, openAgent, onAnswered, onDetails, bodyMaxHeight }: { workspace: Workspace; theme: Theme; compact: boolean; openAgent?: (agentId: string) => void; onAnswered?: () => void; onDetails?: (id: string) => void; bodyMaxHeight?: number }) {
321
+ export function QuestionStepper({ workspace: w, theme, compact, openAgent, onAnswered, onDetails, bodyMaxHeight }: { workspace: ListWorkspace; theme: Theme; compact: boolean; openAgent?: (agentId: string) => void; onAnswered?: () => void; onDetails?: (id: string) => void; bodyMaxHeight?: number }) {
321
322
  const c = theme.colors; const t = text(c);
322
323
  const pending = usePendingAnswers();
323
324
  // An answer on its way (sent, no reply yet) steps the pill on at once; one that failed comes back as Not sent.
package/client/spec.tsx CHANGED
@@ -5,7 +5,7 @@ import { openExternalUrl, useRpc } from "@getpaseo/plugin/client";
5
5
  import { Icon, Modal, TextInput, useToast } from "@getpaseo/plugin/client/ui";
6
6
  import { useQueryClient } from "@tanstack/react-query";
7
7
  import { workspaceSpecRpc } from "../shared/contracts";
8
- import type { Workspace } from "../shared/model";
8
+ import type { ListWorkspace as Workspace } from "../shared/list";
9
9
  import { specLabel, validSpecUrl } from "../shared/spec";
10
10
  import { ago } from "../shared/attention";
11
11
  import { Button, CardRow, text, type Theme, SubmitScope } from "./kit";
@@ -1,46 +1,63 @@
1
- import { useSyncExternalStore } from "react";
1
+ import { useEffect, useSyncExternalStore } from "react";
2
2
  import { useQuery } from "@tanstack/react-query";
3
3
  import { useRpc } from "@getpaseo/plugin/client";
4
4
  import { getRpc } from "../shared/contracts";
5
- import type { Workspace } from "../shared/model";
6
5
  import type { LiveStore } from "./live";
7
- import { acceptWorkspace } from "./live-copies";
6
+ import { useToast } from "@getpaseo/plugin/client/ui";
7
+ import { acceptWorkspace, detailFailure } from "./live-copies";
8
+ export { openRowCopy } from "./live-copies";
8
9
  import { workspaceKey } from "./keys";
10
+ import type { Workspace } from "../shared/model";
9
11
 
10
12
  const none = () => () => {};
11
- const newer = (a: Workspace | null | undefined, b: Workspace | null | undefined): Workspace | null => {
12
- if (!a) return b ?? null; if (!b) return a;
13
- return Date.parse(b.updatedAt) > Date.parse(a.updatedAt) ? b : a;
14
- };
15
13
 
16
14
  /**
17
- * One workspace for the panel, the larger view and the pill (1.4.0). The client's shared live store already holds
18
- * every followed workspace and keeps it current (one diff poll for the whole client, nudged by agent changes), so a
19
- * surface paints from it at once. On open it makes one small read of its own workspace, never a poll; a mutation's
20
- * invalidation re-reads it once. Whichever copy is newer wins.
15
+ * One workspace in full for the panel, the larger view, the pill's popover and Home's open row (1.4.0; full since
16
+ * 2.0.1). The client's shared live store holds every followed workspace in its LIST form only (shared/list.ts,
17
+ * a-list-carries-only-what-lists-draw): what Home, the pill and the sidebar draw, without deployment evidence, task
18
+ * evidence or question background. A surface that draws detail makes one small read of its own workspace on open,
19
+ * never a poll; when the list copy changes after that read, it reads once more; a mutation's invalidation re-reads it.
21
20
  */
22
21
  type GetReply = { workspace: Workspace | null; error: string | null };
23
- /** One read of a workspace; its copy also reaches every live store (acceptWorkspace), so no surface keeps an older one. */
22
+ /** One read of a workspace; its list form also reaches every live store (acceptWorkspace), so no surface keeps an older one. */
24
23
  export async function readWorkspace(read: (input: { workspaceId: string }) => Promise<GetReply>, workspaceId: string): Promise<GetReply> {
25
24
  const reply = await read({ workspaceId });
26
25
  if (reply.workspace) acceptWorkspace(reply.workspace);
27
26
  return reply;
28
27
  }
29
28
 
30
- export function useWorkspace(live: LiveStore | undefined, workspaceId: string, options: { enabled?: boolean; read?: boolean } = {}) {
29
+ export function useWorkspace(live: LiveStore | undefined, workspaceId: string, options: { enabled?: boolean } = {}) {
31
30
  const enabled = (options.enabled ?? true) && !!workspaceId;
32
31
  const read = useRpc(getRpc);
33
- useSyncExternalStore(live?.subscribe ?? none, live?.version ?? (() => 0), live?.version ?? (() => 0));
34
- const cached = enabled ? live?.get(workspaceId) : undefined;
35
- const query = useQuery({ queryKey: workspaceKey(workspaceId), queryFn: () => readWorkspace(read, workspaceId), enabled: enabled && (options.read ?? true), staleTime: 15_000, refetchOnWindowFocus: false });
36
- const workspace = enabled ? newer(cached, query.data?.workspace) : null;
32
+ // The list copy only says when to read again: a change listed after this read (updatedAt) re-reads once.
33
+ const listedAt = useSyncExternalStore(live?.subscribe ?? none, () => enabled ? live?.get(workspaceId)?.updatedAt ?? null : null, () => null);
34
+ const query = useQuery({ queryKey: workspaceKey(workspaceId), queryFn: () => readWorkspace(read, workspaceId), enabled, staleTime: 15_000, refetchOnWindowFocus: false });
35
+ const readAt = query.data?.workspace?.updatedAt ?? null;
36
+ const { refetch, isFetching } = query;
37
+ useEffect(() => {
38
+ if (enabled && listedAt && readAt && !isFetching && Date.parse(listedAt) > Date.parse(readAt)) void refetch();
39
+ }, [enabled, listedAt, readAt, isFetching, refetch]);
40
+ const workspace = enabled ? query.data?.workspace ?? null : null;
37
41
  return {
38
42
  workspace,
39
- /** Nothing to show yet: no live copy and the read hasn't answered. */
40
- pending: !workspace && query.isPending && enabled && (options.read ?? true),
43
+ /** Why there is no workspace to show: the read failed or found none (null while reading, or when disabled). */
44
+ failure: detailFailure({ enabled, workspace, error: query.error, reply: query.data }),
45
+ /** Nothing to show yet: the read hasn't answered. */
46
+ pending: !workspace && query.isPending && enabled,
41
47
  error: query.error,
42
48
  loadError: query.data?.error ?? null,
43
49
  refetching: query.isRefetching,
44
50
  refetch: () => { live?.refresh(); return query.refetch(); },
45
51
  };
46
52
  }
53
+
54
+ /**
55
+ * A sheet that waits for the full read (PR sheet, question sheet): opened while reading, it appears when the read
56
+ * answers; if the read fails, Follow-up's error toast says so and the request closes, instead of a click doing nothing.
57
+ */
58
+ export function useDetailGate(failure: string | null, open: boolean, close: () => void): void {
59
+ const toast = useToast();
60
+ useEffect(() => {
61
+ if (open && failure) { toast.error(`Couldn't open it: ${failure}`); close(); }
62
+ }, [open, failure]); // eslint-disable-line react-hooks/exhaustive-deps
63
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "paseo-follow-up",
3
3
  "private": false,
4
- "version": "2.0.1",
4
+ "version": "2.0.2-beta.1",
5
5
  "description": "A Paseo plugin that follows every workspace until the work is done: one Home for what needs you, questions you answer anywhere, and repairs that send themselves.",
6
6
  "type": "module",
7
7
  "files": [
@@ -37,6 +37,7 @@
37
37
  "test:scale": "node scripts/scale-check.mjs --workspaces 140 --awake 5 --idle 90 --realistic --rss-budget 300 --idle-rss-budget realistic --cpu-budget 3 --request-budget 2",
38
38
  "test:scale:live": "node scripts/scale-check.mjs --workspaces 140 --awake 5 --live-sized --busy 180 --idle 90 --rss-budget 300 --idle-rss-budget 240 --cpu-budget 3 --request-budget 2 --budgets-report-only",
39
39
  "check:notes": "node scripts/release-notes.mjs --check",
40
+ "release:version": "node scripts/release-notes.mjs --next-version",
40
41
  "release:notes": "node scripts/release-notes.mjs",
41
42
  "test:feeds": "node scripts/screenshots.mjs --only feeds --out .feeds-check",
42
43
  "test:wait": "node scripts/check-wait.mjs",