@openclaw/ai 2026.8.1-beta.2 → 2026.8.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-B6dLpq5L.mjs → anthropic-Djj7L1rx.mjs} +49 -39
- package/dist/{anthropic-compaction-replay-8lJNKXOE.mjs → anthropic-compaction-replay-CY4tkD4V.mjs} +42 -44
- package/dist/{anthropic-payload-policy-CiEuQS72.d.mts → anthropic-payload-policy-i_5_inWe.d.mts} +4 -2
- package/dist/{api-registry-k3zTz0cV.d.mts → api-registry-C9-wZd_W.d.mts} +2 -1
- package/dist/{azure-openai-responses-mxIOtUnn.mjs → azure-openai-responses-Bj3czHNa.mjs} +4 -4
- package/dist/{number-coercion-H9qHik3g.mjs → base64-CEFBpSkN.mjs} +73 -1
- package/dist/diagnostics.d.mts +2 -3
- package/dist/diagnostics.mjs +1 -1
- package/dist/{env-api-keys-DrgeBuva.mjs → env-api-keys-bktO00EJ.mjs} +2 -15
- package/dist/event-stream-C988TSLe.d.mts +1 -0
- package/dist/{event-stream-BP6AWT8j.d.mts → event-stream-UhnxHuqt.d.mts} +1 -2
- package/dist/event-stream.d.mts +2 -1
- package/dist/{google-C7h2QzDX.mjs → google-0Ca6TYbw.mjs} +4 -4
- package/dist/{google-shared-B0Qr9OR7.mjs → google-shared-DVfL9COU.mjs} +22 -8
- package/dist/{google-vertex-Bhc3TjDl.mjs → google-vertex-5dAMxprN.mjs} +4 -4
- package/dist/{host-DTqNc7ad.mjs → host-D51fmkH6.mjs} +40 -33
- package/dist/{host-vWgMMhiJ.d.mts → host-DoPJJ1KD.d.mts} +7 -7
- package/dist/index-N3zr6__t.d.mts +105 -0
- package/dist/index.d.mts +9 -10
- package/dist/index.mjs +2 -3
- package/dist/internal/anthropic.d.mts +57 -49
- package/dist/internal/anthropic.mjs +5 -5
- package/dist/internal/openai-responses-payload-policy.d.mts +3 -3
- package/dist/internal/openai-responses-payload-policy.mjs +2 -3
- package/dist/internal/openai.d.mts +65 -63
- package/dist/internal/openai.mjs +10 -8
- package/dist/internal/retry-after.d.mts +2 -3
- package/dist/internal/runtime.d.mts +53 -40
- package/dist/internal/runtime.mjs +10 -9
- package/dist/internal/shared.d.mts +37 -23
- 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-BCnrI-kV.mjs} +64 -53
- package/dist/{openai-chatgpt-responses-CrPmqERt.mjs → openai-chatgpt-responses-CGBGWSqr.mjs} +45 -20
- package/dist/{openai-completions-BPnt4Sml.mjs → openai-completions-BaTuwID7.mjs} +63 -258
- package/dist/{openai-completions-compat-Dt3dcawL.d.mts → openai-completions-compat-DB7FFq7k.d.mts} +3 -3
- package/dist/openai-completions-stream-Bpns6uNc.mjs +1622 -0
- package/dist/{openai-responses-DhIKtOup.mjs → openai-responses-1GBcQujk.mjs} +8 -6
- package/dist/openai-responses-compaction-window-DwydGZI8.mjs +686 -0
- package/dist/{openai-responses-contracts-XpZJxrRG.d.mts → openai-responses-contracts-DgaR3t5T.d.mts} +14 -5
- package/dist/{openai-responses-payload-policy-BSs371VM.d.mts → openai-responses-payload-policy-rLRPsSmB.d.mts} +2 -0
- package/dist/{openai-responses-prompt-observer-internal-DgNTYnRY.mjs → openai-responses-prompt-observer-internal-_nhGTn2b.mjs} +3 -3
- package/dist/{openai-responses-shared-DXIt3iY5.mjs → openai-responses-shared-zPmKnhF5.mjs} +345 -1553
- package/dist/openai-stop-reason-Drnn_6Qj.mjs +28 -0
- package/dist/openai-tool-schema-Dgl4H2MU.mjs +1695 -0
- package/dist/{provider-error-BUwEnjXq.mjs → provider-error-jZP5NMTZ.mjs} +3 -82
- package/dist/{provider-options-B96RdNpH.d.mts → provider-options-HvA_slFa.d.mts} +23 -4
- package/dist/provider-transcript-transform-C01bQ5a3.mjs +32 -0
- package/dist/provider-types.d.mts +18 -17
- package/dist/providers.d.mts +5 -6
- package/dist/providers.mjs +9 -9
- package/dist/{reasoning-tag-text-partitioner-rnPwX2pg.mjs → reasoning-tag-text-partitioner-CwzKb0bA.mjs} +4 -1
- package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
- package/dist/{sanitize-unicode-BYqrYtC_.mjs → sanitize-unicode-DCkltN94.mjs} +1 -2
- package/dist/{simple-options-D58D5Kvw.mjs → simple-options-DKx86yX9.mjs} +42 -4
- package/dist/{anthropic-JsNA5KCu.mjs → src-Bu3FiFAG.mjs} +1 -1
- package/dist/{stream-first-event-timeout-MK28puvq.mjs → stream-first-event-timeout-DcNjoFQE.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-CT5ycdzn.mjs +342 -0
- package/dist/transport-stream-shared-NjwWNaRY.d.mts +138 -0
- package/dist/{transport-utils-DJqkxbhC.mjs → transport-utils-BHx9z8Cl.mjs} +9 -9
- package/dist/transports.d.mts +140 -169
- package/dist/transports.mjs +269 -1262
- package/dist/types-DtGu2d3C.d.mts +1 -0
- package/dist/{types-BHNrPS1l.d.mts → types-h38Azne1.d.mts} +53 -17
- 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-C68lP2uy.d.mts} +1 -2
- package/dist/validation.d.mts +1 -1
- package/package.json +6 -6
- package/dist/anthropic-SrGtwsJu.d.mts +0 -100
- package/dist/index-BVVgDSdq.d.mts +0 -1
- package/dist/openai-responses-contracts-CyfIkQi5.mjs +0 -253
- package/dist/openai-responses-payload-policy-BDxV-W0c.mjs +0 -206
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index-N3zr6__t.mjs";
|
|
@@ -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,28 @@ 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
|
+
/** Exact media directives consumed by the managed-media transcript rewrite owner. */
|
|
293
|
+
mediaUrls?: string[];
|
|
294
|
+
replyToCurrent?: true;
|
|
295
|
+
replyToId?: string;
|
|
296
|
+
/** Provider text phase is unresolved until the assistant turn reaches terminal state. */
|
|
297
|
+
textPhaseRequiresTerminal?: true;
|
|
298
|
+
/** Parsed once at the assistant write boundary; delivery resolves policy from these facts. */
|
|
299
|
+
tts?: AssistantDeliveryTtsFacts;
|
|
300
|
+
};
|
|
282
301
|
api: Api;
|
|
283
302
|
provider: Provider;
|
|
284
303
|
model: string;
|
|
@@ -356,13 +375,13 @@ type AssistantMessageEvent = {
|
|
|
356
375
|
type: "text_start";
|
|
357
376
|
contentIndex: number;
|
|
358
377
|
partial: AssistantMessage;
|
|
359
|
-
}
|
|
378
|
+
} |
|
|
360
379
|
/**
|
|
361
380
|
* Plain text deltas may omit `partial` to avoid retaining one full assistant
|
|
362
381
|
* snapshot per token. Consumers that need current text should replay `delta`
|
|
363
382
|
* from the latest start/end partial checkpoint.
|
|
364
383
|
*/
|
|
365
|
-
|
|
384
|
+
{
|
|
366
385
|
type: "text_delta";
|
|
367
386
|
contentIndex: number;
|
|
368
387
|
delta: string;
|
|
@@ -475,6 +494,8 @@ interface OpenAIResponsesCompat {
|
|
|
475
494
|
sendSessionIdHeader?: boolean;
|
|
476
495
|
/** Whether the provider supports `prompt_cache_retention: "24h"`. Default: true. */
|
|
477
496
|
supportsLongCacheRetention?: boolean;
|
|
497
|
+
/** Whether the provider honors top-level `instructions`. Defaults to true only for verified native routes (OpenAI, xAI); every other route defaults to false and embeds the system prompt in `input` unless set true here after verifying against that endpoint. */
|
|
498
|
+
supportsInstructions?: boolean;
|
|
478
499
|
}
|
|
479
500
|
/** Compatibility settings for Anthropic Messages-compatible APIs. */
|
|
480
501
|
interface AnthropicMessagesCompat {
|
|
@@ -534,29 +555,44 @@ interface OpenRouterRouting {
|
|
|
534
555
|
quantizations?: string[];
|
|
535
556
|
/** Sorting strategy. Can be a string (e.g., "price", "throughput", "latency") or an object with `by` and `partition`. */
|
|
536
557
|
sort?: string | {
|
|
537
|
-
/** The sorting metric: "price", "throughput", "latency". */
|
|
558
|
+
/** The sorting metric: "price", "throughput", "latency". */
|
|
559
|
+
by?: string;
|
|
560
|
+
/** Partitioning strategy: "model" (default) or "none". */
|
|
538
561
|
partition?: string | null;
|
|
539
562
|
};
|
|
540
563
|
/** Maximum price per million tokens (USD). */
|
|
541
564
|
max_price?: {
|
|
542
|
-
/** Price per million prompt tokens. */
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
565
|
+
/** Price per million prompt tokens. */
|
|
566
|
+
prompt?: number | string;
|
|
567
|
+
/** Price per million completion tokens. */
|
|
568
|
+
completion?: number | string;
|
|
569
|
+
/** Price per image. */
|
|
570
|
+
image?: number | string;
|
|
571
|
+
/** Price per audio unit. */
|
|
572
|
+
audio?: number | string;
|
|
573
|
+
/** Price per request. */
|
|
546
574
|
request?: number | string;
|
|
547
575
|
};
|
|
548
576
|
/** Preferred minimum throughput (tokens/second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. */
|
|
549
577
|
preferred_min_throughput?: number | {
|
|
550
|
-
/** Minimum tokens/second at the 50th percentile. */
|
|
551
|
-
|
|
552
|
-
|
|
578
|
+
/** Minimum tokens/second at the 50th percentile. */
|
|
579
|
+
p50?: number;
|
|
580
|
+
/** Minimum tokens/second at the 75th percentile. */
|
|
581
|
+
p75?: number;
|
|
582
|
+
/** Minimum tokens/second at the 90th percentile. */
|
|
583
|
+
p90?: number;
|
|
584
|
+
/** Minimum tokens/second at the 99th percentile. */
|
|
553
585
|
p99?: number;
|
|
554
586
|
};
|
|
555
587
|
/** Preferred maximum latency (seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. */
|
|
556
588
|
preferred_max_latency?: number | {
|
|
557
|
-
/** Maximum latency in seconds at the 50th percentile. */
|
|
558
|
-
|
|
559
|
-
|
|
589
|
+
/** Maximum latency in seconds at the 50th percentile. */
|
|
590
|
+
p50?: number;
|
|
591
|
+
/** Maximum latency in seconds at the 75th percentile. */
|
|
592
|
+
p75?: number;
|
|
593
|
+
/** Maximum latency in seconds at the 90th percentile. */
|
|
594
|
+
p90?: number;
|
|
595
|
+
/** Maximum latency in seconds at the 99th percentile. */
|
|
560
596
|
p99?: number;
|
|
561
597
|
};
|
|
562
598
|
}
|
|
@@ -590,7 +626,7 @@ interface Model<TApi extends Api = Api> {
|
|
|
590
626
|
cacheRead: number;
|
|
591
627
|
cacheWrite: number;
|
|
592
628
|
};
|
|
593
|
-
contextWindow
|
|
629
|
+
contextWindow?: number;
|
|
594
630
|
/**
|
|
595
631
|
* Optional effective runtime cap used for compaction/session budgeting.
|
|
596
632
|
* Keeps provider/native contextWindow metadata intact while allowing a
|
|
@@ -625,4 +661,4 @@ type StreamFn = (model: Model, context: Context, options?: SimpleStreamOptions)
|
|
|
625
661
|
type CompleteSimpleFn = (model: Model, context: Pick<Context, "systemPrompt" | "messages">, options?: SimpleStreamOptions) => Promise<AssistantMessage>;
|
|
626
662
|
type ValidateToolArgumentsFn = (tool: Tool, toolCall: ToolCall) => unknown;
|
|
627
663
|
//#endregion
|
|
628
|
-
export {
|
|
664
|
+
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,7 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { _ as supportsClaudeNativeXhighEffort, a as requiresClaudeDefaultSampling, c as resolveClaudeModelIdentity, d as resolveClaudeOpus5ModelIdentity, f as resolveClaudeSonnet5ModelIdentity, g as supportsClaudeNativeMaxEffort, h as supportsClaudeFastMode, i as CLAUDE_SONNET_5_THINKING_PROFILE, l as resolveClaudeMythos5ModelIdentity, m as supportsClaudeAdaptiveThinking, n as CLAUDE_FABLE_5_THINKING_PROFILE, o as requiresClaudeMandatoryAdaptiveThinking, p as supportsClaude1MContext, r as CLAUDE_OPUS_5_THINKING_PROFILE, s as resolveClaudeFable5ModelIdentity, u as resolveClaudeNativeThinkingLevelMap } from "./index-N3zr6__t.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-h38Azne1.mjs";
|
|
4
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-UhnxHuqt.mjs";
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-C68lP2uy.mjs";
|
|
6
|
+
import "./types-DtGu2d3C.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-h38Azne1.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-C68lP2uy.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
|
|
3
|
+
"version": "2026.8.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.
|
|
108
|
-
"@mistralai/mistralai": "2.
|
|
109
|
-
"openai": "
|
|
106
|
+
"@anthropic-ai/sdk": "0.120.0",
|
|
107
|
+
"@google/genai": "2.18.0",
|
|
108
|
+
"@mistralai/mistralai": "2.6.4",
|
|
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,100 +0,0 @@
|
|
|
1
|
-
//#region packages/llm-core/src/model-contracts/anthropic.d.ts
|
|
2
|
-
type ClaudeModelRef = {
|
|
3
|
-
id?: string;
|
|
4
|
-
params?: Record<string, unknown>;
|
|
5
|
-
};
|
|
6
|
-
type ClaudeEffortModelRef = ClaudeModelRef & {
|
|
7
|
-
thinkingLevelMap?: Record<string, string | null | undefined>;
|
|
8
|
-
};
|
|
9
|
-
declare const CLAUDE_FABLE_5_THINKING_PROFILE: {
|
|
10
|
-
readonly levels: readonly [{
|
|
11
|
-
readonly id: "off";
|
|
12
|
-
}, {
|
|
13
|
-
readonly id: "minimal";
|
|
14
|
-
}, {
|
|
15
|
-
readonly id: "low";
|
|
16
|
-
}, {
|
|
17
|
-
readonly id: "medium";
|
|
18
|
-
}, {
|
|
19
|
-
readonly id: "high";
|
|
20
|
-
}, {
|
|
21
|
-
readonly id: "xhigh";
|
|
22
|
-
}, {
|
|
23
|
-
readonly id: "adaptive";
|
|
24
|
-
}, {
|
|
25
|
-
readonly id: "max";
|
|
26
|
-
}];
|
|
27
|
-
readonly defaultLevel: "high";
|
|
28
|
-
readonly preserveWhenCatalogReasoningFalse: true;
|
|
29
|
-
};
|
|
30
|
-
declare const CLAUDE_SONNET_5_THINKING_PROFILE: {
|
|
31
|
-
readonly levels: readonly [{
|
|
32
|
-
readonly id: "off";
|
|
33
|
-
}, {
|
|
34
|
-
readonly id: "minimal";
|
|
35
|
-
}, {
|
|
36
|
-
readonly id: "low";
|
|
37
|
-
}, {
|
|
38
|
-
readonly id: "medium";
|
|
39
|
-
}, {
|
|
40
|
-
readonly id: "high";
|
|
41
|
-
}, {
|
|
42
|
-
readonly id: "xhigh";
|
|
43
|
-
}, {
|
|
44
|
-
readonly id: "adaptive";
|
|
45
|
-
}, {
|
|
46
|
-
readonly id: "max";
|
|
47
|
-
}];
|
|
48
|
-
readonly defaultLevel: "high";
|
|
49
|
-
};
|
|
50
|
-
declare const CLAUDE_OPUS_5_THINKING_PROFILE: {
|
|
51
|
-
readonly levels: readonly [{
|
|
52
|
-
readonly id: "off";
|
|
53
|
-
}, {
|
|
54
|
-
readonly id: "minimal";
|
|
55
|
-
}, {
|
|
56
|
-
readonly id: "low";
|
|
57
|
-
}, {
|
|
58
|
-
readonly id: "medium";
|
|
59
|
-
}, {
|
|
60
|
-
readonly id: "high";
|
|
61
|
-
}, {
|
|
62
|
-
readonly id: "xhigh";
|
|
63
|
-
}, {
|
|
64
|
-
readonly id: "adaptive";
|
|
65
|
-
}, {
|
|
66
|
-
readonly id: "max";
|
|
67
|
-
}];
|
|
68
|
-
readonly defaultLevel: "high";
|
|
69
|
-
};
|
|
70
|
-
/** Resolve the canonical normalized Claude model id for one runtime model ref. */
|
|
71
|
-
declare function resolveClaudeModelIdentity(ref: ClaudeModelRef): string;
|
|
72
|
-
/** Resolve Claude Fable 5 through direct ids, cloud ids, or deployment metadata. */
|
|
73
|
-
declare function resolveClaudeFable5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
74
|
-
/** Resolve Claude Mythos 5 through direct ids, cloud ids, or deployment metadata. */
|
|
75
|
-
declare function resolveClaudeMythos5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
76
|
-
/** Return whether a Claude model requires adaptive thinking instead of manual budgets. */
|
|
77
|
-
declare function requiresClaudeMandatoryAdaptiveThinking(ref: ClaudeModelRef): boolean;
|
|
78
|
-
/** Resolve Claude Sonnet 5 through direct ids, cloud ids, or deployment metadata. */
|
|
79
|
-
declare function resolveClaudeSonnet5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
80
|
-
/** Resolve Claude Opus 5 through aliases, direct ids, cloud ids, or deployment metadata. */
|
|
81
|
-
declare function resolveClaudeOpus5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
82
|
-
/** Return whether a Claude model supports adaptive thinking. */
|
|
83
|
-
declare function supportsClaudeAdaptiveThinking(ref: ClaudeModelRef): boolean;
|
|
84
|
-
/** Return whether a Claude model has a native 1M-token context window. */
|
|
85
|
-
declare function supportsClaude1MContext(ref: ClaudeModelRef): boolean;
|
|
86
|
-
/** Return whether a Claude model supports Anthropic's native fast mode. */
|
|
87
|
-
declare function supportsClaudeFastMode(ref: ClaudeModelRef): boolean;
|
|
88
|
-
/** Return whether a Claude model supports native max effort. */
|
|
89
|
-
declare function supportsClaudeNativeMaxEffort(ref: ClaudeModelRef): boolean;
|
|
90
|
-
/** Return whether a Claude model supports native xhigh effort. */
|
|
91
|
-
declare function supportsClaudeNativeXhighEffort(ref: ClaudeModelRef): boolean;
|
|
92
|
-
/** Return whether a Claude model rejects caller-selected sampling parameters. */
|
|
93
|
-
declare function requiresClaudeDefaultSampling(ref: ClaudeModelRef): boolean;
|
|
94
|
-
/**
|
|
95
|
-
* Fill native Claude effort mappings only when the provider did not publish a
|
|
96
|
-
* narrower route-specific contract.
|
|
97
|
-
*/
|
|
98
|
-
declare function resolveClaudeNativeThinkingLevelMap(ref: ClaudeEffortModelRef): Record<string, string | null | undefined> | undefined;
|
|
99
|
-
//#endregion
|
|
100
|
-
export { requiresClaudeMandatoryAdaptiveThinking as a, resolveClaudeMythos5ModelIdentity as c, resolveClaudeSonnet5ModelIdentity as d, supportsClaude1MContext as f, supportsClaudeNativeXhighEffort as g, supportsClaudeNativeMaxEffort as h, requiresClaudeDefaultSampling as i, resolveClaudeNativeThinkingLevelMap as l, supportsClaudeFastMode as m, CLAUDE_OPUS_5_THINKING_PROFILE as n, resolveClaudeFable5ModelIdentity as o, supportsClaudeAdaptiveThinking as p, CLAUDE_SONNET_5_THINKING_PROFILE as r, resolveClaudeModelIdentity as s, CLAUDE_FABLE_5_THINKING_PROFILE as t, resolveClaudeOpus5ModelIdentity as u };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|