paseo-follow-up 2.4.0-beta.8 → 2.4.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/brief-since.tsx +29 -16
- package/client/compass-settings.tsx +26 -3
- package/client/home-data.ts +3 -3
- package/client/home-view.ts +4 -2
- package/client/home.tsx +7 -6
- package/client/morning-brief-settings.tsx +4 -2
- package/client/new.tsx +6 -2
- package/index.server.ts +46 -6
- package/package.json +1 -1
- package/server/agent-hook.mjs +4 -0
- package/server/agent-parity.ts +2 -2
- package/server/compass.ts +109 -12
- package/server/dispatch.ts +9 -2
- package/server/hook-source.ts +4 -0
- package/server/linear-queue.ts +8 -4
- package/server/mcp-source.ts +3 -3
- package/server/mcp.mjs +3 -3
- package/server/overseer.ts +6 -1
- package/shared/brief-since.ts +28 -4
- package/shared/compass.ts +22 -1
- package/shared/contracts.ts +14 -7
- package/shared/dispatch.ts +20 -14
- package/shared/new-view.ts +27 -3
- package/shared/nobody.ts +233 -0
- package/shared/overseer.ts +9 -2
package/client/brief-since.tsx
CHANGED
|
@@ -4,9 +4,10 @@ import { Pressable, Text } from "./text";
|
|
|
4
4
|
import { useRpc } from "@getpaseo/plugin/client";
|
|
5
5
|
import { Icon, ScrollView, useToast } from "@getpaseo/plugin/client/ui";
|
|
6
6
|
import { dispatchActionsRpc, dispatchRpc, linearQueueRpc, sweepQueueRpc } from "../shared/contracts";
|
|
7
|
-
import { changeChip, openedLine, queueRowMeta,
|
|
7
|
+
import { changeChip, openedLine, queueRowMeta, sinceBlock, type SinceChange, type SinceLine } from "../shared/brief-since";
|
|
8
|
+
import { nobodyRow, type CompassSince } from "../shared/nobody";
|
|
9
|
+
import { PriorityLine } from "./home-chrome";
|
|
8
10
|
import { actionIcon, stateIcon } from "../shared/new-view";
|
|
9
|
-
import type { RaisedNeed } from "../shared/linear-queue";
|
|
10
11
|
import type { QueueNeeds } from "./home-view";
|
|
11
12
|
import type { DispatchAction } from "../shared/dispatch";
|
|
12
13
|
import { errorText } from "../shared/errors";
|
|
@@ -34,7 +35,9 @@ type QueueViewData = {
|
|
|
34
35
|
groups: { priority: number; name: string; count: number; issues: QueueIssueRow[] }[];
|
|
35
36
|
counts: { all: number; noWorkspace: number; changed: number };
|
|
36
37
|
more: number;
|
|
37
|
-
raised:
|
|
38
|
+
raised: unknown[];
|
|
39
|
+
/** What Compass heard since the same point: the one Since block (design §8). */
|
|
40
|
+
compass?: CompassSince | null;
|
|
38
41
|
};
|
|
39
42
|
type Filter = "all" | "no-workspace" | "changed";
|
|
40
43
|
type Nav = { openWorkspace(i: { workspaceId: string }): void } | undefined;
|
|
@@ -122,7 +125,7 @@ export function SinceBlock({ theme, compact, openQueue, onStarted, navigation, r
|
|
|
122
125
|
<Text style={t.meta}>Couldn't read it: {error}</Text>
|
|
123
126
|
</View>;
|
|
124
127
|
// Nothing swept yet and nothing to say: no block (a fresh install before its first sweep, or no Linear).
|
|
125
|
-
if (!view || (!view.status.sweptAt && !view.changes.length)) return null;
|
|
128
|
+
if (!view || (!view.status.sweptAt && !view.changes.length && !view.compass?.lines.length)) return null;
|
|
126
129
|
const now = Date.now();
|
|
127
130
|
const b = sinceBlock(view, now, view.status.timeZone, raised);
|
|
128
131
|
const link = <Pressable accessibilityRole="link" accessibilityLabel={`Open your Linear queue: ${b.link}`} onPress={openQueue} hitSlop={compact ? 0 : 8}
|
|
@@ -262,39 +265,49 @@ export function QueueScreen({ theme, compact, onHome, navigation }: { theme: The
|
|
|
262
265
|
</ScrollView>;
|
|
263
266
|
}
|
|
264
267
|
|
|
265
|
-
// ----------
|
|
268
|
+
// ---------- "Nobody's on it": raised issues and urgent Compass asks in Needs you ----------
|
|
266
269
|
|
|
267
270
|
/**
|
|
268
|
-
*
|
|
269
|
-
*
|
|
271
|
+
* "Nobody's on it" rows (nobody-s-on-it-is-needs-you), shaped like Home's: an amber ↑ for a raise or the compass glyph
|
|
272
|
+
* for a Compass ask, the key, "Nobody's on it", then "title · due Thu"; under it the reason
|
|
273
|
+
* line with its source, as Home's rows carry AI priority's ("Dana: renewal call Thu · Compass", "Linear Raised Low →
|
|
274
|
+
* Urgent"). One Start… (New on the issue, `{why}` filled) and the two-click Remove of every Needs-you item (invariant
|
|
275
|
+
* 59: follow.dismiss `issue`, which takes the raise and every Compass ask on it).
|
|
270
276
|
*/
|
|
271
|
-
export function
|
|
277
|
+
export function NobodyRows({ theme, compact, data, onDismissed }: { theme: Theme; compact: boolean; data: QueueNeeds; onDismissed: () => void }) {
|
|
272
278
|
const c = theme.colors;
|
|
273
279
|
// The same Dismiss as every Needs-you item (invariant 59): two clicks in place, one toast with Undo. The worker
|
|
274
280
|
// pushes the new list on the home feed; without the feed, onDismissed reads it once.
|
|
275
281
|
const dismiss = useDismiss(onDismissed);
|
|
276
282
|
const now = Date.now();
|
|
277
|
-
return <>{data.
|
|
278
|
-
const row =
|
|
283
|
+
return <>{data.needs.map(r => {
|
|
284
|
+
const row = nobodyRow(r, now, data.timeZone);
|
|
285
|
+
const first = r.reasons[0]!;
|
|
286
|
+
const reason = <PriorityLine reason={first.line} source={first.from === "compass" ? { kind: "compass", label: first.source } : { kind: "linear", label: first.source }} c={c} size={compact ? 12 : 11} lines={compact ? 2 : 1} />;
|
|
279
287
|
const when = age(r.at, now);
|
|
280
288
|
const start = <BarBtn c={c} compact={compact} small primary={false} disabled={false} b={{ name: "Start…", icon: "Play", key: null }} onPress={() => openNew({ source: r.key })} />;
|
|
281
289
|
const x = <DismissX theme={theme} compact={compact} label={`Remove ${r.key}`} onPress={() => dismiss({ issue: r.key })} />;
|
|
290
|
+
const glyph = <View style={{ width: compact ? 18 : 16, alignItems: "center", paddingTop: compact ? 2 : 0 }}><Icon name={row.compass ? "Compass" : "ArrowUp"} size={compact ? 17 : 15} color={c.statusWarning} /></View>;
|
|
282
291
|
return <RevealScope key={r.key} accessibilityLabel={`Needs you: ${row.label}`}
|
|
283
|
-
style={{ flexDirection: "row", alignItems: compact ? "flex-start" : "center", gap: 10, minHeight: compact ? 56 :
|
|
292
|
+
style={{ flexDirection: "row", alignItems: compact ? "flex-start" : "center", gap: 10, minHeight: compact ? 56 : 46, paddingLeft: compact ? 14 : 16, paddingRight: compact ? 16 : 16, paddingVertical: compact ? 12 : 5,
|
|
284
293
|
borderLeftWidth: 2, borderLeftColor: withAlpha(c.statusWarning, 0.9), ...(compact ? { borderBottomWidth: 1, borderBottomColor: withAlpha(c.border, 0.6) } : {}) }}>
|
|
285
|
-
|
|
294
|
+
{glyph}
|
|
286
295
|
{compact ? <View style={{ flex: 1, minWidth: 0, gap: 2 }}>
|
|
287
296
|
<View style={{ flexDirection: "row", alignItems: "flex-start", gap: 8 }}>
|
|
288
297
|
<Text numberOfLines={1} style={{ flex: 1, minWidth: 0, color: c.foreground, fontSize: 15, lineHeight: 20, fontWeight: "500" }}>{row.title}</Text>
|
|
289
298
|
<Text style={{ color: c.foregroundMuted, fontSize: 12, paddingTop: 2, fontVariant: ["tabular-nums"] }}>{when}</Text>
|
|
290
299
|
</View>
|
|
291
300
|
<Text numberOfLines={2} style={{ color: c.foregroundMuted, fontSize: 13, lineHeight: 18 }}><Text style={{ color: c.statusWarning, fontWeight: "600" }}>{row.word}</Text> · {row.line}</Text>
|
|
301
|
+
{reason}
|
|
292
302
|
<View style={{ flexDirection: "row", alignItems: "center", justifyContent: "space-between", marginTop: 6 }}>{start}{x}</View>
|
|
293
303
|
</View> : <>
|
|
294
|
-
<View style={{ flex: 1, minWidth: 0,
|
|
295
|
-
<
|
|
296
|
-
|
|
297
|
-
|
|
304
|
+
<View style={{ flex: 1, minWidth: 0, gap: 1 }}>
|
|
305
|
+
<View style={{ flexDirection: "row", alignItems: "center", gap: 10, minWidth: 0 }}>
|
|
306
|
+
<Text numberOfLines={1} style={{ flexShrink: 0, color: c.foreground, fontSize: 13, fontWeight: "500" }}>{row.title}</Text>
|
|
307
|
+
<Text numberOfLines={1} style={{ flexShrink: 0, color: c.statusWarning, fontSize: 12 }}>{row.word}</Text>
|
|
308
|
+
<Text numberOfLines={1} style={{ flex: 1, minWidth: 0, color: c.foregroundMuted, fontSize: 12, marginLeft: -10 }}>{"\u00a0· "}{row.line}</Text>
|
|
309
|
+
</View>
|
|
310
|
+
<View style={{ paddingRight: 40 }}>{reason}</View>
|
|
298
311
|
</View>
|
|
299
312
|
{start}
|
|
300
313
|
<View style={{ flexDirection: "row", alignItems: "center", gap: 4 }}>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState, type ReactNode } from "react";
|
|
2
2
|
import { ActivityIndicator, TextInput, View } from "react-native";
|
|
3
3
|
import { openExternalUrl, useRpc } from "@getpaseo/plugin/client";
|
|
4
|
-
import { Icon, SettingsSection, useToast } from "@getpaseo/plugin/client/ui";
|
|
4
|
+
import { Icon, SettingsSection, SettingsSelect, useToast } from "@getpaseo/plugin/client/ui";
|
|
5
5
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
6
|
import { Pressable, Text } from "./text";
|
|
7
7
|
import { Button, SubmitScope, Switch, errorText, text, type Theme } from "./kit";
|
|
@@ -10,13 +10,14 @@ import { raised, tint } from "./theme";
|
|
|
10
10
|
import { compassFindRpc, compassRpc, readCompassRpc, setCompassRpc } from "../shared/contracts";
|
|
11
11
|
import {
|
|
12
12
|
COMPASS, ROLES, ROLE_INFO, type CompassChange, type CompassNote, type CompassSource, type GlossaryEntry, type Place, type Preset, type PresetView, type Role, type Who,
|
|
13
|
+
CADENCES, type CompassSettings,
|
|
13
14
|
} from "../shared/compass";
|
|
14
15
|
import { type PlanView } from "../shared/morning-brief";
|
|
15
16
|
|
|
16
17
|
export const compassKey = ["follow-up", "compass"];
|
|
17
18
|
|
|
18
19
|
type View_ = {
|
|
19
|
-
settings: { sources: CompassSource[]; instructions: string; glossary: GlossaryEntry[] };
|
|
20
|
+
settings: { sources: CompassSource[]; instructions: string; glossary: GlossaryEntry[]; cadence: CompassSettings["cadence"]; routing: CompassSettings["routing"] };
|
|
20
21
|
readers: { conversation: boolean; history: boolean };
|
|
21
22
|
presets: PresetView[];
|
|
22
23
|
blocked: string | null;
|
|
@@ -75,7 +76,7 @@ export function CompassSection({ theme, compact, after }: { theme: Theme; compac
|
|
|
75
76
|
const [editing, setEditing] = useState<string | "new" | null>(null);
|
|
76
77
|
const data = query.data;
|
|
77
78
|
const full = !!data && data.settings.sources.length >= COMPASS.sources;
|
|
78
|
-
return <SettingsSection title="What sets your priorities" info="Everything AI priority, Needs you and the brief read, in one list. The people you add are read each workday morning: Follow-up keeps a note of each priority with their words, and AI priority ranks your work by it. Only the people you pick are read, only through read-only tools, and a fast model with no tools reads them. Nothing is ever posted. Agents can set it up too.">
|
|
79
|
+
return <SettingsSection title="What sets your priorities" info="Everything AI priority, Needs you and the brief read, in one list. The people you add are read each workday morning, and during the day while Follow-up is open: Follow-up keeps a note of each priority with their words, and AI priority ranks your work by it. Only the people you pick are read, only through read-only tools, and a fast model with no tools reads them. Nothing is ever posted. Agents can set it up too.">
|
|
79
80
|
{query.isPending && <ActivityIndicator accessibilityLabel="Loading Compass" color={c.foregroundMuted} style={{ alignSelf: "flex-start", marginVertical: 8 }} />}
|
|
80
81
|
{query.error && <Text style={[t.meta, { color: c.statusWarning }]}>{`Couldn't load Compass: ${errorText(query.error)}`}</Text>}
|
|
81
82
|
{data?.blocked && <Line icon="TriangleAlert" tone={c.statusWarning} text={data.blocked} theme={theme} compact={compact} />}
|
|
@@ -114,6 +115,28 @@ export function CompassReading({ theme, compact }: { theme: Theme; compact: bool
|
|
|
114
115
|
</SettingsSection>;
|
|
115
116
|
}
|
|
116
117
|
|
|
118
|
+
/** The daytime read's choices (the-brief-has-one-timer): only while Follow-up is open, on workdays 08:00-20:00. */
|
|
119
|
+
const CADENCE_LABEL: Record<CompassSettings["cadence"], string> = { off: "Mornings only", "1h": "Every hour", "2h": "Every 2 hours", "4h": "Every 4 hours" };
|
|
120
|
+
/** Where Compass's suggestions go: an issue nobody started that a source said matters. */
|
|
121
|
+
const ROUTING_LABEL: Record<CompassSettings["routing"]["suggestions"], string> = { "needs-you-and-new": "Needs you and New", "new-only": "New only", off: "Off" };
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* When's Compass rows: the daytime read (Off, 1, 2 or 4 h while the app is open) and where suggestions go. The same
|
|
125
|
+
* `set_compass` change an agent sends ({ cadence }, { routing }).
|
|
126
|
+
*/
|
|
127
|
+
export function CompassWhen({ theme, compact, part }: { theme: Theme; compact: boolean; part: "cadence" | "routing" }) {
|
|
128
|
+
const query = useCompassView(); const change = useCompassChange();
|
|
129
|
+
const data = query.data;
|
|
130
|
+
if (!data || !data.settings.sources.length) return null;
|
|
131
|
+
const s = data.settings;
|
|
132
|
+
// One row each, so the settings card draws its divider between them.
|
|
133
|
+
if (part === "cadence") return <SettingsSelect label="During the day" hint={s.cadence === "off" ? "Compass reads once, at the morning read. Read now reads at once." : "While Follow-up is open, on workdays from 08:00 to 20:00. Each read takes only what's new, and nothing is read while the app is closed."}
|
|
134
|
+
value={s.cadence} disabled={change.isPending} options={CADENCES.map(v => ({ value: v, label: CADENCE_LABEL[v] }))} onValueChange={cadence => change.mutate({ cadence: cadence as CompassSettings["cadence"] })} />;
|
|
135
|
+
return <SettingsSelect label="Issues nobody's on" hint={s.routing.suggestions === "off" ? "Compass notes still reorder AI priority; none suggests an issue." : s.routing.suggestions === "new-only" ? "Listed first in New's My issues, with why." : `A strong ask due within ${s.routing.urgentWithinWorkdays} workdays goes to Needs you, from a source with Needs you on. The rest are first in New.`}
|
|
136
|
+
value={s.routing.suggestions} disabled={change.isPending} options={(Object.keys(ROUTING_LABEL) as CompassSettings["routing"]["suggestions"][]).map(v => ({ value: v, label: ROUTING_LABEL[v] }))}
|
|
137
|
+
onValueChange={suggestions => change.mutate({ routing: { suggestions: suggestions as CompassSettings["routing"]["suggestions"] } })} />;
|
|
138
|
+
}
|
|
139
|
+
|
|
117
140
|
/** "Read 09:02 · 3 notes live · 1 not matched to a workspace", or why the last read failed. */
|
|
118
141
|
function statusLine(v: View_): string {
|
|
119
142
|
if (v.running) return "Reading…";
|
package/client/home-data.ts
CHANGED
|
@@ -84,9 +84,9 @@ export function useHomeModel(sources: HomeSources): HomeModel {
|
|
|
84
84
|
const now = useMinute();
|
|
85
85
|
// The machine-wide auto-send hold: a string, so a usage poll that changes nothing else doesn't rebuild the model.
|
|
86
86
|
const hold = useSyncExternalStore(extras.subscribe, () => autoSendHold(extras.usage().resources, Date.now()), () => null);
|
|
87
|
-
//
|
|
88
|
-
// strip and brief line and the sidebar badge (client/live.tsx) agree (
|
|
89
|
-
const raised = useSyncExternalStore(extras.subscribe, () => extras.queue().
|
|
87
|
+
// "Nobody's on it" rows (raised issues and urgent Compass asks) count in Needs you, the worker's one number (home
|
|
88
|
+
// feed), so Home's header, strip and brief line and the sidebar badge (client/live.tsx) agree (nobody-s-on-it-is-needs-you).
|
|
89
|
+
const raised = useSyncExternalStore(extras.subscribe, () => extras.queue().needs.length, () => 0);
|
|
90
90
|
const compass = useSyncExternalStore(extras.subscribe, extras.compass, extras.compass);
|
|
91
91
|
return useMemo(() => buildHome({ rows: inbox.rows(), tracked: live.all(), paseo: paseo.all(), now: Date.now(), sort, priorities, hidden: overseer ? [overseer] : [], hold, compass, raised }), [a, b, c, now, sort, priorities, inbox, live, paseo, overseer, hold, raised, compass]);
|
|
92
92
|
}
|
package/client/home-view.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { NO_USAGE, USAGE_POLL_MS, type Usage } from "../shared/usage";
|
|
|
12
12
|
import type { z } from "zod";
|
|
13
13
|
|
|
14
14
|
export type QueueNeeds = z.infer<typeof queueNeedsSchema>;
|
|
15
|
-
const NO_QUEUE: QueueNeeds = {
|
|
15
|
+
const NO_QUEUE: QueueNeeds = { needs: [], timeZone: "UTC", revision: "" };
|
|
16
16
|
import { onVisible, whileVisible } from "./visibility";
|
|
17
17
|
import type { ContextRequest } from "../shared/catch-up";
|
|
18
18
|
|
|
@@ -108,7 +108,9 @@ export function createHomeExtras(client: PluginClientContext) {
|
|
|
108
108
|
const pollHome = () => together([
|
|
109
109
|
poll(PRIORITY_POLL_MS, async () => {
|
|
110
110
|
const answer = await client.rpc(prioritiesRpc, {});
|
|
111
|
-
|
|
111
|
+
// Set every store the answer carries: `a() || b()` skips b once a changed (a Compass line hid Nobody's on it).
|
|
112
|
+
const compassMoved = setCompass(answer.compass), queueMoved = setQueue(answer.queue);
|
|
113
|
+
const queued = compassMoved || queueMoved;
|
|
112
114
|
if (JSON.stringify(answer.items) === JSON.stringify(priorities)) return queued;
|
|
113
115
|
priorities = answer.items; return true;
|
|
114
116
|
}),
|
package/client/home.tsx
CHANGED
|
@@ -22,7 +22,7 @@ import { ReferencesLine } from "./linked";
|
|
|
22
22
|
import { WhyItMatters } from "./why-it-matters";
|
|
23
23
|
import { bottomGap, bottomInset, Button, focusSoon, IconButton, space, text, type Theme } from "./kit";
|
|
24
24
|
import { DispatchRows, NewHost, openNew, useNewOpen } from "./new";
|
|
25
|
-
import {
|
|
25
|
+
import { NobodyRows, QueueScreen, SinceBlock } from "./brief-since";
|
|
26
26
|
import type { NewKey } from "./search-key";
|
|
27
27
|
import { DockedPane } from "./docked-pane";
|
|
28
28
|
import type { DockState } from "./dock";
|
|
@@ -115,11 +115,12 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
|
|
|
115
115
|
const { inbox } = deps.sources;
|
|
116
116
|
const c = theme.colors;
|
|
117
117
|
const compact = layout.compact;
|
|
118
|
-
//
|
|
119
|
-
// feed; the model counts them (model.raised) and they head the group. Catch up's deck and
|
|
118
|
+
// "Nobody's on it" (raised issues, urgent Compass asks) are Needs-you items with no workspace row. The worker sends
|
|
119
|
+
// them on the home feed; the model counts them (model.raised) and they head the group. Catch up's deck and
|
|
120
|
+
// model.needs stay workspaces.
|
|
120
121
|
const model = useHomeModel(deps.sources);
|
|
121
122
|
const queue = useSyncExternalStore(deps.sources.extras.subscribe, deps.sources.extras.queue, deps.sources.extras.queue);
|
|
122
|
-
const raisedKeys = useMemo(() => new Set(queue.
|
|
123
|
+
const raisedKeys = useMemo(() => new Set(queue.needs.map(r => r.key)), [queue.needs]);
|
|
123
124
|
const omnibox = useOmnibox(model, deps.sources);
|
|
124
125
|
const searchKey = deps.searchKey;
|
|
125
126
|
const anywhereKey = useSyncExternalStore(searchKey?.subscribe ?? noSubscribe, searchKey?.label ?? noLabel, searchKey?.label ?? noLabel);
|
|
@@ -212,7 +213,7 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
|
|
|
212
213
|
setSelected(OVERSEER_KEY); setReplyFocus(n => n + 1);
|
|
213
214
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
214
215
|
}, [params.ask]);
|
|
215
|
-
const briefLine = [pane.counts.needs ? `${pane.counts.needs} need you` : "Nothing needs you", pane.counts.sending ? `${pane.counts.sending} sending` : "", pane.away.count ? `${pane.away.count} done while away` : ""].filter(Boolean).join(" · ");
|
|
216
|
+
const briefLine = [pane.counts.needs ? `${pane.counts.needs} need you` : "Nothing needs you", pane.counts.sending ? `${pane.counts.sending} sending` : "", pane.away.count ? `${pane.away.count} done while away` : "", queue.heard ?? ""].filter(Boolean).join(" · ");
|
|
216
217
|
|
|
217
218
|
const openFull = useCallback((s: Workstream) => {
|
|
218
219
|
if (!navigation) return;
|
|
@@ -286,7 +287,7 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
|
|
|
286
287
|
<View style={{ flexDirection: "row", paddingHorizontal: 6 }}><VersionMark theme={theme} touch openSettings={deps.openSettings} /></View></View>
|
|
287
288
|
: undefined}
|
|
288
289
|
// Phones: the setup offer goes after the Needs-you group when there is one, so the first ask stays high.
|
|
289
|
-
raised={<
|
|
290
|
+
raised={<NobodyRows theme={theme} compact={compact} data={queue} onDismissed={deps.sources.extras.refreshQueue} />}
|
|
290
291
|
afterNeeds={compact && model.needs > 0 && props.onboarding?.offer ? <SetupOffer theme={theme} compact view={props.onboarding} /> : undefined}
|
|
291
292
|
emptyAction={compact ? <Button theme={theme} compact kind="secondary" icon="Settings" title="Project settings" onPress={deps.openSettings} /> : undefined}
|
|
292
293
|
top={<ListTop theme={theme} dense={compact} title={compact ? undefined : <ListHeader theme={theme} compact={compact} onSettings={deps.openSettings} onKeys={() => setKeysOpen(v => !v)} onStats={openStats} onNew={() => openNew()} newLabel={newLabel} />}>
|
|
@@ -6,7 +6,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
|
6
6
|
import { Pressable, Text } from "./text";
|
|
7
7
|
import { Button, IconButton, Switch, errorText, text, type Theme } from "./kit";
|
|
8
8
|
import { raised, tint, withAlpha } from "./theme";
|
|
9
|
-
import { CompassReading, CompassSection, compassKey } from "./compass-settings";
|
|
9
|
+
import { CompassReading, CompassSection, CompassWhen, compassKey } from "./compass-settings";
|
|
10
10
|
import { briefSettingsRpc, briefSourcesRpc, setBriefPlanRpc, setBriefSettingsRpc, setBriefSourcesRpc } from "../shared/contracts";
|
|
11
11
|
import { ASK_COST, inputLabel, inputRole, type BriefSource, type SourcesChange, type SourcesView } from "../shared/brief-sources";
|
|
12
12
|
import { ASK } from "../shared/ask";
|
|
@@ -383,10 +383,12 @@ function WhenSection({ view, theme, compact }: { view: BriefSettingsView; theme:
|
|
|
383
383
|
const times = [...new Set([...SWEEP_TIMES, q.sweepAt])].sort();
|
|
384
384
|
const zoneFrom = view.clock.zoneFrom === "setting" ? "set here" : view.clock.zoneFrom === "device" ? "this device's" : "the host's";
|
|
385
385
|
const usual = defaultWorkdays(view.clock.timeZone);
|
|
386
|
-
return <SettingsSection title="When" info="The morning read: Compass reads its sources, the Linear queue is swept and mcpproxy is asked again, once each workday at this time. The brief's changes are counted from your last read.">
|
|
386
|
+
return <SettingsSection title="When" info="The morning read: Compass reads its sources, the Linear queue is swept and mcpproxy is asked again, once each workday at this time. During the day Compass reads again while Follow-up is open. The brief's changes are counted from your last read.">
|
|
387
387
|
<SettingsCard>
|
|
388
388
|
<SettingsSelect label="Morning read at" hint={`On workdays, in ${view.clock.timeZone}.`} value={q.sweepAt} disabled={change.isPending}
|
|
389
389
|
options={times.map(v => ({ value: v, label: v }))} onValueChange={sweepAt => change.mutate({ sweepAt })} />
|
|
390
|
+
<CompassWhen theme={theme} compact={compact} part="cadence" />
|
|
391
|
+
<CompassWhen theme={theme} compact={compact} part="routing" />
|
|
390
392
|
<SettingsSelect label="Changes since" hint={q.since === "read" ? "What moved since you last read the brief; before your first read, since the last workday's sweep." : "What moved since the last workday's sweep, however often you look."}
|
|
391
393
|
value={q.since} disabled={change.isPending} options={[{ value: "read", label: "Your last read" }, { value: "workday", label: "Your last workday" }]} onValueChange={since => change.mutate({ since })} />
|
|
392
394
|
</SettingsCard>
|
package/client/new.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PriorityLine } from "./home-chrome";
|
|
1
2
|
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore, type ReactNode } from "react";
|
|
2
3
|
import { Platform, View, useWindowDimensions, type ViewStyle } from "react-native";
|
|
3
4
|
import { Pressable, Text } from "./text";
|
|
@@ -294,12 +295,15 @@ function ListRow({ row, selected, c, compact, onPress, chevron }: { row: NewRow;
|
|
|
294
295
|
const routeColor = row.route.tone === "warn" ? c.statusWarning : row.route.tone === "open" && !row.taken ? c.foreground : c.foregroundMuted;
|
|
295
296
|
// A taken issue (inside the open fold) is muted: it's somebody's work already, and ↵ opens its workspace.
|
|
296
297
|
const ink = row.taken && !selected ? c.foregroundMuted : c.foreground;
|
|
297
|
-
|
|
298
|
+
const meta = [row.state, row.age].filter(Boolean).join(" · ");
|
|
299
|
+
return <Pressable accessibilityRole="button" accessibilityState={{ selected }} accessibilityLabel={`${row.key} ${row.title}, ${row.reason ? `${row.reason}, from Compass, ` : ""}${row.state ? `${row.state}, ` : ""}${row.taken ? `already in ${row.route.text}` : row.route.text}`} onPress={onPress} style={base}>
|
|
298
300
|
<View style={{ paddingTop: 2 }}><Icon name={row.icon} size={15} color={row.icon === "Contrast" && !row.taken ? c.statusWarning : c.foregroundMuted} /></View>
|
|
299
301
|
<View style={{ flex: 1, minWidth: 0, gap: 2 }}>
|
|
300
302
|
<Text numberOfLines={compact ? 2 : 1} style={{ color: ink, fontSize: compact ? 15 : 13 }}><Text style={{ color: c.foregroundMuted }}>{row.key} </Text>{row.title}</Text>
|
|
303
|
+
{/* A Compass suggestion says why it's on top, as Home's rows do (the reason line with its source). */}
|
|
304
|
+
{!!row.reason && <PriorityLine reason={row.reason} source={{ kind: "compass", label: "Compass" }} c={c} size={12} lines={compact ? 2 : 1} />}
|
|
301
305
|
<View style={{ flexDirection: "row", alignItems: "center", gap: 4, flexWrap: "wrap" }}>
|
|
302
|
-
<Text style={{ color: c.foregroundMuted, fontSize: 12 }}>{
|
|
306
|
+
{!!meta && <Text style={{ color: c.foregroundMuted, fontSize: 12 }}>{meta} · </Text>}
|
|
303
307
|
{row.route.tone === "open" && <Icon name="ExternalLink" size={12} color={routeColor} />}
|
|
304
308
|
<Text numberOfLines={1} style={{ color: routeColor, fontSize: 12, flexShrink: 1 }}>{row.route.text}</Text>
|
|
305
309
|
{row.tag && <Text style={{ color: c.foregroundMuted, fontSize: 12 }}> · {row.tag}</Text>}
|
package/index.server.ts
CHANGED
|
@@ -115,6 +115,8 @@ import { matchPlan } from "./shared/morning-brief";
|
|
|
115
115
|
import { askSource } from "./server/ask";
|
|
116
116
|
import { BriefSources } from "./server/brief-sources";
|
|
117
117
|
import { Compass, CompassStore } from "./server/compass";
|
|
118
|
+
import { heardWords, nobodyNeeds } from "./shared/nobody";
|
|
119
|
+
import { COMPASS } from "./shared/compass";
|
|
118
120
|
import { sourceDirectory } from "./server/source-tools";
|
|
119
121
|
import { AboutService, AboutStore, liveSources, rootHistory, type AboutContext } from "./server/about";
|
|
120
122
|
import { LinkedService, LinkedStore, liveLinkedSources, type LinkResult } from "./server/linked";
|
|
@@ -308,6 +310,9 @@ export default function contribute(server: PluginServerContext) {
|
|
|
308
310
|
let morningBrief: MorningBrief | null = null;
|
|
309
311
|
let briefSources: BriefSources | null = null;
|
|
310
312
|
let compass: Compass | null = null;
|
|
313
|
+
// Whether an app client is open (set once the home feed exists), and when a 0.15 client last polled priorities.
|
|
314
|
+
let appOpen: () => boolean = () => false;
|
|
315
|
+
let polledAt = 0;
|
|
311
316
|
// Who sent a message (server/inbox-classifier.ts): the inbox and the Overseer's new-workspace gate read one ledger.
|
|
312
317
|
const senderSources = fileSources(paseoHome, async () => (await inbox.store.snapshot()).ledger);
|
|
313
318
|
const inbox: Inbox = new Inbox(directory, {
|
|
@@ -902,11 +907,17 @@ export default function contribute(server: PluginServerContext) {
|
|
|
902
907
|
});
|
|
903
908
|
handle(rpc.dismissQuestionRpc, async ({ workspaceId, questionId, undo }, context) => { await requireReady(); return engine.dismiss(workspaceId, questionId, !!undo, actorOf(context)); });
|
|
904
909
|
// dismissing-anything-in-needs-you-sends-the-agent-nothing: one path for every kind; only records change.
|
|
905
|
-
handle(rpc.dismissRpc, async ({ workspaceId, key, agentId, issue, undo }, context) => {
|
|
910
|
+
handle(rpc.dismissRpc, async ({ workspaceId, key, agentId, issue, compass: note, undo }, context) => {
|
|
906
911
|
await requireReady();
|
|
907
912
|
const actor = actorOf(context);
|
|
908
913
|
if (agentId) return inbox.dismiss(agentId, !!undo, actor);
|
|
909
|
-
if (
|
|
914
|
+
if (note) return compass!.removeSuggestion(note, !!undo);
|
|
915
|
+
// "Nobody's on it" is one row per issue: its Remove takes the queue's raise and every Compass ask on it.
|
|
916
|
+
if (issue) {
|
|
917
|
+
const asks = await compass?.removeIssue(issue, !!undo).catch(() => 0) ?? 0;
|
|
918
|
+
try { return await linearQueue!.dismissRaise(issue, !!undo); }
|
|
919
|
+
catch (error) { if (asks) return { name: issue.toUpperCase() }; throw error; }
|
|
920
|
+
}
|
|
910
921
|
return store.mutateWorkspace(workspaceId!, w => {
|
|
911
922
|
const r = undo ? undoDismissItem(w, key!, actor) : dismissItem(w, key!, actor, Date.now());
|
|
912
923
|
w.updatedAt = new Date().toISOString();
|
|
@@ -1059,6 +1070,14 @@ export default function contribute(server: PluginServerContext) {
|
|
|
1059
1070
|
const overseerOn = async () => (await inboxSettings()).enable_overseer !== false;
|
|
1060
1071
|
overseer = new Overseer({ directory, store, inbox, enqueue: enqueueMessage, sources: senderSources, priorities: priorityStore, workspaces: paseoWorkspaces, enabled: overseerOn, paseoHome, tight: async () => !governor.allowsBackground(),
|
|
1061
1072
|
windowMs: async () => activeWindowMs(await store.snapshot()), agent: () => agentSettings.role("overseer"),
|
|
1073
|
+
// Compass's digest block (compass-without-the-overseer): built only with the digest, only when a note is live.
|
|
1074
|
+
compass: async () => {
|
|
1075
|
+
const notes = await compass?.digest() ?? [];
|
|
1076
|
+
if (!notes.length) return [];
|
|
1077
|
+
const read = (await morningBrief?.planView().catch(() => null))?.read ?? null;
|
|
1078
|
+
const plan = read ? `This week's plan: ${read.title ?? "untitled"}, ${read.items} items${read.withoutIssue ? `, ${read.withoutIssue} without an issue` : ""}` : null;
|
|
1079
|
+
return plan ? [plan, ...notes] : notes;
|
|
1080
|
+
},
|
|
1062
1081
|
// Harness override only (isolated test daemons): "provider/model" wins over Settings → Agents.
|
|
1063
1082
|
provider: process.env.FOLLOW_UP_OVERSEER_PROVIDER || undefined,
|
|
1064
1083
|
// Starts the run and answers at once (a tool call shares the plugin RPC timeout); the current ranking comes along.
|
|
@@ -1312,6 +1331,8 @@ export default function contribute(server: PluginServerContext) {
|
|
|
1312
1331
|
};
|
|
1313
1332
|
const dispatcher = new DispatchService({
|
|
1314
1333
|
store: new DispatchStore(directory),
|
|
1334
|
+
// Compass's suggestions for New's My issues and `{why}` (compass is set before New is ever opened).
|
|
1335
|
+
compass: async () => compass ? compass.suggestions() : [],
|
|
1315
1336
|
images: imageStore,
|
|
1316
1337
|
linear: linearIssues,
|
|
1317
1338
|
github: async (kind, repo, number) => {
|
|
@@ -1446,7 +1467,12 @@ export default function contribute(server: PluginServerContext) {
|
|
|
1446
1467
|
onChange: () => feeds.home(),
|
|
1447
1468
|
log: line => console.warn(line),
|
|
1448
1469
|
});
|
|
1449
|
-
|
|
1470
|
+
// The brief's one Since block (design §8): the queue's changes and what Compass heard, against the same stored point.
|
|
1471
|
+
handle(rpc.linearQueueRpc, async ({ filter, since, limit, open }) => {
|
|
1472
|
+
await requireReady();
|
|
1473
|
+
const view = open ? await linearQueue!.open() : await linearQueue!.view({ filter, since, limit });
|
|
1474
|
+
return { ...view, compass: compass ? await compass.since(view.since).catch(() => null) : null };
|
|
1475
|
+
});
|
|
1450
1476
|
handle(rpc.sweepQueueRpc, async ({ wait }, context) => { await requireReady(); return linearQueue!.sweepNow(actorOf(context).kind === "agent" ? "agent" : "manual", wait === false ? 0 : undefined); });
|
|
1451
1477
|
handle(rpc.briefSettingsRpc, async () => { await requireReady(); return morningBrief!.view(); });
|
|
1452
1478
|
handle(rpc.setBriefSettingsRpc, async input => { await requireReady(); return morningBrief!.setQueue(input); });
|
|
@@ -1525,7 +1551,8 @@ export default function contribute(server: PluginServerContext) {
|
|
|
1525
1551
|
issueWorkspace: key => holders.get(key.toUpperCase())?.workspaceId ?? null,
|
|
1526
1552
|
};
|
|
1527
1553
|
},
|
|
1528
|
-
allowed: chatAllowed, tight: () => !governor.allowsBackground(),
|
|
1554
|
+
allowed: chatAllowed, tight: () => !governor.allowsBackground(), appOpen: () => appOpen(),
|
|
1555
|
+
issues: async () => (await linearQueue?.needs())?.issues ?? new Map(),
|
|
1529
1556
|
// Tell the agent (compass-reaches-an-agent-only-by-a-click): one queued message to the workspace's main agent.
|
|
1530
1557
|
tell: async (workspaceId, text, by) => {
|
|
1531
1558
|
const w = (await store.snapshot()).workspaces.find(x => x.id === workspaceId && !x.archived);
|
|
@@ -1723,7 +1750,7 @@ export default function contribute(server: PluginServerContext) {
|
|
|
1723
1750
|
// The directory's agent list (metadata only): a claim never loads or refreshes the main agent.
|
|
1724
1751
|
agentInfo: async agentId => { const row = gateway.directory.cached(agentId) ?? (await gateway.directory.read()).agents.find(r => r.agent.id === agentId)?.agent; return row ? { status: row.status, activeTurn: row.activeTurn, pendingPermissions: row.pendingPermissions, archivedAt: row.archivedAt } : null; } });
|
|
1725
1752
|
// 0.15 polls priorities once a minute; the raised issues (Q8) ride the same answer instead of a read of their own.
|
|
1726
|
-
handle(rpc.prioritiesRpc, async () => ({ items: await priorityStore.read(), queue: await
|
|
1753
|
+
handle(rpc.prioritiesRpc, async () => { polledAt = Date.now(); return { items: await priorityStore.read(), queue: await nobodyOnIt(), compass: await compass?.lines().catch(() => undefined) }; });
|
|
1727
1754
|
// The chat's created cards: the engine's directory snapshot as it stands (never waits on or asks the daemon, wakes
|
|
1728
1755
|
// nothing) and the store. Before the engine's first read the cards just show no state yet.
|
|
1729
1756
|
// The engine's snapshot as it stands, plus remembered archived agents; ids it lacks are looked up once, not awaited.
|
|
@@ -1803,6 +1830,16 @@ export default function contribute(server: PluginServerContext) {
|
|
|
1803
1830
|
const workspacesFeed = new WorkspacesFeed(listCache, () => store.snapshot(), () => waiting ?? loadError ?? hookError ?? writeHealth.message() ?? engine.error);
|
|
1804
1831
|
const inboxFeed = new ValueFeed({ read: async () => { await requireReady(); return inboxAnswer({ ...await inbox.list(), error: inboxError }, undefined); }, key: v => v.etag ?? JSON.stringify(v) });
|
|
1805
1832
|
let usageWatch: { close(): void } | null = null;
|
|
1833
|
+
// "Nobody's on it" (nobody-s-on-it-is-needs-you): the queue's raises and Compass's urgent asks, one row per issue,
|
|
1834
|
+
// from what the worker holds (linear-queue.json, compass.json): one count for every surface, never a read of its own.
|
|
1835
|
+
const nobodyOnIt = async () => {
|
|
1836
|
+
const q = await linearQueue?.needs().catch(() => undefined);
|
|
1837
|
+
const list = compass ? await compass.suggestions(q?.issues).catch(() => []) : [];
|
|
1838
|
+
if (!q && !list.length) return undefined;
|
|
1839
|
+
const heard = compass ? heardWords(await compass.since(q?.since ?? null, list).catch(() => ({ from: [], lines: [], heard: 0 }))) : null;
|
|
1840
|
+
return { needs: nobodyNeeds(q?.raised ?? [], list), timeZone: q?.timeZone ?? (await briefClock()).timeZone, heard,
|
|
1841
|
+
revision: `${q?.revision ?? ""}|${list.map(x => `${x.note}${x.urgent ? "!" : ""}`).join(",")}` };
|
|
1842
|
+
};
|
|
1806
1843
|
// New's dispatches for Home's row: the last hour's (the client drops what its clock says is over), at most 5.
|
|
1807
1844
|
const homeDispatches = async () => (await dispatcher.records().catch(() => [])).filter(r => Date.now() - Date.parse(r.at) < 3_600_000).slice(0, 5);
|
|
1808
1845
|
const homeFeed = new ValueFeed({
|
|
@@ -1811,7 +1848,7 @@ export default function contribute(server: PluginServerContext) {
|
|
|
1811
1848
|
const [items, rank, overseerView] = await Promise.all([priorityStore.read(), ranker!.status(), overseerStatus()]);
|
|
1812
1849
|
// The worker's live resources change every tick: the client reads those once when Home opens (follow.usage).
|
|
1813
1850
|
const meters = governor.allowsExtras() ? await usage.read() : NO_USAGE;
|
|
1814
|
-
return { priorities: items, rank, overseer: overseerView, usage: { available: meters.available, source: meters.source, accounts: meters.accounts }, usageLive: !!usageWatch, context: await contextRequests.list(), prStats: await prStats.anyOn(), dispatches: await homeDispatches(), queue: await
|
|
1851
|
+
return { priorities: items, rank, overseer: overseerView, usage: { available: meters.available, source: meters.source, accounts: meters.accounts }, usageLive: !!usageWatch, context: await contextRequests.list(), prStats: await prStats.anyOn(), dispatches: await homeDispatches(), queue: await nobodyOnIt(), compass: await compass?.lines().catch(() => undefined) };
|
|
1815
1852
|
},
|
|
1816
1853
|
key: v => JSON.stringify([v.priorities, v.rank, v.overseer, usageKey(v.usage), v.usageLive, v.context, v.prStats, v.dispatches, v.queue, v.compass]),
|
|
1817
1854
|
// Smart Session's files are watched only while someone looks at Home (server/usage.ts watch()).
|
|
@@ -1822,6 +1859,9 @@ export default function contribute(server: PluginServerContext) {
|
|
|
1822
1859
|
feeds.workspaces = () => void workspacesFeed.changed();
|
|
1823
1860
|
feeds.inbox = () => void inboxFeed.changed();
|
|
1824
1861
|
feeds.home = () => void homeFeed.changed();
|
|
1862
|
+
// The daytime read runs only while an app client is open (the-brief-has-one-timer): a subscriber on the home feed,
|
|
1863
|
+
// or on Paseo 0.15 (no subscriptions) a priorities poll in the last 2 minutes.
|
|
1864
|
+
appOpen = () => homeFeed.size > 0 || Date.now() - polledAt < COMPASS.openWindowMs;
|
|
1825
1865
|
priorityStore.onWrite = feeds.home;
|
|
1826
1866
|
ranker!.onRunChange = feeds.home;
|
|
1827
1867
|
let displayOff: (() => void) | null = null;
|
package/package.json
CHANGED
package/server/agent-hook.mjs
CHANGED
|
@@ -103,6 +103,10 @@ export function overseerDigest(file, seen, now = Date.now(), { needsMax = 20, ch
|
|
|
103
103
|
if (gone.length) lines.push(`- ${gone.length} workspace${gone.length === 1 ? "" : "s"} archived or removed: ${gone.slice(0, 5).join(", ")}`);
|
|
104
104
|
}
|
|
105
105
|
if (resting.length) lines.push(`Resting (${resting.length}; agents likely unloaded, sending wakes them): ${resting.slice(0, restingMax).map(r => r.line).join("; ")}${resting.length > restingMax ? `; …${resting.length - restingMax} more: workstreams()` : ""}`);
|
|
106
|
+
// Compass (compass-without-the-overseer): what the developer's priority sources said, as notes. compass lists them all
|
|
107
|
+
// with links; compass_note pins, edits, unpins or tells (dry run, then confirm).
|
|
108
|
+
const compass = Array.isArray(file?.compass) ? file.compass.filter(l => typeof l === "string") : [];
|
|
109
|
+
if (compass.length) { lines.push("Compass (the developer's priority sources, as notes: who · until · what · where · note id; compass for all, compass_note to act):"); for (const l of compass) lines.push(`- ${l}`); }
|
|
106
110
|
let text = "";
|
|
107
111
|
for (const l of lines) { if (text.length + l.length + 1 > chars) { text += "- …truncated: use workstreams()\n"; break; } text += l + "\n"; }
|
|
108
112
|
return { text: text.trimEnd(), seen: { at: now, rows: Object.fromEntries(all.map(r => [r.id, r.hash])) } };
|
package/server/agent-parity.ts
CHANGED
|
@@ -114,8 +114,8 @@ export const RPC_TOOLS: readonly RpcTool[] = [
|
|
|
114
114
|
toRpc: a => ({ workspaceId: a.workspaceId, questionId: a.questionId, choice: a.choice, words: a.words, action: "send", ...(a.images ? { images: a.images } : {}) }) },
|
|
115
115
|
// dismissing-anything-in-needs-you-sends-the-agent-nothing: the small x on every Needs-you item and brief.
|
|
116
116
|
{ name: "dismiss_item", rpc: "follow.dismiss", kind: "planned",
|
|
117
|
-
input: z.strictObject({ workspaceId: id.optional(), key: z.string().min(1).max(400).optional(), agentId: id.optional(), issue: z.string().max(30).optional(), undo: z.boolean().optional(), ...confirm }),
|
|
118
|
-
toRpc: a => ({ ...(a.agentId ? { agentId: a.agentId } : a.issue ? { issue: a.issue } : { workspaceId: a.workspaceId, key: a.key }), ...(a.undo ? { undo: true } : {}) }),
|
|
117
|
+
input: z.strictObject({ workspaceId: id.optional(), key: z.string().min(1).max(400).optional(), agentId: id.optional(), issue: z.string().max(30).optional(), compass: z.string().min(1).max(80).optional(), undo: z.boolean().optional(), ...confirm }),
|
|
118
|
+
toRpc: a => ({ ...(a.agentId ? { agentId: a.agentId } : a.issue ? { issue: a.issue } : a.compass ? { compass: a.compass } : { workspaceId: a.workspaceId, key: a.key }), ...(a.undo ? { undo: true } : {}) }),
|
|
119
119
|
guard: (a, caller) => a.agentId === caller ? "dismiss_item dismisses another agent's brief for the developer; your own brief is the developer's to dismiss." : null },
|
|
120
120
|
{ name: "dismiss_question", rpc: "follow.dismiss-question", kind: "planned",
|
|
121
121
|
input: z.strictObject({ workspaceId: id.optional(), questionId: z.string().regex(/^Q\d+$/).optional(), undo: z.boolean().optional(), ...confirm }),
|