@mcp-b/react-components 0.70.0 → 0.71.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AgentComputer-CpS9R2KG.d.ts +305 -0
- package/dist/{AgentComputer-CFJxjMFE.js → AgentComputer-CsWDnHwj.js} +1859 -478
- package/dist/CommandPalette-DDctKdpC.d.ts +53 -0
- package/dist/ComputerCalendar-Z6k_DVJF.js +1360 -0
- package/dist/ComputerCustomWallpaper-CnGQYHp0.js +518 -0
- package/dist/ComputerCustomWallpaper-D4lgwj2k.d.ts +18 -0
- package/dist/ComputerNotifications-q7eeELZ8.d.ts +41 -0
- package/dist/ComputerPresentation-BEQKYAjc.js +888 -0
- package/dist/{ExecutionResult-C7SzVquo.js → ExecutionResult-CXnGcmM4.js} +1 -1
- package/dist/{WorkspaceBrowser-ojoZy0uO.js → WorkspaceBrowser-mRScUczT.js} +5 -5
- package/dist/WorkspaceFileTransfer-D2cOoVyO.js +1625 -0
- package/dist/{WorkspaceMessageResponse-BoeeltJM.js → WorkspaceMessageResponse-CXGOQgpo.js} +1 -1
- package/dist/components/agents-sdk/AgentComputer.d.ts +2 -276
- package/dist/components/agents-sdk/AgentComputer.js +1 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/ComputerAutomations.d.ts +5 -15
- package/dist/components/agents-sdk/ComputerAutomations.js +164 -145
- package/dist/components/agents-sdk/ComputerCalendar.d.ts +1 -1
- package/dist/components/agents-sdk/ComputerCalendar.js +1 -1344
- package/dist/components/agents-sdk/ComputerCustomWallpaper.d.ts +2 -39
- package/dist/components/agents-sdk/ComputerCustomWallpaper.js +2 -522
- package/dist/components/agents-sdk/ComputerFiles.d.ts +18 -81
- package/dist/components/agents-sdk/ComputerFiles.js +386 -98
- package/dist/components/agents-sdk/ComputerHome.d.ts +6 -11
- package/dist/components/agents-sdk/ComputerHome.js +1 -89
- package/dist/components/agents-sdk/ComputerHost.d.ts +43 -0
- package/dist/components/agents-sdk/ComputerHost.js +97 -0
- package/dist/components/agents-sdk/ComputerLayout.d.ts +1 -1
- package/dist/components/agents-sdk/ComputerNotifications.d.ts +2 -54
- package/dist/components/agents-sdk/ComputerNotifications.js +1 -668
- package/dist/components/agents-sdk/ComputerPresentation.d.ts +2 -0
- package/dist/components/agents-sdk/ComputerPresentation.js +2 -0
- package/dist/components/agents-sdk/ComputerScreen.d.ts +14 -14
- package/dist/components/agents-sdk/ComputerScreen.js +109 -50
- package/dist/components/agents-sdk/ComputerSettings.d.ts +12 -40
- package/dist/components/agents-sdk/ComputerSettings.js +249 -1038
- package/dist/components/agents-sdk/ComputerSpotlight.d.ts +13 -15
- package/dist/components/agents-sdk/ComputerSpotlight.js +1 -231
- package/dist/components/agents-sdk/ComputerViewer.d.ts +13 -17
- package/dist/components/agents-sdk/ComputerViewer.js +176 -187
- package/dist/components/agents-sdk/ComputerWallpapers.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeChat.js +2 -2
- package/dist/components/agents-sdk/EmployeeChrome.js +3 -3
- package/dist/components/agents-sdk/EmployeeSchedules.js +2 -2
- package/dist/components/agents-sdk/ExecutionBoard.js +1 -1
- package/dist/components/agents-sdk/ManagerOffice.js +1 -1
- package/dist/components/agents-sdk/ManagerOfficeScreens.js +2 -2
- package/dist/components/agents-sdk/McpPluginCatalog.js +1 -1
- package/dist/components/agents-sdk/ThinkChat.js +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +3 -3
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +2 -2
- package/dist/components/agents-sdk/ThinkScheduleActions.js +1 -1
- package/dist/components/agents-sdk/ThinkScheduleBrowser.js +1 -1
- package/dist/components/agents-sdk/ThinkScheduleDetail.js +4 -4
- package/dist/components/agents-sdk/ThinkScheduleForm.js +3 -3
- package/dist/components/agents-sdk/WorkspaceAutomation.js +3 -3
- package/dist/components/agents-sdk/WorkspaceAutomationTable.js +1 -1
- package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
- package/dist/components/agents-sdk/WorkspaceDesktop.d.ts +1 -5
- package/dist/components/agents-sdk/WorkspaceDesktop.js +53 -41
- package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -3
- package/dist/components/agents-sdk/WorkspaceFileCommands.js +1 -924
- package/dist/components/agents-sdk/WorkspaceFileDetails.js +1 -1
- package/dist/components/agents-sdk/WorkspaceFileTransfer.js +1 -504
- package/dist/components/agents-sdk/WorkspaceFileView.js +6 -6
- package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLive.d.ts +9 -0
- package/dist/components/agents-sdk/WorkspaceLive.js +2 -177
- package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
- package/dist/components/agents-sdk/WorkspaceMountManager.js +1 -1
- package/dist/components/ai-sdk/Context.js +1 -1
- package/dist/components/ai-sdk/PromptInput.js +1 -1
- package/dist/components/extension/FirstRunSetup.js +2 -2
- package/dist/components/foundations/ThemeProvider.d.ts +2 -0
- package/dist/components/foundations/ThemeProvider.js +2 -1
- package/dist/components/general-purpose/CommandPalette.d.ts +2 -52
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
- package/dist/components/general-purpose/WallpaperPicker.d.ts +33 -2
- package/dist/components/nanites/AgentConnection.js +1 -1
- package/dist/components/nanites/AgentToolDetail.js +1 -1
- package/dist/context-BWJpR084.js +94 -0
- package/dist/{parts-CPVz9l31.js → parts-BFK5iocu.js} +1 -1
- package/dist/styles/agent-computer.css +16 -0
- package/dist/styles/computer-files.css +5 -0
- package/dist/styles/computer-notifications.css +1 -0
- package/dist/{workspace-drag-B6hMXUNt.js → workspace-drag-BNhZIN8F.js} +1 -1
- package/dist/{workspace-quick-look-DODjsfhH.js → workspace-quick-look-8cbGu1Xf.js} +2 -2
- package/package.json +2 -2
- package/dist/WallpaperPicker-C-FItmDS.d.ts +0 -34
- package/dist/automations-host-DPORjdc7.js +0 -17
- package/dist/context-Ddsp8HgD.js +0 -43
- package/dist/minute-clock-CXpRGCMF.js +0 -35
- package/dist/{Context-DQDumCV8.js → Context-CYUxZrwW.js} +1 -1
- package/dist/{ManagerOffice-kSK7vTBl.js → ManagerOffice-BJ2vs-Lr.js} +2 -2
- 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 {
|
|
12
|
-
import { r as
|
|
13
|
-
import {
|
|
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-CsWDnHwj.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-BFK5iocu.js";
|
|
20
22
|
import { ToggleGroup } from "../foundations/ToggleGroup.js";
|
|
21
23
|
import { a as hasModifier } from "../../ComputerFileThumbnail-CXHy127c.js";
|
|
22
|
-
import {
|
|
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
|
|
@@ -51,11 +52,12 @@ function finderPlaces(locations) {
|
|
|
51
52
|
}
|
|
52
53
|
/**
|
|
53
54
|
* The home volume's source, with Recents and a search read from the host.
|
|
54
|
-
* A Proxy, so a class-backed source keeps its own `this`.
|
|
55
|
+
* A Proxy, so a class-backed source keeps its own `this`. Finder and Spotlight
|
|
56
|
+
* both list through it, so one cached query answers them both.
|
|
55
57
|
*/
|
|
56
58
|
function querySource(source, recent, search) {
|
|
57
59
|
const readDir = async (path = "/", options) => {
|
|
58
|
-
const rows = path === "/.Recents" ? await recent(QUERY_LIMIT) : path.startsWith(
|
|
60
|
+
const rows = path === "/.Recents" ? await recent(QUERY_LIMIT) : path.startsWith("/.Search/") ? await search(decodeURIComponent(path.slice(9)), QUERY_LIMIT) : null;
|
|
59
61
|
if (!rows) return source.readDir(path, options);
|
|
60
62
|
const offset = options?.offset ?? 0;
|
|
61
63
|
return rows.slice(offset, offset + (options?.limit ?? Infinity));
|
|
@@ -119,7 +121,7 @@ function ComputerFilesPreview(t0) {
|
|
|
119
121
|
} else t8 = $[11];
|
|
120
122
|
let t9;
|
|
121
123
|
if ($[12] !== children) {
|
|
122
|
-
t9 = children.map(_temp$
|
|
124
|
+
t9 = children.map(_temp$2);
|
|
123
125
|
$[12] = children;
|
|
124
126
|
$[13] = t9;
|
|
125
127
|
} else t9 = $[13];
|
|
@@ -176,7 +178,7 @@ function ComputerFilesPreview(t0) {
|
|
|
176
178
|
} else t8 = $[28];
|
|
177
179
|
return t8;
|
|
178
180
|
}
|
|
179
|
-
function _temp$
|
|
181
|
+
function _temp$2(child) {
|
|
180
182
|
return /* @__PURE__ */ jsx("li", { children: child.name }, child.path);
|
|
181
183
|
}
|
|
182
184
|
/** Downloads or saves one file and resolves to its status line, including a failure's. */
|
|
@@ -319,7 +321,7 @@ function FinderViewControls(t0) {
|
|
|
319
321
|
} else t8 = $[12];
|
|
320
322
|
let t9;
|
|
321
323
|
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
322
|
-
t9 = SORT_KEYS.map(_temp2$
|
|
324
|
+
t9 = SORT_KEYS.map(_temp2$2);
|
|
323
325
|
$[13] = t9;
|
|
324
326
|
} else t9 = $[13];
|
|
325
327
|
let t10;
|
|
@@ -389,7 +391,7 @@ function FinderViewControls(t0) {
|
|
|
389
391
|
} else t17 = $[30];
|
|
390
392
|
return t17;
|
|
391
393
|
}
|
|
392
|
-
function _temp2$
|
|
394
|
+
function _temp2$2(t0) {
|
|
393
395
|
const [by, label] = t0;
|
|
394
396
|
return /* @__PURE__ */ jsxs(Menu.RadioItem, {
|
|
395
397
|
value: by,
|
|
@@ -623,7 +625,7 @@ function FinderRail(t0) {
|
|
|
623
625
|
const group = phone ? "inset-group" : void 0;
|
|
624
626
|
let t1;
|
|
625
627
|
if ($[0] !== phone || $[1] !== places) {
|
|
626
|
-
t1 = phone ? places.filter(_temp3$
|
|
628
|
+
t1 = phone ? places.filter(_temp3$2) : places;
|
|
627
629
|
$[0] = phone;
|
|
628
630
|
$[1] = places;
|
|
629
631
|
$[2] = t1;
|
|
@@ -768,7 +770,7 @@ function _temp5(event) {
|
|
|
768
770
|
function _temp4(project) {
|
|
769
771
|
return workspaceDirname(project.path);
|
|
770
772
|
}
|
|
771
|
-
function _temp3$
|
|
773
|
+
function _temp3$2(place) {
|
|
772
774
|
return place.path !== "/";
|
|
773
775
|
}
|
|
774
776
|
/** One sidebar location: it opens on a press and, as in Finder, takes a drop and springs open under a held drag. */
|
|
@@ -1313,9 +1315,11 @@ function folderLineage(path) {
|
|
|
1313
1315
|
* search, and which face of a Markdown file shows — the bar and the content
|
|
1314
1316
|
* are separate subtrees of the same window.
|
|
1315
1317
|
*/
|
|
1316
|
-
function useFinderModel(host) {
|
|
1318
|
+
function useFinderModel(host, files) {
|
|
1317
1319
|
const $ = c(130);
|
|
1318
|
-
const {
|
|
1320
|
+
const { navigation, location, onLocation, onBack, onForward, projects, onStartConversation } = host;
|
|
1321
|
+
const { onOpenConversation } = useComputerHost("ComputerFiles");
|
|
1322
|
+
const views = use(PresentationContext);
|
|
1319
1323
|
const { source, sourceKey, resolveFileAsset } = files.home;
|
|
1320
1324
|
const queryClient = useQueryClient();
|
|
1321
1325
|
const places = finderPlaces(files.locations);
|
|
@@ -1394,7 +1398,7 @@ function useFinderModel(host) {
|
|
|
1394
1398
|
const [view, setView] = useState("preview");
|
|
1395
1399
|
let t6;
|
|
1396
1400
|
if ($[19] !== location || $[20] !== recents || $[21] !== views) {
|
|
1397
|
-
t6 = () => (recents ? [location] : folderLineage(location)).map((folder) => views.get(folder)
|
|
1401
|
+
t6 = () => (recents ? [location] : folderLineage(location)).map((folder) => views.get().folders[folder]).find(Boolean) ?? (recents ? RECENTS_VIEW : FOLDER_VIEW);
|
|
1398
1402
|
$[19] = location;
|
|
1399
1403
|
$[20] = recents;
|
|
1400
1404
|
$[21] = views;
|
|
@@ -1404,7 +1408,7 @@ function useFinderModel(host) {
|
|
|
1404
1408
|
const { layout, sort } = folderView;
|
|
1405
1409
|
let t7;
|
|
1406
1410
|
if ($[23] !== folderView || $[24] !== location || $[25] !== views) {
|
|
1407
|
-
t7 = (patch) => views.
|
|
1411
|
+
t7 = (patch) => views.setFolderView(location, {
|
|
1408
1412
|
...folderView,
|
|
1409
1413
|
...patch
|
|
1410
1414
|
});
|
|
@@ -2143,7 +2147,7 @@ function useComputerFiles(t0) {
|
|
|
2143
2147
|
const [infoPanels, setInfoPanels] = React.useState(t1);
|
|
2144
2148
|
let t2;
|
|
2145
2149
|
if ($[1] !== infoPanels) {
|
|
2146
|
-
t2 = Object.entries(infoPanels).map(_temp);
|
|
2150
|
+
t2 = Object.entries(infoPanels).map(_temp$1);
|
|
2147
2151
|
$[1] = infoPanels;
|
|
2148
2152
|
$[2] = t2;
|
|
2149
2153
|
} else t2 = $[2];
|
|
@@ -2207,7 +2211,7 @@ function useComputerFiles(t0) {
|
|
|
2207
2211
|
const getInfo = t6;
|
|
2208
2212
|
let t7;
|
|
2209
2213
|
if ($[12] !== locations) {
|
|
2210
|
-
t7 = locations.filter(_temp2).map(_temp3);
|
|
2214
|
+
t7 = locations.filter(_temp2$1).map(_temp3$1);
|
|
2211
2215
|
$[12] = locations;
|
|
2212
2216
|
$[13] = t7;
|
|
2213
2217
|
} else t7 = $[13];
|
|
@@ -2247,55 +2251,365 @@ function useComputerFiles(t0) {
|
|
|
2247
2251
|
} else t10 = $[24];
|
|
2248
2252
|
return t10;
|
|
2249
2253
|
}
|
|
2250
|
-
function _temp3(location_0) {
|
|
2254
|
+
function _temp3$1(location_0) {
|
|
2251
2255
|
return location_0.path;
|
|
2252
2256
|
}
|
|
2253
|
-
function _temp2(location) {
|
|
2257
|
+
function _temp2$1(location) {
|
|
2254
2258
|
return location.readOnly;
|
|
2255
2259
|
}
|
|
2256
|
-
function _temp(t0) {
|
|
2260
|
+
function _temp$1(t0) {
|
|
2257
2261
|
const [id, subject] = t0;
|
|
2258
2262
|
return infoApp(id, subject);
|
|
2259
2263
|
}
|
|
2260
2264
|
//#endregion
|
|
2261
2265
|
//#region src/components/agents-sdk/ComputerFiles.tsx
|
|
2262
|
-
|
|
2266
|
+
/** How many of the files last written lead Spotlight, and how many matches follow them. */
|
|
2267
|
+
const SPOTLIGHT_RECENT = 5;
|
|
2268
|
+
const SPOTLIGHT_FOUND = 25;
|
|
2269
|
+
const FilesContext = React.createContext(null);
|
|
2263
2270
|
const ModelContext = React.createContext(null);
|
|
2264
|
-
function
|
|
2265
|
-
const
|
|
2266
|
-
if (!
|
|
2267
|
-
return
|
|
2271
|
+
function useFilesState() {
|
|
2272
|
+
const state = React.use(FilesContext);
|
|
2273
|
+
if (!state) throw new Error("ComputerFiles.app needs a ComputerFiles.Host above the computer.");
|
|
2274
|
+
return state;
|
|
2268
2275
|
}
|
|
2269
|
-
/**
|
|
2276
|
+
/** A folder by the name Files shows it under: Home, a project's, a place's, or its own. */
|
|
2277
|
+
function folderTitle(host, home, path) {
|
|
2278
|
+
if (path === "/") return home;
|
|
2279
|
+
return host.projects.find((project) => workspaceDirname(project.path) === path)?.name ?? host.locations.find((location) => location.path === path)?.label ?? workspaceBasename(path);
|
|
2280
|
+
}
|
|
2281
|
+
/**
|
|
2282
|
+
* Adds Files, its Get Info windows, the desktop, the Dock's Trash and
|
|
2283
|
+
* Spotlight's file results to the computer below it, inside a `ComputerHost`
|
|
2284
|
+
* whose workspace they read. One clipboard, Undo history and Trash serve the
|
|
2285
|
+
* desktop and every Files window.
|
|
2286
|
+
*/
|
|
2270
2287
|
function Host(t0) {
|
|
2271
|
-
const $ = c(
|
|
2288
|
+
const $ = c(53);
|
|
2272
2289
|
const { value, children } = t0;
|
|
2290
|
+
const { computer, workspace } = useComputerHost("ComputerFiles.Host");
|
|
2291
|
+
const volume = workspace.volume;
|
|
2292
|
+
const queryClient = useQueryClient();
|
|
2293
|
+
const latest = React.useRef(value);
|
|
2273
2294
|
let t1;
|
|
2274
|
-
if ($[0] !==
|
|
2275
|
-
t1 =
|
|
2276
|
-
|
|
2295
|
+
if ($[0] !== value) {
|
|
2296
|
+
t1 = () => {
|
|
2297
|
+
latest.current = value;
|
|
2298
|
+
};
|
|
2299
|
+
$[0] = value;
|
|
2300
|
+
$[1] = t1;
|
|
2301
|
+
} else t1 = $[1];
|
|
2302
|
+
React.useLayoutEffect(t1);
|
|
2303
|
+
let t2;
|
|
2304
|
+
if ($[2] !== computer) {
|
|
2305
|
+
t2 = (id) => void computer.current?.openApp(id);
|
|
2306
|
+
$[2] = computer;
|
|
2307
|
+
$[3] = t2;
|
|
2308
|
+
} else t2 = $[3];
|
|
2309
|
+
const openApp = t2;
|
|
2310
|
+
let t3;
|
|
2311
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2312
|
+
t3 = (path) => latest.current.onLocation(path);
|
|
2313
|
+
$[4] = t3;
|
|
2314
|
+
} else t3 = $[4];
|
|
2315
|
+
const openFolder = t3;
|
|
2316
|
+
let t4;
|
|
2317
|
+
if ($[5] !== openApp || $[6] !== value.locations || $[7] !== volume) {
|
|
2318
|
+
t4 = {
|
|
2319
|
+
volume,
|
|
2320
|
+
locations: value.locations,
|
|
2321
|
+
openFolder,
|
|
2322
|
+
openApp
|
|
2323
|
+
};
|
|
2324
|
+
$[5] = openApp;
|
|
2325
|
+
$[6] = value.locations;
|
|
2326
|
+
$[7] = volume;
|
|
2327
|
+
$[8] = t4;
|
|
2328
|
+
} else t4 = $[8];
|
|
2329
|
+
const files = useComputerFiles(t4);
|
|
2330
|
+
const { infoApps, infoPanels, trashFull, openTrash, trashDrop, dialogs } = files;
|
|
2331
|
+
let t5;
|
|
2332
|
+
if ($[9] !== openApp) {
|
|
2333
|
+
t5 = function open(path_0, type) {
|
|
2334
|
+
if (type === "directory") latest.current.onLocation(path_0);
|
|
2335
|
+
else latest.current.navigation.navigate({
|
|
2336
|
+
kind: "file",
|
|
2337
|
+
path: path_0,
|
|
2338
|
+
fragment: null
|
|
2339
|
+
});
|
|
2340
|
+
openApp(COMPUTER_APP_IDS.files);
|
|
2341
|
+
};
|
|
2342
|
+
$[9] = openApp;
|
|
2343
|
+
$[10] = t5;
|
|
2344
|
+
} else t5 = $[10];
|
|
2345
|
+
const open = t5;
|
|
2346
|
+
let t6;
|
|
2347
|
+
if ($[11] !== open || $[12] !== volume) {
|
|
2348
|
+
t6 = function command(entry, group) {
|
|
2349
|
+
const title = (path_1) => folderTitle(latest.current, volume.name, path_1);
|
|
2350
|
+
return {
|
|
2351
|
+
id: `file:${entry.path}`,
|
|
2352
|
+
label: entry.type === "directory" ? title(entry.path) : entry.name,
|
|
2353
|
+
description: title(workspaceDirname(entry.path)),
|
|
2354
|
+
keywords: [entry.path],
|
|
2355
|
+
group,
|
|
2356
|
+
icon: entry.type === "directory" ? /* @__PURE__ */ jsx(FolderIcon, {}) : /* @__PURE__ */ jsx(FileIcon, {}),
|
|
2357
|
+
onSelect: () => open(entry.path, entry.type)
|
|
2358
|
+
};
|
|
2359
|
+
};
|
|
2360
|
+
$[11] = open;
|
|
2361
|
+
$[12] = volume;
|
|
2362
|
+
$[13] = t6;
|
|
2363
|
+
} else t6 = $[13];
|
|
2364
|
+
const command = t6;
|
|
2365
|
+
let t7;
|
|
2366
|
+
if ($[14] !== open || $[15] !== volume) {
|
|
2367
|
+
t7 = (t8) => {
|
|
2368
|
+
const { source, sourceKey, paths } = t8;
|
|
2369
|
+
if (sourceKey !== volume.sourceKey) return;
|
|
2370
|
+
source.stat(paths[0]).then((entry_0) => entry_0 && open(entry_0.path, entry_0.type));
|
|
2371
|
+
};
|
|
2372
|
+
$[14] = open;
|
|
2373
|
+
$[15] = volume;
|
|
2374
|
+
$[16] = t7;
|
|
2375
|
+
} else t7 = $[16];
|
|
2376
|
+
let t8;
|
|
2377
|
+
if ($[17] !== queryClient || $[18] !== volume) {
|
|
2378
|
+
t8 = () => {
|
|
2379
|
+
const { source: source_0, sourceKey: sourceKey_0 } = volume;
|
|
2380
|
+
const { location } = latest.current;
|
|
2381
|
+
queryClient.prefetchQuery(workspaceInfoQueryOptions(source_0, sourceKey_0));
|
|
2382
|
+
queryClient.prefetchQuery(workspaceDirectoryQueryOptions(source_0, sourceKey_0, location, location));
|
|
2383
|
+
};
|
|
2384
|
+
$[17] = queryClient;
|
|
2385
|
+
$[18] = volume;
|
|
2386
|
+
$[19] = t8;
|
|
2387
|
+
} else t8 = $[19];
|
|
2388
|
+
let t9;
|
|
2389
|
+
if ($[20] !== t7 || $[21] !== t8) {
|
|
2390
|
+
t9 = {
|
|
2391
|
+
...app,
|
|
2392
|
+
onWorkspaceDrop: t7,
|
|
2393
|
+
preload: t8
|
|
2394
|
+
};
|
|
2395
|
+
$[20] = t7;
|
|
2396
|
+
$[21] = t8;
|
|
2397
|
+
$[22] = t9;
|
|
2398
|
+
} else t9 = $[22];
|
|
2399
|
+
let t10;
|
|
2400
|
+
if ($[23] !== infoApps || $[24] !== t9) {
|
|
2401
|
+
t10 = [t9, ...infoApps];
|
|
2402
|
+
$[23] = infoApps;
|
|
2403
|
+
$[24] = t9;
|
|
2404
|
+
$[25] = t10;
|
|
2405
|
+
} else t10 = $[25];
|
|
2406
|
+
let t11;
|
|
2407
|
+
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2408
|
+
t11 = /* @__PURE__ */ jsx(FilesDesktop, {});
|
|
2409
|
+
$[26] = t11;
|
|
2410
|
+
} else t11 = $[26];
|
|
2411
|
+
let t12;
|
|
2412
|
+
if ($[27] !== openTrash || $[28] !== trashDrop || $[29] !== trashFull) {
|
|
2413
|
+
t12 = {
|
|
2414
|
+
full: trashFull,
|
|
2415
|
+
onOpen: openTrash,
|
|
2416
|
+
onDrop: trashDrop
|
|
2417
|
+
};
|
|
2418
|
+
$[27] = openTrash;
|
|
2419
|
+
$[28] = trashDrop;
|
|
2420
|
+
$[29] = trashFull;
|
|
2421
|
+
$[30] = t12;
|
|
2422
|
+
} else t12 = $[30];
|
|
2423
|
+
let t13;
|
|
2424
|
+
if ($[31] !== command || $[32] !== queryClient || $[33] !== volume) {
|
|
2425
|
+
t13 = async (query) => {
|
|
2426
|
+
const { source: source_1, sourceKey: sourceKey_1 } = volume;
|
|
2427
|
+
const { recent: recentFn, search: searchFn } = latest.current;
|
|
2428
|
+
const listing = (root) => queryClient.fetchQuery(workspaceDirectoryQueryOptions(querySource(source_1, recentFn, searchFn), sourceKey_1, root, root));
|
|
2429
|
+
const [recent, found] = await Promise.all([listing(RECENTS).then(_temp), listing(`${SEARCH}${encodeURIComponent(query)}`).then(_temp2)]);
|
|
2430
|
+
const paths_0 = new Set(recent.map(_temp3));
|
|
2431
|
+
return {
|
|
2432
|
+
recent: recent.map((entry_2) => command(entry_2, "Recent")),
|
|
2433
|
+
found: found.filter((entry_3) => !paths_0.has(entry_3.path)).map((entry_4) => command(entry_4, entry_4.type === "directory" ? "Folders" : "Files"))
|
|
2434
|
+
};
|
|
2435
|
+
};
|
|
2436
|
+
$[31] = command;
|
|
2437
|
+
$[32] = queryClient;
|
|
2438
|
+
$[33] = volume;
|
|
2439
|
+
$[34] = t13;
|
|
2440
|
+
} else t13 = $[34];
|
|
2441
|
+
let t14;
|
|
2442
|
+
if ($[35] !== dialogs || $[36] !== open || $[37] !== t10 || $[38] !== t12 || $[39] !== t13) {
|
|
2443
|
+
t14 = {
|
|
2444
|
+
apps: t10,
|
|
2445
|
+
desktop: t11,
|
|
2446
|
+
dialogs,
|
|
2447
|
+
trash: t12,
|
|
2448
|
+
open,
|
|
2449
|
+
spotlight: t13
|
|
2450
|
+
};
|
|
2451
|
+
$[35] = dialogs;
|
|
2452
|
+
$[36] = open;
|
|
2453
|
+
$[37] = t10;
|
|
2454
|
+
$[38] = t12;
|
|
2455
|
+
$[39] = t13;
|
|
2456
|
+
$[40] = t14;
|
|
2457
|
+
} else t14 = $[40];
|
|
2458
|
+
const contribution = t14;
|
|
2459
|
+
let t15;
|
|
2460
|
+
if ($[41] !== files || $[42] !== value) {
|
|
2461
|
+
t15 = {
|
|
2462
|
+
host: value,
|
|
2463
|
+
files
|
|
2464
|
+
};
|
|
2465
|
+
$[41] = files;
|
|
2466
|
+
$[42] = value;
|
|
2467
|
+
$[43] = t15;
|
|
2468
|
+
} else t15 = $[43];
|
|
2469
|
+
const state = t15;
|
|
2470
|
+
const t16 = useAppHosts("files", contribution);
|
|
2471
|
+
let t17;
|
|
2472
|
+
if ($[44] !== children || $[45] !== t16) {
|
|
2473
|
+
t17 = /* @__PURE__ */ jsx(AppHostsContext, {
|
|
2474
|
+
value: t16,
|
|
2277
2475
|
children
|
|
2278
2476
|
});
|
|
2279
|
-
$[
|
|
2280
|
-
$[
|
|
2281
|
-
$[
|
|
2282
|
-
} else
|
|
2477
|
+
$[44] = children;
|
|
2478
|
+
$[45] = t16;
|
|
2479
|
+
$[46] = t17;
|
|
2480
|
+
} else t17 = $[46];
|
|
2481
|
+
let t18;
|
|
2482
|
+
if ($[47] !== infoPanels || $[48] !== t17) {
|
|
2483
|
+
t18 = /* @__PURE__ */ jsx(InfoPanels, {
|
|
2484
|
+
value: infoPanels,
|
|
2485
|
+
children: t17
|
|
2486
|
+
});
|
|
2487
|
+
$[47] = infoPanels;
|
|
2488
|
+
$[48] = t17;
|
|
2489
|
+
$[49] = t18;
|
|
2490
|
+
} else t18 = $[49];
|
|
2491
|
+
let t19;
|
|
2492
|
+
if ($[50] !== state || $[51] !== t18) {
|
|
2493
|
+
t19 = /* @__PURE__ */ jsx(FilesContext, {
|
|
2494
|
+
value: state,
|
|
2495
|
+
children: t18
|
|
2496
|
+
});
|
|
2497
|
+
$[50] = state;
|
|
2498
|
+
$[51] = t18;
|
|
2499
|
+
$[52] = t19;
|
|
2500
|
+
} else t19 = $[52];
|
|
2501
|
+
return t19;
|
|
2502
|
+
}
|
|
2503
|
+
function _temp3(entry_1) {
|
|
2504
|
+
return entry_1.path;
|
|
2505
|
+
}
|
|
2506
|
+
function _temp2(rows_0) {
|
|
2507
|
+
return rows_0.slice(0, SPOTLIGHT_FOUND);
|
|
2508
|
+
}
|
|
2509
|
+
function _temp(rows) {
|
|
2510
|
+
return rows.slice(0, SPOTLIGHT_RECENT);
|
|
2511
|
+
}
|
|
2512
|
+
/** The workspace's root on the desktop, behind the windows. */
|
|
2513
|
+
function FilesDesktop() {
|
|
2514
|
+
const $ = c(27);
|
|
2515
|
+
const { host, files } = useFilesState();
|
|
2516
|
+
const { workspace } = useComputerHost("ComputerFiles");
|
|
2517
|
+
const { source, sourceKey, resolveFileAsset } = workspace.volume;
|
|
2518
|
+
const open = React.use(AppHostsContext).files.open;
|
|
2519
|
+
let t0;
|
|
2520
|
+
if ($[0] !== resolveFileAsset || $[1] !== source || $[2] !== sourceKey) {
|
|
2521
|
+
t0 = {
|
|
2522
|
+
source,
|
|
2523
|
+
sourceKey,
|
|
2524
|
+
resolveFileAsset,
|
|
2525
|
+
root: "/",
|
|
2526
|
+
selectedPath: null
|
|
2527
|
+
};
|
|
2528
|
+
$[0] = resolveFileAsset;
|
|
2529
|
+
$[1] = source;
|
|
2530
|
+
$[2] = sourceKey;
|
|
2531
|
+
$[3] = t0;
|
|
2532
|
+
} else t0 = $[3];
|
|
2533
|
+
const listing = useWorkspace(t0);
|
|
2534
|
+
let t1;
|
|
2535
|
+
if ($[4] !== listing.entriesByDirectory) {
|
|
2536
|
+
t1 = listing.entriesByDirectory["/"] ?? [];
|
|
2537
|
+
$[4] = listing.entriesByDirectory;
|
|
2538
|
+
$[5] = t1;
|
|
2539
|
+
} else t1 = $[5];
|
|
2283
2540
|
let t2;
|
|
2284
|
-
if ($[
|
|
2285
|
-
t2 = /* @__PURE__ */ jsx(
|
|
2286
|
-
|
|
2287
|
-
|
|
2541
|
+
if ($[6] !== host.renderUnsupported || $[7] !== resolveFileAsset || $[8] !== source || $[9] !== sourceKey) {
|
|
2542
|
+
t2 = (entry) => /* @__PURE__ */ jsx(ComputerFilesPreview, {
|
|
2543
|
+
entry,
|
|
2544
|
+
source,
|
|
2545
|
+
sourceKey,
|
|
2546
|
+
resolveFileAsset,
|
|
2547
|
+
renderUnsupported: host.renderUnsupported
|
|
2288
2548
|
});
|
|
2289
|
-
$[
|
|
2290
|
-
$[
|
|
2291
|
-
$[
|
|
2292
|
-
|
|
2293
|
-
|
|
2549
|
+
$[6] = host.renderUnsupported;
|
|
2550
|
+
$[7] = resolveFileAsset;
|
|
2551
|
+
$[8] = source;
|
|
2552
|
+
$[9] = sourceKey;
|
|
2553
|
+
$[10] = t2;
|
|
2554
|
+
} else t2 = $[10];
|
|
2555
|
+
let t3;
|
|
2556
|
+
if ($[11] !== open) {
|
|
2557
|
+
t3 = (entry_0) => open(entry_0.path, entry_0.type);
|
|
2558
|
+
$[11] = open;
|
|
2559
|
+
$[12] = t3;
|
|
2560
|
+
} else t3 = $[12];
|
|
2561
|
+
let t4;
|
|
2562
|
+
if ($[13] !== files) {
|
|
2563
|
+
t4 = (drop, directory, operation) => void files.drop(files.home, drop, directory, operation);
|
|
2564
|
+
$[13] = files;
|
|
2565
|
+
$[14] = t4;
|
|
2566
|
+
} else t4 = $[14];
|
|
2567
|
+
let t5;
|
|
2568
|
+
if ($[15] !== source || $[16] !== sourceKey || $[17] !== t4) {
|
|
2569
|
+
t5 = {
|
|
2570
|
+
source,
|
|
2571
|
+
sourceKey,
|
|
2572
|
+
onDrop: t4
|
|
2573
|
+
};
|
|
2574
|
+
$[15] = source;
|
|
2575
|
+
$[16] = sourceKey;
|
|
2576
|
+
$[17] = t4;
|
|
2577
|
+
$[18] = t5;
|
|
2578
|
+
} else t5 = $[18];
|
|
2579
|
+
let t6;
|
|
2580
|
+
if ($[19] !== files) {
|
|
2581
|
+
t6 = files.commands(files.home, "desktop");
|
|
2582
|
+
$[19] = files;
|
|
2583
|
+
$[20] = t6;
|
|
2584
|
+
} else t6 = $[20];
|
|
2585
|
+
let t7;
|
|
2586
|
+
if ($[21] !== t1 || $[22] !== t2 || $[23] !== t3 || $[24] !== t5 || $[25] !== t6) {
|
|
2587
|
+
t7 = /* @__PURE__ */ jsx("div", {
|
|
2588
|
+
className: "computer-files-desktop",
|
|
2589
|
+
role: "group",
|
|
2590
|
+
"aria-label": "Desktop background",
|
|
2591
|
+
children: /* @__PURE__ */ jsx(WorkspaceDesktop, {
|
|
2592
|
+
entries: t1,
|
|
2593
|
+
renderPreview: t2,
|
|
2594
|
+
onOpen: t3,
|
|
2595
|
+
dragAndDrop: t5,
|
|
2596
|
+
commands: t6
|
|
2597
|
+
})
|
|
2598
|
+
});
|
|
2599
|
+
$[21] = t1;
|
|
2600
|
+
$[22] = t2;
|
|
2601
|
+
$[23] = t3;
|
|
2602
|
+
$[24] = t5;
|
|
2603
|
+
$[25] = t6;
|
|
2604
|
+
$[26] = t7;
|
|
2605
|
+
} else t7 = $[26];
|
|
2606
|
+
return t7;
|
|
2294
2607
|
}
|
|
2295
2608
|
function Provider(t0) {
|
|
2296
2609
|
const $ = c(5);
|
|
2297
2610
|
const { children } = t0;
|
|
2298
|
-
const
|
|
2611
|
+
const { host, files } = useFilesState();
|
|
2612
|
+
const model = useFinderModel(host, files);
|
|
2299
2613
|
let t1;
|
|
2300
2614
|
if ($[0] !== model.onKeyDown) {
|
|
2301
2615
|
t1 = { onKeyDown: model.onKeyDown };
|
|
@@ -2364,59 +2678,33 @@ function Content() {
|
|
|
2364
2678
|
} else t0 = $[2];
|
|
2365
2679
|
return t0;
|
|
2366
2680
|
}
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
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
|
-
}
|
|
2681
|
+
const app = {
|
|
2682
|
+
id: COMPUTER_APP_IDS.files,
|
|
2683
|
+
label: "Files",
|
|
2684
|
+
icon: FILES_ICON,
|
|
2685
|
+
launcher: "favorite",
|
|
2686
|
+
titleBar: "unified",
|
|
2687
|
+
Provider,
|
|
2688
|
+
Title,
|
|
2689
|
+
AppMenu,
|
|
2690
|
+
Menus,
|
|
2691
|
+
Content
|
|
2692
|
+
};
|
|
2390
2693
|
/**
|
|
2391
|
-
* Finder for an agent's workspace
|
|
2392
|
-
*
|
|
2393
|
-
*
|
|
2394
|
-
*
|
|
2395
|
-
* `infoApps`, listed beside `app`.
|
|
2694
|
+
* Finder for an agent's workspace. Its `Host`, inside a `ComputerHost` and
|
|
2695
|
+
* above the computer, adds Files, its Get Info windows, the desktop's files,
|
|
2696
|
+
* the Dock's Trash and Spotlight's file results; the host passes the address
|
|
2697
|
+
* and the queries the Finder reads.
|
|
2396
2698
|
*
|
|
2397
2699
|
* ```tsx
|
|
2398
|
-
*
|
|
2399
|
-
*
|
|
2400
|
-
* <AgentComputer apps={[ComputerFiles.app, ...files.infoApps]} … />
|
|
2700
|
+
* <ComputerFiles.Host value={{ locations, recent, search, ...address, projects, onStartConversation }}>
|
|
2701
|
+
* <AgentComputer … />
|
|
2401
2702
|
* </ComputerFiles.Host>
|
|
2402
2703
|
* ```
|
|
2403
2704
|
*/
|
|
2404
2705
|
const ComputerFiles = {
|
|
2405
|
-
app
|
|
2406
|
-
|
|
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
|
|
2706
|
+
app,
|
|
2707
|
+
Host
|
|
2420
2708
|
};
|
|
2421
2709
|
//#endregion
|
|
2422
2710
|
export { ComputerFiles };
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import
|
|
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
|
|
11
|
-
*
|
|
12
|
-
*
|
|
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(
|
|
9
|
+
export declare function ComputerHome(): React.JSX.Element;
|
|
15
10
|
//#endregion
|