refactor: move plugin contracts onto SDK testing seams

This commit is contained in:
Peter Steinberger
2026-04-28 00:14:52 +01:00
parent d3e4640bed
commit d462d1faf2
28 changed files with 326 additions and 167 deletions

View File

@@ -3,7 +3,12 @@
export type { OpenClawConfig } from "../config/config.js";
export type { DmPolicy, GroupPolicy } from "../config/types.js";
export type { SecretInput } from "../config/types.secrets.js";
export type { WizardPrompter } from "../wizard/prompts.js";
export type {
WizardMultiSelectParams,
WizardProgress,
WizardPrompter,
WizardSelectParams,
} from "../wizard/prompts.js";
export { WizardCancelledError } from "../wizard/prompts.js";
export type { ChannelSetupAdapter } from "../channels/plugins/types.adapters.js";
export type { ChannelSetupInput } from "../channels/plugins/types.core.js";

View File

@@ -1,7 +1,12 @@
// Narrow public testing surface for plugin authors.
// Keep this list additive and limited to helpers we are willing to support.
export { removeAckReactionAfterReply, shouldAckReaction } from "../channels/ack-reactions.js";
export {
createAckReactionHandle,
removeAckReactionAfterReply,
removeAckReactionHandleAfterReply,
shouldAckReaction,
} from "../channels/ack-reactions.js";
export {
expectChannelInboundContextContract,
primeChannelOutboundSendMock,
@@ -23,10 +28,48 @@ export { setDefaultChannelPluginRegistryForTests } from "../commands/channel-tes
export type { ChannelAccountSnapshot } from "../channels/plugins/types.public.js";
export type { ChannelGatewayContext } from "../channels/plugins/types.adapters.js";
export type { OpenClawConfig } from "../config/config.js";
export { isAtLeast, parseSemver } from "../infra/runtime-guard.js";
export { callGateway } from "../gateway/call.js";
export { createEmptyPluginRegistry } from "../plugins/registry.js";
export { deliverOutboundPayloads } from "../infra/outbound/deliver.js";
export {
createEmptyPluginRegistry,
createPluginRegistry,
type PluginRecord,
} from "../plugins/registry.js";
export {
providerContractLoadError,
pluginRegistrationContractRegistry,
resolveProviderContractProvidersForPluginIds,
resolveWebFetchProviderContractEntriesForPluginId,
resolveWebSearchProviderContractEntriesForPluginId,
} from "../plugins/contracts/registry.js";
export { BUNDLED_PLUGIN_CONTRACT_SNAPSHOTS } from "../plugins/contracts/inventory/bundled-capability-metadata.js";
export { loadPluginManifestRegistry } from "../plugins/manifest-registry.js";
export { parseMinHostVersionRequirement } from "../plugins/min-host-version.js";
export { resolveBundledExplicitProviderContractsFromPublicArtifacts } from "../plugins/provider-contract-public-artifacts.js";
export {
expectAugmentedCodexCatalog,
expectedAugmentedOpenaiCodexCatalogEntriesWithGpt55,
expectCodexBuiltInSuppression,
expectCodexMissingAuthHint,
} from "../plugins/provider-runtime.test-support.js";
export {
initializeGlobalHookRunner,
resetGlobalHookRunner,
} from "../plugins/hook-runner-global.js";
export { addTestHook } from "../plugins/hooks.test-helpers.js";
export {
assertUniqueValues,
BUNDLED_RUNTIME_SIDECAR_PATHS,
} from "../plugins/runtime-sidecar-paths.js";
export { createPluginRecord } from "../plugins/status.test-helpers.js";
export {
resolveBundledExplicitWebFetchProvidersFromPublicArtifacts,
resolveBundledExplicitWebSearchProvidersFromPublicArtifacts,
} from "../plugins/web-provider-public-artifacts.explicit.js";
export {
getActivePluginRegistry,
releasePinnedPluginChannelRegistry,
resetPluginRuntimeStateForTest,
setActivePluginRegistry,
} from "../plugins/runtime.js";
@@ -35,8 +78,16 @@ export {
resetFacadeRuntimeStateForTest,
} from "./facade-runtime.js";
export { capturePluginRegistration } from "../plugins/captured-registration.js";
export { runProviderCatalog } from "../plugins/provider-discovery.js";
export {
buildProviderPluginMethodChoice,
resolveProviderModelPickerEntries,
resolveProviderWizardOptions,
setProviderWizardProvidersResolverForTest,
} from "../plugins/provider-wizard.js";
export { resolveProviderPluginChoice } from "../plugins/provider-auth-choice.runtime.js";
export type { PluginRuntime } from "../plugins/runtime/types.js";
export type { PluginHookRegistration } from "../plugins/hook-types.js";
export type { RuntimeEnv } from "../runtime.js";
export type { MockFn } from "../test-utils/vitest-mock-fn.js";
export {
@@ -105,7 +156,7 @@ export type {
} from "../video-generation/types.js";
export { jsonResponse, requestBodyText, requestUrl } from "../test-helpers/http.js";
export { mockPinnedHostnameResolution } from "../test-helpers/ssrf.js";
export { createTestRegistry } from "../test-utils/channel-plugins.js";
export { createOutboundTestPlugin, createTestRegistry } from "../test-utils/channel-plugins.js";
export { createWindowsCmdShimFixture } from "../test-helpers/windows-cmd-shim.js";
export { installCommonResolveTargetErrorCases } from "../test-helpers/resolve-target-error-cases.js";
export { sanitizeTerminalText } from "../terminal/safe-text.js";
@@ -117,6 +168,7 @@ export { withFetchPreconnect, type FetchMock } from "../test-utils/fetch-mock.js
export { createMockServerResponse } from "../test-utils/mock-http-response.js";
export {
registerProviderPlugin,
registerProviderPlugins,
registerSingleProviderPlugin,
requireRegisteredProvider,
type RegisteredProviderCollections,