Files
openclaw/src/plugins/provider-thinking.ts
Peter Steinberger c7e7ac2728 refactor: remove expired plugin compatibility surfaces (#111451)
* docs(secrets): remove retired web credential paths

* refactor(web): remove retired provider compatibility paths

* refactor(providers): delete retired compatibility routes

* refactor(secrets): remove retired credential aliases

* refactor(plugin-sdk): delete retired compatibility surfaces

* docs(plugin-sdk): remove retired migration guidance

* chore(plugin-sdk): refresh rebased surface budgets

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

* refactor(compat): migrate retired internal callers

* chore(plugin-sdk): refresh current-main baselines

* test(config): migrate plugin-owned secret assertions

* test(gateway): narrow plugin secret refs

* fix(plugin-sdk): preserve private boundary type identity

* chore(compat): remove stale sweep references

* chore(lint): lower max-lines budget

* refactor(secrets): remove unused web helper

* build(plugin-sdk): drop removed compat entries

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

* chore(plugin-sdk): use Linux API baseline hash

* fix(plugin-sdk): preserve private bundled build entries

* fix(plugin-sdk): package private runtime facades

* fix(plugins): preserve external credential contracts
2026-07-19 11:04:48 -07:00

38 lines
1.4 KiB
TypeScript

// Resolves provider thinking-level policy from active plugins or plugin metadata.
import { getCurrentPluginMetadataSnapshot } from "./current-plugin-metadata-snapshot.js";
import { resolveProviderPolicySurface } from "./provider-public-artifacts.js";
import { resolveActiveProviderThinkingProfile } from "./provider-thinking-active.js";
import type { ProviderDefaultThinkingPolicyContext } from "./provider-thinking.types.js";
function resolveProviderPublicPolicySurface(providerId: string) {
const metadataSnapshot = getCurrentPluginMetadataSnapshot({
allowScopedSnapshot: true,
allowWorkspaceScopedSnapshot: true,
});
return resolveProviderPolicySurface(providerId, {
manifestRegistry: metadataSnapshot?.manifestRegistry,
});
}
type ThinkingHookParams<TContext> = {
provider: string;
context: TContext;
};
/** Resolves a provider thinking profile from active plugins or bundled policy surface. */
export function resolveProviderThinkingProfile(
params: ThinkingHookParams<ProviderDefaultThinkingPolicyContext>,
options?: { allowPublicArtifactFallback?: boolean },
) {
const activeProfile = resolveActiveProviderThinkingProfile(params);
if (activeProfile !== undefined) {
return activeProfile;
}
if (options?.allowPublicArtifactFallback === false) {
return undefined;
}
return resolveProviderPublicPolicySurface(params.provider)?.resolveThinkingProfile?.(
params.context,
);
}