@openclaw/ai 2026.10.1-beta.2 → 2026.10.5-beta.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/README.md +6 -0
- package/dist/{anthropic-CZv6XFER.mjs → anthropic-BAHKgWam.mjs} +30 -59
- package/dist/{anthropic-payload-policy-BhCcgNdm.d.mts → anthropic-payload-policy-DGblkHL5.d.mts} +19 -16
- package/dist/{anthropic-stream-reducer-BQ1tjd7x.mjs → anthropic-stream-reducer-g6w1YVii.mjs} +197 -285
- package/dist/{api-registry-DpU0Rj-I.d.mts → api-registry-BhXXYdRA.d.mts} +2 -2
- package/dist/assistant-message-events-CHMJgbhs.mjs +18 -0
- package/dist/{assistant-output-OLm-Oln0.mjs → assistant-output-CUEeSotf.mjs} +2 -2
- package/dist/{assistant-text-phase-Bl1aDCB7.mjs → assistant-text-phase-BrV8KdFO.mjs} +7 -6
- package/dist/{azure-openai-responses-DH7bd3QT.mjs → azure-openai-responses-C7qBuR23.mjs} +8 -9
- package/dist/{credential-redaction-BKv49aiv.d.mts → credential-redaction-BHxruEH6.d.mts} +3 -1
- package/dist/{diagnostics-Caj-4RBA.mjs → diagnostics-tQasYct1.mjs} +10 -3
- package/dist/diagnostics.d.mts +7 -7
- package/dist/diagnostics.mjs +3 -3
- package/dist/{env-api-keys-CyX4VKGO.mjs → env-api-keys-CrxwdylR.mjs} +24 -35
- package/dist/event-stream-6UNs-AhN.d.mts +1 -0
- package/dist/{event-stream-DrRM_90c.d.mts → event-stream-BcqWLo_u.d.mts} +1 -1
- package/dist/{event-stream-C5AbCAaZ.mjs → event-stream-X2gmsUWv.mjs} +5 -8
- package/dist/event-stream.d.mts +2 -2
- package/dist/event-stream.mjs +1 -1
- package/dist/google-Boz2QcpK.mjs +20 -0
- package/dist/{google-interactions-wrnE6MLw.mjs → google-interactions-tjAb1mc5.mjs} +52 -84
- package/dist/{google-messages-BwPPycw6.mjs → google-messages-C-RZzloH.mjs} +25 -35
- package/dist/google-provider-stream-CMImyxbX.mjs +58 -0
- package/dist/{google-shared-Eql1OMPU.mjs → google-shared-OyAtMTZv.mjs} +6 -15
- package/dist/google-vertex-hCxTJea7.mjs +40 -0
- package/dist/{host-BinBeGcQ.d.mts → host-CTDz7LXD.d.mts} +6 -3
- package/dist/{host-DCW52iHe.mjs → host-JWXZWa-c.mjs} +12 -8
- package/dist/{host-policy-B3jc4Rpn.mjs → host-policy-q4Azym9F.mjs} +1 -1
- package/dist/{index-a8e_oKnu.d.mts → index-BYDvopUB.d.mts} +27 -6
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +7 -6
- package/dist/internal/anthropic.d.mts +6 -6
- package/dist/internal/anthropic.mjs +5 -5
- package/dist/internal/openai-completions-compat.d.mts +1 -1
- package/dist/internal/openai-completions-compat.mjs +1 -1
- package/dist/internal/openai-responses-payload-policy.d.mts +8 -1
- package/dist/internal/openai-responses-payload-policy.mjs +3 -3
- package/dist/internal/openai.d.mts +9 -9
- package/dist/internal/openai.mjs +9 -11
- package/dist/internal/runtime.d.mts +14 -11
- package/dist/internal/runtime.mjs +10 -13
- package/dist/internal/shared.d.mts +5 -5
- package/dist/internal/shared.mjs +6 -7
- package/dist/internal/tool-schema.mjs +2 -2
- package/dist/{llm-request-activity-D8f_oxHj.mjs → llm-request-activity-CfMuh5cC.mjs} +2 -2
- package/dist/{mistral-DSt4vQAO.mjs → mistral-DUveP4hF.mjs} +71 -146
- package/dist/{model-transport-url-C5f59L3Y.d.mts → model-transport-url-BrsjjdjR.d.mts} +5 -1
- package/dist/{number-coercion-V8-BhME4.mjs → number-coercion-C3hztWoY.mjs} +5 -4
- package/dist/{openai-chatgpt-responses-BC2x0Oqx.mjs → openai-chatgpt-responses-OCwckGhY.mjs} +173 -242
- package/dist/{openai-completions-DNyHnXKg.mjs → openai-completions-DOltBUe9.mjs} +7 -6
- package/dist/{openai-completions-compat-BYdYpXhU.d.mts → openai-completions-compat-i-nLZxFy.d.mts} +10 -11
- package/dist/{openai-completions-compat-BdmlhD4u.mjs → openai-completions-compat-pg1q4uNG.mjs} +10 -6
- package/dist/openai-completions-transport-OMrn7gnZ.mjs +3319 -0
- package/dist/{openai-prompt-cache-I8YQTzf8.mjs → openai-prompt-cache-Cr2xKVrS.mjs} +1 -1
- package/dist/{openai-prompt-cache-45-AH_xv.d.mts → openai-prompt-cache-DIPMrMFy.d.mts} +2 -2
- package/dist/{openai-responses-uZ5oWSp7.mjs → openai-responses-BSBJUA19.mjs} +9 -10
- package/dist/{openai-responses-compaction-replay-BClApUIf.d.mts → openai-responses-compaction-replay-B2FE4Nw8.d.mts} +4 -4
- package/dist/{openai-responses-contracts-Br5IIw_h.d.mts → openai-responses-contracts-DKqMJ1Ct.d.mts} +9 -4
- package/dist/{openai-responses-contracts-BKu8O7l4.mjs → openai-responses-contracts-DlKMMTxK.mjs} +26 -6
- package/dist/{openai-responses-compaction-window-m878aVpU.mjs → openai-responses-endpoint-CinGh4VZ.mjs} +14 -4
- package/dist/{openai-responses-prompt-observer-internal-CCg7B6l4.mjs → openai-responses-request-lifecycle-D2IFiI0-.mjs} +39 -4
- package/dist/{openai-responses-shared-C7oVyjED.mjs → openai-responses-shared-DVGhq5xF.mjs} +1036 -327
- package/dist/{openai-responses-terminal-usage-DgImcyJu.d.mts → openai-responses-terminal-usage-BygjiAdi.d.mts} +2 -2
- package/dist/{openai-tool-schema-DYNePiF8.mjs → openai-tool-schema-DDPXsvJP.mjs} +236 -399
- package/dist/{positive-integer-CwLi8LUL.mjs → positive-integer-CqWjqSi9.mjs} +1 -1
- package/dist/{provider-error-DQBE1bUQ.mjs → provider-error-CF9GWCs2.mjs} +5 -3
- package/dist/{provider-options-D5ABCV_l.d.mts → provider-options-CVrXZBtA.d.mts} +3 -2
- package/dist/{provider-transport-turn-state-_M2kLdUE.mjs → provider-transport-turn-state-LuCaTsSO.mjs} +2 -2
- package/dist/{provider-types-F8Mqc9Ma.d.mts → provider-types-CHtRx0dI.d.mts} +3 -3
- package/dist/provider-types.d.mts +6 -6
- package/dist/providers.d.mts +2 -2
- package/dist/providers.mjs +12 -12
- package/dist/{reasoning-tag-text-partitioner-Ju9VpUGl.mjs → reasoning-tag-text-partitioner-0-Rsezog.mjs} +13 -12
- package/dist/{required-api-key-D4kn3252.mjs → required-api-key-CFJvcFy_.mjs} +1 -1
- package/dist/{simple-options-BkKTXxhp.mjs → simple-options-BARFAzk9.mjs} +9 -11
- package/dist/{src-B0NIt2UK.mjs → src-C_wfIUmV.mjs} +35 -10
- package/dist/{stream-DSdzKsDK.mjs → stream-DwrETW0_.mjs} +12 -21
- package/dist/{stream-first-event-timeout-D9ZmL_s9.mjs → stream-first-event-timeout-Dc42hKv6.mjs} +8 -21
- package/dist/{streaming-byte-guard-CC-HMn_u.mjs → streaming-byte-guard-DBXr1XYn.mjs} +16 -1
- package/dist/{string-normalization-PN10hf6d.mjs → string-normalization-I3ux50s9.mjs} +1 -1
- package/dist/{text-signature-MLwfi6fq.mjs → text-signature-B_MB6U_9.mjs} +32 -5
- package/dist/{tool-schema-json-projection-Ct8SeBeJ.mjs → tool-schema-json-projection-B8sG1I9v.mjs} +29 -23
- package/dist/{transport-stream-shared-BcAKh2XH.d.mts → transport-stream-shared-BmpzDtdQ.d.mts} +4 -4
- package/dist/{transport-stream-shared-CxXXz_Dd.mjs → transport-stream-shared-DH08b7Il.mjs} +31 -20
- package/dist/transports.d.mts +33 -22
- package/dist/transports.mjs +73 -1234
- package/dist/{types-DvzmWW8J.d.mts → types-Bd2T86VJ.d.mts} +5 -23
- package/dist/types-Kdfw_04V.d.mts +1 -0
- package/dist/types.d.mts +6 -6
- package/dist/types.mjs +5 -4
- package/dist/{validation-B3lQt_VE.d.mts → validation-DdGB1yy3.d.mts} +1 -1
- package/dist/{validation-DbqlIfDn.mjs → validation-opC2pjk9.mjs} +2 -3
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/package.json +4 -4
- package/dist/event-stream-DqDQWqiy.d.mts +0 -1
- package/dist/google-1WLOtb8w.mjs +0 -54
- package/dist/google-vertex-0LrlRoO3.mjs +0 -88
- package/dist/openai-completions-transport-DWM2mQDB.mjs +0 -2081
- package/dist/openai-responses-request-lifecycle-Fsag-IGZ.mjs +0 -36
- package/dist/openai-transport-params-JFsnIyto.mjs +0 -735
- package/dist/openai-web-search-tools-Cfu0uLyN.mjs +0 -14
- package/dist/provider-replay-context-C7Bmi84a.mjs +0 -25
- package/dist/types-BuiEBM3u.d.mts +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as parseStrictPositiveInteger } from "./number-coercion-C3hztWoY.mjs";
|
|
2
2
|
//#region packages/ai/src/transports/positive-integer.ts
|
|
3
3
|
function parsePositiveInteger(value) {
|
|
4
4
|
if (typeof value === "number" && Number.isFinite(value) && value > 0) return Math.floor(value);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as asOptionalRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
2
|
import { o as normalizeStringifiedOptionalString } from "./string-coerce-CtgOVOSv.mjs";
|
|
3
|
-
import "./number-coercion-
|
|
3
|
+
import "./number-coercion-C3hztWoY.mjs";
|
|
4
4
|
import { t as expectDefined } from "./expect-lbe3Hgrh.mjs";
|
|
5
5
|
import { parseRetryAfterErrorSeconds, parseRetryAfterHeadersSeconds } from "./internal/retry-after.mjs";
|
|
6
6
|
import { n as estimateBase64DecodedBytes } from "./base64-C8CdcsjU.mjs";
|
|
@@ -281,7 +281,9 @@ function hasSensitiveProseContent(value) {
|
|
|
281
281
|
function normalizeDiagnosticFieldName(value) {
|
|
282
282
|
return value.toLowerCase().replaceAll(DIAGNOSTIC_FIELD_SEPARATOR_RE, "");
|
|
283
283
|
}
|
|
284
|
-
|
|
284
|
+
/** Classifies credential-bearing fields, including case-insensitive HTTP header names. */
|
|
285
|
+
function isCredentialFieldName(name) {
|
|
286
|
+
const normalized = normalizeDiagnosticFieldName(name);
|
|
285
287
|
if (!normalized || NON_CREDENTIAL_FIELD_NAMES.has(normalized)) return false;
|
|
286
288
|
return normalized === "authorization" || normalized === "proxyauthorization" || CREDENTIAL_FIELD_SUFFIX_RE.test(normalized);
|
|
287
289
|
}
|
|
@@ -529,4 +531,4 @@ function projectProviderError(error, signal) {
|
|
|
529
531
|
}
|
|
530
532
|
}
|
|
531
533
|
//#endregion
|
|
532
|
-
export {
|
|
534
|
+
export { projectDiagnosticValue as a, stableStringify as c, isCredentialFieldName as i, projectProviderError as n, redactDiagnosticText as o, createDiagnosticRecord as r, truncateUtf16Safe as s, configureProviderErrorRedactor as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { nt as StreamOptions } from "./types-
|
|
1
|
+
import { nt as StreamOptions } from "./types-Bd2T86VJ.mjs";
|
|
2
2
|
import { t as OpenAICompletionsToolChoice } from "./openai-tool-projection-793cE3QX.mjs";
|
|
3
|
-
import "./types-
|
|
3
|
+
import "./types-Kdfw_04V.mjs";
|
|
4
4
|
import Anthropic from "@anthropic-ai/sdk";
|
|
5
5
|
//#region packages/ai/src/providers/openai-reasoning-effort.d.ts
|
|
6
6
|
declare const ENABLED_REASONING_EFFORTS: readonly ["minimal", "low", "medium", "high", "xhigh", "max"];
|
|
@@ -143,6 +143,7 @@ type BaseOpenAIStreamOptions = StreamOptions & {
|
|
|
143
143
|
};
|
|
144
144
|
/** Superset retained under the provider's published compatibility type name. */
|
|
145
145
|
type OpenAICompletionsOptions = BaseOpenAIStreamOptions & {
|
|
146
|
+
streaming?: boolean;
|
|
146
147
|
toolChoice?: OpenAICompletionsToolChoice;
|
|
147
148
|
reasoning?: OpenAIReasoningEffort | "off";
|
|
148
149
|
reasoningEffort?: OpenAIReasoningEffort | "off";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as getAiTransportHost } from "./host-
|
|
1
|
+
import { r as getAiTransportHost } from "./host-JWXZWa-c.mjs";
|
|
2
2
|
import { n as resolveCloudflareBaseUrl, t as isCloudflareProvider } from "./cloudflare-5qSGvIUH.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { Pt as resolveOpenAIClientBaseUrl } from "./openai-responses-shared-DVGhq5xF.mjs";
|
|
4
4
|
import { n as resolveOpencodeSessionHeaders, t as hasOpencodeSessionHeader } from "./session-affinity-DA4WHv1h.mjs";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
import OpenAI from "openai";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as index_d_exports } from "./index-
|
|
2
|
-
import { a as AssistantMessage, d as Context, dt as ToolResultMessage, k as Model, mt as UserMessage, n as Api, nt as StreamOptions, p as ImageContent, rt as TextContent, s as AssistantMessageEventStreamContract } from "./types-
|
|
3
|
-
import "./types-
|
|
1
|
+
import { t as index_d_exports } from "./index-BYDvopUB.mjs";
|
|
2
|
+
import { a as AssistantMessage, d as Context, dt as ToolResultMessage, k as Model, mt as UserMessage, n as Api, nt as StreamOptions, p as ImageContent, rt as TextContent, s as AssistantMessageEventStreamContract } from "./types-Bd2T86VJ.mjs";
|
|
3
|
+
import "./types-Kdfw_04V.mjs";
|
|
4
4
|
//#region packages/ai/src/provider-types.d.ts
|
|
5
5
|
declare const PROVIDER_CONTEXT_HANDOFF: unique symbol;
|
|
6
6
|
type VideoContent = Omit<ImageContent, "type"> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { $ as StopReason, A as ModelCostConfig, At as extractDiagnosticError, B as ProviderImagesOptions, C as KnownApi, Ct as readRuntimeContextMetadata, D as MaybePromise, Dt as DiagnosticErrorInfo, E as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, Et as AssistantMessageDiagnostic, F as OpenRouterRouting, G as RUNTIME_CONTEXT_CUSTOM_TYPE, H as ProviderResponse, I as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, J as RUNTIME_CONTEXT_HEADER, K as RUNTIME_CONTEXT_END_MARKER, L as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, M as ModelThinkingLevel, Mt as isProviderRefusalAssistantError, N as OpenAICompletionsCompat, Ot as appendAssistantMessageDiagnostic, P as OpenAIResponsesCompat, Q as SimpleStreamOptions, R as PricingTier, S as ImagesStopReason, St as labelRuntimeContextText, T as KnownImagesProvider, Tt as setRuntimeContextRetention, V as ProviderReplayState, W as RUNTIME_CONTEXT_BEGIN_MARKER, X as RawPricingTier, Y as RawModelCostConfig, Z as RuntimeContextMessage, _ as ImagesInputContent, _t as escapeRuntimeContextFooter, a as AssistantMessage, at as ThinkingBudgets, b as ImagesOutputContent, bt as isRuntimeContextMessage, c as AssistantMessageEventStreamLike, ct as ThinkingLevelMap, dt as ToolResultMessage, et as StreamFn, f as DEFAULT_MISSING_TOOL_RESULT_TEXT, ft as Transport, g as ImagesFunction, gt as VercelGatewayRouting, h as ImagesContext, ht as ValidateToolArgumentsFn, i as AssistantImages, it as TextSignatureV1, j as ModelCostRates, jt as formatThrownValue, kt as createAssistantMessageDiagnostic, l as CacheRetention, lt as Tool, m as ImagesApi, mt as UserMessage, n as Api, nt as StreamOptions, o as AssistantMessageEvent, ot as ThinkingContent, p as ImageContent, pt as Usage, q as RUNTIME_CONTEXT_FOOTER, r as AssistantDeliveryTtsFacts, rt as TextContent, s as AssistantMessageEventStreamContract, st as ThinkingLevel, t as AnthropicMessagesCompat, u as CompleteSimpleFn, ut as ToolCall, v as ImagesModel, vt as hasLegacyRuntimeContextEnvelope, w as KnownImagesApi, wt as runtimeContextContentToText, x as ImagesProvider, xt as labelRuntimeContextContent, y as ImagesOptions, yt as hasRuntimeContextMarker, z as Provider } from "./types-
|
|
3
|
-
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
4
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
5
|
-
import { a as ProviderContextHandoff, c as ProviderStreamFunction, d as VideoContent, f as resolveProviderContext, i as ProviderContext, l as ProviderStreamOptions, n as ModelInputContent, o as ProviderMessage, r as PROVIDER_CONTEXT_HANDOFF, s as ProviderModel, t as MediaContent, u as ProviderUserMessage } from "./provider-types-
|
|
6
|
-
export { type AnthropicMessagesCompat, type Api, type AssistantDeliveryTtsFacts, type AssistantImages, type AssistantMessage, type AssistantMessageDiagnostic, type AssistantMessageEvent, type AssistantMessageEventStream, type AssistantMessageEventStreamContract, type AssistantMessageEventStreamLike, type CLAUDE_FABLE_5_THINKING_PROFILE, type CLAUDE_OPUS_55_THINKING_PROFILE, type CLAUDE_OPUS_5_THINKING_PROFILE, type CLAUDE_SONNET_55_THINKING_PROFILE, type CLAUDE_SONNET_5_THINKING_PROFILE, type CacheRetention, type CompleteSimpleFn, type ProviderContext as Context, ProviderContext, type DEFAULT_MISSING_TOOL_RESULT_TEXT, type DiagnosticErrorInfo, type EventStream, type ImageContent, type ImagesApi, type ImagesContext, type ImagesFunction, type ImagesInputContent, type ImagesModel, type ImagesOptions, type ImagesOutputContent, type ImagesProvider, type ImagesStopReason, type KnownApi, type KnownImagesApi, type KnownImagesProvider, type MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, type MaybePromise, MediaContent, type ProviderMessage as Message, ProviderMessage, type ProviderModel as Model, ProviderModel, type ModelCostConfig, type ModelCostRates, ModelInputContent, type ModelThinkingLevel, type OpenAICompletionsCompat, type OpenAIResponsesCompat, type OpenRouterRouting, PROVIDER_CONTEXT_HANDOFF, type PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, type PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, type PricingTier, type Provider, ProviderContextHandoff, type ProviderImagesOptions, type ProviderRefusalReview, type ProviderReplayState, type ProviderResponse, ProviderStreamFunction, type ProviderStreamFunction as StreamFunction, ProviderStreamOptions, ProviderUserMessage, type RUNTIME_CONTEXT_BEGIN_MARKER, type RUNTIME_CONTEXT_CUSTOM_TYPE, type RUNTIME_CONTEXT_END_MARKER, type RUNTIME_CONTEXT_FOOTER, type RUNTIME_CONTEXT_HEADER, type RawModelCostConfig, type RawPricingTier, type RuntimeContextMessage, type SimpleStreamOptions, type StopReason, type StreamFn, type StreamOptions, type TextContent, type TextSignatureV1, type ThinkingBudgets, type ThinkingContent, type ThinkingLevel, type ThinkingLevelMap, type Tool, type ToolCall, type ToolResultMessage, type Transport, type Usage, type UserMessage, type ValidateToolArgumentsFn, type VercelGatewayRouting, VideoContent, type appendAssistantMessageDiagnostic, type bindsClaudeThinkingPrefix, type calculateUsageCost, type createAssistantMessageDiagnostic, type createAssistantMessageEventStream, type escapeRuntimeContextFooter, type extractDiagnosticError, type formatThrownValue, type hasLegacyRuntimeContextEnvelope, type hasRuntimeContextMarker, type isProviderRefusalAssistantError, type isRuntimeContextMessage, type labelRuntimeContextContent, type labelRuntimeContextText, type normalizeModelCostConfig, type normalizeResolvedPricing, type readProviderRefusalReview, type readRuntimeContextMetadata, type requiresClaudeBetweenToolsThinking, type requiresClaudeDefaultSampling, type requiresClaudeMandatoryAdaptiveThinking, type resolveClaudeFable5ModelIdentity, type resolveClaudeModelIdentity, type resolveClaudeMythos5ModelIdentity, type resolveClaudeNativeThinkingLevelMap, type resolveClaudeOpus55ModelIdentity, type resolveClaudeOpus5ModelIdentity, type resolveClaudeSonnet55ModelIdentity, type resolveClaudeSonnet5ModelIdentity, resolveProviderContext, type runtimeContextContentToText, type setRuntimeContextRetention, type supportsClaude1MContext, type supportsClaudeAdaptiveThinking, type supportsClaudeFastMode, type supportsClaudeInHistorySystemMessages, type supportsClaudeNativeMaxEffort, type supportsClaudeNativeXhighEffort, type validateToolArguments, type validateToolCall };
|
|
1
|
+
import { A as supportsClaudeInHistorySystemMessages, C as resolveClaudeOpus55ModelIdentity, D as supportsClaude1MContext, E as resolveClaudeSonnet5ModelIdentity, M as supportsClaudeNativeXhighEffort, O as supportsClaudeAdaptiveThinking, S as resolveClaudeNativeThinkingLevelMap, T as resolveClaudeSonnet55ModelIdentity, _ as requiresClaudeMandatoryAdaptiveThinking, a as normalizeResolvedPricing, b as resolveClaudeModelIdentity, c as CLAUDE_FABLE_5_THINKING_PROFILE, d as CLAUDE_OPUS_5_THINKING_PROFILE, f as CLAUDE_SONNET_55_THINKING_PROFILE, g as requiresClaudeDefaultSampling, h as requiresClaudeBetweenToolsThinking, i as normalizeModelCostConfig, j as supportsClaudeNativeMaxEffort, k as supportsClaudeFastMode, l as CLAUDE_HAIKU_55_THINKING_PROFILE, m as bindsClaudeThinkingPrefix, n as appendTextDeltaToAssistantMessage, o as ProviderRefusalReview, p as CLAUDE_SONNET_5_THINKING_PROFILE, r as calculateUsageCost, s as readProviderRefusalReview, u as CLAUDE_OPUS_55_THINKING_PROFILE, v as resolveClaudeFable5ModelIdentity, w as resolveClaudeOpus5ModelIdentity, x as resolveClaudeMythos5ModelIdentity, y as resolveClaudeHaiku55ModelIdentity } from "./index-BYDvopUB.mjs";
|
|
2
|
+
import { $ as StopReason, A as ModelCostConfig, At as extractDiagnosticError, B as ProviderImagesOptions, C as KnownApi, Ct as readRuntimeContextMetadata, D as MaybePromise, Dt as DiagnosticErrorInfo, E as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, Et as AssistantMessageDiagnostic, F as OpenRouterRouting, G as RUNTIME_CONTEXT_CUSTOM_TYPE, H as ProviderResponse, I as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, J as RUNTIME_CONTEXT_HEADER, K as RUNTIME_CONTEXT_END_MARKER, L as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, M as ModelThinkingLevel, Mt as isProviderRefusalAssistantError, N as OpenAICompletionsCompat, Ot as appendAssistantMessageDiagnostic, P as OpenAIResponsesCompat, Q as SimpleStreamOptions, R as PricingTier, S as ImagesStopReason, St as labelRuntimeContextText, T as KnownImagesProvider, Tt as setRuntimeContextRetention, V as ProviderReplayState, W as RUNTIME_CONTEXT_BEGIN_MARKER, X as RawPricingTier, Y as RawModelCostConfig, Z as RuntimeContextMessage, _ as ImagesInputContent, _t as escapeRuntimeContextFooter, a as AssistantMessage, at as ThinkingBudgets, b as ImagesOutputContent, bt as isRuntimeContextMessage, c as AssistantMessageEventStreamLike, ct as ThinkingLevelMap, dt as ToolResultMessage, et as StreamFn, f as DEFAULT_MISSING_TOOL_RESULT_TEXT, ft as Transport, g as ImagesFunction, gt as VercelGatewayRouting, h as ImagesContext, ht as ValidateToolArgumentsFn, i as AssistantImages, it as TextSignatureV1, j as ModelCostRates, jt as formatThrownValue, kt as createAssistantMessageDiagnostic, l as CacheRetention, lt as Tool, m as ImagesApi, mt as UserMessage, n as Api, nt as StreamOptions, o as AssistantMessageEvent, ot as ThinkingContent, p as ImageContent, pt as Usage, q as RUNTIME_CONTEXT_FOOTER, r as AssistantDeliveryTtsFacts, rt as TextContent, s as AssistantMessageEventStreamContract, st as ThinkingLevel, t as AnthropicMessagesCompat, u as CompleteSimpleFn, ut as ToolCall, v as ImagesModel, vt as hasLegacyRuntimeContextEnvelope, w as KnownImagesApi, wt as runtimeContextContentToText, x as ImagesProvider, xt as labelRuntimeContextContent, y as ImagesOptions, yt as hasRuntimeContextMarker, z as Provider } from "./types-Bd2T86VJ.mjs";
|
|
3
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-BcqWLo_u.mjs";
|
|
4
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-DdGB1yy3.mjs";
|
|
5
|
+
import { a as ProviderContextHandoff, c as ProviderStreamFunction, d as VideoContent, f as resolveProviderContext, i as ProviderContext, l as ProviderStreamOptions, n as ModelInputContent, o as ProviderMessage, r as PROVIDER_CONTEXT_HANDOFF, s as ProviderModel, t as MediaContent, u as ProviderUserMessage } from "./provider-types-CHtRx0dI.mjs";
|
|
6
|
+
export { type AnthropicMessagesCompat, type Api, type AssistantDeliveryTtsFacts, type AssistantImages, type AssistantMessage, type AssistantMessageDiagnostic, type AssistantMessageEvent, type AssistantMessageEventStream, type AssistantMessageEventStreamContract, type AssistantMessageEventStreamLike, type CLAUDE_FABLE_5_THINKING_PROFILE, type CLAUDE_HAIKU_55_THINKING_PROFILE, type CLAUDE_OPUS_55_THINKING_PROFILE, type CLAUDE_OPUS_5_THINKING_PROFILE, type CLAUDE_SONNET_55_THINKING_PROFILE, type CLAUDE_SONNET_5_THINKING_PROFILE, type CacheRetention, type CompleteSimpleFn, type ProviderContext as Context, ProviderContext, type DEFAULT_MISSING_TOOL_RESULT_TEXT, type DiagnosticErrorInfo, type EventStream, type ImageContent, type ImagesApi, type ImagesContext, type ImagesFunction, type ImagesInputContent, type ImagesModel, type ImagesOptions, type ImagesOutputContent, type ImagesProvider, type ImagesStopReason, type KnownApi, type KnownImagesApi, type KnownImagesProvider, type MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, type MaybePromise, MediaContent, type ProviderMessage as Message, ProviderMessage, type ProviderModel as Model, ProviderModel, type ModelCostConfig, type ModelCostRates, ModelInputContent, type ModelThinkingLevel, type OpenAICompletionsCompat, type OpenAIResponsesCompat, type OpenRouterRouting, PROVIDER_CONTEXT_HANDOFF, type PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, type PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, type PricingTier, type Provider, ProviderContextHandoff, type ProviderImagesOptions, type ProviderRefusalReview, type ProviderReplayState, type ProviderResponse, ProviderStreamFunction, type ProviderStreamFunction as StreamFunction, ProviderStreamOptions, ProviderUserMessage, type RUNTIME_CONTEXT_BEGIN_MARKER, type RUNTIME_CONTEXT_CUSTOM_TYPE, type RUNTIME_CONTEXT_END_MARKER, type RUNTIME_CONTEXT_FOOTER, type RUNTIME_CONTEXT_HEADER, type RawModelCostConfig, type RawPricingTier, type RuntimeContextMessage, type SimpleStreamOptions, type StopReason, type StreamFn, type StreamOptions, type TextContent, type TextSignatureV1, type ThinkingBudgets, type ThinkingContent, type ThinkingLevel, type ThinkingLevelMap, type Tool, type ToolCall, type ToolResultMessage, type Transport, type Usage, type UserMessage, type ValidateToolArgumentsFn, type VercelGatewayRouting, VideoContent, type appendAssistantMessageDiagnostic, type appendTextDeltaToAssistantMessage, type bindsClaudeThinkingPrefix, type calculateUsageCost, type createAssistantMessageDiagnostic, type createAssistantMessageEventStream, type escapeRuntimeContextFooter, type extractDiagnosticError, type formatThrownValue, type hasLegacyRuntimeContextEnvelope, type hasRuntimeContextMarker, type isProviderRefusalAssistantError, type isRuntimeContextMessage, type labelRuntimeContextContent, type labelRuntimeContextText, type normalizeModelCostConfig, type normalizeResolvedPricing, type readProviderRefusalReview, type readRuntimeContextMetadata, type requiresClaudeBetweenToolsThinking, type requiresClaudeDefaultSampling, type requiresClaudeMandatoryAdaptiveThinking, type resolveClaudeFable5ModelIdentity, type resolveClaudeHaiku55ModelIdentity, type resolveClaudeModelIdentity, type resolveClaudeMythos5ModelIdentity, type resolveClaudeNativeThinkingLevelMap, type resolveClaudeOpus55ModelIdentity, type resolveClaudeOpus5ModelIdentity, type resolveClaudeSonnet55ModelIdentity, type resolveClaudeSonnet5ModelIdentity, resolveProviderContext, type runtimeContextContentToText, type setRuntimeContextRetention, type supportsClaude1MContext, type supportsClaudeAdaptiveThinking, type supportsClaudeFastMode, type supportsClaudeInHistorySystemMessages, type supportsClaudeNativeMaxEffort, type supportsClaudeNativeXhighEffort, type validateToolArguments, type validateToolCall };
|
package/dist/providers.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ApiRegistry } from "./api-registry-
|
|
2
|
-
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-
|
|
1
|
+
import { n as ApiRegistry } from "./api-registry-BhXXYdRA.mjs";
|
|
2
|
+
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-DIPMrMFy.mjs";
|
|
3
3
|
//#region packages/ai/src/providers/register-builtins.d.ts
|
|
4
4
|
/** Source id used for built-in API provider registrations. */
|
|
5
5
|
export declare const BUILT_IN_API_PROVIDER_SOURCE_ID = "core:built-in";
|
package/dist/providers.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as AssistantMessageEventStream } from "./event-stream-
|
|
2
|
-
import { n as projectProviderError } from "./provider-error-
|
|
3
|
-
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-
|
|
1
|
+
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
2
|
+
import { n as projectProviderError } from "./provider-error-CF9GWCs2.mjs";
|
|
3
|
+
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-Cr2xKVrS.mjs";
|
|
4
4
|
import { t as createZeroUsage } from "./usage-CJH5D6Ea.mjs";
|
|
5
5
|
//#region packages/ai/src/providers/register-builtins.ts
|
|
6
6
|
/** Source id used for built-in API provider registrations. */
|
|
@@ -50,39 +50,39 @@ function createLazyRegistration(api, importModule, select) {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
const registerBuiltIns = [
|
|
53
|
-
createLazyRegistration("anthropic-messages", () => import("./anthropic-
|
|
53
|
+
createLazyRegistration("anthropic-messages", () => import("./anthropic-BAHKgWam.mjs").then((n) => n.t), (module) => ({
|
|
54
54
|
stream: module.streamAnthropic,
|
|
55
55
|
streamSimple: module.streamSimpleAnthropic
|
|
56
56
|
})),
|
|
57
|
-
createLazyRegistration("openai-completions", () => import("./openai-completions-
|
|
57
|
+
createLazyRegistration("openai-completions", () => import("./openai-completions-DOltBUe9.mjs").then((n) => n.t), (module) => ({
|
|
58
58
|
stream: module.streamOpenAICompletions,
|
|
59
59
|
streamSimple: module.streamSimpleOpenAICompletions
|
|
60
60
|
})),
|
|
61
|
-
createLazyRegistration("mistral-conversations", () => import("./mistral-
|
|
61
|
+
createLazyRegistration("mistral-conversations", () => import("./mistral-DUveP4hF.mjs"), (module) => ({
|
|
62
62
|
stream: module.streamMistral,
|
|
63
63
|
streamSimple: module.streamSimpleMistral
|
|
64
64
|
})),
|
|
65
|
-
createLazyRegistration("openai-responses", () => import("./openai-responses-
|
|
65
|
+
createLazyRegistration("openai-responses", () => import("./openai-responses-BSBJUA19.mjs").then((n) => n.t), (module) => ({
|
|
66
66
|
stream: module.streamOpenAIResponses,
|
|
67
67
|
streamSimple: module.streamSimpleOpenAIResponses
|
|
68
68
|
})),
|
|
69
|
-
createLazyRegistration("azure-openai-responses", () => import("./azure-openai-responses-
|
|
69
|
+
createLazyRegistration("azure-openai-responses", () => import("./azure-openai-responses-C7qBuR23.mjs"), (module) => ({
|
|
70
70
|
stream: module.streamAzureOpenAIResponses,
|
|
71
71
|
streamSimple: module.streamSimpleAzureOpenAIResponses
|
|
72
72
|
})),
|
|
73
|
-
createLazyRegistration("openai-chatgpt-responses", () => import("./openai-chatgpt-responses-
|
|
73
|
+
createLazyRegistration("openai-chatgpt-responses", () => import("./openai-chatgpt-responses-OCwckGhY.mjs"), (module) => ({
|
|
74
74
|
stream: module.streamOpenAICodexResponses,
|
|
75
75
|
streamSimple: module.streamSimpleOpenAICodexResponses
|
|
76
76
|
})),
|
|
77
|
-
createLazyRegistration("google-generative-ai", () => import("./google-
|
|
77
|
+
createLazyRegistration("google-generative-ai", () => import("./google-Boz2QcpK.mjs"), (module) => ({
|
|
78
78
|
stream: module.streamGoogle,
|
|
79
79
|
streamSimple: module.streamSimpleGoogle
|
|
80
80
|
})),
|
|
81
|
-
createLazyRegistration("google-interactions", () => import("./google-interactions-
|
|
81
|
+
createLazyRegistration("google-interactions", () => import("./google-interactions-tjAb1mc5.mjs"), (module) => ({
|
|
82
82
|
stream: module.streamGoogleInteractions,
|
|
83
83
|
streamSimple: module.streamSimpleGoogleInteractions
|
|
84
84
|
})),
|
|
85
|
-
createLazyRegistration("google-vertex", () => import("./google-vertex-
|
|
85
|
+
createLazyRegistration("google-vertex", () => import("./google-vertex-hCxTJea7.mjs"), (module) => ({
|
|
86
86
|
stream: module.streamGoogleVertex,
|
|
87
87
|
streamSimple: module.streamSimpleGoogleVertex
|
|
88
88
|
}))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
|
-
import "./provider-error-
|
|
2
|
+
import "./provider-error-CF9GWCs2.mjs";
|
|
3
3
|
import { t as expectDefined } from "./expect-lbe3Hgrh.mjs";
|
|
4
4
|
//#region node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.js
|
|
5
5
|
/**
|
|
@@ -12002,7 +12002,7 @@ function reduceReasoningText(text, codeSpans, state, options) {
|
|
|
12002
12002
|
if (options.final && state.depth > 0 && state.pending) {
|
|
12003
12003
|
const pending = state.pending;
|
|
12004
12004
|
if (!pending.containsPrivate) {
|
|
12005
|
-
if (options.mode === "static-preserve" || options.mode === "static-strict" && !pending.visibleBefore && !pending.protectedClose || options.mode === "visible" && !pending.protectedClose) emit("text", options.mode === "visible" && pending.visibleBefore ? pending.openTag + pending.content : pending.content);
|
|
12005
|
+
if ((options.mode === "static-preserve" || options.mode === "static-strict" && !pending.visibleBefore && !pending.protectedClose || options.mode === "visible" && !pending.protectedClose) && options.recoverUnclosed !== false) emit("text", options.mode === "visible" && pending.visibleBefore ? pending.openTag + pending.content : pending.content);
|
|
12006
12006
|
else emit("thinking", pending.content);
|
|
12007
12007
|
}
|
|
12008
12008
|
state.depth = 0;
|
|
@@ -12181,7 +12181,7 @@ function createReasoningTagTextPartitioner() {
|
|
|
12181
12181
|
reduceSafePrefix(special, safeLimit, limit, output);
|
|
12182
12182
|
}
|
|
12183
12183
|
};
|
|
12184
|
-
const processBlock = (end, final, output, parsedCodeSpans, parsedRetainStart) => {
|
|
12184
|
+
const processBlock = (end, final, output, parsedCodeSpans, parsedRetainStart, recoverUnclosed = true) => {
|
|
12185
12185
|
const previousBlockStart = blockStart;
|
|
12186
12186
|
let blockCodeSpans = parsedCodeSpans;
|
|
12187
12187
|
let blockRetainStart = parsedRetainStart;
|
|
@@ -12189,30 +12189,31 @@ function createReasoningTagTextPartitioner() {
|
|
|
12189
12189
|
if (!final || reduction.depth === 0) return;
|
|
12190
12190
|
merge(output, reduceReasoningText("", [], reduction, {
|
|
12191
12191
|
final: true,
|
|
12192
|
+
recoverUnclosed,
|
|
12192
12193
|
mode: strictMode ? "hide" : "visible",
|
|
12193
12194
|
scope: "all"
|
|
12194
12195
|
}));
|
|
12195
12196
|
};
|
|
12196
12197
|
if (end <= blockStart) {
|
|
12197
12198
|
finalizePending();
|
|
12198
|
-
return
|
|
12199
|
+
return;
|
|
12199
12200
|
}
|
|
12200
12201
|
if (end <= emitted) {
|
|
12201
12202
|
finalizePending();
|
|
12202
12203
|
blockStart = end;
|
|
12203
12204
|
fastPathCheckedThrough = Math.max(fastPathCheckedThrough, end);
|
|
12204
|
-
return
|
|
12205
|
+
return;
|
|
12205
12206
|
}
|
|
12206
12207
|
emitSafePrefix(end, output);
|
|
12207
12208
|
if (holdStart !== void 0 && holdStart < end) {
|
|
12208
12209
|
const held = source.slice(holdStart, end);
|
|
12209
12210
|
if (!final) {
|
|
12210
|
-
if (pendingTagProbe && !pendingTagProbe.resolved) return
|
|
12211
|
+
if (pendingTagProbe && !pendingTagProbe.resolved) return;
|
|
12211
12212
|
pendingTagProbe = void 0;
|
|
12212
12213
|
const pendingStart = scanReasoningTags(held, false).pendingStart;
|
|
12213
12214
|
if (pendingStart !== void 0) {
|
|
12214
12215
|
startPendingTagProbe(holdStart + pendingStart, end);
|
|
12215
|
-
return
|
|
12216
|
+
return;
|
|
12216
12217
|
}
|
|
12217
12218
|
}
|
|
12218
12219
|
const block = source.slice(0, end);
|
|
@@ -12224,6 +12225,7 @@ function createReasoningTagTextPartitioner() {
|
|
|
12224
12225
|
}
|
|
12225
12226
|
merge(output, reduceReasoningText(block, blockCodeSpans, reduction, {
|
|
12226
12227
|
final,
|
|
12228
|
+
recoverUnclosed,
|
|
12227
12229
|
mode: strictMode ? "hide" : "visible",
|
|
12228
12230
|
scope: "all",
|
|
12229
12231
|
start
|
|
@@ -12250,9 +12252,8 @@ function createReasoningTagTextPartitioner() {
|
|
|
12250
12252
|
fastPathCheckedThrough = end;
|
|
12251
12253
|
fastPathCodeSafe = !final && !crossedLineBoundary && emitted === source.length && !blockCodeSpans?.some(([, spanEnd]) => spanEnd === source.length);
|
|
12252
12254
|
if (!final && reduction.depth === 0 && emitted === source.length && endedBlankBlock && !MARKDOWN_CONTAINER_LINE_RE.test(source.slice(blockRetainStart ?? 0)) && !blockCodeSpans?.some(([, spanEnd]) => spanEnd === source.length)) compactCommittedSource(blockRetainStart ?? 0);
|
|
12253
|
-
return true;
|
|
12254
12255
|
};
|
|
12255
|
-
const consume = (appended, strict, final) => {
|
|
12256
|
+
const consume = (appended, strict, final, recoverUnclosed = true) => {
|
|
12256
12257
|
strictMode ||= strict;
|
|
12257
12258
|
const previousEndedBlankBlock = endedBlankBlock;
|
|
12258
12259
|
source += appended;
|
|
@@ -12274,7 +12275,7 @@ function createReasoningTagTextPartitioner() {
|
|
|
12274
12275
|
heldBacktickStart = void 0;
|
|
12275
12276
|
}
|
|
12276
12277
|
const output = [];
|
|
12277
|
-
if (final) processBlock(source.length, true, output);
|
|
12278
|
+
if (final) processBlock(source.length, true, output, void 0, void 0, recoverUnclosed);
|
|
12278
12279
|
else {
|
|
12279
12280
|
emitSafePrefix(source.length, output, appended);
|
|
12280
12281
|
if (!strictMode && holdStart !== void 0 && holdStart < source.length) {
|
|
@@ -12353,8 +12354,8 @@ function createReasoningTagTextPartitioner() {
|
|
|
12353
12354
|
pushVisible(chunk) {
|
|
12354
12355
|
return consume(chunk, false, false);
|
|
12355
12356
|
},
|
|
12356
|
-
flush() {
|
|
12357
|
-
return consume("", strictMode, true);
|
|
12357
|
+
flush(options) {
|
|
12358
|
+
return consume("", strictMode, true, options?.recoverUnclosed);
|
|
12358
12359
|
},
|
|
12359
12360
|
hasPending() {
|
|
12360
12361
|
return holdStart !== void 0 && holdStart < source.length || reduction.depth > 0 || emitted < source.length;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as getEnvApiKey } from "./env-api-keys-
|
|
1
|
+
import { n as getEnvApiKey } from "./env-api-keys-CrxwdylR.mjs";
|
|
2
2
|
//#region packages/ai/src/utils/required-api-key.ts
|
|
3
3
|
function requireApiKey(provider, apiKey) {
|
|
4
4
|
const resolved = apiKey || getEnvApiKey(provider);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
2
|
import { n as normalizeLowercaseStringOrEmpty } from "./string-coerce-CtgOVOSv.mjs";
|
|
3
|
-
import { M as hasMediaPayload, r as getAiTransportHost } from "./host-
|
|
4
|
-
import { g as responsesServiceTierObserver } from "./openai-responses-contracts-
|
|
5
|
-
import {
|
|
6
|
-
import { P as sanitizeSurrogates, i as copyProviderAcceptanceObserver } from "./transport-stream-shared-
|
|
3
|
+
import { M as hasMediaPayload, r as getAiTransportHost } from "./host-JWXZWa-c.mjs";
|
|
4
|
+
import { g as responsesServiceTierObserver } from "./openai-responses-contracts-DlKMMTxK.mjs";
|
|
5
|
+
import { s as truncateUtf16Safe } from "./provider-error-CF9GWCs2.mjs";
|
|
6
|
+
import { P as sanitizeSurrogates, i as copyProviderAcceptanceObserver } from "./transport-stream-shared-DH08b7Il.mjs";
|
|
7
7
|
//#region packages/ai/src/utils/prompt-cache-stability.ts
|
|
8
8
|
/**
|
|
9
9
|
* Prompt-cache normalization helpers. They keep generated prompt sections
|
|
@@ -114,10 +114,6 @@ function isBinaryMimeType(mimeType) {
|
|
|
114
114
|
const normalized = mimeType.split(";", 1)[0]?.trim().toLowerCase();
|
|
115
115
|
return normalized ? !TEXTUAL_MIME_PATTERN.test(normalized) : false;
|
|
116
116
|
}
|
|
117
|
-
function describeOmittedValue(value, label) {
|
|
118
|
-
const length = typeof value === "string" ? value.length : JSON.stringify(value)?.length;
|
|
119
|
-
return length ? `[${label} omitted: ${length} chars]` : `[${label} omitted]`;
|
|
120
|
-
}
|
|
121
117
|
function redactInlineDataUris(value) {
|
|
122
118
|
return value.replace(INLINE_DATA_URI_PATTERN, (_match, prefix, uri) => `${prefix}[inline data URI: ${uri.length} chars]`);
|
|
123
119
|
}
|
|
@@ -130,7 +126,10 @@ function stringifyStructuredBlock(block) {
|
|
|
130
126
|
if (OPAQUE_OR_BINARY_FIELD_RE.test(key)) return `[omitted ${key}]`;
|
|
131
127
|
if (key === "data") {
|
|
132
128
|
const mimeType = readMimeType(this);
|
|
133
|
-
if (mimeType && isBinaryMimeType(mimeType))
|
|
129
|
+
if (mimeType && isBinaryMimeType(mimeType)) {
|
|
130
|
+
const length = typeof value === "string" ? value.length : JSON.stringify(value)?.length;
|
|
131
|
+
return length ? `[binary data omitted: ${length} chars]` : "[binary data omitted]";
|
|
132
|
+
}
|
|
134
133
|
}
|
|
135
134
|
if (typeof value === "bigint") return value.toString();
|
|
136
135
|
if (typeof value === "string") return redactInlineDataUris(host.redactModelVisibleSecrets(value));
|
|
@@ -257,8 +256,7 @@ const reasoningTagTextPolicy = {
|
|
|
257
256
|
const REQUEST_BODY = Symbol("modelRequestBody");
|
|
258
257
|
/** Call-local state survives option spreads; no payload is cached across requests. */
|
|
259
258
|
function modelRequestBodyState(options, inheritFrom) {
|
|
260
|
-
|
|
261
|
-
if (!state) state = {};
|
|
259
|
+
const state = Reflect.get(options, REQUEST_BODY) ?? (inheritFrom && Reflect.get(inheritFrom, REQUEST_BODY)) ?? {};
|
|
262
260
|
Reflect.set(options, REQUEST_BODY, state);
|
|
263
261
|
return state;
|
|
264
262
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import "./diagnostics-DzrF1h4J.mjs";
|
|
2
|
-
import "./validation-
|
|
2
|
+
import "./validation-opC2pjk9.mjs";
|
|
3
3
|
//#region packages/llm-core/src/model-contracts/anthropic.ts
|
|
4
|
+
function readListedClaudeCapability(ref, capability) {
|
|
5
|
+
const listed = ref.params?.claudeCapabilities;
|
|
6
|
+
if (typeof listed !== "object" || listed === null) return;
|
|
7
|
+
const value = Reflect.get(listed, capability);
|
|
8
|
+
return typeof value === "boolean" ? value : void 0;
|
|
9
|
+
}
|
|
4
10
|
function normalizeClaudeModelId(modelId) {
|
|
5
11
|
const normalized = modelId?.trim().toLowerCase() ?? "";
|
|
6
12
|
return (normalized.startsWith("anthropic/") ? normalized.slice(10) : normalized).replace(/[._\s]+/g, "-");
|
|
@@ -42,6 +48,16 @@ const CLAUDE_SONNET_55_THINKING_PROFILE = {
|
|
|
42
48
|
],
|
|
43
49
|
defaultLevel: "high"
|
|
44
50
|
};
|
|
51
|
+
const CLAUDE_HAIKU_55_THINKING_PROFILE = {
|
|
52
|
+
...CLAUDE_SONNET_55_THINKING_PROFILE,
|
|
53
|
+
defaultLevel: "medium"
|
|
54
|
+
};
|
|
55
|
+
/** Resolve Haiku 5.5 through direct ids, cloud ids, aliases, or deployment metadata. */
|
|
56
|
+
function resolveClaudeHaiku55ModelIdentity(ref) {
|
|
57
|
+
const normalized = resolveClaudeModelIdentity(ref);
|
|
58
|
+
if (normalized === "haiku" || normalized === "haiku-5-5") return "claude-haiku-5-5";
|
|
59
|
+
return /^claude-haiku-5-5(?=$|[^a-z0-9])/.test(normalized) ? normalized : void 0;
|
|
60
|
+
}
|
|
45
61
|
/** Resolve the canonical normalized Claude model id for one runtime model ref. */
|
|
46
62
|
function resolveClaudeModelIdentity(ref) {
|
|
47
63
|
const normalized = normalizeClaudeModelId((typeof ref.params?.canonicalModelId === "string" ? ref.params.canonicalModelId : void 0) ?? ref.id);
|
|
@@ -60,18 +76,20 @@ function resolveClaudeMythos5ModelIdentity(ref) {
|
|
|
60
76
|
return matchClaudeModelIdentity(resolveClaudeModelIdentity(ref), /(?:^|-)claude-mythos-5(?=$|[^a-z0-9])/);
|
|
61
77
|
}
|
|
62
78
|
/**
|
|
63
|
-
* Opus 5.5, Sonnet 5.5, and Fable 5.1 require append-only runtime context.
|
|
79
|
+
* Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.1 require append-only runtime context.
|
|
64
80
|
* Extend only with live replay proof (Mythos 5.1 remains unproven).
|
|
65
81
|
*/
|
|
66
82
|
function bindsClaudeThinkingPrefix(ref) {
|
|
67
|
-
return resolveClaudeOpus55ModelIdentity(ref) !== void 0 || resolveClaudeSonnet55ModelIdentity(ref) !== void 0 || /^claude-fable-5-1(?=$|[^a-z0-9])/.test(resolveClaudeModelIdentity(ref));
|
|
83
|
+
return resolveClaudeHaiku55ModelIdentity(ref) !== void 0 || resolveClaudeOpus55ModelIdentity(ref) !== void 0 || resolveClaudeSonnet55ModelIdentity(ref) !== void 0 || /^claude-fable-5-1(?=$|[^a-z0-9])/.test(resolveClaudeModelIdentity(ref));
|
|
68
84
|
}
|
|
69
85
|
/** Return whether Claude accepts operator instructions within conversation history. */
|
|
70
86
|
function supportsClaudeInHistorySystemMessages(ref) {
|
|
71
|
-
return resolveClaudeOpus5ModelIdentity(ref) !== void 0 || resolveClaudeSonnet5ModelIdentity(ref) !== void 0 || resolveClaudeFable5ModelIdentity(ref) !== void 0 || resolveClaudeMythos5ModelIdentity(ref) !== void 0 || /^claude-opus-4-8(?=$|[^a-z0-9])/.test(resolveClaudeModelIdentity(ref));
|
|
87
|
+
return resolveClaudeHaiku55ModelIdentity(ref) !== void 0 || resolveClaudeOpus5ModelIdentity(ref) !== void 0 || resolveClaudeSonnet5ModelIdentity(ref) !== void 0 || resolveClaudeFable5ModelIdentity(ref) !== void 0 || resolveClaudeMythos5ModelIdentity(ref) !== void 0 || /^claude-opus-4-8(?=$|[^a-z0-9])/.test(resolveClaudeModelIdentity(ref));
|
|
72
88
|
}
|
|
73
89
|
/** Return whether a Claude model requires adaptive thinking instead of manual budgets. */
|
|
74
90
|
function requiresClaudeMandatoryAdaptiveThinking(ref) {
|
|
91
|
+
const disabledThinking = readListedClaudeCapability(ref, "disabledThinking");
|
|
92
|
+
if (disabledThinking !== void 0) return !disabledThinking && !requiresClaudeBetweenToolsThinking(ref) && supportsClaudeAdaptiveThinking(ref);
|
|
75
93
|
const modelId = resolveClaudeModelIdentity(ref);
|
|
76
94
|
return resolveClaudeOpus55ModelIdentity(ref) !== void 0 || resolveClaudeFable5ModelIdentity(ref) !== void 0 || resolveClaudeMythos5ModelIdentity(ref) !== void 0 || /(?:^|-)claude-mythos-preview(?=$|[^a-z0-9])/.test(modelId);
|
|
77
95
|
}
|
|
@@ -107,14 +125,17 @@ function resolveClaudeOpus55ModelIdentity(ref) {
|
|
|
107
125
|
if (normalized === "opus" || normalized === "opus-5-5") return "claude-opus-5-5";
|
|
108
126
|
return /^claude-opus-5-5(?=$|[^a-z0-9])/.test(normalized) ? normalized : void 0;
|
|
109
127
|
}
|
|
128
|
+
function supportsClaudeAdaptiveThinkingById(ref) {
|
|
129
|
+
const modelId = resolveClaudeModelIdentity(ref);
|
|
130
|
+
return resolveClaudeHaiku55ModelIdentity(ref) !== void 0 || resolveClaudeOpus5ModelIdentity(ref) !== void 0 || resolveClaudeSonnet5ModelIdentity(ref) !== void 0 || /(?:^|-)claude-(?:fable-5|mythos-(?:5|preview)|opus-4-(?:6|7|8)|sonnet-4-6)(?=$|[^a-z0-9])/.test(modelId);
|
|
131
|
+
}
|
|
110
132
|
/** Return whether a Claude model supports adaptive thinking. */
|
|
111
133
|
function supportsClaudeAdaptiveThinking(ref) {
|
|
112
|
-
|
|
113
|
-
return resolveClaudeOpus5ModelIdentity(ref) !== void 0 || resolveClaudeSonnet5ModelIdentity(ref) !== void 0 || /(?:^|-)claude-(?:fable-5|mythos-(?:5|preview)|opus-4-(?:6|7|8)|sonnet-4-6)(?=$|[^a-z0-9])/.test(modelId);
|
|
134
|
+
return readListedClaudeCapability(ref, "adaptiveThinking") ?? supportsClaudeAdaptiveThinkingById(ref);
|
|
114
135
|
}
|
|
115
136
|
/** Return whether a Claude model has a native 1M-token context window. */
|
|
116
137
|
function supportsClaude1MContext(ref) {
|
|
117
|
-
return
|
|
138
|
+
return supportsClaudeAdaptiveThinkingById(ref);
|
|
118
139
|
}
|
|
119
140
|
/** Return whether a Claude model supports Anthropic's native fast mode. */
|
|
120
141
|
function supportsClaudeFastMode(ref) {
|
|
@@ -123,13 +144,17 @@ function supportsClaudeFastMode(ref) {
|
|
|
123
144
|
}
|
|
124
145
|
/** Return whether a Claude model supports native max effort. */
|
|
125
146
|
function supportsClaudeNativeMaxEffort(ref) {
|
|
147
|
+
const listed = readListedClaudeCapability(ref, "maxEffort");
|
|
148
|
+
if (listed !== void 0) return listed;
|
|
126
149
|
const modelId = resolveClaudeModelIdentity(ref);
|
|
127
|
-
return resolveClaudeOpus5ModelIdentity(ref) !== void 0 || resolveClaudeSonnet5ModelIdentity(ref) !== void 0 || /(?:^|-)claude-(?:fable-5|mythos-5|opus-4-(?:6|7|8)|sonnet-4-6)(?=$|[^a-z0-9])/.test(modelId);
|
|
150
|
+
return resolveClaudeHaiku55ModelIdentity(ref) !== void 0 || resolveClaudeOpus5ModelIdentity(ref) !== void 0 || resolveClaudeSonnet5ModelIdentity(ref) !== void 0 || /(?:^|-)claude-(?:fable-5|mythos-5|opus-4-(?:6|7|8)|sonnet-4-6)(?=$|[^a-z0-9])/.test(modelId);
|
|
128
151
|
}
|
|
129
152
|
/** Return whether a Claude model supports native xhigh effort. */
|
|
130
153
|
function supportsClaudeNativeXhighEffort(ref) {
|
|
154
|
+
const listed = readListedClaudeCapability(ref, "xhighEffort");
|
|
155
|
+
if (listed !== void 0) return listed;
|
|
131
156
|
const modelId = resolveClaudeModelIdentity(ref);
|
|
132
|
-
return resolveClaudeOpus5ModelIdentity(ref) !== void 0 || resolveClaudeSonnet5ModelIdentity(ref) !== void 0 || /(?:^|-)claude-(?:fable-5|mythos-5|opus-4-(?:7|8))(?=$|[^a-z0-9])/.test(modelId);
|
|
157
|
+
return resolveClaudeHaiku55ModelIdentity(ref) !== void 0 || resolveClaudeOpus5ModelIdentity(ref) !== void 0 || resolveClaudeSonnet5ModelIdentity(ref) !== void 0 || /(?:^|-)claude-(?:fable-5|mythos-5|opus-4-(?:7|8))(?=$|[^a-z0-9])/.test(modelId);
|
|
133
158
|
}
|
|
134
159
|
/** Return whether a Claude model rejects caller-selected sampling parameters. */
|
|
135
160
|
function requiresClaudeDefaultSampling(ref) {
|
|
@@ -222,4 +247,4 @@ function calculateUsageCost(usage, pricing) {
|
|
|
222
247
|
return cost;
|
|
223
248
|
}
|
|
224
249
|
//#endregion
|
|
225
|
-
export {
|
|
250
|
+
export { supportsClaude1MContext as C, supportsClaudeNativeMaxEffort as D, supportsClaudeInHistorySystemMessages as E, supportsClaudeNativeXhighEffort as O, resolveClaudeSonnet5ModelIdentity as S, supportsClaudeFastMode as T, resolveClaudeMythos5ModelIdentity as _, CLAUDE_HAIKU_55_THINKING_PROFILE as a, resolveClaudeOpus5ModelIdentity as b, CLAUDE_SONNET_55_THINKING_PROFILE as c, requiresClaudeBetweenToolsThinking as d, requiresClaudeDefaultSampling as f, resolveClaudeModelIdentity as g, resolveClaudeHaiku55ModelIdentity as h, CLAUDE_FABLE_5_THINKING_PROFILE as i, CLAUDE_SONNET_5_THINKING_PROFILE as l, resolveClaudeFable5ModelIdentity as m, normalizeModelCostConfig as n, CLAUDE_OPUS_55_THINKING_PROFILE as o, requiresClaudeMandatoryAdaptiveThinking as p, normalizeResolvedPricing as r, CLAUDE_OPUS_5_THINKING_PROFILE as s, calculateUsageCost as t, bindsClaudeThinkingPrefix as u, resolveClaudeNativeThinkingLevelMap as v, supportsClaudeAdaptiveThinking as w, resolveClaudeSonnet55ModelIdentity as x, resolveClaudeOpus55ModelIdentity as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as bindAssistantMessageEventStream, o as getEventStreamCompletion } from "./event-stream-
|
|
2
|
-
import { i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, s as supportsScopedAiTransportHosts } from "./host-
|
|
1
|
+
import { i as bindAssistantMessageEventStream, o as getEventStreamCompletion } from "./event-stream-X2gmsUWv.mjs";
|
|
2
|
+
import { i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, s as supportsScopedAiTransportHosts } from "./host-JWXZWa-c.mjs";
|
|
3
3
|
import { i as registerSessionResourceCleanupObserver, t as cleanupSessionResources } from "./session-resources-D1wgDQ8C.mjs";
|
|
4
4
|
//#region packages/ai/src/api-registry.ts
|
|
5
5
|
function wrapStream(api, stream) {
|
|
@@ -47,6 +47,9 @@ function trackDefaultHostSessions(sessions) {
|
|
|
47
47
|
defaultHostSessionReferences.add(reference);
|
|
48
48
|
defaultHostSessionFinalizer.register(sessions, reference, reference);
|
|
49
49
|
}
|
|
50
|
+
function selectDefaultHostSessions(sessions, sessionId) {
|
|
51
|
+
return sessionId ? [[sessionId, sessions.get(sessionId)]] : sessions;
|
|
52
|
+
}
|
|
50
53
|
registerSessionResourceCleanupObserver((sessionId, owner) => {
|
|
51
54
|
for (const reference of defaultHostSessionReferences) {
|
|
52
55
|
const sessions = reference.deref();
|
|
@@ -59,12 +62,7 @@ registerSessionResourceCleanupObserver((sessionId, owner) => {
|
|
|
59
62
|
else owners.clear();
|
|
60
63
|
return owners.size === 0;
|
|
61
64
|
};
|
|
62
|
-
|
|
63
|
-
const owners = sessions.get(sessionId);
|
|
64
|
-
if (owners && pruneOwners(owners)) sessions.delete(sessionId);
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
for (const [ownedSessionId, owners] of sessions) if (pruneOwners(owners)) sessions.delete(ownedSessionId);
|
|
65
|
+
for (const [ownedSessionId, owners] of selectDefaultHostSessions(sessions, sessionId)) if (owners && pruneOwners(owners)) sessions.delete(ownedSessionId);
|
|
68
66
|
}
|
|
69
67
|
});
|
|
70
68
|
function retainUnscopedStreamLifetime(stream, runWithHost) {
|
|
@@ -90,7 +88,6 @@ function retainUnscopedStreamLifetime(stream, runWithHost) {
|
|
|
90
88
|
const bufferWaiters = /* @__PURE__ */ new Set();
|
|
91
89
|
let bufferError;
|
|
92
90
|
let resultPromise;
|
|
93
|
-
const wrapIterationError = (error) => new Error("Stream iteration failed", { cause: error });
|
|
94
91
|
const notifyBufferWaiters = () => {
|
|
95
92
|
for (const resolve of bufferWaiters) resolve();
|
|
96
93
|
bufferWaiters.clear();
|
|
@@ -103,13 +100,11 @@ function retainUnscopedStreamLifetime(stream, runWithHost) {
|
|
|
103
100
|
} catch (error) {
|
|
104
101
|
providerResult = Promise.reject(new Error("Stream result failed", { cause: error }));
|
|
105
102
|
}
|
|
106
|
-
|
|
103
|
+
const settleResult = () => {
|
|
107
104
|
resultSettled = true;
|
|
108
105
|
releaseIfSettled();
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
releaseIfSettled();
|
|
112
|
-
});
|
|
106
|
+
};
|
|
107
|
+
providerResult.then(settleResult, settleResult);
|
|
113
108
|
resultPromise = providerResult;
|
|
114
109
|
}
|
|
115
110
|
return resultPromise;
|
|
@@ -124,7 +119,7 @@ function retainUnscopedStreamLifetime(stream, runWithHost) {
|
|
|
124
119
|
notifyBufferWaiters();
|
|
125
120
|
}
|
|
126
121
|
} catch (error) {
|
|
127
|
-
bufferError =
|
|
122
|
+
bufferError = new Error("Stream iteration failed", { cause: error });
|
|
128
123
|
} finally {
|
|
129
124
|
bufferSettled = true;
|
|
130
125
|
notifyBufferWaiters();
|
|
@@ -202,11 +197,8 @@ function createRuntime(registry, transportHost) {
|
|
|
202
197
|
if (completion) {
|
|
203
198
|
if (!supportsScopedAiTransportHosts()) {
|
|
204
199
|
let producerSettled = false;
|
|
205
|
-
const observedCompletion = completion.
|
|
206
|
-
producerSettled = true;
|
|
207
|
-
}, (error) => {
|
|
200
|
+
const observedCompletion = completion.finally(() => {
|
|
208
201
|
producerSettled = true;
|
|
209
|
-
throw error;
|
|
210
202
|
});
|
|
211
203
|
runWithStreamHost(() => observedCompletion);
|
|
212
204
|
const result = runWithStreamHost(() => started.result());
|
|
@@ -240,8 +232,7 @@ function createRuntime(registry, transportHost) {
|
|
|
240
232
|
}
|
|
241
233
|
const usedHosts = /* @__PURE__ */ new Set();
|
|
242
234
|
if (!explicitHost) {
|
|
243
|
-
|
|
244
|
-
else for (const owners of defaultHostsBySession.values()) for (const host of owners) usedHosts.add(host);
|
|
235
|
+
for (const [, owners] of selectDefaultHostSessions(defaultHostsBySession, sessionId)) for (const host of owners ?? []) usedHosts.add(host);
|
|
245
236
|
usedHosts.add(getDefaultAiTransportHost());
|
|
246
237
|
}
|
|
247
238
|
const hosts = explicitHost ? [explicitHost] : [...usedHosts];
|
package/dist/{stream-first-event-timeout-D9ZmL_s9.mjs → stream-first-event-timeout-Dc42hKv6.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as clampTimerTimeoutMs } from "./number-coercion-C3hztWoY.mjs";
|
|
2
2
|
//#region packages/ai/src/utils/stream-first-event-timeout.ts
|
|
3
3
|
function getFirstStreamEventTimeoutMs(options) {
|
|
4
4
|
return options?.firstEventTimeoutMs;
|
|
@@ -46,14 +46,8 @@ function withFirstStreamEventTimeout(stream, context) {
|
|
|
46
46
|
const iterator = stream[Symbol.asyncIterator]();
|
|
47
47
|
let timer;
|
|
48
48
|
let completed = false;
|
|
49
|
-
const clear = () => {
|
|
50
|
-
if (timer) {
|
|
51
|
-
clearTimeout(timer);
|
|
52
|
-
timer = void 0;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
49
|
try {
|
|
56
|
-
|
|
50
|
+
let next = await new Promise((resolve, reject) => {
|
|
57
51
|
timer = setTimeout(() => {
|
|
58
52
|
const timeoutError = createFirstStreamEventTimeoutError(timeoutContext);
|
|
59
53
|
timeoutContext.onTimeout?.(timeoutError);
|
|
@@ -62,22 +56,15 @@ function withFirstStreamEventTimeout(stream, context) {
|
|
|
62
56
|
}, timeoutMs);
|
|
63
57
|
timer.unref?.();
|
|
64
58
|
iterator.next().then(resolve, reject);
|
|
65
|
-
}).finally(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
yield first.value;
|
|
71
|
-
for (;;) {
|
|
72
|
-
const next = await iterator.next();
|
|
73
|
-
if (next.done) {
|
|
74
|
-
completed = true;
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
59
|
+
}).finally(() => {
|
|
60
|
+
if (timer) clearTimeout(timer);
|
|
61
|
+
});
|
|
62
|
+
while (!next.done) {
|
|
77
63
|
yield next.value;
|
|
64
|
+
next = await iterator.next();
|
|
78
65
|
}
|
|
66
|
+
completed = true;
|
|
79
67
|
} finally {
|
|
80
|
-
clear();
|
|
81
68
|
if (!completed) iterator.return?.().catch(() => void 0);
|
|
82
69
|
}
|
|
83
70
|
} };
|
|
@@ -41,5 +41,20 @@ function createSseByteGuard(reader, opts) {
|
|
|
41
41
|
cancelled: () => cancelledFlag
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
+
/** Lazily bound an SDK response while preserving upstream cancellation. */
|
|
45
|
+
function boundResponseBody(response, options) {
|
|
46
|
+
if (!response.body || typeof response.body.getReader !== "function") return response;
|
|
47
|
+
const guard = createSseByteGuard(response.body.getReader(), options);
|
|
48
|
+
return new Response(new ReadableStream({
|
|
49
|
+
async pull(controller) {
|
|
50
|
+
const { done, value } = await guard.read();
|
|
51
|
+
if (done) controller.close();
|
|
52
|
+
else controller.enqueue(value);
|
|
53
|
+
},
|
|
54
|
+
async cancel(reason) {
|
|
55
|
+
await guard.cancel(reason);
|
|
56
|
+
}
|
|
57
|
+
}), response);
|
|
58
|
+
}
|
|
44
59
|
//#endregion
|
|
45
|
-
export { createSseByteGuard as t };
|
|
60
|
+
export { createSseByteGuard as n, boundResponseBody as t };
|
|
@@ -2,7 +2,7 @@ import { a as normalizeOptionalString } from "./string-coerce-CtgOVOSv.mjs";
|
|
|
2
2
|
//#region packages/normalization-core/src/string-normalization.ts
|
|
3
3
|
/** Coerces entries to strings, trims them, and drops empty results. */
|
|
4
4
|
function normalizeStringEntries(list) {
|
|
5
|
-
return (list ?? []).map((entry) =>
|
|
5
|
+
return (list ?? []).map((entry) => String(entry).trim()).filter(Boolean);
|
|
6
6
|
}
|
|
7
7
|
/** Returns first-seen unique values while preserving insertion order. */
|
|
8
8
|
function uniqueValues(values) {
|