test: fix amazon-bedrock extension test boundary (#58753)

* Tests: stop amazon-bedrock from importing private core plugin types

* Config: refresh generated doc baseline
This commit is contained in:
Josh Lehman
2026-03-31 22:24:38 -07:00
committed by GitHub
parent ac6db066d3
commit 5836ddea3f
3 changed files with 93 additions and 7 deletions

View File

@@ -4,13 +4,14 @@ import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../src/config/config.js";
import { buildPluginApi } from "../../src/plugins/api-builder.js";
import type { PluginRuntime } from "../../src/plugins/runtime/types.js";
import type { ProviderPlugin } from "../../src/plugins/types.js";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import amazonBedrockPlugin from "./index.js";
type RegisteredProviderPlugin = ReturnType<typeof registerSingleProviderPlugin>;
/** Register the amazon-bedrock plugin with an optional pluginConfig override. */
function registerWithConfig(pluginConfig?: Record<string, unknown>): ProviderPlugin {
const providers: ProviderPlugin[] = [];
function registerWithConfig(pluginConfig?: Record<string, unknown>): RegisteredProviderPlugin {
const providers: RegisteredProviderPlugin[] = [];
const noopLogger = { info() {}, warn() {}, error() {}, debug() {} };
const api = buildPluginApi({
id: "amazon-bedrock",
@@ -23,7 +24,7 @@ function registerWithConfig(pluginConfig?: Record<string, unknown>): ProviderPlu
logger: noopLogger,
resolvePath: (input) => input,
handlers: {
registerProvider(provider: ProviderPlugin) {
registerProvider(provider: RegisteredProviderPlugin) {
providers.push(provider);
},
},
@@ -58,7 +59,7 @@ const ANTHROPIC_MODEL_DESCRIPTOR = {
* the payload via the onPayload hook that streamWithPayloadPatch installs.
*/
function callWrappedStream(
provider: ProviderPlugin,
provider: RegisteredProviderPlugin,
modelId: string,
modelDescriptor: never,
): Record<string, unknown> {