Files
tharuntejmeta a57e8c70f5 feat(meta): add Muse Spark 1.2 models (#120373)
* feat(meta): add Muse Spark 1.2 models

* fix(meta): verify Muse Spark 1.2 catalog metadata

* fix(meta): verify Muse Spark 1.2 contracts

* docs(meta): quote discounted services terms

* fix(meta): preserve replay fields for simple completions

* test(meta): align stream host adapter types

* fix(meta): apply catalog cap for zero max tokens

* fix(meta): preserve omitted output cap

* fix(meta): scope responses stream wrapper

* fix(ai): preserve source API for stream wrappers

* fix(ai): distinguish hook and dispatch APIs

* test(ai): adapt plugin streams synchronously

* chore(plugin-sdk): refresh API baseline

* chore(plugin-sdk): refresh sharded API baseline

---------

Co-authored-by: Patrick Erichsen <patrick.a.erichsen@gmail.com>
2026-08-11 11:26:58 -07:00

28 lines
1.0 KiB
TypeScript

// Meta plugin module implements thinking behavior.
import type {
ProviderDefaultThinkingPolicyContext,
ProviderThinkingProfile,
} from "openclaw/plugin-sdk/plugin-entry";
import { META_MODEL_CATALOG } from "./models.js";
const META_REASONING_MODEL_IDS = new Set(
META_MODEL_CATALOG.filter((model) => model.reasoning).map((model) => model.id.toLowerCase()),
);
const META_THINKING_LEVEL_IDS = ["off", "minimal", "low", "medium", "high", "xhigh"] as const;
const META_THINKING_PROFILE = {
levels: META_THINKING_LEVEL_IDS.map((id) => ({ id })),
defaultLevel: "high",
} satisfies ProviderThinkingProfile;
export function resolveMetaThinkingProfile(
context: ProviderDefaultThinkingPolicyContext,
): ProviderThinkingProfile | undefined {
// Some control-plane callers have no runtime catalog. Fall back to the
// process-stable manifest so those paths retain the same model policy.
const reasoning =
context.reasoning ?? META_REASONING_MODEL_IDS.has(context.modelId.toLowerCase());
return reasoning ? META_THINKING_PROFILE : undefined;
}