paseo-follow-up 1.4.0-beta.8 → 1.4.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -183,7 +183,7 @@ The choices live in `agents.json` in Follow-up's data folder. Anything missing o
183
183
  Install the beta:
184
184
 
185
185
  ```sh
186
- paseo plugin update follow-through --version 1.4.0-beta.8
186
+ paseo plugin update follow-through --version 1.4.0-beta.9
187
187
  # or, for a fresh install:
188
188
  paseo plugin install npm:paseo-follow-up@beta
189
189
  ```
@@ -1,11 +1,11 @@
1
1
  import type { PluginClientContext, PluginSidebarItemContribution, PluginSurfaceProps } from "@getpaseo/plugin/client";
2
2
  import { useRpc, useSettings } from "@getpaseo/plugin/client";
3
3
  import { useQuery } from "@tanstack/react-query";
4
- import { inboxListRpc } from "../shared/contracts";
4
+ import { inboxListRpc, trustBypassRpc } from "../shared/contracts";
5
5
  import { SettingsAction, SettingsCard, SettingsSection, SettingsSwitch } from "@getpaseo/plugin/client/ui";
6
6
  import { useEffect } from "react";
7
7
  import { ActivityIndicator, Text, View } from "react-native";
8
- import { displayPreferences, displayRpc } from "../shared/display";
8
+ import { displayPreferences, displayRpc, trustCountText } from "../shared/display";
9
9
  import { sidebarVisibility } from "./sidebar-visibility";
10
10
  import { appVisible, onVisible } from "./visibility";
11
11
 
@@ -22,6 +22,13 @@ export function briefShareText(stats: { days: number; total: number; tool: numbe
22
22
  return `Last ${stats.days} days: agents stated what they need on ${stats.tool} of ${stats.total} flagged turns (${pct}%).${rest ? ` ${rest[0].toUpperCase()}${rest.slice(1)}.` : ""}`;
23
23
  }
24
24
 
25
+ function TrustCount({ theme }: Pick<PluginSurfaceProps, "theme">) {
26
+ const read = useRpc(trustBypassRpc);
27
+ const stats = useQuery({ queryKey: ["follow-through", "trust-bypass"], queryFn: () => read({}), refetchInterval: 60_000 });
28
+ const text = trustCountText(stats.data);
29
+ return text ? <Text numberOfLines={1} style={{ color: theme.colors.foregroundMuted, fontSize: 12, lineHeight: 17, paddingHorizontal: 4 }}>{text}</Text> : null;
30
+ }
31
+
25
32
  /** "Sidebar & pills" and "Needs-you inbox", rendered inside the one Follow-up settings screen. */
26
33
  export function DisplaySections({ theme }: Pick<PluginSurfaceProps, "theme">) {
27
34
  const settings = useSettings(displayPreferences);
@@ -64,6 +71,12 @@ export function DisplaySections({ theme }: Pick<PluginSurfaceProps, "theme">) {
64
71
  </SettingsCard>
65
72
  {settings.values.enable_inbox && !!share.data?.briefStats && <Text style={{ color: theme.colors.foregroundMuted, fontSize: 12, lineHeight: 17, paddingHorizontal: 4 }}>{briefShareText(share.data.briefStats)}</Text>}
66
73
  </SettingsSection>
74
+ <SettingsSection title="Permissions" info="Claude Code in Bypass and Codex in Full access still stop on some tool calls and wait for a yes.">
75
+ <SettingsCard>
76
+ <SettingsSwitch label="Trust bypass agents" hint="Approves those tool prompts for you, judged by the agent's mode at the time. Questions and plan approval still come to you, and agents in other modes still ask." value={settings.values.enable_trust_bypass} disabled={settings.saving} onValueChange={(enable_trust_bypass) => save({ enable_trust_bypass })} />
77
+ </SettingsCard>
78
+ {settings.values.enable_trust_bypass && <TrustCount theme={theme} />}
79
+ </SettingsSection>
67
80
  <SettingsSection title="Overseer (beta)" info="One agent you can ask about all your work. It sends each task to the agent that owns it and asks you when it isn't sure.">
68
81
  <SettingsCard>
69
82
  <SettingsSwitch label="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." value={settings.values.enable_overseer} disabled={settings.saving} onValueChange={(enable_overseer) => save({ enable_overseer })} />
package/index.server.ts CHANGED
@@ -32,6 +32,7 @@ import { AgentHooks } from "./server/agent-hooks";
32
32
  import { withSessionMcp } from "./server/session-mcp";
33
33
  import { nativeTools, nativeToolsAvailable, type Invoke, type Live } from "./server/native-tools";
34
34
  import { removeGlobalRegistrations } from "./server/mcp-registrations";
35
+ import { TrustBypass } from "./server/trust-bypass";
35
36
  import { scopes } from "./server/scopes";
36
37
  import { updateObligation } from "./server/obligations";
37
38
  import { Inbox, type GuardPause } from "./server/inbox";
@@ -746,7 +747,20 @@ export default function contribute(server: PluginServerContext) {
746
747
  return { brief };
747
748
  });
748
749
 
750
+ // Trust bypass agents: answer the plain tool prompts a full-trust agent still raises (server/trust-bypass.ts). The
751
+ // mode is re-read at request time; the inbox holds a permission row back for its grace period, and the resolve
752
+ // this approval causes cancels it, so an approved prompt never flags Needs you.
753
+ let trustApi: PaseoApi | null = null;
754
+ const trust = new TrustBypass(directory, {
755
+ enabled: async () => (await inboxSettings()).enable_trust_bypass,
756
+ // The mode the provider reports now; never the one the agent was created with.
757
+ mode: async agentId => { const agent = (await trustApi!.agents.ref(agentId).refresh())?.agent; return agent?.currentModeId ?? agent?.runtimeInfo?.modeId ?? null; },
758
+ approve: (agentId, requestId) => trustApi!.agents.ref(agentId).respondToPermission({ requestId, response: { behavior: "allow" } }),
759
+ });
760
+ handle(rpc.trustBypassRpc, async () => trust.recent(20));
761
+
749
762
  const removers = [
763
+ server.on("agent.permission_requested", async (event, { paseo }) => { trustApi = paseo; await trust.handle(event.agent, event.request as never).catch(() => undefined); }),
750
764
  displaySettings.subscribe(() => void writeBriefState().catch(() => undefined)),
751
765
  // The shared directory learns from events instead of polling Paseo (see DaemonDirectory). Registered first so the
752
766
  // handlers below read the patched rows.
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.8",
4
+ "version": "1.4.0-beta.9",
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": [
@@ -24,7 +24,8 @@
24
24
  "scripts": {
25
25
  "typecheck": "tsc --noEmit",
26
26
  "test": "tsx --test tests/*.test.ts",
27
- "verify": "npm run typecheck && npm test && node --test button-visibility.test.mjs && npm run test:scale && npm run test:native",
27
+ "verify": "npm run typecheck && npm test && node --test button-visibility.test.mjs && npm run test:scale && npm run test:native && npm run test:trust",
28
+ "test:trust": "node scripts/check-trust-bypass.mjs",
28
29
  "preview": "node scripts/check-install.mjs --keep",
29
30
  "test:install": "node scripts/check-install.mjs",
30
31
  "test:native": "node scripts/check-native-tools.mjs --agents 10",
@@ -0,0 +1,104 @@
1
+ import { appendFile, mkdir, readFile, rename, writeFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { randomUUID } from "node:crypto";
4
+
5
+ /**
6
+ * "Bypass means bypass" (Tom, 2026-11-09). Claude Code still sends some tool calls to the permission prompt in
7
+ * bypassPermissions mode (its bypass-immune safety checks: compound `cd … && git`, writes under .git/ or a config folder,
8
+ * commands it can't statically validate), so a bypass agent stops and flags Needs you anyway. When the agent's mode
9
+ * *right now* is a full-trust mode, Follow-up answers those plain tool permissions with allow, and logs each one.
10
+ *
11
+ * Never answered: anything that needs the developer's own input (questions, plan approval, MCP elicitation or auth), or
12
+ * any request whose kind isn't a plain tool permission. Never for an agent in any other mode.
13
+ */
14
+ export const FULL_TRUST_MODES: ReadonlySet<string> = new Set(["bypassPermissions", "full-access"]);
15
+ /** Tool names that ask the developer something even when their kind says "tool" (Codex sends elicitation as one). */
16
+ const NEEDS_DEVELOPER = new Set(["AskUserQuestion", "ExitPlanMode", "EnterPlanMode", "CodexMcpElicitation"]);
17
+ const NEEDS_DEVELOPER_PATTERN = /elicit|question|ask[_-]?user|oauth|authenticat|authoriz|login|consent/i;
18
+
19
+ export type PermissionRequestShape = { id: string; kind?: string; name?: string; title?: string; description?: string; input?: Record<string, unknown> | null; actions?: { intent?: string }[] | null };
20
+
21
+ /** A plain tool permission: the only kind a trusted agent's mode already answers. Pure, so every exclusion is tested. */
22
+ export function plainToolPermission(request: PermissionRequestShape): boolean {
23
+ if (request.kind !== "tool") return false;
24
+ const name = String(request.name ?? "");
25
+ if (!name || NEEDS_DEVELOPER.has(name) || NEEDS_DEVELOPER_PATTERN.test(name)) return false;
26
+ // Actions with an intent are plan-style choices (implement / resume / dismiss), not a yes to a tool call.
27
+ if (request.actions?.some(action => action.intent)) return false;
28
+ return true;
29
+ }
30
+
31
+ /**
32
+ * Secret-looking values a command line can carry, masked before it reaches the audit log or Settings: values after
33
+ * token/key/secret/password flags or variables, Authorization headers, credentials in URLs, and long opaque tokens.
34
+ */
35
+ export function redact(text: string): string {
36
+ return text
37
+ .replace(/((?:--?|\b)[\w-]*(?:token|secret|password|passwd|api[_-]?key|access[_-]?key|private[_-]?key|credential)[\w-]*\s*[=:\s]\s*)("[^"]*"|'[^']*'|[^\s-]\S*)/gi, "$1•••")
38
+ .replace(/\b(authorization:\s*(?:bearer|basic|token)?\s*)\S+/gi, "$1•••")
39
+ .replace(/(\/\/[^\/\s:@]+:)[^@\s\/]+@/g, "$1•••@")
40
+ .replace(/\b(?:sk-[\w-]{16,}|gh[pousr]_[A-Za-z0-9]{20,}|github_pat_\w{20,}|xox[abpsr]-[\w-]{10,}|AKIA[0-9A-Z]{16}|ya29\.[\w-]{20,}|eyJ[\w-]{10,}\.[\w-]{10,}\.[\w-]{10,})/g, "•••");
41
+ }
42
+
43
+ /** "Bash: cd repo && git status" — the tool and a short, single-line, redacted view of what it ran, for the audit log. */
44
+ export function summarize(request: PermissionRequestShape, max = 160): string {
45
+ const input = request.input ?? {};
46
+ const detail = [input.command, input.file_path, input.path, input.url, input.pattern].find(v => typeof v === "string") as string | undefined;
47
+ const text = redact((detail ?? request.title ?? request.description ?? "").replace(/\s+/g, " ").trim());
48
+ const line = text ? `${request.name}: ${text}` : String(request.name ?? "tool");
49
+ return line.length > max ? `${line.slice(0, max - 1)}…` : line;
50
+ }
51
+
52
+ export type Approval = { at: string; agentId: string; tool: string; summary: string; mode: string };
53
+ export type Decision = { approved: true; mode: string } | { approved: false; reason: "off" | "not-a-tool" | "mode" | "error"; mode?: string | null };
54
+
55
+ export type TrustOptions = {
56
+ enabled: () => Promise<boolean>;
57
+ /** The agent's current mode, read at request time (one fetch). Null when unknown. */
58
+ mode: (agentId: string) => Promise<string | null>;
59
+ approve: (agentId: string, requestId: string) => Promise<void>;
60
+ now?: () => number;
61
+ /** Lines the audit log keeps; it is trimmed back to this once it grows half again past it. */
62
+ keep?: number;
63
+ };
64
+
65
+ export class TrustBypass {
66
+ private readonly file: string;
67
+ private writes: Promise<unknown> = Promise.resolve();
68
+ constructor(directory: string, private readonly o: TrustOptions) { this.file = join(directory, "trust-bypass.jsonl"); }
69
+
70
+ async handle(agent: { id: string }, request: PermissionRequestShape): Promise<Decision> {
71
+ if (!await this.o.enabled().catch(() => false)) return { approved: false, reason: "off" };
72
+ if (!plainToolPermission(request)) return { approved: false, reason: "not-a-tool" };
73
+ const mode = await this.o.mode(agent.id).catch(() => null);
74
+ if (!mode || !FULL_TRUST_MODES.has(mode)) return { approved: false, reason: "mode", mode };
75
+ try { await this.o.approve(agent.id, request.id); } catch { return { approved: false, reason: "error", mode }; }
76
+ await this.record({ at: new Date((this.o.now ?? Date.now)()).toISOString(), agentId: agent.id, tool: String(request.name), summary: summarize(request), mode }).catch(() => undefined);
77
+ return { approved: true, mode };
78
+ }
79
+
80
+ /** Appends one line; past keep × 1.5 lines, keeps the newest `keep`. Serialized so concurrent approvals don't race the trim. */
81
+ private record(entry: Approval): Promise<void> {
82
+ const keep = this.o.keep ?? 500;
83
+ const run = async () => {
84
+ await mkdir(join(this.file, ".."), { recursive: true, mode: 0o700 });
85
+ await appendFile(this.file, JSON.stringify(entry) + "\n", { mode: 0o600 });
86
+ const lines = (await readFile(this.file, "utf8")).split("\n").filter(Boolean);
87
+ if (lines.length <= keep * 1.5) return;
88
+ const temporary = `${this.file}.${randomUUID()}`;
89
+ await writeFile(temporary, lines.slice(-keep).join("\n") + "\n", { mode: 0o600 });
90
+ await rename(temporary, this.file);
91
+ };
92
+ const next = this.writes.then(run, run);
93
+ this.writes = next.catch(() => undefined);
94
+ return next;
95
+ }
96
+
97
+ /** The newest approvals, newest first, and how many landed since local midnight. Unreadable lines are skipped. */
98
+ async recent(limit = 20): Promise<{ today: number; recent: Approval[] }> {
99
+ const text = await readFile(this.file, "utf8").catch(() => "");
100
+ const all = text.split("\n").filter(Boolean).flatMap(line => { try { return [JSON.parse(line) as Approval]; } catch { return []; } });
101
+ const midnight = new Date((this.o.now ?? Date.now)()); midnight.setHours(0, 0, 0, 0);
102
+ return { today: all.filter(a => Date.parse(a.at) >= midnight.getTime()).length, recent: all.slice(-limit).reverse() };
103
+ }
104
+ }
@@ -80,6 +80,8 @@ export const prioritiesRpc = defineRpc({ name: "follow.priorities", input: z.obj
80
80
  /** "What's this about?": collapsed reads the cache; open may start an overview; refresh always does. */
81
81
  export const workspaceAboutRpc = defineRpc({ name: "follow.workspace-about", input: z.object({ workspaceId: idSchema, open: z.boolean().optional(), refresh: z.boolean().optional() }), output: aboutViewSchema });
82
82
  export const usageRpc = defineRpc({ name: "follow.usage", input: z.object({}), output: usageSchema });
83
+ // Trust bypass agents: how many permission prompts were approved today, and the newest few (tool and a short summary).
84
+ export const trustBypassRpc = defineRpc({ name: "follow.trust-bypass", input: z.object({}), output: z.object({ today: z.number().int().nonnegative(), recent: z.array(z.object({ at: z.string(), agentId: z.string(), tool: z.string(), summary: z.string(), mode: z.string() })).max(20) }) });
83
85
  export const refineTasksRpc = defineRpc({ name: "follow.refine-tasks", input: z.object({ workspaceId: idSchema, tasks: z.array(z.object({ id: idSchema, title: textSchema, afterPrs: z.array(idSchema), dependencyStage: z.enum(["merged", "deployed"]), enable_follow_up: z.boolean(), communication: communicationSchema.optional(), trigger: taskTriggerSchema.nullable().optional() })).max(50) }), output: workspaceSchema });
84
86
  export const taskTriggerRpc = defineRpc({ name: "follow.set-task-trigger", input: z.object({ workspaceId: idSchema, obligationId: idSchema, expectedRevision: z.number().int().nonnegative(), trigger: taskTriggerSchema.nullable(), afterPrs: z.array(idSchema) }), output: workspaceSchema });
85
87
 
package/shared/display.ts CHANGED
@@ -18,7 +18,20 @@ export const displayPreferences = defineSettings({
18
18
  // 1.4.0-beta.0: the Overseer row on Home and its per-turn digest. Off never archives an existing Overseer.
19
19
  enable_overseer: z.boolean().default(true),
20
20
  // 1.4.0-beta.0: the ranker behind Home's Priority sort (Linear, Slack, GitHub reviews, the CPO's plan).
21
- enable_ranker: z.boolean().default(true) }),
21
+ enable_ranker: z.boolean().default(true),
22
+ // Trust bypass agents: a plain tool permission from an agent whose current mode is bypassPermissions (Claude) or
23
+ // full-access (Codex) is approved automatically. Off restores the prompt.
24
+ enable_trust_bypass: z.boolean().default(true) }),
22
25
  });
23
26
 
24
27
  export const displayRpc = settingsRpc(displayPreferences.id);
28
+
29
+ /** "3 prompts approved today · latest Bash: cd repo && git status". Nothing until the first approval. */
30
+ export function trustCountText(stats: { today: number; recent: { summary: string }[] } | undefined): string | null {
31
+ if (!stats) return null;
32
+ // On but unused reads differently from loading or failed (both blank).
33
+ if (!stats.today && !stats.recent.length) return "None approved yet";
34
+ const count = stats.today ? `${stats.today} ${stats.today === 1 ? "prompt" : "prompts"} approved today` : "None approved today";
35
+ const last = stats.recent[0]?.summary;
36
+ return `${count}${last ? ` · latest ${last}` : ""}`;
37
+ }