@lvce-editor/test-worker 13.13.0 → 13.15.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.
package/dist/api.d.ts CHANGED
@@ -53,6 +53,11 @@ export interface UpdateConfig {
53
53
  readonly state: number;
54
54
  }
55
55
 
56
+ export interface DroppedFileHandle {
57
+ readonly file: File;
58
+ readonly id: number;
59
+ }
60
+
56
61
  export interface MockOpenAiResponseOptions {
57
62
  readonly status: number;
58
63
  readonly value: any;
@@ -67,11 +72,6 @@ export interface Diagnostic {
67
72
  readonly type: "error" | "warning";
68
73
  }
69
74
 
70
- export interface DroppedFileHandle {
71
- readonly file: File;
72
- readonly id: number;
73
- }
74
-
75
75
  export interface FileSystemTmpDirOptions {
76
76
  readonly scheme?: string;
77
77
  }
@@ -129,21 +129,26 @@ interface BaseUrl {
129
129
  }
130
130
 
131
131
  interface Chat {
132
+ readonly clearInput: () => Promise<void>;
132
133
  readonly deleteSessionAtIndex: (index: number) => Promise<void>;
133
134
  readonly enterNewLine: () => Promise<void>;
135
+ readonly getAuthState: () => Promise<any>;
134
136
  readonly getSelectedSessionId: () => Promise<string>;
137
+ readonly handleChatHeaderContextMenu: () => Promise<void>;
135
138
  readonly handleChatListContextMenu: (eventX: number, eventY: number) => Promise<void>;
136
139
  readonly handleClickBack: () => Promise<void>;
137
140
  readonly handleClickClose: () => Promise<void>;
138
141
  readonly handleClickDelete: () => Promise<void>;
139
142
  readonly handleClickNew: () => Promise<void>;
140
143
  readonly handleClickSettings: () => Promise<void>;
144
+ readonly handleDropFiles: (file: DroppedFileHandle) => Promise<void>;
141
145
  readonly handleInput: (text: string) => Promise<void>;
142
146
  readonly handleInputCopy: () => Promise<void>;
143
147
  readonly handleInputCut: () => Promise<void>;
144
148
  readonly handleInputFocus: () => Promise<void>;
145
149
  readonly handleInputPaste: () => Promise<void>;
146
150
  readonly handleModelChange: (modelId: string) => Promise<void>;
151
+ readonly handleModelInputBlur: () => Promise<void>;
147
152
  readonly handleSubmit: () => Promise<void>;
148
153
  readonly mockBackendAuthResponse: (response: any) => Promise<void>;
149
154
  readonly mockOpenAiResponse: (options: MockOpenAiResponseOptions) => Promise<void>;
@@ -152,6 +157,8 @@ interface Chat {
152
157
  readonly mockOpenApiStreamFinish: () => Promise<void>;
153
158
  readonly mockOpenApiStreamPushChunk: (chunk: string) => Promise<void>;
154
159
  readonly mockOpenApiStreamReset: () => Promise<void>;
160
+ readonly openAgentModePicker: () => Promise<void>;
161
+ readonly openMockSession: (sessionId: string, messages: readonly any[]) => Promise<void>;
155
162
  readonly rerender: () => Promise<void>;
156
163
  readonly reset: () => Promise<void>;
157
164
  readonly selectIndex: (index: number) => Promise<void>;
@@ -1373,6 +1373,7 @@ const toHaveJSProperty = async (locator, options) => {
1373
1373
  return `expected ${locatorString} to have js property ${key} ${value} but was ${actual}`;
1374
1374
  };
1375
1375
 
1376
+ /* eslint-disable @typescript-eslint/only-throw-error */
1376
1377
  const getFunction = fnName => {
1377
1378
  switch (fnName) {
1378
1379
  case 'toBeFocused':
@@ -1404,6 +1405,7 @@ const getFunction = fnName => {
1404
1405
  }
1405
1406
  };
1406
1407
 
1408
+ /* eslint-disable @typescript-eslint/only-throw-error */
1407
1409
  const string = (value, message) => {
1408
1410
  if (typeof value !== 'string') {
1409
1411
  throw new TypeError(message);
@@ -1415,6 +1417,8 @@ const number = (value, message) => {
1415
1417
  }
1416
1418
  };
1417
1419
 
1420
+ /* eslint-disable @typescript-eslint/only-throw-error, @typescript-eslint/prefer-readonly-parameter-types */
1421
+
1418
1422
  const expect$1 = locator => {
1419
1423
  return new Expect(locator);
1420
1424
  };
@@ -1550,6 +1554,7 @@ const performAction = async (locator, action, options) => {
1550
1554
  return invoke('TestFrameWork.performAction', locator, action, options);
1551
1555
  };
1552
1556
 
1557
+ /* eslint-disable @typescript-eslint/only-throw-error */
1553
1558
  const toButtonNumber = buttonType => {
1554
1559
  switch (buttonType) {
1555
1560
  case 'left':
@@ -1669,6 +1674,7 @@ const About = {
1669
1674
  show: show$7
1670
1675
  };
1671
1676
 
1677
+ /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
1672
1678
  const focus$2 = async () => {
1673
1679
  await invoke$1('ActivityBar.focus');
1674
1680
  };
@@ -1721,6 +1727,15 @@ const ActivityBar = {
1721
1727
  toggleActivityBarItem
1722
1728
  };
1723
1729
 
1730
+ const execute$1 = async (id, ...args) => {
1731
+ return invoke$1(id, ...args);
1732
+ };
1733
+
1734
+ const Command = {
1735
+ execute: execute$1
1736
+ };
1737
+
1738
+ /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
1724
1739
  const handleChatListContextMenu = async (eventX, eventY) => {
1725
1740
  await invoke$1('Chat.handleChatListContextMenu', eventX, eventY);
1726
1741
  };
@@ -1733,6 +1748,9 @@ const handleClickBack = async () => {
1733
1748
  const setNewChatModelPickerEnabled = async enabled => {
1734
1749
  await invoke$1('Chat.setNewChatModelPickerEnabled', enabled);
1735
1750
  };
1751
+ const openAgentModePicker = async () => {
1752
+ await invoke$1('Chat.openAgentModePicker');
1753
+ };
1736
1754
  const handleClickSettings = async () => {
1737
1755
  await invoke$1('Chat.handleClickSettings');
1738
1756
  };
@@ -1758,6 +1776,12 @@ const getSelectedSessionId = async () => {
1758
1776
  const handleInput$7 = async text => {
1759
1777
  await invoke$1('Chat.handleInput', 'composer', text, 'script');
1760
1778
  };
1779
+ const handleDropFiles = async file => {
1780
+ await execute$1('Chat.handleDropFiles', 'composer-drop-target', [file]);
1781
+ };
1782
+ const handleChatHeaderContextMenu = async () => {
1783
+ await execute$1('Chat.handleChatHeaderContextMenu', 0, 0);
1784
+ };
1761
1785
  const reset = async () => {
1762
1786
  await invoke$1('Chat.reset');
1763
1787
  };
@@ -1767,6 +1791,9 @@ const mockOpenApiStreamFinish = async () => {
1767
1791
  const mockOpenApiStreamPushChunk = async chunk => {
1768
1792
  await invoke$1('Chat.mockOpenApiStreamPushChunk', chunk);
1769
1793
  };
1794
+ const openMockSession = async (sessionId, messages) => {
1795
+ await invoke$1('Chat.openMockSession', sessionId, messages);
1796
+ };
1770
1797
  const handleSubmit = async () => {
1771
1798
  await invoke$1('Chat.handleSubmit');
1772
1799
  };
@@ -1806,6 +1833,9 @@ const deleteSessionAtIndex = async index => {
1806
1833
  const handleModelChange = async modelId => {
1807
1834
  await invoke$1('Chat.handleModelChange', modelId);
1808
1835
  };
1836
+ const handleModelInputBlur = async () => {
1837
+ await execute$1('Chat.handleModelInputBlur');
1838
+ };
1809
1839
  const handleInputPaste$1 = async () => {
1810
1840
  await invoke$1('Chat.handleInputPaste');
1811
1841
  };
@@ -1815,29 +1845,40 @@ const handleInputCopy$1 = async () => {
1815
1845
  const handleInputCut$1 = async () => {
1816
1846
  await invoke$1('Chat.handleInputCut');
1817
1847
  };
1848
+ const clearInput$1 = async () => {
1849
+ await execute$1('Chat.clearInput');
1850
+ };
1818
1851
  const mockOpenAiResponse = async options => {
1819
1852
  return invoke$1('Chat.mockOpenAiResponse', options);
1820
1853
  };
1821
1854
  const handleInputFocus = async () => {
1822
- return invoke$1('Chat.handleInputFocus');
1855
+ return execute$1('Chat.handleInputFocus', 'chat-list');
1856
+ };
1857
+ const getAuthState = async () => {
1858
+ return invoke$1('Chat.getAuthState');
1823
1859
  };
1824
1860
 
1825
1861
  const Chat = {
1862
+ clearInput: clearInput$1,
1826
1863
  deleteSessionAtIndex,
1827
1864
  enterNewLine,
1865
+ getAuthState,
1828
1866
  getSelectedSessionId,
1867
+ handleChatHeaderContextMenu,
1829
1868
  handleChatListContextMenu,
1830
1869
  handleClickBack,
1831
1870
  handleClickClose,
1832
1871
  handleClickDelete,
1833
1872
  handleClickNew,
1834
1873
  handleClickSettings,
1874
+ handleDropFiles,
1835
1875
  handleInput: handleInput$7,
1836
1876
  handleInputCopy: handleInputCopy$1,
1837
1877
  handleInputCut: handleInputCut$1,
1838
1878
  handleInputFocus,
1839
1879
  handleInputPaste: handleInputPaste$1,
1840
1880
  handleModelChange,
1881
+ handleModelInputBlur,
1841
1882
  handleSubmit,
1842
1883
  mockBackendAuthResponse,
1843
1884
  mockOpenAiResponse,
@@ -1846,6 +1887,8 @@ const Chat = {
1846
1887
  mockOpenApiStreamFinish,
1847
1888
  mockOpenApiStreamPushChunk,
1848
1889
  mockOpenApiStreamReset,
1890
+ openAgentModePicker,
1891
+ openMockSession,
1849
1892
  rerender,
1850
1893
  reset,
1851
1894
  selectIndex: selectIndex$7,
@@ -1858,6 +1901,7 @@ const Chat = {
1858
1901
  useMockApi
1859
1902
  };
1860
1903
 
1904
+ /* eslint-disable @typescript-eslint/only-throw-error, @typescript-eslint/prefer-readonly-parameter-types */
1861
1905
  const readNativeFiles = async () => {
1862
1906
  await invoke$1('ClipBoard.readNativeFiles');
1863
1907
  };
@@ -1903,14 +1947,6 @@ const ColorPicker = {
1903
1947
  setRelativeX
1904
1948
  };
1905
1949
 
1906
- const execute$1 = async (id, ...args) => {
1907
- return invoke$1(id, ...args);
1908
- };
1909
-
1910
- const Command = {
1911
- execute: execute$1
1912
- };
1913
-
1914
1950
  const selectItem$1 = async text => {
1915
1951
  await invoke$1('Menu.selectItem', text);
1916
1952
  };
@@ -2020,6 +2056,7 @@ const areSelectionsEqual = (a, b) => {
2020
2056
  return true;
2021
2057
  };
2022
2058
 
2059
+ /* eslint-disable @typescript-eslint/only-throw-error */
2023
2060
  const getEditorKey = async () => {
2024
2061
  const keys = await invoke$2('Editor.getKeys');
2025
2062
  if (keys.length === 0) {
@@ -2052,6 +2089,7 @@ const Settings = {
2052
2089
  update: update$1
2053
2090
  };
2054
2091
 
2092
+ /* eslint-disable @typescript-eslint/only-throw-error */
2055
2093
  const setCursor = async (rowIndex, columnIndex) => {
2056
2094
  await invoke$1('Editor.cursorSet', rowIndex, columnIndex);
2057
2095
  };
@@ -2520,6 +2558,7 @@ const EditorSourceAction = {
2520
2558
  selectIndex: selectIndex$5
2521
2559
  };
2522
2560
 
2561
+ /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
2523
2562
  const openContextMenu = async index => {
2524
2563
  await invoke$1('Explorer.handleContextMenuKeyboard', index);
2525
2564
  };
@@ -2859,6 +2898,7 @@ const ExtensionSearch = {
2859
2898
 
2860
2899
  const Memfs = 'memfs';
2861
2900
 
2901
+ /* eslint-disable @typescript-eslint/only-throw-error */
2862
2902
  const toFileUrl = url => {
2863
2903
  const urlObject = new URL(url);
2864
2904
  const pathName = urlObject.pathname;
@@ -2909,6 +2949,8 @@ const isValidFileMap = value => {
2909
2949
  return true;
2910
2950
  };
2911
2951
 
2952
+ /* eslint-disable @typescript-eslint/only-throw-error */
2953
+
2912
2954
  const loadFileMap = async fileMapUrl => {
2913
2955
  try {
2914
2956
  const response = await fetch(fileMapUrl);
@@ -2953,6 +2995,7 @@ const stringifyJson = data => {
2953
2995
  return JSON.stringify(data, null, 2) + '\n';
2954
2996
  };
2955
2997
 
2998
+ /* eslint-disable @typescript-eslint/only-throw-error */
2956
2999
  const writeFile = async (uri, content) => {
2957
3000
  await invoke$1('FileSystem.writeFile', uri, content);
2958
3001
  };
@@ -3319,6 +3362,7 @@ const LanguageModels = {
3319
3362
  removeModel
3320
3363
  };
3321
3364
 
3365
+ /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
3322
3366
  const openUri = async uri => {
3323
3367
  await invoke$1('Main.openUri', uri);
3324
3368
  };
@@ -3407,6 +3451,7 @@ const Main = {
3407
3451
  splitRight
3408
3452
  };
3409
3453
 
3454
+ /* eslint-disable @typescript-eslint/only-throw-error, @typescript-eslint/prefer-readonly-parameter-types */
3410
3455
  const enableMemoryOpener = async () => {
3411
3456
  await invoke('Open.enableMemoryOpener');
3412
3457
  };
@@ -3738,6 +3783,7 @@ const RunAndDebug = {
3738
3783
  show: show$2
3739
3784
  };
3740
3785
 
3786
+ /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
3741
3787
  const setValue = async value => {
3742
3788
  await invoke$1('Search.handleInput', value, Script);
3743
3789
  };
@@ -4112,6 +4158,8 @@ const waitForFirstEventEvent = async port => {
4112
4158
  return firstEvent;
4113
4159
  };
4114
4160
 
4161
+ /* eslint-disable @typescript-eslint/only-throw-error */
4162
+
4115
4163
  const createPortRpc = async webViewId => {
4116
4164
  // TODO use transforpemssageportrpc
4117
4165
  const {
@@ -4346,6 +4394,7 @@ const importScript = async url => {
4346
4394
  }
4347
4395
  };
4348
4396
 
4397
+ /* eslint-disable @typescript-eslint/only-throw-error */
4349
4398
  const importTest = async url => {
4350
4399
  try {
4351
4400
  return await importScript(url);
@@ -4354,6 +4403,8 @@ const importTest = async url => {
4354
4403
  }
4355
4404
  };
4356
4405
 
4406
+ /* eslint-disable @typescript-eslint/only-throw-error */
4407
+
4357
4408
  let items = [];
4358
4409
  const push = item => {
4359
4410
  items = [...items, item];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "13.13.0",
3
+ "version": "13.15.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",