@openclaw/ai 2026.8.1-beta.2 → 2026.9.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{anthropic-SrGtwsJu.d.mts → anthropic-BECQCNdF.d.mts} +0 -2
- package/dist/{anthropic-B6dLpq5L.mjs → anthropic-DI4PZKKB.mjs} +46 -34
- package/dist/{anthropic-compaction-replay-8lJNKXOE.mjs → anthropic-compaction-replay-nhKaCXu6.mjs} +17 -22
- package/dist/{anthropic-payload-policy-CiEuQS72.d.mts → anthropic-payload-policy-B_0n0enE.d.mts} +3 -1
- package/dist/{api-registry-k3zTz0cV.d.mts → api-registry-CTd8NzcD.d.mts} +2 -1
- package/dist/{azure-openai-responses-mxIOtUnn.mjs → azure-openai-responses-D8dI0ekg.mjs} +3 -3
- package/dist/diagnostics.d.mts +0 -1
- package/dist/diagnostics.mjs +1 -1
- package/dist/event-stream-BKp4fOt_.d.mts +1 -0
- package/dist/{event-stream-BP6AWT8j.d.mts → event-stream-LiXePESD.d.mts} +1 -2
- package/dist/event-stream.d.mts +2 -1
- package/dist/{google-C7h2QzDX.mjs → google-Od-LLdVK.mjs} +3 -3
- package/dist/{google-shared-B0Qr9OR7.mjs → google-shared-Bgr9lFPw.mjs} +22 -8
- package/dist/{google-vertex-Bhc3TjDl.mjs → google-vertex-aerRSXc4.mjs} +4 -4
- package/dist/{host-DTqNc7ad.mjs → host-D51fmkH6.mjs} +40 -33
- package/dist/{host-vWgMMhiJ.d.mts → host-DsbPMFU6.d.mts} +7 -7
- package/dist/index-Qbej8io0.d.mts +3 -0
- package/dist/index.d.mts +8 -8
- package/dist/index.mjs +2 -3
- package/dist/internal/anthropic.d.mts +13 -6
- package/dist/internal/anthropic.mjs +4 -4
- package/dist/internal/openai-responses-payload-policy.d.mts +2 -2
- package/dist/internal/openai-responses-payload-policy.mjs +2 -2
- package/dist/internal/openai.d.mts +6 -6
- package/dist/internal/openai.mjs +10 -8
- package/dist/internal/runtime.d.mts +18 -5
- package/dist/internal/runtime.mjs +8 -7
- package/dist/internal/shared.d.mts +18 -4
- package/dist/internal/shared.mjs +4 -4
- package/dist/{json-parse-CDnesDM_.mjs → json-parse-BuAJEbdW.mjs} +18 -2
- package/dist/{headers-DdOQtGuU.mjs → llm-request-activity-BjtkplhG.mjs} +1 -9
- package/dist/{mistral-CEWoQI_g.mjs → mistral-EiHdymeb.mjs} +59 -49
- package/dist/{openai-chatgpt-responses-CrPmqERt.mjs → openai-chatgpt-responses-DHpF9o1e.mjs} +42 -17
- package/dist/{openai-completions-BPnt4Sml.mjs → openai-completions-EFPiUGfS.mjs} +60 -257
- package/dist/{openai-completions-compat-Dt3dcawL.d.mts → openai-completions-compat-BefmHT26.d.mts} +3 -3
- package/dist/openai-completions-stream-DUlGwRMz.mjs +1621 -0
- package/dist/{openai-responses-DhIKtOup.mjs → openai-responses-BogP8OjX.mjs} +6 -5
- package/dist/{openai-responses-contracts-XpZJxrRG.d.mts → openai-responses-contracts-Dvj_UtPy.d.mts} +3 -3
- package/dist/{openai-responses-contracts-CyfIkQi5.mjs → openai-responses-contracts-QUY12X0B.mjs} +6 -26
- package/dist/{openai-responses-payload-policy-BSs371VM.d.mts → openai-responses-payload-policy-CNGFT9zr.d.mts} +1 -0
- package/dist/{openai-responses-payload-policy-BDxV-W0c.mjs → openai-responses-payload-policy-D8EdimYe.mjs} +6 -8
- package/dist/{openai-responses-prompt-observer-internal-DgNTYnRY.mjs → openai-responses-prompt-observer-internal-Cd4hJG-S.mjs} +3 -3
- package/dist/{openai-responses-shared-DXIt3iY5.mjs → openai-responses-shared-DJThc6jW.mjs} +205 -1472
- package/dist/openai-stop-reason-Drnn_6Qj.mjs +28 -0
- package/dist/openai-tool-schema-ho-hIkQf.mjs +1695 -0
- package/dist/{provider-error-BUwEnjXq.mjs → provider-error-DDOs_Bz0.mjs} +20 -27
- package/dist/provider-options-AvldWZt8.mjs +21 -0
- package/dist/{provider-options-B96RdNpH.d.mts → provider-options-MdMBLzlU.d.mts} +15 -4
- package/dist/provider-transcript-transform-C01bQ5a3.mjs +32 -0
- package/dist/provider-types.d.mts +7 -5
- package/dist/providers.d.mts +1 -2
- package/dist/providers.mjs +9 -9
- package/dist/{reasoning-tag-text-partitioner-rnPwX2pg.mjs → reasoning-tag-text-partitioner-5ygO2rZc.mjs} +3 -0
- package/dist/{sanitize-unicode-BYqrYtC_.mjs → sanitize-unicode-DCkltN94.mjs} +1 -2
- package/dist/{simple-options-D58D5Kvw.mjs → simple-options-CFj7x3J4.mjs} +5 -4
- package/dist/{anthropic-JsNA5KCu.mjs → src-Bu3FiFAG.mjs} +1 -1
- package/dist/{streaming-byte-guard-BrbkbwUu.mjs → streaming-byte-guard-CC-HMn_u.mjs} +5 -6
- package/dist/string-normalization--fwJ4S2q.mjs +16 -0
- package/dist/{tool-schema-json-projection-q5d7QX5c.mjs → tool-schema-json-projection-qvTEs5Am.mjs} +17 -8
- package/dist/transport-stream-shared-ljShVIZB.mjs +342 -0
- package/dist/transport-stream-shared-rvaCyFYt.d.mts +138 -0
- package/dist/{transport-utils-DJqkxbhC.mjs → transport-utils-LJ1_rbi-.mjs} +8 -5
- package/dist/transports.d.mts +45 -106
- package/dist/transports.mjs +134 -1089
- package/dist/{types-BHNrPS1l.d.mts → types-DhLoJbFm.d.mts} +49 -17
- package/dist/types-GiAjXatj.d.mts +1 -0
- package/dist/types.d.mts +6 -5
- package/dist/types.mjs +1 -2
- package/dist/utf16-slice-qz3nsy87.mjs +84 -0
- package/dist/{validation-DT9SrFn3.d.mts → validation-Dk7q7NMN.d.mts} +1 -2
- package/dist/validation.d.mts +1 -1
- package/package.json +5 -5
- package/dist/index-BVVgDSdq.d.mts +0 -1
- package/dist/openai-stop-reason-BkFkqqK0.mjs +0 -563
- package/dist/openai-tool-projection-CY04OcvQ.mjs +0 -338
- package/dist/provider-transcript-transform-ePx-Bbfr.mjs +0 -155
- package/dist/record-coerce-DdXsgUd_.mjs +0 -23
- package/dist/src-D2H6yKkH.mjs +0 -2
- package/dist/stream-first-event-timeout-DvDeSucC.d.mts +0 -29
- package/dist/string-coerce-fsri9iCu.mjs +0 -34
- package/dist/types-BVVgDSdq.d.mts +0 -1
- package/dist/utf16-slice-CvGodqok.mjs +0 -29
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { t as AssistantMessageDiagnostic } from "./diagnostics-BaTA9eVl.mjs";
|
|
2
2
|
import { TSchema } from "typebox";
|
|
3
|
-
|
|
4
3
|
//#region packages/llm-core/src/types.d.ts
|
|
5
4
|
/** Provider API families with first-class request/stream adapters in OpenClaw. */
|
|
6
5
|
type KnownApi = "openai-completions" | "mistral-conversations" | "openai-responses" | "azure-openai-responses" | "openai-chatgpt-responses" | "anthropic-messages" | "bedrock-converse-stream" | "google-generative-ai" | "google-vertex";
|
|
@@ -251,7 +250,8 @@ interface Usage {
|
|
|
251
250
|
output: number;
|
|
252
251
|
cacheRead: number;
|
|
253
252
|
cacheWrite: number;
|
|
254
|
-
total: number;
|
|
253
|
+
total: number;
|
|
254
|
+
/** Provenance for the recorded total cost; provider-billed totals are authoritative. */
|
|
255
255
|
totalOrigin?: "provider-billed";
|
|
256
256
|
};
|
|
257
257
|
}
|
|
@@ -276,9 +276,26 @@ interface UserMessage {
|
|
|
276
276
|
runtimeContextCarrier?: boolean;
|
|
277
277
|
}
|
|
278
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
|
+
};
|
|
279
287
|
interface AssistantMessage {
|
|
280
288
|
role: "assistant";
|
|
281
289
|
content: (TextContent | ThinkingContent | ToolCall)[];
|
|
290
|
+
openclawDelivery?: {
|
|
291
|
+
audioAsVoice?: true;
|
|
292
|
+
replyToCurrent?: true;
|
|
293
|
+
replyToId?: string;
|
|
294
|
+
/** Provider text phase is unresolved until the assistant turn reaches terminal state. */
|
|
295
|
+
textPhaseRequiresTerminal?: true;
|
|
296
|
+
/** Parsed once at the assistant write boundary; delivery resolves policy from these facts. */
|
|
297
|
+
tts?: AssistantDeliveryTtsFacts;
|
|
298
|
+
};
|
|
282
299
|
api: Api;
|
|
283
300
|
provider: Provider;
|
|
284
301
|
model: string;
|
|
@@ -356,13 +373,13 @@ type AssistantMessageEvent = {
|
|
|
356
373
|
type: "text_start";
|
|
357
374
|
contentIndex: number;
|
|
358
375
|
partial: AssistantMessage;
|
|
359
|
-
}
|
|
376
|
+
} |
|
|
360
377
|
/**
|
|
361
378
|
* Plain text deltas may omit `partial` to avoid retaining one full assistant
|
|
362
379
|
* snapshot per token. Consumers that need current text should replay `delta`
|
|
363
380
|
* from the latest start/end partial checkpoint.
|
|
364
381
|
*/
|
|
365
|
-
|
|
382
|
+
{
|
|
366
383
|
type: "text_delta";
|
|
367
384
|
contentIndex: number;
|
|
368
385
|
delta: string;
|
|
@@ -534,29 +551,44 @@ interface OpenRouterRouting {
|
|
|
534
551
|
quantizations?: string[];
|
|
535
552
|
/** Sorting strategy. Can be a string (e.g., "price", "throughput", "latency") or an object with `by` and `partition`. */
|
|
536
553
|
sort?: string | {
|
|
537
|
-
/** The sorting metric: "price", "throughput", "latency". */
|
|
554
|
+
/** The sorting metric: "price", "throughput", "latency". */
|
|
555
|
+
by?: string;
|
|
556
|
+
/** Partitioning strategy: "model" (default) or "none". */
|
|
538
557
|
partition?: string | null;
|
|
539
558
|
};
|
|
540
559
|
/** Maximum price per million tokens (USD). */
|
|
541
560
|
max_price?: {
|
|
542
|
-
/** Price per million prompt tokens. */
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
561
|
+
/** Price per million prompt tokens. */
|
|
562
|
+
prompt?: number | string;
|
|
563
|
+
/** Price per million completion tokens. */
|
|
564
|
+
completion?: number | string;
|
|
565
|
+
/** Price per image. */
|
|
566
|
+
image?: number | string;
|
|
567
|
+
/** Price per audio unit. */
|
|
568
|
+
audio?: number | string;
|
|
569
|
+
/** Price per request. */
|
|
546
570
|
request?: number | string;
|
|
547
571
|
};
|
|
548
572
|
/** Preferred minimum throughput (tokens/second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. */
|
|
549
573
|
preferred_min_throughput?: number | {
|
|
550
|
-
/** Minimum tokens/second at the 50th percentile. */
|
|
551
|
-
|
|
552
|
-
|
|
574
|
+
/** Minimum tokens/second at the 50th percentile. */
|
|
575
|
+
p50?: number;
|
|
576
|
+
/** Minimum tokens/second at the 75th percentile. */
|
|
577
|
+
p75?: number;
|
|
578
|
+
/** Minimum tokens/second at the 90th percentile. */
|
|
579
|
+
p90?: number;
|
|
580
|
+
/** Minimum tokens/second at the 99th percentile. */
|
|
553
581
|
p99?: number;
|
|
554
582
|
};
|
|
555
583
|
/** Preferred maximum latency (seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. */
|
|
556
584
|
preferred_max_latency?: number | {
|
|
557
|
-
/** Maximum latency in seconds at the 50th percentile. */
|
|
558
|
-
|
|
559
|
-
|
|
585
|
+
/** Maximum latency in seconds at the 50th percentile. */
|
|
586
|
+
p50?: number;
|
|
587
|
+
/** Maximum latency in seconds at the 75th percentile. */
|
|
588
|
+
p75?: number;
|
|
589
|
+
/** Maximum latency in seconds at the 90th percentile. */
|
|
590
|
+
p90?: number;
|
|
591
|
+
/** Maximum latency in seconds at the 99th percentile. */
|
|
560
592
|
p99?: number;
|
|
561
593
|
};
|
|
562
594
|
}
|
|
@@ -590,7 +622,7 @@ interface Model<TApi extends Api = Api> {
|
|
|
590
622
|
cacheRead: number;
|
|
591
623
|
cacheWrite: number;
|
|
592
624
|
};
|
|
593
|
-
contextWindow
|
|
625
|
+
contextWindow?: number;
|
|
594
626
|
/**
|
|
595
627
|
* Optional effective runtime cap used for compaction/session budgeting.
|
|
596
628
|
* Keeps provider/native contextWindow metadata intact while allowing a
|
|
@@ -625,4 +657,4 @@ type StreamFn = (model: Model, context: Context, options?: SimpleStreamOptions)
|
|
|
625
657
|
type CompleteSimpleFn = (model: Model, context: Pick<Context, "systemPrompt" | "messages">, options?: SimpleStreamOptions) => Promise<AssistantMessage>;
|
|
626
658
|
type ValidateToolArgumentsFn = (tool: Tool, toolCall: ToolCall) => unknown;
|
|
627
659
|
//#endregion
|
|
628
|
-
export {
|
|
660
|
+
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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index-Qbej8io0.mjs";
|
package/dist/types.d.mts
CHANGED
|
@@ -1,6 +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 "./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
|
-
|
|
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-DhLoJbFm.mjs";
|
|
4
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-LiXePESD.mjs";
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-Dk7q7NMN.mjs";
|
|
6
|
+
import "./types-GiAjXatj.mjs";
|
|
7
|
+
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,7 +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 "./
|
|
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 "./src-Bu3FiFAG.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
5
|
import { n as validateToolCall, t as validateToolArguments } from "./validation-B61OhAio.mjs";
|
|
6
|
-
import "./src-D2H6yKkH.mjs";
|
|
7
6
|
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,84 @@
|
|
|
1
|
+
//#region packages/normalization-core/src/string-coerce.ts
|
|
2
|
+
/** Reads a value only when it is already a string, preserving whitespace. */
|
|
3
|
+
function readStringValue(value) {
|
|
4
|
+
return typeof value === "string" ? value : void 0;
|
|
5
|
+
}
|
|
6
|
+
/** Trims string input and returns null for non-strings or empty strings. */
|
|
7
|
+
function normalizeNullableString(value) {
|
|
8
|
+
if (typeof value !== "string") return null;
|
|
9
|
+
const trimmed = value.trim();
|
|
10
|
+
return trimmed ? trimmed : null;
|
|
11
|
+
}
|
|
12
|
+
/** Trims string input and returns undefined for non-strings or empty strings. */
|
|
13
|
+
function normalizeOptionalString(value) {
|
|
14
|
+
return normalizeNullableString(value) ?? void 0;
|
|
15
|
+
}
|
|
16
|
+
/** Stringifies primitive ids/flags before applying optional string normalization. */
|
|
17
|
+
function normalizeStringifiedOptionalString(value) {
|
|
18
|
+
if (typeof value === "string") return normalizeOptionalString(value);
|
|
19
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return normalizeOptionalString(String(value));
|
|
20
|
+
}
|
|
21
|
+
/** Lowercases a normalized optional string. */
|
|
22
|
+
function normalizeOptionalLowercaseString(value) {
|
|
23
|
+
return normalizeOptionalString(value)?.toLowerCase();
|
|
24
|
+
}
|
|
25
|
+
/** Lowercases a normalized string or returns an empty string when absent. */
|
|
26
|
+
function normalizeLowercaseStringOrEmpty(value) {
|
|
27
|
+
return normalizeOptionalLowercaseString(value) ?? "";
|
|
28
|
+
}
|
|
29
|
+
/** Type guard for strings that remain non-empty after trimming. */
|
|
30
|
+
function hasNonEmptyString(value) {
|
|
31
|
+
return normalizeOptionalString(value) !== void 0;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region packages/normalization-core/src/record-coerce.ts
|
|
35
|
+
/** Type guard for non-array object records at browser-safe boundaries. */
|
|
36
|
+
function isRecord(value) {
|
|
37
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
38
|
+
}
|
|
39
|
+
/** Returns a non-array record or undefined. */
|
|
40
|
+
function asOptionalRecord(value) {
|
|
41
|
+
return isRecord(value) ? value : void 0;
|
|
42
|
+
}
|
|
43
|
+
/** Returns a non-array record or a fresh ordinary empty record. */
|
|
44
|
+
function asNonArrayRecord(value) {
|
|
45
|
+
return asOptionalRecord(value) ?? {};
|
|
46
|
+
}
|
|
47
|
+
/** Returns a non-array record or null. */
|
|
48
|
+
function asNullableRecord(value) {
|
|
49
|
+
return isRecord(value) ? value : null;
|
|
50
|
+
}
|
|
51
|
+
/** Returns any object-backed record, including arrays, or undefined. */
|
|
52
|
+
function asOptionalObjectRecord(value) {
|
|
53
|
+
return value && typeof value === "object" ? value : void 0;
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region packages/normalization-core/src/utf16-slice.ts
|
|
57
|
+
function isHighSurrogate(codeUnit) {
|
|
58
|
+
return codeUnit >= 55296 && codeUnit <= 56319;
|
|
59
|
+
}
|
|
60
|
+
function isLowSurrogate(codeUnit) {
|
|
61
|
+
return codeUnit >= 56320 && codeUnit <= 57343;
|
|
62
|
+
}
|
|
63
|
+
/** Slices a UTF-16 string without returning dangling surrogate halves at either edge. */
|
|
64
|
+
function sliceUtf16Safe(input, start, end) {
|
|
65
|
+
const len = input.length;
|
|
66
|
+
let from = start < 0 ? Math.max(len + start, 0) : Math.min(start, len);
|
|
67
|
+
let to = end === void 0 ? len : end < 0 ? Math.max(len + end, 0) : Math.min(end, len);
|
|
68
|
+
if (to <= from) return "";
|
|
69
|
+
if (from > 0 && from < len) {
|
|
70
|
+
if (isLowSurrogate(input.charCodeAt(from)) && isHighSurrogate(input.charCodeAt(from - 1))) from += 1;
|
|
71
|
+
}
|
|
72
|
+
if (to > 0 && to < len) {
|
|
73
|
+
if (isHighSurrogate(input.charCodeAt(to - 1)) && isLowSurrogate(input.charCodeAt(to))) to -= 1;
|
|
74
|
+
}
|
|
75
|
+
return input.slice(from, to);
|
|
76
|
+
}
|
|
77
|
+
/** Truncates a UTF-16 string without cutting a surrogate pair in half. */
|
|
78
|
+
function truncateUtf16Safe(input, maxLen) {
|
|
79
|
+
const limit = Math.max(0, Math.floor(maxLen));
|
|
80
|
+
if (input.length <= limit) return input;
|
|
81
|
+
return sliceUtf16Safe(input, 0, limit);
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
export { asOptionalRecord as a, normalizeLowercaseStringOrEmpty as c, normalizeOptionalString as d, normalizeStringifiedOptionalString as f, asOptionalObjectRecord as i, normalizeNullableString as l, asNonArrayRecord as n, isRecord as o, readStringValue as p, asNullableRecord as r, hasNonEmptyString as s, truncateUtf16Safe as t, normalizeOptionalLowercaseString as u };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { X as
|
|
2
|
-
|
|
1
|
+
import { X as Tool, Z as ToolCall } from "./types-DhLoJbFm.mjs";
|
|
3
2
|
//#region packages/llm-core/src/validation.d.ts
|
|
4
3
|
/** Finds the target tool and validates/coerces a model-emitted tool call. */
|
|
5
4
|
declare function validateToolCall(tools: Tool[], toolCall: ToolCall): unknown;
|
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-Dk7q7NMN.mjs";
|
|
2
2
|
export { validateToolArguments, validateToolCall };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/ai",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.9.1-beta.1",
|
|
4
4
|
"description": "Reusable model provider adapters and streaming runtime from OpenClaw",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -103,12 +103,12 @@
|
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@anthropic-ai/sdk": "0.
|
|
107
|
-
"@google/genai": "2.
|
|
106
|
+
"@anthropic-ai/sdk": "0.118.0",
|
|
107
|
+
"@google/genai": "2.17.1",
|
|
108
108
|
"@mistralai/mistralai": "2.5.0",
|
|
109
|
-
"openai": "
|
|
109
|
+
"openai": "7.5.0",
|
|
110
110
|
"partial-json": "0.1.7",
|
|
111
|
-
"typebox": "1.3.
|
|
111
|
+
"typebox": "1.3.16"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@openclaw/model-catalog-core": "0.0.0-private",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|