@openclaw/ai 2026.8.1 → 2026.8.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/dist/{anthropic-Djj7L1rx.mjs → anthropic-DTGZ4VMY.mjs} +13 -11
- package/dist/{anthropic-compaction-replay-CY4tkD4V.mjs → anthropic-compaction-replay-CKCDrZJv.mjs} +6 -6
- package/dist/{anthropic-payload-policy-i_5_inWe.d.mts → anthropic-payload-policy-BTzmNC14.d.mts} +2 -2
- package/dist/{api-registry-C9-wZd_W.d.mts → api-registry-BbUHEKER.d.mts} +2 -2
- package/dist/{azure-openai-responses-Bj3czHNa.mjs → azure-openai-responses-BmqaDXM1.mjs} +5 -4
- package/dist/diagnostics.mjs +1 -1
- package/dist/{event-stream-UhnxHuqt.d.mts → event-stream-DcvAPSBe.d.mts} +1 -1
- package/dist/event-stream-pXT3FI6X.d.mts +1 -0
- package/dist/event-stream.d.mts +2 -2
- package/dist/{google-0Ca6TYbw.mjs → google-CqjVZMwo.mjs} +7 -5
- package/dist/{google-shared-DVfL9COU.mjs → google-shared-Bnqni5j3.mjs} +25 -23
- package/dist/{google-vertex-5dAMxprN.mjs → google-vertex-D_WREEJi.mjs} +7 -5
- package/dist/{host-D51fmkH6.mjs → host-BIaiBURL.mjs} +2 -2
- package/dist/{host-DoPJJ1KD.d.mts → host-DKFUAmCn.d.mts} +3 -3
- package/dist/{index-N3zr6__t.d.mts → index-CefaUGSS.d.mts} +11 -5
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +4 -4
- package/dist/internal/anthropic.d.mts +5 -5
- package/dist/internal/anthropic.mjs +4 -4
- package/dist/internal/openai-responses-payload-policy.d.mts +1 -1
- package/dist/internal/openai-responses-payload-policy.mjs +1 -1
- package/dist/internal/openai.d.mts +5 -5
- package/dist/internal/openai.mjs +8 -8
- package/dist/internal/runtime.d.mts +5 -5
- package/dist/internal/runtime.mjs +3 -3
- package/dist/internal/shared.d.mts +2 -2
- package/dist/internal/shared.mjs +3 -3
- package/dist/{mistral-BCnrI-kV.mjs → mistral-C24jVd6f.mjs} +18 -13
- package/dist/{openai-chatgpt-responses-CGBGWSqr.mjs → openai-chatgpt-responses-Czum0oXz.mjs} +16 -15
- package/dist/{openai-completions-BaTuwID7.mjs → openai-completions-BfFwac6f.mjs} +16 -13
- package/dist/{openai-completions-compat-DB7FFq7k.d.mts → openai-completions-compat-SZhi0Lf4.d.mts} +3 -3
- package/dist/{openai-completions-stream-Bpns6uNc.mjs → openai-completions-stream-DGOvau4J.mjs} +29 -26
- package/dist/{openai-responses-1GBcQujk.mjs → openai-responses-BAryVEJM.mjs} +9 -7
- package/dist/{openai-responses-compaction-window-DwydGZI8.mjs → openai-responses-compaction-window-DO7yV7az.mjs} +3 -3
- package/dist/{openai-responses-contracts-DgaR3t5T.d.mts → openai-responses-contracts-BthRXano.d.mts} +3 -3
- package/dist/{openai-responses-prompt-observer-internal-_nhGTn2b.mjs → openai-responses-prompt-observer-internal--R0kZLOZ.mjs} +3 -3
- package/dist/{openai-responses-shared-zPmKnhF5.mjs → openai-responses-shared-CxgdGBvm.mjs} +27 -26
- package/dist/{openai-tool-schema-Dgl4H2MU.mjs → openai-tool-schema-CSMh5e9O.mjs} +13 -11
- package/dist/{provider-error-jZP5NMTZ.mjs → provider-error-BI8kIViN.mjs} +11 -11
- package/dist/{provider-options-HvA_slFa.d.mts → provider-options-DJd_9euj.d.mts} +2 -2
- package/dist/{provider-transcript-transform-C01bQ5a3.mjs → provider-transcript-transform-WvJmFUAf.mjs} +1 -1
- package/dist/provider-types.d.mts +6 -6
- package/dist/providers.d.mts +1 -1
- package/dist/providers.mjs +9 -9
- package/dist/{reasoning-tag-text-partitioner-CwzKb0bA.mjs → reasoning-tag-text-partitioner-BsUX44Tq.mjs} +29 -19
- package/dist/{sanitize-unicode-DCkltN94.mjs → sanitize-unicode-S6binQG-.mjs} +2 -8
- package/dist/{simple-options-DKx86yX9.mjs → simple-options-rdOPzr7Z.mjs} +2 -2
- package/dist/{src-Bu3FiFAG.mjs → src-C8U7lkoa.mjs} +75 -2
- package/dist/{tool-schema-json-projection-qvTEs5Am.mjs → tool-schema-json-projection-BtZiml7r.mjs} +21 -31
- package/dist/{transport-stream-shared-NjwWNaRY.d.mts → transport-stream-shared-BbG7PThh.d.mts} +4 -4
- package/dist/{transport-stream-shared-CT5ycdzn.mjs → transport-stream-shared-D8nQWCUo.mjs} +2 -2
- package/dist/{transport-utils-BHx9z8Cl.mjs → transport-utils-CtuS1Upe.mjs} +2 -2
- package/dist/transports.d.mts +12 -9
- package/dist/transports.mjs +61 -50
- package/dist/{types-h38Azne1.d.mts → types-Beemor2E.d.mts} +20 -7
- package/dist/types-COdhCX0U.d.mts +1 -0
- package/dist/types.d.mts +6 -6
- package/dist/types.mjs +3 -3
- package/dist/{validation-C68lP2uy.d.mts → validation-CC6s7Smp.d.mts} +1 -1
- package/dist/{validation-B61OhAio.mjs → validation-CJZtym2g.mjs} +7 -5
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/package.json +2 -2
- package/dist/event-stream-C988TSLe.d.mts +0 -1
- package/dist/types-DtGu2d3C.d.mts +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { g as supportsClaudeAdaptiveThinking, m as resolveClaudeSonnet5ModelIdentity, p as resolveClaudeOpus5ModelIdentity, y as supportsClaudeNativeXhighEffort } from "./src-C8U7lkoa.mjs";
|
|
3
3
|
import { t as AssistantMessageEventStream } from "./event-stream-uSMZJ3FA.mjs";
|
|
4
4
|
import { o as isRecord } from "./utf16-slice-qz3nsy87.mjs";
|
|
5
|
-
import { r as calculateCost, t as sanitizeSurrogates } from "./sanitize-unicode-
|
|
6
|
-
import { S as usesClaudeStreamingRefusalContract, _ as prepareClaudeNoPrefillRequestContext, a as describeToolResultMediaPlaceholder, c as extractToolResultText, d as isImageWithMediaPayload, f as ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, g as mapAnthropicStopReason, m as applyClaudeRequestContract, n as getAiTransportHost, p as ANTHROPIC_CLAUDE_CODE_VERSION, r as resolveAiTransportHeaderSentinels, s as extractToolResultBlockText, v as requiresClaudeAdaptiveThinking, x as usesClaudeFable5MessagesContract, y as resolveAnthropicThinkingEffort } from "./host-
|
|
7
|
-
import { n as projectProviderError } from "./provider-error-
|
|
8
|
-
import { A as applyAnthropicCacheControlToMessages, C as applyAnthropicFallbackBoundary, D as createAnthropicInlineImageBudget, E as applyAnthropicRefusal, I as isAnthropicOAuthApiKey, L as omitFoundryBearerCredentialHeaders, O as normalizeAnthropicInlineContent, R as usesFoundryBearerAuth, T as resolveAnthropicFallbackServingModelCost, _ as toClaudeCodeToolName, a as suppressAnthropicCompaction, b as ANTHROPIC_SERVER_SIDE_FALLBACKS, f as normalizeAnthropicToolCallId, g as resolveOriginalAnthropicToolName, h as reconcileAnthropicToolChoice, k as resolveAnthropicImageMediaType, m as projectAnthropicTools, n as createCompactionCapture, o as applyAnthropicMessageDeltaUsage, p as normalizeAnthropicToolChoice, r as isAnthropicReplayRejection, s as applyAnthropicMessageStartUsage, t as buildAnthropicReplayPlan, v as ANTHROPIC_OMITTED_REASONING_TEXT, w as readAnthropicFallbackBoundary, x as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, y as findActiveAnthropicToolTurnAssistantIndex } from "./anthropic-compaction-replay-
|
|
5
|
+
import { r as calculateCost, t as sanitizeSurrogates } from "./sanitize-unicode-S6binQG-.mjs";
|
|
6
|
+
import { S as usesClaudeStreamingRefusalContract, _ as prepareClaudeNoPrefillRequestContext, a as describeToolResultMediaPlaceholder, c as extractToolResultText, d as isImageWithMediaPayload, f as ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, g as mapAnthropicStopReason, m as applyClaudeRequestContract, n as getAiTransportHost, p as ANTHROPIC_CLAUDE_CODE_VERSION, r as resolveAiTransportHeaderSentinels, s as extractToolResultBlockText, v as requiresClaudeAdaptiveThinking, x as usesClaudeFable5MessagesContract, y as resolveAnthropicThinkingEffort } from "./host-BIaiBURL.mjs";
|
|
7
|
+
import { n as projectProviderError } from "./provider-error-BI8kIViN.mjs";
|
|
8
|
+
import { A as applyAnthropicCacheControlToMessages, C as applyAnthropicFallbackBoundary, D as createAnthropicInlineImageBudget, E as applyAnthropicRefusal, I as isAnthropicOAuthApiKey, L as omitFoundryBearerCredentialHeaders, O as normalizeAnthropicInlineContent, R as usesFoundryBearerAuth, T as resolveAnthropicFallbackServingModelCost, _ as toClaudeCodeToolName, a as suppressAnthropicCompaction, b as ANTHROPIC_SERVER_SIDE_FALLBACKS, f as normalizeAnthropicToolCallId, g as resolveOriginalAnthropicToolName, h as reconcileAnthropicToolChoice, k as resolveAnthropicImageMediaType, m as projectAnthropicTools, n as createCompactionCapture, o as applyAnthropicMessageDeltaUsage, p as normalizeAnthropicToolChoice, r as isAnthropicReplayRejection, s as applyAnthropicMessageStartUsage, t as buildAnthropicReplayPlan, v as ANTHROPIC_OMITTED_REASONING_TEXT, w as readAnthropicFallbackBoundary, x as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, y as findActiveAnthropicToolTurnAssistantIndex } from "./anthropic-compaction-replay-CKCDrZJv.mjs";
|
|
9
9
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
10
|
-
import { d as stripSystemPromptCacheBoundary, n as buildBaseOptions, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking, u as splitSystemPromptCacheBoundary } from "./simple-options-
|
|
11
|
-
import { t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-
|
|
10
|
+
import { d as stripSystemPromptCacheBoundary, n as buildBaseOptions, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking, u as splitSystemPromptCacheBoundary } from "./simple-options-rdOPzr7Z.mjs";
|
|
11
|
+
import { t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-CtuS1Upe.mjs";
|
|
12
12
|
import { n as getEnvApiKey } from "./env-api-keys-bktO00EJ.mjs";
|
|
13
|
-
import { _ as transportAbortError, f as notifyProviderHttpResponse, s as finalizeTerminalToolCallArguments } from "./transport-stream-shared-
|
|
13
|
+
import { _ as transportAbortError, f as notifyProviderHttpResponse, s as finalizeTerminalToolCallArguments } from "./transport-stream-shared-D8nQWCUo.mjs";
|
|
14
14
|
import { t as createDeferredEventBuffer } from "./deferred-event-buffer-DAvyP7qA.mjs";
|
|
15
15
|
import { n as parseJsonWithRepair, r as parseStreamingJson, t as createToolArgumentPreviewSchedule } from "./json-parse-BuAJEbdW.mjs";
|
|
16
16
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-BjtkplhG.mjs";
|
|
17
|
-
import { t as transformProviderMessages } from "./provider-transcript-transform-
|
|
17
|
+
import { t as transformProviderMessages } from "./provider-transcript-transform-WvJmFUAf.mjs";
|
|
18
18
|
import { i as resolveCloudflareBaseUrl, n as hasCopilotVisionInput, t as buildCopilotDynamicHeaders } from "./github-copilot-headers-NCJtz9i0.mjs";
|
|
19
19
|
import Anthropic from "@anthropic-ai/sdk";
|
|
20
20
|
import { Stream } from "@anthropic-ai/sdk/core/streaming.js";
|
|
@@ -398,8 +398,10 @@ const streamAnthropic = (model, context, options) => {
|
|
|
398
398
|
});
|
|
399
399
|
}
|
|
400
400
|
} else if (event.type === "message_delta") {
|
|
401
|
-
if (event.delta.stop_reason)
|
|
402
|
-
|
|
401
|
+
if (event.delta.stop_reason) {
|
|
402
|
+
if (event.delta.stop_reason === "refusal") applyAnthropicRefusal(output, event.delta.stop_details, model.provider);
|
|
403
|
+
else output.stopReason = mapAnthropicStopReason(event.delta.stop_reason);
|
|
404
|
+
}
|
|
403
405
|
if (event.usage) applyAnthropicMessageDeltaUsage(output.usage, event.usage, messageStartPromptUsage);
|
|
404
406
|
calculateCost(costModel, output.usage);
|
|
405
407
|
}
|
package/dist/{anthropic-compaction-replay-CY4tkD4V.mjs → anthropic-compaction-replay-CKCDrZJv.mjs}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as resolveClaudeFable5ModelIdentity, p as resolveClaudeOpus5ModelIdentity, u as resolveClaudeModelIdentity } from "./src-C8U7lkoa.mjs";
|
|
2
2
|
import { l as normalizeNullableString, o as isRecord, u as normalizeOptionalLowercaseString } from "./utf16-slice-qz3nsy87.mjs";
|
|
3
|
-
import { n as getAiTransportHost } from "./host-
|
|
3
|
+
import { n as getAiTransportHost } from "./host-BIaiBURL.mjs";
|
|
4
4
|
import { a as asNonNegativeFiniteNumber, n as estimateBase64DecodedBytes } from "./base64-CEFBpSkN.mjs";
|
|
5
5
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
6
|
-
import { d as stripSystemPromptCacheBoundary, m as sortPromptCacheToolsByName, u as splitSystemPromptCacheBoundary } from "./simple-options-
|
|
7
|
-
import { a as resolveProviderEndpoint, o as resolveProviderRequestCapabilities, t as projectRuntimeToolInputSchema } from "./tool-schema-json-projection-
|
|
8
|
-
import { s as parsePositiveInteger } from "./transport-utils-
|
|
6
|
+
import { d as stripSystemPromptCacheBoundary, m as sortPromptCacheToolsByName, u as splitSystemPromptCacheBoundary } from "./simple-options-rdOPzr7Z.mjs";
|
|
7
|
+
import { a as resolveProviderEndpoint, o as resolveProviderRequestCapabilities, t as projectRuntimeToolInputSchema } from "./tool-schema-json-projection-BtZiml7r.mjs";
|
|
8
|
+
import { s as parsePositiveInteger } from "./transport-utils-CtuS1Upe.mjs";
|
|
9
9
|
import { t as shortHash } from "./hash-CHgqbJmD.mjs";
|
|
10
10
|
//#region packages/ai/src/providers/anthropic-auth-headers.ts
|
|
11
11
|
/** Inspect resolved credential shape for auth routing without exposing its value. */
|
|
@@ -240,7 +240,7 @@ const ANTHROPIC_IMAGE_MEDIA_TYPE_SET = /* @__PURE__ */ new Set([
|
|
|
240
240
|
"image/gif",
|
|
241
241
|
"image/webp"
|
|
242
242
|
]);
|
|
243
|
-
const ANTHROPIC_INLINE_IMAGES_DECODE_SAFETY_BYTES =
|
|
243
|
+
const ANTHROPIC_INLINE_IMAGES_DECODE_SAFETY_BYTES = 67108864;
|
|
244
244
|
function createAnthropicInlineImageBudget() {
|
|
245
245
|
return { totalBytes: 0 };
|
|
246
246
|
}
|
package/dist/{anthropic-payload-policy-i_5_inWe.d.mts → anthropic-payload-policy-BTzmNC14.d.mts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { D as Model } from "./types-
|
|
1
|
+
import "./index-CefaUGSS.mjs";
|
|
2
|
+
import { D as Model } from "./types-Beemor2E.mjs";
|
|
3
3
|
//#region packages/ai/src/transports/anthropic-payload-policy.d.ts
|
|
4
4
|
/** @deprecated Anthropic-family provider payload helper; do not use from third-party plugins. */
|
|
5
5
|
type AnthropicServiceTier = "auto" | "standard_only";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { D as Model,
|
|
1
|
+
import "./index-CefaUGSS.mjs";
|
|
2
|
+
import { D as Model, J as StreamOptions, W as SimpleStreamOptions, d as Context, n as Api, q as StreamFunction, s as AssistantMessageEventStreamContract } from "./types-Beemor2E.mjs";
|
|
3
3
|
//#region packages/ai/src/api-registry.d.ts
|
|
4
4
|
/** Runtime stream adapter signature stored in the API provider registry. */
|
|
5
5
|
type ApiStreamFunction = (model: Model, context: Context, options?: StreamOptions) => AssistantMessageEventStreamContract;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-uSMZJ3FA.mjs";
|
|
2
|
-
import { n as getAiTransportHost } from "./host-
|
|
2
|
+
import { n as getAiTransportHost } from "./host-BIaiBURL.mjs";
|
|
3
3
|
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-mZTCdRPo.mjs";
|
|
4
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
4
|
+
import { n as buildBaseOptions } from "./simple-options-rdOPzr7Z.mjs";
|
|
5
5
|
import { n as getEnvApiKey } from "./env-api-keys-bktO00EJ.mjs";
|
|
6
|
-
import { a as resolveResponsesReasoningEffort, i as createResponsesAssistantOutput, o as runResponsesStreamLifecycle, r as convertResponsesMessages, t as applyCommonResponsesParams } from "./openai-responses-shared-
|
|
6
|
+
import { a as resolveResponsesReasoningEffort, i as createResponsesAssistantOutput, o as runResponsesStreamLifecycle, r as convertResponsesMessages, t as applyCommonResponsesParams } from "./openai-responses-shared-CxgdGBvm.mjs";
|
|
7
7
|
import { i as resolveAzureDeploymentNameFromMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "./azure-openai-responses-client-compat-C7K7QfUE.mjs";
|
|
8
8
|
import OpenAI, { AzureOpenAI } from "openai";
|
|
9
9
|
//#region packages/ai/src/providers/azure-openai-responses.ts
|
|
@@ -25,10 +25,11 @@ function resolveDeploymentName(model, options) {
|
|
|
25
25
|
*/
|
|
26
26
|
const streamAzureOpenAIResponses = (model, context, options) => {
|
|
27
27
|
const stream = new AssistantMessageEventStream();
|
|
28
|
+
const output = createResponsesAssistantOutput(model, "azure-openai-responses");
|
|
28
29
|
runResponsesStreamLifecycle({
|
|
29
30
|
stream,
|
|
30
31
|
model,
|
|
31
|
-
output
|
|
32
|
+
output,
|
|
32
33
|
options,
|
|
33
34
|
resolveRequestModel: (requestModel) => {
|
|
34
35
|
const { baseUrl } = resolveAzureConfig(requestModel, options);
|
package/dist/diagnostics.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { i as formatThrownValue, n as createAssistantMessageDiagnostic, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-COpOtRwq.mjs";
|
|
2
|
-
import { r as projectDiagnosticValue, t as configureProviderErrorRedactor } from "./provider-error-
|
|
2
|
+
import { r as projectDiagnosticValue, t as configureProviderErrorRedactor } from "./provider-error-BI8kIViN.mjs";
|
|
3
3
|
export { appendAssistantMessageDiagnostic, configureProviderErrorRedactor, createAssistantMessageDiagnostic, extractDiagnosticError, formatThrownValue, projectDiagnosticValue };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as AssistantMessage, o as AssistantMessageEvent, s as AssistantMessageEventStreamContract } from "./types-
|
|
1
|
+
import { a as AssistantMessage, o as AssistantMessageEvent, s as AssistantMessageEventStreamContract } from "./types-Beemor2E.mjs";
|
|
2
2
|
//#region packages/llm-core/src/utils/event-stream.d.ts
|
|
3
3
|
/** Generic async-iterable event stream with a separately awaited final result. */
|
|
4
4
|
declare class EventStream<T, R = T> implements AsyncIterable<T> {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./event-stream-DcvAPSBe.mjs";
|
package/dist/event-stream.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
2
|
-
import "./event-stream-
|
|
1
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-DcvAPSBe.mjs";
|
|
2
|
+
import "./event-stream-pXT3FI6X.mjs";
|
|
3
3
|
export { AssistantMessageEventStream, EventStream, createAssistantMessageEventStream };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-uSMZJ3FA.mjs";
|
|
2
|
-
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-
|
|
3
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
2
|
+
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-BIaiBURL.mjs";
|
|
3
|
+
import { n as buildBaseOptions } from "./simple-options-rdOPzr7Z.mjs";
|
|
4
4
|
import { n as getEnvApiKey } from "./env-api-keys-bktO00EJ.mjs";
|
|
5
|
-
import { i as runGoogleGenerateContentLifecycle, n as buildGoogleSimpleThinking, r as createGoogleAssistantOutput, t as buildGoogleGenerateContentParams } from "./google-shared-
|
|
5
|
+
import { i as runGoogleGenerateContentLifecycle, n as buildGoogleSimpleThinking, r as createGoogleAssistantOutput, t as buildGoogleGenerateContentParams } from "./google-shared-Bnqni5j3.mjs";
|
|
6
6
|
import { GoogleGenAI } from "@google/genai";
|
|
7
7
|
//#region packages/ai/src/providers/google.ts
|
|
8
8
|
let toolCallCounter = 0;
|
|
9
9
|
const streamGoogle = (model, context, options) => {
|
|
10
10
|
const stream = new AssistantMessageEventStream();
|
|
11
|
+
const output = createGoogleAssistantOutput(model, "google-generative-ai");
|
|
11
12
|
runGoogleGenerateContentLifecycle({
|
|
12
13
|
stream,
|
|
13
14
|
model,
|
|
14
|
-
output
|
|
15
|
+
output,
|
|
15
16
|
options,
|
|
16
17
|
createClient: () => {
|
|
17
18
|
return createClient(model, options?.apiKey || getEnvApiKey(model.provider) || "", options?.headers);
|
|
@@ -43,8 +44,9 @@ function createClient(model, apiKey, optionsHeaders) {
|
|
|
43
44
|
...model.headers,
|
|
44
45
|
...optionsHeaders
|
|
45
46
|
});
|
|
47
|
+
const resolvedApiKey = apiKey ? getAiTransportHost().resolveSecretSentinel(apiKey) : void 0;
|
|
46
48
|
return new GoogleGenAI({
|
|
47
|
-
apiKey:
|
|
49
|
+
apiKey: resolvedApiKey,
|
|
48
50
|
httpOptions: Object.keys(httpOptions).length > 0 ? httpOptions : void 0
|
|
49
51
|
});
|
|
50
52
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as clampThinkingLevel, r as calculateCost, t as sanitizeSurrogates } from "./sanitize-unicode-
|
|
2
|
-
import { a as describeToolResultMediaPlaceholder, c as extractToolResultText, d as isImageWithMediaPayload } from "./host-
|
|
3
|
-
import { d as stripSystemPromptCacheBoundary, m as sortPromptCacheToolsByName } from "./simple-options-
|
|
4
|
-
import { _ as transportAbortError, n as coerceTransportToolCallArguments, p as notifyProviderStreamOpened, t as assignTransportErrorDetails } from "./transport-stream-shared-
|
|
1
|
+
import { i as clampThinkingLevel, r as calculateCost, t as sanitizeSurrogates } from "./sanitize-unicode-S6binQG-.mjs";
|
|
2
|
+
import { a as describeToolResultMediaPlaceholder, c as extractToolResultText, d as isImageWithMediaPayload } from "./host-BIaiBURL.mjs";
|
|
3
|
+
import { d as stripSystemPromptCacheBoundary, m as sortPromptCacheToolsByName } from "./simple-options-rdOPzr7Z.mjs";
|
|
4
|
+
import { _ as transportAbortError, n as coerceTransportToolCallArguments, p as notifyProviderStreamOpened, t as assignTransportErrorDetails } from "./transport-stream-shared-D8nQWCUo.mjs";
|
|
5
5
|
import { t as googleFlashSupportsMinimalThinking } from "./google-thinking-level-C-V3tecN.mjs";
|
|
6
|
-
import { t as transformProviderMessages } from "./provider-transcript-transform-
|
|
6
|
+
import { t as transformProviderMessages } from "./provider-transcript-transform-WvJmFUAf.mjs";
|
|
7
7
|
import { FinishReason, FunctionCallingConfigMode, ThinkingLevel } from "@google/genai";
|
|
8
8
|
//#region packages/ai/src/providers/google-shared.ts
|
|
9
9
|
/**
|
|
@@ -94,25 +94,26 @@ function convertMessages(model, context) {
|
|
|
94
94
|
};
|
|
95
95
|
for (const msg of transformedMessages) {
|
|
96
96
|
if (msg.role !== "toolResult") flushToolResultRun();
|
|
97
|
-
if (msg.role === "user")
|
|
98
|
-
|
|
99
|
-
parts: [{ text: sanitizeSurrogates(msg.content) || " " }]
|
|
100
|
-
});
|
|
101
|
-
else {
|
|
102
|
-
const parts = msg.content.map((item) => {
|
|
103
|
-
if (item.type === "text") return { text: sanitizeSurrogates(item.text) || " " };
|
|
104
|
-
return { inlineData: {
|
|
105
|
-
mimeType: item.mimeType,
|
|
106
|
-
data: item.data
|
|
107
|
-
} };
|
|
108
|
-
});
|
|
109
|
-
if (parts.length === 0) parts.push({ text: " " });
|
|
110
|
-
contents.push({
|
|
97
|
+
if (msg.role === "user") {
|
|
98
|
+
if (typeof msg.content === "string") contents.push({
|
|
111
99
|
role: "user",
|
|
112
|
-
parts
|
|
100
|
+
parts: [{ text: sanitizeSurrogates(msg.content) || " " }]
|
|
113
101
|
});
|
|
114
|
-
|
|
115
|
-
|
|
102
|
+
else {
|
|
103
|
+
const parts = msg.content.map((item) => {
|
|
104
|
+
if (item.type === "text") return { text: sanitizeSurrogates(item.text) || " " };
|
|
105
|
+
return { inlineData: {
|
|
106
|
+
mimeType: item.mimeType,
|
|
107
|
+
data: item.data
|
|
108
|
+
} };
|
|
109
|
+
});
|
|
110
|
+
if (parts.length === 0) parts.push({ text: " " });
|
|
111
|
+
contents.push({
|
|
112
|
+
role: "user",
|
|
113
|
+
parts
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
} else if (msg.role === "assistant") {
|
|
116
117
|
const parts = [];
|
|
117
118
|
let sawFunctionCall = false;
|
|
118
119
|
const isSameProviderAndModel = msg.provider === model.provider && msg.api === model.api && msg.model === model.id;
|
|
@@ -265,7 +266,8 @@ async function runGoogleGenerateContentLifecycle(params) {
|
|
|
265
266
|
});
|
|
266
267
|
} catch (error) {
|
|
267
268
|
for (const block of output.content) if ("index" in block) delete block.index;
|
|
268
|
-
|
|
269
|
+
const failure = options?.signal?.aborted ? transportAbortError(options.signal) : error;
|
|
270
|
+
assignTransportErrorDetails(output, failure, options?.signal);
|
|
269
271
|
stream.push({
|
|
270
272
|
type: "error",
|
|
271
273
|
reason: output.stopReason === "aborted" ? "aborted" : "error",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-uSMZJ3FA.mjs";
|
|
2
2
|
import { d as normalizeOptionalString } from "./utf16-slice-qz3nsy87.mjs";
|
|
3
|
-
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-
|
|
4
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
5
|
-
import { i as runGoogleGenerateContentLifecycle, n as buildGoogleSimpleThinking, r as createGoogleAssistantOutput, t as buildGoogleGenerateContentParams } from "./google-shared-
|
|
3
|
+
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-BIaiBURL.mjs";
|
|
4
|
+
import { n as buildBaseOptions } from "./simple-options-rdOPzr7Z.mjs";
|
|
5
|
+
import { i as runGoogleGenerateContentLifecycle, n as buildGoogleSimpleThinking, r as createGoogleAssistantOutput, t as buildGoogleGenerateContentParams } from "./google-shared-Bnqni5j3.mjs";
|
|
6
6
|
import { GoogleGenAI, ResourceScope } from "@google/genai";
|
|
7
7
|
//#region packages/ai/src/providers/google-vertex.ts
|
|
8
8
|
const API_VERSION = "v1";
|
|
@@ -10,10 +10,11 @@ const GCP_VERTEX_CREDENTIALS_MARKER = "gcp-vertex-credentials";
|
|
|
10
10
|
let toolCallCounter = 0;
|
|
11
11
|
const streamGoogleVertex = (model, context, options) => {
|
|
12
12
|
const stream = new AssistantMessageEventStream();
|
|
13
|
+
const output = createGoogleAssistantOutput(model, "google-vertex");
|
|
13
14
|
runGoogleGenerateContentLifecycle({
|
|
14
15
|
stream,
|
|
15
16
|
model,
|
|
16
|
-
output
|
|
17
|
+
output,
|
|
17
18
|
options,
|
|
18
19
|
createClient: () => {
|
|
19
20
|
const apiKey = resolveApiKey(options);
|
|
@@ -44,9 +45,10 @@ function createClient(model, project, location, optionsHeaders) {
|
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
47
|
function createClientWithApiKey(model, apiKey, optionsHeaders) {
|
|
48
|
+
const resolvedApiKey = getAiTransportHost().resolveSecretSentinel(apiKey);
|
|
47
49
|
return new GoogleGenAI({
|
|
48
50
|
vertexai: true,
|
|
49
|
-
apiKey:
|
|
51
|
+
apiKey: resolvedApiKey,
|
|
50
52
|
apiVersion: API_VERSION,
|
|
51
53
|
httpOptions: buildHttpOptions(model, optionsHeaders)
|
|
52
54
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as requiresClaudeMandatoryAdaptiveThinking, d as resolveClaudeMythos5ModelIdentity, f as resolveClaudeNativeThinkingLevelMap, l as resolveClaudeFable5ModelIdentity, m as resolveClaudeSonnet5ModelIdentity, p as resolveClaudeOpus5ModelIdentity, s as requiresClaudeDefaultSampling, v as supportsClaudeNativeMaxEffort, y as supportsClaudeNativeXhighEffort } from "./src-C8U7lkoa.mjs";
|
|
2
2
|
import { c as normalizeLowercaseStringOrEmpty, o as isRecord, t as truncateUtf16Safe } from "./utf16-slice-qz3nsy87.mjs";
|
|
3
|
-
import { i as clampThinkingLevel, t as sanitizeSurrogates } from "./sanitize-unicode-
|
|
3
|
+
import { i as clampThinkingLevel, t as sanitizeSurrogates } from "./sanitize-unicode-S6binQG-.mjs";
|
|
4
4
|
//#region packages/ai/src/providers/anthropic-model-contract.ts
|
|
5
5
|
const ANTHROPIC_CLAUDE_CODE_VERSION = "2.1.75";
|
|
6
6
|
const ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK = `x-anthropic-billing-header: cc_version=${ANTHROPIC_CLAUDE_CODE_VERSION}; cc_entrypoint=sdk-cli;`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { D as Model,
|
|
3
|
-
import { n as ApiRegistry } from "./api-registry-
|
|
1
|
+
import "./index-CefaUGSS.mjs";
|
|
2
|
+
import { D as Model, K as StreamFn, d as Context, n as Api } from "./types-Beemor2E.mjs";
|
|
3
|
+
import { n as ApiRegistry } from "./api-registry-BbUHEKER.mjs";
|
|
4
4
|
//#region packages/ai/src/host.d.ts
|
|
5
5
|
/** Provider capability facts needed by the package-owned transports. */
|
|
6
6
|
interface AiProviderRequestCapabilities {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as extractDiagnosticError, i as createAssistantMessageDiagnostic, n as DiagnosticErrorInfo, o as formatThrownValue, r as appendAssistantMessageDiagnostic, t as AssistantMessageDiagnostic } from "./diagnostics-BaTA9eVl.mjs";
|
|
2
|
-
import { $ as
|
|
3
|
-
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
4
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
2
|
+
import { $ as ThinkingLevel, A as ModelThinkingLevel, B as ProviderResponse, C as KnownImagesApi, D as Model, E as Message, F as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, G as StopReason, H as RawModelCostConfig, I as PricingTier, J as StreamOptions, K as StreamFn, L as Provider, M as OpenAIResponsesCompat, N as OpenRouterRouting, O as ModelCostConfig, P as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, Q as ThinkingContent, R as ProviderImagesOptions, S as KnownApi, T as MaybePromise, U as RawPricingTier, V as ProviderStreamOptions, W as SimpleStreamOptions, X as TextSignatureV1, Y as TextContent, Z as ThinkingBudgets, _ as ImagesModel, a as AssistantMessage, at as Usage, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as VercelGatewayRouting, d as Context, et as ThinkingLevelMap, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, it as Transport, j as OpenAICompletionsCompat, k as ModelCostRates, l as CacheRetention, m as ImagesContext, n as Api, nt as ToolCall, o as AssistantMessageEvent, ot as UserMessage, p as ImagesApi, q as StreamFunction, r as AssistantDeliveryTtsFacts, rt as ToolResultMessage, s as AssistantMessageEventStreamContract, st as ValidateToolArgumentsFn, t as AnthropicMessagesCompat, tt as Tool, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderReplayState } from "./types-Beemor2E.mjs";
|
|
3
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-DcvAPSBe.mjs";
|
|
4
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-CC6s7Smp.mjs";
|
|
5
5
|
//#region packages/llm-core/src/model-contracts/anthropic.d.ts
|
|
6
6
|
type ClaudeModelRef = {
|
|
7
7
|
id?: string;
|
|
@@ -98,8 +98,14 @@ declare function requiresClaudeDefaultSampling(ref: ClaudeModelRef): boolean;
|
|
|
98
98
|
* narrower route-specific contract.
|
|
99
99
|
*/
|
|
100
100
|
declare function resolveClaudeNativeThinkingLevelMap(ref: ClaudeEffortModelRef): Record<string, string | null | undefined> | undefined;
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region packages/llm-core/src/usage-cost.d.ts
|
|
103
|
+
declare function normalizeModelCostConfig(cost: RawModelCostConfig): ModelCostConfig;
|
|
104
|
+
declare function normalizeResolvedPricing(cost: Partial<RawModelCostConfig>): ModelCostConfig;
|
|
105
|
+
/** Price one model call, selecting its tier before billing the separate token buckets. */
|
|
106
|
+
declare function calculateUsageCost(usage: Partial<Pick<Usage, "input" | "output" | "cacheRead" | "cacheWrite" | "cacheWrite1h">>, pricing: RawModelCostConfig): Usage["cost"];
|
|
101
107
|
declare namespace index_d_exports {
|
|
102
|
-
export { AnthropicMessagesCompat, Api, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MaybePromise, Message, Model, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
108
|
+
export { AnthropicMessagesCompat, Api, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
103
109
|
}
|
|
104
110
|
//#endregion
|
|
105
|
-
export {
|
|
111
|
+
export { supportsClaudeAdaptiveThinking as _, CLAUDE_FABLE_5_THINKING_PROFILE as a, supportsClaudeNativeXhighEffort as b, requiresClaudeDefaultSampling as c, resolveClaudeModelIdentity as d, resolveClaudeMythos5ModelIdentity as f, supportsClaude1MContext as g, resolveClaudeSonnet5ModelIdentity as h, normalizeResolvedPricing as i, requiresClaudeMandatoryAdaptiveThinking as l, resolveClaudeOpus5ModelIdentity as m, calculateUsageCost as n, CLAUDE_OPUS_5_THINKING_PROFILE as o, resolveClaudeNativeThinkingLevelMap as p, normalizeModelCostConfig as r, CLAUDE_SONNET_5_THINKING_PROFILE as s, index_d_exports as t, resolveClaudeFable5ModelIdentity as u, supportsClaudeFastMode as v, supportsClaudeNativeMaxEffort as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as supportsClaudeAdaptiveThinking, a as CLAUDE_FABLE_5_THINKING_PROFILE, b as supportsClaudeNativeXhighEffort, c as requiresClaudeDefaultSampling, d as resolveClaudeModelIdentity, f as resolveClaudeMythos5ModelIdentity, g as supportsClaude1MContext, h as resolveClaudeSonnet5ModelIdentity, i as normalizeResolvedPricing, l as requiresClaudeMandatoryAdaptiveThinking, m as resolveClaudeOpus5ModelIdentity, n as calculateUsageCost, o as CLAUDE_OPUS_5_THINKING_PROFILE, p as resolveClaudeNativeThinkingLevelMap, r as normalizeModelCostConfig, s as CLAUDE_SONNET_5_THINKING_PROFILE, u as resolveClaudeFable5ModelIdentity, v as supportsClaudeFastMode, y as supportsClaudeNativeMaxEffort } from "./index-CefaUGSS.mjs";
|
|
2
2
|
import { a as extractDiagnosticError, i as createAssistantMessageDiagnostic, n as DiagnosticErrorInfo, o as formatThrownValue, r as appendAssistantMessageDiagnostic, t as AssistantMessageDiagnostic } from "./diagnostics-BaTA9eVl.mjs";
|
|
3
|
-
import { $ as
|
|
4
|
-
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
5
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
6
|
-
import { a as RegisteredApiProvider, i as ApiStreamSimpleFunction, n as ApiRegistry, o as createApiRegistry, r as ApiStreamFunction, t as ApiProvider } from "./api-registry-
|
|
7
|
-
import { a as AiProviderRequestPolicyInput, c as AiTransportHost, d as configureAiTransportHost, f as getAiTransportHost, i as AiProviderRequestCapabilities, l as AiTransportPluginHost, n as AiInlineImageBlock, o as AiProviderStreamHookContext, p as resolveAiTransportHeaderSentinels, r as AiInlineTextBlock, s as AiTransformTransportMessages, t as AiInlineContentBlock, u as OpenAIStrictToolSettingOptions } from "./host-
|
|
3
|
+
import { $ as ThinkingLevel, A as ModelThinkingLevel, B as ProviderResponse, C as KnownImagesApi, D as Model, E as Message, F as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, G as StopReason, H as RawModelCostConfig, I as PricingTier, J as StreamOptions, K as StreamFn, L as Provider, M as OpenAIResponsesCompat, N as OpenRouterRouting, O as ModelCostConfig, P as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, Q as ThinkingContent, R as ProviderImagesOptions, S as KnownApi, T as MaybePromise, U as RawPricingTier, V as ProviderStreamOptions, W as SimpleStreamOptions, X as TextSignatureV1, Y as TextContent, Z as ThinkingBudgets, _ as ImagesModel, a as AssistantMessage, at as Usage, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as VercelGatewayRouting, d as Context, et as ThinkingLevelMap, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, it as Transport, j as OpenAICompletionsCompat, k as ModelCostRates, l as CacheRetention, m as ImagesContext, n as Api, nt as ToolCall, o as AssistantMessageEvent, ot as UserMessage, p as ImagesApi, q as StreamFunction, r as AssistantDeliveryTtsFacts, rt as ToolResultMessage, s as AssistantMessageEventStreamContract, st as ValidateToolArgumentsFn, t as AnthropicMessagesCompat, tt as Tool, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderReplayState } from "./types-Beemor2E.mjs";
|
|
4
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-DcvAPSBe.mjs";
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-CC6s7Smp.mjs";
|
|
6
|
+
import { a as RegisteredApiProvider, i as ApiStreamSimpleFunction, n as ApiRegistry, o as createApiRegistry, r as ApiStreamFunction, t as ApiProvider } from "./api-registry-BbUHEKER.mjs";
|
|
7
|
+
import { a as AiProviderRequestPolicyInput, c as AiTransportHost, d as configureAiTransportHost, f as getAiTransportHost, i as AiProviderRequestCapabilities, l as AiTransportPluginHost, n as AiInlineImageBlock, o as AiProviderStreamHookContext, p as resolveAiTransportHeaderSentinels, r as AiInlineTextBlock, s as AiTransformTransportMessages, t as AiInlineContentBlock, u as OpenAIStrictToolSettingOptions } from "./host-DKFUAmCn.mjs";
|
|
8
8
|
//#region packages/ai/src/stream.d.ts
|
|
9
9
|
/** Creates an isolated LLM runtime backed by the supplied provider registry. */
|
|
10
10
|
export declare function createLlmRuntime(registry?: ApiRegistry): {
|
|
@@ -22,4 +22,4 @@ export declare function createLlmRuntime(registry?: ApiRegistry): {
|
|
|
22
22
|
};
|
|
23
23
|
export type LlmRuntime = ReturnType<typeof createLlmRuntime>;
|
|
24
24
|
//#endregion
|
|
25
|
-
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_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MaybePromise, Message, Model, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenAIStrictToolSettingOptions, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RegisteredApiProvider, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, getAiTransportHost, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
25
|
+
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_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, 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, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, RegisteredApiProvider, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, calculateUsageCost, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, getAiTransportHost, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { _ as supportsClaudeFastMode, a as CLAUDE_OPUS_5_THINKING_PROFILE, c as requiresClaudeMandatoryAdaptiveThinking, d as resolveClaudeMythos5ModelIdentity, f as resolveClaudeNativeThinkingLevelMap, g as supportsClaudeAdaptiveThinking, h as supportsClaude1MContext, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as resolveClaudeFable5ModelIdentity, m as resolveClaudeSonnet5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_SONNET_5_THINKING_PROFILE, p as resolveClaudeOpus5ModelIdentity, r as normalizeResolvedPricing, s as requiresClaudeDefaultSampling, t as calculateUsageCost, u as resolveClaudeModelIdentity, v as supportsClaudeNativeMaxEffort, y as supportsClaudeNativeXhighEffort } from "./src-C8U7lkoa.mjs";
|
|
2
2
|
import { n as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, t as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE } from "./types-BDdaOVi2.mjs";
|
|
3
3
|
import { i as formatThrownValue, n as createAssistantMessageDiagnostic, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-COpOtRwq.mjs";
|
|
4
4
|
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-uSMZJ3FA.mjs";
|
|
5
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-CJZtym2g.mjs";
|
|
6
6
|
import { n as createApiRegistry, t as createLlmRuntime } from "./stream-CREqxHgU.mjs";
|
|
7
|
-
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, t as configureAiTransportHost } from "./host-
|
|
8
|
-
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, EventStream, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, appendAssistantMessageDiagnostic, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, extractDiagnosticError, formatThrownValue, getAiTransportHost, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
7
|
+
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, t as configureAiTransportHost } from "./host-BIaiBURL.mjs";
|
|
8
|
+
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, EventStream, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, appendAssistantMessageDiagnostic, calculateUsageCost, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, extractDiagnosticError, formatThrownValue, getAiTransportHost, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as supportsClaudeAdaptiveThinking, b as supportsClaudeNativeXhighEffort, c as requiresClaudeDefaultSampling, d as resolveClaudeModelIdentity, f as resolveClaudeMythos5ModelIdentity, h as resolveClaudeSonnet5ModelIdentity, l as requiresClaudeMandatoryAdaptiveThinking, m as resolveClaudeOpus5ModelIdentity, p as resolveClaudeNativeThinkingLevelMap, u as resolveClaudeFable5ModelIdentity, y as supportsClaudeNativeMaxEffort } from "../index-CefaUGSS.mjs";
|
|
2
2
|
import { t as AssistantMessageDiagnostic } from "../diagnostics-BaTA9eVl.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { n as AnthropicOptions, r as AnthropicThinkingDisplay, t as AnthropicEffort } from "../provider-options-
|
|
5
|
-
import "../types-
|
|
6
|
-
import { o as resolveAnthropicServerCompactionPlan } from "../anthropic-payload-policy-
|
|
3
|
+
import { D as Model, G as StopReason, W as SimpleStreamOptions, at as Usage, d as Context, q as StreamFunction } from "../types-Beemor2E.mjs";
|
|
4
|
+
import { n as AnthropicOptions, r as AnthropicThinkingDisplay, t as AnthropicEffort } from "../provider-options-DJd_9euj.mjs";
|
|
5
|
+
import "../types-COdhCX0U.mjs";
|
|
6
|
+
import { o as resolveAnthropicServerCompactionPlan } from "../anthropic-payload-policy-BTzmNC14.mjs";
|
|
7
7
|
//#region packages/ai/src/providers/anthropic.d.ts
|
|
8
8
|
type AnthropicCompactionOptions = AnthropicOptions & {
|
|
9
9
|
anthropicServerCompaction?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as usesClaudeStreamingRefusalContract, _ as prepareClaudeNoPrefillRequestContext, b as resolveModelBoundThinkingReplayMode, f as ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, g as mapAnthropicStopReason, h as defaultsClaudeAdaptiveThinking, m as applyClaudeRequestContract, p as ANTHROPIC_CLAUDE_CODE_VERSION, v as requiresClaudeAdaptiveThinking, x as usesClaudeFable5MessagesContract, y as resolveAnthropicThinkingEffort } from "../host-
|
|
3
|
-
import { C as applyAnthropicFallbackBoundary, E as applyAnthropicRefusal, F as resolveAnthropicServerCompactionPlan, I as isAnthropicOAuthApiKey, L as omitFoundryBearerCredentialHeaders, R as usesFoundryBearerAuth, S as CLAUDE_OPUS_FALLBACK_MODEL_COST, T as resolveAnthropicFallbackServingModelCost, _ as toClaudeCodeToolName, b as ANTHROPIC_SERVER_SIDE_FALLBACKS, c as readAnthropicCacheWriteUsage, d as readLastAnthropicIterationUsage, f as normalizeAnthropicToolCallId, g as resolveOriginalAnthropicToolName, h as reconcileAnthropicToolChoice, l as readAnthropicPromptUsageSnapshot, m as projectAnthropicTools, o as applyAnthropicMessageDeltaUsage, p as normalizeAnthropicToolChoice, s as applyAnthropicMessageStartUsage, u as readAnthropicUsageTokenCount, v as ANTHROPIC_OMITTED_REASONING_TEXT, w as readAnthropicFallbackBoundary, x as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, y as findActiveAnthropicToolTurnAssistantIndex } from "../anthropic-compaction-replay-
|
|
4
|
-
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-
|
|
1
|
+
import { c as requiresClaudeMandatoryAdaptiveThinking, d as resolveClaudeMythos5ModelIdentity, f as resolveClaudeNativeThinkingLevelMap, g as supportsClaudeAdaptiveThinking, l as resolveClaudeFable5ModelIdentity, m as resolveClaudeSonnet5ModelIdentity, p as resolveClaudeOpus5ModelIdentity, s as requiresClaudeDefaultSampling, u as resolveClaudeModelIdentity, v as supportsClaudeNativeMaxEffort, y as supportsClaudeNativeXhighEffort } from "../src-C8U7lkoa.mjs";
|
|
2
|
+
import { S as usesClaudeStreamingRefusalContract, _ as prepareClaudeNoPrefillRequestContext, b as resolveModelBoundThinkingReplayMode, f as ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, g as mapAnthropicStopReason, h as defaultsClaudeAdaptiveThinking, m as applyClaudeRequestContract, p as ANTHROPIC_CLAUDE_CODE_VERSION, v as requiresClaudeAdaptiveThinking, x as usesClaudeFable5MessagesContract, y as resolveAnthropicThinkingEffort } from "../host-BIaiBURL.mjs";
|
|
3
|
+
import { C as applyAnthropicFallbackBoundary, E as applyAnthropicRefusal, F as resolveAnthropicServerCompactionPlan, I as isAnthropicOAuthApiKey, L as omitFoundryBearerCredentialHeaders, R as usesFoundryBearerAuth, S as CLAUDE_OPUS_FALLBACK_MODEL_COST, T as resolveAnthropicFallbackServingModelCost, _ as toClaudeCodeToolName, b as ANTHROPIC_SERVER_SIDE_FALLBACKS, c as readAnthropicCacheWriteUsage, d as readLastAnthropicIterationUsage, f as normalizeAnthropicToolCallId, g as resolveOriginalAnthropicToolName, h as reconcileAnthropicToolChoice, l as readAnthropicPromptUsageSnapshot, m as projectAnthropicTools, o as applyAnthropicMessageDeltaUsage, p as normalizeAnthropicToolChoice, s as applyAnthropicMessageStartUsage, u as readAnthropicUsageTokenCount, v as ANTHROPIC_OMITTED_REASONING_TEXT, w as readAnthropicFallbackBoundary, x as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, y as findActiveAnthropicToolTurnAssistantIndex } from "../anthropic-compaction-replay-CKCDrZJv.mjs";
|
|
4
|
+
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-DTGZ4VMY.mjs";
|
|
5
5
|
export { ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, 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, applyClaudeRequestContract, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, isAnthropicOAuthApiKey, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareClaudeNoPrefillRequestContext, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveModelBoundThinkingReplayMode, resolveOriginalAnthropicToolName, streamAnthropic, streamSimpleAnthropic, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName, usesClaudeFable5MessagesContract, usesClaudeStreamingRefusalContract, usesFoundryBearerAuth };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { c as OpenAIResponsesCompactionOutput, l as readOpenAIResponsesCompactionWindow, t as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-
|
|
1
|
+
import { c as OpenAIResponsesCompactionOutput, l as readOpenAIResponsesCompactionWindow, t as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-BthRXano.mjs";
|
|
2
2
|
import { i as resolveOpenAIResponsesServerCompactionPlan } from "../openai-responses-payload-policy-rLRPsSmB.mjs";
|
|
3
3
|
export { OPENAI_RESPONSES_APIS, type OpenAIResponsesCompactionOutput, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesServerCompactionPlan };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as resolveOpenAIResponsesServerCompactionPlan, f as OPENAI_RESPONSES_APIS, r as readOpenAIResponsesCompactionWindow } from "../openai-responses-compaction-window-
|
|
1
|
+
import { c as resolveOpenAIResponsesServerCompactionPlan, f as OPENAI_RESPONSES_APIS, r as readOpenAIResponsesCompactionWindow } from "../openai-responses-compaction-window-DO7yV7az.mjs";
|
|
2
2
|
export { OPENAI_RESPONSES_APIS, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesServerCompactionPlan };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as supportsOpenAIReasoningEffort, S as resolveOpenAISupportedReasoningEfforts, _ as isOpenAIGpt54MiniModel, a as CodeModeToolSurfaceObservation, b as normalizeOpenAIReasoningEffort, c as codeModeToolSurfaceObserver, d as OpenAIToolProjection, f as projectOpenAITools, g as OpenAIReasoningEffort, h as OpenAIApiReasoningEffort, i as BaseOpenAIStreamOptions, l as reasoningTagTextPolicy, m as reconcileOpenAIResponsesToolChoice, o as OpenAICompletionsOptions, p as reconcileOpenAICompletionsToolChoice, u as OpenAICompletionsToolChoice, v as isOpenAIGpt55Model, w as supportsOpenAITemperature, x as resolveOpenAIReasoningEffortForModel, y as isOpenAIGpt56Model } from "../provider-options-
|
|
3
|
-
import "../types-
|
|
4
|
-
import { o as ResponsesPromptObservation, s as responsesPromptObserver } from "../openai-responses-contracts-
|
|
5
|
-
import { t as ResolvedOpenAICompletionsCompat } from "../openai-completions-compat-
|
|
1
|
+
import { D as Model, G as StopReason, W as SimpleStreamOptions, at as Usage, d as Context, q as StreamFunction } from "../types-Beemor2E.mjs";
|
|
2
|
+
import { C as supportsOpenAIReasoningEffort, S as resolveOpenAISupportedReasoningEfforts, _ as isOpenAIGpt54MiniModel, a as CodeModeToolSurfaceObservation, b as normalizeOpenAIReasoningEffort, c as codeModeToolSurfaceObserver, d as OpenAIToolProjection, f as projectOpenAITools, g as OpenAIReasoningEffort, h as OpenAIApiReasoningEffort, i as BaseOpenAIStreamOptions, l as reasoningTagTextPolicy, m as reconcileOpenAIResponsesToolChoice, o as OpenAICompletionsOptions, p as reconcileOpenAICompletionsToolChoice, u as OpenAICompletionsToolChoice, v as isOpenAIGpt55Model, w as supportsOpenAITemperature, x as resolveOpenAIReasoningEffortForModel, y as isOpenAIGpt56Model } from "../provider-options-DJd_9euj.mjs";
|
|
3
|
+
import "../types-COdhCX0U.mjs";
|
|
4
|
+
import { o as ResponsesPromptObservation, s as responsesPromptObserver } from "../openai-responses-contracts-BthRXano.mjs";
|
|
5
|
+
import { t as ResolvedOpenAICompletionsCompat } from "../openai-completions-compat-SZhi0Lf4.mjs";
|
|
6
6
|
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-2uo_1OR1.mjs";
|
|
7
7
|
import OpenAI from "openai";
|
|
8
8
|
import { TSchema } from "typebox";
|
package/dist/internal/openai.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-mZTCdRPo.mjs";
|
|
2
|
-
import { a as codeModeToolSurfaceObserver, o as reasoningTagTextPolicy } from "../simple-options-
|
|
3
|
-
import { t as projectRuntimeToolInputSchema } from "../tool-schema-json-projection-
|
|
4
|
-
import { g as convertMessages } from "../openai-completions-stream-
|
|
5
|
-
import { A as isAzureResponsesTextDeltaEvent, D as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, E as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, M as isResponsesTextContentPartType, N as isResponsesTextDeltaEventType, O as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, P as resolveResponsesMessageSnapshotCollapse, T as readResponsesToolCallItemIdentity, d as resolveResponsesTerminalStopReason, j as isAzureResponsesTextDeltaEventType, k as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, l as mapResponsesTerminalUsage, u as readResponsesReasoningTokens, w as createResponsesToolCallTracker } from "../openai-responses-shared-
|
|
6
|
-
import { _ as cleanSchemaForGemini, a as resolveOpenAIProjectedToolsStrictToolFlag, b as reconcileOpenAIResponsesToolChoice, c as extractToolSchemaModelCompat, d as shouldOmitEmptyArrayItems, f as stripUnsupportedSchemaKeywords, g as GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, h as findLlamacppGbnfSchemaViolations, i as normalizeStrictOpenAIJsonSchema, l as normalizeToolParameterSchema, m as cleanSchemaForLlamacppGbnf, n as isStrictOpenAIJsonSchemaCompatible, o as findOpenAIStrictSchemaViolations, p as LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, r as normalizeOpenAIStrictToolParameters, s as normalizeOpenAIStrictCompatSchema, t as findOpenAIStrictToolProjectionDiagnostics, u as resolveUnsupportedToolSchemaKeywords, v as projectOpenAITools, y as reconcileOpenAICompletionsToolChoice } from "../openai-tool-schema-
|
|
7
|
-
import { A as supportsOpenAITemperature, C as isOpenAIGpt54MiniModel, D as resolveOpenAIReasoningEffortForModel, E as normalizeOpenAIReasoningEffort, O as resolveOpenAISupportedReasoningEfforts, S as responsesPromptObserver, T as isOpenAIGpt56Model, k as supportsOpenAIReasoningEffort, w as isOpenAIGpt55Model } from "../openai-responses-compaction-window-
|
|
2
|
+
import { a as codeModeToolSurfaceObserver, o as reasoningTagTextPolicy } from "../simple-options-rdOPzr7Z.mjs";
|
|
3
|
+
import { t as projectRuntimeToolInputSchema } from "../tool-schema-json-projection-BtZiml7r.mjs";
|
|
4
|
+
import { g as convertMessages } from "../openai-completions-stream-DGOvau4J.mjs";
|
|
5
|
+
import { A as isAzureResponsesTextDeltaEvent, D as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, E as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, M as isResponsesTextContentPartType, N as isResponsesTextDeltaEventType, O as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, P as resolveResponsesMessageSnapshotCollapse, T as readResponsesToolCallItemIdentity, d as resolveResponsesTerminalStopReason, j as isAzureResponsesTextDeltaEventType, k as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, l as mapResponsesTerminalUsage, u as readResponsesReasoningTokens, w as createResponsesToolCallTracker } from "../openai-responses-shared-CxgdGBvm.mjs";
|
|
6
|
+
import { _ as cleanSchemaForGemini, a as resolveOpenAIProjectedToolsStrictToolFlag, b as reconcileOpenAIResponsesToolChoice, c as extractToolSchemaModelCompat, d as shouldOmitEmptyArrayItems, f as stripUnsupportedSchemaKeywords, g as GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, h as findLlamacppGbnfSchemaViolations, i as normalizeStrictOpenAIJsonSchema, l as normalizeToolParameterSchema, m as cleanSchemaForLlamacppGbnf, n as isStrictOpenAIJsonSchemaCompatible, o as findOpenAIStrictSchemaViolations, p as LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, r as normalizeOpenAIStrictToolParameters, s as normalizeOpenAIStrictCompatSchema, t as findOpenAIStrictToolProjectionDiagnostics, u as resolveUnsupportedToolSchemaKeywords, v as projectOpenAITools, y as reconcileOpenAICompletionsToolChoice } from "../openai-tool-schema-CSMh5e9O.mjs";
|
|
7
|
+
import { A as supportsOpenAITemperature, C as isOpenAIGpt54MiniModel, D as resolveOpenAIReasoningEffortForModel, E as normalizeOpenAIReasoningEffort, O as resolveOpenAISupportedReasoningEfforts, S as responsesPromptObserver, T as isOpenAIGpt56Model, k as supportsOpenAIReasoningEffort, w as isOpenAIGpt55Model } from "../openai-responses-compaction-window-DO7yV7az.mjs";
|
|
8
8
|
import { t as mapOpenAIStopReason } from "../openai-stop-reason-Drnn_6Qj.mjs";
|
|
9
9
|
import { i as resolveAzureDeploymentNameFromMap, n as isTraditionalAzureOpenAIHost, r as parseAzureDeploymentNameMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "../azure-openai-responses-client-compat-C7K7QfUE.mjs";
|
|
10
|
-
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-
|
|
11
|
-
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-
|
|
10
|
+
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-BfFwac6f.mjs";
|
|
11
|
+
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-BAryVEJM.mjs";
|
|
12
12
|
export { AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, clampOpenAIPromptCacheKey, cleanSchemaForGemini, cleanSchemaForLlamacppGbnf, codeModeToolSurfaceObserver, convertMessages, createResponsesToolCallTracker, extractToolSchemaModelCompat, findLlamacppGbnfSchemaViolations, findOpenAIStrictSchemaViolations, findOpenAIStrictToolProjectionDiagnostics, isAzureResponsesTextDeltaEvent, isAzureResponsesTextDeltaEventType, isOpenAICompatibleAzureResponsesBaseUrl, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isResponsesTextContentPartType, isResponsesTextDeltaEventType, isStrictOpenAIJsonSchemaCompatible, isTraditionalAzureOpenAIHost, mapOpenAIStopReason, mapResponsesTerminalUsage, normalizeOpenAIReasoningEffort, normalizeOpenAIStrictCompatSchema, normalizeOpenAIStrictToolParameters, normalizeStrictOpenAIJsonSchema, normalizeToolParameterSchema, parseAzureDeploymentNameMap, projectOpenAITools, projectRuntimeToolInputSchema, readResponsesReasoningTokens, readResponsesToolCallItemIdentity, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveAzureDeploymentNameFromMap, resolveOpenAIProjectedToolsStrictToolFlag, resolveOpenAIReasoningEffortForModel, resolveOpenAISupportedReasoningEfforts, resolveResponsesMessageSnapshotCollapse, resolveResponsesTerminalStopReason, resolveUnsupportedToolSchemaKeywords, responsesPromptObserver, shouldOmitEmptyArrayItems, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, stripUnsupportedSchemaKeywords, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../index-
|
|
2
|
-
import { D as Model,
|
|
3
|
-
import { a as RegisteredApiProvider, t as ApiProvider } from "../api-registry-
|
|
4
|
-
import "../types-
|
|
1
|
+
import "../index-CefaUGSS.mjs";
|
|
2
|
+
import { A as ModelThinkingLevel, D as Model, J as StreamOptions, V as ProviderStreamOptions, W as SimpleStreamOptions, a as AssistantMessage, at as Usage, d as Context, n as Api, s as AssistantMessageEventStreamContract } from "../types-Beemor2E.mjs";
|
|
3
|
+
import { a as RegisteredApiProvider, t as ApiProvider } from "../api-registry-BbUHEKER.mjs";
|
|
4
|
+
import "../types-COdhCX0U.mjs";
|
|
5
5
|
import { t as sanitizeSurrogates } from "../sanitize-unicode-BZiVbGwK.mjs";
|
|
6
|
-
import { C as FirstStreamEventInternalOptions, D as getFirstStreamEventTimeoutHandler, E as createFirstStreamEventTimeoutError, O as getFirstStreamEventTimeoutMs, S as FirstStreamEventAbortController, T as createFirstStreamEventAbortController, g as parseTerminalToolCallArguments, k as withFirstStreamEventTimeout, w as FirstStreamEventTimeoutContext } from "../transport-stream-shared-
|
|
6
|
+
import { C as FirstStreamEventInternalOptions, D as getFirstStreamEventTimeoutHandler, E as createFirstStreamEventTimeoutError, O as getFirstStreamEventTimeoutMs, S as FirstStreamEventAbortController, T as createFirstStreamEventAbortController, g as parseTerminalToolCallArguments, k as withFirstStreamEventTimeout, w as FirstStreamEventTimeoutContext } from "../transport-stream-shared-BbG7PThh.mjs";
|
|
7
7
|
//#region packages/ai/src/internal/default-runtime.d.ts
|
|
8
8
|
export declare const defaultApiRegistry: {
|
|
9
9
|
registerApiProvider: <TApi extends Api, TOptions extends StreamOptions>(provider: ApiProvider<TApi, TOptions>, sourceId?: string) => void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { n as createApiRegistry, t as createLlmRuntime } from "../stream-CREqxHgU.mjs";
|
|
2
|
-
import { a as getSupportedThinkingLevels, i as clampThinkingLevel, n as applyProviderReportedUsageCost, o as modelsAreEqual, r as calculateCost, t as sanitizeSurrogates } from "../sanitize-unicode-
|
|
2
|
+
import { a as getSupportedThinkingLevels, i as clampThinkingLevel, n as applyProviderReportedUsageCost, o as modelsAreEqual, r as calculateCost, t as sanitizeSurrogates } from "../sanitize-unicode-S6binQG-.mjs";
|
|
3
3
|
import { n as getEnvApiKey, t as findEnvKeys } from "../env-api-keys-bktO00EJ.mjs";
|
|
4
|
-
import { C as headersToRecord, m as parseTerminalToolCallArguments } from "../transport-stream-shared-
|
|
4
|
+
import { C as headersToRecord, m as parseTerminalToolCallArguments } from "../transport-stream-shared-D8nQWCUo.mjs";
|
|
5
5
|
import { t as createDeferredEventBuffer } from "../deferred-event-buffer-DAvyP7qA.mjs";
|
|
6
6
|
import { i as repairJson, n as parseJsonWithRepair, r as parseStreamingJson, t as createToolArgumentPreviewSchedule } from "../json-parse-BuAJEbdW.mjs";
|
|
7
7
|
import { n as onLlmRequestActivity, t as notifyLlmRequestActivity } from "../llm-request-activity-BjtkplhG.mjs";
|
|
8
8
|
import { t as shortHash } from "../hash-CHgqbJmD.mjs";
|
|
9
9
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, n as createFirstStreamEventTimeoutError, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "../stream-first-event-timeout-DcNjoFQE.mjs";
|
|
10
|
-
import { t as createReasoningTagTextPartitioner } from "../reasoning-tag-text-partitioner-
|
|
10
|
+
import { t as createReasoningTagTextPartitioner } from "../reasoning-tag-text-partitioner-BsUX44Tq.mjs";
|
|
11
11
|
import { t as createSseByteGuard } from "../streaming-byte-guard-CC-HMn_u.mjs";
|
|
12
12
|
import { n as registerSessionResourceCleanup, t as cleanupSessionResources } from "../session-resources-CkR4WWy1.mjs";
|
|
13
13
|
import { n as resolveOpenAICodexAccountId, t as decodeOpenAICodexJwtPayload } from "../openai-chatgpt-jwt-KWcgd0d_.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as Model, E as Message, J as
|
|
2
|
-
import "../types-
|
|
1
|
+
import { $ as ThinkingLevel, D as Model, E as Message, J as StreamOptions, W as SimpleStreamOptions, Z as ThinkingBudgets, a as AssistantMessage, n as Api } from "../types-Beemor2E.mjs";
|
|
2
|
+
import "../types-COdhCX0U.mjs";
|
|
3
3
|
import { t as sanitizeSurrogates } from "../sanitize-unicode-BZiVbGwK.mjs";
|
|
4
4
|
import { n as normalizeStructuredPromptSection, r as sortPromptCacheToolsByName, t as normalizePromptCapabilityIds } from "../prompt-cache-stability-Cwcjv_fx.mjs";
|
|
5
5
|
//#region packages/ai/src/providers/simple-options.d.ts
|