refactor: trim contract helper exports

This commit is contained in:
Peter Steinberger
2026-05-02 05:02:51 +01:00
parent 78010b65ed
commit 614a294afa
5 changed files with 3 additions and 37 deletions

View File

@@ -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)",

View File

@@ -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();

View File

@@ -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] : [];
});
}

View File

@@ -9,8 +9,6 @@ export const channelPluginSurfaceKeys = [
"gateway",
] as const;
export type ChannelPluginSurface = (typeof channelPluginSurfaceKeys)[number];
export const sessionBindingContractChannelIds = [
"bluebubbles",
"discord",

View File

@@ -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 }),
};
});
}