fix preserve plugin-sdk web search compatibility

This commit is contained in:
Tak Hoffman 2026-03-17 22:50:34 -05:00
parent 326c660775
commit e691345774
No known key found for this signature in database
1 changed files with 20 additions and 2 deletions

View File

@ -1,12 +1,12 @@
// Public web-search registration helpers for provider plugins.
import type { WebSearchProviderPlugin } from "../plugins/types.js";
export {
createPluginBackedWebSearchProvider,
getScopedCredentialValue,
getTopLevelCredentialValue,
setScopedCredentialValue,
setTopLevelCredentialValue,
} from "../agents/tools/web-search-plugin-factory.js";
} from "../agents/tools/web-search-provider-config.js";
export { withTrustedWebToolsEndpoint } from "../agents/tools/web-guarded-fetch.js";
export {
DEFAULT_CACHE_TTL_MINUTES,
@ -16,3 +16,21 @@ export {
resolveCacheTtlMs,
writeCache,
} from "../agents/tools/web-shared.js";
/**
* @deprecated Implement provider-owned `createTool(...)` directly on the
* returned WebSearchProviderPlugin instead of routing through core.
*/
export function createPluginBackedWebSearchProvider(
provider: WebSearchProviderPlugin,
): WebSearchProviderPlugin {
return {
...provider,
createTool: () => {
throw new Error(
`createPluginBackedWebSearchProvider(${provider.id}) is no longer supported. ` +
"Define provider-owned createTool(...) directly in the extension's WebSearchProviderPlugin.",
);
},
};
}