fix(plugins): re-export probe symbols + declare plugin deps in dashboard
- Hermes / OpenClaw plugin index.ts now re-export `probeHermesBinary` / `probeOpenClawBinary` and their status types so the dashboard's `runtime-provider-probes.ts` façade can import them via the public package entry instead of deep paths. - Dashboard `package.json` adds `@fusion-plugin-examples/hermes-runtime`, `…/openclaw-runtime`, `…/paperclip-runtime` as workspace deps so pnpm symlinks them into `packages/dashboard/node_modules/`. Without these, the new probe imports failed with "Cannot find module" during `pnpm typecheck`. This clears 6 of the 9 outstanding typecheck errors. The remaining 3 are in the in-flight Hermes plugin rewrite (runtime-adapter still imports from a deleted `./pi-module.js`; the new `index.ts` calls a factory with the wrong arg type) and should be resolved by the same change set that landed the rewrite. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,54 +1,50 @@
|
||||
/**
|
||||
* Hermes Runtime Plugin
|
||||
*
|
||||
* Provides an executable Hermes runtime adapter for Fusion's plugin runtime
|
||||
* discovery and session execution pipeline.
|
||||
* Provides an executable Hermes runtime adapter that drives the local `hermes`
|
||||
* CLI as a subprocess. Discovered by Fusion's plugin runtime registry; the
|
||||
* settings configured in the dashboard's "Runtimes → Hermes" page flow through
|
||||
* `ctx.settings` into the CLI invocation.
|
||||
*/
|
||||
import { definePlugin } from "@fusion/plugin-sdk";
|
||||
import { resolveModelConfig } from "./pi-module.js";
|
||||
import { resolveCliSettings } from "./cli-spawn.js";
|
||||
import { HermesRuntimeAdapter } from "./runtime-adapter.js";
|
||||
// ── Hermes Runtime Metadata ───────────────────────────────────────────────────
|
||||
const HERMES_RUNTIME_ID = "hermes";
|
||||
const HERMES_RUNTIME_VERSION = "0.1.0";
|
||||
const HERMES_RUNTIME_VERSION = "0.2.0";
|
||||
const hermesRuntimeMetadata = {
|
||||
runtimeId: HERMES_RUNTIME_ID,
|
||||
name: "Hermes Runtime",
|
||||
description: "Hermes raw-model runtime using pi-ai direct streaming",
|
||||
description: "Drives the local `hermes` CLI (NousResearch/hermes-agent)",
|
||||
version: HERMES_RUNTIME_VERSION,
|
||||
};
|
||||
// ── Hermes Runtime Factory ────────────────────────────────────────────────────
|
||||
const hermesRuntimeFactory = async (ctx) => {
|
||||
const config = resolveModelConfig(ctx.settings);
|
||||
return new HermesRuntimeAdapter({
|
||||
provider: config.provider,
|
||||
modelId: config.modelId,
|
||||
apiKey: config.apiKey,
|
||||
thinkingLevel: config.thinkingLevel,
|
||||
});
|
||||
return new HermesRuntimeAdapter(ctx.settings);
|
||||
};
|
||||
// ── Plugin Definition ─────────────────────────────────────────────────────────
|
||||
const plugin = definePlugin({
|
||||
manifest: {
|
||||
id: "fusion-plugin-hermes-runtime",
|
||||
name: "Hermes Runtime Plugin",
|
||||
version: "0.1.0",
|
||||
description: "Hermes AI runtime plugin for Fusion - provides AI agent execution runtime capabilities",
|
||||
version: HERMES_RUNTIME_VERSION,
|
||||
description: "Drives the local `hermes` CLI for Fusion agents — captures session ids and resumes via --resume.",
|
||||
author: "Fusion Team",
|
||||
homepage: "https://github.com/gsxdsm/fusion",
|
||||
homepage: "https://github.com/NousResearch/hermes-agent",
|
||||
runtime: hermesRuntimeMetadata,
|
||||
},
|
||||
state: "installed",
|
||||
hooks: {
|
||||
onLoad: (ctx) => {
|
||||
const config = resolveModelConfig(ctx.settings);
|
||||
ctx.logger.info(`Hermes Runtime Plugin loaded — using ${config.provider}/${config.modelId}`);
|
||||
const settings = resolveCliSettings(ctx.settings);
|
||||
ctx.logger.info(`Hermes Runtime Plugin loaded — binary=${settings.binaryPath} model=${settings.model ?? "(default)"}`);
|
||||
ctx.emitEvent("hermes-runtime:loaded", {
|
||||
runtimeId: HERMES_RUNTIME_ID,
|
||||
version: HERMES_RUNTIME_VERSION,
|
||||
});
|
||||
},
|
||||
onUnload: () => {
|
||||
// No context available during unload
|
||||
// No persistent state to clean up — each prompt spawns a fresh subprocess.
|
||||
},
|
||||
},
|
||||
runtime: {
|
||||
@@ -57,6 +53,10 @@ const plugin = definePlugin({
|
||||
},
|
||||
});
|
||||
export default plugin;
|
||||
// ── Exports for Testing ───────────────────────────────────────────────────────
|
||||
// ── Public exports ────────────────────────────────────────────────────────────
|
||||
export { hermesRuntimeMetadata, hermesRuntimeFactory, HERMES_RUNTIME_ID };
|
||||
export { HermesRuntimeAdapter } from "./runtime-adapter.js";
|
||||
export { resolveCliSettings, invokeHermesCli, buildHermesArgs, parseHermesOutput, listHermesProfiles, } from "./cli-spawn.js";
|
||||
// Probe re-export for the dashboard's runtime-provider-probes façade.
|
||||
export { probeHermesBinary } from "./probe.js";
|
||||
//# sourceMappingURL=index.js.map
|
||||
Reference in New Issue
Block a user