@lvce-editor/test-worker 13.15.0 → 13.17.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
@@ -58,6 +58,10 @@ export interface DroppedFileHandle {
58
58
  readonly id: number;
59
59
  }
60
60
 
61
+ export interface MockResponseOptions {
62
+ readonly text: string;
63
+ }
64
+
61
65
  export interface MockOpenAiResponseOptions {
62
66
  readonly status: number;
63
67
  readonly value: any;
@@ -130,25 +134,32 @@ interface BaseUrl {
130
134
 
131
135
  interface Chat {
132
136
  readonly clearInput: () => Promise<void>;
137
+ readonly closeGitBranchPicker: () => Promise<void>;
133
138
  readonly deleteSessionAtIndex: (index: number) => Promise<void>;
134
139
  readonly enterNewLine: () => Promise<void>;
135
140
  readonly getAuthState: () => Promise<any>;
136
141
  readonly getSelectedSessionId: () => Promise<string>;
142
+ readonly handleAgentModeChange: (newAgentMode: string) => Promise<void>;
137
143
  readonly handleChatHeaderContextMenu: () => Promise<void>;
138
144
  readonly handleChatListContextMenu: (eventX: number, eventY: number) => Promise<void>;
139
145
  readonly handleClickBack: () => Promise<void>;
140
146
  readonly handleClickClose: () => Promise<void>;
141
147
  readonly handleClickDelete: () => Promise<void>;
148
+ readonly handleClickFileName: (fileName: string) => Promise<void>;
142
149
  readonly handleClickNew: () => Promise<void>;
150
+ readonly handleClickSessionDebug: () => Promise<void>;
143
151
  readonly handleClickSettings: () => Promise<void>;
152
+ readonly handleContextMenuChatImageAttachment: (id: string, x: number, y: number) => Promise<void>;
144
153
  readonly handleDropFiles: (file: DroppedFileHandle) => Promise<void>;
145
154
  readonly handleInput: (text: string) => Promise<void>;
146
155
  readonly handleInputCopy: () => Promise<void>;
147
156
  readonly handleInputCut: () => Promise<void>;
148
157
  readonly handleInputFocus: () => Promise<void>;
149
158
  readonly handleInputPaste: () => Promise<void>;
159
+ readonly handleMessagesScroll: (id: number, x: number, y: number) => Promise<void>;
150
160
  readonly handleModelChange: (modelId: string) => Promise<void>;
151
161
  readonly handleModelInputBlur: () => Promise<void>;
162
+ readonly handleProjectListContextMenu: (id: number, x: number, y: number) => Promise<void>;
152
163
  readonly handleSubmit: () => Promise<void>;
153
164
  readonly mockBackendAuthResponse: (response: any) => Promise<void>;
154
165
  readonly mockOpenAiResponse: (options: MockOpenAiResponseOptions) => Promise<void>;
@@ -158,16 +169,25 @@ interface Chat {
158
169
  readonly mockOpenApiStreamPushChunk: (chunk: string) => Promise<void>;
159
170
  readonly mockOpenApiStreamReset: () => Promise<void>;
160
171
  readonly openAgentModePicker: () => Promise<void>;
172
+ readonly openGitBranchPicker: () => Promise<void>;
161
173
  readonly openMockSession: (sessionId: string, messages: readonly any[]) => Promise<void>;
174
+ readonly openModelPicker: () => Promise<void>;
175
+ readonly registerMockResponse: (options: MockResponseOptions) => Promise<void>;
162
176
  readonly rerender: () => Promise<void>;
163
177
  readonly reset: () => Promise<void>;
164
178
  readonly selectIndex: (index: number) => Promise<void>;
179
+ readonly setAddContextButtonEnabled: (enabled: boolean) => Promise<void>;
165
180
  readonly setAuthEnabled: (enabled: boolean) => Promise<void>;
166
181
  readonly setBackendUrl: (url: string) => Promise<void>;
167
182
  readonly setNewChatModelPickerEnabled: (enabled: boolean) => Promise<void>;
183
+ readonly setQuestionToolEnabled: (enabled: boolean) => Promise<void>;
184
+ readonly setReasoningEffort: (effort: string) => Promise<void>;
185
+ readonly setReasoningPickerEnabled: (enabled: boolean) => Promise<void>;
186
+ readonly setScrollDownButtonEnabled: (enabled: boolean) => Promise<void>;
168
187
  readonly setSearchEnabled: (enabled: boolean) => Promise<void>;
169
188
  readonly setStreamingEnabled: (enabled: boolean) => Promise<void>;
170
189
  readonly show: () => Promise<void>;
190
+ readonly showComposerAttachmentPreviewOverlay: (attachmentId: string) => Promise<void>;
171
191
  readonly useMockApi: () => Promise<void>;
172
192
  }
173
193
 
@@ -1736,6 +1736,12 @@ const Command = {
1736
1736
  };
1737
1737
 
1738
1738
  /* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */
1739
+ const setReasoningPickerEnabled = async enabled => {
1740
+ await invoke$1('Chat.setReasoningPickerEnabled', enabled);
1741
+ };
1742
+ const setReasoningEffort = async effort => {
1743
+ await invoke$1('Chat.setReasoningEffort', effort);
1744
+ };
1739
1745
  const handleChatListContextMenu = async (eventX, eventY) => {
1740
1746
  await invoke$1('Chat.handleChatListContextMenu', eventX, eventY);
1741
1747
  };
@@ -1766,6 +1772,9 @@ const handleClickNew = async () => {
1766
1772
  const enterNewLine = async () => {
1767
1773
  await invoke$1('Chat.enterNewLine');
1768
1774
  };
1775
+ const setScrollDownButtonEnabled = async enabled => {
1776
+ await invoke$1('Chat.setScrollDownButtonEnabled', enabled);
1777
+ };
1769
1778
  const show$6 = async () => {
1770
1779
  await invoke$1('Layout.showSecondarySideBar');
1771
1780
  await invoke$1('Chat.reset');
@@ -1779,12 +1788,21 @@ const handleInput$7 = async text => {
1779
1788
  const handleDropFiles = async file => {
1780
1789
  await execute$1('Chat.handleDropFiles', 'composer-drop-target', [file]);
1781
1790
  };
1791
+ const showComposerAttachmentPreviewOverlay = async attachmentId => {
1792
+ await execute$1('Chat.showComposerAttachmentPreviewOverlay', attachmentId);
1793
+ };
1794
+ const handleClickSessionDebug = async () => {
1795
+ await execute$1('Chat.handleClickSessionDebug');
1796
+ };
1782
1797
  const handleChatHeaderContextMenu = async () => {
1783
1798
  await execute$1('Chat.handleChatHeaderContextMenu', 0, 0);
1784
1799
  };
1785
1800
  const reset = async () => {
1786
1801
  await invoke$1('Chat.reset');
1787
1802
  };
1803
+ const handleMessagesScroll = async (id, x, y) => {
1804
+ await invoke$1('Chat.handleMessagesScroll', id, x, y);
1805
+ };
1788
1806
  const mockOpenApiStreamFinish = async () => {
1789
1807
  await invoke$1('Chat.mockOpenApiStreamFinish');
1790
1808
  };
@@ -1794,6 +1812,9 @@ const mockOpenApiStreamPushChunk = async chunk => {
1794
1812
  const openMockSession = async (sessionId, messages) => {
1795
1813
  await invoke$1('Chat.openMockSession', sessionId, messages);
1796
1814
  };
1815
+ const registerMockResponse = async options => {
1816
+ await invoke$1('Chat.registerMockResponse', options);
1817
+ };
1797
1818
  const handleSubmit = async () => {
1798
1819
  await invoke$1('Chat.handleSubmit');
1799
1820
  };
@@ -1803,6 +1824,12 @@ const setStreamingEnabled = async enabled => {
1803
1824
  const useMockApi = async () => {
1804
1825
  await invoke$1('Chat.useMockApi', true);
1805
1826
  };
1827
+ const openGitBranchPicker = async () => {
1828
+ await invoke$1('Chat.openGitBranchPicker');
1829
+ };
1830
+ const closeGitBranchPicker = async () => {
1831
+ await invoke$1('Chat.closeGitBranchPicker');
1832
+ };
1806
1833
  const setAuthEnabled = async enabled => {
1807
1834
  await invoke$1('Chat.setAuthEnabled', enabled);
1808
1835
  };
@@ -1824,9 +1851,18 @@ const mockOpenApiRequestReset = async () => {
1824
1851
  const mockOpenApiStreamReset = async () => {
1825
1852
  await invoke$1('Chat.mockOpenApiStreamReset');
1826
1853
  };
1854
+ const openModelPicker = async () => {
1855
+ await invoke$1('Chat.openModelPicker');
1856
+ };
1827
1857
  const handleClickDelete = async () => {
1828
1858
  await invoke$1('Chat.handleClickDelete');
1829
1859
  };
1860
+ const handleContextMenuChatImageAttachment = async (id, x, y) => {
1861
+ await invoke$1('Chat.handleContextMenuChatImageAttachment', id, x, y);
1862
+ };
1863
+ const setAddContextButtonEnabled = async enabled => {
1864
+ await invoke$1('Chat.setAddContextButtonEnabled', enabled);
1865
+ };
1830
1866
  const deleteSessionAtIndex = async index => {
1831
1867
  await invoke$1('Chat.deleteSessionAtIndex', index);
1832
1868
  };
@@ -1839,15 +1875,24 @@ const handleModelInputBlur = async () => {
1839
1875
  const handleInputPaste$1 = async () => {
1840
1876
  await invoke$1('Chat.handleInputPaste');
1841
1877
  };
1878
+ const setQuestionToolEnabled = async enabled => {
1879
+ await invoke$1('Chat.setQuestionToolEnabled', enabled);
1880
+ };
1842
1881
  const handleInputCopy$1 = async () => {
1843
1882
  await invoke$1('Chat.handleInputCopy');
1844
1883
  };
1884
+ const handleClickFileName = async fileName => {
1885
+ await invoke$1('Chat.handleClickFileName', fileName);
1886
+ };
1845
1887
  const handleInputCut$1 = async () => {
1846
1888
  await invoke$1('Chat.handleInputCut');
1847
1889
  };
1848
1890
  const clearInput$1 = async () => {
1849
1891
  await execute$1('Chat.clearInput');
1850
1892
  };
1893
+ const handleProjectListContextMenu = async (id, x, y) => {
1894
+ await execute$1('Chat.handleProjectListContextMenu', id, x, y);
1895
+ };
1851
1896
  const mockOpenAiResponse = async options => {
1852
1897
  return invoke$1('Chat.mockOpenAiResponse', options);
1853
1898
  };
@@ -1857,28 +1902,38 @@ const handleInputFocus = async () => {
1857
1902
  const getAuthState = async () => {
1858
1903
  return invoke$1('Chat.getAuthState');
1859
1904
  };
1905
+ const handleAgentModeChange = async newAgentMode => {
1906
+ return invoke$1('Chat.handleAgentModeChange', newAgentMode);
1907
+ };
1860
1908
 
1861
1909
  const Chat = {
1862
1910
  clearInput: clearInput$1,
1911
+ closeGitBranchPicker,
1863
1912
  deleteSessionAtIndex,
1864
1913
  enterNewLine,
1865
1914
  getAuthState,
1866
1915
  getSelectedSessionId,
1916
+ handleAgentModeChange,
1867
1917
  handleChatHeaderContextMenu,
1868
1918
  handleChatListContextMenu,
1869
1919
  handleClickBack,
1870
1920
  handleClickClose,
1871
1921
  handleClickDelete,
1922
+ handleClickFileName,
1872
1923
  handleClickNew,
1924
+ handleClickSessionDebug,
1873
1925
  handleClickSettings,
1926
+ handleContextMenuChatImageAttachment,
1874
1927
  handleDropFiles,
1875
1928
  handleInput: handleInput$7,
1876
1929
  handleInputCopy: handleInputCopy$1,
1877
1930
  handleInputCut: handleInputCut$1,
1878
1931
  handleInputFocus,
1879
1932
  handleInputPaste: handleInputPaste$1,
1933
+ handleMessagesScroll,
1880
1934
  handleModelChange,
1881
1935
  handleModelInputBlur,
1936
+ handleProjectListContextMenu,
1882
1937
  handleSubmit,
1883
1938
  mockBackendAuthResponse,
1884
1939
  mockOpenAiResponse,
@@ -1888,16 +1943,25 @@ const Chat = {
1888
1943
  mockOpenApiStreamPushChunk,
1889
1944
  mockOpenApiStreamReset,
1890
1945
  openAgentModePicker,
1946
+ openGitBranchPicker,
1891
1947
  openMockSession,
1948
+ openModelPicker,
1949
+ registerMockResponse,
1892
1950
  rerender,
1893
1951
  reset,
1894
1952
  selectIndex: selectIndex$7,
1953
+ setAddContextButtonEnabled,
1895
1954
  setAuthEnabled,
1896
1955
  setBackendUrl,
1897
1956
  setNewChatModelPickerEnabled,
1957
+ setQuestionToolEnabled,
1958
+ setReasoningEffort,
1959
+ setReasoningPickerEnabled,
1960
+ setScrollDownButtonEnabled,
1898
1961
  setSearchEnabled,
1899
1962
  setStreamingEnabled,
1900
1963
  show: show$6,
1964
+ showComposerAttachmentPreviewOverlay,
1901
1965
  useMockApi
1902
1966
  };
1903
1967
 
@@ -4450,14 +4514,20 @@ const execute = async (href, platform, assetDir) => {
4450
4514
  setUrl(scriptUrl); // TODO avoid side effect
4451
4515
  // 2. import that script
4452
4516
  const module = await importTest(scriptUrl);
4453
- if (module.mockRpc) {
4454
- setMockRpc(module.mockRpc);
4455
- }
4456
- if (module.test) {
4457
- if (module.skip) {
4458
- await skipTest(module.name);
4517
+ const {
4518
+ mockRpc,
4519
+ name,
4520
+ skip,
4521
+ test
4522
+ } = module;
4523
+ if (mockRpc) {
4524
+ setMockRpc(mockRpc);
4525
+ }
4526
+ if (test) {
4527
+ if (skip) {
4528
+ await skipTest(name);
4459
4529
  } else {
4460
- await executeTest(module.name, module.test, globals);
4530
+ await executeTest(name, test, globals);
4461
4531
  }
4462
4532
  }
4463
4533
  // TODO maybe setup file watcher earlier, to not miss events?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "13.15.0",
3
+ "version": "13.17.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",