@lvce-editor/process-explorer-worker 3.7.0 → 3.8.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 (2) hide show
  1. package/index.js +198 -722
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -181,12 +181,12 @@ const collapseAll = state => {
181
181
  };
182
182
 
183
183
  const {
184
- dispose: dispose$3,
184
+ dispose: dispose$4,
185
185
  get: get$2,
186
186
  getCommandIds,
187
187
  getKeys: getKeys$1,
188
188
  registerCommands,
189
- set: set$a,
189
+ set: set$6,
190
190
  wrapCommand,
191
191
  wrapGetter,
192
192
  wrapLoadContent
@@ -215,14 +215,14 @@ const create$d = (id, _uri, x, y, width, height, args, parentUid, platform = 0,
215
215
  parentUid,
216
216
  platform,
217
217
  processes: [],
218
- rootPid: 0,
218
+ rootPid: -1,
219
219
  uid: id,
220
220
  visibleProcesses: [],
221
221
  width,
222
222
  x,
223
223
  y
224
224
  };
225
- set$a(state.uid, state, state);
225
+ set$6(state.uid, state, state);
226
226
  return state;
227
227
  };
228
228
 
@@ -888,8 +888,10 @@ const getCurrentStack = () => {
888
888
  const currentStack = joinLines(splitLines(new Error().stack || '').slice(stackLinesToSkip));
889
889
  return currentStack;
890
890
  };
891
- const getNewLineIndex = (string, startIndex = undefined) => {
892
- return string.indexOf(NewLine, startIndex);
891
+ const getNewLineIndex = (string, startIndex) => {
892
+ {
893
+ return string.indexOf(NewLine);
894
+ }
893
895
  };
894
896
  const getParentStack = error => {
895
897
  let parentStack = error.stack || error.data || error.message || '';
@@ -900,55 +902,77 @@ const getParentStack = error => {
900
902
  };
901
903
  const MethodNotFound = -32601;
902
904
  const Custom = -32001;
905
+ const restoreExistingError = (error, currentStack) => {
906
+ if (typeof error.stack === 'string') {
907
+ error.stack = error.stack + NewLine + currentStack;
908
+ }
909
+ return error;
910
+ };
911
+ const restoreMethodNotFoundError = (error, currentStack) => {
912
+ const restoredError = new JsonRpcError(error.message);
913
+ const parentStack = getParentStack(error);
914
+ restoredError.stack = parentStack + NewLine + currentStack;
915
+ return restoredError;
916
+ };
917
+ const restoreStackFromData = (restoredError, error, currentStack) => {
918
+ if (error.data.stack && error.data.type && error.message) {
919
+ restoredError.stack = error.data.type + ': ' + error.message + NewLine + error.data.stack + NewLine + currentStack;
920
+ return;
921
+ }
922
+ if (error.data.stack) {
923
+ restoredError.stack = error.data.stack;
924
+ }
925
+ };
926
+ const applyDataProperties = (restoredError, error) => {
927
+ if (!error.data) {
928
+ return;
929
+ }
930
+ restoreStackFromData(restoredError, error, getCurrentStack());
931
+ if (error.data.codeFrame) {
932
+ // @ts-ignore
933
+ restoredError.codeFrame = error.data.codeFrame;
934
+ }
935
+ if (error.data.code) {
936
+ // @ts-ignore
937
+ restoredError.code = error.data.code;
938
+ }
939
+ if (error.data.type) {
940
+ // @ts-ignore
941
+ restoredError.name = error.data.type;
942
+ }
943
+ };
944
+ const applyDirectProperties = (restoredError, error) => {
945
+ if (error.stack) {
946
+ const lowerStack = restoredError.stack || '';
947
+ const indexNewLine = getNewLineIndex(lowerStack);
948
+ const parentStack = getParentStack(error);
949
+ // @ts-ignore
950
+ restoredError.stack = parentStack + lowerStack.slice(indexNewLine);
951
+ }
952
+ if (error.codeFrame) {
953
+ // @ts-ignore
954
+ restoredError.codeFrame = error.codeFrame;
955
+ }
956
+ };
957
+ const restoreMessageError = (error, _currentStack) => {
958
+ const restoredError = constructError(error.message, error.type, error.name);
959
+ if (error.data) {
960
+ applyDataProperties(restoredError, error);
961
+ } else {
962
+ applyDirectProperties(restoredError, error);
963
+ }
964
+ return restoredError;
965
+ };
903
966
  const restoreJsonRpcError = error => {
904
967
  const currentStack = getCurrentStack();
905
968
  if (error && error instanceof Error) {
906
- if (typeof error.stack === 'string') {
907
- error.stack = error.stack + NewLine + currentStack;
908
- }
909
- return error;
969
+ return restoreExistingError(error, currentStack);
910
970
  }
911
971
  if (error && error.code && error.code === MethodNotFound) {
912
- const restoredError = new JsonRpcError(error.message);
913
- const parentStack = getParentStack(error);
914
- restoredError.stack = parentStack + NewLine + currentStack;
915
- return restoredError;
972
+ return restoreMethodNotFoundError(error, currentStack);
916
973
  }
917
974
  if (error && error.message) {
918
- const restoredError = constructError(error.message, error.type, error.name);
919
- if (error.data) {
920
- if (error.data.stack && error.data.type && error.message) {
921
- restoredError.stack = error.data.type + ': ' + error.message + NewLine + error.data.stack + NewLine + currentStack;
922
- } else if (error.data.stack) {
923
- restoredError.stack = error.data.stack;
924
- }
925
- if (error.data.codeFrame) {
926
- // @ts-ignore
927
- restoredError.codeFrame = error.data.codeFrame;
928
- }
929
- if (error.data.code) {
930
- // @ts-ignore
931
- restoredError.code = error.data.code;
932
- }
933
- if (error.data.type) {
934
- // @ts-ignore
935
- restoredError.name = error.data.type;
936
- }
937
- } else {
938
- if (error.stack) {
939
- const lowerStack = restoredError.stack || '';
940
- // @ts-ignore
941
- const indexNewLine = getNewLineIndex(lowerStack);
942
- const parentStack = getParentStack(error);
943
- // @ts-ignore
944
- restoredError.stack = parentStack + lowerStack.slice(indexNewLine);
945
- }
946
- if (error.codeFrame) {
947
- // @ts-ignore
948
- restoredError.codeFrame = error.codeFrame;
949
- }
950
- }
951
- return restoredError;
975
+ return restoreMessageError(error);
952
976
  }
953
977
  if (typeof error === 'string') {
954
978
  return new Error(`JsonRpc Error: ${error}`);
@@ -1423,7 +1447,7 @@ const createMockRpc = ({
1423
1447
  };
1424
1448
 
1425
1449
  const rpcs = Object.create(null);
1426
- const set$9 = (id, rpc) => {
1450
+ const set$5 = (id, rpc) => {
1427
1451
  rpcs[id] = rpc;
1428
1452
  };
1429
1453
  const get = id => {
@@ -1456,7 +1480,7 @@ const create = rpcId => {
1456
1480
  const mockRpc = createMockRpc({
1457
1481
  commandMap
1458
1482
  });
1459
- set$9(rpcId, mockRpc);
1483
+ set$5(rpcId, mockRpc);
1460
1484
  // @ts-ignore
1461
1485
  mockRpc[Symbol.dispose] = () => {
1462
1486
  remove(rpcId);
@@ -1465,7 +1489,7 @@ const create = rpcId => {
1465
1489
  return mockRpc;
1466
1490
  },
1467
1491
  set(rpc) {
1468
- set$9(rpcId, rpc);
1492
+ set$5(rpcId, rpc);
1469
1493
  }
1470
1494
  };
1471
1495
  };
@@ -1496,8 +1520,6 @@ const DownArrow = 16;
1496
1520
  const ContextMenu = 56;
1497
1521
  const Star = 131;
1498
1522
 
1499
- const Script = 2;
1500
-
1501
1523
  const CtrlCmd = 1 << 11 >>> 0;
1502
1524
 
1503
1525
  const None$1 = 0;
@@ -1505,14 +1527,9 @@ const None$1 = 0;
1505
1527
  const Electron = 2;
1506
1528
  const Remote = 3;
1507
1529
 
1508
- const DebugWorker = 55;
1509
- const EditorWorker = 99;
1510
1530
  const ErrorWorker = 3308;
1511
1531
  const FileSystemWorker$1 = 209;
1512
- const IconThemeWorker = 7009;
1513
- const OpenerWorker = 4561;
1514
- const RendererWorker$1 = 1;
1515
- const TestWorker = 9001;
1532
+ const RendererWorker = 1;
1516
1533
 
1517
1534
  const FocusSelector = 'Viewlet.focusSelector';
1518
1535
  const SetDom2 = 'Viewlet.setDom2';
@@ -1522,61 +1539,28 @@ const SetPatches = 'Viewlet.setPatches';
1522
1539
  const Empty = 0;
1523
1540
  const FocusExplorer = 13;
1524
1541
 
1525
- const {
1526
- set: set$8
1527
- } = create(EditorWorker);
1528
-
1529
1542
  const {
1530
1543
  invoke: invoke$2,
1531
- set: set$7
1544
+ set: set$4
1532
1545
  } = create(ErrorWorker);
1533
1546
  const prepare = async error => {
1534
1547
  return invoke$2('Errors.prepare', error);
1535
1548
  };
1536
1549
 
1537
1550
  const {
1538
- set: set$6
1551
+ set: set$3
1539
1552
  } = create(FileSystemWorker$1);
1540
1553
 
1541
1554
  const FileSystemWorker = {
1542
1555
  __proto__: null,
1543
- set: set$6
1544
- };
1545
-
1546
- const {
1547
- set: set$5
1548
- } = create(OpenerWorker);
1549
-
1550
- const {
1551
- set: set$4
1552
- } = create(10_001);
1553
-
1554
- const {
1555
1556
  set: set$3
1556
- } = create(IconThemeWorker);
1557
+ };
1557
1558
 
1558
1559
  const {
1559
- dispose: dispose$2,
1560
1560
  invoke: invoke$1,
1561
1561
  invokeAndTransfer,
1562
- registerMockRpc,
1563
1562
  set: set$2
1564
- } = create(RendererWorker$1);
1565
- const searchFileHtml = async uri => {
1566
- return invoke$1('ExtensionHost.searchFileWithHtml', uri);
1567
- };
1568
- const getFilePathElectron = async file => {
1569
- return invoke$1('FileSystemHandle.getFilePathElectron', file);
1570
- };
1571
- const handleModifiedStatusChange = async (uri, modified) => {
1572
- return invoke$1('Main.handleModifiedStatusChange', uri, modified);
1573
- };
1574
- /**
1575
- * @deprecated
1576
- */
1577
- const showContextMenu = async (x, y, id, ...args) => {
1578
- return invoke$1('ContextMenu.show', x, y, id, ...args);
1579
- };
1563
+ } = create(RendererWorker);
1580
1564
  const showContextMenu2 = async (uid, menuId, x, y, args) => {
1581
1565
  number(uid);
1582
1566
  number(menuId);
@@ -1584,565 +1568,18 @@ const showContextMenu2 = async (uid, menuId, x, y, args) => {
1584
1568
  number(y);
1585
1569
  await invoke$1('ContextMenu.show2', uid, menuId, x, y, args);
1586
1570
  };
1587
- const getElectronVersion = async () => {
1588
- return invoke$1('Process.getElectronVersion');
1589
- };
1590
- const applyBulkReplacement = async bulkEdits => {
1591
- await invoke$1('BulkReplacement.applyBulkReplacement', bulkEdits);
1592
- };
1593
- const setColorTheme = async id => {
1594
- return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
1595
- };
1596
- const getNodeVersion = async () => {
1597
- return invoke$1('Process.getNodeVersion');
1598
- };
1599
- const getBadgeCounts = async () => {
1600
- return invoke$1('Layout.getBadgeCounts');
1601
- };
1602
- const getChromeVersion = async () => {
1603
- return invoke$1('Process.getChromeVersion');
1604
- };
1605
- const getV8Version = async () => {
1606
- return invoke$1('Process.getV8Version');
1607
- };
1608
- const getFileHandles = async fileIds => {
1609
- const files = await invoke$1('FileSystemHandle.getFileHandles', fileIds);
1610
- return files;
1611
- };
1612
- const setWorkspacePath = async path => {
1613
- await invoke$1('Workspace.setPath', path);
1614
- };
1615
- const registerWebViewInterceptor = async (id, port) => {
1616
- await invokeAndTransfer('WebView.registerInterceptor', id, port);
1617
- };
1618
- const unregisterWebViewInterceptor = async id => {
1619
- await invoke$1('WebView.unregisterInterceptor', id);
1620
- };
1621
- const sendMessagePortToEditorWorker = async (port, rpcId) => {
1622
- const command = 'HandleMessagePort.handleMessagePort';
1623
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
1624
- };
1625
- const sendMessagePortToSettingsWorker = async (port, rpcId) => {
1626
- const command = 'HandleMessagePort.handleMessagePort';
1627
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSettingsWorker', port, command, rpcId);
1628
- };
1629
- const sendMessagePortToClipBoardWorker = async (port, rpcId) => {
1630
- const command = 'ClipBoard.handleMessagePort';
1631
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToClipBoardWorker', port, command, rpcId);
1632
- };
1633
- const sendMessagePortToOpenerWorker = async (port, rpcId) => {
1634
- const command = 'HandleMessagePort.handleMessagePort';
1635
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToOpenerWorker', port, command, rpcId);
1636
- };
1637
- const sendMessagePortToChatMathWorker = async (port, rpcId) => {
1638
- const command = 'HandleMessagePort.handleMessagePort';
1639
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatMathWorker', port, command, rpcId);
1640
- };
1641
- const sendMessagePortToChatCoordinatorWorker = async (port, rpcId) => {
1642
- const command = 'HandleMessagePort.handleMessagePort';
1643
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatCoordinatorWorker', port, command, rpcId);
1644
- };
1645
- const sendMessagePortToChatMessageParsingWorker = async (port, rpcId) => {
1646
- const command = 'HandleMessagePort.handleMessagePort';
1647
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatMessageParsingWorker', port, command, rpcId);
1648
- };
1649
- const sendMessagePortToMainAreaWorker = async (port, rpcId) => {
1650
- const command = 'HandleMessagePort.handleMessagePort';
1651
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMainAreaWorker', port, command, rpcId);
1652
- };
1653
- const sendMessagePortToTerminalProcess = async (port, rpcId) => {
1654
- const command = 'HandleMessagePortForTerminalProcess.handleMessagePortForTerminalProcess';
1655
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTerminalProcess', port, command, rpcId);
1656
- };
1657
- const sendMessagePortToTextSearchWorker = async (port, rpcId) => {
1658
- const command = 'HandleMessagePort.handleMessagePort';
1659
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextSearchWorker', port, command, rpcId);
1660
- };
1661
- const sendMessagePortToAuthWorker = async (port, rpcId) => {
1662
- const command = 'HandleMessagePort.handleMessagePort';
1663
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToAuthWorker', port, command, rpcId);
1664
- };
1665
- const sendMessagePortToAuthProcess = async (port, rpcId) => {
1666
- const command = 'HandleMessagePortForAuthProcess.handleMessagePortForAuthProcess';
1667
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
1668
- };
1669
1571
  const sendMessagePortToErrorWorker$1 = async (port, rpcId) => {
1670
1572
  const command = 'Errors.handleMessagePort';
1671
1573
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
1672
1574
  };
1673
- const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
1674
- const command = 'Markdown.handleMessagePort';
1675
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
1676
- };
1677
- const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
1678
- const command = 'IconTheme.handleMessagePort';
1679
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
1680
- };
1681
1575
  const sendMessagePortToFileSystemWorker$1 = async (port, rpcId) => {
1682
1576
  const command = 'FileSystem.handleMessagePort';
1683
1577
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
1684
1578
  };
1685
- const readFile = async uri => {
1686
- return invoke$1('FileSystem.readFile', uri);
1687
- };
1688
- const getWebViewSecret = async key => {
1689
- return invoke$1('WebView.getSecret', key);
1690
- };
1691
- const setWebViewPort = async (uid, port, origin, portType) => {
1692
- return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
1693
- };
1694
- const setFocus = key => {
1695
- return invoke$1('Focus.setFocus', key);
1696
- };
1697
- const getFileIcon = async options => {
1698
- return invoke$1('IconTheme.getFileIcon', options);
1699
- };
1700
- const getColorThemeNames = async () => {
1701
- return invoke$1('ColorTheme.getColorThemeNames');
1702
- };
1703
- const disableExtension = async id => {
1704
- return invoke$1('ExtensionManagement.disable', id);
1705
- };
1706
- const enableExtension = async id => {
1707
- return invoke$1('ExtensionManagement.enable', id);
1708
- };
1709
- const disposeEditor = async uid => {
1710
- return invoke$1('Viewlet.dispose', uid);
1711
- };
1712
- const handleDebugChange = async params => {
1713
- return invoke$1('Run And Debug.handleChange', params);
1714
- };
1715
- const getFolderIcon = async options => {
1716
- return invoke$1('IconTheme.getFolderIcon', options);
1717
- };
1718
- const handleWorkspaceRefresh = async () => {
1719
- return invoke$1('Layout.handleWorkspaceRefresh');
1720
- };
1721
- const closeWidget = async widgetId => {
1722
- return invoke$1('Viewlet.closeWidget', widgetId);
1723
- };
1724
- const createViewlet = async (viewletModuleId, editorUid, tabId, bounds, uri) => {
1725
- return invoke$1('Layout.createViewlet', viewletModuleId, editorUid, tabId, bounds, uri);
1726
- };
1727
- const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
1728
- const command = 'HandleMessagePort.handleMessagePort2';
1729
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
1730
- };
1731
- const getViewletModuleId = async uri => {
1732
- return invoke$1('Layout.getModuleId', uri);
1733
- };
1734
- const showPanel = async () => {
1735
- return invoke$1('Layout.showPanel');
1736
- };
1737
- const showPreview = async () => {
1738
- return invoke$1('Layout.showPreview');
1739
- };
1740
- const saveEditor = async () => {
1741
- return invoke$1('Editor.save');
1742
- };
1743
- const sendMessagePortToFileSearchWorker2 = async (port, rpcId = 0) => {
1744
- const command = 'FileSearch.handleMessagePort';
1745
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
1746
- };
1747
- const togglePanelView = async id => {
1748
- return invoke$1('Panel.toggleView', id);
1749
- };
1750
- const resizeViewlet = async (uid, dimensions) => {
1751
- return invoke$1('Viewlet.resize', uid, dimensions);
1752
- };
1753
- const sendMessagePortToFileSearchWorker = async (port, rpcId = 0) => {
1754
- const command = 'QuickPick.handleMessagePort';
1755
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
1756
- };
1757
- const sendMessagePortToQuickPickWorker = async (port, rpcId = 0) => {
1758
- const command = 'QuickPick.handleMessagePort';
1759
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToQuickPickWorker', port, command, rpcId);
1760
- };
1761
- const sendMessagePortToSearchProcess = async port => {
1762
- await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
1763
- };
1764
- const sendMessagePortToChatViewModel = async port => {
1765
- await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToChatViewModel', port, 'ViewModel.handleMessagePort');
1766
- };
1767
- const sendMessagePortToChatNetworkWorker = async port => {
1768
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatNetworkWorker', port, 'HandleMessagePort.handleMessagePort');
1769
- };
1770
- const sendMessagePortToChatToolWorker = async port => {
1771
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatToolWorker', port, 'HandleMessagePort.handleMessagePort');
1772
- };
1773
- const sendMessagePortToChatStorageWorker = async (port, rpcId) => {
1774
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatStorageWorker', port, 'HandleMessagePort.handleMessagePort', rpcId);
1775
- };
1776
- const sendMessagePortToChatDebugViewWorker = async port => {
1777
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatDebugViewWorker', port, 'HandleMessagePort.handleMessagePort');
1778
- };
1779
- const confirm = async (message, options) => {
1780
- const result = await invoke$1('ConfirmPrompt.prompt', message, options);
1781
- return result;
1782
- };
1783
- const getRecentlyOpened = async () => {
1784
- return invoke$1(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
1785
- };
1786
- const getKeyBindings$1 = async () => {
1787
- return invoke$1('KeyBindingsInitial.getKeyBindings');
1788
- };
1789
- const writeClipBoardText = async text => {
1790
- await invoke$1('ClipBoard.writeText', /* text */text);
1791
- };
1792
- const writeFile = async (uri, text) => {
1793
- await invoke$1('FileSystem.writeFile', uri, text);
1794
- };
1795
- const handleUriChange = async (uri, newUri) => {
1796
- await invoke$1('Main.handleUriChange', uri, newUri);
1797
- };
1798
- const readClipBoardText = async () => {
1799
- return invoke$1('ClipBoard.readText');
1800
- };
1801
- const writeClipBoardImage = async blob => {
1802
- await invoke$1('ClipBoard.writeImage', /* text */blob);
1803
- };
1804
- const searchFileMemory = async uri => {
1805
- return invoke$1('ExtensionHost.searchFileWithMemory', uri);
1806
- };
1807
- const searchFileFetch = async uri => {
1808
- return invoke$1('ExtensionHost.searchFileWithFetch', uri);
1809
- };
1810
- const showMessageBox = async options => {
1811
- return invoke$1('ElectronDialog.showMessageBox', options);
1812
- };
1813
- const handleDebugResumed = async params => {
1814
- await invoke$1('Run And Debug.handleResumed', params);
1815
- };
1816
- const openWidget = async name => {
1817
- await invoke$1('Viewlet.openWidget', name);
1818
- };
1819
- const getIcons = async requests => {
1820
- const icons = await invoke$1('IconTheme.getIcons', requests);
1821
- return icons;
1822
- };
1823
- const activateByEvent = (event, assetDir, platform) => {
1824
- return invoke$1('ExtensionHostManagement.activateByEvent', event, assetDir, platform);
1825
- };
1826
- const setAdditionalFocus = focusKey => {
1827
- return invoke$1('Focus.setAdditionalFocus', focusKey);
1828
- };
1829
- const getActiveEditorId = () => {
1830
- return invoke$1('GetActiveEditor.getActiveEditorId');
1831
- };
1832
- const getWorkspacePath = () => {
1833
- return invoke$1('Workspace.getPath');
1834
- };
1835
- const sendMessagePortToRendererProcess = async port => {
1836
- const command = 'HandleMessagePort.handleMessagePort';
1837
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
1838
- };
1839
- const sendMessagePortToTextMeasurementWorker = async port => {
1840
- const command = 'TextMeasurement.handleMessagePort';
1841
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
1842
- };
1843
1579
  const sendMessagePortToProcessExplorer$1 = async port => {
1844
1580
  const command = 'ProcessExplorer.handleMessagePort';
1845
1581
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToProcessExplorer', port, command, 0);
1846
1582
  };
1847
- const sendMessagePortToSourceControlWorker = async port => {
1848
- const command = 'SourceControl.handleMessagePort';
1849
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
1850
- };
1851
- const sendMessagePortToSharedProcess = async port => {
1852
- const command = 'HandleElectronMessagePort.handleElectronMessagePort';
1853
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, 0);
1854
- };
1855
- const sendMessagePortToFileSystemProcess = async (port, rpcId) => {
1856
- const command = 'HandleMessagePortForFileSystemProcess.handleMessagePortForFileSystemProcess';
1857
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
1858
- };
1859
- const sendMessagePortToIframeWorker = async (port, rpcId) => {
1860
- const command = 'Iframes.handleMessagePort';
1861
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIframeWorker', port, command, rpcId);
1862
- };
1863
- const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
1864
- const command = 'Extensions.handleMessagePort';
1865
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
1866
- };
1867
- const getPreference = async key => {
1868
- return await invoke$1('Preferences.get', key);
1869
- };
1870
- const getAllExtensions = async () => {
1871
- return invoke$1('ExtensionManagement.getAllExtensions');
1872
- };
1873
- const rerenderEditor = async key => {
1874
- return invoke$1('Editor.rerender', key);
1875
- };
1876
- const handleDebugPaused = async params => {
1877
- await invoke$1('Run And Debug.handlePaused', params);
1878
- };
1879
- const openUri = async (uri, focus, options) => {
1880
- await invoke$1('Main.openUri', uri, focus, options);
1881
- };
1882
- const sendMessagePortToSyntaxHighlightingWorker = async port => {
1883
- await invokeAndTransfer('SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
1884
- };
1885
- const sendMessagePortToBlobWorker = async (port, rpcId = 0) => {
1886
- const command = 'Blob.handleMessagePort';
1887
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToBlobWorker', port, command, rpcId);
1888
- };
1889
- const sendMessagePortToDiffWorker = async (port, rpcId = 0) => {
1890
- const command = 'Diff.handleMessagePort';
1891
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToDiffWorker', port, command, rpcId);
1892
- };
1893
- const handleDebugScriptParsed = async script => {
1894
- await invoke$1('Run And Debug.handleScriptParsed', script);
1895
- };
1896
- const getWindowId = async () => {
1897
- return invoke$1('GetWindowId.getWindowId');
1898
- };
1899
- const getBlob = async uri => {
1900
- return invoke$1('FileSystem.getBlob', uri);
1901
- };
1902
- const getExtensionCommands = async () => {
1903
- return invoke$1('ExtensionHost.getCommands');
1904
- };
1905
- const showErrorDialog = async errorInfo => {
1906
- await invoke$1('ErrorHandling.showErrorDialog', errorInfo);
1907
- };
1908
- const getFolderSize = async uri => {
1909
- return await invoke$1('FileSystem.getFolderSize', uri);
1910
- };
1911
- const getExtension = async id => {
1912
- return invoke$1('ExtensionManagement.getExtension', id);
1913
- };
1914
- const getMarkdownDom = async html => {
1915
- return invoke$1('Markdown.getVirtualDom', html);
1916
- };
1917
- const renderMarkdown = async (markdown, options) => {
1918
- return invoke$1('Markdown.renderMarkdown', markdown, options);
1919
- };
1920
- const openNativeFolder = async uri => {
1921
- await invoke$1('OpenNativeFolder.openNativeFolder', uri);
1922
- };
1923
- const uninstallExtension = async id => {
1924
- return invoke$1('ExtensionManagement.uninstall', id);
1925
- };
1926
- const installExtension = async id => {
1927
- return invoke$1('ExtensionManagement.install', id);
1928
- };
1929
- const minimizeWindow = async () => {
1930
- return invoke$1('ElectronWindow.minimize');
1931
- };
1932
- const unmaximizeWindow = async () => {
1933
- return invoke$1('ElectronWindow.unmaximize');
1934
- };
1935
- const maximizeWindow = async () => {
1936
- return invoke$1('ElectronWindow.maximize');
1937
- };
1938
- const showSideBar = async (id, focus) => {
1939
- return invoke$1('SideBar.show', id, focus);
1940
- };
1941
- const closeWindow = async () => {
1942
- return invoke$1('ElectronWindow.close');
1943
- };
1944
- const openExtensionSearch = async () => {
1945
- return invoke$1('SideBar.openViewlet', 'Extensions');
1946
- };
1947
- const setExtensionsSearchValue = async searchValue => {
1948
- return invoke$1('Extensions.handleInput', searchValue, Script);
1949
- };
1950
- const openExternal = async uri => {
1951
- await invoke$1('Open.openExternal', uri);
1952
- };
1953
- const openUrl = async uri => {
1954
- await invoke$1('Open.openUrl', uri);
1955
- };
1956
- const getAllPreferences = async () => {
1957
- return invoke$1('Preferences.getAll');
1958
- };
1959
- const showSaveFilePicker = async () => {
1960
- return invoke$1('FilePicker.showSaveFilePicker');
1961
- };
1962
- const getLogsDir = async () => {
1963
- return invoke$1('PlatformPaths.getLogsDir');
1964
- };
1965
- const measureTextBlockHeight = async (actualInput, fontFamily, fontSize, lineHeightPx, width) => {
1966
- return invoke$1(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
1967
- };
1968
- const refreshOutput = async () => {
1969
- await invoke$1('Output.refresh');
1970
- };
1971
- const send = async (port, sourceId = 0) => {
1972
- await sendMessagePortToOpenerWorker(port, sourceId);
1973
- };
1974
- const initializeOpenerWorker = async () => {
1975
- const rpc = await create$5({
1976
- commandMap: {},
1977
- send
1978
- });
1979
- set$5(rpc);
1980
- };
1981
- const send2 = async port => {
1982
- await sendMessagePortToEditorWorker(port, TestWorker);
1983
- };
1984
- const initializeEditorWorker = async () => {
1985
- const rpc = await create$5({
1986
- commandMap: {},
1987
- send: send2
1988
- });
1989
- set$8(rpc);
1990
- };
1991
- const send3 = port => {
1992
- return sendMessagePortToTextMeasurementWorker(port);
1993
- };
1994
- const initializeTextMeasurementWorker = async () => {
1995
- const rpc = await create$5({
1996
- commandMap: {},
1997
- send: send3
1998
- });
1999
- set$3(rpc);
2000
- };
2001
- const send4 = port => {
2002
- return sendMessagePortToTextMeasurementWorker(port);
2003
- };
2004
- const initializeProcessExplorer$1 = async () => {
2005
- const rpc = await create$5({
2006
- commandMap: {},
2007
- send: send4
2008
- });
2009
- set$4(rpc);
2010
- };
2011
-
2012
- const RendererWorker = {
2013
- __proto__: null,
2014
- activateByEvent,
2015
- applyBulkReplacement,
2016
- closeWidget,
2017
- closeWindow,
2018
- confirm,
2019
- createViewlet,
2020
- disableExtension,
2021
- dispose: dispose$2,
2022
- disposeEditor,
2023
- enableExtension,
2024
- getActiveEditorId,
2025
- getAllExtensions,
2026
- getAllPreferences,
2027
- getBadgeCounts,
2028
- getBlob,
2029
- getChromeVersion,
2030
- getColorThemeNames,
2031
- getElectronVersion,
2032
- getExtension,
2033
- getExtensionCommands,
2034
- getFileHandles,
2035
- getFileIcon,
2036
- getFilePathElectron,
2037
- getFolderIcon,
2038
- getFolderSize,
2039
- getIcons,
2040
- getKeyBindings: getKeyBindings$1,
2041
- getLogsDir,
2042
- getMarkdownDom,
2043
- getNodeVersion,
2044
- getPreference,
2045
- getRecentlyOpened,
2046
- getV8Version,
2047
- getViewletModuleId,
2048
- getWebViewSecret,
2049
- getWindowId,
2050
- getWorkspacePath,
2051
- handleDebugChange,
2052
- handleDebugPaused,
2053
- handleDebugResumed,
2054
- handleDebugScriptParsed,
2055
- handleModifiedStatusChange,
2056
- handleUriChange,
2057
- handleWorkspaceRefresh,
2058
- initializeEditorWorker,
2059
- initializeOpenerWorker,
2060
- initializeProcessExplorer: initializeProcessExplorer$1,
2061
- initializeTextMeasurementWorker,
2062
- installExtension,
2063
- invoke: invoke$1,
2064
- invokeAndTransfer,
2065
- maximizeWindow,
2066
- measureTextBlockHeight,
2067
- minimizeWindow,
2068
- openExtensionSearch,
2069
- openExternal,
2070
- openNativeFolder,
2071
- openUri,
2072
- openUrl,
2073
- openWidget,
2074
- readClipBoardText,
2075
- readFile,
2076
- refreshOutput,
2077
- registerMockRpc,
2078
- registerWebViewInterceptor,
2079
- renderMarkdown,
2080
- rerenderEditor,
2081
- resizeViewlet,
2082
- saveEditor,
2083
- searchFileFetch,
2084
- searchFileHtml,
2085
- searchFileMemory,
2086
- sendMessagePortToAuthProcess,
2087
- sendMessagePortToAuthWorker,
2088
- sendMessagePortToBlobWorker,
2089
- sendMessagePortToChatCoordinatorWorker,
2090
- sendMessagePortToChatDebugViewWorker,
2091
- sendMessagePortToChatMathWorker,
2092
- sendMessagePortToChatMessageParsingWorker,
2093
- sendMessagePortToChatNetworkWorker,
2094
- sendMessagePortToChatStorageWorker,
2095
- sendMessagePortToChatToolWorker,
2096
- sendMessagePortToChatViewModel,
2097
- sendMessagePortToClipBoardWorker,
2098
- sendMessagePortToDiffWorker,
2099
- sendMessagePortToEditorWorker,
2100
- sendMessagePortToErrorWorker: sendMessagePortToErrorWorker$1,
2101
- sendMessagePortToExtensionHostWorker,
2102
- sendMessagePortToExtensionManagementWorker,
2103
- sendMessagePortToFileSearchWorker,
2104
- sendMessagePortToFileSearchWorker2,
2105
- sendMessagePortToFileSystemProcess,
2106
- sendMessagePortToFileSystemWorker: sendMessagePortToFileSystemWorker$1,
2107
- sendMessagePortToIconThemeWorker,
2108
- sendMessagePortToIframeWorker,
2109
- sendMessagePortToMainAreaWorker,
2110
- sendMessagePortToMarkdownWorker,
2111
- sendMessagePortToOpenerWorker,
2112
- sendMessagePortToProcessExplorer: sendMessagePortToProcessExplorer$1,
2113
- sendMessagePortToQuickPickWorker,
2114
- sendMessagePortToRendererProcess,
2115
- sendMessagePortToSearchProcess,
2116
- sendMessagePortToSettingsWorker,
2117
- sendMessagePortToSharedProcess,
2118
- sendMessagePortToSourceControlWorker,
2119
- sendMessagePortToSyntaxHighlightingWorker,
2120
- sendMessagePortToTerminalProcess,
2121
- sendMessagePortToTextMeasurementWorker,
2122
- sendMessagePortToTextSearchWorker,
2123
- set: set$2,
2124
- setAdditionalFocus,
2125
- setColorTheme,
2126
- setExtensionsSearchValue,
2127
- setFocus,
2128
- setWebViewPort,
2129
- setWorkspacePath,
2130
- showContextMenu,
2131
- showContextMenu2,
2132
- showErrorDialog,
2133
- showMessageBox,
2134
- showPanel,
2135
- showPreview,
2136
- showSaveFilePicker,
2137
- showSideBar,
2138
- togglePanelView,
2139
- uninstallExtension,
2140
- unmaximizeWindow,
2141
- unregisterWebViewInterceptor,
2142
- writeClipBoardImage,
2143
- writeClipBoardText,
2144
- writeFile
2145
- };
2146
1583
 
2147
1584
  const debugProcess = async (state, index = state.focusedIndex) => {
2148
1585
  const process = state.visibleProcesses[index];
@@ -2192,7 +1629,7 @@ const processExplorerUpdateInterval = 1000;
2192
1629
 
2193
1630
  const intervals = new Map();
2194
1631
  const pending = new Set();
2195
- const dispose$1 = uid => {
1632
+ const dispose$3 = uid => {
2196
1633
  const interval = intervals.get(uid);
2197
1634
  if (interval) {
2198
1635
  clearInterval(interval);
@@ -2202,7 +1639,7 @@ const dispose$1 = uid => {
2202
1639
  };
2203
1640
  const update = async uid => {
2204
1641
  if (!getKeys$1().includes(uid)) {
2205
- dispose$1(uid);
1642
+ dispose$3(uid);
2206
1643
  return;
2207
1644
  }
2208
1645
  if (pending.has(uid)) {
@@ -2227,9 +1664,95 @@ const start = (uid, interval = processExplorerUpdateInterval) => {
2227
1664
  intervals.set(uid, intervalId);
2228
1665
  };
2229
1666
 
2230
- const dispose = uid => {
2231
- dispose$1(uid);
1667
+ const sendMessagePortToProcessExplorer = async port => {
1668
+ await sendMessagePortToProcessExplorer$1(port);
1669
+ };
1670
+
1671
+ const launchProcessExplorerElectron = async () => {
1672
+ try {
1673
+ const rpc = await create$5({
1674
+ commandMap: {},
1675
+ send: sendMessagePortToProcessExplorer
1676
+ });
1677
+ return rpc;
1678
+ } catch (error) {
1679
+ throw new VError(error, 'Failed to create process explorer electron rpc');
1680
+ }
1681
+ };
1682
+
1683
+ const launchProcessExplorerNode = async () => {
1684
+ try {
1685
+ const rpc = await create$2({
1686
+ commandMap: {},
1687
+ type: 'process-explorer'
1688
+ });
1689
+ return rpc;
1690
+ } catch (error) {
1691
+ throw new VError(error, 'Failed to create process explorer websocket rpc');
1692
+ }
1693
+ };
1694
+
1695
+ const state$1 = {
1696
+ rpc: undefined
1697
+ };
1698
+ const invoke = async (method, ...params) => {
1699
+ if (!state$1.rpc) {
1700
+ throw new Error('ProcessExplorerModule is not initialized');
1701
+ }
1702
+ return state$1.rpc.invoke(method, ...params);
1703
+ };
1704
+ const set$1 = newRpc => {
1705
+ state$1.rpc = newRpc;
1706
+ };
1707
+ const dispose$2 = async () => {
1708
+ const {
1709
+ rpc
1710
+ } = state$1;
1711
+ state$1.rpc = undefined;
1712
+ await rpc?.dispose();
1713
+ };
1714
+
1715
+ const state = {
1716
+ initializedPlatform: 0
1717
+ };
1718
+ const initializeProcessExplorer = async platform => {
1719
+ if (state.initializedPlatform === platform) {
1720
+ return;
1721
+ }
1722
+ if (platform === Electron) {
1723
+ const rpc = await launchProcessExplorerElectron();
1724
+ set$1(rpc);
1725
+ state.initializedPlatform = platform;
1726
+ return;
1727
+ }
1728
+ if (platform === Remote) {
1729
+ const rpc = await launchProcessExplorerNode();
1730
+ set$1(rpc);
1731
+ state.initializedPlatform = platform;
1732
+ }
1733
+ };
1734
+ const dispose$1 = async () => {
1735
+ state.initializedPlatform = 0;
1736
+ await dispose$2();
1737
+ };
1738
+
1739
+ const dispose = async uid => {
2232
1740
  dispose$3(uid);
1741
+ dispose$4(uid);
1742
+ if (getKeys$1().length === 0) {
1743
+ await dispose$1();
1744
+ }
1745
+ };
1746
+
1747
+ const createE2eFixtureProcess = async (state, marker) => {
1748
+ const pid = await invoke('Process.createE2eFixtureProcess', marker);
1749
+ return {
1750
+ ...state,
1751
+ rootPid: pid
1752
+ };
1753
+ };
1754
+ const disposeE2eFixtureProcess = async (_uid, pidOrMarker) => {
1755
+ await invoke('Process.disposeE2eFixtureProcess', pidOrMarker);
2233
1756
  };
2234
1757
 
2235
1758
  const expandAll = state => {
@@ -2459,7 +1982,7 @@ const handleContextMenu = async (state, index = state.focusedIndex, x = 0, y = 0
2459
1982
  focused: false,
2460
1983
  focusedIndex: index
2461
1984
  };
2462
- set$a(state.uid, state, newState);
1985
+ set$6(state.uid, state, newState);
2463
1986
  await show2(state.uid, ProcessExplorer$1, x, y, {
2464
1987
  index,
2465
1988
  menuId: ProcessExplorer$1
@@ -2478,22 +2001,15 @@ const handleFocus = state => {
2478
2001
  };
2479
2002
  };
2480
2003
 
2481
- const SigTerm = 'SIGTERM';
2482
-
2483
2004
  const killProcess = async (state, index = state.focusedIndex) => {
2484
2005
  const process = state.visibleProcesses[index];
2485
2006
  if (!process) {
2486
2007
  return state;
2487
2008
  }
2488
- await invoke$1('Process.kill', process.pid, SigTerm);
2009
+ await invoke('Process.kill', process.pid);
2489
2010
  return state;
2490
2011
  };
2491
2012
 
2492
- const WindowPid = -1;
2493
- const QueryOrHashRegex = /[?#]/;
2494
- const isValidMemoryValue = value => {
2495
- return typeof value === 'number' && Number.isFinite(value) && value >= 0;
2496
- };
2497
2013
  const getMeasureMemory = () => {
2498
2014
  const {
2499
2015
  measureUserAgentSpecificMemory
@@ -2503,6 +2019,12 @@ const getMeasureMemory = () => {
2503
2019
  }
2504
2020
  return measureUserAgentSpecificMemory.bind(performance);
2505
2021
  };
2022
+
2023
+ const isValidMemoryValue = value => {
2024
+ return typeof value === 'number' && Number.isFinite(value) && value >= 0;
2025
+ };
2026
+
2027
+ const QueryOrHashRegex = /[?#]/;
2506
2028
  const getUrlName = url => {
2507
2029
  if (!url || url === 'cross-origin-url') {
2508
2030
  return url;
@@ -2517,6 +2039,7 @@ const getUrlName = url => {
2517
2039
  return parts.at(-1) || url;
2518
2040
  }
2519
2041
  };
2042
+
2520
2043
  const getAttributionName = attribution => {
2521
2044
  const scope = attribution.scope || 'memory';
2522
2045
  const url = attribution.url ? getUrlName(attribution.url) : '';
@@ -2525,6 +2048,7 @@ const getAttributionName = attribution => {
2525
2048
  }
2526
2049
  return scope;
2527
2050
  };
2051
+
2528
2052
  const getBreakdownName = (entry, index) => {
2529
2053
  if (entry.attribution && entry.attribution.length > 0) {
2530
2054
  return entry.attribution.map(getAttributionName).join(', ');
@@ -2534,6 +2058,9 @@ const getBreakdownName = (entry, index) => {
2534
2058
  }
2535
2059
  return `breakdown ${index + 1}`;
2536
2060
  };
2061
+
2062
+ const WindowPid = -1;
2063
+
2537
2064
  const toBreakdownProcess = (entry, index) => {
2538
2065
  const name = getBreakdownName(entry, index);
2539
2066
  return {
@@ -2545,6 +2072,7 @@ const toBreakdownProcess = (entry, index) => {
2545
2072
  synthetic: true
2546
2073
  };
2547
2074
  };
2075
+
2548
2076
  const getFrontendMemoryUsage = async rootPid => {
2549
2077
  const measureMemory = getMeasureMemory();
2550
2078
  if (!measureMemory) {
@@ -2570,68 +2098,6 @@ const getFrontendMemoryUsage = async rootPid => {
2570
2098
  }
2571
2099
  };
2572
2100
 
2573
- const sendMessagePortToProcessExplorer = async port => {
2574
- const rendererWorker = RendererWorker;
2575
- await rendererWorker.sendMessagePortToProcessExplorer(port);
2576
- };
2577
-
2578
- const launchProcessExplorerElectron = async () => {
2579
- try {
2580
- const rpc = await create$5({
2581
- commandMap: {},
2582
- send: sendMessagePortToProcessExplorer
2583
- });
2584
- return rpc;
2585
- } catch (error) {
2586
- throw new VError(error, 'Failed to create process explorer electron rpc');
2587
- }
2588
- };
2589
-
2590
- const launchProcessExplorerNode = async () => {
2591
- try {
2592
- const rpc = await create$2({
2593
- commandMap: {},
2594
- type: 'process-explorer'
2595
- });
2596
- return rpc;
2597
- } catch (error) {
2598
- throw new VError(error, 'Failed to create process explorer websocket rpc');
2599
- }
2600
- };
2601
-
2602
- const state$1 = {
2603
- rpc: undefined
2604
- };
2605
- const invoke = async (method, ...params) => {
2606
- if (!state$1.rpc) {
2607
- throw new Error('ProcessExplorerModule is not initialized');
2608
- }
2609
- return state$1.rpc.invoke(method, ...params);
2610
- };
2611
- const set$1 = newRpc => {
2612
- state$1.rpc = newRpc;
2613
- };
2614
-
2615
- const state = {
2616
- initializedPlatform: 0
2617
- };
2618
- const initializeProcessExplorer = async platform => {
2619
- if (state.initializedPlatform === platform) {
2620
- return;
2621
- }
2622
- if (platform === Electron) {
2623
- const rpc = await launchProcessExplorerElectron();
2624
- set$1(rpc);
2625
- state.initializedPlatform = platform;
2626
- return;
2627
- }
2628
- if (platform === Remote) {
2629
- const rpc = await launchProcessExplorerNode();
2630
- set$1(rpc);
2631
- state.initializedPlatform = platform;
2632
- }
2633
- };
2634
-
2635
2101
  const getErrorMessage = error => {
2636
2102
  if (error instanceof Error) {
2637
2103
  return error.message;
@@ -2663,9 +2129,9 @@ const refresh = async state => {
2663
2129
  try {
2664
2130
  await initializeProcessExplorer(state.platform);
2665
2131
  const includeElectronData = state.platform === Electron;
2666
- const rootPid = state.rootPid || (await invoke('ProcessId.getMainProcessId', {
2132
+ const rootPid = state.rootPid === -1 ? await invoke('ProcessId.getMainProcessId', {
2667
2133
  includeElectronData
2668
- }));
2134
+ }) : state.rootPid;
2669
2135
  const processes = await invoke('ListProcessesWithMemoryUsage.listProcessesWithMemoryUsage', rootPid, includeElectronData);
2670
2136
  const frontendMemoryProcesses = state.includeFrontendMemoryUsage ? await getFrontendMemoryUsage(rootPid) : [];
2671
2137
  const allProcesses = [...processes, ...frontendMemoryProcesses];
@@ -3217,7 +2683,7 @@ const render2 = (uid, diffResult) => {
3217
2683
  oldState,
3218
2684
  scheduledState
3219
2685
  } = get$2(uid);
3220
- set$a(uid, scheduledState, scheduledState);
2686
+ set$6(uid, scheduledState, scheduledState);
3221
2687
  return applyRender(oldState, scheduledState, diffResult);
3222
2688
  };
3223
2689
 
@@ -3289,12 +2755,21 @@ const setError = async (state, rawError) => {
3289
2755
  };
3290
2756
  };
3291
2757
 
2758
+ const setRootProcessId = (state, rootPid) => {
2759
+ return {
2760
+ ...state,
2761
+ rootPid
2762
+ };
2763
+ };
2764
+
3292
2765
  const commandMap = {
3293
2766
  'ProcessExplorer.collapseAll': wrapCommand(collapseAll),
3294
2767
  'ProcessExplorer.create': create$d,
2768
+ 'ProcessExplorer.createE2eFixtureProcess': wrapCommand(createE2eFixtureProcess),
3295
2769
  'ProcessExplorer.debugProcess': wrapCommand(debugProcess),
3296
2770
  'ProcessExplorer.diff2': diff2,
3297
2771
  'ProcessExplorer.dispose': dispose,
2772
+ 'ProcessExplorer.disposeE2eFixtureProcess': disposeE2eFixtureProcess,
3298
2773
  'ProcessExplorer.expandAll': wrapCommand(expandAll),
3299
2774
  'ProcessExplorer.focusFirst': wrapCommand(focusFirst),
3300
2775
  'ProcessExplorer.focusLast': wrapCommand(focusLast),
@@ -3317,6 +2792,7 @@ const commandMap = {
3317
2792
  'ProcessExplorer.render2': render2,
3318
2793
  'ProcessExplorer.renderEventListeners': renderEventListeners,
3319
2794
  'ProcessExplorer.setError': wrapCommand(setError),
2795
+ 'ProcessExplorer.setRootProcessId': wrapCommand(setRootProcessId),
3320
2796
  'ProcessExplorer.terminate': terminate,
3321
2797
  'ProcessExplorer.update': wrapCommand(refresh)
3322
2798
  };
@@ -3339,7 +2815,7 @@ const createErrorWorkerRpc = async () => {
3339
2815
 
3340
2816
  const initializeErrorWorker = async () => {
3341
2817
  const rpc = await createErrorWorkerRpc();
3342
- set$7(rpc);
2818
+ set$4(rpc);
3343
2819
  };
3344
2820
 
3345
2821
  const sendMessagePortToFileSystemWorker = async port => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/process-explorer-worker",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",