@theokit/sdk 2.12.0 → 2.13.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,2 +1,2 @@
1
1
  import './run-TMdc7gmo.cjs';
2
- export { K as Cron } from './cron-Dv94Lgat.cjs';
2
+ export { K as Cron } from './cron-CpxLdAXc.cjs';
package/dist/cron.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import './run-TMdc7gmo.js';
2
- export { K as Cron } from './cron-BchPdvs2.js';
2
+ export { K as Cron } from './cron-CL_9nfhQ.js';
package/dist/cron.js CHANGED
@@ -10993,6 +10993,14 @@ var OpenAIClient = class {
10993
10993
  name = "openai";
10994
10994
  baseUrl;
10995
10995
  fetchImpl;
10996
+ /**
10997
+ * Whether this client recovers leaked Hermes tool-call dialect from assistant
10998
+ * text (theokit#58 follow-up). Observability for the route→client wiring of
10999
+ * `extractToolCallsFromContent`. @internal
11000
+ */
11001
+ get recoversLeakedToolCalls() {
11002
+ return this.options.extractToolCallsFromContent ?? false;
11003
+ }
10996
11004
  // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: HTTP+SSE handshake + accumulator is intentionally one block
10997
11005
  async *stream(request, signal) {
10998
11006
  const headers = {
@@ -11643,8 +11651,9 @@ function buildChain(options) {
11643
11651
  return clients;
11644
11652
  }
11645
11653
  function buildClient(name, routerOptions) {
11646
- const profile = getProviderProfile(name);
11647
- if (profile === void 0) return void 0;
11654
+ const baseProfile = getProviderProfile(name);
11655
+ if (baseProfile === void 0) return void 0;
11656
+ const profile = routerOptions.extractToolCallsFromContent === true && baseProfile.extractToolCallsFromContent !== true ? { ...baseProfile, extractToolCallsFromContent: true } : baseProfile;
11648
11657
  const ambient = currentCredentialPool(name);
11649
11658
  if (ambient !== void 0) {
11650
11659
  return new PoolAwareLlmClient(ambient, (apiKey) => selectTransport(profile, apiKey));
@@ -12045,11 +12054,13 @@ function buildLoopInputs(options, runId, userText) {
12045
12054
  const fallback = options.agentOptions.providers?.fallback;
12046
12055
  const apiKeys = options.agentOptions.providers?.apiKeys;
12047
12056
  const credentialPoolStrategy = options.agentOptions.providers?.credentialPoolStrategy;
12057
+ const extractToolCallsFromContent = options.agentOptions.providers?.routes?.[0]?.extractToolCallsFromContent;
12048
12058
  const chain = resolveProviderChain({
12049
12059
  primary,
12050
12060
  ...fallback !== void 0 ? { fallback } : {},
12051
12061
  ...apiKeys !== void 0 ? { apiKeys } : {},
12052
- ...credentialPoolStrategy !== void 0 ? { credentialPoolStrategy } : {}
12062
+ ...credentialPoolStrategy !== void 0 ? { credentialPoolStrategy } : {},
12063
+ ...extractToolCallsFromContent === true ? { extractToolCallsFromContent: true } : {}
12053
12064
  });
12054
12065
  const llm = chain.length === 1 ? chain[0] : new FallbackLlmClient(chain);
12055
12066
  return {