@jerome-benoit/sap-ai-provider-v2 4.8.0 → 4.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/{chunk-TQXCNZBC.js → chunk-5EDF6MHL.js} +4 -4
  2. package/dist/chunk-5EDF6MHL.js.map +1 -0
  3. package/dist/{chunk-BVDSJ4IZ.js → chunk-5JVF4555.js} +3 -3
  4. package/dist/{chunk-3ZSXTKOK.js → chunk-5ZKQJNHO.js} +399 -101
  5. package/dist/{chunk-3ZSXTKOK.js.map → chunk-5ZKQJNHO.js.map} +1 -1
  6. package/dist/{chunk-KVOLFUQJ.js → chunk-RJFB6VFO.js} +2 -2
  7. package/dist/{chunk-H5KD4EPO.js → chunk-VHZSAQBJ.js} +2 -2
  8. package/dist/{foundation-models-embedding-model-strategy-SWRJNFD4.js → foundation-models-embedding-model-strategy-VKBRG7RT.js} +4 -4
  9. package/dist/{foundation-models-language-model-strategy-LRAC25ZY.js → foundation-models-language-model-strategy-FBGKZSTU.js} +4 -4
  10. package/dist/index.cjs +413 -106
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +6 -4
  13. package/dist/index.d.ts +6 -4
  14. package/dist/index.js +6 -6
  15. package/dist/index.js.map +1 -1
  16. package/dist/{orchestration-embedding-model-strategy-C5G735Q2.js → orchestration-embedding-model-strategy-DVPO2TP3.js} +5 -5
  17. package/dist/{orchestration-language-model-strategy-NUHYRIXH.js → orchestration-language-model-strategy-KEJWB4E2.js} +18 -9
  18. package/dist/orchestration-language-model-strategy-KEJWB4E2.js.map +1 -0
  19. package/package.json +19 -21
  20. package/dist/chunk-TQXCNZBC.js.map +0 -1
  21. package/dist/orchestration-language-model-strategy-NUHYRIXH.js.map +0 -1
  22. /package/dist/{chunk-BVDSJ4IZ.js.map → chunk-5JVF4555.js.map} +0 -0
  23. /package/dist/{chunk-KVOLFUQJ.js.map → chunk-RJFB6VFO.js.map} +0 -0
  24. /package/dist/{chunk-H5KD4EPO.js.map → chunk-VHZSAQBJ.js.map} +0 -0
  25. /package/dist/{foundation-models-embedding-model-strategy-SWRJNFD4.js.map → foundation-models-embedding-model-strategy-VKBRG7RT.js.map} +0 -0
  26. /package/dist/{foundation-models-language-model-strategy-LRAC25ZY.js.map → foundation-models-language-model-strategy-FBGKZSTU.js.map} +0 -0
  27. /package/dist/{orchestration-embedding-model-strategy-C5G735Q2.js.map → orchestration-embedding-model-strategy-DVPO2TP3.js.map} +0 -0
package/dist/index.cjs CHANGED
@@ -317,7 +317,7 @@ function parseSAPPartProviderOptions(providerOptions, warnings) {
317
317
  }
318
318
  return void 0;
319
319
  }
320
- var import_provider_utils, import_zod, SAP_AI_PROVIDER_NAME, modelParamsSchema, embeddingModelParamsSchema, sapAIApiTypeSchema, cacheControlSchema, sapAIPartProviderOptionsSchema, promptTemplateScopeSchema, promptTemplateRefByIdSchema, promptTemplateRefByScenarioNameVersionSchema, promptTemplateRefSchema, orchestrationConfigRefByIdSchema, orchestrationConfigRefByScenarioNameVersionSchema, orchestrationConfigRefSchema, sapAILanguageModelProviderOptions, sapAIEmbeddingProviderOptions;
320
+ var import_provider_utils, import_zod, SAP_AI_PROVIDER_NAME, modelParamsSchema, embeddingModelParamsSchema, sapAIApiTypeSchema, cacheControlSchema, sapAIPartProviderOptionsSchema, promptTemplateScopeSchema, promptTemplateRefByIdSchema, promptTemplateRefByScenarioNameVersionSchema, promptTemplateRefSchema, orchestrationConfigRefOverrideSchema, orchestrationConfigRefByIdSchema, orchestrationConfigRefByScenarioNameVersionSchema, orchestrationConfigRefSchema, sapAILanguageModelProviderOptions, sapAIEmbeddingProviderOptions;
321
321
  var init_sap_ai_provider_options = __esm({
322
322
  "src/sap-ai-provider-options.ts"() {
323
323
  "use strict";
@@ -361,11 +361,48 @@ var init_sap_ai_provider_options = __esm({
361
361
  promptTemplateRefByIdSchema,
362
362
  promptTemplateRefByScenarioNameVersionSchema
363
363
  ]);
364
+ orchestrationConfigRefOverrideSchema = import_zod.z.custom(
365
+ (value) => typeof value === "object" && value !== null && !Array.isArray(value),
366
+ { message: "overrideConfig must be an object" }
367
+ ).refine(
368
+ (value) => {
369
+ let stream;
370
+ try {
371
+ stream = value.stream;
372
+ } catch {
373
+ return false;
374
+ }
375
+ return stream === void 0 || Boolean(stream) && typeof stream === "object" && !Array.isArray(stream);
376
+ },
377
+ { message: "overrideConfig.stream must be an object" }
378
+ ).refine(
379
+ (value) => {
380
+ let stream;
381
+ try {
382
+ stream = value.stream;
383
+ } catch {
384
+ return true;
385
+ }
386
+ if (stream === void 0 || stream === null || typeof stream !== "object") {
387
+ return true;
388
+ }
389
+ try {
390
+ return !("enabled" in stream);
391
+ } catch {
392
+ return false;
393
+ }
394
+ },
395
+ {
396
+ message: "stream.enabled is not allowed in overrideConfig: it is controlled by the call site (stream() or chatCompletion())"
397
+ }
398
+ );
364
399
  orchestrationConfigRefByIdSchema = import_zod.z.object({
365
- id: import_zod.z.string().min(1, "Config ID cannot be empty")
400
+ id: import_zod.z.string().min(1, "Config ID cannot be empty"),
401
+ overrideConfig: orchestrationConfigRefOverrideSchema.optional()
366
402
  });
367
403
  orchestrationConfigRefByScenarioNameVersionSchema = import_zod.z.object({
368
404
  name: import_zod.z.string().min(1, "Config name cannot be empty"),
405
+ overrideConfig: orchestrationConfigRefOverrideSchema.optional(),
369
406
  scenario: import_zod.z.string().min(1, "Scenario cannot be empty"),
370
407
  version: import_zod.z.string().min(1, "Version cannot be empty")
371
408
  });
@@ -11764,7 +11801,7 @@ var require_error_with_cause = __commonJS({
11764
11801
  this.addStack(cause);
11765
11802
  }
11766
11803
  isAxiosError(err) {
11767
- return err["isAxiosError"] === true;
11804
+ return "isAxiosError" in err && err.isAxiosError === true;
11768
11805
  }
11769
11806
  addStack(cause) {
11770
11807
  if (this.isAxiosError(cause)) {
@@ -25701,6 +25738,7 @@ var require_axios = __commonJS({
25701
25738
  var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined";
25702
25739
  var isBlob = kindOfTest("Blob");
25703
25740
  var isFileList = kindOfTest("FileList");
25741
+ var isSet = kindOfTest("Set");
25704
25742
  var isStream = (val) => isObject(val) && isFunction$1(val.pipe);
25705
25743
  function getGlobal() {
25706
25744
  if (typeof globalThis !== "undefined") return globalThis;
@@ -25998,11 +26036,20 @@ var require_axios = __commonJS({
25998
26036
  }
25999
26037
  if (!("toJSON" in source)) {
26000
26038
  visited.add(source);
26001
- const target = isArray(source) ? [] : {};
26002
- forEach(source, (value, key) => {
26003
- const reducedValue = visit(value);
26004
- !isUndefined(reducedValue) && (target[key] = reducedValue);
26005
- });
26039
+ let target;
26040
+ if (isSet(source)) {
26041
+ target = [];
26042
+ for (const value of source) {
26043
+ const reducedValue = visit(value);
26044
+ !isUndefined(reducedValue) && target.push(reducedValue);
26045
+ }
26046
+ } else {
26047
+ target = isArray(source) ? [] : {};
26048
+ forEach(source, (value, key) => {
26049
+ const reducedValue = visit(value);
26050
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
26051
+ });
26052
+ }
26006
26053
  visited.delete(source);
26007
26054
  return target;
26008
26055
  }
@@ -26110,17 +26157,18 @@ var require_axios = __commonJS({
26110
26157
  i = line.indexOf(":");
26111
26158
  key = line.substring(0, i).trim().toLowerCase();
26112
26159
  val = line.substring(i + 1).trim();
26113
- if (!key || parsed[key] && ignoreDuplicateOf[key]) {
26160
+ const hasKey = utils$1.hasOwnProp(parsed, key);
26161
+ if (!key || hasKey && utils$1.hasOwnProp(ignoreDuplicateOf, key)) {
26114
26162
  return;
26115
26163
  }
26116
26164
  if (key === "set-cookie") {
26117
- if (parsed[key]) {
26165
+ if (hasKey) {
26118
26166
  parsed[key].push(val);
26119
26167
  } else {
26120
26168
  parsed[key] = [val];
26121
26169
  }
26122
26170
  } else {
26123
- parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
26171
+ parsed[key] = hasKey ? parsed[key] + ", " + val : val;
26124
26172
  }
26125
26173
  });
26126
26174
  return parsed;
@@ -26180,6 +26228,90 @@ var require_axios = __commonJS({
26180
26228
  }
26181
26229
  return tokens;
26182
26230
  }
26231
+ var parameterNameRE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
26232
+ function trimOWS(value) {
26233
+ let start = 0;
26234
+ let end = value.length;
26235
+ while (start < end) {
26236
+ const code = value.charCodeAt(start);
26237
+ if (code !== 9 && code !== 32) {
26238
+ break;
26239
+ }
26240
+ start += 1;
26241
+ }
26242
+ while (end > start) {
26243
+ const code = value.charCodeAt(end - 1);
26244
+ if (code !== 9 && code !== 32) {
26245
+ break;
26246
+ }
26247
+ end -= 1;
26248
+ }
26249
+ return start === 0 && end === value.length ? value : value.slice(start, end);
26250
+ }
26251
+ function decodeQuotedString(value) {
26252
+ const last2 = value.length - 1;
26253
+ if (last2 < 1 || value.charCodeAt(0) !== 34 || value.charCodeAt(last2) !== 34) {
26254
+ return value;
26255
+ }
26256
+ let decoded = "";
26257
+ for (let i = 1; i < last2; i++) {
26258
+ const code = value.charCodeAt(i);
26259
+ if (code === 34) {
26260
+ return value;
26261
+ }
26262
+ if (code === 92) {
26263
+ i += 1;
26264
+ if (i >= last2) {
26265
+ return value;
26266
+ }
26267
+ }
26268
+ decoded += value[i];
26269
+ }
26270
+ return decoded;
26271
+ }
26272
+ function parseParameters(value) {
26273
+ const parameters = /* @__PURE__ */ Object.create(null);
26274
+ const str = String(value);
26275
+ let start = 0;
26276
+ let quoted = false;
26277
+ let escaped = false;
26278
+ function parseParameter(end) {
26279
+ const part = trimOWS(str.slice(start, end));
26280
+ const equals = part.indexOf("=");
26281
+ if (equals < 1) {
26282
+ return;
26283
+ }
26284
+ const name = trimOWS(part.slice(0, equals));
26285
+ if (!parameterNameRE.test(name)) {
26286
+ return;
26287
+ }
26288
+ const normalizedName = name.toLowerCase();
26289
+ if (normalizedName === "__proto__" || normalizedName === "constructor" || normalizedName === "prototype") {
26290
+ return;
26291
+ }
26292
+ const parameterValue = trimOWS(part.slice(equals + 1));
26293
+ parameters[normalizedName] = decodeQuotedString(parameterValue);
26294
+ }
26295
+ for (let i = 0; i < str.length; i++) {
26296
+ const code = str.charCodeAt(i);
26297
+ if (quoted) {
26298
+ if (escaped) {
26299
+ escaped = false;
26300
+ } else if (code === 92) {
26301
+ escaped = true;
26302
+ } else if (code === 34) {
26303
+ quoted = false;
26304
+ }
26305
+ } else if (code === 34) {
26306
+ quoted = true;
26307
+ } else if (code === 44 || code === 59) {
26308
+ parseParameter(i);
26309
+ start = i + 1;
26310
+ }
26311
+ }
26312
+ parseParameter(str.length);
26313
+ return parameters;
26314
+ }
26183
26315
  var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
26184
26316
  function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
26185
26317
  if (utils$1.isFunction(filter)) {
@@ -26355,7 +26487,8 @@ var require_axios = __commonJS({
26355
26487
  return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
26356
26488
  }
26357
26489
  getSetCookie() {
26358
- return this.get("set-cookie") || [];
26490
+ const value = this.get("set-cookie");
26491
+ return utils$1.isArray(value) ? value : value == null || value === false ? [] : [value];
26359
26492
  }
26360
26493
  get [Symbol.toStringTag]() {
26361
26494
  return "AxiosHeaders";
@@ -26363,6 +26496,9 @@ var require_axios = __commonJS({
26363
26496
  static from(thing) {
26364
26497
  return thing instanceof this ? thing : new this(thing);
26365
26498
  }
26499
+ static parseParameters(value) {
26500
+ return parseParameters(value);
26501
+ }
26366
26502
  static concat(first2, ...targets) {
26367
26503
  const computed = new this(first2);
26368
26504
  targets.forEach((target) => computed.set(target));
@@ -26450,9 +26586,30 @@ var require_axios = __commonJS({
26450
26586
  };
26451
26587
  return visit(config);
26452
26588
  }
26589
+ function stringifySafely$1(value) {
26590
+ try {
26591
+ return String(value);
26592
+ } catch (err) {
26593
+ return "";
26594
+ }
26595
+ }
26596
+ function aggregateErrorMessage(error) {
26597
+ const message = error.errors.map((entry) => {
26598
+ try {
26599
+ return entry && entry.message ? stringifySafely$1(entry.message) : stringifySafely$1(entry);
26600
+ } catch (err) {
26601
+ return "";
26602
+ }
26603
+ }).filter(Boolean).join("; ");
26604
+ return message || error.name || "AggregateError";
26605
+ }
26453
26606
  var AxiosError = class _AxiosError extends Error {
26454
26607
  static from(error, code, config, request, response, customProps) {
26455
- const axiosError = new _AxiosError(error.message, code || error.code, config, request, response);
26608
+ let message = error.message;
26609
+ if (!message && utils$1.isArray(error.errors) && error.errors.length) {
26610
+ message = aggregateErrorMessage(error);
26611
+ }
26612
+ const axiosError = new _AxiosError(message, code || error.code, config, request, response);
26456
26613
  Object.defineProperty(axiosError, "cause", {
26457
26614
  __proto__: null,
26458
26615
  value: error,
@@ -26536,6 +26693,14 @@ var require_axios = __commonJS({
26536
26693
  AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
26537
26694
  AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
26538
26695
  AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
26696
+ var PlatformBuffer = {
26697
+ isBufferAvailable() {
26698
+ return typeof Buffer !== "undefined";
26699
+ },
26700
+ from(value) {
26701
+ return Buffer.from(value);
26702
+ }
26703
+ };
26539
26704
  var DEFAULT_FORM_DATA_MAX_DEPTH = 100;
26540
26705
  function isVisitable(thing) {
26541
26706
  return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
@@ -26594,8 +26759,8 @@ var require_axios = __commonJS({
26594
26759
  if (useBlob && typeof _Blob === "function") {
26595
26760
  return new _Blob([value]);
26596
26761
  }
26597
- if (typeof Buffer !== "undefined") {
26598
- return Buffer.from(value);
26762
+ if (PlatformBuffer && PlatformBuffer.isBufferAvailable()) {
26763
+ return PlatformBuffer.from(value);
26599
26764
  }
26600
26765
  throw new AxiosError("Blob is not supported. Use a Buffer instead.", AxiosError.ERR_NOT_SUPPORT);
26601
26766
  }
@@ -26873,7 +27038,7 @@ var require_axios = __commonJS({
26873
27038
  }
26874
27039
  function parsePropPath(name) {
26875
27040
  const path2 = [];
26876
- const pattern = /\w+|\[(\w*)]/g;
27041
+ const pattern = /[^.[\]]+|\[([^.[\]]*)]/g;
26877
27042
  let match2;
26878
27043
  while ((match2 = pattern.exec(name)) !== null) {
26879
27044
  throwIfDepthExceeded(path2.length);
@@ -27080,7 +27245,14 @@ var require_axios = __commonJS({
27080
27245
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
27081
27246
  }
27082
27247
  function combineURLs(baseURL, relativeURL) {
27083
- return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
27248
+ if (!relativeURL) {
27249
+ return baseURL;
27250
+ }
27251
+ let end = baseURL.length;
27252
+ while (end > 0 && baseURL.charCodeAt(end - 1) === 47) {
27253
+ end--;
27254
+ }
27255
+ return baseURL.slice(0, end) + "/" + relativeURL.replace(/^\/+/, "");
27084
27256
  }
27085
27257
  var malformedHttpProtocol = /^https?:(?!\/\/)/i;
27086
27258
  var httpProtocolControlCharacters = /[\t\n\r]/g;
@@ -27094,9 +27266,30 @@ var require_axios = __commonJS({
27094
27266
  function normalizeURLForProtocolCheck(url2) {
27095
27267
  return stripLeadingC0ControlOrSpace(url2).replace(httpProtocolControlCharacters, "");
27096
27268
  }
27269
+ function redactFragment(fragment) {
27270
+ if (!fragment) {
27271
+ return fragment;
27272
+ }
27273
+ return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match2, separator, parameterName = "") => {
27274
+ return `${separator}${parameterName}${REDACTED}`;
27275
+ });
27276
+ }
27277
+ function redactSensitiveURLParts(url2) {
27278
+ const redactedURL = url2.replace(/^(https?:\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`);
27279
+ const fragmentIndex = redactedURL.indexOf("#");
27280
+ const urlWithoutFragment = fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex);
27281
+ const redactedURLWithoutFragment = urlWithoutFragment.replace(/([?&][^=&#]*=)[^&#]*/g, `$1${REDACTED}`);
27282
+ if (fragmentIndex === -1) {
27283
+ return redactedURLWithoutFragment;
27284
+ }
27285
+ return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`;
27286
+ }
27097
27287
  function assertValidHttpProtocolURL(url2, config) {
27098
- if (typeof url2 === "string" && malformedHttpProtocol.test(normalizeURLForProtocolCheck(url2))) {
27099
- throw new AxiosError('Invalid URL: missing "//" after protocol', AxiosError.ERR_INVALID_URL, config);
27288
+ if (typeof url2 === "string") {
27289
+ const normalizedURL = normalizeURLForProtocolCheck(url2);
27290
+ if (malformedHttpProtocol.test(normalizedURL)) {
27291
+ throw new AxiosError(`Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`, AxiosError.ERR_INVALID_URL, config);
27292
+ }
27100
27293
  }
27101
27294
  }
27102
27295
  function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
@@ -27173,7 +27366,7 @@ var require_axios = __commonJS({
27173
27366
  function getEnv(key) {
27174
27367
  return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
27175
27368
  }
27176
- var VERSION2 = "1.18.1";
27369
+ var VERSION2 = "1.19.0";
27177
27370
  function parseProtocol(url2) {
27178
27371
  const match2 = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url2);
27179
27372
  return match2 && match2[1] || "";
@@ -27214,6 +27407,18 @@ var require_axios = __commonJS({
27214
27407
  }
27215
27408
  throw new AxiosError("Unsupported protocol " + protocol, AxiosError.ERR_NOT_SUPPORT);
27216
27409
  }
27410
+ var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"];
27411
+ function setFormDataHeaders(headers, formHeaders, policy) {
27412
+ if (policy !== "content-only") {
27413
+ headers.set(formHeaders);
27414
+ return;
27415
+ }
27416
+ Object.entries(formHeaders || {}).forEach(([key, val]) => {
27417
+ if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
27418
+ headers.set(key, val);
27419
+ }
27420
+ });
27421
+ }
27217
27422
  var kInternals = /* @__PURE__ */ Symbol("internals");
27218
27423
  var AxiosTransformStream = class extends stream.Transform {
27219
27424
  constructor(options) {
@@ -27532,6 +27737,60 @@ var require_axios = __commonJS({
27532
27737
  if (parts[0] !== "127") return false;
27533
27738
  return parts.every((p) => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255);
27534
27739
  };
27740
+ var parseIPv4Octet = (text) => {
27741
+ if (/^0[xX][0-9a-fA-F]+$/.test(text)) {
27742
+ const n = parseInt(text.slice(2), 16);
27743
+ return Number.isFinite(n) ? n : null;
27744
+ }
27745
+ if (text.length > 1 && /^0[0-7]+$/.test(text)) {
27746
+ const n = parseInt(text, 8);
27747
+ return Number.isFinite(n) ? n : null;
27748
+ }
27749
+ if (text.length > 1 && /^0[0-9]+$/.test(text)) {
27750
+ return null;
27751
+ }
27752
+ if (/^[0-9]+$/.test(text)) {
27753
+ const n = parseInt(text, 10);
27754
+ return Number.isFinite(n) ? n : null;
27755
+ }
27756
+ return null;
27757
+ };
27758
+ var normalizeIPAddress = (host) => {
27759
+ if (typeof host !== "string" || !host || host.indexOf(":") !== -1) {
27760
+ return host;
27761
+ }
27762
+ let h = host;
27763
+ if (h.charAt(0) === "[" && h.charAt(h.length - 1) === "]") {
27764
+ h = h.slice(1, -1);
27765
+ }
27766
+ h = h.replace(/\.+$/, "");
27767
+ if (!/^[0-9.xXa-fA-F]+$/.test(h)) return host;
27768
+ const parts = h.split(".");
27769
+ if (parts.some((p) => p === "")) return host;
27770
+ if (parts.length === 4) {
27771
+ const octets = parts.map(parseIPv4Octet);
27772
+ if (octets.some((n) => n === null || n < 0 || n > 255)) return host;
27773
+ return octets.join(".");
27774
+ }
27775
+ if (parts.length > 4) {
27776
+ return host;
27777
+ }
27778
+ if (parts.length === 1) return host;
27779
+ const literalOctets = parts.slice(0, -1);
27780
+ const tail = parts[parts.length - 1];
27781
+ const tailSlots = 4 - literalOctets.length;
27782
+ const tailValue = parseIPv4Octet(tail);
27783
+ if (tailValue === null) return host;
27784
+ const maxTail = (1 << 8 * tailSlots) - 1;
27785
+ if (tailValue < 0 || tailValue > maxTail) return host;
27786
+ const tailOctets = new Array(tailSlots).fill(0);
27787
+ for (let i = tailSlots - 1, v = tailValue; i >= 0; i--, v >>= 8) {
27788
+ tailOctets[i] = v & 255;
27789
+ }
27790
+ const literal2 = literalOctets.map(parseIPv4Octet);
27791
+ if (literal2.some((n) => n === null || n < 0 || n > 255)) return host;
27792
+ return [...literal2, ...tailOctets].join(".");
27793
+ };
27535
27794
  var isIPv6ZeroGroup = (group) => /^0{1,4}$/.test(group);
27536
27795
  var isIPv6Unspecified = (host) => {
27537
27796
  if (host === "::") return true;
@@ -27623,7 +27882,12 @@ var require_axios = __commonJS({
27623
27882
  if (hostname.charAt(0) === "[" && hostname.charAt(hostname.length - 1) === "]") {
27624
27883
  hostname = hostname.slice(1, -1);
27625
27884
  }
27626
- return unmapIPv4MappedIPv6(hostname.replace(/\.+$/, ""));
27885
+ const trimmed = hostname.replace(/\.+$/, "");
27886
+ const ipv4 = normalizeIPAddress(trimmed);
27887
+ if (ipv4 !== trimmed) {
27888
+ return ipv4;
27889
+ }
27890
+ return unmapIPv4MappedIPv6(trimmed);
27627
27891
  };
27628
27892
  function shouldBypassProxy(location) {
27629
27893
  let parsed;
@@ -27645,6 +27909,9 @@ var require_axios = __commonJS({
27645
27909
  if (!entry) {
27646
27910
  return false;
27647
27911
  }
27912
+ if (entry === "*") {
27913
+ return true;
27914
+ }
27648
27915
  let [entryHost, entryPort] = parseNoProxyEntry(entry);
27649
27916
  entryHost = normalizeNoProxyHost(entryHost);
27650
27917
  if (!entryHost) {
@@ -27736,7 +28003,7 @@ var require_axios = __commonJS({
27736
28003
  }
27737
28004
  const rawLoaded = e.loaded;
27738
28005
  const total = e.lengthComputable ? e.total : void 0;
27739
- const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
28006
+ const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded);
27740
28007
  const progressBytes = Math.max(0, loaded - bytesNotified);
27741
28008
  const rate = _speedometer(progressBytes);
27742
28009
  bytesNotified = Math.max(bytesNotified, loaded);
@@ -27762,10 +28029,64 @@ var require_axios = __commonJS({
27762
28029
  loaded
27763
28030
  }), throttled[1]];
27764
28031
  };
27765
- var asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
28032
+ var asyncDecorator = (fn, scheduler = utils$1.asap) => (...args) => scheduler(() => fn(...args));
27766
28033
  var isHexDigit = (charCode) => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102;
27767
28034
  var isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
27768
- function estimateDataURLDecodedBytes(url2) {
28035
+ var hexValue = (charCode) => charCode <= 57 ? charCode - 48 : (charCode & 223) - 55;
28036
+ var isBase64Char = (charCode) => charCode >= 65 && charCode <= 90 || // A-Z
28037
+ charCode >= 97 && charCode <= 122 || // a-z
28038
+ charCode >= 48 && charCode <= 57 || // 0-9
28039
+ charCode === 43 || // +
28040
+ charCode === 47 || // /
28041
+ charCode === 45 || // - (base64url)
28042
+ charCode === 95;
28043
+ var isBase64Whitespace = (charCode) => charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32;
28044
+ var base64Bytes = (significant) => {
28045
+ const groups = Math.floor(significant / 4);
28046
+ const remainder = significant % 4;
28047
+ return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0);
28048
+ };
28049
+ var estimateBase64BufferAllocation = (body) => {
28050
+ const len = body.length;
28051
+ let padding = 0;
28052
+ if (len > 0 && body.charCodeAt(len - 1) === 61) {
28053
+ padding++;
28054
+ if (len > 1 && body.charCodeAt(len - 2) === 61) {
28055
+ padding++;
28056
+ }
28057
+ }
28058
+ return Math.floor((len - padding) * 3 / 4);
28059
+ };
28060
+ var estimatePercentDecodedBase64Bytes = (body) => {
28061
+ const len = body.length;
28062
+ let significant = 0;
28063
+ let padding = 0;
28064
+ let invalid = false;
28065
+ for (let i = 0; i < len; i++) {
28066
+ let code = body.charCodeAt(i);
28067
+ if (code === 37 && isPercentEncodedByte(body, i, len)) {
28068
+ code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2));
28069
+ i += 2;
28070
+ }
28071
+ if (isBase64Whitespace(code)) {
28072
+ continue;
28073
+ }
28074
+ if (code === 61) {
28075
+ padding++;
28076
+ continue;
28077
+ }
28078
+ if (!isBase64Char(code) || padding > 0) {
28079
+ invalid = true;
28080
+ continue;
28081
+ }
28082
+ significant++;
28083
+ }
28084
+ if (invalid || padding > 2 || padding > 0 && (significant + padding) % 4 !== 0 || significant % 4 === 1) {
28085
+ return estimateBase64BufferAllocation(body);
28086
+ }
28087
+ return base64Bytes(significant);
28088
+ };
28089
+ var estimateDataURLBytes = (url2, estimateBase64) => {
27769
28090
  if (!url2 || typeof url2 !== "string") return 0;
27770
28091
  if (!url2.startsWith("data:")) return 0;
27771
28092
  const comma = url2.indexOf(",");
@@ -27774,43 +28095,7 @@ var require_axios = __commonJS({
27774
28095
  const body = url2.slice(comma + 1);
27775
28096
  const isBase64 = /;base64/i.test(meta);
27776
28097
  if (isBase64) {
27777
- let effectiveLen = body.length;
27778
- const len = body.length;
27779
- for (let i = 0; i < len; i++) {
27780
- if (body.charCodeAt(i) === 37 && i + 2 < len) {
27781
- const a = body.charCodeAt(i + 1);
27782
- const b = body.charCodeAt(i + 2);
27783
- const isHex = isHexDigit(a) && isHexDigit(b);
27784
- if (isHex) {
27785
- effectiveLen -= 2;
27786
- i += 2;
27787
- }
27788
- }
27789
- }
27790
- let pad3 = 0;
27791
- let idx = len - 1;
27792
- const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%'
27793
- body.charCodeAt(j - 1) === 51 && // '3'
27794
- (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
27795
- if (idx >= 0) {
27796
- if (body.charCodeAt(idx) === 61) {
27797
- pad3++;
27798
- idx--;
27799
- } else if (tailIsPct3D(idx)) {
27800
- pad3++;
27801
- idx -= 3;
27802
- }
27803
- }
27804
- if (pad3 === 1 && idx >= 0) {
27805
- if (body.charCodeAt(idx) === 61) {
27806
- pad3++;
27807
- } else if (tailIsPct3D(idx)) {
27808
- pad3++;
27809
- }
27810
- }
27811
- const groups = Math.floor(effectiveLen / 4);
27812
- const bytes2 = groups * 3 - (pad3 || 0);
27813
- return bytes2 > 0 ? bytes2 : 0;
28098
+ return estimateBase64(body);
27814
28099
  }
27815
28100
  let bytes = 0;
27816
28101
  for (let i = 0, len = body.length; i < len; i++) {
@@ -27835,6 +28120,13 @@ var require_axios = __commonJS({
27835
28120
  }
27836
28121
  }
27837
28122
  return bytes;
28123
+ };
28124
+ function estimateDataURLDecodedBytes(url2) {
28125
+ const fragmentIndex = typeof url2 === "string" ? url2.indexOf("#") : -1;
28126
+ return estimateDataURLBytes(fragmentIndex === -1 ? url2 : url2.slice(0, fragmentIndex), estimatePercentDecodedBase64Bytes);
28127
+ }
28128
+ function estimateDataURLBufferAllocation(url2) {
28129
+ return estimateDataURLBytes(url2, estimateBase64BufferAllocation);
27838
28130
  }
27839
28131
  var zlibOptions = {
27840
28132
  flush: zlib.constants.Z_SYNC_FLUSH,
@@ -27852,23 +28144,12 @@ var require_axios = __commonJS({
27852
28144
  var isZstdSupported = utils$1.isFunction(zlib.createZstdDecompress);
27853
28145
  var ACCEPT_ENCODING = "gzip, compress, deflate" + (isBrotliSupported ? ", br" : "");
27854
28146
  var ACCEPT_ENCODING_WITH_ZSTD = ACCEPT_ENCODING + (isZstdSupported ? ", zstd" : "");
28147
+ var scheduleProgress = typeof process !== "undefined" && process.nextTick ? process.nextTick.bind(process) : utils$1.asap;
27855
28148
  var {
27856
28149
  http: httpFollow,
27857
28150
  https: httpsFollow
27858
28151
  } = followRedirects;
27859
28152
  var isHttps = /https:?/;
27860
- var FORM_DATA_CONTENT_HEADERS$1 = ["content-type", "content-length"];
27861
- function setFormDataHeaders$1(headers, formHeaders, policy) {
27862
- if (policy !== "content-only") {
27863
- headers.set(formHeaders);
27864
- return;
27865
- }
27866
- Object.entries(formHeaders).forEach(([key, val]) => {
27867
- if (FORM_DATA_CONTENT_HEADERS$1.includes(key.toLowerCase())) {
27868
- headers.set(key, val);
27869
- }
27870
- });
27871
- }
27872
28153
  var kAxiosSocketListener = /* @__PURE__ */ Symbol("axios.http.socketListener");
27873
28154
  var kAxiosCurrentReq = /* @__PURE__ */ Symbol("axios.http.currentReq");
27874
28155
  var kAxiosInstalledTunnel = /* @__PURE__ */ Symbol("axios.http.installedTunnel");
@@ -28259,7 +28540,7 @@ var require_axios = __commonJS({
28259
28540
  if (protocol === "data:") {
28260
28541
  if (maxContentLength > -1) {
28261
28542
  const dataUrl = String(own2("url") || fullPath || "");
28262
- const estimated = estimateDataURLDecodedBytes(dataUrl);
28543
+ const estimated = estimateDataURLBufferAllocation(dataUrl);
28263
28544
  if (estimated > maxContentLength) {
28264
28545
  return reject(new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config));
28265
28546
  }
@@ -28317,7 +28598,7 @@ var require_axios = __commonJS({
28317
28598
  boundary: userBoundary && userBoundary[1] || void 0
28318
28599
  });
28319
28600
  } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders) && data.getHeaders !== Object.prototype.getHeaders) {
28320
- setFormDataHeaders$1(headers, data.getHeaders(), own2("formDataHeaderPolicy"));
28601
+ setFormDataHeaders(headers, data.getHeaders(), own2("formDataHeaderPolicy"));
28321
28602
  if (!headers.hasContentLength()) {
28322
28603
  try {
28323
28604
  const knownLength = await util.promisify(data.getLength).call(data);
@@ -28359,7 +28640,7 @@ var require_axios = __commonJS({
28359
28640
  data = stream.pipeline([data, new AxiosTransformStream({
28360
28641
  maxRate: utils$1.toFiniteNumber(maxUploadRate)
28361
28642
  })], utils$1.noop);
28362
- onUploadProgress && data.on("progress", flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress), false, 3))));
28643
+ onUploadProgress && data.on("progress", flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress, scheduleProgress), false, 3))));
28363
28644
  }
28364
28645
  let auth = void 0;
28365
28646
  const configAuth = own2("auth");
@@ -28496,7 +28777,7 @@ var require_axios = __commonJS({
28496
28777
  const transformStream = new AxiosTransformStream({
28497
28778
  maxRate: utils$1.toFiniteNumber(maxDownloadRate)
28498
28779
  });
28499
- onDownloadProgress && transformStream.on("progress", flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress), true, 3))));
28780
+ onDownloadProgress && transformStream.on("progress", flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress, scheduleProgress), true, 3))));
28500
28781
  streams.push(transformStream);
28501
28782
  }
28502
28783
  let responseStream = res;
@@ -28762,6 +29043,12 @@ var require_axios = __commonJS({
28762
29043
  var headersToObject = (thing) => thing instanceof AxiosHeaders ? {
28763
29044
  ...thing
28764
29045
  } : thing;
29046
+ var ownEnumerableKeys = (thing) => {
29047
+ if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {
29048
+ return Object.keys(thing).concat(Object.getOwnPropertySymbols(thing).filter((symbol) => Object.getOwnPropertyDescriptor(thing, symbol).enumerable));
29049
+ }
29050
+ return Object.keys(thing);
29051
+ };
28765
29052
  function mergeConfig(config1, config2) {
28766
29053
  config1 = config1 || {};
28767
29054
  config2 = config2 || {};
@@ -28862,7 +29149,7 @@ var require_axios = __commonJS({
28862
29149
  validateStatus: mergeDirectKeys,
28863
29150
  headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
28864
29151
  };
28865
- utils$1.forEach(Object.keys({
29152
+ utils$1.forEach(ownEnumerableKeys({
28866
29153
  ...config1,
28867
29154
  ...config2
28868
29155
  }), function computeConfigValue(prop) {
@@ -28882,18 +29169,6 @@ var require_axios = __commonJS({
28882
29169
  }
28883
29170
  return config;
28884
29171
  }
28885
- var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"];
28886
- function setFormDataHeaders(headers, formHeaders, policy) {
28887
- if (policy !== "content-only") {
28888
- headers.set(formHeaders);
28889
- return;
28890
- }
28891
- Object.entries(formHeaders || {}).forEach(([key, val]) => {
28892
- if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
28893
- headers.set(key, val);
28894
- }
28895
- });
28896
- }
28897
29172
  var encodeUTF8$1 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
28898
29173
  function resolveConfig(config) {
28899
29174
  const newConfig = mergeConfig({}, config);
@@ -29099,9 +29374,18 @@ var require_axios = __commonJS({
29099
29374
  });
29100
29375
  signals = null;
29101
29376
  };
29102
- signals.forEach((signal2) => signal2.addEventListener("abort", onabort, {
29103
- once: true
29104
- }));
29377
+ signals.forEach((signal2) => {
29378
+ if (aborted) {
29379
+ return;
29380
+ }
29381
+ if (signal2.aborted) {
29382
+ onabort.call(signal2);
29383
+ return;
29384
+ }
29385
+ signal2.addEventListener("abort", onabort, {
29386
+ once: true
29387
+ });
29388
+ });
29105
29389
  const {
29106
29390
  signal
29107
29391
  } = controller;
@@ -29847,16 +30131,29 @@ var require_axios = __commonJS({
29847
30131
  const onFulfilled = requestInterceptorChain[i++];
29848
30132
  const onRejected = requestInterceptorChain[i++];
29849
30133
  try {
29850
- newConfig = onFulfilled(newConfig);
30134
+ newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig;
29851
30135
  } catch (error) {
29852
- onRejected.call(this, error);
30136
+ if (!onRejected) {
30137
+ promise = Promise.reject(error);
30138
+ break;
30139
+ }
30140
+ try {
30141
+ const rejectedResult = onRejected.call(this, error);
30142
+ if (utils$1.isThenable(rejectedResult)) {
30143
+ promise = Promise.resolve(rejectedResult).then(() => dispatchRequest.call(this, newConfig));
30144
+ }
30145
+ } catch (rejectedError) {
30146
+ promise = Promise.reject(rejectedError);
30147
+ }
29853
30148
  break;
29854
30149
  }
29855
30150
  }
29856
- try {
29857
- promise = dispatchRequest.call(this, newConfig);
29858
- } catch (error) {
29859
- return Promise.reject(error);
30151
+ if (!promise) {
30152
+ try {
30153
+ promise = dispatchRequest.call(this, newConfig);
30154
+ } catch (error) {
30155
+ promise = Promise.reject(error);
30156
+ }
29860
30157
  }
29861
30158
  i = 0;
29862
30159
  len = responseInterceptorChain.length;
@@ -30065,6 +30362,7 @@ var require_axios = __commonJS({
30065
30362
  LoopDetected: 508,
30066
30363
  NotExtended: 510,
30067
30364
  NetworkAuthenticationRequired: 511,
30365
+ WebServerReturnsAnUnknownError: 520,
30068
30366
  WebServerIsDown: 521,
30069
30367
  ConnectionTimedOut: 522,
30070
30368
  OriginIsUnreachable: 523,
@@ -31535,7 +31833,7 @@ var VERSION;
31535
31833
  var init_version = __esm({
31536
31834
  "src/version.ts"() {
31537
31835
  "use strict";
31538
- VERSION = true ? "4.8.0" : "0.0.0-test";
31836
+ VERSION = true ? "4.9.1" : "0.0.0-test";
31539
31837
  }
31540
31838
  });
31541
31839
 
@@ -31950,7 +32248,7 @@ var init_base_language_model_strategy = __esm({
31950
32248
  * @internal
31951
32249
  */
31952
32250
  static COMMON_PARAM_MAPPINGS = [
31953
- { camelCaseKey: "maxTokens", optionKey: "maxOutputTokens", outputKey: "max_tokens" },
32251
+ { camelCaseKey: "maxTokens", optionKey: "maxOutputTokens", outputKey: "max_completion_tokens" },
31954
32252
  { camelCaseKey: "temperature", optionKey: "temperature", outputKey: "temperature" },
31955
32253
  { camelCaseKey: "topP", optionKey: "topP", outputKey: "top_p" },
31956
32254
  {
@@ -32454,7 +32752,7 @@ var init_orchestration_language_model_strategy = __esm({
32454
32752
  * @internal
32455
32753
  */
32456
32754
  resolveAdditionalState(_config, settings, sapOptions, options, warnings) {
32457
- const configRef = this.resolveConfigRef(sapOptions, settings);
32755
+ const configRef = this.resolveConfigRef(sapOptions, settings, warnings);
32458
32756
  const promptTemplateRef = this.resolvePromptTemplateRef(sapOptions, settings);
32459
32757
  if (configRef === void 0) {
32460
32758
  validateMaskingProvidersDeprecation(settings, warnings);
@@ -32680,17 +32978,26 @@ var init_orchestration_language_model_strategy = __esm({
32680
32978
  }
32681
32979
  /**
32682
32980
  * Resolves the orchestrationConfigRef from provider options or settings.
32683
- * Provider options take priority over settings.
32981
+ * Provider options take priority over settings. A present-but-invalid reference is
32982
+ * ignored with a warning instead of failing the request.
32684
32983
  * @param sapOptions - Parsed provider options from commonParts.
32685
32984
  * @param settings - The model settings.
32985
+ * @param warnings - Shared warnings sink for degradation signals.
32686
32986
  * @returns The resolved config reference or undefined.
32687
32987
  * @internal
32688
32988
  */
32689
- resolveConfigRef(sapOptions, settings) {
32989
+ resolveConfigRef(sapOptions, settings, warnings) {
32690
32990
  const configRefCandidate = sapOptions?.orchestrationConfigRef ?? settings.orchestrationConfigRef;
32691
- if (configRefCandidate && isOrchestrationConfigRef(configRefCandidate)) {
32991
+ if (!configRefCandidate) {
32992
+ return void 0;
32993
+ }
32994
+ if (isOrchestrationConfigRef(configRefCandidate)) {
32692
32995
  return configRefCandidate;
32693
32996
  }
32997
+ warnings.push({
32998
+ message: "orchestrationConfigRef is invalid and was ignored; falling back to local module settings.",
32999
+ type: "other"
33000
+ });
32694
33001
  return void 0;
32695
33002
  }
32696
33003
  /**
@@ -33427,6 +33734,6 @@ mime-types/index.js:
33427
33734
  *)
33428
33735
 
33429
33736
  axios/dist/node/axios.cjs:
33430
- (*! Axios v1.18.1 Copyright (c) 2026 Matt Zabriskie and contributors *)
33737
+ (*! Axios v1.19.0 Copyright (c) 2026 Matt Zabriskie and contributors *)
33431
33738
  */
33432
33739
  //# sourceMappingURL=index-v2.cjs.map