@openclaw/ai 2026.11.3 → 2026.11.5-beta.2
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 +11 -8
- package/dist/.source-module-urls/fe058cc430242ce2ab0dfbcbe153e240a52cf9c3072c3dc0a73e5f956b6ba49b.json +1 -0
- package/dist/anthropic-DEKgalVg.mjs +182 -0
- package/dist/{anthropic-payload-policy-C0ki72BT.d.mts → anthropic-payload-policy-CXCJ5Pmj.d.mts} +21 -4
- package/dist/{anthropic-stream-reducer-yWDb5Cct.mjs → anthropic-stream-lifecycle-DF2qVvg1.mjs} +845 -649
- package/dist/{anthropic-tool-projection-C2-d1eZ3.d.mts → anthropic-tool-projection-D5DyrL6C.d.mts} +6 -7
- package/dist/{anthropic-tool-projection-DZOKfAmL.mjs → anthropic-tool-projection-dGRfr4iT.mjs} +22 -32
- package/dist/{api-registry-gDt0faai.d.mts → api-registry-DY2MLUyg.d.mts} +2 -2
- package/dist/assistant-output-CD4kY9gu.mjs +16 -0
- package/dist/{azure-openai-responses-BvvXzZbi.mjs → azure-openai-responses-DbQV5RTx.mjs} +47 -53
- package/dist/{cloudflare-Dttf8jKq.mjs → cloudflare-BJ2_Xabx.mjs} +1 -1
- package/dist/{credential-redaction-XvsPf7Yi.d.mts → credential-redaction-DrgndwTJ.d.mts} +5 -3
- package/dist/{deferred-event-buffer-DAvyP7qA.mjs → deferred-event-buffer-tIGkTkTm.mjs} +1 -2
- package/dist/{diagnostics-v7oVEW59.mjs → diagnostics-CloVGQiK.mjs} +27 -20
- package/dist/{diagnostics-DzrF1h4J.mjs → diagnostics-o1PrVNQb.mjs} +11 -4
- package/dist/diagnostics.d.mts +6 -7
- package/dist/diagnostics.mjs +4 -4
- package/dist/{env-api-keys-Xd8dm_aV.mjs → env-api-keys-BuHc86ya.mjs} +1 -26
- package/dist/event-stream-B4ZcSvsu.d.mts +1 -0
- package/dist/{event-stream-CzpE1g_o.d.mts → event-stream-BYmtRe8-.d.mts} +1 -1
- package/dist/event-stream.d.mts +2 -2
- package/dist/event-stream.mjs +1 -2
- package/dist/expect-lbe3Hgrh.mjs +8 -0
- package/dist/{github-copilot-request-facts-F-EmvkpW.mjs → github-copilot-request-facts-BZ_EMo7X.mjs} +1 -1
- package/dist/{google-Cpi_cLKZ.mjs → google-B1g82bn4.mjs} +7 -8
- package/dist/{google-interactions-CGINbsjO.mjs → google-interactions-Ckr0Z99Z.mjs} +243 -269
- package/dist/{google-messages-DQMgG5yG.mjs → google-messages-A-9d3y5V.mjs} +52 -18
- package/dist/{google-provider-stream-BHd0cST9.mjs → google-provider-stream-CNVh4gpm.mjs} +19 -11
- package/dist/{google-shared-vtag8bj5.mjs → google-shared-WNM86ZcW.mjs} +72 -42
- package/dist/{google-vertex-eKoUnW7N.mjs → google-vertex-CXjleC6g.mjs} +3 -3
- package/dist/{google-video-slots-D8tPH8wX.mjs → google-video-slots-Bxt-OXO8.mjs} +1 -1
- package/dist/{host-CWt55nnF.mjs → host-DX7ORpeH.mjs} +46 -39
- package/dist/{host-jJOffdlW.d.mts → host-ccbwPC3A.d.mts} +17 -9
- package/dist/{host-policy-Dm7PM6AD.mjs → host-policy-jCZebuXx.mjs} +2 -2
- package/dist/index-Bczt0MnO.d.mts +17 -0
- package/dist/index.d.mts +8 -7
- package/dist/index.mjs +9 -7
- package/dist/internal/anthropic.d.mts +21 -26
- package/dist/internal/anthropic.mjs +6 -6
- package/dist/internal/google-model-family.mjs +1 -1
- package/dist/internal/google.d.mts +15 -0
- package/dist/internal/google.mjs +1 -0
- package/dist/internal/model-request-body.d.mts +37 -0
- package/dist/internal/model-request-body.mjs +106 -0
- 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 +2 -2
- package/dist/internal/openai-responses-payload-policy.mjs +2 -2
- package/dist/internal/openai.d.mts +14 -12
- package/dist/internal/openai.mjs +11 -10
- package/dist/internal/reasoning-tag-text-partitioner.d.mts +26 -0
- package/dist/{reasoning-tag-text-partitioner-CU9A4Lg8.mjs → internal/reasoning-tag-text-partitioner.mjs} +313 -111
- package/dist/internal/retry-after.d.mts +2 -2
- package/dist/internal/retry-after.mjs +96 -32
- package/dist/internal/runtime.d.mts +15 -41
- package/dist/internal/runtime.mjs +9 -10
- package/dist/internal/shared.d.mts +21 -25
- package/dist/internal/shared.mjs +9 -98
- package/dist/internal/tool-schema.d.mts +10 -10
- package/dist/internal/tool-schema.mjs +4 -4
- package/dist/{llm-request-activity-CfMuh5cC.mjs → llm-request-activity-DzaHoRAU.mjs} +2 -2
- package/dist/mistral-CjHkvsqR.mjs +3741 -0
- package/dist/{openai.LICENSE → mistral.LICENSE} +1 -1
- package/dist/{model-transport-url-BrsjjdjR.d.mts → model-transport-url-BdksnBqu.d.mts} +6 -8
- package/dist/{number-coercion-37gmNkuA.mjs → number-coercion-C7HsBgUL.mjs} +7 -2
- package/dist/observe-async-iterator-AlARO5wS.d.mts +178 -0
- package/dist/observe-async-iterator-DgmegcZR.mjs +181 -0
- package/dist/{openai-chatgpt-responses-BZa3SySh.mjs → openai-chatgpt-responses-CwS5JP7A.mjs} +61 -80
- package/dist/{openai-completions-compat-CBvb2eld.d.mts → openai-completions-compat-CJ-NsDzg.d.mts} +12 -6
- package/dist/{openai-completions-compat-bNQXF1y9.mjs → openai-completions-compat-CstlTQuF.mjs} +74 -50
- package/dist/{openai-completions-CCZ_UHCk.mjs → openai-completions-sj4S-RXQ.mjs} +5 -5
- package/dist/openai-completions-transport-BDAIA0_P.mjs +3406 -0
- package/dist/{openai-prompt-cache-DgjD-UL5.d.mts → openai-prompt-cache-BZGaIWYh.d.mts} +4 -4
- package/dist/{openai-prompt-cache-B9AvdoEo.mjs → openai-prompt-cache-CgDoFhO0.mjs} +5 -4
- package/dist/{openai-responses-compaction-replay-_sUXtcwU.d.mts → openai-responses-compaction-replay-CNHk6k53.d.mts} +4 -4
- package/dist/{openai-responses-contracts-B1nkeLL6.d.mts → openai-responses-contracts-BXMcvO7F.d.mts} +4 -10
- package/dist/{openai-responses-contracts-B5mGAbR6.mjs → openai-responses-contracts-xU-n9AJJ.mjs} +36 -37
- package/dist/{openai-responses-endpoint-CfKR6N5f.mjs → openai-responses-endpoint-DCkURKS0.mjs} +55 -8
- package/dist/openai-responses-ev_c6oTy.mjs +89 -0
- package/dist/{openai-responses-payload-policy-BzM52TTH.d.mts → openai-responses-payload-policy-DyE30gdD.d.mts} +7 -7
- package/dist/{openai-responses-request-lifecycle-CTqHc02t.mjs → openai-responses-request-lifecycle-BuOs0mwI.mjs} +12 -26
- package/dist/{openai-responses-shared-wx9v1MCn.mjs → openai-responses-shared-BmRQnUPP.mjs} +633 -1493
- package/dist/{openai-responses-terminal-usage-CpVjkqn-.d.mts → openai-responses-terminal-usage-D7IhRA6i.d.mts} +9 -3
- package/dist/{openai-tool-schema-BTEU2xmN.mjs → openai-tool-schema-CsoYgnWy.mjs} +97 -122
- package/dist/otel-Buswj0Mf.mjs +766 -0
- package/dist/{overflow-OF3PgPbw.mjs → overflow-CpApyjG2.mjs} +1 -1
- package/dist/{positive-integer-Bb4Evc7L.mjs → positive-integer-DiqE5vNi.mjs} +2 -3
- package/dist/{prompt-cache-stability-D_MeCQFI.mjs → prompt-cache-stability-w-ICeyOI.mjs} +1 -1
- package/dist/{provider-error-qtZD2inE.mjs → provider-error-DD-fo4Rz.mjs} +71 -234
- package/dist/{provider-options-DAzsyi49.d.mts → provider-options-Mo8NM5d1.d.mts} +16 -5
- package/dist/{provider-replay-context-4vxI7p4V.mjs → provider-replay-context-xyU7-CiT.mjs} +2 -2
- package/dist/provider-transcript-transform-DtaxNcC1.mjs +32 -0
- package/dist/{provider-transport-turn-state-D_GjPJHe.mjs → provider-transport-turn-state-BIS8maBK.mjs} +4 -4
- package/dist/{provider-types-CWl4VXvE.d.mts → provider-types-B1e98js5.d.mts} +3 -3
- package/dist/provider-types.d.mts +7 -6
- package/dist/providers.d.mts +2 -2
- package/dist/providers.mjs +26 -29
- package/dist/{record-coerce-CNDovvft.mjs → record-coerce-BQaoiN3r.mjs} +4 -1
- package/dist/request-headers-DO4Mqhw1.mjs +10 -0
- package/dist/{required-api-key-D088S4Cd.mjs → required-api-key-2zZTkmsi.mjs} +1 -1
- package/dist/{retry-after-BrmTv0jL.d.mts → retry-after-DnHBlFS2.d.mts} +21 -1
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/dist/{sanitize-unicode-ZqVLLEKC.d.mts → sanitize-unicode-BISmUlUv.d.mts} +2 -2
- package/dist/{simple-options-xJkqrG_E.mjs → simple-options-tLSeECry.mjs} +108 -82
- package/dist/src-BUsVkrNt.mjs +105 -0
- package/dist/{src-CyA0zJnt.mjs → src-CQ7nH2mL.mjs} +4 -7
- package/dist/stable-stringify-CchQEmeA.mjs +84 -0
- package/dist/{stream-C4YDqhFj.mjs → stream-DrtAWu7c.mjs} +2 -6
- package/dist/{stream-first-event-timeout-D_TfJHRJ.mjs → stream-first-event-timeout-B7RcufAV.mjs} +16 -13
- package/dist/{string-coerce-Cj8sqWHx.mjs → string-coerce-BCuWMIrk.mjs} +1 -1
- package/dist/string-normalization-B8TDDBX_.mjs +32 -0
- package/dist/telemetry-CvK1yQg7.mjs +582 -0
- package/dist/{tool-schema-json-projection-B1sTYwfH.mjs → tool-schema-json-projection-BQpiJlXJ.mjs} +53 -69
- package/dist/{transport-stream-shared-lhgkTOz3.mjs → transport-stream-shared-D2uFMhMc.mjs} +177 -93
- package/dist/{transport-stream-shared-8ru8eX4s.d.mts → transport-stream-shared-D3IAU4jn.d.mts} +29 -15
- package/dist/{transport-utils-DwOpuTjL.mjs → transport-utils-Da_39MYi.mjs} +23 -38
- package/dist/transports.d.mts +42 -39
- package/dist/transports.mjs +215 -296
- package/dist/{types-CVYzKrMl.d.mts → types-BVdTf0YV.d.mts} +38 -3
- package/dist/types-Cb3-5WM9.d.mts +1 -0
- package/dist/{types-BXd0kI8-.mjs → types-OVEWUaDh.mjs} +3 -1
- package/dist/types.d.mts +7 -6
- package/dist/types.mjs +7 -5
- package/dist/{validation-9FSkE8T-.mjs → validation-DGXqfvkj.mjs} +45 -27
- package/dist/{validation-BQ5u20Ru.d.mts → validation-QmyD0E5A.d.mts} +1 -1
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -2
- package/package.json +40 -6
- package/dist/anthropic-lueA8LUg.mjs +0 -221
- package/dist/assistant-output-BnQm3fov.mjs +0 -47
- package/dist/event-stream-CDpFza-M.d.mts +0 -1
- package/dist/index-DSprYWaz.d.mts +0 -185
- package/dist/mistral-CQ7aoWg2.mjs +0 -512
- package/dist/model-request-body-BD5vy4rP.d.mts +0 -17
- package/dist/openai-CiRi-nVE.mjs +0 -20077
- package/dist/openai-completions-transport-DFvSBbUT.mjs +0 -10881
- package/dist/openai-responses-DQsZKUoI.mjs +0 -87
- package/dist/rolldown-runtime-B4iAMlE-.mjs +0 -35
- package/dist/types-CBJthzJX.d.mts +0 -1
- package/dist/ws.LICENSE +0 -20
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as
|
|
3
|
-
import { n as
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { C as supportsClaudeFastMode, D as supportsClaudeServerCompaction, E as supportsClaudeNativeXhighEffort, S as supportsClaudeAdaptiveThinking, T as supportsClaudeNativeMaxEffort, _ as resolveClaudeOpus55ModelIdentity, a as CLAUDE_OPUS_5_THINKING_PROFILE, b as resolveClaudeSonnet5ModelIdentity, c as bindsClaudeThinkingPrefix, d as requiresClaudeMandatoryAdaptiveThinking, f as resolveClaudeFable5ModelIdentity, g as resolveClaudeNativeThinkingLevelMap, h as resolveClaudeMythos5ModelIdentity, i as CLAUDE_OPUS_55_THINKING_PROFILE, l as requiresClaudeBetweenToolsThinking, m as resolveClaudeModelIdentity, n as CLAUDE_FABLE_5_THINKING_PROFILE, o as CLAUDE_SONNET_55_THINKING_PROFILE, p as resolveClaudeHaiku55ModelIdentity, r as CLAUDE_HAIKU_55_THINKING_PROFILE, s as CLAUDE_SONNET_5_THINKING_PROFILE, t as observeAsyncIterator, u as requiresClaudeDefaultSampling, v as resolveClaudeOpus5ModelIdentity, w as supportsClaudeInHistorySystemMessages, x as supportsClaude1MContext, y as resolveClaudeSonnet55ModelIdentity } from "./observe-async-iterator-AlARO5wS.mjs";
|
|
2
|
+
import { $ as RawPricingTier, A as ModelCostConfig, At as DiagnosticErrorInfo, B as PricingTier, C as KnownApi, Ct as isRuntimeContextMessage, D as MaybePromise, Dt as runtimeContextContentToText, E as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, Et as readRuntimeContextMetadata, F as OpenAIResponsesCompat, Ft as formatThrownValue, G as ProviderStreamOptions, H as ProviderImagesOptions, I as OpenRouterRouting, It as isProviderRefusalAssistantError, J as RUNTIME_CONTEXT_CUSTOM_TYPE, K as REPETITIVE_OUTPUT_ERROR_CODE, L as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, Lt as readProviderRefusalReview, M as ModelRequestHeaders, Mt as appendAssistantMessageDiagnostic, N as ModelThinkingLevel, Nt as createAssistantMessageDiagnostic, O as Message, Ot as setRuntimeContextRetention, P as OpenAICompletionsCompat, Pt as extractDiagnosticError, Q as RawModelCostConfig, R as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, Rt as recordSuppressedReasoning, S as ImagesStopReason, St as hasRuntimeContextMarker, T as KnownImagesProvider, Tt as labelRuntimeContextText, U as ProviderReplayState, V as Provider, W as ProviderResponse, X as RUNTIME_CONTEXT_FOOTER, Y as RUNTIME_CONTEXT_END_MARKER, Z as RUNTIME_CONTEXT_HEADER, _ as ImagesInputContent, _t as UserMessage, a as AssistantMessage, at as StreamOptions, b as ImagesOutputContent, bt as escapeRuntimeContextFooter, c as AssistantMessageEventStreamLike, ct as ThinkingBudgets, d as Context, dt as ThinkingLevelMap, et as RuntimeContextMessage, f as DEFAULT_MISSING_TOOL_RESULT_TEXT, ft as Tool, g as ImagesFunction, gt as Usage, h as ImagesContext, ht as Transport, i as AssistantImages, it as StreamFunction, j as ModelCostRates, jt as ProviderRefusalReview, k as Model, kt as AssistantMessageDiagnostic, l as CacheRetention, lt as ThinkingContent, m as ImagesApi, mt as ToolResultMessage, n as Api, nt as StopReason, o as AssistantMessageEvent, ot as TextContent, p as ImageContent, pt as ToolCall, q as RUNTIME_CONTEXT_BEGIN_MARKER, r as AssistantDeliveryTtsFacts, rt as StreamFn, s as AssistantMessageEventStreamContract, st as TextSignatureV1, t as AnthropicMessagesCompat, tt as SimpleStreamOptions, u as CompleteSimpleFn, ut as ThinkingLevel, v as ImagesModel, vt as ValidateToolArgumentsFn, w as KnownImagesApi, wt as labelRuntimeContextContent, x as ImagesProvider, xt as hasLegacyRuntimeContextEnvelope, y as ImagesOptions, yt as VercelGatewayRouting, z as PreparedSystemPrompt } from "./types-BVdTf0YV.mjs";
|
|
3
|
+
import { a as normalizeResolvedPricing, i as normalizeModelCostConfig, n as appendTextDeltaToAssistantMessage, r as calculateUsageCost, t as omitNullRequestHeaders } from "./index-Bczt0MnO.mjs";
|
|
4
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-BYmtRe8-.mjs";
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-QmyD0E5A.mjs";
|
|
6
|
+
import { a as RegisteredApiProvider, i as ApiStreamSimpleFunction, n as ApiRegistry, o as createApiRegistry, r as ApiStreamFunction, t as ApiProvider } from "./api-registry-DY2MLUyg.mjs";
|
|
7
|
+
import { _ as supportsScopedAiTransportHosts, a as AiProviderRequestPolicyInput, c as AiTransportHost, d as configureAiTransportHost, f as createAiTransportHost, g as runWithAiTransportHost, h as resolveAiTransportHeaderSentinels, i as AiProviderRequestCapabilities, l as AiTransportPluginHost, m as getDefaultAiTransportHost, n as AiInlineImageBlock, o as AiProviderStreamHookContext, p as getAiTransportHost, r as AiInlineTextBlock, s as AiTransformTransportMessages, t as AiInlineContentBlock, u as OpenAIStrictToolSettingOptions } from "./host-ccbwPC3A.mjs";
|
|
7
8
|
//#region packages/ai/src/stream.d.ts
|
|
8
9
|
/** Creates an isolated LLM runtime backed by the supplied provider registry. */
|
|
9
10
|
export declare function createLlmRuntime(registry?: ApiRegistry): {
|
|
@@ -37,4 +38,4 @@ export declare function createNodeLlmRuntime(registry?: ApiRegistry, transportHo
|
|
|
37
38
|
};
|
|
38
39
|
export type LlmRuntime = ReturnType<typeof createLlmRuntime>;
|
|
39
40
|
//#endregion
|
|
40
|
-
export { AiInlineContentBlock, AiInlineImageBlock, AiInlineTextBlock, AiProviderRequestCapabilities, AiProviderRequestPolicyInput, AiProviderStreamHookContext, AiTransformTransportMessages, AiTransportHost, AiTransportPluginHost, AnthropicMessagesCompat, Api, ApiProvider, ApiRegistry, ApiStreamFunction, ApiStreamSimpleFunction, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_HAIKU_55_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_55_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DEFAULT_MISSING_TOOL_RESULT_TEXT, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenAIStrictToolSettingOptions, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions,
|
|
41
|
+
export { AiInlineContentBlock, AiInlineImageBlock, AiInlineTextBlock, AiProviderRequestCapabilities, AiProviderRequestPolicyInput, AiProviderStreamHookContext, AiTransformTransportMessages, AiTransportHost, AiTransportPluginHost, AnthropicMessagesCompat, Api, ApiProvider, ApiRegistry, ApiStreamFunction, ApiStreamSimpleFunction, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_HAIKU_55_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_55_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DEFAULT_MISSING_TOOL_RESULT_TEXT, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelRequestHeaders, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenAIStrictToolSettingOptions, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PreparedSystemPrompt, PricingTier, Provider, ProviderImagesOptions, ProviderRefusalReview, ProviderReplayState, ProviderResponse, ProviderStreamOptions, REPETITIVE_OUTPUT_ERROR_CODE, RUNTIME_CONTEXT_BEGIN_MARKER, RUNTIME_CONTEXT_CUSTOM_TYPE, RUNTIME_CONTEXT_END_MARKER, RUNTIME_CONTEXT_FOOTER, RUNTIME_CONTEXT_HEADER, RawModelCostConfig, RawPricingTier, RegisteredApiProvider, RuntimeContextMessage, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, appendTextDeltaToAssistantMessage, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, escapeRuntimeContextFooter, extractDiagnosticError, formatThrownValue, getAiTransportHost, getDefaultAiTransportHost, hasLegacyRuntimeContextEnvelope, hasRuntimeContextMarker, isProviderRefusalAssistantError, isRuntimeContextMessage, labelRuntimeContextContent, labelRuntimeContextText, normalizeModelCostConfig, normalizeResolvedPricing, observeAsyncIterator, omitNullRequestHeaders, readProviderRefusalReview, readRuntimeContextMetadata, recordSuppressedReasoning, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, runWithAiTransportHost, runtimeContextContentToText, setRuntimeContextRetention, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeInHistorySystemMessages, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, supportsClaudeServerCompaction, supportsScopedAiTransportHosts, validateToolArguments, validateToolCall };
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { C as supportsClaude1MContext, D as supportsClaudeNativeMaxEffort, E as supportsClaudeInHistorySystemMessages, O as supportsClaudeNativeXhighEffort, S as resolveClaudeSonnet5ModelIdentity, T as supportsClaudeFastMode, _ as resolveClaudeMythos5ModelIdentity, a as CLAUDE_HAIKU_55_THINKING_PROFILE, b as resolveClaudeOpus5ModelIdentity, c as CLAUDE_SONNET_55_THINKING_PROFILE, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, k as supportsClaudeServerCompaction, l as CLAUDE_SONNET_5_THINKING_PROFILE, m as resolveClaudeFable5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_OPUS_55_THINKING_PROFILE, p as requiresClaudeMandatoryAdaptiveThinking, r as normalizeResolvedPricing, s as CLAUDE_OPUS_5_THINKING_PROFILE, t as calculateUsageCost, u as bindsClaudeThinkingPrefix, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./src-
|
|
2
|
-
import { _ as
|
|
1
|
+
import { C as supportsClaude1MContext, D as supportsClaudeNativeMaxEffort, E as supportsClaudeInHistorySystemMessages, O as supportsClaudeNativeXhighEffort, S as resolveClaudeSonnet5ModelIdentity, T as supportsClaudeFastMode, _ as resolveClaudeMythos5ModelIdentity, a as CLAUDE_HAIKU_55_THINKING_PROFILE, b as resolveClaudeOpus5ModelIdentity, c as CLAUDE_SONNET_55_THINKING_PROFILE, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, k as supportsClaudeServerCompaction, l as CLAUDE_SONNET_5_THINKING_PROFILE, m as resolveClaudeFable5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_OPUS_55_THINKING_PROFILE, p as requiresClaudeMandatoryAdaptiveThinking, r as normalizeResolvedPricing, s as CLAUDE_OPUS_5_THINKING_PROFILE, t as calculateUsageCost, u as bindsClaudeThinkingPrefix, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./src-CQ7nH2mL.mjs";
|
|
2
|
+
import { _ as readRuntimeContextMetadata, a as REPETITIVE_OUTPUT_ERROR_CODE, c as RUNTIME_CONTEXT_END_MARKER, d as escapeRuntimeContextFooter, f as hasLegacyRuntimeContextEnvelope, g as labelRuntimeContextText, h as labelRuntimeContextContent, i as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, l as RUNTIME_CONTEXT_FOOTER, m as isRuntimeContextMessage, n as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, o as RUNTIME_CONTEXT_BEGIN_MARKER, p as hasRuntimeContextMarker, r as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, s as RUNTIME_CONTEXT_CUSTOM_TYPE, t as DEFAULT_MISSING_TOOL_RESULT_TEXT, u as RUNTIME_CONTEXT_HEADER, v as runtimeContextContentToText, y as setRuntimeContextRetention } from "./types-OVEWUaDh.mjs";
|
|
3
3
|
import { t as appendTextDeltaToAssistantMessage } from "./assistant-message-events-CHMJgbhs.mjs";
|
|
4
|
-
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, o as readProviderRefusalReview, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-
|
|
4
|
+
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, o as readProviderRefusalReview, r as extractDiagnosticError, s as recordSuppressedReasoning, t as appendAssistantMessageDiagnostic } from "./diagnostics-o1PrVNQb.mjs";
|
|
5
|
+
import { t as omitNullRequestHeaders } from "./request-headers-DO4Mqhw1.mjs";
|
|
5
6
|
import { a as createAssistantMessageEventStream, n as EventStream, t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
6
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
7
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-DGXqfvkj.mjs";
|
|
8
|
+
import { t as observeAsyncIterator } from "./observe-async-iterator-DgmegcZR.mjs";
|
|
9
|
+
import { n as createNodeLlmRuntime, r as createApiRegistry, t as createLlmRuntime } from "./stream-DrtAWu7c.mjs";
|
|
10
|
+
import { a as resolveAiTransportHeaderSentinels, i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, r as getAiTransportHost, s as supportsScopedAiTransportHosts, t as configureAiTransportHost } from "./host-DX7ORpeH.mjs";
|
|
11
|
+
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_HAIKU_55_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_55_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, DEFAULT_MISSING_TOOL_RESULT_TEXT, EventStream, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, REPETITIVE_OUTPUT_ERROR_CODE, RUNTIME_CONTEXT_BEGIN_MARKER, RUNTIME_CONTEXT_CUSTOM_TYPE, RUNTIME_CONTEXT_END_MARKER, RUNTIME_CONTEXT_FOOTER, RUNTIME_CONTEXT_HEADER, appendAssistantMessageDiagnostic, appendTextDeltaToAssistantMessage, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, createNodeLlmRuntime, escapeRuntimeContextFooter, extractDiagnosticError, formatThrownValue, getAiTransportHost, getDefaultAiTransportHost, hasLegacyRuntimeContextEnvelope, hasRuntimeContextMarker, isProviderRefusalAssistantError, isRuntimeContextMessage, labelRuntimeContextContent, labelRuntimeContextText, normalizeModelCostConfig, normalizeResolvedPricing, observeAsyncIterator, omitNullRequestHeaders, readProviderRefusalReview, readRuntimeContextMetadata, recordSuppressedReasoning, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, runWithAiTransportHost, runtimeContextContentToText, setRuntimeContextRetention, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeInHistorySystemMessages, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, supportsClaudeServerCompaction, supportsScopedAiTransportHosts, validateToolArguments, validateToolCall };
|
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import "../types-
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
1
|
+
import { E as supportsClaudeNativeXhighEffort, S as supportsClaudeAdaptiveThinking, T as supportsClaudeNativeMaxEffort, _ as resolveClaudeOpus55ModelIdentity, b as resolveClaudeSonnet5ModelIdentity, c as bindsClaudeThinkingPrefix, d as requiresClaudeMandatoryAdaptiveThinking, f as resolveClaudeFable5ModelIdentity, g as resolveClaudeNativeThinkingLevelMap, h as resolveClaudeMythos5ModelIdentity, l as requiresClaudeBetweenToolsThinking, m as resolveClaudeModelIdentity, p as resolveClaudeHaiku55ModelIdentity, u as requiresClaudeDefaultSampling, v as resolveClaudeOpus5ModelIdentity, y as resolveClaudeSonnet55ModelIdentity } from "../observe-async-iterator-AlARO5wS.mjs";
|
|
2
|
+
import { M as ModelRequestHeaders, d as Context, gt as Usage, it as StreamFunction, k as Model, kt as AssistantMessageDiagnostic, nt as StopReason, tt as SimpleStreamOptions } from "../types-BVdTf0YV.mjs";
|
|
3
|
+
import "../index-Bczt0MnO.mjs";
|
|
4
|
+
import "../types-Cb3-5WM9.mjs";
|
|
5
|
+
import { i as AnthropicThinkingDisplay, n as AnthropicEffort, r as AnthropicOptions, t as AnthropicContextManagementOptions } from "../provider-options-Mo8NM5d1.mjs";
|
|
6
|
+
import { a as prepareAnthropicInputSchema, c as resolveOriginalAnthropicToolName, i as normalizeAnthropicToolChoice, l as toClaudeCodeToolName, n as AnthropicToolProjection, o as projectAnthropicTools, r as normalizeAnthropicToolCallId, s as reconcileAnthropicToolChoice, t as AnthropicProjectedToolChoice } from "../anthropic-tool-projection-D5DyrL6C.mjs";
|
|
7
|
+
import { a as buildAnthropicSystemBlocks, h as applyAnthropicThinkingOptions, p as resolveAnthropicServerCompactionPlan, s as isDirectAnthropicModel } from "../anthropic-payload-policy-CXCJ5Pmj.mjs";
|
|
7
8
|
//#region packages/ai/src/providers/anthropic.d.ts
|
|
8
9
|
type AnthropicCompactionOptions = AnthropicOptions & {
|
|
9
10
|
authProfileId?: string;
|
|
10
11
|
};
|
|
11
12
|
export declare const streamAnthropic: StreamFunction<"anthropic-messages", AnthropicCompactionOptions>;
|
|
12
|
-
|
|
13
|
+
export declare const streamSimpleAnthropic: StreamFunction<"anthropic-messages", SimpleStreamOptions & AnthropicContextManagementOptions & {
|
|
13
14
|
authProfileId?: string;
|
|
14
15
|
toolChoice?: AnthropicCompactionOptions["toolChoice"];
|
|
15
16
|
thinkingDisplay?: AnthropicOptions["thinkingDisplay"];
|
|
16
|
-
}
|
|
17
|
-
export declare const streamSimpleAnthropic: StreamFunction<"anthropic-messages", AnthropicSimpleStreamOptions>;
|
|
17
|
+
}>;
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region packages/ai/src/providers/anthropic-auth-headers.d.ts
|
|
20
20
|
/** Inspect resolved credential shape for auth routing without exposing its value. */
|
|
21
21
|
export declare function isAnthropicOAuthApiKey(apiKey: unknown): boolean;
|
|
22
|
-
|
|
22
|
+
export declare function usesFoundryBearerAuth(model: {
|
|
23
23
|
provider?: string;
|
|
24
24
|
authHeader?: boolean;
|
|
25
|
-
headers?:
|
|
26
|
-
};
|
|
27
|
-
export declare function
|
|
28
|
-
export declare function omitFoundryBearerCredentialHeaders(headers?: Record<string, string>): Record<string, string> | undefined;
|
|
25
|
+
headers?: ModelRequestHeaders;
|
|
26
|
+
}): boolean;
|
|
27
|
+
export declare function omitFoundryBearerCredentialHeaders(headers?: ModelRequestHeaders): ModelRequestHeaders | undefined;
|
|
29
28
|
//#endregion
|
|
30
29
|
//#region packages/ai/src/providers/anthropic-model-contract.d.ts
|
|
31
30
|
export declare const ANTHROPIC_CLAUDE_CODE_VERSION = "2.1.280";
|
|
32
31
|
/** Build OAuth headers and the matching billing identity from one request snapshot. */
|
|
33
|
-
export declare function buildAnthropicClaudeCodeIdentity(betaHeader: string | undefined, ...headerSources: (
|
|
32
|
+
export declare function buildAnthropicClaudeCodeIdentity(betaHeader: string | undefined, ...headerSources: (ModelRequestHeaders | undefined)[]): {
|
|
34
33
|
headers: Record<string, string>;
|
|
35
34
|
version: string;
|
|
36
35
|
};
|
|
@@ -69,29 +68,25 @@ export declare function resolveAnthropicThinkingEffort(model: Model<"anthropic-m
|
|
|
69
68
|
export declare function mapAnthropicStopReason(reason: string | undefined): StopReason;
|
|
70
69
|
/** Remove unsupported assistant prefills while preserving completed tool-use turns. */
|
|
71
70
|
export declare function prepareClaudeNoPrefillRequestContext(model: Model, context: Context): Context;
|
|
72
|
-
|
|
71
|
+
export declare function applyClaudeRequestContract(params: {
|
|
73
72
|
temperature?: unknown;
|
|
74
73
|
top_p?: unknown;
|
|
75
74
|
top_k?: unknown;
|
|
76
75
|
service_tier?: unknown;
|
|
77
|
-
}
|
|
78
|
-
export declare function applyClaudeRequestContract(params: ClaudeSamplingRequestParams, model: {
|
|
76
|
+
}, model: {
|
|
79
77
|
id?: string;
|
|
80
78
|
params?: Record<string, unknown>;
|
|
81
79
|
api?: string;
|
|
82
80
|
}): void;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
target: ReplayModelRef;
|
|
86
|
-
}): "default" | "preserve" | "drop";
|
|
81
|
+
/** The destination is fixed during one synchronous history transform. */
|
|
82
|
+
export declare function prepareModelBoundThinkingReplay(target: Pick<Model, "api" | "provider" | "id" | "params">): (source: ReplayModelRef) => "default" | "preserve" | "drop";
|
|
87
83
|
//#endregion
|
|
88
84
|
//#region packages/ai/src/providers/anthropic-refusal.d.ts
|
|
89
|
-
|
|
85
|
+
export declare function applyAnthropicRefusal(output: {
|
|
90
86
|
stopReason: string;
|
|
91
87
|
errorMessage?: string;
|
|
92
88
|
diagnostics?: AssistantMessageDiagnostic[];
|
|
93
|
-
};
|
|
94
|
-
export declare function applyAnthropicRefusal(output: AnthropicRefusalOutput, stopDetails: unknown, provider: string): void;
|
|
89
|
+
}, stopDetails: unknown, provider: string): void;
|
|
95
90
|
//#endregion
|
|
96
91
|
//#region packages/ai/src/providers/anthropic-server-fallback.d.ts
|
|
97
92
|
/** Anthropic beta that re-serves safety refusals on an allowed fallback model. */
|
|
@@ -184,4 +179,4 @@ export declare function applyAnthropicMessageStartUsage(target: Usage, payload:
|
|
|
184
179
|
/** Keep billing and context distinct; omitted usage preserves the last snapshot. */
|
|
185
180
|
export declare function applyAnthropicMessageDeltaUsage(target: Usage, usage: AnthropicUsagePayload | undefined, messageStartPromptUsage: AnthropicPromptUsageSnapshot | undefined): void;
|
|
186
181
|
//#endregion
|
|
187
|
-
export { type AnthropicEffort, type AnthropicOptions, AnthropicProjectedToolChoice, type AnthropicThinkingDisplay, AnthropicToolProjection, bindsClaudeThinkingPrefix, buildAnthropicSystemBlocks, isDirectAnthropicModel, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, prepareAnthropicInputSchema, projectAnthropicTools, reconcileAnthropicToolChoice, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicServerCompactionPlan, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveOriginalAnthropicToolName, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName };
|
|
182
|
+
export { type AnthropicEffort, type AnthropicOptions, AnthropicProjectedToolChoice, type AnthropicThinkingDisplay, AnthropicToolProjection, applyAnthropicThinkingOptions, bindsClaudeThinkingPrefix, buildAnthropicSystemBlocks, isDirectAnthropicModel, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, prepareAnthropicInputSchema, projectAnthropicTools, reconcileAnthropicToolChoice, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicServerCompactionPlan, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveOriginalAnthropicToolName, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as supportsClaudeNativeMaxEffort, O as supportsClaudeNativeXhighEffort, S as resolveClaudeSonnet5ModelIdentity, _ as resolveClaudeMythos5ModelIdentity, b as resolveClaudeOpus5ModelIdentity, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, m as resolveClaudeFable5ModelIdentity, p as requiresClaudeMandatoryAdaptiveThinking, u as bindsClaudeThinkingPrefix, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "../src-
|
|
2
|
-
import { C as
|
|
3
|
-
import {
|
|
4
|
-
import { a as reconcileAnthropicToolChoice, i as projectAnthropicTools, n as normalizeAnthropicToolChoice, o as resolveOriginalAnthropicToolName, r as prepareAnthropicInputSchema, s as toClaudeCodeToolName, t as normalizeAnthropicToolCallId } from "../anthropic-tool-projection-
|
|
5
|
-
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-
|
|
6
|
-
export { ANTHROPIC_CLAUDE_CODE_VERSION, ANTHROPIC_OMITTED_REASONING_TEXT, ANTHROPIC_SERVER_SIDE_FALLBACKS, ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, CLAUDE_OPUS_FALLBACK_MODEL_COST, applyAnthropicFallbackBoundary, applyAnthropicMessageDeltaUsage, applyAnthropicMessageStartUsage, applyAnthropicRefusal, applyAnthropicThinkingBindingControls, applyClaudeRequestContract, bindsClaudeThinkingPrefix, buildAnthropicClaudeCodeIdentity, buildAnthropicSystemBlocks, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, isAnthropicOAuthApiKey, isDirectAnthropicModel, logAnthropicThinkingDrops, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareAnthropicInputSchema, prepareClaudeNoPrefillRequestContext, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicInputTransformations, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity,
|
|
1
|
+
import { D as supportsClaudeNativeMaxEffort, O as supportsClaudeNativeXhighEffort, S as resolveClaudeSonnet5ModelIdentity, _ as resolveClaudeMythos5ModelIdentity, b as resolveClaudeOpus5ModelIdentity, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, m as resolveClaudeFable5ModelIdentity, p as requiresClaudeMandatoryAdaptiveThinking, u as bindsClaudeThinkingPrefix, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "../src-CQ7nH2mL.mjs";
|
|
2
|
+
import { C as resolveAnthropicThinkingEffort, S as requiresClaudeAdaptiveThinking, T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, b as prepareClaudeNoPrefillRequestContext, g as applyClaudeRequestContract, h as ANTHROPIC_CLAUDE_CODE_VERSION, v as defaultsClaudeAdaptiveThinking, w as usesClaudeFable5MessagesContract, x as prepareModelBoundThinkingReplay, y as mapAnthropicStopReason } from "../host-DX7ORpeH.mjs";
|
|
3
|
+
import { A as resolveAnthropicServerCompactionPlan, B as usesFoundryBearerAuth, F as applyAnthropicFallbackBoundary, I as readAnthropicFallbackBoundary, L as resolveAnthropicFallbackServingModelCost, M as ANTHROPIC_SERVER_SIDE_FALLBACKS, N as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, P as CLAUDE_OPUS_FALLBACK_MODEL_COST, R as isAnthropicOAuthApiKey, S as buildAnthropicSystemBlocks, _ as applyAnthropicRefusal, c as readAnthropicCacheWriteUsage, d as readLastAnthropicIterationUsage, f as ANTHROPIC_OMITTED_REASONING_TEXT, g as readAnthropicInputTransformations, h as logAnthropicThinkingDrops, l as readAnthropicPromptUsageSnapshot, m as findActiveAnthropicToolTurnAssistantIndex, n as applyAnthropicThinkingOptions, o as applyAnthropicMessageDeltaUsage, p as applyAnthropicThinkingBindingControls, s as applyAnthropicMessageStartUsage, u as readAnthropicUsageTokenCount, w as isDirectAnthropicModel, z as omitFoundryBearerCredentialHeaders } from "../anthropic-stream-lifecycle-DF2qVvg1.mjs";
|
|
4
|
+
import { a as reconcileAnthropicToolChoice, i as projectAnthropicTools, n as normalizeAnthropicToolChoice, o as resolveOriginalAnthropicToolName, r as prepareAnthropicInputSchema, s as toClaudeCodeToolName, t as normalizeAnthropicToolCallId } from "../anthropic-tool-projection-dGRfr4iT.mjs";
|
|
5
|
+
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-DEKgalVg.mjs";
|
|
6
|
+
export { ANTHROPIC_CLAUDE_CODE_VERSION, ANTHROPIC_OMITTED_REASONING_TEXT, ANTHROPIC_SERVER_SIDE_FALLBACKS, ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, CLAUDE_OPUS_FALLBACK_MODEL_COST, applyAnthropicFallbackBoundary, applyAnthropicMessageDeltaUsage, applyAnthropicMessageStartUsage, applyAnthropicRefusal, applyAnthropicThinkingBindingControls, applyAnthropicThinkingOptions, applyClaudeRequestContract, bindsClaudeThinkingPrefix, buildAnthropicClaudeCodeIdentity, buildAnthropicSystemBlocks, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, isAnthropicOAuthApiKey, isDirectAnthropicModel, logAnthropicThinkingDrops, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareAnthropicInputSchema, prepareClaudeNoPrefillRequestContext, prepareModelBoundThinkingReplay, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicInputTransformations, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveOriginalAnthropicToolName, streamAnthropic, streamSimpleAnthropic, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName, usesClaudeFable5MessagesContract, usesClaudeStreamingRefusalContract, usesFoundryBearerAuth };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as normalizeLowercaseStringOrEmpty } from "../string-coerce-
|
|
1
|
+
import { r as normalizeLowercaseStringOrEmpty } from "../string-coerce-BCuWMIrk.mjs";
|
|
2
2
|
//#region packages/ai/src/internal/google-model-family.ts
|
|
3
3
|
function isGoogleGemini3ProModel(modelId) {
|
|
4
4
|
const normalized = normalizeLowercaseStringOrEmpty(modelId);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { k as Model, tt as SimpleStreamOptions } from "../types-BVdTf0YV.mjs";
|
|
2
|
+
import "../types-Cb3-5WM9.mjs";
|
|
3
|
+
import "../event-stream-B4ZcSvsu.mjs";
|
|
4
|
+
import { GenerateContentConfig, ThinkingLevel } from "@google/genai";
|
|
5
|
+
//#region packages/ai/src/providers/google-shared.d.ts
|
|
6
|
+
type GoogleThinkingOptions = {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
budgetTokens?: number;
|
|
9
|
+
level?: `${ThinkingLevel}`;
|
|
10
|
+
};
|
|
11
|
+
/** Shared wire policy for the Gemini API and Vertex, with or without the Google SDK. */
|
|
12
|
+
export declare function buildGoogleGenerationConfig(model: Pick<Model, "id" | "reasoning" | "maxTokens">, thinking: GoogleThinkingOptions | undefined, maxTokens: number | undefined): Pick<GenerateContentConfig, "maxOutputTokens" | "thinkingConfig">;
|
|
13
|
+
export declare function buildGoogleSimpleThinking(model: Model, options: SimpleStreamOptions | undefined): GoogleThinkingOptions;
|
|
14
|
+
//#endregion
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { n as buildGoogleGenerationConfig, i as buildGoogleSimpleThinking } from "../google-shared-WNM86ZcW.mjs";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region packages/ai/src/transports/model-request-body.d.ts
|
|
2
|
+
export type EncodedModelRequestBody = {
|
|
3
|
+
body: Uint8Array<ArrayBuffer>;
|
|
4
|
+
stream: boolean;
|
|
5
|
+
};
|
|
6
|
+
/** A slice of JSON.stringify output; only keys need decoding to inspect its shape. */
|
|
7
|
+
declare class ModelRequestJson {
|
|
8
|
+
readonly json: string;
|
|
9
|
+
constructor(json: string);
|
|
10
|
+
members(): Generator<[string, ModelRequestJson]>;
|
|
11
|
+
private valueEnd;
|
|
12
|
+
}
|
|
13
|
+
type ModelRequestBodyState = {
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
reportsBytes?: boolean;
|
|
16
|
+
encode?: (payload: unknown) => Promise<EncodedModelRequestBody>;
|
|
17
|
+
onEncoded?: (body: Blob, payload: unknown) => void;
|
|
18
|
+
onBytes?: (bytes: number) => void;
|
|
19
|
+
};
|
|
20
|
+
/** Call-local state survives option spreads; no payload is cached across requests. */
|
|
21
|
+
export declare function modelRequestBodyState(options: object, inheritFrom?: object): ModelRequestBodyState;
|
|
22
|
+
/** Observe JSON fetch bodies without opting into host-owned request encoding. */
|
|
23
|
+
export declare function withModelRequestBodyBytes(options: object | undefined, fetch: typeof globalThis.fetch): typeof globalThis.fetch;
|
|
24
|
+
export declare function serializeModelRequestBody(payload: unknown, onSerializedPayload?: (payload: unknown) => void): EncodedModelRequestBody & {
|
|
25
|
+
json: ModelRequestJson | undefined;
|
|
26
|
+
};
|
|
27
|
+
export declare function markEncodedModelRequestBody(body: Blob, stream: boolean): void;
|
|
28
|
+
export declare function encodedModelRequestBodyStream(body: unknown): boolean | undefined;
|
|
29
|
+
/** SDK RequestOptions.body overrides encoding while the original params retain stream metadata. */
|
|
30
|
+
export declare function prepareModelRequestBody(options: object | undefined): (payload: unknown) => Promise<{
|
|
31
|
+
body: Blob;
|
|
32
|
+
headers: {
|
|
33
|
+
"content-type": string;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
//#endregion
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//#region packages/ai/src/transports/model-request-body.ts
|
|
2
|
+
const REQUEST_BODY = Symbol("modelRequestBody");
|
|
3
|
+
/** A slice of JSON.stringify output; only keys need decoding to inspect its shape. */
|
|
4
|
+
var ModelRequestJson = class ModelRequestJson {
|
|
5
|
+
constructor(json) {
|
|
6
|
+
this.json = json;
|
|
7
|
+
}
|
|
8
|
+
*members() {
|
|
9
|
+
const object = this.json[0] === "{";
|
|
10
|
+
if (!object && this.json[0] !== "[") return;
|
|
11
|
+
let index = 1;
|
|
12
|
+
let item = 0;
|
|
13
|
+
while (index < this.json.length - 1) {
|
|
14
|
+
let key = String(item++);
|
|
15
|
+
if (object) {
|
|
16
|
+
const end = this.valueEnd(index);
|
|
17
|
+
const encodedKey = this.json.slice(index + 1, end - 1);
|
|
18
|
+
key = encodedKey.includes("\\") ? JSON.parse(this.json.slice(index, end)) : encodedKey;
|
|
19
|
+
index = end + 1;
|
|
20
|
+
}
|
|
21
|
+
const end = this.valueEnd(index);
|
|
22
|
+
yield [key, new ModelRequestJson(this.json.slice(index, end))];
|
|
23
|
+
index = end + 1;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
valueEnd(start) {
|
|
27
|
+
let depth = 0;
|
|
28
|
+
for (let index = start; index < this.json.length; index++) {
|
|
29
|
+
const char = this.json[index];
|
|
30
|
+
if (char === "\"") {
|
|
31
|
+
let escaped;
|
|
32
|
+
do {
|
|
33
|
+
index = this.json.indexOf("\"", index + 1);
|
|
34
|
+
let slash = index - 1;
|
|
35
|
+
while (this.json[slash] === "\\") slash--;
|
|
36
|
+
escaped = (index - slash) % 2 === 0;
|
|
37
|
+
} while (escaped);
|
|
38
|
+
if (depth === 0) return index + 1;
|
|
39
|
+
} else if (char === "{" || char === "[") depth++;
|
|
40
|
+
else if (char === "}" || char === "]") {
|
|
41
|
+
if (depth === 0) return index;
|
|
42
|
+
depth--;
|
|
43
|
+
if (depth === 0) return index + 1;
|
|
44
|
+
} else if (depth === 0 && (char === "," || char === ":")) return index;
|
|
45
|
+
}
|
|
46
|
+
return this.json.length;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
/** Call-local state survives option spreads; no payload is cached across requests. */
|
|
50
|
+
function modelRequestBodyState(options, inheritFrom) {
|
|
51
|
+
const state = Reflect.get(options, REQUEST_BODY) ?? (inheritFrom && Reflect.get(inheritFrom, REQUEST_BODY)) ?? {};
|
|
52
|
+
Reflect.set(options, REQUEST_BODY, state);
|
|
53
|
+
return state;
|
|
54
|
+
}
|
|
55
|
+
/** Observe JSON fetch bodies without opting into host-owned request encoding. */
|
|
56
|
+
function withModelRequestBodyBytes(options, fetch) {
|
|
57
|
+
const state = modelRequestBodyState(options ?? {});
|
|
58
|
+
state.reportsBytes = true;
|
|
59
|
+
return (input, init) => {
|
|
60
|
+
if (typeof init?.body === "string") state.onBytes?.(Buffer.byteLength(init.body, "utf8"));
|
|
61
|
+
else if (init?.body instanceof Blob) state.onBytes?.(init.body.size);
|
|
62
|
+
return fetch(input, init);
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function serializeModelRequestBody(payload, onSerializedPayload) {
|
|
66
|
+
const json = JSON.stringify(payload);
|
|
67
|
+
const request = json === void 0 ? void 0 : new ModelRequestJson(json);
|
|
68
|
+
let stream = false;
|
|
69
|
+
if (request?.json[0] === "{") {
|
|
70
|
+
for (const [key, value] of request.members()) if (key === "stream") {
|
|
71
|
+
stream = value.json === "true";
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (onSerializedPayload) onSerializedPayload(json === void 0 ? void 0 : JSON.parse(json));
|
|
76
|
+
return {
|
|
77
|
+
body: new TextEncoder().encode(json),
|
|
78
|
+
stream,
|
|
79
|
+
json: request
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const encodedBodyStreams = /* @__PURE__ */ new WeakMap();
|
|
83
|
+
function markEncodedModelRequestBody(body, stream) {
|
|
84
|
+
encodedBodyStreams.set(body, stream);
|
|
85
|
+
}
|
|
86
|
+
function encodedModelRequestBodyStream(body) {
|
|
87
|
+
return typeof body === "object" && body !== null ? encodedBodyStreams.get(body) : void 0;
|
|
88
|
+
}
|
|
89
|
+
/** SDK RequestOptions.body overrides encoding while the original params retain stream metadata. */
|
|
90
|
+
function prepareModelRequestBody(options) {
|
|
91
|
+
const state = options ? modelRequestBodyState(options) : {};
|
|
92
|
+
state.enabled = true;
|
|
93
|
+
return async (payload) => {
|
|
94
|
+
const encoded = state.encode ? await state.encode(payload) : serializeModelRequestBody(payload);
|
|
95
|
+
const body = new Blob([encoded.body]);
|
|
96
|
+
state.onEncoded?.(body, payload);
|
|
97
|
+
state.onBytes?.(body.size);
|
|
98
|
+
markEncodedModelRequestBody(body, encoded.stream);
|
|
99
|
+
return {
|
|
100
|
+
body,
|
|
101
|
+
headers: { "content-type": "application/json" }
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { encodedModelRequestBodyStream, markEncodedModelRequestBody, modelRequestBodyState, prepareModelRequestBody, serializeModelRequestBody, withModelRequestBodyBytes };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as resolveOpenAICompletionsCompat } from "../openai-completions-compat-CJ-NsDzg.mjs";
|
|
2
2
|
//#region packages/ai/src/transports/openai-completions-reasoning-replay.d.ts
|
|
3
3
|
/** Shared by history sanitization and wire replay, including stale model metadata. */
|
|
4
4
|
export declare function requiresReasoningContentReplay(modelId: unknown): boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as resolveOpenAICompletionsCompat } from "../openai-completions-compat-CstlTQuF.mjs";
|
|
2
2
|
import { t as requiresReasoningContentReplay } from "../openai-completions-reasoning-replay-BwT1xwRI.mjs";
|
|
3
3
|
export { requiresReasoningContentReplay, resolveOpenAICompletionsCompat };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as readOpenAIResponsesCompactionWindow, t as OPENAI_RESPONSES_APIS, u as OpenAIResponsesCompactionOutput } from "../openai-responses-contracts-
|
|
2
|
-
import { a as resolveOpenAIResponsesPayloadPolicy, o as resolveOpenAIResponsesRequestContextTokens, r as normalizeOpenAIServiceTier, s as resolveOpenAIResponsesServerCompactionPlan, t as OpenAIServiceTier } from "../openai-responses-payload-policy-
|
|
1
|
+
import { d as readOpenAIResponsesCompactionWindow, t as OPENAI_RESPONSES_APIS, u as OpenAIResponsesCompactionOutput } from "../openai-responses-contracts-BXMcvO7F.mjs";
|
|
2
|
+
import { a as resolveOpenAIResponsesPayloadPolicy, o as resolveOpenAIResponsesRequestContextTokens, r as normalizeOpenAIServiceTier, s as resolveOpenAIResponsesServerCompactionPlan, t as OpenAIServiceTier } from "../openai-responses-payload-policy-DyE30gdD.mjs";
|
|
3
3
|
//#region packages/ai/src/transports/openai-responses-endpoint.d.ts
|
|
4
4
|
export declare function supportsNativeOpenAIResponsesEndpoint(params: {
|
|
5
5
|
provider: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-
|
|
2
|
-
import {
|
|
1
|
+
import { i as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-xU-n9AJJ.mjs";
|
|
2
|
+
import { f as resolveOpenAIResponsesPayloadPolicy, m as resolveOpenAIResponsesServerCompactionPlan, n as supportsNativeOpenAIResponsesEndpoint, o as readOpenAIResponsesCompactionWindow, p as resolveOpenAIResponsesRequestContextTokens, u as normalizeOpenAIServiceTier } from "../openai-responses-endpoint-DCkURKS0.mjs";
|
|
3
3
|
export { OPENAI_RESPONSES_APIS, normalizeOpenAIServiceTier, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesRequestContextTokens, resolveOpenAIResponsesServerCompactionPlan, supportsNativeOpenAIResponsesEndpoint };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import "../types-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "../openai-responses-
|
|
10
|
-
import
|
|
1
|
+
import { d as Context, it as StreamFunction, nt as StopReason, tt as SimpleStreamOptions } from "../types-BVdTf0YV.mjs";
|
|
2
|
+
import "../index-Bczt0MnO.mjs";
|
|
3
|
+
import "../types-Cb3-5WM9.mjs";
|
|
4
|
+
import { a as ProviderContext, c as ProviderModel } from "../provider-types-B1e98js5.mjs";
|
|
5
|
+
import { A as resolveOpenAISupportedReasoningEfforts, C as isOpenAIGpt55Model, D as resolveOpenAIModelReasoningEfforts, E as normalizeOpenAIReasoningEffort, M as supportsOpenAITemperature, O as resolveOpenAIReasoningEffortForModel, S as isOpenAIGpt54MiniModel, T as isOpenAIGpt6Model, _ as reconcileOpenAICompletionsToolChoice, a as BaseOpenAIStreamOptions, b as OpenAIReasoningEffort, c as OpenAICompletionsOptions, d as measuredRequestPressure, g as projectOpenAITools, h as OpenAIToolProjection, j as supportsOpenAIReasoningEffort, k as resolveOpenAIReasoningEffortMapping, m as OpenAICompletionsToolChoice, o as CodeModeToolSurfaceObservation, p as reasoningTagTextPolicy, u as codeModeToolSurfaceObserver, v as reconcileOpenAIResponsesToolChoice, w as isOpenAIGpt56Model, x as applyOpenAICompletionsToolReasoning, y as OpenAIApiReasoningEffort } from "../provider-options-Mo8NM5d1.mjs";
|
|
6
|
+
import { t as ResolvedOpenAICompletionsCompat } from "../openai-completions-compat-CJ-NsDzg.mjs";
|
|
7
|
+
import { c as responsesPromptObserver, f as OpenAIRequestReasoningEffort, l as responsesServiceTierObserver, o as ResponsesPromptObservation, s as ResponsesServiceTierObservation } from "../openai-responses-contracts-BXMcvO7F.mjs";
|
|
8
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-BZGaIWYh.mjs";
|
|
9
|
+
import { a as readResponsesReasoningTokens, i as mapResponsesTerminalUsage, n as applyResponsesCacheWritePricing, o as resolveResponsesTerminalStopReason, r as isResponsesOutputLimitToolCallError, t as ResponsesTerminalUsagePayload } from "../openai-responses-terminal-usage-D7IhRA6i.mjs";
|
|
10
|
+
import "../openai-responses-compaction-replay-CNHk6k53.mjs";
|
|
11
|
+
import { encodedModelRequestBodyStream, modelRequestBodyState } from "./model-request-body.mjs";
|
|
11
12
|
import { ResponseCreateParamsStreaming, ResponseInputItem } from "openai/resources/responses/responses.js";
|
|
12
13
|
import { ChatCompletionMessageParam } from "openai/resources/chat/completions.js";
|
|
13
14
|
//#region packages/ai/src/providers/azure-deployment-map.d.ts
|
|
@@ -31,10 +32,11 @@ export declare function isOpenAICompatibleAzureResponsesBaseUrl(baseUrl: string)
|
|
|
31
32
|
//#endregion
|
|
32
33
|
//#region packages/ai/src/openai-completions-messages.d.ts
|
|
33
34
|
/** Convert a normalized transcript to OpenAI Chat Completions messages. */
|
|
34
|
-
export declare function convertMessages(model:
|
|
35
|
+
export declare function convertMessages(model: ProviderModel, context: ProviderContext, compat: ResolvedOpenAICompletionsCompat, options?: {
|
|
35
36
|
cacheOptOutIndexes?: Set<number>;
|
|
36
37
|
preserveSystemPromptCacheBoundary?: boolean;
|
|
37
38
|
supportsTools?: boolean;
|
|
39
|
+
declaredToolNames?: ReadonlySet<string>;
|
|
38
40
|
}): ChatCompletionMessageParam[];
|
|
39
41
|
//#endregion
|
|
40
42
|
//#region packages/ai/src/providers/openai-completions.d.ts
|
|
@@ -153,4 +155,4 @@ export declare function bindResponsesInputMessage(source: Extract<Context["messa
|
|
|
153
155
|
role: "user";
|
|
154
156
|
}>): (input: unknown) => boolean;
|
|
155
157
|
//#endregion
|
|
156
|
-
export { type CodeModeToolSurfaceObservation, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OpenAIApiReasoningEffort, type OpenAICompletionsOptions, type OpenAICompletionsToolChoice, OpenAIReasoningEffort, type OpenAIToolProjection, type ResponsesPromptObservation, type ResponsesServiceTierObservation, ResponsesTerminalUsagePayload, applyOpenAICompletionsToolReasoning, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, encodedModelRequestBodyStream, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isOpenAIGpt6Model, isResponsesOutputLimitToolCallError, mapResponsesTerminalUsage, modelRequestBodyState, normalizeOpenAIReasoningEffort, projectOpenAITools, readResponsesReasoningTokens, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveOpenAIModelReasoningEfforts, resolveOpenAIPromptCacheParams, resolveOpenAIReasoningEffortForModel, resolveOpenAIReasoningEffortMapping, resolveOpenAISupportedReasoningEfforts, resolveResponsesTerminalStopReason, responsesPromptObserver, responsesServiceTierObserver, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
158
|
+
export { type CodeModeToolSurfaceObservation, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OpenAIApiReasoningEffort, type OpenAICompletionsOptions, type OpenAICompletionsToolChoice, OpenAIReasoningEffort, type OpenAIToolProjection, type ResponsesPromptObservation, type ResponsesServiceTierObservation, ResponsesTerminalUsagePayload, applyOpenAICompletionsToolReasoning, applyResponsesCacheWritePricing, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, encodedModelRequestBodyStream, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isOpenAIGpt6Model, isResponsesOutputLimitToolCallError, mapResponsesTerminalUsage, measuredRequestPressure, modelRequestBodyState, normalizeOpenAIReasoningEffort, projectOpenAITools, readResponsesReasoningTokens, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveOpenAIModelReasoningEfforts, resolveOpenAIPromptCacheParams, resolveOpenAIReasoningEffortForModel, resolveOpenAIReasoningEffortMapping, resolveOpenAISupportedReasoningEfforts, resolveResponsesTerminalStopReason, responsesPromptObserver, responsesServiceTierObserver, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
package/dist/internal/openai.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-
|
|
3
|
-
import { _ as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { A as resolveOpenAIReasoningEffortMapping, C as isOpenAIGpt54MiniModel, D as normalizeOpenAIReasoningEffort, E as isOpenAIGpt6Model, M as supportsOpenAIReasoningEffort, N as supportsOpenAITemperature, O as resolveOpenAIModelReasoningEfforts, S as applyOpenAICompletionsToolReasoning, T as isOpenAIGpt56Model, j as resolveOpenAISupportedReasoningEfforts, k as resolveOpenAIReasoningEffortForModel, v as responsesPromptObserver, w as isOpenAIGpt55Model, y as responsesServiceTierObserver } from "../openai-responses-contracts-xU-n9AJJ.mjs";
|
|
2
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-CgDoFhO0.mjs";
|
|
3
|
+
import { _ as isResponsesOutputLimitToolCallError, b as resolveResponsesTerminalStopReason, g as applyResponsesCacheWritePricing, v as mapResponsesTerminalUsage, y as readResponsesReasoningTokens } from "../diagnostics-CloVGQiK.mjs";
|
|
4
|
+
import { d as measuredRequestPressure, p as reasoningTagTextPolicy, u as codeModeToolSurfaceObserver } from "../simple-options-tLSeECry.mjs";
|
|
5
|
+
import { encodedModelRequestBodyStream, modelRequestBodyState } from "./model-request-body.mjs";
|
|
6
|
+
import { a as hasResponsesWebSearchTool, s as convertMessages } from "../openai-completions-transport-BDAIA0_P.mjs";
|
|
7
|
+
import { N as bindResponsesInputMessage, St as reconcileOpenAIResponsesToolChoice, _ as isAzureResponsesTextDeltaEventType, b as resolveResponsesMessageSnapshotCollapse, bt as projectOpenAITools, f as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, g as isAzureResponsesTextDeltaEvent, h as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, l as createResponsesToolCallTracker, m as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, p as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, u as readResponsesToolCallItemIdentity, v as isResponsesTextContentPartType, xt as reconcileOpenAICompletionsToolChoice, y as isResponsesTextDeltaEventType } from "../openai-responses-shared-BmRQnUPP.mjs";
|
|
7
8
|
import { t as mapOpenAIStopReason } from "../openai-stop-reason-8s70vDXj.mjs";
|
|
8
9
|
import { i as resolveAzureDeploymentNameFromMap, n as isTraditionalAzureOpenAIHost, r as parseAzureDeploymentNameMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "../azure-openai-responses-client-compat-D0dvJMbZ.mjs";
|
|
9
|
-
import { n as responsesRequestLifecycle, t as independentResponsesRequest } from "../openai-responses-request-lifecycle-
|
|
10
|
-
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-
|
|
11
|
-
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-
|
|
12
|
-
export { AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, applyOpenAICompletionsToolReasoning, bindResponsesInputMessage, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, convertMessages, createResponsesToolCallTracker, encodedModelRequestBodyStream, hasResponsesWebSearchTool, independentResponsesRequest, isAzureResponsesTextDeltaEvent, isAzureResponsesTextDeltaEventType, isOpenAICompatibleAzureResponsesBaseUrl, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isOpenAIGpt6Model, isResponsesOutputLimitToolCallError, isResponsesTextContentPartType, isResponsesTextDeltaEventType, isTraditionalAzureOpenAIHost, mapOpenAIStopReason, mapResponsesTerminalUsage, modelRequestBodyState, normalizeOpenAIReasoningEffort, parseAzureDeploymentNameMap, projectOpenAITools, readResponsesReasoningTokens, readResponsesToolCallItemIdentity, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveAzureDeploymentNameFromMap, resolveOpenAIModelReasoningEfforts, resolveOpenAIPromptCacheParams, resolveOpenAIReasoningEffortForModel, resolveOpenAIReasoningEffortMapping, resolveOpenAISupportedReasoningEfforts, resolveResponsesMessageSnapshotCollapse, resolveResponsesTerminalStopReason, responsesPromptObserver, responsesRequestLifecycle, responsesServiceTierObserver, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
10
|
+
import { n as responsesRequestLifecycle, t as independentResponsesRequest } from "../openai-responses-request-lifecycle-BuOs0mwI.mjs";
|
|
11
|
+
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-sj4S-RXQ.mjs";
|
|
12
|
+
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-ev_c6oTy.mjs";
|
|
13
|
+
export { AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, applyOpenAICompletionsToolReasoning, applyResponsesCacheWritePricing, bindResponsesInputMessage, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, convertMessages, createResponsesToolCallTracker, encodedModelRequestBodyStream, hasResponsesWebSearchTool, independentResponsesRequest, isAzureResponsesTextDeltaEvent, isAzureResponsesTextDeltaEventType, isOpenAICompatibleAzureResponsesBaseUrl, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isOpenAIGpt6Model, isResponsesOutputLimitToolCallError, isResponsesTextContentPartType, isResponsesTextDeltaEventType, isTraditionalAzureOpenAIHost, mapOpenAIStopReason, mapResponsesTerminalUsage, measuredRequestPressure, modelRequestBodyState, normalizeOpenAIReasoningEffort, parseAzureDeploymentNameMap, projectOpenAITools, readResponsesReasoningTokens, readResponsesToolCallItemIdentity, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveAzureDeploymentNameFromMap, resolveOpenAIModelReasoningEfforts, resolveOpenAIPromptCacheParams, resolveOpenAIReasoningEffortForModel, resolveOpenAIReasoningEffortMapping, resolveOpenAISupportedReasoningEfforts, resolveResponsesMessageSnapshotCollapse, resolveResponsesTerminalStopReason, responsesPromptObserver, responsesRequestLifecycle, responsesServiceTierObserver, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region packages/markdown-core/src/reasoning-tag-syntax.d.ts
|
|
2
|
+
type ReasoningTagTextDelta = {
|
|
3
|
+
kind: "text";
|
|
4
|
+
text: string;
|
|
5
|
+
} | {
|
|
6
|
+
kind: "thinking";
|
|
7
|
+
text: string;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region packages/markdown-core/src/reasoning-tags.d.ts
|
|
11
|
+
interface ReasoningTagTextPartitioner {
|
|
12
|
+
markStrict(): void;
|
|
13
|
+
push(chunk: string): ReasoningTagTextDelta[];
|
|
14
|
+
pushVisible(chunk: string): ReasoningTagTextDelta[];
|
|
15
|
+
flush(options?: {
|
|
16
|
+
recoverUnclosed?: boolean;
|
|
17
|
+
}): ReasoningTagTextDelta[];
|
|
18
|
+
hasPending(): boolean;
|
|
19
|
+
/** Whether more input can change buffered Markdown or reasoning-tag ownership. */
|
|
20
|
+
hasPendingSyntax(): boolean;
|
|
21
|
+
isInsideReasoning(): boolean;
|
|
22
|
+
}
|
|
23
|
+
/** Creates a block-incremental parser that emits only Markdown-stable text. */
|
|
24
|
+
export declare function createReasoningTagTextPartitioner(): ReasoningTagTextPartitioner;
|
|
25
|
+
//#endregion
|
|
26
|
+
export {};
|