paseo-follow-up 2.2.0-beta.1 → 2.2.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.
package/client/brief.tsx CHANGED
@@ -14,6 +14,7 @@ import { briefKey, HEADLINE_WORD } from "../shared/headline";
14
14
  const word = (kind: Brief["kind"]) => HEADLINE_WORD[briefKey(kind)];
15
15
  import { answerQuestionRpc, briefActionRpc, browserStatusRpc, inboxBriefRpc } from "../shared/contracts";
16
16
  import { errorText, mootNote } from "../shared/errors";
17
+ import { PRIMARY_FORM } from "./dock";
17
18
  import { OTHER, OTHER_LABEL, OWN_ANSWER_HINT, briefAnswerStatus, isOther, type Question } from "../shared/questions";
18
19
  import type { ListQuestion, ListWorkspace } from "../shared/list";
19
20
  import { useDetailGate, useWorkspace } from "./workspace-data";
@@ -184,7 +185,8 @@ function BriefBody({ b, c, compact, tight, embedded, height, mode, picks, onPick
184
185
  {(!readonly || isOther(d.chosen)) && <OptionRow other option={{ letter: "", label: OTHER_LABEL, consequence: readonly ? `"${d.words ?? ""}"` : null }} recommended={false} mode={mode} answerLabel={answerLabel}
185
186
  selected={readonly ? isOther(d.chosen) : isOther(picks[d.id])} answered={readonly && !!d.chosen} sending={busy === `${d.id}:${OTHER}`} disabled={!!busy} tight={false} open={false} onToggle={() => undefined}
186
187
  onPress={() => onPick(d.id, OTHER)} c={c} compact={compact} />}
187
- {!readonly && isOther(picks[d.id]) && <View style={{ gap: 8 }}>
188
+ {/* Something else's field with its Send answer, kept on screen together while typing (DockedPane). */}
189
+ {!readonly && isOther(picks[d.id]) && <View {...PRIMARY_FORM} style={{ gap: 8 }}>
188
190
  <TextInput accessibilityLabel={`Your answer${numbered ? ` to question ${i + 1}` : ""}, required`} placeholder="Your answer (required)" placeholderTextColor={c.foregroundMuted} autoFocus multiline maxLength={2000}
189
191
  value={words[d.id] ?? ""} editable={!busy} onChangeText={t => onWords?.(d.id, t)}
190
192
  style={{ minHeight: compact ? 66 : 58, paddingHorizontal: 10, paddingVertical: 8, borderRadius: 8, borderWidth: 1, borderColor: words[d.id]?.trim() ? c.border : withAlpha(c.accent, 0.7), color: c.foreground, backgroundColor: c.surface0, fontSize: 14, lineHeight: 20, textAlignVertical: "top" }} />
@@ -194,7 +196,7 @@ function BriefBody({ b, c, compact, tight, embedded, height, mode, picks, onPick
194
196
  </View>}
195
197
  </View>}
196
198
  {/* A note on a lettered pick ("A, but…"): quiet until asked for, never in the way of the one-tap answer. */}
197
- {!readonly && !isOther(picks[d.id]) && (notesOpen[d.id] ? <View style={{ gap: 6, marginTop: 2 }}>
199
+ {!readonly && !isOther(picks[d.id]) && (notesOpen[d.id] ? <View {...PRIMARY_FORM} style={{ gap: 6, marginTop: 2 }}>
198
200
  <Text style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16, fontWeight: "600" }}>Note</Text>
199
201
  <TextInput accessibilityLabel={`Note for the agent${numbered ? ` on decision ${i + 1}` : ""}, optional`} placeholder={mode === "select" ? "Sent with your pick for this decision" : "Sent with the option you tap"}
200
202
  placeholderTextColor={c.foregroundMuted} autoFocus={focusNote === d.id} multiline maxLength={2000} value={notes[d.id] ?? ""} editable={!busy} onChangeText={t => onNote?.(d.id, t)}
package/client/dock.ts ADDED
@@ -0,0 +1,70 @@
1
+ // What a docked pane does around a field (`a-focused-field-and-its-send-stay-in-view`): pure, so tests can run it
2
+ // without React Native. client/docked-pane.tsx wires it to focus, the keyboard and the scroll view.
3
+
4
+ /** The bit of a DOM element this needs; tests pass plain objects. */
5
+ export type DockNode = {
6
+ tagName?: string;
7
+ isContentEditable?: boolean;
8
+ parentElement?: DockNode | null;
9
+ dataset?: Record<string, string | undefined>;
10
+ style?: { scrollMarginBottom?: string; scrollMarginTop?: string };
11
+ scrollIntoView?(o?: { block?: "nearest" | "start" | "end" | "center"; inline?: "nearest" }): void;
12
+ };
13
+
14
+ /** A field the keyboard types into. */
15
+ export const isField = (n: DockNode | null | undefined): boolean =>
16
+ !!n && (n.tagName === "TEXTAREA" || n.tagName === "INPUT" || !!n.isContentEditable);
17
+
18
+ /**
19
+ * What must stay on screen while `field` has focus: the nearest enclosing primary form (the field with its Send,
20
+ * marked `dataSet={{ primaryForm: "1" }}`, PRIMARY_FORM), else the field itself.
21
+ */
22
+ export function revealTarget(field: DockNode): DockNode {
23
+ for (let n: DockNode | null | undefined = field; n; n = n.parentElement) if (n.dataset?.primaryForm !== undefined) return n;
24
+ return field;
25
+ }
26
+
27
+ /** Scroll the focused field's form into view, the least distance that shows it all. Returns what it revealed. */
28
+ export function revealFocused(field: DockNode | null | undefined): DockNode | null {
29
+ if (!isField(field)) return null;
30
+ const target = revealTarget(field!);
31
+ // A gutter's gap from the dock below and the header above, never flush against either.
32
+ if (target.style) { target.style.scrollMarginBottom = `${REVEAL_GAP}px`; target.style.scrollMarginTop = `${REVEAL_GAP}px`; }
33
+ target.scrollIntoView?.({ block: "nearest", inline: "nearest" });
34
+ return target;
35
+ }
36
+
37
+ /**
38
+ * The dock's extras (Sign off, Sign off & next, Later; setup's Back and Continue) step aside on a phone while a field
39
+ * in the pane has focus or the keyboard is up, so the pane's height goes to what is being typed and its Send.
40
+ */
41
+ export const dockYields = (s: { compact: boolean; fieldFocused: boolean; keyboardUp: boolean }): boolean =>
42
+ s.compact && (s.fieldFocused || s.keyboardUp);
43
+
44
+ /**
45
+ * What a docked pane shows around a field. `yields`: the dock drops its extras and the header its secondary lines.
46
+ * `typingInContent`: a field in the content (not the dock's own reply box) has focus, so the whole dock steps aside
47
+ * and only one text box is on screen.
48
+ */
49
+ export type DockState = { yields: boolean; typingInContent: boolean };
50
+ export const dockState = (s: { compact: boolean; fieldFocused: boolean; fieldInDock: boolean; keyboardUp: boolean }): DockState =>
51
+ ({ yields: dockYields(s), typingInContent: s.compact && s.fieldFocused && !s.fieldInDock });
52
+
53
+ /** The gap kept between a revealed form and the dock or header (the 16 px gutter). */
54
+ export const REVEAL_GAP = 16;
55
+
56
+ /**
57
+ * How much of the layout the on-screen keyboard covers on the web: the layout viewport below the visual one. Zero
58
+ * when the browser resizes the page for the keyboard (the pane shrinks on its own) or no keyboard is up.
59
+ */
60
+ export const keyboardOverlap = (v: { innerHeight: number; viewportHeight: number; offsetTop: number }): number =>
61
+ Math.max(0, Math.round(v.innerHeight - v.viewportHeight - v.offsetTop));
62
+
63
+ /** Above this, a shrunken visual viewport is the keyboard, not browser chrome sliding in. */
64
+ export const KEYBOARD_MIN = 150;
65
+
66
+ /**
67
+ * The marker a primary form carries: spread it on the View holding a field and its Send. React Native web turns
68
+ * dataSet into data-* attributes (dataset.primaryForm); its types don't list dataSet, hence the spread.
69
+ */
70
+ export const PRIMARY_FORM = { dataSet: { primaryForm: "1" } } as object;
@@ -0,0 +1,108 @@
1
+ // A scrolling pane with a bar docked under it (`a-focused-field-and-its-send-stay-in-view`). Home's detail pane, the
2
+ // Overseer's pane and setup draw through it, so none of them handles the keyboard or a focused field its own way.
3
+ import { useEffect, useRef, useState, type ReactNode } from "react";
4
+ import { Keyboard, Platform, TextInput, View, findNodeHandle, type StyleProp, type ViewStyle } from "react-native";
5
+ import { ScrollView } from "@getpaseo/plugin/client/ui";
6
+ import { KEYBOARD_MIN, dockState, isField, keyboardOverlap, revealFocused, type DockNode, type DockState } from "./dock";
7
+
8
+ type Doc = { activeElement?: DockNode | null };
9
+ type Viewport = { height: number; offsetTop: number; addEventListener(e: "resize" | "scroll", f: () => void): void; removeEventListener(e: "resize" | "scroll", f: () => void): void };
10
+ type Win = { innerHeight: number; innerWidth: number; visualViewport?: Viewport; addEventListener(e: "resize", f: () => void): void; removeEventListener(e: "resize", f: () => void): void };
11
+ type DomNode = DockNode & { contains(n: unknown): boolean; addEventListener(e: string, f: (e: { target: unknown }) => void): void; removeEventListener(e: string, f: (e: { target: unknown }) => void): void };
12
+
13
+ /**
14
+ * Phones: whether the on-screen keyboard is up, and how much of the page it covers. On the web the keyboard either
15
+ * shrinks the visual viewport over an unchanged page (iOS Safari, Chrome's default: `overlap`) or resizes the page
16
+ * itself (`interactive-widget=resizes-content`: the window got shorter at the same width). Native reads Keyboard.
17
+ */
18
+ export function useKeyboard(compact: boolean): { up: boolean; overlap: number } {
19
+ const [k, setK] = useState({ up: false, overlap: 0 });
20
+ useEffect(() => {
21
+ if (!compact) return;
22
+ if (Platform.OS === "web") {
23
+ const win = globalThis as unknown as Win;
24
+ const vv = win.visualViewport;
25
+ let tallest = win.innerHeight, width = win.innerWidth;
26
+ const check = () => {
27
+ if (win.innerWidth !== width) { width = win.innerWidth; tallest = win.innerHeight; }
28
+ tallest = Math.max(tallest, win.innerHeight);
29
+ const overlap = vv ? keyboardOverlap({ innerHeight: win.innerHeight, viewportHeight: vv.height, offsetTop: vv.offsetTop }) : 0;
30
+ const up = overlap > KEYBOARD_MIN || tallest - win.innerHeight > KEYBOARD_MIN;
31
+ setK(p => p.up === up && p.overlap === overlap ? p : { up, overlap: up ? overlap : 0 });
32
+ };
33
+ vv?.addEventListener("resize", check); vv?.addEventListener("scroll", check); win.addEventListener("resize", check);
34
+ return () => { vv?.removeEventListener("resize", check); vv?.removeEventListener("scroll", check); win.removeEventListener("resize", check); };
35
+ }
36
+ // Native: the host keeps the pane above the keyboard; the pane only needs to know it is up.
37
+ const show = Keyboard.addListener(Platform.OS === "ios" ? "keyboardWillShow" : "keyboardDidShow", () => setK({ up: true, overlap: 0 }));
38
+ const hide = Keyboard.addListener(Platform.OS === "ios" ? "keyboardWillHide" : "keyboardDidHide", () => setK({ up: false, overlap: 0 }));
39
+ return () => { show.remove(); hide.remove(); };
40
+ }, [compact]);
41
+ return k;
42
+ }
43
+
44
+ /**
45
+ * The pane: `header`, a scroll view holding `children`, and the bar `dock(yields)` draws under it. On a phone, while
46
+ * a field in the pane has focus or the keyboard is up, `yields` is true and the dock drops its extras (Home's Sign
47
+ * off row, setup's Back and Continue), the pane stops above the keyboard, and the focused field's primary form (the
48
+ * field with its Send, marked PRIMARY_FORM) scrolls into view, again whenever the keyboard or the dock changes size.
49
+ */
50
+ export function DockedPane({ compact, header, children, dock, style, contentContainerStyle, scrollRef }: {
51
+ compact: boolean; header?: ReactNode | ((s: DockState) => ReactNode); children: ReactNode; dock?: (s: DockState) => ReactNode;
52
+ style?: StyleProp<ViewStyle>; contentContainerStyle?: StyleProp<ViewStyle>;
53
+ scrollRef?: React.MutableRefObject<unknown>;
54
+ }) {
55
+ const root = useRef<View | null>(null);
56
+ const dockRef = useRef<View | null>(null);
57
+ const ownScroll = useRef<unknown>(null);
58
+ const scroll = scrollRef ?? ownScroll;
59
+ const [focus, setFocus] = useState({ field: false, inDock: false });
60
+ const keyboard = useKeyboard(compact);
61
+ const state = dockState({ compact, fieldFocused: focus.field, fieldInDock: focus.inDock, keyboardUp: keyboard.up });
62
+ const yields = state.yields;
63
+ const inDock = (n: unknown) => !!n && !!(dockRef.current as unknown as DomNode | null)?.contains(n);
64
+ // Web: track focus inside the pane, and keep the focused field's form on screen.
65
+ const reveal = () => {
66
+ if (Platform.OS !== "web") return;
67
+ const node = root.current as unknown as DomNode | null;
68
+ const active = (globalThis as { document?: Doc }).document?.activeElement;
69
+ if (node && active && node.contains(active)) revealFocused(active);
70
+ };
71
+ useEffect(() => {
72
+ if (Platform.OS !== "web" || !compact) return;
73
+ const node = root.current as unknown as DomNode | null;
74
+ if (!node) return;
75
+ const timers = new Set<ReturnType<typeof setTimeout>>();
76
+ const later = (ms: number, f: () => void) => { const t = setTimeout(() => { timers.delete(t); f(); }, ms); timers.add(t); };
77
+ const onIn = (e: { target: unknown }) => {
78
+ if (!isField(e.target as DockNode)) return;
79
+ setFocus({ field: true, inDock: inDock(e.target) });
80
+ // Once the dock has yielded and the keyboard has settled.
81
+ later(0, reveal); later(320, reveal);
82
+ };
83
+ const onOut = () => later(0, () => {
84
+ const active = (globalThis as { document?: Doc }).document?.activeElement;
85
+ const field = !!active && node.contains(active) && isField(active);
86
+ setFocus({ field, inDock: field && inDock(active) });
87
+ });
88
+ node.addEventListener("focusin", onIn); node.addEventListener("focusout", onOut);
89
+ return () => { node.removeEventListener("focusin", onIn); node.removeEventListener("focusout", onOut); timers.forEach(clearTimeout); };
90
+ }, [compact]);
91
+ useEffect(() => { if (yields) { reveal(); const t = setTimeout(reveal, 320); return () => clearTimeout(t); } }, [yields, state.typingInContent, keyboard.overlap]);
92
+ // Native: the focused input, with room below it for its Send, once the keyboard is up.
93
+ useEffect(() => {
94
+ if (Platform.OS === "web" || !keyboard.up) return;
95
+ const input = (TextInput as unknown as { State?: { currentlyFocusedInput?(): unknown } }).State?.currentlyFocusedInput?.();
96
+ const handle = input ? findNodeHandle(input as never) : null;
97
+ const s = scroll.current as { scrollResponderScrollNativeHandleToKeyboard?(h: number, extra: number, prevent: boolean): void } | null;
98
+ if (handle) s?.scrollResponderScrollNativeHandleToKeyboard?.(handle, NATIVE_SEND_ROOM, true);
99
+ }, [keyboard.up]);
100
+ return <View ref={root} style={[{ flex: 1 }, style, keyboard.overlap ? { paddingBottom: keyboard.overlap } : null]}>
101
+ {typeof header === "function" ? header(state) : header}
102
+ <ScrollView ref={scroll as never} style={{ flex: 1 }} contentContainerStyle={contentContainerStyle} keyboardShouldPersistTaps="handled">{children}</ScrollView>
103
+ <View ref={dockRef}>{dock?.(state)}</View>
104
+ </View>;
105
+ }
106
+
107
+ /** Native: what is kept clear under the focused input, about one row of actions (Send) plus the gap above it. */
108
+ const NATIVE_SEND_ROOM = 96;
package/client/home.tsx CHANGED
@@ -17,6 +17,8 @@ import { BriefCard, type BriefDeps } from "./brief";
17
17
  import { SummaryLine } from "./about";
18
18
  import { ReferencesLine } from "./linked";
19
19
  import { bottomGap, bottomInset, Button, focusSoon, IconButton, space, text, type Theme } from "./kit";
20
+ import { DockedPane } from "./docked-pane";
21
+ import type { DockState } from "./dock";
20
22
  import { NeedsYouBlock } from "./needs-you";
21
23
  import { HeldMerges } from "./merge-button";
22
24
  import { PrSheet } from "./pr-sheet";
@@ -385,7 +387,6 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
385
387
  // Phones: one primary per screen. An actionable Needs-you item (Answer, Merge…) outranks Sign off.
386
388
  const itemFirst = compact && asks.length > 0;
387
389
  const [laterSheet, setLaterSheet] = useState(false);
388
- const [typing, setTyping] = useState(false);
389
390
  // A snoozed row keeps its moves: Sign off is a normal end for something put off, and Later changes the time.
390
391
  const flagged = !!row?.needs;
391
392
  const plan = paneButtons({ permissions: agent.permissions.length, decisions: !!b?.decisions.some(d => d.options.length), items, flagged, hasAgent: !!s.agentId });
@@ -410,12 +411,13 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
410
411
  const metaRest = [laterText, ago === "now" ? "just now" : ago, s.project].filter(Boolean).join(" · ");
411
412
  // Phones: the host header already says Follow-up and carries ←. The pane head is the full-width title, then one meta
412
413
  // line (state, age, project, PRs as text) that ellipsizes instead of wrapping, with Open full as an icon at its end.
413
- const header = compact ? <View style={{ paddingHorizontal: 16, paddingTop: 10, paddingBottom: 6, gap: 2, borderBottomWidth: 1, borderBottomColor: c.border }}>
414
- <Text accessibilityRole="header" numberOfLines={3} style={t.title}>{s.title}</Text>
414
+ // While typing (DockedPane yields) the phone head keeps only the title, so the form gets the height.
415
+ const header = ({ yields: writing }: DockState) => compact ? <View style={{ paddingHorizontal: 16, paddingTop: 10, paddingBottom: 6, gap: 2, borderBottomWidth: 1, borderBottomColor: c.border }}>
416
+ <Text accessibilityRole="header" numberOfLines={writing ? 1 : 3} style={t.title}>{s.title}</Text>
415
417
  {/* The Summary: what this workspace is for, right under its name. */}
416
- {s.workspaceId && w && <View style={{ marginTop: 4 }}><SummaryLine key={s.workspaceId} workspace={w} theme={theme} compact /></View>}
417
- {s.workspaceId && w && <View style={{ marginTop: 6 }}><ReferencesLine key={`refs:${s.workspaceId}`} workspace={w} theme={theme} compact /></View>}
418
- <View style={{ flexDirection: "row", alignItems: "center", gap: 6, minHeight: 44 }}>
418
+ {!writing && s.workspaceId && w && <View style={{ marginTop: 4 }}><SummaryLine key={s.workspaceId} workspace={w} theme={theme} compact /></View>}
419
+ {!writing && s.workspaceId && w && <View style={{ marginTop: 6 }}><ReferencesLine key={`refs:${s.workspaceId}`} workspace={w} theme={theme} compact /></View>}
420
+ {!writing && <View style={{ flexDirection: "row", alignItems: "center", gap: 6, minHeight: 44 }}>
419
421
  <Icon name={s.icon} size={14} color={color} />
420
422
  <Text numberOfLines={1} style={[t.meta, { flex: 1, minWidth: 0 }]}>
421
423
  {!!s.word && <Text style={{ color, fontWeight: "600" }}>{s.word}</Text>}
@@ -423,7 +425,7 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
423
425
  <PrSummaryText s={s} c={c} lead=" · " />
424
426
  </Text>
425
427
  <IconButton theme={theme} compact icon="PanelRightOpen" label="Open full" onPress={() => openFull(s)} />
426
- </View>
428
+ </View>}
427
429
  </View> : <View style={{ paddingHorizontal: 20, paddingTop: 12, paddingBottom: 12, gap: 6, borderBottomWidth: 1, borderBottomColor: c.border }}>
428
430
  <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
429
431
  {onBack && <IconButton theme={theme} compact icon="ChevronLeft" label="Back to Home" onPress={onBack} />}
@@ -476,7 +478,8 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
476
478
  const laterTimes = laterChoices(new Date());
477
479
  // Phones: the moves sit in the dock above the composer, in thumb reach, on one row: Sign off, Sign off & next, Later.
478
480
  const narrow = useWindowDimensions().width < 380;
479
- const moves = compact && canMove && !typing && <View style={{ flexDirection: "row", gap: 8, paddingHorizontal: 12, paddingTop: 10 }}>
481
+ // The dock's extras step aside while a field in the pane has focus (DockedPane, a-focused-field-and-its-send-stay-in-view).
482
+ const moves = compact && canMove && <View style={{ flexDirection: "row", gap: 8, paddingHorizontal: 12, paddingTop: 10 }}>
480
483
  <View style={{ flex: 1 }}><Button nativeID={PANE_PRIMARY} theme={theme} compact grow kind={plan.primary === "sign_off" && !itemFirst ? "primary" : "secondary"} icon={narrow ? undefined : "Check"} title="Sign off" loading={busy === "sign_off"}
481
484
  onPress={() => void run("sign_off", () => inbox.signOff([s.agentId!]))} /></View>
482
485
  <View style={{ flex: 1.3 }}><Button theme={theme} compact grow icon={narrow ? undefined : "ArrowRight"} title="Sign off & next" onPress={() => signOffNext(s)} /></View>
@@ -521,9 +524,14 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
521
524
  // Only a real ask joins it (shared briefAsks): a done brief on a row flagged for something else stays out of the count.
522
525
  const inBlock = !!w && !!showBrief && !later && briefAsks(b, row);
523
526
 
524
- return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
525
- {header}
526
- <ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: compact ? 16 : 20, gap: 16, paddingBottom: 24 }} keyboardShouldPersistTaps="handled">
527
+ return <><DockedPane compact={compact} header={header} style={{ backgroundColor: c.surface0 }} contentContainerStyle={{ padding: compact ? 16 : 20, gap: 16, paddingBottom: 24 }}
528
+ dock={({ yields, typingInContent }) => s.agentId && !typingInContent && <View nativeID={compact ? TOAST_ANCHOR : undefined} style={[{ borderTopWidth: 1, borderTopColor: c.border, backgroundColor: c.surface0 }, bottomInset(compact)]}>
529
+ {!yields && moves}
530
+ <ReplyBox theme={theme} compact={compact} agentName={s.title} placeholder={compact ? "Reply to the agent" : undefined} onSend={async text => {
531
+ await agent.handle!.send(text);
532
+ inbox.refresh();
533
+ }} />
534
+ </View>}>
527
535
  {agent.permissions.map(p => <PermissionBlock key={p.id} p={p} theme={theme} compact={compact} busy={busy === `perm:${p.id}`} primary={plan.primary === "allow"} onRespond={r => void respond(p, r)} />)}
528
536
  {showBrief ? inBlock ? null : <BriefCard {...({ embedded: true, snoozed: !!later, item: { data: b }, theme, layout: { compact }, agentId: s.agentId, deps: deps.briefDeps } as unknown as Parameters<typeof BriefCard>[0])} />
529
537
  : echoed || (b && compact && b.source === "none" && asks.length) ? null
@@ -536,18 +544,11 @@ function DetailPane({ s, model, theme, compact, deps, openFull, signOffNext, ask
536
544
  {actionBar}
537
545
  {laterBlock}
538
546
  {steps}
539
- </ScrollView>
540
- {s.agentId && <View nativeID={compact ? TOAST_ANCHOR : undefined} style={[{ borderTopWidth: 1, borderTopColor: c.border, backgroundColor: c.surface0 }, bottomInset(compact)]}>
541
- {moves}
542
- <ReplyBox theme={theme} compact={compact} agentName={s.title} placeholder={compact ? "Reply to the agent" : undefined} onFocusChange={setTyping} onSend={async text => {
543
- await agent.handle!.send(text);
544
- inbox.refresh();
545
- }} />
546
- </View>}
547
+ </DockedPane>
547
548
  {laterModal}
548
549
  {full && sheet && <PrSheet workspace={full} prKey={sheet.key} intent={sheet.intent} theme={theme} compact={compact} browserReady={browser.data?.ready ?? false} onClose={() => setSheet(null)} />}
549
550
  {full && <QuestionSheet workspace={full} questionId={question} theme={theme} compact={compact} onClose={() => setQuestion(null)} />}
550
- </View>;
551
+ </>;
551
552
  }
552
553
 
553
554
  /**
@@ -613,9 +614,11 @@ function OverseerPane({ theme, compact, o, focus = 0, pending = null, agentId, m
613
614
  <View style={{ flexDirection: "row" }}><Button theme={theme} compact={compact} grow={compact} kind="primary" icon="Play" title="Start the Overseer" loading={starting} onPress={() => void start()} /></View>
614
615
  </ScrollView>
615
616
  </View>;
616
- return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
617
- {header}
618
- <ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: compact ? 16 : 20, gap: 12, paddingBottom: 24 }} keyboardShouldPersistTaps="handled">
617
+ return <DockedPane compact={compact} header={header} style={{ backgroundColor: c.surface0 }} contentContainerStyle={{ padding: compact ? 16 : 20, gap: 12, paddingBottom: 24 }}
618
+ dock={({ typingInContent }) => agentId && !typingInContent && <View style={[{ borderTopWidth: 1, borderTopColor: c.border }, bottomInset(compact)]}>
619
+ <ReplyBox theme={theme} compact={compact} agentName="the Overseer" placeholder={compact ? "Ask or give a task" : "Ask or give a task: “assign reviewers on all ready PRs”"} hint={null} focus={focus}
620
+ onSend={async message => { await agent.handle!.send(message); inbox.refresh(); }} />
621
+ </View>}>
619
622
  {o.state === "error" && <Text accessibilityRole="alert" style={[t.body, { color: c.statusDanger }]}>{o.line}</Text>}
620
623
  {tail.steps === null ? <Spinner color={c.foregroundMuted} size={12} label="Loading the conversation" />
621
624
  : tail.steps.length === 0 ? <Text style={t.meta}>{tail.error ? `Couldn't load the conversation: ${tail.error}` : "Nothing yet. Ask it what needs you, or give it a task for one of your agents."}</Text>
@@ -625,12 +628,7 @@ function OverseerPane({ theme, compact, o, focus = 0, pending = null, agentId, m
625
628
  {(o.state === "running" || pending && tail.steps && !tail.steps.some(x => x.kind === "you" && x.text.trim() === pending)) && <Spinner color={c.foregroundMuted} size={12} label="The Overseer is working" />}
626
629
  {/* Its open ask, after the conversation that led to it. Only something Tom can act on; never "No ask stated". */}
627
630
  {b && agentId && (b.kind === "decision" && b.decisions.some(d => d.options.length) || b.kind === "action") ? <BriefCard {...({ embedded: true, item: { data: b }, theme, layout: { compact }, agentId, deps: deps.briefDeps } as unknown as Parameters<typeof BriefCard>[0])} /> : null}
628
- </ScrollView>
629
- {agentId && <View style={[{ borderTopWidth: 1, borderTopColor: c.border }, bottomInset(compact)]}>
630
- <ReplyBox theme={theme} compact={compact} agentName="the Overseer" placeholder={compact ? "Ask or give a task" : "Ask or give a task: “assign reviewers on all ready PRs”"} hint={null} focus={focus}
631
- onSend={async message => { await agent.handle!.send(message); inbox.refresh(); }} />
632
- </View>}
633
- </View>;
631
+ </DockedPane>;
634
632
  }
635
633
 
636
634
  /** "Codex · GPT-6-Luna · low" → "GPT-6-Luna · low": the button already says it's the Overseer's provider change. */
@@ -1,8 +1,8 @@
1
1
  import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";
2
- import { Animated, Easing, Keyboard, Platform, View, type ViewStyle, type ScrollView as NativeScrollView } from "react-native";
2
+ import { Animated, Easing, Platform, View, type ViewStyle, type ScrollView as NativeScrollView } from "react-native";
3
3
  import { Pressable, Text } from "./text";
4
4
  import { useRpc, useSettings } from "@getpaseo/plugin/client";
5
- import { Icon, ScrollView, copyText, useToast } from "@getpaseo/plugin/client/ui";
5
+ import { Icon, copyText, useToast } from "@getpaseo/plugin/client/ui";
6
6
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
7
7
  import { followSettingsRpc, onboardingChecksRpc, onboardingRpc, setFollowSettingsRpc, setOnboardingRpc } from "../shared/contracts";
8
8
  import { displayPreferences } from "../shared/display";
@@ -10,6 +10,7 @@ import { ONBOARDING_STEPS, autoSendWrites, checksSummary, type Check, type Onboa
10
10
  import { Button, IconButton, errorText, text, type Theme } from "./kit";
11
11
  import { ReviewerSettings } from "./reviewers";
12
12
  import { JobRows } from "./job-rows";
13
+ import { DockedPane } from "./docked-pane";
13
14
  import { SETUP_ORDER } from "../shared/job-rows";
14
15
  import { ShippingStep } from "./shipping";
15
16
  import { UpdatesStep } from "./updates";
@@ -77,7 +78,6 @@ export function Setup({ theme, compact, view, deps }: { theme: Theme; compact: b
77
78
  } });
78
79
  const skip = () => move.mutate({ action: "skip" }, { onSuccess: () => toast.show("Setup skipped. Set it up any time from Follow-up settings, General.") });
79
80
  const last = index === ONBOARDING_STEPS.length - 1;
80
- const keyboard = useKeyboardUp(compact);
81
81
  const failing = step === "checks" && checks.data ? checksSummary(checks.data.checks).state === "fail" : false;
82
82
 
83
83
  const body = step === "intro" ? <IntroStep theme={theme} compact={compact} follow={follow.data ?? null} />
@@ -100,22 +100,13 @@ export function Setup({ theme, compact, view, deps }: { theme: Theme; compact: b
100
100
  };
101
101
  const column: ViewStyle = { width: "100%", maxWidth: 560, alignSelf: "center", paddingHorizontal: compact ? 16 : 24 };
102
102
 
103
- return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
104
- <View style={[column, { flexDirection: "row", alignItems: "center", gap: 12, paddingTop: compact ? 8 : 20, paddingBottom: 8 }]}>
103
+ return <DockedPane compact={compact} scrollRef={scroll} style={{ backgroundColor: c.surface0 }} contentContainerStyle={{ paddingBottom: 24 }}
104
+ header={<View style={[column, { flexDirection: "row", alignItems: "center", gap: 12, paddingTop: compact ? 8 : 20, paddingBottom: 8 }]}>
105
105
  <Progress theme={theme} index={index} onPick={i => i < index && go(ONBOARDING_STEPS[i])} />
106
106
  <Button theme={theme} compact={compact} kind="ghost" title="Skip setup" accessibilityHint="Leaves setup. Every setting keeps its current value." onPress={skip} disabled={move.isPending} />
107
- </View>
108
- <ScrollView ref={scroll} style={{ flex: 1 }} contentContainerStyle={{ paddingBottom: 24 }} keyboardShouldPersistTaps="handled">
109
- <StepFade key={step} style={[column, { gap: compact ? 14 : 16, paddingTop: compact ? 8 : 20 }]}>
110
- <View style={{ gap: 6 }}>
111
- <Text accessibilityRole="header" style={{ color: c.foreground, fontSize: 20, lineHeight: 26, fontWeight: "600" }}>{TITLES[step]}</Text>
112
- <Text style={[t.body, { color: c.foregroundMuted, maxWidth: 520 }]}>{lead[step]}</Text>
113
- </View>
114
- {body}
115
- </StepFade>
116
- </ScrollView>
117
- {/* While typing a reviewer on a phone the bar steps aside, so Continue never sits over the keyboard. */}
118
- {!keyboard && <View style={[{ borderTopWidth: 1, borderTopColor: c.border, backgroundColor: c.surface0, paddingTop: 12 }, bottomPad(compact)]}>
107
+ </View>}
108
+ // While typing a reviewer on a phone the bar steps aside, so Continue never sits over the keyboard (DockedPane).
109
+ dock={({ yields }) => !yields && <View style={[{ borderTopWidth: 1, borderTopColor: c.border, backgroundColor: c.surface0, paddingTop: 12 }, bottomPad(compact)]}>
119
110
  <View style={[column, { flexDirection: "row", alignItems: "center", gap: 8 }]}>
120
111
  {index > 0 && (compact
121
112
  ? <IconButton theme={theme} compact icon="ChevronLeft" label="Back" onPress={() => go(ONBOARDING_STEPS[index - 1])} />
@@ -126,29 +117,15 @@ export function Setup({ theme, compact, view, deps }: { theme: Theme; compact: b
126
117
  title={last ? "Finish" : failing ? "Continue anyway" : "Continue"} loading={last && move.isPending}
127
118
  onPress={() => last ? finish() : go(ONBOARDING_STEPS[index + 1])} />
128
119
  </View>
129
- </View>}
130
- </View>;
131
- }
132
-
133
- /** Phones: whether the on-screen keyboard is up (native events; on the web, the visual viewport shrinking). */
134
- function useKeyboardUp(compact: boolean): boolean {
135
- const [up, setUp] = useState(false);
136
- useEffect(() => {
137
- if (!compact) return;
138
- if (Platform.OS === "web") {
139
- type Viewport = { height: number; addEventListener(e: "resize", f: () => void): void; removeEventListener(e: "resize", f: () => void): void };
140
- const vv = (globalThis as { visualViewport?: Viewport }).visualViewport;
141
- const win = globalThis as unknown as { innerHeight: number };
142
- if (!vv) return;
143
- const check = () => setUp(win.innerHeight - vv.height > 150);
144
- vv.addEventListener("resize", check);
145
- return () => vv.removeEventListener("resize", check);
146
- }
147
- const show = Keyboard.addListener(Platform.OS === "ios" ? "keyboardWillShow" : "keyboardDidShow", () => setUp(true));
148
- const hide = Keyboard.addListener(Platform.OS === "ios" ? "keyboardWillHide" : "keyboardDidHide", () => setUp(false));
149
- return () => { show.remove(); hide.remove(); };
150
- }, [compact]);
151
- return up;
120
+ </View>}>
121
+ <StepFade key={step} style={[column, { gap: compact ? 14 : 16, paddingTop: compact ? 8 : 20 }]}>
122
+ <View style={{ gap: 6 }}>
123
+ <Text accessibilityRole="header" style={{ color: c.foreground, fontSize: 20, lineHeight: 26, fontWeight: "600" }}>{TITLES[step]}</Text>
124
+ <Text style={[t.body, { color: c.foregroundMuted, maxWidth: 520 }]}>{lead[step]}</Text>
125
+ </View>
126
+ {body}
127
+ </StepFade>
128
+ </DockedPane>;
152
129
  }
153
130
 
154
131
  /** "2 of 5" and one short segment per step, drawn like the stack bar but in neutral ink: progress isn't a PR state. */
@@ -18,6 +18,7 @@ import { activity, type ActivityTone } from "../shared/activity";
18
18
  import { Button, Card, CardRow, Chip, FoldRow, IconButton, SubmitScope, errorText, text, type Theme } from "./kit";
19
19
  import { Spinner } from "./motion";
20
20
  import { NoteLink } from "./brief";
21
+ import { PRIMARY_FORM } from "./dock";
21
22
  import { mergedColor, tint, withAlpha, type Colors } from "./theme";
22
23
  import { overviewKey, workspaceKey } from "./keys";
23
24
  import { PrLinksProvider, RichText } from "./rich-text";
@@ -273,7 +274,6 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
273
274
  {open && (draft.canAddNote || draft.canRemoveNote) && <NoteLink icon={draft.canAddNote ? "MessageSquarePlus" : "X"} label={draft.canAddNote ? "Add note" : "Remove note"}
274
275
  a11y={draft.canAddNote ? `Add a note for the agent about ${q.id}` : `Remove the note on ${q.id}`} disabled={run.isPending} c={c} compact={compact}
275
276
  onPress={() => { if (draft.canAddNote) setNoteOpen(true); else { setWords(""); setNoteOpen(false); } }} />}
276
- {open && !pinned && input}
277
277
  </View>;
278
278
  const actions = (open || q.answer && answerHasActions(q.answer.delivery)) && <View style={{ gap: 6 }}>
279
279
  <View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8 }}>
@@ -309,13 +309,20 @@ export function QuestionBody({ workspace: w, question: q, theme, compact, now =
309
309
  <Text style={t.small}>More below</Text>
310
310
  </View>}
311
311
  </View>
312
- {showInput && input}
313
- {actions}
312
+ {/* The field with its Send: kept on screen together while typing (a-focused-field-and-its-send-stay-in-view). */}
313
+ <View {...PRIMARY_FORM} style={{ gap: 10 }}>
314
+ {showInput && input}
315
+ {actions}
316
+ </View>
314
317
  </SubmitScope>;
315
318
  }
316
319
  return <SubmitScope enabled={submittable} onSubmit={() => open ? quick("send") : run.mutate("send")} style={{ gap: dense ? 10 : 14 }}>
317
320
  {body}
318
- {actions}
321
+ {/* The field with its Send: kept on screen together while typing (a-focused-field-and-its-send-stay-in-view). */}
322
+ <View {...PRIMARY_FORM} style={{ gap: dense ? 10 : 14 }}>
323
+ {open && input}
324
+ {actions}
325
+ </View>
319
326
  {!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>}
320
327
  </SubmitScope>;
321
328
  }
package/index.server.ts CHANGED
@@ -14,6 +14,11 @@ import { agentSetSpec, developerSetSpec } from "./server/spec";
14
14
  import type { PluginServerContext, PluginHandlerContext, PluginHookContext, PluginSessionOpenRequest } from "@getpaseo/plugin/server";
15
15
  import type { PluginRpcContract, PluginSubscriptionContract } from "@getpaseo/plugin";
16
16
  import { ValueFeed, WorkspacesFeed } from "./server/feeds";
17
+ import { ContextRequests } from "./server/context-requests";
18
+ import { agentContextPrompt, deckCards, overseerContextPrompt } from "./shared/catch-up";
19
+ import { buildHome } from "./shared/home";
20
+ import { needsYou } from "./shared/attention";
21
+ import type { SortMode } from "./shared/sort";
17
22
  import type { ZodType, output as zOutput } from "zod";
18
23
  import { mkdir, writeFile } from "node:fs/promises";
19
24
  import { isTimeZone } from "./shared/inbox";
@@ -207,6 +212,8 @@ export default function contribute(server: PluginServerContext) {
207
212
  prWorkflow.onChanged = () => { void store.snapshot().then(state => store.onChanged(state)).catch(() => undefined); };
208
213
  const browser = new BrowserBridge();
209
214
  const reviewerStore = new ReviewerConfigStore(directory);
215
+ const contextRequests = new ContextRequests(directory);
216
+ contextRequests.onChange = () => feeds.home();
210
217
  // an-ack-never-waits-on-the-disk (server/write-behind.ts): these files save behind the reply; one still failing after
211
218
  // SURFACE_AFTER attempts shows as the worker's error line until it lands.
212
219
  const writeHealth = new WriteHealth();
@@ -472,7 +479,7 @@ export default function contribute(server: PluginServerContext) {
472
479
  await inbox.adoptOutbox().catch(error => console.warn(`[follow-up] couldn't move the answer outbox onto the queue: ${error instanceof Error ? error.message : String(error)}`));
473
480
  queue.start();
474
481
  })().catch(() => { loadError = "Follow-up could not start. Check its saved state and worker lock."; });
475
- for (const file of [store, reviewerStore.persist, agentSettings.persist, prWorkflow.persist, inbox.store.persist]) file.health = writeHealth;
482
+ for (const file of [store, contextRequests.persist, reviewerStore.persist, agentSettings.persist, prWorkflow.persist, inbox.store.persist]) file.health = writeHealth;
476
483
  const requireReady = async () => { if (waiting) throw new Error(waiting); await ready; if (loadError || stopped) throw new Error(loadError ?? "Follow-up is stopping"); };
477
484
  // 1.4.0-beta.2: Follow-up's tools per agent: natively through Paseo's MCP when the host serves plugin tools,
478
485
  // otherwise the stdio bridge for this launch only. FOLLOW_UP_TOOLS tells the hooks which names the agent has.
@@ -929,6 +936,55 @@ export default function contribute(server: PluginServerContext) {
929
936
  handle(rpc.overseerStatusRpc, async () => { await requireReady(); return overseerStatus(); });
930
937
  handle(rpc.overseerStartRpc, async (_input, { paseo }) => { await requireReady(); seen(paseo); await overseer!.start(paseo as unknown as OverseerPaseo); return overseerStatus(); });
931
938
  handle(rpc.overseerAskRpc, async ({ text }, { paseo }) => { await requireReady(); seen(paseo); await overseer!.ask(paseo as unknown as OverseerPaseo, text); return overseerStatus(); });
939
+ // Catch up's More context: the ask is recorded and answered at once; the Overseer's send runs after the reply (it may
940
+ // start the Overseer), the agent's goes through the message queue (invariant 36). Asking the card's agent may wake
941
+ // it: the developer asked, the one exception to never-wake (invariant 1). The Overseer reads without waking anyone.
942
+ handle(rpc.contextAskRpc, async (input, context) => {
943
+ await requireReady();
944
+ const actor = actorOf(context);
945
+ if (actor.kind === "agent" && input.target === "agent" && input.agentId === actor.agentId) throw new Error("ask_context asks another agent about its card for the developer; explain your own ask in your reply.");
946
+ if (input.target === "agent" && !input.agentId) throw new Error("This card has no agent to ask. Ask the Overseer instead.");
947
+ const out = await contextRequests.ask(input, actorBy(actor), input.target === "agent" ? input.agentId : (await overseerStatus().catch(() => null))?.agentId ?? null);
948
+ if (!out.fresh) return out;
949
+ const r = out.request;
950
+ if (input.target === "agent") enqueueMessage(input.agentId!, agentContextPrompt(r), r.id, "developer");
951
+ else {
952
+ const paseo = (context as { paseo?: unknown }).paseo;
953
+ const workspace = input.workspaceId ? (await gateway.directory.read().catch(() => null))?.workspaces.find(w => w.id === input.workspaceId)?.name ?? "a workspace" : "a workspace";
954
+ void (async () => {
955
+ try {
956
+ if (!await overseerOn()) throw new Error("The Overseer is off. Turn it on in Settings → Agents, or ask the agent.");
957
+ const s = await overseer!.ask(paseo as unknown as OverseerPaseo, overseerContextPrompt(r, workspace));
958
+ if (s.agentId) await contextRequests.setAskedOf(r.id, s.agentId);
959
+ } catch (error) { await contextRequests.fail(r.id, error instanceof Error ? error.message : String(error)); }
960
+ })();
961
+ }
962
+ return out;
963
+ });
964
+ // Built when read (a-derived-view-is-built-when-read), from state the worker holds: no daemon request but the
965
+ // directory's cached workspace list.
966
+ handle(rpc.catchUpDeckRpc, async () => {
967
+ await requireReady();
968
+ const [state, list, paseoList, priorities, settings, context] = await Promise.all([store.snapshot(), inbox.list(), paseoWorkspaces(), priorityStore.read(), inboxSettings(), contextRequests.list()]);
969
+ const tracked = state.workspaces.filter(w => w.enable_tracking);
970
+ const byId = new Map(tracked.map(w => [w.id, w]));
971
+ const model = buildHome({ rows: list.rows, tracked, paseo: paseoList, now: Date.now(), sort: (settings as { home_sort?: SortMode }).home_sort, priorities });
972
+ const cards = deckCards({ model, rows: list.rows, items: id => { const w = byId.get(id); return w ? needsYou(w) : []; } });
973
+ return { cards: cards.map(c => {
974
+ const r = [...context].reverse().find(x => x.cardKey === c.key);
975
+ 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,
976
+ 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 };
977
+ }) };
978
+ });
979
+ handle(rpc.contextListRpc, async ({ workspaceId }) => ({ requests: await contextRequests.list(workspaceId ? { workspaceId } : {}) }));
980
+ handle(rpc.contextReplyRpc, async ({ agentId, requestId, text }) => {
981
+ await requireReady();
982
+ const r = (await contextRequests.list()).find(x => x.id === requestId);
983
+ // The Overseer may have been (re)started by the ask itself, so its id is checked now, not when it was asked.
984
+ if (r?.target === "overseer" && r.askedOf !== agentId && (await overseerStatus().catch(() => null))?.agentId === agentId) await contextRequests.setAskedOf(r.id, agentId);
985
+ await contextRequests.reply(requestId, agentId, text);
986
+ return { ok: true };
987
+ });
932
988
  handle(rpc.overseerRestartRpc, async (_input, { paseo }) => { await requireReady(); seen(paseo); await overseer!.restart(paseo as unknown as OverseerPaseo); return overseerStatus(); });
933
989
  // The provider catalog for Settings → Agents: read only when that screen asks, cached ten minutes.
934
990
  const providerCatalog = new ProviderCatalog(async () => {
@@ -1303,9 +1359,9 @@ export default function contribute(server: PluginServerContext) {
1303
1359
  const [items, rank, overseerView] = await Promise.all([priorityStore.read(), ranker!.status(), overseerStatus()]);
1304
1360
  // The worker's live resources change every tick: the client reads those once when Home opens (follow.usage).
1305
1361
  const meters = governor.allowsExtras() ? await usage.read() : NO_USAGE;
1306
- return { priorities: items, rank, overseer: overseerView, usage: { available: meters.available, source: meters.source, accounts: meters.accounts }, usageLive: !!usageWatch };
1362
+ return { priorities: items, rank, overseer: overseerView, usage: { available: meters.available, source: meters.source, accounts: meters.accounts }, usageLive: !!usageWatch, context: await contextRequests.list() };
1307
1363
  },
1308
- key: v => JSON.stringify([v.priorities, v.rank, v.overseer, usageKey(v.usage), v.usageLive]),
1364
+ key: v => JSON.stringify([v.priorities, v.rank, v.overseer, usageKey(v.usage), v.usageLive, v.context]),
1309
1365
  // Smart Session's files are watched only while someone looks at Home (server/usage.ts watch()).
1310
1366
  onFirst: () => { usageWatch = usage.watch(() => void homeFeed.changed()); },
1311
1367
  onLast: () => { usageWatch?.close(); usageWatch = null; },
@@ -1449,6 +1505,8 @@ export default function contribute(server: PluginServerContext) {
1449
1505
  // handlers below read the patched rows.
1450
1506
  server.on("agent.turn_started", async event => gateway.directory.turnStarted(event.agent, event.turnId)),
1451
1507
  server.on("agent.turn_ended", async event => gateway.directory.turnEnded(event.agent, event.outcome)),
1508
+ server.on("agent.turn_started", async event => contextRequests.turnStarted(event.agent.id)),
1509
+ server.on("agent.turn_ended", async event => contextRequests.turnEnded(event.agent.id)),
1452
1510
  server.on("agent.permission_requested", async event => gateway.directory.permissionRequested(event.agent.id, event.request as { id?: string })),
1453
1511
  server.on("agent.permission_resolved", async event => gateway.directory.permissionResolved(event.agent.id, event.requestId)),
1454
1512
  server.on("agent.archived", async event => gateway.directory.agentArchived(event.agent.id, event.archivedAt)),
@@ -1570,7 +1628,7 @@ export default function contribute(server: PluginServerContext) {
1570
1628
  // One deadline for every wait (worker-stop-never-waits-on-a-stuck-pass, server/teardown.ts): start-up and the work
1571
1629
  // in flight may be stuck on a daemon or CLI that never answers. Work that ends inside the deadline is saved; what
1572
1630
  // outlives it can't write, because the store closes before the lock is released.
1573
- await stopWorker({ files: [reviewerStore, agentSettings, prWorkflow, queue], ready, hooks: hooksStarted ? () => agentHooks.stop() : undefined, actions, closeConnections, engine, store, inbox: inbox.store, unlock });
1631
+ await stopWorker({ files: [contextRequests, reviewerStore, agentSettings, prWorkflow, queue], ready, hooks: hooksStarted ? () => agentHooks.stop() : undefined, actions, closeConnections, engine, store, inbox: inbox.store, unlock });
1574
1632
  })();
1575
1633
  return stop;
1576
1634
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "paseo-follow-up",
3
3
  "private": false,
4
- "version": "2.2.0-beta.1",
4
+ "version": "2.2.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": [
@@ -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"] 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", "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)];