mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:30:42 +00:00
refactor: trim contract helper exports
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import { createWebSearchProviderContractFields } from "openclaw/plugin-sdk/provider-web-search-contract";
|
||||
|
||||
const DUCKDUCKGO_ONBOARDING_SCOPES: Array<"text-inference"> = ["text-inference"];
|
||||
|
||||
export function createDuckDuckGoWebSearchProviderBase() {
|
||||
return {
|
||||
id: "duckduckgo",
|
||||
label: "DuckDuckGo Search (experimental)",
|
||||
hint: "Free web search fallback with no API key required",
|
||||
onboardingScopes: ["text-inference"] as const,
|
||||
onboardingScopes: [...DUCKDUCKGO_ONBOARDING_SCOPES],
|
||||
requiresCredential: false,
|
||||
envVars: [],
|
||||
placeholder: "(no key needed)",
|
||||
|
||||
@@ -25,15 +25,3 @@ export function buildDispatchInboundCaptureMock<T extends Record<string, unknown
|
||||
dispatchInboundMessageWithBufferedDispatcher: dispatchInboundMessage,
|
||||
};
|
||||
}
|
||||
|
||||
export async function buildDispatchInboundContextCapture(
|
||||
loadActual: <T extends Record<string, unknown>>() => Promise<T>,
|
||||
capture: InboundContextCapture,
|
||||
) {
|
||||
const actual = await loadActual<typeof import("../../../auto-reply/dispatch.js")>();
|
||||
return buildDispatchInboundCaptureMock(actual, (ctx) => {
|
||||
capture.ctx = ctx as MsgContext;
|
||||
});
|
||||
}
|
||||
|
||||
export const inboundCtxCapture = createInboundContextCapture();
|
||||
|
||||
@@ -66,10 +66,3 @@ export async function getBundledChannelPluginAsync(
|
||||
channelPluginPromiseCache.set(id, loading);
|
||||
return (await loading) ?? undefined;
|
||||
}
|
||||
|
||||
export function listBundledChannelPlugins(): readonly ChannelPlugin[] {
|
||||
return listBundledChannelPluginIds().flatMap((id) => {
|
||||
const plugin = getBundledChannelPlugin(id);
|
||||
return plugin ? [plugin] : [];
|
||||
});
|
||||
}
|
||||
|
||||
@@ -9,8 +9,6 @@ export const channelPluginSurfaceKeys = [
|
||||
"gateway",
|
||||
] as const;
|
||||
|
||||
export type ChannelPluginSurface = (typeof channelPluginSurfaceKeys)[number];
|
||||
|
||||
export const sessionBindingContractChannelIds = [
|
||||
"bluebubbles",
|
||||
"discord",
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { vi } from "vitest";
|
||||
import * as ssrf from "../../../infra/net/ssrf.js";
|
||||
import { normalizeLowercaseStringOrEmpty } from "../../../shared/string-coerce.js";
|
||||
|
||||
export function mockPublicPinnedHostname() {
|
||||
return vi.spyOn(ssrf, "resolvePinnedHostnameWithPolicy").mockImplementation(async (hostname) => {
|
||||
const normalized = normalizeLowercaseStringOrEmpty(hostname).replace(/\.$/, "");
|
||||
const addresses = ["93.184.216.34"];
|
||||
return {
|
||||
hostname: normalized,
|
||||
addresses,
|
||||
lookup: ssrf.createPinnedLookup({ hostname: normalized, addresses }),
|
||||
};
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user