paseo-follow-up 2.3.0-beta.0 → 2.3.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/brief.tsx +17 -7
- package/client/catch-up.tsx +25 -105
- package/client/dismiss.tsx +106 -0
- package/client/home-chrome.tsx +3 -1
- package/client/home.tsx +4 -2
- package/client/inbox-store.ts +11 -1
- package/client/more-context.tsx +177 -0
- package/client/needs-you.tsx +28 -9
- package/client/questions.tsx +43 -8
- package/index.client.tsx +7 -0
- package/index.server.ts +27 -7
- package/package.json +3 -2
- package/server/agent-actions.ts +1 -1
- package/server/agent-hook.mjs +1 -1
- package/server/agent-parity.ts +10 -1
- package/server/context-requests.ts +6 -3
- package/server/dismiss.ts +62 -0
- package/server/engine.ts +13 -1
- package/server/hook-source.ts +1 -1
- package/server/inbox.ts +29 -4
- package/server/mcp-source.ts +8 -0
- package/server/mcp.mjs +8 -0
- package/server/questions.ts +47 -9
- package/shared/activity.ts +2 -2
- package/shared/attention.ts +50 -3
- package/shared/brief.ts +9 -6
- package/shared/catch-up.ts +29 -1
- package/shared/chat.ts +1 -1
- package/shared/contracts.ts +13 -3
- package/shared/display.ts +4 -3
- package/shared/errors.ts +6 -2
- package/shared/home-keys.ts +2 -2
- package/shared/inbox.ts +21 -3
- package/shared/model.ts +7 -0
- package/shared/paseo-keys.ts +24 -0
- package/shared/questions.ts +29 -1
- package/shared/search-key.ts +8 -8
- package/shared/section-search.ts +2 -2
- package/shared/status-invariants.ts +2 -2
package/shared/catch-up.ts
CHANGED
|
@@ -205,7 +205,7 @@ export function statsOf(s: Session): SessionStats {
|
|
|
205
205
|
* anywhere presets. Paseo takes Shift+? (its shortcuts dialog) and Escape (interrupt agent) when focus is outside a
|
|
206
206
|
* field, which is exactly when these fire, so the sheet is S and leaving is X.
|
|
207
207
|
*/
|
|
208
|
-
export type CatchUpAction = "pick" | "own" | "send" | "skip" | "skip-workspace" | "back" | "more" | "chip" | "ask" | "note" | "later" | "chat" | "rail" | "rail-up" | "rail-down" | "keys" | "leave" | "dictate";
|
|
208
|
+
export type CatchUpAction = "pick" | "own" | "send" | "skip" | "skip-workspace" | "back" | "more" | "chip" | "ask" | "note" | "later" | "chat" | "rail" | "rail-up" | "rail-down" | "keys" | "leave" | "dictate" | "dismiss";
|
|
209
209
|
/**
|
|
210
210
|
* a-move-bar-action-opens-in-view: where each move-bar action opens what it opens, so its result is where the eye
|
|
211
211
|
* already is and never appended below the fold. `sheet`: drawn in the phone's dock, above the bar, kept above the
|
|
@@ -237,6 +237,8 @@ export const CATCH_UP_KEYS: readonly { key: string; what: string; action: CatchU
|
|
|
237
237
|
{ key: "1–4", what: "Pick a More context ask", action: "chip", combos: ["Digit"], when: "more" },
|
|
238
238
|
{ key: "⌘↵", what: "Ask the agent", action: "ask", combos: ["Cmd+Enter", "Ctrl+Enter"], when: "more" },
|
|
239
239
|
{ key: "N", what: "Add a note", action: "note", combos: ["N"] },
|
|
240
|
+
// D alone picks option D, so Dismiss takes Shift, as Skip workspace does beside J.
|
|
241
|
+
{ key: "⇧D", what: "Dismiss the question (the agent isn't messaged)", action: "dismiss", combos: ["Shift+D"] },
|
|
240
242
|
{ key: "V", what: "Dictate your answer, and stop", action: "dictate", combos: ["V"], needs: "dictation" },
|
|
241
243
|
{ key: "L", what: "Later", action: "later", combos: ["L"] },
|
|
242
244
|
{ key: "O", what: "Open chat", action: "chat", combos: ["O"] },
|
|
@@ -266,6 +268,7 @@ export function catchUpKey(e: KeyPress, at: { typing: boolean; inMore: boolean;
|
|
|
266
268
|
if (e.key === "ArrowLeft") return { action: "back" };
|
|
267
269
|
if (at.moreOpen && /^[1-4]$/.test(e.key)) return { action: "chip", arg: e.key };
|
|
268
270
|
if (e.shift && e.key.toLowerCase() === "j") return { action: "skip-workspace" };
|
|
271
|
+
if (e.shift && e.key.toLowerCase() === "d") return { action: "dismiss" };
|
|
269
272
|
if (e.shift || e.key.length !== 1) return null;
|
|
270
273
|
const k = e.key.toLowerCase();
|
|
271
274
|
if (/^[a-h]$/.test(k)) return { action: "pick", arg: k.toUpperCase() };
|
|
@@ -387,5 +390,30 @@ export function plainAnswer(text: string): string {
|
|
|
387
390
|
return text.replace(/\*\*(.+?)\*\*|__(.+?)__/g, (_m, a, b) => a ?? b).replace(/^\s{0,3}(#{1,6}|>)\s+/gm, "").trim();
|
|
388
391
|
}
|
|
389
392
|
|
|
393
|
+
/**
|
|
394
|
+
* more-context-is-the-same-on-every-surface: a question is one card wherever it is answered. Catch up keys its card
|
|
395
|
+
* by workstream (`agent:<id>|Q3` or `ws:<id>|Q3`); the panel, Home's detail pane, the pill and phones ask with
|
|
396
|
+
* `questionCardKey`. Every reader and the worker's one-open-ask rule match through `sameCard`, so an ask made on one
|
|
397
|
+
* surface shows (and dedupes) on all of them.
|
|
398
|
+
*/
|
|
399
|
+
export const questionCardKey = (workspaceId: string, questionId: string) => `ws:${workspaceId}|${questionId}`;
|
|
400
|
+
/** The question a card key is about ("Q3"), or null for any other card (a permission, a merge, a brief). */
|
|
401
|
+
export function questionOfCard(cardKey: string): string | null {
|
|
402
|
+
const i = cardKey.indexOf("|");
|
|
403
|
+
const subject = i < 0 ? "" : cardKey.slice(i + 1);
|
|
404
|
+
return /^Q\d+$/.test(subject) ? subject : null;
|
|
405
|
+
}
|
|
406
|
+
/** One card, whichever surface named it: the same key, or the same question of the same workspace. */
|
|
407
|
+
export function sameCard(a: { workspaceId: string | null; cardKey: string }, b: { workspaceId: string | null; cardKey: string }): boolean {
|
|
408
|
+
if (a.cardKey === b.cardKey) return true;
|
|
409
|
+
const q = questionOfCard(a.cardKey);
|
|
410
|
+
return !!q && !!a.workspaceId && a.workspaceId === b.workspaceId && q === questionOfCard(b.cardKey);
|
|
411
|
+
}
|
|
412
|
+
/** The newest ask about a card, from any surface. */
|
|
413
|
+
export function contextFor(requests: readonly ContextRequest[], card: { workspaceId: string | null; cardKey: string }): ContextRequest | null {
|
|
414
|
+
for (let i = requests.length - 1; i >= 0; i--) if (sameCard(requests[i], card)) return requests[i];
|
|
415
|
+
return null;
|
|
416
|
+
}
|
|
417
|
+
|
|
390
418
|
/** The ask as the card's header quotes it: its first sentence ("I don't get it."), not the whole prompt. */
|
|
391
419
|
export const askHeadline = (ask: string): string => (ask.match(/^.+?[.?!](?=\s|$)/)?.[0] ?? ask).slice(0, 120);
|
package/shared/chat.ts
CHANGED
|
@@ -156,7 +156,7 @@ export const TOOL_PRESENTATION: Record<string, "routine" | "moment"> = {
|
|
|
156
156
|
set_pr_workflow: "routine", reviewer_settings: "routine", reviewer_suggestions: "routine", save_reviewers: "routine", set_agent_setting: "routine",
|
|
157
157
|
set_wait_for_jobs: "routine", onboarding_status: "routine", onboarding_checks: "routine", set_onboarding: "routine", rank_status: "routine",
|
|
158
158
|
rerank_priorities: "routine", overseer_status: "routine", overseer_start: "routine", overseer_restart: "routine", overseer_ask: "routine", catch_up_deck: "routine", context_requests: "routine", ask_context: "routine", context_reply: "routine",
|
|
159
|
-
inbox_brief: "routine", brief_action: "routine", queue_list: "routine", queue_action: "routine", inbox_act: "routine", answer_question: "routine", run_recovery: "routine",
|
|
159
|
+
inbox_brief: "routine", brief_action: "routine", queue_list: "routine", queue_action: "routine", inbox_act: "routine", answer_question: "routine", dismiss_question: "routine", dismiss_item: "routine", run_recovery: "routine",
|
|
160
160
|
set_workspace_spec: "routine", link_item: "routine", unlink_item: "routine", link_items: "routine", set_linked_items: "routine", set_task_trigger: "routine", pr_controls: "routine", browser_status: "routine", trust_bypass_status: "routine",
|
|
161
161
|
release_notes: "routine", updates_status: "routine", check_updates: "routine", set_updates: "routine", install_update: "routine", retry_move: "routine", report_issue: "routine", report_send: "routine", make_main_agent: "routine", wait_prepare_job: "routine", wait_for_job: "routine", wait_get_job: "routine",
|
|
162
162
|
// The developer's moments: the workspace is done, or the agent asked them something. needs_you runs every turn, so a
|
package/shared/contracts.ts
CHANGED
|
@@ -38,7 +38,7 @@ const agentCommunicationSchema = z.strictObject({
|
|
|
38
38
|
export const listRpc = defineRpc({ name: "follow.list", input: z.object({ since: z.number().optional() }), output: z.object({ workspaces: z.array(listEntrySchema), error: z.string().nullable(), revision: z.number().optional(), full: z.boolean().optional(), removed: z.array(z.string()).optional() }) });
|
|
39
39
|
export const getRpc = defineRpc({ name: "follow.get", input: z.object({ workspaceId: idSchema }), output: z.object({ workspace: workspaceSchema.nullable(), error: z.string().nullable() }) });
|
|
40
40
|
/** `prWorkflow` (1.4.0-beta.14): how this workspace ships PRs (graphite | github) and its review-fix command (null: built-in steps). */
|
|
41
|
-
export const agentStatusRpc = defineRpc({ name: "follow.agent-status", input: z.strictObject({ agentId: idSchema, detail: z.enum(["summary", "full"]).optional() }), output: workspaceSchema.extend({ prWorkflow: z.object({ mode: z.enum(["graphite", "github"]), reviewFix: z.string().nullable() }).optional(), /** The next message: recipient, tasks, exact text, and when and why it goes (Preview's agent form). */ nextMessageInfo: z.object({ to: z.string(), tasks: z.array(z.string()), text: z.string(), reason: z.string(), eta: z.string().nullable() }).nullable().optional(),
|
|
41
|
+
export const agentStatusRpc = defineRpc({ name: "follow.agent-status", input: z.strictObject({ agentId: idSchema, detail: z.enum(["summary", "full"]).optional() }), output: workspaceSchema.extend({ /** The caller's own ask the developer dismissed (still standing): don't raise it again. */ dismissedAsk: z.object({ ask: z.string(), kind: z.string(), at: z.string() }).nullable().optional(), prWorkflow: z.object({ mode: z.enum(["graphite", "github"]), reviewFix: z.string().nullable() }).optional(), /** The next message: recipient, tasks, exact text, and when and why it goes (Preview's agent form). */ nextMessageInfo: z.object({ to: z.string(), tasks: z.array(z.string()), text: z.string(), reason: z.string(), eta: z.string().nullable() }).nullable().optional(),
|
|
42
42
|
/** Home's Sending row for this workspace (shared/sending.ts): queued or sent, when and why, and whether Send now (send_repairs) would go through. */
|
|
43
43
|
sending: sendingSchema.nullable().optional() }) });
|
|
44
44
|
export const syncWorkspaceRpc = defineRpc({ name: "follow.sync", input: z.strictObject({ agentId: idSchema, summary: z.string().trim().min(1).max(1000) }), output: z.object({ workspaceId: idSchema, synced: z.literal(true) }) });
|
|
@@ -118,9 +118,19 @@ export const askQuestionRpc = defineRpc({ name: "follow.ask-question", input: z.
|
|
|
118
118
|
background: z.string().trim().max(4000).optional(), links: z.array(linkInput).max(10).optional(),
|
|
119
119
|
pr: z.string().trim().max(200).optional(), task: idSchema.optional(), supersedes: z.string().regex(/^Q\d+$/).optional(),
|
|
120
120
|
}), output: z.object({ workspaceId: idSchema, question: questionSchema, mode: z.enum(QUESTION_MODES), instruction: z.string(),
|
|
121
|
-
outcome: z.enum(["asked", "duplicate", "superseded"]).default("asked"), of: z.string().nullable().default(null) }) });
|
|
121
|
+
outcome: z.enum(["asked", "duplicate", "superseded", "dismissed"]).default("asked"), of: z.string().nullable().default(null) }) });
|
|
122
122
|
export const recordAnswerRpc = defineRpc({ name: "follow.record-answer", input: z.strictObject({ agentId: idSchema, id: z.string().regex(/^Q\d+$/), choice: z.string().trim().min(1).max(200), words: z.string().trim().max(2000).optional() }), output: z.object({ workspaceId: idSchema, question: questionSchema }) });
|
|
123
123
|
export const withdrawQuestionRpc = defineRpc({ name: "follow.withdraw-question", input: z.strictObject({ agentId: idSchema, id: z.string().regex(/^Q\d+$/), reason: z.string().trim().min(1).max(500) }), output: z.object({ workspaceId: idSchema, question: questionSchema }) });
|
|
124
|
+
/** Dismiss a question that no longer matters, or undo that (dismissing-a-question-sends-the-agent-nothing). Sends nothing. */
|
|
125
|
+
export const dismissQuestionRpc = defineRpc({ name: "follow.dismiss-question", input: z.strictObject({ workspaceId: idSchema, questionId: z.string().regex(/^Q\d+$/), undo: z.boolean().optional() }), output: z.object({ workspace: workspaceSchema, question: questionSchema }) });
|
|
126
|
+
/**
|
|
127
|
+
* Dismiss anything in Needs you, or undo that (dismissing-anything-in-needs-you-sends-the-agent-nothing): a workspace's
|
|
128
|
+
* item by its key (NeedItem.key; "question:Qn" closes the question as dismissed), or an agent's turn-end brief by its
|
|
129
|
+
* agentId. Sends nothing to any agent. `name` is what the toast calls it ("Q3", or the row's title).
|
|
130
|
+
*/
|
|
131
|
+
export const dismissRpc = defineRpc({ name: "follow.dismiss", input: z.strictObject({ workspaceId: idSchema.optional(), key: z.string().min(1).max(400).optional(), agentId: idSchema.optional(), undo: z.boolean().optional() })
|
|
132
|
+
.refine(i => !!i.agentId !== !!(i.workspaceId && i.key), "Give workspaceId and key for a Needs-you item, or agentId for an agent's brief."),
|
|
133
|
+
output: z.object({ name: z.string() }) });
|
|
124
134
|
export const answerQuestionRpc = defineRpc({ name: "follow.answer-question", input: z.object({ workspaceId: idSchema, questionId: z.string().regex(/^Q\d+$/), choice: z.string().trim().min(1).max(200), words: z.string().trim().max(2000).optional(), action: z.enum(["send", "copy", "chat", "resend"]) }), output: z.object({ workspace: workspaceSchema, question: questionSchema }) });
|
|
125
135
|
export const setSpecRpc = defineRpc({ name: "follow.set-spec", input: z.strictObject({ agentId: idSchema, url: z.string().trim().min(1).max(2000), title: z.string().trim().max(120).optional() }), output: z.object({ workspaceId: idSchema, spec: specSchema.nullable(), applied: z.boolean(), message: z.string() }) });
|
|
126
136
|
export const workspaceSpecRpc = defineRpc({ name: "follow.workspace-spec", input: z.discriminatedUnion("action", [
|
|
@@ -180,7 +190,7 @@ export const needsYouRpc = defineRpc({ name: "follow.needs-you", input: z.strict
|
|
|
180
190
|
questions: z.array(z.string()).optional(),
|
|
181
191
|
context: z.string().optional(),
|
|
182
192
|
links: z.array(z.strictObject({ label: z.string(), url: z.string().optional(), path: z.string().optional(), pr: z.string().optional() })).optional(),
|
|
183
|
-
}), output: z.object({ ok: z.literal(true), briefId: z.string() }) });
|
|
193
|
+
}), output: z.object({ ok: z.literal(true), briefId: z.string(), /** Decisions the developer had dismissed: left off the card, and why. */ note: z.string().optional() }) });
|
|
184
194
|
/** Home's detail pane: the full stored brief for one agent (the list carries only its one-liner). */
|
|
185
195
|
// The message queue (server/message-queue.ts): what waits to go to agents, and Retry or Cancel on one item.
|
|
186
196
|
export const queueListRpc = defineRpc({ name: "follow.queue-list", input: z.strictObject({ workspaceId: idSchema.optional(), agentId: idSchema.optional() }), output: z.object({ items: z.array(queueViewSchema), recent: z.array(queueViewSchema) }) });
|
package/shared/display.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineSettings, settingsRpc } from "@getpaseo/plugin";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { DEFAULT_SORT, isSortMode, SORT_MODES, type SortMode } from "./sort";
|
|
4
|
-
import { SEARCH_SHORTCUTS } from "./search-key";
|
|
4
|
+
import { DEFAULT_SEARCH_SHORTCUT, SEARCH_SHORTCUTS } from "./search-key";
|
|
5
5
|
|
|
6
6
|
/** Home's right pane as a share of Home's width: the default and the range set_display and the divider accept. */
|
|
7
7
|
export const HOME_DETAIL_DEFAULT = 0.42;
|
|
@@ -44,8 +44,9 @@ export const displayPreferences = defineSettings({
|
|
|
44
44
|
// Absent means CATCH_UP_RAIL_DEFAULT.
|
|
45
45
|
catch_up_rail_fraction: z.number().min(CATCH_UP_RAIL_MIN).max(CATCH_UP_RAIL_MAX).optional(),
|
|
46
46
|
// 2.1: the key that opens Home with the cursor in its search from anywhere in Paseo (shared/search-key.ts).
|
|
47
|
-
// Absent means DEFAULT_SEARCH_SHORTCUT (
|
|
48
|
-
|
|
47
|
+
// Absent means DEFAULT_SEARCH_SHORTCUT (⌘⇧K or Ctrl+Shift+K); "none" turns it off.
|
|
48
|
+
// The retired preset must not invalidate the entire saved Display document.
|
|
49
|
+
search_shortcut: z.preprocess(value => value === "mod-slash" ? DEFAULT_SEARCH_SHORTCUT : value, z.enum(SEARCH_SHORTCUTS).optional()) }),
|
|
49
50
|
});
|
|
50
51
|
|
|
51
52
|
/** Every Display key, set or not: what set_display accepts. */
|
package/shared/errors.ts
CHANGED
|
@@ -16,7 +16,9 @@ export const STALE_BRIEF = {
|
|
|
16
16
|
answered: "This brief was already answered or signed off.",
|
|
17
17
|
} as const;
|
|
18
18
|
// Q35 answered or withdrawn elsewhere (server/questions.ts developerAnswer, recordAnswer).
|
|
19
|
-
const MOOT = [/^This brief was (replaced by a newer one|already answered or signed off)\./, /^Q\d+ (is already (answered|withdrawn)|was withdrawn)\b
|
|
19
|
+
const MOOT = [/^This brief was (replaced by a newer one|already answered or signed off)\./, /^Q\d+ (is already (answered|withdrawn|dismissed)|was (withdrawn|dismissed))\b/,
|
|
20
|
+
// Dismiss (server/dismiss.ts, Inbox.dismiss): the item left Needs you by itself, or another surface dismissed it first.
|
|
21
|
+
/^\S+ is already (gone from Needs you|dismissed)\./, /^This agent's ask is already gone from Needs you\./];
|
|
20
22
|
|
|
21
23
|
/**
|
|
22
24
|
* A refusal that means the action is moot, not failed: what it acts on was already answered, replaced or withdrawn
|
|
@@ -28,8 +30,9 @@ export function isMoot(error: unknown): boolean {
|
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
/** Which moot refusal it is, so a surface says it in its own words instead of echoing the server's. */
|
|
31
|
-
export function mootKind(error: unknown): "answered" | "withdrawn" | "replaced" | null {
|
|
33
|
+
export function mootKind(error: unknown): "answered" | "withdrawn" | "replaced" | "dismissed" | null {
|
|
32
34
|
const t = errorText(error);
|
|
35
|
+
if (/^Q\d+ (is already dismissed|was dismissed)\b/.test(t)) return "dismissed";
|
|
33
36
|
if (/^This brief was replaced by a newer one\./.test(t)) return "replaced";
|
|
34
37
|
if (/^Q\d+ (is already withdrawn|was withdrawn)\b/.test(t)) return "withdrawn";
|
|
35
38
|
return isMoot(error) ? "answered" : null;
|
|
@@ -40,6 +43,7 @@ export function mootNote(error: unknown, typed = false): string {
|
|
|
40
43
|
const kept = typed ? "Your answer wasn't sent." : "Your pick wasn't sent.";
|
|
41
44
|
switch (mootKind(error)) {
|
|
42
45
|
case "withdrawn": return `The agent withdrew this question. ${kept}`;
|
|
46
|
+
case "dismissed": return `This question was dismissed. ${kept}`;
|
|
43
47
|
case "replaced": return `A newer card replaced this one. ${kept}`;
|
|
44
48
|
default: return `Already answered elsewhere. ${kept}`;
|
|
45
49
|
}
|
package/shared/home-keys.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* the list walk (`listMove`, shared/list-keys.ts), the search field and Search from anywhere; a letter Catch up also
|
|
4
4
|
* uses does the same thing here (O opens the chat, S shows the keys).
|
|
5
5
|
*/
|
|
6
|
-
export const HOME_KEYS: readonly { key: string; what: string; when?: "search" | "pane" }[] = [
|
|
6
|
+
export const HOME_KEYS: readonly { key: string; what: string; when?: "search" | "pane"; combos?: readonly string[] }[] = [
|
|
7
7
|
{ key: "↑ ↓ / J K", what: "Move through the list" },
|
|
8
8
|
{ key: "Home / End", what: "First or last row" },
|
|
9
9
|
{ key: "↵ / O", what: "Open the selected workspace's chat" },
|
|
@@ -12,5 +12,5 @@ export const HOME_KEYS: readonly { key: string; what: string; when?: "search" |
|
|
|
12
12
|
{ key: "↑ / ↓", what: "Move through the results", when: "search" },
|
|
13
13
|
{ key: "↵", what: "Show the result; ↵ again opens its chat", when: "search" },
|
|
14
14
|
{ key: "Esc", what: "Clear the search, then leave it", when: "search" },
|
|
15
|
-
{ key: "⌘↵", what: "Send the answer you're writing", when: "pane" },
|
|
15
|
+
{ key: "⌘↵", what: "Send the answer you're writing", when: "pane", combos: ["Cmd+Enter", "Ctrl+Enter"] },
|
|
16
16
|
];
|
package/shared/inbox.ts
CHANGED
|
@@ -42,6 +42,11 @@ export const entrySchema = z.object({
|
|
|
42
42
|
undo: z.object({ kind: z.enum(["sign_off", "snooze"]).default("sign_off"), seq: z.number().int(), prev: needsSchema.nullable(), prevSnooze: snoozeSchema.nullable().default(null), set: snoozeSchema.nullable().default(null), expires: isoSchema }).nullable().default(null),
|
|
43
43
|
/** D2: "Sign off · mute this turn". The next turn end is absorbed once. */
|
|
44
44
|
muteTurn: z.boolean().default(false),
|
|
45
|
+
/**
|
|
46
|
+
* The ask the developer dismissed (dismissing-anything-in-needs-you-sends-the-agent-nothing): a needs_you that states it
|
|
47
|
+
* again isn't flagged again (sameAsk), and the call says why. Cleared by the developer's own message or Undo.
|
|
48
|
+
*/
|
|
49
|
+
dismissedAsk: z.object({ ask: z.string(), kind: z.string(), at: isoSchema }).nullable().optional(),
|
|
45
50
|
/** Per-agent "Don't flag finishes": permission prompts and errors still flag, plain turn ends don't. */
|
|
46
51
|
enable_finish_flags: z.boolean().default(true),
|
|
47
52
|
/** Archived: hidden, kept for 7 days so an unarchive restores it. */
|
|
@@ -134,7 +139,8 @@ export type InboxEvent =
|
|
|
134
139
|
| { type: "pr_closed"; dedupeKey: string; detail: string; prKey: string; merged?: boolean; quiet?: boolean; title?: string }
|
|
135
140
|
/** The outside facts (FACT_REASONS) that still hold for this agent's PRs: a flag whose fact ended is withdrawn. */
|
|
136
141
|
| { type: "facts_live"; live: Reason[] }
|
|
137
|
-
|
|
142
|
+
/** `dismissed`: the developer's Dismiss, a sign-off that also remembers the brief's ask so it isn't flagged again. */
|
|
143
|
+
| { type: "sign_off"; seq?: number; muteTurn?: boolean; dismissed?: boolean }
|
|
138
144
|
| { type: "undo" }
|
|
139
145
|
| { type: "snooze"; until: string }
|
|
140
146
|
/** Bring back now: ends a Later early. */
|
|
@@ -321,7 +327,7 @@ export function reduce(prev: Entry, event: InboxEvent, now: string): Entry {
|
|
|
321
327
|
case "message":
|
|
322
328
|
// #11 clears everything. #12 automation changes nothing, except that its turn supersedes the last turn's
|
|
323
329
|
// failure or pause (RUN_STATE_REASONS): the agent is running again.
|
|
324
|
-
if (event.from === "tom") { e.needs = null; e.snooze = null; e.muteTurn = false; e.lastTomMessageAt = now; }
|
|
330
|
+
if (event.from === "tom") { e.needs = null; e.snooze = null; e.muteTurn = false; e.dismissedAsk = null; e.lastTomMessageAt = now; }
|
|
325
331
|
else { e.needs = withoutRunState(e.needs); if (!e.needs) e.snooze = null; }
|
|
326
332
|
break;
|
|
327
333
|
case "permission": flag("permission", event.detail, `permission:${event.requestId}`); break; // #4
|
|
@@ -361,6 +367,7 @@ export function reduce(prev: Entry, event: InboxEvent, now: string): Entry {
|
|
|
361
367
|
if (e.needs || e.snooze) e.undo = { kind: "sign_off", seq: e.seq + 1, prev: e.needs, prevSnooze: e.snooze, set: null, expires: new Date(Date.parse(now) + UNDO_MS).toISOString() };
|
|
362
368
|
e.needs = null; e.snooze = null; e.signedOffAt = now;
|
|
363
369
|
if (event.muteTurn) e.muteTurn = true;
|
|
370
|
+
if (event.dismissed && e.brief?.ask) e.dismissedAsk = { ask: e.brief.ask, kind: e.brief.kind, at: now };
|
|
364
371
|
break;
|
|
365
372
|
}
|
|
366
373
|
case "undo": { // #14
|
|
@@ -377,7 +384,7 @@ export function reduce(prev: Entry, event: InboxEvent, now: string): Entry {
|
|
|
377
384
|
const keys = new Set(e.needs.reasons.map(r => r.dedupeKey));
|
|
378
385
|
e.needs = { reasons: [...u.prev.reasons.filter(r => !keys.has(r.dedupeKey)), ...e.needs.reasons], since: u.prev.since < e.needs.since ? u.prev.since : e.needs.since };
|
|
379
386
|
}
|
|
380
|
-
e.undo = null; e.signedOffAt = null; e.muteTurn = false;
|
|
387
|
+
e.undo = null; e.signedOffAt = null; e.muteTurn = false; e.dismissedAsk = null;
|
|
381
388
|
break;
|
|
382
389
|
}
|
|
383
390
|
case "snooze": // #15, and #15b: Later is undoable like a sign-off.
|
|
@@ -605,3 +612,14 @@ export function prEndEvent(pr: { key: string; repo: string; number: number; agen
|
|
|
605
612
|
const merged = s.state === "MERGED";
|
|
606
613
|
return { type: "pr_closed", dedupeKey: `${pr.key}:${s.state}`, detail: `#${pr.number} ${merged ? "merged" : "closed"}`, prKey: pr.key, merged, ...(s.title ? { title: s.title } : {}), ...(merged && agentMerges(pr) ? { quiet: true } : {}) };
|
|
607
614
|
}
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Whether a needs_you ask restates one the developer dismissed (dismissing-anything-in-needs-you-sends-the-agent-nothing):
|
|
618
|
+
* the same words once case, punctuation and spacing are set aside. A different ask is news and flags as usual.
|
|
619
|
+
*/
|
|
620
|
+
export function sameAsk(a: string, b: string): boolean {
|
|
621
|
+
const norm = (s: string) => s.toLowerCase().replace(/[^\p{L}\p{N}#]+/gu, " ").trim();
|
|
622
|
+
return !!norm(a) && norm(a) === norm(b);
|
|
623
|
+
}
|
|
624
|
+
/** What needs_you tells an agent whose restated ask the developer had dismissed. */
|
|
625
|
+
export const DISMISSED_ASK_NOTE = "The developer dismissed this ask: it no longer needs them, so it wasn't flagged again and nothing was sent. Don't raise it again; if something really changed, say what changed in a new ask.";
|
package/shared/model.ts
CHANGED
|
@@ -126,6 +126,13 @@ export const workspaceSchema = z.object({
|
|
|
126
126
|
* needs it was set on (`keys`, needKey). A new need or the time ends it (workspaceSnoozed). Null: not snoozed.
|
|
127
127
|
*/
|
|
128
128
|
snooze: z.object({ until: z.string(), at: z.string(), keys: z.array(z.string()) }).nullable().optional(),
|
|
129
|
+
/**
|
|
130
|
+
* Needs-you items the developer dismissed (dismissing-anything-in-needs-you-sends-the-agent-nothing): the item's key
|
|
131
|
+
* and its print (shared/attention.ts dismissPrint), what it said, when and by whom. An item stays hidden while its
|
|
132
|
+
* print matches; a change (a new head, a new failure, a new batch) is a new print, so it comes back. Nothing here is
|
|
133
|
+
* ever sent to an agent. A question's dismissal lives on the question (closed.dismissed), not here.
|
|
134
|
+
*/
|
|
135
|
+
dismissed: z.array(z.object({ key: z.string().max(400), print: z.string().max(2000), title: z.string().max(400), at: z.string(), by: z.string() })).max(100).optional(),
|
|
129
136
|
prs: z.array(prSchema), obligations: z.array(obligationSchema), batches: z.array(batchSchema),
|
|
130
137
|
excludedStacks: z.array(z.object({ name: textSchema, reason: textSchema, excludedAt: z.string(), prs: z.array(prSchema), obligations: z.array(obligationSchema) })).default([]),
|
|
131
138
|
prActions: z.array(z.object({ id: idSchema, kind: z.enum(["merge", "enable_mwr", "disable_mwr", "request_reviewers"]), reviewers: z.array(z.string()).optional(), prs: z.array(idSchema), heads: z.record(z.string(), z.string()), createdAt: z.string(), state: z.enum(["sending", "submitted", "failed", "uncertain"]), result: z.string(), /** A submitted merge: how far it got (mergeStageSchema). */ merge: z.enum(["merged", "queued", "requested"]).optional() })).default([]),
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Canonical Paseo combos: expand Mod for both platforms and compare modifiers in one order. */
|
|
2
|
+
export function normalizeCombos(combos: readonly string[]): string[] {
|
|
3
|
+
return [...new Set(combos.filter(Boolean).flatMap(combo => {
|
|
4
|
+
const variants = combo.startsWith("Mod+") ? [combo.replace(/^Mod\+/, "Cmd+"), combo.replace(/^Mod\+/, "Ctrl+")] : [combo];
|
|
5
|
+
return variants.map(value => {
|
|
6
|
+
const parts = value.split("+");
|
|
7
|
+
const key = parts.pop()!;
|
|
8
|
+
const order = ["Cmd", "Ctrl", "Alt", "Shift"];
|
|
9
|
+
return [...parts.sort((a, b) => order.indexOf(a) - order.indexOf(b)), key.length === 1 ? key.toUpperCase() : key].join("+");
|
|
10
|
+
});
|
|
11
|
+
}))].sort();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Read JS string escapes before comparing (notably Cmd+\\). Only shortcut declarations count. */
|
|
15
|
+
export function extractPaseoCombos(bundle: string): string[] {
|
|
16
|
+
return normalizeCombos([...bundle.matchAll(/\bcombo\s*:\s*("(?:\\.|[^"\\])*")/g)].map(m => JSON.parse(m[1]) as string));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function keyConflicts(actual: readonly string[], bound: readonly string[], followUp: readonly string[]) {
|
|
20
|
+
const known = new Set(normalizeCombos(bound));
|
|
21
|
+
const ours = new Set(normalizeCombos(followUp));
|
|
22
|
+
const combos = normalizeCombos(actual);
|
|
23
|
+
return { collisions: combos.filter(c => ours.has(c)), additions: combos.filter(c => !known.has(c)) };
|
|
24
|
+
}
|
package/shared/questions.ts
CHANGED
|
@@ -91,7 +91,11 @@ export const questionSchema = z.object({
|
|
|
91
91
|
askedAt: z.string(),
|
|
92
92
|
mode: z.enum(QUESTION_MODES),
|
|
93
93
|
answer: answerSchema.nullable().default(null),
|
|
94
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Closed without an answer: withdrawn by its agent, superseded, a task that moved on, or `dismissed` by the developer
|
|
96
|
+
* (or an agent for them, `by` "agent:<id>"): it no longer matters, and the agent was sent nothing.
|
|
97
|
+
*/
|
|
98
|
+
closed: z.object({ at: z.string(), reason: z.string(), by: z.string().nullable(), dismissed: z.boolean().optional() }).nullable().default(null),
|
|
95
99
|
/** Which path created it (1.4.0-beta.25): ask_question, a needs_you decision, or a blocked task. Older records: null. */
|
|
96
100
|
via: z.enum(["ask", "needs_you", "task"]).nullable().optional(),
|
|
97
101
|
});
|
|
@@ -100,6 +104,15 @@ export type QuestionOption = z.infer<typeof questionOptionSchema>;
|
|
|
100
104
|
export type Answer = z.infer<typeof answerSchema>;
|
|
101
105
|
|
|
102
106
|
export const isOpen = (q: Pick<Question, "answer" | "closed">) => !q.answer && !q.closed;
|
|
107
|
+
/** The developer dismissed it (dismissing-a-question-sends-the-agent-nothing): closed, no answer, nothing sent. */
|
|
108
|
+
export const isDismissed = (q: Pick<Question, "answer" | "closed">) => !q.answer && !!q.closed?.dismissed;
|
|
109
|
+
export const DISMISS_REASON = "Dismissed by the developer: it no longer matters.";
|
|
110
|
+
/** A closed question's line on every surface: "Dismissed by you" (or "for you by an agent"), else why it was withdrawn. */
|
|
111
|
+
export function closedLine(q: Pick<Question, "answer" | "closed">): string {
|
|
112
|
+
if (!q.closed) return "";
|
|
113
|
+
if (isDismissed(q)) return q.closed.by?.startsWith("agent:") ? "Dismissed for you by an agent" : "Dismissed by you";
|
|
114
|
+
return `Withdrawn: ${q.closed.reason}`;
|
|
115
|
+
}
|
|
103
116
|
|
|
104
117
|
/** Q1, Q2…: unique for the life of the workspace, never reused after a question closes. */
|
|
105
118
|
export function nextQuestionId(questions: Pick<Question, "id">[]): string {
|
|
@@ -361,6 +374,21 @@ export function findOpenMatch<Q extends Matchable>(questions: readonly Q[], inpu
|
|
|
361
374
|
return best && { question: best.question, verdict: best.verdict };
|
|
362
375
|
}
|
|
363
376
|
|
|
377
|
+
/**
|
|
378
|
+
* The dismissed question `input` repeats, if any: the same candidates and rule as findOpenMatch, over questions the
|
|
379
|
+
* developer dismissed. A re-ask returns it instead of a new card, so an agent can't bring back what the developer set
|
|
380
|
+
* aside (no re-ask loop); `supersedes` is the way to ask again when something really changed.
|
|
381
|
+
*/
|
|
382
|
+
export function findDismissedMatch<Q extends Matchable>(questions: readonly Q[], input: QuestionShape, askedBy: string | null): Q | null {
|
|
383
|
+
for (let i = questions.length - 1; i >= 0; i--) {
|
|
384
|
+
const q = questions[i];
|
|
385
|
+
if (!isDismissed(q) || q.taskRevision !== null) continue;
|
|
386
|
+
const own = q.askedBy === askedBy || q.via === "needs_you";
|
|
387
|
+
if ((own ? compareQuestions(input, q) : nearIdentical(input, q) ? "same" : null) === "same") return q;
|
|
388
|
+
}
|
|
389
|
+
return null;
|
|
390
|
+
}
|
|
391
|
+
|
|
364
392
|
/** Open questions that repeat an older open one in the same workspace: [duplicate, original] pairs. The invariant. */
|
|
365
393
|
export function duplicateOpenQuestions<Q extends Matchable>(questions: readonly Q[]): { duplicate: Q; of: Q }[] {
|
|
366
394
|
const out: { duplicate: Q; of: Q }[] = [];
|
package/shared/search-key.ts
CHANGED
|
@@ -5,12 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/** "Search from anywhere": opens Home with the cursor in its search. Mod is ⌘ on a Mac and Ctrl elsewhere. */
|
|
8
|
-
export const SEARCH_SHORTCUTS = ["mod-
|
|
8
|
+
export const SEARCH_SHORTCUTS = ["mod-shift-k", "mod-shift-h", "none"] as const;
|
|
9
9
|
export type SearchShortcut = typeof SEARCH_SHORTCUTS[number];
|
|
10
|
-
export const DEFAULT_SEARCH_SHORTCUT: SearchShortcut = "mod-
|
|
10
|
+
export const DEFAULT_SEARCH_SHORTCUT: SearchShortcut = "mod-shift-k";
|
|
11
11
|
|
|
12
12
|
const KEYS: Record<Exclude<SearchShortcut, "none">, { key: string; code: string; shift: boolean }> = {
|
|
13
|
-
"mod-slash": { key: "/", code: "Slash", shift: false },
|
|
14
13
|
"mod-shift-k": { key: "k", code: "KeyK", shift: true },
|
|
15
14
|
"mod-shift-h": { key: "h", code: "KeyH", shift: true },
|
|
16
15
|
};
|
|
@@ -34,7 +33,7 @@ export type KeyEventLike = { key: string; code?: string; metaKey: boolean; ctrlK
|
|
|
34
33
|
|
|
35
34
|
/**
|
|
36
35
|
* True when `event` is exactly `preset`: Mod (⌘ on a Mac, Ctrl elsewhere), Shift as the preset says, no other modifier,
|
|
37
|
-
* and the key by its character or its physical code (so
|
|
36
|
+
* and the key by its character or its physical code (so the key works across keyboard layouts).
|
|
38
37
|
* Never while an input method is composing, never on auto-repeat.
|
|
39
38
|
*/
|
|
40
39
|
export function matchesShortcut(event: KeyEventLike, preset: SearchShortcut, mac: boolean): boolean {
|
|
@@ -45,7 +44,7 @@ export function matchesShortcut(event: KeyEventLike, preset: SearchShortcut, mac
|
|
|
45
44
|
return event.key.toLowerCase() === want.key || event.code === want.code;
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
/** How the platform prints it: "
|
|
47
|
+
/** How the platform prints it: "⌘⇧K" on a Mac; "Ctrl+Shift+K" elsewhere; null for None. */
|
|
49
48
|
export function shortcutLabel(preset: SearchShortcut, mac: boolean): string | null {
|
|
50
49
|
if (preset === "none") return null;
|
|
51
50
|
const { key, shift } = KEYS[preset];
|
|
@@ -53,7 +52,7 @@ export function shortcutLabel(preset: SearchShortcut, mac: boolean): string | nu
|
|
|
53
52
|
return mac ? `⌘${shift ? "⇧" : ""}${k}` : `Ctrl+${shift ? "Shift+" : ""}${k}`;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
/** The preset in Paseo's own combo spelling ("Cmd
|
|
55
|
+
/** The preset in Paseo's own combo spelling ("Cmd+Shift+K", "Ctrl+Shift+K"), to compare with PASEO_BOUND. */
|
|
57
56
|
export function shortcutCombos(preset: SearchShortcut): string[] {
|
|
58
57
|
if (preset === "none") return [];
|
|
59
58
|
const { key, shift } = KEYS[preset];
|
|
@@ -68,10 +67,11 @@ export function searchShortcutOptions(mac: boolean): { label: string; value: Sea
|
|
|
68
67
|
|
|
69
68
|
/**
|
|
70
69
|
* Every key combo Paseo's web app binds, read from its bundles (`combo:"…"` in the served web UI's index JS) of
|
|
71
|
-
* 0.15.4 and 0.
|
|
72
|
-
* if a preset takes one of these.
|
|
70
|
+
* 0.15.4, 0.16.x and 0.17.0-beta.1, the union (Mod expanded for both platforms).
|
|
71
|
+
* check:paseo-keys checks latest and beta manually; tests fail if a preset takes one of these.
|
|
73
72
|
*/
|
|
74
73
|
export const PASEO_BOUND: readonly string[] = [
|
|
74
|
+
"Cmd+/", "Ctrl+/", "Cmd+Shift+/", "Ctrl+Shift+/",
|
|
75
75
|
"Alt+Digit", "Alt+Shift+Digit", "Alt+Shift+W", "Alt+Shift+[", "Alt+Shift+]", "Alt+[", "Alt+]",
|
|
76
76
|
"Cmd+,", "Cmd+.", "Cmd+Alt+Digit", "Cmd+Alt+Shift+ArrowDown", "Cmd+Alt+Shift+ArrowLeft", "Cmd+Alt+Shift+ArrowRight",
|
|
77
77
|
"Cmd+Alt+Shift+ArrowUp", "Cmd+Alt+T", "Cmd+B", "Cmd+D", "Cmd+Digit", "Cmd+E", "Cmd+K", "Cmd+L", "Cmd+N", "Cmd+O",
|
package/shared/section-search.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Obligation, Pr } from "./model";
|
|
|
2
2
|
import type { Activity } from "./activity";
|
|
3
3
|
import type { RepairRow } from "./task-rows";
|
|
4
4
|
import { shortTitle } from "./task-rows";
|
|
5
|
-
import { answerLabel, answerStatus, type Question } from "./questions";
|
|
5
|
+
import { answerLabel, answerStatus, closedLine, type Question } from "./questions";
|
|
6
6
|
import type { ItemField } from "./search";
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -48,7 +48,7 @@ export function activityFields(r: Pick<Activity, "text" | "detail">): ItemField[
|
|
|
48
48
|
/** The Questions tab's line 2: the answer, where it is on its way, or why it was withdrawn. */
|
|
49
49
|
export function questionStatus(q: Question): string {
|
|
50
50
|
const s = answerStatus(q);
|
|
51
|
-
return q.answer ? `${s && !s.delivered ? `${s.label} · ` : ""}${answerLabel(q, q.answer.choice, q.answer.words)}` : q.closed ?
|
|
51
|
+
return q.answer ? `${s && !s.delivered ? `${s.label} · ` : ""}${answerLabel(q, q.answer.choice, q.answer.words)}` : q.closed ? closedLine(q) : "Waiting for you";
|
|
52
52
|
}
|
|
53
53
|
/** A question: "Q2 · title" and its status line, both on the row. */
|
|
54
54
|
export function questionFields(q: Question): ItemField[] {
|
|
@@ -9,7 +9,7 @@ import { briefAnswer, briefAnswers, briefAsks, briefStep, reviewersBriefPr, shou
|
|
|
9
9
|
import { workspaceHeadline, sayNew, repeatsRow, flagHeadline, HEADLINE_WORD } from "./headline";
|
|
10
10
|
import { newEntry, prEndEvent, REASONS, reduce, type InboxRow } from "./inbox";
|
|
11
11
|
import { blockedOnDeveloper, completionCheck, liveWorkingTask, summary } from "./model";
|
|
12
|
-
import {
|
|
12
|
+
import { liveLine, needsYou, reviewersAskStands, type NeedItem } from "./attention";
|
|
13
13
|
import { HOME_GROUPS, homeCounts, prChip, trackedGroup, type HomeModel } from "./home";
|
|
14
14
|
import { freshPriorities, type Priority } from "./priorities";
|
|
15
15
|
import { agentCard, automaticHold, batchView, holdSuperseded } from "./status";
|
|
@@ -570,7 +570,7 @@ export function factFlagViolations(rows: Pick<InboxRow, "agentId" | "needs">[],
|
|
|
570
570
|
if (!flag) continue;
|
|
571
571
|
const prs = workspaces.filter(w => w.enable_tracking && !w.archived).flatMap(w => w.prs.filter(p => (p.registeredAgentId ?? w.mainAgentId) === row.agentId).map(p => ({ p, w })));
|
|
572
572
|
if (prs.some(({ p }) => p.error || !p.snapshot?.complete)) continue;
|
|
573
|
-
if (!prs.some(({ p, w }) => p.snapshot!.state === "OPEN" &&
|
|
573
|
+
if (!prs.some(({ p, w }) => p.snapshot!.state === "OPEN" && reviewersAskStands(p, w))) out.push({ id: "outside-fact-is-live", detail: `${row.agentId} still flags "Add reviewers ${flag.detail}" but none of its PRs asks for reviewers` });
|
|
574
574
|
}
|
|
575
575
|
return out;
|
|
576
576
|
}
|