paseo-office 0.2.0 → 0.2.2

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 (143) 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 +212 -83
  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/tracker-connections.tsx +252 -0
  73. package/client/transcript-styles.ts +90 -0
  74. package/client/use-device-switch.ts +21 -12
  75. package/client/use-duty-actions.ts +43 -0
  76. package/client/use-group-photo.ts +48 -0
  77. package/client/use-new-agent.ts +4 -0
  78. package/client/use-street.ts +8 -0
  79. package/client/workspace-office-tools.tsx +102 -0
  80. package/client/workspace-overlay-route.web.ts +47 -0
  81. package/client/workspace-overlay.tsx +195 -0
  82. package/client/world/adapter.ts +37 -2
  83. package/client/world/escape.ts +58 -0
  84. package/client/world/use-world-feed.ts +6 -2
  85. package/client/world/workspace-dock.ts +6 -0
  86. package/client/world/world-api.ts +45 -4
  87. package/client/world/world-bridge-page.ts +14 -3
  88. package/client/world/world-bridge.ts +50 -5
  89. package/client/world/world-frame.web.ts +8 -0
  90. package/client/world/world-view-native.tsx +31 -10
  91. package/client/world/world-view-shared.ts +36 -7
  92. package/client/world/world-view.tsx +93 -21
  93. package/docs/office.md +165 -64
  94. package/index.client.tsx +13 -6
  95. package/index.server.ts +232 -16
  96. package/package.json +2 -1
  97. package/server/activity.ts +42 -19
  98. package/server/agent-tools.ts +11 -5
  99. package/server/board-service.ts +381 -10
  100. package/server/brand-logo.ts +34 -0
  101. package/server/chat-group.ts +83 -0
  102. package/server/chat-service.ts +406 -62
  103. package/server/chat-store.ts +1 -4
  104. package/server/directory.ts +22 -7
  105. package/server/duty-service.ts +230 -0
  106. package/server/group-photo.ts +39 -0
  107. package/server/home-departure.ts +47 -0
  108. package/server/hub.ts +43 -1
  109. package/server/incidents-jira.ts +19 -7
  110. package/server/incidents-schedule.ts +10 -10
  111. package/server/incidents-sentry.ts +34 -8
  112. package/server/live-ports.ts +114 -18
  113. package/server/lobby-pickup.ts +170 -0
  114. package/server/machine/details.ts +91 -0
  115. package/server/mention-queue.ts +14 -0
  116. package/server/office.ts +110 -6
  117. package/server/paths.ts +14 -0
  118. package/server/ssh/LICENSE.paseo +211 -0
  119. package/server/ssh/client.ts +401 -0
  120. package/server/ssh/discovery.ts +230 -0
  121. package/server/ssh/installed.ts +104 -0
  122. package/server/ssh/monitor.ts +104 -0
  123. package/server/ssh/pid-files.ts +194 -0
  124. package/server/ssh/read.ts +136 -0
  125. package/server/subagent-names.ts +4 -0
  126. package/server/tracker-credentials.ts +141 -0
  127. package/server/words.generated.ts +1 -1
  128. package/server/world.generated.ts +1 -1
  129. package/shared/appearance.ts +43 -0
  130. package/shared/branding.ts +53 -0
  131. package/shared/chat-words.ts +2 -2
  132. package/shared/contracts.ts +199 -5
  133. package/shared/duties.ts +100 -0
  134. package/shared/host-details.ts +25 -0
  135. package/shared/lobby-assignment.ts +34 -0
  136. package/shared/model.ts +9 -1
  137. package/shared/names.ts +2 -0
  138. package/shared/settings.ts +14 -3
  139. package/shared/ssh.ts +34 -0
  140. package/shared/upstream/README.md +1 -3
  141. package/shared/upstream/chat-engine.d.ts +4 -0
  142. package/shared/upstream/prompt-coach.d.ts +6 -0
  143. package/shared/upstream/prompt-coach.js +178 -0
@@ -0,0 +1,321 @@
1
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
2
+ import { Pressable, Text, View } from "react-native";
3
+ import { Icon, TextInput } from "@getpaseo/plugin/client/ui";
4
+ import type { Duty } from "../shared/contracts.js";
5
+ import {
6
+ DUTY_INSTRUCTIONS_MAX,
7
+ DUTY_MAX,
8
+ DUTY_NAME_MAX,
9
+ dutyListProblem,
10
+ type DutyDraft,
11
+ type DutyRow,
12
+ } from "../shared/duties.js";
13
+ import { ActionButton } from "./action-button.js";
14
+ import { dutyRowTitle, dutyStateText } from "./duty-text.js";
15
+ import { DAY_NAMES } from "./notes-days.js";
16
+ import { OfficeModal as Modal } from "./office-modal.js";
17
+ import { SegmentPill } from "./segment-pill.js";
18
+ import type { OfficeStyles } from "./styles.js";
19
+ import type { DutyActions } from "./use-duty-actions.js";
20
+
21
+ const WEEKDAYS = [1, 2, 3, 4, 5];
22
+ const HINT =
23
+ "A duty without instructions is pretend: the 3D office acts it out and no agent is asked. One with instructions goes to an idle agent on each of its days, from 08:00 in the notes' time zone.";
24
+
25
+ /** A duty as the editor holds it: `key` tells the rows apart, a new duty having no id yet. */
26
+ interface Draft extends DutyDraft {
27
+ key: string;
28
+ days: number[];
29
+ }
30
+
31
+ function draftsOf(list: readonly Duty[]): Draft[] {
32
+ return list.map((duty) => ({
33
+ key: duty.id,
34
+ id: duty.id,
35
+ name: duty.name,
36
+ instructions: duty.instructions,
37
+ days: [...duty.days],
38
+ }));
39
+ }
40
+
41
+ /** What a save sends: a listed duty with its id, a new one without. */
42
+ function sent({ id, name, instructions, days }: Draft): DutyDraft {
43
+ return id === undefined ? { name, instructions, days } : { id, name, instructions, days };
44
+ }
45
+
46
+ interface TodayRowProps {
47
+ row: DutyRow;
48
+ name(author: string): string;
49
+ actions: DutyActions;
50
+ styles: OfficeStyles;
51
+ }
52
+
53
+ /**
54
+ * A duty due today, who has it, and the owner's hand: Mark done until it is done, and Reopen once
55
+ * someone has it or it is done, so a duty held by an agent that has gone is not stuck.
56
+ */
57
+ function TodayRow({ row, name, actions, styles }: TodayRowProps) {
58
+ const title = dutyRowTitle(row);
59
+ const done = row.post.state === "done";
60
+ const held = done || row.post.state === "claimed";
61
+ const { id } = row.post;
62
+ const reopen = useCallback(() => actions.reopen(id), [actions, id]);
63
+ const markDone = useCallback(() => actions.markDone(id), [actions, id]);
64
+ return (
65
+ <View style={styles.dutyCard}>
66
+ <View style={styles.post}>
67
+ <Text style={done ? styles.todoTextDone : styles.rowTitle}>{title}</Text>
68
+ <Text style={styles.postMeta}>{dutyStateText(row, name)}</Text>
69
+ </View>
70
+ <View style={styles.actions}>
71
+ {held ? (
72
+ <ActionButton
73
+ label="Reopen"
74
+ name={`Reopen ${title}`}
75
+ pendingLabel="Saving..."
76
+ onPress={reopen}
77
+ styles={styles}
78
+ />
79
+ ) : null}
80
+ {done ? null : (
81
+ <ActionButton
82
+ label="Mark done"
83
+ name={`Mark ${title} done`}
84
+ pendingLabel="Saving..."
85
+ onPress={markDone}
86
+ styles={styles}
87
+ />
88
+ )}
89
+ </View>
90
+ </View>
91
+ );
92
+ }
93
+
94
+ interface DutyDaysProps {
95
+ label: string;
96
+ days: readonly number[];
97
+ onToggle(day: number): void;
98
+ styles: OfficeStyles;
99
+ }
100
+
101
+ /** The days a duty is due, Sunday to Saturday, as the stand-up days are chosen. */
102
+ function DutyDays({ label, days, onToggle, styles }: DutyDaysProps) {
103
+ return (
104
+ <View role="group" aria-label={label} style={styles.notesDays}>
105
+ {DAY_NAMES.map((dayName, day) => (
106
+ <SegmentPill
107
+ key={dayName}
108
+ value={day}
109
+ name={dayName}
110
+ text={dayName.slice(0, 3)}
111
+ on={days.includes(day)}
112
+ disabled={false}
113
+ onPress={onToggle}
114
+ styles={styles}
115
+ />
116
+ ))}
117
+ </View>
118
+ );
119
+ }
120
+
121
+ interface DutyFieldsProps {
122
+ index: number;
123
+ draft: Draft;
124
+ onChange(key: string, patch: Partial<Draft>): void;
125
+ onRemove(key: string): void;
126
+ styles: OfficeStyles;
127
+ }
128
+
129
+ /** One duty of the list: its name, its instructions for an agent, its days, and Remove. */
130
+ function DutyFields({ index, draft, onChange, onRemove, styles }: DutyFieldsProps) {
131
+ const { key, days } = draft;
132
+ const n = index + 1;
133
+ const setName = useCallback((name: string) => onChange(key, { name }), [onChange, key]);
134
+ const setInstructions = useCallback(
135
+ (instructions: string) => onChange(key, { instructions }),
136
+ [onChange, key],
137
+ );
138
+ const toggle = useCallback(
139
+ (day: number) =>
140
+ onChange(key, {
141
+ days: days.includes(day)
142
+ ? days.filter((other) => other !== day)
143
+ : [...days, day].sort((a, b) => a - b),
144
+ }),
145
+ [onChange, key, days],
146
+ );
147
+ const remove = useCallback(() => onRemove(key), [onRemove, key]);
148
+ return (
149
+ <View style={styles.dutyCard}>
150
+ <View style={styles.lobbyTaskLine}>
151
+ <View style={styles.rowBody}>
152
+ <TextInput
153
+ accessibilityLabel={`Duty ${n} name`}
154
+ value={draft.name}
155
+ onChangeText={setName}
156
+ placeholder="Name"
157
+ placeholderTextColor={styles.placeholderColor}
158
+ maxLength={DUTY_NAME_MAX}
159
+ style={styles.fieldInput}
160
+ />
161
+ </View>
162
+ <Pressable
163
+ accessibilityRole="button"
164
+ accessibilityLabel={`Remove ${draft.name.trim() || `duty ${n}`}`}
165
+ onPress={remove}
166
+ style={styles.lobbyDelete}
167
+ >
168
+ <Icon name="Trash2" size={16} color={styles.iconColor} />
169
+ </Pressable>
170
+ </View>
171
+ <TextInput
172
+ accessibilityLabel={`Duty ${n} instructions`}
173
+ value={draft.instructions}
174
+ onChangeText={setInstructions}
175
+ placeholder="Instructions for an agent (none: a pretend duty)"
176
+ placeholderTextColor={styles.placeholderColor}
177
+ maxLength={DUTY_INSTRUCTIONS_MAX}
178
+ multiline
179
+ style={styles.input}
180
+ />
181
+ <DutyDays label={`Duty ${n} days`} days={days} onToggle={toggle} styles={styles} />
182
+ </View>
183
+ );
184
+ }
185
+
186
+ interface DutyListProps {
187
+ list: readonly Duty[];
188
+ actions: DutyActions;
189
+ styles: OfficeStyles;
190
+ }
191
+
192
+ /** The list as the owner edits it, saved whole; until an edit it is the host's list. */
193
+ function DutyList({ list, actions, styles }: DutyListProps) {
194
+ const [drafts, setDrafts] = useState<Draft[] | null>(null);
195
+ const shown = useMemo(() => drafts ?? draftsOf(list), [drafts, list]);
196
+ const added = useRef(0);
197
+ const mounted = useRef(true);
198
+ useEffect(() => {
199
+ mounted.current = true;
200
+ return () => {
201
+ mounted.current = false;
202
+ };
203
+ }, []);
204
+ const edit = useCallback(
205
+ (next: (current: Draft[]) => Draft[]) =>
206
+ setDrafts((current) => next(current ?? draftsOf(list))),
207
+ [list],
208
+ );
209
+ const change = useCallback(
210
+ (key: string, patch: Partial<Draft>) =>
211
+ edit((current) =>
212
+ current.map((draft) => (draft.key === key ? { ...draft, ...patch } : draft)),
213
+ ),
214
+ [edit],
215
+ );
216
+ const remove = useCallback(
217
+ (key: string) => edit((current) => current.filter((draft) => draft.key !== key)),
218
+ [edit],
219
+ );
220
+ const add = useCallback(() => {
221
+ added.current += 1;
222
+ const key = `new-${added.current}`;
223
+ edit((current) => [...current, { key, name: "", instructions: "", days: [...WEEKDAYS] }]);
224
+ }, [edit]);
225
+ const save = useCallback(async () => {
226
+ const duties = shown.map(sent);
227
+ const problem = dutyListProblem(duties);
228
+ if (problem !== null) throw new Error(problem);
229
+ await actions.save(duties);
230
+ // Saved: the host's list, with the new duties' ids, is what shows from now.
231
+ if (mounted.current) setDrafts(null);
232
+ }, [shown, actions]);
233
+ return (
234
+ <View style={styles.lobbySection}>
235
+ <Text accessibilityRole="header" style={styles.lobbyHeading}>
236
+ Duties
237
+ </Text>
238
+ <Text style={styles.fieldHint}>{HINT}</Text>
239
+ {shown.map((draft, index) => (
240
+ <DutyFields
241
+ key={draft.key}
242
+ index={index}
243
+ draft={draft}
244
+ onChange={change}
245
+ onRemove={remove}
246
+ styles={styles}
247
+ />
248
+ ))}
249
+ <View style={styles.actions}>
250
+ <ActionButton
251
+ label="Add duty"
252
+ name="Add a duty"
253
+ pendingLabel="Adding..."
254
+ onPress={add}
255
+ disabled={shown.length >= DUTY_MAX}
256
+ styles={styles}
257
+ />
258
+ <ActionButton
259
+ label="Save"
260
+ name="Save duties"
261
+ pendingLabel="Saving..."
262
+ onPress={save}
263
+ disabled={drafts === null}
264
+ styles={styles}
265
+ primary
266
+ />
267
+ </View>
268
+ </View>
269
+ );
270
+ }
271
+
272
+ export interface DutySheetProps {
273
+ open: boolean;
274
+ /** The duty list; null until the host has sent it. */
275
+ list: readonly Duty[] | null;
276
+ /** The day's duties: today's posts and the owed ones. */
277
+ rows: readonly DutyRow[];
278
+ name(author: string): string;
279
+ actions: DutyActions;
280
+ styles: OfficeStyles;
281
+ onClose(): void;
282
+ }
283
+
284
+ /**
285
+ * The duty board: today's duties with who has each, and the list the host posts them from. A
286
+ * duty with instructions goes to an idle agent; one without is acted out in the 3D office.
287
+ */
288
+ export function DutySheet({ open, list, rows, name, actions, styles, onClose }: DutySheetProps) {
289
+ const change = useCallback(
290
+ (next: boolean) => {
291
+ if (!next) onClose();
292
+ },
293
+ [onClose],
294
+ );
295
+ const icon = useMemo(
296
+ () => <Icon name="ClipboardCheck" size={18} color={styles.iconColor} />,
297
+ [styles.iconColor],
298
+ );
299
+ return (
300
+ <Modal title="Duty board" icon={icon} open={open} onOpenChange={change}>
301
+ <Modal.Content>
302
+ <View style={styles.sheet}>
303
+ <View style={styles.lobbySection}>
304
+ <Text accessibilityRole="header" style={styles.lobbyHeading}>
305
+ Today
306
+ </Text>
307
+ {rows.length === 0 ? <Text style={styles.muted}>No duty is due today.</Text> : null}
308
+ {rows.map((row) => (
309
+ <TodayRow key={row.post.id} row={row} name={name} actions={actions} styles={styles} />
310
+ ))}
311
+ </View>
312
+ {list === null ? (
313
+ <Text style={styles.muted}>Loading the duty list...</Text>
314
+ ) : (
315
+ <DutyList list={list} actions={actions} styles={styles} />
316
+ )}
317
+ </View>
318
+ </Modal.Content>
319
+ </Modal>
320
+ );
321
+ }
@@ -0,0 +1,20 @@
1
+ import type { DutyRow } from "../shared/duties.js";
2
+
3
+ /** What the duty board calls a row: its duty's name, or the post's first line once it is gone. */
4
+ export function dutyRowTitle(row: DutyRow): string {
5
+ return row.duty?.name ?? row.post.text.split("\n")[0] ?? row.post.id;
6
+ }
7
+
8
+ function stateOf(row: DutyRow, name: (author: string) => string): string {
9
+ const { post } = row;
10
+ if (post.state === "done") return post.claimedBy ? `Done by ${name(post.claimedBy)}` : "Done";
11
+ if (post.state === "claimed" && post.claimedBy) return `${name(post.claimedBy)} has it`;
12
+ const pretend = (row.duty?.instructions.trim() ?? "") === "";
13
+ return pretend ? "Open: the 3D office acts it out" : "Open: the next idle agent gets it";
14
+ }
15
+
16
+ /** Who has a duty today, or who will: an owed one says the day it was due. */
17
+ export function dutyStateText(row: DutyRow, name: (author: string) => string): string {
18
+ const state = stateOf(row, name);
19
+ return row.owed ? `Owed from ${row.post.duty?.day ?? "an earlier day"}. ${state}` : state;
20
+ }
@@ -1,3 +1,5 @@
1
+ import { OfficeMark } from "./office-mark.js";
2
+ import { useOfficeBrand } from "./office-brand-context.js";
1
3
  import { useCallback, useState, type ReactNode } from "react";
2
4
  import { Pressable, Text, View, type PressableStateCallbackType } from "react-native";
3
5
  import { Icon } from "@getpaseo/plugin/client/ui";
@@ -6,6 +8,7 @@ import type { ColumnState } from "./use-column.js";
6
8
  import type { OfficeStyles } from "./styles.js";
7
9
 
8
10
  export interface SidebarControls {
11
+ sessionsAvailable: boolean;
9
12
  sessionsOpen: boolean;
10
13
  column: ColumnState;
11
14
  hideSessions(hidden: boolean): void;
@@ -53,6 +56,7 @@ interface FullscreenHeaderProps {
53
56
  badges: ColumnBadges;
54
57
  sidebars: SidebarControls;
55
58
  modes: ReactNode;
59
+ onOffice(): void;
56
60
  children: ReactNode;
57
61
  color: string;
58
62
  styles: OfficeStyles;
@@ -63,10 +67,12 @@ export function FullscreenHeader({
63
67
  sidebars,
64
68
  badges,
65
69
  modes,
70
+ onOffice,
66
71
  children,
67
72
  color,
68
73
  styles,
69
74
  }: FullscreenHeaderProps) {
75
+ const brand = useOfficeBrand();
70
76
  const { sessionsOpen, hideSessions, column } = sidebars;
71
77
  const { collapsed, setCollapsed } = column;
72
78
  const sessions = useCallback(() => hideSessions(sessionsOpen), [hideSessions, sessionsOpen]);
@@ -74,21 +80,30 @@ export function FullscreenHeader({
74
80
  return (
75
81
  <View style={styles.fullscreenHeader}>
76
82
  <View style={styles.headerTools}>
77
- <View style={styles.headerBrand}>
78
- <Icon name="Building2" size={20} color={styles.brandIcon.color} />
79
- <Text style={styles.brandText}>Office 3D</Text>
80
- </View>
81
- <View style={styles.headerModes}>{modes}</View>
83
+ <Pressable
84
+ accessibilityRole="button"
85
+ accessibilityLabel={brand.name ?? "Office 3D"}
86
+ onPress={onOffice}
87
+ style={styles.headerBrand}
88
+ >
89
+ <OfficeMark brand={brand} fallbackColor={styles.brandIcon.color} />
90
+ <Text numberOfLines={1} style={styles.brandText}>
91
+ {brand.name ?? "Office 3D"}
92
+ </Text>
93
+ </Pressable>
94
+ {sidebars.sessionsAvailable && (
95
+ <SidebarButton
96
+ name="Sessions"
97
+ icon={sessionsOpen ? "PanelLeftClose" : "PanelLeftOpen"}
98
+ expanded={sessionsOpen}
99
+ toggle={sessions}
100
+ color={color}
101
+ styles={styles}
102
+ />
103
+ )}
82
104
  </View>
83
105
  <View style={styles.headerTools}>
84
- <SidebarButton
85
- name="Sessions"
86
- icon={sessionsOpen ? "PanelLeftClose" : "PanelLeftOpen"}
87
- expanded={sessionsOpen}
88
- toggle={sessions}
89
- color={color}
90
- styles={styles}
91
- />
106
+ <View style={styles.headerModes}>{modes}</View>
92
107
  {collapsed && (
93
108
  <ColumnTabs
94
109
  hideSessions
@@ -0,0 +1,38 @@
1
+ import type { PluginTheme } from "@getpaseo/plugin";
2
+ import { isDarkTheme } from "./world/adapter.js";
3
+
4
+ // The fullscreen shell uses the surfaces, ink and status colors of my-office's styles/base.css.
5
+ const night: PluginTheme = {
6
+ colors: {
7
+ surface0: "#131922",
8
+ surface1: "#18202B",
9
+ surface2: "#263040",
10
+ border: "#323C4A",
11
+ foreground: "#E8ECF4",
12
+ foregroundMuted: "#A2AEC1",
13
+ accent: "#EF8A5F",
14
+ accentForeground: "#2A1307",
15
+ statusSuccess: "#3DDC84",
16
+ statusWarning: "#F2B544",
17
+ statusDanger: "#FF7171",
18
+ },
19
+ };
20
+ const day: PluginTheme = {
21
+ colors: {
22
+ surface0: "#F7F8FA",
23
+ surface1: "#FFFFFF",
24
+ surface2: "#E6EBF2",
25
+ border: "#C8D0DC",
26
+ foreground: "#152338",
27
+ foregroundMuted: "#506176",
28
+ accent: "#A9411E",
29
+ accentForeground: "#FFFFFF",
30
+ statusSuccess: "#147241",
31
+ statusWarning: "#875900",
32
+ statusDanger: "#B13236",
33
+ },
34
+ };
35
+ export function fullscreenTheme(host: PluginTheme, integrated: boolean) {
36
+ if (!integrated) return host;
37
+ return isDarkTheme(host.colors) ? night : day;
38
+ }