paseo-follow-up 1.4.0-beta.31 → 1.4.0-beta.32
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/OVERVIEW.md +3 -1
- package/README.md +19 -2
- package/client/home.tsx +8 -5
- package/client/onboarding.tsx +5 -1
- package/client/questions.tsx +4 -3
- package/client/settings.tsx +8 -21
- package/client/updates.tsx +188 -0
- package/index.server.ts +82 -5
- package/package.json +1 -1
- package/scripts/build.mjs +2 -0
- package/server/agent-actions.ts +1 -1
- package/server/agent-hook.mjs +1 -1
- package/server/agent-parity.ts +12 -0
- package/server/hook-source.ts +1 -1
- package/server/mcp-source.ts +1 -1
- package/server/mcp.mjs +5 -1
- package/server/ranker.ts +2 -0
- package/server/release-notes.ts +3 -1
- package/server/update-provenance.ts +113 -0
- package/server/update-registry.ts +97 -0
- package/server/update-watchdog-source.ts +2 -0
- package/server/update-watchdog.d.mts +8 -0
- package/server/update-watchdog.mjs +133 -0
- package/server/updater.ts +310 -0
- package/server/updates.ts +45 -0
- package/shared/chat.ts +1 -1
- package/shared/contracts.ts +11 -0
- package/shared/onboarding.ts +16 -9
- package/shared/settings-nav.ts +1 -1
- package/shared/update-policy.ts +65 -0
- package/shared/updates.ts +167 -0
package/OVERVIEW.md
CHANGED
|
@@ -28,7 +28,7 @@ Auto-send ("Send repairs automatically") is on by default for every followed wor
|
|
|
28
28
|
|
|
29
29
|
### What agents can do for you
|
|
30
30
|
|
|
31
|
-
Every root agent Paseo launches (tracked or not) gets Follow-up's action tools: `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`, `set_finish_flags`, `set_priorities`, `set_wait_for_jobs` and the read-only `workspace_about` (a workspace's overview and linked items) and `release_notes` (the installed version and its notes) (external priorities for Home's Priority sort, kept in `plugin-data/follow-through/priorities.json`). Each runs the server path its button runs, with the same guards (tracked workspace, hold, PR eligibility, merge blockers), across every tracked workspace, so an orchestrating agent can act "on all" when you ask it to. Tools that act on a list, and merge, return a dry run and run only with `confirm: true` and that plan's id; merge is marked destructive and the list tools read-only. Inbox tools act on other agents only: an agent can't sign itself off. Recovery agents, contributors and subagents never get them, and the daemon re-checks the caller on each call. Each agent action is kept in the inbox's delivery ledger as `by: "agent:<id>"`; it never counts as you writing to an agent. A sign-off is still a sign-off made on your behalf, so it clears the flag. There is no tool to untrack or archive a workspace, or to put one on hold, because Follow-up has no button for those either.
|
|
31
|
+
Every root agent Paseo launches (tracked or not) gets Follow-up's action tools: `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`, `set_finish_flags`, `set_priorities`, `set_wait_for_jobs` and the read-only `workspace_about` (a workspace's overview and linked items) and `release_notes` (the installed version and its notes), `updates_status` and `check_updates` (Settings → General, Check now), with `set_updates` and `install_update` as confirmed plans (external priorities for Home's Priority sort, kept in `plugin-data/follow-through/priorities.json`). Each runs the server path its button runs, with the same guards (tracked workspace, hold, PR eligibility, merge blockers), across every tracked workspace, so an orchestrating agent can act "on all" when you ask it to. Tools that act on a list, and merge, return a dry run and run only with `confirm: true` and that plan's id; merge is marked destructive and the list tools read-only. Inbox tools act on other agents only: an agent can't sign itself off. Recovery agents, contributors and subagents never get them, and the daemon re-checks the caller on each call. Each agent action is kept in the inbox's delivery ledger as `by: "agent:<id>"`; it never counts as you writing to an agent. A sign-off is still a sign-off made on your behalf, so it clears the flag. There is no tool to untrack or archive a workspace, or to put one on hold, because Follow-up has no button for those either.
|
|
32
32
|
|
|
33
33
|
## Data and access
|
|
34
34
|
|
|
@@ -54,3 +54,5 @@ The ranker behind AI priority (beta) runs inside Follow-up's worker as bounded o
|
|
|
54
54
|
Wait for background jobs (1.4.0-beta.24, folded in from the standalone paseo-wait plugin) attaches `wait_prepare_job`, `wait_for_job` and `wait_get_job` to every interactive Claude session as native plugin tools, with `CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS=0` in that session's environment (Claude Code then never backgrounds a long MCP call, Wait's or another's) and `FOLLOW_THROUGH_WAIT=1`, which makes the provider hook add Wait's guidance once at SessionStart. It keeps job records in `plugin-data/follow-through/wait/jobs/<agentId>/<jobId>/` (`job.json`, a `started` marker and the exit receipt `result.json`) and a shell runner, `wait/run-job.sh`, that the agent's own Bash tool runs; the worker never runs the command. A job is readable only by the agent id and working directory the daemon reports for the caller. A wait holds two timers and refreshes that one agent at most once a second to notice a new message, and only while it waits. It is off when Settings → Agents says so (`enable_wait: false` in `agents.json`), when Paseo's `config.json` lists the standalone `paseo-wait` plugin as installed and not disabled, when the host doesn't serve plugin tools, and for agents labelled `follow-up-wait/enabled=false`, `paseo-wait/enabled=false` or `plugin-tools/enabled=false`. Records are never deleted automatically.
|
|
55
55
|
|
|
56
56
|
Getting started keeps only its own progress in `plugin-data/follow-through/onboarding.json`: whether this host was a fresh or existing install when this version first started (existing if `state.json`, `inbox.json`, `reviewers.json`, `agents.json` or `brief.json` was already there), the current step, and whether the existing-install offer was shown or dismissed. An unreadable file counts as finished, so setup is never forced. Its choices are written through the same RPCs and display settings the Settings screen uses. The readiness checks run only when setup asks for them, at most once a minute unless you press Check again: `gh api user` on the daemon host, Paseo's provider snapshot (the same cached read Settings → Agents uses), Paseo's `config.json`, and the count of `hook-state/native-*.json` files. They never read an agent's timeline.
|
|
57
|
+
|
|
58
|
+
Updates (Settings → General) talk to the npm registry Paseo itself uses (`npm_config_registry`, else registry.npmjs.org): one abbreviated-metadata request with an ETag about every six hours (none when updates are Off), at most one a minute when Settings opens, one per Check now, and, once per new version, two for its provenance (the version document and its attestations) and one download of its tarball, checked against the confirmed checksum, to show its release notes before installing. Nothing about the host or its agents is sent. Choices, the waiting update and provenance verdicts live in `updates.json`, the last registry answer in `registry.json`, and each install step in `updates.jsonl`. Installing writes `update-watchdog.mjs` and starts it as a detached `node` process with the daemon's connection details in its environment (never on the command line); it previews and applies the update through Paseo's own plugin-update calls, pinned to the checksum Follow-up checked, then reads Paseo's plugin list every 15 seconds and the new worker's `heartbeat.json` for ten minutes, rolls back the same way if needed, and exits. Waiting for a quiet moment uses the cached agent list and turn events, with one fresh agent list right before installing; it never reads timelines.
|
package/README.md
CHANGED
|
@@ -32,7 +32,8 @@ The first time you open Follow-up from the sidebar, a short setup takes Home's p
|
|
|
32
32
|
2. **Check your setup.** Whether the GitHub CLI is signed in (and as whom), whether Claude and Codex are available for the helper agents, and whether agents get Follow-up's tools. Anything missing shows the fix, with the command to copy. Checks run only while this step is open.
|
|
33
33
|
3. **What Follow-up does without asking.** Follow every workspace (or turn single ones off), Send repairs automatically, and Trust bypass agents. They are on by default and save as you change them.
|
|
34
34
|
4. **Reviewers.** Who **Add reviewers** asks: a default for every repository, and a list per repository Follow-up has seen. **Skip, set later** leaves it empty.
|
|
35
|
-
5. **
|
|
35
|
+
5. **Updates.** Install automatically (recommended), Tell me, or Off, and the Stable or Beta channel. Passing the step or skipping setup keeps Install automatically.
|
|
36
|
+
6. **Helpers.** The Overseer and AI priority switches, which models they use (change them under Settings → Agents), and where Home, the workspace panel, Needs you and the Summary live.
|
|
36
37
|
|
|
37
38
|
Every switch in setup is the same one Settings shows, so nothing is applied twice and nothing is lost if you stop halfway. Setup remembers its step, so a reload or another device picks up where you left off. Run it again any time from **Set up Follow-up again** in Settings → **General**, the first category, or ⌘K → **Follow-up: Set up again**. If Follow-up was already installed before this version, it doesn't open on its own: Home shows one dismissible line offering it, for a day.
|
|
38
39
|
|
|
@@ -40,6 +41,22 @@ Every switch in setup is the same one Settings shows, so nothing is applied twic
|
|
|
40
41
|
|
|
41
42
|
After a major update (1.x to 2.0), the next time you open Paseo it shows **What's new**: the notes for every version since that device last looked, newest open, older ones folded. It shows once per device per version (once per host in the phone app), never on a fresh install and never over setup. Betas, minor and patch updates never pop it up. Betas have no notes of their own; their changes are collected in the next stable release. Home's last line says which version you run, with **Release notes** for the full list; for three days after an update to a version with its own notes it reads **Updated to X · What's new** instead. The notes ship inside the package as [CHANGELOG.md](CHANGELOG.md), so they work offline and match the installed version.
|
|
42
43
|
|
|
44
|
+
## Updates
|
|
45
|
+
|
|
46
|
+
Follow-up can update itself. **Settings → General** has three modes:
|
|
47
|
+
|
|
48
|
+
- **Install automatically** installs a new version at a quiet moment: no agent mid-turn and none of Follow-up's own work running, for five minutes in a row (after a day of waiting, any idle moment). Installing reloads Follow-up, which detaches its tools from open agent sessions until they reopen, so it never installs mid-turn.
|
|
49
|
+
- **Tell me** shows the new version in Settings → General, and as one line on Home only for a new major version (2.0). You choose when with **Install now**. It is the default on hosts that had Follow-up before updates existed.
|
|
50
|
+
- **Off** never asks npm on its own, not even when Settings opens. **Check now** still works.
|
|
51
|
+
|
|
52
|
+
Follow-up asks npm about once every six hours (one small request, nothing when unchanged), opening Settings → General checks at most once a minute, and **Check now** always asks. **Channel** picks Stable (`latest`) or Beta; it starts on Beta when you run a beta, and never offers a stable older than what you run.
|
|
53
|
+
|
|
54
|
+
Before installing a version on its own, Follow-up reads the version's npm provenance and checks that it was built by this repository's GitHub workflow and is the exact file npm serves. That file's checksum is then pinned for the install. Follow-up does not verify the provenance signature itself, so this guards against a version published by hand or from another repository, not against a compromised registry. A version that fails the check is never installed from Settings; install it by hand with `paseo plugin update follow-through --version <version>` only if you trust it.
|
|
55
|
+
|
|
56
|
+
An installer runs alongside Follow-up for the install and the ten minutes after it. If the new version fails to load, reports an error, or doesn't start within two minutes, it installs the previous version again, and Settings and Home say what happened. Follow-up doesn't retry a rolled-back version on its own. Every update is listed under **Update history**. Installs from a Git checkout or a local folder are left alone: pull and rebuild to update.
|
|
57
|
+
|
|
58
|
+
Agents can do the same with `updates_status`, `check_updates`, `set_updates` and `install_update` (the last two as confirmed plans).
|
|
59
|
+
|
|
43
60
|
## Use
|
|
44
61
|
|
|
45
62
|
Follow-up follows every workspace as soon as it has an agent; there is nothing to turn on. Open a workspace and click the Follow-up icon in its header (or press ⌘K / Ctrl+K and choose **Follow-up: open for this workspace**) to see that workspace's panel. Its **Home** button opens Home, the list of every workspace. To leave a workspace or a project out, open the settings (**Follow-up: settings** in ⌘K): **Following** has the global switches, **Workspace exceptions** the per-workspace ones.
|
|
@@ -221,7 +238,7 @@ This replaces the separate **Wait** plugin (`paseo-wait`). While that plugin is
|
|
|
221
238
|
Install the beta:
|
|
222
239
|
|
|
223
240
|
```sh
|
|
224
|
-
paseo plugin update follow-through --version 1.4.0-beta.
|
|
241
|
+
paseo plugin update follow-through --version 1.4.0-beta.32
|
|
225
242
|
# or, for a fresh install:
|
|
226
243
|
paseo plugin install npm:paseo-follow-up@beta
|
|
227
244
|
```
|
package/client/home.tsx
CHANGED
|
@@ -26,6 +26,7 @@ import { Spinner } from "./motion";
|
|
|
26
26
|
import { Setup, SetupOffer, useOnboarding } from "./onboarding";
|
|
27
27
|
import type { OnboardingView } from "../shared/onboarding";
|
|
28
28
|
import { withAlpha, isLight, mergedColor, type Colors } from "./theme";
|
|
29
|
+
import { UpdateNotice } from "./updates";
|
|
29
30
|
import { ReleaseNotesSheet, VersionLine, WhatsNewGate } from "./release-notes";
|
|
30
31
|
|
|
31
32
|
export const HOME_SCREEN = "follow-through";
|
|
@@ -121,7 +122,8 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
|
|
|
121
122
|
|
|
122
123
|
// null: closed; false: What's new since the previous version; true: every version.
|
|
123
124
|
const [notesOpen, setNotesOpen] = useState<boolean | null>(null);
|
|
124
|
-
const
|
|
125
|
+
const updateNotice = <UpdateNotice theme={theme} compact={compact} openSettings={deps.openSettings} />;
|
|
126
|
+
const updatesFooter = <VersionLine theme={theme} compact={compact} onOpen={setNotesOpen} />;
|
|
125
127
|
const updateSheets = <>
|
|
126
128
|
<WhatsNewGate surface="home" theme={theme} compact={compact} />
|
|
127
129
|
{notesOpen != null && <ReleaseNotesSheet theme={theme} compact={compact} all={notesOpen} onClose={() => setNotesOpen(null)} />}
|
|
@@ -140,8 +142,8 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
|
|
|
140
142
|
// Phones: the host header already says Follow-up, so no "Home" title row; search, sort and settings share one row and
|
|
141
143
|
// the meters move to the end of the list.
|
|
142
144
|
footer={omnibox.results ? undefined : compact
|
|
143
|
-
? <View style={{ paddingTop: 16, paddingBottom: 96, gap: 12 }}>{!nothing && <UsageMeters theme={theme} sources={deps.sources} dense />}{
|
|
144
|
-
:
|
|
145
|
+
? <View style={{ paddingTop: 16, paddingBottom: 96, gap: 12 }}>{!nothing && <UsageMeters theme={theme} sources={deps.sources} dense />}{updatesFooter}</View>
|
|
146
|
+
: updatesFooter}
|
|
145
147
|
// Phones: the setup offer goes after the Needs-you group when there is one, so the first ask stays high.
|
|
146
148
|
afterNeeds={compact && model.needs > 0 ? <SetupOffer theme={theme} compact view={props.onboarding} /> : undefined}
|
|
147
149
|
emptyAction={compact ? <Button theme={theme} compact kind="secondary" icon="Settings" title="Project settings" onPress={deps.openSettings} /> : undefined}
|
|
@@ -159,10 +161,11 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
|
|
|
159
161
|
</ListTop>}
|
|
160
162
|
// Phones: only the search row stays pinned; the status chips and the setup offer scroll away with the list, so a
|
|
161
163
|
// scrolled list keeps the screen instead of sitting under a 250px block.
|
|
162
|
-
header={
|
|
164
|
+
header={omnibox.results ? undefined : compact ? <View style={{ gap: 8, paddingTop: 6, paddingBottom: 6 }}>
|
|
163
165
|
<StatusStrip theme={theme} model={model} filter={filter} onFilter={setFilter} touch dense />
|
|
166
|
+
{updateNotice}
|
|
164
167
|
{model.needs === 0 && <SetupOffer theme={theme} compact view={props.onboarding} />}
|
|
165
|
-
</View> :
|
|
168
|
+
</View> : updateNotice} />;
|
|
166
169
|
|
|
167
170
|
if (compact) return <View style={{ flex: 1, backgroundColor: c.surface0 }}>
|
|
168
171
|
{current || selected === OVERSEER_KEY && overseer || selected === BRIEF_KEY ? detail : list}
|
package/client/onboarding.tsx
CHANGED
|
@@ -9,11 +9,12 @@ import { ONBOARDING_STEPS, autoSendWrites, checksSummary, type Check, type Onboa
|
|
|
9
9
|
import { Button, IconButton, errorText, text, type Theme } from "./kit";
|
|
10
10
|
import { ReviewerSettings } from "./reviewers";
|
|
11
11
|
import { ShippingStep } from "./shipping";
|
|
12
|
+
import { UpdatesStep } from "./updates";
|
|
12
13
|
import { Spinner, useReducedMotion } from "./motion";
|
|
13
14
|
import { raised, runningColor, tint, withAlpha, type Colors } from "./theme";
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
|
-
* Getting started:
|
|
17
|
+
* Getting started: the steps that take a fresh install to a configured Follow-up. Shown in Home's place while the
|
|
17
18
|
* server says so (fresh install, or "Set up Follow-up again"), never forced on an existing install.
|
|
18
19
|
* Every switch writes through the Settings screen's own RPC or settings document as it changes; the flow itself only
|
|
19
20
|
* saves which step it's on, so a reload resumes there.
|
|
@@ -40,6 +41,7 @@ const TITLES: Record<OnboardingStep, string> = {
|
|
|
40
41
|
defaults: "What Follow-up does without asking",
|
|
41
42
|
shipping: "How do you ship PRs?",
|
|
42
43
|
reviewers: "Who should review your PRs?",
|
|
44
|
+
updates: "Keep Follow-up up to date",
|
|
43
45
|
helpers: "Helpers, and where things are",
|
|
44
46
|
};
|
|
45
47
|
|
|
@@ -79,6 +81,7 @@ export function Setup({ theme, compact, view, deps }: { theme: Theme; compact: b
|
|
|
79
81
|
: step === "defaults" ? <DefaultsStep theme={theme} compact={compact} held={view.holdsAutoSends} />
|
|
80
82
|
: step === "shipping" ? <ShippingStep theme={theme} compact={compact} />
|
|
81
83
|
: step === "reviewers" ? <ReviewerSettings theme={theme} compact={compact} />
|
|
84
|
+
: step === "updates" ? <UpdatesStep theme={theme} compact={compact} />
|
|
82
85
|
: <HelpersStep theme={theme} compact={compact} deps={deps} checks={checks.data?.checks ?? null} />;
|
|
83
86
|
const lead: Record<OnboardingStep, string> = {
|
|
84
87
|
intro: "It follows your agents' pull requests until the work is done, sends fixes back to them, and asks you only for decisions.",
|
|
@@ -86,6 +89,7 @@ export function Setup({ theme, compact, view, deps }: { theme: Theme; compact: b
|
|
|
86
89
|
defaults: "These are on now. Change anything here; it saves as you go, and Settings has the same switches.",
|
|
87
90
|
shipping: "Follow-up merges and tracks PRs the way each repository already works. It picked these; change one if it's wrong.",
|
|
88
91
|
reviewers: "When you press Add reviewers on a PR, Follow-up asks these people. Set a default for all repositories, or a list for one. Until then, PRs without reviewers show in Needs you.",
|
|
92
|
+
updates: "New versions fix problems and add features. Follow-up can install them for you, at a moment when no agent is using it, and goes back to the old version if something breaks.",
|
|
89
93
|
helpers: "Two optional agents. They read, summarise and rank. They never change code or message anyone.",
|
|
90
94
|
};
|
|
91
95
|
const column: ViewStyle = { width: "100%", maxWidth: 560, alignSelf: "center", paddingHorizontal: compact ? 16 : 24 };
|
package/client/questions.tsx
CHANGED
|
@@ -43,9 +43,10 @@ function deliveryLine(w: Workspace, q: Question, now: number): { icon: string; t
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
/** A radio card: the question options, and setup's Updates choice (no letter there). */
|
|
47
|
+
export function OptionCard({ theme, letter, label, consequence, recommended, selected, disabled, onPress, compact, dense = false }: { theme: Theme; letter?: string; label: string; consequence?: string; recommended: boolean; selected: boolean; disabled: boolean; onPress: () => void; compact: boolean; dense?: boolean }) {
|
|
47
48
|
const c = theme.colors; const t = text(c);
|
|
48
|
-
return <Pressable accessibilityRole="radio" aria-checked={selected} accessibilityState={{ checked: selected, disabled }} accessibilityLabel={`${letter}. ${label}${recommended ? ". Recommended" : ""}${consequence ? `. ${consequence}` : ""}`}
|
|
49
|
+
return <Pressable accessibilityRole="radio" aria-checked={selected} accessibilityState={{ checked: selected, disabled }} accessibilityLabel={`${letter ? `${letter}. ` : ""}${label}${recommended ? ". Recommended" : ""}${consequence ? `. ${consequence}` : ""}`}
|
|
49
50
|
disabled={disabled} onPress={onPress}
|
|
50
51
|
style={state => ({ flexDirection: "row", gap: 10, paddingHorizontal: dense ? 10 : 12, paddingVertical: compact ? 12 : dense ? 8 : 10, borderRadius: 8, borderWidth: selected ? 1.5 : 1,
|
|
51
52
|
borderColor: selected ? c.accent : c.border, margin: selected ? 0 : 0.5,
|
|
@@ -53,7 +54,7 @@ function OptionCard({ theme, letter, label, consequence, recommended, selected,
|
|
|
53
54
|
<View style={{ width: 18, height: 18, marginTop: 1, borderRadius: 9, borderWidth: selected ? 5 : 1.5, borderColor: selected ? c.accent : c.foregroundMuted }} />
|
|
54
55
|
<View style={{ flex: 1, minWidth: 0, gap: 2 }}>
|
|
55
56
|
<View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", columnGap: 8, rowGap: 4 }}>
|
|
56
|
-
<Text style={t.label}
|
|
57
|
+
<Text style={t.label}>{letter ? <><Text style={{ fontVariant: ["tabular-nums"] }}>{letter}</Text>{" "}</> : null}{label}</Text>
|
|
57
58
|
{recommended && <Chip theme={theme} icon="ThumbsUp" label="Recommended" color={c.foregroundMuted} />}
|
|
58
59
|
</View>
|
|
59
60
|
{!!consequence && <Text numberOfLines={dense ? 2 : undefined} style={t.meta}>{consequence}</Text>}
|
package/client/settings.tsx
CHANGED
|
@@ -11,12 +11,11 @@ import { DisplaySections, PermissionsSection, PreferenceSwitch } from "./display
|
|
|
11
11
|
import { ReviewerSettings, reviewerSettingsKey } from "./reviewers";
|
|
12
12
|
import { AgentSettings, WaitSettings, agentSettingsKey } from "./agents";
|
|
13
13
|
import { ShippingSettings } from "./shipping";
|
|
14
|
+
import { UpdatesSections, useUpdates } from "./updates";
|
|
15
|
+
import { generalSummary } from "../shared/updates";
|
|
14
16
|
import { BackHeader, CategoryList, CategoryTabs, Disclosure } from "./settings-shell";
|
|
15
17
|
import { useOnboarding } from "./onboarding";
|
|
16
|
-
import {
|
|
17
|
-
import { ReleaseNotesSheet, releaseNotesKey, useReleaseNotes } from "./release-notes";
|
|
18
|
-
import type { ReleaseNotesView } from "../shared/changelog";
|
|
19
|
-
import type { OnboardingView } from "../shared/onboarding";
|
|
18
|
+
import { setupEntry, type SetupEntry } from "../shared/onboarding";
|
|
20
19
|
import {
|
|
21
20
|
categoryTitle, followingSummary, hasSavedCategory, projectsOpenByDefault, projectsSummary, readCategory, reviewersSummary, workspaceRows, workspaceState, workspacesOpenByDefault, workspacesSummary,
|
|
22
21
|
writeCategory, type SettingsCategory, type WorkspaceSetting,
|
|
@@ -179,21 +178,11 @@ function AgentsCategory({ theme, compact }: { theme: Theme; compact: boolean })
|
|
|
179
178
|
* "Set up Follow-up again" is the first row, so it's on the first screen Settings opens on.
|
|
180
179
|
*/
|
|
181
180
|
function GeneralCategory({ theme, compact, setup }: { theme: Theme; compact: boolean; setup?: { entry: SetupEntry; open: () => void } }) {
|
|
182
|
-
const notes = useReleaseNotes();
|
|
183
|
-
const [sheet, setSheet] = useState<boolean | null>(null);
|
|
184
|
-
const version = notes.data?.version;
|
|
185
181
|
return <>
|
|
186
182
|
{setup && <SettingsSection title="Setup">
|
|
187
183
|
<SettingsCard><SettingsAction label={setup.entry.label} hint={setup.entry.hint} actionLabel={setup.entry.action} onPress={setup.open} /></SettingsCard>
|
|
188
184
|
</SettingsSection>}
|
|
189
|
-
<
|
|
190
|
-
<SettingsCard>
|
|
191
|
-
<SettingsAction label={version ? `Follow-up ${version}` : "Follow-up"} hint={notes.isError ? "Couldn't read the release notes." : "Installed version."}
|
|
192
|
-
actionLabel="What's new" onPress={() => setSheet(false)} />
|
|
193
|
-
<SettingsAction label="Older versions" hint="Every release, newest first." actionLabel="Open" onPress={() => setSheet(true)} />
|
|
194
|
-
</SettingsCard>
|
|
195
|
-
</SettingsSection>
|
|
196
|
-
{sheet != null && <ReleaseNotesSheet theme={theme} compact={compact} all={sheet} onClose={() => setSheet(null)} />}
|
|
185
|
+
<UpdatesSections theme={theme} compact={compact} />
|
|
197
186
|
</>;
|
|
198
187
|
}
|
|
199
188
|
|
|
@@ -204,10 +193,10 @@ function useSummaries(): Partial<Record<SettingsCategory, string | null>> {
|
|
|
204
193
|
const reviewers = useQuery({ queryKey: reviewerSettingsKey, queryFn: skipToken }).data as { config: ReviewerConfig } | undefined;
|
|
205
194
|
const agents = useQuery({ queryKey: agentSettingsKey, queryFn: skipToken }).data as AgentSettingsView | undefined;
|
|
206
195
|
const changed = agents?.roles.filter(r => !r.isDefault).length ?? 0;
|
|
207
|
-
|
|
208
|
-
const
|
|
196
|
+
// General's line reads the updates view (local files, no npm request), so the phone list shows it before a drill-in.
|
|
197
|
+
const updates = useUpdates().data;
|
|
209
198
|
return {
|
|
210
|
-
general: generalSummary(
|
|
199
|
+
general: updates ? generalSummary(updates) : null,
|
|
211
200
|
following: follow ? followingSummary(follow) : null,
|
|
212
201
|
reviewers: reviewers ? reviewersSummary(reviewers.config) : null,
|
|
213
202
|
agents: agents ? (changed ? `${changed} of ${agents.roles.length} changed from the defaults` : "Every agent on its default") : null,
|
|
@@ -229,8 +218,6 @@ export function FollowSettings({ theme, layout, openSetup }: PluginSurfaceProps
|
|
|
229
218
|
const pick = (id: SettingsCategory) => { writeCategory(id); setCategory(id); };
|
|
230
219
|
// "Set up Follow-up again" leads General, the first category: what it says depends on where setup stands.
|
|
231
220
|
const onboarding = useOnboarding();
|
|
232
|
-
// Loaded up front (cached for good) so General's line in the phone list can name the version.
|
|
233
|
-
useReleaseNotes();
|
|
234
221
|
const entry = setupEntry(onboarding.data);
|
|
235
222
|
const setup = openSetup ? { entry, open: () => openSetup(entry.resume) } : undefined;
|
|
236
223
|
const content = category === "general" ? <GeneralCategory theme={theme} compact={compact} setup={setup} />
|
|
@@ -253,7 +240,7 @@ export function FollowSettings({ theme, layout, openSetup }: PluginSurfaceProps
|
|
|
253
240
|
const line = summaries[category];
|
|
254
241
|
return <ScrollView style={{ flex: 1, backgroundColor: c.surface0 }} stickyHeaderIndices={[0]} contentContainerStyle={{ ...page, paddingTop: 0 }}>
|
|
255
242
|
<View style={{ paddingTop: 24, backgroundColor: c.surface0 }}><CategoryTabs value={category} onChange={pick} theme={theme} /></View>
|
|
256
|
-
{/* General
|
|
243
|
+
{/* General's status card says it already; its line is for the phone list. */}
|
|
257
244
|
{line && category !== "general" ? <Text style={[t.meta, { marginTop: -6 }]}>{line}</Text> : null}
|
|
258
245
|
{content}
|
|
259
246
|
</ScrollView>;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { Pressable, Text, View } from "react-native";
|
|
3
|
+
import { openExternalUrl, useRpc } from "@getpaseo/plugin/client";
|
|
4
|
+
import { Icon, SettingsAction, SettingsCard, SettingsSection, SettingsSelect, copyText, useToast } from "@getpaseo/plugin/client/ui";
|
|
5
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
|
+
import { dismissUpdateNoticeRpc, installUpdateRpc, setUpdatesRpc, updatesRpc } from "../shared/contracts";
|
|
7
|
+
import { MODE_HINT, MODE_LABEL, UPDATE_MODES, channelHint, checkedText, copyCommand, statusCopy, type StatusAction, type UpdateMode, type UpdatesView } from "../shared/updates";
|
|
8
|
+
import { writeCategory } from "../shared/settings-nav";
|
|
9
|
+
import type { Channel } from "../shared/version";
|
|
10
|
+
import { Button, errorText, space, text, useNow, type Theme } from "./kit";
|
|
11
|
+
import { Spinner } from "./motion";
|
|
12
|
+
import { Disclosure } from "./settings-shell";
|
|
13
|
+
import { withAlpha } from "./theme";
|
|
14
|
+
import { OptionCard } from "./questions";
|
|
15
|
+
import { ReleaseNotesSheet, VersionNotes } from "./release-notes";
|
|
16
|
+
|
|
17
|
+
export const updatesKey = ["follow-through", "updates"];
|
|
18
|
+
|
|
19
|
+
/** The server's updates view. Reading it never asks the registry; `check` does (rate-limited on the server). */
|
|
20
|
+
export function useUpdates(check?: "settings") {
|
|
21
|
+
const read = useRpc(updatesRpc);
|
|
22
|
+
return useQuery({ queryKey: updatesKey, queryFn: () => read(check ? { check } : {}), staleTime: 60_000,
|
|
23
|
+
// While installing, the plugin reloads under us: keep asking every few seconds until it's back.
|
|
24
|
+
refetchInterval: q => { const k = (q.state.data as UpdatesView | undefined)?.phase.kind; return k === "installing" || k === "checking" ? 3000 : false; } });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const toneColor = (tone: "success" | "warning" | "muted", c: Theme["colors"]) => tone === "success" ? c.statusSuccess : tone === "warning" ? c.statusWarning : c.foregroundMuted;
|
|
28
|
+
/** Home's top line: an update to install (Tell me mode) or a rollback. One slot; the rollback wins. */
|
|
29
|
+
export function UpdateNotice({ theme, compact, openSettings }: { theme: Theme; compact: boolean; openSettings: () => void }) {
|
|
30
|
+
const c = theme.colors; const t = text(c);
|
|
31
|
+
const query = useUpdates(); const cache = useQueryClient(); const toast = useToast();
|
|
32
|
+
const dismiss = useRpc(dismissUpdateNoticeRpc); const install = useRpc(installUpdateRpc);
|
|
33
|
+
const [confirm, setConfirm] = useState(false);
|
|
34
|
+
const run = useMutation({ mutationFn: (fn: () => Promise<UpdatesView>) => fn(), onSuccess: v => cache.setQueryData(updatesKey, v), onError: e => toast.error(errorText(e)) });
|
|
35
|
+
const n = query.data?.notice;
|
|
36
|
+
if (!n) return null;
|
|
37
|
+
const rolled = n.kind === "rolled-back";
|
|
38
|
+
const title = rolled ? `Update to ${n.version} failed, rolled back` : `Follow-up ${n.version} is available`;
|
|
39
|
+
const detail = rolled ? `You're on ${n.from} again. Nothing to do.` : "Installing reloads Follow-up for a few seconds.";
|
|
40
|
+
return <View accessibilityRole="summary" style={{ marginHorizontal: compact ? space(true).gutter : 24, marginTop: 8, marginBottom: 4, borderRadius: 8, borderWidth: 1,
|
|
41
|
+
borderColor: rolled ? withAlpha(c.statusWarning, 0.6) : c.border, backgroundColor: c.surface1, paddingHorizontal: 12, paddingVertical: 10, gap: 8 }}>
|
|
42
|
+
<View style={{ flexDirection: "row", alignItems: "flex-start", gap: 10 }}>
|
|
43
|
+
<View style={{ paddingTop: 2 }}><Icon name={rolled ? "Undo2" : "CircleArrowUp"} size={15} color={rolled ? c.statusWarning : c.foregroundMuted} /></View>
|
|
44
|
+
<View style={{ flex: 1, minWidth: 0, gap: 2 }}>
|
|
45
|
+
<Text style={t.label}>{title}</Text>
|
|
46
|
+
<Text style={t.meta}>{confirm ? "Some agents are mid-turn. Open agent chats lose Follow-up's tools until you reopen them; their work and history are kept." : detail}</Text>
|
|
47
|
+
</View>
|
|
48
|
+
<Pressable accessibilityRole="button" accessibilityLabel={rolled ? "Dismiss" : "Not now"} hitSlop={8} onPress={() => run.mutate(() => dismiss({ id: n.id }))}
|
|
49
|
+
style={state => ({ width: compact ? 44 : 32, height: compact ? 44 : 32, marginTop: compact ? -12 : -6, marginRight: compact ? -12 : -8, alignItems: "center", justifyContent: "center", borderRadius: 6, backgroundColor: state.pressed ? c.surface2 : "transparent" })}>
|
|
50
|
+
<Icon name="X" size={14} color={c.foregroundMuted} />
|
|
51
|
+
</Pressable>
|
|
52
|
+
</View>
|
|
53
|
+
<View style={{ flexDirection: "row", gap: 8, paddingLeft: 25 }}>
|
|
54
|
+
{rolled ? <Button title="Details" theme={theme} compact={compact} onPress={() => { writeCategory("general"); openSettings(); }} />
|
|
55
|
+
: confirm ? <>
|
|
56
|
+
<Button title="Install now" theme={theme} compact={compact} loading={run.isPending} onPress={() => run.mutate(() => install({ version: n.version, anyway: true }))} />
|
|
57
|
+
<Button title="Cancel" kind="ghost" theme={theme} compact={compact} onPress={() => setConfirm(false)} />
|
|
58
|
+
</> : <Button title="Install" theme={theme} compact={compact} loading={run.isPending} onPress={() => run.mutate(async () => { const v = await install({ version: n.version }); if (v.phase.kind === "waiting" && v.phase.busy) setConfirm(true); return v; })} />}
|
|
59
|
+
</View>
|
|
60
|
+
</View>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** The status card at the top of Settings → General. */
|
|
64
|
+
function StatusCard({ view, theme, compact, onWhatsNew }: { view: UpdatesView; theme: Theme; compact: boolean; onWhatsNew: () => void }) {
|
|
65
|
+
const c = theme.colors; const t = text(c);
|
|
66
|
+
const now = useNow(30_000);
|
|
67
|
+
const read = useRpc(updatesRpc); const install = useRpc(installUpdateRpc);
|
|
68
|
+
const cache = useQueryClient(); const toast = useToast();
|
|
69
|
+
const [confirm, setConfirm] = useState(false);
|
|
70
|
+
const run = useMutation({ mutationFn: (fn: () => Promise<UpdatesView>) => fn(), onSuccess: v => cache.setQueryData(updatesKey, v), onError: e => toast.error(errorText(e)) });
|
|
71
|
+
const s = statusCopy(view, now);
|
|
72
|
+
const color = toneColor(s.tone, c);
|
|
73
|
+
const p = view.phase;
|
|
74
|
+
const version = "version" in p ? p.version : view.version;
|
|
75
|
+
const act: Record<StatusAction, { title: string; onPress: () => void; icon?: string }> = {
|
|
76
|
+
check: { title: "Check now", onPress: () => run.mutate(() => read({ check: "manual" })) },
|
|
77
|
+
install: { title: "Install now", onPress: () => run.mutate(async () => { const v = await install({ version }); if (v.phase.kind === "waiting" && v.phase.busy) setConfirm(true); return v; }) },
|
|
78
|
+
"install-anyway": { title: "Install now anyway", onPress: () => setConfirm(true) },
|
|
79
|
+
retry: { title: "Try again", onPress: () => run.mutate(() => install({ version })) },
|
|
80
|
+
"copy-details": { title: "Copy details", onPress: () => void copyText(`${s.title}\n${s.detail}`).then(() => toast.show("Copied"), () => toast.error("Couldn't copy")) },
|
|
81
|
+
"copy-command": { title: "Copy install command", onPress: () => void copyText(copyCommand(version)).then(() => toast.show("Copied. Run it on the computer running Paseo."), () => toast.error("Couldn't copy")) },
|
|
82
|
+
"view-npm": { title: "View on npm", onPress: () => void openExternalUrl(`https://www.npmjs.com/package/paseo-follow-up/v/${encodeURIComponent(version)}`).catch(() => undefined) },
|
|
83
|
+
"whats-new": { title: "What's new", onPress: onWhatsNew },
|
|
84
|
+
};
|
|
85
|
+
const checking = run.isPending && run.variables != null;
|
|
86
|
+
const pending = view.pendingNotes;
|
|
87
|
+
return <View style={{ borderRadius: 10, borderWidth: 1, borderColor: s.tone === "warning" ? withAlpha(c.statusWarning, 0.6) : c.border, backgroundColor: c.surface1, padding: compact ? 16 : 14, gap: 4 }}>
|
|
88
|
+
<View accessibilityLiveRegion="polite" style={{ flexDirection: "row", alignItems: "flex-start", gap: 10 }}>
|
|
89
|
+
<View style={{ width: 16, paddingTop: 1, alignItems: "center" }}>{s.spinning ? <Spinner color={color} size={14} /> : <Icon name={s.icon} size={16} color={color} />}</View>
|
|
90
|
+
<View style={{ flex: 1, minWidth: 0, gap: 4 }}>
|
|
91
|
+
<Text style={t.label}>{s.title}</Text>
|
|
92
|
+
<Text style={t.meta}>{confirm ? "Open agent chats lose Follow-up's tools until you reopen them. Their work and history are kept." : s.detail}</Text>
|
|
93
|
+
</View>
|
|
94
|
+
</View>
|
|
95
|
+
{(confirm || s.primary || s.secondary.length > 0 || view.installKind === "npm") && <View style={{ flexDirection: compact ? "column" : "row", alignItems: compact ? "stretch" : "center", gap: 8, marginTop: 10, paddingLeft: 26 }}>
|
|
96
|
+
{/* Phones: one full-width button per row, so a ghost button below a bordered one doesn't float. */}
|
|
97
|
+
<View style={compact ? { flexDirection: "column", alignItems: "stretch", gap: 8 } : { flexDirection: "row", flexWrap: "wrap", gap: 8, flex: 1 }}>
|
|
98
|
+
{confirm ? <>
|
|
99
|
+
<Button title="Install now" kind="primary" theme={theme} compact={compact} loading={run.isPending} onPress={() => run.mutate(() => install({ version, anyway: true }).finally(() => setConfirm(false)))} />
|
|
100
|
+
<Button title="Cancel" kind="ghost" theme={theme} compact={compact} onPress={() => setConfirm(false)} />
|
|
101
|
+
</> : <>
|
|
102
|
+
{s.primary && <Button title={act[s.primary].title} kind="primary" theme={theme} compact={compact} loading={run.isPending && s.primary === "install"} onPress={act[s.primary].onPress} />}
|
|
103
|
+
{s.secondary.map((a, i) => <Button key={a} title={act[a].title} kind={i === 0 && !s.primary ? "secondary" : "ghost"} theme={theme} compact={compact} loading={a === "check" && checking} onPress={act[a].onPress} />)}
|
|
104
|
+
</>}
|
|
105
|
+
</View>
|
|
106
|
+
{view.installKind === "npm" && <Text style={[t.small, compact ? null : { textAlign: "right" }]}>{checkedText(view.checkedAt, now)}</Text>}
|
|
107
|
+
</View>}
|
|
108
|
+
{pending.length > 0 && (p.kind === "available" || p.kind === "waiting" || p.kind === "untrusted") && <View style={{ marginTop: 12, paddingTop: 12, borderTopWidth: 1, borderTopColor: c.border, gap: 8, paddingLeft: 26 }}>
|
|
109
|
+
<Text style={t.small}>{`What's in ${pending[0]!.version}`}</Text>
|
|
110
|
+
<VersionNotes note={pending[0]!} theme={theme} max={6} />
|
|
111
|
+
{pending.length > 1 && <Text style={t.small}>{`and ${pending.length - 1} earlier version${pending.length === 2 ? "" : "s"} since yours`}</Text>}
|
|
112
|
+
</View>}
|
|
113
|
+
</View>;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const HISTORY_RESULT: Record<string, string> = { updated: "Updated", "rolled-back": "Rolled back", failed: "Failed", skipped: "Skipped" };
|
|
117
|
+
const stamp = (at: number) => { const d = new Date(at); return `${d.toLocaleDateString(undefined, { day: "numeric", month: "short" })} ${String(d.getHours()).padStart(2, "0")}:${String(d.getMinutes()).padStart(2, "0")}`; };
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Settings → General's updates: the status card (version, last check, Check now, what's available or went wrong),
|
|
121
|
+
* the two settings, all release notes and the history. Opening it asks npm at most once a minute, never when Off.
|
|
122
|
+
*/
|
|
123
|
+
export function UpdatesSections({ theme, compact }: { theme: Theme; compact: boolean }) {
|
|
124
|
+
const c = theme.colors; const t = text(c);
|
|
125
|
+
const query = useUpdates("settings");
|
|
126
|
+
const write = useRpc(setUpdatesRpc); const cache = useQueryClient(); const toast = useToast();
|
|
127
|
+
// null: closed; false: What's new (since the last update); true: every version.
|
|
128
|
+
const [sheet, setSheet] = useState<boolean | null>(null);
|
|
129
|
+
const save = useMutation({ mutationFn: (input: { mode?: UpdateMode; channel?: Channel }) => write(input), onSuccess: v => cache.setQueryData(updatesKey, v), onError: e => toast.error(errorText(e)) });
|
|
130
|
+
const view = query.data;
|
|
131
|
+
if (query.isLoading) return <Spinner color={c.foregroundMuted} size={16} label="Loading updates" />;
|
|
132
|
+
if (!view) return <SettingsSection title="Updates"><Text accessibilityRole="alert" style={{ color: c.statusDanger }}>{query.error ? errorText(query.error) : "Couldn't load updates."}</Text></SettingsSection>;
|
|
133
|
+
return <View style={{ gap: 18 }}>
|
|
134
|
+
<SettingsSection title="Updates">
|
|
135
|
+
<StatusCard view={view} theme={theme} compact={compact} onWhatsNew={() => setSheet(false)} />
|
|
136
|
+
</SettingsSection>
|
|
137
|
+
<SettingsSection title={view.installKind === "npm" ? "How Follow-up updates" : "Release notes"}>
|
|
138
|
+
<SettingsCard>
|
|
139
|
+
{view.installKind === "npm" && <>
|
|
140
|
+
<SettingsSelect<UpdateMode> label="When a new version is out" hint={MODE_HINT[view.mode]} value={view.mode} disabled={save.isPending}
|
|
141
|
+
options={UPDATE_MODES.map(m => ({ value: m, label: MODE_LABEL[m] }))} onValueChange={mode => save.mutate({ mode })} />
|
|
142
|
+
<SettingsSelect<Channel> label="Channel" hint={channelHint(view)} value={view.channel} disabled={save.isPending}
|
|
143
|
+
options={[{ value: "stable", label: "Stable" }, { value: "beta", label: "Beta" }]}
|
|
144
|
+
onValueChange={channel => save.mutate({ channel }, { onSuccess: () => toast.show(channel === "stable" ? "Switched to Stable. Nothing changes until a newer stable is out." : "Switched to Beta. The next check looks for betas.") })} />
|
|
145
|
+
</>}
|
|
146
|
+
<SettingsAction label="Release notes" hint={`Every version up to ${view.version}, newest first.`} actionLabel="See all" onPress={() => setSheet(true)} />
|
|
147
|
+
</SettingsCard>
|
|
148
|
+
</SettingsSection>
|
|
149
|
+
{view.installKind === "npm" && view.history.length > 0 && <Disclosure id="updates.history" title="Update history" summary={`${HISTORY_RESULT[view.history[0]!.result]} ${stamp(view.history[0]!.at)}`} defaultOpen={false} theme={theme} compact={compact}>
|
|
150
|
+
{view.history.slice(0, 10).map((h, i) => <View key={i} style={{ paddingHorizontal: compact ? 16 : 14, paddingVertical: 8, borderTopWidth: i ? 1 : 0, borderTopColor: c.border, gap: 2 }}>
|
|
151
|
+
<Text style={t.meta}>{`${stamp(h.at)} · ${h.from} → ${h.to} · ${HISTORY_RESULT[h.result]}`}</Text>
|
|
152
|
+
{h.reason && <Text style={t.small}>{h.reason}</Text>}
|
|
153
|
+
</View>)}
|
|
154
|
+
</Disclosure>}
|
|
155
|
+
{sheet != null && <ReleaseNotesSheet theme={theme} compact={compact} all={sheet} onClose={() => setSheet(null)} />}
|
|
156
|
+
</View>;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const SETUP_CARDS: { mode: UpdateMode; hint: string }[] = [
|
|
160
|
+
{ mode: "auto", hint: "Waits until your agents are idle. Rolls back if the new version fails." },
|
|
161
|
+
{ mode: "notify", hint: "Shows new versions on Home. You choose when to install." },
|
|
162
|
+
{ mode: "off", hint: "No checks. You can check from Settings → General." },
|
|
163
|
+
];
|
|
164
|
+
/**
|
|
165
|
+
* Setup's Updates step: the same RPCs and controls as Settings → General, as radio cards. Reads without asking npm.
|
|
166
|
+
* Saves on change; passing the step or skipping setup on a fresh install saves the pre-selected mode (server side).
|
|
167
|
+
*/
|
|
168
|
+
export function UpdatesStep({ theme, compact }: { theme: Theme; compact: boolean }) {
|
|
169
|
+
const c = theme.colors; const t = text(c);
|
|
170
|
+
const query = useUpdates();
|
|
171
|
+
const write = useRpc(setUpdatesRpc); const cache = useQueryClient(); const toast = useToast();
|
|
172
|
+
const save = useMutation({ mutationFn: (input: { mode?: UpdateMode; channel?: Channel }) => write(input), onSuccess: v => cache.setQueryData(updatesKey, v), onError: e => toast.error(errorText(e)) });
|
|
173
|
+
const view = query.data;
|
|
174
|
+
if (query.isLoading) return <Spinner color={c.foregroundMuted} size={16} label="Loading updates" />;
|
|
175
|
+
if (!view) return <Text accessibilityRole="alert" style={[t.meta, { color: c.statusDanger }]}>{query.error ? errorText(query.error) : "Couldn't load updates."}</Text>;
|
|
176
|
+
if (view.installKind !== "npm") return <Text style={t.body}>Updates are managed by your checkout. Pull and rebuild to update.</Text>;
|
|
177
|
+
return <View style={{ gap: 12 }}>
|
|
178
|
+
<View accessibilityRole="radiogroup" accessibilityLabel="Updates" style={{ gap: 6 }}>
|
|
179
|
+
{SETUP_CARDS.map(card => <OptionCard key={card.mode} theme={theme} compact={compact} label={MODE_LABEL[card.mode]} consequence={card.hint} recommended={card.mode === "auto"}
|
|
180
|
+
selected={view.mode === card.mode} disabled={save.isPending} onPress={() => view.mode !== card.mode && save.mutate({ mode: card.mode })} />)}
|
|
181
|
+
</View>
|
|
182
|
+
<SettingsCard>
|
|
183
|
+
<SettingsSelect<Channel> label="Channel" hint={channelHint(view)} value={view.channel} disabled={save.isPending}
|
|
184
|
+
options={[{ value: "stable", label: "Stable" }, { value: "beta", label: "Beta" }]} onValueChange={channel => save.mutate({ channel })} />
|
|
185
|
+
</SettingsCard>
|
|
186
|
+
<Text style={t.small}>Follow-up only installs versions npm confirms were built from github.com/tomgrin10/paseo-follow-up.</Text>
|
|
187
|
+
</View>;
|
|
188
|
+
}
|
package/index.server.ts
CHANGED
|
@@ -22,7 +22,7 @@ import { Graphite } from "./server/graphite";
|
|
|
22
22
|
import { BrowserBridge } from "./server/browser-bridge";
|
|
23
23
|
import { PrActions } from "./server/pr-actions";
|
|
24
24
|
import { AgentActions, AGENT_TOOLS, controlWorkspace, type AgentTool } from "./server/agent-actions";
|
|
25
|
-
import { PaseoGateway, paseoHome, clientEntry, closeConnections, sessionGuardOwnsInterruption } from "./server/daemon";
|
|
25
|
+
import { PaseoGateway, paseoHome, clientEntry, daemonOptions, closeConnections, sessionGuardOwnsInterruption } from "./server/daemon";
|
|
26
26
|
import { mcpSource } from "./server/mcp-source";
|
|
27
27
|
import { excludeStack } from "./server/exclusions";
|
|
28
28
|
import { applyHistory, applyDiscovery, extractHistory, mainWorkDue, markMainWork } from "./server/discovery";
|
|
@@ -64,9 +64,17 @@ import { AgentSettingsStore, ProviderCatalog, type CatalogSource } from "./serve
|
|
|
64
64
|
import { labelsFor, providerName, resolveRole, roleSummary, type AgentSettingsView } from "./shared/agent-settings";
|
|
65
65
|
import type { LoadSignals } from "./shared/agent-load";
|
|
66
66
|
import { OnboardingStore, ReadinessChecks, nativeAgentCount } from "./server/onboarding";
|
|
67
|
-
import {
|
|
67
|
+
import { updatesConsent } from "./shared/onboarding";
|
|
68
|
+
import { execFile, spawn } from "node:child_process";
|
|
68
69
|
import { compactHeap } from "./server/memory";
|
|
70
|
+
import { UpdatesStore } from "./server/updates";
|
|
71
|
+
import { Updater } from "./server/updater";
|
|
72
|
+
import { RegistryChecker, registryUrl, type RegistrySnapshot } from "./server/update-registry";
|
|
73
|
+
import { checkProvenance, tarballChangelog } from "./server/update-provenance";
|
|
74
|
+
import { watchdogSource } from "./server/update-watchdog-source";
|
|
75
|
+
import { busyAgents, type Busy } from "./shared/update-policy";
|
|
69
76
|
import { VersionsStore, demoOverride, describeSelf, readPackage, type SelfInstall } from "./server/release-notes";
|
|
77
|
+
import { updatesViewSchema, type UpdatesView } from "./shared/updates";
|
|
70
78
|
import { releaseNotesViewSchema, type ReleaseNote, type ReleaseNotesView } from "./shared/changelog";
|
|
71
79
|
import { BRIEF_KIND, BRIEF_VERSION, prState, validateNeedsYou, type Brief, type NeedsYouRecord } from "./shared/brief";
|
|
72
80
|
|
|
@@ -732,8 +740,9 @@ export default function contribute(server: PluginServerContext) {
|
|
|
732
740
|
const cat = catalog ? await providerCatalog.read(fresh) : null;
|
|
733
741
|
return { roles: Object.values(roles).map(r => ({ ...r, summary: roleSummary(r, labelsFor(r, cat)) })), invalid, catalog: cat, wait: await currentWait() };
|
|
734
742
|
};
|
|
735
|
-
// What's new. Follow-up's own install comes from Paseo's plugin list, read once per worker.
|
|
743
|
+
// What's new and Settings → General. Follow-up's own install comes from Paseo's plugin list, read once per worker.
|
|
736
744
|
const versions = new VersionsStore(directory);
|
|
745
|
+
const updatesStore = new UpdatesStore(directory);
|
|
737
746
|
let self: Promise<SelfInstall & { notes: ReleaseNote[] }> | null = null;
|
|
738
747
|
const selfInstall = () => self ??= withDaemon(async c => describeSelf(await c.listPlugins?.() ?? [])).then(async row => {
|
|
739
748
|
const pkg = row.path ? await readPackage(row.path) : { version: null, notes: [] };
|
|
@@ -752,6 +761,64 @@ export default function contribute(server: PluginServerContext) {
|
|
|
752
761
|
};
|
|
753
762
|
handle(rpc.releaseNotesRpc, async () => releaseNotesView());
|
|
754
763
|
handle(rpc.whatsNewSeenRpc, async ({ version }) => { await versions.seen(version); return releaseNotesView(); });
|
|
764
|
+
// Settings → General: see server/updater.ts. The registry snapshot lives in registry.json; installs run detached.
|
|
765
|
+
const registry = new RegistryChecker({ packageName: "paseo-follow-up", fetch: (url, init) => fetch(url, init),
|
|
766
|
+
load: () => readFile(join(directory, "registry.json"), "utf8").then(t => JSON.parse(t) as RegistrySnapshot, () => null),
|
|
767
|
+
save: async snap => { const tmp = join(directory, `registry.json.${process.pid}.tmp`); await writeFile(tmp, JSON.stringify(snap), { mode: 0o600 }); await rename(tmp, join(directory, "registry.json")); } });
|
|
768
|
+
const watchdogLock = join(directory, "update-watchdog.lock");
|
|
769
|
+
// Only the isolated update harness sets this: short quiet window and probation, so a rollback shows in minutes.
|
|
770
|
+
const fastUpdates = process.env.FOLLOW_UP_UPDATES_FAST === "1";
|
|
771
|
+
const installerAlive = async () => {
|
|
772
|
+
const lock = await readFile(watchdogLock, "utf8").then(t => JSON.parse(t) as { pid?: number }, () => null);
|
|
773
|
+
if (!lock?.pid) return false;
|
|
774
|
+
try { process.kill(lock.pid, 0); return true; } catch (e) { return (e as NodeJS.ErrnoException).code === "EPERM"; }
|
|
775
|
+
};
|
|
776
|
+
const updater = new Updater({
|
|
777
|
+
directory, read: () => updatesStore.read(), defaultMode: () => onboarding.init().then(f => f.install === "fresh" ? "auto" as const : "notify" as const, () => "notify" as const), write: next => updatesStore.write(next), self: () => selfInstall(), registry,
|
|
778
|
+
changelog: (tarball, integrity) => tarballChangelog({ fetch: (url, init) => fetch(url, init), tarball, integrity }),
|
|
779
|
+
provenance: version => checkProvenance({ fetch: (url, init) => fetch(url, init), registry: registryUrl(), name: "paseo-follow-up", version }),
|
|
780
|
+
busy: async fresh => {
|
|
781
|
+
const busy: Busy[] = [];
|
|
782
|
+
const rows = await gateway.directory.read(fresh ? { fresh: "agents" } : {});
|
|
783
|
+
const agents = busyAgents(rows.agents.map(({ agent }) => ({ status: agent.status, archivedAt: agent.archivedAt, hasFollowTools: true })));
|
|
784
|
+
if (agents) busy.push({ kind: "agent", count: agents });
|
|
785
|
+
if (ranker?.isRunning()) busy.push({ kind: "ranker" });
|
|
786
|
+
else if (aiJobs.active > 0) busy.push({ kind: "about" });
|
|
787
|
+
const state = await store.snapshot();
|
|
788
|
+
const prActions = state.workspaces.reduce((n, w) => n + w.prActions.filter(a => a.state === "sending").length, 0);
|
|
789
|
+
const repairs = state.workspaces.reduce((n, w) => n + w.batches.filter(b => b.state === "sending").length, 0);
|
|
790
|
+
if (prActions) busy.push({ kind: "pr-action", count: prActions });
|
|
791
|
+
if (repairs) busy.push({ kind: "repair", count: repairs });
|
|
792
|
+
return busy;
|
|
793
|
+
},
|
|
794
|
+
installerAlive,
|
|
795
|
+
spawn: async job => {
|
|
796
|
+
if (await installerAlive()) return false;
|
|
797
|
+
const script = join(directory, "update-watchdog.mjs");
|
|
798
|
+
await writeFile(script, watchdogSource, { mode: 0o600 });
|
|
799
|
+
const env = { ...process.env, FOLLOW_UP_UPDATE_JOB: JSON.stringify({ ...job, directory, pluginId: "follow-through", clientEntry: clientEntry(), daemon: await daemonOptions(), ...(fastUpdates ? { timing: { probationMs: 60_000, loadTimeoutMs: 45_000, watchEveryMs: 5_000 } } : {}) }) };
|
|
800
|
+
const child = spawn(process.execPath, [script], { detached: true, stdio: "ignore", env });
|
|
801
|
+
child.unref();
|
|
802
|
+
await writeFile(watchdogLock, JSON.stringify({ pid: child.pid, to: job.to }), { mode: 0o600 });
|
|
803
|
+
return true;
|
|
804
|
+
},
|
|
805
|
+
log: message => console.warn(message),
|
|
806
|
+
timing: fastUpdates ? { quietMs: 90_000, probationMs: 60_000 } : undefined,
|
|
807
|
+
});
|
|
808
|
+
const updatesView = async (): Promise<UpdatesView> => demoOverride(directory, "updates", updatesViewSchema, await updater.view());
|
|
809
|
+
// The new worker reports in for the installer's probation once it is ready, with the reason if it couldn't start.
|
|
810
|
+
void ready.then(async () => {
|
|
811
|
+
const me = await selfInstall();
|
|
812
|
+
await writeFile(join(directory, "heartbeat.json"), JSON.stringify({ version: me.version, at: Date.now(), error: loadError ? String(loadError).slice(0, 300) : null }), { mode: 0o600 });
|
|
813
|
+
if (!stopped) await updater.start();
|
|
814
|
+
}).catch(() => undefined);
|
|
815
|
+
handle(rpc.updatesRpc, async ({ check }) => {
|
|
816
|
+
if (check) await updater.check(check).catch(() => undefined);
|
|
817
|
+
return updatesView();
|
|
818
|
+
});
|
|
819
|
+
handle(rpc.setUpdatesRpc, async ({ mode, channel }) => { await updater.setSettings({ mode, channel }); return updatesView(); });
|
|
820
|
+
handle(rpc.installUpdateRpc, async ({ version, anyway }) => { await updater.install(version, !!anyway); return updatesView(); });
|
|
821
|
+
handle(rpc.dismissUpdateNoticeRpc, async ({ id }) => { await updater.dismiss(id); return updatesView(); });
|
|
755
822
|
handle(rpc.agentSettingsRpc, async ({ catalog, fresh }, { paseo }) => { await requireReady(); seen(paseo); return agentSettingsView(!!catalog, !!fresh); });
|
|
756
823
|
handle(rpc.setAgentSettingRpc, async ({ role, entry }, { paseo }) => { await requireReady(); seen(paseo); await agentSettings.save(role, entry); return agentSettingsView(true); });
|
|
757
824
|
handle(rpc.setWaitRpc, async ({ enable_wait }, { paseo }) => { await requireReady(); seen(paseo); await agentSettings.setWait(enable_wait); return agentSettingsView(true); });
|
|
@@ -947,7 +1014,15 @@ export default function contribute(server: PluginServerContext) {
|
|
|
947
1014
|
}).catch(() => undefined);
|
|
948
1015
|
handle(rpc.trustBypassRpc, async () => trust.recent(20));
|
|
949
1016
|
handle(rpc.onboardingRpc, async () => { await requireReady(); return onboarding.view(); });
|
|
950
|
-
handle(rpc.setOnboardingRpc, async ({ action, step }) => {
|
|
1017
|
+
handle(rpc.setOnboardingRpc, async ({ action, step }) => {
|
|
1018
|
+
await requireReady();
|
|
1019
|
+
const before = await onboarding.init();
|
|
1020
|
+
const view = await onboarding.act(action, step ?? null);
|
|
1021
|
+
// A fresh install passing the Updates step, or skipping setup, takes Install automatically (see updatesConsent).
|
|
1022
|
+
if (updatesConsent({ install: before.install, settled: !!before.settledAt, action, from: before.step, to: step ?? null }) && !(await updatesStore.read()).mode)
|
|
1023
|
+
await updater.setSettings({ mode: "auto" }).catch(() => undefined);
|
|
1024
|
+
return view;
|
|
1025
|
+
});
|
|
951
1026
|
// Readiness checks for the setup flow: gh, the helper providers and whether tools attach. On demand only, cached.
|
|
952
1027
|
const readiness = new ReadinessChecks({
|
|
953
1028
|
gh: () => new Promise((resolve, reject) => execFile("gh", ["api", "user", "--jq", ".login"], { timeout: 10_000 }, (error, stdout, stderr) => error ? reject(Object.assign(error, { stderr })) : resolve(stdout))),
|
|
@@ -982,6 +1057,8 @@ export default function contribute(server: PluginServerContext) {
|
|
|
982
1057
|
server.on("agent.created", async event => { await ready; await gateway.directory.agentCreated(event.agent); }),
|
|
983
1058
|
server.on("workspace.created", async event => gateway.directory.workspaceCreated(event.workspace)),
|
|
984
1059
|
server.on("workspace.archived", async event => gateway.directory.workspaceArchived(event.workspace.id)),
|
|
1060
|
+
server.on("agent.turn_started", async () => updater.activity()),
|
|
1061
|
+
server.on("agent.turn_ended", async () => updater.activity()),
|
|
985
1062
|
server.on("agent.turn_started", async (event, { paseo }) => { seen(paseo); inboxHook(() => inbox.turnStarted(event.agent, event.turnId)); }),
|
|
986
1063
|
server.on("agent.turn_ended", async (event, { paseo }) => { seen(paseo); inboxHook(() => inbox.turnEnded(event.agent, event.outcome, event.turnId)); }),
|
|
987
1064
|
server.on("agent.permission_requested", async (event, { paseo }) => { seen(paseo); inboxHook(async () => { await inbox.permissionRequested(event.agent, event.request); await writeBriefState(); }); }),
|
|
@@ -1081,7 +1158,7 @@ export default function contribute(server: PluginServerContext) {
|
|
|
1081
1158
|
server.on("workspace.archived", async event => { await ready; if (!loadError && !stopped) await store.mutate(state => { const w = state.workspaces.find(w => w.id === event.workspace.id); if (w) w.archived = true; }); }),
|
|
1082
1159
|
];
|
|
1083
1160
|
return async () => {
|
|
1084
|
-
stopped = true; wait.close(); governor.stop(); if (timer) clearTimeout(timer); if (aboutTimer) clearTimeout(aboutTimer); aiJobs.stop(); ranker = null; if (inboxTimer) clearTimeout(inboxTimer); inbox.stop(); if (hookTimer) clearInterval(hookTimer); removers.forEach(remove => remove());
|
|
1161
|
+
stopped = true; wait.close(); updater.stop(); governor.stop(); if (timer) clearTimeout(timer); if (aboutTimer) clearTimeout(aboutTimer); aiJobs.stop(); ranker = null; if (inboxTimer) clearTimeout(inboxTimer); inbox.stop(); if (hookTimer) clearInterval(hookTimer); removers.forEach(remove => remove());
|
|
1085
1162
|
await ready; if (hooksStarted) await agentHooks.stop().catch(() => {});
|
|
1086
1163
|
await actions.close(); await closeConnections(); await engine.stop(); await ready; await store.flush().catch(() => undefined); await unlock?.();
|
|
1087
1164
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "paseo-follow-up",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.4.0-beta.
|
|
4
|
+
"version": "1.4.0-beta.32",
|
|
5
5
|
"description": "Follow every workspace PR stack in Paseo, answer agent questions, batch repairs for the main agent, and see what needs you.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
package/scripts/build.mjs
CHANGED
|
@@ -7,3 +7,5 @@ const overseer = await readFile(new URL("../server/overseer-prompt.md", import.m
|
|
|
7
7
|
await writeFile(new URL("../server/overseer-prompt-source.ts", import.meta.url), `// Generated by scripts/build.mjs from server/overseer-prompt.md.\nexport const overseerPrompt = ${JSON.stringify(overseer)};\n`);
|
|
8
8
|
const runner = await readFile(new URL("../server/wait-runner.sh", import.meta.url), "utf8");
|
|
9
9
|
await writeFile(new URL("../server/wait-runner-source.ts", import.meta.url), `// Generated by scripts/build.mjs from server/wait-runner.sh.\nexport const runnerSource = ${JSON.stringify(runner)};\n`);
|
|
10
|
+
const watchdog = await readFile(new URL("../server/update-watchdog.mjs", import.meta.url), "utf8");
|
|
11
|
+
await writeFile(new URL("../server/update-watchdog-source.ts", import.meta.url), `// Generated by scripts/build.mjs.\nexport const watchdogSource = ${JSON.stringify(watchdog)};\n`);
|