@openclaw/ai 2026.9.4 → 2026.9.5
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 +1 -1
- package/dist/{anthropic-C4Qu4H0Z.mjs → anthropic-COtDvgtt.mjs} +10 -11
- package/dist/{anthropic-payload-policy-BZ8umAbk.d.mts → anthropic-payload-policy-5Erq1Nzy.d.mts} +3 -3
- package/dist/{anthropic-stream-reducer-CILWF7JD.mjs → anthropic-stream-reducer-BvdYYWL8.mjs} +47 -43
- package/dist/{api-registry-ByUwIR0e.d.mts → api-registry-Ba2Cv-ut.d.mts} +2 -2
- package/dist/{assistant-output-tLt4H-iQ.mjs → assistant-output-BsEkB-vU.mjs} +1 -1
- package/dist/{azure-openai-responses-BAlqlKKc.mjs → azure-openai-responses-YrgnD583.mjs} +6 -9
- package/dist/{base64-D-su8YVo.mjs → base64-BQOzsvUH.mjs} +4 -4
- package/dist/credential-redaction-BKv49aiv.d.mts +24 -0
- package/dist/{diagnostics-QuErwCIl.mjs → diagnostics-Dm4bisWG.mjs} +89 -2
- package/dist/diagnostics.d.mts +4 -23
- package/dist/diagnostics.mjs +3 -3
- package/dist/{event-stream-Bt5Y4Pav.d.mts → event-stream-CCoa-qSI.d.mts} +1 -1
- package/dist/event-stream-DmSCpi1T.d.mts +1 -0
- package/dist/event-stream.d.mts +2 -2
- package/dist/expect-lbe3Hgrh.mjs +8 -0
- package/dist/{google-DPBAOaOW.mjs → google-BuhpRO9r.mjs} +6 -9
- package/dist/{google-messages-6JkpHrhJ.mjs → google-messages-CyWnYlh0.mjs} +3 -3
- package/dist/{google-shared-BvBeW9aq.mjs → google-shared-BT5ZeNer.mjs} +13 -13
- package/dist/{google-vertex-k-TMCAYD.mjs → google-vertex-C7EplRvt.mjs} +5 -8
- package/dist/{host-B8YfDGd4.mjs → host-B4MeUNBc.mjs} +25 -27
- package/dist/{host-4atIX-2V.d.mts → host-FZ1RA_qD.d.mts} +5 -3
- package/dist/{host-policy-Zcg_cNz8.mjs → host-policy-DUnXSx0I.mjs} +1 -1
- package/dist/{index-DdD3qerf.d.mts → index-DaF2QbwS.d.mts} +4 -9
- package/dist/index.d.mts +6 -7
- package/dist/index.mjs +3 -4
- package/dist/internal/anthropic.d.mts +6 -7
- package/dist/internal/anthropic.mjs +4 -4
- package/dist/internal/openai-completions-compat.d.mts +2 -0
- package/dist/internal/openai-completions-compat.mjs +2 -0
- 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 +10 -53
- package/dist/internal/openai.mjs +11 -9
- package/dist/internal/runtime.d.mts +6 -8
- package/dist/internal/runtime.mjs +5 -9
- package/dist/internal/shared.d.mts +6 -5
- package/dist/internal/shared.mjs +4 -3
- package/dist/internal/tool-schema.d.mts +3 -3
- package/dist/internal/tool-schema.mjs +2 -2
- package/dist/{mistral-CxUZ1jUb.mjs → mistral-moA-mbwl.mjs} +9 -13
- package/dist/{openai-chatgpt-responses-CgO6kZfo.mjs → openai-chatgpt-responses-DWID3EFO.mjs} +73 -29
- package/dist/{openai-completions-yJuk7eis.mjs → openai-completions-DJ1Vm-CD.mjs} +11 -12
- package/dist/{openai-prompt-cache-Bds-n_9Q.mjs → openai-completions-compat-CkwdxTZx.mjs} +5 -50
- package/dist/{openai-completions-compat-eHgh5UPE.d.mts → openai-completions-compat-JE7gqxb9.d.mts} +4 -4
- package/dist/{openai-completions-stream-Da2vvl-S.mjs → openai-completions-stream-Bu98b0Hv.mjs} +94 -96
- package/dist/openai-prompt-cache-1wfaIszn.mjs +46 -0
- package/dist/{openai-prompt-cache-B4eYo2-I.d.mts → openai-prompt-cache-CJ_xEevu.d.mts} +2 -2
- package/dist/{openai-provider-client-S2gCrM2Z.mjs → openai-provider-client-DPo0Hmak.mjs} +2 -2
- package/dist/openai-reasoning-effort-NlFZmfEu.mjs +235 -0
- package/dist/{openai-responses-DaYwH05E.mjs → openai-responses-BejZzQCP.mjs} +8 -12
- package/dist/{openai-responses-compaction-window-CIhBAkkq.mjs → openai-responses-compaction-window-D6P5oZP5.mjs} +20 -62
- package/dist/openai-responses-contracts-DWrfMODE.mjs +81 -0
- package/dist/{openai-responses-contracts-BjBAqAg_.d.mts → openai-responses-contracts-Dflvrfa8.d.mts} +9 -5
- package/dist/{openai-responses-payload-policy-rLRPsSmB.d.mts → openai-responses-payload-policy-C7GsA1y0.d.mts} +5 -3
- package/dist/openai-responses-prompt-observer-internal-C15_-OwV.mjs +195 -0
- package/dist/{openai-responses-shared-B8RdBPCv.mjs → openai-responses-shared-CwsziD_m.mjs} +385 -178
- package/dist/openai-responses-terminal-usage-Dl3J6zrf.d.mts +47 -0
- package/dist/{openai-tool-schema-CzjyYXun.mjs → openai-tool-schema-BO8rwyAD.mjs} +92 -68
- package/dist/{openai-transport-params-9aPuV5YY.mjs → openai-transport-params-DQeuAvBl.mjs} +157 -47
- package/dist/{positive-integer-41zhOdcV.mjs → positive-integer-DtjCkbue.mjs} +1 -1
- package/dist/{provider-error-BA-v_tKd.mjs → provider-error-DDqw9Qda.mjs} +100 -38
- package/dist/{provider-options-Ceqv1OKk.d.mts → provider-options-DprLsWh9.d.mts} +9 -6
- package/dist/{provider-replay-context-CJ_YvcEW.mjs → provider-replay-context-CnUSOwhr.mjs} +1 -1
- package/dist/{provider-transcript-transform-V5YzU9zh.mjs → provider-transcript-transform-BsRAhuWJ.mjs} +1 -1
- package/dist/{provider-transport-turn-state-D5EXOFL2.mjs → provider-transport-turn-state-CkGToCD2.mjs} +1 -1
- package/dist/{provider-types-CVjKjsuq.d.mts → provider-types-CAKRC7N5.d.mts} +3 -3
- package/dist/provider-types.d.mts +5 -6
- package/dist/providers.d.mts +2 -2
- package/dist/providers.mjs +10 -10
- package/dist/{reasoning-tag-text-partitioner-BcR5pztD.mjs → reasoning-tag-text-partitioner-Dy9IO8Dc.mjs} +15 -7
- package/dist/{simple-options-BQbb4yQL.mjs → simple-options-C6cFWj_f.mjs} +5 -3
- package/dist/{usage-cost-BNWbbXav.mjs → src-DeKjbE8I.mjs} +3 -5
- package/dist/{stream-first-event-timeout-2hfrquuz.mjs → stream-first-event-timeout-C9ZadkJW.mjs} +1 -1
- package/dist/{string-normalization-CmLIasuf.mjs → string-normalization-J9ZiLfGO.mjs} +13 -1
- package/dist/tool-schema-json-projection-CD9c_fK8.mjs +134 -0
- package/dist/{transport-stream-shared-DNvmoWnv.d.mts → transport-stream-shared-BbUkFaHi.d.mts} +4 -4
- package/dist/{transport-stream-shared-zHll9BxO.mjs → transport-stream-shared-D-6FQSHm.mjs} +14 -14
- package/dist/{transport-utils-zrYjICLZ.mjs → transport-utils-1cyq5Y7x.mjs} +3 -3
- package/dist/transports.d.mts +26 -12
- package/dist/transports.mjs +130 -449
- package/dist/{types-Ntv5z2g2.d.mts → types-4_uVs5WH.d.mts} +47 -3
- package/dist/types-DkJfb4W3.d.mts +1 -0
- package/dist/types.d.mts +5 -6
- package/dist/types.mjs +2 -3
- package/dist/{validation-B0t_G2H6.d.mts → validation-Ctzu2DhF.d.mts} +1 -1
- package/dist/{validation-BDzVDnTs.mjs → validation-Dw7cb6BV.mjs} +1 -0
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/package.json +10 -5
- package/dist/diagnostics-DnPnOui6.d.mts +0 -29
- package/dist/event-stream-C3WGFsum.d.mts +0 -1
- package/dist/openai-responses-contracts-DDOHA62Y.mjs +0 -245
- package/dist/openai-responses-prompt-observer-internal-f8J7wpsk.mjs +0 -32
- package/dist/src-DDmEryvj.mjs +0 -2
- package/dist/tool-schema-json-projection-ClptDdAO.mjs +0 -82
- package/dist/types-DlfwzH3T.d.mts +0 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { o as isRecord } from "./record-coerce-DwRYMj3t.mjs";
|
|
2
|
+
import { t as expectDefined } from "./expect-lbe3Hgrh.mjs";
|
|
3
|
+
import { types } from "node:util";
|
|
4
|
+
//#region packages/ai/src/providers/tool-schema-json-projection.ts
|
|
5
|
+
function isNonFiniteNumberValue(value) {
|
|
6
|
+
if (typeof value === "number") return !Number.isFinite(value);
|
|
7
|
+
if (value === null || typeof value !== "object" || !types.isNumberObject(value)) return false;
|
|
8
|
+
return !Number.isFinite(Number.prototype.valueOf.call(value));
|
|
9
|
+
}
|
|
10
|
+
function serializeToolInputSchema(value, path, captureJson) {
|
|
11
|
+
const nonFiniteNumber = { path: null };
|
|
12
|
+
const ancestors = [];
|
|
13
|
+
const pathLengths = [];
|
|
14
|
+
const segments = [path];
|
|
15
|
+
let isRoot = true;
|
|
16
|
+
let text;
|
|
17
|
+
try {
|
|
18
|
+
text = JSON.stringify(value, function(key, entry) {
|
|
19
|
+
const invalidNumber = nonFiniteNumber.path === null && isNonFiniteNumberValue(entry);
|
|
20
|
+
if (invalidNumber || entry && typeof entry === "object") {
|
|
21
|
+
while (ancestors.length > 0 && ancestors[ancestors.length - 1] !== this) {
|
|
22
|
+
ancestors.pop();
|
|
23
|
+
segments.length = expectDefined(pathLengths.pop(), "schema ancestor path length");
|
|
24
|
+
}
|
|
25
|
+
const prefixLength = segments.length;
|
|
26
|
+
if (!isRoot) {
|
|
27
|
+
if (Array.isArray(this)) segments.push("[", key, "]");
|
|
28
|
+
else segments.push(".", key);
|
|
29
|
+
}
|
|
30
|
+
if (invalidNumber) {
|
|
31
|
+
nonFiniteNumber.path = segments.join("");
|
|
32
|
+
segments.length = prefixLength;
|
|
33
|
+
} else {
|
|
34
|
+
ancestors.push(entry);
|
|
35
|
+
pathLengths.push(prefixLength);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
isRoot = false;
|
|
39
|
+
return entry;
|
|
40
|
+
});
|
|
41
|
+
} catch {
|
|
42
|
+
return {
|
|
43
|
+
schema: {},
|
|
44
|
+
violations: [`${path} is not JSON-serializable`]
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (!text) return {
|
|
48
|
+
schema: {},
|
|
49
|
+
violations: [`${path} is not JSON-serializable`]
|
|
50
|
+
};
|
|
51
|
+
if (nonFiniteNumber.path !== null) return {
|
|
52
|
+
schema: {},
|
|
53
|
+
violations: [`${nonFiniteNumber.path} is not JSON-serializable`]
|
|
54
|
+
};
|
|
55
|
+
const schema = JSON.parse(text);
|
|
56
|
+
captureJson?.(text);
|
|
57
|
+
return {
|
|
58
|
+
schema,
|
|
59
|
+
violations: []
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const schemaMapKeywords = /* @__PURE__ */ new Set([
|
|
63
|
+
"$defs",
|
|
64
|
+
"definitions",
|
|
65
|
+
"dependencies",
|
|
66
|
+
"dependentSchemas",
|
|
67
|
+
"patternProperties",
|
|
68
|
+
"properties"
|
|
69
|
+
]);
|
|
70
|
+
function inspectJsonSchema(schema, path, violations) {
|
|
71
|
+
if (Array.isArray(schema)) {
|
|
72
|
+
let index = 0;
|
|
73
|
+
for (const entry of schema) {
|
|
74
|
+
path.push("[", index++, "]");
|
|
75
|
+
const valid = inspectJsonSchema(entry, path, violations);
|
|
76
|
+
path.length -= 3;
|
|
77
|
+
if (!valid) return false;
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
if (!isRecord(schema)) return typeof schema !== "number" || Number.isFinite(schema);
|
|
82
|
+
for (const key of ["$dynamicRef", "$dynamicAnchor"]) if (key in schema) violations.push(`${path.join("")}.${key}`);
|
|
83
|
+
for (const key of Object.keys(schema)) {
|
|
84
|
+
const value = schema[key];
|
|
85
|
+
if (typeof value === "number" && !Number.isFinite(value)) return false;
|
|
86
|
+
if (!value || typeof value !== "object") continue;
|
|
87
|
+
path.push(".", key);
|
|
88
|
+
if (schemaMapKeywords.has(key) && isRecord(value)) for (const schemaName of Object.keys(value)) {
|
|
89
|
+
const childSchema = value[schemaName];
|
|
90
|
+
if (childSchema === void 0) return false;
|
|
91
|
+
path.push(".", schemaName);
|
|
92
|
+
const valid = inspectJsonSchema(childSchema, path, violations);
|
|
93
|
+
path.length -= 2;
|
|
94
|
+
if (!valid) return false;
|
|
95
|
+
}
|
|
96
|
+
else if (!inspectJsonSchema(value, path, violations)) return false;
|
|
97
|
+
path.length -= 2;
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
/** Projects one runtime tool input schema to JSON and reports runtime incompatibilities. */
|
|
102
|
+
function projectRuntimeToolInputSchema(schema, path = "parameters") {
|
|
103
|
+
return projectToolInputSchema(schema, path);
|
|
104
|
+
}
|
|
105
|
+
/** Package-private preparation; public projections never carry normalization provenance. */
|
|
106
|
+
function prepareRuntimeToolInputSchema(schema, path) {
|
|
107
|
+
let inputJson;
|
|
108
|
+
const projection = projectToolInputSchema(schema, path, (text) => {
|
|
109
|
+
inputJson = text;
|
|
110
|
+
});
|
|
111
|
+
return {
|
|
112
|
+
projection,
|
|
113
|
+
...schema && typeof schema === "object" && inputJson && projection.violations.length === 0 ? { normalization: {
|
|
114
|
+
source: schema,
|
|
115
|
+
inputJson
|
|
116
|
+
} } : {}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function projectToolInputSchema(schema, path, captureJson) {
|
|
120
|
+
const projection = serializeToolInputSchema(schema, path, captureJson);
|
|
121
|
+
const violations = [...projection.violations];
|
|
122
|
+
if (!isRecord(projection.schema)) violations.push(`${path} must be a JSON object schema`);
|
|
123
|
+
else if (projection.schema.type !== void 0 && projection.schema.type !== "object") violations.push(`${path}.type must be "object"`);
|
|
124
|
+
if (!inspectJsonSchema(projection.schema, [path], violations)) return {
|
|
125
|
+
schema: {},
|
|
126
|
+
violations: [`${path} is not a JSON value`]
|
|
127
|
+
};
|
|
128
|
+
return {
|
|
129
|
+
schema: projection.schema,
|
|
130
|
+
violations
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
export { projectRuntimeToolInputSchema as n, prepareRuntimeToolInputSchema as t };
|
package/dist/{transport-stream-shared-DNvmoWnv.d.mts → transport-stream-shared-BbUkFaHi.d.mts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { O as Model, V as ProviderResponse, Y as StreamOptions, a as AssistantMessage, ot as Usage } from "./types-
|
|
3
|
-
import { r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
4
|
-
import "./event-stream-
|
|
1
|
+
import "./index-DaF2QbwS.mjs";
|
|
2
|
+
import { O as Model, V as ProviderResponse, Y as StreamOptions, a as AssistantMessage, ot as Usage } from "./types-4_uVs5WH.mjs";
|
|
3
|
+
import { r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-CCoa-qSI.mjs";
|
|
4
|
+
import "./event-stream-DmSCpi1T.mjs";
|
|
5
5
|
import { t as ProviderErrorProjection } from "./provider-error-CzNw4BWX.mjs";
|
|
6
6
|
//#region packages/ai/src/transports/transport-stream-shared.d.ts
|
|
7
7
|
type ContextUsage = NonNullable<Usage["contextUsage"]>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as createAssistantMessageDiagnostic, t as appendAssistantMessageDiagnostic } from "./diagnostics-CPeq9F7y.mjs";
|
|
2
2
|
import { i as createAssistantMessageEventStream } from "./event-stream-D8PARQfL.mjs";
|
|
3
|
-
import { n as getAiTransportHost, v as sanitizeSurrogates } from "./host-B8YfDGd4.mjs";
|
|
4
3
|
import { i as asOptionalRecord, n as asNullableRecord, t as asNonArrayRecord } from "./record-coerce-DwRYMj3t.mjs";
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
4
|
+
import { n as getAiTransportHost, v as sanitizeSurrogates } from "./host-B4MeUNBc.mjs";
|
|
5
|
+
import { i as projectDiagnosticValue, n as projectProviderError } from "./provider-error-DDqw9Qda.mjs";
|
|
6
|
+
import { c as isTransientNetworkError } from "./diagnostics-Dm4bisWG.mjs";
|
|
7
7
|
import { parse } from "partial-json";
|
|
8
8
|
//#region packages/ai/src/utils/hash.ts
|
|
9
9
|
/** Fast deterministic hash to shorten long strings */
|
|
@@ -72,6 +72,7 @@ function escapeControlCharacter(char) {
|
|
|
72
72
|
* tool-call argument buffer) and every valid escape must survive as written.
|
|
73
73
|
*/
|
|
74
74
|
function repairJson(json, options) {
|
|
75
|
+
if (!/[\\\x00-\x1f]/.test(json)) return json;
|
|
75
76
|
const preserveValidControlEscapes = options?.preserveValidControlEscapes === true;
|
|
76
77
|
let repaired = "";
|
|
77
78
|
let inString = false;
|
|
@@ -110,10 +111,13 @@ function repairJson(json, options) {
|
|
|
110
111
|
stringValuePrefix += "\\";
|
|
111
112
|
continue;
|
|
112
113
|
}
|
|
113
|
-
if (!preserveValidControlEscapes && JSON_CONTROL_ESCAPES.has(nextChar)
|
|
114
|
-
|
|
115
|
-
stringValuePrefix
|
|
116
|
-
|
|
114
|
+
if (!preserveValidControlEscapes && JSON_CONTROL_ESCAPES.has(nextChar)) {
|
|
115
|
+
stringValuePrefix = stringValuePrefix.slice(-160);
|
|
116
|
+
if (looksLikeWindowsPathPrefix(stringValuePrefix)) {
|
|
117
|
+
repaired += "\\\\";
|
|
118
|
+
stringValuePrefix += "\\";
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
117
121
|
}
|
|
118
122
|
if (VALID_JSON_ESCAPES.has(nextChar)) {
|
|
119
123
|
repaired += `\\${nextChar}`;
|
|
@@ -134,8 +138,7 @@ function parseJsonWithRepair(json) {
|
|
|
134
138
|
return JSON.parse(repairJson(json));
|
|
135
139
|
}
|
|
136
140
|
function looksLikeWindowsPathPrefix(prefix) {
|
|
137
|
-
|
|
138
|
-
return /(?:^|[^A-Za-z0-9])[A-Za-z]:(?:[\\/][^"\\/:*?<>|\r\n]*)*$/.test(tail);
|
|
141
|
+
return /(?:^|[^A-Za-z0-9])[A-Za-z]:(?:[\\/][^"\\/:*?<>|\r\n]*)*$/.test(prefix);
|
|
139
142
|
}
|
|
140
143
|
/**
|
|
141
144
|
* Attempts to parse potentially incomplete JSON during streaming.
|
|
@@ -152,11 +155,7 @@ function parseStreamingJson(partialJson) {
|
|
|
152
155
|
try {
|
|
153
156
|
return asNonArrayRecord(parse(partialJson));
|
|
154
157
|
} catch {
|
|
155
|
-
|
|
156
|
-
return asNonArrayRecord(parse(repairJson(partialJson)));
|
|
157
|
-
} catch {
|
|
158
|
-
return {};
|
|
159
|
-
}
|
|
158
|
+
return {};
|
|
160
159
|
}
|
|
161
160
|
}
|
|
162
161
|
}
|
|
@@ -221,6 +220,7 @@ function isUnsafeIntegerLiteral(token) {
|
|
|
221
220
|
}
|
|
222
221
|
/** Quotes integer literals above Number.MAX_SAFE_INTEGER before JSON.parse. */
|
|
223
222
|
function quoteUnsafeIntegerLiterals(input) {
|
|
223
|
+
if (!/(?:^|\D)\d{16}/.test(input)) return input;
|
|
224
224
|
let out = "";
|
|
225
225
|
let inString = false;
|
|
226
226
|
let escaped = false;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as getAiTransportHost } from "./host-
|
|
1
|
+
import { n as getAiTransportHost } from "./host-B4MeUNBc.mjs";
|
|
2
2
|
import { t as truncateUtf16Safe } from "./utf16-slice-CvGodqok.mjs";
|
|
3
|
-
import "./provider-error-
|
|
3
|
+
import "./provider-error-DDqw9Qda.mjs";
|
|
4
4
|
import "./internal/retry-after.mjs";
|
|
5
|
-
import "./positive-integer-
|
|
5
|
+
import "./positive-integer-DtjCkbue.mjs";
|
|
6
6
|
//#region packages/normalization-core/src/response-bytes.ts
|
|
7
7
|
async function consumeResponseBytes(options) {
|
|
8
8
|
let size = 0;
|
package/dist/transports.d.mts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { $ as ThinkingContent, B as ProviderReplayState, K as StopReason, M as OpenAICompletionsCompat, O as Model, X as TextContent, Y as StreamOptions, a as AssistantMessage, d as Context, l as CacheRetention, n as Api, nt as Tool, ot as Usage, q as StreamFn, rt as ToolCall
|
|
3
|
-
import { n as ApiRegistry } from "./api-registry-
|
|
4
|
-
import { a as BaseOpenAIStreamOptions, c as OpenAIResponsesCompactionRejection, o as CodeModeToolSurfaceObservation, s as OpenAICompletionsOptions } from "./provider-options-
|
|
1
|
+
import "./index-DaF2QbwS.mjs";
|
|
2
|
+
import { $ as ThinkingContent, B as ProviderReplayState, K as StopReason, M as OpenAICompletionsCompat, O as Model, X as TextContent, Y as StreamOptions, _t as ModelDataThinkingFormat, a as AssistantMessage, d as Context, l as CacheRetention, n as Api, nt as Tool, ot as Usage, q as StreamFn, rt as ToolCall } from "./types-4_uVs5WH.mjs";
|
|
3
|
+
import { n as ApiRegistry } from "./api-registry-Ba2Cv-ut.mjs";
|
|
4
|
+
import { a as BaseOpenAIStreamOptions, c as OpenAIResponsesCompactionRejection, o as CodeModeToolSurfaceObservation, s as OpenAICompletionsOptions } from "./provider-options-DprLsWh9.mjs";
|
|
5
5
|
import { n as OpenAIToolProjection } from "./openai-tool-projection-793cE3QX.mjs";
|
|
6
|
-
import "./types-
|
|
7
|
-
import { a as buildAnthropicSystemBlocks, c as logAnthropicContextEdits, d as resolveAnthropicEphemeralCacheControl, f as resolveAnthropicPayloadPolicy, i as applyAnthropicRequestCacheControl, l as resolveAnthropicCacheOptions, n as applyAnthropicEphemeralCacheControlMarkers, o as isAnthropicServerToolClearingEnabled, p as resolveAnthropicServerCompactionPlan, r as applyAnthropicPayloadPolicyToParams, s as isDirectAnthropicModel, t as applyAnthropicContextManagementToRequest, u as resolveAnthropicContextManagementBetaHeader } from "./anthropic-payload-policy-
|
|
8
|
-
import { i as
|
|
9
|
-
import { i as
|
|
10
|
-
import {
|
|
11
|
-
import { S as withProviderResponseHook, _ as parseTerminalToolCallArguments, a as coerceTransportToolCallArguments, b as transportAbortError, c as createWritableTransportEventStream, d as finalizeTransportStream, f as mergeTransportHeaders, g as notifyProviderStreamOpened, h as notifyProviderHttpResponse, i as assignTransportErrorDetails, l as failTransportStream, m as notifyProviderHttpMetadata, n as ProviderAcceptance, o as copyProviderAcceptanceObserver, p as mergeTransportMetadata, r as WritableTransportStream, s as createEmptyTransportUsage, t as IncompleteToolCallError, u as finalizeTerminalToolCallArguments, v as sanitizeNonEmptyTransportPayloadText, x as withProviderAcceptanceObserver, y as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
6
|
+
import "./types-DkJfb4W3.mjs";
|
|
7
|
+
import { a as buildAnthropicSystemBlocks, c as logAnthropicContextEdits, d as resolveAnthropicEphemeralCacheControl, f as resolveAnthropicPayloadPolicy, i as applyAnthropicRequestCacheControl, l as resolveAnthropicCacheOptions, n as applyAnthropicEphemeralCacheControlMarkers, o as isAnthropicServerToolClearingEnabled, p as resolveAnthropicServerCompactionPlan, r as applyAnthropicPayloadPolicyToParams, s as isDirectAnthropicModel, t as applyAnthropicContextManagementToRequest, u as resolveAnthropicContextManagementBetaHeader } from "./anthropic-payload-policy-5Erq1Nzy.mjs";
|
|
8
|
+
import { a as resolveOpenAICompletionsCompat, i as isOpenAICodexResponsesModel, n as detectOpenAICompletionsCompat, o as resolveOpenAIPromptCacheKeySupport, r as isNativeOpenAIEndpoint, s as usesNativeOpenAICodexResponsesBackend, t as ResolvedOpenAICompletionsCompat } from "./openai-completions-compat-JE7gqxb9.mjs";
|
|
9
|
+
import { i as ReplayableResponseCompactionItem, n as OpenAIResponsesOptions, r as OpenAIResponsesReasoningReplayMetadata, s as OpenAIResponsesCompactionOutput } from "./openai-responses-contracts-Dflvrfa8.mjs";
|
|
10
|
+
import { i as resolveOpenAIResponsesServerCompactionPlan, n as resolveOpenAIResponsesCompactEndpointPlan, r as resolveOpenAIResponsesPayloadPolicy, t as applyOpenAIResponsesPayloadPolicy } from "./openai-responses-payload-policy-C7GsA1y0.mjs";
|
|
11
|
+
import { S as withProviderResponseHook, _ as parseTerminalToolCallArguments, a as coerceTransportToolCallArguments, b as transportAbortError, c as createWritableTransportEventStream, d as finalizeTransportStream, f as mergeTransportHeaders, g as notifyProviderStreamOpened, h as notifyProviderHttpResponse, i as assignTransportErrorDetails, l as failTransportStream, m as notifyProviderHttpMetadata, n as ProviderAcceptance, o as copyProviderAcceptanceObserver, p as mergeTransportMetadata, r as WritableTransportStream, s as createEmptyTransportUsage, t as IncompleteToolCallError, u as finalizeTerminalToolCallArguments, v as sanitizeNonEmptyTransportPayloadText, x as withProviderAcceptanceObserver, y as sanitizeTransportPayloadText } from "./transport-stream-shared-BbUkFaHi.mjs";
|
|
12
12
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-Cwcjv_fx.mjs";
|
|
13
13
|
import { r as normalizeOpenAIStrictToolParameters } from "./openai-tool-schema-ynZBgqW-.mjs";
|
|
14
|
-
import { d as VideoContent, i as ProviderContext, s as ProviderModel } from "./provider-types-
|
|
14
|
+
import { d as VideoContent, i as ProviderContext, s as ProviderModel } from "./provider-types-CAKRC7N5.mjs";
|
|
15
15
|
import { a as resolveModelSseDebugMode, i as resolveModelPayloadDebugMode, n as formatModelTransportDebugUrl, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl } from "./model-transport-url-DKocrEsb.mjs";
|
|
16
16
|
import OpenAI from "openai";
|
|
17
17
|
import { Part } from "@google/genai";
|
|
@@ -82,6 +82,17 @@ export declare const log: {
|
|
|
82
82
|
info(message: string, data?: Record<string, unknown>): void;
|
|
83
83
|
warn(message: string, data?: Record<string, unknown>): void;
|
|
84
84
|
};
|
|
85
|
+
export declare function createResponseModelTracker(enabled?: boolean): {
|
|
86
|
+
begin: (headers?: Headers) => void;
|
|
87
|
+
observeEvent: (event: unknown) => string | undefined;
|
|
88
|
+
resolve: () => string | undefined;
|
|
89
|
+
track(response: Pick<Response, "headers"> | undefined, stream: AsyncIterable<unknown>): AsyncIterable<unknown>;
|
|
90
|
+
terminalOptions: {
|
|
91
|
+
resolveResponseModel: () => string | undefined;
|
|
92
|
+
} | {
|
|
93
|
+
resolveResponseModel?: undefined;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
85
96
|
export declare function resolveOpenAIClientBaseUrl(model: Pick<Model, "provider" | "baseUrl">, baseUrl?: string | undefined): string | undefined;
|
|
86
97
|
export type OpenAICompletionsTextSource = "reasoning_detail" | "refusal";
|
|
87
98
|
export type OpenAICompletionsContentDelta = {
|
|
@@ -265,6 +276,7 @@ export declare function getCompat(model: OpenAIModeModel): {
|
|
|
265
276
|
supportsJsonSchemaResponseFormat: boolean;
|
|
266
277
|
supportsPromptCacheKey: boolean;
|
|
267
278
|
supportsLongCacheRetention: boolean;
|
|
279
|
+
supportedReasoningEfforts?: string[] | undefined;
|
|
268
280
|
sessionAffinity: "openai" | "openrouter" | "none";
|
|
269
281
|
visibleReasoningDetailTypes: string[];
|
|
270
282
|
requiresNonEmptyUserOrAssistantMessage: boolean;
|
|
@@ -284,6 +296,7 @@ type ReplayPressureEstimator = {
|
|
|
284
296
|
text(value: string): number;
|
|
285
297
|
image(): number;
|
|
286
298
|
json(value: unknown): number;
|
|
299
|
+
toolResult?(value: string): number;
|
|
287
300
|
};
|
|
288
301
|
/** Resolve from prepared transport facts; never retain or return credential material. */
|
|
289
302
|
export declare function resolveCompactionReplayEligibility(model: Model, options: {
|
|
@@ -295,9 +308,10 @@ export declare function requiresCompactionReplayRefresh(messages: readonly Repla
|
|
|
295
308
|
/** Carry a checkpoint immediately after reference-preserving history limiting, before repair. */
|
|
296
309
|
export declare function preserveCompactionReplayWindow<T extends ReplayMessage>(source: readonly T[], windowed: T[], model: Model, identity: ReplayIdentity): T[];
|
|
297
310
|
/** Estimate the canonical prefix and its tail once, independent of unbound usage snapshots. */
|
|
298
|
-
export declare function resolveCompactionReplayPressure<T extends ReplayMessage>(messages: T[], model: Model, identity: ReplayIdentity, estimate: ReplayPressureEstimator): {
|
|
311
|
+
export declare function resolveCompactionReplayPressure<T extends ReplayMessage>(messages: T[], model: Model, identity: ReplayIdentity, estimate: ReplayPressureEstimator, systemPrompt?: string): {
|
|
299
312
|
messages: T[];
|
|
300
313
|
prefixTokens: number;
|
|
314
|
+
measuredTokens?: number;
|
|
301
315
|
} | undefined;
|
|
302
316
|
/** Whether provider replay state is a prefix-bound server compaction checkpoint. */
|
|
303
317
|
export declare function isCompactionReplayCheckpoint(replay: unknown): replay is ProviderReplayState;
|