@mcp-b/react-components 0.70.0 → 0.71.0

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 (96) hide show
  1. package/dist/AgentComputer-CpS9R2KG.d.ts +305 -0
  2. package/dist/{AgentComputer-CFJxjMFE.js → AgentComputer-DZCyQkcE.js} +1850 -478
  3. package/dist/CommandPalette-DDctKdpC.d.ts +53 -0
  4. package/dist/ComputerCalendar-Ci7tLASe.js +1360 -0
  5. package/dist/ComputerCustomWallpaper-CnGQYHp0.js +518 -0
  6. package/dist/ComputerCustomWallpaper-D4lgwj2k.d.ts +18 -0
  7. package/dist/ComputerNotifications-q7eeELZ8.d.ts +41 -0
  8. package/dist/ComputerPresentation-BEQKYAjc.js +888 -0
  9. package/dist/{ExecutionResult-C7SzVquo.js → ExecutionResult-CXnGcmM4.js} +1 -1
  10. package/dist/{WorkspaceBrowser-ojoZy0uO.js → WorkspaceBrowser-mRScUczT.js} +5 -5
  11. package/dist/WorkspaceFileTransfer-D2cOoVyO.js +1625 -0
  12. package/dist/{WorkspaceMessageResponse-BoeeltJM.js → WorkspaceMessageResponse-CXGOQgpo.js} +1 -1
  13. package/dist/components/agents-sdk/AgentComputer.d.ts +2 -276
  14. package/dist/components/agents-sdk/AgentComputer.js +1 -1
  15. package/dist/components/agents-sdk/BrowserReplay.js +1 -1
  16. package/dist/components/agents-sdk/ComputerAutomations.d.ts +5 -15
  17. package/dist/components/agents-sdk/ComputerAutomations.js +164 -145
  18. package/dist/components/agents-sdk/ComputerCalendar.d.ts +1 -1
  19. package/dist/components/agents-sdk/ComputerCalendar.js +1 -1344
  20. package/dist/components/agents-sdk/ComputerCustomWallpaper.d.ts +2 -39
  21. package/dist/components/agents-sdk/ComputerCustomWallpaper.js +2 -522
  22. package/dist/components/agents-sdk/ComputerFiles.d.ts +18 -81
  23. package/dist/components/agents-sdk/ComputerFiles.js +365 -89
  24. package/dist/components/agents-sdk/ComputerHome.d.ts +6 -11
  25. package/dist/components/agents-sdk/ComputerHome.js +1 -89
  26. package/dist/components/agents-sdk/ComputerHost.d.ts +43 -0
  27. package/dist/components/agents-sdk/ComputerHost.js +97 -0
  28. package/dist/components/agents-sdk/ComputerLayout.d.ts +1 -1
  29. package/dist/components/agents-sdk/ComputerNotifications.d.ts +2 -54
  30. package/dist/components/agents-sdk/ComputerNotifications.js +1 -668
  31. package/dist/components/agents-sdk/ComputerPresentation.d.ts +2 -0
  32. package/dist/components/agents-sdk/ComputerPresentation.js +2 -0
  33. package/dist/components/agents-sdk/ComputerScreen.d.ts +14 -14
  34. package/dist/components/agents-sdk/ComputerScreen.js +109 -50
  35. package/dist/components/agents-sdk/ComputerSettings.d.ts +12 -40
  36. package/dist/components/agents-sdk/ComputerSettings.js +249 -1038
  37. package/dist/components/agents-sdk/ComputerSpotlight.d.ts +13 -15
  38. package/dist/components/agents-sdk/ComputerSpotlight.js +1 -231
  39. package/dist/components/agents-sdk/ComputerViewer.d.ts +13 -17
  40. package/dist/components/agents-sdk/ComputerViewer.js +176 -187
  41. package/dist/components/agents-sdk/ComputerWallpapers.d.ts +1 -1
  42. package/dist/components/agents-sdk/EmployeeChat.js +2 -2
  43. package/dist/components/agents-sdk/EmployeeChrome.js +3 -3
  44. package/dist/components/agents-sdk/EmployeeSchedules.js +2 -2
  45. package/dist/components/agents-sdk/ExecutionBoard.js +1 -1
  46. package/dist/components/agents-sdk/ManagerOffice.js +1 -1
  47. package/dist/components/agents-sdk/ManagerOfficeScreens.js +2 -2
  48. package/dist/components/agents-sdk/McpPluginCatalog.js +1 -1
  49. package/dist/components/agents-sdk/ThinkChat.js +1 -1
  50. package/dist/components/agents-sdk/ThinkChatToolPanels.js +3 -3
  51. package/dist/components/agents-sdk/ThinkExecutionDetail.js +1 -1
  52. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +2 -2
  53. package/dist/components/agents-sdk/ThinkScheduleActions.js +1 -1
  54. package/dist/components/agents-sdk/ThinkScheduleBrowser.js +1 -1
  55. package/dist/components/agents-sdk/ThinkScheduleDetail.js +4 -4
  56. package/dist/components/agents-sdk/ThinkScheduleForm.js +3 -3
  57. package/dist/components/agents-sdk/WorkspaceAutomation.js +3 -3
  58. package/dist/components/agents-sdk/WorkspaceAutomationTable.js +1 -1
  59. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  60. package/dist/components/agents-sdk/WorkspaceDesktop.d.ts +1 -5
  61. package/dist/components/agents-sdk/WorkspaceDesktop.js +53 -41
  62. package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -3
  63. package/dist/components/agents-sdk/WorkspaceFileCommands.js +1 -924
  64. package/dist/components/agents-sdk/WorkspaceFileDetails.js +1 -1
  65. package/dist/components/agents-sdk/WorkspaceFileTransfer.js +1 -504
  66. package/dist/components/agents-sdk/WorkspaceFileView.js +6 -6
  67. package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
  68. package/dist/components/agents-sdk/WorkspaceLive.d.ts +9 -0
  69. package/dist/components/agents-sdk/WorkspaceLive.js +2 -177
  70. package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
  71. package/dist/components/agents-sdk/WorkspaceMountManager.js +1 -1
  72. package/dist/components/ai-sdk/Context.js +1 -1
  73. package/dist/components/ai-sdk/PromptInput.js +1 -1
  74. package/dist/components/extension/FirstRunSetup.js +2 -2
  75. package/dist/components/foundations/ThemeProvider.d.ts +2 -0
  76. package/dist/components/foundations/ThemeProvider.js +2 -1
  77. package/dist/components/general-purpose/CommandPalette.d.ts +2 -52
  78. package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
  79. package/dist/components/general-purpose/WallpaperPicker.d.ts +33 -2
  80. package/dist/components/nanites/AgentConnection.js +1 -1
  81. package/dist/components/nanites/AgentToolDetail.js +1 -1
  82. package/dist/context-BWJpR084.js +94 -0
  83. package/dist/{parts-CPVz9l31.js → parts-DuT5-rDz.js} +1 -1
  84. package/dist/styles/agent-computer.css +16 -0
  85. package/dist/styles/computer-files.css +5 -0
  86. package/dist/styles/computer-notifications.css +1 -0
  87. package/dist/{workspace-drag-B6hMXUNt.js → workspace-drag-BNhZIN8F.js} +1 -1
  88. package/dist/{workspace-quick-look-DODjsfhH.js → workspace-quick-look-8cbGu1Xf.js} +2 -2
  89. package/package.json +2 -2
  90. package/dist/WallpaperPicker-C-FItmDS.d.ts +0 -34
  91. package/dist/automations-host-DPORjdc7.js +0 -17
  92. package/dist/context-Ddsp8HgD.js +0 -43
  93. package/dist/minute-clock-CXpRGCMF.js +0 -35
  94. package/dist/{Context-DQDumCV8.js → Context-CYUxZrwW.js} +1 -1
  95. package/dist/{ManagerOffice-kSK7vTBl.js → ManagerOffice-BJ2vs-Lr.js} +2 -2
  96. package/dist/{WorkspaceLink-DK9kdMUH.js → WorkspaceLink-DDkj-Tq5.js} +1 -1
@@ -1,835 +1,17 @@
1
1
  import { desktopArtwork } from "../../utils/desktop-artwork.js";
2
- import { A as GlobeIcon, F as LinkIcon, L as LockIcon, N as KeyboardIcon, O as FileIcon, R as MailIcon, V as MessageSquareIcon, W as MonitorIcon, _ as ChromeIcon, d as BrainIcon, et as RefreshIcon, ft as UserIcon, g as ChevronRightIcon, h as ChevronLeftIcon, it as SpinnerIcon, j as GridIcon, k as FolderIcon, mt as WarningIcon, n as ArrowDownIcon, o as ArrowUpIcon, u as BoxIcon, ut as TerminalIcon } from "../../icons-nLTnB9kd.js";
3
- import { Checkbox } from "../foundations/Checkbox.js";
4
- import { Button } from "../foundations/Button.js";
5
- import { IconButton } from "../foundations/IconButton.js";
2
+ import { A as GlobeIcon, F as LinkIcon, L as LockIcon, N as KeyboardIcon, R as MailIcon, V as MessageSquareIcon, W as MonitorIcon, _ as ChromeIcon, ft as UserIcon, j as GridIcon, ut as TerminalIcon } from "../../icons-nLTnB9kd.js";
6
3
  import { AppIcon } from "../foundations/AppIcon.js";
7
- import { Tabs } from "../foundations/Tabs.js";
8
- import { a as useAgentComputerWindow, n as useAgentComputerActions, s as chordLabel } from "../../AgentComputer-CFJxjMFE.js";
4
+ import { a as useAgentComputerWindow, c as COMPUTER_SPOTLIGHT_SHORTCUT, m as chordLabel } from "../../AgentComputer-DZCyQkcE.js";
5
+ import { f as useAppHosts, g as usePresentation, h as useComputerSlice, l as PresentationContext, m as useComputerHost, n as AppHostsContext, r as AppearanceContext } from "../../context-BWJpR084.js";
9
6
  import { COMPUTER_APP_IDS } from "./ComputerAppIds.js";
10
- import { AppTopBar } from "../general-purpose/AppTopBar.js";
11
- import { n as computerAppTile } from "../../parts-CPVz9l31.js";
12
- import { Switch } from "../foundations/Switch.js";
13
- import { ScreenStack } from "../general-purpose/ScreenStack.js";
7
+ import { a as EmployeeWorkspaceRows, c as SettingsToolbar, i as DockSettings, o as SettingsLayout, s as SettingsRow } from "../../ComputerPresentation-BEQKYAjc.js";
14
8
  import { ThemeModeControl } from "../general-purpose/ThemeModeControl.js";
9
+ import { n as computerAppTile } from "../../parts-DuT5-rDz.js";
10
+ import { Switch } from "../foundations/Switch.js";
15
11
  import { WallpaperPicker } from "../general-purpose/WallpaperPicker.js";
16
- import { COMPUTER_SPOTLIGHT_SHORTCUT } from "./ComputerSpotlight.js";
17
12
  import { c } from "react/compiler-runtime";
18
13
  import * as React from "react";
19
- import { useId, useLayoutEffect, useRef } from "react";
20
14
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
21
- import { useQuery } from "@tanstack/react-query";
22
- //#region src/components/_internal/computer-apps/settings.tsx
23
- /**
24
- * Settings uses one Base UI Tabs owner on both platforms. The Mac presents
25
- * those destinations in its familiar rail; the phone puts the same list at
26
- * the root of an iOS navigation stack and pushes the selected pane.
27
- */
28
- function SettingsLayout(t0) {
29
- const $ = c(71);
30
- const { views, view, onViewChange, detailOpen, onDetailOpenChange, phone, panels, footer } = t0;
31
- let t1;
32
- if ($[0] !== view || $[1] !== views) {
33
- let t2;
34
- if ($[3] !== view) {
35
- t2 = (item) => item.value === view;
36
- $[3] = view;
37
- $[4] = t2;
38
- } else t2 = $[4];
39
- t1 = views.find(t2);
40
- $[0] = view;
41
- $[1] = views;
42
- $[2] = t1;
43
- } else t1 = $[2];
44
- const label = t1.label;
45
- const rootRef = useRef(null);
46
- const previousPhone = useRef(phone);
47
- const focusedControl = useRef(null);
48
- let t2;
49
- let t3;
50
- if ($[5] !== detailOpen || $[6] !== phone) {
51
- t2 = () => {
52
- const root = rootRef.current;
53
- const changedLayout = previousPhone.current !== phone;
54
- previousPhone.current = phone;
55
- if (changedLayout && root && focusedControl.current && !focusedControl.current.isConnected && root.ownerDocument.activeElement === root.ownerDocument.body) root.querySelector(phone && detailOpen ? "[data-screen=\"top\"] [data-nav-back]" : "[role=\"tab\"][aria-selected=\"true\"]")?.focus({ preventScroll: true });
56
- };
57
- t3 = [phone, detailOpen];
58
- $[5] = detailOpen;
59
- $[6] = phone;
60
- $[7] = t2;
61
- $[8] = t3;
62
- } else {
63
- t2 = $[7];
64
- t3 = $[8];
65
- }
66
- useLayoutEffect(t2, t3);
67
- let t4;
68
- if ($[9] !== panels || $[10] !== phone || $[11] !== views) {
69
- let t5;
70
- if ($[13] !== panels || $[14] !== phone) {
71
- t5 = (t6) => {
72
- const { value } = t6;
73
- return /* @__PURE__ */ jsx(Tabs.Panel, {
74
- unstyled: phone,
75
- className: "computer-settings__panel",
76
- value,
77
- children: panels[value]
78
- }, value);
79
- };
80
- $[13] = panels;
81
- $[14] = phone;
82
- $[15] = t5;
83
- } else t5 = $[15];
84
- t4 = views.map(t5);
85
- $[9] = panels;
86
- $[10] = phone;
87
- $[11] = views;
88
- $[12] = t4;
89
- } else t4 = $[12];
90
- let t5;
91
- if ($[16] !== t4) {
92
- t5 = /* @__PURE__ */ jsx(Tabs.Panels, { children: t4 });
93
- $[16] = t4;
94
- $[17] = t5;
95
- } else t5 = $[17];
96
- const tabPanels = t5;
97
- const t6 = phone ? "inset-group" : void 0;
98
- let t7;
99
- if ($[18] !== onDetailOpenChange || $[19] !== phone || $[20] !== views) {
100
- let t8;
101
- if ($[22] !== onDetailOpenChange || $[23] !== phone) {
102
- t8 = (t9) => {
103
- const { value: value_0, label: label_0, icon: Icon } = t9;
104
- return /* @__PURE__ */ jsxs(Tabs.Tab, {
105
- unstyled: true,
106
- className: "computer-settings__destination",
107
- value: value_0,
108
- onClick: () => phone && onDetailOpenChange(true),
109
- children: [
110
- /* @__PURE__ */ jsx(Icon, { className: "computer-settings__destination-icon" }),
111
- /* @__PURE__ */ jsx("span", { children: label_0 }),
112
- phone ? /* @__PURE__ */ jsx(ChevronRightIcon, { className: "computer-settings__destination-chevron" }) : null
113
- ]
114
- }, value_0);
115
- };
116
- $[22] = onDetailOpenChange;
117
- $[23] = phone;
118
- $[24] = t8;
119
- } else t8 = $[24];
120
- t7 = views.map(t8);
121
- $[18] = onDetailOpenChange;
122
- $[19] = phone;
123
- $[20] = views;
124
- $[21] = t7;
125
- } else t7 = $[21];
126
- let t8;
127
- if ($[25] !== t6 || $[26] !== t7) {
128
- t8 = /* @__PURE__ */ jsx(Tabs.List, {
129
- unstyled: true,
130
- className: "computer-settings__navigation",
131
- "data-recipe": t6,
132
- "aria-label": "Settings",
133
- children: t7
134
- });
135
- $[25] = t6;
136
- $[26] = t7;
137
- $[27] = t8;
138
- } else t8 = $[27];
139
- const navigation = t8;
140
- let t9;
141
- if ($[28] !== footer) {
142
- t9 = footer ? /* @__PURE__ */ jsx("p", {
143
- className: "computer-settings__storage-status",
144
- role: "status",
145
- children: footer
146
- }) : null;
147
- $[28] = footer;
148
- $[29] = t9;
149
- } else t9 = $[29];
150
- const footerNote = t9;
151
- let t10;
152
- let t11;
153
- if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
154
- t10 = (event) => {
155
- if (event.target instanceof HTMLElement) focusedControl.current = event.target;
156
- };
157
- t11 = (event_0) => {
158
- if (!event_0.currentTarget.contains(event_0.relatedTarget)) focusedControl.current = null;
159
- };
160
- $[30] = t10;
161
- $[31] = t11;
162
- } else {
163
- t10 = $[30];
164
- t11 = $[31];
165
- }
166
- let t12;
167
- if ($[32] !== view) {
168
- t12 = {
169
- ref: rootRef,
170
- unstyled: true,
171
- value: view,
172
- orientation: "vertical",
173
- onFocusCapture: t10,
174
- onBlurCapture: t11
175
- };
176
- $[32] = view;
177
- $[33] = t12;
178
- } else t12 = $[33];
179
- const rootProps = t12;
180
- if (!phone) {
181
- let t13;
182
- if ($[34] !== onViewChange) {
183
- t13 = (next) => onViewChange(next);
184
- $[34] = onViewChange;
185
- $[35] = t13;
186
- } else t13 = $[35];
187
- let t14;
188
- if ($[36] !== navigation) {
189
- t14 = /* @__PURE__ */ jsx("aside", {
190
- className: "computer-settings__sidebar",
191
- children: navigation
192
- });
193
- $[36] = navigation;
194
- $[37] = t14;
195
- } else t14 = $[37];
196
- let t15;
197
- if ($[38] !== footerNote || $[39] !== tabPanels) {
198
- t15 = /* @__PURE__ */ jsxs("div", {
199
- className: "computer-settings__detail",
200
- children: [tabPanels, footerNote]
201
- });
202
- $[38] = footerNote;
203
- $[39] = tabPanels;
204
- $[40] = t15;
205
- } else t15 = $[40];
206
- let t16;
207
- if ($[41] !== rootProps || $[42] !== t13 || $[43] !== t14 || $[44] !== t15) {
208
- t16 = /* @__PURE__ */ jsxs(Tabs.Root, {
209
- ...rootProps,
210
- className: "computer-settings computer-settings--desktop",
211
- onValueChange: t13,
212
- children: [t14, t15]
213
- });
214
- $[41] = rootProps;
215
- $[42] = t13;
216
- $[43] = t14;
217
- $[44] = t15;
218
- $[45] = t16;
219
- } else t16 = $[45];
220
- return t16;
221
- }
222
- let t13;
223
- if ($[46] !== onDetailOpenChange || $[47] !== onViewChange) {
224
- t13 = (next_0) => {
225
- onViewChange(next_0);
226
- onDetailOpenChange(true);
227
- };
228
- $[46] = onDetailOpenChange;
229
- $[47] = onViewChange;
230
- $[48] = t13;
231
- } else t13 = $[48];
232
- let t14;
233
- if ($[49] !== detailOpen || $[50] !== onDetailOpenChange) {
234
- t14 = detailOpen ? () => onDetailOpenChange(false) : void 0;
235
- $[49] = detailOpen;
236
- $[50] = onDetailOpenChange;
237
- $[51] = t14;
238
- } else t14 = $[51];
239
- let t15;
240
- let t16;
241
- if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
242
- t15 = /* @__PURE__ */ jsxs(AppTopBar.Root, {
243
- className: "computer-settings__bar",
244
- "aria-label": "Settings",
245
- "data-nav-bar": "",
246
- children: [
247
- /* @__PURE__ */ jsx(AppTopBar.Leading, {}),
248
- /* @__PURE__ */ jsx(AppTopBar.Title, {
249
- className: "computer-settings__root-title",
250
- children: "Settings"
251
- }),
252
- /* @__PURE__ */ jsx(AppTopBar.Trailing, {})
253
- ]
254
- });
255
- t16 = /* @__PURE__ */ jsx("h1", { children: "Settings" });
256
- $[52] = t15;
257
- $[53] = t16;
258
- } else {
259
- t15 = $[52];
260
- t16 = $[53];
261
- }
262
- let t17;
263
- if ($[54] !== footerNote || $[55] !== navigation) {
264
- t17 = /* @__PURE__ */ jsx(ScreenStack.Screen, { children: /* @__PURE__ */ jsxs("div", {
265
- className: "computer-settings__screen computer-settings__screen--root",
266
- children: [
267
- t15,
268
- t16,
269
- navigation,
270
- footerNote
271
- ]
272
- }) }, "settings-root");
273
- $[54] = footerNote;
274
- $[55] = navigation;
275
- $[56] = t17;
276
- } else t17 = $[56];
277
- let t18;
278
- if ($[57] !== detailOpen || $[58] !== label || $[59] !== onDetailOpenChange || $[60] !== tabPanels || $[61] !== view) {
279
- t18 = detailOpen ? /* @__PURE__ */ jsx(ScreenStack.Screen, { children: /* @__PURE__ */ jsxs("div", {
280
- className: "computer-settings__screen",
281
- children: [/* @__PURE__ */ jsxs(AppTopBar.Root, {
282
- className: "computer-settings__bar",
283
- "aria-label": label,
284
- "data-nav-bar": "",
285
- children: [
286
- /* @__PURE__ */ jsx(AppTopBar.Leading, { children: /* @__PURE__ */ jsx(AppTopBar.Button, {
287
- "data-nav-back": "",
288
- label: "Settings",
289
- onClick: () => onDetailOpenChange(false),
290
- children: /* @__PURE__ */ jsx(ChevronLeftIcon, {})
291
- }) }),
292
- /* @__PURE__ */ jsx(AppTopBar.Title, { children: label }),
293
- /* @__PURE__ */ jsx(AppTopBar.Trailing, {})
294
- ]
295
- }), /* @__PURE__ */ jsxs("div", {
296
- className: "computer-settings__detail",
297
- children: [/* @__PURE__ */ jsx("h1", {
298
- className: "sigvelo-visually-hidden",
299
- children: label
300
- }), tabPanels]
301
- })]
302
- }) }, `settings:${view}`) : null;
303
- $[57] = detailOpen;
304
- $[58] = label;
305
- $[59] = onDetailOpenChange;
306
- $[60] = tabPanels;
307
- $[61] = view;
308
- $[62] = t18;
309
- } else t18 = $[62];
310
- let t19;
311
- if ($[63] !== t14 || $[64] !== t17 || $[65] !== t18) {
312
- t19 = /* @__PURE__ */ jsxs(ScreenStack.Root, {
313
- className: "computer-settings__stack",
314
- "data-recipe": "fill-host",
315
- onPop: t14,
316
- children: [t17, t18]
317
- });
318
- $[63] = t14;
319
- $[64] = t17;
320
- $[65] = t18;
321
- $[66] = t19;
322
- } else t19 = $[66];
323
- let t20;
324
- if ($[67] !== rootProps || $[68] !== t13 || $[69] !== t19) {
325
- t20 = /* @__PURE__ */ jsx(Tabs.Root, {
326
- ...rootProps,
327
- className: "computer-settings computer-settings--phone",
328
- onValueChange: t13,
329
- children: t19
330
- });
331
- $[67] = rootProps;
332
- $[68] = t13;
333
- $[69] = t19;
334
- $[70] = t20;
335
- } else t20 = $[70];
336
- return t20;
337
- }
338
- /**
339
- * Settings' unified toolbar, as System Settings draws it: the sidebar column
340
- * runs up under the traffic lights, and the bar over the detail names the pane
341
- * on screen. A phone paints a bar per screen instead.
342
- */
343
- function SettingsToolbar(t0) {
344
- const $ = c(3);
345
- const { label } = t0;
346
- let t1;
347
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
348
- t1 = /* @__PURE__ */ jsx("span", {
349
- className: "computer-settings-toolbar__rail",
350
- "aria-hidden": "true"
351
- });
352
- $[0] = t1;
353
- } else t1 = $[0];
354
- let t2;
355
- if ($[1] !== label) {
356
- t2 = /* @__PURE__ */ jsxs("div", {
357
- className: "computer-settings-toolbar",
358
- children: [t1, /* @__PURE__ */ jsx("span", {
359
- className: "computer-settings-toolbar__title",
360
- children: label
361
- })]
362
- });
363
- $[1] = label;
364
- $[2] = t2;
365
- } else t2 = $[2];
366
- return t2;
367
- }
368
- /** One row of the employee's inset group, a button when it opens something. */
369
- function SettingsRow(t0) {
370
- const $ = c(5);
371
- const { icon, label, value, onClick } = t0;
372
- let t1;
373
- if ($[0] !== icon || $[1] !== label || $[2] !== onClick || $[3] !== value) {
374
- t1 = onClick ? /* @__PURE__ */ jsxs(Button, {
375
- className: "computer-employee-settings__row",
376
- variant: "ghost",
377
- color: "neutral",
378
- onClick,
379
- children: [
380
- icon,
381
- /* @__PURE__ */ jsx("span", { children: label }),
382
- /* @__PURE__ */ jsx("span", {
383
- className: "computer-employee-settings__value sigvelo-truncate",
384
- children: value
385
- }),
386
- /* @__PURE__ */ jsx(ChevronRightIcon, { className: "computer-employee-settings__chevron" })
387
- ]
388
- }) : /* @__PURE__ */ jsxs("span", {
389
- className: "computer-employee-settings__row",
390
- children: [
391
- icon,
392
- /* @__PURE__ */ jsx("span", { children: label }),
393
- /* @__PURE__ */ jsx("span", {
394
- className: "computer-employee-settings__value sigvelo-truncate",
395
- children: value
396
- })
397
- ]
398
- });
399
- $[0] = icon;
400
- $[1] = label;
401
- $[2] = onClick;
402
- $[3] = value;
403
- $[4] = t1;
404
- } else t1 = $[4];
405
- return t1;
406
- }
407
- /** The workspace folders that shape the employee, each opened in Files. */
408
- const EMPLOYEE_FOLDERS = [
409
- {
410
- path: "/memory",
411
- label: "Memory",
412
- icon: BrainIcon,
413
- one: "note",
414
- other: "notes"
415
- },
416
- {
417
- path: "/skills",
418
- label: "Skills",
419
- icon: BoxIcon,
420
- one: "skill",
421
- other: "skills"
422
- },
423
- {
424
- path: "/projects",
425
- label: "Projects",
426
- icon: FolderIcon,
427
- one: "project",
428
- other: "projects"
429
- }
430
- ];
431
- const INSTRUCTIONS_PATH = "/SOUL.md";
432
- async function countEntries(source, path) {
433
- if (!await source.exists(path)) return 0;
434
- return (await source.readDir(path, {
435
- offset: 0,
436
- limit: 200
437
- })).length;
438
- }
439
- async function loadEmployeeFiles(source) {
440
- const [instructions, ...counts] = await Promise.all([source.stat(INSTRUCTIONS_PATH).then((stat) => stat?.type === "file"), ...EMPLOYEE_FOLDERS.map((folder) => countEntries(source, folder.path))]);
441
- return {
442
- instructions,
443
- counts
444
- };
445
- }
446
- /** The employee as its workspace defines it: its instructions and the folders it works from. */
447
- function EmployeeWorkspaceRows(t0) {
448
- const $ = c(28);
449
- const { source, sourceKey, onOpenFile, onOpenFolder } = t0;
450
- let t1;
451
- if ($[0] !== sourceKey) {
452
- t1 = [
453
- "workspace",
454
- sourceKey,
455
- "computer-employee-settings"
456
- ];
457
- $[0] = sourceKey;
458
- $[1] = t1;
459
- } else t1 = $[1];
460
- let t2;
461
- if ($[2] !== source) {
462
- t2 = () => loadEmployeeFiles(source);
463
- $[2] = source;
464
- $[3] = t2;
465
- } else t2 = $[3];
466
- let t3;
467
- if ($[4] !== t1 || $[5] !== t2) {
468
- t3 = {
469
- queryKey: t1,
470
- queryFn: t2,
471
- staleTime: Infinity
472
- };
473
- $[4] = t1;
474
- $[5] = t2;
475
- $[6] = t3;
476
- } else t3 = $[6];
477
- const files = useQuery(t3);
478
- if (files.isPending) {
479
- let t4;
480
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
481
- t4 = /* @__PURE__ */ jsxs("li", {
482
- className: "computer-employee-settings__status",
483
- role: "status",
484
- children: [/* @__PURE__ */ jsx(SpinnerIcon, {}), "Loading the employee’s files"]
485
- });
486
- $[7] = t4;
487
- } else t4 = $[7];
488
- return t4;
489
- }
490
- if (files.isError) {
491
- let t4;
492
- let t5;
493
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
494
- t4 = /* @__PURE__ */ jsx(WarningIcon, {});
495
- t5 = /* @__PURE__ */ jsx("strong", { children: "Couldn’t read the employee’s files" });
496
- $[8] = t4;
497
- $[9] = t5;
498
- } else {
499
- t4 = $[8];
500
- t5 = $[9];
501
- }
502
- let t6;
503
- if ($[10] !== files) {
504
- t6 = () => files.refetch();
505
- $[10] = files;
506
- $[11] = t6;
507
- } else t6 = $[11];
508
- let t7;
509
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
510
- t7 = /* @__PURE__ */ jsx(RefreshIcon, {});
511
- $[12] = t7;
512
- } else t7 = $[12];
513
- let t8;
514
- if ($[13] !== t6) {
515
- t8 = /* @__PURE__ */ jsxs("li", {
516
- className: "computer-employee-settings__status",
517
- role: "alert",
518
- children: [t4, /* @__PURE__ */ jsxs("div", { children: [t5, /* @__PURE__ */ jsxs(Button, {
519
- size: "sm",
520
- variant: "ghost",
521
- color: "neutral",
522
- onClick: t6,
523
- children: [t7, "Try again"]
524
- })] })]
525
- });
526
- $[13] = t6;
527
- $[14] = t8;
528
- } else t8 = $[14];
529
- return t8;
530
- }
531
- const { instructions, counts } = files.data;
532
- let t4;
533
- if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
534
- t4 = /* @__PURE__ */ jsx(FileIcon, { "aria-hidden": "true" });
535
- $[15] = t4;
536
- } else t4 = $[15];
537
- const t5 = instructions ? "Open" : "Not set";
538
- let t6;
539
- if ($[16] !== instructions || $[17] !== onOpenFile) {
540
- t6 = instructions ? () => onOpenFile(INSTRUCTIONS_PATH) : void 0;
541
- $[16] = instructions;
542
- $[17] = onOpenFile;
543
- $[18] = t6;
544
- } else t6 = $[18];
545
- let t7;
546
- if ($[19] !== t5 || $[20] !== t6) {
547
- t7 = /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SettingsRow, {
548
- icon: t4,
549
- label: "Instructions",
550
- value: t5,
551
- onClick: t6
552
- }) });
553
- $[19] = t5;
554
- $[20] = t6;
555
- $[21] = t7;
556
- } else t7 = $[21];
557
- let t8;
558
- if ($[22] !== counts || $[23] !== onOpenFolder) {
559
- t8 = EMPLOYEE_FOLDERS.map((t9, index) => {
560
- const { path, label, icon: Icon, one, other } = t9;
561
- const count = counts[index];
562
- return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SettingsRow, {
563
- icon: /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true" }),
564
- label,
565
- value: count ? `${count} ${count === 1 ? one : other}` : "None",
566
- onClick: count ? () => onOpenFolder(path) : void 0
567
- }) }, path);
568
- });
569
- $[22] = counts;
570
- $[23] = onOpenFolder;
571
- $[24] = t8;
572
- } else t8 = $[24];
573
- let t9;
574
- if ($[25] !== t7 || $[26] !== t8) {
575
- t9 = /* @__PURE__ */ jsxs(Fragment, { children: [t7, t8] });
576
- $[25] = t7;
577
- $[26] = t8;
578
- $[27] = t9;
579
- } else t9 = $[27];
580
- return t9;
581
- }
582
- /** A list of app ids small enough to be a Dock's. */
583
- function readAppIds(value) {
584
- return Array.isArray(value) && value.length <= 200 && value.every((id) => typeof id === "string") ? [...value] : null;
585
- }
586
- /**
587
- * A saved Dock arrangement, or null when it is not one. Ids the catalog no
588
- * longer has are kept; the Dock drops them when it arranges.
589
- */
590
- function readDockArrangement(value) {
591
- if (!value || typeof value !== "object" || !("order" in value) || !("hidden" in value)) return null;
592
- const order = readAppIds(value.order);
593
- const hidden = readAppIds(value.hidden);
594
- return order && hidden ? {
595
- order,
596
- hidden
597
- } : null;
598
- }
599
- /** Apps a person can arrange: everything the Dock and Home list on their own. */
600
- function dockEligible(apps) {
601
- return apps.filter((app) => app.launcher !== "hidden" && !app.owner);
602
- }
603
- /** Known ids only, every eligible app ordered, and Settings never hidden. */
604
- function normalizeDock(arrangement, apps) {
605
- const ids = new Set(dockEligible(apps).map((app) => app.id));
606
- const known = (list) => [...new Set(list)].filter((id) => ids.has(id));
607
- return {
608
- order: known([...arrangement.order, ...ids]),
609
- hidden: known(arrangement.hidden).filter((id) => id !== COMPUTER_APP_IDS.settings)
610
- };
611
- }
612
- /** The catalog in the arranged order, hidden apps kept for Home and search. */
613
- function arrangeDock(apps, arrangement) {
614
- const { order, hidden } = normalizeDock(arrangement, apps);
615
- return [...order.map((id) => {
616
- const app = apps.find((candidate) => candidate.id === id);
617
- return hidden.includes(id) ? {
618
- ...app,
619
- launcher: "hidden"
620
- } : app;
621
- }), ...apps.filter((app) => !order.includes(app.id))];
622
- }
623
- /** The Dock pane: show or hide each app and move it along the Dock. */
624
- function DockSettings(t0) {
625
- const $ = c(38);
626
- const { apps, arrangement, onChange, phone, children } = t0;
627
- const headingId = useId();
628
- let eligible;
629
- let t1;
630
- let t2;
631
- let t3;
632
- let t4;
633
- let t5;
634
- let t6;
635
- let t7;
636
- let update;
637
- if ($[0] !== apps || $[1] !== arrangement || $[2] !== headingId || $[3] !== onChange || $[4] !== phone) {
638
- eligible = dockEligible(apps);
639
- const { order, hidden } = normalizeDock(arrangement, apps);
640
- const ordered = order.map((id) => eligible.find((app) => app.id === id));
641
- let t8;
642
- if ($[14] !== apps || $[15] !== onChange) {
643
- t8 = (next) => onChange(normalizeDock(next, apps));
644
- $[14] = apps;
645
- $[15] = onChange;
646
- $[16] = t8;
647
- } else t8 = $[16];
648
- update = t8;
649
- const move = function move(id_0, direction) {
650
- const next_0 = [...order];
651
- const index = next_0.indexOf(id_0);
652
- const destination = index + direction;
653
- if (index < 0 || destination < 0 || destination >= next_0.length) return;
654
- const [t9, t10] = [next_0[destination], next_0[index]];
655
- next_0[index] = t9;
656
- next_0[destination] = t10;
657
- update({
658
- order: next_0,
659
- hidden
660
- });
661
- };
662
- t3 = "computer-dock-settings";
663
- t4 = phone ? "" : void 0;
664
- t5 = headingId;
665
- if ($[17] !== headingId) {
666
- t6 = /* @__PURE__ */ jsx("h2", {
667
- id: headingId,
668
- children: "Dock"
669
- });
670
- $[17] = headingId;
671
- $[18] = t6;
672
- } else t6 = $[18];
673
- if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
674
- t7 = /* @__PURE__ */ jsx("p", { children: "Choose the apps in the Dock. Hidden apps stay in Home and search." });
675
- $[19] = t7;
676
- } else t7 = $[19];
677
- t1 = "computer-dock-settings__list";
678
- t2 = ordered.map((app_0, index_0) => /* @__PURE__ */ jsxs("li", {
679
- className: "computer-dock-settings__app",
680
- children: [
681
- /* @__PURE__ */ jsxs("div", {
682
- className: "computer-dock-settings__identity",
683
- children: [/* @__PURE__ */ jsx(AppIcon.Root, {
684
- size: "sm",
685
- "aria-hidden": "true",
686
- children: app_0.icon
687
- }), /* @__PURE__ */ jsx("span", { children: app_0.label })]
688
- }),
689
- /* @__PURE__ */ jsx("div", {
690
- className: "computer-dock-settings__choices",
691
- children: /* @__PURE__ */ jsxs("label", { children: [
692
- /* @__PURE__ */ jsx(Checkbox.Root, {
693
- checked: !hidden.includes(app_0.id),
694
- disabled: app_0.id === COMPUTER_APP_IDS.settings,
695
- onCheckedChange: (checked) => update({
696
- order,
697
- hidden: checked ? hidden.filter((id_1) => id_1 !== app_0.id) : [...hidden, app_0.id]
698
- }),
699
- children: /* @__PURE__ */ jsx(Checkbox.Indicator, {})
700
- }),
701
- /* @__PURE__ */ jsxs("span", {
702
- className: "sigvelo-visually-hidden",
703
- children: [
704
- "Show ",
705
- app_0.label,
706
- " in Dock"
707
- ]
708
- }),
709
- /* @__PURE__ */ jsx("span", {
710
- "aria-hidden": "true",
711
- children: "Show"
712
- })
713
- ] })
714
- }),
715
- /* @__PURE__ */ jsxs("div", {
716
- className: "computer-dock-settings__order",
717
- children: [/* @__PURE__ */ jsx(IconButton, {
718
- label: `Move ${app_0.label} up`,
719
- size: phone ? "xl" : "xs",
720
- disabled: index_0 === 0,
721
- focusableWhenDisabled: true,
722
- variant: "ghost",
723
- color: "neutral",
724
- onClick: () => move(app_0.id, -1),
725
- children: /* @__PURE__ */ jsx(ArrowUpIcon, {})
726
- }), /* @__PURE__ */ jsx(IconButton, {
727
- label: `Move ${app_0.label} down`,
728
- size: phone ? "xl" : "xs",
729
- disabled: index_0 === ordered.length - 1,
730
- focusableWhenDisabled: true,
731
- variant: "ghost",
732
- color: "neutral",
733
- onClick: () => move(app_0.id, 1),
734
- children: /* @__PURE__ */ jsx(ArrowDownIcon, {})
735
- })]
736
- })
737
- ]
738
- }, app_0.id));
739
- $[0] = apps;
740
- $[1] = arrangement;
741
- $[2] = headingId;
742
- $[3] = onChange;
743
- $[4] = phone;
744
- $[5] = eligible;
745
- $[6] = t1;
746
- $[7] = t2;
747
- $[8] = t3;
748
- $[9] = t4;
749
- $[10] = t5;
750
- $[11] = t6;
751
- $[12] = t7;
752
- $[13] = update;
753
- } else {
754
- eligible = $[5];
755
- t1 = $[6];
756
- t2 = $[7];
757
- t3 = $[8];
758
- t4 = $[9];
759
- t5 = $[10];
760
- t6 = $[11];
761
- t7 = $[12];
762
- update = $[13];
763
- }
764
- let t8;
765
- if ($[20] !== t1 || $[21] !== t2) {
766
- t8 = /* @__PURE__ */ jsx("ol", {
767
- className: t1,
768
- children: t2
769
- });
770
- $[20] = t1;
771
- $[21] = t2;
772
- $[22] = t8;
773
- } else t8 = $[22];
774
- let t9;
775
- if ($[23] !== eligible || $[24] !== update) {
776
- t9 = /* @__PURE__ */ jsx(Button, {
777
- variant: "surface",
778
- color: "neutral",
779
- onClick: () => update({
780
- order: eligible.map(_temp$1),
781
- hidden: []
782
- }),
783
- children: "Reset Dock"
784
- });
785
- $[23] = eligible;
786
- $[24] = update;
787
- $[25] = t9;
788
- } else t9 = $[25];
789
- let t10;
790
- if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
791
- t10 = /* @__PURE__ */ jsx("span", { children: "Settings stays in the Dock so you can restore hidden apps." });
792
- $[26] = t10;
793
- } else t10 = $[26];
794
- let t11;
795
- if ($[27] !== t9) {
796
- t11 = /* @__PURE__ */ jsxs("div", {
797
- className: "computer-dock-settings__reset",
798
- children: [t9, t10]
799
- });
800
- $[27] = t9;
801
- $[28] = t11;
802
- } else t11 = $[28];
803
- let t12;
804
- if ($[29] !== children || $[30] !== t11 || $[31] !== t3 || $[32] !== t4 || $[33] !== t5 || $[34] !== t6 || $[35] !== t7 || $[36] !== t8) {
805
- t12 = /* @__PURE__ */ jsxs("section", {
806
- className: t3,
807
- "data-phone": t4,
808
- "aria-labelledby": t5,
809
- children: [
810
- t6,
811
- t7,
812
- t8,
813
- t11,
814
- children
815
- ]
816
- });
817
- $[29] = children;
818
- $[30] = t11;
819
- $[31] = t3;
820
- $[32] = t4;
821
- $[33] = t5;
822
- $[34] = t6;
823
- $[35] = t7;
824
- $[36] = t8;
825
- $[37] = t12;
826
- } else t12 = $[37];
827
- return t12;
828
- }
829
- function _temp$1(app_1) {
830
- return app_1.id;
831
- }
832
- //#endregion
833
15
  //#region src/components/agents-sdk/ComputerSettings.tsx
834
16
  /** Settings' panes, in sidebar order. */
835
17
  const COMPUTER_SETTINGS_VIEWS = [
@@ -871,33 +53,55 @@ function useSettingsHost() {
871
53
  if (!host) throw new Error("Settings needs ComputerSettings.Host.");
872
54
  return host;
873
55
  }
56
+ /** Adds Settings to the computer below it, inside a `ComputerHost`. */
874
57
  function Host(t0) {
875
- const $ = c(3);
58
+ const $ = c(10);
876
59
  const { value, children } = t0;
60
+ const { computer } = useComputerHost("ComputerSettings.Host");
61
+ const onViewChange = React.useRef(value.onViewChange);
877
62
  let t1;
878
- if ($[0] !== children || $[1] !== value) {
879
- t1 = /* @__PURE__ */ jsx(SettingsContext, {
880
- value,
63
+ if ($[0] !== value.onViewChange) {
64
+ t1 = () => {
65
+ onViewChange.current = value.onViewChange;
66
+ };
67
+ $[0] = value.onViewChange;
68
+ $[1] = t1;
69
+ } else t1 = $[1];
70
+ React.useLayoutEffect(t1);
71
+ let t2;
72
+ if ($[2] !== computer) {
73
+ t2 = {
74
+ app,
75
+ open: (view) => {
76
+ onViewChange.current(view);
77
+ computer.current?.openApp(app.id);
78
+ }
79
+ };
80
+ $[2] = computer;
81
+ $[3] = t2;
82
+ } else t2 = $[3];
83
+ const t3 = useAppHosts("settings", t2);
84
+ let t4;
85
+ if ($[4] !== children || $[5] !== t3) {
86
+ t4 = /* @__PURE__ */ jsx(AppHostsContext, {
87
+ value: t3,
881
88
  children
882
89
  });
883
- $[0] = children;
884
- $[1] = value;
885
- $[2] = t1;
886
- } else t1 = $[2];
887
- return t1;
888
- }
889
- /** The host's catalog in the arranged Dock order; pass it to `AgentComputer` inside the Host. */
890
- function useComputerDockPreferences() {
891
- const $ = c(3);
892
- const { apps, dockPreferences } = useSettingsHost();
893
- let t0;
894
- if ($[0] !== apps || $[1] !== dockPreferences) {
895
- t0 = arrangeDock(apps, dockPreferences);
896
- $[0] = apps;
897
- $[1] = dockPreferences;
898
- $[2] = t0;
899
- } else t0 = $[2];
900
- return t0;
90
+ $[4] = children;
91
+ $[5] = t3;
92
+ $[6] = t4;
93
+ } else t4 = $[6];
94
+ let t5;
95
+ if ($[7] !== t4 || $[8] !== value) {
96
+ t5 = /* @__PURE__ */ jsx(SettingsContext, {
97
+ value,
98
+ children: t4
99
+ });
100
+ $[7] = t4;
101
+ $[8] = value;
102
+ $[9] = t5;
103
+ } else t5 = $[9];
104
+ return t5;
901
105
  }
902
106
  function SwitchRow(t0) {
903
107
  const $ = c(10);
@@ -943,9 +147,10 @@ function SwitchRow(t0) {
943
147
  return t4;
944
148
  }
945
149
  function EmployeePane(t0) {
946
- const $ = c(32);
150
+ const $ = c(27);
947
151
  const { employee } = t0;
948
- const { openApp } = useAgentComputerActions();
152
+ const host = useComputerHost("ComputerSettings");
153
+ const files = React.use(AppHostsContext).files;
949
154
  const { identity, companion, localAgents, passkeys } = employee;
950
155
  let t1;
951
156
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
@@ -953,13 +158,13 @@ function EmployeePane(t0) {
953
158
  $[0] = t1;
954
159
  } else t1 = $[0];
955
160
  let t2;
956
- if ($[1] !== employee.name) {
161
+ if ($[1] !== host.employee.name) {
957
162
  t2 = /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SettingsRow, {
958
163
  icon: t1,
959
164
  label: "Name",
960
- value: employee.name
165
+ value: host.employee.name
961
166
  }) });
962
- $[1] = employee.name;
167
+ $[1] = host.employee.name;
963
168
  $[2] = t2;
964
169
  } else t2 = $[2];
965
170
  let t3;
@@ -1027,42 +232,22 @@ function EmployeePane(t0) {
1027
232
  $[13] = passkeys;
1028
233
  $[14] = t9;
1029
234
  } else t9 = $[14];
1030
- let t10;
235
+ const t10 = files?.open;
1031
236
  let t11;
1032
- if ($[15] !== employee || $[16] !== openApp) {
1033
- t10 = (path) => {
1034
- employee.onOpenFile(path);
1035
- openApp(COMPUTER_APP_IDS.files);
1036
- };
1037
- t11 = (path_0) => {
1038
- employee.onOpenFolder(path_0);
1039
- openApp(COMPUTER_APP_IDS.files);
1040
- };
1041
- $[15] = employee;
1042
- $[16] = openApp;
237
+ if ($[15] !== host.workspace.volume.source || $[16] !== host.workspace.volume.sourceKey || $[17] !== t10) {
238
+ t11 = /* @__PURE__ */ jsx(EmployeeWorkspaceRows, {
239
+ source: host.workspace.volume.source,
240
+ sourceKey: host.workspace.volume.sourceKey,
241
+ open: t10
242
+ });
243
+ $[15] = host.workspace.volume.source;
244
+ $[16] = host.workspace.volume.sourceKey;
1043
245
  $[17] = t10;
1044
246
  $[18] = t11;
1045
- } else {
1046
- t10 = $[17];
1047
- t11 = $[18];
1048
- }
247
+ } else t11 = $[18];
1049
248
  let t12;
1050
- if ($[19] !== employee.sourceKey || $[20] !== employee.workspace || $[21] !== t10 || $[22] !== t11) {
1051
- t12 = /* @__PURE__ */ jsx(EmployeeWorkspaceRows, {
1052
- source: employee.workspace,
1053
- sourceKey: employee.sourceKey,
1054
- onOpenFile: t10,
1055
- onOpenFolder: t11
1056
- });
1057
- $[19] = employee.sourceKey;
1058
- $[20] = employee.workspace;
1059
- $[21] = t10;
1060
- $[22] = t11;
1061
- $[23] = t12;
1062
- } else t12 = $[23];
1063
- let t13;
1064
- if ($[24] !== t12 || $[25] !== t2 || $[26] !== t5 || $[27] !== t6 || $[28] !== t7 || $[29] !== t8 || $[30] !== t9) {
1065
- t13 = /* @__PURE__ */ jsxs("ul", {
249
+ if ($[19] !== t11 || $[20] !== t2 || $[21] !== t5 || $[22] !== t6 || $[23] !== t7 || $[24] !== t8 || $[25] !== t9) {
250
+ t12 = /* @__PURE__ */ jsxs("ul", {
1066
251
  className: "computer-employee-settings",
1067
252
  "data-recipe": "inset-group",
1068
253
  "aria-label": "Employee",
@@ -1073,129 +258,129 @@ function EmployeePane(t0) {
1073
258
  t7,
1074
259
  t8,
1075
260
  t9,
1076
- t12
261
+ t11
1077
262
  ]
1078
263
  });
1079
- $[24] = t12;
1080
- $[25] = t2;
1081
- $[26] = t5;
1082
- $[27] = t6;
1083
- $[28] = t7;
1084
- $[29] = t8;
1085
- $[30] = t9;
1086
- $[31] = t13;
1087
- } else t13 = $[31];
1088
- return t13;
264
+ $[19] = t11;
265
+ $[20] = t2;
266
+ $[21] = t5;
267
+ $[22] = t6;
268
+ $[23] = t7;
269
+ $[24] = t8;
270
+ $[25] = t9;
271
+ $[26] = t12;
272
+ } else t12 = $[26];
273
+ return t12;
1089
274
  }
1090
- function AppearancePane(t0) {
275
+ function AppearancePane() {
1091
276
  const $ = c(28);
1092
- const { host } = t0;
1093
277
  const id = React.useId();
278
+ const { settings } = React.use(AppearanceContext);
279
+ const t0 = `${id}-theme`;
1094
280
  const t1 = `${id}-theme`;
1095
- const t2 = `${id}-theme`;
1096
- let t3;
1097
- if ($[0] !== t2) {
1098
- t3 = /* @__PURE__ */ jsx("h3", {
1099
- id: t2,
281
+ let t2;
282
+ if ($[0] !== t1) {
283
+ t2 = /* @__PURE__ */ jsx("h3", {
284
+ id: t1,
1100
285
  children: "Theme"
1101
286
  });
1102
- $[0] = t2;
1103
- $[1] = t3;
1104
- } else t3 = $[1];
1105
- let t4;
287
+ $[0] = t1;
288
+ $[1] = t2;
289
+ } else t2 = $[1];
290
+ let t3;
1106
291
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1107
- t4 = /* @__PURE__ */ jsx("p", { children: "Choose how controls and windows appear." });
1108
- $[2] = t4;
1109
- } else t4 = $[2];
292
+ t3 = /* @__PURE__ */ jsx("p", { children: "Choose how controls and windows appear." });
293
+ $[2] = t3;
294
+ } else t3 = $[2];
295
+ let t4;
296
+ if ($[3] !== t2) {
297
+ t4 = /* @__PURE__ */ jsxs("header", { children: [t2, t3] });
298
+ $[3] = t2;
299
+ $[4] = t4;
300
+ } else t4 = $[4];
1110
301
  let t5;
1111
- if ($[3] !== t3) {
1112
- t5 = /* @__PURE__ */ jsxs("header", { children: [t3, t4] });
1113
- $[3] = t3;
1114
- $[4] = t5;
1115
- } else t5 = $[4];
1116
- let t6;
1117
302
  if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
1118
- t6 = /* @__PURE__ */ jsx(ThemeModeControl, { variant: "previews" });
1119
- $[5] = t6;
1120
- } else t6 = $[5];
1121
- let t7;
1122
- if ($[6] !== t1 || $[7] !== t5) {
1123
- t7 = /* @__PURE__ */ jsxs("section", {
303
+ t5 = /* @__PURE__ */ jsx(ThemeModeControl, { variant: "previews" });
304
+ $[5] = t5;
305
+ } else t5 = $[5];
306
+ let t6;
307
+ if ($[6] !== t0 || $[7] !== t4) {
308
+ t6 = /* @__PURE__ */ jsxs("section", {
1124
309
  className: "computer-settings__appearance-group",
1125
- "aria-labelledby": t1,
1126
- children: [t5, t6]
310
+ "aria-labelledby": t0,
311
+ children: [t4, t5]
1127
312
  });
1128
- $[6] = t1;
1129
- $[7] = t5;
1130
- $[8] = t7;
1131
- } else t7 = $[8];
313
+ $[6] = t0;
314
+ $[7] = t4;
315
+ $[8] = t6;
316
+ } else t6 = $[8];
317
+ const t7 = `${id}-wallpaper`;
1132
318
  const t8 = `${id}-wallpaper`;
1133
- const t9 = `${id}-wallpaper`;
1134
- let t10;
1135
- if ($[9] !== t9) {
1136
- t10 = /* @__PURE__ */ jsx("h3", {
1137
- id: t9,
319
+ let t9;
320
+ if ($[9] !== t8) {
321
+ t9 = /* @__PURE__ */ jsx("h3", {
322
+ id: t8,
1138
323
  children: "Desktop background"
1139
324
  });
1140
- $[9] = t9;
1141
- $[10] = t10;
1142
- } else t10 = $[10];
1143
- let t11;
325
+ $[9] = t8;
326
+ $[10] = t9;
327
+ } else t9 = $[10];
328
+ let t10;
1144
329
  if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
1145
- t11 = /* @__PURE__ */ jsx("p", { children: "Choose the image behind windows and desktop files." });
1146
- $[11] = t11;
1147
- } else t11 = $[11];
330
+ t10 = /* @__PURE__ */ jsx("p", { children: "Choose the image behind windows and desktop files." });
331
+ $[11] = t10;
332
+ } else t10 = $[11];
333
+ let t11;
334
+ if ($[12] !== t9) {
335
+ t11 = /* @__PURE__ */ jsxs("header", { children: [t9, t10] });
336
+ $[12] = t9;
337
+ $[13] = t11;
338
+ } else t11 = $[13];
1148
339
  let t12;
1149
- if ($[12] !== t10) {
1150
- t12 = /* @__PURE__ */ jsxs("header", { children: [t10, t11] });
1151
- $[12] = t10;
1152
- $[13] = t12;
1153
- } else t12 = $[13];
1154
- let t13;
1155
- if ($[14] !== host.onWallpaperChange || $[15] !== host.wallpaper || $[16] !== host.wallpapers) {
1156
- t13 = /* @__PURE__ */ jsx(WallpaperPicker, {
1157
- wallpapers: host.wallpapers,
1158
- value: host.wallpaper,
1159
- onValueChange: host.onWallpaperChange
340
+ if ($[14] !== settings.onWallpaperChange || $[15] !== settings.wallpaper || $[16] !== settings.wallpapers) {
341
+ t12 = /* @__PURE__ */ jsx(WallpaperPicker, {
342
+ wallpapers: settings.wallpapers,
343
+ value: settings.wallpaper,
344
+ onValueChange: settings.onWallpaperChange
1160
345
  });
1161
- $[14] = host.onWallpaperChange;
1162
- $[15] = host.wallpaper;
1163
- $[16] = host.wallpapers;
1164
- $[17] = t13;
1165
- } else t13 = $[17];
1166
- let t14;
1167
- if ($[18] !== host.display || $[19] !== t13) {
1168
- t14 = /* @__PURE__ */ jsxs("div", {
346
+ $[14] = settings.onWallpaperChange;
347
+ $[15] = settings.wallpaper;
348
+ $[16] = settings.wallpapers;
349
+ $[17] = t12;
350
+ } else t12 = $[17];
351
+ let t13;
352
+ if ($[18] !== settings.display || $[19] !== t12) {
353
+ t13 = /* @__PURE__ */ jsxs("div", {
1169
354
  className: "computer-wallpapers",
1170
- children: [t13, host.display]
355
+ children: [t12, settings.display]
1171
356
  });
1172
- $[18] = host.display;
1173
- $[19] = t13;
1174
- $[20] = t14;
1175
- } else t14 = $[20];
1176
- let t15;
1177
- if ($[21] !== t12 || $[22] !== t14 || $[23] !== t8) {
1178
- t15 = /* @__PURE__ */ jsxs("section", {
357
+ $[18] = settings.display;
358
+ $[19] = t12;
359
+ $[20] = t13;
360
+ } else t13 = $[20];
361
+ let t14;
362
+ if ($[21] !== t11 || $[22] !== t13 || $[23] !== t7) {
363
+ t14 = /* @__PURE__ */ jsxs("section", {
1179
364
  className: "computer-settings__appearance-group",
1180
- "aria-labelledby": t8,
1181
- children: [t12, t14]
365
+ "aria-labelledby": t7,
366
+ children: [t11, t13]
1182
367
  });
1183
- $[21] = t12;
1184
- $[22] = t14;
1185
- $[23] = t8;
1186
- $[24] = t15;
1187
- } else t15 = $[24];
1188
- let t16;
1189
- if ($[25] !== t15 || $[26] !== t7) {
1190
- t16 = /* @__PURE__ */ jsxs("div", {
368
+ $[21] = t11;
369
+ $[22] = t13;
370
+ $[23] = t7;
371
+ $[24] = t14;
372
+ } else t14 = $[24];
373
+ let t15;
374
+ if ($[25] !== t14 || $[26] !== t6) {
375
+ t15 = /* @__PURE__ */ jsxs("div", {
1191
376
  className: "computer-settings__appearance",
1192
- children: [t7, t15]
377
+ children: [t6, t14]
1193
378
  });
1194
- $[25] = t15;
1195
- $[26] = t7;
1196
- $[27] = t16;
1197
- } else t16 = $[27];
1198
- return t16;
379
+ $[25] = t14;
380
+ $[26] = t6;
381
+ $[27] = t15;
382
+ } else t15 = $[27];
383
+ return t15;
1199
384
  }
1200
385
  /** The shell's chords, printed from the table its key handler reads, then the apps' own keys. */
1201
386
  const SHORTCUTS = [
@@ -1283,8 +468,43 @@ function Title() {
1283
468
  } else t0 = $[2];
1284
469
  return t0;
1285
470
  }
471
+ /** The Dock pane over the computer's catalog and its saved arrangement. */
472
+ function DockPane(t0) {
473
+ const $ = c(7);
474
+ const { phone } = t0;
475
+ const apps = useComputerSlice(_temp2);
476
+ const presentation = React.use(PresentationContext);
477
+ const arrangement = usePresentation(_temp3);
478
+ let t1;
479
+ if ($[0] !== presentation) {
480
+ t1 = (dock) => presentation.update({ dock });
481
+ $[0] = presentation;
482
+ $[1] = t1;
483
+ } else t1 = $[1];
484
+ let t2;
485
+ if ($[2] !== apps || $[3] !== arrangement || $[4] !== phone || $[5] !== t1) {
486
+ t2 = /* @__PURE__ */ jsx(DockSettings, {
487
+ apps,
488
+ arrangement,
489
+ onChange: t1,
490
+ phone
491
+ });
492
+ $[2] = apps;
493
+ $[3] = arrangement;
494
+ $[4] = phone;
495
+ $[5] = t1;
496
+ $[6] = t2;
497
+ } else t2 = $[6];
498
+ return t2;
499
+ }
500
+ function _temp3(store) {
501
+ return store.get().dock;
502
+ }
503
+ function _temp2(computer) {
504
+ return computer.getState().apps;
505
+ }
1286
506
  function Content() {
1287
- const $ = c(23);
507
+ const $ = c(18);
1288
508
  const { phone } = useAgentComputerWindow();
1289
509
  const host = useSettingsHost();
1290
510
  const [detailOpen, setDetailOpen] = React.useState(false);
@@ -1300,41 +520,32 @@ function Content() {
1300
520
  $[1] = t0;
1301
521
  } else t0 = $[1];
1302
522
  let t1;
1303
- if ($[2] !== host) {
1304
- t1 = /* @__PURE__ */ jsx(AppearancePane, { host });
1305
- $[2] = host;
1306
- $[3] = t1;
1307
- } else t1 = $[3];
523
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
524
+ t1 = /* @__PURE__ */ jsx(AppearancePane, {});
525
+ $[2] = t1;
526
+ } else t1 = $[2];
1308
527
  let t2;
1309
- if ($[4] !== host.apps || $[5] !== host.dockPreferences || $[6] !== host.onDockPreferencesChange || $[7] !== phone) {
1310
- t2 = /* @__PURE__ */ jsx(DockSettings, {
1311
- apps: host.apps,
1312
- arrangement: host.dockPreferences,
1313
- onChange: host.onDockPreferencesChange,
1314
- phone
1315
- });
1316
- $[4] = host.apps;
1317
- $[5] = host.dockPreferences;
1318
- $[6] = host.onDockPreferencesChange;
1319
- $[7] = phone;
1320
- $[8] = t2;
1321
- } else t2 = $[8];
528
+ if ($[3] !== phone) {
529
+ t2 = /* @__PURE__ */ jsx(DockPane, { phone });
530
+ $[3] = phone;
531
+ $[4] = t2;
532
+ } else t2 = $[4];
1322
533
  let t3;
1323
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
534
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
1324
535
  t3 = /* @__PURE__ */ jsx(ShortcutsPane, {});
1325
- $[9] = t3;
1326
- } else t3 = $[9];
536
+ $[5] = t3;
537
+ } else t3 = $[5];
1327
538
  let t4;
1328
- if ($[10] !== host.connections) {
539
+ if ($[6] !== host.connections) {
1329
540
  t4 = /* @__PURE__ */ jsx("div", {
1330
541
  className: "computer-settings__connections",
1331
542
  children: host.connections
1332
543
  });
1333
- $[10] = host.connections;
1334
- $[11] = t4;
1335
- } else t4 = $[11];
544
+ $[6] = host.connections;
545
+ $[7] = t4;
546
+ } else t4 = $[7];
1336
547
  let t5;
1337
- if ($[12] !== t0 || $[13] !== t1 || $[14] !== t2 || $[15] !== t4) {
548
+ if ($[8] !== t0 || $[9] !== t2 || $[10] !== t4) {
1338
549
  t5 = {
1339
550
  employee: t0,
1340
551
  appearance: t1,
@@ -1342,14 +553,13 @@ function Content() {
1342
553
  shortcuts: t3,
1343
554
  connections: t4
1344
555
  };
1345
- $[12] = t0;
1346
- $[13] = t1;
1347
- $[14] = t2;
1348
- $[15] = t4;
1349
- $[16] = t5;
1350
- } else t5 = $[16];
556
+ $[8] = t0;
557
+ $[9] = t2;
558
+ $[10] = t4;
559
+ $[11] = t5;
560
+ } else t5 = $[11];
1351
561
  let t6;
1352
- if ($[17] !== detailOpen || $[18] !== host.onViewChange || $[19] !== host.view || $[20] !== phone || $[21] !== t5) {
562
+ if ($[12] !== detailOpen || $[13] !== host.onViewChange || $[14] !== host.view || $[15] !== phone || $[16] !== t5) {
1353
563
  t6 = /* @__PURE__ */ jsx(SettingsLayout, {
1354
564
  views: VIEWS,
1355
565
  view: host.view,
@@ -1359,33 +569,34 @@ function Content() {
1359
569
  phone,
1360
570
  panels: t5
1361
571
  });
1362
- $[17] = detailOpen;
1363
- $[18] = host.onViewChange;
1364
- $[19] = host.view;
1365
- $[20] = phone;
1366
- $[21] = t5;
1367
- $[22] = t6;
1368
- } else t6 = $[22];
572
+ $[12] = detailOpen;
573
+ $[13] = host.onViewChange;
574
+ $[14] = host.view;
575
+ $[15] = phone;
576
+ $[16] = t5;
577
+ $[17] = t6;
578
+ } else t6 = $[17];
1369
579
  return t6;
1370
580
  }
581
+ const app = {
582
+ id: COMPUTER_APP_IDS.settings,
583
+ label: "Settings",
584
+ icon: computerAppTile(/* @__PURE__ */ jsx(AppIcon.Image, {
585
+ src: desktopArtwork.settings,
586
+ alt: ""
587
+ }), "light-dark(#e5e5ea, #3a3a3c)"),
588
+ defaultWindowSize: {
589
+ width: 660,
590
+ height: 580
591
+ },
592
+ titleBar: "unified",
593
+ Title,
594
+ Content
595
+ };
1371
596
  /** Settings in the Dock, and the Host it reads: employee, appearance, Dock, shortcuts, connections. */
1372
597
  const ComputerSettings = {
1373
598
  Host,
1374
- app: {
1375
- id: COMPUTER_APP_IDS.settings,
1376
- label: "Settings",
1377
- icon: computerAppTile(/* @__PURE__ */ jsx(AppIcon.Image, {
1378
- src: desktopArtwork.settings,
1379
- alt: ""
1380
- }), "light-dark(#e5e5ea, #3a3a3c)"),
1381
- defaultWindowSize: {
1382
- width: 660,
1383
- height: 580
1384
- },
1385
- titleBar: "unified",
1386
- Title,
1387
- Content
1388
- }
599
+ app
1389
600
  };
1390
601
  //#endregion
1391
- export { COMPUTER_SETTINGS_VIEWS, ComputerSettings, readDockArrangement, useComputerDockPreferences };
602
+ export { COMPUTER_SETTINGS_VIEWS, ComputerSettings };