@nemesis-oss/ollama-sdk 1.19.0 → 1.19.1

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/index.js CHANGED
@@ -426,6 +426,43 @@ function isNetworkLevelError(error) {
426
426
  }
427
427
  return false;
428
428
  }
429
+ function lookupHeader(headers, name) {
430
+ if (headers === void 0) {
431
+ return void 0;
432
+ }
433
+ const needle = name.toLowerCase();
434
+ for (const [key, value] of Object.entries(headers)) {
435
+ if (key.toLowerCase() === needle) {
436
+ return value;
437
+ }
438
+ }
439
+ return void 0;
440
+ }
441
+ var HTTP_DATE_PATTERN = /^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), \d{2} (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} \d{2}:\d{2}:\d{2} GMT$/;
442
+ function parseRetryAfterMs(headerValue, now = Date.now()) {
443
+ if (headerValue === void 0) {
444
+ return void 0;
445
+ }
446
+ const trimmed = headerValue.trim();
447
+ if (trimmed === "") {
448
+ return void 0;
449
+ }
450
+ if (/^\d+$/.test(trimmed)) {
451
+ const seconds = Number(trimmed);
452
+ if (!Number.isSafeInteger(seconds)) {
453
+ return void 0;
454
+ }
455
+ return seconds * 1e3;
456
+ }
457
+ if (!HTTP_DATE_PATTERN.test(trimmed)) {
458
+ return void 0;
459
+ }
460
+ const instant = Date.parse(trimmed);
461
+ if (Number.isNaN(instant)) {
462
+ return void 0;
463
+ }
464
+ return Math.max(0, instant - now);
465
+ }
429
466
  function statusToError(status, message, options) {
430
467
  if (status === 401 || status === 403) {
431
468
  return new OllamaAuthError(message, { ...options, status });
@@ -437,7 +474,8 @@ function statusToError(status, message, options) {
437
474
  return new OllamaNotFoundError(message, { ...options, status });
438
475
  }
439
476
  if (status === 429) {
440
- return new OllamaRateLimitError(message, { ...options, status });
477
+ const retryAfterMs = parseRetryAfterMs(lookupHeader(options.response?.headers, "retry-after"));
478
+ return new OllamaRateLimitError(message, { ...options, status, retryAfterMs });
441
479
  }
442
480
  if (status === 502) {
443
481
  return new OllamaBadGatewayError(message, { ...options });
@@ -1140,6 +1178,21 @@ function sameHeaders(actual, expected) {
1140
1178
  const expectedKeys = Object.keys(expectedEntries);
1141
1179
  return actualKeys.length === expectedKeys.length && expectedKeys.every((key) => actualEntries[key] === expectedEntries[key]);
1142
1180
  }
1181
+ function retryAfterHeaderFrom(response) {
1182
+ try {
1183
+ const headers = response?.headers;
1184
+ if (headers === null || headers === void 0 || typeof headers.get !== "function") {
1185
+ return void 0;
1186
+ }
1187
+ const value = headers.get("retry-after");
1188
+ if (value === null || value === "") {
1189
+ return void 0;
1190
+ }
1191
+ return { "retry-after": value };
1192
+ } catch {
1193
+ return void 0;
1194
+ }
1195
+ }
1143
1196
  var HttpClient = class {
1144
1197
  baseUrl;
1145
1198
  apiKey;
@@ -1207,7 +1260,12 @@ var HttpClient = class {
1207
1260
  durationMs: Date.now() - startedAt,
1208
1261
  error: mapError(new Error(`HTTP ${response2.status}`), {
1209
1262
  request: { method: request.method, url: request.url },
1210
- response: { status: response2.status }
1263
+ // Mirrors the middleware path, which reports context.headers:
1264
+ // a 429 lifecycle event carries the server's Retry-After.
1265
+ response: {
1266
+ status: response2.status,
1267
+ headers: retryAfterHeaderFrom(response2)
1268
+ }
1211
1269
  }),
1212
1270
  timestamp: Date.now()
1213
1271
  });
@@ -1313,7 +1371,11 @@ var HttpClient = class {
1313
1371
  const message = typeof errorBody === "object" && errorBody !== null && "error" in errorBody ? String(errorBody.error) : `HTTP ${response.status} ${response.statusText}`;
1314
1372
  throw mapError(new Error(message), {
1315
1373
  request: { method, url },
1316
- response: { status: response.status, body: errorBody }
1374
+ response: {
1375
+ status: response.status,
1376
+ headers: retryAfterHeaderFrom(response),
1377
+ body: errorBody
1378
+ }
1317
1379
  });
1318
1380
  }
1319
1381
  if (options.method === "HEAD" || response.status === 204) {
@@ -1378,7 +1440,11 @@ var HttpClient = class {
1378
1440
  const errorText = await response.text();
1379
1441
  throw mapError(new Error(errorText || `HTTP ${response.status}`), {
1380
1442
  request: { method, url },
1381
- response: { status: response.status, body: errorText }
1443
+ response: {
1444
+ status: response.status,
1445
+ headers: retryAfterHeaderFrom(response),
1446
+ body: errorText
1447
+ }
1382
1448
  });
1383
1449
  }
1384
1450
  if (!response.body) {
@@ -1442,7 +1508,11 @@ var HttpClient = class {
1442
1508
  const errorText = await response.text();
1443
1509
  throw mapError(new Error(errorText || `HTTP ${response.status}`), {
1444
1510
  request: { method, url },
1445
- response: { status: response.status, body: errorText }
1511
+ response: {
1512
+ status: response.status,
1513
+ headers: retryAfterHeaderFrom(response),
1514
+ body: errorText
1515
+ }
1446
1516
  });
1447
1517
  }
1448
1518
  if (!response.body) {
@@ -1748,7 +1818,7 @@ function contextWarningMessage(check2, kind) {
1748
1818
  if (check2.windowSource === "client-default") {
1749
1819
  return `${where}: estimated prompt size ${estimate} is close to or beyond the client's \`defaultContextLength\` (${check2.effectiveContextLength}, injected as \`num_ctx\`). The server will likely silently truncate the top of the conversation \u2014 the model loses earlier turns with no error. Raise \`defaultContextLength\`, set \`options.num_ctx\` per request, or shorten the conversation.${suggestion} Estimates are heuristic (\xB120\u201330%); see \`estimateTokens\`.`;
1750
1820
  }
1751
- return `${where}: estimated prompt size ${estimate} outright exceeds Ollama's conservative server-default context window (${OLLAMA_FALLBACK_CONTEXT_LENGTH}\u20134096 tokens when \`num_ctx\` is unset \u2014 model-dependent). Unless the model's default is larger, the server will silently truncate the top of the conversation \u2014 the model loses earlier turns with no error. Set \`options.num_ctx\` (or the client's \`defaultContextLength\`) to an explicit window to make truncation visible and controllable.${suggestion} Estimates are heuristic (\xB120\u201330%); see \`estimateTokens\`.`;
1821
+ return `${where}: estimated prompt size ${estimate} outright exceeds the worst-case floor for the unset-\`num_ctx\` window (${OLLAMA_FALLBACK_CONTEXT_LENGTH} tokens \u2014 current daemons default higher, tiered by VRAM: 4096 / 32768 / 262144; \`OLLAMA_CONTEXT_LENGTH\` can override either way). If your daemon's effective window is that small, the server will silently truncate the top of the conversation \u2014 the model loses earlier turns with no error. Set \`options.num_ctx\` (or the client's \`defaultContextLength\`) to an explicit window \u2014 or discover the real one via \`client.models.getContextLength()\` \u2014 to make truncation visible and controllable.${suggestion} Estimates are heuristic (\xB120\u201330%); see \`estimateTokens\`.`;
1752
1822
  }
1753
1823
 
1754
1824
  // src/context-discovery.ts
@@ -2476,6 +2546,12 @@ function sleep(ms, signal) {
2476
2546
  signal?.addEventListener("abort", onAbort, { once: true });
2477
2547
  });
2478
2548
  }
2549
+ function retryDelayMs(error, attempt, backoff) {
2550
+ if (error instanceof OllamaRateLimitError && error.retryAfterMs !== void 0) {
2551
+ return error.retryAfterMs;
2552
+ }
2553
+ return calculateBackoff(attempt, backoff);
2554
+ }
2479
2555
  async function withRetry(operation, config = DEFAULT_RETRY_CONFIG, signal) {
2480
2556
  let attempt = 0;
2481
2557
  while (true) {
@@ -2487,7 +2563,7 @@ async function withRetry(operation, config = DEFAULT_RETRY_CONFIG, signal) {
2487
2563
  if (attempt >= config.maxRetries || !shouldRetry(error, attempt)) {
2488
2564
  throw error;
2489
2565
  }
2490
- const delayMs = calculateBackoff(attempt, config.backoff);
2566
+ const delayMs = retryDelayMs(error, attempt, config.backoff);
2491
2567
  config.onRetry?.(error, attempt, delayMs);
2492
2568
  await sleep(delayMs, signal);
2493
2569
  attempt += 1;
@@ -2656,7 +2732,8 @@ var ModelsClient = class {
2656
2732
  }
2657
2733
  /**
2658
2734
  * Discovers the model's real context window from the server — no more
2659
- * 2048/4096 guesswork. Consults, in precedence order:
2735
+ * default-window guesswork (current daemons tier the unset-`num_ctx`
2736
+ * default by VRAM: 4k / 32k / 256k). Consults, in precedence order:
2660
2737
  *
2661
2738
  * 1. `GET /api/ps` — the window the **running instance actually
2662
2739
  * allocated** (exact, reflects the Modelfile `num_ctx` default and
@@ -2668,7 +2745,7 @@ var ModelsClient = class {
2668
2745
  * 3. `POST /api/show` `model_info["<arch>.context_length"]` — the
2669
2746
  * model's **native GGUF maximum** (a ceiling to raise `num_ctx`
2670
2747
  * toward, not the allocated window).
2671
- * 4. Fallback — Ollama's conservative unset-`num_ctx` default (2048).
2748
+ * 4. Fallback — the 2048 worst-case floor for the unset-`num_ctx` window.
2672
2749
  *
2673
2750
  * The result carries every signal it found, so `nativeContextLength:
2674
2751
  * 131072` vs `contextLength: 4096` (a 32× gap seen in the official API
@@ -6369,7 +6446,9 @@ var OllamaClient = class _OllamaClient {
6369
6446
  * through a local server. Requires an Ollama account API key: pass `apiKey` to the
6370
6447
  * client constructor or set `OLLAMA_API_KEY`. Applies the same default `timeoutMs` and
6371
6448
  * retry policy as inference calls, but never cross-endpoint-fails-over — there is only
6372
- * ever the one cloud endpoint to call.
6449
+ * ever the one cloud endpoint to call. If the service answers 429 with a `Retry-After`
6450
+ * header, the transport parses it into `OllamaRateLimitError.retryAfterMs` and the
6451
+ * retry loop sleeps exactly that long instead of jittered backoff (see ADR 0035).
6373
6452
  */
6374
6453
  async webSearch(req) {
6375
6454
  const { count, max_results, ...rest } = req;
@@ -6400,8 +6479,11 @@ var OllamaClient = class _OllamaClient {
6400
6479
  * web search, and web fetch, bucketed by hour (`range: '24h'`) or day (`'7d'`/`'30d'`).
6401
6480
  *
6402
6481
  * See {@link OllamaClient.webSearch} for the cloud-endpoint/auth/timeout/retry
6403
- * behavior, which applies identically here. Query parameters mirror the official
6404
- * endpoint: `range` (`'24h' | '7d' | '30d'`, server default `'7d'`) and `scope`
6482
+ * behavior, which applies identically here. The pinned contract documents this
6483
+ * endpoint's 429 with a `Retry-After` header ("Seconds to wait before retrying"),
6484
+ * which the SDK parses into `OllamaRateLimitError.retryAfterMs` and honors verbatim
6485
+ * when retrying. Query parameters mirror the official endpoint: `range`
6486
+ * (`'24h' | '7d' | '30d'`, server default `'7d'`) and `scope`
6405
6487
  * (`'self' | 'team'`, server default `'self'`; team scope requires a team admin).
6406
6488
  * Omitted options are left unset so the server applies its own defaults.
6407
6489
  *
@@ -6434,7 +6516,9 @@ var OllamaClient = class _OllamaClient {
6434
6516
  * object (`balance_usd`/`allowance_usd`/`period`) or, on legacy plans, session/weekly
6435
6517
  * percentage limits; the shape is discriminated at runtime by the server response.
6436
6518
  * See {@link OllamaClient.webSearch} for the cloud-endpoint/auth/timeout/retry
6437
- * behavior, which applies identically here.
6519
+ * behavior, which applies identically here. Like `/api/usage`, the pinned contract
6520
+ * documents this endpoint's 429 with a `Retry-After` header, parsed into
6521
+ * `OllamaRateLimitError.retryAfterMs` and honored verbatim when retrying (ADR 0035).
6438
6522
  *
6439
6523
  * ```ts
6440
6524
  * const balance = await client.balance();
@@ -6720,6 +6804,21 @@ function sleep2(ms, signal) {
6720
6804
  signal?.addEventListener("abort", onAbort, { once: true });
6721
6805
  });
6722
6806
  }
6807
+ function retryAfterMsFromResponse(response) {
6808
+ try {
6809
+ const headers = response?.headers;
6810
+ if (headers === null || headers === void 0 || typeof headers.get !== "function") {
6811
+ return void 0;
6812
+ }
6813
+ const value = headers.get("retry-after");
6814
+ if (value === null || value === "") {
6815
+ return void 0;
6816
+ }
6817
+ return parseRetryAfterMs(value);
6818
+ } catch {
6819
+ return void 0;
6820
+ }
6821
+ }
6723
6822
  async function fetchWithBackoff(input, init, config = {}) {
6724
6823
  const fetchImpl = config.fetch ?? globalThis.fetch;
6725
6824
  if (typeof fetchImpl !== "function") {
@@ -6741,7 +6840,8 @@ async function fetchWithBackoff(input, init, config = {}) {
6741
6840
  ...signal !== void 0 ? { signal } : {}
6742
6841
  });
6743
6842
  if (RETRYABLE_STATUS_CODES.has(response.status) && attempt < maxRetries) {
6744
- const delayMs = calculateBackoff(attempt, backoff);
6843
+ const serverDelayMs = response.status === 429 ? retryAfterMsFromResponse(response) : void 0;
6844
+ const delayMs = serverDelayMs ?? calculateBackoff(attempt, backoff);
6745
6845
  config.onRetry?.(attempt, response.status, delayMs);
6746
6846
  await sleep2(delayMs, signal);
6747
6847
  continue;
@@ -8291,6 +8391,6 @@ function estimateSystemOneRequestBytes(request, options) {
8291
8391
  return new TextEncoder().encode(JSON.stringify(body)).byteLength;
8292
8392
  }
8293
8393
 
8294
- export { ATTR_GEN_AI_OPERATION_NAME, ATTR_GEN_AI_REQUEST_MODEL, ATTR_GEN_AI_RESPONSE_MODEL, ATTR_GEN_AI_SYSTEM, ATTR_GEN_AI_TOOL_CALL_ID, ATTR_GEN_AI_TOOL_NAME, ATTR_GEN_AI_USAGE_INPUT_TOKENS, ATTR_GEN_AI_USAGE_OUTPUT_TOKENS, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_OLLAMA_AGENT_ITERATION, ATTR_OLLAMA_AGENT_MAX_ITERATIONS, ATTR_OLLAMA_ENDPOINT_ATTEMPT, ATTR_OLLAMA_ENDPOINT_NAME, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_URL_FULL, Agent, AnthropicCompatClient, AnthropicMessagesStream, ConversationSession, DEFAULT_BACKOFF, DEFAULT_BASE_URL, DEFAULT_CONTEXT_WARNING_THRESHOLD, DEFAULT_EMBED_BATCH_SIZE, DEFAULT_EMBED_CONCURRENCY, DEFAULT_FAILOVER_CODES, DEFAULT_FETCH_BACKOFF_CONFIG, DEFAULT_RETRY_CONFIG, DEFAULT_TIMEOUT_MS, EndpointRegistry, GEN_AI_SYSTEM_OLLAMA, HttpClient, IMAGE_TOKEN_ESTIMATE, KEEP_ALIVE_INDEFINITE, KEEP_ALIVE_UNLOAD, KNOWN_DONE_REASONS, MAX_SYSTEM_ONE_IMAGES_BYTES, MAX_SYSTEM_ONE_REQUEST_BYTES, MESSAGE_OVERHEAD_TOKENS, McpBridge, ModelAffinityRouter, ModelAffinityScheduler, ModelsClient, NANOS_PER_MS, NANOS_PER_SECOND, NETWORK_ERROR_CODES, NOOP_LOGGER, OLLAMA_CLOUD_BASE_URL, OLLAMA_FALLBACK_CONTEXT_LENGTH, OllamaAbortError, OllamaAgentMaxIterationsError, OllamaAgentMaxToolCallsError, OllamaAgentToolLoopError, OllamaAuthError, OllamaBadGatewayError, OllamaClient, OllamaClientError, OllamaGenericClientError, OllamaIncompatibleModelError, OllamaMcpError, OllamaModelRoutingError, OllamaNetworkError, OllamaNotFoundError, OllamaOverloadedError, OllamaPaymentRequiredError, OllamaQuotaExceededError, OllamaRateLimitError, OllamaRequestTooLargeError, OllamaRequestValidationError, OllamaResponseValidationError, OllamaServerError, OllamaServerVersionUnknownError, OllamaSkillInvalidError, OllamaSkillNotFoundError, OllamaStream, OllamaStreamError, OllamaTimeoutError, OllamaToolTimeoutError, OllamaToolValidationError, OllamaUnsupportedCapabilityError, OpenAIChatCompletionStream, OpenAICompatClient, OpenAICompletionStream, OpenAIResponsesStream, OpenAIResponsesStreamError, QuotaManager, RETRYABLE_STATUS_CODES, ResponsesModule, ToolCallAccumulator, ToolRegistry, WEB_FETCH_TOOL_NAME, WEB_SEARCH_TOOL_NAME, addSpanEvent, applySkill, batchEmbed, calculateBackoff, canonicalToolCallSignature, checkChatContext, checkEndpointHealth, checkGenerateContext, compactConversationHistory, compareDraftPerformance, composeMiddleware, computeProgressPercent, contextWarningMessage, createConsoleLogger, createDecision, createModelAffinityScheduler, createOllamaCloudFreeTierQuota, createProgressSpeedTracker, createTimeoutSignal, createWebFetchTool, createWebSearchTool, createWebTools, defineTool, detectModelCapabilities, embedBatchOverflowMessage, encodeImage, estimateChatRequestTokens, estimateGenerateRequestTokens, estimateMessageTokens, estimateSystemOneRequestBytes, estimateTokens, extractContextLength as extractNativeContextLength, extractParameterNumCtx, extractUsage, fetchWithBackoff, findOversizedEmbedInputs, findRunningModelContextLength, formatTelemetry, formatWebFetchResult, formatWebSearchResult, imageStringNeedsResolution, inferRuntimeMode, isKeepAliveSugar, isKnownDoneReason, isModelResident, isNetworkLevelError, isSameToolCall, listAllMcpTools, listAvailableModels, loadMcpTools, mapError, mergeToolCall, mergeToolCallArgumentsString, mergeToolCallArrays, normalizeChatStream, normalizeGenerateStream, normalizeKeepAlive, normalizeProgressStream, observeStream, onProgress, parseFrontmatter, parseNdjsonStream, parseSseStream, parseStructuredOutput, recommendContextWindow, registerMcpTools, resolveContextLength, resolveCredentialEndpoints, resolveImageInput, sanitizeHistoryForNextTurn, setSpanError, toDataStream, toPullProgressEvent, toResponse, toTextStream, withRetry, withSpan, zodToJsonSchema };
8394
+ export { ATTR_GEN_AI_OPERATION_NAME, ATTR_GEN_AI_REQUEST_MODEL, ATTR_GEN_AI_RESPONSE_MODEL, ATTR_GEN_AI_SYSTEM, ATTR_GEN_AI_TOOL_CALL_ID, ATTR_GEN_AI_TOOL_NAME, ATTR_GEN_AI_USAGE_INPUT_TOKENS, ATTR_GEN_AI_USAGE_OUTPUT_TOKENS, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_OLLAMA_AGENT_ITERATION, ATTR_OLLAMA_AGENT_MAX_ITERATIONS, ATTR_OLLAMA_ENDPOINT_ATTEMPT, ATTR_OLLAMA_ENDPOINT_NAME, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_URL_FULL, Agent, AnthropicCompatClient, AnthropicMessagesStream, ConversationSession, DEFAULT_BACKOFF, DEFAULT_BASE_URL, DEFAULT_CONTEXT_WARNING_THRESHOLD, DEFAULT_EMBED_BATCH_SIZE, DEFAULT_EMBED_CONCURRENCY, DEFAULT_FAILOVER_CODES, DEFAULT_FETCH_BACKOFF_CONFIG, DEFAULT_RETRY_CONFIG, DEFAULT_TIMEOUT_MS, EndpointRegistry, GEN_AI_SYSTEM_OLLAMA, HttpClient, IMAGE_TOKEN_ESTIMATE, KEEP_ALIVE_INDEFINITE, KEEP_ALIVE_UNLOAD, KNOWN_DONE_REASONS, MAX_SYSTEM_ONE_IMAGES_BYTES, MAX_SYSTEM_ONE_REQUEST_BYTES, MESSAGE_OVERHEAD_TOKENS, McpBridge, ModelAffinityRouter, ModelAffinityScheduler, ModelsClient, NANOS_PER_MS, NANOS_PER_SECOND, NETWORK_ERROR_CODES, NOOP_LOGGER, OLLAMA_CLOUD_BASE_URL, OLLAMA_FALLBACK_CONTEXT_LENGTH, OllamaAbortError, OllamaAgentMaxIterationsError, OllamaAgentMaxToolCallsError, OllamaAgentToolLoopError, OllamaAuthError, OllamaBadGatewayError, OllamaClient, OllamaClientError, OllamaGenericClientError, OllamaIncompatibleModelError, OllamaMcpError, OllamaModelRoutingError, OllamaNetworkError, OllamaNotFoundError, OllamaOverloadedError, OllamaPaymentRequiredError, OllamaQuotaExceededError, OllamaRateLimitError, OllamaRequestTooLargeError, OllamaRequestValidationError, OllamaResponseValidationError, OllamaServerError, OllamaServerVersionUnknownError, OllamaSkillInvalidError, OllamaSkillNotFoundError, OllamaStream, OllamaStreamError, OllamaTimeoutError, OllamaToolTimeoutError, OllamaToolValidationError, OllamaUnsupportedCapabilityError, OpenAIChatCompletionStream, OpenAICompatClient, OpenAICompletionStream, OpenAIResponsesStream, OpenAIResponsesStreamError, QuotaManager, RETRYABLE_STATUS_CODES, ResponsesModule, ToolCallAccumulator, ToolRegistry, WEB_FETCH_TOOL_NAME, WEB_SEARCH_TOOL_NAME, addSpanEvent, applySkill, batchEmbed, calculateBackoff, canonicalToolCallSignature, checkChatContext, checkEndpointHealth, checkGenerateContext, compactConversationHistory, compareDraftPerformance, composeMiddleware, computeProgressPercent, contextWarningMessage, createConsoleLogger, createDecision, createModelAffinityScheduler, createOllamaCloudFreeTierQuota, createProgressSpeedTracker, createTimeoutSignal, createWebFetchTool, createWebSearchTool, createWebTools, defineTool, detectModelCapabilities, embedBatchOverflowMessage, encodeImage, estimateChatRequestTokens, estimateGenerateRequestTokens, estimateMessageTokens, estimateSystemOneRequestBytes, estimateTokens, extractContextLength as extractNativeContextLength, extractParameterNumCtx, extractUsage, fetchWithBackoff, findOversizedEmbedInputs, findRunningModelContextLength, formatTelemetry, formatWebFetchResult, formatWebSearchResult, imageStringNeedsResolution, inferRuntimeMode, isKeepAliveSugar, isKnownDoneReason, isModelResident, isNetworkLevelError, isSameToolCall, listAllMcpTools, listAvailableModels, loadMcpTools, mapError, mergeToolCall, mergeToolCallArgumentsString, mergeToolCallArrays, normalizeChatStream, normalizeGenerateStream, normalizeKeepAlive, normalizeProgressStream, observeStream, onProgress, parseFrontmatter, parseNdjsonStream, parseRetryAfterMs, parseSseStream, parseStructuredOutput, recommendContextWindow, registerMcpTools, resolveContextLength, resolveCredentialEndpoints, resolveImageInput, sanitizeHistoryForNextTurn, setSpanError, toDataStream, toPullProgressEvent, toResponse, toTextStream, withRetry, withSpan, zodToJsonSchema };
8295
8395
  //# sourceMappingURL=index.js.map
8296
8396
  //# sourceMappingURL=index.js.map