@saadnvd1/agent-os 0.3.541 → 0.3.542
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/components/SessionList/SessionList.types.ts +1 -0
- package/components/SessionList/SessionShelves.tsx +8 -1
- package/components/SessionList/SidebarBody.tsx +1 -0
- package/components/SessionList/index.tsx +2 -1
- package/lib/db/queries.ts +1 -1
- package/lib/sidebar/machines.ts +7 -1
- package/lib/sidebar/rollup.ts +1 -0
- package/lib/sidebar/shelves.ts +38 -4
- package/lib/status/collect.ts +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ and check on all of it from your phone.
|
|
|
23
23
|
- **Project config.** `agentos.json` gives each session its own ports, environment, files and a private Postgres copy. [More](docs/reference/project-config.md)
|
|
24
24
|
- **Schedules and recipes.** Start work on a timer, or save a job that comes up again. [More](docs/guides/schedules.md)
|
|
25
25
|
- **Plans in pieces and stacks.** A plan splits into several PRs only for a real reason; a board can run as stacked PRs. [More](docs/guides/tasks.md#plans-in-pieces)
|
|
26
|
-
- **Machine load and status.** A load gauge, each session's share of CPU and memory, and Needs you, Working and Done as it changes. [More](docs/guides/sessions.md)
|
|
26
|
+
- **Machine load and status.** A load gauge, each session's share of CPU and memory, and Needs you, Working, In review and Done as it changes. [More](docs/guides/sessions.md)
|
|
27
27
|
- **Workspaces.** Group projects, finish work with Done, and get a log of every merged task. [More](docs/reference/workspaces.md)
|
|
28
28
|
- **LumifyHub (optional).** Boards, cards and docs for a workspace, if you want them. [More](docs/lumifyhub.md)
|
|
29
29
|
- **Also:** a ⌘K palette, code search, a file picker, a git panel, dev servers, up to four panes, and dictation.
|
|
@@ -86,7 +86,7 @@ export function MachineShelves({ groups }: { groups: MachineGroup[] }) {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
// The pinned orchestrator (or a row to start one), then Pinned, Needs you,
|
|
89
|
-
// Working, Queued and Done: once for the whole list.
|
|
89
|
+
// Working, In review, Queued and Done: once for the whole list.
|
|
90
90
|
export function SessionShelves({
|
|
91
91
|
shelves,
|
|
92
92
|
queued,
|
|
@@ -136,6 +136,13 @@ export function SessionShelves({
|
|
|
136
136
|
))}
|
|
137
137
|
</Shelf>
|
|
138
138
|
)}
|
|
139
|
+
{shelves.inReview.length > 0 && (
|
|
140
|
+
<Shelf label="In review" count={shelves.inReview.length}>
|
|
141
|
+
{shelves.inReview.map((r) => (
|
|
142
|
+
<SessionRow key={r.session.id} row={r} />
|
|
143
|
+
))}
|
|
144
|
+
</Shelf>
|
|
145
|
+
)}
|
|
139
146
|
{queued.length > 0 && (
|
|
140
147
|
<Shelf label="Queued" count={queued.length}>
|
|
141
148
|
{queued.map((r) => (
|
|
@@ -31,7 +31,7 @@ const flatten = (rows: SidebarRow[]): string[] =>
|
|
|
31
31
|
rows.flatMap((r) => [r.session.id, ...flatten(r.workers)]);
|
|
32
32
|
|
|
33
33
|
// One flat list of the workspace's sessions, on shelves: Pinned, Needs
|
|
34
|
-
// you, Working, Done.
|
|
34
|
+
// you, Working, In review, Done.
|
|
35
35
|
export function SessionList({
|
|
36
36
|
activeSessionId,
|
|
37
37
|
sessionStatuses,
|
|
@@ -62,6 +62,7 @@ export function SessionList({
|
|
|
62
62
|
...shelves.pinned,
|
|
63
63
|
...shelves.needsYou,
|
|
64
64
|
...shelves.working,
|
|
65
|
+
...shelves.inReview,
|
|
65
66
|
...shelves.done,
|
|
66
67
|
...data.machines.flatMap((g) => g.rows),
|
|
67
68
|
]),
|
package/lib/db/queries.ts
CHANGED
|
@@ -33,7 +33,7 @@ export function sessionListColumns(db: Database.Database, alias = ""): string {
|
|
|
33
33
|
.map((c) => `${prefix}${c}`)
|
|
34
34
|
.join(", ");
|
|
35
35
|
// The recipe run or feature piece a session is, as JSON, for its row's chip.
|
|
36
|
-
const recipe = `(SELECT json_object('id', r.id, 'name', r.name, 'seq', rr.seq) FROM recipe_runs rr JOIN recipes r ON r.id = rr.recipe_id WHERE rr.session_id = ${alias || "sessions"}.id)`;
|
|
36
|
+
const recipe = `(SELECT json_object('id', r.id, 'name', r.name, 'seq', rr.seq, 'status', rr.status) FROM recipe_runs rr JOIN recipes r ON r.id = rr.recipe_id WHERE rr.session_id = ${alias || "sessions"}.id)`;
|
|
37
37
|
const piece = `(SELECT json_object('feature', f.id, 'name', f.name, 'position', fp.position, 'total', (SELECT COUNT(*) FROM feature_pieces WHERE feature_id = f.id AND status != 'dropped')) FROM feature_pieces fp JOIN features f ON f.id = fp.feature_id WHERE fp.session_id = ${alias || "sessions"}.id)`;
|
|
38
38
|
return `${list}, (${prefix}task_brief IS NOT NULL AND ${prefix}task_brief != '') AS has_brief, ${recipe} AS recipe_run, ${piece} AS feature_piece`;
|
|
39
39
|
}
|
package/lib/sidebar/machines.ts
CHANGED
|
@@ -40,7 +40,13 @@ export function machineGroups(
|
|
|
40
40
|
return {
|
|
41
41
|
hostId,
|
|
42
42
|
name,
|
|
43
|
-
rows: [
|
|
43
|
+
rows: [
|
|
44
|
+
...s.pinned,
|
|
45
|
+
...s.needsYou,
|
|
46
|
+
...s.working,
|
|
47
|
+
...s.inReview,
|
|
48
|
+
...s.done,
|
|
49
|
+
],
|
|
44
50
|
};
|
|
45
51
|
})
|
|
46
52
|
.filter((g) => g.rows.length > 0)
|
package/lib/sidebar/rollup.ts
CHANGED
package/lib/sidebar/shelves.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// The sidebar's one flat list, sorted onto shelves: the workspace's pinned
|
|
2
|
-
// orchestrator, Pinned, Needs you, Working, then Done. Client-safe: no database.
|
|
2
|
+
// orchestrator, Pinned, Needs you, Working, In review, then Done. Client-safe: no database.
|
|
3
3
|
import type { Session } from "@/lib/db/types";
|
|
4
4
|
import { fromSqliteTime } from "@/lib/session-meta";
|
|
5
5
|
import type { PrStage } from "@/lib/tasks/pr-stage";
|
|
6
|
-
import type
|
|
6
|
+
import { isFinished, type TaskState } from "@/lib/tasks/state";
|
|
7
7
|
|
|
8
8
|
// Why a session is blocked on you.
|
|
9
9
|
export type SessionNeed =
|
|
@@ -33,6 +33,8 @@ export interface RowStatus {
|
|
|
33
33
|
stalled?: boolean;
|
|
34
34
|
// A chat summarising its context (status stays "running").
|
|
35
35
|
compacting?: { since: number; before?: number };
|
|
36
|
+
// Background commands, subagents and monitors still running.
|
|
37
|
+
background?: number;
|
|
36
38
|
asks?: number;
|
|
37
39
|
prStage?: PrStage;
|
|
38
40
|
// A program's own message (OSC 7501): untrusted, plain text only.
|
|
@@ -61,6 +63,7 @@ export interface Shelves {
|
|
|
61
63
|
pinned: SidebarRow[];
|
|
62
64
|
needsYou: SidebarRow[];
|
|
63
65
|
working: SidebarRow[];
|
|
66
|
+
inReview: SidebarRow[];
|
|
64
67
|
done: SidebarRow[];
|
|
65
68
|
}
|
|
66
69
|
|
|
@@ -70,6 +73,17 @@ export function taskNeed(state: TaskState | undefined): SessionNeed | null {
|
|
|
70
73
|
return null;
|
|
71
74
|
}
|
|
72
75
|
|
|
76
|
+
// Where a row that needs nothing and isn't running goes: an open PR or a plan
|
|
77
|
+
// waiting on approval is in review, any other unfinished task is mid-job, and
|
|
78
|
+
// only finished work or a plain idle session is done.
|
|
79
|
+
export function quietShelf(
|
|
80
|
+
task: TaskState | undefined
|
|
81
|
+
): "inReview" | "working" | "done" {
|
|
82
|
+
if (task === "review" || task === "plan-ready") return "inReview";
|
|
83
|
+
if (!task || isFinished(task)) return "done";
|
|
84
|
+
return "working";
|
|
85
|
+
}
|
|
86
|
+
|
|
73
87
|
// An approval or a question beats what the task says; a terminal waiting
|
|
74
88
|
// for input or an errored chat only counts when the task has nothing.
|
|
75
89
|
export function needOf(
|
|
@@ -118,6 +132,20 @@ const newestFirst = (a: SidebarRow, b: SidebarRow) =>
|
|
|
118
132
|
const oldestFirst = (a: SidebarRow, b: SidebarRow) =>
|
|
119
133
|
a.session.created_at.localeCompare(b.session.created_at);
|
|
120
134
|
|
|
135
|
+
const OPEN_RUN = ["queued", "starting", "running"];
|
|
136
|
+
|
|
137
|
+
// A recipe run that hasn't reported its result yet: its session going quiet
|
|
138
|
+
// between turns (an EAS build running in the background, say) isn't it ending.
|
|
139
|
+
// The list query carries the run as JSON.
|
|
140
|
+
export function recipeRunOpen(session: Pick<Session, "recipe_run">): boolean {
|
|
141
|
+
if (!session.recipe_run) return false;
|
|
142
|
+
try {
|
|
143
|
+
return OPEN_RUN.includes(JSON.parse(session.recipe_run)?.status);
|
|
144
|
+
} catch {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
121
149
|
function toRow(input: ShelfInput, session: Session): SidebarRow {
|
|
122
150
|
const status = input.statuses[session.id];
|
|
123
151
|
return {
|
|
@@ -125,7 +153,10 @@ function toRow(input: ShelfInput, session: Session): SidebarRow {
|
|
|
125
153
|
status,
|
|
126
154
|
need: needOf(session, status, input.tasks[session.id]),
|
|
127
155
|
unread: !!status?.unread,
|
|
128
|
-
working:
|
|
156
|
+
working:
|
|
157
|
+
status?.status === "running" ||
|
|
158
|
+
(status?.background ?? 0) > 0 ||
|
|
159
|
+
recipeRunOpen(session),
|
|
129
160
|
compacting: !!status?.compacting,
|
|
130
161
|
workers: [],
|
|
131
162
|
task: input.tasks[session.id],
|
|
@@ -169,6 +200,7 @@ export function buildShelves(input: ShelfInput): Shelves {
|
|
|
169
200
|
pinned: [],
|
|
170
201
|
needsYou: [],
|
|
171
202
|
working: [],
|
|
203
|
+
inReview: [],
|
|
172
204
|
done: [],
|
|
173
205
|
};
|
|
174
206
|
for (const row of top) {
|
|
@@ -178,12 +210,13 @@ export function buildShelves(input: ShelfInput): Shelves {
|
|
|
178
210
|
else if (pinned && role !== "orchestrator") shelves.pinned.push(row);
|
|
179
211
|
else if (row.need) shelves.needsYou.push(row);
|
|
180
212
|
else if (row.working) shelves.working.push(row);
|
|
181
|
-
else shelves.
|
|
213
|
+
else shelves[quietShelf(row.task)].push(row);
|
|
182
214
|
}
|
|
183
215
|
shelves.orchestrators.sort(oldestFirst);
|
|
184
216
|
shelves.pinned.sort(oldestFirst);
|
|
185
217
|
shelves.needsYou.sort(newestFirst);
|
|
186
218
|
shelves.working.sort(newestFirst);
|
|
219
|
+
shelves.inReview.sort(newestFirst);
|
|
187
220
|
shelves.done.sort(newestFirst);
|
|
188
221
|
return shelves;
|
|
189
222
|
}
|
|
@@ -265,6 +298,7 @@ function sameStatus(a: RowStatus | undefined, b: RowStatus | undefined) {
|
|
|
265
298
|
!!a.stalled === !!b.stalled &&
|
|
266
299
|
(a.compacting?.since ?? null) === (b.compacting?.since ?? null) &&
|
|
267
300
|
(a.compacting?.before ?? null) === (b.compacting?.before ?? null) &&
|
|
301
|
+
(a.background ?? 0) === (b.background ?? 0) &&
|
|
268
302
|
a.asks === b.asks &&
|
|
269
303
|
(a.prStage?.stage ?? null) === (b.prStage?.stage ?? null) &&
|
|
270
304
|
(a.prStage?.number ?? null) === (b.prStage?.number ?? null) &&
|
package/lib/status/collect.ts
CHANGED
|
@@ -26,7 +26,7 @@ import { noteWaiting } from "../notify/push/waiting";
|
|
|
26
26
|
import { getDb } from "../db";
|
|
27
27
|
import { beginPass, chatMemo } from "./incremental";
|
|
28
28
|
import { chatCompacting, chatState } from "../chat/runner";
|
|
29
|
-
import { chatActivityLine, chatStall } from "../chat/activity";
|
|
29
|
+
import { chatActivity, chatActivityLine, chatStall } from "../chat/activity";
|
|
30
30
|
import {
|
|
31
31
|
chatNeed,
|
|
32
32
|
isUnread,
|
|
@@ -72,6 +72,8 @@ export interface SessionStatusResponse {
|
|
|
72
72
|
stalled?: boolean;
|
|
73
73
|
// A chat whose agent is summarising its context ("status" stays running).
|
|
74
74
|
compacting?: Compacting;
|
|
75
|
+
// Background commands, subagents and monitors a chat still has running.
|
|
76
|
+
background?: number;
|
|
75
77
|
// Where a task's PR is in the gates (lib/tasks/pr-stage.ts).
|
|
76
78
|
prStage?: PrStage;
|
|
77
79
|
// A program's own message (OSC 7501): untrusted, plain text only.
|
|
@@ -474,6 +476,7 @@ async function collect(full = false): Promise<StatusSnapshot> {
|
|
|
474
476
|
(s) => s.view === "chat" && (!s.host_id || s.host_id === "local")
|
|
475
477
|
)) {
|
|
476
478
|
const state = chatState(session.id);
|
|
479
|
+
const background = chatActivity(session.id)?.background;
|
|
477
480
|
const orchestrator = session.role === "orchestrator";
|
|
478
481
|
// What the database says; the rest below moves with time or the process.
|
|
479
482
|
const base = chatMemo(pass, session.id, orchestrator, state ?? "", () => {
|
|
@@ -498,6 +501,7 @@ async function collect(full = false): Promise<StatusSnapshot> {
|
|
|
498
501
|
...(chatCompacting(session.id) && {
|
|
499
502
|
compacting: chatCompacting(session.id)!,
|
|
500
503
|
}),
|
|
504
|
+
...(background && { background }),
|
|
501
505
|
...(orchestrator && { asks: base.asks }),
|
|
502
506
|
};
|
|
503
507
|
}
|