paseo-office 0.2.0 → 0.2.1
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 +27 -0
- package/README.md +65 -134
- package/client/action-button.tsx +4 -1
- package/client/activity-panel.tsx +6 -4
- package/client/agent-appearance.tsx +257 -0
- package/client/agent-card.tsx +2 -1
- package/client/agent-picker-text.ts +23 -4
- package/client/agent-picker.tsx +5 -8
- package/client/board-sheet.tsx +48 -16
- package/client/board-text.ts +12 -2
- package/client/brand.ts +1 -0
- package/client/chat-chrome.tsx +318 -0
- package/client/chat-compose-tools.tsx +314 -0
- package/client/chat-dictation.tsx +133 -0
- package/client/chat-more.tsx +119 -0
- package/client/chat-panel.tsx +401 -146
- package/client/chat-quick.tsx +198 -0
- package/client/chat-text.ts +25 -6
- package/client/column-sheet.tsx +93 -23
- package/client/conversation-model.ts +19 -5
- package/client/duty-sheet.tsx +321 -0
- package/client/duty-text.ts +20 -0
- package/client/fullscreen-header.tsx +28 -13
- package/client/fullscreen-theme.ts +38 -0
- package/client/host-details.tsx +269 -0
- package/client/host-styles.ts +129 -0
- package/client/host-switches.tsx +197 -73
- package/client/incidents-card.tsx +2 -1
- package/client/janitor-card.tsx +1 -1
- package/client/library-card.tsx +2 -1
- package/client/list-text.ts +8 -6
- package/client/lobby-board.tsx +73 -53
- package/client/machine-card.tsx +225 -85
- package/client/messenger-styles.ts +216 -0
- package/client/new-agent-form.tsx +153 -61
- package/client/new-agent-model.ts +2 -0
- package/client/notes-card.tsx +111 -83
- package/client/notes-days.tsx +1 -1
- package/client/office-brand-context.ts +44 -0
- package/client/office-column.tsx +2 -1
- package/client/office-keyboard.ts +79 -0
- package/client/office-link.ts +7 -1
- package/client/office-mark.tsx +29 -0
- package/client/office-modal.tsx +440 -0
- package/client/office-settings.tsx +75 -30
- package/client/office-state.ts +12 -2
- package/client/office-surface.tsx +591 -81
- package/client/pixel/actors.ts +2 -1
- package/client/pixel/art.ts +33 -19
- package/client/pixel/pixel-office.tsx +2 -2
- package/client/prompt-coach.tsx +152 -0
- package/client/qa-card.tsx +2 -1
- package/client/review-card.tsx +2 -1
- package/client/room-board.tsx +26 -2
- package/client/scene-picker.tsx +158 -0
- package/client/scene-previews.ts +10 -0
- package/client/session-pane.tsx +25 -5
- package/client/session-panel-detail.tsx +238 -0
- package/client/session-panel.tsx +222 -137
- package/client/session-styles.ts +224 -1
- package/client/session-transcript.tsx +243 -0
- package/client/sessions-panel.tsx +181 -22
- package/client/sessions-text.ts +18 -0
- package/client/settings-sections.tsx +126 -0
- package/client/sidebar-launcher.ts +29 -0
- package/client/ssh-hosts.tsx +331 -0
- package/client/ssh-metrics.ts +76 -0
- package/client/standup-card.tsx +2 -1
- package/client/structure-view.tsx +20 -3
- package/client/styles.ts +170 -62
- package/client/team-chat-preview.tsx +96 -0
- package/client/transcript-styles.ts +90 -0
- package/client/use-device-switch.ts +21 -12
- package/client/use-duty-actions.ts +43 -0
- package/client/use-group-photo.ts +48 -0
- package/client/use-new-agent.ts +4 -0
- package/client/use-street.ts +8 -0
- package/client/workspace-office-tools.tsx +102 -0
- package/client/workspace-overlay-route.web.ts +47 -0
- package/client/workspace-overlay.tsx +195 -0
- package/client/world/adapter.ts +37 -2
- package/client/world/escape.ts +58 -0
- package/client/world/use-world-feed.ts +6 -2
- package/client/world/workspace-dock.ts +6 -0
- package/client/world/world-api.ts +45 -4
- package/client/world/world-bridge-page.ts +14 -3
- package/client/world/world-bridge.ts +50 -5
- package/client/world/world-frame.web.ts +8 -0
- package/client/world/world-view-native.tsx +31 -10
- package/client/world/world-view-shared.ts +36 -7
- package/client/world/world-view.tsx +93 -21
- package/docs/office.md +148 -58
- package/index.client.tsx +13 -6
- package/index.server.ts +125 -9
- package/package.json +2 -1
- package/server/activity.ts +42 -19
- package/server/agent-tools.ts +11 -5
- package/server/board-service.ts +381 -10
- package/server/brand-logo.ts +34 -0
- package/server/chat-group.ts +83 -0
- package/server/chat-service.ts +406 -62
- package/server/chat-store.ts +1 -4
- package/server/directory.ts +22 -7
- package/server/duty-service.ts +230 -0
- package/server/group-photo.ts +39 -0
- package/server/home-departure.ts +47 -0
- package/server/hub.ts +43 -1
- package/server/live-ports.ts +114 -18
- package/server/lobby-pickup.ts +170 -0
- package/server/machine/details.ts +91 -0
- package/server/mention-queue.ts +14 -0
- package/server/office.ts +110 -6
- package/server/paths.ts +9 -0
- package/server/ssh/LICENSE.paseo +211 -0
- package/server/ssh/client.ts +401 -0
- package/server/ssh/discovery.ts +230 -0
- package/server/ssh/installed.ts +104 -0
- package/server/ssh/monitor.ts +104 -0
- package/server/ssh/pid-files.ts +194 -0
- package/server/ssh/read.ts +136 -0
- package/server/subagent-names.ts +4 -0
- package/server/words.generated.ts +1 -1
- package/server/world.generated.ts +1 -1
- package/shared/appearance.ts +43 -0
- package/shared/branding.ts +53 -0
- package/shared/chat-words.ts +2 -2
- package/shared/contracts.ts +135 -4
- package/shared/duties.ts +100 -0
- package/shared/host-details.ts +25 -0
- package/shared/lobby-assignment.ts +34 -0
- package/shared/model.ts +9 -1
- package/shared/names.ts +2 -0
- package/shared/settings.ts +14 -3
- package/shared/ssh.ts +34 -0
- package/shared/upstream/README.md +1 -3
- package/shared/upstream/chat-engine.d.ts +4 -0
- package/shared/upstream/prompt-coach.d.ts +6 -0
- package/shared/upstream/prompt-coach.js +178 -0
package/client/host-switches.tsx
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { useOfficeBrand } from "./office-brand-context.js";
|
|
2
|
+
import { OfficeMark } from "./office-mark.js";
|
|
1
3
|
import { useCallback, useEffect, useRef, useState, type ReactNode } from "react";
|
|
2
4
|
import { Text, View } from "react-native";
|
|
3
5
|
import { useSettings, type SettingsState } from "@getpaseo/plugin/client";
|
|
6
|
+
import { SettingsSections, settingsLayout } from "./settings-sections.js";
|
|
4
7
|
import { SettingField } from "./setting-field.js";
|
|
5
8
|
import { WeatherFields, type WeatherSetting } from "./weather-settings.js";
|
|
6
9
|
import type { IncidentsState, WakeState } from "../shared/contracts.js";
|
|
@@ -17,6 +20,10 @@ type HostSettings = SettingsState<typeof officeHostSettings.schema>;
|
|
|
17
20
|
export type HostValues = Extract<HostSettings, { status: "ready" }>["values"];
|
|
18
21
|
/** A host setting, as its control is labelled. */
|
|
19
22
|
type HostSetting =
|
|
23
|
+
| "Office name"
|
|
24
|
+
| "Logo URL"
|
|
25
|
+
| "Brand color"
|
|
26
|
+
| "Archive idle sessions"
|
|
20
27
|
| "Agent tools"
|
|
21
28
|
| "Notes folder"
|
|
22
29
|
| "Time zone"
|
|
@@ -70,6 +77,7 @@ export interface HostSwitchesProps {
|
|
|
70
77
|
incidents: TrackerState | undefined;
|
|
71
78
|
/** The device's own switch: last in the row, so on a phone it wraps to the line above the view. */
|
|
72
79
|
weather?: import("../shared/contracts.js").WeatherState | undefined;
|
|
80
|
+
language?: ReactNode;
|
|
73
81
|
children?: ReactNode;
|
|
74
82
|
}
|
|
75
83
|
|
|
@@ -87,6 +95,7 @@ export function HostSwitches({
|
|
|
87
95
|
scheduleError,
|
|
88
96
|
incidents,
|
|
89
97
|
weather,
|
|
98
|
+
language,
|
|
90
99
|
children,
|
|
91
100
|
}: HostSwitchesProps) {
|
|
92
101
|
const settings = useSettings(officeHostSettings);
|
|
@@ -175,82 +184,113 @@ export function HostSwitches({
|
|
|
175
184
|
wakeProblem,
|
|
176
185
|
settings.status === "error" ? failureText("Read the office settings", settings.error) : null,
|
|
177
186
|
saveProblem("Agent tools"),
|
|
178
|
-
deviceProblem,
|
|
179
187
|
].filter((problem): problem is string => problem !== null);
|
|
180
188
|
return (
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
<FloorPlanRow
|
|
200
|
-
value={storedPlan(stored)}
|
|
201
|
-
onSave={savePlan}
|
|
202
|
-
problem={saveProblem(FLOOR_PLAN_LABEL)}
|
|
203
|
-
styles={styles}
|
|
204
|
-
/>
|
|
205
|
-
</View>
|
|
206
|
-
<View style={styles.headerFields}>
|
|
207
|
-
<SettingField
|
|
208
|
-
label="Notes folder"
|
|
209
|
-
hint="Where the stand-up notes are written. Empty turns them off."
|
|
210
|
-
value={stored?.notesFolder ?? null}
|
|
211
|
-
onSave={saveFolder}
|
|
212
|
-
problem={saveProblem("Notes folder")}
|
|
213
|
-
styles={styles}
|
|
214
|
-
/>
|
|
215
|
-
<SettingField
|
|
216
|
-
label="Time zone"
|
|
217
|
-
hint="For the 8:00 run. Empty uses this host's."
|
|
218
|
-
value={stored?.notesTimeZone ?? null}
|
|
219
|
-
onSave={saveTimeZone}
|
|
220
|
-
problem={timeZoneProblem}
|
|
221
|
-
styles={styles}
|
|
222
|
-
/>
|
|
223
|
-
<NotesDays
|
|
224
|
-
value={stored?.notesDays ?? null}
|
|
225
|
-
onSave={saveDays}
|
|
226
|
-
problem={saveProblem(NOTES_DAYS_LABEL)}
|
|
227
|
-
styles={styles}
|
|
228
|
-
/>
|
|
229
|
-
</View>
|
|
230
|
-
<TrackerFields
|
|
231
|
-
values={stored}
|
|
232
|
-
incidents={incidents}
|
|
233
|
-
change={change}
|
|
234
|
-
saveProblem={saveProblem}
|
|
235
|
-
styles={styles}
|
|
236
|
-
/>
|
|
237
|
-
<WeatherFields
|
|
238
|
-
values={stored}
|
|
239
|
-
weather={weather}
|
|
240
|
-
change={change}
|
|
241
|
-
saveProblem={saveProblem}
|
|
242
|
-
styles={styles}
|
|
243
|
-
/>
|
|
244
|
-
{problems.length > 0 ? (
|
|
245
|
-
<View style={styles.headerProblems}>
|
|
246
|
-
{problems.map((problem) => (
|
|
247
|
-
<Text key={problem} accessibilityRole="alert" style={styles.actionError}>
|
|
248
|
-
{problem}
|
|
189
|
+
<SettingsSections
|
|
190
|
+
styles={styles}
|
|
191
|
+
appearance={
|
|
192
|
+
<>
|
|
193
|
+
{children}
|
|
194
|
+
<BrandFields values={stored} change={change} saveProblem={saveProblem} styles={styles} />
|
|
195
|
+
<View style={styles.headerFields}>
|
|
196
|
+
<FloorPlanRow
|
|
197
|
+
value={storedPlan(stored)}
|
|
198
|
+
onSave={savePlan}
|
|
199
|
+
problem={saveProblem(FLOOR_PLAN_LABEL)}
|
|
200
|
+
styles={styles}
|
|
201
|
+
/>
|
|
202
|
+
</View>
|
|
203
|
+
<View style={styles.headerFields}>{language}</View>
|
|
204
|
+
{deviceProblem && (
|
|
205
|
+
<Text accessibilityRole="alert" style={styles.actionError}>
|
|
206
|
+
{deviceProblem}
|
|
249
207
|
</Text>
|
|
250
|
-
)
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
208
|
+
)}
|
|
209
|
+
</>
|
|
210
|
+
}
|
|
211
|
+
automation={
|
|
212
|
+
<>
|
|
213
|
+
<View style={settingsLayout.block}>
|
|
214
|
+
<Text style={styles.sheetLabel}>Agents</Text>
|
|
215
|
+
<View style={settingsLayout.strip}>
|
|
216
|
+
<LabeledSwitch
|
|
217
|
+
label="Wake agents"
|
|
218
|
+
note={summary}
|
|
219
|
+
value={wantedWakes ?? wakesOn}
|
|
220
|
+
onChange={toggleWakes}
|
|
221
|
+
styles={styles}
|
|
222
|
+
/>
|
|
223
|
+
<LabeledSwitch
|
|
224
|
+
label="Agent tools"
|
|
225
|
+
value={wantedTools ?? stored?.agentTools ?? null}
|
|
226
|
+
onChange={toggleTools}
|
|
227
|
+
styles={styles}
|
|
228
|
+
/>
|
|
229
|
+
</View>
|
|
230
|
+
</View>
|
|
231
|
+
<ArchiveSetting
|
|
232
|
+
values={stored}
|
|
233
|
+
change={change}
|
|
234
|
+
saveProblem={saveProblem}
|
|
235
|
+
styles={styles}
|
|
236
|
+
/>
|
|
237
|
+
<Text style={styles.sheetLabel}>Stand-up schedule</Text>
|
|
238
|
+
<View style={styles.headerFields}>
|
|
239
|
+
<SettingField
|
|
240
|
+
label="Notes folder"
|
|
241
|
+
hint="Where the stand-up notes are written. Empty turns them off."
|
|
242
|
+
value={stored?.notesFolder ?? null}
|
|
243
|
+
onSave={saveFolder}
|
|
244
|
+
problem={saveProblem("Notes folder")}
|
|
245
|
+
styles={styles}
|
|
246
|
+
/>
|
|
247
|
+
<SettingField
|
|
248
|
+
label="Time zone"
|
|
249
|
+
hint="For the 8:00 run. Empty uses this host's."
|
|
250
|
+
value={stored?.notesTimeZone ?? null}
|
|
251
|
+
onSave={saveTimeZone}
|
|
252
|
+
problem={timeZoneProblem}
|
|
253
|
+
styles={styles}
|
|
254
|
+
/>
|
|
255
|
+
<NotesDays
|
|
256
|
+
value={stored?.notesDays ?? null}
|
|
257
|
+
onSave={saveDays}
|
|
258
|
+
problem={saveProblem(NOTES_DAYS_LABEL)}
|
|
259
|
+
styles={styles}
|
|
260
|
+
/>
|
|
261
|
+
</View>
|
|
262
|
+
{problems.length > 0 ? (
|
|
263
|
+
<View style={styles.headerProblems}>
|
|
264
|
+
{problems.map((problem) => (
|
|
265
|
+
<Text key={problem} accessibilityRole="alert" style={styles.actionError}>
|
|
266
|
+
{problem}
|
|
267
|
+
</Text>
|
|
268
|
+
))}
|
|
269
|
+
</View>
|
|
270
|
+
) : null}
|
|
271
|
+
</>
|
|
272
|
+
}
|
|
273
|
+
services={
|
|
274
|
+
<>
|
|
275
|
+
<Text style={styles.sheetLabel}>Issue trackers</Text>
|
|
276
|
+
<TrackerFields
|
|
277
|
+
values={stored}
|
|
278
|
+
incidents={incidents}
|
|
279
|
+
change={change}
|
|
280
|
+
saveProblem={saveProblem}
|
|
281
|
+
styles={styles}
|
|
282
|
+
/>
|
|
283
|
+
<Text style={styles.sheetLabel}>Weather service</Text>
|
|
284
|
+
<WeatherFields
|
|
285
|
+
values={stored}
|
|
286
|
+
weather={weather}
|
|
287
|
+
change={change}
|
|
288
|
+
saveProblem={saveProblem}
|
|
289
|
+
styles={styles}
|
|
290
|
+
/>
|
|
291
|
+
</>
|
|
292
|
+
}
|
|
293
|
+
/>
|
|
254
294
|
);
|
|
255
295
|
}
|
|
256
296
|
|
|
@@ -355,3 +395,87 @@ function TrackerFields({ values, incidents, change, saveProblem, styles }: Track
|
|
|
355
395
|
</>
|
|
356
396
|
);
|
|
357
397
|
}
|
|
398
|
+
|
|
399
|
+
function ArchiveSetting({
|
|
400
|
+
values: stored,
|
|
401
|
+
change,
|
|
402
|
+
saveProblem,
|
|
403
|
+
styles,
|
|
404
|
+
}: Omit<TrackerFieldsProps, "incidents">) {
|
|
405
|
+
const toggle = useCallback(
|
|
406
|
+
(next: boolean) => void change("Archive idle sessions", { archiveOnDeparture: next }),
|
|
407
|
+
[change],
|
|
408
|
+
);
|
|
409
|
+
const problem = saveProblem("Archive idle sessions");
|
|
410
|
+
return (
|
|
411
|
+
<View style={settingsLayout.block}>
|
|
412
|
+
{stored && (
|
|
413
|
+
<LabeledSwitch
|
|
414
|
+
label="Archive idle sessions"
|
|
415
|
+
value={stored.archiveOnDeparture}
|
|
416
|
+
onChange={toggle}
|
|
417
|
+
styles={styles}
|
|
418
|
+
/>
|
|
419
|
+
)}
|
|
420
|
+
<Text style={styles.fieldHint}>
|
|
421
|
+
Off by default. When a worker goes home for the night or after evening drinks, an open 3D
|
|
422
|
+
floor can archive its idle session on this host. Sessions awaiting approval or a working
|
|
423
|
+
subagent stay active. Archived sessions leave the active list and keep their history.
|
|
424
|
+
</Text>
|
|
425
|
+
{problem && (
|
|
426
|
+
<Text accessibilityRole="alert" style={styles.actionError}>
|
|
427
|
+
{problem}
|
|
428
|
+
</Text>
|
|
429
|
+
)}
|
|
430
|
+
</View>
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
function BrandFields({
|
|
435
|
+
values: stored,
|
|
436
|
+
change,
|
|
437
|
+
saveProblem,
|
|
438
|
+
styles,
|
|
439
|
+
}: Omit<TrackerFieldsProps, "incidents">) {
|
|
440
|
+
const brand = useOfficeBrand();
|
|
441
|
+
const saveName = useCallback((v: string) => change("Office name", { brandName: v }), [change]);
|
|
442
|
+
const saveLogo = useCallback((v: string) => change("Logo URL", { brandLogoUrl: v }), [change]);
|
|
443
|
+
const saveColor = useCallback((v: string) => change("Brand color", { brandColor: v }), [change]);
|
|
444
|
+
return (
|
|
445
|
+
<View style={settingsLayout.block}>
|
|
446
|
+
<Text style={styles.sheetLabel}>Branding</Text>
|
|
447
|
+
<View style={settingsLayout.strip}>
|
|
448
|
+
<OfficeMark brand={brand} fallbackColor={styles.brandIcon.color} />
|
|
449
|
+
<Text numberOfLines={1} style={styles.brandText}>
|
|
450
|
+
{brand.name ?? "Office 3D"}
|
|
451
|
+
</Text>
|
|
452
|
+
</View>
|
|
453
|
+
<View style={styles.headerFields}>
|
|
454
|
+
<SettingField
|
|
455
|
+
label="Office name"
|
|
456
|
+
value={stored ? (stored.brandName ?? "") : null}
|
|
457
|
+
hint="Display name. Leave blank to use the host default."
|
|
458
|
+
onSave={saveName}
|
|
459
|
+
problem={saveProblem("Office name")}
|
|
460
|
+
styles={styles}
|
|
461
|
+
/>
|
|
462
|
+
<SettingField
|
|
463
|
+
label="Brand color"
|
|
464
|
+
value={stored ? (stored.brandColor ?? "") : null}
|
|
465
|
+
hint="Hex color for the office mark, such as #e8865f."
|
|
466
|
+
onSave={saveColor}
|
|
467
|
+
problem={saveProblem("Brand color")}
|
|
468
|
+
styles={styles}
|
|
469
|
+
/>
|
|
470
|
+
<SettingField
|
|
471
|
+
label="Logo URL"
|
|
472
|
+
value={stored ? (stored.brandLogoUrl ?? "") : null}
|
|
473
|
+
hint="HTTPS image URL. Allow cross-origin images for the 3D sign."
|
|
474
|
+
onSave={saveLogo}
|
|
475
|
+
problem={saveProblem("Logo URL")}
|
|
476
|
+
styles={styles}
|
|
477
|
+
/>
|
|
478
|
+
</View>
|
|
479
|
+
</View>
|
|
480
|
+
);
|
|
481
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { Text, View } from "react-native";
|
|
3
|
-
import { ExternalLink
|
|
3
|
+
import { ExternalLink } from "@getpaseo/plugin/client/ui";
|
|
4
|
+
import { OfficeModal as Modal } from "./office-modal.js";
|
|
4
5
|
import type { IncidentsState } from "../shared/contracts.js";
|
|
5
6
|
import { ActionButton, failureText } from "./action-button.js";
|
|
6
7
|
import { incidentProblems, incidentRows, type IncidentRow } from "./incidents-text.js";
|
package/client/janitor-card.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { Text, View, type ViewStyle } from "react-native";
|
|
3
|
-
import { Modal } from "
|
|
3
|
+
import { OfficeModal as Modal } from "./office-modal.js";
|
|
4
4
|
import { ActionButton, failureText } from "./action-button.js";
|
|
5
5
|
import { contextTone, inShownOrder, janitorRowLabel, type JanitorRow } from "./context-text.js";
|
|
6
6
|
import type { OfficeStyles } from "./styles.js";
|
package/client/library-card.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment, useCallback, useEffect, useRef, useState } from "react";
|
|
2
2
|
import { Text, View } from "react-native";
|
|
3
|
-
import {
|
|
3
|
+
import { ScrollView, TextInput } from "@getpaseo/plugin/client/ui";
|
|
4
|
+
import { OfficeModal as Modal } from "./office-modal.js";
|
|
4
5
|
import type { SkillInfo, SkillsResult } from "../shared/contracts.js";
|
|
5
6
|
import { ActionButton, failureText } from "./action-button.js";
|
|
6
7
|
import { textAfterSend } from "./agent-card.js";
|
package/client/list-text.ts
CHANGED
|
@@ -136,22 +136,24 @@ function clockText(promptedAt: string | undefined, now: number): string | null {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
/** How long ago a resting agent's last change was: "now", "5m ago", "2h ago", "3d ago". */
|
|
139
|
-
function agoText(idleSince: string | undefined, now: number): string | null {
|
|
139
|
+
function agoText(idleSince: string | undefined, now: number, waiting = false): string | null {
|
|
140
140
|
const since = idleSince === undefined ? Number.NaN : Date.parse(idleSince);
|
|
141
141
|
if (!Number.isFinite(since)) return null;
|
|
142
142
|
const ms = Math.max(0, now - since);
|
|
143
|
-
if (ms < MINUTE) return "now";
|
|
144
|
-
|
|
145
|
-
if (ms <
|
|
146
|
-
|
|
143
|
+
if (ms < MINUTE) return waiting ? "Waiting <1m" : "now";
|
|
144
|
+
let duration = `${Math.floor(ms / DAY)}d`;
|
|
145
|
+
if (ms < HOUR) duration = `${Math.floor(ms / MINUTE)}m`;
|
|
146
|
+
else if (ms < DAY) duration = `${Math.floor(ms / HOUR)}h`;
|
|
147
|
+
return waiting ? `Waiting ${duration}` : `${duration} ago`;
|
|
147
148
|
}
|
|
148
149
|
|
|
149
150
|
/**
|
|
150
151
|
* The row's time: the turn's clock while it runs, how long it has rested while it is idle. An
|
|
151
|
-
* agent
|
|
152
|
+
* agent with a permission request uses its attention timestamp when the host provides one.
|
|
152
153
|
*/
|
|
153
154
|
export function timeText(row: OfficeRow, now: number): string | null {
|
|
154
155
|
const { agent } = row;
|
|
156
|
+
if (agent.permissions.length) return agoText(agent.permissionSince, now, true);
|
|
155
157
|
if (attentionReason(agent) !== null) return null;
|
|
156
158
|
if (agent.status === "running") return clockText(agent.promptedAt, now);
|
|
157
159
|
if (agent.status === "idle") return agoText(agent.idleSince, now);
|
package/client/lobby-board.tsx
CHANGED
|
@@ -92,39 +92,48 @@ function TodoRow({ post, name, actions, styles }: TodoRowProps) {
|
|
|
92
92
|
const keep = useCallback(() => setAsking(false), []);
|
|
93
93
|
const remove = useCallback(() => actions.remove(post.id), [actions, post.id]);
|
|
94
94
|
return (
|
|
95
|
-
<View style={styles.
|
|
96
|
-
<
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
95
|
+
<View style={styles.lobbyTask}>
|
|
96
|
+
<View style={styles.lobbyTaskLine}>
|
|
97
|
+
<Pressable
|
|
98
|
+
id={id}
|
|
99
|
+
accessibilityRole="checkbox"
|
|
100
|
+
accessibilityLabel={meta === null ? post.text : `${post.text}, ${meta}`}
|
|
101
|
+
aria-checked={done}
|
|
102
|
+
disabled={pending}
|
|
103
|
+
onPress={toggle}
|
|
104
|
+
style={pending ? styles.todoRowDisabled : styles.todoRow}
|
|
105
|
+
>
|
|
106
|
+
<Icon name={done ? "SquareCheck" : "Square"} size={20} color={styles.iconColor} />
|
|
107
|
+
<View style={styles.rowBody}>
|
|
108
|
+
<Text style={done ? styles.todoTextDone : styles.postText}>{post.text}</Text>
|
|
109
|
+
{meta === null ? null : <Text style={styles.postMeta}>{meta}</Text>}
|
|
110
|
+
</View>
|
|
111
|
+
</Pressable>
|
|
112
|
+
<Pressable
|
|
113
|
+
accessibilityRole="button"
|
|
114
|
+
accessibilityLabel={`Delete task: ${post.text}`}
|
|
115
|
+
aria-expanded={asking}
|
|
116
|
+
onPress={ask}
|
|
117
|
+
style={styles.lobbyDelete}
|
|
118
|
+
>
|
|
119
|
+
<Icon name="Trash2" size={16} color={styles.iconColor} />
|
|
120
|
+
</Pressable>
|
|
121
|
+
</View>
|
|
111
122
|
{failure === null ? null : (
|
|
112
123
|
<Text accessibilityRole="alert" style={styles.actionError}>
|
|
113
124
|
{failure}
|
|
114
125
|
</Text>
|
|
115
126
|
)}
|
|
116
127
|
{asking ? (
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
<View style={styles.actions}>
|
|
125
|
-
<ActionButton label="Delete" pendingLabel="Deleting..." onPress={ask} styles={styles} />
|
|
128
|
+
<View style={styles.lobbyConfirm}>
|
|
129
|
+
<DeleteQuestion
|
|
130
|
+
question="Delete this post?"
|
|
131
|
+
onDelete={remove}
|
|
132
|
+
onKeep={keep}
|
|
133
|
+
styles={styles}
|
|
134
|
+
/>
|
|
126
135
|
</View>
|
|
127
|
-
)}
|
|
136
|
+
) : null}
|
|
128
137
|
</View>
|
|
129
138
|
);
|
|
130
139
|
}
|
|
@@ -153,7 +162,9 @@ function TodoHeading({ board, done, actions, styles }: TodoHeadingProps) {
|
|
|
153
162
|
if (asking && done === 0) setAsking(false);
|
|
154
163
|
return (
|
|
155
164
|
<View style={styles.boardTitleRow}>
|
|
156
|
-
<Text style={styles.
|
|
165
|
+
<Text accessibilityRole="header" style={styles.lobbyHeading}>
|
|
166
|
+
To-do
|
|
167
|
+
</Text>
|
|
157
168
|
{asking ? (
|
|
158
169
|
<View style={styles.sheetActions}>
|
|
159
170
|
<DeleteQuestion
|
|
@@ -164,13 +175,15 @@ function TodoHeading({ board, done, actions, styles }: TodoHeadingProps) {
|
|
|
164
175
|
/>
|
|
165
176
|
</View>
|
|
166
177
|
) : (
|
|
167
|
-
<
|
|
168
|
-
|
|
169
|
-
|
|
178
|
+
<Pressable
|
|
179
|
+
accessibilityRole="button"
|
|
180
|
+
accessibilityLabel="Clear finished"
|
|
170
181
|
onPress={ask}
|
|
171
182
|
disabled={done === 0}
|
|
172
|
-
|
|
173
|
-
|
|
183
|
+
style={styles.lobbyDelete}
|
|
184
|
+
>
|
|
185
|
+
<Text style={styles.lobbyDeleteText}>Clear finished</Text>
|
|
186
|
+
</Pressable>
|
|
174
187
|
)}
|
|
175
188
|
</View>
|
|
176
189
|
);
|
|
@@ -204,13 +217,15 @@ interface TaskGroupProps {
|
|
|
204
217
|
function TaskGroup({ group, name, styles }: TaskGroupProps) {
|
|
205
218
|
const lines = useMemo(() => stepLines(group.steps), [group.steps]);
|
|
206
219
|
return (
|
|
207
|
-
<View style={styles.
|
|
208
|
-
<
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
{line.
|
|
212
|
-
|
|
213
|
-
|
|
220
|
+
<View style={styles.lobbyTask}>
|
|
221
|
+
<View style={styles.post}>
|
|
222
|
+
<Text style={styles.rowTitle}>{name(group.agentId)}</Text>
|
|
223
|
+
{lines.map((line) => (
|
|
224
|
+
<Text key={line.key} style={styles.postText}>
|
|
225
|
+
{line.text}
|
|
226
|
+
</Text>
|
|
227
|
+
))}
|
|
228
|
+
</View>
|
|
214
229
|
</View>
|
|
215
230
|
);
|
|
216
231
|
}
|
|
@@ -281,7 +296,7 @@ export function LobbyBody({
|
|
|
281
296
|
}
|
|
282
297
|
return (
|
|
283
298
|
<View style={styles.sheet}>
|
|
284
|
-
<View style={styles.
|
|
299
|
+
<View style={styles.lobbyForm}>
|
|
285
300
|
<View style={styles.boardTitleRow}>
|
|
286
301
|
<View style={styles.rowBody}>
|
|
287
302
|
<TextInput
|
|
@@ -313,16 +328,17 @@ export function LobbyBody({
|
|
|
313
328
|
{failure}
|
|
314
329
|
</Text>
|
|
315
330
|
)}
|
|
331
|
+
<WakeField
|
|
332
|
+
id={fieldId}
|
|
333
|
+
roomId={room.id}
|
|
334
|
+
to={to}
|
|
335
|
+
rooms={rooms}
|
|
336
|
+
wakesPaused={wakesPaused}
|
|
337
|
+
onOpen={open}
|
|
338
|
+
styles={styles}
|
|
339
|
+
/>
|
|
316
340
|
</View>
|
|
317
|
-
<
|
|
318
|
-
id={fieldId}
|
|
319
|
-
to={to}
|
|
320
|
-
rooms={rooms}
|
|
321
|
-
wakesPaused={wakesPaused}
|
|
322
|
-
onOpen={open}
|
|
323
|
-
styles={styles}
|
|
324
|
-
/>
|
|
325
|
-
<View style={styles.boardPosts}>
|
|
341
|
+
<View style={styles.lobbySection}>
|
|
326
342
|
<TodoHeading board={room.id} done={done} actions={actions} styles={styles} />
|
|
327
343
|
{room.todos.length === 0 ? <Text style={styles.muted}>No to-dos</Text> : null}
|
|
328
344
|
{room.todos.map((post) => (
|
|
@@ -330,8 +346,10 @@ export function LobbyBody({
|
|
|
330
346
|
))}
|
|
331
347
|
</View>
|
|
332
348
|
{notes.length > 0 ? (
|
|
333
|
-
<View style={styles.
|
|
334
|
-
<Text style={styles.
|
|
349
|
+
<View style={styles.lobbySection}>
|
|
350
|
+
<Text accessibilityRole="header" style={styles.lobbyHeading}>
|
|
351
|
+
Notes
|
|
352
|
+
</Text>
|
|
335
353
|
{notes.map((post) => (
|
|
336
354
|
<PostWithActions
|
|
337
355
|
key={post.id}
|
|
@@ -343,8 +361,10 @@ export function LobbyBody({
|
|
|
343
361
|
))}
|
|
344
362
|
</View>
|
|
345
363
|
) : null}
|
|
346
|
-
<View style={styles.
|
|
347
|
-
<Text style={styles.
|
|
364
|
+
<View style={styles.lobbySection}>
|
|
365
|
+
<Text accessibilityRole="header" style={styles.lobbyHeading}>
|
|
366
|
+
Agent tasks
|
|
367
|
+
</Text>
|
|
348
368
|
{agentTasks.length === 0 ? <Text style={styles.muted}>No agent tasks</Text> : null}
|
|
349
369
|
{agentTasks.map((group) => (
|
|
350
370
|
<TaskGroup key={group.agentId} group={group} name={name} styles={styles} />
|