mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
test(boundary): remove last direct bundled plugin imports
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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<BundledProviderEntryModule>({
|
||||
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",
|
||||
|
||||
Reference in New Issue
Block a user