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
This commit is contained in:
Fusion
2026-04-27 11:32:05 -07:00
committed by gsxdsm
parent 597daeaf33
commit 626e768f39
33 changed files with 1010 additions and 635 deletions

View File

@@ -6,6 +6,7 @@
*/
import { definePlugin } from "@fusion/plugin-sdk";
import { resolveModelConfig } from "./pi-module.js";
import { HermesRuntimeAdapter } from "./runtime-adapter.js";
import type {
FusionPlugin,
@@ -21,14 +22,21 @@ const HERMES_RUNTIME_VERSION = "0.1.0";
const hermesRuntimeMetadata: PluginRuntimeManifestMetadata = {
runtimeId: HERMES_RUNTIME_ID,
name: "Hermes Runtime",
description: "Hermes-backed AI session using the user's configured pi provider and model",
description: "Hermes raw-model runtime using pi-ai direct streaming",
version: HERMES_RUNTIME_VERSION,
};
// ── Hermes Runtime Factory ────────────────────────────────────────────────────
const hermesRuntimeFactory: PluginRuntimeFactory = async () => {
return new HermesRuntimeAdapter();
const hermesRuntimeFactory: PluginRuntimeFactory = async (ctx) => {
const config = resolveModelConfig(ctx.settings);
return new HermesRuntimeAdapter({
provider: config.provider,
modelId: config.modelId,
apiKey: config.apiKey,
thinkingLevel: config.thinkingLevel,
});
};
// ── Plugin Definition ─────────────────────────────────────────────────────────
@@ -46,7 +54,8 @@ const plugin: FusionPlugin = definePlugin({
state: "installed",
hooks: {
onLoad: (ctx) => {
ctx.logger.info("Hermes Runtime Plugin loaded");
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,