@theokit/sdk 4.9.1 → 4.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cron.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- export { N as Cron } from './cron-26WH1n7o.cjs';
1
+ export { N as Cron } from './cron-DXEhagMa.cjs';
2
2
  import './run-DFM1H2jW.cjs';
3
3
  import 'zod';
package/dist/cron.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { N as Cron } from './cron-D_0p_gXd.js';
1
+ export { N as Cron } from './cron-BF_AI5NP.js';
2
2
  import './run-DFM1H2jW.js';
3
3
  import 'zod';
package/dist/cron.js CHANGED
@@ -13682,6 +13682,9 @@ function resolveApiKey2(envVars) {
13682
13682
  return void 0;
13683
13683
  }
13684
13684
  function selectTransport(profile, apiKey) {
13685
+ const transformCtx = { apiKey };
13686
+ const transformFetch = profile.transform?.fetch?.(transformCtx);
13687
+ const transformHeaders = profile.transform?.headers?.(transformCtx);
13685
13688
  if (profile.apiMode === "chat_completions") {
13686
13689
  if (profile.name === "ollama") {
13687
13690
  const ollamaBase = process.env.OLLAMA_HOST ?? profile.baseUrl;
@@ -13698,6 +13701,7 @@ function selectTransport(profile, apiKey) {
13698
13701
  }
13699
13702
  const envOverride = resolveBaseUrlEnvOverride(profile.name);
13700
13703
  if (envOverride !== void 0) opts.baseUrl = envOverride;
13704
+ if (transformFetch !== void 0) opts.fetch = transformFetch;
13701
13705
  return new OpenAIClient(opts);
13702
13706
  }
13703
13707
  if (profile.apiMode === "anthropic_messages") {
@@ -13714,10 +13718,12 @@ function selectTransport(profile, apiKey) {
13714
13718
  return new BedrockAnthropicClient(realKey !== void 0 ? { apiKey: realKey } : {});
13715
13719
  }
13716
13720
  if (profile.apiMode === "responses_api") {
13721
+ const mergedHeaders = profile.extraHeaders !== void 0 || transformHeaders !== void 0 ? { ...profile.extraHeaders, ...transformHeaders } : void 0;
13717
13722
  return new ResponsesApiClient({
13718
13723
  apiKey,
13719
13724
  ...profile.baseUrl !== void 0 ? { baseUrl: profile.baseUrl } : {},
13720
- ...profile.extraHeaders !== void 0 ? { extraHeaders: profile.extraHeaders } : {},
13725
+ ...mergedHeaders !== void 0 ? { extraHeaders: mergedHeaders } : {},
13726
+ ...transformFetch !== void 0 ? { fetch: transformFetch } : {},
13721
13727
  providerName: profile.name
13722
13728
  });
13723
13729
  }