@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
@@ -283,6 +283,10 @@ async function workspaceRenameTarget(source, path, name) {
283
283
  if (await source.exists(to)) throw new Error(`The name “${trimmed}” is already taken. Please choose a different name.`);
284
284
  return to;
285
285
  }
286
+ /** Whether `path` is `folder` or inside it. */
287
+ function isWithin(path, folder) {
288
+ return folder === "/" || path === folder || path.startsWith(`${folder}/`);
289
+ }
286
290
  /** "untitled folder", or the first free "untitled folder 2"… in `directory`. */
287
291
  function newWorkspaceFolderPath(source, directory) {
288
292
  return availableWorkspacePath(source, directory, "untitled folder", {
@@ -336,29 +340,36 @@ function writeSystemClipboard(source, paths) {
336
340
  * ```
337
341
  */
338
342
  function useWorkspaceFileCommands(t0) {
339
- const $ = c(102);
340
- const { home, openFolder, getInfo, onStatus } = t0;
341
- const queryClient = useQueryClient();
342
- let t1;
343
- if ($[0] !== onStatus) {
344
- t1 = { onStatus };
345
- $[0] = onStatus;
346
- $[1] = t1;
347
- } else t1 = $[1];
348
- const transfer = useWorkspaceTransfer(t1);
349
- const [clipboard, setClipboard] = React.useState(null);
343
+ const $ = c(111);
344
+ const { home, readOnly: t1, openFolder, getInfo, onStatus } = t0;
350
345
  let t2;
351
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
352
- t2 = [];
353
- $[2] = t2;
354
- } else t2 = $[2];
355
- const [undoStack, setUndoStack] = React.useState(t2);
346
+ if ($[0] !== t1) {
347
+ t2 = t1 === void 0 ? [] : t1;
348
+ $[0] = t1;
349
+ $[1] = t2;
350
+ } else t2 = $[1];
351
+ const readOnly = t2;
352
+ const queryClient = useQueryClient();
356
353
  let t3;
357
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
358
- t3 = [];
354
+ if ($[2] !== onStatus) {
355
+ t3 = { onStatus };
356
+ $[2] = onStatus;
359
357
  $[3] = t3;
360
358
  } else t3 = $[3];
361
- const [redoStack, setRedoStack] = React.useState(t3);
359
+ const transfer = useWorkspaceTransfer(t3);
360
+ const [clipboard, setClipboard] = React.useState(null);
361
+ let t4;
362
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
363
+ t4 = [];
364
+ $[4] = t4;
365
+ } else t4 = $[4];
366
+ const [undoStack, setUndoStack] = React.useState(t4);
367
+ let t5;
368
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
369
+ t5 = [];
370
+ $[5] = t5;
371
+ } else t5 = $[5];
372
+ const [redoStack, setRedoStack] = React.useState(t5);
362
373
  const [confirm, setConfirm] = React.useState(null);
363
374
  const busy = React.useRef(false);
364
375
  const trashFull = useQuery({
@@ -369,47 +380,55 @@ function useWorkspaceFileCommands(t0) {
369
380
  ],
370
381
  queryFn: () => workspaceTrashIsFull(home.source)
371
382
  }).data ?? false;
372
- let t4;
373
- if ($[4] !== queryClient) {
374
- t4 = (volume) => queryClient.invalidateQueries({ queryKey: ["workspace", volume.sourceKey] });
375
- $[4] = queryClient;
376
- $[5] = t4;
377
- } else t4 = $[5];
378
- const reload = t4;
379
- let t5;
380
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
381
- t5 = function record(entry) {
383
+ let t6;
384
+ if ($[6] !== home.sourceKey || $[7] !== readOnly) {
385
+ t6 = (volume, path) => volume.sourceKey === home.sourceKey && readOnly.some((folder) => isWithin(path, folder));
386
+ $[6] = home.sourceKey;
387
+ $[7] = readOnly;
388
+ $[8] = t6;
389
+ } else t6 = $[8];
390
+ const locked = t6;
391
+ let t7;
392
+ if ($[9] !== queryClient) {
393
+ t7 = (volume_0) => queryClient.invalidateQueries({ queryKey: ["workspace", volume_0.sourceKey] });
394
+ $[9] = queryClient;
395
+ $[10] = t7;
396
+ } else t7 = $[10];
397
+ const reload = t7;
398
+ let t8;
399
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
400
+ t8 = function record(entry) {
382
401
  if (!entry.operations.length) return;
383
402
  setUndoStack((stack) => [...stack, entry]);
384
403
  setRedoStack([]);
385
404
  };
386
- $[6] = t5;
387
- } else t5 = $[6];
388
- const record = t5;
389
- let t6;
390
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
391
- t6 = function ask(question) {
405
+ $[11] = t8;
406
+ } else t8 = $[11];
407
+ const record = t8;
408
+ let t9;
409
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
410
+ t9 = function ask(question) {
392
411
  return new Promise((resolve) => setConfirm({
393
412
  ...question,
394
413
  resolve
395
414
  }));
396
415
  };
397
- $[7] = t6;
398
- } else t6 = $[7];
399
- const ask = t6;
400
- let t7;
401
- if ($[8] !== confirm) {
402
- t7 = function answer(confirmed) {
416
+ $[12] = t9;
417
+ } else t9 = $[12];
418
+ const ask = t9;
419
+ let t10;
420
+ if ($[13] !== confirm) {
421
+ t10 = function answer(confirmed) {
403
422
  confirm?.resolve(confirmed);
404
423
  setConfirm(null);
405
424
  };
406
- $[8] = confirm;
407
- $[9] = t7;
408
- } else t7 = $[9];
409
- const answer = t7;
410
- let t8;
411
- if ($[10] !== transfer) {
412
- t8 = async function exclusive(title, work) {
425
+ $[13] = confirm;
426
+ $[14] = t10;
427
+ } else t10 = $[14];
428
+ const answer = t10;
429
+ let t11;
430
+ if ($[15] !== transfer) {
431
+ t11 = async function exclusive(title, work) {
413
432
  if (busy.current) return;
414
433
  busy.current = true;
415
434
  const result = await work().then(_temp, _temp2);
@@ -423,33 +442,35 @@ function useWorkspaceFileCommands(t0) {
423
442
  }
424
443
  return result.value;
425
444
  };
426
- $[10] = transfer;
427
- $[11] = t8;
428
- } else t8 = $[11];
429
- const exclusive = t8;
430
- let t9;
431
- if ($[12] !== exclusive || $[13] !== reload) {
432
- t9 = async function apply(volume_0, label, operations) {
433
- const inverse = await exclusive(`${label} couldn’t be completed`, () => runWorkspaceFileOperations(volume_0.source, operations));
434
- await reload(volume_0);
445
+ $[15] = transfer;
446
+ $[16] = t11;
447
+ } else t11 = $[16];
448
+ const exclusive = t11;
449
+ let t12;
450
+ if ($[17] !== exclusive || $[18] !== reload) {
451
+ t12 = async function apply(volume_1, label, operations) {
452
+ const inverse = await exclusive(`${label} couldn’t be completed`, () => runWorkspaceFileOperations(volume_1.source, operations));
453
+ await reload(volume_1);
435
454
  if (!inverse) return [];
436
455
  record({
437
456
  label,
438
- volume: volume_0,
457
+ volume: volume_1,
439
458
  operations: inverse
440
459
  });
441
460
  return workspaceFileOperationPaths(inverse);
442
461
  };
443
- $[12] = exclusive;
444
- $[13] = reload;
445
- $[14] = t9;
446
- } else t9 = $[14];
447
- const apply = t9;
448
- let t10;
449
- if ($[15] !== apply || $[16] !== exclusive || $[17] !== reload) {
450
- t10 = async function trash(volume_1, paths) {
451
- if (!volume_1.linked) {
452
- await apply(volume_1, `Move of ${subject(paths)}`, paths.map(_temp3));
462
+ $[17] = exclusive;
463
+ $[18] = reload;
464
+ $[19] = t12;
465
+ } else t12 = $[19];
466
+ const apply = t12;
467
+ let t13;
468
+ if ($[20] !== apply || $[21] !== exclusive || $[22] !== locked || $[23] !== reload) {
469
+ t13 = async function trash(volume_2, all) {
470
+ const paths = all.filter((path_0) => !locked(volume_2, path_0));
471
+ if (!paths.length) return;
472
+ if (!volume_2.linked) {
473
+ await apply(volume_2, `Move of ${subject(paths)}`, paths.map(_temp3));
453
474
  return;
454
475
  }
455
476
  if (!await ask({
@@ -458,22 +479,23 @@ function useWorkspaceFileCommands(t0) {
458
479
  action: "Delete"
459
480
  })) return;
460
481
  await exclusive("The items couldn’t be deleted", async () => {
461
- for (const path_0 of paths) await volume_1.source.rm(path_0, {
482
+ for (const path_2 of paths) await volume_2.source.rm(path_2, {
462
483
  recursive: true,
463
484
  force: true
464
485
  });
465
486
  });
466
- await reload(volume_1);
487
+ await reload(volume_2);
467
488
  };
468
- $[15] = apply;
469
- $[16] = exclusive;
470
- $[17] = reload;
471
- $[18] = t10;
472
- } else t10 = $[18];
473
- const trash = t10;
474
- let t11;
475
- if ($[19] !== exclusive || $[20] !== home || $[21] !== reload) {
476
- t11 = async function emptyTrash() {
489
+ $[20] = apply;
490
+ $[21] = exclusive;
491
+ $[22] = locked;
492
+ $[23] = reload;
493
+ $[24] = t13;
494
+ } else t13 = $[24];
495
+ const trash = t13;
496
+ let t14;
497
+ if ($[25] !== exclusive || $[26] !== home || $[27] !== reload) {
498
+ t14 = async function emptyTrash() {
477
499
  if (!await ask({
478
500
  title: "Are you sure you want to permanently erase the items in the Trash?",
479
501
  detail: "You can’t undo this action.",
@@ -482,55 +504,59 @@ function useWorkspaceFileCommands(t0) {
482
504
  await exclusive("The Trash couldn’t be emptied", () => emptyWorkspaceTrash(home.source));
483
505
  await reload(home);
484
506
  };
485
- $[19] = exclusive;
486
- $[20] = home;
487
- $[21] = reload;
488
- $[22] = t11;
489
- } else t11 = $[22];
490
- const emptyTrash = t11;
491
- let t12;
492
- if ($[23] !== transfer || $[24] !== trash) {
493
- t12 = async function drop(volume_2, dropped, directory, operation, label_0) {
494
- if (dropped.kind === "workspace" && dropped.sourceKey === volume_2.sourceKey && !volume_2.linked && directory === "/.Trash") {
495
- await trash(volume_2, dropped.paths);
507
+ $[25] = exclusive;
508
+ $[26] = home;
509
+ $[27] = reload;
510
+ $[28] = t14;
511
+ } else t14 = $[28];
512
+ const emptyTrash = t14;
513
+ let t15;
514
+ if ($[29] !== home || $[30] !== locked || $[31] !== transfer || $[32] !== trash) {
515
+ t15 = async function drop(volume_3, dropped, directory, requested, label_0) {
516
+ if (locked(volume_3, directory)) return [];
517
+ const operation = dropped.kind === "workspace" && dropped.sourceKey === home.sourceKey && dropped.paths.some((path_3) => locked(home, path_3)) ? "copy" : requested;
518
+ if (dropped.kind === "workspace" && dropped.sourceKey === volume_3.sourceKey && !volume_3.linked && directory === "/.Trash") {
519
+ await trash(volume_3, dropped.paths);
496
520
  return [];
497
521
  }
498
522
  const result_0 = await transfer.run({
499
523
  drop: dropped,
500
- destination: volume_2.source,
501
- destinationKey: volume_2.sourceKey,
524
+ destination: volume_3.source,
525
+ destinationKey: volume_3.sourceKey,
502
526
  directory,
503
527
  operation
504
528
  });
505
529
  if (!result_0) return [];
506
- const moved = dropped.kind === "workspace" && dropped.sourceKey === volume_2.sourceKey;
507
- const operations_0 = result_0.landed.flatMap((t13) => {
508
- const { from, path: path_1 } = t13;
530
+ const moved = dropped.kind === "workspace" && dropped.sourceKey === volume_3.sourceKey;
531
+ const operations_0 = result_0.landed.flatMap((t16) => {
532
+ const { from, path: path_4 } = t16;
509
533
  return moved && operation === "move" && from ? [{
510
534
  kind: "move",
511
- from: path_1,
535
+ from: path_4,
512
536
  to: from
513
- }] : volume_2.linked ? [] : [{
537
+ }] : volume_3.linked ? [] : [{
514
538
  kind: "trash",
515
- path: path_1
539
+ path: path_4
516
540
  }];
517
541
  });
518
542
  const paths_0 = result_0.landed.map(_temp4);
519
543
  record({
520
544
  label: label_0 ?? `${moved && operation === "move" ? "Move" : "Copy"} of ${subject(paths_0)}`,
521
- volume: volume_2,
545
+ volume: volume_3,
522
546
  operations: operations_0.toReversed()
523
547
  });
524
548
  return paths_0;
525
549
  };
526
- $[23] = transfer;
527
- $[24] = trash;
528
- $[25] = t12;
529
- } else t12 = $[25];
530
- const drop = t12;
531
- let t13;
532
- if ($[26] !== exclusive || $[27] !== redoStack || $[28] !== reload || $[29] !== undoStack) {
533
- t13 = async function step(direction) {
550
+ $[29] = home;
551
+ $[30] = locked;
552
+ $[31] = transfer;
553
+ $[32] = trash;
554
+ $[33] = t15;
555
+ } else t15 = $[33];
556
+ const drop = t15;
557
+ let t16;
558
+ if ($[34] !== exclusive || $[35] !== redoStack || $[36] !== reload || $[37] !== undoStack) {
559
+ t16 = async function step(direction) {
534
560
  const [from_0, setFrom, setTo] = direction === "undo" ? [
535
561
  undoStack,
536
562
  setUndoStack,
@@ -552,32 +578,34 @@ function useWorkspaceFileCommands(t0) {
552
578
  }]);
553
579
  return workspaceFileOperationPaths(inverse_0);
554
580
  };
555
- $[26] = exclusive;
556
- $[27] = redoStack;
557
- $[28] = reload;
558
- $[29] = undoStack;
559
- $[30] = t13;
560
- } else t13 = $[30];
561
- const step = t13;
562
- let t14;
563
- if ($[31] !== apply || $[32] !== clipboard || $[33] !== drop || $[34] !== emptyTrash || $[35] !== exclusive || $[36] !== getInfo || $[37] !== openFolder || $[38] !== redoStack.length || $[39] !== reload || $[40] !== step || $[41] !== transfer || $[42] !== trash || $[43] !== trashFull || $[44] !== undoStack.length) {
564
- t14 = function commands(volume_3, surface) {
581
+ $[34] = exclusive;
582
+ $[35] = redoStack;
583
+ $[36] = reload;
584
+ $[37] = undoStack;
585
+ $[38] = t16;
586
+ } else t16 = $[38];
587
+ const step = t16;
588
+ let t17;
589
+ if ($[39] !== apply || $[40] !== clipboard || $[41] !== drop || $[42] !== emptyTrash || $[43] !== exclusive || $[44] !== getInfo || $[45] !== locked || $[46] !== openFolder || $[47] !== redoStack.length || $[48] !== reload || $[49] !== step || $[50] !== transfer || $[51] !== trash || $[52] !== trashFull || $[53] !== undoStack.length) {
590
+ t17 = function commands(volume_4, surface) {
565
591
  const canRun = (command, target) => {
566
- const inTrash = !volume_3.linked && target.directory === "/.Trash";
592
+ const inTrash = !volume_4.linked && target.directory === "/.Trash";
567
593
  const some = target.paths.length > 0;
594
+ const fixed = target.paths.some((path_6) => locked(volume_4, path_6));
595
+ const closed = locked(volume_4, target.directory);
568
596
  switch (command) {
569
597
  case "open":
570
598
  case "quick-look":
571
- case "copy":
572
- case "cut": return some;
599
+ case "copy": return some;
600
+ case "cut": return some && !fixed;
573
601
  case "get-info": return getInfo !== void 0;
574
602
  case "select-all": return true;
575
- case "rename": return target.paths.length === 1 && !inTrash;
576
- case "duplicate":
577
- case "trash": return some && !inTrash;
578
- case "paste": return !inTrash && (clipboard !== null || Boolean(target.files?.length));
579
- case "move-here": return !inTrash && clipboard !== null;
580
- case "new-folder": return !inTrash;
603
+ case "rename": return target.paths.length === 1 && !inTrash && !fixed;
604
+ case "duplicate": return some && !inTrash && !closed;
605
+ case "trash": return some && !inTrash && !fixed;
606
+ case "paste": return !inTrash && !closed && (clipboard !== null || Boolean(target.files?.length));
607
+ case "move-here": return !inTrash && !closed && clipboard !== null;
608
+ case "new-folder": return !inTrash && !closed;
581
609
  case "put-back": return some && inTrash;
582
610
  case "empty-trash": return inTrash && trashFull;
583
611
  case "show-in-finder": return surface === "desktop" && some;
@@ -588,20 +616,21 @@ function useWorkspaceFileCommands(t0) {
588
616
  return {
589
617
  canRun,
590
618
  pasteLabel: clipboard ? `Paste ${clipboard.paths.length === 1 ? "Item" : `${clipboard.paths.length} Items`}` : null,
591
- rename: async (path_3, name) => {
592
- const to = await workspaceRenameTarget(volume_3.source, path_3, name).catch((error_0) => {
619
+ rename: async (path_7, name) => {
620
+ if (locked(volume_4, path_7)) return path_7;
621
+ const to = await workspaceRenameTarget(volume_4.source, path_7, name).catch((error_0) => {
593
622
  transfer.alert({
594
623
  title: "That name can’t be used",
595
624
  detail: formatOperationError(error_0)
596
625
  });
597
626
  throw error_0;
598
627
  });
599
- if (!to) return path_3;
600
- return (await apply(volume_3, "Rename", [{
628
+ if (!to) return path_7;
629
+ return (await apply(volume_4, "Rename", [{
601
630
  kind: "move",
602
- from: path_3,
631
+ from: path_7,
603
632
  to
604
- }])).length ? to : path_3;
633
+ }])).length ? to : path_7;
605
634
  },
606
635
  run: async (command_0, target_0) => {
607
636
  if (!canRun(command_0, target_0)) return;
@@ -609,22 +638,22 @@ function useWorkspaceFileCommands(t0) {
609
638
  switch (command_0) {
610
639
  case "copy":
611
640
  case "cut":
612
- writeSystemClipboard(volume_3.source, paths_1);
641
+ writeSystemClipboard(volume_4.source, paths_1);
613
642
  setClipboard({
614
- volume: volume_3,
643
+ volume: volume_4,
615
644
  paths: paths_1,
616
645
  cut: command_0 === "cut"
617
646
  });
618
647
  return;
619
648
  case "paste":
620
649
  case "move-here": {
621
- if (target_0.files?.length) return drop(volume_3, {
650
+ if (target_0.files?.length) return drop(volume_4, {
622
651
  kind: "files",
623
652
  items: target_0.files.map(_temp6)
624
653
  }, directory_0, "copy");
625
654
  if (!clipboard) return;
626
655
  const move = command_0 === "move-here" || clipboard.cut;
627
- const landed = await drop(volume_3, {
656
+ const landed = await drop(volume_4, {
628
657
  kind: "workspace",
629
658
  ...clipboard.volume,
630
659
  paths: clipboard.paths
@@ -632,33 +661,33 @@ function useWorkspaceFileCommands(t0) {
632
661
  if (move) setClipboard(null);
633
662
  return landed;
634
663
  }
635
- case "duplicate": return drop(volume_3, {
664
+ case "duplicate": return drop(volume_4, {
636
665
  kind: "workspace",
637
- ...volume_3,
666
+ ...volume_4,
638
667
  paths: paths_1
639
668
  }, directory_0, "copy", `Duplicate of ${subject(paths_1)}`);
640
669
  case "new-folder": {
641
- const path_6 = await exclusive("The folder couldn’t be created", async () => {
642
- const path_5 = await newWorkspaceFolderPath(volume_3.source, directory_0);
643
- await volume_3.source.mkdir(path_5);
644
- return path_5;
670
+ const path_10 = await exclusive("The folder couldn’t be created", async () => {
671
+ const path_9 = await newWorkspaceFolderPath(volume_4.source, directory_0);
672
+ await volume_4.source.mkdir(path_9);
673
+ return path_9;
645
674
  });
646
- await reload(volume_3);
647
- if (!path_6) return;
648
- if (!volume_3.linked) record({
675
+ await reload(volume_4);
676
+ if (!path_10) return;
677
+ if (!volume_4.linked) record({
649
678
  label: "New Folder",
650
- volume: volume_3,
679
+ volume: volume_4,
651
680
  operations: [{
652
681
  kind: "trash",
653
- path: path_6
682
+ path: path_10
654
683
  }]
655
684
  });
656
- return [path_6];
685
+ return [path_10];
657
686
  }
658
- case "trash": return trash(volume_3, paths_1);
659
- case "put-back": return apply(volume_3, "Put Back", paths_1.map(_temp7));
687
+ case "trash": return trash(volume_4, paths_1);
688
+ case "put-back": return apply(volume_4, "Put Back", paths_1.map(_temp7));
660
689
  case "empty-trash": return emptyTrash();
661
- case "get-info": return getInfo?.(volume_3, paths_1.length ? paths_1 : [directory_0]);
690
+ case "get-info": return getInfo?.(volume_4, paths_1.length ? paths_1 : [directory_0]);
662
691
  case "show-in-finder":
663
692
  openFolder(workspaceDirname(paths_1.at(-1)));
664
693
  return;
@@ -668,196 +697,197 @@ function useWorkspaceFileCommands(t0) {
668
697
  }
669
698
  };
670
699
  };
671
- $[31] = apply;
672
- $[32] = clipboard;
673
- $[33] = drop;
674
- $[34] = emptyTrash;
675
- $[35] = exclusive;
676
- $[36] = getInfo;
677
- $[37] = openFolder;
678
- $[38] = redoStack.length;
679
- $[39] = reload;
680
- $[40] = step;
681
- $[41] = transfer;
682
- $[42] = trash;
683
- $[43] = trashFull;
684
- $[44] = undoStack.length;
685
- $[45] = t14;
686
- } else t14 = $[45];
687
- const commands = t14;
688
- const t15 = confirm !== null;
689
- let t16;
690
- if ($[46] !== answer) {
691
- t16 = (open) => !open && answer(false);
692
- $[46] = answer;
693
- $[47] = t16;
694
- } else t16 = $[47];
695
- let t17;
696
- if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
697
- t17 = /* @__PURE__ */ jsx(AlertDialog.Backdrop, {});
698
- $[48] = t17;
699
- } else t17 = $[48];
700
- const t18 = confirm?.title;
700
+ $[39] = apply;
701
+ $[40] = clipboard;
702
+ $[41] = drop;
703
+ $[42] = emptyTrash;
704
+ $[43] = exclusive;
705
+ $[44] = getInfo;
706
+ $[45] = locked;
707
+ $[46] = openFolder;
708
+ $[47] = redoStack.length;
709
+ $[48] = reload;
710
+ $[49] = step;
711
+ $[50] = transfer;
712
+ $[51] = trash;
713
+ $[52] = trashFull;
714
+ $[53] = undoStack.length;
715
+ $[54] = t17;
716
+ } else t17 = $[54];
717
+ const commands = t17;
718
+ const t18 = confirm !== null;
701
719
  let t19;
702
- if ($[49] !== t18) {
703
- t19 = /* @__PURE__ */ jsx(AlertDialog.Title, { children: t18 });
704
- $[49] = t18;
705
- $[50] = t19;
706
- } else t19 = $[50];
707
- const t20 = confirm?.detail;
708
- let t21;
709
- if ($[51] !== t20) {
710
- t21 = /* @__PURE__ */ jsx(AlertDialog.Description, { children: t20 });
711
- $[51] = t20;
712
- $[52] = t21;
713
- } else t21 = $[52];
720
+ if ($[55] !== answer) {
721
+ t19 = (open) => !open && answer(false);
722
+ $[55] = answer;
723
+ $[56] = t19;
724
+ } else t19 = $[56];
725
+ let t20;
726
+ if ($[57] === Symbol.for("react.memo_cache_sentinel")) {
727
+ t20 = /* @__PURE__ */ jsx(AlertDialog.Backdrop, {});
728
+ $[57] = t20;
729
+ } else t20 = $[57];
730
+ const t21 = confirm?.title;
714
731
  let t22;
715
- if ($[53] !== t19 || $[54] !== t21) {
716
- t22 = /* @__PURE__ */ jsxs(AlertDialog.Header, { children: [t19, t21] });
717
- $[53] = t19;
718
- $[54] = t21;
719
- $[55] = t22;
720
- } else t22 = $[55];
721
- let t23;
722
- if ($[56] === Symbol.for("react.memo_cache_sentinel")) {
723
- t23 = /* @__PURE__ */ jsx(AlertDialog.Close, { children: "Cancel" });
724
- $[56] = t23;
725
- } else t23 = $[56];
732
+ if ($[58] !== t21) {
733
+ t22 = /* @__PURE__ */ jsx(AlertDialog.Title, { children: t21 });
734
+ $[58] = t21;
735
+ $[59] = t22;
736
+ } else t22 = $[59];
737
+ const t23 = confirm?.detail;
726
738
  let t24;
727
- if ($[57] !== answer) {
728
- t24 = () => answer(true);
729
- $[57] = answer;
730
- $[58] = t24;
731
- } else t24 = $[58];
732
- const t25 = confirm?.action;
739
+ if ($[60] !== t23) {
740
+ t24 = /* @__PURE__ */ jsx(AlertDialog.Description, { children: t23 });
741
+ $[60] = t23;
742
+ $[61] = t24;
743
+ } else t24 = $[61];
744
+ let t25;
745
+ if ($[62] !== t22 || $[63] !== t24) {
746
+ t25 = /* @__PURE__ */ jsxs(AlertDialog.Header, { children: [t22, t24] });
747
+ $[62] = t22;
748
+ $[63] = t24;
749
+ $[64] = t25;
750
+ } else t25 = $[64];
733
751
  let t26;
734
- if ($[59] !== t24 || $[60] !== t25) {
735
- t26 = /* @__PURE__ */ jsxs(AlertDialog.Footer, { children: [t23, /* @__PURE__ */ jsx(Button, {
736
- color: "destructive",
737
- onClick: t24,
738
- children: t25
739
- })] });
740
- $[59] = t24;
741
- $[60] = t25;
742
- $[61] = t26;
743
- } else t26 = $[61];
752
+ if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
753
+ t26 = /* @__PURE__ */ jsx(AlertDialog.Close, { children: "Cancel" });
754
+ $[65] = t26;
755
+ } else t26 = $[65];
744
756
  let t27;
745
- if ($[62] !== t22 || $[63] !== t26) {
746
- t27 = /* @__PURE__ */ jsxs(AlertDialog.Portal, { children: [t17, /* @__PURE__ */ jsx(AlertDialog.Viewport, { children: /* @__PURE__ */ jsxs(AlertDialog.Popup, {
747
- size: "sm",
748
- children: [t22, t26]
749
- }) })] });
750
- $[62] = t22;
751
- $[63] = t26;
752
- $[64] = t27;
753
- } else t27 = $[64];
754
- let t28;
755
- if ($[65] !== t15 || $[66] !== t16 || $[67] !== t27) {
756
- t28 = /* @__PURE__ */ jsx(AlertDialog.Root, {
757
- open: t15,
758
- onOpenChange: t16,
759
- children: t27
760
- });
761
- $[65] = t15;
762
- $[66] = t16;
757
+ if ($[66] !== answer) {
758
+ t27 = () => answer(true);
759
+ $[66] = answer;
763
760
  $[67] = t27;
764
- $[68] = t28;
765
- } else t28 = $[68];
761
+ } else t27 = $[67];
762
+ const t28 = confirm?.action;
766
763
  let t29;
767
- if ($[69] !== t28 || $[70] !== transfer.dialogs) {
768
- t29 = /* @__PURE__ */ jsxs(Fragment, { children: [transfer.dialogs, t28] });
764
+ if ($[68] !== t27 || $[69] !== t28) {
765
+ t29 = /* @__PURE__ */ jsxs(AlertDialog.Footer, { children: [t26, /* @__PURE__ */ jsx(Button, {
766
+ color: "destructive",
767
+ onClick: t27,
768
+ children: t28
769
+ })] });
770
+ $[68] = t27;
769
771
  $[69] = t28;
770
- $[70] = transfer.dialogs;
771
- $[71] = t29;
772
- } else t29 = $[71];
773
- const dialogs = t29;
772
+ $[70] = t29;
773
+ } else t29 = $[70];
774
774
  let t30;
775
- if ($[72] !== undoStack) {
776
- t30 = undoStack.at(-1)?.label ?? null;
777
- $[72] = undoStack;
775
+ if ($[71] !== t25 || $[72] !== t29) {
776
+ t30 = /* @__PURE__ */ jsxs(AlertDialog.Portal, { children: [t20, /* @__PURE__ */ jsx(AlertDialog.Viewport, { children: /* @__PURE__ */ jsxs(AlertDialog.Popup, {
777
+ size: "sm",
778
+ children: [t25, t29]
779
+ }) })] });
780
+ $[71] = t25;
781
+ $[72] = t29;
778
782
  $[73] = t30;
779
783
  } else t30 = $[73];
780
784
  let t31;
781
- if ($[74] !== redoStack) {
782
- t31 = redoStack.at(-1)?.label ?? null;
783
- $[74] = redoStack;
784
- $[75] = t31;
785
- } else t31 = $[75];
785
+ if ($[74] !== t18 || $[75] !== t19 || $[76] !== t30) {
786
+ t31 = /* @__PURE__ */ jsx(AlertDialog.Root, {
787
+ open: t18,
788
+ onOpenChange: t19,
789
+ children: t30
790
+ });
791
+ $[74] = t18;
792
+ $[75] = t19;
793
+ $[76] = t30;
794
+ $[77] = t31;
795
+ } else t31 = $[77];
786
796
  let t32;
797
+ if ($[78] !== t31 || $[79] !== transfer.dialogs) {
798
+ t32 = /* @__PURE__ */ jsxs(Fragment, { children: [transfer.dialogs, t31] });
799
+ $[78] = t31;
800
+ $[79] = transfer.dialogs;
801
+ $[80] = t32;
802
+ } else t32 = $[80];
803
+ const dialogs = t32;
787
804
  let t33;
788
- if ($[76] !== step) {
789
- t32 = () => void step("undo");
790
- t33 = () => void step("redo");
791
- $[76] = step;
792
- $[77] = t32;
793
- $[78] = t33;
794
- } else {
795
- t32 = $[77];
796
- t33 = $[78];
797
- }
805
+ if ($[81] !== undoStack) {
806
+ t33 = undoStack.at(-1)?.label ?? null;
807
+ $[81] = undoStack;
808
+ $[82] = t33;
809
+ } else t33 = $[82];
798
810
  let t34;
799
- if ($[79] !== emptyTrash) {
800
- t34 = () => void emptyTrash();
801
- $[79] = emptyTrash;
802
- $[80] = t34;
803
- } else t34 = $[80];
811
+ if ($[83] !== redoStack) {
812
+ t34 = redoStack.at(-1)?.label ?? null;
813
+ $[83] = redoStack;
814
+ $[84] = t34;
815
+ } else t34 = $[84];
804
816
  let t35;
805
- if ($[81] !== home.source || $[82] !== openFolder) {
806
- t35 = () => void home.source.mkdir(WORKSPACE_TRASH, { recursive: true }).then(() => openFolder(WORKSPACE_TRASH));
807
- $[81] = home.source;
808
- $[82] = openFolder;
809
- $[83] = t35;
810
- } else t35 = $[83];
811
817
  let t36;
812
- if ($[84] !== home || $[85] !== trash) {
813
- t36 = (t37) => {
814
- const { sourceKey, paths: paths_2 } = t37;
818
+ if ($[85] !== step) {
819
+ t35 = () => void step("undo");
820
+ t36 = () => void step("redo");
821
+ $[85] = step;
822
+ $[86] = t35;
823
+ $[87] = t36;
824
+ } else {
825
+ t35 = $[86];
826
+ t36 = $[87];
827
+ }
828
+ let t37;
829
+ if ($[88] !== emptyTrash) {
830
+ t37 = () => void emptyTrash();
831
+ $[88] = emptyTrash;
832
+ $[89] = t37;
833
+ } else t37 = $[89];
834
+ let t38;
835
+ if ($[90] !== home.source || $[91] !== openFolder) {
836
+ t38 = () => void home.source.mkdir(WORKSPACE_TRASH, { recursive: true }).then(() => openFolder(WORKSPACE_TRASH));
837
+ $[90] = home.source;
838
+ $[91] = openFolder;
839
+ $[92] = t38;
840
+ } else t38 = $[92];
841
+ let t39;
842
+ if ($[93] !== home || $[94] !== trash) {
843
+ t39 = (t40) => {
844
+ const { sourceKey, paths: paths_2 } = t40;
815
845
  if (sourceKey === home.sourceKey) trash(home, paths_2);
816
846
  };
817
- $[84] = home;
818
- $[85] = trash;
819
- $[86] = t36;
820
- } else t36 = $[86];
821
- let t37;
822
- if ($[87] !== commands || $[88] !== dialogs || $[89] !== drop || $[90] !== home || $[91] !== t30 || $[92] !== t31 || $[93] !== t32 || $[94] !== t33 || $[95] !== t34 || $[96] !== t35 || $[97] !== t36 || $[98] !== transfer.cancel || $[99] !== transfer.transferring || $[100] !== trashFull) {
823
- t37 = {
847
+ $[93] = home;
848
+ $[94] = trash;
849
+ $[95] = t39;
850
+ } else t39 = $[95];
851
+ let t40;
852
+ if ($[96] !== commands || $[97] !== dialogs || $[98] !== drop || $[99] !== home || $[100] !== t33 || $[101] !== t34 || $[102] !== t35 || $[103] !== t36 || $[104] !== t37 || $[105] !== t38 || $[106] !== t39 || $[107] !== transfer.cancel || $[108] !== transfer.transferring || $[109] !== trashFull) {
853
+ t40 = {
824
854
  home,
825
855
  commands,
826
856
  drop,
827
- undoLabel: t30,
828
- redoLabel: t31,
829
- undo: t32,
830
- redo: t33,
857
+ undoLabel: t33,
858
+ redoLabel: t34,
859
+ undo: t35,
860
+ redo: t36,
831
861
  trashFull,
832
- emptyTrash: t34,
833
- openTrash: t35,
834
- trashDrop: t36,
862
+ emptyTrash: t37,
863
+ openTrash: t38,
864
+ trashDrop: t39,
835
865
  transferring: transfer.transferring,
836
866
  cancelTransfer: transfer.cancel,
837
867
  dialogs
838
868
  };
839
- $[87] = commands;
840
- $[88] = dialogs;
841
- $[89] = drop;
842
- $[90] = home;
843
- $[91] = t30;
844
- $[92] = t31;
845
- $[93] = t32;
846
- $[94] = t33;
847
- $[95] = t34;
848
- $[96] = t35;
849
- $[97] = t36;
850
- $[98] = transfer.cancel;
851
- $[99] = transfer.transferring;
852
- $[100] = trashFull;
853
- $[101] = t37;
854
- } else t37 = $[101];
855
- return t37;
869
+ $[96] = commands;
870
+ $[97] = dialogs;
871
+ $[98] = drop;
872
+ $[99] = home;
873
+ $[100] = t33;
874
+ $[101] = t34;
875
+ $[102] = t35;
876
+ $[103] = t36;
877
+ $[104] = t37;
878
+ $[105] = t38;
879
+ $[106] = t39;
880
+ $[107] = transfer.cancel;
881
+ $[108] = transfer.transferring;
882
+ $[109] = trashFull;
883
+ $[110] = t40;
884
+ } else t40 = $[110];
885
+ return t40;
856
886
  }
857
- function _temp7(path_4) {
887
+ function _temp7(path_8) {
858
888
  return {
859
889
  kind: "put-back",
860
- path: path_4
890
+ path: path_8
861
891
  };
862
892
  }
863
893
  function _temp6(file) {
@@ -871,13 +901,13 @@ function _temp5(stack_0) {
871
901
  return stack_0.slice(0, -1);
872
902
  }
873
903
  function _temp4(t0) {
874
- const { path: path_2 } = t0;
875
- return path_2;
904
+ const { path: path_5 } = t0;
905
+ return path_5;
876
906
  }
877
- function _temp3(path) {
907
+ function _temp3(path_1) {
878
908
  return {
879
909
  kind: "trash",
880
- path
910
+ path: path_1
881
911
  };
882
912
  }
883
913
  function _temp2(error) {
@@ -887,4 +917,4 @@ function _temp(value) {
887
917
  return { value };
888
918
  }
889
919
  //#endregion
890
- export { WORKSPACE_TRASH, isHiddenWorkspaceEntry, isInWorkspaceTrash, runWorkspaceFileOperations, useWorkspaceFileCommands, workspaceFileCommandForKey, workspaceFileShortcut, workspaceRenameTarget, workspaceTrashIsFull };
920
+ export { WORKSPACE_TRASH, isHiddenWorkspaceEntry, isInWorkspaceTrash, isWithin, runWorkspaceFileOperations, useWorkspaceFileCommands, workspaceFileCommandForKey, workspaceFileShortcut, workspaceRenameTarget, workspaceTrashIsFull };