feat(FN-2294): merge fusion/fn-2294

This commit is contained in:
Fusion
2026-04-23 08:07:53 -07:00
committed by gsxdsm
parent 70ad1836d0
commit c04c5386b6
16 changed files with 96 additions and 53 deletions

View File

@@ -1,4 +1,11 @@
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
import { describe, it, expect, vi } from "vitest";
vi.mock("../pi-module.js", () => ({
createFnAgent: vi.fn().mockResolvedValue({ session: {} }),
promptWithFallback: vi.fn(),
describeModel: vi.fn().mockReturnValue("mock/model"),
}));
import plugin from "../index.js";
import { PaperclipRuntimeAdapter } from "../runtime-adapter.js";
@@ -51,18 +58,6 @@ describe("paperclip-runtime plugin", () => {
});
describe("runtime factory invocation", () => {
beforeEach(() => {
vi.mock("../../../../packages/engine/src/pi.js", () => ({
createFnAgent: vi.fn().mockResolvedValue({ session: {} }),
promptWithFallback: vi.fn(),
describeModel: vi.fn().mockReturnValue("mock/model"),
}));
});
afterEach(() => {
vi.restoreAllMocks();
});
it("should return a PaperclipRuntimeAdapter instance when factory is invoked", async () => {
const runtime = await plugin.runtime!.factory({} as any);
expect(runtime).toBeInstanceOf(PaperclipRuntimeAdapter);