@lvce-editor/test-worker 13.9.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 +35 -21
- package/dist/testWorkerMain.js +129 -75
- 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,26 +193,6 @@ interface Dialog {
|
|
|
167
193
|
readonly showSaveFilePicker: () => Promise<void>;
|
|
168
194
|
}
|
|
169
195
|
|
|
170
|
-
interface Chat {
|
|
171
|
-
readonly enterNewLine: () => Promise<void>;
|
|
172
|
-
readonly getSelectedSessionId: () => Promise<string>;
|
|
173
|
-
readonly handleClickBack: () => Promise<void>;
|
|
174
|
-
readonly handleClickClose: () => Promise<void>;
|
|
175
|
-
readonly handleClickNew: () => Promise<void>;
|
|
176
|
-
readonly handleClickSettings: () => Promise<void>;
|
|
177
|
-
readonly handleInput: (text: string) => Promise<void>;
|
|
178
|
-
readonly handleModelChange: (modelId: string) => Promise<void>;
|
|
179
|
-
readonly handleSubmit: () => Promise<void>;
|
|
180
|
-
readonly mockOpenAiResponse: (options: MockOpenAiResponseOptions) => Promise<void>;
|
|
181
|
-
readonly mockOpenApiStreamFinish: () => Promise<void>;
|
|
182
|
-
readonly mockOpenApiStreamPushChunk: (chunk: string) => Promise<void>;
|
|
183
|
-
readonly reset: () => Promise<void>;
|
|
184
|
-
readonly selectIndex: (index: number) => Promise<void>;
|
|
185
|
-
readonly setStreamingEnabled: (enabled: boolean) => Promise<void>;
|
|
186
|
-
readonly show: () => Promise<void>;
|
|
187
|
-
readonly useMockApi: () => Promise<void>;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
196
|
interface Editor {
|
|
191
197
|
readonly addAllMissingImports: () => Promise<void>;
|
|
192
198
|
readonly cancelSelection: () => Promise<void>;
|
|
@@ -492,11 +498,18 @@ interface Main {
|
|
|
492
498
|
readonly openKeyBindings: () => Promise<void>;
|
|
493
499
|
readonly openUri: (uri: string) => Promise<void>;
|
|
494
500
|
readonly save: () => Promise<void>;
|
|
501
|
+
readonly saveAll: () => Promise<void>;
|
|
495
502
|
readonly selectTab: (groupIndex: number, tabIndex: number) => Promise<void>;
|
|
496
503
|
readonly splitDown: () => Promise<void>;
|
|
497
504
|
readonly splitRight: () => Promise<void>;
|
|
498
505
|
}
|
|
499
506
|
|
|
507
|
+
interface Open {
|
|
508
|
+
readonly disableMemoryOpener: () => Promise<void>;
|
|
509
|
+
readonly enableMemoryOpener: () => Promise<void>;
|
|
510
|
+
readonly shouldHaveUrl: (expectedText: string | RegExp) => Promise<void>;
|
|
511
|
+
}
|
|
512
|
+
|
|
500
513
|
interface Output {
|
|
501
514
|
readonly clear: () => Promise<void>;
|
|
502
515
|
readonly handleFilterInput: (text: string) => Promise<void>;
|
|
@@ -693,13 +706,13 @@ export interface TestApi {
|
|
|
693
706
|
readonly About: About
|
|
694
707
|
readonly ActivityBar: ActivityBar
|
|
695
708
|
readonly BaseUrl: BaseUrl
|
|
709
|
+
readonly Chat: Chat
|
|
696
710
|
readonly ClipBoard: ClipBoard
|
|
697
711
|
readonly ColorPicker: ColorPicker
|
|
698
712
|
readonly Command: Command
|
|
699
713
|
readonly ContextMenu: ContextMenu
|
|
700
714
|
readonly Developer: Developer
|
|
701
715
|
readonly Dialog: Dialog
|
|
702
|
-
readonly Chat: Chat
|
|
703
716
|
readonly Editor: Editor
|
|
704
717
|
readonly EditorCompletion: EditorCompletion
|
|
705
718
|
readonly EditorHover: EditorHover
|
|
@@ -717,6 +730,7 @@ export interface TestApi {
|
|
|
717
730
|
readonly KeyBoard: KeyBoard
|
|
718
731
|
readonly LanguageModels: LanguageModels
|
|
719
732
|
readonly Main: Main
|
|
733
|
+
readonly Open: Open
|
|
720
734
|
readonly Output: Output
|
|
721
735
|
readonly Panel: Panel
|
|
722
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,79 +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 handleModelChange = async modelId => {
|
|
1884
|
-
await invoke('Chat.handleModelChange', modelId);
|
|
1885
|
-
};
|
|
1886
|
-
const mockOpenAiResponse = async options => {
|
|
1887
|
-
return invoke('Chat.mockOpenAiResponse', options);
|
|
1888
|
-
};
|
|
1889
|
-
|
|
1890
|
-
const Chat = {
|
|
1891
|
-
enterNewLine,
|
|
1892
|
-
getSelectedSessionId,
|
|
1893
|
-
handleClickBack,
|
|
1894
|
-
handleClickClose,
|
|
1895
|
-
handleClickNew,
|
|
1896
|
-
handleClickSettings,
|
|
1897
|
-
handleInput: handleInput$7,
|
|
1898
|
-
handleModelChange,
|
|
1899
|
-
handleSubmit,
|
|
1900
|
-
mockOpenAiResponse,
|
|
1901
|
-
mockOpenApiStreamFinish,
|
|
1902
|
-
mockOpenApiStreamPushChunk,
|
|
1903
|
-
reset,
|
|
1904
|
-
selectIndex: selectIndex$7,
|
|
1905
|
-
setStreamingEnabled,
|
|
1906
|
-
show: show$6,
|
|
1907
|
-
useMockApi
|
|
1908
|
-
};
|
|
1909
|
-
|
|
1910
1934
|
const isDiagnosticEqual = (actual, expected) => {
|
|
1911
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;
|
|
1912
1936
|
};
|
|
@@ -3273,6 +3297,9 @@ const closeActiveEditor = async () => {
|
|
|
3273
3297
|
const save = async () => {
|
|
3274
3298
|
await invoke('Main.save');
|
|
3275
3299
|
};
|
|
3300
|
+
const saveAll = async () => {
|
|
3301
|
+
await invoke('Main.saveAll');
|
|
3302
|
+
};
|
|
3276
3303
|
const focusFirst$3 = async () => {
|
|
3277
3304
|
await invoke('Main.focusFirst');
|
|
3278
3305
|
};
|
|
@@ -3313,11 +3340,37 @@ const Main = {
|
|
|
3313
3340
|
openKeyBindings,
|
|
3314
3341
|
openUri,
|
|
3315
3342
|
save,
|
|
3343
|
+
saveAll,
|
|
3316
3344
|
selectTab: selectTab$1,
|
|
3317
3345
|
splitDown,
|
|
3318
3346
|
splitRight
|
|
3319
3347
|
};
|
|
3320
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
|
+
|
|
3321
3374
|
const open$3 = async id => {
|
|
3322
3375
|
await invoke('Layout.showPanel', id);
|
|
3323
3376
|
};
|
|
@@ -4110,6 +4163,7 @@ const createApi = (platform, assetDir) => {
|
|
|
4110
4163
|
LanguageModels,
|
|
4111
4164
|
Locator: createLocator,
|
|
4112
4165
|
Main,
|
|
4166
|
+
Open,
|
|
4113
4167
|
Output,
|
|
4114
4168
|
Panel,
|
|
4115
4169
|
Platform,
|