@lvce-editor/test-worker 13.7.0 → 13.9.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 MockOpenAiResponseOptions {
57
+ readonly status: number;
58
+ readonly value: any;
59
+ }
60
+
56
61
  export interface Diagnostic {
57
62
  readonly columnIndex: number;
58
63
  readonly endColumnIndex: number;
@@ -162,6 +167,26 @@ interface Dialog {
162
167
  readonly showSaveFilePicker: () => Promise<void>;
163
168
  }
164
169
 
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
+
165
190
  interface Editor {
166
191
  readonly addAllMissingImports: () => Promise<void>;
167
192
  readonly cancelSelection: () => Promise<void>;
@@ -674,6 +699,7 @@ export interface TestApi {
674
699
  readonly ContextMenu: ContextMenu
675
700
  readonly Developer: Developer
676
701
  readonly Dialog: Dialog
702
+ readonly Chat: Chat
677
703
  readonly Editor: Editor
678
704
  readonly EditorCompletion: EditorCompletion
679
705
  readonly EditorHover: EditorHover
@@ -1620,13 +1620,13 @@ const {
1620
1620
  expect
1621
1621
  } = Expect$1;
1622
1622
 
1623
- const show$6 = async () => {
1623
+ const show$7 = async () => {
1624
1624
  return invoke('About.showAbout');
1625
1625
  };
1626
1626
  const handleClickOk = async () => {
1627
1627
  return invoke('About.handleClickOk');
1628
1628
  };
1629
- const handleClickClose = async () => {
1629
+ const handleClickClose$1 = async () => {
1630
1630
  return invoke('About.handleClickClose');
1631
1631
  };
1632
1632
  const handleClickCopy = async () => {
@@ -1642,10 +1642,10 @@ const focusPrevious$8 = async () => {
1642
1642
  const About = {
1643
1643
  focusNext: focusNext$9,
1644
1644
  focusPrevious: focusPrevious$8,
1645
- handleClickClose,
1645
+ handleClickClose: handleClickClose$1,
1646
1646
  handleClickCopy,
1647
1647
  handleClickOk,
1648
- show: show$6
1648
+ show: show$7
1649
1649
  };
1650
1650
 
1651
1651
  const focus$2 = async () => {
@@ -1681,7 +1681,7 @@ const setUpdateState = async config => {
1681
1681
  const selectCurrent = async () => {
1682
1682
  await invoke('ActivityBar.selectCurrent');
1683
1683
  };
1684
- const handleClickSettings = async (x, y) => {
1684
+ const handleClickSettings$1 = async (x, y) => {
1685
1685
  await invoke('ActivityBar.handleClickSettings', x, y);
1686
1686
  };
1687
1687
 
@@ -1692,7 +1692,7 @@ const ActivityBar = {
1692
1692
  focusNext: focusNext$8,
1693
1693
  focusPrevious: focusPrevious$7,
1694
1694
  handleClick: handleClick$4,
1695
- handleClickSettings,
1695
+ handleClickSettings: handleClickSettings$1,
1696
1696
  handleContextMenu: handleContextMenu$5,
1697
1697
  selectCurrent,
1698
1698
  setAccountEnabled,
@@ -1834,6 +1834,79 @@ const Dialog = {
1834
1834
  showSaveFilePicker
1835
1835
  };
1836
1836
 
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
+
1837
1910
  const isDiagnosticEqual = (actual, expected) => {
1838
1911
  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;
1839
1912
  };
@@ -4004,6 +4077,7 @@ const createApi = (platform, assetDir) => {
4004
4077
  return assetDir;
4005
4078
  }
4006
4079
  },
4080
+ Chat,
4007
4081
  ClipBoard,
4008
4082
  ColorPicker,
4009
4083
  Command,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-worker",
3
- "version": "13.7.0",
3
+ "version": "13.9.0",
4
4
  "description": "Test Worker",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,8 +10,5 @@
10
10
  "author": "Lvce Editor",
11
11
  "type": "module",
12
12
  "main": "dist/testWorkerMain.js",
13
- "dependencies": {
14
- "@lvce-editor/constants": "^3.5.0"
15
- },
16
13
  "types": "dist/api.d.ts"
17
14
  }