@openclaw/ai 2026.11.3 → 2026.11.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -8
- package/dist/.source-module-urls/fe058cc430242ce2ab0dfbcbe153e240a52cf9c3072c3dc0a73e5f956b6ba49b.json +1 -0
- package/dist/anthropic-DEKgalVg.mjs +182 -0
- package/dist/{anthropic-payload-policy-C0ki72BT.d.mts → anthropic-payload-policy-CXCJ5Pmj.d.mts} +21 -4
- package/dist/{anthropic-stream-reducer-yWDb5Cct.mjs → anthropic-stream-lifecycle-DF2qVvg1.mjs} +845 -649
- package/dist/{anthropic-tool-projection-C2-d1eZ3.d.mts → anthropic-tool-projection-D5DyrL6C.d.mts} +6 -7
- package/dist/{anthropic-tool-projection-DZOKfAmL.mjs → anthropic-tool-projection-dGRfr4iT.mjs} +22 -32
- package/dist/{api-registry-gDt0faai.d.mts → api-registry-DY2MLUyg.d.mts} +2 -2
- package/dist/assistant-output-CD4kY9gu.mjs +16 -0
- package/dist/{azure-openai-responses-BvvXzZbi.mjs → azure-openai-responses-DbQV5RTx.mjs} +47 -53
- package/dist/{cloudflare-Dttf8jKq.mjs → cloudflare-BJ2_Xabx.mjs} +1 -1
- package/dist/{credential-redaction-XvsPf7Yi.d.mts → credential-redaction-DrgndwTJ.d.mts} +5 -3
- package/dist/{deferred-event-buffer-DAvyP7qA.mjs → deferred-event-buffer-tIGkTkTm.mjs} +1 -2
- package/dist/{diagnostics-v7oVEW59.mjs → diagnostics-CloVGQiK.mjs} +27 -20
- package/dist/{diagnostics-DzrF1h4J.mjs → diagnostics-o1PrVNQb.mjs} +11 -4
- package/dist/diagnostics.d.mts +6 -7
- package/dist/diagnostics.mjs +4 -4
- package/dist/{env-api-keys-Xd8dm_aV.mjs → env-api-keys-BuHc86ya.mjs} +1 -26
- package/dist/event-stream-B4ZcSvsu.d.mts +1 -0
- package/dist/{event-stream-CzpE1g_o.d.mts → event-stream-BYmtRe8-.d.mts} +1 -1
- package/dist/event-stream.d.mts +2 -2
- package/dist/event-stream.mjs +1 -2
- package/dist/expect-lbe3Hgrh.mjs +8 -0
- package/dist/{github-copilot-request-facts-F-EmvkpW.mjs → github-copilot-request-facts-BZ_EMo7X.mjs} +1 -1
- package/dist/{google-Cpi_cLKZ.mjs → google-B1g82bn4.mjs} +7 -8
- package/dist/{google-interactions-CGINbsjO.mjs → google-interactions-Ckr0Z99Z.mjs} +243 -269
- package/dist/{google-messages-DQMgG5yG.mjs → google-messages-A-9d3y5V.mjs} +52 -18
- package/dist/{google-provider-stream-BHd0cST9.mjs → google-provider-stream-CNVh4gpm.mjs} +19 -11
- package/dist/{google-shared-vtag8bj5.mjs → google-shared-WNM86ZcW.mjs} +72 -42
- package/dist/{google-vertex-eKoUnW7N.mjs → google-vertex-CXjleC6g.mjs} +3 -3
- package/dist/{google-video-slots-D8tPH8wX.mjs → google-video-slots-Bxt-OXO8.mjs} +1 -1
- package/dist/{host-CWt55nnF.mjs → host-DX7ORpeH.mjs} +46 -39
- package/dist/{host-jJOffdlW.d.mts → host-ccbwPC3A.d.mts} +17 -9
- package/dist/{host-policy-Dm7PM6AD.mjs → host-policy-jCZebuXx.mjs} +2 -2
- package/dist/index-Bczt0MnO.d.mts +17 -0
- package/dist/index.d.mts +8 -7
- package/dist/index.mjs +9 -7
- package/dist/internal/anthropic.d.mts +21 -26
- package/dist/internal/anthropic.mjs +6 -6
- package/dist/internal/google-model-family.mjs +1 -1
- package/dist/internal/google.d.mts +15 -0
- package/dist/internal/google.mjs +1 -0
- package/dist/internal/model-request-body.d.mts +37 -0
- package/dist/internal/model-request-body.mjs +106 -0
- package/dist/internal/openai-completions-compat.d.mts +1 -1
- package/dist/internal/openai-completions-compat.mjs +1 -1
- package/dist/internal/openai-responses-payload-policy.d.mts +2 -2
- package/dist/internal/openai-responses-payload-policy.mjs +2 -2
- package/dist/internal/openai.d.mts +14 -12
- package/dist/internal/openai.mjs +11 -10
- package/dist/internal/reasoning-tag-text-partitioner.d.mts +26 -0
- package/dist/{reasoning-tag-text-partitioner-CU9A4Lg8.mjs → internal/reasoning-tag-text-partitioner.mjs} +313 -111
- package/dist/internal/retry-after.d.mts +2 -2
- package/dist/internal/retry-after.mjs +96 -32
- package/dist/internal/runtime.d.mts +15 -41
- package/dist/internal/runtime.mjs +9 -10
- package/dist/internal/shared.d.mts +21 -25
- package/dist/internal/shared.mjs +9 -98
- package/dist/internal/tool-schema.d.mts +10 -10
- package/dist/internal/tool-schema.mjs +4 -4
- package/dist/{llm-request-activity-CfMuh5cC.mjs → llm-request-activity-DzaHoRAU.mjs} +2 -2
- package/dist/mistral-CjHkvsqR.mjs +3741 -0
- package/dist/{openai.LICENSE → mistral.LICENSE} +1 -1
- package/dist/{model-transport-url-BrsjjdjR.d.mts → model-transport-url-BdksnBqu.d.mts} +6 -8
- package/dist/{number-coercion-37gmNkuA.mjs → number-coercion-C7HsBgUL.mjs} +7 -2
- package/dist/observe-async-iterator-AlARO5wS.d.mts +178 -0
- package/dist/observe-async-iterator-DgmegcZR.mjs +181 -0
- package/dist/{openai-chatgpt-responses-BZa3SySh.mjs → openai-chatgpt-responses-CwS5JP7A.mjs} +61 -80
- package/dist/{openai-completions-compat-CBvb2eld.d.mts → openai-completions-compat-CJ-NsDzg.d.mts} +12 -6
- package/dist/{openai-completions-compat-bNQXF1y9.mjs → openai-completions-compat-CstlTQuF.mjs} +74 -50
- package/dist/{openai-completions-CCZ_UHCk.mjs → openai-completions-sj4S-RXQ.mjs} +5 -5
- package/dist/openai-completions-transport-BDAIA0_P.mjs +3406 -0
- package/dist/{openai-prompt-cache-DgjD-UL5.d.mts → openai-prompt-cache-BZGaIWYh.d.mts} +4 -4
- package/dist/{openai-prompt-cache-B9AvdoEo.mjs → openai-prompt-cache-CgDoFhO0.mjs} +5 -4
- package/dist/{openai-responses-compaction-replay-_sUXtcwU.d.mts → openai-responses-compaction-replay-CNHk6k53.d.mts} +4 -4
- package/dist/{openai-responses-contracts-B1nkeLL6.d.mts → openai-responses-contracts-BXMcvO7F.d.mts} +4 -10
- package/dist/{openai-responses-contracts-B5mGAbR6.mjs → openai-responses-contracts-xU-n9AJJ.mjs} +36 -37
- package/dist/{openai-responses-endpoint-CfKR6N5f.mjs → openai-responses-endpoint-DCkURKS0.mjs} +55 -8
- package/dist/openai-responses-ev_c6oTy.mjs +89 -0
- package/dist/{openai-responses-payload-policy-BzM52TTH.d.mts → openai-responses-payload-policy-DyE30gdD.d.mts} +7 -7
- package/dist/{openai-responses-request-lifecycle-CTqHc02t.mjs → openai-responses-request-lifecycle-BuOs0mwI.mjs} +12 -26
- package/dist/{openai-responses-shared-wx9v1MCn.mjs → openai-responses-shared-BmRQnUPP.mjs} +633 -1493
- package/dist/{openai-responses-terminal-usage-CpVjkqn-.d.mts → openai-responses-terminal-usage-D7IhRA6i.d.mts} +9 -3
- package/dist/{openai-tool-schema-BTEU2xmN.mjs → openai-tool-schema-CsoYgnWy.mjs} +97 -122
- package/dist/otel-Buswj0Mf.mjs +766 -0
- package/dist/{overflow-OF3PgPbw.mjs → overflow-CpApyjG2.mjs} +1 -1
- package/dist/{positive-integer-Bb4Evc7L.mjs → positive-integer-DiqE5vNi.mjs} +2 -3
- package/dist/{prompt-cache-stability-D_MeCQFI.mjs → prompt-cache-stability-w-ICeyOI.mjs} +1 -1
- package/dist/{provider-error-qtZD2inE.mjs → provider-error-DD-fo4Rz.mjs} +71 -234
- package/dist/{provider-options-DAzsyi49.d.mts → provider-options-Mo8NM5d1.d.mts} +16 -5
- package/dist/{provider-replay-context-4vxI7p4V.mjs → provider-replay-context-xyU7-CiT.mjs} +2 -2
- package/dist/provider-transcript-transform-DtaxNcC1.mjs +32 -0
- package/dist/{provider-transport-turn-state-D_GjPJHe.mjs → provider-transport-turn-state-BIS8maBK.mjs} +4 -4
- package/dist/{provider-types-CWl4VXvE.d.mts → provider-types-B1e98js5.d.mts} +3 -3
- package/dist/provider-types.d.mts +7 -6
- package/dist/providers.d.mts +2 -2
- package/dist/providers.mjs +26 -29
- package/dist/{record-coerce-CNDovvft.mjs → record-coerce-BQaoiN3r.mjs} +4 -1
- package/dist/request-headers-DO4Mqhw1.mjs +10 -0
- package/dist/{required-api-key-D088S4Cd.mjs → required-api-key-2zZTkmsi.mjs} +1 -1
- package/dist/{retry-after-BrmTv0jL.d.mts → retry-after-DnHBlFS2.d.mts} +21 -1
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/dist/{sanitize-unicode-ZqVLLEKC.d.mts → sanitize-unicode-BISmUlUv.d.mts} +2 -2
- package/dist/{simple-options-xJkqrG_E.mjs → simple-options-tLSeECry.mjs} +108 -82
- package/dist/src-BUsVkrNt.mjs +105 -0
- package/dist/{src-CyA0zJnt.mjs → src-CQ7nH2mL.mjs} +4 -7
- package/dist/stable-stringify-CchQEmeA.mjs +84 -0
- package/dist/{stream-C4YDqhFj.mjs → stream-DrtAWu7c.mjs} +2 -6
- package/dist/{stream-first-event-timeout-D_TfJHRJ.mjs → stream-first-event-timeout-B7RcufAV.mjs} +16 -13
- package/dist/{string-coerce-Cj8sqWHx.mjs → string-coerce-BCuWMIrk.mjs} +1 -1
- package/dist/string-normalization-B8TDDBX_.mjs +32 -0
- package/dist/telemetry-CvK1yQg7.mjs +582 -0
- package/dist/{tool-schema-json-projection-B1sTYwfH.mjs → tool-schema-json-projection-BQpiJlXJ.mjs} +53 -69
- package/dist/{transport-stream-shared-lhgkTOz3.mjs → transport-stream-shared-D2uFMhMc.mjs} +177 -93
- package/dist/{transport-stream-shared-8ru8eX4s.d.mts → transport-stream-shared-D3IAU4jn.d.mts} +29 -15
- package/dist/{transport-utils-DwOpuTjL.mjs → transport-utils-Da_39MYi.mjs} +23 -38
- package/dist/transports.d.mts +42 -39
- package/dist/transports.mjs +215 -296
- package/dist/{types-CVYzKrMl.d.mts → types-BVdTf0YV.d.mts} +38 -3
- package/dist/types-Cb3-5WM9.d.mts +1 -0
- package/dist/{types-BXd0kI8-.mjs → types-OVEWUaDh.mjs} +3 -1
- package/dist/types.d.mts +7 -6
- package/dist/types.mjs +7 -5
- package/dist/{validation-9FSkE8T-.mjs → validation-DGXqfvkj.mjs} +45 -27
- package/dist/{validation-BQ5u20Ru.d.mts → validation-QmyD0E5A.d.mts} +1 -1
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -2
- package/package.json +40 -6
- package/dist/anthropic-lueA8LUg.mjs +0 -221
- package/dist/assistant-output-BnQm3fov.mjs +0 -47
- package/dist/event-stream-CDpFza-M.d.mts +0 -1
- package/dist/index-DSprYWaz.d.mts +0 -185
- package/dist/mistral-CQ7aoWg2.mjs +0 -512
- package/dist/model-request-body-BD5vy4rP.d.mts +0 -17
- package/dist/openai-CiRi-nVE.mjs +0 -20077
- package/dist/openai-completions-transport-DFvSBbUT.mjs +0 -10881
- package/dist/openai-responses-DQsZKUoI.mjs +0 -87
- package/dist/rolldown-runtime-B4iAMlE-.mjs +0 -35
- package/dist/types-CBJthzJX.d.mts +0 -1
- package/dist/ws.LICENSE +0 -20
|
@@ -59,6 +59,16 @@ type ModelRoutingPercentiles = {
|
|
|
59
59
|
};
|
|
60
60
|
//#endregion
|
|
61
61
|
//#region packages/llm-core/src/utils/diagnostics.d.ts
|
|
62
|
+
/** Provider-authored findings; continuation is offered only after explicit user review. */
|
|
63
|
+
type ProviderRefusalReview = {
|
|
64
|
+
explanation: string;
|
|
65
|
+
continuation?: {
|
|
66
|
+
message: string;
|
|
67
|
+
};
|
|
68
|
+
errorType?: string;
|
|
69
|
+
};
|
|
70
|
+
/** Keep exact provider text. Truncation must never make an invalid continuation usable. */
|
|
71
|
+
declare function readProviderRefusalReview(value: unknown): ProviderRefusalReview | undefined;
|
|
62
72
|
interface DiagnosticErrorInfo {
|
|
63
73
|
name?: string;
|
|
64
74
|
message: string;
|
|
@@ -85,6 +95,8 @@ declare function createAssistantMessageDiagnostic(type: string, error: unknown,
|
|
|
85
95
|
declare function appendAssistantMessageDiagnostic(message: {
|
|
86
96
|
diagnostics?: AssistantMessageDiagnostic[];
|
|
87
97
|
}, diagnostic: AssistantMessageDiagnostic): void;
|
|
98
|
+
/** Records only the presence of hidden reasoning; never copies its content. */
|
|
99
|
+
declare function recordSuppressedReasoning(message: AssistantMessage): Error | undefined;
|
|
88
100
|
//#endregion
|
|
89
101
|
//#region packages/llm-core/src/types.d.ts
|
|
90
102
|
/** Provider API families with first-class request/stream adapters in OpenClaw. */
|
|
@@ -124,6 +136,8 @@ interface ProviderResponse {
|
|
|
124
136
|
status: number;
|
|
125
137
|
headers: Record<string, string>;
|
|
126
138
|
}
|
|
139
|
+
/** Runtime header overrides; null preserves an SDK's default-header deletion sentinel. */
|
|
140
|
+
type ModelRequestHeaders = Record<string, string | null>;
|
|
127
141
|
interface StreamOptions {
|
|
128
142
|
temperature?: number;
|
|
129
143
|
maxTokens?: number;
|
|
@@ -150,6 +164,8 @@ interface StreamOptions {
|
|
|
150
164
|
* Default: "short".
|
|
151
165
|
*/
|
|
152
166
|
cacheRetention?: CacheRetention;
|
|
167
|
+
/** Request-level cache lifetime for GPT-5.6+ Responses APIs; unset preserves provider defaults. */
|
|
168
|
+
promptCacheTtl?: "30m" | "12h";
|
|
153
169
|
/**
|
|
154
170
|
* Optional session identifier for providers that support session-based caching.
|
|
155
171
|
* Providers can use this to enable prompt caching, request routing, or other
|
|
@@ -176,6 +192,8 @@ interface StreamOptions {
|
|
|
176
192
|
* its body stream is consumed.
|
|
177
193
|
*/
|
|
178
194
|
onResponse?: (response: ProviderResponse, model: Model) => void | Promise<void>;
|
|
195
|
+
/** Local-provider wait observation. Slot waits require request-correlated backend evidence. */
|
|
196
|
+
onProviderWait?: (reason: "response" | "slot" | null) => void;
|
|
179
197
|
/**
|
|
180
198
|
* Observe a live response that accepts user input before generation finishes.
|
|
181
199
|
* `steer` resolves false only when the input was definitely not admitted;
|
|
@@ -198,7 +216,7 @@ interface StreamOptions {
|
|
|
198
216
|
* Merged with provider defaults; can override default headers.
|
|
199
217
|
* Not supported by all providers (e.g., AWS Bedrock uses SDK auth).
|
|
200
218
|
*/
|
|
201
|
-
headers?:
|
|
219
|
+
headers?: ModelRequestHeaders;
|
|
202
220
|
/**
|
|
203
221
|
* HTTP request timeout in milliseconds for providers/SDKs that support it.
|
|
204
222
|
* For example, OpenAI and Anthropic SDK clients default to 10 minutes.
|
|
@@ -335,6 +353,8 @@ interface Usage {
|
|
|
335
353
|
};
|
|
336
354
|
/** Subset of `cacheWrite` written with 1-hour retention when reported. */
|
|
337
355
|
cacheWrite1h?: number;
|
|
356
|
+
/** Subset of `cacheWrite` written with 5-minute retention when reported. */
|
|
357
|
+
cacheWrite5m?: number;
|
|
338
358
|
/**
|
|
339
359
|
* Whether usage is complete for this provider response. Missing terminal usage
|
|
340
360
|
* and provisional stream counters are unavailable, including after interruption.
|
|
@@ -381,6 +401,8 @@ type StopReason = "stop" | "length" | "toolUse" | "error" | "aborted";
|
|
|
381
401
|
/** Stable error codes for provider outcomes that cannot be replayed safely. */
|
|
382
402
|
declare const PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE = "PROVIDER_POST_DISPATCH_AMBIGUITY";
|
|
383
403
|
declare const PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE = "PROVIDER_FAILURE_WITH_OUTPUT";
|
|
404
|
+
/** The stream owner removed repetitive content before persistence and replay. */
|
|
405
|
+
declare const REPETITIVE_OUTPUT_ERROR_CODE = "openclaw_repetitive_output";
|
|
384
406
|
/** Pre-dispatch argument rejection; callers still enforce output and effect guards. */
|
|
385
407
|
declare const MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE = "malformed_tool_call_arguments";
|
|
386
408
|
declare const DEFAULT_MISSING_TOOL_RESULT_TEXT = "Tool call interrupted before a result was recorded; its outcome is unknown. Retry only if the operation is read-only or safe to repeat. If it may have had side effects, verify the current state first instead of repeating it.";
|
|
@@ -476,6 +498,8 @@ interface AssistantMessage {
|
|
|
476
498
|
provider: Provider;
|
|
477
499
|
model: string;
|
|
478
500
|
responseModel?: string;
|
|
501
|
+
/** Provider-reported access only; absent/null never confirms a requested program. */
|
|
502
|
+
responseAccessProgram?: "standard" | "daybreak_blue" | "daybreak_red" | null;
|
|
479
503
|
responseId?: string;
|
|
480
504
|
providerReplay?: ProviderReplayState;
|
|
481
505
|
turnId?: string;
|
|
@@ -529,8 +553,15 @@ interface Tool<TParameters extends TSchema = TSchema> {
|
|
|
529
553
|
*/
|
|
530
554
|
async?: false;
|
|
531
555
|
}
|
|
556
|
+
/** Derived prompt bytes belong to this exact immutable text revision. */
|
|
557
|
+
interface PreparedSystemPrompt {
|
|
558
|
+
readonly text: string;
|
|
559
|
+
readonly stripped: string;
|
|
560
|
+
readonly instructions: string;
|
|
561
|
+
}
|
|
532
562
|
interface Context {
|
|
533
563
|
systemPrompt?: string;
|
|
564
|
+
preparedSystemPrompt?: PreparedSystemPrompt;
|
|
534
565
|
messages: Message[];
|
|
535
566
|
tools?: Tool[];
|
|
536
567
|
}
|
|
@@ -789,10 +820,14 @@ interface Model<TApi extends Api = Api> {
|
|
|
789
820
|
* smaller practical window.
|
|
790
821
|
*/
|
|
791
822
|
contextTokens?: number;
|
|
823
|
+
/** Provider/catalog-declared total parameter count, including inactive experts. */
|
|
824
|
+
parameterCount?: number;
|
|
825
|
+
/** Provider/catalog-declared canonical developer lineage, such as `anthropic`. */
|
|
826
|
+
family?: string;
|
|
792
827
|
maxTokens: number;
|
|
793
828
|
/** Provider-specific request/runtime parameters passed through to provider plugins. */
|
|
794
829
|
params?: Record<string, unknown>;
|
|
795
|
-
headers?:
|
|
830
|
+
headers?: ModelRequestHeaders;
|
|
796
831
|
/** Sends runtime credentials as Authorization: Bearer instead of provider-specific key headers. */
|
|
797
832
|
authHeader?: boolean;
|
|
798
833
|
/** Compatibility overrides for OpenAI-compatible APIs. If not set, auto-detected from baseUrl. */
|
|
@@ -809,4 +844,4 @@ type StreamFn = (model: Model, context: Context, options?: SimpleStreamOptions)
|
|
|
809
844
|
type CompleteSimpleFn = (model: Model, context: Pick<Context, "systemPrompt" | "messages">, options?: SimpleStreamOptions) => Promise<AssistantMessage>;
|
|
810
845
|
type ValidateToolArgumentsFn = (tool: Tool, toolCall: ToolCall) => unknown;
|
|
811
846
|
//#endregion
|
|
812
|
-
export {
|
|
847
|
+
export { RawPricingTier as $, ModelCostConfig as A, DiagnosticErrorInfo as At, PricingTier as B, KnownApi as C, isRuntimeContextMessage as Ct, MaybePromise as D, runtimeContextContentToText as Dt, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE as E, readRuntimeContextMetadata as Et, OpenAIResponsesCompat as F, formatThrownValue as Ft, ProviderStreamOptions as G, ProviderImagesOptions as H, OpenRouterRouting as I, isProviderRefusalAssistantError as It, RUNTIME_CONTEXT_CUSTOM_TYPE as J, REPETITIVE_OUTPUT_ERROR_CODE as K, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE as L, readProviderRefusalReview as Lt, ModelRequestHeaders as M, appendAssistantMessageDiagnostic as Mt, ModelThinkingLevel as N, createAssistantMessageDiagnostic as Nt, Message as O, setRuntimeContextRetention as Ot, OpenAICompletionsCompat as P, extractDiagnosticError as Pt, RawModelCostConfig as Q, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE as R, recordSuppressedReasoning as Rt, ImagesStopReason as S, hasRuntimeContextMarker as St, KnownImagesProvider as T, labelRuntimeContextText as Tt, ProviderReplayState as U, Provider as V, ProviderResponse as W, RUNTIME_CONTEXT_FOOTER as X, RUNTIME_CONTEXT_END_MARKER as Y, RUNTIME_CONTEXT_HEADER as Z, ImagesInputContent as _, UserMessage as _t, AssistantMessage as a, StreamOptions as at, ImagesOutputContent as b, escapeRuntimeContextFooter as bt, AssistantMessageEventStreamLike as c, ThinkingBudgets as ct, Context as d, ThinkingLevelMap as dt, RuntimeContextMessage as et, DEFAULT_MISSING_TOOL_RESULT_TEXT as f, Tool as ft, ImagesFunction as g, Usage as gt, ImagesContext as h, Transport as ht, AssistantImages as i, StreamFunction as it, ModelCostRates as j, ProviderRefusalReview as jt, Model as k, AssistantMessageDiagnostic as kt, CacheRetention as l, ThinkingContent as lt, ImagesApi as m, ToolResultMessage as mt, Api as n, StopReason as nt, AssistantMessageEvent as o, TextContent as ot, ImageContent as p, ToolCall as pt, RUNTIME_CONTEXT_BEGIN_MARKER as q, AssistantDeliveryTtsFacts as r, StreamFn as rt, AssistantMessageEventStreamContract as s, TextSignatureV1 as st, AnthropicMessagesCompat as t, SimpleStreamOptions as tt, CompleteSimpleFn as u, ThinkingLevel as ut, ImagesModel as v, ValidateToolArgumentsFn as vt, KnownImagesApi as w, labelRuntimeContextContent as wt, ImagesProvider as x, hasLegacyRuntimeContextEnvelope as xt, ImagesOptions as y, VercelGatewayRouting as yt, PreparedSystemPrompt as z, ModelDataThinkingFormat as zt };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index-Bczt0MnO.mjs";
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/** Stable error codes for provider outcomes that cannot be replayed safely. */
|
|
3
3
|
const PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE = "PROVIDER_POST_DISPATCH_AMBIGUITY";
|
|
4
4
|
const PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE = "PROVIDER_FAILURE_WITH_OUTPUT";
|
|
5
|
+
/** The stream owner removed repetitive content before persistence and replay. */
|
|
6
|
+
const REPETITIVE_OUTPUT_ERROR_CODE = "openclaw_repetitive_output";
|
|
5
7
|
/** Pre-dispatch argument rejection; callers still enforce output and effect guards. */
|
|
6
8
|
const MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE = "malformed_tool_call_arguments";
|
|
7
9
|
const DEFAULT_MISSING_TOOL_RESULT_TEXT = "Tool call interrupted before a result was recorded; its outcome is unknown. Retry only if the operation is read-only or safe to repeat. If it may have had side effects, verify the current state first instead of repeating it.";
|
|
@@ -66,4 +68,4 @@ function setRuntimeContextRetention(message, retained) {
|
|
|
66
68
|
message.runtimeContextCarrierRetained = retained;
|
|
67
69
|
}
|
|
68
70
|
//#endregion
|
|
69
|
-
export {
|
|
71
|
+
export { readRuntimeContextMetadata as _, REPETITIVE_OUTPUT_ERROR_CODE as a, RUNTIME_CONTEXT_END_MARKER as c, escapeRuntimeContextFooter as d, hasLegacyRuntimeContextEnvelope as f, labelRuntimeContextText as g, labelRuntimeContextContent as h, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE as i, RUNTIME_CONTEXT_FOOTER as l, isRuntimeContextMessage as m, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE as n, RUNTIME_CONTEXT_BEGIN_MARKER as o, hasRuntimeContextMarker as p, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE as r, RUNTIME_CONTEXT_CUSTOM_TYPE as s, DEFAULT_MISSING_TOOL_RESULT_TEXT as t, RUNTIME_CONTEXT_HEADER as u, runtimeContextContentToText as v, setRuntimeContextRetention as y };
|
package/dist/types.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as
|
|
3
|
-
import { n as
|
|
4
|
-
import { n as
|
|
5
|
-
import "./
|
|
6
|
-
|
|
1
|
+
import { C as supportsClaudeFastMode, D as supportsClaudeServerCompaction, E as supportsClaudeNativeXhighEffort, S as supportsClaudeAdaptiveThinking, T as supportsClaudeNativeMaxEffort, _ as resolveClaudeOpus55ModelIdentity, a as CLAUDE_OPUS_5_THINKING_PROFILE, b as resolveClaudeSonnet5ModelIdentity, c as bindsClaudeThinkingPrefix, d as requiresClaudeMandatoryAdaptiveThinking, f as resolveClaudeFable5ModelIdentity, g as resolveClaudeNativeThinkingLevelMap, h as resolveClaudeMythos5ModelIdentity, i as CLAUDE_OPUS_55_THINKING_PROFILE, l as requiresClaudeBetweenToolsThinking, m as resolveClaudeModelIdentity, n as CLAUDE_FABLE_5_THINKING_PROFILE, o as CLAUDE_SONNET_55_THINKING_PROFILE, p as resolveClaudeHaiku55ModelIdentity, r as CLAUDE_HAIKU_55_THINKING_PROFILE, s as CLAUDE_SONNET_5_THINKING_PROFILE, t as observeAsyncIterator, u as requiresClaudeDefaultSampling, v as resolveClaudeOpus5ModelIdentity, w as supportsClaudeInHistorySystemMessages, x as supportsClaude1MContext, y as resolveClaudeSonnet55ModelIdentity } from "./observe-async-iterator-AlARO5wS.mjs";
|
|
2
|
+
import { $ as RawPricingTier, A as ModelCostConfig, At as DiagnosticErrorInfo, B as PricingTier, C as KnownApi, Ct as isRuntimeContextMessage, D as MaybePromise, Dt as runtimeContextContentToText, E as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, Et as readRuntimeContextMetadata, F as OpenAIResponsesCompat, Ft as formatThrownValue, G as ProviderStreamOptions, H as ProviderImagesOptions, I as OpenRouterRouting, It as isProviderRefusalAssistantError, J as RUNTIME_CONTEXT_CUSTOM_TYPE, K as REPETITIVE_OUTPUT_ERROR_CODE, L as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, Lt as readProviderRefusalReview, M as ModelRequestHeaders, Mt as appendAssistantMessageDiagnostic, N as ModelThinkingLevel, Nt as createAssistantMessageDiagnostic, O as Message, Ot as setRuntimeContextRetention, P as OpenAICompletionsCompat, Pt as extractDiagnosticError, Q as RawModelCostConfig, R as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, Rt as recordSuppressedReasoning, S as ImagesStopReason, St as hasRuntimeContextMarker, T as KnownImagesProvider, Tt as labelRuntimeContextText, U as ProviderReplayState, V as Provider, W as ProviderResponse, X as RUNTIME_CONTEXT_FOOTER, Y as RUNTIME_CONTEXT_END_MARKER, Z as RUNTIME_CONTEXT_HEADER, _ as ImagesInputContent, _t as UserMessage, a as AssistantMessage, at as StreamOptions, b as ImagesOutputContent, bt as escapeRuntimeContextFooter, c as AssistantMessageEventStreamLike, ct as ThinkingBudgets, d as Context, dt as ThinkingLevelMap, et as RuntimeContextMessage, f as DEFAULT_MISSING_TOOL_RESULT_TEXT, ft as Tool, g as ImagesFunction, gt as Usage, h as ImagesContext, ht as Transport, i as AssistantImages, it as StreamFunction, j as ModelCostRates, jt as ProviderRefusalReview, k as Model, kt as AssistantMessageDiagnostic, l as CacheRetention, lt as ThinkingContent, m as ImagesApi, mt as ToolResultMessage, n as Api, nt as StopReason, o as AssistantMessageEvent, ot as TextContent, p as ImageContent, pt as ToolCall, q as RUNTIME_CONTEXT_BEGIN_MARKER, r as AssistantDeliveryTtsFacts, rt as StreamFn, s as AssistantMessageEventStreamContract, st as TextSignatureV1, t as AnthropicMessagesCompat, tt as SimpleStreamOptions, u as CompleteSimpleFn, ut as ThinkingLevel, v as ImagesModel, vt as ValidateToolArgumentsFn, w as KnownImagesApi, wt as labelRuntimeContextContent, x as ImagesProvider, xt as hasLegacyRuntimeContextEnvelope, y as ImagesOptions, yt as VercelGatewayRouting, z as PreparedSystemPrompt } from "./types-BVdTf0YV.mjs";
|
|
3
|
+
import { a as normalizeResolvedPricing, i as normalizeModelCostConfig, n as appendTextDeltaToAssistantMessage, r as calculateUsageCost, t as omitNullRequestHeaders } from "./index-Bczt0MnO.mjs";
|
|
4
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-BYmtRe8-.mjs";
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-QmyD0E5A.mjs";
|
|
6
|
+
import "./types-Cb3-5WM9.mjs";
|
|
7
|
+
export { AnthropicMessagesCompat, Api, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_HAIKU_55_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_55_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DEFAULT_MISSING_TOOL_RESULT_TEXT, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelRequestHeaders, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PreparedSystemPrompt, PricingTier, Provider, ProviderImagesOptions, ProviderRefusalReview, ProviderReplayState, ProviderResponse, ProviderStreamOptions, REPETITIVE_OUTPUT_ERROR_CODE, RUNTIME_CONTEXT_BEGIN_MARKER, RUNTIME_CONTEXT_CUSTOM_TYPE, RUNTIME_CONTEXT_END_MARKER, RUNTIME_CONTEXT_FOOTER, RUNTIME_CONTEXT_HEADER, RawModelCostConfig, RawPricingTier, RuntimeContextMessage, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, appendTextDeltaToAssistantMessage, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, escapeRuntimeContextFooter, extractDiagnosticError, formatThrownValue, hasLegacyRuntimeContextEnvelope, hasRuntimeContextMarker, isProviderRefusalAssistantError, isRuntimeContextMessage, labelRuntimeContextContent, labelRuntimeContextText, normalizeModelCostConfig, normalizeResolvedPricing, observeAsyncIterator, omitNullRequestHeaders, readProviderRefusalReview, readRuntimeContextMetadata, recordSuppressedReasoning, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, runtimeContextContentToText, setRuntimeContextRetention, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeInHistorySystemMessages, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, supportsClaudeServerCompaction, validateToolArguments, validateToolCall };
|
package/dist/types.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { C as supportsClaude1MContext, D as supportsClaudeNativeMaxEffort, E as supportsClaudeInHistorySystemMessages, O as supportsClaudeNativeXhighEffort, S as resolveClaudeSonnet5ModelIdentity, T as supportsClaudeFastMode, _ as resolveClaudeMythos5ModelIdentity, a as CLAUDE_HAIKU_55_THINKING_PROFILE, b as resolveClaudeOpus5ModelIdentity, c as CLAUDE_SONNET_55_THINKING_PROFILE, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, k as supportsClaudeServerCompaction, l as CLAUDE_SONNET_5_THINKING_PROFILE, m as resolveClaudeFable5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_OPUS_55_THINKING_PROFILE, p as requiresClaudeMandatoryAdaptiveThinking, r as normalizeResolvedPricing, s as CLAUDE_OPUS_5_THINKING_PROFILE, t as calculateUsageCost, u as bindsClaudeThinkingPrefix, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./src-
|
|
2
|
-
import { _ as
|
|
1
|
+
import { C as supportsClaude1MContext, D as supportsClaudeNativeMaxEffort, E as supportsClaudeInHistorySystemMessages, O as supportsClaudeNativeXhighEffort, S as resolveClaudeSonnet5ModelIdentity, T as supportsClaudeFastMode, _ as resolveClaudeMythos5ModelIdentity, a as CLAUDE_HAIKU_55_THINKING_PROFILE, b as resolveClaudeOpus5ModelIdentity, c as CLAUDE_SONNET_55_THINKING_PROFILE, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, k as supportsClaudeServerCompaction, l as CLAUDE_SONNET_5_THINKING_PROFILE, m as resolveClaudeFable5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_OPUS_55_THINKING_PROFILE, p as requiresClaudeMandatoryAdaptiveThinking, r as normalizeResolvedPricing, s as CLAUDE_OPUS_5_THINKING_PROFILE, t as calculateUsageCost, u as bindsClaudeThinkingPrefix, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./src-CQ7nH2mL.mjs";
|
|
2
|
+
import { _ as readRuntimeContextMetadata, a as REPETITIVE_OUTPUT_ERROR_CODE, c as RUNTIME_CONTEXT_END_MARKER, d as escapeRuntimeContextFooter, f as hasLegacyRuntimeContextEnvelope, g as labelRuntimeContextText, h as labelRuntimeContextContent, i as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, l as RUNTIME_CONTEXT_FOOTER, m as isRuntimeContextMessage, n as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, o as RUNTIME_CONTEXT_BEGIN_MARKER, p as hasRuntimeContextMarker, r as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, s as RUNTIME_CONTEXT_CUSTOM_TYPE, t as DEFAULT_MISSING_TOOL_RESULT_TEXT, u as RUNTIME_CONTEXT_HEADER, v as runtimeContextContentToText, y as setRuntimeContextRetention } from "./types-OVEWUaDh.mjs";
|
|
3
3
|
import { t as appendTextDeltaToAssistantMessage } from "./assistant-message-events-CHMJgbhs.mjs";
|
|
4
|
-
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, o as readProviderRefusalReview, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-
|
|
4
|
+
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, o as readProviderRefusalReview, r as extractDiagnosticError, s as recordSuppressedReasoning, t as appendAssistantMessageDiagnostic } from "./diagnostics-o1PrVNQb.mjs";
|
|
5
|
+
import { t as omitNullRequestHeaders } from "./request-headers-DO4Mqhw1.mjs";
|
|
5
6
|
import { a as createAssistantMessageEventStream, n as EventStream, t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
6
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
7
|
-
|
|
7
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-DGXqfvkj.mjs";
|
|
8
|
+
import { t as observeAsyncIterator } from "./observe-async-iterator-DgmegcZR.mjs";
|
|
9
|
+
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_HAIKU_55_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_55_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, DEFAULT_MISSING_TOOL_RESULT_TEXT, EventStream, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, REPETITIVE_OUTPUT_ERROR_CODE, RUNTIME_CONTEXT_BEGIN_MARKER, RUNTIME_CONTEXT_CUSTOM_TYPE, RUNTIME_CONTEXT_END_MARKER, RUNTIME_CONTEXT_FOOTER, RUNTIME_CONTEXT_HEADER, appendAssistantMessageDiagnostic, appendTextDeltaToAssistantMessage, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, escapeRuntimeContextFooter, extractDiagnosticError, formatThrownValue, hasLegacyRuntimeContextEnvelope, hasRuntimeContextMarker, isProviderRefusalAssistantError, isRuntimeContextMessage, labelRuntimeContextContent, labelRuntimeContextText, normalizeModelCostConfig, normalizeResolvedPricing, observeAsyncIterator, omitNullRequestHeaders, readProviderRefusalReview, readRuntimeContextMetadata, recordSuppressedReasoning, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, runtimeContextContentToText, setRuntimeContextRetention, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeInHistorySystemMessages, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, supportsClaudeServerCompaction, validateToolArguments, validateToolCall };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as parseStrictFiniteNumber } from "./number-coercion-C7HsBgUL.mjs";
|
|
2
|
+
import { t as filterStringEntries } from "./string-normalization-B8TDDBX_.mjs";
|
|
2
3
|
import "typebox/guard";
|
|
3
|
-
import { Pointer } from "typebox/schema";
|
|
4
|
+
import { CheckContext, CheckSchema, Pointer, Stack } from "typebox/schema";
|
|
4
5
|
import { Compile } from "typebox/compile";
|
|
6
|
+
import { Convert, Errors } from "typebox/value";
|
|
5
7
|
//#region packages/normalization-core/src/json-schema.ts
|
|
6
8
|
/** Decode a local URI fragment before recognizing or splitting its JSON Pointer. */
|
|
7
9
|
function decodeLocalSchemaRefFragment(ref) {
|
|
@@ -21,6 +23,16 @@ function parseLocalSchemaRefPointer(ref) {
|
|
|
21
23
|
return fragment?.startsWith("/") ? fragment.slice(1).split("/").map(decodeJsonPointerSegment) : void 0;
|
|
22
24
|
}
|
|
23
25
|
//#endregion
|
|
26
|
+
//#region standalone-runtime-profile.mjs
|
|
27
|
+
let runtimeExecutionProfile;
|
|
28
|
+
function resolveRuntimeExecutionProfile(build) {
|
|
29
|
+
return build?.mode === "aot" ? "embedded-aot" : "dynamic-execution";
|
|
30
|
+
}
|
|
31
|
+
/** Compiler bootstrap installs image facts before any application entry or worker executes. */
|
|
32
|
+
function getRuntimeExecutionProfile() {
|
|
33
|
+
return runtimeExecutionProfile ??= resolveRuntimeExecutionProfile(globalThis.__openclawStandaloneBuildInfo);
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
24
36
|
//#region packages/llm-core/src/validation.ts
|
|
25
37
|
const validatorCache = /* @__PURE__ */ new WeakMap();
|
|
26
38
|
/** Maximum string length accepted for schema-gated JSON coercion. */
|
|
@@ -57,8 +69,7 @@ function getSchemaTypes(initialSchema, root) {
|
|
|
57
69
|
schema = target;
|
|
58
70
|
}
|
|
59
71
|
if (typeof schema.type === "string") return [schema.type];
|
|
60
|
-
|
|
61
|
-
return [];
|
|
72
|
+
return filterStringEntries(schema.type);
|
|
62
73
|
}
|
|
63
74
|
function matchesJsonType(value, type) {
|
|
64
75
|
switch (type) {
|
|
@@ -115,25 +126,6 @@ function coercePrimitiveByType(value, type) {
|
|
|
115
126
|
default: return value;
|
|
116
127
|
}
|
|
117
128
|
}
|
|
118
|
-
function applySchemaObjectCoercion(value, schema, root) {
|
|
119
|
-
const properties = schema.properties;
|
|
120
|
-
const propertyKeys = properties ? Object.keys(properties) : [];
|
|
121
|
-
if (properties) {
|
|
122
|
-
for (const [key, propertySchema] of Object.entries(properties)) if (key in value) value[key] = coerceWithJsonSchema(value[key], propertySchema, root);
|
|
123
|
-
}
|
|
124
|
-
if (schema.additionalProperties && isJsonSchemaObject(schema.additionalProperties)) {
|
|
125
|
-
const definedKeys = new Set(propertyKeys);
|
|
126
|
-
for (const [key, propertyValue] of Object.entries(value)) if (!definedKeys.has(key)) value[key] = coerceWithJsonSchema(propertyValue, schema.additionalProperties, root);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
function applySchemaArrayCoercion(value, schema, root) {
|
|
130
|
-
const items = schema.items;
|
|
131
|
-
if (!isJsonSchemaObject(items)) return;
|
|
132
|
-
for (let index = 0; index < value.length; index++) {
|
|
133
|
-
const itemSchema = Array.isArray(items) ? items[index] : items;
|
|
134
|
-
if (itemSchema) value[index] = coerceWithJsonSchema(value[index], itemSchema, root);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
129
|
function coerceWithUnionSchema(value, schemas, root, refs) {
|
|
138
130
|
for (const schema of schemas) if (getSubSchemaValidator(schema, root)?.Check(value)) return value;
|
|
139
131
|
for (const schema of schemas) {
|
|
@@ -166,8 +158,25 @@ function coerceWithJsonSchema(value, schema, contextRoot, refs) {
|
|
|
166
158
|
break;
|
|
167
159
|
}
|
|
168
160
|
}
|
|
169
|
-
if (schemaTypes.includes("object") && isObjectBackedRecord(nextValue) && !Array.isArray(nextValue))
|
|
170
|
-
|
|
161
|
+
if (schemaTypes.includes("object") && isObjectBackedRecord(nextValue) && !Array.isArray(nextValue)) {
|
|
162
|
+
const properties = schema.properties;
|
|
163
|
+
const propertyKeys = properties ? Object.keys(properties) : [];
|
|
164
|
+
if (properties) {
|
|
165
|
+
for (const [key, propertySchema] of Object.entries(properties)) if (key in nextValue) nextValue[key] = coerceWithJsonSchema(nextValue[key], propertySchema, root);
|
|
166
|
+
}
|
|
167
|
+
if (schema.additionalProperties && isJsonSchemaObject(schema.additionalProperties)) {
|
|
168
|
+
const definedKeys = new Set(propertyKeys);
|
|
169
|
+
for (const [key, propertyValue] of Object.entries(nextValue)) if (!definedKeys.has(key)) nextValue[key] = coerceWithJsonSchema(propertyValue, schema.additionalProperties, root);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (schemaTypes.includes("array") && Array.isArray(nextValue)) {
|
|
173
|
+
const items = schema.items;
|
|
174
|
+
if (!isJsonSchemaObject(items)) return nextValue;
|
|
175
|
+
for (let index = 0; index < nextValue.length; index++) {
|
|
176
|
+
const itemSchema = Array.isArray(items) ? items[index] : items;
|
|
177
|
+
if (itemSchema) nextValue[index] = coerceWithJsonSchema(nextValue[index], itemSchema, root);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
171
180
|
return nextValue;
|
|
172
181
|
}
|
|
173
182
|
function getValidator(schema, root) {
|
|
@@ -175,11 +184,20 @@ function getValidator(schema, root) {
|
|
|
175
184
|
let validators = validatorCache.get(scope);
|
|
176
185
|
const cached = validators?.get(schema);
|
|
177
186
|
if (cached) return cached;
|
|
178
|
-
const
|
|
187
|
+
const scopedSchema = root && root !== schema ? {
|
|
179
188
|
$defs: root.$defs,
|
|
180
189
|
definitions: root.definitions,
|
|
181
190
|
allOf: [schema]
|
|
182
|
-
} : schema
|
|
191
|
+
} : schema;
|
|
192
|
+
let validator;
|
|
193
|
+
if (getRuntimeExecutionProfile() === "embedded-aot") {
|
|
194
|
+
const stack = Stack({}, scopedSchema);
|
|
195
|
+
validator = {
|
|
196
|
+
Check: (value) => CheckSchema(stack, new CheckContext(), scopedSchema, value),
|
|
197
|
+
Convert: (value) => Convert(scopedSchema, value),
|
|
198
|
+
Errors: (value) => Errors(scopedSchema, value)
|
|
199
|
+
};
|
|
200
|
+
} else validator = Compile(scopedSchema);
|
|
183
201
|
if (!validators) {
|
|
184
202
|
validators = /* @__PURE__ */ new WeakMap();
|
|
185
203
|
validatorCache.set(scope, validators);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ft as Tool, pt as ToolCall } from "./types-BVdTf0YV.mjs";
|
|
2
2
|
//#region packages/llm-core/src/validation.d.ts
|
|
3
3
|
/** Finds the target tool and validates/coerces a model-emitted tool call. */
|
|
4
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-QmyD0E5A.mjs";
|
|
2
2
|
export { validateToolArguments, validateToolCall };
|
package/dist/validation.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { validateToolArguments, validateToolCall };
|
|
1
|
+
export { t as validateToolArguments, n as validateToolCall } from "./validation-DGXqfvkj.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/ai",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.5-beta.2",
|
|
4
4
|
"description": "Reusable model provider adapters and streaming runtime from OpenClaw",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -76,11 +76,21 @@
|
|
|
76
76
|
"import": "./dist/internal/anthropic.mjs",
|
|
77
77
|
"default": "./dist/internal/anthropic.mjs"
|
|
78
78
|
},
|
|
79
|
+
"./internal/google": {
|
|
80
|
+
"types": "./dist/internal/google.d.mts",
|
|
81
|
+
"import": "./dist/internal/google.mjs",
|
|
82
|
+
"default": "./dist/internal/google.mjs"
|
|
83
|
+
},
|
|
79
84
|
"./internal/google-model-family": {
|
|
80
85
|
"types": "./dist/internal/google-model-family.d.mts",
|
|
81
86
|
"import": "./dist/internal/google-model-family.mjs",
|
|
82
87
|
"default": "./dist/internal/google-model-family.mjs"
|
|
83
88
|
},
|
|
89
|
+
"./internal/model-request-body": {
|
|
90
|
+
"types": "./dist/internal/model-request-body.d.mts",
|
|
91
|
+
"import": "./dist/internal/model-request-body.mjs",
|
|
92
|
+
"default": "./dist/internal/model-request-body.mjs"
|
|
93
|
+
},
|
|
84
94
|
"./internal/openai": {
|
|
85
95
|
"types": "./dist/internal/openai.d.mts",
|
|
86
96
|
"import": "./dist/internal/openai.mjs",
|
|
@@ -118,14 +128,38 @@
|
|
|
118
128
|
}
|
|
119
129
|
},
|
|
120
130
|
"dependencies": {
|
|
121
|
-
"@anthropic-ai/sdk": "0.
|
|
122
|
-
"@google/genai": "2.
|
|
123
|
-
"@
|
|
124
|
-
"openai": "7.
|
|
131
|
+
"@anthropic-ai/sdk": "0.135.0",
|
|
132
|
+
"@google/genai": "2.30.0",
|
|
133
|
+
"@opentelemetry/semantic-conventions": "1.43.0",
|
|
134
|
+
"openai": "7.39.0",
|
|
125
135
|
"partial-json": "0.1.7",
|
|
126
|
-
"
|
|
136
|
+
"proxy-from-env": "2.1.0",
|
|
137
|
+
"typebox": "1.4.2",
|
|
138
|
+
"zod": "4.6.7",
|
|
139
|
+
"zod-to-json-schema": "3.25.2"
|
|
140
|
+
},
|
|
141
|
+
"peerDependencies": {
|
|
142
|
+
"@opentelemetry/api": "^1.9.0",
|
|
143
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.220.0 || ^0.223.0",
|
|
144
|
+
"@opentelemetry/resources": "^2.9.0",
|
|
145
|
+
"@opentelemetry/sdk-trace-base": "^2.9.0"
|
|
146
|
+
},
|
|
147
|
+
"peerDependenciesMeta": {
|
|
148
|
+
"@opentelemetry/api": {
|
|
149
|
+
"optional": true
|
|
150
|
+
},
|
|
151
|
+
"@opentelemetry/exporter-trace-otlp-http": {
|
|
152
|
+
"optional": true
|
|
153
|
+
},
|
|
154
|
+
"@opentelemetry/resources": {
|
|
155
|
+
"optional": true
|
|
156
|
+
},
|
|
157
|
+
"@opentelemetry/sdk-trace-base": {
|
|
158
|
+
"optional": true
|
|
159
|
+
}
|
|
127
160
|
},
|
|
128
161
|
"devDependencies": {
|
|
162
|
+
"@mistralai/mistralai": "2.7.0",
|
|
129
163
|
"@openclaw/model-catalog-core": "0.0.0-private",
|
|
130
164
|
"@openclaw/normalization-core": "0.0.0-private"
|
|
131
165
|
},
|