paseo-follow-up 1.4.0-beta.34 → 1.4.0-beta.36
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/README.md +1 -1
- package/client/agents.tsx +52 -87
- package/client/display.tsx +0 -13
- package/client/job-rows.tsx +206 -0
- package/client/onboarding.tsx +32 -38
- package/client/settings.tsx +15 -3
- package/index.server.ts +15 -4
- package/package.json +1 -1
- package/server/agent-hook.mjs +4 -0
- package/server/agent-settings.ts +6 -7
- package/server/ai-jobs.ts +8 -5
- package/server/background-agents.ts +49 -0
- package/server/daemon.ts +1 -1
- package/server/directory.ts +3 -0
- package/server/hook-source.ts +1 -1
- package/server/inbox-directory.ts +1 -1
- package/server/inbox.ts +10 -1
- package/server/job-agent.ts +83 -0
- package/server/mcp-source.ts +1 -1
- package/server/mcp.mjs +1 -1
- package/server/wait.ts +3 -2
- package/server/workspace-agent.ts +3 -1
- package/shared/agent-settings.ts +14 -11
- package/shared/job-rows.ts +134 -0
- package/shared/onboarding.ts +25 -15
- package/shared/recommend.ts +104 -0
package/README.md
CHANGED
|
@@ -238,7 +238,7 @@ This replaces the separate **Wait** plugin (`paseo-wait`). While that plugin is
|
|
|
238
238
|
Install the beta:
|
|
239
239
|
|
|
240
240
|
```sh
|
|
241
|
-
paseo plugin update follow-through --version 1.4.0-beta.
|
|
241
|
+
paseo plugin update follow-through --version 1.4.0-beta.36
|
|
242
242
|
# or, for a fresh install:
|
|
243
243
|
paseo plugin install npm:paseo-follow-up@beta
|
|
244
244
|
```
|
package/client/agents.tsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
1
|
import { ActivityIndicator, Text, View } from "react-native";
|
|
3
2
|
import type { PluginSurfaceProps } from "@getpaseo/plugin/client";
|
|
4
3
|
import { useRpc } from "@getpaseo/plugin/client";
|
|
@@ -6,52 +5,38 @@ import { SettingsAction, SettingsCard, SettingsSection, SettingsSelect, Settings
|
|
|
6
5
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
7
6
|
import { agentSettingsRpc, setAgentSettingRpc, setWaitRpc } from "../shared/contracts";
|
|
8
7
|
import { WAIT_HINT, WAIT_NOT_ATTACHED, WAIT_TITLE, waitNote } from "../shared/wait";
|
|
9
|
-
import {
|
|
8
|
+
import { isJobRole, type AgentRole, type AgentSettingsView, type SavedRole } from "../shared/agent-settings";
|
|
9
|
+
import { NO_PROMPT_MODE, SETTINGS_ORDER, isReset, resetEntry } from "../shared/job-rows";
|
|
10
|
+
import { JobRows, agentSettingsKey, useAgentSettings, type JobExtra } from "./job-rows";
|
|
10
11
|
import { Button, errorText, text, type Theme } from "./kit";
|
|
11
12
|
|
|
12
|
-
export
|
|
13
|
+
export { agentSettingsKey } from "./job-rows";
|
|
13
14
|
const key = agentSettingsKey;
|
|
14
|
-
const SAME = "__same";
|
|
15
15
|
const DEFAULT = "__default";
|
|
16
|
-
/** Each provider's "don't ask" mode, used when a Paseo agent role moves to it. */
|
|
17
|
-
const BYPASS: Record<string, string> = { claude: "bypassPermissions", codex: "full-access" };
|
|
18
16
|
|
|
19
17
|
type Role = AgentSettingsView["roles"][number];
|
|
20
18
|
|
|
21
19
|
/**
|
|
22
|
-
* Settings → Agents:
|
|
23
|
-
*
|
|
20
|
+
* Settings → Agents: the same job rows as setup's Helper agents step (client/job-rows.tsx), plus each row's More with
|
|
21
|
+
* what only Settings has: permissions, limits, schedule and Reset to defaults. The provider catalog is read once when
|
|
22
|
+
* this screen opens (cached on the server), never polled.
|
|
24
23
|
*/
|
|
25
|
-
export function AgentSettings({ theme, compact
|
|
24
|
+
export function AgentSettings({ theme, compact }: Pick<PluginSurfaceProps, "theme"> & { compact: boolean }) {
|
|
26
25
|
const c = theme.colors; const t = text(c);
|
|
27
|
-
const
|
|
28
|
-
const query = useQuery({ queryKey: key, queryFn: () => read({ catalog: true }), staleTime: 5 * 60_000,
|
|
29
|
-
// Only while Paseo is still discovering providers (right after it starts): ask again until they settle.
|
|
30
|
-
refetchInterval: q => (q.state.data as AgentSettingsView | undefined)?.catalog?.providers.some(p => p.reason === "Still loading") && q.state.dataUpdateCount < 10 ? 5000 : false });
|
|
31
|
-
const change = useMutation({
|
|
32
|
-
mutationFn: (input: { role: AgentRole; entry: SavedRole | null }) => write(input),
|
|
33
|
-
onSuccess: (value, input) => {
|
|
34
|
-
cache.setQueryData(key, value);
|
|
35
|
-
void cache.invalidateQueries({ queryKey: ["follow-through", "about"] });
|
|
36
|
-
const r = value.roles.find(x => x.role === input.role);
|
|
37
|
-
if (r) toast.show(input.role === "overseer" ? `Overseer: ${r.summary}. Restart it from Home to switch.` : `${ROLE_INFO[input.role].title}: ${r.summary}`, { variant: "success" });
|
|
38
|
-
},
|
|
39
|
-
onError: error => toast.error(errorText(error)),
|
|
40
|
-
});
|
|
26
|
+
const { query } = useAgentSettings();
|
|
41
27
|
const data = query.data;
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
{/* Once, after the
|
|
53
|
-
{!!data?.catalog
|
|
54
|
-
|
|
28
|
+
const more: JobExtra = {
|
|
29
|
+
// The toggle names what's inside, so nobody opens it to find out.
|
|
30
|
+
label: r => r.role === "ranker" ? "Schedule, limits and reset" : isJobRole(r.role) ? "Limits and reset" : r.same ? null : "Permissions and reset",
|
|
31
|
+
render: (r, save, busy) => <RoleMore r={r} save={save} busy={busy} theme={theme} compact={compact} invalid={!!data?.invalid.includes(r.role)} />,
|
|
32
|
+
};
|
|
33
|
+
const info = "Which agent Follow-up uses for each of its own jobs. Recommended picks come from what Paseo has: with Claude, Haiku for summaries, Sonnet for AI priority, the newest Opus for the Overseer and the main agent's setup for recovery; otherwise a model of the size each job needs. Summaries and AI priority are one-shot jobs: on a provider other than Claude or Codex, each runs as a short hidden agent that's archived when it answers. Changes apply from the next call; the Overseer switches when you restart it.";
|
|
34
|
+
return <SettingsSection title="Helper agents" info={info}>
|
|
35
|
+
<SettingsCard>
|
|
36
|
+
<JobRows theme={theme} compact={compact} order={SETTINGS_ORDER} extra={more} />
|
|
37
|
+
</SettingsCard>
|
|
38
|
+
{/* Once, after the rows: what can't be picked and why (the pickers only list what can). */}
|
|
39
|
+
{!!data?.catalog && unavailableLine(data.catalog.providers) && <Text style={[t.meta, { paddingHorizontal: 4 }]}>{unavailableLine(data.catalog.providers)}</Text>}
|
|
55
40
|
</SettingsSection>;
|
|
56
41
|
}
|
|
57
42
|
|
|
@@ -82,64 +67,27 @@ export function WaitSettings({ theme }: Pick<PluginSurfaceProps, "theme">) {
|
|
|
82
67
|
</SettingsSection>;
|
|
83
68
|
}
|
|
84
69
|
|
|
85
|
-
|
|
70
|
+
/** A row's More in Settings: permissions (Paseo agents), limits and schedule (jobs), and Reset to defaults. */
|
|
71
|
+
function RoleMore({ r, save, busy, theme, compact, invalid }: { r: Role; save: (entry: SavedRole | null) => void; busy: boolean; theme: Theme; compact: boolean; invalid: boolean }) {
|
|
86
72
|
const c = theme.colors; const t = text(c);
|
|
73
|
+
const { query } = useAgentSettings();
|
|
74
|
+
const catalog = query.data?.catalog?.providers ?? [];
|
|
87
75
|
const role = r.role;
|
|
88
76
|
const jobs = isJobRole(role);
|
|
89
|
-
const usable = catalog.filter(p => p.available && (!jobs || (JOB_PROVIDERS as readonly string[]).includes(p.id)));
|
|
90
77
|
const current = catalog.find(p => p.id === r.provider);
|
|
91
78
|
const base: SavedRole = { provider: r.provider, model: r.model, thinking: r.thinking, ...(jobs ? {} : { mode: r.mode }), ...(role === "recovery" ? { same: r.same } : {}),
|
|
92
79
|
...(jobs ? { dailyCap: r.dailyCap ?? undefined, maxPromptChars: r.maxPromptChars ?? undefined } : {}), ...(role === "ranker" ? { cadenceMinutes: r.cadenceMinutes ?? undefined } : {}) };
|
|
93
80
|
const set = (patch: SavedRole) => save({ ...base, ...patch });
|
|
94
|
-
const providerLabel = providerName(r.provider, current?.label);
|
|
95
|
-
// Saved on a provider Paseo can't use right now: say so plainly, with what happens and the way out.
|
|
96
|
-
const blocked = !r.same && catalog.length > 0 && !usable.some(p => p.id === r.provider);
|
|
97
|
-
const blockedReason = !current ? "not in Paseo's provider list" : !current.available ? (current.reason ?? "unavailable").replace(/\.$/, "") : "can't run one-shot jobs";
|
|
98
|
-
|
|
99
|
-
const providerOptions = [
|
|
100
|
-
...(role === "recovery" ? [{ value: SAME, label: "Same as main agent" }] : []),
|
|
101
|
-
...usable.map(p => ({ value: p.id, label: p.label })),
|
|
102
|
-
...(!r.same && !usable.some(p => p.id === r.provider) ? [{ value: r.provider, label: `${providerLabel} · unavailable` }] : []),
|
|
103
|
-
];
|
|
104
|
-
const pickProvider = (value: string) => {
|
|
105
|
-
if (value === SAME) return set({ same: true });
|
|
106
|
-
const p = catalog.find(x => x.id === value);
|
|
107
|
-
const defaults = ROLE_DEFAULTS[role];
|
|
108
|
-
const same = value === defaults.provider;
|
|
109
|
-
set({ same: false, provider: value, model: same ? defaults.model : null, thinking: null, ...(jobs ? {} : { mode: same ? defaults.mode : BYPASS[value] ?? p?.defaultMode ?? null }) });
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const models = current?.models ?? [];
|
|
113
|
-
const model = r.model ? models.find(m => m.id === r.model) : null;
|
|
114
|
-
const providerDefault = models.find(m => m.isDefault);
|
|
115
|
-
const defaultModel = role === "overseer" && r.provider === "claude" ? "Default (newest Opus)" : providerDefault ? `Default (${providerDefault.label})` : "Default";
|
|
116
|
-
const modelOptions = [{ value: DEFAULT, label: defaultModel }, ...models.map(m => ({ value: m.id, label: m.label })),
|
|
117
|
-
...(r.model && !model ? [{ value: r.model, label: modelName(r.model) }] : [])];
|
|
118
|
-
const thinking = (model ?? providerDefault)?.thinking ?? [];
|
|
119
|
-
const thinkingDefault = thinking.find(o => o.isDefault);
|
|
120
81
|
const modes = current?.modes ?? [];
|
|
121
82
|
const modeDefault = modes.find(m => m.id === current?.defaultMode);
|
|
122
|
-
const modeLabel = (m: { id: string; label: string }) =>
|
|
123
|
-
|
|
124
|
-
const reset =
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
</View>
|
|
131
|
-
<Text style={t.meta}>{ROLE_INFO[role].does}{role === "overseer" ? " A running Overseer keeps its model until you restart it from Home." : ""}</Text>
|
|
132
|
-
{invalid && <Text style={t.meta}>Part of the saved setting wasn't valid, so its default is used.</Text>}
|
|
133
|
-
{blocked && <Text accessibilityRole="alert" style={[t.meta, { color: c.statusWarning }]}>{`${providerLabel} isn't available (${blockedReason}). ${role === "about" ? "Summaries will fail" : role === "ranker" ? "Ranking will fail" : role === "overseer" ? "Starting or restarting the Overseer will fail" : "Recovery agents won't start"} until you pick another provider or reset.`}</Text>}
|
|
134
|
-
</View>
|
|
135
|
-
{/* The role's own on/off (Overseer, AI priority) leads its card; the model rows follow. */}
|
|
136
|
-
{toggle}
|
|
137
|
-
<SettingsSelect label="Provider" value={r.same ? SAME : r.provider} options={providerOptions} disabled={busy || !catalog.length} onValueChange={pickProvider} />
|
|
138
|
-
{!r.same && <SettingsSelect label="Model" value={r.model ?? DEFAULT} options={modelOptions} disabled={busy || !catalog.length}
|
|
139
|
-
onValueChange={value => set({ model: value === DEFAULT ? null : value, thinking: null })} />}
|
|
140
|
-
{!r.same && (thinking.length > 0 || !!r.thinking) && <SettingsSelect label="Effort" hint={!thinking.length && !blocked && model ? "This model lists no effort levels in Paseo; the saved one is still passed on." : undefined} value={r.thinking ?? DEFAULT}
|
|
141
|
-
options={[{ value: DEFAULT, label: thinkingDefault ? `Default (${thinkingDefault.label})` : "Default" }, ...thinking.map(o => ({ value: o.id, label: o.label })), ...(r.thinking && !thinking.some(o => o.id === r.thinking) ? [{ value: r.thinking, label: r.thinking }] : [])]} disabled={busy}
|
|
142
|
-
onValueChange={value => set({ thinking: value === DEFAULT ? null : value })} />}
|
|
83
|
+
const modeLabel = (m: { id: string; label: string }) => NO_PROMPT_MODE[r.provider] === m.id ? `${m.label} · no prompts` : m.label;
|
|
84
|
+
// Reset puts back the declared defaults, unless they can't run here: then the recommendation, with default limits.
|
|
85
|
+
const reset = resetEntry(role, query.data?.catalog);
|
|
86
|
+
const resetDone = isReset(r, query.data?.catalog);
|
|
87
|
+
const schedule = role === "ranker" ? "limits and schedule" : jobs ? "limits" : "permissions";
|
|
88
|
+
const resetText = reset.entry ? `Back to the recommended ${reset.label}, with the default ${schedule}.` : `Everything back to ${roleDefaultText(role)}, ${schedule} too.`;
|
|
89
|
+
return <>
|
|
90
|
+
{invalid && <Text style={[t.meta, { paddingHorizontal: 16, paddingTop: 10 }]}>Part of the saved setting wasn't valid, so its default is used.</Text>}
|
|
143
91
|
{!jobs && !r.same && modes.length > 0 && <SettingsSelect label="Permissions" hint="It runs unattended, so pick a mode that doesn't prompt." value={r.mode ?? DEFAULT}
|
|
144
92
|
options={[{ value: DEFAULT, label: modeDefault ? `Default (${modeLabel(modeDefault)})` : "Default" }, ...modes.map(m => ({ value: m.id, label: modeLabel(m) }))]} disabled={busy}
|
|
145
93
|
onValueChange={value => set({ mode: value === DEFAULT ? null : value })} />}
|
|
@@ -152,9 +100,26 @@ function RoleCard({ r, invalid, catalog, busy, save, theme, compact, toggle }: {
|
|
|
152
100
|
{role === "ranker" && <SettingsSelect label="At most per day" value={String(r.dailyCap ?? 24)} disabled={busy}
|
|
153
101
|
options={withCurrent([6, 12, 24, 48, 96], r.dailyCap ?? 24).map(n => ({ value: String(n), label: String(n) }))}
|
|
154
102
|
onValueChange={value => set({ dailyCap: Number(value) })} />}
|
|
155
|
-
|
|
156
|
-
|
|
103
|
+
<View style={{ flexDirection: "row", alignItems: "center", gap: 8, paddingHorizontal: compact ? 14 : 16, paddingVertical: 8, borderTopWidth: 1, borderTopColor: c.border }}>
|
|
104
|
+
<Text style={[t.meta, { flex: 1 }]}>{resetText}</Text>
|
|
105
|
+
<Button theme={theme} compact={compact} kind="ghost" title="Reset to defaults" disabled={busy || (resetDone && !invalid)} onPress={() => save(reset.entry)} />
|
|
106
|
+
</View>
|
|
107
|
+
</>;
|
|
157
108
|
}
|
|
158
109
|
|
|
159
110
|
const roleDefaultText = (role: AgentRole) => role === "recovery" ? "the main agent's setup" : role === "overseer" ? "Claude, newest Opus" : role === "about" ? "Claude Haiku" : "Claude Sonnet, hourly";
|
|
111
|
+
/** "Not available in Paseo: Claude and Pi (turned off in Paseo); Antigravity (not installed)." Grouped by reason; a
|
|
112
|
+
* provider whose name is also on a ready one isn't listed, so the line never contradicts the rows. */
|
|
113
|
+
function unavailableLine(providers: readonly { label: string; available: boolean; reason: string | null }[]): string | null {
|
|
114
|
+
const ready = new Set(providers.filter(p => p.available).map(p => p.label));
|
|
115
|
+
const groups = new Map<string, string[]>();
|
|
116
|
+
for (const p of providers) if (!p.available && !ready.has(p.label)) {
|
|
117
|
+
// Paseo's reasons can name binaries and PATH; developers here only need "not installed".
|
|
118
|
+
const why = /not found|PATH|not installed/i.test(p.reason ?? "") ? "not installed" : (p.reason ?? "unavailable").replace(/\.$/, "");
|
|
119
|
+
groups.set(why, [...(groups.get(why) ?? []), p.label]);
|
|
120
|
+
}
|
|
121
|
+
if (!groups.size) return null;
|
|
122
|
+
const list = (names: string[]) => names.length < 2 ? names.join("") : `${names.slice(0, -1).join(", ")} and ${names[names.length - 1]}`;
|
|
123
|
+
return `Not available in Paseo: ${[...groups].map(([why, names]) => `${list(names)} (${why[0].toLowerCase()}${why.slice(1)})`).join("; ")}.`;
|
|
124
|
+
}
|
|
160
125
|
const withCurrent = (list: number[], value: number) => [...new Set([...list, value])].sort((a, b) => a - b);
|
package/client/display.tsx
CHANGED
|
@@ -36,19 +36,6 @@ function TrustCount({ theme, inCard = false }: Pick<PluginSurfaceProps, "theme">
|
|
|
36
36
|
* The Overseer and AI priority switches, at the top of their cards in Settings → Agents. Same Display preferences as
|
|
37
37
|
* before (enable_overseer, enable_ranker); only where they show moved.
|
|
38
38
|
*/
|
|
39
|
-
export function PreferenceSwitch({ field, theme }: { field: "enable_overseer" | "enable_ranker"; theme: PluginSurfaceProps["theme"] }) {
|
|
40
|
-
const settings = useSettings(displayPreferences);
|
|
41
|
-
if (settings.status !== "ready") return null;
|
|
42
|
-
const copy = field === "enable_overseer"
|
|
43
|
-
? { label: "Run the Overseer", hint: "Off hides its row on Home and stops its digest. An Overseer you already started stays in its workspace; Follow-up never archives it." }
|
|
44
|
-
: { label: "Rank with AI", hint: "Ranks Home's Priority sort from Linear, Slack, GitHub and the weekly plan. Read-only; runs hourly on workdays when something changed." };
|
|
45
|
-
return <>
|
|
46
|
-
<SettingsSwitch label={copy.label} hint={copy.hint} value={settings.values[field]} disabled={settings.saving}
|
|
47
|
-
onValueChange={value => void settings.save({ ...settings.values, [field]: value }, settings.revision)} />
|
|
48
|
-
{settings.saveError && <Text accessibilityRole="alert" style={{ color: theme.colors.statusDanger, paddingHorizontal: 16, paddingBottom: 8 }}>{settings.saveError}</Text>}
|
|
49
|
-
</>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
39
|
/**
|
|
53
40
|
* Permissions, in Settings → Following after Defaults: Trust bypass agents and how many prompts it approved.
|
|
54
41
|
* Same Display preference as before (enable_trust_bypass); only where it shows moved.
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { useEffect, useRef, useState, type ReactNode } from "react";
|
|
2
|
+
import { Pressable, Text, View } from "react-native";
|
|
3
|
+
import { useRpc, useSettings } from "@getpaseo/plugin/client";
|
|
4
|
+
import { Icon, SettingsSelect, useToast } from "@getpaseo/plugin/client/ui";
|
|
5
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
|
+
import { agentSettingsRpc, setAgentSettingRpc } from "../shared/contracts";
|
|
7
|
+
import { displayPreferences } from "../shared/display";
|
|
8
|
+
import { ROLE_DEFAULTS, ROLE_INFO, isJobRole, modelName, providerName, type AgentRole, type AgentSettingsView, type CatalogProvider, type SavedRole } from "../shared/agent-settings";
|
|
9
|
+
import { NO_PROMPT_MODE, jobRow, jobsHeader, preselect as toPreselect, recommendedEntry, type JobRowModel } from "../shared/job-rows";
|
|
10
|
+
import { Button, Chip, Switch, errorText, text, type Theme } from "./kit";
|
|
11
|
+
import { Spinner } from "./motion";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The helper jobs as rows: setup's Helper agents step and Settings → Agents both render <JobRows>, so they show the same
|
|
15
|
+
* thing for the same job (tests/job-rows.test.ts). What a row says comes from shared/job-rows.ts.
|
|
16
|
+
*/
|
|
17
|
+
export const agentSettingsKey = ["follow-through", "agent-settings"];
|
|
18
|
+
type RoleView = AgentSettingsView["roles"][number];
|
|
19
|
+
const SAME = "__same";
|
|
20
|
+
const DEFAULT = "__default";
|
|
21
|
+
const SWITCH: Partial<Record<AgentRole, "enable_overseer" | "enable_ranker">> = { overseer: "enable_overseer", ranker: "enable_ranker" };
|
|
22
|
+
|
|
23
|
+
/** The one read of roles and the provider catalog, shared by every screen that shows the jobs. */
|
|
24
|
+
export function useAgentSettings() {
|
|
25
|
+
const read = useRpc(agentSettingsRpc); const write = useRpc(setAgentSettingRpc); const cache = useQueryClient(); const toast = useToast();
|
|
26
|
+
const query = useQuery({ queryKey: agentSettingsKey, queryFn: () => read({ catalog: true }), staleTime: 5 * 60_000,
|
|
27
|
+
// Only while Paseo is still discovering providers (right after it starts): ask again until they settle.
|
|
28
|
+
refetchInterval: q => (q.state.data as AgentSettingsView | undefined)?.catalog?.providers.some(p => p.reason === "Still loading") && q.state.dataUpdateCount < 10 ? 5000 : false });
|
|
29
|
+
const change = useMutation({
|
|
30
|
+
mutationFn: (input: { role: AgentRole; entry: SavedRole | null; quiet?: boolean }) => write({ role: input.role, entry: input.entry }),
|
|
31
|
+
onSuccess: (value, input) => {
|
|
32
|
+
cache.setQueryData(agentSettingsKey, value);
|
|
33
|
+
void cache.invalidateQueries({ queryKey: ["follow-through", "about"] });
|
|
34
|
+
const r = value.roles.find(x => x.role === input.role);
|
|
35
|
+
if (r && !input.quiet) toast.show(input.role === "overseer" ? `Overseer: ${r.summary}. Restart it from Home to switch.` : `${ROLE_INFO[input.role].title}: ${r.summary}`, { variant: "success" });
|
|
36
|
+
},
|
|
37
|
+
onError: error => toast.error(errorText(error)),
|
|
38
|
+
});
|
|
39
|
+
const refresh = () => read({ catalog: true, fresh: true }).then(v => cache.setQueryData(agentSettingsKey, v), e => toast.error(errorText(e)));
|
|
40
|
+
return { query, change, refresh, toast };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Settings' per-row More: what its toggle says (it names what's inside) and what it shows. */
|
|
44
|
+
export type JobExtra = { label: (r: RoleView) => string | null; render: (r: RoleView, save: (entry: SavedRole | null) => void, busy: boolean) => ReactNode };
|
|
45
|
+
|
|
46
|
+
export function JobRows({ theme, compact, order, extra, preselect = false }: {
|
|
47
|
+
theme: Theme; compact: boolean; order: readonly AgentRole[];
|
|
48
|
+
/** Settings only: controls behind each row's More (limits, schedule, permissions, Reset to defaults). */
|
|
49
|
+
extra?: JobExtra;
|
|
50
|
+
/** Setup only: fill in the recommendation for jobs with nothing saved whose default can't run here. */
|
|
51
|
+
preselect?: boolean;
|
|
52
|
+
}) {
|
|
53
|
+
const c = theme.colors; const t = text(c, compact);
|
|
54
|
+
const { query, change, refresh, toast } = useAgentSettings();
|
|
55
|
+
const display = useSettings(displayPreferences);
|
|
56
|
+
const [open, setOpen] = useState<AgentRole | null>(null);
|
|
57
|
+
const [bulk, setBulk] = useState(false);
|
|
58
|
+
const data = query.data;
|
|
59
|
+
const catalog = data?.catalog ?? null;
|
|
60
|
+
const roles = order.map(role => data?.roles.find(r => r.role === role)).filter((r): r is RoleView => !!r);
|
|
61
|
+
const rows = roles.map(r => jobRow(r, catalog));
|
|
62
|
+
const header = jobsHeader(rows, catalog, query.isPending);
|
|
63
|
+
const busy = change.isPending || bulk;
|
|
64
|
+
|
|
65
|
+
// Preselect once per open, quietly: there was no choice, and the default couldn't run.
|
|
66
|
+
const filled = useRef(false);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (!preselect || filled.current || !data) return;
|
|
69
|
+
const todo = toPreselect(data.roles, data.catalog);
|
|
70
|
+
if (!data.catalog || data.catalog.providers.some(p => p.reason === "Still loading")) return;
|
|
71
|
+
filled.current = true;
|
|
72
|
+
void (async () => { for (const p of todo) await change.mutateAsync({ ...p, quiet: true }).catch(() => undefined); })();
|
|
73
|
+
}, [preselect, data, change]);
|
|
74
|
+
|
|
75
|
+
const useAll = async () => {
|
|
76
|
+
setBulk(true);
|
|
77
|
+
let overseer = false;
|
|
78
|
+
try {
|
|
79
|
+
for (const [i, row] of rows.entries()) {
|
|
80
|
+
if (!row.rec || row.recommended) continue;
|
|
81
|
+
await change.mutateAsync({ role: row.role, entry: recommendedEntry(roles[i], row.rec), quiet: true });
|
|
82
|
+
if (row.role === "overseer") overseer = true;
|
|
83
|
+
}
|
|
84
|
+
toast.show(overseer ? "Using the recommended models. A running Overseer switches when you restart it from Home." : "Using the recommended models.", { variant: "success" });
|
|
85
|
+
} catch { /* the mutation's toast says why */ } finally { setBulk(false); }
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
if (query.error) return <View style={{ padding: 16, gap: 8 }}>
|
|
89
|
+
<Text accessibilityRole="alert" style={[t.meta, { color: c.statusWarning }]}>{`Couldn't load the helper agents: ${errorText(query.error)}`}</Text>
|
|
90
|
+
<Button theme={theme} compact={compact} title="Retry" onPress={() => void query.refetch()} />
|
|
91
|
+
</View>;
|
|
92
|
+
const action = header.action === "use" ? <Button theme={theme} compact={compact} title="Use recommended" loading={bulk} disabled={busy} onPress={() => void useAll()} />
|
|
93
|
+
: header.action === "retry" ? <Button theme={theme} compact={compact} title="Retry" disabled={busy} onPress={() => void refresh()} />
|
|
94
|
+
: header.action === "check" ? <Button theme={theme} compact={compact} title="Check again" disabled={busy} onPress={() => void refresh()} /> : null;
|
|
95
|
+
return <View>
|
|
96
|
+
<View style={{ flexDirection: compact ? "column" : "row", alignItems: compact ? "flex-start" : "center", gap: compact ? 8 : 12, paddingHorizontal: compact ? 14 : 16, paddingVertical: 12, borderBottomWidth: 1, borderBottomColor: c.border }}>
|
|
97
|
+
<View style={{ flex: compact ? undefined : 1, flexDirection: "row", alignItems: "center", gap: 8 }}>
|
|
98
|
+
{header.text === "Reading your providers…" && <Spinner color={c.foregroundMuted} size={14} />}
|
|
99
|
+
<Text accessibilityRole={header.tone === "warning" ? "alert" : undefined} style={[t.meta, header.tone === "warning" ? { color: c.statusWarning } : null]}>{header.text}</Text>
|
|
100
|
+
</View>
|
|
101
|
+
{action}
|
|
102
|
+
</View>
|
|
103
|
+
{roles.map((r, i) => {
|
|
104
|
+
const field = SWITCH[r.role];
|
|
105
|
+
const on = field && display.status === "ready" ? display.values[field] !== false : null;
|
|
106
|
+
return <JobRow key={r.role} first={i === 0} row={rows[i]} r={r} catalog={catalog?.providers ?? []} loading={!catalog} theme={theme} compact={compact} busy={busy}
|
|
107
|
+
open={open === r.role} onToggle={() => setOpen(open === r.role ? null : r.role)}
|
|
108
|
+
enabled={field ? on : undefined} onEnable={field && display.status === "ready" ? v => void display.save({ ...display.values, [field]: v }, display.revision).catch(e => toast.error(errorText(e))) : undefined}
|
|
109
|
+
save={entry => change.mutate({ role: r.role, entry })} extra={extra} />;
|
|
110
|
+
})}
|
|
111
|
+
</View>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function JobRow({ row, r, catalog, loading, theme, compact, busy, open, onToggle, enabled, onEnable, save, extra, first }: {
|
|
115
|
+
row: JobRowModel; r: RoleView; catalog: CatalogProvider[]; loading: boolean; theme: Theme; compact: boolean; busy: boolean;
|
|
116
|
+
open: boolean; onToggle: () => void; enabled?: boolean | null; onEnable?: (v: boolean) => void;
|
|
117
|
+
save: (entry: SavedRole | null) => void; extra?: JobExtra; first: boolean;
|
|
118
|
+
}) {
|
|
119
|
+
const c = theme.colors; const t = text(c, compact);
|
|
120
|
+
const [more, setMore] = useState(false);
|
|
121
|
+
const off = enabled === false;
|
|
122
|
+
const pad = compact ? 14 : 16;
|
|
123
|
+
const use = row.rec && !row.recommended ? () => save(recommendedEntry(r, row.rec!)) : null;
|
|
124
|
+
return <View style={{ borderTopWidth: first ? 0 : 1, borderTopColor: c.border, paddingHorizontal: pad, paddingVertical: 14, gap: 2 }}>
|
|
125
|
+
<View style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
|
|
126
|
+
<Text accessibilityRole="header" style={[t.label, { flex: 1 }]}>{row.title}</Text>
|
|
127
|
+
{enabled !== undefined && <Switch theme={theme} compact={compact} label={enabled ? "On" : "Off"} accessibilityLabel={row.title} value={enabled} disabled={!onEnable} onChange={v => onEnable?.(v)} />}
|
|
128
|
+
</View>
|
|
129
|
+
<Text style={[t.meta, off && { opacity: 0.6 }]}>{row.does}</Text>
|
|
130
|
+
<View style={{ opacity: off ? 0.6 : 1, gap: 6, marginTop: 8 }}>
|
|
131
|
+
<View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8 }}>
|
|
132
|
+
{loading
|
|
133
|
+
? <View style={{ flexDirection: "row", alignItems: "center", gap: 8, minHeight: compact ? 44 : 32 }}><Spinner color={c.foregroundMuted} size={14} /><Text style={t.meta}>Reading your providers…</Text></View>
|
|
134
|
+
: <Pressable accessibilityRole="button" accessibilityLabel={`${row.title} model: ${row.pick}. Change`} accessibilityState={{ expanded: open, disabled: busy }} aria-expanded={open}
|
|
135
|
+
disabled={busy && !open} onPress={onToggle}
|
|
136
|
+
style={({ pressed }) => ({ flexDirection: "row", alignItems: "center", gap: 8, minHeight: compact ? 44 : 32, maxWidth: "100%", paddingHorizontal: 10, borderRadius: 8, borderWidth: 1, borderColor: c.border, backgroundColor: pressed ? c.surface2 : c.surface0 })}>
|
|
137
|
+
<Text numberOfLines={1} style={[t.body, { color: c.foreground, flexShrink: 1 }]}>{row.pick}</Text>
|
|
138
|
+
<Icon name={open ? "ChevronUp" : "ChevronDown"} size={14} color={c.foregroundMuted} />
|
|
139
|
+
</Pressable>}
|
|
140
|
+
{row.recommended && <Chip theme={theme} label="Recommended" color={c.foregroundMuted} />}
|
|
141
|
+
</View>
|
|
142
|
+
<Text style={[t.meta, { fontSize: 12, lineHeight: 16 }]}>{row.hint ? `${row.need} ${row.hint}` : row.need}</Text>
|
|
143
|
+
{row.notice && <View style={{ gap: 6, alignItems: "flex-start" }}>
|
|
144
|
+
<Text accessibilityRole={row.notice.tone === "warning" ? "alert" : undefined} style={[t.meta, { fontSize: 12, lineHeight: 16, color: row.notice.tone === "warning" ? c.statusWarning : c.foregroundMuted }]}>{row.notice.text}</Text>
|
|
145
|
+
{/* Can't run: a real button, the row's one way back. Only differs: the developer chose it, so a quiet link. */}
|
|
146
|
+
{use && (row.notice.tone === "warning"
|
|
147
|
+
? <Button theme={theme} compact={compact} kind="secondary" title="Use recommended" accessibilityLabel={`Use ${row.recPick} for ${row.title}`} disabled={busy} onPress={use} />
|
|
148
|
+
: <Pressable accessibilityRole="button" accessibilityLabel={`Use ${row.recPick} for ${row.title}`} disabled={busy} onPress={use} hitSlop={8} style={{ minHeight: compact ? 44 : 24, justifyContent: "center" }}>
|
|
149
|
+
<Text style={[t.label, { fontSize: 12, textDecorationLine: "underline" }]}>Use recommended</Text>
|
|
150
|
+
</Pressable>)}
|
|
151
|
+
</View>}
|
|
152
|
+
{open && !loading && <View style={{ marginTop: 4, borderWidth: 1, borderColor: c.border, borderRadius: 10, overflow: "hidden" }}>
|
|
153
|
+
<RolePickers r={r} catalog={catalog} busy={busy} save={save} />
|
|
154
|
+
</View>}
|
|
155
|
+
{/* No label: nothing Settings-only for this row (Recovery on the main agent's setup is already its default). */}
|
|
156
|
+
{extra && extra.label(r) && <>
|
|
157
|
+
<Pressable accessibilityRole="button" accessibilityState={{ expanded: more }} aria-expanded={more} accessibilityLabel={`${row.title}: ${extra.label(r)}`} onPress={() => setMore(!more)} hitSlop={6}
|
|
158
|
+
style={{ flexDirection: "row", alignItems: "center", gap: 4, alignSelf: "flex-start", minHeight: compact ? 44 : 24 }}>
|
|
159
|
+
<Text style={[t.meta, { color: c.foreground }]}>{extra.label(r)}</Text>
|
|
160
|
+
<Icon name={more ? "ChevronUp" : "ChevronDown"} size={12} color={c.foregroundMuted} />
|
|
161
|
+
</Pressable>
|
|
162
|
+
{more && <View style={{ borderWidth: 1, borderColor: c.border, borderRadius: 10, overflow: "hidden" }}>{extra.render(r, save, busy)}</View>}
|
|
163
|
+
</>}
|
|
164
|
+
</View>
|
|
165
|
+
</View>;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** Provider, Model and Effort: the same pickers in setup and Settings. */
|
|
169
|
+
export function RolePickers({ r, catalog, busy, save }: { r: RoleView; catalog: CatalogProvider[]; busy: boolean; save: (entry: SavedRole | null) => void }) {
|
|
170
|
+
const role = r.role;
|
|
171
|
+
const jobs = isJobRole(role);
|
|
172
|
+
const usable = catalog.filter(p => p.available);
|
|
173
|
+
const current = catalog.find(p => p.id === r.provider);
|
|
174
|
+
const base: SavedRole = { provider: r.provider, model: r.model, thinking: r.thinking, ...(jobs ? {} : { mode: r.mode }), ...(role === "recovery" ? { same: r.same } : {}),
|
|
175
|
+
...(jobs ? { dailyCap: r.dailyCap ?? undefined, maxPromptChars: r.maxPromptChars ?? undefined } : {}), ...(role === "ranker" ? { cadenceMinutes: r.cadenceMinutes ?? undefined } : {}) };
|
|
176
|
+
const set = (patch: SavedRole) => save({ ...base, ...patch });
|
|
177
|
+
const providerLabel = providerName(r.provider, current?.label);
|
|
178
|
+
const providerOptions = [
|
|
179
|
+
...(role === "recovery" ? [{ value: SAME, label: "Same as main agent" }] : []),
|
|
180
|
+
...usable.map(p => ({ value: p.id, label: p.label })),
|
|
181
|
+
...(!r.same && !usable.some(p => p.id === r.provider) ? [{ value: r.provider, label: `${providerLabel} · unavailable` }] : []),
|
|
182
|
+
];
|
|
183
|
+
const pickProvider = (value: string) => {
|
|
184
|
+
if (value === SAME) return set({ same: true });
|
|
185
|
+
const p = catalog.find(x => x.id === value);
|
|
186
|
+
const defaults = ROLE_DEFAULTS[role];
|
|
187
|
+
const same = value === defaults.provider;
|
|
188
|
+
set({ same: false, provider: value, model: same ? defaults.model : null, thinking: null, ...(jobs ? {} : { mode: same ? defaults.mode : NO_PROMPT_MODE[value] ?? p?.defaultMode ?? null }) });
|
|
189
|
+
};
|
|
190
|
+
const models = current?.models ?? [];
|
|
191
|
+
const model = r.model ? models.find(m => m.id === r.model) : null;
|
|
192
|
+
const providerDefault = models.find(m => m.isDefault);
|
|
193
|
+
const defaultModel = role === "overseer" && r.provider === "claude" ? "Default (newest Opus)" : providerDefault ? `Default (${providerDefault.label})` : "Default";
|
|
194
|
+
const modelOptions = [{ value: DEFAULT, label: defaultModel }, ...models.map(m => ({ value: m.id, label: m.label })),
|
|
195
|
+
...(r.model && !model ? [{ value: r.model, label: modelName(r.model) }] : [])];
|
|
196
|
+
const thinking = (model ?? providerDefault)?.thinking ?? [];
|
|
197
|
+
const thinkingDefault = thinking.find(o => o.isDefault);
|
|
198
|
+
return <>
|
|
199
|
+
<SettingsSelect label="Provider" value={r.same ? SAME : r.provider} options={providerOptions} disabled={busy || !catalog.length} onValueChange={pickProvider} />
|
|
200
|
+
{!r.same && <SettingsSelect label="Model" value={r.model ?? DEFAULT} options={modelOptions} disabled={busy || !catalog.length}
|
|
201
|
+
onValueChange={value => set({ model: value === DEFAULT ? null : value, thinking: null })} />}
|
|
202
|
+
{!r.same && (thinking.length > 0 || !!r.thinking) && <SettingsSelect label="Effort" value={r.thinking ?? DEFAULT}
|
|
203
|
+
options={[{ value: DEFAULT, label: thinkingDefault ? `Default (${thinkingDefault.label})` : "Default" }, ...thinking.map(o => ({ value: o.id, label: o.label })), ...(r.thinking && !thinking.some(o => o.id === r.thinking) ? [{ value: r.thinking, label: r.thinking }] : [])]} disabled={busy}
|
|
204
|
+
onValueChange={value => set({ thinking: value === DEFAULT ? null : value })} />}
|
|
205
|
+
</>;
|
|
206
|
+
}
|
package/client/onboarding.tsx
CHANGED
|
@@ -3,11 +3,13 @@ import { Animated, Easing, Keyboard, Platform, Pressable, ScrollView, Text, View
|
|
|
3
3
|
import { useRpc, useSettings } from "@getpaseo/plugin/client";
|
|
4
4
|
import { Icon, copyText, useToast } from "@getpaseo/plugin/client/ui";
|
|
5
5
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
|
-
import {
|
|
6
|
+
import { followSettingsRpc, onboardingChecksRpc, onboardingRpc, setFollowSettingsRpc, setOnboardingRpc } from "../shared/contracts";
|
|
7
7
|
import { displayPreferences } from "../shared/display";
|
|
8
8
|
import { ONBOARDING_STEPS, autoSendWrites, checksSummary, type Check, type OnboardingStep, type OnboardingView } from "../shared/onboarding";
|
|
9
9
|
import { Button, IconButton, errorText, text, type Theme } from "./kit";
|
|
10
10
|
import { ReviewerSettings } from "./reviewers";
|
|
11
|
+
import { JobRows } from "./job-rows";
|
|
12
|
+
import { SETUP_ORDER } from "../shared/job-rows";
|
|
11
13
|
import { ShippingStep } from "./shipping";
|
|
12
14
|
import { UpdatesStep } from "./updates";
|
|
13
15
|
import { Spinner, useReducedMotion } from "./motion";
|
|
@@ -42,7 +44,8 @@ const TITLES: Record<OnboardingStep, string> = {
|
|
|
42
44
|
shipping: "How do you ship PRs?",
|
|
43
45
|
reviewers: "Who should review your PRs?",
|
|
44
46
|
updates: "Keep Follow-up up to date",
|
|
45
|
-
helpers: "
|
|
47
|
+
helpers: "Helper agents",
|
|
48
|
+
tour: "Where to find things",
|
|
46
49
|
};
|
|
47
50
|
|
|
48
51
|
/** Bottom clearance on phones. TODO(rebase): kit.tsx's bottomInset from the mobile rework replaces this. */
|
|
@@ -82,15 +85,17 @@ export function Setup({ theme, compact, view, deps }: { theme: Theme; compact: b
|
|
|
82
85
|
: step === "shipping" ? <ShippingStep theme={theme} compact={compact} />
|
|
83
86
|
: step === "reviewers" ? <ReviewerSettings theme={theme} compact={compact} />
|
|
84
87
|
: step === "updates" ? <UpdatesStep theme={theme} compact={compact} />
|
|
85
|
-
: <HelpersStep theme={theme} compact={compact} deps={deps}
|
|
88
|
+
: step === "helpers" ? <HelpersStep theme={theme} compact={compact} deps={deps} />
|
|
89
|
+
: <TourStep theme={theme} compact={compact} />;
|
|
86
90
|
const lead: Record<OnboardingStep, string> = {
|
|
87
91
|
intro: "It follows your agents' pull requests until the work is done, sends fixes back to them, and asks you only for decisions.",
|
|
88
|
-
checks: "Follow-up reads PRs with the GitHub CLI, and its helper agents run on
|
|
92
|
+
checks: "Follow-up reads PRs with the GitHub CLI, and its helper agents run on the providers you pick. Checking is free.",
|
|
89
93
|
defaults: "These are on now. Change anything here; it saves as you go, and Settings has the same switches.",
|
|
90
94
|
shipping: "Follow-up merges and tracks PRs the way each repository already works. It picked these; change one if it's wrong.",
|
|
91
95
|
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
96
|
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.",
|
|
93
|
-
helpers: "
|
|
97
|
+
helpers: "Follow-up's own agents. They read, summarise and rank. They never change code or message anyone.",
|
|
98
|
+
tour: "Four places worth knowing. Everything else is in Settings.",
|
|
94
99
|
};
|
|
95
100
|
const column: ViewStyle = { width: "100%", maxWidth: 560, alignSelf: "center", paddingHorizontal: compact ? 16 : 24 };
|
|
96
101
|
|
|
@@ -286,7 +291,7 @@ function CheckRow({ theme, compact, row, first, checking, deps }: { theme: Theme
|
|
|
286
291
|
<Text selectable numberOfLines={1} style={{ flexShrink: 1, color: c.foreground, fontSize: 12, lineHeight: 17, fontFamily: Platform.OS === "ios" ? "Menlo" : "ui-monospace, SFMono-Regular, Menlo, monospace" }}>{row.fix.command}</Text>
|
|
287
292
|
<IconButton theme={theme} compact={compact} icon="Copy" label={`Copy ${row.fix.command}`} onPress={() => { void copyText(row.fix!.command!).then(() => toast.show("Copied", { variant: "success" }), () => toast.error("Couldn't copy here")); }} />
|
|
288
293
|
</View>}
|
|
289
|
-
{row.fix.settings && <Button theme={theme} compact={compact} kind="ghost" icon="Settings" title="Open Settings
|
|
294
|
+
{row.fix.settings && <Button theme={theme} compact={compact} kind="ghost" icon="Settings" title="Open Settings → Agents" onPress={() => deps.openSettings(row.fix!.settings!)} />}
|
|
290
295
|
</View>}
|
|
291
296
|
</View>
|
|
292
297
|
</View>;
|
|
@@ -366,44 +371,33 @@ function DefaultsStep({ theme, compact, held }: { theme: Theme; compact: boolean
|
|
|
366
371
|
</View>;
|
|
367
372
|
}
|
|
368
373
|
|
|
369
|
-
// ----------
|
|
374
|
+
// ---------- 6. helper agents, 7. where to find things ----------
|
|
370
375
|
|
|
371
|
-
|
|
376
|
+
/** The same job rows as Settings → Agents (client/job-rows.tsx), cheapest first; fills in picks that can't run here. */
|
|
377
|
+
function HelpersStep({ theme, compact, deps }: { theme: Theme; compact: boolean; deps: SetupDeps }) {
|
|
372
378
|
const c = theme.colors; const t = text(c);
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
return <View style={{ gap: 14 }}>
|
|
382
|
-
<Panel c={c}>
|
|
383
|
-
<SwitchRow first theme={theme} compact={compact} label="Overseer" value={values?.enable_overseer ?? null} onChange={v => save({ enable_overseer: v })}
|
|
384
|
-
hint={`One agent you ask about all your workspaces, from Home's search box. It starts only when you click Start on Home.${on(role("overseer"))}`} />
|
|
385
|
-
<SwitchRow theme={theme} compact={compact} label="AI priority" value={values?.enable_ranker ?? null} onChange={v => save({ enable_ranker: v })}
|
|
386
|
-
hint={`Sorts Home by what matters most, from your Linear issues, Slack mentions and review requests. About once an hour on workdays.${on(role("ranker"))}`} />
|
|
387
|
-
<View style={{ flexDirection: compact ? "column" : "row", alignItems: compact ? "flex-start" : "center", gap: 8, paddingHorizontal: compact ? 14 : 16, paddingVertical: 10, borderTopWidth: 1, borderTopColor: c.border }}>
|
|
388
|
-
<Text style={[t.meta, { flex: compact ? undefined : 1 }]}>{`Summaries use ${role("about") ?? "a small model"}.${claudeDown ? " Claude isn't available here; switch the helpers to Codex in Settings." : ""}`}</Text>
|
|
389
|
-
{compact
|
|
390
|
-
? <Pressable accessibilityRole="link" accessibilityLabel="Change models in Follow-up settings, Agents" onPress={() => deps.openSettings("agents")} style={{ minHeight: 44, justifyContent: "center" }}>
|
|
391
|
-
<Text style={[t.label, { textDecorationLine: "underline" }]}>Change models</Text>
|
|
392
|
-
</Pressable>
|
|
393
|
-
: <Button theme={theme} kind="ghost" icon="Bot" title="Change models" accessibilityLabel="Change models in Follow-up settings, Agents" onPress={() => deps.openSettings("agents")} />}
|
|
394
|
-
</View>
|
|
395
|
-
</Panel>
|
|
396
|
-
<View style={{ gap: 2 }}>
|
|
397
|
-
<Text accessibilityRole="header" style={{ color: c.foregroundMuted, fontSize: 11, lineHeight: 15, fontWeight: "600", letterSpacing: 0.5, textTransform: "uppercase", marginTop: 10, marginBottom: 4 }}>Where to find things</Text>
|
|
398
|
-
<TourRow theme={theme} thumb={<ThumbHome c={c} />} title="Home" line="Follow-up in the sidebar. Every workspace, with what needs you at the top." />
|
|
399
|
-
<TourRow theme={theme} thumb={<ThumbPanel c={c} />} title="Workspace panel"
|
|
400
|
-
line={compact ? "Tap Follow-up at the top of any workspace: its PRs, tasks and what the agent is doing." : "The Follow-up button in a workspace's header docks its PRs, tasks and what the agent is doing beside the chat."} />
|
|
401
|
-
<TourRow theme={theme} thumb={<ThumbNeeds c={c} />} title="Needs you" line="The decisions only you can make, one button each. A pill above the chat shows the same." />
|
|
402
|
-
<TourRow theme={theme} thumb={<ThumbAbout c={c} />} title="Summary" line="One sentence under a workspace's title saying what it's for." />
|
|
379
|
+
return <View style={{ gap: 12 }}>
|
|
380
|
+
<Panel c={c}><JobRows theme={theme} compact={compact} order={SETUP_ORDER} preselect /></Panel>
|
|
381
|
+
<View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center" }}>
|
|
382
|
+
<Text style={t.meta}>Permissions and limits are in </Text>
|
|
383
|
+
<Pressable accessibilityRole="link" accessibilityLabel="Open Follow-up settings, Agents" onPress={() => deps.openSettings("agents")} hitSlop={8} style={{ minHeight: compact ? 44 : 20, justifyContent: "center" }}>
|
|
384
|
+
<Text style={[t.meta, { color: c.foreground, textDecorationLine: "underline" }]}>Settings → Agents</Text>
|
|
385
|
+
</Pressable>
|
|
386
|
+
<Text style={t.meta}>.</Text>
|
|
403
387
|
</View>
|
|
404
388
|
</View>;
|
|
405
389
|
}
|
|
406
390
|
|
|
391
|
+
function TourStep({ theme, compact }: { theme: Theme; compact: boolean }) {
|
|
392
|
+
return <View style={{ gap: 2 }}>
|
|
393
|
+
<TourRow theme={theme} thumb={<ThumbHome c={theme.colors} />} title="Home" line="Follow-up in the sidebar. Every workspace, with what needs you at the top." />
|
|
394
|
+
<TourRow theme={theme} thumb={<ThumbPanel c={theme.colors} />} title="Workspace panel"
|
|
395
|
+
line={compact ? "Tap Follow-up at the top of any workspace: its PRs, tasks and what the agent is doing." : "The Follow-up button in a workspace's header docks its PRs, tasks and what the agent is doing beside the chat."} />
|
|
396
|
+
<TourRow theme={theme} thumb={<ThumbNeeds c={theme.colors} />} title="Needs you" line="The decisions only you can make, one button each. A pill above the chat shows the same." />
|
|
397
|
+
<TourRow theme={theme} thumb={<ThumbAbout c={theme.colors} />} title="Summary" line="One sentence under a workspace's title saying what it's for." />
|
|
398
|
+
</View>;
|
|
399
|
+
}
|
|
400
|
+
|
|
407
401
|
function TourRow({ theme, thumb, title, line }: { theme: Theme; thumb: ReactNode; title: string; line: string }) {
|
|
408
402
|
const c = theme.colors; const t = text(c);
|
|
409
403
|
return <View style={{ flexDirection: "row", alignItems: "center", gap: 12, paddingVertical: 8 }}>
|
package/client/settings.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { QUESTION_MODES, QUESTION_MODE_RULES, questionPreferences, type Question
|
|
|
7
7
|
import { skipToken, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
8
8
|
import { followSettingsRpc, projectSettingsRpc, setFollowSettingsRpc, setProjectTrackingRpc } from "../shared/contracts";
|
|
9
9
|
import { Switch, bottomInset, errorText, space, text, type Theme } from "./kit";
|
|
10
|
-
import { DisplaySections, PermissionsSection
|
|
10
|
+
import { DisplaySections, PermissionsSection } from "./display";
|
|
11
11
|
import { ReviewerSettings, reviewerSettingsKey } from "./reviewers";
|
|
12
12
|
import { AgentSettings, WaitSettings, agentSettingsKey } from "./agents";
|
|
13
13
|
import { ShippingSettings } from "./shipping";
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
writeCategory, type SettingsCategory, type WorkspaceSetting,
|
|
22
22
|
} from "../shared/settings-nav";
|
|
23
23
|
import type { AgentSettingsView } from "../shared/agent-settings";
|
|
24
|
+
import { jobRow, jobsHeader } from "../shared/job-rows";
|
|
24
25
|
import type { ReviewerConfig } from "../shared/reviewers";
|
|
25
26
|
|
|
26
27
|
const settingsKey = ["follow-through", "project-settings"];
|
|
@@ -169,7 +170,7 @@ function AgentsCategory({ theme, compact }: { theme: Theme; compact: boolean })
|
|
|
169
170
|
return <>
|
|
170
171
|
<QuestionSettings theme={theme} />
|
|
171
172
|
<WaitSettings theme={theme} />
|
|
172
|
-
<AgentSettings theme={theme} compact={compact}
|
|
173
|
+
<AgentSettings theme={theme} compact={compact} />
|
|
173
174
|
</>;
|
|
174
175
|
}
|
|
175
176
|
|
|
@@ -186,6 +187,17 @@ function GeneralCategory({ theme, compact, setup }: { theme: Theme; compact: boo
|
|
|
186
187
|
</>;
|
|
187
188
|
}
|
|
188
189
|
|
|
190
|
+
/** Agents' line says what the rows' header says (recommended or not); without the catalog, how many differ from defaults. */
|
|
191
|
+
function agentsSummary(agents: AgentSettingsView, changed: number): string {
|
|
192
|
+
if (agents.catalog?.providers.length && !agents.catalog.error) {
|
|
193
|
+
const header = jobsHeader(agents.roles.map(r => jobRow(r, agents.catalog)), agents.catalog, false);
|
|
194
|
+
if (header.action === "check") return "No provider is ready";
|
|
195
|
+
// The same words as the rows' header, so the tab line and the card never disagree.
|
|
196
|
+
return header.action === "use" ? header.text.replace(/\.$/, "") : "All on the recommended models";
|
|
197
|
+
}
|
|
198
|
+
return changed ? `${changed} of ${agents.roles.length} changed from the defaults` : "Every agent on its default";
|
|
199
|
+
}
|
|
200
|
+
|
|
189
201
|
/** Each category's one line, from data already loaded (never fetched for it). */
|
|
190
202
|
function useSummaries(): Partial<Record<SettingsCategory, string | null>> {
|
|
191
203
|
// skipToken: subscribe to what's cached (re-rendering when it arrives) without ever fetching for the summary.
|
|
@@ -199,7 +211,7 @@ function useSummaries(): Partial<Record<SettingsCategory, string | null>> {
|
|
|
199
211
|
general: updates ? generalSummary(updates) : null,
|
|
200
212
|
following: follow ? followingSummary(follow) : null,
|
|
201
213
|
reviewers: reviewers ? reviewersSummary(reviewers.config) : null,
|
|
202
|
-
agents: agents ? (
|
|
214
|
+
agents: agents ? agentsSummary(agents, changed) : null,
|
|
203
215
|
};
|
|
204
216
|
}
|
|
205
217
|
|