refactor: decouple bundled plugin sdk surfaces

This commit is contained in:
Peter Steinberger
2026-03-29 21:20:24 +01:00
parent 5d4c4bb850
commit 35233bae96
13 changed files with 109 additions and 17 deletions

View File

@@ -1,16 +1,17 @@
import { isMiniMaxModernModelId } from "openclaw/plugin-sdk/minimax";
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth-api-key";
import { matchesExactOrPrefix } from "openclaw/plugin-sdk/provider-model-shared";
import { applyOpencodeZenConfig, OPENCODE_ZEN_DEFAULT_MODEL } from "./api.js";
const PROVIDER_ID = "opencode";
const MINIMAX_MODERN_MODEL_MATCHERS = ["minimax-m2.7"] as const;
function isModernOpencodeModel(modelId: string): boolean {
const lower = modelId.trim().toLowerCase();
if (lower.endsWith("-free") || lower === "alpha-glm-4.7") {
return false;
}
return !isMiniMaxModernModelId(lower);
return !matchesExactOrPrefix(lower, MINIMAX_MODERN_MODEL_MATCHERS);
}
export default definePluginEntry({