paseo-follow-up 1.3.0-beta.4 → 1.3.0-beta.5
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
|
@@ -116,7 +116,7 @@ The Follow-up sidebar row (and ⌘K → **Follow-up: Home**) opens **Home**: eve
|
|
|
116
116
|
Install the beta:
|
|
117
117
|
|
|
118
118
|
```sh
|
|
119
|
-
paseo plugin update follow-through --version 1.3.0-beta.
|
|
119
|
+
paseo plugin update follow-through --version 1.3.0-beta.5
|
|
120
120
|
# or, for a fresh install:
|
|
121
121
|
paseo plugin install npm:paseo-follow-up@beta
|
|
122
122
|
```
|
package/client/brief.tsx
CHANGED
|
@@ -141,14 +141,22 @@ export function BriefCard({ item, theme, layout, agentId, deps, embedded = false
|
|
|
141
141
|
</View>;
|
|
142
142
|
|
|
143
143
|
if (b.slim) {
|
|
144
|
-
//
|
|
144
|
+
// Permission: Paseo's own prompt below is the control (F9). Fallback: the paragraph is right above.
|
|
145
|
+
// The label and age share the top line so the ask always gets the full width; at a narrow panel the move wraps under it.
|
|
145
146
|
return <View accessibilityRole="summary" accessibilityLabel={`${acts ? "Needs you: " : ""}${b.ask}. ${b.sourceLine}`}
|
|
146
|
-
style={{ marginVertical:
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
style={{ marginVertical: embedded ? 0 : 10, gap: 4, paddingHorizontal: 12, paddingVertical: 10, borderRadius: 10, borderWidth: 1, borderColor: border }}>
|
|
148
|
+
<View style={{ flexDirection: "row", alignItems: "center", gap: 7 }}>
|
|
149
|
+
<Icon name={ICON[b.kind]} size={14} color={tone} />
|
|
150
|
+
<Text numberOfLines={1} style={{ flexShrink: 1, color: acts ? attention : tone, fontSize: 12, lineHeight: 16, fontWeight: "600" }}>{acts ? "Needs you" : word(b.kind)}</Text>
|
|
151
|
+
<View style={{ flex: 1 }} />
|
|
152
|
+
<Text style={{ color: c.foregroundMuted, fontSize: 12, lineHeight: 16, fontVariant: ["tabular-nums"] }}>{ageText}</Text>
|
|
153
|
+
</View>
|
|
154
|
+
<View style={{ flexDirection: "row", flexWrap: "wrap", alignItems: "center", columnGap: 10, rowGap: 8 }}>
|
|
155
|
+
<Text numberOfLines={3} {...(Platform.OS === "web" ? { title: b.ask } as object : {})}
|
|
156
|
+
style={{ flexGrow: 1, flexShrink: 1, flexBasis: 200, minWidth: 0, color: acts ? c.foreground : c.foregroundMuted, fontSize: 14, lineHeight: 20, fontWeight: acts ? "600" : "400" }}>{b.ask}</Text>
|
|
157
|
+
{!embedded && moves.map(m => <Btn key={m.kind} label={busy === m.kind ? `${m.label}…` : m.label} icon={MOVE_ICON[m.kind]} disabled={!!busy} onPress={() => press(m)} c={c} compact={compact} />)}
|
|
158
|
+
</View>
|
|
159
|
+
{!!error && <Text accessibilityRole="alert" style={{ color: c.statusDanger, fontSize: 13, lineHeight: 18 }}>{error}</Text>}
|
|
152
160
|
</View>;
|
|
153
161
|
}
|
|
154
162
|
|
|
Binary file
|
|
Binary file
|
package/index.server.ts
CHANGED
|
@@ -134,7 +134,7 @@ export default function contribute(server: PluginServerContext) {
|
|
|
134
134
|
if (stopped || loadError) return;
|
|
135
135
|
// Critical memory: the inbox's background reads wait too; hooks still record live events.
|
|
136
136
|
if (!governor.allowsExtras()) { if (!stopped) inboxTimer = setTimeout(() => void inboxLoop(), 15_000); return; }
|
|
137
|
-
try { await writeBriefState().catch(() => undefined); await inbox.tick(); await inbox.observeGuard(); await inbox.observeFollowUp(await store.snapshot()); inboxError = null; }
|
|
137
|
+
try { await writeBriefState().catch(() => undefined); await inbox.tick(); await inbox.reconcilePermissions(); await inbox.observeGuard(); await inbox.observeFollowUp(await store.snapshot()); inboxError = null; }
|
|
138
138
|
catch (error) { inboxError = error instanceof Error ? error.message : "The Needs-you inbox couldn't update."; }
|
|
139
139
|
if (!stopped) inboxTimer = setTimeout(() => void inboxLoop(), 15_000);
|
|
140
140
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "paseo-follow-up",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.3.0-beta.
|
|
4
|
+
"version": "1.3.0-beta.5",
|
|
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": [
|
|
@@ -9,6 +9,7 @@ const info = (a: Snapshot): AgentInfo => ({
|
|
|
9
9
|
title: a.title ?? null, status: a.status, archivedAt: a.archivedAt ?? null, updatedAt: a.updatedAt ?? null,
|
|
10
10
|
lastUserMessageAt: a.lastUserMessageAt ?? null, requiresAttention: !!a.requiresAttention, attentionReason: a.attentionReason ?? null,
|
|
11
11
|
attentionTimestamp: a.attentionTimestamp ?? null, createdAt: a.createdAt ?? null,
|
|
12
|
+
pendingPermissionIds: Array.isArray(a.pendingPermissions) ? a.pendingPermissions.flatMap(p => typeof (p as { id?: unknown })?.id === "string" ? [(p as { id: string }).id] : []) : null,
|
|
12
13
|
});
|
|
13
14
|
|
|
14
15
|
/** The daemon as the inbox sees it. One connection reads agents and workspaces together, cached briefly. */
|
package/server/inbox.ts
CHANGED
|
@@ -59,6 +59,8 @@ export type AgentInfo = {
|
|
|
59
59
|
requiresAttention: boolean; attentionReason: string | null;
|
|
60
60
|
/** When Paseo marked the agent as needing attention (a turn finished unread). Optional for older hosts and stubs. */
|
|
61
61
|
attentionTimestamp?: string | null; createdAt?: string | null;
|
|
62
|
+
/** Ids of the permission prompts Paseo shows for this agent right now. Absent or null: unknown, so nothing is cleared. */
|
|
63
|
+
pendingPermissionIds?: string[] | null;
|
|
62
64
|
};
|
|
63
65
|
export interface Directory {
|
|
64
66
|
agents(): Promise<AgentInfo[]>;
|
|
@@ -90,6 +92,8 @@ export type InboxOptions = {
|
|
|
90
92
|
guard: () => Promise<GuardPause[] | null>;
|
|
91
93
|
now?: () => number;
|
|
92
94
|
graceMs?: number;
|
|
95
|
+
/** How long a permission row stays before reconcilePermissions checks Paseo still shows its prompt. */
|
|
96
|
+
permissionSettleMs?: number;
|
|
93
97
|
/** How long a turn end waits for Paseo to stop reporting "running" (F7). Tests shorten it. */
|
|
94
98
|
settleMs?: number; settleStepMs?: number;
|
|
95
99
|
};
|
|
@@ -301,6 +305,8 @@ export class Inbox {
|
|
|
301
305
|
const turn = this.turns.get(root.rootId) ?? this.turns.get(agent.id);
|
|
302
306
|
const stated = await this.sources(root.rootId, turn?.at ?? null, turn?.turnId ?? null);
|
|
303
307
|
const brief = await this.creator(root.rootId, turn?.turnId ?? null, `:permission:${request.id}`, "permission", { ...stated, permission: { title: question, subagent: root.subagent ? { id: agent.id, title: root.subagent.title } : null } });
|
|
308
|
+
// Answered while the brief was being built: its resolve already ran against an unflagged entry, so flagging now would stick.
|
|
309
|
+
if (this.resolved.has(key)) return;
|
|
304
310
|
this.pending.add(root.rootId);
|
|
305
311
|
await this.apply([{ agentId: root.rootId, event: { type: "permission", requestId: request.id, detail: root.subagent ? `Subagent asks · ${question}` : question }, brief }]);
|
|
306
312
|
})().catch(() => undefined).finally(resolve);
|
|
@@ -318,6 +324,36 @@ export class Inbox {
|
|
|
318
324
|
await this.apply([{ agentId: root.rootId, event: { type: "permission_resolved", requestId } }]);
|
|
319
325
|
}
|
|
320
326
|
|
|
327
|
+
/**
|
|
328
|
+
* A permission row whose prompt Paseo no longer shows is cleared, for resolves the hook never delivered (a mode change,
|
|
329
|
+
* a provider that answers on its own, a worker restart). Reads only the daemon's agent list, never a timeline, and only
|
|
330
|
+
* when a permission row has been up past the settle time. An agent whose pending prompts are unknown keeps its row.
|
|
331
|
+
*/
|
|
332
|
+
async reconcilePermissions(): Promise<void> {
|
|
333
|
+
const now = this.now();
|
|
334
|
+
const settle = this.o.permissionSettleMs ?? 30_000;
|
|
335
|
+
const state = await this.store.snapshot();
|
|
336
|
+
const open = Object.entries(state.entries).flatMap(([rootId, e]) => (e.needs?.reasons ?? [])
|
|
337
|
+
.filter(r => r.reason === "permission" && now - Date.parse(r.at) >= settle)
|
|
338
|
+
.map(r => ({ rootId, requestId: r.dedupeKey.replace(/^permission:/, "") })));
|
|
339
|
+
if (!open.length) return;
|
|
340
|
+
const agents = await this.o.directory.agents();
|
|
341
|
+
const byId = new Map(agents.map(a => [a.id, a]));
|
|
342
|
+
const rootOf = (a: AgentInfo) => { let at = a; for (let i = 0; i < 8 && at.parentAgentId && byId.has(at.parentAgentId); i++) at = byId.get(at.parentAgentId)!; return at.id; };
|
|
343
|
+
const events: { agentId: string; event: InboxEvent }[] = [];
|
|
344
|
+
for (const { rootId, requestId } of open) {
|
|
345
|
+
if (!byId.has(rootId)) continue;
|
|
346
|
+
const family = agents.filter(a => rootOf(a) === rootId);
|
|
347
|
+
if (family.some(a => !Array.isArray(a.pendingPermissionIds))) continue;
|
|
348
|
+
const showing = family.flatMap(a => a.pendingPermissionIds!);
|
|
349
|
+
// "import" stands for whatever prompt was up when the worker started; it clears once none is.
|
|
350
|
+
if (requestId === "import" ? showing.length : showing.includes(requestId)) continue;
|
|
351
|
+
events.push({ agentId: rootId, event: { type: "permission_resolved", requestId } });
|
|
352
|
+
if (!showing.length) this.pending.delete(rootId);
|
|
353
|
+
}
|
|
354
|
+
await this.apply(events);
|
|
355
|
+
}
|
|
356
|
+
|
|
321
357
|
/** Root agents with a permission prompt showing, for the Stop-hook nudge to skip (R2). */
|
|
322
358
|
private pending = new Set<string>();
|
|
323
359
|
pendingPermissions(): string[] { return [...this.pending]; }
|