@lvce-editor/test-worker 13.10.0 → 13.11.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 +34 -24
- package/dist/testWorkerMain.js +125 -87
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -128,6 +128,32 @@ interface BaseUrl {
|
|
|
128
128
|
readonly getBaseUrl: () => string;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
interface Chat {
|
|
132
|
+
readonly deleteSessionAtIndex: (index: number) => Promise<void>;
|
|
133
|
+
readonly enterNewLine: () => Promise<void>;
|
|
134
|
+
readonly getSelectedSessionId: () => Promise<string>;
|
|
135
|
+
readonly handleClickBack: () => Promise<void>;
|
|
136
|
+
readonly handleClickClose: () => Promise<void>;
|
|
137
|
+
readonly handleClickDelete: () => Promise<void>;
|
|
138
|
+
readonly handleClickNew: () => Promise<void>;
|
|
139
|
+
readonly handleClickSettings: () => Promise<void>;
|
|
140
|
+
readonly handleInput: (text: string) => Promise<void>;
|
|
141
|
+
readonly handleModelChange: (modelId: string) => Promise<void>;
|
|
142
|
+
readonly handleSubmit: () => Promise<void>;
|
|
143
|
+
readonly mockOpenAiResponse: (options: MockOpenAiResponseOptions) => Promise<void>;
|
|
144
|
+
readonly mockOpenApiRequestGetAll: () => Promise<readonly any[]>;
|
|
145
|
+
readonly mockOpenApiRequestReset: () => Promise<void>;
|
|
146
|
+
readonly mockOpenApiStreamFinish: () => Promise<void>;
|
|
147
|
+
readonly mockOpenApiStreamPushChunk: (chunk: string) => Promise<void>;
|
|
148
|
+
readonly mockOpenApiStreamReset: () => Promise<void>;
|
|
149
|
+
readonly rerender: () => Promise<void>;
|
|
150
|
+
readonly reset: () => Promise<void>;
|
|
151
|
+
readonly selectIndex: (index: number) => Promise<void>;
|
|
152
|
+
readonly setStreamingEnabled: (enabled: boolean) => Promise<void>;
|
|
153
|
+
readonly show: () => Promise<void>;
|
|
154
|
+
readonly useMockApi: () => Promise<void>;
|
|
155
|
+
}
|
|
156
|
+
|
|
131
157
|
interface ClipBoard {
|
|
132
158
|
readonly disableMemoryClipBoard: () => Promise<void>;
|
|
133
159
|
readonly enableMemoryClipBoard: () => Promise<void>;
|
|
@@ -167,29 +193,6 @@ interface Dialog {
|
|
|
167
193
|
readonly showSaveFilePicker: () => Promise<void>;
|
|
168
194
|
}
|
|
169
195
|
|
|
170
|
-
interface Chat {
|
|
171
|
-
readonly deleteSessionAtIndex: (index: number) => Promise<void>;
|
|
172
|
-
readonly enterNewLine: () => Promise<void>;
|
|
173
|
-
readonly getSelectedSessionId: () => Promise<string>;
|
|
174
|
-
readonly handleClickBack: () => Promise<void>;
|
|
175
|
-
readonly handleClickClose: () => Promise<void>;
|
|
176
|
-
readonly handleClickDelete: () => Promise<void>;
|
|
177
|
-
readonly handleClickNew: () => Promise<void>;
|
|
178
|
-
readonly handleClickSettings: () => Promise<void>;
|
|
179
|
-
readonly handleInput: (text: string) => Promise<void>;
|
|
180
|
-
readonly handleModelChange: (modelId: string) => Promise<void>;
|
|
181
|
-
readonly handleSubmit: () => Promise<void>;
|
|
182
|
-
readonly mockOpenAiResponse: (options: MockOpenAiResponseOptions) => Promise<void>;
|
|
183
|
-
readonly mockOpenApiStreamFinish: () => Promise<void>;
|
|
184
|
-
readonly mockOpenApiStreamPushChunk: (chunk: string) => Promise<void>;
|
|
185
|
-
readonly rerender: () => Promise<void>;
|
|
186
|
-
readonly reset: () => Promise<void>;
|
|
187
|
-
readonly selectIndex: (index: number) => Promise<void>;
|
|
188
|
-
readonly setStreamingEnabled: (enabled: boolean) => Promise<void>;
|
|
189
|
-
readonly show: () => Promise<void>;
|
|
190
|
-
readonly useMockApi: () => Promise<void>;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
196
|
interface Editor {
|
|
194
197
|
readonly addAllMissingImports: () => Promise<void>;
|
|
195
198
|
readonly cancelSelection: () => Promise<void>;
|
|
@@ -501,6 +504,12 @@ interface Main {
|
|
|
501
504
|
readonly splitRight: () => Promise<void>;
|
|
502
505
|
}
|
|
503
506
|
|
|
507
|
+
interface Open {
|
|
508
|
+
readonly disableMemoryOpener: () => Promise<void>;
|
|
509
|
+
readonly enableMemoryOpener: () => Promise<void>;
|
|
510
|
+
readonly shouldHaveUrl: (expectedText: string | RegExp) => Promise<void>;
|
|
511
|
+
}
|
|
512
|
+
|
|
504
513
|
interface Output {
|
|
505
514
|
readonly clear: () => Promise<void>;
|
|
506
515
|
readonly handleFilterInput: (text: string) => Promise<void>;
|
|
@@ -697,13 +706,13 @@ export interface TestApi {
|
|
|
697
706
|
readonly About: About
|
|
698
707
|
readonly ActivityBar: ActivityBar
|
|
699
708
|
readonly BaseUrl: BaseUrl
|
|
709
|
+
readonly Chat: Chat
|
|
700
710
|
readonly ClipBoard: ClipBoard
|
|
701
711
|
readonly ColorPicker: ColorPicker
|
|
702
712
|
readonly Command: Command
|
|
703
713
|
readonly ContextMenu: ContextMenu
|
|
704
714
|
readonly Developer: Developer
|
|
705
715
|
readonly Dialog: Dialog
|
|
706
|
-
readonly Chat: Chat
|
|
707
716
|
readonly Editor: Editor
|
|
708
717
|
readonly EditorCompletion: EditorCompletion
|
|
709
718
|
readonly EditorHover: EditorHover
|
|
@@ -721,6 +730,7 @@ export interface TestApi {
|
|
|
721
730
|
readonly KeyBoard: KeyBoard
|
|
722
731
|
readonly LanguageModels: LanguageModels
|
|
723
732
|
readonly Main: Main
|
|
733
|
+
readonly Open: Open
|
|
724
734
|
readonly Output: Output
|
|
725
735
|
readonly Panel: Panel
|
|
726
736
|
readonly Platform: Platform
|
package/dist/testWorkerMain.js
CHANGED
|
@@ -1700,6 +1700,103 @@ const ActivityBar = {
|
|
|
1700
1700
|
toggleActivityBarItem
|
|
1701
1701
|
};
|
|
1702
1702
|
|
|
1703
|
+
const handleClickBack = async () => {
|
|
1704
|
+
await invoke('Chat.handleClickBack');
|
|
1705
|
+
};
|
|
1706
|
+
const handleClickSettings = async () => {
|
|
1707
|
+
await invoke('Chat.handleClickSettings');
|
|
1708
|
+
};
|
|
1709
|
+
const selectIndex$7 = async index => {
|
|
1710
|
+
await invoke('Chat.selectIndex', index);
|
|
1711
|
+
};
|
|
1712
|
+
const handleClickClose = async () => {
|
|
1713
|
+
await invoke('Chat.handleClickClose');
|
|
1714
|
+
};
|
|
1715
|
+
const handleClickNew = async () => {
|
|
1716
|
+
await invoke('Chat.handleClickNew');
|
|
1717
|
+
};
|
|
1718
|
+
const enterNewLine = async () => {
|
|
1719
|
+
await invoke('Chat.enterNewLine');
|
|
1720
|
+
};
|
|
1721
|
+
const show$6 = async () => {
|
|
1722
|
+
await invoke('Layout.showSecondarySideBar');
|
|
1723
|
+
await invoke('Chat.reset');
|
|
1724
|
+
};
|
|
1725
|
+
const getSelectedSessionId = async () => {
|
|
1726
|
+
return invoke('Chat.getSelectedSessionId');
|
|
1727
|
+
};
|
|
1728
|
+
const handleInput$7 = async text => {
|
|
1729
|
+
await invoke('Chat.handleInput', 'composer', text, 'script');
|
|
1730
|
+
};
|
|
1731
|
+
const reset = async () => {
|
|
1732
|
+
await invoke('Chat.reset');
|
|
1733
|
+
};
|
|
1734
|
+
const mockOpenApiStreamFinish = async () => {
|
|
1735
|
+
await invoke('Chat.mockOpenApiStreamFinish');
|
|
1736
|
+
};
|
|
1737
|
+
const mockOpenApiStreamPushChunk = async chunk => {
|
|
1738
|
+
await invoke('Chat.mockOpenApiStreamPushChunk', chunk);
|
|
1739
|
+
};
|
|
1740
|
+
const handleSubmit = async () => {
|
|
1741
|
+
await invoke('Chat.handleSubmit');
|
|
1742
|
+
};
|
|
1743
|
+
const setStreamingEnabled = async enabled => {
|
|
1744
|
+
await invoke('Chat.setStreamingEnabled', enabled);
|
|
1745
|
+
};
|
|
1746
|
+
const useMockApi = async () => {
|
|
1747
|
+
await invoke('Chat.useMockApi', true);
|
|
1748
|
+
};
|
|
1749
|
+
const mockOpenApiRequestGetAll = async () => {
|
|
1750
|
+
return invoke('Chat.mockOpenApiRequestGetAll');
|
|
1751
|
+
};
|
|
1752
|
+
const rerender = async () => {
|
|
1753
|
+
await invoke('Chat.rerender');
|
|
1754
|
+
};
|
|
1755
|
+
const mockOpenApiRequestReset = async () => {
|
|
1756
|
+
await invoke('Chat.mockOpenApiRequestReset');
|
|
1757
|
+
};
|
|
1758
|
+
const mockOpenApiStreamReset = async () => {
|
|
1759
|
+
await invoke('Chat.mockOpenApiStreamReset');
|
|
1760
|
+
};
|
|
1761
|
+
const handleClickDelete = async () => {
|
|
1762
|
+
await invoke('Chat.handleClickDelete');
|
|
1763
|
+
};
|
|
1764
|
+
const deleteSessionAtIndex = async index => {
|
|
1765
|
+
await invoke('Chat.deleteSessionAtIndex', index);
|
|
1766
|
+
};
|
|
1767
|
+
const handleModelChange = async modelId => {
|
|
1768
|
+
await invoke('Chat.handleModelChange', modelId);
|
|
1769
|
+
};
|
|
1770
|
+
const mockOpenAiResponse = async options => {
|
|
1771
|
+
return invoke('Chat.mockOpenAiResponse', options);
|
|
1772
|
+
};
|
|
1773
|
+
|
|
1774
|
+
const Chat = {
|
|
1775
|
+
deleteSessionAtIndex,
|
|
1776
|
+
enterNewLine,
|
|
1777
|
+
getSelectedSessionId,
|
|
1778
|
+
handleClickBack,
|
|
1779
|
+
handleClickClose,
|
|
1780
|
+
handleClickDelete,
|
|
1781
|
+
handleClickNew,
|
|
1782
|
+
handleClickSettings,
|
|
1783
|
+
handleInput: handleInput$7,
|
|
1784
|
+
handleModelChange,
|
|
1785
|
+
handleSubmit,
|
|
1786
|
+
mockOpenAiResponse,
|
|
1787
|
+
mockOpenApiRequestGetAll,
|
|
1788
|
+
mockOpenApiRequestReset,
|
|
1789
|
+
mockOpenApiStreamFinish,
|
|
1790
|
+
mockOpenApiStreamPushChunk,
|
|
1791
|
+
mockOpenApiStreamReset,
|
|
1792
|
+
rerender,
|
|
1793
|
+
reset,
|
|
1794
|
+
selectIndex: selectIndex$7,
|
|
1795
|
+
setStreamingEnabled,
|
|
1796
|
+
show: show$6,
|
|
1797
|
+
useMockApi
|
|
1798
|
+
};
|
|
1799
|
+
|
|
1703
1800
|
const readNativeFiles = async () => {
|
|
1704
1801
|
await invoke('ClipBoard.readNativeFiles');
|
|
1705
1802
|
};
|
|
@@ -1712,7 +1809,7 @@ const enableMemoryClipBoard = async () => {
|
|
|
1712
1809
|
const disableMemoryClipBoard = async () => {
|
|
1713
1810
|
await invoke('ClipBoard.disableMemoryClipBoard');
|
|
1714
1811
|
};
|
|
1715
|
-
const matchesExpectedText = (actualText, expectedText) => {
|
|
1812
|
+
const matchesExpectedText$1 = (actualText, expectedText) => {
|
|
1716
1813
|
if (typeof expectedText === 'string') {
|
|
1717
1814
|
return actualText === expectedText;
|
|
1718
1815
|
}
|
|
@@ -1720,7 +1817,7 @@ const matchesExpectedText = (actualText, expectedText) => {
|
|
|
1720
1817
|
};
|
|
1721
1818
|
const shouldHaveText$1 = async expectedText => {
|
|
1722
1819
|
const actualText = await invoke('ClipBoard.readMemoryText');
|
|
1723
|
-
if (!matchesExpectedText(actualText, expectedText)) {
|
|
1820
|
+
if (!matchesExpectedText$1(actualText, expectedText)) {
|
|
1724
1821
|
throw new AssertionError(`expected clipboard to have text "${expectedText}" but was "${actualText}"`);
|
|
1725
1822
|
}
|
|
1726
1823
|
};
|
|
@@ -1834,91 +1931,6 @@ const Dialog = {
|
|
|
1834
1931
|
showSaveFilePicker
|
|
1835
1932
|
};
|
|
1836
1933
|
|
|
1837
|
-
const handleClickBack = async () => {
|
|
1838
|
-
await invoke('Chat.handleClickBack');
|
|
1839
|
-
};
|
|
1840
|
-
const handleClickSettings = async () => {
|
|
1841
|
-
await invoke('Chat.handleClickSettings');
|
|
1842
|
-
};
|
|
1843
|
-
const selectIndex$7 = async index => {
|
|
1844
|
-
await invoke('Chat.selectIndex', index);
|
|
1845
|
-
};
|
|
1846
|
-
const handleClickClose = async () => {
|
|
1847
|
-
await invoke('Chat.handleClickClose');
|
|
1848
|
-
};
|
|
1849
|
-
const handleClickNew = async () => {
|
|
1850
|
-
await invoke('Chat.handleClickNew');
|
|
1851
|
-
};
|
|
1852
|
-
const enterNewLine = async () => {
|
|
1853
|
-
await invoke('Chat.enterNewLine');
|
|
1854
|
-
};
|
|
1855
|
-
const show$6 = async () => {
|
|
1856
|
-
await invoke('Layout.showSecondarySideBar');
|
|
1857
|
-
await invoke('Chat.reset');
|
|
1858
|
-
};
|
|
1859
|
-
const getSelectedSessionId = async () => {
|
|
1860
|
-
return invoke('Chat.getSelectedSessionId');
|
|
1861
|
-
};
|
|
1862
|
-
const handleInput$7 = async text => {
|
|
1863
|
-
await invoke('Chat.handleInput', 'composer', text, 'script');
|
|
1864
|
-
};
|
|
1865
|
-
const reset = async () => {
|
|
1866
|
-
await invoke('Chat.reset');
|
|
1867
|
-
};
|
|
1868
|
-
const mockOpenApiStreamFinish = async () => {
|
|
1869
|
-
await invoke('Chat.mockOpenApiStreamFinish');
|
|
1870
|
-
};
|
|
1871
|
-
const mockOpenApiStreamPushChunk = async chunk => {
|
|
1872
|
-
await invoke('Chat.mockOpenApiStreamPushChunk', chunk);
|
|
1873
|
-
};
|
|
1874
|
-
const handleSubmit = async () => {
|
|
1875
|
-
await invoke('Chat.handleSubmit');
|
|
1876
|
-
};
|
|
1877
|
-
const setStreamingEnabled = async enabled => {
|
|
1878
|
-
await invoke('Chat.setStreamingEnabled', enabled);
|
|
1879
|
-
};
|
|
1880
|
-
const useMockApi = async () => {
|
|
1881
|
-
await invoke('Chat.useMockApi', true);
|
|
1882
|
-
};
|
|
1883
|
-
const rerender = async () => {
|
|
1884
|
-
await invoke('Chat.rerender');
|
|
1885
|
-
};
|
|
1886
|
-
const handleClickDelete = async () => {
|
|
1887
|
-
await invoke('Chat.handleClickDelete');
|
|
1888
|
-
};
|
|
1889
|
-
const deleteSessionAtIndex = async index => {
|
|
1890
|
-
await invoke('Chat.deleteSessionAtIndex', index);
|
|
1891
|
-
};
|
|
1892
|
-
const handleModelChange = async modelId => {
|
|
1893
|
-
await invoke('Chat.handleModelChange', modelId);
|
|
1894
|
-
};
|
|
1895
|
-
const mockOpenAiResponse = async options => {
|
|
1896
|
-
return invoke('Chat.mockOpenAiResponse', options);
|
|
1897
|
-
};
|
|
1898
|
-
|
|
1899
|
-
const Chat = {
|
|
1900
|
-
deleteSessionAtIndex,
|
|
1901
|
-
enterNewLine,
|
|
1902
|
-
getSelectedSessionId,
|
|
1903
|
-
handleClickBack,
|
|
1904
|
-
handleClickClose,
|
|
1905
|
-
handleClickDelete,
|
|
1906
|
-
handleClickNew,
|
|
1907
|
-
handleClickSettings,
|
|
1908
|
-
handleInput: handleInput$7,
|
|
1909
|
-
handleModelChange,
|
|
1910
|
-
handleSubmit,
|
|
1911
|
-
mockOpenAiResponse,
|
|
1912
|
-
mockOpenApiStreamFinish,
|
|
1913
|
-
mockOpenApiStreamPushChunk,
|
|
1914
|
-
rerender,
|
|
1915
|
-
reset,
|
|
1916
|
-
selectIndex: selectIndex$7,
|
|
1917
|
-
setStreamingEnabled,
|
|
1918
|
-
show: show$6,
|
|
1919
|
-
useMockApi
|
|
1920
|
-
};
|
|
1921
|
-
|
|
1922
1934
|
const isDiagnosticEqual = (actual, expected) => {
|
|
1923
1935
|
return actual.rowIndex === expected.rowIndex && actual.columnIndex === expected.columnIndex && actual.endRowIndex === expected.endRowIndex && actual.endColumnIndex === expected.endColumnIndex && actual.message === expected.message && actual.type === expected.type;
|
|
1924
1936
|
};
|
|
@@ -3334,6 +3346,31 @@ const Main = {
|
|
|
3334
3346
|
splitRight
|
|
3335
3347
|
};
|
|
3336
3348
|
|
|
3349
|
+
const enableMemoryOpener = async () => {
|
|
3350
|
+
await invoke('Open.enableMemoryOpener');
|
|
3351
|
+
};
|
|
3352
|
+
const disableMemoryOpener = async () => {
|
|
3353
|
+
await invoke('Open.disableMemoryOpener');
|
|
3354
|
+
};
|
|
3355
|
+
const matchesExpectedText = (actualText, expectedText) => {
|
|
3356
|
+
if (typeof expectedText === 'string') {
|
|
3357
|
+
return actualText === expectedText;
|
|
3358
|
+
}
|
|
3359
|
+
return expectedText.test(actualText);
|
|
3360
|
+
};
|
|
3361
|
+
const shouldHaveUrl = async expectedText => {
|
|
3362
|
+
const actualText = await invoke('Open.readMemoryUrl');
|
|
3363
|
+
if (!matchesExpectedText(actualText, expectedText)) {
|
|
3364
|
+
throw new AssertionError(`expected opened url to be "${expectedText}" but was "${actualText}"`);
|
|
3365
|
+
}
|
|
3366
|
+
};
|
|
3367
|
+
|
|
3368
|
+
const Open = {
|
|
3369
|
+
disableMemoryOpener,
|
|
3370
|
+
enableMemoryOpener,
|
|
3371
|
+
shouldHaveUrl
|
|
3372
|
+
};
|
|
3373
|
+
|
|
3337
3374
|
const open$3 = async id => {
|
|
3338
3375
|
await invoke('Layout.showPanel', id);
|
|
3339
3376
|
};
|
|
@@ -4126,6 +4163,7 @@ const createApi = (platform, assetDir) => {
|
|
|
4126
4163
|
LanguageModels,
|
|
4127
4164
|
Locator: createLocator,
|
|
4128
4165
|
Main,
|
|
4166
|
+
Open,
|
|
4129
4167
|
Output,
|
|
4130
4168
|
Panel,
|
|
4131
4169
|
Platform,
|