paseo-follow-up 2.1.0 → 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/CHANGELOG.md +1 -1
- package/README.md +6 -2
- package/client/brief.tsx +8 -6
- package/client/dock.ts +70 -0
- package/client/docked-pane.tsx +108 -0
- package/client/home.tsx +27 -29
- package/client/onboarding.tsx +17 -40
- package/client/questions.tsx +35 -18
- package/client/release-notes.tsx +3 -2
- package/client/updates.tsx +7 -5
- package/index.server.ts +65 -7
- package/package.json +1 -1
- package/server/agent-actions.ts +1 -1
- package/server/agent-hook.mjs +1 -1
- package/server/agent-parity.ts +10 -1
- package/server/context-requests.ts +111 -0
- package/server/daemon.ts +20 -13
- package/server/delivery.ts +8 -0
- package/server/hook-source.ts +1 -1
- package/server/mcp-source.ts +9 -5
- package/server/mcp.mjs +9 -5
- package/server/message-queue.ts +34 -12
- package/server/transcript.ts +56 -0
- package/server/updater.ts +7 -6
- package/server/updates.ts +4 -2
- package/shared/attention.ts +3 -2
- package/shared/catch-up.ts +249 -0
- package/shared/changelog.ts +28 -22
- package/shared/chat.ts +1 -1
- package/shared/contracts.ts +15 -0
- package/shared/questions.ts +54 -0
- package/shared/queue.ts +28 -3
- package/shared/status-invariants.ts +14 -0
- package/shared/updates.ts +11 -3
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
// Catch up: everything in Needs you, one card at a time (docs/design/catch-up.md).
|
|
2
|
+
// Pure: the deck's cards and their order come from Home's model, the inbox rows and the workspaces already on the
|
|
3
|
+
// client, so opening Catch up costs no read of its own. The session's order (skips, More context parking a
|
|
4
|
+
// workspace, its return) is a pure state machine here, so the client, the agent tool and the tests agree.
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import type { HomeModel, Workstream } from "./home";
|
|
7
|
+
import type { InboxRow } from "./inbox";
|
|
8
|
+
import type { NeedItem } from "./attention";
|
|
9
|
+
|
|
10
|
+
export type CardKind = "permission" | "question" | "item" | "brief" | "finished";
|
|
11
|
+
/**
|
|
12
|
+
* One card: one thing to act on. A workspace with two questions and a merge is three cards, kept together so its
|
|
13
|
+
* context is read once. `key` is stable across refreshes, so the deck can tell a card that went away from a new one.
|
|
14
|
+
*/
|
|
15
|
+
export type DeckCard = { key: string; kind: CardKind; s: Workstream; questionId?: string; item?: NeedItem };
|
|
16
|
+
|
|
17
|
+
type Source = {
|
|
18
|
+
model: Pick<HomeModel, "groups">;
|
|
19
|
+
rows: readonly Pick<InboxRow, "agentId" | "needs" | "brief">[];
|
|
20
|
+
/** The workspace's Needs-you items in block order (stopped questions first), from `needsYou`. */
|
|
21
|
+
items: (workspaceId: string) => readonly NeedItem[];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const BRIEF_CARD_KINDS = ["decision", "action", "review"];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The deck, in Home's Needs-you order: the order the developer already sees in the list (blocking asks first, then
|
|
28
|
+
* decisions, then finished turns; inside a tier the chosen sort, AI priority included). Inside a workstream: a pending
|
|
29
|
+
* permission, then each open question, then every other item, then the agent's own ask when nothing above speaks for it.
|
|
30
|
+
*/
|
|
31
|
+
export function deckCards({ model, rows, items }: Source): DeckCard[] {
|
|
32
|
+
const needs = model.groups.find(g => g.id === "needs")?.items ?? [];
|
|
33
|
+
const out: DeckCard[] = [];
|
|
34
|
+
for (const s of needs) {
|
|
35
|
+
const row = s.agentId ? rows.find(r => r.agentId === s.agentId) ?? null : null;
|
|
36
|
+
const reasons = row?.needs?.reasons.map(r => r.reason) ?? [];
|
|
37
|
+
const before = out.length;
|
|
38
|
+
if (reasons.includes("permission")) out.push({ key: `${s.key}|permission`, kind: "permission", s });
|
|
39
|
+
const asks = s.workspaceId ? items(s.workspaceId) : [];
|
|
40
|
+
for (const item of asks) {
|
|
41
|
+
if (item.kind === "question") out.push({ key: `${s.key}|${item.questionId}`, kind: "question", s, questionId: item.questionId, item });
|
|
42
|
+
else out.push({ key: `${s.key}|${item.key}`, kind: "item", s, item });
|
|
43
|
+
}
|
|
44
|
+
const brief = row?.brief as { kind?: string; questionIds?: string[] } | null | undefined;
|
|
45
|
+
const pointsAtQuestion = !!brief?.questionIds?.length && out.slice(before).some(c => c.kind === "question");
|
|
46
|
+
if (brief && !pointsAtQuestion && BRIEF_CARD_KINDS.includes(brief.kind ?? "")) out.push({ key: `${s.key}|brief`, kind: "brief", s });
|
|
47
|
+
if (out.length === before) out.push({ key: `${s.key}|finished`, kind: "finished", s });
|
|
48
|
+
}
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The workstream a card key belongs to (`agent:<id>` or `ws:<id>`): cards of one workstream move together. */
|
|
53
|
+
export const groupOf = (key: string) => key.slice(0, key.indexOf("|") < 0 ? key.length : key.indexOf("|"));
|
|
54
|
+
|
|
55
|
+
/** What happened to a card this session. `gone`: it left Needs you elsewhere (answered on another device, the agent moved on). */
|
|
56
|
+
export type Outcome = "done" | "skipped" | "later" | "gone";
|
|
57
|
+
export type SessionStats = { done: number; skipped: number; later: number; gone: number; waiting: number };
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* A Catch up session. `order` is every card key seen this session (done ones stay, so Back works); `pos` is the card
|
|
61
|
+
* on screen, `order.length` once nothing is left. `parked` maps a workstream waiting for More context to its request.
|
|
62
|
+
*/
|
|
63
|
+
export type Session = { order: string[]; pos: number; outcomes: Record<string, Outcome>; parked: Record<string, string> };
|
|
64
|
+
|
|
65
|
+
export const startSession = (cards: readonly Pick<DeckCard, "key">[]): Session => ({ order: cards.map(c => c.key), pos: 0, outcomes: {}, parked: {} });
|
|
66
|
+
|
|
67
|
+
/** Still to act on: not done, later or gone. Skipped cards stay open; they come round again after the rest. */
|
|
68
|
+
const open = (s: Session, key: string) => { const o = s.outcomes[key]; return !o || o === "skipped"; };
|
|
69
|
+
/** A card forward moves may land on: open, and not in a workstream waiting for context. */
|
|
70
|
+
const landable = (s: Session, key: string) => open(s, key) && !s.parked[groupOf(key)];
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The next card after `from`: the next landable one in order, else the first skipped one from the start (a second
|
|
74
|
+
* pass), else `order.length` (finished). Never returns `from` itself unless it is the only one left.
|
|
75
|
+
*/
|
|
76
|
+
export function nextPos(s: Session, from: number): number {
|
|
77
|
+
for (let i = from + 1; i < s.order.length; i++) if (landable(s, s.order[i]) && s.outcomes[s.order[i]] !== "skipped") return i;
|
|
78
|
+
for (let i = 0; i < s.order.length; i++) if (i !== from && landable(s, s.order[i])) return i;
|
|
79
|
+
return from < s.order.length && landable(s, s.order[from]) ? from : s.order.length;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Back: the card before, whatever happened to it (done cards show what was sent; a parked one shows it is asking). */
|
|
83
|
+
export const prevPos = (s: Session): number => Math.max(0, Math.min(s.pos, s.order.length) - 1);
|
|
84
|
+
|
|
85
|
+
/** Records what happened to the card on screen and moves on. */
|
|
86
|
+
export function settle(s: Session, outcome: Outcome, key = s.order[s.pos]): Session {
|
|
87
|
+
if (key === undefined) return s;
|
|
88
|
+
const next = { ...s, outcomes: { ...s.outcomes, [key]: outcome } };
|
|
89
|
+
return s.order[s.pos] === key ? { ...next, pos: nextPos(next, s.pos) } : next;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* More context was asked about the card on screen: its workstream waits (every card of it, so its context is read
|
|
94
|
+
* once when it returns) and the deck moves on to the next workstream at once. Tom, 2026-11-17: "Getting more context
|
|
95
|
+
* may take a bit, so make it skip to the next workspace".
|
|
96
|
+
*/
|
|
97
|
+
export function park(s: Session, requestId: string, key = s.order[s.pos]): Session {
|
|
98
|
+
if (key === undefined) return s;
|
|
99
|
+
const next = { ...s, parked: { ...s.parked, [groupOf(key)]: requestId } };
|
|
100
|
+
return s.order[s.pos] !== undefined && groupOf(s.order[s.pos]) === groupOf(key) ? { ...next, pos: nextPos(next, s.pos) } : next;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The live deck changed: cards that left Needs you are `gone`, new ones join at the end (never jumping the queue under
|
|
105
|
+
* the developer's thumb), and a parked workstream whose request settled comes back as the very next card: its open
|
|
106
|
+
* cards move to right after the one on screen (or become the current one when the deck had finished). The card on
|
|
107
|
+
* screen never changes under the developer, except to `gone`.
|
|
108
|
+
*/
|
|
109
|
+
export function sync(s: Session, live: readonly Pick<DeckCard, "key">[], settled: (requestId: string) => boolean): Session {
|
|
110
|
+
const liveKeys = new Set(live.map(c => c.key));
|
|
111
|
+
const known = new Set(s.order);
|
|
112
|
+
let order = [...s.order, ...live.map(c => c.key).filter(k => !known.has(k))];
|
|
113
|
+
const outcomes = { ...s.outcomes };
|
|
114
|
+
for (const k of order) if (!liveKeys.has(k) && open({ ...s, outcomes }, k)) outcomes[k] = "gone";
|
|
115
|
+
let pos = s.pos;
|
|
116
|
+
const parked = { ...s.parked };
|
|
117
|
+
for (const [group, requestId] of Object.entries(s.parked)) {
|
|
118
|
+
if (!settled(requestId)) continue;
|
|
119
|
+
delete parked[group];
|
|
120
|
+
const current = order[pos];
|
|
121
|
+
const back = order.filter(k => groupOf(k) === group && k !== current && open({ ...s, outcomes }, k));
|
|
122
|
+
if (!back.length) continue;
|
|
123
|
+
const rest = order.filter(k => !back.includes(k));
|
|
124
|
+
const at = current === undefined ? rest.length : rest.indexOf(current) + 1;
|
|
125
|
+
order = [...rest.slice(0, at), ...back, ...rest.slice(at)];
|
|
126
|
+
pos = current === undefined ? at : order.indexOf(current);
|
|
127
|
+
}
|
|
128
|
+
return { order, pos, outcomes, parked };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** The progress line's numbers: the card on screen out of every card this session, and what is waiting for context. */
|
|
132
|
+
export function statsOf(s: Session): SessionStats {
|
|
133
|
+
const out: SessionStats = { done: 0, skipped: 0, later: 0, gone: 0, waiting: 0 };
|
|
134
|
+
for (const o of Object.values(s.outcomes)) out[o]++;
|
|
135
|
+
out.waiting = s.order.filter(k => s.parked[groupOf(k)] && open(s, k)).length;
|
|
136
|
+
return out;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** The keys, one place, so the help line, the tooltips and the handler agree. Option letters pick; these never collide with A–H. */
|
|
140
|
+
export const CATCH_UP_KEYS = [
|
|
141
|
+
{ key: "A–H", what: "Pick an option" },
|
|
142
|
+
{ key: "W", what: "Write your own answer" },
|
|
143
|
+
{ key: "⌘↵", what: "Send" },
|
|
144
|
+
{ key: "J / →", what: "Skip" },
|
|
145
|
+
{ key: "K / ←", what: "Back" },
|
|
146
|
+
{ key: "M", what: "More context" },
|
|
147
|
+
{ key: "N", what: "Add a note" },
|
|
148
|
+
{ key: "L", what: "Later" },
|
|
149
|
+
{ key: "O", what: "Open chat" },
|
|
150
|
+
{ key: "?", what: "Show the keys" },
|
|
151
|
+
{ key: "Esc", what: "Leave" },
|
|
152
|
+
] as const;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The mode's name in every place it shows, so renaming it is one edit. Tom picked Catch up (2026-11-17: "people know
|
|
156
|
+
* the name"); code identifiers say `catch-up` too. The Home button counts cards, not workspaces, and says so.
|
|
157
|
+
*/
|
|
158
|
+
export const MODE = {
|
|
159
|
+
name: "Catch up",
|
|
160
|
+
button: (n: number) => `Catch up · ${n}`,
|
|
161
|
+
/** The button's accessible name and tooltip: the number is cards, which can differ from Needs you's workspaces. */
|
|
162
|
+
buttonLabel: (n: number) => `Catch up on ${n} ${n === 1 ? "thing" : "things"} that need you, one at a time`,
|
|
163
|
+
command: "Follow-up: Catch up on what needs you",
|
|
164
|
+
progress: (at: number, of: number) => `Catch up ${at} of ${of}`,
|
|
165
|
+
waiting: (n: number) => `${n} getting context`,
|
|
166
|
+
finished: "All caught up",
|
|
167
|
+
empty: "Nothing needs you",
|
|
168
|
+
} as const;
|
|
169
|
+
|
|
170
|
+
// More context ------------------------------------------------------------------------------------------------------
|
|
171
|
+
|
|
172
|
+
/** Who answers: the Overseer from what it already knows (wakes no one), or the card's own agent (Tom asked, so it may wake). */
|
|
173
|
+
export const CONTEXT_TARGETS = ["overseer", "agent"] as const;
|
|
174
|
+
export type ContextTarget = typeof CONTEXT_TARGETS[number];
|
|
175
|
+
/** asking → answered (the reply came with context_reply), chat (the agent ended its turn without it: read its chat), failed. */
|
|
176
|
+
export const CONTEXT_STATES = ["asking", "answered", "chat", "failed"] as const;
|
|
177
|
+
export type ContextState = typeof CONTEXT_STATES[number];
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The suggestions, first one first. Tom, 2026-11-17: "most of the time, the question is just not understood and needs
|
|
181
|
+
* a simple explaining and more context", so "I don't get it" leads.
|
|
182
|
+
*/
|
|
183
|
+
export const CONTEXT_ASKS = [
|
|
184
|
+
{ id: "explain", label: "I don't get it", text: "I don't get it. Explain this in plain words: what is being asked, why, and what each choice would mean. Add the context I need to decide." },
|
|
185
|
+
{ id: "why", label: "Why does it matter?", text: "Why does this matter, and what happens if it waits?" },
|
|
186
|
+
{ id: "tried", label: "What did it try?", text: "What has been tried so far, and what happened?" },
|
|
187
|
+
{ id: "recommend", label: "What if I take the recommendation?", text: "What happens if I take the recommendation?" },
|
|
188
|
+
] as const;
|
|
189
|
+
|
|
190
|
+
export const CONTEXT_ANSWER_MAX = 4000;
|
|
191
|
+
const iso = z.string().max(40);
|
|
192
|
+
export const contextRequestSchema = z.object({
|
|
193
|
+
id: z.string().min(1).max(80),
|
|
194
|
+
workspaceId: z.string().nullable(),
|
|
195
|
+
/** The card's agent (the one that asked); the request's own recipient is `askedOf`. */
|
|
196
|
+
agentId: z.string().nullable(),
|
|
197
|
+
cardKey: z.string().min(1).max(400),
|
|
198
|
+
/** One line naming what the card asks ("Q12: Which retry policy?"), for the prompt and the agent tool. */
|
|
199
|
+
card: z.string().max(300),
|
|
200
|
+
target: z.enum(CONTEXT_TARGETS),
|
|
201
|
+
/** The developer's words, or a suggestion's text. */
|
|
202
|
+
ask: z.string().min(1).max(2000),
|
|
203
|
+
/** The agent that should reply (the card's agent, or the Overseer once it is known). */
|
|
204
|
+
askedOf: z.string().nullable(),
|
|
205
|
+
state: z.enum(CONTEXT_STATES),
|
|
206
|
+
answer: z.string().max(CONTEXT_ANSWER_MAX).nullable(),
|
|
207
|
+
error: z.string().max(500).nullable(),
|
|
208
|
+
askedAt: iso,
|
|
209
|
+
settledAt: iso.nullable(),
|
|
210
|
+
/** Who asked: "developer" or "agent:<id>" (agent parity). */
|
|
211
|
+
by: z.string().max(120),
|
|
212
|
+
});
|
|
213
|
+
export type ContextRequest = z.infer<typeof contextRequestSchema>;
|
|
214
|
+
export const contextFileSchema = z.object({ requests: z.array(contextRequestSchema) });
|
|
215
|
+
export type ContextFile = z.infer<typeof contextFileSchema>;
|
|
216
|
+
|
|
217
|
+
/** Settled requests are kept this long (the card shows the answer when it returns), and at most this many. */
|
|
218
|
+
export const CONTEXT_KEEP_MS = 24 * 3_600_000;
|
|
219
|
+
export const CONTEXT_MAX = 50;
|
|
220
|
+
export const contextSettled = (r: Pick<ContextRequest, "state">) => r.state !== "asking";
|
|
221
|
+
|
|
222
|
+
/** The tool an asked agent replies with (native tools carry the follow_ prefix; the stdio bridge doesn't). */
|
|
223
|
+
const REPLY_TOOL = "context_reply";
|
|
224
|
+
|
|
225
|
+
/** The message the card's agent gets. It asks for an explanation, not action, and never counts as the developer's answer. */
|
|
226
|
+
export function agentContextPrompt(r: Pick<ContextRequest, "id" | "card" | "ask">): string {
|
|
227
|
+
return [
|
|
228
|
+
`The developer is catching up on what needs them and is looking at your ask: ${r.card}`,
|
|
229
|
+
`They want more context before they answer: "${r.ask}"`,
|
|
230
|
+
`Explain in plain words, short (under ${CONTEXT_ANSWER_MAX} characters), with what they need to decide. This isn't their answer: don't act on the ask yet, and keep it open.`,
|
|
231
|
+
`Reply with ${REPLY_TOOL} (follow_${REPLY_TOOL} as a native tool) and requestId "${r.id}" so the answer shows on their card, then end your turn.`,
|
|
232
|
+
].join("\n");
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/** The Overseer's version: it answers from what it can read without waking anyone, and doesn't forward the ask. */
|
|
236
|
+
export function overseerContextPrompt(r: Pick<ContextRequest, "id" | "card" | "ask">, workspace: string): string {
|
|
237
|
+
return [
|
|
238
|
+
`The developer is catching up on what needs them and is looking at a card from ${workspace}: ${r.card}`,
|
|
239
|
+
`They want more context before they answer: "${r.ask}"`,
|
|
240
|
+
`Answer from what you can read (workstreams, agent_digest) without waking agents and without forwarding this to the agent. Plain words, short (under ${CONTEXT_ANSWER_MAX} characters).`,
|
|
241
|
+
`Reply with ${REPLY_TOOL} and requestId "${r.id}" so the answer shows on their card.`,
|
|
242
|
+
].join("\n");
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** A request older than CONTEXT_KEEP_MS goes, then the oldest past CONTEXT_MAX; an asking one is kept while it is young. */
|
|
246
|
+
export function pruneContext(requests: readonly ContextRequest[], now: number): ContextRequest[] {
|
|
247
|
+
const young = requests.filter(r => now - Date.parse(r.askedAt) < CONTEXT_KEEP_MS);
|
|
248
|
+
return young.slice(Math.max(0, young.length - CONTEXT_MAX));
|
|
249
|
+
}
|
package/shared/changelog.ts
CHANGED
|
@@ -119,48 +119,52 @@ export type WhatsNewInput = {
|
|
|
119
119
|
previous: string | null;
|
|
120
120
|
/** Onboarding is showing or not finished: never cover it. */
|
|
121
121
|
onboarding: boolean;
|
|
122
|
+
/** Settings → General's "Show What's new after updates" (`enable_whats_new`); absent means on. */
|
|
123
|
+
enabled?: boolean;
|
|
122
124
|
notes: readonly ReleaseNote[];
|
|
123
125
|
};
|
|
124
126
|
export type WhatsNew =
|
|
125
127
|
| { show: true; notes: ReleaseNote[] }
|
|
126
|
-
/**
|
|
127
|
-
|
|
128
|
+
/**
|
|
129
|
+
* `record` is the version to store as seen without showing anything (first install, downgrade, a beta, the setting
|
|
130
|
+
* off, nothing new).
|
|
131
|
+
*/
|
|
132
|
+
| { show: false; reason: "first-run" | "onboarding" | "seen" | "older" | "off" | "prerelease" | "no-notes"; record: string | null };
|
|
128
133
|
|
|
129
134
|
/**
|
|
130
|
-
*
|
|
131
|
-
*
|
|
135
|
+
* Home's "Follow-up X is available" line (Tell me mode, server/updater.ts) announces every newer stable release.
|
|
136
|
+
* Prereleases stay in Settings → General, including major release candidates. A first install (no `from`), an
|
|
137
|
+
* unchanged version and a downgrade are never announced. What's new has its own notes-based rule (`whatsNew`).
|
|
132
138
|
*/
|
|
133
|
-
function
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return
|
|
139
|
+
export function announcesUpdate(from: string | null, to: string): boolean {
|
|
140
|
+
if (!from || !parseVersion(from)) return false;
|
|
141
|
+
const target = parseVersion(to);
|
|
142
|
+
return target != null && target.pre.length === 0 && compareVersions(to, from) > 0;
|
|
137
143
|
}
|
|
138
144
|
|
|
139
145
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* changes wait in changes/ and ship in the next stable release's notes. A first install (no `from`) is never announced.
|
|
146
|
+
* A beta (any prerelease but a major's rc, which carries the major's curated section). Betas ship no notes of their
|
|
147
|
+
* own in the app, so What's new records them quietly; the next stable shows everything since the device last looked.
|
|
143
148
|
*/
|
|
144
|
-
export
|
|
145
|
-
if (!from) return false;
|
|
146
|
-
const a = releasedMajor(from), b = releasedMajor(to);
|
|
147
|
-
return a != null && b != null && b > a;
|
|
148
|
-
}
|
|
149
|
+
export const quietRelease = (version: string): boolean => (parseVersion(version)?.pre.length ?? 0) > 0 && !isMajorRc(version);
|
|
149
150
|
|
|
150
151
|
/**
|
|
151
|
-
* Whether this device shows "What's new" now
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
152
|
+
* Whether this device shows "What's new" now (invariant `whats-new-after-every-stable-update`): What's new opens after a stable update that brings new release notes, unless the switch is off; betas never do
|
|
153
|
+
* (only stables carry notes). New means a CHANGELOG section newer than the version this device last saw; with none, no
|
|
154
|
+
* sheet ("no-notes"). A major's rc carries the major's section and counts as its release. Quiet, recording the
|
|
155
|
+
* installed version: a first install (no baseline at all; onboarding covers it), a downgrade, a beta, and the switch
|
|
156
|
+
* off (so turning it back on never brings old notes). Onboarding wins over the
|
|
157
|
+
* sheet and leaves the stored version alone, so the sheet can come after onboarding ends.
|
|
155
158
|
*/
|
|
156
|
-
export function whatsNew({ installed, deviceSeen, previous, onboarding, notes }: WhatsNewInput): WhatsNew {
|
|
159
|
+
export function whatsNew({ installed, deviceSeen, previous, onboarding, enabled = true, notes }: WhatsNewInput): WhatsNew {
|
|
157
160
|
if (onboarding) return { show: false, reason: "onboarding", record: null };
|
|
158
161
|
const lastSeen = deviceSeen ?? previous;
|
|
159
162
|
if (!lastSeen) return { show: false, reason: "first-run", record: installed };
|
|
160
163
|
const c = compareVersions(installed, lastSeen);
|
|
161
164
|
if (c === 0) return { show: false, reason: "seen", record: deviceSeen ? null : installed };
|
|
162
165
|
if (c < 0) return { show: false, reason: "older", record: installed };
|
|
163
|
-
if (!
|
|
166
|
+
if (!enabled) return { show: false, reason: "off", record: installed };
|
|
167
|
+
if (quietRelease(installed)) return { show: false, reason: "prerelease", record: installed };
|
|
164
168
|
const since = notesSince(notes, lastSeen, installed);
|
|
165
169
|
return since.length ? { show: true, notes: since } : { show: false, reason: "no-notes", record: installed };
|
|
166
170
|
}
|
|
@@ -201,6 +205,8 @@ export const releaseNotesViewSchema = z.object({
|
|
|
201
205
|
updatedAt: z.number().nullable(),
|
|
202
206
|
/** The last version anyone on this host closed What's new for: the "seen" record for apps without local storage. */
|
|
203
207
|
hostSeen: z.string().nullable(),
|
|
208
|
+
/** Settings → General's "Show What's new after updates" (updates.json); off records each update as seen quietly. */
|
|
209
|
+
enable_whats_new: z.boolean().default(true),
|
|
204
210
|
/** Every shipped release note, newest first. */
|
|
205
211
|
notes: z.array(releaseNoteSchema),
|
|
206
212
|
});
|
package/shared/chat.ts
CHANGED
|
@@ -155,7 +155,7 @@ export const TOOL_PRESENTATION: Record<string, "routine" | "moment"> = {
|
|
|
155
155
|
follow_settings: "routine", set_follow_settings: "routine", project_settings: "routine", set_project_tracking: "routine", pr_workflow: "routine",
|
|
156
156
|
set_pr_workflow: "routine", reviewer_settings: "routine", reviewer_suggestions: "routine", save_reviewers: "routine", set_agent_setting: "routine",
|
|
157
157
|
set_wait_for_jobs: "routine", onboarding_status: "routine", onboarding_checks: "routine", set_onboarding: "routine", rank_status: "routine",
|
|
158
|
-
rerank_priorities: "routine", overseer_status: "routine", overseer_start: "routine", overseer_restart: "routine", overseer_ask: "routine",
|
|
158
|
+
rerank_priorities: "routine", overseer_status: "routine", overseer_start: "routine", overseer_restart: "routine", overseer_ask: "routine", catch_up_deck: "routine", context_requests: "routine", ask_context: "routine", context_reply: "routine",
|
|
159
159
|
inbox_brief: "routine", brief_action: "routine", queue_list: "routine", queue_action: "routine", inbox_act: "routine", answer_question: "routine", run_recovery: "routine",
|
|
160
160
|
set_workspace_spec: "routine", link_item: "routine", unlink_item: "routine", link_items: "routine", set_linked_items: "routine", set_task_trigger: "routine", pr_controls: "routine", browser_status: "routine", trust_bypass_status: "routine",
|
|
161
161
|
release_notes: "routine", updates_status: "routine", check_updates: "routine", set_updates: "routine", install_update: "routine", retry_move: "routine", report_issue: "routine", report_send: "routine", make_main_agent: "routine", wait_prepare_job: "routine", wait_for_job: "routine", wait_get_job: "routine",
|
package/shared/contracts.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { aboutViewSchema } from "./about";
|
|
|
9
9
|
import { LINKED_KINDS, linkedItemSchema } from "./linked";
|
|
10
10
|
import { AGENT_ROLES, agentSettingsViewSchema, savedRoleSchema } from "./agent-settings";
|
|
11
11
|
import { defineRpc, type PluginSubscriptionContract } from "@getpaseo/plugin";
|
|
12
|
+
import { CONTEXT_ANSWER_MAX, CONTEXT_TARGETS, contextRequestSchema } from "./catch-up";
|
|
12
13
|
import { ONBOARDING_ACTIONS, ONBOARDING_STEPS, checksSchema, onboardingViewSchema } from "./onboarding";
|
|
13
14
|
import { z } from "zod";
|
|
14
15
|
import { inboxRowSchema } from "./inbox";
|
|
@@ -205,6 +206,18 @@ export const overseerStatusSchema = z.object({ enabled: z.boolean(), agentId: z.
|
|
|
205
206
|
export const overseerStatusRpc = defineRpc({ name: "follow.overseer-status", input: z.object({}), output: overseerStatusSchema });
|
|
206
207
|
export const overseerStartRpc = defineRpc({ name: "follow.overseer-start", input: z.object({}), output: overseerStatusSchema });
|
|
207
208
|
export const overseerAskRpc = defineRpc({ name: "follow.overseer-ask", input: z.strictObject({ text: z.string().trim().min(1).max(2000) }), output: overseerStatusSchema });
|
|
209
|
+
// Catch up's More context (docs/needs-you.md#catch-up): ask the Overseer or the card's agent, list the asks, and the
|
|
210
|
+
// asked agent's reply. The ask answers once it is recorded; the send to the agent goes through the message queue.
|
|
211
|
+
export const contextAskRpc = defineRpc({ name: "follow.context-ask", input: z.strictObject({
|
|
212
|
+
workspaceId: z.string().min(1).max(200).nullable(), agentId: z.string().min(1).max(200).nullable(), cardKey: z.string().min(1).max(400),
|
|
213
|
+
card: z.string().trim().min(1).max(300), target: z.enum(CONTEXT_TARGETS), ask: z.string().trim().min(1).max(2000) }),
|
|
214
|
+
output: z.object({ request: contextRequestSchema, fresh: z.boolean() }) });
|
|
215
|
+
export const contextListRpc = defineRpc({ name: "follow.context-list", input: z.strictObject({ workspaceId: z.string().max(200).optional() }), output: z.object({ requests: z.array(contextRequestSchema) }) });
|
|
216
|
+
/** Catch up's deck as the developer's Home would deal it (agent parity: an agent sees what the developer goes through). */
|
|
217
|
+
export const catchUpDeckRpc = defineRpc({ name: "follow.catch-up-deck", input: z.strictObject({}), output: z.object({
|
|
218
|
+
cards: z.array(z.object({ key: z.string(), kind: z.string(), workspaceId: z.string().nullable(), agentId: z.string().nullable(), title: z.string(), line: z.string(),
|
|
219
|
+
questionId: z.string().nullable(), item: z.string().nullable(), context: contextRequestSchema.pick({ id: true, state: true, target: true }).nullable() })) }) });
|
|
220
|
+
export const contextReplyRpc = defineRpc({ name: "follow.context-reply", input: z.strictObject({ agentId: z.string().min(1).max(200), requestId: z.string().min(1).max(80), text: z.string().trim().min(1).max(CONTEXT_ANSWER_MAX) }), output: z.object({ ok: z.boolean() }) });
|
|
208
221
|
export const rankStatusSchema = z.object({ enabled: z.boolean(), running: z.boolean(), lastRunAt: z.string().nullable(), healthLine: z.string(), error: z.string().nullable(), costUsd: z.number().nullable(), notStarted: z.number().int(),
|
|
209
222
|
last: z.object({ ok: z.boolean(), skipped: z.string().nullable(), top: z.string().nullable(), provider: z.string().nullable(), inputTokens: z.number().nullable(), outputTokens: z.number().nullable() }).nullable() });
|
|
210
223
|
export const rankStatusRpc = defineRpc({ name: "follow.rank-status", input: z.object({}), output: rankStatusSchema });
|
|
@@ -296,6 +309,8 @@ export const homeFeed = subscription("follow.home-feed", z.object({}), z.object(
|
|
|
296
309
|
usage: usageSchema.nullable(),
|
|
297
310
|
/** False when Smart Session's data directory can't be watched: the client reads usage once a minute instead. */
|
|
298
311
|
usageLive: z.boolean(),
|
|
312
|
+
/** Catch up's More context asks (pushed when one is asked or answered); absent from an older worker. */
|
|
313
|
+
context: z.array(contextRequestSchema).optional(),
|
|
299
314
|
}));
|
|
300
315
|
export const displayFeed = subscription("follow.display-feed", z.object({}), z.object({ status: z.string(), revision: z.string().optional(), values: z.unknown().optional() }));
|
|
301
316
|
export const FEEDS = [workspacesFeed, inboxFeed, homeFeed, displayFeed] as const;
|
package/shared/questions.ts
CHANGED
|
@@ -114,6 +114,60 @@ export function nextQuestionId(questions: Pick<Question, "id">[]): string {
|
|
|
114
114
|
export const OTHER = "other";
|
|
115
115
|
export const OTHER_LABEL = "Something else";
|
|
116
116
|
export const isOther = (choice: string | null | undefined) => choice === OTHER;
|
|
117
|
+
|
|
118
|
+
/** Under a disabled Send while Something else has no words yet. The brief card says the same. */
|
|
119
|
+
export const OWN_ANSWER_HINT = "Write your answer, then send it.";
|
|
120
|
+
/** Under a disabled Send while nothing is picked: names the way to write your own, too. */
|
|
121
|
+
export const PICK_HINT = "Pick an option, or Something else to write your own.";
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* What an open question's answer form holds and what its one text field means
|
|
125
|
+
* (`one-answer-flow-for-every-question`). Every surface that answers a question (the dialog, the panel's and Home's
|
|
126
|
+
* Needs you, the pill, phones) draws QuestionBody, which reads this and nothing else, so the same question is
|
|
127
|
+
* answered the same way wherever it is shown.
|
|
128
|
+
*
|
|
129
|
+
* The field appears only once the developer has said what the words are: their own answer (Something else, or a
|
|
130
|
+
* question with no options) or a note on the option they picked (Add note). A field that is a note until something
|
|
131
|
+
* else is clicked is the bug this replaces: words typed with nothing picked could not be sent. Should words ever be
|
|
132
|
+
* there with nothing picked (an unsent answer restored, say), they are the developer's own answer, never a lost note.
|
|
133
|
+
*/
|
|
134
|
+
export type AnswerField = "answer" | "note";
|
|
135
|
+
export type AnswerDraft = {
|
|
136
|
+
/** The field's role, or null while it is hidden (a lettered pick, or nothing picked, without Add note). */
|
|
137
|
+
field: AnswerField | null;
|
|
138
|
+
/** Something else is the pick, marked on its radio. */
|
|
139
|
+
own: boolean;
|
|
140
|
+
/** What Send records: a letter, OTHER, the free answer, or null while Send can't send yet. */
|
|
141
|
+
answer: string | null;
|
|
142
|
+
/** Words sent with a lettered pick. */
|
|
143
|
+
note?: string;
|
|
144
|
+
placeholder: string;
|
|
145
|
+
/** The field's visible label, which stays once the placeholder is gone. */
|
|
146
|
+
heading: string | null;
|
|
147
|
+
label: string;
|
|
148
|
+
/** Says why Send is disabled, when it is. */
|
|
149
|
+
hint: string | null;
|
|
150
|
+
/** Add note is on offer: a letter is picked and no field is open. */
|
|
151
|
+
canAddNote: boolean;
|
|
152
|
+
/** Remove note is on offer: the field is a note the developer opened. */
|
|
153
|
+
canRemoveNote: boolean;
|
|
154
|
+
};
|
|
155
|
+
export function answerDraft(q: { id: string; options: readonly { letter?: string; label?: string }[] }, s: { choice: string | null; words: string; noteOpen: boolean }): AnswerDraft {
|
|
156
|
+
const words = s.words.trim();
|
|
157
|
+
if (!q.options.length) return { field: "answer", own: false, answer: words || null, placeholder: "Your answer", heading: null, label: `Your answer to ${q.id}`, hint: null, canAddNote: false, canRemoveNote: false };
|
|
158
|
+
const own = isOther(s.choice) || (!s.choice && !!words);
|
|
159
|
+
if (own) return { field: "answer", own, answer: words ? OTHER : null, placeholder: "Your answer (required)", heading: "Your answer", label: `Your answer to ${q.id}, required`, hint: words ? null : OWN_ANSWER_HINT, canAddNote: false, canRemoveNote: false };
|
|
160
|
+
// A lettered pick: the field is a note, shown once asked for (or once it holds words, e.g. Something else's words
|
|
161
|
+
// kept when the developer picks a letter after all, so they read as the note they now are).
|
|
162
|
+
const field = s.choice && (s.noteOpen || !!words) ? "note" as const : null;
|
|
163
|
+
return { field, own, answer: s.choice, note: field && words ? words : undefined, placeholder: "Add a note for the agent (optional)", heading: s.choice ? noteHeading(q, s.choice) : null,
|
|
164
|
+
label: `Note for the agent, sent with ${s.choice} on ${q.id}, optional`, hint: s.choice ? null : PICK_HINT, canAddNote: !!s.choice && !field, canRemoveNote: field === "note" };
|
|
165
|
+
}
|
|
166
|
+
/** "Note, sent with A · The English text": the option by name too, since it may have scrolled out of view. */
|
|
167
|
+
function noteHeading(q: { options: readonly { letter?: string; label?: string }[] }, choice: string): string {
|
|
168
|
+
const label = q.options.find(o => o.letter === choice)?.label?.replace(/\s+/g, " ").trim();
|
|
169
|
+
return `Note, sent with ${choice}${label ? ` · ${label.length > 48 ? `${label.slice(0, 47)}…` : label}` : ""}`;
|
|
170
|
+
}
|
|
117
171
|
const quoted = (words: string | undefined | null) => `"${(words ?? "").trim()}"`;
|
|
118
172
|
|
|
119
173
|
/**
|
package/shared/queue.ts
CHANGED
|
@@ -16,7 +16,8 @@ export type QueueKind = typeof QUEUE_KINDS[number];
|
|
|
16
16
|
* - queued: waiting to go out (fresh, or a send that never left: Paseo unreachable, no agent, a permission prompt).
|
|
17
17
|
* - sending: the send is out and Paseo hasn't answered yet.
|
|
18
18
|
* - uncertain: a send left (or may have) without a confirmation; the chat is read before anything is resent.
|
|
19
|
-
* - failed: the
|
|
19
|
+
* - failed: only when the target can't take messages (its conversation is gone, `gone` names it); Retry resends.
|
|
20
|
+
* An unknown arrival is never failed: it keeps checking (a-queued-message-never-stops-short).
|
|
20
21
|
* - sent, cancelled: settled; kept only in the file's short tail.
|
|
21
22
|
*/
|
|
22
23
|
export const QUEUE_STATES = ["queued", "sending", "uncertain", "failed", "sent", "cancelled"] as const;
|
|
@@ -39,12 +40,16 @@ export const queueItemSchema = z.object({
|
|
|
39
40
|
state: z.enum(QUEUE_STATES),
|
|
40
41
|
/** Tries that never left (unreachable, no agent): they never end in failed. */
|
|
41
42
|
attempts: z.number().int().min(0).default(0),
|
|
42
|
-
/**
|
|
43
|
+
/** Unconfirmed sends and arrival checks that couldn't tell: the ambiguous ladder's step (AMBIGUOUS_MS). */
|
|
43
44
|
unknowns: z.number().int().min(0).default(0),
|
|
44
45
|
/** When it is due again. Null: fresh, it goes out after the quiet window. */
|
|
45
46
|
nextAt: z.string().nullable().default(null),
|
|
46
47
|
/** Why it waits, failed or was cancelled, in a few plain words. */
|
|
47
48
|
reason: z.string().max(400).nullable().default(null),
|
|
49
|
+
/** Every messageId an envelope carrying this item went out under: the arrival check looks for each. */
|
|
50
|
+
sentIds: z.array(z.string()).max(50).default([]),
|
|
51
|
+
/** Bumped when Paseo refuses the messageId for good (idRefused): the next send, after the chat shows it missing, goes under a fresh id derived from it. */
|
|
52
|
+
generation: z.number().int().min(0).default(0),
|
|
48
53
|
/** The last send that left or may have: the arrival check reads the chat for this messageId. */
|
|
49
54
|
envelope: z.object({ messageId: z.string(), to: z.string().nullable(), at: z.string() }).nullable().default(null),
|
|
50
55
|
/** The agent whose provider conversation is gone (a send's ConversationGone), so its channel can say so. */
|
|
@@ -91,7 +96,10 @@ export const QUEUE_QUIET_MS = 2_000;
|
|
|
91
96
|
export const QUEUE_CAP_MS = 8_000;
|
|
92
97
|
/** A send that never left retries on this ladder, its last step forever: it never ends in failed. */
|
|
93
98
|
export const NEVER_LEFT_MS = [15_000, 60_000, 300_000] as const;
|
|
94
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* A send that left unconfirmed: the chat is read after each step, and the last step repeats until the chat can tell
|
|
101
|
+
* (found: sent; not there: resent). It never ends in failed: an unknown isn't a no (a-queued-message-never-stops-short).
|
|
102
|
+
*/
|
|
95
103
|
export const AMBIGUOUS_MS = [15_000, 60_000, 300_000, 900_000] as const;
|
|
96
104
|
/** One attempt's cap: past it the send counts as left but unconfirmed. */
|
|
97
105
|
export const QUEUE_ATTEMPT_MS = 120_000;
|
|
@@ -107,6 +115,7 @@ export const PROBE_MS = 15_000;
|
|
|
107
115
|
export const PROBE_SLOW_MS = 60_000;
|
|
108
116
|
export const PROBE_BACKOFF_AFTER_MS = 10 * 60_000;
|
|
109
117
|
|
|
118
|
+
export const ambiguousDelay = (unknowns: number) => AMBIGUOUS_MS[Math.min(Math.max(unknowns, 0), AMBIGUOUS_MS.length - 1)];
|
|
110
119
|
export const neverLeftDelay = (attempts: number) => NEVER_LEFT_MS[Math.min(Math.max(attempts, 1), NEVER_LEFT_MS.length) - 1];
|
|
111
120
|
|
|
112
121
|
/**
|
|
@@ -143,6 +152,8 @@ export type DeliveryStatus = {
|
|
|
143
152
|
};
|
|
144
153
|
const hhmm = (iso: string) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? d.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) : ""; };
|
|
145
154
|
|
|
155
|
+
/** The one reason a queued message ends Failed: its target can't take messages (a-queued-message-never-stops-short). */
|
|
156
|
+
export const GONE_REASON = "The agent's conversation is gone, so it can't take messages.";
|
|
146
157
|
export const RETRYING_DETAIL = "Not confirmed yet. Follow-up reads the agent's chat before sending again, so it never arrives twice.";
|
|
147
158
|
export const FAILED_DETAIL = "Follow-up couldn't confirm the agent got it. Check the agent's chat, then Retry.";
|
|
148
159
|
|
|
@@ -158,6 +169,20 @@ export function deliveryStatus(d: DeliveryView, clock: (iso: string) => string =
|
|
|
158
169
|
}
|
|
159
170
|
}
|
|
160
171
|
|
|
172
|
+
/**
|
|
173
|
+
* a-queued-message-never-stops-short: an item still in the queue is either due again (queued or uncertain with a next
|
|
174
|
+
* try, or fresh and inside its quiet window), going out (sending), or Failed because its target is gone, with the
|
|
175
|
+
* reason. Null when that holds; otherwise what is wrong. Settled items (sent, cancelled) always hold.
|
|
176
|
+
*/
|
|
177
|
+
export function queueItemStop(item: Pick<QueueItem, "state" | "nextAt" | "reason" | "gone" | "envelope">): string | null {
|
|
178
|
+
switch (item.state) {
|
|
179
|
+
case "sent": case "cancelled": case "sending": return null;
|
|
180
|
+
case "failed": return item.gone && item.reason ? null : item.gone ? "failed without saying why" : "failed with no next try, though its target isn't gone";
|
|
181
|
+
case "uncertain": return item.nextAt ? null : "uncertain with no next check";
|
|
182
|
+
case "queued": return item.nextAt || (!item.reason && !item.envelope) ? null : "queued with no next try";
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
161
186
|
/** A message Follow-up couldn't deliver that has no card of its own (an Overseer forward, a report) raises Needs you after this long queued, or at once when Failed. */
|
|
162
187
|
export const MESSAGE_STUCK_MS = 10 * 60_000;
|
|
163
188
|
/** An item as follow.queue-list and follow_queue_list show it: no message text, only its first line. */
|
|
@@ -23,6 +23,7 @@ import { foldedAsk, needsYouBlock, onceViolation } from "./needs-block";
|
|
|
23
23
|
import { compactPrStatus, prLink, prPresentation } from "./presentation";
|
|
24
24
|
import { agentMerges } from "./pr-workflow";
|
|
25
25
|
import { mergeScope } from "./merge-click";
|
|
26
|
+
import { GONE_REASON } from "./queue";
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* Status invariants: what must hold for any workspace, whatever path changed it. Pure, no IO, and never throwing:
|
|
@@ -283,6 +284,19 @@ export const INVARIANTS: Invariant[] = [
|
|
|
283
284
|
return null;
|
|
284
285
|
},
|
|
285
286
|
},
|
|
287
|
+
{
|
|
288
|
+
id: "a-queued-message-never-stops-short",
|
|
289
|
+
why: "2026-11-17: an answer whose send timed out sat through four arrival checks that couldn't tell (the agent wasn't loaded, so only its transcript was read, and only a find counted), then ended Failed with no next try; the agent never got it. An answer on its way is delivered, has a next try, or is Failed only because its agent's conversation is gone (server/message-queue.ts, queueItemStop).",
|
|
290
|
+
check(w) {
|
|
291
|
+
for (const q of w.questions) {
|
|
292
|
+
const d = q.answer?.delivery;
|
|
293
|
+
if (!d) continue;
|
|
294
|
+
if (d.state === "failed" && d.reason !== GONE_REASON) return `${q.id}'s answer is Failed though its agent can still take messages: "${d.reason ?? "no reason"}"`;
|
|
295
|
+
if (d.state === "queued" && d.reason && !d.nextAt) return `${q.id}'s answer waits ("${d.reason}") with no next try`;
|
|
296
|
+
}
|
|
297
|
+
return null;
|
|
298
|
+
},
|
|
299
|
+
},
|
|
286
300
|
{
|
|
287
301
|
id: "a-pick-note-reaches-the-agent",
|
|
288
302
|
why: "Task 32deeb27, the developer's ask: \"A, but make sure to…\". A note on a lettered pick reaches the agent's message and the record, on a question here and on a brief card (pickNoteViolations).",
|
package/shared/updates.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type { InstallKind } from "./changelog";
|
|
|
7
7
|
/**
|
|
8
8
|
* Settings → General: the view the server sends, and the words each state shows. Pure, so every state's copy is
|
|
9
9
|
* testable without rendering. Also the contract for onboarding's Updates step: it reads `follow.updates` and writes
|
|
10
|
-
* `follow.set-updates` with `{ mode, channel }`, exactly like Settings.
|
|
10
|
+
* `follow.set-updates` with `{ mode, channel }`, exactly like Settings (which also writes `enable_whats_new`).
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
export const UPDATE_MODES = ["auto", "notify", "off"] as const;
|
|
@@ -15,7 +15,7 @@ export type UpdateMode = typeof UPDATE_MODES[number];
|
|
|
15
15
|
export const MODE_LABEL: Record<UpdateMode, string> = { auto: "Install automatically", notify: "Tell me", off: "Off" };
|
|
16
16
|
export const MODE_HINT: Record<UpdateMode, string> = {
|
|
17
17
|
auto: "Installs new versions when no agent is using Follow-up. Checked about every 6 hours.",
|
|
18
|
-
notify: "Shows new versions here and on Home. You choose when to install.",
|
|
18
|
+
notify: "Shows new versions here and new stable versions on Home. You choose when to install.",
|
|
19
19
|
off: "No checks on its own. You can still check and install from here.",
|
|
20
20
|
};
|
|
21
21
|
export const MODE_SHORT: Record<UpdateMode, string> = { auto: "installs automatically", notify: "tells you", off: "updates off" };
|
|
@@ -44,6 +44,8 @@ export const updatesViewSchema = z.object({
|
|
|
44
44
|
installKind: z.enum(INSTALL_KINDS),
|
|
45
45
|
mode: z.enum(UPDATE_MODES),
|
|
46
46
|
channel: z.enum(["stable", "beta"]),
|
|
47
|
+
/** What's new opens after an update that brings new release notes (stables only). Applies to every install kind. */
|
|
48
|
+
enable_whats_new: z.boolean().default(true),
|
|
47
49
|
/** Newest version on each channel per the last check (null: nothing published, or never checked). */
|
|
48
50
|
channels: z.object({ stable: z.string().nullable(), beta: z.string().nullable() }),
|
|
49
51
|
checkedAt: z.number().nullable(),
|
|
@@ -61,7 +63,13 @@ export const updatesViewSchema = z.object({
|
|
|
61
63
|
});
|
|
62
64
|
export type UpdatesView = z.infer<typeof updatesViewSchema>;
|
|
63
65
|
|
|
64
|
-
export const setUpdatesInputSchema = z.strictObject({ mode: z.enum(UPDATE_MODES).optional(), channel: z.enum(["stable", "beta"]).optional() });
|
|
66
|
+
export const setUpdatesInputSchema = z.strictObject({ mode: z.enum(UPDATE_MODES).optional(), channel: z.enum(["stable", "beta"]).optional(), enable_whats_new: z.boolean().optional() });
|
|
67
|
+
export type UpdatesChange = z.infer<typeof setUpdatesInputSchema>;
|
|
68
|
+
/** Settings → General's What's new switch: its label and the hint for each state. */
|
|
69
|
+
export const WHATS_NEW_LABEL = "Show What's new after updates";
|
|
70
|
+
export const whatsNewHint = (on: boolean) => on
|
|
71
|
+
? "Opens once after an update that brings new release notes. Betas stay quiet."
|
|
72
|
+
: "Updates install quietly. Release notes below still show every version.";
|
|
65
73
|
|
|
66
74
|
const ago = (ms: number) => {
|
|
67
75
|
const m = Math.round(ms / 60_000);
|