fix(plugin-sdk): add web-search contract subpath

This commit is contained in:
Vincent Koc
2026-04-06 23:28:29 +01:00
parent 3eecbc3c7d
commit 2a6e8dca47
9 changed files with 39 additions and 6 deletions

View File

@@ -1,2 +1,2 @@
08615a28ed3deb20a96c9cd8fd7237a4cbb209ceec93dca03b543979304459e4 plugin-sdk-api-baseline.json
683c1249dc15529d8e79bc75e9c00484551cb74126befee507fffcf786e01833 plugin-sdk-api-baseline.jsonl
1aafbd4e24b950c3386f5f1641e498a0060590ea6279ec5628ef0c9d62a62169 plugin-sdk-api-baseline.json
479743ab748836a98e53797328d1831d6698ceff513a52a2dbb47a3ec183a085 plugin-sdk-api-baseline.jsonl

View File

@@ -3,7 +3,7 @@ import {
getScopedCredentialValue,
setScopedCredentialValue,
type WebSearchProviderPlugin,
} from "openclaw/plugin-sdk/provider-web-search";
} from "openclaw/plugin-sdk/provider-web-search-contract";
export function createDuckDuckGoWebSearchProvider(): WebSearchProviderPlugin {
return {

View File

@@ -5,7 +5,7 @@ import {
setProviderWebSearchPluginConfigValue,
setScopedCredentialValue,
type WebSearchProviderPlugin,
} from "openclaw/plugin-sdk/provider-web-search";
} from "openclaw/plugin-sdk/provider-web-search-contract";
export function createFirecrawlWebSearchProvider(): WebSearchProviderPlugin {
return {

View File

@@ -4,7 +4,7 @@ import {
setProviderWebSearchPluginConfigValue,
setScopedCredentialValue,
type WebSearchProviderPlugin,
} from "openclaw/plugin-sdk/provider-web-search";
} from "openclaw/plugin-sdk/provider-web-search-contract";
export function createGeminiWebSearchProvider(): WebSearchProviderPlugin {
return {

View File

@@ -1,7 +1,7 @@
import {
enablePluginInConfig,
type WebSearchProviderPlugin,
} from "openclaw/plugin-sdk/provider-web-search";
} from "openclaw/plugin-sdk/provider-web-search-contract";
export function createOllamaWebSearchProvider(): WebSearchProviderPlugin {
return {

View File

@@ -896,6 +896,10 @@
"types": "./dist/plugin-sdk/provider-web-fetch.d.ts",
"default": "./dist/plugin-sdk/provider-web-fetch.js"
},
"./plugin-sdk/provider-web-search-contract": {
"types": "./dist/plugin-sdk/provider-web-search-contract.d.ts",
"default": "./dist/plugin-sdk/provider-web-search-contract.js"
},
"./plugin-sdk/provider-web-search": {
"types": "./dist/plugin-sdk/provider-web-search.d.ts",
"default": "./dist/plugin-sdk/provider-web-search.js"

View File

@@ -213,6 +213,7 @@
"provider-tools",
"provider-usage",
"provider-web-fetch",
"provider-web-search-contract",
"provider-web-search",
"retry-runtime",
"run-command",

View File

@@ -0,0 +1,12 @@
// Narrow shared exports for web-search contract surfaces.
import type { WebSearchProviderPlugin } from "../plugins/types.js";
export {
getScopedCredentialValue,
resolveProviderWebSearchPluginConfig,
setScopedCredentialValue,
setProviderWebSearchPluginConfigValue,
} from "../agents/tools/web-search-provider-config.js";
export { enablePluginInConfig } from "../plugins/enable.js";
export type { WebSearchProviderPlugin };

View File

@@ -328,6 +328,22 @@ describe("plugin-sdk subpath exports", () => {
"safeMatchRegex",
],
});
expectSourceContract("provider-web-search-contract", {
mentions: [
"enablePluginInConfig",
"getScopedCredentialValue",
"resolveProviderWebSearchPluginConfig",
"setScopedCredentialValue",
"setProviderWebSearchPluginConfigValue",
"WebSearchProviderPlugin",
],
omits: [
"buildSearchCacheKey",
"withTrustedWebSearchEndpoint",
"writeCachedSearchPayload",
"resolveCitationRedirectUrl",
],
});
expectSourceMentions("compat", [
"createPluginRuntimeStore",
"createScopedChannelConfigAdapter",