diff --git a/src/agents/pi-embedded-runner-extraparams-moonshot.test.ts b/src/agents/pi-embedded-runner-extraparams-moonshot.test.ts index b8270d51270..6dd460064c6 100644 --- a/src/agents/pi-embedded-runner-extraparams-moonshot.test.ts +++ b/src/agents/pi-embedded-runner-extraparams-moonshot.test.ts @@ -1,7 +1,7 @@ import type { StreamFn } from "@mariozechner/pi-agent-core"; import type { Context, Model } from "@mariozechner/pi-ai"; import { afterEach, beforeEach, describe, expect, it } from "vitest"; -import { createConfiguredOllamaCompatStreamWrapper } from "../../extensions/ollama/api.ts"; +import { createConfiguredOllamaCompatStreamWrapper } from "../plugin-sdk/ollama-runtime.js"; import { __testing as extraParamsTesting } from "./pi-embedded-runner/extra-params.js"; import { applyExtraParamsToAgent } from "./pi-embedded-runner/extra-params.js"; import { diff --git a/src/image-generation/runtime.live.test.ts b/src/image-generation/runtime.live.test.ts index d6356551cd8..b547cf3072f 100644 --- a/src/image-generation/runtime.live.test.ts +++ b/src/image-generation/runtime.live.test.ts @@ -1,9 +1,4 @@ import { describe, expect, it } from "vitest"; -import falPlugin from "../../extensions/fal/index.js"; -import googlePlugin from "../../extensions/google/index.js"; -import minimaxPlugin from "../../extensions/minimax/index.js"; -import openaiPlugin from "../../extensions/openai/index.js"; -import vydraPlugin from "../../extensions/vydra/index.js"; import { registerProviderPlugin, requireRegisteredProvider, @@ -17,6 +12,7 @@ import { isTruthyEnvValue } from "../infra/env.js"; import { getShellEnvAppliedKeys, loadShellEnvFallback } from "../infra/shell-env.js"; import { encodePngRgba, fillPixel } from "../media/png-encode.js"; import { getProviderEnvVars } from "../secrets/provider-env-vars.js"; +import { loadBundledPluginPublicSurfaceSync } from "../test-utils/bundled-plugin-public-surface.js"; import { DEFAULT_LIVE_IMAGE_MODELS, parseCaseFilter, @@ -42,6 +38,10 @@ type LiveProviderCase = { providerId: string; }; +type BundledProviderEntryModule = { + default: LiveProviderCase["plugin"]; +}; + type LiveImageCase = { id: string; providerId: string; @@ -52,28 +52,40 @@ type LiveImageCase = { inputImages?: Array<{ buffer: Buffer; mimeType: string; fileName?: string }>; }; +function loadBundledProviderPlugin(pluginId: string): LiveProviderCase["plugin"] { + return loadBundledPluginPublicSurfaceSync({ + pluginId, + artifactBasename: "index.js", + }).default; +} + const PROVIDER_CASES: LiveProviderCase[] = [ - { plugin: falPlugin, pluginId: "fal", pluginName: "fal Provider", providerId: "fal" }, { - plugin: googlePlugin, + plugin: loadBundledProviderPlugin("fal"), + pluginId: "fal", + pluginName: "fal Provider", + providerId: "fal", + }, + { + plugin: loadBundledProviderPlugin("google"), pluginId: "google", pluginName: "Google Provider", providerId: "google", }, { - plugin: minimaxPlugin, + plugin: loadBundledProviderPlugin("minimax"), pluginId: "minimax", pluginName: "MiniMax Provider", providerId: "minimax", }, { - plugin: openaiPlugin, + plugin: loadBundledProviderPlugin("openai"), pluginId: "openai", pluginName: "OpenAI Provider", providerId: "openai", }, { - plugin: vydraPlugin, + plugin: loadBundledProviderPlugin("vydra"), pluginId: "vydra", pluginName: "Vydra Provider", providerId: "vydra",