Add createStreamFn for CORS proxy support

- createStreamFn(proxyUrl?) returns a sync streamFn that applies proxy
- Example reads proxy settings once when creating Agent
- Matches old ProviderTransport behavior
This commit is contained in:
Mario Zechner 2025-12-28 11:37:42 +01:00
parent e49e787322
commit e0be2e650d
3 changed files with 28 additions and 1 deletions

View file

@ -112,3 +112,4 @@ export { loadAttachment } from "./utils/attachment-utils.js";
export { clearAuthToken, getAuthToken } from "./utils/auth-token.js";
export { formatCost, formatModelCost, formatTokenCount, formatUsage } from "./utils/format.js";
export { i18n, setLanguage, translations } from "./utils/i18n.js";
export { applyProxyIfNeeded, createStreamFn, isCorsError, shouldUseProxyForProvider } from "./utils/proxy-utils.js";