Skip to content

API 支持程度(底座 v0.2.1) ​

由 packages/core/src/apis.ts 自动生成(node scripts/gen-support.mjs),不要手改。

支持程度:原生 = 行为一致;模拟 = 换了实现但语义一致;部分 = 只支持一部分参数或场景;占位 = 不报错但没有真实效果;— = 不支持(按宿主策略抛错或警告)。

运行时可以用 whatevertools.supports(name) 查询(会结合当前宿主实际配置,比如没有配置 AI 提供者时 ai.chat 返回 false)。

lifecycle ​

APIuTools 旧名权限ElectronWeb说明
lifecycle.onEnteronPluginEnter原生模拟
lifecycle.onLeaveonPluginOut原生模拟
lifecycle.onReadyonPluginReady原生模拟
lifecycle.onDetachonPluginDetach模拟占位启动器没有分离窗口时不会触发
lifecycle.onSearchPushonMainPush模拟—
lifecycle.exitoutPlugin原生模拟

events ​

APIuTools 旧名权限ElectronWeb说明
schedule.onTriggeronScheduleTriggerschedule模拟部分

panel ​

APIuTools 旧名权限ElectronWeb说明
panel.hidehideMainWindow原生—
panel.showshowMainWindow原生—
panel.setHeightsetExpandHeight模拟占位
panel.input.setsetSubInput模拟—
panel.input.removeremoveSubInput模拟—
panel.input.setValuesetSubInputValue模拟—
panel.input.focussubInputFocus模拟—
panel.input.blursubInputBlur模拟—
panel.input.selectsubInputSelect模拟—

window ​

APIuTools 旧名权限ElectronWeb说明
window.createcreateBrowserWindowwindow.create原生部分web 端用 window.open / iframe 模拟
window.sendToParentsendToParent原生模拟
window.typegetWindowType原生模拟

page ​

APIuTools 旧名权限ElectronWeb说明
page.findfindInPage原生—
page.stopFindstopFindInPage原生—

system ​

APIuTools 旧名权限ElectronWeb说明
system.notifyshowNotificationnotification原生模拟
dialog.openshowOpenDialogdialog原生部分web:选目录且带 createDirectory 时返回下载目录;其他情况浏览器没法同步选文件,返回 undefined 并异步弹出选择器,选中的文件按 WebBootConfig.fileDialogs.openDialog 交给插件(默认作为 files 进入)。新代码请用 dialog.openAsync
dialog.saveshowSaveDialogdialog原生模拟web:返回 /downloads 下的路径,写进这个路径的文件会由浏览器下载
dialog.openAsyncdialog原生模拟web:浏览器文件选择器,选中的文件放在虚拟文件系统 /picked 下(0.2.0 起)
dialog.saveAsyncdialog原生模拟同 dialog.save(0.2.0 起)
shell.openPathshellOpenPathshell.open原生部分web:只对 /downloads 下的文件有效(重新下载)
shell.trashshellTrashItemshell.trash原生—
shell.showInFoldershellShowItemInFoldershell.open原生占位web:浏览器管理下载位置,调用不报错也没有效果
shell.openExternalshellOpenExternalshell.external原生模拟
shell.beepshellBeep原生—
system.appNamegetAppName原生模拟
system.appVersiongetAppVersion原生模拟返回 identity.mock.platform.version
paths.getgetPath原生占位
system.fileIcongetFileIcon原生—
system.fileIconAsyncgetFileIconAsync原生—
paths.datagetPluginLocalDataPathfs.plugin原生模拟
paths.tempgetPluginTempPathfs.plugin原生模拟
system.isDevisDev原生模拟
system.isMacisMacOS原生模拟
system.isWindowsisWindows原生模拟
system.isLinuxisLinux原生模拟
system.isDarkisDarkColors原生模拟
system.onThemeChange原生模拟宿主主题变化(跟随系统或宿主设置)

device ​

APIuTools 旧名权限ElectronWeb说明
device.idgetNativeIdsystem.identity模拟模拟

account ​

APIuTools 旧名权限ElectronWeb说明
account.usergetUsersystem.identity模拟模拟宿主可通过 hook 提供用户信息,默认 null

context ​

APIuTools 旧名权限ElectronWeb说明
context.activeFolderreadCurrentFolderPathsystem.context部分—
context.activeBrowserUrlreadCurrentBrowserUrlsystem.context部分—
context.activeWindowsystem.context部分—

clipboard ​

APIuTools 旧名权限ElectronWeb说明
clipboard.writeTextcopyTextclipboard.write原生模拟
clipboard.writeImagecopyImageclipboard.write原生模拟
clipboard.writeFilescopyFileclipboard.write原生—
clipboard.readFilesgetCopiedFilesclipboard.read原生—

input ​

APIuTools 旧名权限ElectronWeb说明
input.sendTexthideMainWindowPasteTextinput.paste模拟—
input.sendFileshideMainWindowPasteFileinput.paste模拟—
input.sendImagehideMainWindowPasteImageinput.paste模拟—
input.typeTexthideMainWindowTypeStringinput.paste模拟—
input.startDragstartDraginput.drag原生—
input.keyTapsimulateKeyboardTapinput.simulate部分—系统级按键:macOS AppleScript / Windows SendKeys / Linux xdotool,或 providers.input
input.mouseMovesimulateMouseMoveinput.simulate占位—
input.mouseClicksimulateMouseClickinput.simulate占位—
input.mouseDoubleClicksimulateMouseDoubleClickinput.simulate占位—
input.mouseRightClicksimulateMouseRightClickinput.simulate占位—

screen ​

APIuTools 旧名权限ElectronWeb说明
screen.captureRegionscreenCapturescreen.captureDisplay模拟—
screen.captureDisplaycaptureDisplayscreen.captureDisplay原生—
screen.pickColorscreenColorPickscreen.captureDisplay模拟—
screen.captureSourcesdesktopCaptureSourcesscreen.captureDisplay原生—
screen.displaysgetAllDisplaysscreen.read原生模拟
screen.primaryDisplaygetPrimaryDisplayscreen.read原生模拟
screen.cursorgetCursorScreenPointscreen.read原生部分
screen.nearestDisplaygetDisplayNearestPointscreen.read原生模拟
screen.matchingDisplaygetDisplayMatchingscreen.read原生模拟
screen.toDipPointscreenToDipPointscreen.read原生模拟
screen.toScreenPointdipToScreenPointscreen.read原生模拟
screen.toDipRectscreenToDipRectscreen.read原生模拟
screen.toScreenRectdipToScreenRectscreen.read原生模拟

db ​

APIuTools 旧名权限ElectronWeb说明
db.putdb.putstorage原生模拟
db.getdb.getstorage原生模拟
db.removedb.removestorage原生模拟
db.bulkdb.bulkDocsstorage原生模拟
db.alldb.allDocsstorage原生模拟
db.putAttachmentdb.postAttachmentstorage原生部分
db.getAttachmentdb.getAttachmentstorage原生模拟
db.getAttachmentTypedb.getAttachmentTypestorage原生模拟
db.syncStatedb.replicateStateFromCloudstorage模拟模拟配置了同步适配器才有意义
db.onPullonDbPullstorage模拟模拟配置了同步适配器才会触发
kv.setdbStorage.setItemstorage原生模拟
kv.getdbStorage.getItemstorage原生模拟
kv.removedbStorage.removeItemstorage原生模拟

features ​

APIuTools 旧名权限ElectronWeb说明
features.listgetFeatures原生模拟
features.setsetFeaturefeatures原生模拟
features.removeremoveFeaturefeatures原生模拟

launch ​

APIuTools 旧名权限ElectronWeb说明
launch.openredirectredirect模拟—

hotkeys ​

APIuTools 旧名权限ElectronWeb说明
hotkeys.openSettingsredirectHotKeySetting模拟—
hotkeys.getgetCmdHotKey模拟—

schedule ​

APIuTools 旧名权限ElectronWeb说明
schedule.requestrequestScheduleschedule模拟部分
schedule.listgetSchedulesschedule模拟部分
schedule.removeremoveScheduleschedule模拟部分

ai ​

APIuTools 旧名权限ElectronWeb说明
ai.chataiai模拟模拟需要宿主配置模型提供方(hook: service:ai)
ai.modelsallAiModelsai模拟模拟
tools.registerregisterTool模拟—注册不需要权限;外部 Agent 第一次调用时按 mcp 权限询问

media ​

APIuTools 旧名权限ElectronWeb说明
media.ffmpegrunFFmpegmedia.ffmpeg模拟部分使用宿主配置或 PATH 中的 ffmpeg;web 端可接 ffmpeg.wasm
image.sharpsharpimage.sharp模拟部分electron:宿主安装的 sharp;web:@whatevertools/sharp-canvas(Canvas 实现的常用子集,不支持 AVIF 编码、ICC、动图),也可以换成 wasm 版

payment ​

APIuTools 旧名权限ElectronWeb说明
billing.isPurchasedisPurchasedUserpayment占位占位默认 true,宿主可 hook
billing.purchaseopenPurchasepayment占位占位

ubrowser ​

APIuTools 旧名权限ElectronWeb说明
browser.automateubrowserbrowser部分—用隐藏的 BrowserWindow 实现常用链式指令
browser.idlegetIdleUBrowsersbrowser模拟—
browser.setProxysetUBrowserProxybrowser模拟—
browser.clearCacheclearUBrowserCachebrowser模拟—

权限 ​

默认询问;只有插件自己的沙盒(数据库、私有目录)默认放行。每一项都可以按插件单独设置。

权限名称说明风险默认
storage插件数据库db / kv,只能访问自己的数据low允许
fs.plugin插件私有目录读写插件自己的数据目录和临时目录low允许
fs.read读取文件读取任意(或指定范围内的)本地文件medium询问
fs.write写入文件创建、修改、删除任意(或指定范围内的)本地文件high询问
clipboard.write写入剪贴板clipboard.writeText / writeImage / writeFileslow询问
clipboard.read读取剪贴板读取剪贴板里的文字、图片和文件medium询问
notification系统通知system.notifylow询问
dialog文件对话框弹出打开/保存对话框,用户选中的路径会临时授予读写low询问
shell.open打开文件用系统默认程序打开文件、在访达/资源管理器中显示medium询问
shell.external打开链接用浏览器打开网址low询问
shell.trash移到废纸篓shell.trashhigh询问
screen.read屏幕信息显示器列表、光标位置low询问
screen.capture截屏screen.selectRegion / capture / sources / pickColorhigh询问
window.create独立窗口window.createlow询问
window.overlay覆盖层窗口置顶、鼠标穿透、全屏透明、所有桌面可见medium询问
input.paste粘贴到其他应用input.pasteText / pasteFiles / pasteImage / typeTextmedium询问
input.simulate模拟键鼠input.keyTap / mouseMove / mouseClickhigh询问
input.drag拖出文件input.startDraglow询问
network网络Node http/https/net/dgram/tls 模块(页面里的 fetch 不受影响)medium询问
process.spawn运行程序child_process / worker_threadshigh询问
process.native原生模块加载 .node 原生扩展high询问
electron.raw未过滤的 Electron APIrequire("electron") 拿到完整对象,而不是兼容白名单;只能在权限设置里显式授予,不会弹窗询问high禁止
system.identity用户与设备信息system.user / deviceIdmedium询问
system.context前台应用上下文system.activeFolder / activeBrowserUrlmedium询问
schedule定时任务schedule.requestlow询问
features动态功能features.set / removelow询问
redirect跳转其他插件launch.open,向其他插件传数据low询问
aiAI 模型ai.chat / models,消耗宿主配置的模型额度medium询问
mcpMCP 工具把注册的工具暴露给外部 AI Agent(MCP)medium询问
browser自动化浏览器browser.automatehigh询问
media.ffmpegFFmpegmedia.ffmpeglow询问
image.sharpSharpimage.sharp 图像处理low询问
payment付费billing.isPurchased / purchaselow询问
media.camera摄像头页面通过 getUserMedia 使用摄像头high询问
media.microphone麦克风页面通过 getUserMedia 使用麦克风high询问
geolocation位置页面读取地理位置medium询问
device.hardware硬件设备WebHID / WebSerial / WebUSB / MIDIhigh询问

MIT License