mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 04:15:48 -06:00
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import { fileURLToPath } from "node:url";
|
|
import { definePluginEntry, type OpenClawPluginService } from "openclaw/plugin-sdk/plugin-entry";
|
|
import { createCrabboxWorkerProvider, resolveOpenClawRoot } from "./src/crabbox-worker-provider.js";
|
|
|
|
const workerWallpaperPath = fileURLToPath(
|
|
new URL("./assets/openclaw-worker-wallpaper.png", import.meta.url),
|
|
);
|
|
|
|
export default definePluginEntry({
|
|
id: "crabbox",
|
|
name: "Crabbox Worker Provider",
|
|
description: "Cloud worker provider backed by the Crabbox CLI",
|
|
register(api) {
|
|
const provider = createCrabboxWorkerProvider({
|
|
openclawRoot: resolveOpenClawRoot(api.rootDir),
|
|
wallpaperPath: workerWallpaperPath,
|
|
warn: (message) => api.logger.warn(message),
|
|
});
|
|
api.registerWorkerProvider(provider);
|
|
// Worker sidecars stop first; plugin services own generation-wide heartbeat cleanup.
|
|
api.registerService({
|
|
id: "crabbox-worker-cleanup",
|
|
start() {},
|
|
stop() {
|
|
provider.dispose();
|
|
},
|
|
} satisfies OpenClawPluginService);
|
|
},
|
|
});
|