@mcp-b/react-components 0.69.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 (100) 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/Context-CYUxZrwW.js +918 -0
  10. package/dist/{ExecutionResult-C7SzVquo.js → ExecutionResult-CXnGcmM4.js} +1 -1
  11. package/dist/{WorkspaceBrowser-ojoZy0uO.js → WorkspaceBrowser-mRScUczT.js} +5 -5
  12. package/dist/WorkspaceFileTransfer-D2cOoVyO.js +1625 -0
  13. package/dist/{WorkspaceMessageResponse-BoeeltJM.js → WorkspaceMessageResponse-CXGOQgpo.js} +1 -1
  14. package/dist/components/agents-sdk/AgentComputer.d.ts +2 -276
  15. package/dist/components/agents-sdk/AgentComputer.js +1 -1
  16. package/dist/components/agents-sdk/BrowserReplay.js +1 -1
  17. package/dist/components/agents-sdk/ComputerAutomations.d.ts +5 -15
  18. package/dist/components/agents-sdk/ComputerAutomations.js +164 -145
  19. package/dist/components/agents-sdk/ComputerCalendar.d.ts +1 -1
  20. package/dist/components/agents-sdk/ComputerCalendar.js +1 -1344
  21. package/dist/components/agents-sdk/ComputerCustomWallpaper.d.ts +2 -39
  22. package/dist/components/agents-sdk/ComputerCustomWallpaper.js +2 -522
  23. package/dist/components/agents-sdk/ComputerFiles.d.ts +18 -81
  24. package/dist/components/agents-sdk/ComputerFiles.js +365 -89
  25. package/dist/components/agents-sdk/ComputerHome.d.ts +6 -11
  26. package/dist/components/agents-sdk/ComputerHome.js +1 -89
  27. package/dist/components/agents-sdk/ComputerHost.d.ts +43 -0
  28. package/dist/components/agents-sdk/ComputerHost.js +97 -0
  29. package/dist/components/agents-sdk/ComputerLayout.d.ts +1 -1
  30. package/dist/components/agents-sdk/ComputerNotifications.d.ts +2 -54
  31. package/dist/components/agents-sdk/ComputerNotifications.js +1 -668
  32. package/dist/components/agents-sdk/ComputerPresentation.d.ts +2 -0
  33. package/dist/components/agents-sdk/ComputerPresentation.js +2 -0
  34. package/dist/components/agents-sdk/ComputerScreen.d.ts +14 -14
  35. package/dist/components/agents-sdk/ComputerScreen.js +109 -50
  36. package/dist/components/agents-sdk/ComputerSettings.d.ts +12 -40
  37. package/dist/components/agents-sdk/ComputerSettings.js +249 -1038
  38. package/dist/components/agents-sdk/ComputerSpotlight.d.ts +13 -15
  39. package/dist/components/agents-sdk/ComputerSpotlight.js +1 -231
  40. package/dist/components/agents-sdk/ComputerViewer.d.ts +13 -17
  41. package/dist/components/agents-sdk/ComputerViewer.js +176 -187
  42. package/dist/components/agents-sdk/ComputerWallpapers.d.ts +1 -1
  43. package/dist/components/agents-sdk/EmployeeChat.js +2 -2
  44. package/dist/components/agents-sdk/EmployeeChrome.js +3 -3
  45. package/dist/components/agents-sdk/EmployeeSchedules.js +2 -2
  46. package/dist/components/agents-sdk/ExecutionBoard.js +1 -1
  47. package/dist/components/agents-sdk/ManagerOffice.js +1 -1
  48. package/dist/components/agents-sdk/ManagerOfficeScreens.js +2 -2
  49. package/dist/components/agents-sdk/McpPluginCatalog.js +1 -1
  50. package/dist/components/agents-sdk/ThinkChat.js +1 -1
  51. package/dist/components/agents-sdk/ThinkChatToolPanels.js +3 -3
  52. package/dist/components/agents-sdk/ThinkExecutionDetail.js +1 -1
  53. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +2 -2
  54. package/dist/components/agents-sdk/ThinkScheduleActions.js +1 -1
  55. package/dist/components/agents-sdk/ThinkScheduleBrowser.js +1 -1
  56. package/dist/components/agents-sdk/ThinkScheduleDetail.js +4 -4
  57. package/dist/components/agents-sdk/ThinkScheduleForm.js +3 -3
  58. package/dist/components/agents-sdk/WorkspaceAutomation.js +3 -3
  59. package/dist/components/agents-sdk/WorkspaceAutomationTable.js +1 -1
  60. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  61. package/dist/components/agents-sdk/WorkspaceDesktop.d.ts +1 -5
  62. package/dist/components/agents-sdk/WorkspaceDesktop.js +53 -41
  63. package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -3
  64. package/dist/components/agents-sdk/WorkspaceFileCommands.js +1 -924
  65. package/dist/components/agents-sdk/WorkspaceFileDetails.js +1 -1
  66. package/dist/components/agents-sdk/WorkspaceFileTransfer.js +1 -504
  67. package/dist/components/agents-sdk/WorkspaceFileView.js +6 -6
  68. package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
  69. package/dist/components/agents-sdk/WorkspaceLive.d.ts +9 -0
  70. package/dist/components/agents-sdk/WorkspaceLive.js +2 -177
  71. package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
  72. package/dist/components/agents-sdk/WorkspaceMountManager.js +1 -1
  73. package/dist/components/ai-sdk/Context.js +1 -842
  74. package/dist/components/ai-sdk/Plan.d.ts +33 -9
  75. package/dist/components/ai-sdk/Plan.js +336 -107
  76. package/dist/components/ai-sdk/PromptInput.js +1 -1
  77. package/dist/components/extension/FirstRunSetup.js +2 -2
  78. package/dist/components/foundations/ThemeProvider.d.ts +2 -0
  79. package/dist/components/foundations/ThemeProvider.js +2 -1
  80. package/dist/components/general-purpose/CommandPalette.d.ts +2 -52
  81. package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
  82. package/dist/components/general-purpose/WallpaperPicker.d.ts +33 -2
  83. package/dist/components/nanites/AgentConnection.js +1 -1
  84. package/dist/components/nanites/AgentToolDetail.js +1 -1
  85. package/dist/context-BWJpR084.js +94 -0
  86. package/dist/{parts-CPVz9l31.js → parts-DuT5-rDz.js} +1 -1
  87. package/dist/styles/agent-computer.css +16 -0
  88. package/dist/styles/computer-files.css +5 -0
  89. package/dist/styles/computer-notifications.css +1 -0
  90. package/dist/styles/plan.css +160 -23
  91. package/dist/{workspace-drag-B6hMXUNt.js → workspace-drag-BNhZIN8F.js} +1 -1
  92. package/dist/{workspace-quick-look-DODjsfhH.js → workspace-quick-look-8cbGu1Xf.js} +2 -2
  93. package/package.json +2 -2
  94. package/dist/WallpaperPicker-C-FItmDS.d.ts +0 -34
  95. package/dist/automations-host-DPORjdc7.js +0 -17
  96. package/dist/context-Ddsp8HgD.js +0 -43
  97. package/dist/minute-clock-CXpRGCMF.js +0 -35
  98. package/dist/progress-ring-BO649JA9.js +0 -79
  99. package/dist/{ManagerOffice-kSK7vTBl.js → ManagerOffice-BJ2vs-Lr.js} +2 -2
  100. package/dist/{WorkspaceLink-DK9kdMUH.js → WorkspaceLink-DDkj-Tq5.js} +1 -1
@@ -1,5 +1,5 @@
1
1
  import { desktopArtwork } from "../../utils/desktop-artwork.js";
2
- import { C as DownloadIcon, E as EyeIcon, I as ListIcon, J as PencilIcon, V as MessageSquareIcon, Z as PlusIcon, a as ArrowUpDownIcon, et as RefreshIcon, g as ChevronRightIcon, h as ChevronLeftIcon, j as GridIcon, k as FolderIcon, p as CheckIcon, v as ClockIcon, w as EllipsisIcon, y as CodeIcon } from "../../icons-nLTnB9kd.js";
2
+ import { C as DownloadIcon, E as EyeIcon, I as ListIcon, J as PencilIcon, O as FileIcon, V as MessageSquareIcon, Z as PlusIcon, a as ArrowUpDownIcon, et as RefreshIcon, g as ChevronRightIcon, h as ChevronLeftIcon, j as GridIcon, k as FolderIcon, p as CheckIcon, v as ClockIcon, w as EllipsisIcon, y as CodeIcon } from "../../icons-nLTnB9kd.js";
3
3
  import { Field } from "../foundations/Field.js";
4
4
  import { o as formatOperationError } from "../../format-DL7f2rqp.js";
5
5
  import { Button } from "../foundations/Button.js";
@@ -8,27 +8,28 @@ import { IconButton } from "../foundations/IconButton.js";
8
8
  import { AppIcon } from "../foundations/AppIcon.js";
9
9
  import { Menu } from "../foundations/Menu.js";
10
10
  import { a as workspaceDirname, i as workspaceBasename } from "../../workspace-path-TZggP-u4.js";
11
- import { downloadWorkspaceFile, saveWorkspaceFileAs } from "./WorkspaceFileTransfer.js";
12
- import { r as useWorkspaceDragAndDrop } from "../../workspace-drag-B6hMXUNt.js";
13
- import { a as useAgentComputerWindow, r as useAgentComputerAppHandlers } from "../../AgentComputer-CFJxjMFE.js";
11
+ import { useWorkspace, workspaceDirectoryQueryOptions, workspaceInfoQueryKey, workspaceInfoQueryOptions } from "./Workspace.js";
12
+ import { _ as workspaceFileShortcut, a as saveWorkspaceFileAs, d as isHiddenWorkspaceEntry, f as isInWorkspaceTrash, g as workspaceFileCommandForKey, h as useWorkspaceFileCommands, p as isWithin, r as downloadWorkspaceFile, u as WORKSPACE_TRASH } from "../../WorkspaceFileTransfer-D2cOoVyO.js";
13
+ import { r as useWorkspaceDragAndDrop } from "../../workspace-drag-BNhZIN8F.js";
14
+ import { a as useAgentComputerWindow, r as useAgentComputerAppHandlers } from "../../AgentComputer-DZCyQkcE.js";
15
+ import { f as useAppHosts, l as PresentationContext, m as useComputerHost, n as AppHostsContext } from "../../context-BWJpR084.js";
16
+ import { AppTopBar } from "../general-purpose/AppTopBar.js";
17
+ import { COMPUTER_APP_IDS } from "./ComputerAppIds.js";
14
18
  import { Menubar } from "../foundations/Menubar.js";
15
19
  import { EmptyState } from "../foundations/EmptyState.js";
16
- import { COMPUTER_APP_IDS } from "./ComputerAppIds.js";
17
- import { AppTopBar } from "../general-purpose/AppTopBar.js";
18
- import { n as computerAppTile } from "../../parts-CPVz9l31.js";
19
20
  import { SearchField } from "../foundations/SearchField.js";
21
+ import { n as computerAppTile } from "../../parts-DuT5-rDz.js";
20
22
  import { ToggleGroup } from "../foundations/ToggleGroup.js";
21
23
  import { a as hasModifier } from "../../ComputerFileThumbnail-CXHy127c.js";
22
- import { useWorkspace, workspaceInfoQueryKey } from "./Workspace.js";
23
- import { i as WorkspaceThumbnailContext } from "../../workspace-quick-look-DODjsfhH.js";
24
- import { WORKSPACE_TRASH, isHiddenWorkspaceEntry, isInWorkspaceTrash, isWithin, useWorkspaceFileCommands, workspaceFileCommandForKey, workspaceFileShortcut } from "./WorkspaceFileCommands.js";
24
+ import { i as WorkspaceThumbnailContext } from "../../workspace-quick-look-8cbGu1Xf.js";
25
25
  import { WorkspaceFileDetails, WorkspaceFileFacts } from "./WorkspaceFileDetails.js";
26
26
  import { WorkspaceFileView } from "./WorkspaceFileView.js";
27
27
  import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
28
28
  import { ListDetail } from "../general-purpose/ListDetail.js";
29
+ import { WorkspaceDesktop } from "./WorkspaceDesktop.js";
29
30
  import { c } from "react/compiler-runtime";
30
31
  import * as React from "react";
31
- import { useDeferredValue, useRef, useState, useSyncExternalStore } from "react";
32
+ import { use, useDeferredValue, useRef, useState, useSyncExternalStore } from "react";
32
33
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
33
34
  import { useQuery, useQueryClient } from "@tanstack/react-query";
34
35
  //#region src/components/_internal/computer-files/finder.tsx
@@ -119,7 +120,7 @@ function ComputerFilesPreview(t0) {
119
120
  } else t8 = $[11];
120
121
  let t9;
121
122
  if ($[12] !== children) {
122
- t9 = children.map(_temp$1);
123
+ t9 = children.map(_temp$2);
123
124
  $[12] = children;
124
125
  $[13] = t9;
125
126
  } else t9 = $[13];
@@ -176,7 +177,7 @@ function ComputerFilesPreview(t0) {
176
177
  } else t8 = $[28];
177
178
  return t8;
178
179
  }
179
- function _temp$1(child) {
180
+ function _temp$2(child) {
180
181
  return /* @__PURE__ */ jsx("li", { children: child.name }, child.path);
181
182
  }
182
183
  /** Downloads or saves one file and resolves to its status line, including a failure's. */
@@ -1313,9 +1314,11 @@ function folderLineage(path) {
1313
1314
  * search, and which face of a Markdown file shows — the bar and the content
1314
1315
  * are separate subtrees of the same window.
1315
1316
  */
1316
- function useFinderModel(host) {
1317
+ function useFinderModel(host, files) {
1317
1318
  const $ = c(130);
1318
- const { files, navigation, location, onLocation, onBack, onForward, projects, onOpenConversation, onStartConversation, views } = host;
1319
+ const { navigation, location, onLocation, onBack, onForward, projects, onStartConversation } = host;
1320
+ const { onOpenConversation } = useComputerHost("ComputerFiles");
1321
+ const views = use(PresentationContext);
1319
1322
  const { source, sourceKey, resolveFileAsset } = files.home;
1320
1323
  const queryClient = useQueryClient();
1321
1324
  const places = finderPlaces(files.locations);
@@ -1394,7 +1397,7 @@ function useFinderModel(host) {
1394
1397
  const [view, setView] = useState("preview");
1395
1398
  let t6;
1396
1399
  if ($[19] !== location || $[20] !== recents || $[21] !== views) {
1397
- t6 = () => (recents ? [location] : folderLineage(location)).map((folder) => views.get(folder)).find(Boolean) ?? (recents ? RECENTS_VIEW : FOLDER_VIEW);
1400
+ t6 = () => (recents ? [location] : folderLineage(location)).map((folder) => views.get().folders[folder]).find(Boolean) ?? (recents ? RECENTS_VIEW : FOLDER_VIEW);
1398
1401
  $[19] = location;
1399
1402
  $[20] = recents;
1400
1403
  $[21] = views;
@@ -1404,7 +1407,7 @@ function useFinderModel(host) {
1404
1407
  const { layout, sort } = folderView;
1405
1408
  let t7;
1406
1409
  if ($[23] !== folderView || $[24] !== location || $[25] !== views) {
1407
- t7 = (patch) => views.set(location, {
1410
+ t7 = (patch) => views.setFolderView(location, {
1408
1411
  ...folderView,
1409
1412
  ...patch
1410
1413
  });
@@ -2143,7 +2146,7 @@ function useComputerFiles(t0) {
2143
2146
  const [infoPanels, setInfoPanels] = React.useState(t1);
2144
2147
  let t2;
2145
2148
  if ($[1] !== infoPanels) {
2146
- t2 = Object.entries(infoPanels).map(_temp);
2149
+ t2 = Object.entries(infoPanels).map(_temp$1);
2147
2150
  $[1] = infoPanels;
2148
2151
  $[2] = t2;
2149
2152
  } else t2 = $[2];
@@ -2253,49 +2256,348 @@ function _temp3(location_0) {
2253
2256
  function _temp2(location) {
2254
2257
  return location.readOnly;
2255
2258
  }
2256
- function _temp(t0) {
2259
+ function _temp$1(t0) {
2257
2260
  const [id, subject] = t0;
2258
2261
  return infoApp(id, subject);
2259
2262
  }
2260
2263
  //#endregion
2261
2264
  //#region src/components/agents-sdk/ComputerFiles.tsx
2262
- const HostContext = React.createContext(null);
2265
+ /** How many of the files last written lead Spotlight, and how many matches follow them. */
2266
+ const SPOTLIGHT_RECENT = 5;
2267
+ const SPOTLIGHT_FOUND = 25;
2268
+ const FilesContext = React.createContext(null);
2263
2269
  const ModelContext = React.createContext(null);
2264
- function useHost() {
2265
- const host = React.use(HostContext);
2266
- if (!host) throw new Error("ComputerFiles.app needs a ComputerFiles.Host above the computer.");
2267
- return host;
2270
+ function useFilesState() {
2271
+ const state = React.use(FilesContext);
2272
+ if (!state) throw new Error("ComputerFiles.app needs a ComputerFiles.Host above the computer.");
2273
+ return state;
2268
2274
  }
2269
- /** Supplies the Files app, its Get Info windows and its previews with the host's files. */
2275
+ /** A folder by the name Files shows it under: Home, a project's, a place's, or its own. */
2276
+ function folderTitle(host, home, path) {
2277
+ if (path === "/") return home;
2278
+ return host.projects.find((project) => workspaceDirname(project.path) === path)?.name ?? host.locations.find((location) => location.path === path)?.label ?? workspaceBasename(path);
2279
+ }
2280
+ /**
2281
+ * Adds Files, its Get Info windows, the desktop, the Dock's Trash and
2282
+ * Spotlight's file results to the computer below it, inside a `ComputerHost`
2283
+ * whose workspace they read. One clipboard, Undo history and Trash serve the
2284
+ * desktop and every Files window.
2285
+ */
2270
2286
  function Host(t0) {
2271
- const $ = c(6);
2287
+ const $ = c(51);
2272
2288
  const { value, children } = t0;
2289
+ const { computer, workspace } = useComputerHost("ComputerFiles.Host");
2290
+ const volume = workspace.volume;
2291
+ const queryClient = useQueryClient();
2292
+ const latest = React.useRef(value);
2273
2293
  let t1;
2274
- if ($[0] !== children || $[1] !== value.files.infoPanels) {
2275
- t1 = /* @__PURE__ */ jsx(InfoPanels, {
2276
- value: value.files.infoPanels,
2294
+ if ($[0] !== value) {
2295
+ t1 = () => {
2296
+ latest.current = value;
2297
+ };
2298
+ $[0] = value;
2299
+ $[1] = t1;
2300
+ } else t1 = $[1];
2301
+ React.useLayoutEffect(t1);
2302
+ let t2;
2303
+ if ($[2] !== computer) {
2304
+ t2 = (id) => void computer.current?.openApp(id);
2305
+ $[2] = computer;
2306
+ $[3] = t2;
2307
+ } else t2 = $[3];
2308
+ const openApp = t2;
2309
+ let t3;
2310
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
2311
+ t3 = (path) => latest.current.onLocation(path);
2312
+ $[4] = t3;
2313
+ } else t3 = $[4];
2314
+ const openFolder = t3;
2315
+ let t4;
2316
+ if ($[5] !== openApp || $[6] !== value.locations || $[7] !== volume) {
2317
+ t4 = {
2318
+ volume,
2319
+ locations: value.locations,
2320
+ openFolder,
2321
+ openApp
2322
+ };
2323
+ $[5] = openApp;
2324
+ $[6] = value.locations;
2325
+ $[7] = volume;
2326
+ $[8] = t4;
2327
+ } else t4 = $[8];
2328
+ const files = useComputerFiles(t4);
2329
+ const { infoApps, infoPanels, trashFull, openTrash, trashDrop, dialogs } = files;
2330
+ let t5;
2331
+ if ($[9] !== openApp) {
2332
+ t5 = function open(path_0, type) {
2333
+ if (type === "directory") latest.current.onLocation(path_0);
2334
+ else latest.current.navigation.navigate({
2335
+ kind: "file",
2336
+ path: path_0,
2337
+ fragment: null
2338
+ });
2339
+ openApp(COMPUTER_APP_IDS.files);
2340
+ };
2341
+ $[9] = openApp;
2342
+ $[10] = t5;
2343
+ } else t5 = $[10];
2344
+ const open = t5;
2345
+ let t6;
2346
+ if ($[11] !== open || $[12] !== volume) {
2347
+ t6 = function command(entry, group) {
2348
+ const title = (path_1) => folderTitle(latest.current, volume.name, path_1);
2349
+ return {
2350
+ id: `file:${entry.path}`,
2351
+ label: entry.type === "directory" ? title(entry.path) : entry.name,
2352
+ description: title(workspaceDirname(entry.path)),
2353
+ keywords: [entry.path],
2354
+ group,
2355
+ icon: entry.type === "directory" ? /* @__PURE__ */ jsx(FolderIcon, {}) : /* @__PURE__ */ jsx(FileIcon, {}),
2356
+ onSelect: () => open(entry.path, entry.type)
2357
+ };
2358
+ };
2359
+ $[11] = open;
2360
+ $[12] = volume;
2361
+ $[13] = t6;
2362
+ } else t6 = $[13];
2363
+ const command = t6;
2364
+ let t7;
2365
+ if ($[14] !== open || $[15] !== volume) {
2366
+ t7 = (t8) => {
2367
+ const { source, sourceKey, paths } = t8;
2368
+ if (sourceKey !== volume.sourceKey) return;
2369
+ source.stat(paths[0]).then((entry_0) => entry_0 && open(entry_0.path, entry_0.type));
2370
+ };
2371
+ $[14] = open;
2372
+ $[15] = volume;
2373
+ $[16] = t7;
2374
+ } else t7 = $[16];
2375
+ let t8;
2376
+ if ($[17] !== queryClient || $[18] !== volume) {
2377
+ t8 = () => {
2378
+ const { source: source_0, sourceKey: sourceKey_0 } = volume;
2379
+ const { location } = latest.current;
2380
+ queryClient.prefetchQuery(workspaceInfoQueryOptions(source_0, sourceKey_0));
2381
+ queryClient.prefetchQuery(workspaceDirectoryQueryOptions(source_0, sourceKey_0, location, location));
2382
+ };
2383
+ $[17] = queryClient;
2384
+ $[18] = volume;
2385
+ $[19] = t8;
2386
+ } else t8 = $[19];
2387
+ let t9;
2388
+ if ($[20] !== t7 || $[21] !== t8) {
2389
+ t9 = {
2390
+ ...app,
2391
+ onWorkspaceDrop: t7,
2392
+ preload: t8
2393
+ };
2394
+ $[20] = t7;
2395
+ $[21] = t8;
2396
+ $[22] = t9;
2397
+ } else t9 = $[22];
2398
+ let t10;
2399
+ if ($[23] !== infoApps || $[24] !== t9) {
2400
+ t10 = [t9, ...infoApps];
2401
+ $[23] = infoApps;
2402
+ $[24] = t9;
2403
+ $[25] = t10;
2404
+ } else t10 = $[25];
2405
+ let t11;
2406
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
2407
+ t11 = /* @__PURE__ */ jsx(FilesDesktop, {});
2408
+ $[26] = t11;
2409
+ } else t11 = $[26];
2410
+ let t12;
2411
+ if ($[27] !== openTrash || $[28] !== trashDrop || $[29] !== trashFull) {
2412
+ t12 = {
2413
+ full: trashFull,
2414
+ onOpen: openTrash,
2415
+ onDrop: trashDrop
2416
+ };
2417
+ $[27] = openTrash;
2418
+ $[28] = trashDrop;
2419
+ $[29] = trashFull;
2420
+ $[30] = t12;
2421
+ } else t12 = $[30];
2422
+ let t13;
2423
+ if ($[31] !== command) {
2424
+ t13 = async (query) => {
2425
+ const [recent, found] = await Promise.all([latest.current.recent(SPOTLIGHT_RECENT), latest.current.search(query, SPOTLIGHT_FOUND)]);
2426
+ const paths_0 = new Set(recent.map(_temp));
2427
+ return {
2428
+ recent: recent.map((entry_2) => command(entry_2, "Recent")),
2429
+ found: found.filter((entry_3) => !paths_0.has(entry_3.path)).map((entry_4) => command(entry_4, entry_4.type === "directory" ? "Folders" : "Files"))
2430
+ };
2431
+ };
2432
+ $[31] = command;
2433
+ $[32] = t13;
2434
+ } else t13 = $[32];
2435
+ let t14;
2436
+ if ($[33] !== dialogs || $[34] !== open || $[35] !== t10 || $[36] !== t12 || $[37] !== t13) {
2437
+ t14 = {
2438
+ apps: t10,
2439
+ desktop: t11,
2440
+ dialogs,
2441
+ trash: t12,
2442
+ open,
2443
+ spotlight: t13
2444
+ };
2445
+ $[33] = dialogs;
2446
+ $[34] = open;
2447
+ $[35] = t10;
2448
+ $[36] = t12;
2449
+ $[37] = t13;
2450
+ $[38] = t14;
2451
+ } else t14 = $[38];
2452
+ const contribution = t14;
2453
+ let t15;
2454
+ if ($[39] !== files || $[40] !== value) {
2455
+ t15 = {
2456
+ host: value,
2457
+ files
2458
+ };
2459
+ $[39] = files;
2460
+ $[40] = value;
2461
+ $[41] = t15;
2462
+ } else t15 = $[41];
2463
+ const state = t15;
2464
+ const t16 = useAppHosts("files", contribution);
2465
+ let t17;
2466
+ if ($[42] !== children || $[43] !== t16) {
2467
+ t17 = /* @__PURE__ */ jsx(AppHostsContext, {
2468
+ value: t16,
2277
2469
  children
2278
2470
  });
2279
- $[0] = children;
2280
- $[1] = value.files.infoPanels;
2281
- $[2] = t1;
2282
- } else t1 = $[2];
2471
+ $[42] = children;
2472
+ $[43] = t16;
2473
+ $[44] = t17;
2474
+ } else t17 = $[44];
2475
+ let t18;
2476
+ if ($[45] !== infoPanels || $[46] !== t17) {
2477
+ t18 = /* @__PURE__ */ jsx(InfoPanels, {
2478
+ value: infoPanels,
2479
+ children: t17
2480
+ });
2481
+ $[45] = infoPanels;
2482
+ $[46] = t17;
2483
+ $[47] = t18;
2484
+ } else t18 = $[47];
2485
+ let t19;
2486
+ if ($[48] !== state || $[49] !== t18) {
2487
+ t19 = /* @__PURE__ */ jsx(FilesContext, {
2488
+ value: state,
2489
+ children: t18
2490
+ });
2491
+ $[48] = state;
2492
+ $[49] = t18;
2493
+ $[50] = t19;
2494
+ } else t19 = $[50];
2495
+ return t19;
2496
+ }
2497
+ function _temp(entry_1) {
2498
+ return entry_1.path;
2499
+ }
2500
+ /** The workspace's root on the desktop, behind the windows. */
2501
+ function FilesDesktop() {
2502
+ const $ = c(27);
2503
+ const { host, files } = useFilesState();
2504
+ const { workspace } = useComputerHost("ComputerFiles");
2505
+ const { source, sourceKey, resolveFileAsset } = workspace.volume;
2506
+ const open = React.use(AppHostsContext).files.open;
2507
+ let t0;
2508
+ if ($[0] !== resolveFileAsset || $[1] !== source || $[2] !== sourceKey) {
2509
+ t0 = {
2510
+ source,
2511
+ sourceKey,
2512
+ resolveFileAsset,
2513
+ root: "/",
2514
+ selectedPath: null
2515
+ };
2516
+ $[0] = resolveFileAsset;
2517
+ $[1] = source;
2518
+ $[2] = sourceKey;
2519
+ $[3] = t0;
2520
+ } else t0 = $[3];
2521
+ const listing = useWorkspace(t0);
2522
+ let t1;
2523
+ if ($[4] !== listing.entriesByDirectory) {
2524
+ t1 = listing.entriesByDirectory["/"] ?? [];
2525
+ $[4] = listing.entriesByDirectory;
2526
+ $[5] = t1;
2527
+ } else t1 = $[5];
2283
2528
  let t2;
2284
- if ($[3] !== t1 || $[4] !== value) {
2285
- t2 = /* @__PURE__ */ jsx(HostContext, {
2286
- value,
2287
- children: t1
2529
+ if ($[6] !== host.renderUnsupported || $[7] !== resolveFileAsset || $[8] !== source || $[9] !== sourceKey) {
2530
+ t2 = (entry) => /* @__PURE__ */ jsx(ComputerFilesPreview, {
2531
+ entry,
2532
+ source,
2533
+ sourceKey,
2534
+ resolveFileAsset,
2535
+ renderUnsupported: host.renderUnsupported
2288
2536
  });
2289
- $[3] = t1;
2290
- $[4] = value;
2291
- $[5] = t2;
2292
- } else t2 = $[5];
2293
- return t2;
2537
+ $[6] = host.renderUnsupported;
2538
+ $[7] = resolveFileAsset;
2539
+ $[8] = source;
2540
+ $[9] = sourceKey;
2541
+ $[10] = t2;
2542
+ } else t2 = $[10];
2543
+ let t3;
2544
+ if ($[11] !== open) {
2545
+ t3 = (entry_0) => open(entry_0.path, entry_0.type);
2546
+ $[11] = open;
2547
+ $[12] = t3;
2548
+ } else t3 = $[12];
2549
+ let t4;
2550
+ if ($[13] !== files) {
2551
+ t4 = (drop, directory, operation) => void files.drop(files.home, drop, directory, operation);
2552
+ $[13] = files;
2553
+ $[14] = t4;
2554
+ } else t4 = $[14];
2555
+ let t5;
2556
+ if ($[15] !== source || $[16] !== sourceKey || $[17] !== t4) {
2557
+ t5 = {
2558
+ source,
2559
+ sourceKey,
2560
+ onDrop: t4
2561
+ };
2562
+ $[15] = source;
2563
+ $[16] = sourceKey;
2564
+ $[17] = t4;
2565
+ $[18] = t5;
2566
+ } else t5 = $[18];
2567
+ let t6;
2568
+ if ($[19] !== files) {
2569
+ t6 = files.commands(files.home, "desktop");
2570
+ $[19] = files;
2571
+ $[20] = t6;
2572
+ } else t6 = $[20];
2573
+ let t7;
2574
+ if ($[21] !== t1 || $[22] !== t2 || $[23] !== t3 || $[24] !== t5 || $[25] !== t6) {
2575
+ t7 = /* @__PURE__ */ jsx("div", {
2576
+ className: "computer-files-desktop",
2577
+ role: "group",
2578
+ "aria-label": "Desktop background",
2579
+ children: /* @__PURE__ */ jsx(WorkspaceDesktop, {
2580
+ entries: t1,
2581
+ renderPreview: t2,
2582
+ onOpen: t3,
2583
+ dragAndDrop: t5,
2584
+ commands: t6
2585
+ })
2586
+ });
2587
+ $[21] = t1;
2588
+ $[22] = t2;
2589
+ $[23] = t3;
2590
+ $[24] = t5;
2591
+ $[25] = t6;
2592
+ $[26] = t7;
2593
+ } else t7 = $[26];
2594
+ return t7;
2294
2595
  }
2295
2596
  function Provider(t0) {
2296
2597
  const $ = c(5);
2297
2598
  const { children } = t0;
2298
- const model = useFinderModel(useHost());
2599
+ const { host, files } = useFilesState();
2600
+ const model = useFinderModel(host, files);
2299
2601
  let t1;
2300
2602
  if ($[0] !== model.onKeyDown) {
2301
2603
  t1 = { onKeyDown: model.onKeyDown };
@@ -2364,59 +2666,33 @@ function Content() {
2364
2666
  } else t0 = $[2];
2365
2667
  return t0;
2366
2668
  }
2367
- /** What a desktop icon opens into, as Quick Look shows it: a folder's contents, or the file. */
2368
- function Preview(t0) {
2369
- const $ = c(6);
2370
- const { entry } = t0;
2371
- const { files, renderUnsupported } = useHost();
2372
- let t1;
2373
- if ($[0] !== entry || $[1] !== files.home.resolveFileAsset || $[2] !== files.home.source || $[3] !== files.home.sourceKey || $[4] !== renderUnsupported) {
2374
- t1 = /* @__PURE__ */ jsx(ComputerFilesPreview, {
2375
- entry,
2376
- source: files.home.source,
2377
- sourceKey: files.home.sourceKey,
2378
- resolveFileAsset: files.home.resolveFileAsset,
2379
- renderUnsupported
2380
- });
2381
- $[0] = entry;
2382
- $[1] = files.home.resolveFileAsset;
2383
- $[2] = files.home.source;
2384
- $[3] = files.home.sourceKey;
2385
- $[4] = renderUnsupported;
2386
- $[5] = t1;
2387
- } else t1 = $[5];
2388
- return t1;
2389
- }
2669
+ const app = {
2670
+ id: COMPUTER_APP_IDS.files,
2671
+ label: "Files",
2672
+ icon: FILES_ICON,
2673
+ launcher: "favorite",
2674
+ titleBar: "unified",
2675
+ Provider,
2676
+ Title,
2677
+ AppMenu,
2678
+ Menus,
2679
+ Content
2680
+ };
2390
2681
  /**
2391
- * Finder for an agent's workspace, as an `AgentComputer` app. The host keeps
2392
- * one `useFiles` per computer — its clipboard, Undo and Trash are the
2393
- * desktop's too — and hands it, with the address and the queries the Finder
2394
- * reads, to `Host` above the computer. Get Info windows are `useFiles`'s
2395
- * `infoApps`, listed beside `app`.
2682
+ * Finder for an agent's workspace. Its `Host`, inside a `ComputerHost` and
2683
+ * above the computer, adds Files, its Get Info windows, the desktop's files,
2684
+ * the Dock's Trash and Spotlight's file results; the host passes the address
2685
+ * and the queries the Finder reads.
2396
2686
  *
2397
2687
  * ```tsx
2398
- * const files = ComputerFiles.useFiles({ volume, locations, openFolder, openApp });
2399
- * <ComputerFiles.Host value={{ files, recent, search, ...address, ... }}>
2400
- * <AgentComputer apps={[ComputerFiles.app, ...files.infoApps]} … />
2688
+ * <ComputerFiles.Host value={{ locations, recent, search, ...address, projects, onStartConversation }}>
2689
+ * <AgentComputer … />
2401
2690
  * </ComputerFiles.Host>
2402
2691
  * ```
2403
2692
  */
2404
2693
  const ComputerFiles = {
2405
- app: {
2406
- id: COMPUTER_APP_IDS.files,
2407
- label: "Files",
2408
- icon: FILES_ICON,
2409
- launcher: "favorite",
2410
- titleBar: "unified",
2411
- Provider,
2412
- Title,
2413
- AppMenu,
2414
- Menus,
2415
- Content
2416
- },
2417
- Host,
2418
- useFiles: useComputerFiles,
2419
- Preview
2694
+ app,
2695
+ Host
2420
2696
  };
2421
2697
  //#endregion
2422
2698
  export { ComputerFiles };
@@ -1,15 +1,10 @@
1
- import { AgentComputerApp } from "./AgentComputer.js";
1
+ import * as React from "react";
2
2
  //#region src/components/agents-sdk/ComputerHome.d.ts
3
- export interface ComputerHomeProps {
4
- /** The computer's apps. Windows owned by another app and hidden apps are left out. */
5
- apps: readonly AgentComputerApp[];
6
- /** Open the workspace search, typically `ComputerSpotlight`. */
7
- onSearch: () => void;
8
- }
9
3
  /**
10
- * Home: the launchpad and the workspace search, for `AgentComputer`'s `home`.
11
- * A launcher opens its app from its own icon. On a phone the Dock's favorites
12
- * are not repeated, as iOS never repeats a Dock app on the Home page.
4
+ * Home: the launchpad, in the Dock's order with the apps hidden from the Dock
5
+ * kept, and the workspace search. `AgentComputer` draws it. A launcher opens
6
+ * its app from its own icon. On a phone the Dock's favorites are not
7
+ * repeated, as iOS never repeats a Dock app on the Home page.
13
8
  */
14
- export declare function ComputerHome({ apps, onSearch }: ComputerHomeProps): import("react").JSX.Element;
9
+ export declare function ComputerHome(): React.JSX.Element;
15
10
  //#endregion
@@ -1,90 +1,2 @@
1
- import { tt as SearchIcon } from "../../icons-nLTnB9kd.js";
2
- import { Button } from "../foundations/Button.js";
3
- import { AppIcon } from "../foundations/AppIcon.js";
4
- import { n as useAgentComputerActions } from "../../AgentComputer-CFJxjMFE.js";
5
- import { c } from "react/compiler-runtime";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
- //#region src/components/agents-sdk/ComputerHome.tsx
8
- /**
9
- * Home: the launchpad and the workspace search, for `AgentComputer`'s `home`.
10
- * A launcher opens its app from its own icon. On a phone the Dock's favorites
11
- * are not repeated, as iOS never repeats a Dock app on the Home page.
12
- */
13
- function ComputerHome(t0) {
14
- const $ = c(13);
15
- const { apps, onSearch } = t0;
16
- const { openApp } = useAgentComputerActions();
17
- let t1;
18
- if ($[0] !== apps || $[1] !== openApp) {
19
- let t2;
20
- if ($[3] !== openApp) {
21
- t2 = (app_0) => /* @__PURE__ */ jsxs(Button, {
22
- className: "computer-home__launcher",
23
- "data-favorite": app_0.launcher === "favorite" ? "" : void 0,
24
- variant: "ghost",
25
- color: "neutral",
26
- onClick: (event) => void openApp(app_0.id, { from: event.currentTarget.querySelector("[data-app-id]") ?? void 0 }),
27
- children: [/* @__PURE__ */ jsx(AppIcon.Root, {
28
- className: "computer-home__icon",
29
- "data-app-id": app_0.id,
30
- size: "2xl",
31
- "aria-hidden": "true",
32
- children: app_0.icon
33
- }), /* @__PURE__ */ jsx("span", {
34
- className: "computer-home__label",
35
- children: app_0.label
36
- })]
37
- }, app_0.id);
38
- $[3] = openApp;
39
- $[4] = t2;
40
- } else t2 = $[4];
41
- t1 = apps.filter(_temp).map(t2);
42
- $[0] = apps;
43
- $[1] = openApp;
44
- $[2] = t1;
45
- } else t1 = $[2];
46
- let t2;
47
- if ($[5] !== t1) {
48
- t2 = /* @__PURE__ */ jsx("nav", {
49
- className: "computer-home__launchpad",
50
- "aria-label": "Applications",
51
- children: t1
52
- });
53
- $[5] = t1;
54
- $[6] = t2;
55
- } else t2 = $[6];
56
- let t3;
57
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
58
- t3 = /* @__PURE__ */ jsx(SearchIcon, {});
59
- $[7] = t3;
60
- } else t3 = $[7];
61
- let t4;
62
- if ($[8] !== onSearch) {
63
- t4 = /* @__PURE__ */ jsxs(Button, {
64
- className: "computer-home__search",
65
- variant: "surface",
66
- color: "neutral",
67
- "aria-keyshortcuts": "Meta+K Control+K Alt+Space",
68
- onClick: onSearch,
69
- children: [t3, " Search workspace"]
70
- });
71
- $[8] = onSearch;
72
- $[9] = t4;
73
- } else t4 = $[9];
74
- let t5;
75
- if ($[10] !== t2 || $[11] !== t4) {
76
- t5 = /* @__PURE__ */ jsxs("div", {
77
- className: "computer-home",
78
- children: [t2, t4]
79
- });
80
- $[10] = t2;
81
- $[11] = t4;
82
- $[12] = t5;
83
- } else t5 = $[12];
84
- return t5;
85
- }
86
- function _temp(app) {
87
- return !app.owner && app.launcher !== "hidden";
88
- }
89
- //#endregion
1
+ import { s as ComputerHome } from "../../AgentComputer-DZCyQkcE.js";
90
2
  export { ComputerHome };