paseo-follow-up 2.3.0-beta.0 → 2.3.0-beta.2

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.
@@ -0,0 +1,177 @@
1
+ // More context, the one component and the one request path for every surface that answers a question
2
+ // (more-context-is-the-same-on-every-surface, docs/needs-you.md#more-context): Catch up's card (its move bar opens
3
+ // MorePanel), and QuestionBody everywhere else: the panel's Needs you card, Home's detail pane, the question dialog, the
4
+ // pill, phones. "I don't get it" first, then your own words; the ask goes to the card's workspace's main agent
5
+ // (follow.context-ask, the same request ask_context makes), and the answer shows on the question wherever you look at it,
6
+ // because every reader matches it with `contextFor` (shared/catch-up.ts).
7
+ import { useEffect, useRef, useState, useSyncExternalStore, type ReactNode } from "react";
8
+ import { Platform, View } from "react-native";
9
+ import { Pressable, Text } from "./text";
10
+ import { Icon, TextInput } from "@getpaseo/plugin/client/ui";
11
+ import { CONTEXT_ASKS, askHeadline, contextFor, keyLabel, questionCardKey, type ContextRequest } from "../shared/catch-up";
12
+ import type { RpcInput } from "@getpaseo/plugin";
13
+ import type { contextAskRpc } from "../shared/contracts";
14
+ import type { ListQuestion, ListWorkspace } from "../shared/list";
15
+ import { errorText } from "../shared/errors";
16
+ import { Button, IconButton, text, type Theme } from "./kit";
17
+ import { withAlpha } from "./theme";
18
+ import { RichText } from "./rich-text";
19
+ import { PRIMARY_FORM } from "./dock";
20
+
21
+ const CATCH_UP_FOOTNOTE = "This workspace steps aside while you keep going, and comes back as your next card with the answer. Back reaches it any time.";
22
+ const isMac = () => typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test((navigator as { platform?: string }).platform ?? "");
23
+
24
+ /**
25
+ * The client's one store of More context asks: Home's extras (client/home-view.ts), which the home feed keeps current,
26
+ * so nothing polls. index.client.tsx hands it over once; every surface reads the same asks and asks through it.
27
+ */
28
+ export type ContextSource = {
29
+ context(): ContextRequest[];
30
+ subscribe(listener: () => void): () => void;
31
+ askContext(input: RpcInput<typeof contextAskRpc>): Promise<{ request: ContextRequest }>;
32
+ /** Reads the asks once. A 0.15 host has no feed, and the store starts empty, so a fresh panel would miss an ask. */
33
+ refreshContext?(): Promise<void>;
34
+ };
35
+ /** Sources already read: the first question card on screen reads the asks once per client, never per card or on a timer. */
36
+ const read = new WeakSet<ContextSource>();
37
+ let source: ContextSource | null = null;
38
+ const sourceListeners = new Set<() => void>();
39
+ export function setContextSource(next: ContextSource | null): void { source = next; for (const l of sourceListeners) l(); }
40
+ const noAsks: ContextRequest[] = [];
41
+ const idle = () => () => undefined;
42
+
43
+ /** The newest ask about one question, from any surface, and the way to ask. Null `ask` when no source is set. */
44
+ export function useQuestionContext(workspaceId: string, questionId: string): { request: ContextRequest | null; ask: ((words: string, card: string, agentId: string | null) => Promise<ContextRequest>) | null } {
45
+ const current = useSyncExternalStore(l => { sourceListeners.add(l); return () => { sourceListeners.delete(l); }; }, () => source, () => source);
46
+ const requests = useSyncExternalStore(current?.subscribe ?? idle, current?.context ?? (() => noAsks), current?.context ?? (() => noAsks));
47
+ useEffect(() => { if (current && !read.has(current)) { read.add(current); void current.refreshContext?.().catch(() => undefined); } }, [current]);
48
+ const cardKey = questionCardKey(workspaceId, questionId);
49
+ const request = contextFor(requests, { workspaceId, cardKey });
50
+ return {
51
+ request,
52
+ ask: current && (async (words, card, agentId) => (await current.askContext({ workspaceId, agentId, cardKey, card: card.slice(0, 300), ask: words })).request),
53
+ };
54
+ }
55
+
56
+ /**
57
+ * More context on a question card outside Catch up: a quiet link where the answer is written, never a new top-level
58
+ * button. Open, it is Catch up's panel (suggestions, then your own words) in Catch up's sheet; asked, the card says it
59
+ * is waiting; answered, the answer sits on the question. `children` are the row's other quiet links (they follow it).
60
+ */
61
+ export function QuestionMoreContext({ workspace: w, question: q, theme, compact, openAgent, children }: { workspace: Pick<ListWorkspace, "id" | "mainAgentId">; question: Pick<ListQuestion, "id" | "title" | "askedBy">; theme: Theme; compact: boolean; openAgent?: (agentId: string) => void; children?: ReactNode }) {
62
+ const c = theme.colors;
63
+ const { request, ask } = useQuestionContext(w.id, q.id);
64
+ const [open, setOpen] = useState(false);
65
+ const asking = request?.state === "asking";
66
+ const agentId = q.askedBy ?? w.mainAgentId ?? null;
67
+ const chatOf = request?.askedOf ?? w.mainAgentId ?? null;
68
+ const onAsk = async (words: string) => { await ask!(words, `${q.id} · ${q.title}`, agentId); setOpen(false); };
69
+ const link = !!ask && !asking && !open && <Pressable accessibilityRole="button" accessibilityLabel={`More context on ${q.id}`} accessibilityHint="Ask the agent to explain this question" hitSlop={6} onPress={() => setOpen(true)}
70
+ style={({ hovered, pressed }: { hovered?: boolean; pressed: boolean }) => ({ flexDirection: "row", alignItems: "center", gap: 6, alignSelf: "flex-start", minHeight: compact ? 44 : 28, paddingHorizontal: 4, marginLeft: -4, borderRadius: 6, opacity: pressed ? 0.7 : 1, backgroundColor: hovered ? withAlpha(c.foreground, 0.05) : "transparent" })}>
71
+ <Icon name="Sparkles" size={14} color={c.foregroundMuted} />
72
+ <Text style={{ color: c.foregroundMuted, fontSize: 13, lineHeight: 18, fontWeight: "500" }}>{request ? "Ask more" : "More context"}</Text>
73
+ </Pressable>;
74
+ if (!ask && !request && !children) return null;
75
+ return <View {...({ dataSet: { moreContext: q.id } } as object)} style={{ gap: 8 }}>
76
+ {request && <ContextAnswer theme={theme} compact={compact} request={request} waiting={false} onQuestion agent="the agent"
77
+ openChat={() => { if (chatOf) openAgent?.(chatOf); }} chatDisabled={!openAgent || !chatOf} openAgent={openAgent} />}
78
+ {open && ask && <MoveResult place="sheet" inset theme={theme} label="More context">
79
+ <MorePanel theme={theme} compact={compact} onClose={() => setOpen(false)} onAsk={onAsk}
80
+ footnote="Keep going meanwhile: the answer shows on this question here, on Home and in Catch up." />
81
+ </MoveResult>}
82
+ {(link || children) && <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", columnGap: 16 }}>{link}{children}</View>}
83
+ </View>;
84
+ }
85
+
86
+ /**
87
+ * Where a move's result opens (MOVE_OPENS, a-move-bar-action-opens-in-view): a sheet in the phone's dock or a popover
88
+ * on its desktop button. Focus moves into it (its first choice), and on the web it scrolls into view the least distance.
89
+ */
90
+ export function MoveResult({ place, theme, label, width, inset = false, children }: { place: "sheet" | "popover"; theme: Theme; label: string; width?: number; /** Inside a card: no margins of its own. */ inset?: boolean; children: ReactNode }) {
91
+ const c = theme.colors;
92
+ const ref = useRef<View>(null);
93
+ useEffect(() => {
94
+ if (Platform.OS !== "web") return;
95
+ const t = setTimeout(() => {
96
+ const node = ref.current as unknown as { querySelector?(q: string): { focus?(o?: object): void } | null; scrollIntoView?(o: object): void } | null;
97
+ node?.scrollIntoView?.({ block: "nearest" });
98
+ // The first choice: More context's suggestions ("I don't get it" leads), else Later's first time.
99
+ (node?.querySelector?.('[role="radio"]') ?? node?.querySelector?.('[role="menu"] [role="button"]'))?.focus?.({ preventScroll: true });
100
+ }, 0);
101
+ return () => clearTimeout(t);
102
+ }, []);
103
+ return <View ref={ref} {...({ dataSet: { moveResult: place } } as object)} role="dialog" accessibilityLabel={label}
104
+ style={[{ padding: place === "sheet" ? 14 : 16, borderRadius: 12, borderWidth: 1, borderColor: c.border, backgroundColor: c.surface1 },
105
+ place === "sheet"
106
+ ? inset ? {} : { marginHorizontal: 12, marginTop: 12 }
107
+ : { position: "absolute", zIndex: 20, left: 0, bottom: "100%", marginBottom: 8, width, shadowColor: "#000", shadowOpacity: 0.22, shadowRadius: 16, shadowOffset: { width: 0, height: 6 } }]}>
108
+ {children}
109
+ </View>;
110
+ }
111
+
112
+ /** What came back for this card: the answer, "answered in its chat", a failure, or (seen going Back) that it's still asking. */
113
+ export function ContextAnswer({ theme, compact, request, waiting, agent, openChat, openAgent, onQuestion = false, chatDisabled = false }: { theme: Theme; compact: boolean; request: ContextRequest; waiting: boolean; agent: string; openChat: () => void; openAgent?: (agentId: string) => void;
114
+ /** On a question card outside Catch up: a pending ask says where its answer will show. */ onQuestion?: boolean; chatDisabled?: boolean }) {
115
+ const c = theme.colors; const t = text(c, compact);
116
+ const who = request.target === "overseer" ? "Overseer" : agent === "the agent" ? "The agent" : agent;
117
+ const asking = request.state === "asking";
118
+ return <View accessibilityLiveRegion="polite" style={{ gap: 8, padding: compact ? 14 : 16, borderRadius: 12, borderWidth: 1, borderColor: asking ? c.border : withAlpha(c.statusSuccess, 0.4), backgroundColor: c.surface1 }}>
119
+ <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
120
+ <Icon name={asking ? "Hourglass" : request.state === "failed" ? "CircleAlert" : "Sparkles"} size={14} color={request.state === "failed" ? c.statusDanger : c.foregroundMuted} />
121
+ <RichText plain style={[t.small, { flex: 1 }]}>{asking ? `Asked ${who === "Overseer" ? "the Overseer" : who === "The agent" ? "the agent" : who}${waiting ? " · this comes back as the next card when it answers. You can still act on it now" : onQuestion ? " · the answer shows here when it comes. You can still answer now" : ""}` : `${who} · you asked: ${askHeadline(request.ask)}`}</RichText>
122
+ </View>
123
+ {request.state === "answered" && request.answer && <RichText selectable style={t.body}>{request.answer}</RichText>}
124
+ {request.state === "chat" && <View style={{ gap: 8 }}>
125
+ <Text style={t.body}>{who === "Overseer" ? "The Overseer answered in its own chat, not here: it can't reply on a card." : `${who} answered in its chat.`}</Text>
126
+ {/* A 2.2.0-beta.3 ask of the Overseer: its answer is in the Overseer's chat (an-ask-goes-only-to-an-agent-that-can-answer-it). */}
127
+ <View style={{ flexDirection: "row" }}>{who === "Overseer"
128
+ ? <Button theme={theme} compact={compact} icon="MessageSquare" title="Open Overseer" disabled={!request.askedOf || !openAgent} onPress={() => request.askedOf && openAgent?.(request.askedOf)} />
129
+ : <Button theme={theme} compact={compact} icon="MessageSquare" title="Open chat" disabled={chatDisabled} onPress={openChat} />}</View>
130
+ </View>}
131
+ {request.state === "failed" && <Text style={t.body}>{request.error ?? "The ask didn't go through. Try again, or open the chat."}</Text>}
132
+ </View>;
133
+ }
134
+
135
+ /**
136
+ * More context: "I don't get it" first (most asks just need explaining), then the developer's own words, to one place:
137
+ * the card's workspace's main agent, the one that can answer on the card (an-ask-goes-only-to-an-agent-that-can-answer-
138
+ * it). It may wake, because the developer asked. The deck moves on and this workspace comes back when the answer is ready.
139
+ */
140
+ export function MorePanel({ theme, compact, onClose, onAsk, footnote = CATCH_UP_FOOTNOTE }: { theme: Theme; compact: boolean; onClose: () => void; onAsk: (words: string) => Promise<void>; /** What happens while the agent answers, in this surface's terms. */ footnote?: string }) {
141
+ const c = theme.colors; const t = text(c, compact);
142
+ const [words, setWords] = useState<string>(CONTEXT_ASKS[0].text);
143
+ const [picked, setPicked] = useState<string>(CONTEXT_ASKS[0].id);
144
+ const [busy, setBusy] = useState(false);
145
+ const [error, setError] = useState<string | null>(null);
146
+ const send = () => {
147
+ if (!words.trim() || busy) return;
148
+ setBusy(true); setError(null);
149
+ // The words stay unless the ask is recorded.
150
+ onAsk(words.trim()).catch(e => setError(errorText(e))).finally(() => setBusy(false));
151
+ };
152
+ return <View {...({ dataSet: { catchUpMore: "1" } } as object)} style={{ gap: 10 }}>
153
+ <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
154
+ <Icon name="Sparkles" size={14} color={c.foreground} />
155
+ <Text style={[t.label, { flex: 1, fontWeight: "600" }]}>More context</Text>
156
+ <IconButton theme={theme} compact={compact} icon="X" label="Close more context" onPress={onClose} />
157
+ </View>
158
+ <View accessibilityRole="radiogroup" style={{ flexDirection: "row", flexWrap: "wrap", gap: 6 }}>
159
+ {CONTEXT_ASKS.map((x, i) => <Pressable key={x.id} accessibilityLabel={compact ? x.label : `${x.label} (${i + 1})`} accessibilityRole="radio" accessibilityState={{ checked: picked === x.id }} onPress={() => { setPicked(x.id); setWords(x.text); }}
160
+ style={{ minHeight: compact ? 36 : 28, justifyContent: "center", paddingHorizontal: 10, borderRadius: 999, borderWidth: 1, borderColor: picked === x.id ? c.foreground : c.border, backgroundColor: picked === x.id ? c.surface2 : "transparent" }}>
161
+ <Text style={[t.meta, { color: picked === x.id ? c.foreground : c.foregroundMuted }]}>{x.label}</Text>
162
+ </Pressable>)}
163
+ </View>
164
+ <View {...PRIMARY_FORM} style={{ gap: 10 }}>
165
+ <TextInput accessibilityLabel="What do you want to know?" placeholder="What do you want to know?" placeholderTextColor={c.foregroundMuted} value={words} multiline
166
+ onChangeText={v => { setWords(v); setPicked(CONTEXT_ASKS.find(x => x.text === v)?.id ?? ""); }}
167
+ style={{ minHeight: compact ? 84 : 76, paddingHorizontal: 10, paddingVertical: 8, borderRadius: 6, borderWidth: 1, borderColor: c.border, color: c.foreground, backgroundColor: c.surface0 }} />
168
+ {!!error && <Text accessibilityRole="alert" style={[t.meta, { color: c.statusDanger }]}>{error}</Text>}
169
+ <View {...({ dataSet: { askAgent: "1" } } as object)} style={{ flexDirection: "row" }}>
170
+ <Button theme={theme} compact={compact} grow={compact} kind="primary" icon="MessageSquareText" title="Ask the agent" loading={busy} disabled={!words.trim() || busy}
171
+ accessibilityHint={compact ? "Asks this workspace's main agent, which may wake it" : `Asks this workspace's main agent, which may wake it. ${keyLabel("⌘↵", isMac())}`} onPress={send} />
172
+ </View>
173
+ </View>
174
+ <Text style={t.small}>{footnote}</Text>
175
+ </View>;
176
+ }
177
+
@@ -11,7 +11,7 @@ import { sameText } from "../shared/home";
11
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
- import { QuestionBody, meanwhile } from "./questions";
14
+ import { QuestionBody, QuestionDismissX, meanwhile } from "./questions";
15
15
  import { needsYouBlock } from "../shared/needs-block";
16
16
  import { age } from "../shared/inbox";
17
17
  import { questionState } from "../shared/questions";
@@ -20,6 +20,7 @@ import { useState, type ReactNode } from "react";
20
20
  import { usePendingAnswer } from "./pending-answers";
21
21
  import { useReviewerSettings } from "./reviewers";
22
22
  import { NoReviewLink } from "./review-mode";
23
+ import { DismissX, RevealScope, useDismiss } from "./dismiss";
23
24
 
24
25
  import { overviewKey, workspaceKey } from "./keys";
25
26
  import { PrLinksProvider, RichText } from "./rich-text";
@@ -99,6 +100,7 @@ export function NeedsYouList({ workspace: w, theme, compact, actions, now = Date
99
100
  const inspect = useMutation({ mutationFn: (actionId: string) => check({ workspaceId: w.id, actionId }), onSuccess: reply => { toast.show(reply.result, { variant: reply.state === "failed" ? "warning" : "info" }); refresh(); }, onError: fail });
100
101
  const items = rows ?? needsYou(w, now);
101
102
  const mergeControl = useMergeButtons(w);
103
+ const dismiss = useDismiss();
102
104
  if (!items.length) return null;
103
105
  const busy = resume.isPending || retry.isPending || retryTask.isPending || deliver.isPending || sendAnswer.isPending || resendAnswer.isPending || queueAct.isPending || inspect.isPending;
104
106
  const openMain = actions.openAgent ? () => actions.openAgent!(w.mainAgentId) : undefined;
@@ -160,12 +162,15 @@ export function NeedsYouList({ workspace: w, theme, compact, actions, now = Date
160
162
  const more = secondary(item);
161
163
  const button = act || link || more ? <>{pair ?? <>{act}{link}</>}{more}</> : null;
162
164
  const said = !!untitled?.has(item.key);
165
+ // The small x, top right, on every kind (dismissing-anything-in-needs-you-sends-the-agent-nothing).
166
+ const x = <DismissX theme={theme} compact={compact} label={`Dismiss ${item.kind === "question" ? item.questionId : item.title}`}
167
+ onPress={() => dismiss({ workspaceId: w.id, key: item.key }, { onDismissed: actions.after })} />;
163
168
  // Phones: the action sits at the row's right edge so rows never grow a second line of controls. A send batch
164
169
  // (the primary, with its task list) and Retry's pair keep their buttons full width under the row.
165
170
  // A stack's scope line and a blocker need the row's full width, so those rows put their button under the text.
166
171
  const inline = compact && button && item.kind !== "send" && !(item.kind === "retry" && !item.exhausted) && item.kind !== "person" && !scopeLine && !notice;
167
172
  if (inline) return <CardRow key={item.key} theme={theme} compact first={index === 0 && flush} style={flush ? { paddingHorizontal: 0 } : undefined}>
168
- <View style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
173
+ <RevealScope style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
169
174
  {/* A row with the quiet link under it is taller: the glyph stays on the title's line. */}
170
175
  <View style={item.kind === "reviewers" ? { alignSelf: "flex-start", paddingTop: 2 } : undefined}><Icon name={g.name} size={16} color={g.color} /></View>
171
176
  <View style={{ flex: 1, minWidth: 0, gap: 2 }}>
@@ -174,10 +179,12 @@ export function NeedsYouList({ workspace: w, theme, compact, actions, now = Date
174
179
  {item.kind === "reviewers" && <NoReviewLink repo={item.prKey.split("#")[0]} theme={theme} compact />}
175
180
  </View>
176
181
  <View style={item.kind === "reviewers" ? { alignSelf: "flex-start" } : undefined}>{pair ?? button}</View>
177
- </View>
182
+ {/* Top right, a step away from the action so a thumb aimed at it doesn't land here. */}
183
+ <View style={{ alignSelf: "flex-start", marginTop: -4, marginRight: -6, marginLeft: 2 }}>{x}</View>
184
+ </RevealScope>
178
185
  </CardRow>;
179
186
  return <CardRow key={item.key} theme={theme} compact={compact} first={index === 0 && flush} style={flush ? { paddingHorizontal: 0 } : undefined}>
180
- <View style={{ flexDirection: "row", gap: 9 }}>
187
+ <RevealScope style={{ flexDirection: "row", gap: 9 }}>
181
188
  <View style={{ paddingTop: 2 }}><Icon name={g.name} size={14} color={g.color} /></View>
182
189
  <View style={{ flex: 1, minWidth: 0, gap: 3 }}>
183
190
  {!said && <RichText style={compact ? t.label : t.body}>{item.title}</RichText>}
@@ -191,7 +198,8 @@ export function NeedsYouList({ workspace: w, theme, compact, actions, now = Date
191
198
  </View>}
192
199
  {notice}
193
200
  </View>
194
- </View>
201
+ <View style={{ marginTop: -3, marginRight: -5 }}>{x}</View>
202
+ </RevealScope>
195
203
  </CardRow>;
196
204
  })}
197
205
  </View></PrLinksProvider>;
@@ -246,6 +254,7 @@ export function NeedsYouBlock({ workspace: w, theme, compact, actions, now, brie
246
254
  function QuestionAsk({ workspace: w, questionId, context, theme, compact, now, open, onToggle, openAgent }: { workspace: Workspace; questionId: string; context: string | null; theme: Theme; compact: boolean; now: number; open: boolean; onToggle: () => void; openAgent?: (agentId: string) => void }) {
247
255
  const c = theme.colors; const t = text(c, compact);
248
256
  const pending = usePendingAnswer(w.id, questionId);
257
+ const dismiss = useDismiss();
249
258
  const q = w.questions.find(x => x.id === questionId);
250
259
  if (!q) return null;
251
260
  const state = meanwhile(w, q, pending);
@@ -257,10 +266,20 @@ function QuestionAsk({ workspace: w, questionId, context, theme, compact, now, o
257
266
  <Text style={[t.meta, { paddingTop: 1 }]}>{age(q.askedAt, now)}</Text>
258
267
  <View style={{ paddingTop: 1 }}><Icon name={open ? "ChevronUp" : "ChevronDown"} size={14} color={c.foregroundMuted} /></View>
259
268
  </View>;
260
- if (!open) return <CardRow theme={theme} compact={compact} onPress={onToggle} accessibilityLabel={`Show ${q.id}: ${q.title}`} style={{ minHeight: compact ? 48 : undefined, justifyContent: "center" }}>{header}</CardRow>;
269
+ // The x sits beside the header, outside its toggle, so dismissing never also opens or closes the section.
270
+ const x = <View style={{ marginTop: compact ? -4 : -3, marginRight: compact ? -8 : -6 }}><QuestionDismissX workspaceId={w.id} questionId={q.id} theme={theme} compact={compact} dismiss={dismiss} /></View>;
271
+ if (!open) return <CardRow theme={theme} compact={compact} style={{ minHeight: compact ? 48 : undefined, justifyContent: "center" }}>
272
+ <RevealScope style={{ flexDirection: "row", alignItems: "flex-start", gap: 6 }}>
273
+ <Pressable accessibilityRole="button" accessibilityLabel={`Show ${q.id}: ${q.title}`} onPress={onToggle} style={{ flex: 1, minWidth: 0, minHeight: compact ? 44 : undefined, justifyContent: "center" }}>{header}</Pressable>
274
+ {x}
275
+ </RevealScope>
276
+ </CardRow>;
261
277
  return <CardRow theme={theme} compact={compact} style={{ paddingVertical: compact ? 14 : 12 }}>
262
- <View style={{ gap: 12 }}>
263
- <Pressable accessibilityRole="button" aria-expanded accessibilityState={{ expanded: true }} accessibilityLabel={`Hide ${q.id}: ${q.title}`} onPress={onToggle} style={{ minHeight: compact ? 44 : undefined }}>{header}</Pressable>
278
+ <RevealScope style={{ gap: 12 }}>
279
+ <View style={{ flexDirection: "row", alignItems: "flex-start", gap: 6 }}>
280
+ <Pressable accessibilityRole="button" aria-expanded accessibilityState={{ expanded: true }} accessibilityLabel={`Hide ${q.id}: ${q.title}`} onPress={onToggle} style={{ flex: 1, minWidth: 0, minHeight: compact ? 44 : undefined }}>{header}</Pressable>
281
+ {x}
282
+ </View>
264
283
  {/* What the agent does meanwhile sits under the question, as in the dialog; under the buttons goes what they do. */}
265
284
  <View style={{ flexDirection: "row", gap: 6 }}>
266
285
  <View style={{ paddingTop: 2 }}><Icon name={state.icon} size={12} color={state.color(c)} /></View>
@@ -268,6 +287,6 @@ function QuestionAsk({ workspace: w, questionId, context, theme, compact, now, o
268
287
  </View>
269
288
  {!!context && <RichText selectable linkColor={c.foreground} style={[t.body, { color: c.foregroundMuted }]}>{context}</RichText>}
270
289
  <QuestionBody workspace={w} question={q} theme={theme} compact={compact} now={now} openAgent={openAgent} inline />
271
- </View>
290
+ </RevealScope>
272
291
  </CardRow>;
273
292
  }
@@ -10,7 +10,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
10
10
  import { answerQuestionRpc } from "../shared/contracts";
11
11
  import type { Workspace } from "../shared/model";
12
12
  import type { ListQuestion, ListWorkspace } from "../shared/list";
13
- import { OTHER, OTHER_LABEL, answerDraft, answerHeading, answerLabel, answerStatus, answerMessage, answerHasActions, resendTitle, isOpen, isOther, questionState, type Question } from "../shared/questions";
13
+ import { OTHER, OTHER_LABEL, closedLine, isDismissed, answerDraft, answerHeading, answerLabel, answerStatus, answerMessage, answerHasActions, resendTitle, isOpen, isOther, questionState, type Question } from "../shared/questions";
14
14
  import { ago } from "../shared/attention";
15
15
  import { RETRYING_DETAIL, deliveryStatus } from "../shared/queue";
16
16
  import { mootNote, sentence } from "../shared/errors";
@@ -19,12 +19,14 @@ import { Button, Card, CardRow, Chip, FoldRow, IconButton, SubmitScope, errorTex
19
19
  import { Spinner } from "./motion";
20
20
  import { DictationField, useCaret, type FieldPad } from "./dictation";
21
21
  import { NoteLink } from "./brief";
22
+ import { QuestionMoreContext } from "./more-context";
22
23
  import { PRIMARY_FORM } from "./dock";
23
24
  import { mergedColor, tint, withAlpha, type Colors } from "./theme";
24
25
  import { overviewKey, workspaceKey } from "./keys";
25
26
  import { PrLinksProvider, RichText } from "./rich-text";
26
27
  import { prLinksByNumber } from "../shared/presentation";
27
28
  import { notice, openQuestion, runAction } from "./toasts";
29
+ import { DismissX, useDismiss } from "./dismiss";
28
30
  import { putInChatOrCopy } from "../shared/put-in-chat";
29
31
  import { useChatComposer } from "./put-in-chat";
30
32
  import { Marked, NoMatchRow, useSectionSearch } from "./section-search";
@@ -102,10 +104,16 @@ export type SendReady = { send: () => void; busy: boolean };
102
104
  * (the dialog, Needs you on Home and in the panel, the pill, phones): what its field means comes from answerDraft
103
105
  * (`one-answer-flow-for-every-question`), never from the surface.
104
106
  */
105
- export function QuestionBody({ workspace: w, question: q, theme, compact, now = Date.now(), dense = false, bodyMaxHeight, openAgent, onAnswered, onDetails, onClose, inline = false, onSendReady, dictate = false }: {
107
+ export function QuestionBody({ workspace: w, question: q, theme, compact, now = Date.now(), dense = false, bodyMaxHeight, openAgent, onAnswered, onDetails, onClose, inline = false, onSendReady, dictate = false, moreContext = true, dismissAt = inline ? "host" : "top" }: {
106
108
  workspace: ListWorkspace; question: ListQuestion; theme: Theme; compact: boolean; now?: number; dense?: boolean; bodyMaxHeight?: number; openAgent?: (agentId: string) => void; onAnswered?: () => void; onDetails?: () => void;
107
109
  /** Inside the Needs you block: its header says the title and when it was asked, its footer what the agent does meanwhile. */
108
110
  inline?: boolean;
111
+ /**
112
+ * Where the card's small x sits (dismissing-anything-in-needs-you-sends-the-agent-nothing): "top", the body's top
113
+ * right; "host", in the header of whatever draws this body (the Needs you block, the pill, Catch up), next to its age;
114
+ * "foot", at the end of the "Asked … by" line, for the dialog, whose header's top right is its own close.
115
+ */
116
+ dismissAt?: "top" | "host" | "foot";
109
117
  /** The dialog's close: Send and Copy close it at once and report the outcome as a toast. */
110
118
  onClose?: () => void;
111
119
  /**
@@ -115,6 +123,11 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
115
123
  onSendReady?: (send: SendReady | null) => void;
116
124
  /** Catch up: a mic beside the field (DictationField), when the host has Paseo's dictation. */
117
125
  dictate?: boolean;
126
+ /**
127
+ * More context on the question (more-context-is-the-same-on-every-surface). Catch up passes false: its move bar has
128
+ * the same More context, and its card shows the answer.
129
+ */
130
+ moreContext?: boolean;
118
131
  }) {
119
132
  const c = theme.colors; const t = text(c);
120
133
  const toast = useToast(); const cache = useQueryClient();
@@ -203,6 +216,12 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
203
216
  });
204
217
  onClose?.(); onAnswered?.();
205
218
  };
219
+ /**
220
+ * Dismiss (dismissing-anything-in-needs-you-sends-the-agent-nothing): the question no longer matters. It closes and
221
+ * leaves Needs you; nothing goes to the agent. Undo in the toast reopens it. The card moves on as after an answer.
222
+ */
223
+ const dismissAny = useDismiss();
224
+ const dismissX = open && dismissAt !== "host" ? <QuestionDismissX workspaceId={w.id} questionId={q.id} theme={theme} compact={compact} disabled={run.isPending} onDismissed={() => { onClose?.(); onAnswered?.(); }} dismiss={dismissAny} /> : null;
206
225
  // The footer's Send calls the latest quick through a ref, so it never sends a stale choice or words.
207
226
  const quickRef = useRef(quick); quickRef.current = quick;
208
227
  const sendable = open && !!answer;
@@ -254,7 +273,10 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
254
273
  const body = <View style={{ gap: dense ? 10 : 14 }}>
255
274
  <View style={{ gap: 6 }}>
256
275
  {/* Inline: the block's header carries the title, so the question reads as body text under it. */}
257
- <RichText selectable style={inline ? text(c, compact).body : [t.body, { fontSize: dense ? 13 : 15, lineHeight: dense ? 19 : 22 }]}>{q.question}</RichText>
276
+ {(() => {
277
+ const question = <RichText selectable style={[inline ? text(c, compact).body : [t.body, { fontSize: dense ? 13 : 15, lineHeight: dense ? 19 : 22 }], { flex: 1, minWidth: 0 }]}>{q.question}</RichText>;
278
+ return dismissX && dismissAt === "top" ? <View style={{ flexDirection: "row", alignItems: "flex-start", gap: 8 }}>{question}<View style={{ marginTop: -2, marginRight: -5 }}>{dismissX}</View></View> : question;
279
+ })()}
258
280
  {/* Phones: who asked and when is meta under the question, not a footnote after the buttons. */}
259
281
  {compact && !dense && !inline && <Text style={t.small}>Asked {ago(q.askedAt, now)} by {who(w, q.askedBy)}{q.taskId && !q.options.length ? " (blocked task)" : ""}</Text>}
260
282
  {open && !inline && <View style={{ flexDirection: "row", gap: 6 }}>
@@ -263,10 +285,13 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
263
285
  </View>}
264
286
  </View>
265
287
  {q.closed && <View style={{ flexDirection: "row", gap: 6 }}>
266
- <View style={{ paddingTop: 2 }}><Icon name="MessageCircleOff" size={12} color={c.foregroundMuted} /></View>
267
- <Text style={[t.meta, { flex: 1 }]}>Withdrawn {ago(q.closed.at, now)}: {q.closed.reason}</Text>
288
+ <View style={{ paddingTop: 2 }}><Icon name={isDismissed(q) ? "X" : "MessageCircleOff"} size={12} color={c.foregroundMuted} /></View>
289
+ <Text style={[t.meta, { flex: 1 }]}>{isDismissed(q) ? `${closedLine(q)} ${ago(q.closed.at, now)}. The agent wasn't messaged.` : `Withdrawn ${ago(q.closed.at, now)}: ${q.closed.reason}`}</Text>
268
290
  </View>}
269
291
  {context}
292
+ {/* Read before choosing: More context sits under the question's own context, its answer with it. */}
293
+ {/* The question's quiet row: More context (Catch up's move bar has its own). Dismiss is the card's x, top right. */}
294
+ {open && moreContext && <QuestionMoreContext workspace={w} question={q} theme={theme} compact={compact} openAgent={openAgent} />}
270
295
  {!!q.options.length && <View accessibilityRole="radiogroup" accessibilityLabel={`Options for ${q.id}`} style={{ gap: 6 }}>
271
296
  {q.options.map(o => <OptionCard key={o.letter} theme={theme} compact={compact} dense={dense} letter={o.letter} label={o.label} consequence={o.consequence} recommended={q.recommend === o.letter}
272
297
  selected={(open ? choice : q.answer?.choice) === o.letter} disabled={!open || run.isPending} onPress={() => setChoice(o.letter)} />)}
@@ -347,10 +372,18 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
347
372
  {open && input}
348
373
  {actions}
349
374
  </View>
350
- {!dense && !compact && !inline && <Text style={t.small}>Asked {ago(q.askedAt, now)} by {who(w, q.askedBy)}{q.taskId && !q.options.length ? " (blocked task)" : ""}</Text>}
375
+ {!dense && !compact && !inline && <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
376
+ <Text style={[t.small, { flex: 1 }]}>Asked {ago(q.askedAt, now)} by {who(w, q.askedBy)}{q.taskId && !q.options.length ? " (blocked task)" : ""}</Text>
377
+ {dismissAt === "foot" && dismissX}
378
+ </View>}
351
379
  </SubmitScope>;
352
380
  }
353
381
 
382
+ /** A question's x: closes it as dismissed (follow.dismiss with "question:Qn"), sends the agent nothing, Undo in the toast. */
383
+ export function QuestionDismissX({ workspaceId, questionId, theme, compact, disabled, onDismissed, dismiss }: { workspaceId: string; questionId: string; theme: Theme; compact: boolean; disabled?: boolean; onDismissed?: () => void; dismiss: ReturnType<typeof useDismiss> }) {
384
+ return <DismissX theme={theme} compact={compact} label={`Dismiss ${questionId}`} disabled={disabled} onPress={() => dismiss({ workspaceId, key: `question:${questionId}` }, { onDismissed })} />;
385
+ }
386
+
354
387
  function hostOf(url: string): string {
355
388
  try { return new URL(url).host.replace(/^www\./, ""); } catch { return ""; }
356
389
  }
@@ -362,7 +395,7 @@ export function QuestionSheet({ workspace: w, questionId, theme, compact, onClos
362
395
  const color = !q ? c.foregroundMuted : q.answer ? c.statusSuccess : q.closed ? c.foregroundMuted : c.statusWarning;
363
396
  return <Modal title={q ? `${q.id} · ${q.title}` : "Question"} icon={<Icon name={q?.answer ? "MessageCircleReply" : "MessageCircleQuestion"} size={18} color={color} />} open={!!q} onOpenChange={next => { if (!next) onClose(); }}>
364
397
  <Modal.Content contentContainerStyle={{ padding: compact ? 16 : 20 }}>
365
- {q && <QuestionBody key={q.id} workspace={w} question={q} theme={theme} compact={compact} openAgent={openAgent} onClose={onClose} />}
398
+ {q && <QuestionBody key={q.id} workspace={w} question={q} theme={theme} compact={compact} openAgent={openAgent} onClose={onClose} dismissAt={compact ? "top" : "foot"} />}
366
399
  </Modal.Content>
367
400
  </Modal>;
368
401
  }
@@ -374,6 +407,7 @@ export function QuestionStepper({ workspace: w, theme, compact, openAgent, onAns
374
407
  // An answer on its way (sent, no reply yet) steps the pill on at once; one that failed comes back as Not sent.
375
408
  const open = w.questions.filter(q => isOpen(q) && !(pending[pendingKey(w.id, q.id)] && !pending[pendingKey(w.id, q.id)].error)).sort((a, b) => Number(questionState(b) === "stopped") - Number(questionState(a) === "stopped"));
376
409
  const [index, setIndex] = useState(0);
410
+ const dismiss = useDismiss();
377
411
  if (!open.length) return null;
378
412
  const at = Math.min(index, open.length - 1);
379
413
  const q = open[at];
@@ -390,8 +424,9 @@ export function QuestionStepper({ workspace: w, theme, compact, openAgent, onAns
390
424
  <Text accessibilityLabel={`Question ${at + 1} of ${open.length}`} style={[t.small, { marginLeft: 4 }]}>{at + 1} of {open.length}</Text>
391
425
  {arrow("ChevronLeft", "Previous question", -1)}{arrow("ChevronRight", "Next question", 1)}
392
426
  </>}
427
+ <QuestionDismissX workspaceId={w.id} questionId={q.id} theme={theme} compact={compact} onDismissed={onAnswered} dismiss={dismiss} />
393
428
  </View>
394
- <QuestionBody key={q.id} workspace={w} question={q} theme={theme} compact={compact} dense bodyMaxHeight={bodyMaxHeight} openAgent={openAgent} onAnswered={onAnswered} onDetails={onDetails ? () => onDetails(q.id) : undefined} />
429
+ <QuestionBody key={q.id} workspace={w} question={q} theme={theme} compact={compact} dense bodyMaxHeight={bodyMaxHeight} openAgent={openAgent} onAnswered={onAnswered} onDetails={onDetails ? () => onDetails(q.id) : undefined} dismissAt="host" />
395
430
  </View>;
396
431
  }
397
432
 
package/index.client.tsx CHANGED
@@ -10,6 +10,7 @@ import { MODE } from "./shared/catch-up";
10
10
  import { FollowPanel } from "./client/panel";
11
11
  import { createPaseoWorkspaces } from "./client/home-data";
12
12
  import { createHomeExtras } from "./client/home-view";
13
+ import { setContextSource } from "./client/more-context";
13
14
  import { contributeChat } from "./client/chat";
14
15
  import { contributeCreated } from "./client/created";
15
16
  import { hasFeeds } from "./client/feeds";
@@ -17,6 +18,7 @@ import { createLiveStore, headerIcon, sidebarItem } from "./client/live";
17
18
  import { FOLLOW_UP_ICON } from "./client/follow-up-icon";
18
19
  import { contributeFollowUpPill } from "./client/pill";
19
20
  import { FollowLarge, LARGE_SCREEN } from "./client/large";
21
+ import { bindDismissInbox } from "./client/dismiss";
20
22
  import { createInboxStore } from "./client/inbox-store";
21
23
  import { contributeInboxCommands } from "./client/inbox";
22
24
  import type { BriefDeps } from "./client/brief";
@@ -68,6 +70,8 @@ export default function contribute(host: PluginClientContext) {
68
70
  const Settings = (props: PluginSurfaceProps) => <><FollowSettings {...props} openSetup={openSetup} openReport={() => openReportSheet()} />{reportHost(props)}</>;
69
71
  const store = createLiveStore(client);
70
72
  const inbox = createInboxStore(host);
73
+ // A brief's x (client/dismiss.tsx) updates the inbox rows at once, like Sign off.
74
+ bindDismissInbox(inbox);
71
75
  const HeaderIcon = headerIcon(store);
72
76
  const headers = new Map<string, PluginButtonRegistration>();
73
77
  let stopped = false;
@@ -78,6 +82,8 @@ export default function contribute(host: PluginClientContext) {
78
82
  };
79
83
  const paseoWorkspaces = createPaseoWorkspaces(client, { onAdd: register, onRemove: id => { headers.get(id)?.remove(); headers.delete(id); } });
80
84
  const extras = createHomeExtras(client);
85
+ // One store of More context asks for every question surface (client/more-context.tsx).
86
+ setContextSource(extras);
81
87
  const searchKey = createSearchKey();
82
88
  const sources = { inbox, live: store, paseo: paseoWorkspaces, extras };
83
89
  const offActivity = extras.onActivity(() => { inbox.nudge(); store.nudge(); });
@@ -164,6 +170,7 @@ export default function contribute(host: PluginClientContext) {
164
170
  for (const r of removers) void r();
165
171
  for (const button of headers.values()) button.remove();
166
172
  await paseoWorkspaces.stop();
173
+ setContextSource(null);
167
174
  await extras.stop();
168
175
  };
169
176
  }
package/index.server.ts CHANGED
@@ -10,18 +10,19 @@ import { isRecovery, withRuntimePrelude, invokeSelf, PLUGIN_ID } from "./shared/
10
10
  import { displayPreferences } from "./shared/display";
11
11
  import { DEFAULT_QUESTION_MODE, QUESTION_DEDUPE_MIGRATION, awaitingSend, collapseDuplicateQuestions, questionPreferences, signedOffAnswers, type QuestionMode } from "./shared/questions";
12
12
  import { answerRecipients, askQuestion, needsYouQuestions, recordAnswer, syncTaskQuestions, withdrawQuestion } from "./server/questions";
13
+ import { dismissItem, dismissedNeeds, undoDismissItem } from "./server/dismiss";
13
14
  import { agentSetSpec, developerSetSpec } from "./server/spec";
14
15
  import type { PluginServerContext, PluginHandlerContext, PluginHookContext, PluginSessionOpenRequest } from "@getpaseo/plugin/server";
15
16
  import type { PluginRpcContract, PluginSubscriptionContract } from "@getpaseo/plugin";
16
17
  import { ValueFeed, WorkspacesFeed } from "./server/feeds";
17
18
  import { ContextRequests, contextRecipient } from "./server/context-requests";
18
- import { agentContextPrompt, deckCards } from "./shared/catch-up";
19
+ import { agentContextPrompt, contextFor, deckCards } from "./shared/catch-up";
19
20
  import { buildHome } from "./shared/home";
20
21
  import { needsYou } from "./shared/attention";
21
22
  import type { SortMode } from "./shared/sort";
22
23
  import type { ZodType, output as zOutput } from "zod";
23
24
  import { mkdir, writeFile } from "node:fs/promises";
24
- import { isTimeZone } from "./shared/inbox";
25
+ import { DISMISSED_ASK_NOTE, isTimeZone, sameAsk } from "./shared/inbox";
25
26
  import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
26
27
  import { join } from "node:path";
27
28
  import { randomUUID } from "node:crypto";
@@ -643,7 +644,7 @@ export default function contribute(server: PluginServerContext) {
643
644
  await agentHooks.confirm(w.id, agentId, summary);
644
645
  return { workspaceId: w.id, synced: true as const };
645
646
  });
646
- handle(rpc.agentStatusRpc, async ({ agentId }, { paseo }) => { await requireReady(); const workspaceId = await callerWorkspaceId(agentId, paseo); const w = agentWorkspace(await store.snapshot(), agentId, "read", workspaceId, "pr"); return { ...w, prWorkflow: prWorkflow.agentWorkflow(workspaceRepo(w), touchedRepos(w)), nextMessageInfo: nextMessageInfo(w, Date.now()), sending: sendingOf(w, Date.now(), { held: !governor.allowsBackground() }) }; });
647
+ handle(rpc.agentStatusRpc, async ({ agentId }, { paseo }) => { await requireReady(); const workspaceId = await callerWorkspaceId(agentId, paseo); const w = agentWorkspace(await store.snapshot(), agentId, "read", workspaceId, "pr"); return { ...w, dismissed: dismissedNeeds(w, Date.now()), dismissedAsk: await inbox.dismissedAsk(agentId), prWorkflow: prWorkflow.agentWorkflow(workspaceRepo(w), touchedRepos(w)), nextMessageInfo: nextMessageInfo(w, Date.now()), sending: sendingOf(w, Date.now(), { held: !governor.allowsBackground() }) }; });
647
648
  handle(rpc.activateRpc, async ({ workspaceId }) => { await requireReady(); return engine.activate(workspaceId); });
648
649
  handle(rpc.sendRpc, async ({ workspaceId, batchId }) => { await requireReady(); return engine.sendPending(workspaceId, batchId); });
649
650
  handle(rpc.recoverRpc, async ({ workspaceId }) => { await requireReady(); return engine.startRecovery(workspaceId); });
@@ -805,6 +806,18 @@ export default function contribute(server: PluginServerContext) {
805
806
  return w;
806
807
  });
807
808
  });
809
+ handle(rpc.dismissQuestionRpc, async ({ workspaceId, questionId, undo }, context) => { await requireReady(); return engine.dismiss(workspaceId, questionId, !!undo, actorOf(context)); });
810
+ // dismissing-anything-in-needs-you-sends-the-agent-nothing: one path for every kind; only records change.
811
+ handle(rpc.dismissRpc, async ({ workspaceId, key, agentId, undo }, context) => {
812
+ await requireReady();
813
+ const actor = actorOf(context);
814
+ if (agentId) return inbox.dismiss(agentId, !!undo, actor);
815
+ return store.mutateWorkspace(workspaceId!, w => {
816
+ const r = undo ? undoDismissItem(w, key!, actor) : dismissItem(w, key!, actor, Date.now());
817
+ w.updatedAt = new Date().toISOString();
818
+ return r;
819
+ });
820
+ });
808
821
  handle(rpc.answerQuestionRpc, async ({ workspaceId, questionId, choice, words, action }, context) => { await requireReady(); return engine.answer(workspaceId, questionId, choice, words, action, actorOf(context)); });
809
822
  handle(rpc.declareDoneRpc, async ({ agentId, summary }, { paseo }) => { await requireReady(); return engine.declareDone(agentId, summary, await callerWorkspaceId(agentId, paseo, false)); });
810
823
  handle(rpc.acknowledgeRpc, async ({ agentId, batchId, outcome, result, humanOnly }, { paseo }) => {
@@ -979,7 +992,7 @@ export default function contribute(server: PluginServerContext) {
979
992
  const model = buildHome({ rows: list.rows, tracked, paseo: paseoList, now: Date.now(), sort: (settings as { home_sort?: SortMode }).home_sort, priorities });
980
993
  const cards = deckCards({ model, rows: list.rows, items: id => { const w = byId.get(id); return w ? needsYou(w) : []; } });
981
994
  return { cards: cards.map(c => {
982
- const r = [...context].reverse().find(x => x.cardKey === c.key);
995
+ const r = contextFor(context, { workspaceId: c.s.workspaceId, cardKey: c.key });
983
996
  return { key: c.key, kind: c.kind, workspaceId: c.s.workspaceId, agentId: c.s.agentId, title: c.s.title, line: c.s.line, questionId: c.questionId ?? null,
984
997
  item: c.item && "title" in c.item ? String((c.item as { title?: unknown }).title ?? "") || null : null, context: r ? { id: r.id, state: r.state, target: r.target } : null };
985
998
  }) };
@@ -1408,7 +1421,7 @@ export default function contribute(server: PluginServerContext) {
1408
1421
  const turn = inbox.currentTurn(agentId);
1409
1422
  const previous = await readFile(needsYouPath(agentId), "utf8").then(t => JSON.parse(t) as NeedsYouRecord).catch(() => null);
1410
1423
  const sameTurn = !!previous && (turn?.turnId ? previous.turnId === turn.turnId : !!turn && previous.at >= turn.at);
1411
- let questionIds: string[] = []; let createdIds: string[] = [];
1424
+ let questionIds: string[] = []; let createdIds: string[] = []; let dismissed: string[] = [];
1412
1425
  if (tracked) {
1413
1426
  const mode = await questionMode();
1414
1427
  const linked = await store.mutate(state => {
@@ -1417,7 +1430,7 @@ export default function contribute(server: PluginServerContext) {
1417
1430
  if (result.questionIds.length || sameTurn) changed(w);
1418
1431
  return { ...result, ask: foldedAsk(call.ask, result.questionIds, w.questions) };
1419
1432
  });
1420
- questionIds = linked.questionIds; createdIds = linked.createdIds;
1433
+ questionIds = linked.questionIds; createdIds = linked.createdIds; dismissed = linked.dismissed;
1421
1434
  // one-ask-one-title: a brief that folds into its question is named by the question everywhere.
1422
1435
  call = { ...call, ask: linked.ask };
1423
1436
  // The brief maps decisions to questions by position, so the record keeps them aligned (a linked question shows as itself).
@@ -1425,12 +1438,19 @@ export default function contribute(server: PluginServerContext) {
1425
1438
  call = { ...rest, ...(linked.decisions.length ? { decisions: linked.decisions } : {}) };
1426
1439
  if (!linked.decisions.length) delete call.decisions;
1427
1440
  } else if (call.questions?.length) throw new Error("questions point at a tracked workspace's open questions, and this workspace isn't tracked.");
1441
+ // dismissing-anything-in-needs-you-sends-the-agent-nothing: an ask the developer dismissed, stated again with nothing
1442
+ // new to decide, isn't flagged again: the turn ends quiet, and the call says why.
1443
+ const gone = await inbox.dismissedAsk(agentId);
1444
+ const restated = !!gone && !questionIds.length && !call.decisions?.length && sameAsk(gone.ask, call.ask);
1445
+ if (restated) call = { ...call, kind: "done" };
1428
1446
  const record: NeedsYouRecord = { at: Date.now(), turnId: turn?.turnId ?? null, call, questionIds, createdIds };
1429
1447
  await mkdir(join(directory, "hook-state"), { recursive: true, mode: 0o700 });
1430
1448
  const temporary = `${needsYouPath(agentId)}.${randomUUID()}`;
1431
1449
  await writeFile(temporary, JSON.stringify(record), { mode: 0o600 });
1432
1450
  await rename(temporary, needsYouPath(agentId));
1433
- return { ok: true as const, briefId: `brief:${turn?.turnId ?? record.at}` };
1451
+ return { ok: true as const, briefId: `brief:${turn?.turnId ?? record.at}`,
1452
+ ...(restated ? { note: DISMISSED_ASK_NOTE }
1453
+ : dismissed.length ? { note: `The developer dismissed ${dismissed.join(", ")}: ${dismissed.length === 1 ? "it no longer matters, so it was" : "they no longer matter, so they were"} left off the card. Don't raise ${dismissed.length === 1 ? "it" : "them"} again.` } : {}) };
1434
1454
  });
1435
1455
  // Replies once the answer is recorded; the send runs after (Inbox.briefAction), so a dormant agent's slow resume never
1436
1456
  // times the card out.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "paseo-follow-up",
3
3
  "private": false,
4
- "version": "2.3.0-beta.0",
4
+ "version": "2.3.0-beta.2",
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": [
@@ -43,7 +43,8 @@
43
43
  "test:wait": "node scripts/check-wait.mjs",
44
44
  "test:wait-live": "node scripts/check-wait.mjs --live",
45
45
  "shots": "node scripts/screenshots.mjs",
46
- "shots:readme": "sh scripts/readme-shots.sh"
46
+ "shots:readme": "sh scripts/readme-shots.sh",
47
+ "check:paseo-keys": "tsx scripts/check-paseo-keys.ts"
47
48
  },
48
49
  "devDependencies": {
49
50
  "@getpaseo/client": "0.16.0-beta.1",
@@ -47,7 +47,7 @@ export function rowPrs(state: State, r: InboxRow, now: number): PrLink[] {
47
47
  return [...out.values()];
48
48
  }
49
49
 
50
- export const AGENT_TOOLS = ["make_main_agent", "list_prs", "add_reviewers", "merge", "enable_merge_when_ready", "disable_merge_when_ready", "send_repairs", "set_auto_send", "clear_hold", "retry_batch", "track", "inbox_list", "sign_off", "snooze", "snooze_workspace", "set_finish_flags", "set_priorities", "workspace_about", "agent_settings", "follow_settings", "set_follow_settings", "project_settings", "set_project_tracking", "pr_workflow", "set_pr_workflow", "reviewer_settings", "reviewer_suggestions", "save_reviewers", "set_agent_setting", "set_wait_for_jobs", "onboarding_status", "onboarding_checks", "set_onboarding", "priorities", "rank_status", "rerank_priorities", "usage", "overseer_status", "overseer_start", "overseer_restart", "overseer_ask", "inbox_brief", "brief_action", "queue_list", "queue_action", "inbox_act", "answer_question", "run_recovery", "refresh", "set_workspace_spec", "set_task_trigger", "pr_controls", "browser_status", "trust_bypass_status", "release_notes", "link_items", "set_linked_items", "updates_status", "check_updates", "set_updates", "install_update", "display_settings", "set_display", "retry_move", "report_issue", "report_send", "ai_rename", "catch_up_deck", "context_requests", "ask_context"] as const;
50
+ export const AGENT_TOOLS = ["make_main_agent", "list_prs", "add_reviewers", "merge", "enable_merge_when_ready", "disable_merge_when_ready", "send_repairs", "set_auto_send", "clear_hold", "retry_batch", "track", "inbox_list", "sign_off", "snooze", "snooze_workspace", "set_finish_flags", "set_priorities", "workspace_about", "agent_settings", "follow_settings", "set_follow_settings", "project_settings", "set_project_tracking", "pr_workflow", "set_pr_workflow", "reviewer_settings", "reviewer_suggestions", "save_reviewers", "set_agent_setting", "set_wait_for_jobs", "onboarding_status", "onboarding_checks", "set_onboarding", "priorities", "rank_status", "rerank_priorities", "usage", "overseer_status", "overseer_start", "overseer_restart", "overseer_ask", "inbox_brief", "brief_action", "queue_list", "queue_action", "inbox_act", "answer_question", "dismiss_question", "dismiss_item", "run_recovery", "refresh", "set_workspace_spec", "set_task_trigger", "pr_controls", "browser_status", "trust_bypass_status", "release_notes", "link_items", "set_linked_items", "updates_status", "check_updates", "set_updates", "install_update", "display_settings", "set_display", "retry_move", "report_issue", "report_send", "ai_rename", "catch_up_deck", "context_requests", "ask_context"] as const;
51
51
  export type AgentTool = typeof AGENT_TOOLS[number];
52
52
  /** Tools that only read. */
53
53
  export const READ_ONLY_TOOLS: readonly AgentTool[] = ["list_prs", "inbox_list", "workspace_about", "agent_settings", "display_settings", ...RPC_TOOLS.filter(t => t.kind === "read").map(t => t.name as AgentTool)];