@mcp-b/react-components 0.65.0 → 0.67.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 (107) hide show
  1. package/dist/AgentComputer-BP9ixGGE.js +8093 -0
  2. package/dist/{ExecutionResult-CXnGcmM4.js → ExecutionResult-C7SzVquo.js} +1 -1
  3. package/dist/WallpaperPicker-C-FItmDS.d.ts +34 -0
  4. package/dist/WorkspaceBrowser-Dz48H-7X.d.ts +89 -0
  5. package/dist/{WorkspaceFileCommands-SNIjRgtU.d.ts → WorkspaceFileCommands-1s9Ol8CG.d.ts} +11 -3
  6. package/dist/{WorkspaceMessageResponse-CXGOQgpo.js → WorkspaceMessageResponse-BoeeltJM.js} +1 -1
  7. package/dist/assets/wallpapers/README.md +31 -0
  8. package/dist/assets/wallpapers/alpine.webp +0 -0
  9. package/dist/assets/wallpapers/dusk.webp +0 -0
  10. package/dist/assets/wallpapers/ember.webp +0 -0
  11. package/dist/assets/wallpapers/graphite.webp +0 -0
  12. package/dist/assets/wallpapers/sigvelo.webp +0 -0
  13. package/dist/assets/wallpapers/tide.webp +0 -0
  14. package/dist/automations-host-DPORjdc7.js +17 -0
  15. package/dist/components/agents-sdk/AgentComputer.d.ts +7 -1
  16. package/dist/components/agents-sdk/AgentComputer.js +1 -8044
  17. package/dist/components/agents-sdk/AgentScreenSwitcher.js +1 -0
  18. package/dist/components/agents-sdk/BrowserLiveScreen.d.ts +7 -1
  19. package/dist/components/agents-sdk/BrowserLiveScreen.js +259 -257
  20. package/dist/components/agents-sdk/BrowserRunPanel.d.ts +2 -0
  21. package/dist/components/agents-sdk/BrowserRunPanel.js +1 -0
  22. package/dist/components/agents-sdk/ComputerAutomations.d.ts +70 -0
  23. package/dist/components/agents-sdk/ComputerAutomations.js +1410 -0
  24. package/dist/components/agents-sdk/ComputerCalendar.d.ts +7 -0
  25. package/dist/components/agents-sdk/ComputerCalendar.js +1344 -0
  26. package/dist/components/agents-sdk/ComputerFiles.d.ts +153 -0
  27. package/dist/components/agents-sdk/ComputerFiles.js +2401 -0
  28. package/dist/components/agents-sdk/ComputerHome.d.ts +15 -0
  29. package/dist/components/agents-sdk/ComputerHome.js +90 -0
  30. package/dist/components/agents-sdk/ComputerNotifications.d.ts +54 -0
  31. package/dist/components/agents-sdk/ComputerNotifications.js +692 -0
  32. package/dist/components/agents-sdk/ComputerScreen.d.ts +78 -0
  33. package/dist/components/agents-sdk/ComputerScreen.js +750 -0
  34. package/dist/components/agents-sdk/ComputerSettings.d.ts +69 -0
  35. package/dist/components/agents-sdk/ComputerSettings.js +1371 -0
  36. package/dist/components/agents-sdk/ComputerSpotlight.d.ts +29 -0
  37. package/dist/components/agents-sdk/ComputerSpotlight.js +232 -0
  38. package/dist/components/agents-sdk/ComputerViewer.d.ts +51 -0
  39. package/dist/components/agents-sdk/ComputerViewer.js +339 -0
  40. package/dist/components/agents-sdk/ComputerWallpapers.d.ts +11 -0
  41. package/dist/components/agents-sdk/ComputerWallpapers.js +43 -0
  42. package/dist/components/agents-sdk/EmployeeApp.js +1 -1
  43. package/dist/components/agents-sdk/EmployeeChat.js +1 -1
  44. package/dist/components/agents-sdk/EmployeeChrome.js +4 -4
  45. package/dist/components/agents-sdk/EmployeeSchedules.js +3 -3
  46. package/dist/components/agents-sdk/EmployeeStartScreen.js +1 -1
  47. package/dist/components/agents-sdk/ExecutionBoard.js +1 -1
  48. package/dist/components/agents-sdk/ManagerOffice.js +1 -1
  49. package/dist/components/agents-sdk/ManagerOfficeScreens.js +1 -1
  50. package/dist/components/agents-sdk/McpPluginCatalog.js +1 -1
  51. package/dist/components/agents-sdk/ModelSelector.js +1 -1
  52. package/dist/components/agents-sdk/ThinkChat.js +1 -1
  53. package/dist/components/agents-sdk/ThinkChatActivitySummary.js +1 -1
  54. package/dist/components/agents-sdk/ThinkChatToolPanels.js +5 -5
  55. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +3 -3
  56. package/dist/components/agents-sdk/ThinkFullApp.d.ts +13 -0
  57. package/dist/components/agents-sdk/ThinkFullApp.js +13 -0
  58. package/dist/components/agents-sdk/ThinkScheduleActions.js +1 -1
  59. package/dist/components/agents-sdk/ThinkScheduleDetail.js +3 -3
  60. package/dist/components/agents-sdk/ThinkScheduleForm.js +4 -4
  61. package/dist/components/agents-sdk/WorkspaceAutomation.js +4 -4
  62. package/dist/components/agents-sdk/WorkspaceAutomationTable.js +1 -1
  63. package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +2 -88
  64. package/dist/components/agents-sdk/WorkspaceCorrespondence.js +1 -1
  65. package/dist/components/agents-sdk/WorkspaceDesktop.d.ts +1 -1
  66. package/dist/components/agents-sdk/WorkspaceDocumentFrame.d.ts +17 -0
  67. package/dist/components/agents-sdk/WorkspaceDocumentFrame.js +90 -0
  68. package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +4 -1
  69. package/dist/components/agents-sdk/WorkspaceExplorer.js +70 -66
  70. package/dist/components/agents-sdk/WorkspaceFileCommands.d.ts +2 -2
  71. package/dist/components/agents-sdk/WorkspaceFileCommands.js +346 -316
  72. package/dist/components/agents-sdk/WorkspaceFileView.d.ts +7 -1
  73. package/dist/components/agents-sdk/WorkspaceFileView.js +83 -71
  74. package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
  75. package/dist/components/agents-sdk/WorkspaceLive.d.ts +2 -4
  76. package/dist/components/agents-sdk/WorkspaceLive.js +18 -11
  77. package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
  78. package/dist/components/ai-sdk/ConnectedAppCards.js +1 -1
  79. package/dist/components/ai-sdk/Goal.d.ts +1 -2
  80. package/dist/components/ai-sdk/Goal.js +1 -2
  81. package/dist/components/extension/FirstRunSetup.js +5 -5
  82. package/dist/components/general-purpose/CommandPalette.d.ts +6 -1
  83. package/dist/components/general-purpose/CommandPalette.js +90 -82
  84. package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
  85. package/dist/components/general-purpose/ThemeModeControl.js +1 -1
  86. package/dist/components/general-purpose/WallpaperPicker.d.ts +2 -33
  87. package/dist/components/nanites/AgentConnection.js +1 -1
  88. package/dist/parts-RXV6GGdB.js +112 -0
  89. package/dist/styles/agent-computer.css +35 -0
  90. package/dist/styles/base.css +6 -0
  91. package/dist/styles/computer-app-tile.css +20 -0
  92. package/dist/styles/computer-automations.css +454 -0
  93. package/dist/styles/computer-calendar.css +648 -0
  94. package/dist/styles/computer-files.css +566 -0
  95. package/dist/styles/computer-home.css +90 -0
  96. package/dist/styles/computer-notifications.css +242 -0
  97. package/dist/styles/computer-screen.css +89 -0
  98. package/dist/styles/computer-settings.css +550 -0
  99. package/dist/styles/computer-spotlight.css +7 -0
  100. package/dist/styles/computer-viewer.css +130 -0
  101. package/dist/styles/index.css +11 -0
  102. package/dist/styles/recipes.css +42 -0
  103. package/dist/styles/workspace-document-frame.css +31 -0
  104. package/package.json +2 -2
  105. package/dist/{ManagerOffice-T79utm-P.js → ManagerOffice-kSK7vTBl.js} +1 -1
  106. package/dist/{WorkspaceLink-DDkj-Tq5.js → WorkspaceLink-DK9kdMUH.js} +1 -1
  107. package/dist/{connected-app-drafts-Bocdg3Z-.js → connected-app-drafts-C49343p9.js} +1 -1
@@ -0,0 +1,1371 @@
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";
6
+ 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-BP9ixGGE.js";
9
+ import { AppTopBar } from "../general-purpose/AppTopBar.js";
10
+ import { n as computerAppTile } from "../../parts-RXV6GGdB.js";
11
+ import { Switch } from "../foundations/Switch.js";
12
+ import { ScreenStack } from "../general-purpose/ScreenStack.js";
13
+ import { ThemeModeControl } from "../general-purpose/ThemeModeControl.js";
14
+ import { WallpaperPicker } from "../general-purpose/WallpaperPicker.js";
15
+ import { COMPUTER_SPOTLIGHT_SHORTCUT } from "./ComputerSpotlight.js";
16
+ import { c } from "react/compiler-runtime";
17
+ import * as React from "react";
18
+ import { useId, useLayoutEffect, useRef } from "react";
19
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
20
+ import { useQuery } from "@tanstack/react-query";
21
+ //#region src/components/_internal/computer-apps/settings.tsx
22
+ /**
23
+ * Settings uses one Base UI Tabs owner on both platforms. The Mac presents
24
+ * those destinations in its familiar rail; the phone puts the same list at
25
+ * the root of an iOS navigation stack and pushes the selected pane.
26
+ */
27
+ function SettingsLayout(t0) {
28
+ const $ = c(71);
29
+ const { views, view, onViewChange, detailOpen, onDetailOpenChange, phone, panels, footer } = t0;
30
+ let t1;
31
+ if ($[0] !== view || $[1] !== views) {
32
+ let t2;
33
+ if ($[3] !== view) {
34
+ t2 = (item) => item.value === view;
35
+ $[3] = view;
36
+ $[4] = t2;
37
+ } else t2 = $[4];
38
+ t1 = views.find(t2);
39
+ $[0] = view;
40
+ $[1] = views;
41
+ $[2] = t1;
42
+ } else t1 = $[2];
43
+ const label = t1.label;
44
+ const rootRef = useRef(null);
45
+ const previousPhone = useRef(phone);
46
+ const focusedControl = useRef(null);
47
+ let t2;
48
+ let t3;
49
+ if ($[5] !== detailOpen || $[6] !== phone) {
50
+ t2 = () => {
51
+ const root = rootRef.current;
52
+ const changedLayout = previousPhone.current !== phone;
53
+ previousPhone.current = phone;
54
+ 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 });
55
+ };
56
+ t3 = [phone, detailOpen];
57
+ $[5] = detailOpen;
58
+ $[6] = phone;
59
+ $[7] = t2;
60
+ $[8] = t3;
61
+ } else {
62
+ t2 = $[7];
63
+ t3 = $[8];
64
+ }
65
+ useLayoutEffect(t2, t3);
66
+ let t4;
67
+ if ($[9] !== panels || $[10] !== phone || $[11] !== views) {
68
+ let t5;
69
+ if ($[13] !== panels || $[14] !== phone) {
70
+ t5 = (t6) => {
71
+ const { value } = t6;
72
+ return /* @__PURE__ */ jsx(Tabs.Panel, {
73
+ unstyled: phone,
74
+ className: "computer-settings__panel",
75
+ value,
76
+ children: panels[value]
77
+ }, value);
78
+ };
79
+ $[13] = panels;
80
+ $[14] = phone;
81
+ $[15] = t5;
82
+ } else t5 = $[15];
83
+ t4 = views.map(t5);
84
+ $[9] = panels;
85
+ $[10] = phone;
86
+ $[11] = views;
87
+ $[12] = t4;
88
+ } else t4 = $[12];
89
+ let t5;
90
+ if ($[16] !== t4) {
91
+ t5 = /* @__PURE__ */ jsx(Tabs.Panels, { children: t4 });
92
+ $[16] = t4;
93
+ $[17] = t5;
94
+ } else t5 = $[17];
95
+ const tabPanels = t5;
96
+ const t6 = phone ? "inset-group" : void 0;
97
+ let t7;
98
+ if ($[18] !== onDetailOpenChange || $[19] !== phone || $[20] !== views) {
99
+ let t8;
100
+ if ($[22] !== onDetailOpenChange || $[23] !== phone) {
101
+ t8 = (t9) => {
102
+ const { value: value_0, label: label_0, icon: Icon } = t9;
103
+ return /* @__PURE__ */ jsxs(Tabs.Tab, {
104
+ unstyled: true,
105
+ className: "computer-settings__destination",
106
+ value: value_0,
107
+ onClick: () => phone && onDetailOpenChange(true),
108
+ children: [
109
+ /* @__PURE__ */ jsx(Icon, { className: "computer-settings__destination-icon" }),
110
+ /* @__PURE__ */ jsx("span", { children: label_0 }),
111
+ phone ? /* @__PURE__ */ jsx(ChevronRightIcon, { className: "computer-settings__destination-chevron" }) : null
112
+ ]
113
+ }, value_0);
114
+ };
115
+ $[22] = onDetailOpenChange;
116
+ $[23] = phone;
117
+ $[24] = t8;
118
+ } else t8 = $[24];
119
+ t7 = views.map(t8);
120
+ $[18] = onDetailOpenChange;
121
+ $[19] = phone;
122
+ $[20] = views;
123
+ $[21] = t7;
124
+ } else t7 = $[21];
125
+ let t8;
126
+ if ($[25] !== t6 || $[26] !== t7) {
127
+ t8 = /* @__PURE__ */ jsx(Tabs.List, {
128
+ unstyled: true,
129
+ className: "computer-settings__navigation",
130
+ "data-recipe": t6,
131
+ "aria-label": "Settings",
132
+ children: t7
133
+ });
134
+ $[25] = t6;
135
+ $[26] = t7;
136
+ $[27] = t8;
137
+ } else t8 = $[27];
138
+ const navigation = t8;
139
+ let t9;
140
+ if ($[28] !== footer) {
141
+ t9 = footer ? /* @__PURE__ */ jsx("p", {
142
+ className: "computer-settings__storage-status",
143
+ role: "status",
144
+ children: footer
145
+ }) : null;
146
+ $[28] = footer;
147
+ $[29] = t9;
148
+ } else t9 = $[29];
149
+ const footerNote = t9;
150
+ let t10;
151
+ let t11;
152
+ if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
153
+ t10 = (event) => {
154
+ if (event.target instanceof HTMLElement) focusedControl.current = event.target;
155
+ };
156
+ t11 = (event_0) => {
157
+ if (!event_0.currentTarget.contains(event_0.relatedTarget)) focusedControl.current = null;
158
+ };
159
+ $[30] = t10;
160
+ $[31] = t11;
161
+ } else {
162
+ t10 = $[30];
163
+ t11 = $[31];
164
+ }
165
+ let t12;
166
+ if ($[32] !== view) {
167
+ t12 = {
168
+ ref: rootRef,
169
+ unstyled: true,
170
+ value: view,
171
+ orientation: "vertical",
172
+ onFocusCapture: t10,
173
+ onBlurCapture: t11
174
+ };
175
+ $[32] = view;
176
+ $[33] = t12;
177
+ } else t12 = $[33];
178
+ const rootProps = t12;
179
+ if (!phone) {
180
+ let t13;
181
+ if ($[34] !== onViewChange) {
182
+ t13 = (next) => onViewChange(next);
183
+ $[34] = onViewChange;
184
+ $[35] = t13;
185
+ } else t13 = $[35];
186
+ let t14;
187
+ if ($[36] !== navigation) {
188
+ t14 = /* @__PURE__ */ jsx("aside", {
189
+ className: "computer-settings__sidebar",
190
+ children: navigation
191
+ });
192
+ $[36] = navigation;
193
+ $[37] = t14;
194
+ } else t14 = $[37];
195
+ let t15;
196
+ if ($[38] !== footerNote || $[39] !== tabPanels) {
197
+ t15 = /* @__PURE__ */ jsxs("div", {
198
+ className: "computer-settings__detail",
199
+ children: [tabPanels, footerNote]
200
+ });
201
+ $[38] = footerNote;
202
+ $[39] = tabPanels;
203
+ $[40] = t15;
204
+ } else t15 = $[40];
205
+ let t16;
206
+ if ($[41] !== rootProps || $[42] !== t13 || $[43] !== t14 || $[44] !== t15) {
207
+ t16 = /* @__PURE__ */ jsxs(Tabs.Root, {
208
+ ...rootProps,
209
+ className: "computer-settings computer-settings--desktop",
210
+ onValueChange: t13,
211
+ children: [t14, t15]
212
+ });
213
+ $[41] = rootProps;
214
+ $[42] = t13;
215
+ $[43] = t14;
216
+ $[44] = t15;
217
+ $[45] = t16;
218
+ } else t16 = $[45];
219
+ return t16;
220
+ }
221
+ let t13;
222
+ if ($[46] !== onDetailOpenChange || $[47] !== onViewChange) {
223
+ t13 = (next_0) => {
224
+ onViewChange(next_0);
225
+ onDetailOpenChange(true);
226
+ };
227
+ $[46] = onDetailOpenChange;
228
+ $[47] = onViewChange;
229
+ $[48] = t13;
230
+ } else t13 = $[48];
231
+ let t14;
232
+ if ($[49] !== detailOpen || $[50] !== onDetailOpenChange) {
233
+ t14 = detailOpen ? () => onDetailOpenChange(false) : void 0;
234
+ $[49] = detailOpen;
235
+ $[50] = onDetailOpenChange;
236
+ $[51] = t14;
237
+ } else t14 = $[51];
238
+ let t15;
239
+ let t16;
240
+ if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
241
+ t15 = /* @__PURE__ */ jsxs(AppTopBar.Root, {
242
+ className: "computer-settings__bar",
243
+ "aria-label": "Settings",
244
+ "data-nav-bar": "",
245
+ children: [
246
+ /* @__PURE__ */ jsx(AppTopBar.Leading, {}),
247
+ /* @__PURE__ */ jsx(AppTopBar.Title, {
248
+ className: "computer-settings__root-title",
249
+ children: "Settings"
250
+ }),
251
+ /* @__PURE__ */ jsx(AppTopBar.Trailing, {})
252
+ ]
253
+ });
254
+ t16 = /* @__PURE__ */ jsx("h1", { children: "Settings" });
255
+ $[52] = t15;
256
+ $[53] = t16;
257
+ } else {
258
+ t15 = $[52];
259
+ t16 = $[53];
260
+ }
261
+ let t17;
262
+ if ($[54] !== footerNote || $[55] !== navigation) {
263
+ t17 = /* @__PURE__ */ jsx(ScreenStack.Screen, { children: /* @__PURE__ */ jsxs("div", {
264
+ className: "computer-settings__screen computer-settings__screen--root",
265
+ children: [
266
+ t15,
267
+ t16,
268
+ navigation,
269
+ footerNote
270
+ ]
271
+ }) }, "settings-root");
272
+ $[54] = footerNote;
273
+ $[55] = navigation;
274
+ $[56] = t17;
275
+ } else t17 = $[56];
276
+ let t18;
277
+ if ($[57] !== detailOpen || $[58] !== label || $[59] !== onDetailOpenChange || $[60] !== tabPanels || $[61] !== view) {
278
+ t18 = detailOpen ? /* @__PURE__ */ jsx(ScreenStack.Screen, { children: /* @__PURE__ */ jsxs("div", {
279
+ className: "computer-settings__screen",
280
+ children: [/* @__PURE__ */ jsxs(AppTopBar.Root, {
281
+ className: "computer-settings__bar",
282
+ "aria-label": label,
283
+ "data-nav-bar": "",
284
+ children: [
285
+ /* @__PURE__ */ jsx(AppTopBar.Leading, { children: /* @__PURE__ */ jsx(AppTopBar.Button, {
286
+ "data-nav-back": "",
287
+ label: "Settings",
288
+ onClick: () => onDetailOpenChange(false),
289
+ children: /* @__PURE__ */ jsx(ChevronLeftIcon, {})
290
+ }) }),
291
+ /* @__PURE__ */ jsx(AppTopBar.Title, { children: label }),
292
+ /* @__PURE__ */ jsx(AppTopBar.Trailing, {})
293
+ ]
294
+ }), /* @__PURE__ */ jsxs("div", {
295
+ className: "computer-settings__detail",
296
+ children: [/* @__PURE__ */ jsx("h1", {
297
+ className: "sigvelo-visually-hidden",
298
+ children: label
299
+ }), tabPanels]
300
+ })]
301
+ }) }, `settings:${view}`) : null;
302
+ $[57] = detailOpen;
303
+ $[58] = label;
304
+ $[59] = onDetailOpenChange;
305
+ $[60] = tabPanels;
306
+ $[61] = view;
307
+ $[62] = t18;
308
+ } else t18 = $[62];
309
+ let t19;
310
+ if ($[63] !== t14 || $[64] !== t17 || $[65] !== t18) {
311
+ t19 = /* @__PURE__ */ jsxs(ScreenStack.Root, {
312
+ className: "computer-settings__stack",
313
+ "data-recipe": "fill-host",
314
+ onPop: t14,
315
+ children: [t17, t18]
316
+ });
317
+ $[63] = t14;
318
+ $[64] = t17;
319
+ $[65] = t18;
320
+ $[66] = t19;
321
+ } else t19 = $[66];
322
+ let t20;
323
+ if ($[67] !== rootProps || $[68] !== t13 || $[69] !== t19) {
324
+ t20 = /* @__PURE__ */ jsx(Tabs.Root, {
325
+ ...rootProps,
326
+ className: "computer-settings computer-settings--phone",
327
+ onValueChange: t13,
328
+ children: t19
329
+ });
330
+ $[67] = rootProps;
331
+ $[68] = t13;
332
+ $[69] = t19;
333
+ $[70] = t20;
334
+ } else t20 = $[70];
335
+ return t20;
336
+ }
337
+ /**
338
+ * Settings' unified toolbar, as System Settings draws it: the sidebar column
339
+ * runs up under the traffic lights, and the bar over the detail names the pane
340
+ * on screen. A phone paints a bar per screen instead.
341
+ */
342
+ function SettingsToolbar(t0) {
343
+ const $ = c(3);
344
+ const { label } = t0;
345
+ let t1;
346
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
347
+ t1 = /* @__PURE__ */ jsx("span", {
348
+ className: "computer-settings-toolbar__rail",
349
+ "aria-hidden": "true"
350
+ });
351
+ $[0] = t1;
352
+ } else t1 = $[0];
353
+ let t2;
354
+ if ($[1] !== label) {
355
+ t2 = /* @__PURE__ */ jsxs("div", {
356
+ className: "computer-settings-toolbar",
357
+ children: [t1, /* @__PURE__ */ jsx("span", {
358
+ className: "computer-settings-toolbar__title",
359
+ children: label
360
+ })]
361
+ });
362
+ $[1] = label;
363
+ $[2] = t2;
364
+ } else t2 = $[2];
365
+ return t2;
366
+ }
367
+ /** One row of the employee's inset group, a button when it opens something. */
368
+ function SettingsRow(t0) {
369
+ const $ = c(5);
370
+ const { icon, label, value, onClick } = t0;
371
+ let t1;
372
+ if ($[0] !== icon || $[1] !== label || $[2] !== onClick || $[3] !== value) {
373
+ t1 = onClick ? /* @__PURE__ */ jsxs(Button, {
374
+ className: "computer-employee-settings__row",
375
+ variant: "ghost",
376
+ color: "neutral",
377
+ onClick,
378
+ children: [
379
+ icon,
380
+ /* @__PURE__ */ jsx("span", { children: label }),
381
+ /* @__PURE__ */ jsx("span", {
382
+ className: "computer-employee-settings__value sigvelo-truncate",
383
+ children: value
384
+ }),
385
+ /* @__PURE__ */ jsx(ChevronRightIcon, { className: "computer-employee-settings__chevron" })
386
+ ]
387
+ }) : /* @__PURE__ */ jsxs("span", {
388
+ className: "computer-employee-settings__row",
389
+ children: [
390
+ icon,
391
+ /* @__PURE__ */ jsx("span", { children: label }),
392
+ /* @__PURE__ */ jsx("span", {
393
+ className: "computer-employee-settings__value sigvelo-truncate",
394
+ children: value
395
+ })
396
+ ]
397
+ });
398
+ $[0] = icon;
399
+ $[1] = label;
400
+ $[2] = onClick;
401
+ $[3] = value;
402
+ $[4] = t1;
403
+ } else t1 = $[4];
404
+ return t1;
405
+ }
406
+ /** The workspace folders that shape the employee, each opened in Files. */
407
+ const EMPLOYEE_FOLDERS = [
408
+ {
409
+ path: "/memory",
410
+ label: "Memory",
411
+ icon: BrainIcon,
412
+ one: "note",
413
+ other: "notes"
414
+ },
415
+ {
416
+ path: "/skills",
417
+ label: "Skills",
418
+ icon: BoxIcon,
419
+ one: "skill",
420
+ other: "skills"
421
+ },
422
+ {
423
+ path: "/projects",
424
+ label: "Projects",
425
+ icon: FolderIcon,
426
+ one: "project",
427
+ other: "projects"
428
+ }
429
+ ];
430
+ const INSTRUCTIONS_PATH = "/SOUL.md";
431
+ async function countEntries(source, path) {
432
+ if (!await source.exists(path)) return 0;
433
+ return (await source.readDir(path, {
434
+ offset: 0,
435
+ limit: 200
436
+ })).length;
437
+ }
438
+ async function loadEmployeeFiles(source) {
439
+ const [instructions, ...counts] = await Promise.all([source.stat(INSTRUCTIONS_PATH).then((stat) => stat?.type === "file"), ...EMPLOYEE_FOLDERS.map((folder) => countEntries(source, folder.path))]);
440
+ return {
441
+ instructions,
442
+ counts
443
+ };
444
+ }
445
+ /** The employee as its workspace defines it: its instructions and the folders it works from. */
446
+ function EmployeeWorkspaceRows(t0) {
447
+ const $ = c(28);
448
+ const { source, sourceKey, onOpenFile, onOpenFolder } = t0;
449
+ let t1;
450
+ if ($[0] !== sourceKey) {
451
+ t1 = [
452
+ "workspace",
453
+ sourceKey,
454
+ "computer-employee-settings"
455
+ ];
456
+ $[0] = sourceKey;
457
+ $[1] = t1;
458
+ } else t1 = $[1];
459
+ let t2;
460
+ if ($[2] !== source) {
461
+ t2 = () => loadEmployeeFiles(source);
462
+ $[2] = source;
463
+ $[3] = t2;
464
+ } else t2 = $[3];
465
+ let t3;
466
+ if ($[4] !== t1 || $[5] !== t2) {
467
+ t3 = {
468
+ queryKey: t1,
469
+ queryFn: t2,
470
+ staleTime: Infinity
471
+ };
472
+ $[4] = t1;
473
+ $[5] = t2;
474
+ $[6] = t3;
475
+ } else t3 = $[6];
476
+ const files = useQuery(t3);
477
+ if (files.isPending) {
478
+ let t4;
479
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
480
+ t4 = /* @__PURE__ */ jsxs("li", {
481
+ className: "computer-employee-settings__status",
482
+ role: "status",
483
+ children: [/* @__PURE__ */ jsx(SpinnerIcon, {}), "Loading the employee’s files"]
484
+ });
485
+ $[7] = t4;
486
+ } else t4 = $[7];
487
+ return t4;
488
+ }
489
+ if (files.isError) {
490
+ let t4;
491
+ let t5;
492
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
493
+ t4 = /* @__PURE__ */ jsx(WarningIcon, {});
494
+ t5 = /* @__PURE__ */ jsx("strong", { children: "Couldn’t read the employee’s files" });
495
+ $[8] = t4;
496
+ $[9] = t5;
497
+ } else {
498
+ t4 = $[8];
499
+ t5 = $[9];
500
+ }
501
+ let t6;
502
+ if ($[10] !== files) {
503
+ t6 = () => files.refetch();
504
+ $[10] = files;
505
+ $[11] = t6;
506
+ } else t6 = $[11];
507
+ let t7;
508
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
509
+ t7 = /* @__PURE__ */ jsx(RefreshIcon, {});
510
+ $[12] = t7;
511
+ } else t7 = $[12];
512
+ let t8;
513
+ if ($[13] !== t6) {
514
+ t8 = /* @__PURE__ */ jsxs("li", {
515
+ className: "computer-employee-settings__status",
516
+ role: "alert",
517
+ children: [t4, /* @__PURE__ */ jsxs("div", { children: [t5, /* @__PURE__ */ jsxs(Button, {
518
+ size: "sm",
519
+ variant: "ghost",
520
+ color: "neutral",
521
+ onClick: t6,
522
+ children: [t7, "Try again"]
523
+ })] })]
524
+ });
525
+ $[13] = t6;
526
+ $[14] = t8;
527
+ } else t8 = $[14];
528
+ return t8;
529
+ }
530
+ const { instructions, counts } = files.data;
531
+ let t4;
532
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
533
+ t4 = /* @__PURE__ */ jsx(FileIcon, { "aria-hidden": "true" });
534
+ $[15] = t4;
535
+ } else t4 = $[15];
536
+ const t5 = instructions ? "Open" : "Not set";
537
+ let t6;
538
+ if ($[16] !== instructions || $[17] !== onOpenFile) {
539
+ t6 = instructions ? () => onOpenFile(INSTRUCTIONS_PATH) : void 0;
540
+ $[16] = instructions;
541
+ $[17] = onOpenFile;
542
+ $[18] = t6;
543
+ } else t6 = $[18];
544
+ let t7;
545
+ if ($[19] !== t5 || $[20] !== t6) {
546
+ t7 = /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SettingsRow, {
547
+ icon: t4,
548
+ label: "Instructions",
549
+ value: t5,
550
+ onClick: t6
551
+ }) });
552
+ $[19] = t5;
553
+ $[20] = t6;
554
+ $[21] = t7;
555
+ } else t7 = $[21];
556
+ let t8;
557
+ if ($[22] !== counts || $[23] !== onOpenFolder) {
558
+ t8 = EMPLOYEE_FOLDERS.map((t9, index) => {
559
+ const { path, label, icon: Icon, one, other } = t9;
560
+ const count = counts[index];
561
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SettingsRow, {
562
+ icon: /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true" }),
563
+ label,
564
+ value: count ? `${count} ${count === 1 ? one : other}` : "None",
565
+ onClick: count ? () => onOpenFolder(path) : void 0
566
+ }) }, path);
567
+ });
568
+ $[22] = counts;
569
+ $[23] = onOpenFolder;
570
+ $[24] = t8;
571
+ } else t8 = $[24];
572
+ let t9;
573
+ if ($[25] !== t7 || $[26] !== t8) {
574
+ t9 = /* @__PURE__ */ jsxs(Fragment, { children: [t7, t8] });
575
+ $[25] = t7;
576
+ $[26] = t8;
577
+ $[27] = t9;
578
+ } else t9 = $[27];
579
+ return t9;
580
+ }
581
+ /** Apps a person can arrange: everything the Dock and Home list on their own. */
582
+ function dockEligible(apps) {
583
+ return apps.filter((app) => app.launcher !== "hidden" && !app.owner);
584
+ }
585
+ /** Known ids only, every eligible app ordered, and Settings never hidden. */
586
+ function normalizeDock(arrangement, apps) {
587
+ const ids = new Set(dockEligible(apps).map((app) => app.id));
588
+ const known = (list) => [...new Set(list)].filter((id) => ids.has(id));
589
+ return {
590
+ order: known([...arrangement.order, ...ids]),
591
+ hidden: known(arrangement.hidden).filter((id) => id !== "settings")
592
+ };
593
+ }
594
+ /** The catalog in the arranged order, hidden apps kept for Home and search. */
595
+ function arrangeDock(apps, arrangement) {
596
+ const { order, hidden } = normalizeDock(arrangement, apps);
597
+ return [...order.map((id) => {
598
+ const app = apps.find((candidate) => candidate.id === id);
599
+ return hidden.includes(id) ? {
600
+ ...app,
601
+ launcher: "hidden"
602
+ } : app;
603
+ }), ...apps.filter((app) => !order.includes(app.id))];
604
+ }
605
+ /** The Dock pane: show or hide each app and move it along the Dock. */
606
+ function DockSettings(t0) {
607
+ const $ = c(38);
608
+ const { apps, arrangement, onChange, phone, children } = t0;
609
+ const headingId = useId();
610
+ let eligible;
611
+ let t1;
612
+ let t2;
613
+ let t3;
614
+ let t4;
615
+ let t5;
616
+ let t6;
617
+ let t7;
618
+ let update;
619
+ if ($[0] !== apps || $[1] !== arrangement || $[2] !== headingId || $[3] !== onChange || $[4] !== phone) {
620
+ eligible = dockEligible(apps);
621
+ const { order, hidden } = normalizeDock(arrangement, apps);
622
+ const ordered = order.map((id) => eligible.find((app) => app.id === id));
623
+ let t8;
624
+ if ($[14] !== apps || $[15] !== onChange) {
625
+ t8 = (next) => onChange(normalizeDock(next, apps));
626
+ $[14] = apps;
627
+ $[15] = onChange;
628
+ $[16] = t8;
629
+ } else t8 = $[16];
630
+ update = t8;
631
+ const move = function move(id_0, direction) {
632
+ const next_0 = [...order];
633
+ const index = next_0.indexOf(id_0);
634
+ const destination = index + direction;
635
+ if (index < 0 || destination < 0 || destination >= next_0.length) return;
636
+ const [t9, t10] = [next_0[destination], next_0[index]];
637
+ next_0[index] = t9;
638
+ next_0[destination] = t10;
639
+ update({
640
+ order: next_0,
641
+ hidden
642
+ });
643
+ };
644
+ t3 = "computer-dock-settings";
645
+ t4 = phone ? "" : void 0;
646
+ t5 = headingId;
647
+ if ($[17] !== headingId) {
648
+ t6 = /* @__PURE__ */ jsx("h2", {
649
+ id: headingId,
650
+ children: "Dock"
651
+ });
652
+ $[17] = headingId;
653
+ $[18] = t6;
654
+ } else t6 = $[18];
655
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
656
+ t7 = /* @__PURE__ */ jsx("p", { children: "Choose the apps in the Dock. Hidden apps stay in Home and search." });
657
+ $[19] = t7;
658
+ } else t7 = $[19];
659
+ t1 = "computer-dock-settings__list";
660
+ t2 = ordered.map((app_0, index_0) => /* @__PURE__ */ jsxs("li", {
661
+ className: "computer-dock-settings__app",
662
+ children: [
663
+ /* @__PURE__ */ jsxs("div", {
664
+ className: "computer-dock-settings__identity",
665
+ children: [/* @__PURE__ */ jsx(AppIcon.Root, {
666
+ size: "sm",
667
+ "aria-hidden": "true",
668
+ children: app_0.icon
669
+ }), /* @__PURE__ */ jsx("span", { children: app_0.label })]
670
+ }),
671
+ /* @__PURE__ */ jsx("div", {
672
+ className: "computer-dock-settings__choices",
673
+ children: /* @__PURE__ */ jsxs("label", { children: [
674
+ /* @__PURE__ */ jsx(Checkbox.Root, {
675
+ checked: !hidden.includes(app_0.id),
676
+ disabled: app_0.id === "settings",
677
+ onCheckedChange: (checked) => update({
678
+ order,
679
+ hidden: checked ? hidden.filter((id_1) => id_1 !== app_0.id) : [...hidden, app_0.id]
680
+ }),
681
+ children: /* @__PURE__ */ jsx(Checkbox.Indicator, {})
682
+ }),
683
+ /* @__PURE__ */ jsxs("span", {
684
+ className: "sigvelo-visually-hidden",
685
+ children: [
686
+ "Show ",
687
+ app_0.label,
688
+ " in Dock"
689
+ ]
690
+ }),
691
+ /* @__PURE__ */ jsx("span", {
692
+ "aria-hidden": "true",
693
+ children: "Show"
694
+ })
695
+ ] })
696
+ }),
697
+ /* @__PURE__ */ jsxs("div", {
698
+ className: "computer-dock-settings__order",
699
+ children: [/* @__PURE__ */ jsx(IconButton, {
700
+ label: `Move ${app_0.label} up`,
701
+ size: phone ? "xl" : "xs",
702
+ disabled: index_0 === 0,
703
+ focusableWhenDisabled: true,
704
+ variant: "ghost",
705
+ color: "neutral",
706
+ onClick: () => move(app_0.id, -1),
707
+ children: /* @__PURE__ */ jsx(ArrowUpIcon, {})
708
+ }), /* @__PURE__ */ jsx(IconButton, {
709
+ label: `Move ${app_0.label} down`,
710
+ size: phone ? "xl" : "xs",
711
+ disabled: index_0 === ordered.length - 1,
712
+ focusableWhenDisabled: true,
713
+ variant: "ghost",
714
+ color: "neutral",
715
+ onClick: () => move(app_0.id, 1),
716
+ children: /* @__PURE__ */ jsx(ArrowDownIcon, {})
717
+ })]
718
+ })
719
+ ]
720
+ }, app_0.id));
721
+ $[0] = apps;
722
+ $[1] = arrangement;
723
+ $[2] = headingId;
724
+ $[3] = onChange;
725
+ $[4] = phone;
726
+ $[5] = eligible;
727
+ $[6] = t1;
728
+ $[7] = t2;
729
+ $[8] = t3;
730
+ $[9] = t4;
731
+ $[10] = t5;
732
+ $[11] = t6;
733
+ $[12] = t7;
734
+ $[13] = update;
735
+ } else {
736
+ eligible = $[5];
737
+ t1 = $[6];
738
+ t2 = $[7];
739
+ t3 = $[8];
740
+ t4 = $[9];
741
+ t5 = $[10];
742
+ t6 = $[11];
743
+ t7 = $[12];
744
+ update = $[13];
745
+ }
746
+ let t8;
747
+ if ($[20] !== t1 || $[21] !== t2) {
748
+ t8 = /* @__PURE__ */ jsx("ol", {
749
+ className: t1,
750
+ children: t2
751
+ });
752
+ $[20] = t1;
753
+ $[21] = t2;
754
+ $[22] = t8;
755
+ } else t8 = $[22];
756
+ let t9;
757
+ if ($[23] !== eligible || $[24] !== update) {
758
+ t9 = /* @__PURE__ */ jsx(Button, {
759
+ variant: "surface",
760
+ color: "neutral",
761
+ onClick: () => update({
762
+ order: eligible.map(_temp$1),
763
+ hidden: []
764
+ }),
765
+ children: "Reset Dock"
766
+ });
767
+ $[23] = eligible;
768
+ $[24] = update;
769
+ $[25] = t9;
770
+ } else t9 = $[25];
771
+ let t10;
772
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
773
+ t10 = /* @__PURE__ */ jsx("span", { children: "Settings stays in the Dock so you can restore hidden apps." });
774
+ $[26] = t10;
775
+ } else t10 = $[26];
776
+ let t11;
777
+ if ($[27] !== t9) {
778
+ t11 = /* @__PURE__ */ jsxs("div", {
779
+ className: "computer-dock-settings__reset",
780
+ children: [t9, t10]
781
+ });
782
+ $[27] = t9;
783
+ $[28] = t11;
784
+ } else t11 = $[28];
785
+ let t12;
786
+ if ($[29] !== children || $[30] !== t11 || $[31] !== t3 || $[32] !== t4 || $[33] !== t5 || $[34] !== t6 || $[35] !== t7 || $[36] !== t8) {
787
+ t12 = /* @__PURE__ */ jsxs("section", {
788
+ className: t3,
789
+ "data-phone": t4,
790
+ "aria-labelledby": t5,
791
+ children: [
792
+ t6,
793
+ t7,
794
+ t8,
795
+ t11,
796
+ children
797
+ ]
798
+ });
799
+ $[29] = children;
800
+ $[30] = t11;
801
+ $[31] = t3;
802
+ $[32] = t4;
803
+ $[33] = t5;
804
+ $[34] = t6;
805
+ $[35] = t7;
806
+ $[36] = t8;
807
+ $[37] = t12;
808
+ } else t12 = $[37];
809
+ return t12;
810
+ }
811
+ function _temp$1(app_1) {
812
+ return app_1.id;
813
+ }
814
+ //#endregion
815
+ //#region src/components/agents-sdk/ComputerSettings.tsx
816
+ const VIEWS = [
817
+ {
818
+ value: "employee",
819
+ label: "Employee",
820
+ icon: UserIcon
821
+ },
822
+ {
823
+ value: "appearance",
824
+ label: "Appearance",
825
+ icon: MonitorIcon
826
+ },
827
+ {
828
+ value: "dock",
829
+ label: "Dock",
830
+ icon: GridIcon
831
+ },
832
+ {
833
+ value: "shortcuts",
834
+ label: "Keyboard shortcuts",
835
+ icon: KeyboardIcon
836
+ },
837
+ {
838
+ value: "connections",
839
+ label: "Connections",
840
+ icon: LinkIcon
841
+ }
842
+ ];
843
+ const SettingsContext = React.createContext(null);
844
+ function useSettingsHost() {
845
+ const host = React.use(SettingsContext);
846
+ if (!host) throw new Error("Settings needs ComputerSettings.Host.");
847
+ return host;
848
+ }
849
+ function Host(t0) {
850
+ const $ = c(3);
851
+ const { value, children } = t0;
852
+ let t1;
853
+ if ($[0] !== children || $[1] !== value) {
854
+ t1 = /* @__PURE__ */ jsx(SettingsContext, {
855
+ value,
856
+ children
857
+ });
858
+ $[0] = children;
859
+ $[1] = value;
860
+ $[2] = t1;
861
+ } else t1 = $[2];
862
+ return t1;
863
+ }
864
+ /** The host's catalog in the arranged Dock order; pass it to `AgentComputer` inside the Host. */
865
+ function useComputerDockPreferences() {
866
+ const $ = c(3);
867
+ const { apps, dockPreferences } = useSettingsHost();
868
+ let t0;
869
+ if ($[0] !== apps || $[1] !== dockPreferences) {
870
+ t0 = arrangeDock(apps, dockPreferences);
871
+ $[0] = apps;
872
+ $[1] = dockPreferences;
873
+ $[2] = t0;
874
+ } else t0 = $[2];
875
+ return t0;
876
+ }
877
+ function SwitchRow(t0) {
878
+ const $ = c(10);
879
+ const { icon, label, checked, onCheckedChange } = t0;
880
+ let t1;
881
+ if ($[0] !== label) {
882
+ t1 = /* @__PURE__ */ jsx("span", { children: label });
883
+ $[0] = label;
884
+ $[1] = t1;
885
+ } else t1 = $[1];
886
+ let t2;
887
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
888
+ t2 = /* @__PURE__ */ jsx(Switch.Thumb, {});
889
+ $[2] = t2;
890
+ } else t2 = $[2];
891
+ let t3;
892
+ if ($[3] !== checked || $[4] !== onCheckedChange) {
893
+ t3 = /* @__PURE__ */ jsx(Switch.Root, {
894
+ className: "computer-employee-settings__value",
895
+ checked,
896
+ onCheckedChange,
897
+ children: t2
898
+ });
899
+ $[3] = checked;
900
+ $[4] = onCheckedChange;
901
+ $[5] = t3;
902
+ } else t3 = $[5];
903
+ let t4;
904
+ if ($[6] !== icon || $[7] !== t1 || $[8] !== t3) {
905
+ t4 = /* @__PURE__ */ jsxs("label", {
906
+ className: "computer-employee-settings__row",
907
+ children: [
908
+ icon,
909
+ t1,
910
+ t3
911
+ ]
912
+ });
913
+ $[6] = icon;
914
+ $[7] = t1;
915
+ $[8] = t3;
916
+ $[9] = t4;
917
+ } else t4 = $[9];
918
+ return t4;
919
+ }
920
+ function EmployeePane(t0) {
921
+ const $ = c(32);
922
+ const { employee } = t0;
923
+ const { openApp } = useAgentComputerActions();
924
+ const { identity, companion, localAgents, passkeys } = employee;
925
+ let t1;
926
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
927
+ t1 = /* @__PURE__ */ jsx(UserIcon, { "aria-hidden": "true" });
928
+ $[0] = t1;
929
+ } else t1 = $[0];
930
+ let t2;
931
+ if ($[1] !== employee.name) {
932
+ t2 = /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SettingsRow, {
933
+ icon: t1,
934
+ label: "Name",
935
+ value: employee.name
936
+ }) });
937
+ $[1] = employee.name;
938
+ $[2] = t2;
939
+ } else t2 = $[2];
940
+ let t3;
941
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
942
+ t3 = /* @__PURE__ */ jsx(MessageSquareIcon, { "aria-hidden": "true" });
943
+ $[3] = t3;
944
+ } else t3 = $[3];
945
+ const t4 = employee.model ?? "Not set";
946
+ let t5;
947
+ if ($[4] !== employee.onChooseModel || $[5] !== t4) {
948
+ t5 = /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SettingsRow, {
949
+ icon: t3,
950
+ label: "Model",
951
+ value: t4,
952
+ onClick: employee.onChooseModel
953
+ }) });
954
+ $[4] = employee.onChooseModel;
955
+ $[5] = t4;
956
+ $[6] = t5;
957
+ } else t5 = $[6];
958
+ let t6;
959
+ if ($[7] !== identity) {
960
+ t6 = identity ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SettingsRow, {
961
+ icon: /* @__PURE__ */ jsx(MailIcon, { "aria-hidden": "true" }),
962
+ label: "Account",
963
+ value: identity.email ?? identity.assignedAccount
964
+ }) }), /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SettingsRow, {
965
+ icon: /* @__PURE__ */ jsx(ChromeIcon, { "aria-hidden": "true" }),
966
+ label: "Chrome profile",
967
+ value: identity.liveProfile
968
+ }) })] }) : null;
969
+ $[7] = identity;
970
+ $[8] = t6;
971
+ } else t6 = $[8];
972
+ let t7;
973
+ if ($[9] !== companion) {
974
+ t7 = companion ? /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SwitchRow, {
975
+ icon: /* @__PURE__ */ jsx(GlobeIcon, { "aria-hidden": "true" }),
976
+ label: "Companion app",
977
+ checked: companion.enabled,
978
+ onCheckedChange: companion.setEnabled
979
+ }) }) : null;
980
+ $[9] = companion;
981
+ $[10] = t7;
982
+ } else t7 = $[10];
983
+ let t8;
984
+ if ($[11] !== localAgents) {
985
+ t8 = localAgents ? /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SwitchRow, {
986
+ icon: /* @__PURE__ */ jsx(TerminalIcon, { "aria-hidden": "true" }),
987
+ label: "Agents on this computer",
988
+ checked: localAgents.enabled,
989
+ onCheckedChange: localAgents.setEnabled
990
+ }) }) : null;
991
+ $[11] = localAgents;
992
+ $[12] = t8;
993
+ } else t8 = $[12];
994
+ let t9;
995
+ if ($[13] !== passkeys) {
996
+ t9 = passkeys ? /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SwitchRow, {
997
+ icon: /* @__PURE__ */ jsx(LockIcon, { "aria-hidden": "true" }),
998
+ label: "Use its own passkeys",
999
+ checked: passkeys.enabled,
1000
+ onCheckedChange: passkeys.setEnabled
1001
+ }) }) : null;
1002
+ $[13] = passkeys;
1003
+ $[14] = t9;
1004
+ } else t9 = $[14];
1005
+ let t10;
1006
+ let t11;
1007
+ if ($[15] !== employee || $[16] !== openApp) {
1008
+ t10 = (path) => {
1009
+ employee.onOpenFile(path);
1010
+ openApp("files");
1011
+ };
1012
+ t11 = (path_0) => {
1013
+ employee.onOpenFolder(path_0);
1014
+ openApp("files");
1015
+ };
1016
+ $[15] = employee;
1017
+ $[16] = openApp;
1018
+ $[17] = t10;
1019
+ $[18] = t11;
1020
+ } else {
1021
+ t10 = $[17];
1022
+ t11 = $[18];
1023
+ }
1024
+ let t12;
1025
+ if ($[19] !== employee.sourceKey || $[20] !== employee.workspace || $[21] !== t10 || $[22] !== t11) {
1026
+ t12 = /* @__PURE__ */ jsx(EmployeeWorkspaceRows, {
1027
+ source: employee.workspace,
1028
+ sourceKey: employee.sourceKey,
1029
+ onOpenFile: t10,
1030
+ onOpenFolder: t11
1031
+ });
1032
+ $[19] = employee.sourceKey;
1033
+ $[20] = employee.workspace;
1034
+ $[21] = t10;
1035
+ $[22] = t11;
1036
+ $[23] = t12;
1037
+ } else t12 = $[23];
1038
+ let t13;
1039
+ if ($[24] !== t12 || $[25] !== t2 || $[26] !== t5 || $[27] !== t6 || $[28] !== t7 || $[29] !== t8 || $[30] !== t9) {
1040
+ t13 = /* @__PURE__ */ jsxs("ul", {
1041
+ className: "computer-employee-settings",
1042
+ "data-recipe": "inset-group",
1043
+ "aria-label": "Employee",
1044
+ children: [
1045
+ t2,
1046
+ t5,
1047
+ t6,
1048
+ t7,
1049
+ t8,
1050
+ t9,
1051
+ t12
1052
+ ]
1053
+ });
1054
+ $[24] = t12;
1055
+ $[25] = t2;
1056
+ $[26] = t5;
1057
+ $[27] = t6;
1058
+ $[28] = t7;
1059
+ $[29] = t8;
1060
+ $[30] = t9;
1061
+ $[31] = t13;
1062
+ } else t13 = $[31];
1063
+ return t13;
1064
+ }
1065
+ function AppearancePane(t0) {
1066
+ const $ = c(28);
1067
+ const { host } = t0;
1068
+ const id = React.useId();
1069
+ const t1 = `${id}-theme`;
1070
+ const t2 = `${id}-theme`;
1071
+ let t3;
1072
+ if ($[0] !== t2) {
1073
+ t3 = /* @__PURE__ */ jsx("h3", {
1074
+ id: t2,
1075
+ children: "Theme"
1076
+ });
1077
+ $[0] = t2;
1078
+ $[1] = t3;
1079
+ } else t3 = $[1];
1080
+ let t4;
1081
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1082
+ t4 = /* @__PURE__ */ jsx("p", { children: "Choose how controls and windows appear." });
1083
+ $[2] = t4;
1084
+ } else t4 = $[2];
1085
+ let t5;
1086
+ if ($[3] !== t3) {
1087
+ t5 = /* @__PURE__ */ jsxs("header", { children: [t3, t4] });
1088
+ $[3] = t3;
1089
+ $[4] = t5;
1090
+ } else t5 = $[4];
1091
+ let t6;
1092
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
1093
+ t6 = /* @__PURE__ */ jsx(ThemeModeControl, { variant: "previews" });
1094
+ $[5] = t6;
1095
+ } else t6 = $[5];
1096
+ let t7;
1097
+ if ($[6] !== t1 || $[7] !== t5) {
1098
+ t7 = /* @__PURE__ */ jsxs("section", {
1099
+ className: "computer-settings__appearance-group",
1100
+ "aria-labelledby": t1,
1101
+ children: [t5, t6]
1102
+ });
1103
+ $[6] = t1;
1104
+ $[7] = t5;
1105
+ $[8] = t7;
1106
+ } else t7 = $[8];
1107
+ const t8 = `${id}-wallpaper`;
1108
+ const t9 = `${id}-wallpaper`;
1109
+ let t10;
1110
+ if ($[9] !== t9) {
1111
+ t10 = /* @__PURE__ */ jsx("h3", {
1112
+ id: t9,
1113
+ children: "Desktop background"
1114
+ });
1115
+ $[9] = t9;
1116
+ $[10] = t10;
1117
+ } else t10 = $[10];
1118
+ let t11;
1119
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
1120
+ t11 = /* @__PURE__ */ jsx("p", { children: "Choose the image behind windows and desktop files." });
1121
+ $[11] = t11;
1122
+ } else t11 = $[11];
1123
+ let t12;
1124
+ if ($[12] !== t10) {
1125
+ t12 = /* @__PURE__ */ jsxs("header", { children: [t10, t11] });
1126
+ $[12] = t10;
1127
+ $[13] = t12;
1128
+ } else t12 = $[13];
1129
+ let t13;
1130
+ if ($[14] !== host.onWallpaperChange || $[15] !== host.wallpaper || $[16] !== host.wallpapers) {
1131
+ t13 = /* @__PURE__ */ jsx(WallpaperPicker, {
1132
+ wallpapers: host.wallpapers,
1133
+ value: host.wallpaper,
1134
+ onValueChange: host.onWallpaperChange
1135
+ });
1136
+ $[14] = host.onWallpaperChange;
1137
+ $[15] = host.wallpaper;
1138
+ $[16] = host.wallpapers;
1139
+ $[17] = t13;
1140
+ } else t13 = $[17];
1141
+ let t14;
1142
+ if ($[18] !== host.display || $[19] !== t13) {
1143
+ t14 = /* @__PURE__ */ jsxs("div", {
1144
+ className: "computer-wallpapers",
1145
+ children: [t13, host.display]
1146
+ });
1147
+ $[18] = host.display;
1148
+ $[19] = t13;
1149
+ $[20] = t14;
1150
+ } else t14 = $[20];
1151
+ let t15;
1152
+ if ($[21] !== t12 || $[22] !== t14 || $[23] !== t8) {
1153
+ t15 = /* @__PURE__ */ jsxs("section", {
1154
+ className: "computer-settings__appearance-group",
1155
+ "aria-labelledby": t8,
1156
+ children: [t12, t14]
1157
+ });
1158
+ $[21] = t12;
1159
+ $[22] = t14;
1160
+ $[23] = t8;
1161
+ $[24] = t15;
1162
+ } else t15 = $[24];
1163
+ let t16;
1164
+ if ($[25] !== t15 || $[26] !== t7) {
1165
+ t16 = /* @__PURE__ */ jsxs("div", {
1166
+ className: "computer-settings__appearance",
1167
+ children: [t7, t15]
1168
+ });
1169
+ $[25] = t15;
1170
+ $[26] = t7;
1171
+ $[27] = t16;
1172
+ } else t16 = $[27];
1173
+ return t16;
1174
+ }
1175
+ /** The shell's chords, printed from the table its key handler reads, then the apps' own keys. */
1176
+ const SHORTCUTS = [
1177
+ [COMPUTER_SPOTLIGHT_SHORTCUT.glyph, "Search the workspace with Spotlight"],
1178
+ ...[
1179
+ [["switchApps"], "Switch apps; hold ⌥ and press Tab to move, release to switch"],
1180
+ [["nextWindow"], "Cycle through the app’s windows"],
1181
+ [["missionControl", "appExpose"], "Show every open window side by side, or every window of the app"],
1182
+ [["focusMenuBar", "focusDock"], "Move to the menu bar, or to the Dock; the arrow keys move along it"],
1183
+ [["hide", "hideOthers"], "Hide the app, or hide every other app"],
1184
+ [[
1185
+ "minimize",
1186
+ "close",
1187
+ "quit"
1188
+ ], "Minimize or close the window, or quit the app"],
1189
+ [["fill", "center"], "Fill the desktop with the window, or center it"],
1190
+ [[
1191
+ "left",
1192
+ "right",
1193
+ "previousSize"
1194
+ ], "Tile the window left or right, or return it to its previous size"]
1195
+ ].map(([commands, description]) => [commands.map(chordLabel).join(" / "), description]),
1196
+ ["⌘F", "Search within Files"],
1197
+ ["⌘S", "Save an open schedule"],
1198
+ ["Arrow keys", "Move a focused window title; Home restores its starting position"],
1199
+ ["Arrow keys on Resize", "Change the window width or height; Home restores its starting size"],
1200
+ ["Space", "Quick Look for a selected desktop file"],
1201
+ ["+ / − / 0 / 1", "Zoom an image, fit it, or show its actual size while its preview is focused"],
1202
+ ["Escape", "Close search or Quick Look, or leave a full-screen window"]
1203
+ ];
1204
+ function ShortcutsPane(t0) {
1205
+ const $ = c(8);
1206
+ const { additions } = t0;
1207
+ const headingId = React.useId();
1208
+ let t1;
1209
+ if ($[0] !== headingId) {
1210
+ t1 = /* @__PURE__ */ jsx("h2", {
1211
+ id: headingId,
1212
+ children: "Keyboard shortcuts"
1213
+ });
1214
+ $[0] = headingId;
1215
+ $[1] = t1;
1216
+ } else t1 = $[1];
1217
+ let t2;
1218
+ let t3;
1219
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1220
+ t2 = /* @__PURE__ */ jsx("dl", { children: SHORTCUTS.map(_temp) });
1221
+ t3 = /* @__PURE__ */ jsx("p", { children: "Drag a window to the side of the desktop to tile it, or to the top to fill it." });
1222
+ $[2] = t2;
1223
+ $[3] = t3;
1224
+ } else {
1225
+ t2 = $[2];
1226
+ t3 = $[3];
1227
+ }
1228
+ let t4;
1229
+ if ($[4] !== additions || $[5] !== headingId || $[6] !== t1) {
1230
+ t4 = /* @__PURE__ */ jsxs("section", {
1231
+ className: "computer-settings__shortcuts",
1232
+ "aria-labelledby": headingId,
1233
+ children: [
1234
+ t1,
1235
+ t2,
1236
+ t3,
1237
+ additions
1238
+ ]
1239
+ });
1240
+ $[4] = additions;
1241
+ $[5] = headingId;
1242
+ $[6] = t1;
1243
+ $[7] = t4;
1244
+ } else t4 = $[7];
1245
+ return t4;
1246
+ }
1247
+ function _temp(t0) {
1248
+ const [keys, description] = t0;
1249
+ return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: keys }), /* @__PURE__ */ jsx("dd", { children: description })] }, keys);
1250
+ }
1251
+ function Title() {
1252
+ const $ = c(3);
1253
+ const { phone } = useAgentComputerWindow();
1254
+ const { view } = useSettingsHost();
1255
+ let t0;
1256
+ if ($[0] !== phone || $[1] !== view) {
1257
+ t0 = phone ? null : /* @__PURE__ */ jsx(SettingsToolbar, { label: VIEWS.find((item) => item.value === view).label });
1258
+ $[0] = phone;
1259
+ $[1] = view;
1260
+ $[2] = t0;
1261
+ } else t0 = $[2];
1262
+ return t0;
1263
+ }
1264
+ function Content() {
1265
+ const $ = c(25);
1266
+ const { phone } = useAgentComputerWindow();
1267
+ const host = useSettingsHost();
1268
+ const [detailOpen, setDetailOpen] = React.useState(false);
1269
+ const [shownView, setShownView] = React.useState(host.view);
1270
+ if (shownView !== host.view) {
1271
+ setShownView(host.view);
1272
+ setDetailOpen(true);
1273
+ }
1274
+ let t0;
1275
+ if ($[0] !== host.employee) {
1276
+ t0 = /* @__PURE__ */ jsx(EmployeePane, { employee: host.employee });
1277
+ $[0] = host.employee;
1278
+ $[1] = t0;
1279
+ } else t0 = $[1];
1280
+ let t1;
1281
+ if ($[2] !== host) {
1282
+ t1 = /* @__PURE__ */ jsx(AppearancePane, { host });
1283
+ $[2] = host;
1284
+ $[3] = t1;
1285
+ } else t1 = $[3];
1286
+ let t2;
1287
+ if ($[4] !== host.apps || $[5] !== host.dockPreferences || $[6] !== host.onDockPreferencesChange || $[7] !== phone) {
1288
+ t2 = /* @__PURE__ */ jsx(DockSettings, {
1289
+ apps: host.apps,
1290
+ arrangement: host.dockPreferences,
1291
+ onChange: host.onDockPreferencesChange,
1292
+ phone
1293
+ });
1294
+ $[4] = host.apps;
1295
+ $[5] = host.dockPreferences;
1296
+ $[6] = host.onDockPreferencesChange;
1297
+ $[7] = phone;
1298
+ $[8] = t2;
1299
+ } else t2 = $[8];
1300
+ let t3;
1301
+ if ($[9] !== host.shortcuts) {
1302
+ t3 = /* @__PURE__ */ jsx(ShortcutsPane, { additions: host.shortcuts });
1303
+ $[9] = host.shortcuts;
1304
+ $[10] = t3;
1305
+ } else t3 = $[10];
1306
+ let t4;
1307
+ if ($[11] !== host.connections) {
1308
+ t4 = /* @__PURE__ */ jsx("div", {
1309
+ className: "computer-settings__connections",
1310
+ children: host.connections
1311
+ });
1312
+ $[11] = host.connections;
1313
+ $[12] = t4;
1314
+ } else t4 = $[12];
1315
+ let t5;
1316
+ if ($[13] !== t0 || $[14] !== t1 || $[15] !== t2 || $[16] !== t3 || $[17] !== t4) {
1317
+ t5 = {
1318
+ employee: t0,
1319
+ appearance: t1,
1320
+ dock: t2,
1321
+ shortcuts: t3,
1322
+ connections: t4
1323
+ };
1324
+ $[13] = t0;
1325
+ $[14] = t1;
1326
+ $[15] = t2;
1327
+ $[16] = t3;
1328
+ $[17] = t4;
1329
+ $[18] = t5;
1330
+ } else t5 = $[18];
1331
+ let t6;
1332
+ if ($[19] !== detailOpen || $[20] !== host.onViewChange || $[21] !== host.view || $[22] !== phone || $[23] !== t5) {
1333
+ t6 = /* @__PURE__ */ jsx(SettingsLayout, {
1334
+ views: VIEWS,
1335
+ view: host.view,
1336
+ onViewChange: host.onViewChange,
1337
+ detailOpen,
1338
+ onDetailOpenChange: setDetailOpen,
1339
+ phone,
1340
+ panels: t5
1341
+ });
1342
+ $[19] = detailOpen;
1343
+ $[20] = host.onViewChange;
1344
+ $[21] = host.view;
1345
+ $[22] = phone;
1346
+ $[23] = t5;
1347
+ $[24] = t6;
1348
+ } else t6 = $[24];
1349
+ return t6;
1350
+ }
1351
+ /** Settings in the Dock, and the Host it reads: employee, appearance, Dock, shortcuts, connections. */
1352
+ const ComputerSettings = {
1353
+ Host,
1354
+ app: {
1355
+ id: "settings",
1356
+ label: "Settings",
1357
+ icon: computerAppTile(/* @__PURE__ */ jsx(AppIcon.Image, {
1358
+ src: desktopArtwork.settings,
1359
+ alt: ""
1360
+ }), "light-dark(#e5e5ea, #3a3a3c)"),
1361
+ defaultWindowSize: {
1362
+ width: 660,
1363
+ height: 580
1364
+ },
1365
+ titleBar: "unified",
1366
+ Title,
1367
+ Content
1368
+ }
1369
+ };
1370
+ //#endregion
1371
+ export { ComputerSettings, useComputerDockPreferences };