mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-05 22:32:12 +00:00
fix(ci): restore provider runtime seams
This commit is contained in:
@@ -1,16 +1,10 @@
|
||||
import type { StreamFn } from "@mariozechner/pi-agent-core";
|
||||
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-entry";
|
||||
import { buildProviderReplayFamilyHooks } from "openclaw/plugin-sdk/provider-model-shared";
|
||||
import {
|
||||
createBedrockNoCacheWrapper,
|
||||
isAnthropicBedrockModel,
|
||||
streamWithPayloadPatch,
|
||||
} from "openclaw/plugin-sdk/provider-stream";
|
||||
import {
|
||||
mergeImplicitBedrockProvider,
|
||||
resolveBedrockConfigApiKey,
|
||||
resolveImplicitBedrockProvider,
|
||||
} from "./api.js";
|
||||
|
||||
type GuardrailConfig = {
|
||||
guardrailIdentifier: string;
|
||||
@@ -49,14 +43,23 @@ export async function registerAmazonBedrockPlugin(api: OpenClawPluginApi): Promi
|
||||
// initialization during test bootstrap cannot trip TDZ reads.
|
||||
const providerId = "amazon-bedrock";
|
||||
const claude46ModelRe = /claude-(?:opus|sonnet)-4(?:\.|-)6(?:$|[-.])/i;
|
||||
const anthropicByModelReplayHooks = buildProviderReplayFamilyHooks({
|
||||
family: "anthropic-by-model",
|
||||
});
|
||||
const bedrockContextOverflowPatterns = [
|
||||
/ValidationException.*(?:input is too long|max input token|input token.*exceed)/i,
|
||||
/ValidationException.*(?:exceeds? the (?:maximum|max) (?:number of )?(?:input )?tokens)/i,
|
||||
/ModelStreamErrorException.*(?:Input is too long|too many input tokens)/i,
|
||||
] as const;
|
||||
// Defer provider-owned helper loading until registration so test/plugin-loader
|
||||
// cycles cannot re-enter this module before its constants initialize.
|
||||
const [
|
||||
{ buildProviderReplayFamilyHooks },
|
||||
{ mergeImplicitBedrockProvider, resolveBedrockConfigApiKey, resolveImplicitBedrockProvider },
|
||||
] = await Promise.all([
|
||||
import("openclaw/plugin-sdk/provider-model-shared"),
|
||||
import("./api.js"),
|
||||
]);
|
||||
const anthropicByModelReplayHooks = buildProviderReplayFamilyHooks({
|
||||
family: "anthropic-by-model",
|
||||
});
|
||||
const guardrail = (api.pluginConfig as Record<string, unknown> | undefined)?.guardrail as
|
||||
| GuardrailConfig
|
||||
| undefined;
|
||||
|
||||
@@ -119,6 +119,10 @@
|
||||
"types": "./dist/plugin-sdk/config-runtime.d.ts",
|
||||
"default": "./dist/plugin-sdk/config-runtime.js"
|
||||
},
|
||||
"./plugin-sdk/telegram-command-config": {
|
||||
"types": "./dist/plugin-sdk/telegram-command-config.d.ts",
|
||||
"default": "./dist/plugin-sdk/telegram-command-config.js"
|
||||
},
|
||||
"./plugin-sdk/config-schema": {
|
||||
"types": "./dist/plugin-sdk/config-schema.d.ts",
|
||||
"default": "./dist/plugin-sdk/config-schema.js"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"approval-reply-runtime",
|
||||
"approval-runtime",
|
||||
"config-runtime",
|
||||
"telegram-command-config",
|
||||
"config-schema",
|
||||
"reply-runtime",
|
||||
"reply-dispatch-runtime",
|
||||
|
||||
@@ -336,7 +336,6 @@ describe("plugin-sdk root alias", () => {
|
||||
expect(packageJson.exports?.["./plugin-sdk/slack-targets"]).toBeUndefined();
|
||||
expect(packageJson.exports?.["./plugin-sdk/telegram-account"]).toBeUndefined();
|
||||
expect(packageJson.exports?.["./plugin-sdk/telegram-allow-from"]).toBeUndefined();
|
||||
expect(packageJson.exports?.["./plugin-sdk/telegram-command-config"]).toBeUndefined();
|
||||
expect(packageJson.exports?.["./plugin-sdk/telegram-surface"]).toBeUndefined();
|
||||
expect(packageJson.exports?.["./plugin-sdk/whatsapp-auth-presence"]).toBeUndefined();
|
||||
expect(packageJson.exports?.["./plugin-sdk/whatsapp-core"]).toBeUndefined();
|
||||
|
||||
Reference in New Issue
Block a user