paseo-office 0.2.2 → 0.2.4
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/host-switches.tsx +78 -1
- package/client/machine-card.tsx +41 -0
- package/client/notes-mode-row.tsx +140 -0
- package/client/office-state.ts +1 -0
- package/client/office-surface.tsx +28 -3
- package/client/scene-picker.tsx +20 -1
- package/client/structure-view.tsx +2 -0
- package/client/team-name.tsx +81 -0
- package/client/use-device-switch.ts +7 -1
- package/client/use-plan-usage.ts +46 -0
- package/client/use-street.ts +7 -1
- package/client/world/adapter.ts +58 -4
- package/client/world/use-world-feed.ts +32 -2
- package/client/world/world-api.ts +28 -1
- package/client/world/world-bridge.ts +4 -0
- package/docs/office.md +66 -2
- package/index.server.ts +52 -2
- package/package.json +1 -1
- package/server/activity.ts +80 -9
- package/server/directory.ts +5 -1
- package/server/hub.ts +9 -0
- package/server/life-feed.ts +13 -0
- package/server/live-ports.ts +33 -11
- package/server/notes-schedule.ts +2 -0
- package/server/notes-writer.ts +9 -1
- package/server/plan-usage.ts +51 -0
- package/server/tenure.ts +10 -0
- package/server/world.generated.ts +1 -1
- package/server/writer-mode.ts +45 -0
- package/shared/contracts.ts +72 -0
- package/shared/model.ts +16 -1
- package/shared/names.ts +2 -0
- package/shared/plan-usage.ts +86 -0
- package/shared/settings.ts +29 -2
- package/shared/team-name.ts +23 -0
package/client/world/adapter.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PlanUsage } from "../../shared/plan-usage.js";
|
|
1
2
|
import { shirtColor } from "../../shared/appearance.js";
|
|
2
3
|
import type { OfficeBrand } from "../brand.js";
|
|
3
4
|
import {
|
|
@@ -30,6 +31,7 @@ import type {
|
|
|
30
31
|
WorldEvent,
|
|
31
32
|
WorldEventType,
|
|
32
33
|
WorldMachine,
|
|
34
|
+
WorldLimit,
|
|
33
35
|
WorldSession,
|
|
34
36
|
} from "./world-api.js";
|
|
35
37
|
|
|
@@ -65,11 +67,30 @@ function rank(session: WorldSession): number {
|
|
|
65
67
|
return session.status === "work" ? 1 : 2;
|
|
66
68
|
}
|
|
67
69
|
|
|
70
|
+
/** A sub-agent's id in the scene: its call's id is only unique within its parent's session. */
|
|
71
|
+
function subId(parentId: string, callId: string): string {
|
|
72
|
+
return `${parentId}:${callId}`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const NOBODY_OUT: ReadonlyMap<string, string> = new Map();
|
|
76
|
+
|
|
77
|
+
/** The plans as the scene reads them: a name and how much of each limit is used. */
|
|
78
|
+
export function worldLimits(usage: readonly PlanUsage[]): WorldLimit[] {
|
|
79
|
+
return usage.map((provider) => ({
|
|
80
|
+
name: provider.name,
|
|
81
|
+
windows: provider.windows.map((window) => ({
|
|
82
|
+
pct: window.usedPct,
|
|
83
|
+
resetsAt: window.resetsAt ?? 0,
|
|
84
|
+
})),
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
|
|
68
88
|
function toSession(
|
|
69
89
|
row: OfficeRow,
|
|
70
90
|
team: string,
|
|
71
91
|
checks: WorkspacePullRequest["checks"] | undefined,
|
|
72
92
|
born: Readonly<Record<string, string>>,
|
|
93
|
+
out: ReadonlyMap<string, string>,
|
|
73
94
|
): WorldSession {
|
|
74
95
|
const { agent } = row;
|
|
75
96
|
const title = agentTitle(agent);
|
|
@@ -92,13 +113,14 @@ function toSession(
|
|
|
92
113
|
},
|
|
93
114
|
status,
|
|
94
115
|
agent: markOf(agent.provider),
|
|
116
|
+
...(out.has(agent.provider) ? { acct: out.get(agent.provider) } : {}),
|
|
95
117
|
lastPrompt: "",
|
|
96
118
|
...(status === "rest" && !stuck && Number.isFinite(idle)
|
|
97
119
|
? { doneAt: idle, idleSince: agent.idleSince }
|
|
98
120
|
: {}),
|
|
99
121
|
stuck,
|
|
100
122
|
...(row.waitingOn > 0 ? { waitingOn: row.waitingOn } : {}),
|
|
101
|
-
subs: [],
|
|
123
|
+
subs: (row.subagents ?? []).map((sub) => ({ id: subId(agent.id, sub.id), type: sub.type })),
|
|
102
124
|
...(agent.context === undefined && agent.costUsd === undefined
|
|
103
125
|
? {}
|
|
104
126
|
: {
|
|
@@ -119,11 +141,12 @@ export function worldPeople(
|
|
|
119
141
|
model: OfficeModel,
|
|
120
142
|
desks: number,
|
|
121
143
|
born: Readonly<Record<string, string>> = {},
|
|
144
|
+
out: ReadonlyMap<string, string> = NOBODY_OUT,
|
|
122
145
|
): WorldPeople {
|
|
123
146
|
const rows = model.rooms.flatMap((room) =>
|
|
124
147
|
room.rows.map((row) => ({ row, team: room.name, checks: room.workspace?.pullRequest?.checks })),
|
|
125
148
|
);
|
|
126
|
-
const all = rows.map(({ row, team, checks }) => toSession(row, team, checks, born));
|
|
149
|
+
const all = rows.map(({ row, team, checks }) => toSession(row, team, checks, born, out));
|
|
127
150
|
const order = new Map(all.map((session, index) => [session.id, index]));
|
|
128
151
|
const seated =
|
|
129
152
|
all.length <= desks
|
|
@@ -214,7 +237,7 @@ function runOf(kind: ActivityKind): Run | null {
|
|
|
214
237
|
return kind === "test" || kind === "deploy" ? kind : null;
|
|
215
238
|
}
|
|
216
239
|
|
|
217
|
-
type StepEvent = Pick<WorldEvent, "type" | "of">;
|
|
240
|
+
type StepEvent = Pick<WorldEvent, "type" | "of" | "label">;
|
|
218
241
|
|
|
219
242
|
/**
|
|
220
243
|
* How a run that ended is told. A test run's result goes on the test board. A deploy that
|
|
@@ -237,6 +260,8 @@ interface Told {
|
|
|
237
260
|
running: Run | null;
|
|
238
261
|
/** How full the context was, 0 to 1; null when unknown. */
|
|
239
262
|
full: number | null;
|
|
263
|
+
/** The sub-agents the scene had been told of. */
|
|
264
|
+
subs?: readonly string[];
|
|
240
265
|
}
|
|
241
266
|
export type WorldMemory = ReadonlyMap<string, Told>;
|
|
242
267
|
|
|
@@ -246,6 +271,30 @@ export interface WorldChanges {
|
|
|
246
271
|
memory: WorldMemory;
|
|
247
272
|
}
|
|
248
273
|
|
|
274
|
+
/**
|
|
275
|
+
* A sub-agent that came since the scene was last told walks in, and one that is gone leaves.
|
|
276
|
+
* Someone seen for the first time gets neither: the scene seats who is already there (`subs`).
|
|
277
|
+
*/
|
|
278
|
+
function subEvents(session: WorldSession, was: Told | undefined): WorldEvent[] {
|
|
279
|
+
if (was === undefined) return [];
|
|
280
|
+
const told = was.subs ?? [];
|
|
281
|
+
const here = new Set(session.subs.map((sub) => sub.id));
|
|
282
|
+
const starts = session.subs
|
|
283
|
+
.filter((sub) => !told.includes(sub.id))
|
|
284
|
+
.map(
|
|
285
|
+
(sub): WorldEvent => ({
|
|
286
|
+
sess: session.id,
|
|
287
|
+
type: "substart",
|
|
288
|
+
agent: sub.id,
|
|
289
|
+
label: sub.type,
|
|
290
|
+
}),
|
|
291
|
+
);
|
|
292
|
+
const stops = told
|
|
293
|
+
.filter((id) => !here.has(id))
|
|
294
|
+
.map((id): WorldEvent => ({ sess: session.id, type: "substop", agent: id }));
|
|
295
|
+
return [...starts, ...stops];
|
|
296
|
+
}
|
|
297
|
+
|
|
249
298
|
/**
|
|
250
299
|
* A turn that starts, one that ends, a new error; none for someone seen for the first time. An
|
|
251
300
|
* agent that turns busy because a sub-agent started gets no prompt: nobody sent it one. Its own
|
|
@@ -298,7 +347,10 @@ function stepEvents(
|
|
|
298
347
|
events.push(endOf(run, step.result));
|
|
299
348
|
} else {
|
|
300
349
|
running = run;
|
|
301
|
-
events.push({
|
|
350
|
+
events.push({
|
|
351
|
+
type: STEP_EVENT[step.kind],
|
|
352
|
+
...(step.label === undefined ? {} : { label: step.label }),
|
|
353
|
+
});
|
|
302
354
|
}
|
|
303
355
|
}
|
|
304
356
|
return { events, step: told, running };
|
|
@@ -329,6 +381,7 @@ export function worldChanges(before: WorldMemory | null, people: WorldPeople): W
|
|
|
329
381
|
}
|
|
330
382
|
const full = fullness(session);
|
|
331
383
|
if (tidied(was?.full ?? null, full)) events.push({ sess: session.id, type: "compact" });
|
|
384
|
+
for (const event of subEvents(session, was)) events.push(event);
|
|
332
385
|
const steps = stepEvents(session, people.steps.get(session.id), was);
|
|
333
386
|
for (const event of steps.events) events.push({ sess: session.id, ...event });
|
|
334
387
|
memory.set(session.id, {
|
|
@@ -338,6 +391,7 @@ export function worldChanges(before: WorldMemory | null, people: WorldPeople): W
|
|
|
338
391
|
step: steps.step,
|
|
339
392
|
running: steps.running,
|
|
340
393
|
full,
|
|
394
|
+
subs: session.subs.map((sub) => sub.id),
|
|
341
395
|
});
|
|
342
396
|
}
|
|
343
397
|
return { events, memory };
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
worldBoardRows,
|
|
14
14
|
worldChanges,
|
|
15
15
|
worldDuties,
|
|
16
|
+
worldLimits,
|
|
16
17
|
worldWeather,
|
|
17
18
|
worldMachine,
|
|
18
19
|
worldPeople,
|
|
@@ -20,6 +21,11 @@ import {
|
|
|
20
21
|
type WorldMemory,
|
|
21
22
|
type WorldPlan,
|
|
22
23
|
} from "./adapter.js";
|
|
24
|
+
import { useSettings } from "@getpaseo/plugin/client";
|
|
25
|
+
import { officeHostSettings, stickyNotesOf } from "../../shared/settings.js";
|
|
26
|
+
import { useDeviceSwitch } from "../use-device-switch.js";
|
|
27
|
+
import { providersOut } from "../../shared/plan-usage.js";
|
|
28
|
+
import { usePlanUsageValue } from "../use-plan-usage.js";
|
|
23
29
|
import { useIncidentAlarm } from "./use-incident-alarm.js";
|
|
24
30
|
import type { WorldApi } from "./world-api.js";
|
|
25
31
|
|
|
@@ -94,9 +100,12 @@ export function useWorldFeed(
|
|
|
94
100
|
if (sound !== null) world.current?.setSound?.(sound);
|
|
95
101
|
}, [sound, api]);
|
|
96
102
|
|
|
103
|
+
// Whose plan is used up is named on their session, so the scene knows who takes the break.
|
|
104
|
+
const usage = usePlanUsageValue();
|
|
105
|
+
const out = useMemo(() => providersOut(usage, Date.now()), [usage]);
|
|
97
106
|
const people = useMemo(
|
|
98
|
-
() => worldPeople(model, PLAN_DESKS[plan], life?.born),
|
|
99
|
-
[model, plan, life?.born],
|
|
107
|
+
() => worldPeople(model, PLAN_DESKS[plan], life?.born, out),
|
|
108
|
+
[model, plan, life?.born, out],
|
|
100
109
|
);
|
|
101
110
|
useEffect(() => {
|
|
102
111
|
const scene = world.current;
|
|
@@ -118,6 +127,27 @@ export function useWorldFeed(
|
|
|
118
127
|
world.current?.setMachine(worldReadings);
|
|
119
128
|
}, [worldReadings, api]);
|
|
120
129
|
|
|
130
|
+
// The host's: whether bubbles name what a person is at, and the owner's notes on the whiteboard.
|
|
131
|
+
const host = useSettings(officeHostSettings);
|
|
132
|
+
const hostValues = host.status === "ready" ? host.values : null;
|
|
133
|
+
const streamer = hostValues?.streamerMode ?? null;
|
|
134
|
+
const notesText = hostValues?.stickyNotes ?? null;
|
|
135
|
+
useEffect(() => {
|
|
136
|
+
if (streamer !== null) world.current?.setStreamer?.(streamer);
|
|
137
|
+
}, [streamer, api]);
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
if (notesText !== null) world.current?.setNotes?.(stickyNotesOf(notesText));
|
|
140
|
+
}, [notesText, api]);
|
|
141
|
+
const graphics = useDeviceSwitch("graphics", "auto").on;
|
|
142
|
+
useEffect(() => {
|
|
143
|
+
if (graphics !== null) world.current?.setGraphics?.(graphics);
|
|
144
|
+
}, [graphics, api]);
|
|
145
|
+
|
|
146
|
+
// After the people: the break is for the sessions already named with their plan.
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
world.current?.setLimits?.(worldLimits(usage));
|
|
149
|
+
}, [usage, api]);
|
|
150
|
+
|
|
121
151
|
useEffect(() => {
|
|
122
152
|
world.current?.setWeather?.(worldWeather(weather));
|
|
123
153
|
}, [weather, api]);
|
|
@@ -13,6 +13,12 @@ import type { PluginTheme } from "@getpaseo/plugin";
|
|
|
13
13
|
export type WorldWeather = import("../../shared/contracts.js").WeatherScene;
|
|
14
14
|
|
|
15
15
|
/** A person in the office, in the shape the vendored scene reads. */
|
|
16
|
+
/** A plan and how much of each of its limits is used; `resetsAt` is epoch ms, 0 when not known. */
|
|
17
|
+
export interface WorldLimit {
|
|
18
|
+
name: string;
|
|
19
|
+
windows: { pct: number; resetsAt: number }[];
|
|
20
|
+
}
|
|
21
|
+
|
|
16
22
|
export interface WorldSession {
|
|
17
23
|
appearance?: Appearance;
|
|
18
24
|
shirt?: string;
|
|
@@ -24,6 +30,8 @@ export interface WorldSession {
|
|
|
24
30
|
git: { repo: string; ci?: "red" | "green"; born?: string };
|
|
25
31
|
/** At work, waiting for the user's answer, or resting. */
|
|
26
32
|
status: "work" | "wait" | "rest";
|
|
33
|
+
/** The plan the person runs on, only while that plan is used up: named on their tag, and they take a break. */
|
|
34
|
+
acct?: string;
|
|
27
35
|
/** Which mark the scene puts on the person's screen. */
|
|
28
36
|
agent: "claude" | "codex" | "gemini";
|
|
29
37
|
lastPrompt: string;
|
|
@@ -44,7 +52,11 @@ export interface WorldSession {
|
|
|
44
52
|
* Paseo's `paseo-entry.js` does, for the `subwait` bubble.
|
|
45
53
|
*/
|
|
46
54
|
waitingOn?: number;
|
|
47
|
-
|
|
55
|
+
/**
|
|
56
|
+
* The provider's own sub-agents the agent has at work. The scene seats the ones already there
|
|
57
|
+
* when the person is first drawn; later ones come by `substart` and go by `substop`.
|
|
58
|
+
*/
|
|
59
|
+
subs: { id: string; type: string }[];
|
|
48
60
|
/**
|
|
49
61
|
* The context window, in tokens: the paper on the desk grows with it, and a flag stands in it
|
|
50
62
|
* from 85%. Absent when the provider has not said.
|
|
@@ -59,6 +71,10 @@ export interface WorldSession {
|
|
|
59
71
|
export interface WorldEvent {
|
|
60
72
|
sess: string;
|
|
61
73
|
type: WorldEventType;
|
|
74
|
+
/** On `substart` and `substop`: the sub-agent's id. */
|
|
75
|
+
agent?: string;
|
|
76
|
+
/** On `substart`: the kind of sub-agent, which is the name over its head. */
|
|
77
|
+
label?: string;
|
|
62
78
|
/** On a `fail` that is not the agent's own: what failed. The scene words the bubble by it. */
|
|
63
79
|
of?: "deploy";
|
|
64
80
|
}
|
|
@@ -77,6 +93,9 @@ export type WorldEventType =
|
|
|
77
93
|
| "web"
|
|
78
94
|
| "mcp"
|
|
79
95
|
| "agent"
|
|
96
|
+
/** A sub-agent of the provider's own comes in through the door, and leaves with its report. */
|
|
97
|
+
| "substart"
|
|
98
|
+
| "substop"
|
|
80
99
|
| "plan"
|
|
81
100
|
| "test"
|
|
82
101
|
| "commit"
|
|
@@ -247,6 +266,14 @@ export interface WorldApi {
|
|
|
247
266
|
setTenure?(data: WorldTenure): void;
|
|
248
267
|
setLiftService?(info: WorldLiftService): void;
|
|
249
268
|
setMachine(machine: WorldMachine | null): void;
|
|
269
|
+
/** The plans' limits; one at 100% puts the board up and its resting people on a break. */
|
|
270
|
+
setLimits?(limits: WorldLimit[]): void;
|
|
271
|
+
/** Streamer mode: on, bubbles name no file, command or site; off, they show an event's label. */
|
|
272
|
+
setStreamer?(on: boolean): void;
|
|
273
|
+
/** The graphics level this device chose. */
|
|
274
|
+
setGraphics?(choice: "auto" | "low" | "medium" | "high"): void;
|
|
275
|
+
/** The owner's sticky notes on the whiteboard. */
|
|
276
|
+
setNotes?(notes: string[]): void;
|
|
250
277
|
/**
|
|
251
278
|
* Rings the bell on the meeting table for a stand-up: everyone free walks there and says what
|
|
252
279
|
* they are on. Nothing happens while another gathering is on, or when nobody is free.
|
|
@@ -135,6 +135,10 @@ export function createWorldBridge(
|
|
|
135
135
|
setWeather: sender("setWeather"),
|
|
136
136
|
setIncidents: sender("setIncidents"),
|
|
137
137
|
setSound: sender("setSound"),
|
|
138
|
+
setLimits: sender("setLimits"),
|
|
139
|
+
setStreamer: sender("setStreamer"),
|
|
140
|
+
setGraphics: sender("setGraphics"),
|
|
141
|
+
setNotes: sender("setNotes"),
|
|
138
142
|
};
|
|
139
143
|
|
|
140
144
|
return {
|
package/docs/office.md
CHANGED
|
@@ -63,6 +63,15 @@ script), it is a command.
|
|
|
63
63
|
The reads are 5 s apart. A tool call that starts and ends between two of them, as a web search
|
|
64
64
|
often does, is the step of the read after it, for that one read.
|
|
65
65
|
|
|
66
|
+
A provider can also run sub-agents inside an agent's own session, as Claude's Agent tool does.
|
|
67
|
+
Those are no Paseo agents: they have no session, no card and no row. The office finds them in
|
|
68
|
+
the agent's timeline, as `Task` or `Agent` calls that still run, at its 5 s reads, and the 3D
|
|
69
|
+
floor draws each one as upstream draws a sub-agent: it comes in through the door, takes its brief
|
|
70
|
+
from the agent that started it, works, reports back when its call ends, and leaves. Its name is
|
|
71
|
+
the kind of sub-agent the provider gives ("Explore"), never its task. A call that starts and ends
|
|
72
|
+
between two reads is not seen, and a call older than the tail the office reads is missed. The 2D
|
|
73
|
+
floor and the lists do not show them.
|
|
74
|
+
|
|
66
75
|
An agent whose own turn has ended is not idle while an agent it started, or one those started,
|
|
67
76
|
runs, starts or waits for you: it waits on them. `waitingOnOf` in `shared/model.ts` is the one
|
|
68
77
|
place the rule is worked out. On both floors such an agent stays at its desk, at work; the
|
|
@@ -84,6 +93,18 @@ turn, and is offered only on a host whose SDK has an agent's
|
|
|
84
93
|
"Open session" shows the session in the office's column (see below) in every app, and the card
|
|
85
94
|
closes as it does. In walk-in mode, face an agent and press **E** or tap the on-screen prompt to open their workspace. The same action wakes a sleeping character. **Open in workspace** also opens the selected session’s Paseo workbench over the office. In the browser it uses the paired host’s own workspace, including files, diffs, terminals and session tools. **Office controls** offers session replies, permissions and the room board on native clients and when the workspace cannot be embedded. Closing the overlay returns to the same floor and camera.
|
|
86
95
|
|
|
96
|
+
## Team names
|
|
97
|
+
|
|
98
|
+
A room is a workspace and goes by the workspace's name, which is often a branch or a ticket.
|
|
99
|
+
"Rename team", under a room's title in the List view, gives the team a name of the office's own,
|
|
100
|
+
at most 40 characters. It is kept on the workspace in the plugin's data (`office.team.name`), so
|
|
101
|
+
it needs a host that keeps plugin data on workspaces, and every device sees it. The office shows
|
|
102
|
+
it wherever it showed the workspace's name: the room and its board, the session lists, the
|
|
103
|
+
stand-up and its notes, the team chat and the 3D floor. The workspace keeps its own name in Paseo,
|
|
104
|
+
and the room's card says which workspace it is. An empty name goes back to the workspace's.
|
|
105
|
+
|
|
106
|
+
The 3D floor remembers where a team sat by its name, so a renamed team is seated as a new one.
|
|
107
|
+
|
|
87
108
|
## Views
|
|
88
109
|
|
|
89
110
|
The office has three views: a 3D floor, a 2D floor and the list. A switch over the floor's top
|
|
@@ -476,6 +497,22 @@ The gear in fullscreen opens **Office settings** over the floor. You can also op
|
|
|
476
497
|
|
|
477
498
|
View and sound preferences apply to the device. The host stores the floor plan, branding, automation and integration settings. The [branding defaults](#custom-branding) can also come from the daemon environment.
|
|
478
499
|
|
|
500
|
+
## Streamer mode, graphics and sticky notes
|
|
501
|
+
|
|
502
|
+
**Streamer mode** (Settings, host-wide, on by default) keeps file names, commands, search queries
|
|
503
|
+
and sites out of what the office sends to the floor: a bubble says "a file" or "a command". Turned
|
|
504
|
+
off, a step carries one cut line of what it is at (a file's name without its folder, a command's
|
|
505
|
+
first line, a query, a site's host name, 80 characters at most) and the 3D floor shows it over the
|
|
506
|
+
person, to everyone who opens this office. Prompts and replies are never sent either way.
|
|
507
|
+
|
|
508
|
+
**Graphics** (Settings → the scene picker, per device) is Auto, Low, Medium or High. Auto picks for
|
|
509
|
+
the device and steps down when frames keep coming late; Low draws no shadows and no post effects at
|
|
510
|
+
30 frames a second.
|
|
511
|
+
|
|
512
|
+
**Sticky notes** (Settings, host-wide) are the owner's notes on the 3D whiteboard: up to four,
|
|
513
|
+
60 characters each, typed with `;` between them. While there are any, the whiteboard lists five
|
|
514
|
+
agents instead of ten and the notes take its right half.
|
|
515
|
+
|
|
479
516
|
## The host
|
|
480
517
|
|
|
481
518
|
While an office surface is open, the `office.machine` subscription sends a reading every 10 s:
|
|
@@ -484,6 +521,20 @@ memory, the process count and the TCP ports of the processes that carry its `PAS
|
|
|
484
521
|
Host entry in the Attention tab shows the memory in use and opens a card with the agents by memory.
|
|
485
522
|
In **Host → This instance → Details**, inspect system swap, disk space on the home filesystem, load averages and the largest process groups by resident memory. RAM and CPU history covers up to 30 minutes of Office readings. The same view lists workspace services, agent listening ports, workspaces with changed lines and measured npm and pip cache sizes. **Refresh** takes another snapshot.
|
|
486
523
|
|
|
524
|
+
### Plan limits
|
|
525
|
+
|
|
526
|
+
The Host card lists each provider's plan limits (the 5 hours, the week, whatever the provider
|
|
527
|
+
reports) with how much is used and when it resets. The office asks Paseo for them
|
|
528
|
+
(`office.plan.usage.request`, which reads `providers.listUsage()`) when it opens and every two
|
|
529
|
+
minutes after; it stores none of it. A provider that is unavailable or reports no percentage is not
|
|
530
|
+
listed, and a host whose Paseo has no provider usage shows no limits at all.
|
|
531
|
+
|
|
532
|
+
From 80% used the Host button in the toolbar names the closest limit instead of the memory, in the
|
|
533
|
+
warning colour; from 95% in the danger colour; at 100% it reads "Out of Claude" (or the provider's
|
|
534
|
+
name). On the 3D floor a plan at 100% puts the countdown board on the wall, and the people on that
|
|
535
|
+
plan who are resting take a break in the pantry until it resets. Whoever is still working keeps
|
|
536
|
+
working.
|
|
537
|
+
|
|
487
538
|
Local process readings require Linux. On other platforms the Host card is available when Office
|
|
488
539
|
finds a configured SSH-MCP installation.
|
|
489
540
|
|
|
@@ -568,6 +619,17 @@ its turn again, no new writer starts. "Stand-up notes" under the Stand-up card's
|
|
|
568
619
|
notes reader at the month’s newest entry. Select a date to read that entry, or use the month arrows to browse earlier files. The entry strip also includes the file’s introduction and Contents when present. Contents links open their entries. The
|
|
569
620
|
server reads only `daily-standup-YYYYMM.md` directly in the notes folder.
|
|
570
621
|
|
|
622
|
+
"Writer mode" in the settings is the mode the writer starts in. Its pills are the modes of the
|
|
623
|
+
provider the writer runs on, by the provider's own names, less the one that only plans: for Claude
|
|
624
|
+
Always Ask, Accept File Edits, Auto mode and Bypass; for Codex Default Permissions, Auto-review and
|
|
625
|
+
Full Access. "Office's choice" is no mode set: the writer accepts file edits where its provider
|
|
626
|
+
offers that, else takes the provider's default. Accepting edits approves edits only, so a writer
|
|
627
|
+
that calls another tool or a command then waits for an answer nobody gives at 8:00 and leaves no
|
|
628
|
+
entry; a mode that asks for less lets it finish. A mode that asks for nothing (Bypass, Full Access)
|
|
629
|
+
runs any tool or command unattended, and the row says so. A stored mode the provider does not
|
|
630
|
+
offer falls back to the office's choice, and the row says which mode is used. The mode holds from
|
|
631
|
+
the next run.
|
|
632
|
+
|
|
571
633
|
## Schedules
|
|
572
634
|
|
|
573
635
|
The office runs three schedules of its own (`server/local-schedules.ts`): the stand-up notes at 08:00
|
|
@@ -716,8 +778,10 @@ quarterly fire drill. They run on the office clock. During the 12:30–13:30 des
|
|
|
716
778
|
floor pauses new activities. Street outings are separate.
|
|
717
779
|
|
|
718
780
|
The accountant reads provider-reported spending. HR uses the repository’s first commit month for
|
|
719
|
-
birthdays. The tenure ledger identifies each team by
|
|
720
|
-
|
|
781
|
+
birthdays. The tenure ledger identifies each team by the name it goes by. A team that
|
|
782
|
+
takes another name, the office's own or its workspace's in Paseo, keeps its record while the
|
|
783
|
+
office runs; a workspace renamed in Paseo while the office is not loaded starts a new record and
|
|
784
|
+
the previous name goes quiet. The first set of workspaces is permanent. A later team
|
|
721
785
|
can graduate after 20 turns over
|
|
722
786
|
two days. A previously active team can have a farewell after 30 quiet days. The lift is serviced
|
|
723
787
|
for three minutes at server start or five when the scene build has changed. Commits put letters in the post box and pushes send the postman to collect them. The other indoor scenes
|
package/index.server.ts
CHANGED
|
@@ -44,6 +44,8 @@ import {
|
|
|
44
44
|
} from "./server/incidents-schedule.js";
|
|
45
45
|
import { probeSentry } from "./server/incidents-sentry.js";
|
|
46
46
|
import { createIncidentsStore, type IncidentsStore } from "./server/incidents-store.js";
|
|
47
|
+
import { projectPlanUsage } from "./server/plan-usage.js";
|
|
48
|
+
import { TEAM_NAME_KEY, teamNameOf, tidyTeamName } from "./shared/team-name.js";
|
|
47
49
|
import {
|
|
48
50
|
changeSavedTrackers,
|
|
49
51
|
createTrackerCredentialsStore,
|
|
@@ -58,6 +60,7 @@ import {
|
|
|
58
60
|
liveHubPorts,
|
|
59
61
|
liveJanitorPorts,
|
|
60
62
|
liveNotesPorts,
|
|
63
|
+
readWriterModes,
|
|
61
64
|
liveScriptLogPorts,
|
|
62
65
|
liveSkillsPorts,
|
|
63
66
|
} from "./server/live-ports.js";
|
|
@@ -107,6 +110,9 @@ import {
|
|
|
107
110
|
dutiesSaveRpc,
|
|
108
111
|
dutyActedRpc,
|
|
109
112
|
incidentsDismissRpc,
|
|
113
|
+
notesModesRpc,
|
|
114
|
+
planUsageRpc,
|
|
115
|
+
teamRenameRpc,
|
|
110
116
|
trackersSaveRpc,
|
|
111
117
|
trackersTestRpc,
|
|
112
118
|
type TrackersChange,
|
|
@@ -204,7 +210,9 @@ export function createOfficePlugin(
|
|
|
204
210
|
): () => Promise<void> {
|
|
205
211
|
const { log } = deps;
|
|
206
212
|
const holder = createPaseoHolder();
|
|
207
|
-
|
|
213
|
+
// Off until the settings are read: nothing is named before the host has said it may be.
|
|
214
|
+
let stepsNamed = false;
|
|
215
|
+
const hub = createHub(liveHubPorts(holder, deps.clock, log, () => stepsNamed));
|
|
208
216
|
hub.setBrand(hostBrand({}, deps.env));
|
|
209
217
|
const office = createOffice({
|
|
210
218
|
store: deps.store,
|
|
@@ -428,6 +436,7 @@ export function createOfficePlugin(
|
|
|
428
436
|
// Neither schedule can follow settings it cannot read: both cards say why until a save is read.
|
|
429
437
|
function settingsUnreadable(reason: string): void {
|
|
430
438
|
agentToolsOn = false;
|
|
439
|
+
stepsNamed = false;
|
|
431
440
|
office.setPickupEnabled(false);
|
|
432
441
|
const message = `The office's settings cannot be read: ${reason}`;
|
|
433
442
|
log(`[office] ${message}`);
|
|
@@ -447,6 +456,7 @@ export function createOfficePlugin(
|
|
|
447
456
|
}
|
|
448
457
|
hub.setBrand(hostBrand(state.values, deps.env));
|
|
449
458
|
agentToolsOn = state.values.agentTools;
|
|
459
|
+
stepsNamed = !state.values.streamerMode;
|
|
450
460
|
office.setPickupEnabled(agentToolsOn && holder.held());
|
|
451
461
|
weather.settingsChanged(state.values);
|
|
452
462
|
await notesSchedule.sync(state.values);
|
|
@@ -649,6 +659,45 @@ export function createOfficePlugin(
|
|
|
649
659
|
throw error;
|
|
650
660
|
}
|
|
651
661
|
}
|
|
662
|
+
server.handle(planUsageRpc, async (_input, context) => {
|
|
663
|
+
holder.remember(context.paseo);
|
|
664
|
+
try {
|
|
665
|
+
const listed = await context.paseo.providers.listUsage();
|
|
666
|
+
return { ok: true as const, providers: projectPlanUsage(listed.providers) };
|
|
667
|
+
} catch (error) {
|
|
668
|
+
// A host older than provider usage has no such call: the floor then shows no limit.
|
|
669
|
+
return { ok: false as const, problem: errorMessage(error) };
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
server.handle(teamRenameRpc, async ({ workspaceId, name }, context) => {
|
|
673
|
+
holder.remember(context.paseo);
|
|
674
|
+
try {
|
|
675
|
+
const workspace = context.paseo.workspaces.ref(workspaceId);
|
|
676
|
+
const current = await workspace.refresh();
|
|
677
|
+
if (current === null) return { ok: false as const, problem: "The workspace is gone" };
|
|
678
|
+
const next = tidyTeamName(name);
|
|
679
|
+
// Null removes the key, and the team goes by the workspace's name again.
|
|
680
|
+
await workspace.setMetadata({ [TEAM_NAME_KEY]: next === "" ? null : next });
|
|
681
|
+
const shown = next === "" ? current.name : next;
|
|
682
|
+
// The directory's next view would carry the tenure over too; a restart before it would not.
|
|
683
|
+
(await lifeReady)?.renamed(teamNameOf(current), shown);
|
|
684
|
+
return { ok: true as const, name: shown };
|
|
685
|
+
} catch (error) {
|
|
686
|
+
log(`[office] team rename failed: ${errorMessage(error)}`);
|
|
687
|
+
return { ok: false as const, problem: errorMessage(error) };
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
server.handle(notesModesRpc, async (_input, context) => {
|
|
691
|
+
holder.remember(context.paseo);
|
|
692
|
+
try {
|
|
693
|
+
const values = await readHostSettings();
|
|
694
|
+
// The provider is asked for the notes folder, as the writer's start asks it.
|
|
695
|
+
const cwd = values.notesFolder.trim() || homedir();
|
|
696
|
+
return { ok: true as const, ...(await readWriterModes(holder, cwd, values.notesMode)) };
|
|
697
|
+
} catch (error) {
|
|
698
|
+
return { ok: false as const, problem: errorMessage(error) };
|
|
699
|
+
}
|
|
700
|
+
});
|
|
652
701
|
// One save at a time: each starts from what the one before it kept.
|
|
653
702
|
let trackerSaves: Promise<unknown> = Promise.resolve();
|
|
654
703
|
server.handle(trackersSaveRpc, (input) => {
|
|
@@ -759,7 +808,8 @@ export function createOfficePlugin(
|
|
|
759
808
|
? (await context.paseo.agents.ref(agent.parentAgentId).refresh())?.agent.workspaceId
|
|
760
809
|
: null);
|
|
761
810
|
if (!workspaceId) return null;
|
|
762
|
-
|
|
811
|
+
const workspace = await context.paseo.workspaces.ref(workspaceId).refresh();
|
|
812
|
+
return workspace ? teamNameOf(workspace) : null;
|
|
763
813
|
});
|
|
764
814
|
} catch (error) {
|
|
765
815
|
log(`[office] agent.turn.after failed: ${errorMessage(error)}`);
|