feat(FN-2481): align Hermes runtime artifacts and compatibility coverage
- Regenerate fusion-plugin-hermes-runtime build artifacts and manifest metadata for runtime packaging - Refactor Hermes runtime source into dedicated pi-module, runtime-adapter, and shared type modules - Expand Hermes and engine plugin-runner tests to validate cross-runtime compatibility behavior - Update getting-started, settings reference, and Hermes README docs to reflect the current runtime integration guidance
This commit is contained in:
2
plugins/fusion-plugin-hermes-runtime/dist/__tests__/index.test.d.ts
vendored
Normal file
2
plugins/fusion-plugin-hermes-runtime/dist/__tests__/index.test.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=index.test.d.ts.map
|
||||
1
plugins/fusion-plugin-hermes-runtime/dist/__tests__/index.test.d.ts.map
vendored
Normal file
1
plugins/fusion-plugin-hermes-runtime/dist/__tests__/index.test.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":""}
|
||||
94
plugins/fusion-plugin-hermes-runtime/dist/__tests__/index.test.js
vendored
Normal file
94
plugins/fusion-plugin-hermes-runtime/dist/__tests__/index.test.js
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
||||
const { mockCreateFnAgent, mockPromptWithFallback, mockDescribeModel } = vi.hoisted(() => ({
|
||||
mockCreateFnAgent: vi.fn(),
|
||||
mockPromptWithFallback: vi.fn(),
|
||||
mockDescribeModel: vi.fn().mockReturnValue("unknown model"),
|
||||
}));
|
||||
vi.mock("../pi-module.js", () => ({
|
||||
createFnAgent: mockCreateFnAgent,
|
||||
promptWithFallback: mockPromptWithFallback,
|
||||
describeModel: mockDescribeModel,
|
||||
}));
|
||||
import plugin, { hermesRuntimeMetadata, hermesRuntimeFactory, HERMES_RUNTIME_ID } from "../index.js";
|
||||
import { HermesRuntimeAdapter } from "../runtime-adapter.js";
|
||||
function createMockContext(overrides = {}) {
|
||||
return {
|
||||
pluginId: "fusion-plugin-hermes-runtime",
|
||||
settings: {},
|
||||
logger: {
|
||||
info: vi.fn(),
|
||||
warn: vi.fn(),
|
||||
error: vi.fn(),
|
||||
debug: vi.fn(),
|
||||
},
|
||||
emitEvent: vi.fn(),
|
||||
taskStore: {
|
||||
getTask: vi.fn(),
|
||||
},
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
describe("hermes-runtime plugin", () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
describe("plugin manifest identity", () => {
|
||||
it("should have correct manifest fields", () => {
|
||||
expect(plugin.manifest.id).toBe("fusion-plugin-hermes-runtime");
|
||||
expect(plugin.manifest.name).toBe("Hermes Runtime Plugin");
|
||||
expect(plugin.manifest.version).toBe("0.1.0");
|
||||
expect(plugin.manifest.description).toContain("Hermes");
|
||||
expect(plugin.manifest.author).toBe("Fusion Team");
|
||||
expect(plugin.state).toBe("installed");
|
||||
});
|
||||
});
|
||||
describe("runtime registration", () => {
|
||||
it("should register hermes runtime metadata", () => {
|
||||
expect(plugin.runtime).toBeDefined();
|
||||
expect(plugin.runtime?.metadata.runtimeId).toBe(HERMES_RUNTIME_ID);
|
||||
expect(plugin.runtime?.metadata.name).toBe("Hermes Runtime");
|
||||
expect(plugin.runtime?.metadata.description).toContain("Hermes-backed AI session");
|
||||
expect(plugin.runtime?.metadata.version).toBe("0.1.0");
|
||||
});
|
||||
it("should have consistent runtime metadata between export and manifest", () => {
|
||||
expect(plugin.manifest.runtime).toEqual(hermesRuntimeMetadata);
|
||||
expect(plugin.runtime?.metadata).toEqual(hermesRuntimeMetadata);
|
||||
});
|
||||
});
|
||||
describe("hooks", () => {
|
||||
it("onLoad should log startup message and emit loaded event", async () => {
|
||||
const ctx = createMockContext();
|
||||
await plugin.hooks.onLoad?.(ctx);
|
||||
expect(ctx.logger.info).toHaveBeenCalledWith("Hermes Runtime Plugin loaded");
|
||||
expect(ctx.emitEvent).toHaveBeenCalledWith("hermes-runtime:loaded", {
|
||||
runtimeId: HERMES_RUNTIME_ID,
|
||||
version: "0.1.0",
|
||||
});
|
||||
});
|
||||
it("onUnload should not throw", () => {
|
||||
expect(() => plugin.hooks.onUnload?.()).not.toThrow();
|
||||
});
|
||||
});
|
||||
describe("runtime factory behavior", () => {
|
||||
it("should export runtime constants", () => {
|
||||
expect(HERMES_RUNTIME_ID).toBe("hermes");
|
||||
expect(hermesRuntimeMetadata.runtimeId).toBe("hermes");
|
||||
expect(typeof hermesRuntimeFactory).toBe("function");
|
||||
});
|
||||
it("runtime factory should return executable runtime adapter", async () => {
|
||||
const runtime = (await hermesRuntimeFactory(createMockContext()));
|
||||
expect(runtime).toBeInstanceOf(HermesRuntimeAdapter);
|
||||
expect(runtime.id).toBe("hermes");
|
||||
expect(runtime.name).toBe("Hermes Runtime");
|
||||
expect(runtime).not.toHaveProperty("status");
|
||||
expect(runtime).not.toHaveProperty("execute");
|
||||
});
|
||||
it("factory creation should not throw", async () => {
|
||||
await expect(hermesRuntimeFactory(createMockContext())).resolves.toBeInstanceOf(HermesRuntimeAdapter);
|
||||
});
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=index.test.js.map
|
||||
1
plugins/fusion-plugin-hermes-runtime/dist/__tests__/index.test.js.map
vendored
Normal file
1
plugins/fusion-plugin-hermes-runtime/dist/__tests__/index.test.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEzE,MAAM,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACzF,iBA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B,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,0DAA0D,EAAE,KAAK,IAAI,EAAE;YACxE,MAAM,OAAO,GAAG,CAAC,MAAM,oBAAoB,CAAC,iBAAiB,EAAS,CAAC,CAAyB,CAAC;YAEjG,MAAM,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;YACrD,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAClC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAC5C,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YAC7C,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;YACjD,MAAM,MAAM,CAAC,oBAAoB,CAAC,iBAAiB,EAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CACpF,oBAAoB,CACrB,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
||||
2
plugins/fusion-plugin-hermes-runtime/dist/__tests__/runtime-adapter.test.d.ts
vendored
Normal file
2
plugins/fusion-plugin-hermes-runtime/dist/__tests__/runtime-adapter.test.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=runtime-adapter.test.d.ts.map
|
||||
1
plugins/fusion-plugin-hermes-runtime/dist/__tests__/runtime-adapter.test.d.ts.map
vendored
Normal file
1
plugins/fusion-plugin-hermes-runtime/dist/__tests__/runtime-adapter.test.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"runtime-adapter.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/runtime-adapter.test.ts"],"names":[],"mappings":""}
|
||||
80
plugins/fusion-plugin-hermes-runtime/dist/__tests__/runtime-adapter.test.js
vendored
Normal file
80
plugins/fusion-plugin-hermes-runtime/dist/__tests__/runtime-adapter.test.js
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
||||
import { HermesRuntimeAdapter } from "../runtime-adapter.js";
|
||||
const { mockCreateFnAgent, mockPromptWithFallback, mockDescribeModel } = vi.hoisted(() => ({
|
||||
mockCreateFnAgent: vi.fn(),
|
||||
mockPromptWithFallback: vi.fn(),
|
||||
mockDescribeModel: vi.fn(),
|
||||
}));
|
||||
vi.mock("../pi-module.js", () => ({
|
||||
createFnAgent: mockCreateFnAgent,
|
||||
promptWithFallback: mockPromptWithFallback,
|
||||
describeModel: mockDescribeModel,
|
||||
}));
|
||||
describe("HermesRuntimeAdapter", () => {
|
||||
let adapter;
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
mockDescribeModel.mockReturnValue("mock/anthropic-claude");
|
||||
adapter = new HermesRuntimeAdapter();
|
||||
});
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
it("has stable runtime identity", () => {
|
||||
expect(adapter.id).toBe("hermes");
|
||||
expect(adapter.name).toBe("Hermes Runtime");
|
||||
});
|
||||
it("delegates createSession to createFnAgent with mapped options", async () => {
|
||||
const mockSession = { dispose: vi.fn() };
|
||||
mockCreateFnAgent.mockResolvedValue({ session: mockSession, sessionFile: "/tmp/session.json" });
|
||||
const result = await adapter.createSession({
|
||||
cwd: "/project",
|
||||
systemPrompt: "You are helpful",
|
||||
defaultProvider: "anthropic",
|
||||
defaultModelId: "claude-sonnet-4-5",
|
||||
fallbackProvider: "openai",
|
||||
fallbackModelId: "gpt-4o",
|
||||
skills: ["bash"],
|
||||
});
|
||||
expect(mockCreateFnAgent).toHaveBeenCalledWith({
|
||||
cwd: "/project",
|
||||
systemPrompt: "You are helpful",
|
||||
tools: undefined,
|
||||
customTools: undefined,
|
||||
onText: undefined,
|
||||
onThinking: undefined,
|
||||
onToolStart: undefined,
|
||||
onToolEnd: undefined,
|
||||
defaultProvider: "anthropic",
|
||||
defaultModelId: "claude-sonnet-4-5",
|
||||
fallbackProvider: "openai",
|
||||
fallbackModelId: "gpt-4o",
|
||||
defaultThinkingLevel: undefined,
|
||||
sessionManager: undefined,
|
||||
skillSelection: undefined,
|
||||
skills: ["bash"],
|
||||
});
|
||||
expect(result.session).toBe(mockSession);
|
||||
expect(result.sessionFile).toBe("/tmp/session.json");
|
||||
});
|
||||
it("delegates promptWithFallback to pi seam", async () => {
|
||||
const session = { id: "s-1" };
|
||||
mockPromptWithFallback.mockResolvedValue(undefined);
|
||||
await adapter.promptWithFallback(session, "Hello", { images: [] });
|
||||
expect(mockPromptWithFallback).toHaveBeenCalledWith(session, "Hello", { images: [] });
|
||||
});
|
||||
it("delegates describeModel to pi seam", () => {
|
||||
const session = { id: "s-2" };
|
||||
mockDescribeModel.mockReturnValue("anthropic/claude-sonnet-4-5");
|
||||
const result = adapter.describeModel(session);
|
||||
expect(mockDescribeModel).toHaveBeenCalledWith(session);
|
||||
expect(result).toBe("anthropic/claude-sonnet-4-5");
|
||||
});
|
||||
it("dispose calls session.dispose when present and no-ops otherwise", async () => {
|
||||
const disposeMock = vi.fn().mockResolvedValue(undefined);
|
||||
await adapter.dispose({ dispose: disposeMock });
|
||||
await expect(adapter.dispose({ id: "no-dispose" })).resolves.toBeUndefined();
|
||||
expect(disposeMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=runtime-adapter.test.js.map
|
||||
1
plugins/fusion-plugin-hermes-runtime/dist/__tests__/runtime-adapter.test.js.map
vendored
Normal file
1
plugins/fusion-plugin-hermes-runtime/dist/__tests__/runtime-adapter.test.js.map
vendored
Normal file
@@ -0,0 +1 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CAAC;AACL,CAAC,CAAC,CAAC"}
|
||||
14
plugins/fusion-plugin-hermes-runtime/dist/index.d.ts
vendored
Normal file
14
plugins/fusion-plugin-hermes-runtime/dist/index.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Hermes Runtime Plugin
|
||||
*
|
||||
* Provides an executable Hermes runtime adapter for Fusion's plugin runtime
|
||||
* discovery and session execution pipeline.
|
||||
*/
|
||||
import type { FusionPlugin, PluginRuntimeFactory, PluginRuntimeManifestMetadata } from "@fusion/plugin-sdk";
|
||||
declare const HERMES_RUNTIME_ID = "hermes";
|
||||
declare const hermesRuntimeMetadata: PluginRuntimeManifestMetadata;
|
||||
declare const hermesRuntimeFactory: PluginRuntimeFactory;
|
||||
declare const plugin: FusionPlugin;
|
||||
export default plugin;
|
||||
export { hermesRuntimeMetadata, hermesRuntimeFactory, HERMES_RUNTIME_ID };
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
plugins/fusion-plugin-hermes-runtime/dist/index.d.ts.map
vendored
Normal file
1
plugins/fusion-plugin-hermes-runtime/dist/index.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EACpB,6BAA6B,EAC9B,MAAM,oBAAoB,CAAC;AAI5B,QAAA,MAAM,iBAAiB,WAAW,CAAC;AAGnC,QAAA,MAAM,qBAAqB,EAAE,6BAK5B,CAAC;AAIF,QAAA,MAAM,oBAAoB,EAAE,oBAE3B,CAAC;AAIF,QAAA,MAAM,MAAM,EAAE,YA2BZ,CAAC;AAEH,eAAe,MAAM,CAAC;AAItB,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,CAAC"}
|
||||
54
plugins/fusion-plugin-hermes-runtime/dist/index.js
vendored
Normal file
54
plugins/fusion-plugin-hermes-runtime/dist/index.js
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* 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 { 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-backed AI session using the user's configured pi provider and model",
|
||||
version: HERMES_RUNTIME_VERSION,
|
||||
};
|
||||
// ── Hermes Runtime Factory ────────────────────────────────────────────────────
|
||||
const hermesRuntimeFactory = async () => {
|
||||
return new HermesRuntimeAdapter();
|
||||
};
|
||||
// ── 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) => {
|
||||
ctx.logger.info("Hermes Runtime Plugin loaded");
|
||||
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
|
||||
1
plugins/fusion-plugin-hermes-runtime/dist/index.js.map
vendored
Normal file
1
plugins/fusion-plugin-hermes-runtime/dist/index.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAO5D,iFAAiF;AAEjF,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AACnC,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAEvC,MAAM,qBAAqB,GAAkC;IAC3D,SAAS,EAAE,iBAAiB;IAC5B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,4EAA4E;IACzF,OAAO,EAAE,sBAAsB;CAChC,CAAC;AAEF,iFAAiF;AAEjF,MAAM,oBAAoB,GAAyB,KAAK,IAAI,EAAE;IAC5D,OAAO,IAAI,oBAAoB,EAAE,CAAC;AACpC,CAAC,CAAC;AAEF,iFAAiF;AAEjF,MAAM,MAAM,GAAiB,YAAY,CAAC;IACxC,QAAQ,EAAE;QACR,EAAE,EAAE,8BAA8B;QAClC,IAAI,EAAE,uBAAuB;QAC7B,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,wFAAwF;QACrG,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,kCAAkC;QAC5C,OAAO,EAAE,qBAAqB;KAC/B;IACD,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE;QACL,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;YACd,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;YAChD,GAAG,CAAC,SAAS,CAAC,uBAAuB,EAAE;gBACrC,SAAS,EAAE,iBAAiB;gBAC5B,OAAO,EAAE,sBAAsB;aAChC,CAAC,CAAC;QACL,CAAC;QACD,QAAQ,EAAE,GAAG,EAAE;YACb,qCAAqC;QACvC,CAAC;KACF;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,qBAAqB;QAC/B,OAAO,EAAE,oBAAoB;KAC9B;CACF,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC;AAEtB,iFAAiF;AAEjF,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,CAAC"}
|
||||
34
plugins/fusion-plugin-hermes-runtime/dist/pi-module.d.ts
vendored
Normal file
34
plugins/fusion-plugin-hermes-runtime/dist/pi-module.d.ts
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Pi Module Seam
|
||||
*
|
||||
* Provides a mockable import path for pi functions used by the HermesRuntimeAdapter.
|
||||
*/
|
||||
export interface PiAgentSession {
|
||||
dispose?: () => Promise<void> | void;
|
||||
}
|
||||
export interface PiAgentResult {
|
||||
session: PiAgentSession;
|
||||
sessionFile?: string;
|
||||
}
|
||||
export interface PiAgentOptions {
|
||||
cwd: string;
|
||||
systemPrompt: string;
|
||||
tools?: unknown;
|
||||
customTools?: unknown;
|
||||
onText?: (text: string) => void;
|
||||
onThinking?: (text: string) => void;
|
||||
onToolStart?: (toolName: string, args?: unknown) => void;
|
||||
onToolEnd?: (toolName: string, result?: unknown) => void;
|
||||
defaultProvider?: string;
|
||||
defaultModelId?: string;
|
||||
fallbackProvider?: string;
|
||||
fallbackModelId?: string;
|
||||
defaultThinkingLevel?: string;
|
||||
sessionManager?: unknown;
|
||||
skillSelection?: unknown;
|
||||
skills?: string[];
|
||||
}
|
||||
export declare const createFnAgent: (options: PiAgentOptions) => Promise<PiAgentResult>;
|
||||
export declare const promptWithFallback: (session: PiAgentSession, prompt: string, options?: unknown) => Promise<void>;
|
||||
export declare const describeModel: (session: PiAgentSession) => string;
|
||||
//# sourceMappingURL=pi-module.d.ts.map
|
||||
1
plugins/fusion-plugin-hermes-runtime/dist/pi-module.d.ts.map
vendored
Normal file
1
plugins/fusion-plugin-hermes-runtime/dist/pi-module.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pi-module.d.ts","sourceRoot":"","sources":["../src/pi-module.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACtC;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,cAAc,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzD,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AASD,eAAO,MAAM,aAAa,YALC,cAAc,KAAK,OAAO,CAAC,aAAa,CAKf,CAAC;AACrD,eAAO,MAAM,kBAAkB,YALC,cAAc,UAAU,MAAM,YAAY,OAAO,KAAK,OAAO,CAAC,IAAI,CAKpC,CAAC;AAC/D,eAAO,MAAM,aAAa,YALC,cAAc,KAAK,MAKM,CAAC"}
|
||||
11
plugins/fusion-plugin-hermes-runtime/dist/pi-module.js
vendored
Normal file
11
plugins/fusion-plugin-hermes-runtime/dist/pi-module.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Pi Module Seam
|
||||
*
|
||||
* Provides a mockable import path for pi functions used by the HermesRuntimeAdapter.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
const _piModule = require("../../../packages/engine/src/pi.js");
|
||||
export const createFnAgent = _piModule.createFnAgent;
|
||||
export const promptWithFallback = _piModule.promptWithFallback;
|
||||
export const describeModel = _piModule.describeModel;
|
||||
//# sourceMappingURL=pi-module.js.map
|
||||
1
plugins/fusion-plugin-hermes-runtime/dist/pi-module.js.map
vendored
Normal file
1
plugins/fusion-plugin-hermes-runtime/dist/pi-module.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pi-module.js","sourceRoot":"","sources":["../src/pi-module.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8BH,iEAAiE;AACjE,MAAM,SAAS,GAAG,OAAO,CAAC,oCAAoC,CAI7D,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC;AACrD,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC,kBAAkB,CAAC;AAC/D,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC"}
|
||||
10
plugins/fusion-plugin-hermes-runtime/dist/runtime-adapter.d.ts
vendored
Normal file
10
plugins/fusion-plugin-hermes-runtime/dist/runtime-adapter.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { AgentRuntime, AgentRuntimeOptions, AgentSession, AgentSessionResult } from "./types.js";
|
||||
export declare class HermesRuntimeAdapter implements AgentRuntime {
|
||||
readonly id = "hermes";
|
||||
readonly name = "Hermes Runtime";
|
||||
createSession(options: AgentRuntimeOptions): Promise<AgentSessionResult>;
|
||||
promptWithFallback(session: AgentSession, prompt: string, options?: unknown): Promise<void>;
|
||||
describeModel(session: AgentSession): string;
|
||||
dispose(session: AgentSession): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=runtime-adapter.d.ts.map
|
||||
1
plugins/fusion-plugin-hermes-runtime/dist/runtime-adapter.d.ts.map
vendored
Normal file
1
plugins/fusion-plugin-hermes-runtime/dist/runtime-adapter.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"runtime-adapter.d.ts","sourceRoot":"","sources":["../src/runtime-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAKpB,qBAAa,oBAAqB,YAAW,YAAY;IACvD,QAAQ,CAAC,EAAE,YAAY;IACvB,QAAQ,CAAC,IAAI,oBAAoB;IAE3B,aAAa,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAqBxE,kBAAkB,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjG,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM;IAItC,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CAKpD"}
|
||||
38
plugins/fusion-plugin-hermes-runtime/dist/runtime-adapter.js
vendored
Normal file
38
plugins/fusion-plugin-hermes-runtime/dist/runtime-adapter.js
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import { createFnAgent, describeModel, promptWithFallback } from "./pi-module.js";
|
||||
const getModelDescription = describeModel;
|
||||
export class HermesRuntimeAdapter {
|
||||
id = "hermes";
|
||||
name = "Hermes Runtime";
|
||||
async createSession(options) {
|
||||
return createFnAgent({
|
||||
cwd: options.cwd,
|
||||
systemPrompt: options.systemPrompt,
|
||||
tools: options.tools,
|
||||
customTools: options.customTools,
|
||||
onText: options.onText,
|
||||
onThinking: options.onThinking,
|
||||
onToolStart: options.onToolStart,
|
||||
onToolEnd: options.onToolEnd,
|
||||
defaultProvider: options.defaultProvider,
|
||||
defaultModelId: options.defaultModelId,
|
||||
fallbackProvider: options.fallbackProvider,
|
||||
fallbackModelId: options.fallbackModelId,
|
||||
defaultThinkingLevel: options.defaultThinkingLevel,
|
||||
sessionManager: options.sessionManager,
|
||||
skillSelection: options.skillSelection,
|
||||
skills: options.skills,
|
||||
});
|
||||
}
|
||||
async promptWithFallback(session, prompt, options) {
|
||||
return promptWithFallback(session, prompt, options);
|
||||
}
|
||||
describeModel(session) {
|
||||
return getModelDescription(session);
|
||||
}
|
||||
async dispose(session) {
|
||||
if (typeof session.dispose === "function") {
|
||||
await session.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=runtime-adapter.js.map
|
||||
1
plugins/fusion-plugin-hermes-runtime/dist/runtime-adapter.js.map
vendored
Normal file
1
plugins/fusion-plugin-hermes-runtime/dist/runtime-adapter.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"runtime-adapter.js","sourceRoot":"","sources":["../src/runtime-adapter.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAElF,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAE1C,MAAM,OAAO,oBAAoB;IACtB,EAAE,GAAG,QAAQ,CAAC;IACd,IAAI,GAAG,gBAAgB,CAAC;IAEjC,KAAK,CAAC,aAAa,CAAC,OAA4B;QAC9C,OAAO,aAAa,CAAC;YACnB,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,eAAe,EAAE,OAAO,CAAC,eAAe;YACxC,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;YAC1C,eAAe,EAAE,OAAO,CAAC,eAAe;YACxC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;YAClD,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,OAAqB,EAAE,MAAc,EAAE,OAAiB;QAC/E,OAAO,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,aAAa,CAAC,OAAqB;QACjC,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAqB;QACjC,IAAI,OAAQ,OAA6C,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;YACjF,MAAO,OAA4C,CAAC,OAAO,EAAE,CAAC;QAChE,CAAC;IACH,CAAC;CACF"}
|
||||
44
plugins/fusion-plugin-hermes-runtime/dist/types.d.ts
vendored
Normal file
44
plugins/fusion-plugin-hermes-runtime/dist/types.d.ts
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Hermes Runtime Plugin - Type Definitions
|
||||
*
|
||||
* The runtime contract is defined locally to avoid compile-time coupling to
|
||||
* internal engine exports.
|
||||
*/
|
||||
/** Minimal session shape used by the runtime adapter. */
|
||||
export interface AgentSession {
|
||||
dispose?: () => Promise<void> | void;
|
||||
}
|
||||
/** Options for creating an agent session. Mirrors createFnAgent inputs used by the adapter. */
|
||||
export interface AgentRuntimeOptions {
|
||||
cwd: string;
|
||||
systemPrompt: string;
|
||||
tools?: unknown;
|
||||
customTools?: unknown;
|
||||
onText?: (text: string) => void;
|
||||
onThinking?: (text: string) => void;
|
||||
onToolStart?: (toolName: string, args?: unknown) => void;
|
||||
onToolEnd?: (toolName: string, result?: unknown) => void;
|
||||
defaultProvider?: string;
|
||||
defaultModelId?: string;
|
||||
fallbackProvider?: string;
|
||||
fallbackModelId?: string;
|
||||
defaultThinkingLevel?: string;
|
||||
sessionManager?: unknown;
|
||||
skillSelection?: unknown;
|
||||
skills?: string[];
|
||||
}
|
||||
/** Result of creating a session. */
|
||||
export interface AgentSessionResult {
|
||||
session: AgentSession;
|
||||
sessionFile?: string;
|
||||
}
|
||||
/** Agent runtime adapter interface. */
|
||||
export interface AgentRuntime {
|
||||
id: string;
|
||||
name: string;
|
||||
createSession(options: AgentRuntimeOptions): Promise<AgentSessionResult>;
|
||||
promptWithFallback(session: AgentSession, prompt: string, options?: unknown): Promise<void>;
|
||||
describeModel(session: AgentSession): string;
|
||||
dispose?(session: AgentSession): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=types.d.ts.map
|
||||
1
plugins/fusion-plugin-hermes-runtime/dist/types.d.ts.map
vendored
Normal file
1
plugins/fusion-plugin-hermes-runtime/dist/types.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAA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AAI,CAAC,CAAC;IAC5F,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAAC;IAC7C,OAAO,CAAC,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD"}
|
||||
8
plugins/fusion-plugin-hermes-runtime/dist/types.js
vendored
Normal file
8
plugins/fusion-plugin-hermes-runtime/dist/types.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Hermes Runtime Plugin - Type Definitions
|
||||
*
|
||||
* The runtime contract is defined locally to avoid compile-time coupling to
|
||||
* internal engine exports.
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=types.js.map
|
||||
1
plugins/fusion-plugin-hermes-runtime/dist/types.js.map
vendored
Normal file
1
plugins/fusion-plugin-hermes-runtime/dist/types.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
||||
Reference in New Issue
Block a user