




















11// Extracts explicit public artifacts from web provider plugin manifests.
22import { isRecord } from "@openclaw/normalization-core/record-coerce";
33import { sortUniqueStrings } from "@openclaw/normalization-core/string-normalization";
4-import {
5-loadBundledPluginPublicArtifactModuleSync,
6-resolveBundledPluginPublicArtifactPath,
7-} from "./public-surface-loader.js";
4+import { loadBundledPluginPublicArtifactModuleSync } from "./public-surface-loader.js";
85import type {
96PluginWebFetchProviderEntry,
107PluginWebSearchProviderEntry,
@@ -17,7 +14,6 @@ const WEB_SEARCH_ARTIFACT_CANDIDATES = [
1714"web-search-provider.js",
1815"web-search.js",
1916] as const;
20-const WEB_SEARCH_RUNTIME_ARTIFACT_CANDIDATES = ["web-search-provider.js", "web-search.js"] as const;
2117const WEB_FETCH_ARTIFACT_CANDIDATES = [
2218"web-fetch-contract-api.js",
2319"web-fetch-provider.js",
@@ -166,19 +162,6 @@ export function loadBundledWebSearchProviderEntriesFromDir(params: {
166162});
167163}
168164169-function loadBundledRuntimeWebSearchProviderEntriesFromDir(params: {
170-dirName: string;
171-pluginId: string;
172-}): PluginWebSearchProviderEntry[] | null {
173-return loadBundledProviderEntriesFromDir<WebSearchProviderPlugin>({
174-dirName: params.dirName,
175-pluginId: params.pluginId,
176-artifactCandidates: WEB_SEARCH_RUNTIME_ARTIFACT_CANDIDATES,
177-suffix: "WebSearchProvider",
178-isProvider: isWebSearchProviderPlugin,
179-});
180-}
181-182165export function loadBundledWebFetchProviderEntriesFromDir(params: {
183166dirName: string;
184167pluginId: string;
@@ -209,23 +192,6 @@ export function resolveBundledExplicitWebSearchProvidersFromPublicArtifacts(para
209192return providers;
210193}
211194212-export function resolveBundledExplicitRuntimeWebSearchProvidersFromPublicArtifacts(params: {
213-onlyPluginIds: readonly string[];
214-}): PluginWebSearchProviderEntry[] | null {
215-const providers: PluginWebSearchProviderEntry[] = [];
216-for (const pluginId of normalizeExplicitBundledPluginIds(params.onlyPluginIds)) {
217-const loadedProviders = loadBundledRuntimeWebSearchProviderEntriesFromDir({
218-dirName: pluginId,
219- pluginId,
220-});
221-if (!loadedProviders) {
222-return null;
223-}
224-providers.push(...loadedProviders);
225-}
226-return providers;
227-}
228-229195export function resolveBundledExplicitWebFetchProvidersFromPublicArtifacts(params: {
230196onlyPluginIds: readonly string[];
231197}): PluginWebFetchProviderEntry[] | null {
@@ -242,26 +208,3 @@ export function resolveBundledExplicitWebFetchProvidersFromPublicArtifacts(param
242208}
243209return providers;
244210}
245-246-function hasBundledPublicArtifactCandidate(params: {
247-dirName: string;
248-artifactCandidates: readonly string[];
249-}): boolean {
250-return params.artifactCandidates.some((artifactBasename) =>
251-Boolean(resolveBundledPluginPublicArtifactPath({ dirName: params.dirName, artifactBasename })),
252-);
253-}
254-255-export function hasBundledWebSearchProviderPublicArtifact(pluginId: string): boolean {
256-return hasBundledPublicArtifactCandidate({
257-dirName: pluginId,
258-artifactCandidates: WEB_SEARCH_ARTIFACT_CANDIDATES,
259-});
260-}
261-262-export function hasBundledWebFetchProviderPublicArtifact(pluginId: string): boolean {
263-return hasBundledPublicArtifactCandidate({
264-dirName: pluginId,
265-artifactCandidates: WEB_FETCH_ARTIFACT_CANDIDATES,
266-});
267-}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。