feat(FN-2477): add executable OpenClaw runtime adapter
- Replace deferred OpenClaw placeholder runtime with an executable adapter that creates sessions, prompts with fallback, describes models, and disposes safely - Add a dedicated pi-module seam and local runtime contract types to decouple plugin compilation from engine internals while preserving runtime behavior - Update OpenClaw plugin metadata, manifest/package descriptions, and README to reflect active execution support instead of deferred status - Harden dashboard DevServerStore save flow against ENOENT temp-directory races and add regression coverage for project-directory removal during save
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
/**
|
||||
* OpenClaw Runtime Plugin
|
||||
*
|
||||
* Registers an experimental OpenClaw runtime with Fusion's plugin runtime
|
||||
* discovery pipeline. Runtime execution behavior is intentionally deferred.
|
||||
* Provides an executable OpenClaw runtime adapter for Fusion's plugin runtime
|
||||
* discovery and session execution pipeline.
|
||||
*/
|
||||
|
||||
import { definePlugin } from "@fusion/plugin-sdk";
|
||||
import { OpenClawRuntimeAdapter } from "./runtime-adapter.js";
|
||||
import type {
|
||||
FusionPlugin,
|
||||
PluginContext,
|
||||
PluginRuntimeFactory,
|
||||
PluginRuntimeManifestMetadata,
|
||||
} from "@fusion/plugin-sdk";
|
||||
@@ -19,23 +19,12 @@ const OPENCLAW_RUNTIME_VERSION = "0.1.0";
|
||||
const openclawRuntimeMetadata: PluginRuntimeManifestMetadata = {
|
||||
runtimeId: OPENCLAW_RUNTIME_ID,
|
||||
name: "OpenClaw Runtime",
|
||||
description: "Experimental OpenClaw runtime integration for Fusion tasks (execution deferred)",
|
||||
description: "OpenClaw-backed AI session using the user's configured pi provider and model",
|
||||
version: OPENCLAW_RUNTIME_VERSION,
|
||||
};
|
||||
|
||||
const openclawRuntimeFactory: PluginRuntimeFactory = (_ctx: PluginContext) => {
|
||||
return {
|
||||
runtimeId: OPENCLAW_RUNTIME_ID,
|
||||
version: OPENCLAW_RUNTIME_VERSION,
|
||||
status: "deferred",
|
||||
message:
|
||||
"OpenClaw runtime execution is currently deferred. This runtime is registered for discovery and configuration only.",
|
||||
execute: async () => {
|
||||
throw new Error(
|
||||
"OpenClaw runtime is not implemented yet. Runtime discovery and configuration are supported, but execution is deferred.",
|
||||
);
|
||||
},
|
||||
};
|
||||
const openclawRuntimeFactory: PluginRuntimeFactory = async () => {
|
||||
return new OpenClawRuntimeAdapter();
|
||||
};
|
||||
|
||||
const plugin: FusionPlugin = definePlugin({
|
||||
@@ -43,7 +32,7 @@ const plugin: FusionPlugin = definePlugin({
|
||||
id: "fusion-plugin-openclaw-runtime",
|
||||
name: "OpenClaw Runtime Plugin",
|
||||
version: "0.1.0",
|
||||
description: "OpenClaw runtime plugin for Fusion with experimental deferred execution",
|
||||
description: "Provides OpenClaw runtime for Fusion AI agents",
|
||||
author: "Fusion Team",
|
||||
homepage: "https://github.com/gsxdsm/fusion",
|
||||
runtime: openclawRuntimeMetadata,
|
||||
@@ -51,11 +40,10 @@ const plugin: FusionPlugin = definePlugin({
|
||||
state: "installed",
|
||||
hooks: {
|
||||
onLoad: (ctx) => {
|
||||
ctx.logger.info("OpenClaw Runtime Plugin loaded (experimental placeholder runtime)");
|
||||
ctx.logger.info("OpenClaw Runtime Plugin loaded");
|
||||
ctx.emitEvent("openclaw-runtime:loaded", {
|
||||
runtimeId: OPENCLAW_RUNTIME_ID,
|
||||
version: OPENCLAW_RUNTIME_VERSION,
|
||||
status: "deferred",
|
||||
});
|
||||
},
|
||||
onUnload: () => {
|
||||
@@ -70,4 +58,4 @@ const plugin: FusionPlugin = definePlugin({
|
||||
|
||||
export default plugin;
|
||||
|
||||
export { openclawRuntimeMetadata, openclawRuntimeFactory, OPENCLAW_RUNTIME_ID };
|
||||
export { openclawRuntimeMetadata, openclawRuntimeFactory, OPENCLAW_RUNTIME_ID };
|
||||
Reference in New Issue
Block a user