Files
fusion/plugins/fusion-plugin-hermes-runtime/dist/index.js
Fusion 3d282819e1 feat(FN-2709): migrate Hermes runtime plugin to pi-ai streaming client
- Replace Hermes pi module integration with pi-ai session streaming and updated runtime adapter contracts
- Remove legacy engine guard scaffolding and add hermes-stream-client coverage for streaming behavior
- Rewrite plugin and engine e2e tests to align with the new runtime flow and regenerate dist artifacts
- Update Hermes runtime README and package metadata to document pi-ai execution expectations
2026-04-27 11:34:49 -07:00

62 lines
2.7 KiB
JavaScript

/**
* Hermes Runtime Plugin
*
* Provides an executable Hermes runtime adapter for Fusion's plugin runtime
* discovery and session execution pipeline.
*/
import { definePlugin } from "@fusion/plugin-sdk";
import { resolveModelConfig } from "./pi-module.js";
import { HermesRuntimeAdapter } from "./runtime-adapter.js";
// ── Hermes Runtime Metadata ───────────────────────────────────────────────────
const HERMES_RUNTIME_ID = "hermes";
const HERMES_RUNTIME_VERSION = "0.1.0";
const hermesRuntimeMetadata = {
runtimeId: HERMES_RUNTIME_ID,
name: "Hermes Runtime",
description: "Hermes raw-model runtime using pi-ai direct streaming",
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,
});
};
// ── 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",
author: "Fusion Team",
homepage: "https://github.com/gsxdsm/fusion",
runtime: hermesRuntimeMetadata,
},
state: "installed",
hooks: {
onLoad: (ctx) => {
const config = resolveModelConfig(ctx.settings);
ctx.logger.info(`Hermes Runtime Plugin loaded — using ${config.provider}/${config.modelId}`);
ctx.emitEvent("hermes-runtime:loaded", {
runtimeId: HERMES_RUNTIME_ID,
version: HERMES_RUNTIME_VERSION,
});
},
onUnload: () => {
// No context available during unload
},
},
runtime: {
metadata: hermesRuntimeMetadata,
factory: hermesRuntimeFactory,
},
});
export default plugin;
// ── Exports for Testing ───────────────────────────────────────────────────────
export { hermesRuntimeMetadata, hermesRuntimeFactory, HERMES_RUNTIME_ID };
//# sourceMappingURL=index.js.map