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.
Files changed (138) hide show
  1. package/OVERVIEW.md +27 -0
  2. package/README.md +65 -134
  3. package/client/action-button.tsx +4 -1
  4. package/client/activity-panel.tsx +6 -4
  5. package/client/agent-appearance.tsx +257 -0
  6. package/client/agent-card.tsx +2 -1
  7. package/client/agent-picker-text.ts +23 -4
  8. package/client/agent-picker.tsx +5 -8
  9. package/client/board-sheet.tsx +48 -16
  10. package/client/board-text.ts +12 -2
  11. package/client/brand.ts +1 -0
  12. package/client/chat-chrome.tsx +318 -0
  13. package/client/chat-compose-tools.tsx +314 -0
  14. package/client/chat-dictation.tsx +133 -0
  15. package/client/chat-more.tsx +119 -0
  16. package/client/chat-panel.tsx +401 -146
  17. package/client/chat-quick.tsx +198 -0
  18. package/client/chat-text.ts +25 -6
  19. package/client/column-sheet.tsx +93 -23
  20. package/client/conversation-model.ts +19 -5
  21. package/client/duty-sheet.tsx +321 -0
  22. package/client/duty-text.ts +20 -0
  23. package/client/fullscreen-header.tsx +28 -13
  24. package/client/fullscreen-theme.ts +38 -0
  25. package/client/host-details.tsx +269 -0
  26. package/client/host-styles.ts +129 -0
  27. package/client/host-switches.tsx +197 -73
  28. package/client/incidents-card.tsx +2 -1
  29. package/client/janitor-card.tsx +1 -1
  30. package/client/library-card.tsx +2 -1
  31. package/client/list-text.ts +8 -6
  32. package/client/lobby-board.tsx +73 -53
  33. package/client/machine-card.tsx +225 -85
  34. package/client/messenger-styles.ts +216 -0
  35. package/client/new-agent-form.tsx +153 -61
  36. package/client/new-agent-model.ts +2 -0
  37. package/client/notes-card.tsx +111 -83
  38. package/client/notes-days.tsx +1 -1
  39. package/client/office-brand-context.ts +44 -0
  40. package/client/office-column.tsx +2 -1
  41. package/client/office-keyboard.ts +79 -0
  42. package/client/office-link.ts +7 -1
  43. package/client/office-mark.tsx +29 -0
  44. package/client/office-modal.tsx +440 -0
  45. package/client/office-settings.tsx +75 -30
  46. package/client/office-state.ts +12 -2
  47. package/client/office-surface.tsx +591 -81
  48. package/client/pixel/actors.ts +2 -1
  49. package/client/pixel/art.ts +33 -19
  50. package/client/pixel/pixel-office.tsx +2 -2
  51. package/client/prompt-coach.tsx +152 -0
  52. package/client/qa-card.tsx +2 -1
  53. package/client/review-card.tsx +2 -1
  54. package/client/room-board.tsx +26 -2
  55. package/client/scene-picker.tsx +158 -0
  56. package/client/scene-previews.ts +10 -0
  57. package/client/session-pane.tsx +25 -5
  58. package/client/session-panel-detail.tsx +238 -0
  59. package/client/session-panel.tsx +222 -137
  60. package/client/session-styles.ts +224 -1
  61. package/client/session-transcript.tsx +243 -0
  62. package/client/sessions-panel.tsx +181 -22
  63. package/client/sessions-text.ts +18 -0
  64. package/client/settings-sections.tsx +126 -0
  65. package/client/sidebar-launcher.ts +29 -0
  66. package/client/ssh-hosts.tsx +331 -0
  67. package/client/ssh-metrics.ts +76 -0
  68. package/client/standup-card.tsx +2 -1
  69. package/client/structure-view.tsx +20 -3
  70. package/client/styles.ts +170 -62
  71. package/client/team-chat-preview.tsx +96 -0
  72. package/client/transcript-styles.ts +90 -0
  73. package/client/use-device-switch.ts +21 -12
  74. package/client/use-duty-actions.ts +43 -0
  75. package/client/use-group-photo.ts +48 -0
  76. package/client/use-new-agent.ts +4 -0
  77. package/client/use-street.ts +8 -0
  78. package/client/workspace-office-tools.tsx +102 -0
  79. package/client/workspace-overlay-route.web.ts +47 -0
  80. package/client/workspace-overlay.tsx +195 -0
  81. package/client/world/adapter.ts +37 -2
  82. package/client/world/escape.ts +58 -0
  83. package/client/world/use-world-feed.ts +6 -2
  84. package/client/world/workspace-dock.ts +6 -0
  85. package/client/world/world-api.ts +45 -4
  86. package/client/world/world-bridge-page.ts +14 -3
  87. package/client/world/world-bridge.ts +50 -5
  88. package/client/world/world-frame.web.ts +8 -0
  89. package/client/world/world-view-native.tsx +31 -10
  90. package/client/world/world-view-shared.ts +36 -7
  91. package/client/world/world-view.tsx +93 -21
  92. package/docs/office.md +148 -58
  93. package/index.client.tsx +13 -6
  94. package/index.server.ts +125 -9
  95. package/package.json +2 -1
  96. package/server/activity.ts +42 -19
  97. package/server/agent-tools.ts +11 -5
  98. package/server/board-service.ts +381 -10
  99. package/server/brand-logo.ts +34 -0
  100. package/server/chat-group.ts +83 -0
  101. package/server/chat-service.ts +406 -62
  102. package/server/chat-store.ts +1 -4
  103. package/server/directory.ts +22 -7
  104. package/server/duty-service.ts +230 -0
  105. package/server/group-photo.ts +39 -0
  106. package/server/home-departure.ts +47 -0
  107. package/server/hub.ts +43 -1
  108. package/server/live-ports.ts +114 -18
  109. package/server/lobby-pickup.ts +170 -0
  110. package/server/machine/details.ts +91 -0
  111. package/server/mention-queue.ts +14 -0
  112. package/server/office.ts +110 -6
  113. package/server/paths.ts +9 -0
  114. package/server/ssh/LICENSE.paseo +211 -0
  115. package/server/ssh/client.ts +401 -0
  116. package/server/ssh/discovery.ts +230 -0
  117. package/server/ssh/installed.ts +104 -0
  118. package/server/ssh/monitor.ts +104 -0
  119. package/server/ssh/pid-files.ts +194 -0
  120. package/server/ssh/read.ts +136 -0
  121. package/server/subagent-names.ts +4 -0
  122. package/server/words.generated.ts +1 -1
  123. package/server/world.generated.ts +1 -1
  124. package/shared/appearance.ts +43 -0
  125. package/shared/branding.ts +53 -0
  126. package/shared/chat-words.ts +2 -2
  127. package/shared/contracts.ts +135 -4
  128. package/shared/duties.ts +100 -0
  129. package/shared/host-details.ts +25 -0
  130. package/shared/lobby-assignment.ts +34 -0
  131. package/shared/model.ts +9 -1
  132. package/shared/names.ts +2 -0
  133. package/shared/settings.ts +14 -3
  134. package/shared/ssh.ts +34 -0
  135. package/shared/upstream/README.md +1 -3
  136. package/shared/upstream/chat-engine.d.ts +4 -0
  137. package/shared/upstream/prompt-coach.d.ts +6 -0
  138. package/shared/upstream/prompt-coach.js +178 -0
package/client/styles.ts CHANGED
@@ -1,4 +1,7 @@
1
+ import { transcriptStyles } from "./transcript-styles.js";
2
+ import { hostStyles } from "./host-styles.js";
1
3
  import { sessionStyles } from "./session-styles.js";
4
+ import { messengerStyles } from "./messenger-styles.js";
2
5
  import { useMemo } from "react";
3
6
  import { Platform, type TextStyle, type ViewStyle } from "react-native";
4
7
  import type { PluginTheme } from "@getpaseo/plugin";
@@ -11,9 +14,14 @@ const MONOSPACE = Platform.select({ ios: "Menlo", default: "monospace" });
11
14
  export const SESSION_RAIL_MIN = 264;
12
15
 
13
16
  export interface OfficeStyles {
17
+ host: ReturnType<typeof hostStyles>;
14
18
  sessions: ReturnType<typeof sessionStyles>;
19
+ transcript: ReturnType<typeof transcriptStyles>;
20
+ messenger: ReturnType<typeof messengerStyles>;
15
21
  fullscreenHeader: ViewStyle;
16
22
  headerTools: ViewStyle;
23
+ workspaceAction: ViewStyle;
24
+ workspaceAccent: string;
17
25
  headerBrand: ViewStyle;
18
26
  brandText: TextStyle;
19
27
  brandIcon: { color: string };
@@ -59,13 +67,8 @@ export interface OfficeStyles {
59
67
  columnTabsScroll: ViewStyle;
60
68
  /** An open session's tab: its pill, the button to press, and the close button beside it. */
61
69
  sessionTab: ViewStyle;
62
- /** The session panel: its header, the list of rows, a tool's one line, and the composer. */
63
- sessionHead: ViewStyle;
70
+ /** Reading width and spacing for a session transcript. */
64
71
  sessionList: ViewStyle;
65
- sessionRow: ViewStyle;
66
- sessionRowYou: ViewStyle;
67
- sessionTool: TextStyle;
68
- sessionComposer: ViewStyle;
69
72
  composerWarning: TextStyle;
70
73
  sessionTabMain: ViewStyle;
71
74
  sessionTabClose: ViewStyle;
@@ -81,8 +84,10 @@ export interface OfficeStyles {
81
84
  sheetScrim: ViewStyle;
82
85
  /** The phone's column: a sheet over the lower part of the floor. */
83
86
  columnSheet: ViewStyle;
87
+ sessionSheet: ViewStyle;
84
88
  columnSheetHead: ViewStyle;
85
89
  columnSheetTitle: TextStyle;
90
+ dialogBody: ViewStyle;
86
91
  /** The row of switches: it wraps on a phone, and every line ends on the trailing rail. */
87
92
  headerControls: ViewStyle;
88
93
  /** The switches' failures, one line each, under their row. */
@@ -143,16 +148,12 @@ export interface OfficeStyles {
143
148
  stripReason: Record<AttentionReason, TextStyle>;
144
149
  /** The host's note in the strip, in its tone. */
145
150
  stripNote: Record<HostTone, TextStyle>;
146
- /** The host card: two meters side by side, then groups of agents. */
147
- machineMeters: ViewStyle;
148
- machineMeter: ViewStyle;
149
151
  machineTrack: ViewStyle;
150
152
  /** The empty part of a meter: the plain button's grey, as a layer under the fill. */
151
153
  machineTrackBase: ViewStyle;
152
154
  machineFill: Record<HostTone, ViewStyle>;
153
155
  /** A figure: digits of one width, so a column of them lines up. */
154
156
  machineValue: TextStyle;
155
- machineGroup: ViewStyle;
156
157
  machineRow: ViewStyle;
157
158
  machineRowHead: ViewStyle;
158
159
  machineRowTitle: TextStyle;
@@ -166,6 +167,10 @@ export interface OfficeStyles {
166
167
  standupPeople: ViewStyle;
167
168
  /** The month's notes: the rest of the card's height, scrolled on its own. */
168
169
  notesScroll: ViewStyle;
170
+ notesMonthBar: ViewStyle;
171
+ notesPaper: ViewStyle;
172
+ notesDateStrip: ViewStyle;
173
+ panelHeading: TextStyle;
169
174
  /** The Contents' links to the month's entries, as a list. */
170
175
  notesLinks: ViewStyle;
171
176
  notesLinkRow: ViewStyle;
@@ -254,6 +259,17 @@ export interface OfficeStyles {
254
259
  boardPosts: ViewStyle;
255
260
  /** One post in the sheet with its buttons. */
256
261
  boardPost: ViewStyle;
262
+ lobbyForm: ViewStyle;
263
+ lobbySection: ViewStyle;
264
+ lobbyHeading: TextStyle;
265
+ lobbyRecipient: ViewStyle;
266
+ lobbyTask: ViewStyle;
267
+ lobbyTaskLine: ViewStyle;
268
+ /** A duty of the duty board's editor: a to-do's card with room for its fields. */
269
+ dutyCard: ViewStyle;
270
+ lobbyDelete: ViewStyle;
271
+ lobbyDeleteText: TextStyle;
272
+ lobbyConfirm: ViewStyle;
257
273
  post: ViewStyle;
258
274
  postMeta: TextStyle;
259
275
  postText: TextStyle;
@@ -282,6 +298,9 @@ export interface OfficeStyles {
282
298
  pickerSearch: TextStyle;
283
299
  /** The New agent form, and its list of workspaces: it scrolls inside the form past this height. */
284
300
  newAgentForm: ViewStyle;
301
+ newAgentHeader: ViewStyle;
302
+ newAgentFooter: ViewStyle;
303
+ newAgentSelector: ViewStyle;
285
304
  newAgentWorkspaces: ViewStyle;
286
305
  /** A text setting's field, as the search field. */
287
306
  fieldInput: TextStyle;
@@ -345,10 +364,8 @@ export interface OfficeStyles {
345
364
  chatReactionOn: ViewStyle;
346
365
  /** React, Reply and Recall: on a wide web screen they keep their place while hidden. */
347
366
  chatActions: ViewStyle;
348
- chatActionsHidden: ViewStyle;
349
367
  /** The typing line keeps its height while nobody types, so the list does not move. */
350
368
  chatTyping: TextStyle;
351
- chatBox: ViewStyle;
352
369
  /** The @ list under the box. */
353
370
  chatMentions: ViewStyle;
354
371
  /** The count on the header's Chat button: white on the accent, as a badge is. */
@@ -510,7 +527,9 @@ export function useOfficeStyles(
510
527
  const todoRow: ViewStyle = {
511
528
  flexDirection: "row",
512
529
  alignItems: "flex-start",
513
- gap: 8,
530
+ flex: 1,
531
+ minWidth: 0,
532
+ gap: 10,
514
533
  minHeight: TOUCH_CONTROL,
515
534
  paddingVertical: 12,
516
535
  };
@@ -531,7 +550,7 @@ export function useOfficeStyles(
531
550
  maxWidth: "80%",
532
551
  paddingVertical: 8,
533
552
  paddingHorizontal: 12,
534
- borderRadius: 12,
553
+ borderRadius: 10,
535
554
  borderWidth: 1,
536
555
  borderColor: colors.border,
537
556
  backgroundColor: colors.surface1,
@@ -559,6 +578,20 @@ export function useOfficeStyles(
559
578
  borderColor: colors.border,
560
579
  borderWidth: 1,
561
580
  };
581
+ const columnSheet: ViewStyle = {
582
+ position: "absolute",
583
+ left: 0,
584
+ right: 0,
585
+ bottom: 0,
586
+ height: "75%",
587
+ zIndex: 3,
588
+ borderTopLeftRadius: 12,
589
+ borderTopRightRadius: 12,
590
+ borderTopWidth: 1,
591
+ borderColor: colors.border,
592
+ backgroundColor: colors.surface0,
593
+ overflow: "hidden",
594
+ };
562
595
  return {
563
596
  fullscreenHeader: {
564
597
  ...headerTools,
@@ -571,8 +604,16 @@ export function useOfficeStyles(
571
604
  backgroundColor: colors.surface0,
572
605
  },
573
606
  headerTools,
607
+ workspaceAction: { ...sidebarButton, borderColor: "transparent" },
608
+ workspaceAccent: colors.accent,
574
609
  headerBrand: { ...headerTools, marginRight: 8 },
575
- brandText: { color: colors.foreground, fontSize: 16, fontWeight: "700" },
610
+ brandText: {
611
+ maxWidth: compact ? 100 : 240,
612
+ flexShrink: 1,
613
+ color: colors.foreground,
614
+ fontSize: 16,
615
+ fontWeight: "700",
616
+ },
576
617
  brandIcon: { color: colors.statusWarning },
577
618
  headerModes: {
578
619
  borderWidth: 1,
@@ -688,30 +729,13 @@ export function useOfficeStyles(
688
729
  },
689
730
  columnTabsVertical: { alignItems: "center", gap: 4 },
690
731
  columnTabsScroll: { flexShrink: 1 },
691
- sessionHead: {
732
+ sessionList: {
733
+ width: "100%",
734
+ maxWidth: 880,
735
+ alignSelf: "center",
692
736
  paddingHorizontal: pad,
693
- paddingVertical: 8,
694
- gap: 4,
695
- borderBottomWidth: 1,
696
- borderBottomColor: colors.border,
697
- },
698
- sessionList: { paddingHorizontal: pad, paddingVertical: 12, gap: 8 },
699
- sessionRow: { gap: 2 },
700
- sessionRowYou: {
701
- gap: 2,
702
- alignSelf: "flex-end",
703
- maxWidth: "90%",
704
- padding: 8,
705
- borderRadius: 8,
706
- backgroundColor: colors.surface2,
707
- },
708
- sessionTool: { ...small, fontFamily: MONOSPACE, color: colors.foregroundMuted },
709
- sessionComposer: {
710
- paddingHorizontal: pad,
711
- paddingVertical: 8,
712
- gap: 8,
713
- borderTopWidth: 1,
714
- borderTopColor: colors.border,
737
+ paddingVertical: 16,
738
+ gap: 12,
715
739
  },
716
740
  composerWarning: { ...small, color: colors.statusWarning },
717
741
  sessionTab: {
@@ -757,21 +781,10 @@ export function useOfficeStyles(
757
781
  backgroundColor: colors.surface0,
758
782
  },
759
783
  sheetScrim: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0, zIndex: 2 },
784
+ dialogBody: { padding: compact ? 16 : 22, gap: 16 },
760
785
  // The floor's top quarter stays in view over the sheet, so the office is still there.
761
- columnSheet: {
762
- position: "absolute",
763
- left: 0,
764
- right: 0,
765
- bottom: 0,
766
- height: "75%",
767
- zIndex: 3,
768
- borderTopLeftRadius: 12,
769
- borderTopRightRadius: 12,
770
- borderTopWidth: 1,
771
- borderColor: colors.border,
772
- backgroundColor: colors.surface0,
773
- overflow: "hidden",
774
- },
786
+ columnSheet,
787
+ sessionSheet: { ...columnSheet, height: "92%" },
775
788
  columnSheetHead: {
776
789
  flexDirection: "row",
777
790
  alignItems: "center",
@@ -800,8 +813,7 @@ export function useOfficeStyles(
800
813
  flexDirection: "row",
801
814
  flexWrap: "wrap",
802
815
  columnGap: 16,
803
- rowGap: 12,
804
- paddingHorizontal: pad,
816
+ rowGap: 14,
805
817
  },
806
818
  headerField: { flexGrow: 1, flexBasis: 240, gap: 4 },
807
819
  fieldHint: { ...small, color: colors.foregroundMuted },
@@ -899,8 +911,6 @@ export function useOfficeStyles(
899
911
  warning: { ...small, color: colors.statusWarning },
900
912
  danger: { ...small, color: colors.statusDanger },
901
913
  },
902
- machineMeters: { flexDirection: "row", gap: 16 },
903
- machineMeter: { flex: 1, minWidth: 0, gap: 4 },
904
914
  machineTrack: { height: 4, borderRadius: 2, overflow: "hidden" },
905
915
  machineTrackBase: fill,
906
916
  // As on the Resources screen: grey while all is well, so a colour means something.
@@ -915,7 +925,6 @@ export function useOfficeStyles(
915
925
  color: colors.foreground,
916
926
  fontVariant: ["tabular-nums"],
917
927
  },
918
- machineGroup: { gap: 12 },
919
928
  machineRow: { gap: 8 },
920
929
  machineRowHead: { flexDirection: "row", alignItems: "baseline", gap: 12 },
921
930
  machineRowTitle: { ...base, flex: 1, minWidth: 0, color: colors.foreground },
@@ -934,6 +943,22 @@ export function useOfficeStyles(
934
943
  standupHeading: { ...base, color: colors.foreground, fontWeight: "500" },
935
944
  standupBlocker: { ...base, color: colors.statusWarning },
936
945
  standupPeople: { gap: 6 },
946
+ notesMonthBar: {
947
+ flexDirection: "row",
948
+ alignItems: "center",
949
+ justifyContent: "space-between",
950
+ gap: 12,
951
+ },
952
+ panelHeading: { ...base, color: colors.foreground, fontWeight: "700", fontSize: 19 },
953
+ notesDateStrip: { alignItems: "center", gap: 6, paddingVertical: 4, paddingHorizontal: 2 },
954
+ notesPaper: {
955
+ padding: touch ? 12 : 20,
956
+ backgroundColor: colors.surface1,
957
+ borderColor: colors.border,
958
+ borderWidth: 1,
959
+ borderRadius: 12,
960
+ gap: 8,
961
+ },
937
962
  notesScroll: { flex: 1, minHeight: 0 },
938
963
  notesLinks: { paddingBottom: 8 },
939
964
  notesLinkRow: { alignSelf: "flex-start", paddingVertical: touch ? 8 : 2 },
@@ -1115,12 +1140,65 @@ export function useOfficeStyles(
1115
1140
  // A post and its buttons are one block: closer to each other than to the next post.
1116
1141
  boardPosts: { gap: 16 },
1117
1142
  boardPost: { gap: 8 },
1143
+ lobbyForm: {
1144
+ padding: 12,
1145
+ gap: 6,
1146
+ borderRadius: 12,
1147
+ borderWidth: 1,
1148
+ borderColor: colors.border,
1149
+ backgroundColor: colors.surface1,
1150
+ },
1151
+ lobbyRecipient: {
1152
+ flexDirection: "row",
1153
+ alignItems: "center",
1154
+ alignSelf: "flex-start",
1155
+ maxWidth: "100%",
1156
+ minHeight: controlHeight,
1157
+ borderRadius: 6,
1158
+ paddingHorizontal: 5,
1159
+ gap: 8,
1160
+ overflow: "hidden",
1161
+ },
1162
+ lobbySection: { gap: 6 },
1163
+ lobbyHeading: {
1164
+ ...small,
1165
+ color: colors.foregroundMuted,
1166
+ letterSpacing: 0.7,
1167
+ fontWeight: "700",
1168
+ textTransform: "uppercase",
1169
+ },
1170
+ lobbyTask: {
1171
+ borderRadius: 10,
1172
+ borderWidth: 1,
1173
+ borderColor: colors.border,
1174
+ backgroundColor: colors.surface1,
1175
+ paddingHorizontal: 12,
1176
+ },
1177
+ lobbyTaskLine: { flexDirection: "row", alignItems: "center", gap: 8 },
1178
+ dutyCard: {
1179
+ borderRadius: 10,
1180
+ borderWidth: 1,
1181
+ borderColor: colors.border,
1182
+ backgroundColor: colors.surface1,
1183
+ padding: 12,
1184
+ gap: 8,
1185
+ },
1186
+ lobbyDelete: {
1187
+ minWidth: controlHeight,
1188
+ minHeight: controlHeight,
1189
+ alignItems: "center",
1190
+ justifyContent: "center",
1191
+ borderRadius: 6,
1192
+ paddingHorizontal: 4,
1193
+ },
1194
+ lobbyDeleteText: { ...small, fontWeight: "500", color: colors.foregroundMuted },
1195
+ lobbyConfirm: { borderTopWidth: 1, borderColor: colors.border, paddingVertical: 10, gap: 8 },
1118
1196
  post: { gap: 4, paddingVertical: 4 },
1119
1197
  postMeta: { ...small, color: colors.foregroundMuted },
1120
1198
  postText: { ...base, color: colors.foreground },
1121
1199
  todoRow,
1122
1200
  todoRowDisabled: { ...todoRow, opacity: 0.5 },
1123
- todoTextDone: { ...base, color: colors.foregroundMuted },
1201
+ todoTextDone: { ...base, color: colors.foregroundMuted, textDecorationLine: "line-through" },
1124
1202
  chips: { flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8 },
1125
1203
  // The padding leaves room for a chip's focus ring inside the scroller, and the scroller
1126
1204
  // reaches out by as much, so the chips at rest still stand on the sheet's rails.
@@ -1163,8 +1241,37 @@ export function useOfficeStyles(
1163
1241
  // As wide as the dot even without one, so "Nobody" starts on the agents' rail.
1164
1242
  pickerLead: { width: DOT, height: 20, justifyContent: "center" },
1165
1243
  pickerSearch: lineInput,
1244
+ newAgentHeader: {
1245
+ paddingHorizontal: pad,
1246
+ paddingVertical: 8,
1247
+ flexDirection: "row",
1248
+ alignItems: "center",
1249
+ justifyContent: "space-between",
1250
+ borderBottomWidth: 1,
1251
+ borderBottomColor: colors.border,
1252
+ },
1253
+ newAgentFooter: {
1254
+ paddingHorizontal: pad,
1255
+ paddingVertical: 10,
1256
+ gap: 6,
1257
+ backgroundColor: colors.surface0,
1258
+ borderTopWidth: 1,
1259
+ borderTopColor: colors.border,
1260
+ },
1261
+ newAgentSelector: {
1262
+ minHeight: 40,
1263
+ flexDirection: "row",
1264
+ alignItems: "center",
1265
+ justifyContent: "space-between",
1266
+ paddingHorizontal: 12,
1267
+ gap: 6,
1268
+ borderWidth: 1,
1269
+ borderColor: colors.border,
1270
+ borderRadius: 8,
1271
+ backgroundColor: colors.surface1,
1272
+ },
1166
1273
  newAgentForm: { padding: pad, gap: 16 },
1167
- newAgentWorkspaces: { maxHeight: 240 },
1274
+ newAgentWorkspaces: { maxHeight: 160 },
1168
1275
  fieldInput: lineInput,
1169
1276
  iconColor: colors.foregroundMuted,
1170
1277
  scene: { flex: 1, minHeight: SCENE_MIN_HEIGHT },
@@ -1188,7 +1295,10 @@ export function useOfficeStyles(
1188
1295
  pointerEvents: "none",
1189
1296
  },
1190
1297
  sceneNoteText: { ...small, color: colors.foregroundMuted },
1298
+ host: hostStyles(colors, compact, touch),
1191
1299
  sessions: sessionStyles(colors, touch),
1300
+ transcript: transcriptStyles(colors, touch),
1301
+ messenger: messengerStyles(theme, compact, touch),
1192
1302
  sessionFilter: { flexGrow: 1, paddingHorizontal: 4 },
1193
1303
  activityTop: { paddingHorizontal: pad, paddingTop: pad, paddingBottom: 12, gap: 10 },
1194
1304
  activityHeading: {
@@ -1238,7 +1348,7 @@ export function useOfficeStyles(
1238
1348
  panelCount: { color: colors.foregroundMuted },
1239
1349
  panelFeed: { paddingBottom: 24 },
1240
1350
  panelTime: { ...small, flexShrink: 0, color: colors.foregroundMuted },
1241
- chatList: { paddingHorizontal: pad, paddingVertical: 12, gap: 8 },
1351
+ chatList: { paddingHorizontal: pad, paddingVertical: 14, gap: 12 },
1242
1352
  chatRow,
1243
1353
  chatRowMine: { ...chatRow, justifyContent: "flex-end" },
1244
1354
  chatAvatar: {
@@ -1282,14 +1392,12 @@ export function useOfficeStyles(
1282
1392
  // The segment's chosen fill is a layer of its own, which a style cannot add: the outline.
1283
1393
  chatReactionOn: { ...chatReaction, borderColor: colors.foreground },
1284
1394
  chatActions,
1285
- chatActionsHidden: { ...chatActions, opacity: 0 },
1286
1395
  chatTyping: {
1287
1396
  ...small,
1288
1397
  minHeight: small.lineHeight,
1289
1398
  color: colors.foregroundMuted,
1290
1399
  paddingHorizontal: pad,
1291
1400
  },
1292
- chatBox: { padding: pad, gap: 8, borderTopWidth: 1, borderTopColor: colors.border },
1293
1401
  chatMentions: {
1294
1402
  borderWidth: 1,
1295
1403
  borderColor: colors.border,
@@ -0,0 +1,96 @@
1
+ import { useOfficeBrand } from "./office-brand-context.js";
2
+ import { useEffect, useRef, useState } from "react";
3
+ import { Pressable, Text, View, type TextStyle, type ViewStyle } from "react-native";
4
+ import { Icon } from "@getpaseo/plugin/client/ui";
5
+ import type { ChatMessage, ChatSnapshot } from "../shared/contracts.js";
6
+ import { isYours, shows, STICKERS } from "./chat-text.js";
7
+
8
+ const card: ViewStyle = {
9
+ maxWidth: "100%",
10
+ width: 318,
11
+ minHeight: 56,
12
+ flexDirection: "row",
13
+ gap: 12,
14
+ alignItems: "center",
15
+ borderRadius: 12,
16
+ paddingHorizontal: 14,
17
+ paddingVertical: 9,
18
+ backgroundColor: "#fff",
19
+ borderWidth: 1,
20
+ borderColor: "#cbd4df",
21
+ };
22
+ const compactCard: ViewStyle = { ...card, marginTop: 52, marginRight: 6, maxWidth: "92%" };
23
+ const badge: ViewStyle = {
24
+ width: 34,
25
+ height: 34,
26
+ borderRadius: 17,
27
+ backgroundColor: "#e5f1ff",
28
+ alignItems: "center",
29
+ justifyContent: "center",
30
+ };
31
+ const copy: ViewStyle = { flex: 1, minWidth: 0 };
32
+ const title: TextStyle = { color: "#102647", fontWeight: "700", fontSize: 14 };
33
+ const text: TextStyle = { color: "#526279", fontSize: 13 };
34
+
35
+ function previewText(message: ChatMessage): string {
36
+ if (message.kind === "photo") return "Office photo";
37
+ if (message.kind === "poll") return message.poll?.q ?? "Poll";
38
+ if (message.kind === "remind") return message.remind?.title ?? "Reminder";
39
+ if (message.kind === "sticker") return STICKERS[message.sticker ?? 0] ?? "Sticker";
40
+ return message.text ?? "";
41
+ }
42
+
43
+ /** A newly arrived group message can open the messenger without changing the camera or rail. */
44
+ export function TeamChatPreview({
45
+ chat,
46
+ compact,
47
+ onOpen,
48
+ }: {
49
+ chat: ChatSnapshot | null;
50
+ compact: boolean;
51
+ onOpen(): void;
52
+ }) {
53
+ const brand = useOfficeBrand();
54
+ const newest = chat?.messages.at(-1);
55
+ const id = newest?.id ?? "";
56
+ const last = useRef<string | null>(null);
57
+ const [visible, setVisible] = useState("");
58
+ useEffect(() => {
59
+ const previous = last.current;
60
+ last.current = chat === null ? null : id;
61
+ if (previous !== null && previous !== id) setVisible(id);
62
+ }, [chat, id]);
63
+ useEffect(() => {
64
+ if (!visible) return;
65
+ const timer = setTimeout(() => setVisible(""), 4200);
66
+ return () => clearTimeout(timer);
67
+ }, [visible]);
68
+ if (
69
+ !newest ||
70
+ visible !== id ||
71
+ newest.recalled ||
72
+ isYours(newest) ||
73
+ newest.kind === "sys" ||
74
+ !shows(newest)
75
+ )
76
+ return null;
77
+ const caption = [newest.name, previewText(newest)].filter(Boolean).join(" · ");
78
+ return (
79
+ <Pressable
80
+ accessibilityRole="button"
81
+ accessibilityLabel={`Open team chat: ${caption}`}
82
+ onPress={onOpen}
83
+ style={compact ? compactCard : card}
84
+ >
85
+ <View style={badge}>
86
+ <Icon name="MessagesSquare" size={18} color="#20599a" />
87
+ </View>
88
+ <View style={copy}>
89
+ <Text style={title}>{brand.name ? `${brand.name} team` : "Office team"}</Text>
90
+ <Text numberOfLines={1} style={text}>
91
+ {caption}
92
+ </Text>
93
+ </View>
94
+ </Pressable>
95
+ );
96
+ }
@@ -0,0 +1,90 @@
1
+ import type { PluginTheme } from "@getpaseo/plugin";
2
+ import { Platform, StyleSheet } from "react-native";
3
+
4
+ /** The same reading column in the session drawer and in the larger workspace. */
5
+ export function transcriptStyles(colors: PluginTheme["colors"], touch: boolean) {
6
+ return StyleSheet.create({
7
+ messages: { gap: 16 },
8
+ assistant: { minWidth: 0, gap: 6 },
9
+ speaker: { flexDirection: "row", alignItems: "center", gap: 7 },
10
+ avatar: {
11
+ width: 22,
12
+ height: 22,
13
+ borderRadius: 7,
14
+ alignItems: "center",
15
+ justifyContent: "center",
16
+ borderWidth: 1,
17
+ borderColor: colors.border,
18
+ backgroundColor: colors.surface1,
19
+ },
20
+ initials: { fontSize: 10, fontWeight: "700", color: colors.accent },
21
+ name: { fontSize: 12, lineHeight: 17, fontWeight: "600", color: colors.foregroundMuted },
22
+ outgoing: {
23
+ alignSelf: "flex-end",
24
+ maxWidth: "92%",
25
+ minWidth: 0,
26
+ paddingHorizontal: 13,
27
+ paddingVertical: 9,
28
+ gap: 4,
29
+ borderRadius: 13,
30
+ borderTopRightRadius: 4,
31
+ backgroundColor: colors.surface2,
32
+ },
33
+ text: { color: colors.foreground, fontSize: 14, lineHeight: 21 },
34
+ assignment: {
35
+ minWidth: 0,
36
+ gap: 4,
37
+ paddingHorizontal: 13,
38
+ paddingBottom: 12,
39
+ borderRadius: 10,
40
+ borderWidth: 1,
41
+ borderColor: colors.border,
42
+ backgroundColor: colors.surface1,
43
+ },
44
+ disclosure: {
45
+ flexDirection: "row",
46
+ alignItems: "center",
47
+ gap: 8,
48
+ minHeight: touch ? 44 : 36,
49
+ },
50
+ stepButton: {
51
+ alignSelf: "flex-start",
52
+ maxWidth: "100%",
53
+ flexDirection: "row",
54
+ alignItems: "center",
55
+ gap: 8,
56
+ minHeight: touch ? 44 : 34,
57
+ paddingHorizontal: 10,
58
+ borderRadius: 8,
59
+ borderWidth: 1,
60
+ borderColor: colors.border,
61
+ backgroundColor: colors.surface1,
62
+ },
63
+ pressed: { backgroundColor: colors.surface2 },
64
+ steps: { gap: 4 },
65
+ stepList: { paddingLeft: 12, borderLeftWidth: 1, borderLeftColor: colors.border, gap: 5 },
66
+ code: {
67
+ color: colors.foregroundMuted,
68
+ fontFamily: Platform.select({ ios: "Menlo", default: "monospace" }),
69
+ fontSize: 12,
70
+ lineHeight: 18,
71
+ },
72
+ stepTitle: { color: colors.foreground, flexShrink: 1, fontWeight: "600", fontSize: 12 },
73
+ taskId: {
74
+ color: colors.foregroundMuted,
75
+ flexGrow: 1,
76
+ fontSize: 12,
77
+ fontVariant: ["tabular-nums"],
78
+ },
79
+ raw: { paddingTop: 10, marginTop: 5, borderTopWidth: 1, borderTopColor: colors.border },
80
+ warning: { color: colors.statusWarning },
81
+ danger: { color: colors.statusDanger },
82
+ notice: {
83
+ borderLeftWidth: 2,
84
+ borderLeftColor: colors.border,
85
+ paddingLeft: 10,
86
+ paddingVertical: 3,
87
+ },
88
+ errorNotice: { borderLeftColor: colors.statusDanger },
89
+ });
90
+ }
@@ -1,6 +1,6 @@
1
1
  import { useCallback, useEffect, useRef, useState } from "react";
2
2
  import { useSettings } from "@getpaseo/plugin/client";
3
- import { officeDeviceSettings } from "../shared/settings.js";
3
+ import { officeDeviceSettings, type OfficeScene, type OfficeLighting } from "../shared/settings.js";
4
4
 
5
5
  export interface DeviceSwitch {
6
6
  /** The switch as the person left it (a tap shows at once); null while the device's setting is read or unreadable. */
@@ -11,8 +11,8 @@ export interface DeviceSwitch {
11
11
  }
12
12
 
13
13
  /** A save of the tap against a revision, and whether the store took it. */
14
- interface Tried {
15
- value: boolean;
14
+ interface Tried<Value> {
15
+ value: Value;
16
16
  revision: string;
17
17
  stored: boolean;
18
18
  }
@@ -23,14 +23,22 @@ interface Tried {
23
23
  * tried again on the revision a reload shows; a refusal that moved nothing is not, and the switch
24
24
  * then holds the tap until the next tap or the surface closes (`unsaved`).
25
25
  */
26
- export function useDeviceSwitch(
27
- field: "street" | "sound" | "sessionsHidden",
28
- fallback: boolean,
29
- ): DeviceSwitch {
26
+ interface Preferences {
27
+ street: boolean;
28
+ sound: boolean;
29
+ sessionsHidden: boolean;
30
+ scene: OfficeScene;
31
+ lighting: OfficeLighting;
32
+ }
33
+
34
+ export function useDeviceSwitch<Field extends keyof Preferences>(
35
+ field: Field,
36
+ fallback: Preferences[Field],
37
+ ) {
30
38
  const settings = useSettings(officeDeviceSettings);
31
39
  const stored = settings.status === "ready" ? settings : null;
32
- const [wanted, setWanted] = useState<boolean | null>(null);
33
- const [tried, setTried] = useState<Tried | null>(null);
40
+ const [wanted, setWanted] = useState<Preferences[Field] | null>(null);
41
+ const [tried, setTried] = useState<Tried<Preferences[Field]> | null>(null);
34
42
  const [saving, setSaving] = useState(false);
35
43
  const mounted = useRef(true);
36
44
  useEffect(() => {
@@ -51,7 +59,7 @@ export function useDeviceSwitch(
51
59
  // Waiting for the store to show a save it took, or given up on a refusal: not saved again.
52
60
  if (tried?.value === wanted && tried.revision === revision) return;
53
61
  setSaving(true);
54
- async function keep(value: boolean): Promise<void> {
62
+ async function keep(value: Preferences[Field]): Promise<void> {
55
63
  const ok = await save({ ...values, [field]: value }, revision);
56
64
  if (!ok) await reload().catch(() => undefined);
57
65
  if (!mounted.current) return;
@@ -60,7 +68,7 @@ export function useDeviceSwitch(
60
68
  }
61
69
  void keep(wanted);
62
70
  }, [wanted, stored, saving, tried, save, reload, field]);
63
- const set = useCallback((next: boolean) => {
71
+ const set = useCallback((next: Preferences[Field]) => {
64
72
  setTried(null);
65
73
  setWanted(next);
66
74
  }, []);
@@ -73,7 +81,8 @@ export function useDeviceSwitch(
73
81
  // The floor waits for the street choice before starting. A finished, unreadable
74
82
  // document falls back to the layout default and can still be overridden for this visit.
75
83
  const streetUnreadable =
76
- field === "street" && (settings.status === "error" || settings.status === "invalid");
84
+ (field === "street" || field === "scene" || field === "lighting") &&
85
+ (settings.status === "error" || settings.status === "invalid");
77
86
  const on = wanted ?? stored?.values[field] ?? (stored || streetUnreadable ? fallback : null);
78
87
  return { on, unsaved: unsaved || (wanted !== null && streetUnreadable), set };
79
88
  }