@openclaw/ai 2026.9.5 → 2026.9.7
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-COtDvgtt.mjs → anthropic-Cw2pgccz.mjs} +59 -88
- package/dist/{anthropic-payload-policy-5Erq1Nzy.d.mts → anthropic-payload-policy-NIPVYXPq.d.mts} +8 -6
- package/dist/{anthropic-stream-reducer-BvdYYWL8.mjs → anthropic-stream-reducer-D9MCkl8Z.mjs} +194 -247
- package/dist/{api-registry-Ba2Cv-ut.d.mts → api-registry-D-nbmSqr.d.mts} +2 -2
- package/dist/{azure-openai-responses-YrgnD583.mjs → azure-openai-responses-BwT3-X8P.mjs} +22 -33
- package/dist/{base64-BQOzsvUH.mjs → base64-C1PsYcRQ.mjs} +22 -16
- package/dist/{diagnostics-Dm4bisWG.mjs → diagnostics-CJaB6g8J.mjs} +55 -10
- package/dist/{diagnostics-CPeq9F7y.mjs → diagnostics-DzrF1h4J.mjs} +18 -1
- package/dist/diagnostics.d.mts +11 -5
- package/dist/diagnostics.mjs +4 -4
- package/dist/{env-api-keys-bktO00EJ.mjs → env-api-keys-CyX4VKGO.mjs} +7 -5
- package/dist/event-stream-CMQfX_yr.d.mts +1 -0
- package/dist/{event-stream-CCoa-qSI.d.mts → event-stream-DOPFYVqs.d.mts} +2 -2
- package/dist/{event-stream-D8PARQfL.mjs → event-stream-vd9UnCAU.mjs} +10 -0
- package/dist/event-stream.d.mts +2 -2
- package/dist/event-stream.mjs +1 -1
- package/dist/{google-BuhpRO9r.mjs → google-BfapkS_K.mjs} +8 -11
- package/dist/google-interactions-DW3iXzjc.mjs +574 -0
- package/dist/{google-messages-CyWnYlh0.mjs → google-messages-CtjVtVot.mjs} +35 -71
- package/dist/{google-shared-BT5ZeNer.mjs → google-shared-Y2YfotEu.mjs} +43 -47
- package/dist/{google-vertex-C7EplRvt.mjs → google-vertex-Dov4kBWu.mjs} +16 -30
- package/dist/{host-B4MeUNBc.mjs → host-CHi3X87F.mjs} +64 -189
- package/dist/{host-policy-DUnXSx0I.mjs → host-policy-BOAwRg_M.mjs} +2 -14
- package/dist/{host-FZ1RA_qD.d.mts → host-rxlNaBwm.d.mts} +9 -3
- package/dist/{index-DaF2QbwS.d.mts → index-D6KsSE74.d.mts} +57 -9
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +7 -7
- package/dist/internal/anthropic.d.mts +13 -8
- package/dist/internal/anthropic.mjs +5 -5
- 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 +1 -1
- package/dist/internal/openai-responses-payload-policy.mjs +2 -2
- package/dist/internal/openai.d.mts +46 -9
- package/dist/internal/openai.mjs +13 -12
- package/dist/internal/runtime.d.mts +31 -70
- package/dist/internal/runtime.mjs +11 -66
- package/dist/internal/shared.d.mts +16 -13
- package/dist/internal/shared.mjs +6 -5
- package/dist/internal/tool-schema.d.mts +2 -2
- package/dist/internal/tool-schema.mjs +2 -2
- package/dist/{mistral-moA-mbwl.mjs → mistral-RS6mboC-.mjs} +46 -93
- package/dist/{model-transport-url-DKocrEsb.d.mts → model-transport-url-C5f59L3Y.d.mts} +1 -1
- package/dist/{openai-chatgpt-responses-DWID3EFO.mjs → openai-chatgpt-responses-CYbidtrn.mjs} +118 -99
- package/dist/{openai-completions-DJ1Vm-CD.mjs → openai-completions-D14ihPYk.mjs} +14 -12
- package/dist/{openai-completions-compat-CkwdxTZx.mjs → openai-completions-compat-BOVWBZDn.mjs} +3 -5
- package/dist/{openai-completions-compat-JE7gqxb9.d.mts → openai-completions-compat-qJjmqQ71.d.mts} +3 -3
- package/dist/{openai-completions-stream-Bu98b0Hv.mjs → openai-completions-stream-CDCuw3DP.mjs} +124 -183
- package/dist/{openai-prompt-cache-CJ_xEevu.d.mts → openai-prompt-cache-CouErLh7.d.mts} +2 -2
- package/dist/{openai-prompt-cache-1wfaIszn.mjs → openai-prompt-cache-D2V7MqR7.mjs} +1 -1
- package/dist/{openai-provider-client-DPo0Hmak.mjs → openai-provider-client-CwfsGBbA.mjs} +2 -2
- package/dist/{openai-reasoning-effort-NlFZmfEu.mjs → openai-reasoning-effort-ConhwkeX.mjs} +14 -5
- package/dist/{openai-responses-BejZzQCP.mjs → openai-responses-CKCBEc2W.mjs} +12 -11
- package/dist/openai-responses-compaction-replay-DiYn-gFM.d.mts +12 -0
- package/dist/{openai-responses-compaction-window-D6P5oZP5.mjs → openai-responses-compaction-window-UNK1GDpy.mjs} +5 -5
- package/dist/{openai-responses-contracts-DWrfMODE.mjs → openai-responses-contracts-CLxnqS9p.mjs} +1 -1
- package/dist/{openai-responses-contracts-Dflvrfa8.d.mts → openai-responses-contracts-D1iZ0njF.d.mts} +4 -4
- package/dist/{openai-responses-prompt-observer-internal-C15_-OwV.mjs → openai-responses-prompt-observer-internal-iAqLb4tk.mjs} +16 -13
- package/dist/openai-responses-request-lifecycle-Fsag-IGZ.mjs +36 -0
- package/dist/{openai-responses-shared-CwsziD_m.mjs → openai-responses-shared-DL4ulQn7.mjs} +838 -577
- package/dist/{openai-responses-terminal-usage-Dl3J6zrf.d.mts → openai-responses-terminal-usage-BE7lf7nW.d.mts} +2 -2
- package/dist/{openai-stop-reason-Drnn_6Qj.mjs → openai-stop-reason-8s70vDXj.mjs} +2 -12
- package/dist/{openai-tool-schema-ynZBgqW-.d.mts → openai-tool-schema-a5ysBBga.d.mts} +0 -6
- package/dist/{openai-tool-schema-BO8rwyAD.mjs → openai-tool-schema-vsl-cE-n.mjs} +365 -429
- package/dist/{openai-transport-params-DQeuAvBl.mjs → openai-transport-params-BwlpzX-2.mjs} +61 -106
- package/dist/{positive-integer-DtjCkbue.mjs → positive-integer-CjN5OJbH.mjs} +1 -1
- package/dist/{provider-error-DDqw9Qda.mjs → provider-error-CwT_j2v0.mjs} +82 -10
- package/dist/{provider-error-CzNw4BWX.d.mts → provider-error-xumb1V3F.d.mts} +3 -1
- package/dist/{provider-options-DprLsWh9.d.mts → provider-options-Df7ov0K1.d.mts} +6 -4
- package/dist/{provider-replay-context-CnUSOwhr.mjs → provider-replay-context-DsyI5jOP.mjs} +1 -1
- package/dist/{provider-transcript-transform-BsRAhuWJ.mjs → provider-transcript-transform-JbFbHV8h.mjs} +17 -2
- package/dist/{provider-transport-turn-state-CkGToCD2.mjs → provider-transport-turn-state-BheUi_hl.mjs} +1 -1
- package/dist/{provider-types-CAKRC7N5.d.mts → provider-types-d4XnoZMd.d.mts} +3 -3
- package/dist/provider-types.d.mts +6 -6
- package/dist/providers.d.mts +2 -2
- package/dist/providers.mjs +15 -11
- package/dist/{reasoning-tag-text-partitioner-Dy9IO8Dc.mjs → reasoning-tag-text-partitioner-B6FIIBt6.mjs} +193 -98
- package/dist/{record-coerce-DwRYMj3t.mjs → record-coerce-CNDovvft.mjs} +1 -1
- package/dist/simple-options-CGAkCwtM.mjs +349 -0
- package/dist/{src-DeKjbE8I.mjs → src-H4aXcFuX.mjs} +53 -26
- package/dist/{stream-CREqxHgU.mjs → stream-DDsCBgd-.mjs} +1 -7
- package/dist/{stream-first-event-timeout-C9ZadkJW.mjs → stream-first-event-timeout-B9o0S4SZ.mjs} +1 -1
- package/dist/{tool-schema-json-projection-CD9c_fK8.mjs → tool-schema-json-projection-Ct8SeBeJ.mjs} +63 -23
- package/dist/{transport-stream-shared-D-6FQSHm.mjs → transport-stream-shared-Dh5qKJ8e.mjs} +63 -37
- package/dist/{transport-stream-shared-BbUkFaHi.d.mts → transport-stream-shared-yYhXa4kX.d.mts} +13 -7
- package/dist/{transport-utils-1cyq5Y7x.mjs → transport-utils-C-4bf2Ok.mjs} +3 -4
- package/dist/transports.d.mts +37 -33
- package/dist/transports.mjs +208 -239
- package/dist/types-CB-_vNyI.d.mts +1 -0
- package/dist/{types-4_uVs5WH.d.mts → types-CLLR3eB4.d.mts} +5 -1
- package/dist/types.d.mts +6 -6
- package/dist/types.mjs +5 -5
- package/dist/{validation-Dw7cb6BV.mjs → validation-BFZc40Ig.mjs} +80 -54
- package/dist/{validation-Ctzu2DhF.d.mts → validation-Cat2wQsc.d.mts} +1 -1
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/package.json +6 -6
- package/dist/assistant-output-BsEkB-vU.mjs +0 -16
- package/dist/event-stream-DmSCpi1T.d.mts +0 -1
- package/dist/simple-options-C6cFWj_f.mjs +0 -175
- package/dist/types-DkJfb4W3.d.mts +0 -1
- package/dist/utf16-slice-CvGodqok.mjs +0 -29
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { i as asOptionalRecord } from "./record-coerce-CNDovvft.mjs";
|
|
1
2
|
import { n as normalizeLowercaseStringOrEmpty } from "./string-coerce-fsri9iCu.mjs";
|
|
2
|
-
import { i as asOptionalRecord } from "./record-coerce-DwRYMj3t.mjs";
|
|
3
3
|
import { n as normalizeUniqueTrimmedStringList } from "./string-normalization-J9ZiLfGO.mjs";
|
|
4
4
|
//#region packages/llm-core/src/model-data.ts
|
|
5
5
|
const MODEL_DATA_APIS = [
|
|
@@ -8,6 +8,7 @@ const MODEL_DATA_APIS = [
|
|
|
8
8
|
"openai-chatgpt-responses",
|
|
9
9
|
"anthropic-messages",
|
|
10
10
|
"google-generative-ai",
|
|
11
|
+
"google-interactions",
|
|
11
12
|
"google-vertex",
|
|
12
13
|
"github-copilot",
|
|
13
14
|
"bedrock-converse-stream",
|
|
@@ -158,6 +159,11 @@ function isOpenAIGpt56Model(model) {
|
|
|
158
159
|
const name = normalizeModelId(typeof model.name === "string" ? model.name : void 0);
|
|
159
160
|
return /^gpt-5\.6(?:-|$)/u.test(id) || /^gpt-5\.6(?:\s|\(|-|$)/u.test(name);
|
|
160
161
|
}
|
|
162
|
+
/** Return whether a model has a known GPT-6 reasoning and sampling contract. */
|
|
163
|
+
function isOpenAIGpt6Model(model) {
|
|
164
|
+
const id = normalizeModelId(typeof model.id === "string" ? model.id : void 0);
|
|
165
|
+
return id === "gpt-6-astra" || id === "gpt-6-sol" || id === "gpt-6-luna";
|
|
166
|
+
}
|
|
161
167
|
/** Normalize user-facing reasoning effort names to API effort names. */
|
|
162
168
|
function normalizeOpenAIReasoningEffort(effort) {
|
|
163
169
|
const trimmed = effort.trim();
|
|
@@ -185,7 +191,10 @@ function resolveOpenAIModelReasoningEfforts(model) {
|
|
|
185
191
|
const id = normalizeModelId(typeof model.id === "string" ? model.id : void 0);
|
|
186
192
|
const api = resolveOpenAIThinkingApi(model.api);
|
|
187
193
|
const supportsMax = api !== "openai-completions";
|
|
188
|
-
if (
|
|
194
|
+
if (isOpenAIGpt6Model(model) && api !== "azure-openai-responses") {
|
|
195
|
+
if (id === "gpt-6-astra") return supportsMax ? GPT_6_ASTRA_REASONING_EFFORTS : GPT_CODEX_REASONING_EFFORTS;
|
|
196
|
+
return supportsMax ? GPT_56_REASONING_EFFORTS : GPT_52_REASONING_EFFORTS;
|
|
197
|
+
}
|
|
189
198
|
if (/^gpt-5\.6(?:-|$)/u.test(id)) return supportsMax ? GPT_56_REASONING_EFFORTS : GPT_52_REASONING_EFFORTS;
|
|
190
199
|
if (id === "gpt-5.1-codex-mini") return GPT_51_CODEX_MINI_REASONING_EFFORTS;
|
|
191
200
|
if (id === "gpt-5.1-codex-max") return GPT_51_CODEX_MAX_REASONING_EFFORTS;
|
|
@@ -197,7 +206,7 @@ function resolveOpenAIModelReasoningEfforts(model) {
|
|
|
197
206
|
if (/^gpt-5(?:-|$)/u.test(id)) return GPT_5_REASONING_EFFORTS;
|
|
198
207
|
}
|
|
199
208
|
/**
|
|
200
|
-
* Return whether a model accepts temperature. GPT-5.6 and GPT-6
|
|
209
|
+
* Return whether a model accepts temperature. GPT-5.6 and known GPT-6 models
|
|
201
210
|
* reject it with a 400; catalog compat can override per model.
|
|
202
211
|
*/
|
|
203
212
|
function supportsOpenAITemperature(model) {
|
|
@@ -207,7 +216,7 @@ function supportsOpenAITemperature(model) {
|
|
|
207
216
|
if (typeof declared === "boolean") return declared;
|
|
208
217
|
}
|
|
209
218
|
const id = normalizeModelId(typeof model.id === "string" ? model.id : void 0);
|
|
210
|
-
return (
|
|
219
|
+
return (!isOpenAIGpt6Model(model) || resolveOpenAIThinkingApi(model.api) === "azure-openai-responses") && !/^gpt-5\.6(?:-|$)/u.test(id);
|
|
211
220
|
}
|
|
212
221
|
/** Return whether a model accepts a requested reasoning effort. */
|
|
213
222
|
function supportsOpenAIReasoningEffort(model, effort) {
|
|
@@ -232,4 +241,4 @@ function resolveOpenAIReasoningEffortForModel(params) {
|
|
|
232
241
|
return (requestedRank < 0 ? void 0 : ranked.findLast((effort) => ENABLED_REASONING_EFFORTS.indexOf(effort) <= requestedRank) ?? ranked[0]) ?? supported.find((effort) => !isDisabledReasoningEffort(normalizeOpenAIReasoningEffort(effort)));
|
|
233
242
|
}
|
|
234
243
|
//#endregion
|
|
235
|
-
export {
|
|
244
|
+
export { normalizeOpenAIReasoningEffort as a, resolveOpenAIReasoningEffortMapping as c, supportsOpenAITemperature as d, MODEL_CATALOG_THINKING_LEVELS as f, isOpenAIGpt6Model as i, resolveOpenAISupportedReasoningEfforts as l, resolveOpenAIThinkingApi as m, isOpenAIGpt55Model as n, resolveOpenAIModelReasoningEfforts as o, listMappedModelThinkingLevels as p, isOpenAIGpt56Model as r, resolveOpenAIReasoningEffortForModel as s, isOpenAIGpt54MiniModel as t, supportsOpenAIReasoningEffort as u };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
|
-
import { t as AssistantMessageEventStream } from "./event-stream-
|
|
3
|
-
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-
|
|
4
|
-
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
2
|
+
import { t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
3
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-D2V7MqR7.mjs";
|
|
4
|
+
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-BOVWBZDn.mjs";
|
|
5
5
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
6
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
7
|
-
import { g as resolveOpenAISimpleReasoningEffort } from "./openai-transport-params-
|
|
8
|
-
import { n as getEnvApiKey } from "./env-api-keys-
|
|
9
|
-
import { n as
|
|
10
|
-
import {
|
|
6
|
+
import { n as buildBaseOptions } from "./simple-options-CGAkCwtM.mjs";
|
|
7
|
+
import { g as resolveOpenAISimpleReasoningEffort } from "./openai-transport-params-BwlpzX-2.mjs";
|
|
8
|
+
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
9
|
+
import { n as createAssistantOutput } from "./provider-transcript-transform-JbFbHV8h.mjs";
|
|
10
|
+
import { n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-BheUi_hl.mjs";
|
|
11
|
+
import { P as convertProviderResponsesMessages, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-DL4ulQn7.mjs";
|
|
11
12
|
import { n as hasCopilotVisionInput, t as buildCopilotDynamicHeaders } from "./github-copilot-headers-B37TB3rB.mjs";
|
|
12
|
-
import { t as createOpenAIProviderClient } from "./openai-provider-client-
|
|
13
|
+
import { t as createOpenAIProviderClient } from "./openai-provider-client-CwfsGBbA.mjs";
|
|
13
14
|
//#region packages/ai/src/providers/openai-responses.ts
|
|
14
15
|
var openai_responses_exports = /* @__PURE__ */ __exportAll({
|
|
15
16
|
streamOpenAIResponses: () => streamOpenAIResponses,
|
|
@@ -24,7 +25,7 @@ function getCompat(model) {
|
|
|
24
25
|
}
|
|
25
26
|
const streamOpenAIResponses = (model, context, options) => {
|
|
26
27
|
const stream = new AssistantMessageEventStream();
|
|
27
|
-
const output =
|
|
28
|
+
const output = createAssistantOutput(model);
|
|
28
29
|
runResponsesStreamLifecycle({
|
|
29
30
|
stream,
|
|
30
31
|
model,
|
|
@@ -74,7 +75,7 @@ function createClient(model, context, apiKey, optionsHeaders, sessionId) {
|
|
|
74
75
|
return createOpenAIProviderClient(model, apiKey, headers, optionsHeaders);
|
|
75
76
|
}
|
|
76
77
|
function buildParams(model, context, options, replayMode = "checkpoint") {
|
|
77
|
-
const messages =
|
|
78
|
+
const messages = convertProviderResponsesMessages(model, context, OPENAI_TOOL_CALL_PROVIDERS, {
|
|
78
79
|
replayResponsesItemIds: options?.replayResponsesItemIds ?? false,
|
|
79
80
|
sessionId: options?.sessionId,
|
|
80
81
|
authProfileId: options?.authProfileId,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./index-D6KsSE74.mjs";
|
|
2
|
+
import { O as Model, a as AssistantMessage } from "./types-CLLR3eB4.mjs";
|
|
3
|
+
import "./provider-options-Df7ov0K1.mjs";
|
|
4
|
+
import { i as ReplayableResponseCompactionItem, r as OpenAIResponsesReasoningReplayMetadata, s as OpenAIResponsesCompactionOutput } from "./openai-responses-contracts-D1iZ0njF.mjs";
|
|
5
|
+
import "openai/resources/responses/responses.js";
|
|
6
|
+
//#region packages/ai/src/transports/openai-responses-compaction-replay.d.ts
|
|
7
|
+
declare function captureOpenAIResponsesCompaction(output: Pick<AssistantMessage, "providerReplay">, item: ReplayableResponseCompactionItem, boundary: number | "retained-users", model: Model, captureMetadata?: OpenAIResponsesReasoningReplayMetadata, compactedOutput?: OpenAIResponsesCompactionOutput): void;
|
|
8
|
+
declare class CompactionReplayRefreshRequiredError extends Error {
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { captureOpenAIResponsesCompaction as n, CompactionReplayRefreshRequiredError as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
1
2
|
import { i as normalizeOptionalLowercaseString, n as normalizeLowercaseStringOrEmpty, s as readStringValue } from "./string-coerce-fsri9iCu.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import { i as OPENAI_RESPONSES_APIS } from "./openai-responses-contracts-DWrfMODE.mjs";
|
|
3
|
+
import { u as supportsOpenAIReasoningEffort } from "./openai-reasoning-effort-ConhwkeX.mjs";
|
|
4
|
+
import { t as canonicalizeBase64 } from "./base64-C1PsYcRQ.mjs";
|
|
5
|
+
import { t as parsePositiveInteger } from "./positive-integer-CjN5OJbH.mjs";
|
|
6
|
+
import { i as OPENAI_RESPONSES_APIS } from "./openai-responses-contracts-CLxnqS9p.mjs";
|
|
7
7
|
import { t as createSseByteGuard } from "./streaming-byte-guard-CC-HMn_u.mjs";
|
|
8
8
|
//#region packages/model-catalog-core/src/provider-id.ts
|
|
9
9
|
function normalizeProviderId(provider) {
|
package/dist/{openai-responses-contracts-DWrfMODE.mjs → openai-responses-contracts-CLxnqS9p.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE } from "./types-LFWwv0cF.mjs";
|
|
2
|
-
import { o as isRecord } from "./record-coerce-
|
|
2
|
+
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
3
3
|
//#region packages/ai/src/transports/openai-responses-contracts.ts
|
|
4
4
|
const DEFAULT_AZURE_OPENAI_API_VERSION = "preview";
|
|
5
5
|
const OPENAI_CODEX_RESPONSES_DEFAULT_INSTRUCTIONS = "Follow the user request.";
|
package/dist/{openai-responses-contracts-Dflvrfa8.d.mts → openai-responses-contracts-D1iZ0njF.d.mts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { O as Model, j as ModelThinkingLevel, n as Api } from "./types-
|
|
3
|
-
import { a as BaseOpenAIStreamOptions, f as OpenAIReasoningEffort } from "./provider-options-
|
|
4
|
-
import "./types-
|
|
1
|
+
import "./index-D6KsSE74.mjs";
|
|
2
|
+
import { O as Model, j as ModelThinkingLevel, n as Api } from "./types-CLLR3eB4.mjs";
|
|
3
|
+
import { a as BaseOpenAIStreamOptions, f as OpenAIReasoningEffort } from "./provider-options-Df7ov0K1.mjs";
|
|
4
|
+
import "./types-CB-_vNyI.mjs";
|
|
5
5
|
import { ResponseCompactionItem, ResponseCreateParamsStreaming, ResponseInputItem } from "openai/resources/responses/responses.js";
|
|
6
6
|
//#region packages/ai/src/providers/openai-request-reasoning.d.ts
|
|
7
7
|
type OpenAIRequestReasoningEffort = ModelThinkingLevel | "none";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { o as isRecord } from "./record-coerce-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
+
import { n as getAiTransportHost } from "./host-CHi3X87F.mjs";
|
|
3
|
+
import { d as supportsOpenAITemperature, i as isOpenAIGpt6Model, m as resolveOpenAIThinkingApi } from "./openai-reasoning-effort-ConhwkeX.mjs";
|
|
4
|
+
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-D2V7MqR7.mjs";
|
|
5
|
+
import { o as usesNativeOpenAICodexResponsesBackend } from "./openai-completions-compat-BOVWBZDn.mjs";
|
|
6
6
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { h as responsesPromptObserver, r as OPENAI_CODEX_RESPONSES_DEFAULT_INSTRUCTIONS } from "./openai-responses-contracts-
|
|
11
|
-
import { a as applyOpenAIResponsesPayloadPolicy, s as resolveOpenAIResponsesPayloadPolicy } from "./openai-responses-compaction-window-
|
|
12
|
-
import {
|
|
7
|
+
import { v as sanitizeTransportPayloadText } from "./transport-stream-shared-Dh5qKJ8e.mjs";
|
|
8
|
+
import { C as stripSystemPromptCacheBoundary } from "./simple-options-CGAkCwtM.mjs";
|
|
9
|
+
import { g as resolveOpenAISimpleReasoningEffort, h as resolveOpenAIRequestReasoning, k as resolvePromptCacheKey, m as reconcileOpenAIResponsesToolChoice, s as getCompat } from "./openai-transport-params-BwlpzX-2.mjs";
|
|
10
|
+
import { h as responsesPromptObserver, r as OPENAI_CODEX_RESPONSES_DEFAULT_INSTRUCTIONS } from "./openai-responses-contracts-CLxnqS9p.mjs";
|
|
11
|
+
import { a as applyOpenAIResponsesPayloadPolicy, s as resolveOpenAIResponsesPayloadPolicy } from "./openai-responses-compaction-window-UNK1GDpy.mjs";
|
|
12
|
+
import { F as convertResponsesMessages, N as buildResponsesInputMessage, a as prepareResponsesTools } from "./openai-responses-shared-DL4ulQn7.mjs";
|
|
13
13
|
//#region packages/ai/src/transports/openai-responses-params-internal.ts
|
|
14
14
|
const OPENAI_RESPONSES_TOOL_CALL_PROVIDERS = /* @__PURE__ */ new Set([
|
|
15
15
|
"openai",
|
|
@@ -126,7 +126,7 @@ function buildOpenAIResponsesParams(model, context, options, metadata, replayMod
|
|
|
126
126
|
const effectiveMaxTokens = options?.maxTokens || model.maxTokens;
|
|
127
127
|
if (effectiveMaxTokens) params.max_output_tokens = Math.max(effectiveMaxTokens, 16);
|
|
128
128
|
if (options?.temperature !== void 0 && supportsOpenAITemperature(model)) params.temperature = options.temperature;
|
|
129
|
-
if (options?.topP !== void 0 && model.
|
|
129
|
+
if (options?.topP !== void 0 && (!isOpenAIGpt6Model(model) || resolveOpenAIThinkingApi(model.api) === "azure-openai-responses")) params.top_p = options.topP;
|
|
130
130
|
if (options?.responseFormat !== void 0) params.text = {
|
|
131
131
|
...params.text,
|
|
132
132
|
format: resolveOpenAIResponsesTextFormat(options.responseFormat)
|
|
@@ -134,7 +134,10 @@ function buildOpenAIResponsesParams(model, context, options, metadata, replayMod
|
|
|
134
134
|
if (options?.serviceTier !== void 0 && payloadPolicy.allowsServiceTier) params.service_tier = options.serviceTier;
|
|
135
135
|
if (context.tools) {
|
|
136
136
|
const tools = context.tools;
|
|
137
|
-
const strict = resolveOpenAIStrictToolSetting(model, {
|
|
137
|
+
const strict = getAiTransportHost().resolveOpenAIStrictToolSetting(model, {
|
|
138
|
+
transport: "stream",
|
|
139
|
+
supportsStrictMode: compat.supportsStrictMode
|
|
140
|
+
});
|
|
138
141
|
const { projection, tools: converted } = prepareResponsesTools(tools, strict, model);
|
|
139
142
|
if (converted.length > 0 || projection.inputToolCount === 0 && projection.diagnostics.length === 0) params.tools = converted;
|
|
140
143
|
if (options?.toolChoice) {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
+
//#region packages/ai/src/transports/openai-responses-request-lifecycle.ts
|
|
3
|
+
const lifecycleKey = Symbol("openclaw.responsesRequestLifecycle");
|
|
4
|
+
/** Private transport carrier: serialized options cannot mint host authority. */
|
|
5
|
+
const responsesRequestLifecycle = {
|
|
6
|
+
set(options, lifecycle) {
|
|
7
|
+
Object.defineProperty(options, lifecycleKey, {
|
|
8
|
+
value: lifecycle,
|
|
9
|
+
enumerable: true
|
|
10
|
+
});
|
|
11
|
+
},
|
|
12
|
+
get(options) {
|
|
13
|
+
if (!options) return;
|
|
14
|
+
return Reflect.get(options, lifecycleKey);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
/** A transport receipt must settle before model output can authorize later work. */
|
|
18
|
+
function withResponsesRequestAcceptance(events, lifecycle, signal) {
|
|
19
|
+
if (!lifecycle) return events;
|
|
20
|
+
return { async *[Symbol.asyncIterator]() {
|
|
21
|
+
for await (const event of events) {
|
|
22
|
+
if (isRecord(event) && event.type === "response.created") {
|
|
23
|
+
const response = isRecord(event.response) ? event.response : void 0;
|
|
24
|
+
if (typeof response?.id !== "string" || !response.id.trim()) throw new Error("Provider continuation response has no identity");
|
|
25
|
+
signal?.throwIfAborted();
|
|
26
|
+
lifecycle.assertCurrent();
|
|
27
|
+
await lifecycle.accepted(response.id, signal);
|
|
28
|
+
signal?.throwIfAborted();
|
|
29
|
+
lifecycle.assertCurrent();
|
|
30
|
+
}
|
|
31
|
+
yield event;
|
|
32
|
+
}
|
|
33
|
+
} };
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { withResponsesRequestAcceptance as n, responsesRequestLifecycle as t };
|