feat: 接入本地执行内核与运行面板

This commit is contained in:
yu committed 2026-10-26 17:41:39 +08:00
1 parent 32ca0a1af8
commit 6a2cc24898
23 files changed
+2937 -41

No files matched your search

+10
View File
@@ -1,8 +1,11 @@
import { app, BrowserWindow, dialog, ipcMain, shell } from "electron";
import path from "node:path";
import type { AppInfo, FlowDefinition } from "../shared/types";
import "./capabilities";
import { catalogPath, loadCatalog } from "./catalog";
import { createFlow, deleteFlow, getFlow, listFlows, saveFlow } from "./flows";
import { capabilityCount, capabilityIds } from "./engine/registry";
import { closeBrowserSession, startRun, stopRun } from "./run/manager";
let mainWindow: BrowserWindow | null = null;
@@ -58,6 +61,9 @@ function registerIpc(): void {
}));
ipcMain.handle("catalog:get", () => loadCatalog());
ipcMain.handle("run:start", (event, flow: FlowDefinition) => startRun(flow, event.sender));
ipcMain.handle("run:stop", (_event, runId?: string) => stopRun(runId));
ipcMain.handle("run:capabilities", () => ({ count: capabilityCount(), ids: capabilityIds() }));
ipcMain.handle("flows:list", () => listFlows());
ipcMain.handle("flows:create", (_event, name?: string) => {
const flow = createFlow(name);
@@ -112,4 +118,8 @@ if (!gotLock) {
app.on("window-all-closed", () => {
if (process.platform !== "darwin") app.quit();
});
app.on("before-quit", () => {
void closeBrowserSession();
});
}