@openclaw/ai 2026.8.1-beta.1 → 2026.8.1-beta.3
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-CE-7SkF6.mjs → anthropic-B8KwTtlb.mjs} +62 -37
- package/dist/{anthropic-SrGtwsJu.d.mts → anthropic-BECQCNdF.d.mts} +0 -2
- package/dist/{src-QkygScBs.mjs → anthropic-BQXQudmA.mjs} +0 -2
- package/dist/{anthropic-usage-Ma4iX6uG.mjs → anthropic-compaction-replay-4Zx7-aCr.mjs} +225 -103
- package/dist/anthropic-payload-policy-CSx7MoKH.d.mts +50 -0
- package/dist/{api-registry-EpJoVwM1.d.mts → api-registry-DFxSnFqG.d.mts} +1 -1
- package/dist/{azure-openai-responses-Cc_kasye.mjs → azure-openai-responses-Aa4mVcYG.mjs} +23 -29
- package/dist/diagnostics.d.mts +24 -1
- package/dist/diagnostics.mjs +2 -1
- package/dist/event-stream-BVVgDSdq.d.mts +1 -0
- package/dist/{event-stream-DRmDMRHH.d.mts → event-stream-D91-ohD_.d.mts} +3 -1
- package/dist/{event-stream-CEV9t6da.mjs → event-stream-uSMZJ3FA.mjs} +16 -3
- package/dist/event-stream.d.mts +1 -1
- package/dist/event-stream.mjs +1 -1
- package/dist/{google-shared-Cq2UKx1l.mjs → google-shared-M1dl64nz.mjs} +17 -19
- package/dist/google-thinking-level-C-V3tecN.mjs +9 -0
- package/dist/{google-vertex-CusxWzvE.mjs → google-vertex-DCJHM_a5.mjs} +5 -4
- package/dist/{google-CGQu21aw.mjs → google-yDRnipeq.mjs} +4 -4
- package/dist/host-DF_yxOsA.mjs +477 -0
- package/dist/{host-Dn4_SZI2.d.mts → host-DJq_FGcz.d.mts} +13 -8
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +7 -5
- package/dist/internal/anthropic.d.mts +21 -7
- package/dist/internal/anthropic.mjs +5 -5
- package/dist/internal/openai-responses-payload-policy.d.mts +3 -0
- package/dist/internal/openai-responses-payload-policy.mjs +3 -0
- package/dist/internal/openai.d.mts +6 -6
- package/dist/internal/openai.mjs +9 -7
- package/dist/internal/runtime.d.mts +19 -5
- package/dist/internal/runtime.mjs +85 -72
- package/dist/internal/shared.d.mts +17 -8
- package/dist/internal/shared.mjs +4 -5
- package/dist/{json-parse-BvXNt1-7.mjs → json-parse-CDnesDM_.mjs} +4 -6
- package/dist/{mistral-Dx6VzNjf.mjs → mistral-D6hRXI7A.mjs} +67 -72
- package/dist/{number-coercion-1Miyb5MO.mjs → number-coercion-H9qHik3g.mjs} +7 -2
- package/dist/openai-chatgpt-jwt-KWcgd0d_.mjs +19 -0
- package/dist/{openai-chatgpt-responses-SC9m0FSf.mjs → openai-chatgpt-responses-C339VIfT.mjs} +235 -146
- package/dist/{openai-completions-BaIpl93j.mjs → openai-completions-D88orSJ9.mjs} +88 -67
- package/dist/openai-completions-compat-B0KTleXp.d.mts +43 -0
- package/dist/{openai-responses-Bdx3V_Yu.mjs → openai-responses-BXEcr-Tp.mjs} +17 -24
- package/dist/openai-responses-contracts-CD75pQ0m.d.mts +68 -0
- package/dist/openai-responses-contracts-DvILoqBk.mjs +247 -0
- package/dist/openai-responses-payload-policy-BDo8CQsx.mjs +208 -0
- package/dist/openai-responses-payload-policy-CNGFT9zr.d.mts +41 -0
- package/dist/{openai-responses-prompt-observer-internal-DDZPxRfr.mjs → openai-responses-prompt-observer-internal-BG-1AsBI.mjs} +2 -3
- package/dist/{openai-responses-stream-internal-Bl8YyVtF.mjs → openai-responses-shared-Cvt5MgEm.mjs} +1287 -1039
- package/dist/{openai-reasoning-compat-DKebnIBL.mjs → openai-stop-reason-9OONKyAm.mjs} +222 -180
- package/dist/{openai-transport-shared-Cipt7egQ.mjs → openai-tool-projection-CHGLt03m.mjs} +239 -128
- package/dist/provider-error-C8mBRJDl.mjs +424 -0
- package/dist/provider-error-CzNw4BWX.d.mts +12 -0
- package/dist/provider-options-AvldWZt8.mjs +21 -0
- package/dist/{provider-options-C5kYML7i.d.mts → provider-options-Cc5ZQ6Aa.d.mts} +19 -3
- package/dist/provider-transcript-transform--gtf0ZbR.mjs +32 -0
- package/dist/provider-types.d.mts +31 -0
- package/dist/provider-types.mjs +8 -0
- package/dist/providers.d.mts +1 -1
- package/dist/providers.mjs +17 -19
- package/dist/{reasoning-tag-text-partitioner-CGDyLWUR.mjs → reasoning-tag-text-partitioner-5ygO2rZc.mjs} +17 -8
- package/dist/record-coerce-DdXsgUd_.mjs +23 -0
- package/dist/{model-utils-Dau5dlgm.mjs → sanitize-unicode-BP7HLLZn.mjs} +28 -2
- package/dist/session-resources-CkR4WWy1.mjs +21 -0
- package/dist/simple-options-oqsXB6U3.mjs +450 -0
- package/dist/src-D2H6yKkH.mjs +2 -0
- package/dist/{stream-first-event-timeout-BIBomOGq.mjs → stream-first-event-timeout-MK28puvq.mjs} +2 -2
- package/dist/string-coerce-fsri9iCu.mjs +34 -0
- package/dist/{tool-schema-json-projection-B1b-XCn5.mjs → tool-schema-json-projection-FEr-jOoZ.mjs} +20 -13
- package/dist/transport-utils-Bv0FHkd0.mjs +138 -0
- package/dist/transports.d.mts +199 -209
- package/dist/transports.mjs +1842 -1364
- package/dist/types-BDdaOVi2.mjs +6 -0
- package/dist/{types-CH7ReIcU.d.mts → types-DTAP49HF.d.mts} +35 -2
- package/dist/types.d.mts +5 -5
- package/dist/types.mjs +6 -4
- package/dist/utf16-slice-CvGodqok.mjs +29 -0
- package/dist/{validation-DAa_yFOM.mjs → validation-B61OhAio.mjs} +6 -6
- package/dist/{validation-CcPcuEbR.d.mts → validation-DYNNrU9u.d.mts} +1 -1
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/package.json +15 -1
- package/dist/host-Bl7Kgddo.mjs +0 -407
- package/dist/openai-chatgpt-jwt-DhAAzLkj.mjs +0 -39
- package/dist/openai-responses-contracts-BBKBfAqR.d.mts +0 -116
- package/dist/openai-responses-shared-CCyMvg7M.mjs +0 -403
- package/dist/provider-error-DI0Ts28U.mjs +0 -47
- package/dist/sanitize-unicode-DT5o51ur.mjs +0 -26
- package/dist/tool-result-text-Dvkp2Dus.mjs +0 -274
- package/dist/transform-messages-DfjpNXNQ.mjs +0 -2
- package/dist/transport-stream-shared-CPNv7A3r.mjs +0 -297
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region packages/llm-core/src/types.ts
|
|
2
|
+
/** Stable error codes for provider outcomes that cannot be replayed safely. */
|
|
3
|
+
const PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE = "PROVIDER_POST_DISPATCH_AMBIGUITY";
|
|
4
|
+
const PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE = "PROVIDER_FAILURE_WITH_OUTPUT";
|
|
5
|
+
//#endregion
|
|
6
|
+
export { PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE as n, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE as t };
|
|
@@ -196,6 +196,20 @@ interface ThinkingContent {
|
|
|
196
196
|
* to the API for multi-turn continuity. */
|
|
197
197
|
redacted?: boolean;
|
|
198
198
|
}
|
|
199
|
+
/** Opaque provider-owned state that must survive transcript replay without being rendered. */
|
|
200
|
+
interface ProviderReplayState {
|
|
201
|
+
v: 1;
|
|
202
|
+
type: string;
|
|
203
|
+
id?: string;
|
|
204
|
+
data: string;
|
|
205
|
+
replayIndex?: number;
|
|
206
|
+
provider: Provider;
|
|
207
|
+
api: Api;
|
|
208
|
+
model: string;
|
|
209
|
+
baseUrlHash?: string;
|
|
210
|
+
sessionHash?: string;
|
|
211
|
+
authProfileHash?: string;
|
|
212
|
+
}
|
|
199
213
|
/** Base64 image content block with MIME type metadata. */
|
|
200
214
|
interface ImageContent {
|
|
201
215
|
type: "image";
|
|
@@ -243,6 +257,9 @@ interface Usage {
|
|
|
243
257
|
}
|
|
244
258
|
/** Normalized assistant stop reasons across text providers. */
|
|
245
259
|
type StopReason = "stop" | "length" | "toolUse" | "error" | "aborted";
|
|
260
|
+
/** Stable error codes for provider outcomes that cannot be replayed safely. */
|
|
261
|
+
declare const PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE = "PROVIDER_POST_DISPATCH_AMBIGUITY";
|
|
262
|
+
declare const PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE = "PROVIDER_FAILURE_WITH_OUTPUT";
|
|
246
263
|
/** User turn in a text-model conversation. */
|
|
247
264
|
interface UserMessage {
|
|
248
265
|
role: "user";
|
|
@@ -259,14 +276,30 @@ interface UserMessage {
|
|
|
259
276
|
runtimeContextCarrier?: boolean;
|
|
260
277
|
}
|
|
261
278
|
/** Assistant turn, including provider identity and final stop state. */
|
|
279
|
+
type AssistantDeliveryTtsFacts = {
|
|
280
|
+
tagged: true;
|
|
281
|
+
text?: string;
|
|
282
|
+
directives?: Array<{
|
|
283
|
+
provider?: string;
|
|
284
|
+
values: Record<string, string>;
|
|
285
|
+
}>;
|
|
286
|
+
};
|
|
262
287
|
interface AssistantMessage {
|
|
263
288
|
role: "assistant";
|
|
264
289
|
content: (TextContent | ThinkingContent | ToolCall)[];
|
|
290
|
+
openclawDelivery?: {
|
|
291
|
+
audioAsVoice?: true;
|
|
292
|
+
replyToCurrent?: true;
|
|
293
|
+
replyToId?: string; /** Provider text phase is unresolved until the assistant turn reaches terminal state. */
|
|
294
|
+
textPhaseRequiresTerminal?: true; /** Parsed once at the assistant write boundary; delivery resolves policy from these facts. */
|
|
295
|
+
tts?: AssistantDeliveryTtsFacts;
|
|
296
|
+
};
|
|
265
297
|
api: Api;
|
|
266
298
|
provider: Provider;
|
|
267
299
|
model: string;
|
|
268
300
|
responseModel?: string;
|
|
269
301
|
responseId?: string;
|
|
302
|
+
providerReplay?: ProviderReplayState;
|
|
270
303
|
turnId?: string;
|
|
271
304
|
diagnostics?: AssistantMessageDiagnostic[];
|
|
272
305
|
usage: Usage;
|
|
@@ -572,7 +605,7 @@ interface Model<TApi extends Api = Api> {
|
|
|
572
605
|
cacheRead: number;
|
|
573
606
|
cacheWrite: number;
|
|
574
607
|
};
|
|
575
|
-
contextWindow
|
|
608
|
+
contextWindow?: number;
|
|
576
609
|
/**
|
|
577
610
|
* Optional effective runtime cap used for compaction/session budgeting.
|
|
578
611
|
* Keeps provider/native contextWindow metadata intact while allowing a
|
|
@@ -607,4 +640,4 @@ type StreamFn = (model: Model, context: Context, options?: SimpleStreamOptions)
|
|
|
607
640
|
type CompleteSimpleFn = (model: Model, context: Pick<Context, "systemPrompt" | "messages">, options?: SimpleStreamOptions) => Promise<AssistantMessage>;
|
|
608
641
|
type ValidateToolArgumentsFn = (tool: Tool, toolCall: ToolCall) => unknown;
|
|
609
642
|
//#endregion
|
|
610
|
-
export {
|
|
643
|
+
export { Transport as $, OpenAIResponsesCompat as A, StopReason as B, KnownImagesApi as C, Model as D, Message as E, ProviderImagesOptions as F, TextSignatureV1 as G, StreamFunction as H, ProviderReplayState as I, ThinkingLevel as J, ThinkingBudgets as K, ProviderResponse as L, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE as M, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE as N, ModelThinkingLevel as O, Provider as P, ToolResultMessage as Q, ProviderStreamOptions as R, KnownApi as S, MaybePromise as T, StreamOptions as U, StreamFn as V, TextContent as W, Tool as X, ThinkingLevelMap as Y, ToolCall as Z, ImagesModel as _, AssistantMessage as a, ImagesProvider as b, AssistantMessageEventStreamLike as c, Context as d, Usage as et, ImageContent as f, ImagesInputContent as g, ImagesFunction as h, AssistantImages as i, OpenRouterRouting as j, OpenAICompletionsCompat as k, CacheRetention as l, ImagesContext as m, Api as n, ValidateToolArgumentsFn as nt, AssistantMessageEvent as o, ImagesApi as p, ThinkingContent as q, AssistantDeliveryTtsFacts as r, VercelGatewayRouting as rt, AssistantMessageEventStreamContract as s, AnthropicMessagesCompat as t, UserMessage as tt, CompleteSimpleFn as u, ImagesOptions as v, KnownImagesProvider as w, ImagesStopReason as x, ImagesOutputContent as y, SimpleStreamOptions as z };
|
package/dist/types.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as requiresClaudeMandatoryAdaptiveThinking, c as resolveClaudeMythos5ModelIdentity, d as resolveClaudeSonnet5ModelIdentity, f as supportsClaude1MContext, g as supportsClaudeNativeXhighEffort, h as supportsClaudeNativeMaxEffort, i as requiresClaudeDefaultSampling, l as resolveClaudeNativeThinkingLevelMap, m as supportsClaudeFastMode, n as CLAUDE_OPUS_5_THINKING_PROFILE, o as resolveClaudeFable5ModelIdentity, p as supportsClaudeAdaptiveThinking, r as CLAUDE_SONNET_5_THINKING_PROFILE, s as resolveClaudeModelIdentity, t as CLAUDE_FABLE_5_THINKING_PROFILE, u as resolveClaudeOpus5ModelIdentity } from "./anthropic-
|
|
1
|
+
import { a as requiresClaudeMandatoryAdaptiveThinking, c as resolveClaudeMythos5ModelIdentity, d as resolveClaudeSonnet5ModelIdentity, f as supportsClaude1MContext, g as supportsClaudeNativeXhighEffort, h as supportsClaudeNativeMaxEffort, i as requiresClaudeDefaultSampling, l as resolveClaudeNativeThinkingLevelMap, m as supportsClaudeFastMode, n as CLAUDE_OPUS_5_THINKING_PROFILE, o as resolveClaudeFable5ModelIdentity, p as supportsClaudeAdaptiveThinking, r as CLAUDE_SONNET_5_THINKING_PROFILE, s as resolveClaudeModelIdentity, t as CLAUDE_FABLE_5_THINKING_PROFILE, u as resolveClaudeOpus5ModelIdentity } from "./anthropic-BECQCNdF.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
|
-
export { AnthropicMessagesCompat, Api, 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, ProviderImagesOptions, 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 };
|
|
3
|
+
import { $ as Transport, A as OpenAIResponsesCompat, B as StopReason, C as KnownImagesApi, D as Model, E as Message, F as ProviderImagesOptions, G as TextSignatureV1, H as StreamFunction, I as ProviderReplayState, J as ThinkingLevel, K as ThinkingBudgets, L as ProviderResponse, M as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, N as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, O as ModelThinkingLevel, P as Provider, Q as ToolResultMessage, R as ProviderStreamOptions, S as KnownApi, T as MaybePromise, U as StreamOptions, V as StreamFn, W as TextContent, X as Tool, Y as ThinkingLevelMap, Z as ToolCall, _ as ImagesModel, a as AssistantMessage, b as ImagesProvider, c as AssistantMessageEventStreamLike, d as Context, et as Usage, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, j as OpenRouterRouting, k as OpenAICompletionsCompat, l as CacheRetention, m as ImagesContext, n as Api, nt as ValidateToolArgumentsFn, o as AssistantMessageEvent, p as ImagesApi, q as ThinkingContent, r as AssistantDeliveryTtsFacts, rt as VercelGatewayRouting, s as AssistantMessageEventStreamContract, t as AnthropicMessagesCompat, tt as UserMessage, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as SimpleStreamOptions } from "./types-DTAP49HF.mjs";
|
|
4
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-D91-ohD_.mjs";
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-DYNNrU9u.mjs";
|
|
6
|
+
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 };
|
package/dist/types.mjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { a as requiresClaudeMandatoryAdaptiveThinking, c as resolveClaudeMythos5ModelIdentity, d as resolveClaudeSonnet5ModelIdentity, f as supportsClaude1MContext, g as supportsClaudeNativeXhighEffort, h as supportsClaudeNativeMaxEffort, i as requiresClaudeDefaultSampling, l as resolveClaudeNativeThinkingLevelMap, m as supportsClaudeFastMode, n as CLAUDE_OPUS_5_THINKING_PROFILE, o as resolveClaudeFable5ModelIdentity, p as supportsClaudeAdaptiveThinking, r as CLAUDE_SONNET_5_THINKING_PROFILE, s as resolveClaudeModelIdentity, t as CLAUDE_FABLE_5_THINKING_PROFILE, u as resolveClaudeOpus5ModelIdentity } from "./
|
|
1
|
+
import { a as requiresClaudeMandatoryAdaptiveThinking, c as resolveClaudeMythos5ModelIdentity, d as resolveClaudeSonnet5ModelIdentity, f as supportsClaude1MContext, g as supportsClaudeNativeXhighEffort, h as supportsClaudeNativeMaxEffort, i as requiresClaudeDefaultSampling, l as resolveClaudeNativeThinkingLevelMap, m as supportsClaudeFastMode, n as CLAUDE_OPUS_5_THINKING_PROFILE, o as resolveClaudeFable5ModelIdentity, p as supportsClaudeAdaptiveThinking, r as CLAUDE_SONNET_5_THINKING_PROFILE, s as resolveClaudeModelIdentity, t as CLAUDE_FABLE_5_THINKING_PROFILE, u as resolveClaudeOpus5ModelIdentity } from "./anthropic-BQXQudmA.mjs";
|
|
2
|
+
import { n as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, t as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE } from "./types-BDdaOVi2.mjs";
|
|
2
3
|
import { i as formatThrownValue, n as createAssistantMessageDiagnostic, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-COpOtRwq.mjs";
|
|
3
|
-
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
4
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
5
|
-
|
|
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-B61OhAio.mjs";
|
|
6
|
+
import "./src-D2H6yKkH.mjs";
|
|
7
|
+
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, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region packages/normalization-core/src/utf16-slice.ts
|
|
2
|
+
function isHighSurrogate(codeUnit) {
|
|
3
|
+
return codeUnit >= 55296 && codeUnit <= 56319;
|
|
4
|
+
}
|
|
5
|
+
function isLowSurrogate(codeUnit) {
|
|
6
|
+
return codeUnit >= 56320 && codeUnit <= 57343;
|
|
7
|
+
}
|
|
8
|
+
/** Slices a UTF-16 string without returning dangling surrogate halves at either edge. */
|
|
9
|
+
function sliceUtf16Safe(input, start, end) {
|
|
10
|
+
const len = input.length;
|
|
11
|
+
let from = start < 0 ? Math.max(len + start, 0) : Math.min(start, len);
|
|
12
|
+
let to = end === void 0 ? len : end < 0 ? Math.max(len + end, 0) : Math.min(end, len);
|
|
13
|
+
if (to <= from) return "";
|
|
14
|
+
if (from > 0 && from < len) {
|
|
15
|
+
if (isLowSurrogate(input.charCodeAt(from)) && isHighSurrogate(input.charCodeAt(from - 1))) from += 1;
|
|
16
|
+
}
|
|
17
|
+
if (to > 0 && to < len) {
|
|
18
|
+
if (isHighSurrogate(input.charCodeAt(to - 1)) && isLowSurrogate(input.charCodeAt(to))) to -= 1;
|
|
19
|
+
}
|
|
20
|
+
return input.slice(from, to);
|
|
21
|
+
}
|
|
22
|
+
/** Truncates a UTF-16 string without cutting a surrogate pair in half. */
|
|
23
|
+
function truncateUtf16Safe(input, maxLen) {
|
|
24
|
+
const limit = Math.max(0, Math.floor(maxLen));
|
|
25
|
+
if (input.length <= limit) return input;
|
|
26
|
+
return sliceUtf16Safe(input, 0, limit);
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { truncateUtf16Safe as t };
|
|
@@ -3,11 +3,11 @@ import { Compile } from "typebox/compile";
|
|
|
3
3
|
const validatorCache = /* @__PURE__ */ new WeakMap();
|
|
4
4
|
/** Maximum string length accepted for schema-gated JSON coercion. */
|
|
5
5
|
const MAX_JSON_COERCE_LENGTH = 64 * 1024;
|
|
6
|
-
function
|
|
6
|
+
function isObjectBackedRecord(value) {
|
|
7
7
|
return typeof value === "object" && value !== null;
|
|
8
8
|
}
|
|
9
9
|
function isJsonSchemaObject(value) {
|
|
10
|
-
return
|
|
10
|
+
return isObjectBackedRecord(value);
|
|
11
11
|
}
|
|
12
12
|
function getSchemaTypes(schema) {
|
|
13
13
|
if (typeof schema.type === "string") return [schema.type];
|
|
@@ -22,12 +22,12 @@ function matchesJsonType(value, type) {
|
|
|
22
22
|
case "string": return typeof value === "string";
|
|
23
23
|
case "null": return value === null;
|
|
24
24
|
case "array": return Array.isArray(value);
|
|
25
|
-
case "object": return
|
|
25
|
+
case "object": return isObjectBackedRecord(value) && !Array.isArray(value);
|
|
26
26
|
default: return false;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
function isValidatorSchema(value) {
|
|
30
|
-
return
|
|
30
|
+
return isObjectBackedRecord(value);
|
|
31
31
|
}
|
|
32
32
|
const JSON_NUMBER_TOKEN_RE = /^[+-]?(?:(?:\d+\.?\d*)|(?:\.\d+))(?:e[+-]?\d+)?$/iu;
|
|
33
33
|
function parseJsonNumberString(value) {
|
|
@@ -146,7 +146,7 @@ function coerceWithJsonSchema(value, schema) {
|
|
|
146
146
|
break;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
if (schemaTypes.includes("object") &&
|
|
149
|
+
if (schemaTypes.includes("object") && isObjectBackedRecord(nextValue) && !Array.isArray(nextValue)) applySchemaObjectCoercion(nextValue, schema);
|
|
150
150
|
if (schemaTypes.includes("array") && Array.isArray(nextValue)) applySchemaArrayCoercion(nextValue, schema);
|
|
151
151
|
return nextValue;
|
|
152
152
|
}
|
|
@@ -181,7 +181,7 @@ function validateToolArguments(tool, toolCall) {
|
|
|
181
181
|
validator.Convert(args);
|
|
182
182
|
if (isJsonSchemaObject(tool.parameters)) {
|
|
183
183
|
const coerced = coerceWithJsonSchema(args, tool.parameters);
|
|
184
|
-
if (coerced !== args) if (
|
|
184
|
+
if (coerced !== args) if (isObjectBackedRecord(args) && isObjectBackedRecord(coerced)) {
|
|
185
185
|
for (const key of Object.keys(args)) delete args[key];
|
|
186
186
|
Object.assign(args, coerced);
|
|
187
187
|
} else return validator.Check(coerced) ? coerced : args;
|
package/dist/validation.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
1
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-DYNNrU9u.mjs";
|
|
2
2
|
export { validateToolArguments, validateToolCall };
|
package/dist/validation.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
1
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-B61OhAio.mjs";
|
|
2
2
|
export { validateToolArguments, validateToolCall };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/ai",
|
|
3
|
-
"version": "2026.8.1-beta.
|
|
3
|
+
"version": "2026.8.1-beta.3",
|
|
4
4
|
"description": "Reusable model provider adapters and streaming runtime from OpenClaw",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -61,6 +61,11 @@
|
|
|
61
61
|
"import": "./dist/types.mjs",
|
|
62
62
|
"default": "./dist/types.mjs"
|
|
63
63
|
},
|
|
64
|
+
"./provider-types": {
|
|
65
|
+
"types": "./dist/provider-types.d.mts",
|
|
66
|
+
"import": "./dist/provider-types.mjs",
|
|
67
|
+
"default": "./dist/provider-types.mjs"
|
|
68
|
+
},
|
|
64
69
|
"./validation": {
|
|
65
70
|
"types": "./dist/validation.d.mts",
|
|
66
71
|
"import": "./dist/validation.mjs",
|
|
@@ -76,6 +81,11 @@
|
|
|
76
81
|
"import": "./dist/internal/openai.mjs",
|
|
77
82
|
"default": "./dist/internal/openai.mjs"
|
|
78
83
|
},
|
|
84
|
+
"./internal/openai-responses-payload-policy": {
|
|
85
|
+
"types": "./dist/internal/openai-responses-payload-policy.d.mts",
|
|
86
|
+
"import": "./dist/internal/openai-responses-payload-policy.mjs",
|
|
87
|
+
"default": "./dist/internal/openai-responses-payload-policy.mjs"
|
|
88
|
+
},
|
|
79
89
|
"./internal/retry-after": {
|
|
80
90
|
"types": "./dist/internal/retry-after.d.mts",
|
|
81
91
|
"import": "./dist/internal/retry-after.mjs",
|
|
@@ -100,6 +110,10 @@
|
|
|
100
110
|
"partial-json": "0.1.7",
|
|
101
111
|
"typebox": "1.3.6"
|
|
102
112
|
},
|
|
113
|
+
"devDependencies": {
|
|
114
|
+
"@openclaw/model-catalog-core": "0.0.0-private",
|
|
115
|
+
"@openclaw/normalization-core": "0.0.0-private"
|
|
116
|
+
},
|
|
103
117
|
"engines": {
|
|
104
118
|
"node": ">=22.19.0"
|
|
105
119
|
},
|