openclaw-electron-host
v0.1.0
Published
Electron main-process host integration for OpenClaw runtime
Readme
@yonclaw/openclaw-electron-host
可独立发布的 OpenClaw Electron 宿主层 npm 包。
包含能力:
- 运行时启停、重连、切换、更新、回滚
- 主进程 IPC handler 注册
- preload
contextBridge暴露 - provider / settings / skills 与 OpenClaw runtime 的桥接
最小接入:
const { app } = require('electron');
const { createOpenClawElectronHost } = require('@yonclaw/openclaw-electron-host');
const host = createOpenClawElectronHost({
appName: 'My App',
runtimeBootstrapArchiveUrl: 'https://example.com/runtime/bootstrap.zip',
runtimeUpdateManifestUrl: 'https://example.com/runtime/manifest.json',
});
app.whenReady().then(async () => {
const mainWindow = createMainWindow();
await host.bindWindow(mainWindow);
await host.startRuntime();
});
app.on('before-quit', () => {
host.prepareForQuit();
});preload 中可直接调用:
const { exposeElectronIpcRenderer } = require('@yonclaw/openclaw-electron-host/preload');
exposeElectronIpcRenderer();本包发布后只暴露 dist/ 产物,不依赖父目录的 shared/ 或 monorepo 根配置;在单独目录中执行 npm install 后可直接通过 npm run build 生成 CommonJS 入口。
