This commit is contained in:
suyao 2025-10-09 08:50:46 +08:00
parent 49eec68434
commit 44d2cb345f
No known key found for this signature in database

View File

@ -1,4 +1,5 @@
import { electronAPI } from '@electron-toolkit/preload'
import type { JsExecutionResult } from '@main/services/workers/JsWorker'
import { SpanEntity, TokenUsage } from '@mcp-trace/trace-core'
import { SpanContext } from '@opentelemetry/api'
import { TerminalConfig, UpgradeChannel } from '@shared/config/constant'
@ -344,7 +345,8 @@ const api = {
ipcRenderer.invoke(IpcChannel.Python_Execute, script, context, timeout)
},
js: {
execute: (code: string, timeout?: number) => ipcRenderer.invoke(IpcChannel.Js_Execute, code, timeout)
execute: (code: string, timeout?: number): Promise<JsExecutionResult> =>
ipcRenderer.invoke(IpcChannel.Js_Execute, code, timeout)
},
shell: {
openExternal: (url: string, options?: Electron.OpenExternalOptions) => shell.openExternal(url, options)