@andrioid/paseo-attention-span 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/OVERVIEW.md +3 -1
- package/client/attention-screen.tsx +61 -1174
- package/client/coverage-settings.tsx +5 -4
- package/client/data.ts +4 -2
- package/client/feedback.tsx +21 -25
- package/client/history.tsx +12 -50
- package/client/item-actions.ts +387 -0
- package/client/item-row.tsx +450 -0
- package/client/new-issue.tsx +244 -0
- package/client/next-up.tsx +22 -183
- package/client/pickers.tsx +238 -0
- package/client/session-menu.ts +3 -11
- package/client/sessions.ts +58 -57
- package/client/setup.tsx +2 -1
- package/client/sheet.tsx +92 -15
- package/client/ui.tsx +23 -14
- package/client/wrap-up.tsx +151 -85
- package/docs/architecture.md +24 -13
- package/docs/screenshots/desktop-dark-doing-acknowledge.png +0 -0
- package/docs/screenshots/desktop-dark-doing-clear.png +0 -0
- package/docs/screenshots/desktop-dark-doing-issue-sheet.png +0 -0
- package/docs/screenshots/desktop-dark-doing-reviewers.png +0 -0
- package/docs/screenshots/desktop-dark-doing-sheet.png +0 -0
- package/docs/screenshots/desktop-dark-doing-wrap-dirty.png +0 -0
- package/docs/screenshots/desktop-dark-doing-wrap-multi.png +0 -0
- package/docs/screenshots/desktop-dark-doing-wrap.png +0 -0
- package/docs/screenshots/desktop-dark-doing.png +0 -0
- package/docs/screenshots/desktop-dark-history-filtered.png +0 -0
- package/docs/screenshots/desktop-dark-history.png +0 -0
- package/docs/screenshots/desktop-dark-next-up.png +0 -0
- package/docs/screenshots/desktop-dark-settings.png +0 -0
- package/docs/screenshots/desktop-dark-setup.png +0 -0
- package/docs/screenshots/desktop-dark-waiting-too-long.png +0 -0
- package/docs/screenshots/desktop-dark-waiting.png +0 -0
- package/docs/screenshots/phone-dark-doing.png +0 -0
- package/docs/screenshots/phone-dark-history.png +0 -0
- package/docs/screenshots/phone-light-next-up-filtered.png +0 -0
- package/index.client.tsx +19 -0
- package/index.server.ts +43 -26
- package/package.json +2 -1
- package/requirements.yaml +10 -3
- package/server/actions.ts +2 -1
- package/server/archive.ts +146 -67
- package/server/archived.ts +12 -16
- package/server/changes.ts +34 -54
- package/server/classify.ts +157 -139
- package/server/context.ts +95 -3
- package/server/feedback.ts +2 -6
- package/server/fetch.ts +262 -0
- package/server/fixture.ts +88 -14
- package/server/github-types.ts +5 -2
- package/server/markdown.ts +3 -1
- package/server/port.ts +46 -0
- package/server/queries.ts +34 -24
- package/server/service.ts +155 -272
- package/server/setup.ts +15 -14
- package/server/store.ts +94 -80
- package/server/update.ts +34 -13
- package/server/view.ts +16 -15
- package/shared/archive.ts +116 -13
- package/shared/attention.ts +63 -18
- package/shared/changes.ts +2 -1
- package/shared/config.ts +2 -6
- package/shared/drafting.ts +17 -0
- package/shared/feedback.ts +6 -5
- package/shared/format.ts +2 -1
- package/shared/history-report.ts +2 -1
- package/shared/item-sessions.ts +76 -0
- package/shared/item-view.ts +224 -0
- package/shared/linked-sessions.ts +59 -8
- package/shared/names.ts +17 -0
- package/shared/new-issue.ts +129 -0
- package/shared/next-up-filter.ts +137 -0
- package/shared/paging.ts +16 -0
- package/shared/prompts.ts +39 -22
- package/shared/rpc.ts +23 -10
- package/shared/setup.ts +3 -1
- package/shared/wrap-up.ts +20 -23
package/shared/wrap-up.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { type AgentSummary, type AttentionView, isIdle, type Item,
|
|
1
|
+
import { type AgentSummary, type AttentionView, isIdle, type Item, matchSessions, memberKeys, type RememberedGroups, type WrapItem } from "./attention";
|
|
2
|
+
import { type UnsavedSession, unsavedOf } from "./archive";
|
|
2
3
|
import { ago } from "./format";
|
|
3
4
|
import { changeText } from "./changes";
|
|
5
|
+
import { keySet } from "./names";
|
|
4
6
|
|
|
5
7
|
// Wrap up: finished or out-of-my-hands work whose unarchived Paseo sessions are all idle [ATT-22]. Pure, so the rules are
|
|
6
8
|
// testable. It's assembled on the client, which already polls Paseo's sessions for the screen and the sidebar's count; the
|
|
@@ -8,27 +10,19 @@ import { changeText } from "./changes";
|
|
|
8
10
|
|
|
9
11
|
export type SessionCleanliness = "clean" | "dirty" | "unknown";
|
|
10
12
|
|
|
11
|
-
// What archiving
|
|
12
|
-
//
|
|
13
|
-
export function
|
|
13
|
+
// What archiving a session would lose, from Paseo's reading of its worktree; the server asks git again before archiving.
|
|
14
|
+
// Previews count the files [ATT-22].
|
|
15
|
+
export function sessionUnsaved(agent: AgentSummary): UnsavedSession | null {
|
|
14
16
|
const workspace = agent.workspace;
|
|
15
|
-
|
|
16
|
-
if (workspace.dirty === true || (workspace.ahead ?? 0) > 0) return "dirty";
|
|
17
|
-
if (workspace.dirty === false && workspace.ahead === 0) return "clean";
|
|
18
|
-
return "unknown";
|
|
17
|
+
return unsavedOf({ agentId: agent.id, title: agent.title }, workspace && { ...workspace, files: workspace.dirtyFiles, lines: workspace.dirtyLines });
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
export function
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
if (workspace?.dirty) parts.push("uncommitted changes");
|
|
28
|
-
const ahead = workspace?.ahead ?? 0;
|
|
29
|
-
if (ahead > 0) parts.push(`${ahead} unpushed commit${ahead === 1 ? "" : "s"}`);
|
|
30
|
-
const what = parts.join(" and ") || "unsaved changes";
|
|
31
|
-
return workspace?.branch ? `${what} on ${workspace.branch}` : what;
|
|
20
|
+
// Dirty as soon as Paseo says something is unsaved, even when it couldn't tell the other half; unknown only when it knows
|
|
21
|
+
// of nothing unsaved but can't say it's clean.
|
|
22
|
+
export function sessionCleanliness(agent: AgentSummary): SessionCleanliness {
|
|
23
|
+
const unsaved = sessionUnsaved(agent);
|
|
24
|
+
if (!unsaved) return "clean";
|
|
25
|
+
return unsaved.files || unsaved.uncommitted || unsaved.commits ? "dirty" : "unknown";
|
|
32
26
|
}
|
|
33
27
|
|
|
34
28
|
// A row with one session, clean: Archive session archives it at once, whatever happened on GitHub [ATT-22].
|
|
@@ -37,7 +31,7 @@ export function cleanSingle(item: WrapItem): boolean {
|
|
|
37
31
|
}
|
|
38
32
|
|
|
39
33
|
// What finishing looked like, in the same words the cards use [HIS-05, HIS-07].
|
|
40
|
-
function finishText(item: Item, now: Date): string {
|
|
34
|
+
export function finishText(item: Item, now: Date): string {
|
|
41
35
|
if (item.change) return changeText(item.change, now);
|
|
42
36
|
const at = item.closedAt ?? item.othersActivityAt;
|
|
43
37
|
const age = `${ago(at, now)} ago`;
|
|
@@ -64,10 +58,12 @@ export function rememberGroups(groups: RememberedGroups, items: Pick<Item, "key"
|
|
|
64
58
|
|
|
65
59
|
// The finished work and changes that could appear in Wrap up: my done and reviewed items, my own unmerged closes, work that
|
|
66
60
|
// left my hands, and a change on finished work that History hasn't fetched yet [ATT-22, HIS-01, HIS-07]. A done item beats
|
|
67
|
-
// the note about it.
|
|
61
|
+
// the note about it. A merged PR from the live feed only stands in until History lists it, alone or under its issue, so
|
|
62
|
+
// it never makes a row of its own beside its issue's [FRESH-03].
|
|
68
63
|
function candidates(view: WrapView): Item[] {
|
|
64
|
+
const listed = new Set(view.history.flatMap((item) => [item.key, ...item.children.map((child) => child.key)]).map((key) => key.toLowerCase()));
|
|
69
65
|
const seen = new Set<string>();
|
|
70
|
-
const ordered = [...view.history, ...(view.ownClosed ?? [])].sort((a, b) => Number(a.section === "changed") - Number(b.section === "changed"));
|
|
66
|
+
const ordered = [...view.history, ...(view.ownClosed ?? []).filter((item) => !listed.has(item.key.toLowerCase()))].sort((a, b) => Number(a.section === "changed") - Number(b.section === "changed"));
|
|
71
67
|
return ordered.filter((item) => {
|
|
72
68
|
// A reopened PR is open again, not work to wrap up.
|
|
73
69
|
if (item.section === "changed" && (!item.change || item.change.kind === "reopened")) return false;
|
|
@@ -96,7 +92,8 @@ export function wrapItems(view: WrapView, agents: AgentSummary[], now = new Date
|
|
|
96
92
|
const sessions = matchSessions(agents, keys);
|
|
97
93
|
if (sessions.length === 0) continue;
|
|
98
94
|
// The group's sessions must all be idle, none may serve work that's still active, and a session belongs to one row only.
|
|
99
|
-
|
|
95
|
+
// A sub-agent still working keeps its session's row out too.
|
|
96
|
+
if (sessions.some((agent) => !isIdle(agent) || agent.subAgents?.working || serving(agent.itemKey) || used.has(agent.id)) || keys.some(serving)) continue;
|
|
100
97
|
for (const agent of sessions) used.add(agent.id);
|
|
101
98
|
rows.push({
|
|
102
99
|
item: {
|