mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-22 14:38:09 +00:00
refactor(runtime): remove unused registry accessors
This commit is contained in:
@@ -44,11 +44,6 @@ function hasInboundHistoryMedia(ctx: MsgContext): boolean {
|
||||
);
|
||||
}
|
||||
|
||||
/** True when current or recent inbound history may contain agent-turn attachments. */
|
||||
export function hasPotentialAgentTurnAttachments(ctx: MsgContext): boolean {
|
||||
return hasInboundMedia(ctx) || hasInboundHistoryMedia(ctx);
|
||||
}
|
||||
|
||||
/** Resolves image attachments for the current agent turn and recent image history. */
|
||||
export async function resolveAgentTurnAttachments(params: {
|
||||
ctx: MsgContext;
|
||||
|
||||
@@ -8,11 +8,6 @@ import { copyReplyPayloadMetadata } from "../reply-payload.js";
|
||||
import type { ReplyPayload } from "../reply-payload.js";
|
||||
import type { ReplyDispatchKind } from "./reply-dispatcher.types.js";
|
||||
|
||||
/** True when plugins have registered outbound reply payload hooks. */
|
||||
export function hasReplyPayloadSendingHooks(): boolean {
|
||||
return getGlobalHookRunner()?.hasHooks("reply_payload_sending") === true;
|
||||
}
|
||||
|
||||
/** Runs plugin hooks that may rewrite or cancel an outbound reply payload. */
|
||||
export async function runReplyPayloadSendingHook(params: {
|
||||
payload: ReplyPayload;
|
||||
|
||||
@@ -55,11 +55,6 @@ export function findMatchingPluginNodeCapabilityRoute(
|
||||
return findMatchingPluginNodeCapabilityRoutes(registry, context)[0];
|
||||
}
|
||||
|
||||
/** Lists node-capability surface names advertised by the active plugin registry. */
|
||||
export function listPluginNodeCapabilitySurfaces(registry: PluginRegistry): string[] {
|
||||
return listPluginNodeCapabilities(registry).map((entry) => entry.surface);
|
||||
}
|
||||
|
||||
/** Lists unique node-capability surfaces, preferring the shortest TTL per surface. */
|
||||
export function listPluginNodeCapabilities(
|
||||
registry: PluginRegistry,
|
||||
|
||||
@@ -422,15 +422,6 @@ export function listPluginDoctorSessionRouteStateOwners(params?: {
|
||||
return [...owners.values()].toSorted((left, right) => left.id.localeCompare(right.id));
|
||||
}
|
||||
|
||||
export function listPluginDoctorStateMigrations(params?: {
|
||||
config?: OpenClawConfig;
|
||||
workspaceDir?: string;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
pluginIds?: readonly string[];
|
||||
}): PluginDoctorStateMigration[] {
|
||||
return listPluginDoctorStateMigrationEntries(params).map((entry) => entry.migration);
|
||||
}
|
||||
|
||||
export function listPluginDoctorStateMigrationEntries(params?: {
|
||||
config?: OpenClawConfig;
|
||||
workspaceDir?: string;
|
||||
|
||||
@@ -79,7 +79,6 @@ import type {
|
||||
ProviderPreferRuntimeResolvedModelContext,
|
||||
ProviderPlugin,
|
||||
ProviderResolveExternalAuthProfilesContext,
|
||||
ProviderResolveExternalOAuthProfilesContext,
|
||||
ProviderPrepareRuntimeAuthContext,
|
||||
ProviderApplyConfigDefaultsContext,
|
||||
ProviderResolveConfigApiKeyContext,
|
||||
@@ -87,13 +86,11 @@ import type {
|
||||
ProviderResolveUsageAuthContext,
|
||||
ProviderResolveDynamicModelContext,
|
||||
ProviderResolveTransportTurnStateContext,
|
||||
ProviderResolveWebSocketSessionPolicyContext,
|
||||
ProviderSystemPromptContributionContext,
|
||||
ProviderTransformSystemPromptContext,
|
||||
ProviderThinkingPolicyContext,
|
||||
ProviderTransportTurnState,
|
||||
ProviderValidateReplayTurnsContext,
|
||||
ProviderWebSocketSessionPolicy,
|
||||
PluginTextTransforms,
|
||||
} from "./types.js";
|
||||
|
||||
@@ -608,19 +605,6 @@ export function resolveProviderTransportTurnStateWithPlugin(params: {
|
||||
return plugin?.resolveTransportTurnState?.(params.context) ?? undefined;
|
||||
}
|
||||
|
||||
export function resolveProviderWebSocketSessionPolicyWithPlugin(params: {
|
||||
provider: string;
|
||||
config?: OpenClawConfig;
|
||||
workspaceDir?: string;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
context: ProviderResolveWebSocketSessionPolicyContext;
|
||||
}): ProviderWebSocketSessionPolicy | undefined {
|
||||
return (
|
||||
resolveProviderRuntimePlugin(params)?.resolveWebSocketSessionPolicy?.(params.context) ??
|
||||
undefined
|
||||
);
|
||||
}
|
||||
|
||||
export async function createProviderEmbeddingProvider(params: {
|
||||
provider: string;
|
||||
config?: OpenClawConfig;
|
||||
@@ -992,15 +976,6 @@ export function resolveExternalAuthProfilesWithPlugins(params: {
|
||||
return matches;
|
||||
}
|
||||
|
||||
export function resolveExternalOAuthProfilesWithPlugins(params: {
|
||||
config?: OpenClawConfig;
|
||||
workspaceDir?: string;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
context: ProviderResolveExternalOAuthProfilesContext;
|
||||
}): ProviderExternalAuthProfile[] {
|
||||
return resolveExternalAuthProfilesWithPlugins(params);
|
||||
}
|
||||
|
||||
export function shouldDeferProviderSyntheticProfileAuthWithPlugin(params: {
|
||||
provider: string;
|
||||
config?: OpenClawConfig;
|
||||
|
||||
@@ -780,27 +780,6 @@ export function resolveOwningPluginIdsForModelRefs(params: {
|
||||
);
|
||||
}
|
||||
|
||||
export function resolveNonBundledProviderPluginIds(params: {
|
||||
config?: PluginLoadOptions["config"];
|
||||
workspaceDir?: string;
|
||||
env?: PluginLoadOptions["env"];
|
||||
}): string[] {
|
||||
const registry = loadProviderRegistrySnapshot(params);
|
||||
const providerSurfacePluginIds = resolveProviderSurfacePluginIdSet({ ...params, registry });
|
||||
const normalizedConfig = normalizePluginsConfigWithRegistry(params.config?.plugins, registry);
|
||||
return listRegistryPluginIds(
|
||||
registry,
|
||||
(plugin) =>
|
||||
plugin.origin !== "bundled" &&
|
||||
providerSurfacePluginIds.has(plugin.pluginId) &&
|
||||
resolveEffectiveRegistryPluginActivation({
|
||||
plugin,
|
||||
normalizedConfig,
|
||||
rootConfig: params.config,
|
||||
}).activated,
|
||||
);
|
||||
}
|
||||
|
||||
export function resolveCatalogHookProviderPluginIds(params: {
|
||||
config?: PluginLoadOptions["config"];
|
||||
workspaceDir?: string;
|
||||
|
||||
Reference in New Issue
Block a user