@probelabs/probe 0.6.0-rc325 → 0.6.0-rc330

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/cjs/index.cjs CHANGED
@@ -18380,6 +18380,70 @@ function convertUint8ArrayToBase64(array2) {
18380
18380
  function convertToBase64(value) {
18381
18381
  return value instanceof Uint8Array ? convertUint8ArrayToBase64(value) : value;
18382
18382
  }
18383
+ async function cancelResponseBody(response) {
18384
+ var _a22;
18385
+ try {
18386
+ await ((_a22 = response.body) == null ? void 0 : _a22.cancel());
18387
+ } catch (e) {
18388
+ }
18389
+ }
18390
+ function isNodeDefaultFetch(fetch2) {
18391
+ const source = Function.prototype.toString.call(fetch2);
18392
+ return source.includes("internal/deps/undici") || source.includes("lazy loading of undici");
18393
+ }
18394
+ async function readResponseWithSizeLimit({
18395
+ response,
18396
+ url: url2,
18397
+ maxBytes = DEFAULT_MAX_DOWNLOAD_SIZE
18398
+ }) {
18399
+ const contentLength = response.headers.get("content-length");
18400
+ if (contentLength != null) {
18401
+ const length = parseInt(contentLength, 10);
18402
+ if (!isNaN(length) && length > maxBytes) {
18403
+ await cancelResponseBody(response);
18404
+ throw new DownloadError({
18405
+ url: url2,
18406
+ message: `Download of ${url2} exceeded maximum size of ${maxBytes} bytes (Content-Length: ${length}).`
18407
+ });
18408
+ }
18409
+ }
18410
+ const body = response.body;
18411
+ if (body == null) {
18412
+ return new Uint8Array(0);
18413
+ }
18414
+ const reader = body.getReader();
18415
+ const chunks = [];
18416
+ let totalBytes = 0;
18417
+ try {
18418
+ while (true) {
18419
+ const { done, value } = await reader.read();
18420
+ if (done) {
18421
+ break;
18422
+ }
18423
+ totalBytes += value.length;
18424
+ if (totalBytes > maxBytes) {
18425
+ throw new DownloadError({
18426
+ url: url2,
18427
+ message: `Download of ${url2} exceeded maximum size of ${maxBytes} bytes.`
18428
+ });
18429
+ }
18430
+ chunks.push(value);
18431
+ }
18432
+ } finally {
18433
+ try {
18434
+ await reader.cancel();
18435
+ } finally {
18436
+ reader.releaseLock();
18437
+ }
18438
+ }
18439
+ const result = new Uint8Array(totalBytes);
18440
+ let offset2 = 0;
18441
+ for (const chunk of chunks) {
18442
+ result.set(chunk, offset2);
18443
+ offset2 += chunk.length;
18444
+ }
18445
+ return result;
18446
+ }
18383
18447
  function isAbortError(error40) {
18384
18448
  return (error40 instanceof Error || error40 instanceof DOMException) && (error40.name === "AbortError" || error40.name === "ResponseAborted" || // Next.js
18385
18449
  error40.name === "TimeoutError");
@@ -18472,6 +18536,40 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
18472
18536
  );
18473
18537
  return Object.fromEntries(normalizedHeaders.entries());
18474
18538
  }
18539
+ function injectJsonInstruction({
18540
+ prompt,
18541
+ schema,
18542
+ schemaPrefix = schema != null ? DEFAULT_SCHEMA_PREFIX : void 0,
18543
+ schemaSuffix = schema != null ? DEFAULT_SCHEMA_SUFFIX : DEFAULT_GENERIC_SUFFIX
18544
+ }) {
18545
+ return [
18546
+ prompt != null && prompt.length > 0 ? prompt : void 0,
18547
+ prompt != null && prompt.length > 0 ? "" : void 0,
18548
+ // add a newline if prompt is not null
18549
+ schemaPrefix,
18550
+ schema != null ? JSON.stringify(schema) : void 0,
18551
+ schemaSuffix
18552
+ ].filter((line) => line != null).join("\n");
18553
+ }
18554
+ function injectJsonInstructionIntoMessages({
18555
+ messages,
18556
+ schema,
18557
+ schemaPrefix,
18558
+ schemaSuffix
18559
+ }) {
18560
+ var _a22, _b22;
18561
+ const systemMessage = ((_a22 = messages[0]) == null ? void 0 : _a22.role) === "system" ? { ...messages[0] } : { role: "system", content: "" };
18562
+ systemMessage.content = injectJsonInstruction({
18563
+ prompt: systemMessage.content,
18564
+ schema,
18565
+ schemaPrefix,
18566
+ schemaSuffix
18567
+ });
18568
+ return [
18569
+ systemMessage,
18570
+ ...((_b22 = messages[0]) == null ? void 0 : _b22.role) === "system" ? messages.slice(1) : messages
18571
+ ];
18572
+ }
18475
18573
  function loadOptionalSetting({
18476
18574
  settingValue,
18477
18575
  environmentVariableName
@@ -19391,15 +19489,26 @@ function isSchema(value) {
19391
19489
  return typeof value === "object" && value !== null && schemaSymbol in value && value[schemaSymbol] === true && "jsonSchema" in value && "validate" in value;
19392
19490
  }
19393
19491
  function asSchema(schema) {
19394
- return schema == null ? jsonSchema({ properties: {}, additionalProperties: false }) : isSchema(schema) ? schema : "~standard" in schema ? schema["~standard"].vendor === "zod" ? zodSchema(schema) : standardSchema(schema) : schema();
19492
+ return schema == null ? jsonSchema({
19493
+ type: "object",
19494
+ properties: {},
19495
+ additionalProperties: false
19496
+ }) : isSchema(schema) ? schema : "~standard" in schema ? schema["~standard"].vendor === "zod" ? zodSchema(schema) : standardSchema(schema) : schema();
19395
19497
  }
19396
19498
  function standardSchema(standardSchema2) {
19397
19499
  return jsonSchema(
19398
- () => addAdditionalPropertiesToJsonSchema(
19399
- standardSchema2["~standard"].jsonSchema.input({
19400
- target: "draft-07"
19401
- })
19402
- ),
19500
+ () => {
19501
+ if (!hasStandardJsonSchema(standardSchema2)) {
19502
+ throw new Error(
19503
+ `Standard schema vendor '${standardSchema2["~standard"].vendor}' does not support JSON Schema conversion.`
19504
+ );
19505
+ }
19506
+ return addAdditionalPropertiesToJsonSchema(
19507
+ standardSchema2["~standard"].jsonSchema.input({
19508
+ target: "draft-07"
19509
+ })
19510
+ );
19511
+ },
19403
19512
  {
19404
19513
  validate: async (value) => {
19405
19514
  const result = await standardSchema2["~standard"].validate(value);
@@ -19414,6 +19523,9 @@ function standardSchema(standardSchema2) {
19414
19523
  }
19415
19524
  );
19416
19525
  }
19526
+ function hasStandardJsonSchema(schema) {
19527
+ return schema["~standard"].jsonSchema != null;
19528
+ }
19417
19529
  function zod3Schema(zodSchema2, options) {
19418
19530
  var _a22;
19419
19531
  const useReferences = (_a22 = options == null ? void 0 : options.useReferences) != null ? _a22 : false;
@@ -19560,6 +19672,17 @@ async function resolve(value) {
19560
19672
  }
19561
19673
  return Promise.resolve(value);
19562
19674
  }
19675
+ async function readResponseBodyAsText({
19676
+ response,
19677
+ url: url2
19678
+ }) {
19679
+ return textDecoder.decode(
19680
+ await readResponseWithSizeLimit({
19681
+ response,
19682
+ url: url2
19683
+ })
19684
+ );
19685
+ }
19563
19686
  function stripFileExtension(filename) {
19564
19687
  const firstDotIndex = filename.indexOf(".");
19565
19688
  return firstDotIndex === -1 ? filename : filename.slice(0, firstDotIndex);
@@ -19567,7 +19690,7 @@ function stripFileExtension(filename) {
19567
19690
  function withoutTrailingSlash(url2) {
19568
19691
  return url2 == null ? void 0 : url2.replace(/\/$/, "");
19569
19692
  }
19570
- var btoa2, atob2, name14, marker15, symbol16, _a15, _b15, DownloadError, DEFAULT_MAX_DOWNLOAD_SIZE, createIdGenerator, generateId, FETCH_FAILED_ERROR_MESSAGES, BUN_ERROR_CODES, VERSION, suspectProtoRx, suspectConstructorRx, ignoreOverride, defaultOptions, getDefaultOptions, parseCatchDef, integerDateParser, isJsonSchema7AllOfType, emojiRegex2, zodPatterns, ALPHA_NUMERIC, primitiveMappings, asAnyOf, parseOptionalDef, parsePipelineDef, parseReadonlyDef, selectParser, getRelativePath, get$ref, addMeta, getRefs, zod3ToJsonSchema, schemaSymbol, getOriginalFetch2, postJsonToApi, postToApi, createJsonErrorResponseHandler, createJsonResponseHandler;
19693
+ var btoa2, atob2, name14, marker15, symbol16, _a15, _b15, DownloadError, initialGlobalFetch, initialGlobalFetchIsNodeDefault, DEFAULT_MAX_DOWNLOAD_SIZE, createIdGenerator, generateId, FETCH_FAILED_ERROR_MESSAGES, BUN_ERROR_CODES, VERSION, DEFAULT_SCHEMA_PREFIX, DEFAULT_SCHEMA_SUFFIX, DEFAULT_GENERIC_SUFFIX, suspectProtoRx, suspectConstructorRx, ignoreOverride, defaultOptions, getDefaultOptions, parseCatchDef, integerDateParser, isJsonSchema7AllOfType, emojiRegex2, zodPatterns, ALPHA_NUMERIC, primitiveMappings, asAnyOf, parseOptionalDef, parsePipelineDef, parseReadonlyDef, selectParser, getRelativePath, get$ref, addMeta, getRefs, zod3ToJsonSchema, schemaSymbol, getOriginalFetch2, postJsonToApi, postToApi, textDecoder, createJsonErrorResponseHandler, createJsonResponseHandler;
19571
19694
  var init_dist2 = __esm({
19572
19695
  "node_modules/@ai-sdk/provider-utils/dist/index.mjs"() {
19573
19696
  init_dist();
@@ -19606,6 +19729,8 @@ var init_dist2 = __esm({
19606
19729
  return AISDKError.hasMarker(error40, marker15);
19607
19730
  }
19608
19731
  };
19732
+ initialGlobalFetch = globalThis.fetch;
19733
+ initialGlobalFetchIsNodeDefault = isNodeDefaultFetch(initialGlobalFetch);
19609
19734
  DEFAULT_MAX_DOWNLOAD_SIZE = 2 * 1024 * 1024 * 1024;
19610
19735
  createIdGenerator = ({
19611
19736
  prefix,
@@ -19643,7 +19768,10 @@ var init_dist2 = __esm({
19643
19768
  "ETIMEDOUT",
19644
19769
  "EPIPE"
19645
19770
  ];
19646
- VERSION = true ? "4.0.28" : "0.0.0-test";
19771
+ VERSION = true ? "4.0.41" : "0.0.0-test";
19772
+ DEFAULT_SCHEMA_PREFIX = "JSON schema:";
19773
+ DEFAULT_SCHEMA_SUFFIX = "You MUST answer with a JSON object that matches the JSON schema above.";
19774
+ DEFAULT_GENERIC_SUFFIX = "You MUST answer with JSON.";
19647
19775
  suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
19648
19776
  suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
19649
19777
  ignoreOverride = /* @__PURE__ */ Symbol(
@@ -20076,12 +20204,13 @@ var init_dist2 = __esm({
20076
20204
  throw handleFetchError({ error: error40, url: url2, requestBodyValues: body.values });
20077
20205
  }
20078
20206
  };
20207
+ textDecoder = new TextDecoder();
20079
20208
  createJsonErrorResponseHandler = ({
20080
20209
  errorSchema,
20081
20210
  errorToMessage,
20082
20211
  isRetryable
20083
20212
  }) => async ({ response, url: url2, requestBodyValues }) => {
20084
- const responseBody = await response.text();
20213
+ const responseBody = await readResponseBodyAsText({ response, url: url2 });
20085
20214
  const responseHeaders = extractResponseHeaders(response);
20086
20215
  if (responseBody.trim() === "") {
20087
20216
  return {
@@ -20131,7 +20260,7 @@ var init_dist2 = __esm({
20131
20260
  }
20132
20261
  };
20133
20262
  createJsonResponseHandler = (responseSchema) => async ({ response, url: url2, requestBodyValues }) => {
20134
- const responseBody = await response.text();
20263
+ const responseBody = await readResponseBodyAsText({ response, url: url2 });
20135
20264
  const parsedResult = await safeParseJSON({
20136
20265
  text: responseBody,
20137
20266
  schema: responseSchema
@@ -20157,1111 +20286,6 @@ var init_dist2 = __esm({
20157
20286
  }
20158
20287
  });
20159
20288
 
20160
- // node_modules/tslib/tslib.es6.mjs
20161
- var tslib_es6_exports = {};
20162
- __export(tslib_es6_exports, {
20163
- __addDisposableResource: () => __addDisposableResource,
20164
- __assign: () => __assign,
20165
- __asyncDelegator: () => __asyncDelegator,
20166
- __asyncGenerator: () => __asyncGenerator,
20167
- __asyncValues: () => __asyncValues,
20168
- __await: () => __await,
20169
- __awaiter: () => __awaiter,
20170
- __classPrivateFieldGet: () => __classPrivateFieldGet,
20171
- __classPrivateFieldIn: () => __classPrivateFieldIn,
20172
- __classPrivateFieldSet: () => __classPrivateFieldSet,
20173
- __createBinding: () => __createBinding,
20174
- __decorate: () => __decorate,
20175
- __disposeResources: () => __disposeResources,
20176
- __esDecorate: () => __esDecorate,
20177
- __exportStar: () => __exportStar,
20178
- __extends: () => __extends,
20179
- __generator: () => __generator,
20180
- __importDefault: () => __importDefault,
20181
- __importStar: () => __importStar,
20182
- __makeTemplateObject: () => __makeTemplateObject,
20183
- __metadata: () => __metadata,
20184
- __param: () => __param,
20185
- __propKey: () => __propKey,
20186
- __read: () => __read,
20187
- __rest: () => __rest,
20188
- __rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension,
20189
- __runInitializers: () => __runInitializers,
20190
- __setFunctionName: () => __setFunctionName,
20191
- __spread: () => __spread,
20192
- __spreadArray: () => __spreadArray,
20193
- __spreadArrays: () => __spreadArrays,
20194
- __values: () => __values,
20195
- default: () => tslib_es6_default
20196
- });
20197
- function __extends(d, b) {
20198
- if (typeof b !== "function" && b !== null)
20199
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
20200
- extendStatics(d, b);
20201
- function __() {
20202
- this.constructor = d;
20203
- }
20204
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
20205
- }
20206
- function __rest(s, e) {
20207
- var t = {};
20208
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
20209
- t[p] = s[p];
20210
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
20211
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
20212
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20213
- t[p[i]] = s[p[i]];
20214
- }
20215
- return t;
20216
- }
20217
- function __decorate(decorators, target, key, desc) {
20218
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20219
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20220
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
20221
- return c > 3 && r && Object.defineProperty(target, key, r), r;
20222
- }
20223
- function __param(paramIndex, decorator) {
20224
- return function(target, key) {
20225
- decorator(target, key, paramIndex);
20226
- };
20227
- }
20228
- function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
20229
- function accept(f) {
20230
- if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
20231
- return f;
20232
- }
20233
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
20234
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
20235
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
20236
- var _, done = false;
20237
- for (var i = decorators.length - 1; i >= 0; i--) {
20238
- var context = {};
20239
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
20240
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
20241
- context.addInitializer = function(f) {
20242
- if (done) throw new TypeError("Cannot add initializers after decoration has completed");
20243
- extraInitializers.push(accept(f || null));
20244
- };
20245
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
20246
- if (kind === "accessor") {
20247
- if (result === void 0) continue;
20248
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
20249
- if (_ = accept(result.get)) descriptor.get = _;
20250
- if (_ = accept(result.set)) descriptor.set = _;
20251
- if (_ = accept(result.init)) initializers.unshift(_);
20252
- } else if (_ = accept(result)) {
20253
- if (kind === "field") initializers.unshift(_);
20254
- else descriptor[key] = _;
20255
- }
20256
- }
20257
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
20258
- done = true;
20259
- }
20260
- function __runInitializers(thisArg, initializers, value) {
20261
- var useValue = arguments.length > 2;
20262
- for (var i = 0; i < initializers.length; i++) {
20263
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
20264
- }
20265
- return useValue ? value : void 0;
20266
- }
20267
- function __propKey(x) {
20268
- return typeof x === "symbol" ? x : "".concat(x);
20269
- }
20270
- function __setFunctionName(f, name15, prefix) {
20271
- if (typeof name15 === "symbol") name15 = name15.description ? "[".concat(name15.description, "]") : "";
20272
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name15) : name15 });
20273
- }
20274
- function __metadata(metadataKey, metadataValue) {
20275
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
20276
- }
20277
- function __awaiter(thisArg, _arguments, P, generator) {
20278
- function adopt(value) {
20279
- return value instanceof P ? value : new P(function(resolve9) {
20280
- resolve9(value);
20281
- });
20282
- }
20283
- return new (P || (P = Promise))(function(resolve9, reject2) {
20284
- function fulfilled(value) {
20285
- try {
20286
- step(generator.next(value));
20287
- } catch (e) {
20288
- reject2(e);
20289
- }
20290
- }
20291
- function rejected(value) {
20292
- try {
20293
- step(generator["throw"](value));
20294
- } catch (e) {
20295
- reject2(e);
20296
- }
20297
- }
20298
- function step(result) {
20299
- result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected);
20300
- }
20301
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20302
- });
20303
- }
20304
- function __generator(thisArg, body) {
20305
- var _ = { label: 0, sent: function() {
20306
- if (t[0] & 1) throw t[1];
20307
- return t[1];
20308
- }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
20309
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
20310
- return this;
20311
- }), g;
20312
- function verb(n) {
20313
- return function(v) {
20314
- return step([n, v]);
20315
- };
20316
- }
20317
- function step(op) {
20318
- if (f) throw new TypeError("Generator is already executing.");
20319
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
20320
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
20321
- if (y = 0, t) op = [op[0] & 2, t.value];
20322
- switch (op[0]) {
20323
- case 0:
20324
- case 1:
20325
- t = op;
20326
- break;
20327
- case 4:
20328
- _.label++;
20329
- return { value: op[1], done: false };
20330
- case 5:
20331
- _.label++;
20332
- y = op[1];
20333
- op = [0];
20334
- continue;
20335
- case 7:
20336
- op = _.ops.pop();
20337
- _.trys.pop();
20338
- continue;
20339
- default:
20340
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
20341
- _ = 0;
20342
- continue;
20343
- }
20344
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
20345
- _.label = op[1];
20346
- break;
20347
- }
20348
- if (op[0] === 6 && _.label < t[1]) {
20349
- _.label = t[1];
20350
- t = op;
20351
- break;
20352
- }
20353
- if (t && _.label < t[2]) {
20354
- _.label = t[2];
20355
- _.ops.push(op);
20356
- break;
20357
- }
20358
- if (t[2]) _.ops.pop();
20359
- _.trys.pop();
20360
- continue;
20361
- }
20362
- op = body.call(thisArg, _);
20363
- } catch (e) {
20364
- op = [6, e];
20365
- y = 0;
20366
- } finally {
20367
- f = t = 0;
20368
- }
20369
- if (op[0] & 5) throw op[1];
20370
- return { value: op[0] ? op[1] : void 0, done: true };
20371
- }
20372
- }
20373
- function __exportStar(m, o) {
20374
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
20375
- }
20376
- function __values(o) {
20377
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
20378
- if (m) return m.call(o);
20379
- if (o && typeof o.length === "number") return {
20380
- next: function() {
20381
- if (o && i >= o.length) o = void 0;
20382
- return { value: o && o[i++], done: !o };
20383
- }
20384
- };
20385
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
20386
- }
20387
- function __read(o, n) {
20388
- var m = typeof Symbol === "function" && o[Symbol.iterator];
20389
- if (!m) return o;
20390
- var i = m.call(o), r, ar = [], e;
20391
- try {
20392
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
20393
- } catch (error40) {
20394
- e = { error: error40 };
20395
- } finally {
20396
- try {
20397
- if (r && !r.done && (m = i["return"])) m.call(i);
20398
- } finally {
20399
- if (e) throw e.error;
20400
- }
20401
- }
20402
- return ar;
20403
- }
20404
- function __spread() {
20405
- for (var ar = [], i = 0; i < arguments.length; i++)
20406
- ar = ar.concat(__read(arguments[i]));
20407
- return ar;
20408
- }
20409
- function __spreadArrays() {
20410
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
20411
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
20412
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
20413
- r[k] = a[j];
20414
- return r;
20415
- }
20416
- function __spreadArray(to, from, pack) {
20417
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
20418
- if (ar || !(i in from)) {
20419
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
20420
- ar[i] = from[i];
20421
- }
20422
- }
20423
- return to.concat(ar || Array.prototype.slice.call(from));
20424
- }
20425
- function __await(v) {
20426
- return this instanceof __await ? (this.v = v, this) : new __await(v);
20427
- }
20428
- function __asyncGenerator(thisArg, _arguments, generator) {
20429
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
20430
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
20431
- return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
20432
- return this;
20433
- }, i;
20434
- function awaitReturn(f) {
20435
- return function(v) {
20436
- return Promise.resolve(v).then(f, reject2);
20437
- };
20438
- }
20439
- function verb(n, f) {
20440
- if (g[n]) {
20441
- i[n] = function(v) {
20442
- return new Promise(function(a, b) {
20443
- q.push([n, v, a, b]) > 1 || resume(n, v);
20444
- });
20445
- };
20446
- if (f) i[n] = f(i[n]);
20447
- }
20448
- }
20449
- function resume(n, v) {
20450
- try {
20451
- step(g[n](v));
20452
- } catch (e) {
20453
- settle(q[0][3], e);
20454
- }
20455
- }
20456
- function step(r) {
20457
- r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject2) : settle(q[0][2], r);
20458
- }
20459
- function fulfill(value) {
20460
- resume("next", value);
20461
- }
20462
- function reject2(value) {
20463
- resume("throw", value);
20464
- }
20465
- function settle(f, v) {
20466
- if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
20467
- }
20468
- }
20469
- function __asyncDelegator(o) {
20470
- var i, p;
20471
- return i = {}, verb("next"), verb("throw", function(e) {
20472
- throw e;
20473
- }), verb("return"), i[Symbol.iterator] = function() {
20474
- return this;
20475
- }, i;
20476
- function verb(n, f) {
20477
- i[n] = o[n] ? function(v) {
20478
- return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v;
20479
- } : f;
20480
- }
20481
- }
20482
- function __asyncValues(o) {
20483
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
20484
- var m = o[Symbol.asyncIterator], i;
20485
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
20486
- return this;
20487
- }, i);
20488
- function verb(n) {
20489
- i[n] = o[n] && function(v) {
20490
- return new Promise(function(resolve9, reject2) {
20491
- v = o[n](v), settle(resolve9, reject2, v.done, v.value);
20492
- });
20493
- };
20494
- }
20495
- function settle(resolve9, reject2, d, v) {
20496
- Promise.resolve(v).then(function(v2) {
20497
- resolve9({ value: v2, done: d });
20498
- }, reject2);
20499
- }
20500
- }
20501
- function __makeTemplateObject(cooked, raw) {
20502
- if (Object.defineProperty) {
20503
- Object.defineProperty(cooked, "raw", { value: raw });
20504
- } else {
20505
- cooked.raw = raw;
20506
- }
20507
- return cooked;
20508
- }
20509
- function __importStar(mod) {
20510
- if (mod && mod.__esModule) return mod;
20511
- var result = {};
20512
- if (mod != null) {
20513
- for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
20514
- }
20515
- __setModuleDefault(result, mod);
20516
- return result;
20517
- }
20518
- function __importDefault(mod) {
20519
- return mod && mod.__esModule ? mod : { default: mod };
20520
- }
20521
- function __classPrivateFieldGet(receiver, state, kind, f) {
20522
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
20523
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
20524
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
20525
- }
20526
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
20527
- if (kind === "m") throw new TypeError("Private method is not writable");
20528
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
20529
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
20530
- return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
20531
- }
20532
- function __classPrivateFieldIn(state, receiver) {
20533
- if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object");
20534
- return typeof state === "function" ? receiver === state : state.has(receiver);
20535
- }
20536
- function __addDisposableResource(env, value, async) {
20537
- if (value !== null && value !== void 0) {
20538
- if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
20539
- var dispose, inner;
20540
- if (async) {
20541
- if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
20542
- dispose = value[Symbol.asyncDispose];
20543
- }
20544
- if (dispose === void 0) {
20545
- if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
20546
- dispose = value[Symbol.dispose];
20547
- if (async) inner = dispose;
20548
- }
20549
- if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
20550
- if (inner) dispose = function() {
20551
- try {
20552
- inner.call(this);
20553
- } catch (e) {
20554
- return Promise.reject(e);
20555
- }
20556
- };
20557
- env.stack.push({ value, dispose, async });
20558
- } else if (async) {
20559
- env.stack.push({ async: true });
20560
- }
20561
- return value;
20562
- }
20563
- function __disposeResources(env) {
20564
- function fail(e) {
20565
- env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
20566
- env.hasError = true;
20567
- }
20568
- var r, s = 0;
20569
- function next() {
20570
- while (r = env.stack.pop()) {
20571
- try {
20572
- if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
20573
- if (r.dispose) {
20574
- var result = r.dispose.call(r.value);
20575
- if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
20576
- fail(e);
20577
- return next();
20578
- });
20579
- } else s |= 1;
20580
- } catch (e) {
20581
- fail(e);
20582
- }
20583
- }
20584
- if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
20585
- if (env.hasError) throw env.error;
20586
- }
20587
- return next();
20588
- }
20589
- function __rewriteRelativeImportExtension(path9, preserveJsx) {
20590
- if (typeof path9 === "string" && /^\.\.?\//.test(path9)) {
20591
- return path9.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext2, cm) {
20592
- return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext2 || !cm) ? m : d + ext2 + "." + cm.toLowerCase() + "js";
20593
- });
20594
- }
20595
- return path9;
20596
- }
20597
- var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
20598
- var init_tslib_es6 = __esm({
20599
- "node_modules/tslib/tslib.es6.mjs"() {
20600
- extendStatics = function(d, b) {
20601
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
20602
- d2.__proto__ = b2;
20603
- } || function(d2, b2) {
20604
- for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
20605
- };
20606
- return extendStatics(d, b);
20607
- };
20608
- __assign = function() {
20609
- __assign = Object.assign || function __assign2(t) {
20610
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20611
- s = arguments[i];
20612
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
20613
- }
20614
- return t;
20615
- };
20616
- return __assign.apply(this, arguments);
20617
- };
20618
- __createBinding = Object.create ? (function(o, m, k, k2) {
20619
- if (k2 === void 0) k2 = k;
20620
- var desc = Object.getOwnPropertyDescriptor(m, k);
20621
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
20622
- desc = { enumerable: true, get: function() {
20623
- return m[k];
20624
- } };
20625
- }
20626
- Object.defineProperty(o, k2, desc);
20627
- }) : (function(o, m, k, k2) {
20628
- if (k2 === void 0) k2 = k;
20629
- o[k2] = m[k];
20630
- });
20631
- __setModuleDefault = Object.create ? (function(o, v) {
20632
- Object.defineProperty(o, "default", { enumerable: true, value: v });
20633
- }) : function(o, v) {
20634
- o["default"] = v;
20635
- };
20636
- ownKeys = function(o) {
20637
- ownKeys = Object.getOwnPropertyNames || function(o2) {
20638
- var ar = [];
20639
- for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
20640
- return ar;
20641
- };
20642
- return ownKeys(o);
20643
- };
20644
- _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error40, suppressed, message) {
20645
- var e = new Error(message);
20646
- return e.name = "SuppressedError", e.error = error40, e.suppressed = suppressed, e;
20647
- };
20648
- tslib_es6_default = {
20649
- __extends,
20650
- __assign,
20651
- __rest,
20652
- __decorate,
20653
- __param,
20654
- __esDecorate,
20655
- __runInitializers,
20656
- __propKey,
20657
- __setFunctionName,
20658
- __metadata,
20659
- __awaiter,
20660
- __generator,
20661
- __createBinding,
20662
- __exportStar,
20663
- __values,
20664
- __read,
20665
- __spread,
20666
- __spreadArrays,
20667
- __spreadArray,
20668
- __await,
20669
- __asyncGenerator,
20670
- __asyncDelegator,
20671
- __asyncValues,
20672
- __makeTemplateObject,
20673
- __importStar,
20674
- __importDefault,
20675
- __classPrivateFieldGet,
20676
- __classPrivateFieldSet,
20677
- __classPrivateFieldIn,
20678
- __addDisposableResource,
20679
- __disposeResources,
20680
- __rewriteRelativeImportExtension
20681
- };
20682
- }
20683
- });
20684
-
20685
- // node_modules/@smithy/is-array-buffer/dist-cjs/index.js
20686
- var require_dist_cjs = __commonJS({
20687
- "node_modules/@smithy/is-array-buffer/dist-cjs/index.js"(exports2, module2) {
20688
- var __defProp2 = Object.defineProperty;
20689
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
20690
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
20691
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
20692
- var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
20693
- var __export2 = (target, all) => {
20694
- for (var name15 in all)
20695
- __defProp2(target, name15, { get: all[name15], enumerable: true });
20696
- };
20697
- var __copyProps2 = (to, from, except, desc) => {
20698
- if (from && typeof from === "object" || typeof from === "function") {
20699
- for (let key of __getOwnPropNames2(from))
20700
- if (!__hasOwnProp2.call(to, key) && key !== except)
20701
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
20702
- }
20703
- return to;
20704
- };
20705
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
20706
- var src_exports = {};
20707
- __export2(src_exports, {
20708
- isArrayBuffer: () => isArrayBuffer2
20709
- });
20710
- module2.exports = __toCommonJS2(src_exports);
20711
- var isArrayBuffer2 = /* @__PURE__ */ __name((arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]", "isArrayBuffer");
20712
- }
20713
- });
20714
-
20715
- // node_modules/@smithy/util-buffer-from/dist-cjs/index.js
20716
- var require_dist_cjs2 = __commonJS({
20717
- "node_modules/@smithy/util-buffer-from/dist-cjs/index.js"(exports2, module2) {
20718
- var __defProp2 = Object.defineProperty;
20719
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
20720
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
20721
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
20722
- var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
20723
- var __export2 = (target, all) => {
20724
- for (var name15 in all)
20725
- __defProp2(target, name15, { get: all[name15], enumerable: true });
20726
- };
20727
- var __copyProps2 = (to, from, except, desc) => {
20728
- if (from && typeof from === "object" || typeof from === "function") {
20729
- for (let key of __getOwnPropNames2(from))
20730
- if (!__hasOwnProp2.call(to, key) && key !== except)
20731
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
20732
- }
20733
- return to;
20734
- };
20735
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
20736
- var src_exports = {};
20737
- __export2(src_exports, {
20738
- fromArrayBuffer: () => fromArrayBuffer2,
20739
- fromString: () => fromString2
20740
- });
20741
- module2.exports = __toCommonJS2(src_exports);
20742
- var import_is_array_buffer3 = require_dist_cjs();
20743
- var import_buffer = require("buffer");
20744
- var fromArrayBuffer2 = /* @__PURE__ */ __name((input, offset2 = 0, length = input.byteLength - offset2) => {
20745
- if (!(0, import_is_array_buffer3.isArrayBuffer)(input)) {
20746
- throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`);
20747
- }
20748
- return import_buffer.Buffer.from(input, offset2, length);
20749
- }, "fromArrayBuffer");
20750
- var fromString2 = /* @__PURE__ */ __name((input, encoding) => {
20751
- if (typeof input !== "string") {
20752
- throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`);
20753
- }
20754
- return encoding ? import_buffer.Buffer.from(input, encoding) : import_buffer.Buffer.from(input);
20755
- }, "fromString");
20756
- }
20757
- });
20758
-
20759
- // node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-cjs/index.js
20760
- var require_dist_cjs3 = __commonJS({
20761
- "node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8/dist-cjs/index.js"(exports2, module2) {
20762
- var __defProp2 = Object.defineProperty;
20763
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
20764
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
20765
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
20766
- var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
20767
- var __export2 = (target, all) => {
20768
- for (var name15 in all)
20769
- __defProp2(target, name15, { get: all[name15], enumerable: true });
20770
- };
20771
- var __copyProps2 = (to, from, except, desc) => {
20772
- if (from && typeof from === "object" || typeof from === "function") {
20773
- for (let key of __getOwnPropNames2(from))
20774
- if (!__hasOwnProp2.call(to, key) && key !== except)
20775
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
20776
- }
20777
- return to;
20778
- };
20779
- var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
20780
- var src_exports = {};
20781
- __export2(src_exports, {
20782
- fromUtf8: () => fromUtf84,
20783
- toUint8Array: () => toUint8Array2,
20784
- toUtf8: () => toUtf84
20785
- });
20786
- module2.exports = __toCommonJS2(src_exports);
20787
- var import_util_buffer_from = require_dist_cjs2();
20788
- var fromUtf84 = /* @__PURE__ */ __name((input) => {
20789
- const buf = (0, import_util_buffer_from.fromString)(input, "utf8");
20790
- return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
20791
- }, "fromUtf8");
20792
- var toUint8Array2 = /* @__PURE__ */ __name((data2) => {
20793
- if (typeof data2 === "string") {
20794
- return fromUtf84(data2);
20795
- }
20796
- if (ArrayBuffer.isView(data2)) {
20797
- return new Uint8Array(data2.buffer, data2.byteOffset, data2.byteLength / Uint8Array.BYTES_PER_ELEMENT);
20798
- }
20799
- return new Uint8Array(data2);
20800
- }, "toUint8Array");
20801
- var toUtf84 = /* @__PURE__ */ __name((input) => {
20802
- if (typeof input === "string") {
20803
- return input;
20804
- }
20805
- if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
20806
- throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
20807
- }
20808
- return (0, import_util_buffer_from.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("utf8");
20809
- }, "toUtf8");
20810
- }
20811
- });
20812
-
20813
- // node_modules/@aws-crypto/util/build/main/convertToBuffer.js
20814
- var require_convertToBuffer = __commonJS({
20815
- "node_modules/@aws-crypto/util/build/main/convertToBuffer.js"(exports2) {
20816
- "use strict";
20817
- Object.defineProperty(exports2, "__esModule", { value: true });
20818
- exports2.convertToBuffer = void 0;
20819
- var util_utf8_1 = require_dist_cjs3();
20820
- var fromUtf84 = typeof Buffer !== "undefined" && Buffer.from ? function(input) {
20821
- return Buffer.from(input, "utf8");
20822
- } : util_utf8_1.fromUtf8;
20823
- function convertToBuffer(data2) {
20824
- if (data2 instanceof Uint8Array)
20825
- return data2;
20826
- if (typeof data2 === "string") {
20827
- return fromUtf84(data2);
20828
- }
20829
- if (ArrayBuffer.isView(data2)) {
20830
- return new Uint8Array(data2.buffer, data2.byteOffset, data2.byteLength / Uint8Array.BYTES_PER_ELEMENT);
20831
- }
20832
- return new Uint8Array(data2);
20833
- }
20834
- exports2.convertToBuffer = convertToBuffer;
20835
- }
20836
- });
20837
-
20838
- // node_modules/@aws-crypto/util/build/main/isEmptyData.js
20839
- var require_isEmptyData = __commonJS({
20840
- "node_modules/@aws-crypto/util/build/main/isEmptyData.js"(exports2) {
20841
- "use strict";
20842
- Object.defineProperty(exports2, "__esModule", { value: true });
20843
- exports2.isEmptyData = void 0;
20844
- function isEmptyData(data2) {
20845
- if (typeof data2 === "string") {
20846
- return data2.length === 0;
20847
- }
20848
- return data2.byteLength === 0;
20849
- }
20850
- exports2.isEmptyData = isEmptyData;
20851
- }
20852
- });
20853
-
20854
- // node_modules/@aws-crypto/util/build/main/numToUint8.js
20855
- var require_numToUint8 = __commonJS({
20856
- "node_modules/@aws-crypto/util/build/main/numToUint8.js"(exports2) {
20857
- "use strict";
20858
- Object.defineProperty(exports2, "__esModule", { value: true });
20859
- exports2.numToUint8 = void 0;
20860
- function numToUint8(num) {
20861
- return new Uint8Array([
20862
- (num & 4278190080) >> 24,
20863
- (num & 16711680) >> 16,
20864
- (num & 65280) >> 8,
20865
- num & 255
20866
- ]);
20867
- }
20868
- exports2.numToUint8 = numToUint8;
20869
- }
20870
- });
20871
-
20872
- // node_modules/@aws-crypto/util/build/main/uint32ArrayFrom.js
20873
- var require_uint32ArrayFrom = __commonJS({
20874
- "node_modules/@aws-crypto/util/build/main/uint32ArrayFrom.js"(exports2) {
20875
- "use strict";
20876
- Object.defineProperty(exports2, "__esModule", { value: true });
20877
- exports2.uint32ArrayFrom = void 0;
20878
- function uint32ArrayFrom(a_lookUpTable) {
20879
- if (!Uint32Array.from) {
20880
- var return_array = new Uint32Array(a_lookUpTable.length);
20881
- var a_index = 0;
20882
- while (a_index < a_lookUpTable.length) {
20883
- return_array[a_index] = a_lookUpTable[a_index];
20884
- a_index += 1;
20885
- }
20886
- return return_array;
20887
- }
20888
- return Uint32Array.from(a_lookUpTable);
20889
- }
20890
- exports2.uint32ArrayFrom = uint32ArrayFrom;
20891
- }
20892
- });
20893
-
20894
- // node_modules/@aws-crypto/util/build/main/index.js
20895
- var require_main2 = __commonJS({
20896
- "node_modules/@aws-crypto/util/build/main/index.js"(exports2) {
20897
- "use strict";
20898
- Object.defineProperty(exports2, "__esModule", { value: true });
20899
- exports2.uint32ArrayFrom = exports2.numToUint8 = exports2.isEmptyData = exports2.convertToBuffer = void 0;
20900
- var convertToBuffer_1 = require_convertToBuffer();
20901
- Object.defineProperty(exports2, "convertToBuffer", { enumerable: true, get: function() {
20902
- return convertToBuffer_1.convertToBuffer;
20903
- } });
20904
- var isEmptyData_1 = require_isEmptyData();
20905
- Object.defineProperty(exports2, "isEmptyData", { enumerable: true, get: function() {
20906
- return isEmptyData_1.isEmptyData;
20907
- } });
20908
- var numToUint8_1 = require_numToUint8();
20909
- Object.defineProperty(exports2, "numToUint8", { enumerable: true, get: function() {
20910
- return numToUint8_1.numToUint8;
20911
- } });
20912
- var uint32ArrayFrom_1 = require_uint32ArrayFrom();
20913
- Object.defineProperty(exports2, "uint32ArrayFrom", { enumerable: true, get: function() {
20914
- return uint32ArrayFrom_1.uint32ArrayFrom;
20915
- } });
20916
- }
20917
- });
20918
-
20919
- // node_modules/@aws-crypto/crc32/build/main/aws_crc32.js
20920
- var require_aws_crc32 = __commonJS({
20921
- "node_modules/@aws-crypto/crc32/build/main/aws_crc32.js"(exports2) {
20922
- "use strict";
20923
- Object.defineProperty(exports2, "__esModule", { value: true });
20924
- exports2.AwsCrc32 = void 0;
20925
- var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
20926
- var util_1 = require_main2();
20927
- var index_1 = require_main3();
20928
- var AwsCrc32 = (
20929
- /** @class */
20930
- (function() {
20931
- function AwsCrc322() {
20932
- this.crc32 = new index_1.Crc32();
20933
- }
20934
- AwsCrc322.prototype.update = function(toHash) {
20935
- if ((0, util_1.isEmptyData)(toHash))
20936
- return;
20937
- this.crc32.update((0, util_1.convertToBuffer)(toHash));
20938
- };
20939
- AwsCrc322.prototype.digest = function() {
20940
- return tslib_1.__awaiter(this, void 0, void 0, function() {
20941
- return tslib_1.__generator(this, function(_a17) {
20942
- return [2, (0, util_1.numToUint8)(this.crc32.digest())];
20943
- });
20944
- });
20945
- };
20946
- AwsCrc322.prototype.reset = function() {
20947
- this.crc32 = new index_1.Crc32();
20948
- };
20949
- return AwsCrc322;
20950
- })()
20951
- );
20952
- exports2.AwsCrc32 = AwsCrc32;
20953
- }
20954
- });
20955
-
20956
- // node_modules/@aws-crypto/crc32/build/main/index.js
20957
- var require_main3 = __commonJS({
20958
- "node_modules/@aws-crypto/crc32/build/main/index.js"(exports2) {
20959
- "use strict";
20960
- Object.defineProperty(exports2, "__esModule", { value: true });
20961
- exports2.AwsCrc32 = exports2.Crc32 = exports2.crc32 = void 0;
20962
- var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
20963
- var util_1 = require_main2();
20964
- function crc32(data2) {
20965
- return new Crc323().update(data2).digest();
20966
- }
20967
- exports2.crc32 = crc32;
20968
- var Crc323 = (
20969
- /** @class */
20970
- (function() {
20971
- function Crc324() {
20972
- this.checksum = 4294967295;
20973
- }
20974
- Crc324.prototype.update = function(data2) {
20975
- var e_1, _a17;
20976
- try {
20977
- for (var data_1 = tslib_1.__values(data2), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {
20978
- var byte = data_1_1.value;
20979
- this.checksum = this.checksum >>> 8 ^ lookupTable[(this.checksum ^ byte) & 255];
20980
- }
20981
- } catch (e_1_1) {
20982
- e_1 = { error: e_1_1 };
20983
- } finally {
20984
- try {
20985
- if (data_1_1 && !data_1_1.done && (_a17 = data_1.return)) _a17.call(data_1);
20986
- } finally {
20987
- if (e_1) throw e_1.error;
20988
- }
20989
- }
20990
- return this;
20991
- };
20992
- Crc324.prototype.digest = function() {
20993
- return (this.checksum ^ 4294967295) >>> 0;
20994
- };
20995
- return Crc324;
20996
- })()
20997
- );
20998
- exports2.Crc32 = Crc323;
20999
- var a_lookUpTable = [
21000
- 0,
21001
- 1996959894,
21002
- 3993919788,
21003
- 2567524794,
21004
- 124634137,
21005
- 1886057615,
21006
- 3915621685,
21007
- 2657392035,
21008
- 249268274,
21009
- 2044508324,
21010
- 3772115230,
21011
- 2547177864,
21012
- 162941995,
21013
- 2125561021,
21014
- 3887607047,
21015
- 2428444049,
21016
- 498536548,
21017
- 1789927666,
21018
- 4089016648,
21019
- 2227061214,
21020
- 450548861,
21021
- 1843258603,
21022
- 4107580753,
21023
- 2211677639,
21024
- 325883990,
21025
- 1684777152,
21026
- 4251122042,
21027
- 2321926636,
21028
- 335633487,
21029
- 1661365465,
21030
- 4195302755,
21031
- 2366115317,
21032
- 997073096,
21033
- 1281953886,
21034
- 3579855332,
21035
- 2724688242,
21036
- 1006888145,
21037
- 1258607687,
21038
- 3524101629,
21039
- 2768942443,
21040
- 901097722,
21041
- 1119000684,
21042
- 3686517206,
21043
- 2898065728,
21044
- 853044451,
21045
- 1172266101,
21046
- 3705015759,
21047
- 2882616665,
21048
- 651767980,
21049
- 1373503546,
21050
- 3369554304,
21051
- 3218104598,
21052
- 565507253,
21053
- 1454621731,
21054
- 3485111705,
21055
- 3099436303,
21056
- 671266974,
21057
- 1594198024,
21058
- 3322730930,
21059
- 2970347812,
21060
- 795835527,
21061
- 1483230225,
21062
- 3244367275,
21063
- 3060149565,
21064
- 1994146192,
21065
- 31158534,
21066
- 2563907772,
21067
- 4023717930,
21068
- 1907459465,
21069
- 112637215,
21070
- 2680153253,
21071
- 3904427059,
21072
- 2013776290,
21073
- 251722036,
21074
- 2517215374,
21075
- 3775830040,
21076
- 2137656763,
21077
- 141376813,
21078
- 2439277719,
21079
- 3865271297,
21080
- 1802195444,
21081
- 476864866,
21082
- 2238001368,
21083
- 4066508878,
21084
- 1812370925,
21085
- 453092731,
21086
- 2181625025,
21087
- 4111451223,
21088
- 1706088902,
21089
- 314042704,
21090
- 2344532202,
21091
- 4240017532,
21092
- 1658658271,
21093
- 366619977,
21094
- 2362670323,
21095
- 4224994405,
21096
- 1303535960,
21097
- 984961486,
21098
- 2747007092,
21099
- 3569037538,
21100
- 1256170817,
21101
- 1037604311,
21102
- 2765210733,
21103
- 3554079995,
21104
- 1131014506,
21105
- 879679996,
21106
- 2909243462,
21107
- 3663771856,
21108
- 1141124467,
21109
- 855842277,
21110
- 2852801631,
21111
- 3708648649,
21112
- 1342533948,
21113
- 654459306,
21114
- 3188396048,
21115
- 3373015174,
21116
- 1466479909,
21117
- 544179635,
21118
- 3110523913,
21119
- 3462522015,
21120
- 1591671054,
21121
- 702138776,
21122
- 2966460450,
21123
- 3352799412,
21124
- 1504918807,
21125
- 783551873,
21126
- 3082640443,
21127
- 3233442989,
21128
- 3988292384,
21129
- 2596254646,
21130
- 62317068,
21131
- 1957810842,
21132
- 3939845945,
21133
- 2647816111,
21134
- 81470997,
21135
- 1943803523,
21136
- 3814918930,
21137
- 2489596804,
21138
- 225274430,
21139
- 2053790376,
21140
- 3826175755,
21141
- 2466906013,
21142
- 167816743,
21143
- 2097651377,
21144
- 4027552580,
21145
- 2265490386,
21146
- 503444072,
21147
- 1762050814,
21148
- 4150417245,
21149
- 2154129355,
21150
- 426522225,
21151
- 1852507879,
21152
- 4275313526,
21153
- 2312317920,
21154
- 282753626,
21155
- 1742555852,
21156
- 4189708143,
21157
- 2394877945,
21158
- 397917763,
21159
- 1622183637,
21160
- 3604390888,
21161
- 2714866558,
21162
- 953729732,
21163
- 1340076626,
21164
- 3518719985,
21165
- 2797360999,
21166
- 1068828381,
21167
- 1219638859,
21168
- 3624741850,
21169
- 2936675148,
21170
- 906185462,
21171
- 1090812512,
21172
- 3747672003,
21173
- 2825379669,
21174
- 829329135,
21175
- 1181335161,
21176
- 3412177804,
21177
- 3160834842,
21178
- 628085408,
21179
- 1382605366,
21180
- 3423369109,
21181
- 3138078467,
21182
- 570562233,
21183
- 1426400815,
21184
- 3317316542,
21185
- 2998733608,
21186
- 733239954,
21187
- 1555261956,
21188
- 3268935591,
21189
- 3050360625,
21190
- 752459403,
21191
- 1541320221,
21192
- 2607071920,
21193
- 3965973030,
21194
- 1969922972,
21195
- 40735498,
21196
- 2617837225,
21197
- 3943577151,
21198
- 1913087877,
21199
- 83908371,
21200
- 2512341634,
21201
- 3803740692,
21202
- 2075208622,
21203
- 213261112,
21204
- 2463272603,
21205
- 3855990285,
21206
- 2094854071,
21207
- 198958881,
21208
- 2262029012,
21209
- 4057260610,
21210
- 1759359992,
21211
- 534414190,
21212
- 2176718541,
21213
- 4139329115,
21214
- 1873836001,
21215
- 414664567,
21216
- 2282248934,
21217
- 4279200368,
21218
- 1711684554,
21219
- 285281116,
21220
- 2405801727,
21221
- 4167216745,
21222
- 1634467795,
21223
- 376229701,
21224
- 2685067896,
21225
- 3608007406,
21226
- 1308918612,
21227
- 956543938,
21228
- 2808555105,
21229
- 3495958263,
21230
- 1231636301,
21231
- 1047427035,
21232
- 2932959818,
21233
- 3654703836,
21234
- 1088359270,
21235
- 936918e3,
21236
- 2847714899,
21237
- 3736837829,
21238
- 1202900863,
21239
- 817233897,
21240
- 3183342108,
21241
- 3401237130,
21242
- 1404277552,
21243
- 615818150,
21244
- 3134207493,
21245
- 3453421203,
21246
- 1423857449,
21247
- 601450431,
21248
- 3009837614,
21249
- 3294710456,
21250
- 1567103746,
21251
- 711928724,
21252
- 3020668471,
21253
- 3272380065,
21254
- 1510334235,
21255
- 755167117
21256
- ];
21257
- var lookupTable = (0, util_1.uint32ArrayFrom)(a_lookUpTable);
21258
- var aws_crc32_1 = require_aws_crc32();
21259
- Object.defineProperty(exports2, "AwsCrc32", { enumerable: true, get: function() {
21260
- return aws_crc32_1.AwsCrc32;
21261
- } });
21262
- }
21263
- });
21264
-
21265
20289
  // node_modules/@smithy/core/dist-es/submodules/serde/is-array-buffer/is-array-buffer.js
21266
20290
  var isArrayBuffer;
21267
20291
  var init_is_array_buffer = __esm({
@@ -21343,12 +20367,12 @@ var init_toBase64 = __esm({
21343
20367
  });
21344
20368
 
21345
20369
  // node_modules/@smithy/core/dist-es/submodules/serde/util-stream/blob/Uint8ArrayBlobAdapter.js
21346
- function bindUint8ArrayBlobAdapter(toUtf84, fromUtf84, toBase643, fromBase643) {
20370
+ function bindUint8ArrayBlobAdapter(toUtf84, fromUtf84, toBase643, fromBase642) {
21347
20371
  return class Uint8ArrayBlobAdapter2 extends Uint8Array {
21348
20372
  static fromString(source, encoding = "utf-8") {
21349
20373
  if (typeof source === "string") {
21350
20374
  if (encoding === "base64") {
21351
- return Uint8ArrayBlobAdapter2.mutate(fromBase643(source));
20375
+ return Uint8ArrayBlobAdapter2.mutate(fromBase642(source));
21352
20376
  }
21353
20377
  return Uint8ArrayBlobAdapter2.mutate(fromUtf84(source));
21354
20378
  }
@@ -21412,7 +20436,7 @@ var init_v42 = __esm({
21412
20436
  var copyDocumentWithTransform;
21413
20437
  var init_copyDocumentWithTransform = __esm({
21414
20438
  "node_modules/@smithy/core/dist-es/submodules/serde/copyDocumentWithTransform.js"() {
21415
- copyDocumentWithTransform = (source, schemaRef, transform2 = (_) => _) => source;
20439
+ copyDocumentWithTransform = (source, _schemaRef, _transform2 = (_) => _) => source;
21416
20440
  }
21417
20441
  });
21418
20442
 
@@ -21691,7 +20715,7 @@ var init_date_utils = __esm({
21691
20715
  const day = parseDateValue(dayStr, "day", 1, 31);
21692
20716
  return buildDate(year2, month, day, { hours, minutes, seconds, fractionalMilliseconds });
21693
20717
  };
21694
- RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/);
20718
+ RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}:\d{2})|[zZ])$/);
21695
20719
  parseRfc3339DateTimeWithOffset = (value) => {
21696
20720
  if (value === null || value === void 0) {
21697
20721
  return void 0;
@@ -22073,7 +21097,7 @@ function nv(input) {
22073
21097
  var format, NumericValue;
22074
21098
  var init_NumericValue = __esm({
22075
21099
  "node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js"() {
22076
- format = /^-?\d*(\.\d+)?$/;
21100
+ format = /^-?((0|[1-9]\d*)(\.\d+)?|\.\d+)([eE][+-]?\d+)?$/;
22077
21101
  NumericValue = class _NumericValue {
22078
21102
  string;
22079
21103
  type;
@@ -22081,7 +21105,7 @@ var init_NumericValue = __esm({
22081
21105
  this.string = string4;
22082
21106
  this.type = type;
22083
21107
  if (!format.test(string4)) {
22084
- throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`);
21108
+ throw new Error(`@smithy/core/serde - NumericValue string must conform to the Smithy bigDecimal format. Received: "${string4}"`);
22085
21109
  }
22086
21110
  }
22087
21111
  toString() {
@@ -22172,6 +21196,9 @@ var init_toUint8Array = __esm({
22172
21196
  "node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUint8Array.js"() {
22173
21197
  init_fromUtf8();
22174
21198
  toUint8Array = (data2) => {
21199
+ if (data2 instanceof Uint8Array) {
21200
+ return data2;
21201
+ }
22175
21202
  if (typeof data2 === "string") {
22176
21203
  return fromUtf8(data2);
22177
21204
  }
@@ -22183,44 +21210,64 @@ var init_toUint8Array = __esm({
22183
21210
  }
22184
21211
  });
22185
21212
 
21213
+ // node_modules/@smithy/core/dist-es/submodules/serde/concatBytes.js
21214
+ function concatBytes(arrays, length) {
21215
+ if (length === void 0) {
21216
+ length = 0;
21217
+ for (const bytes of arrays) {
21218
+ length += bytes.byteLength;
21219
+ }
21220
+ }
21221
+ const result = new Uint8Array(length);
21222
+ let offset2 = 0;
21223
+ for (const buf of arrays) {
21224
+ result.set(buf, offset2);
21225
+ offset2 += buf.byteLength;
21226
+ }
21227
+ return result;
21228
+ }
21229
+ var init_concatBytes = __esm({
21230
+ "node_modules/@smithy/core/dist-es/submodules/serde/concatBytes.js"() {
21231
+ }
21232
+ });
21233
+
22186
21234
  // node_modules/@smithy/types/dist-cjs/index.js
22187
- var require_dist_cjs4 = __commonJS({
21235
+ var require_dist_cjs = __commonJS({
22188
21236
  "node_modules/@smithy/types/dist-cjs/index.js"(exports2) {
22189
- "use strict";
22190
- exports2.HttpAuthLocation = void 0;
22191
- (function(HttpAuthLocation) {
22192
- HttpAuthLocation["HEADER"] = "header";
22193
- HttpAuthLocation["QUERY"] = "query";
22194
- })(exports2.HttpAuthLocation || (exports2.HttpAuthLocation = {}));
22195
- exports2.HttpApiKeyAuthLocation = void 0;
22196
- (function(HttpApiKeyAuthLocation) {
22197
- HttpApiKeyAuthLocation["HEADER"] = "header";
22198
- HttpApiKeyAuthLocation["QUERY"] = "query";
22199
- })(exports2.HttpApiKeyAuthLocation || (exports2.HttpApiKeyAuthLocation = {}));
22200
- exports2.EndpointURLScheme = void 0;
22201
- (function(EndpointURLScheme) {
22202
- EndpointURLScheme["HTTP"] = "http";
22203
- EndpointURLScheme["HTTPS"] = "https";
22204
- })(exports2.EndpointURLScheme || (exports2.EndpointURLScheme = {}));
22205
- exports2.AlgorithmId = void 0;
22206
- (function(AlgorithmId) {
22207
- AlgorithmId["MD5"] = "md5";
22208
- AlgorithmId["CRC32"] = "crc32";
22209
- AlgorithmId["CRC32C"] = "crc32c";
22210
- AlgorithmId["SHA1"] = "sha1";
22211
- AlgorithmId["SHA256"] = "sha256";
22212
- })(exports2.AlgorithmId || (exports2.AlgorithmId = {}));
21237
+ var HttpAuthLocation;
21238
+ (function(HttpAuthLocation2) {
21239
+ HttpAuthLocation2["HEADER"] = "header";
21240
+ HttpAuthLocation2["QUERY"] = "query";
21241
+ })(HttpAuthLocation || (HttpAuthLocation = {}));
21242
+ var HttpApiKeyAuthLocation;
21243
+ (function(HttpApiKeyAuthLocation2) {
21244
+ HttpApiKeyAuthLocation2["HEADER"] = "header";
21245
+ HttpApiKeyAuthLocation2["QUERY"] = "query";
21246
+ })(HttpApiKeyAuthLocation || (HttpApiKeyAuthLocation = {}));
21247
+ var EndpointURLScheme;
21248
+ (function(EndpointURLScheme2) {
21249
+ EndpointURLScheme2["HTTP"] = "http";
21250
+ EndpointURLScheme2["HTTPS"] = "https";
21251
+ })(EndpointURLScheme || (EndpointURLScheme = {}));
21252
+ var AlgorithmId;
21253
+ (function(AlgorithmId2) {
21254
+ AlgorithmId2["MD5"] = "md5";
21255
+ AlgorithmId2["CRC32"] = "crc32";
21256
+ AlgorithmId2["CRC32C"] = "crc32c";
21257
+ AlgorithmId2["SHA1"] = "sha1";
21258
+ AlgorithmId2["SHA256"] = "sha256";
21259
+ })(AlgorithmId || (AlgorithmId = {}));
22213
21260
  var getChecksumConfiguration = (runtimeConfig) => {
22214
21261
  const checksumAlgorithms = [];
22215
21262
  if (runtimeConfig.sha256 !== void 0) {
22216
21263
  checksumAlgorithms.push({
22217
- algorithmId: () => exports2.AlgorithmId.SHA256,
21264
+ algorithmId: () => AlgorithmId.SHA256,
22218
21265
  checksumConstructor: () => runtimeConfig.sha256
22219
21266
  });
22220
21267
  }
22221
21268
  if (runtimeConfig.md5 != void 0) {
22222
21269
  checksumAlgorithms.push({
22223
- algorithmId: () => exports2.AlgorithmId.MD5,
21270
+ algorithmId: () => AlgorithmId.MD5,
22224
21271
  checksumConstructor: () => runtimeConfig.md5
22225
21272
  });
22226
21273
  }
@@ -22246,24 +21293,31 @@ var require_dist_cjs4 = __commonJS({
22246
21293
  var resolveDefaultRuntimeConfig = (config2) => {
22247
21294
  return resolveChecksumRuntimeConfig(config2);
22248
21295
  };
22249
- exports2.FieldPosition = void 0;
22250
- (function(FieldPosition) {
22251
- FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER";
22252
- FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER";
22253
- })(exports2.FieldPosition || (exports2.FieldPosition = {}));
21296
+ var FieldPosition;
21297
+ (function(FieldPosition2) {
21298
+ FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER";
21299
+ FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER";
21300
+ })(FieldPosition || (FieldPosition = {}));
22254
21301
  var SMITHY_CONTEXT_KEY2 = "__smithy_context";
22255
- exports2.IniSectionType = void 0;
22256
- (function(IniSectionType3) {
22257
- IniSectionType3["PROFILE"] = "profile";
22258
- IniSectionType3["SSO_SESSION"] = "sso-session";
22259
- IniSectionType3["SERVICES"] = "services";
22260
- })(exports2.IniSectionType || (exports2.IniSectionType = {}));
22261
- exports2.RequestHandlerProtocol = void 0;
22262
- (function(RequestHandlerProtocol) {
22263
- RequestHandlerProtocol["HTTP_0_9"] = "http/0.9";
22264
- RequestHandlerProtocol["HTTP_1_0"] = "http/1.0";
22265
- RequestHandlerProtocol["TDS_8_0"] = "tds/8.0";
22266
- })(exports2.RequestHandlerProtocol || (exports2.RequestHandlerProtocol = {}));
21302
+ var IniSectionType3;
21303
+ (function(IniSectionType4) {
21304
+ IniSectionType4["PROFILE"] = "profile";
21305
+ IniSectionType4["SSO_SESSION"] = "sso-session";
21306
+ IniSectionType4["SERVICES"] = "services";
21307
+ })(IniSectionType3 || (IniSectionType3 = {}));
21308
+ var RequestHandlerProtocol;
21309
+ (function(RequestHandlerProtocol2) {
21310
+ RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9";
21311
+ RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0";
21312
+ RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0";
21313
+ })(RequestHandlerProtocol || (RequestHandlerProtocol = {}));
21314
+ exports2.AlgorithmId = AlgorithmId;
21315
+ exports2.EndpointURLScheme = EndpointURLScheme;
21316
+ exports2.FieldPosition = FieldPosition;
21317
+ exports2.HttpApiKeyAuthLocation = HttpApiKeyAuthLocation;
21318
+ exports2.HttpAuthLocation = HttpAuthLocation;
21319
+ exports2.IniSectionType = IniSectionType3;
21320
+ exports2.RequestHandlerProtocol = RequestHandlerProtocol;
22267
21321
  exports2.SMITHY_CONTEXT_KEY = SMITHY_CONTEXT_KEY2;
22268
21322
  exports2.getDefaultClientConfiguration = getDefaultClientConfiguration;
22269
21323
  exports2.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig;
@@ -22274,7 +21328,7 @@ var require_dist_cjs4 = __commonJS({
22274
21328
  var import_types, getSmithyContext;
22275
21329
  var init_getSmithyContext = __esm({
22276
21330
  "node_modules/@smithy/core/dist-es/submodules/transport/getSmithyContext.js"() {
22277
- import_types = __toESM(require_dist_cjs4());
21331
+ import_types = __toESM(require_dist_cjs());
22278
21332
  getSmithyContext = (context) => context[import_types.SMITHY_CONTEXT_KEY] || (context[import_types.SMITHY_CONTEXT_KEY] = {});
22279
21333
  }
22280
21334
  });
@@ -22427,7 +21481,7 @@ var init_deserializerMiddleware = __esm({
22427
21481
  const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;
22428
21482
  try {
22429
21483
  error40.message += "\n " + hint;
22430
- } catch (e) {
21484
+ } catch (ignored) {
22431
21485
  if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") {
22432
21486
  console.warn(hint);
22433
21487
  } else {
@@ -22450,7 +21504,7 @@ var init_deserializerMiddleware = __esm({
22450
21504
  cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries)
22451
21505
  };
22452
21506
  }
22453
- } catch (e) {
21507
+ } catch (ignored) {
22454
21508
  }
22455
21509
  }
22456
21510
  throw error40;
@@ -22594,6 +21648,33 @@ var init_memoize = __esm({
22594
21648
  }
22595
21649
  });
22596
21650
 
21651
+ // node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js
21652
+ var booleanSelector;
21653
+ var init_booleanSelector = __esm({
21654
+ "node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js"() {
21655
+ booleanSelector = (obj, key, type) => {
21656
+ if (!(key in obj))
21657
+ return void 0;
21658
+ if (obj[key] === "true")
21659
+ return true;
21660
+ if (obj[key] === "false")
21661
+ return false;
21662
+ throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`);
21663
+ };
21664
+ }
21665
+ });
21666
+
21667
+ // node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/types.js
21668
+ var SelectorType;
21669
+ var init_types2 = __esm({
21670
+ "node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/types.js"() {
21671
+ (function(SelectorType2) {
21672
+ SelectorType2["ENV"] = "env";
21673
+ SelectorType2["CONFIG"] = "shared config entry";
21674
+ })(SelectorType || (SelectorType = {}));
21675
+ }
21676
+ });
21677
+
22597
21678
  // node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getHomeDir.js
22598
21679
  var import_node_os, import_node_path, homeDirCache, getHomeDirCacheKey, getHomeDir;
22599
21680
  var init_getHomeDir = __esm({
@@ -22645,7 +21726,7 @@ var init_constants = __esm({
22645
21726
  var import_types2, getConfigData;
22646
21727
  var init_getConfigData = __esm({
22647
21728
  "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getConfigData.js"() {
22648
- import_types2 = __toESM(require_dist_cjs4());
21729
+ import_types2 = __toESM(require_dist_cjs());
22649
21730
  init_constants();
22650
21731
  getConfigData = (data2) => Object.entries(data2).filter(([key]) => {
22651
21732
  const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);
@@ -22690,9 +21771,9 @@ var init_getCredentialsFilepath = __esm({
22690
21771
  var import_types3, prefixKeyRegex, profileNameBlockList, parseIni;
22691
21772
  var init_parseIni = __esm({
22692
21773
  "node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/parseIni.js"() {
22693
- import_types3 = __toESM(require_dist_cjs4());
21774
+ import_types3 = __toESM(require_dist_cjs());
22694
21775
  init_constants();
22695
- prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/;
21776
+ prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@+.%:/]+)\2$/;
22696
21777
  profileNameBlockList = ["__proto__", "profile __proto__"];
22697
21778
  parseIni = (iniData) => {
22698
21779
  const map3 = {};
@@ -22809,7 +21890,7 @@ function getSelectorName(functionString) {
22809
21890
  constants.delete("CONFIG_PREFIX_SEPARATOR");
22810
21891
  constants.delete("ENV");
22811
21892
  return [...constants].join(", ");
22812
- } catch (e) {
21893
+ } catch (ignored) {
22813
21894
  return functionString;
22814
21895
  }
22815
21896
  }
@@ -22893,16 +21974,126 @@ var init_configLoader = __esm({
22893
21974
  }
22894
21975
  });
22895
21976
 
22896
- // node_modules/@smithy/core/dist-es/submodules/client/index.js
22897
- var init_client = __esm({
22898
- "node_modules/@smithy/core/dist-es/submodules/client/index.js"() {
22899
- init_transport();
21977
+ // node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js
21978
+ var TypeRegistry;
21979
+ var init_TypeRegistry = __esm({
21980
+ "node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js"() {
21981
+ TypeRegistry = class _TypeRegistry {
21982
+ namespace;
21983
+ schemas;
21984
+ exceptions;
21985
+ static registries = /* @__PURE__ */ new Map();
21986
+ constructor(namespace, schemas = /* @__PURE__ */ new Map(), exceptions = /* @__PURE__ */ new Map()) {
21987
+ this.namespace = namespace;
21988
+ this.schemas = schemas;
21989
+ this.exceptions = exceptions;
21990
+ }
21991
+ static for(namespace) {
21992
+ if (!_TypeRegistry.registries.has(namespace)) {
21993
+ _TypeRegistry.registries.set(namespace, new _TypeRegistry(namespace));
21994
+ }
21995
+ return _TypeRegistry.registries.get(namespace);
21996
+ }
21997
+ copyFrom(other) {
21998
+ const { schemas, exceptions } = this;
21999
+ for (const [k, v] of other.schemas) {
22000
+ if (!schemas.has(k)) {
22001
+ schemas.set(k, v);
22002
+ }
22003
+ }
22004
+ for (const [k, v] of other.exceptions) {
22005
+ if (!exceptions.has(k)) {
22006
+ exceptions.set(k, v);
22007
+ }
22008
+ }
22009
+ }
22010
+ register(shapeId, schema) {
22011
+ const qualifiedName = this.normalizeShapeId(shapeId);
22012
+ for (const r of [this, _TypeRegistry.for(qualifiedName.split("#")[0])]) {
22013
+ r.schemas.set(qualifiedName, schema);
22014
+ }
22015
+ }
22016
+ getSchema(shapeId) {
22017
+ const id = this.normalizeShapeId(shapeId);
22018
+ if (!this.schemas.has(id)) {
22019
+ if (!shapeId.includes("#")) {
22020
+ const suffix = "#" + shapeId;
22021
+ const candidates = [];
22022
+ for (const [shapeId2, schema] of this.schemas.entries()) {
22023
+ if (shapeId2.endsWith(suffix)) {
22024
+ candidates.push(schema);
22025
+ }
22026
+ }
22027
+ if (candidates.length === 1) {
22028
+ return candidates[0];
22029
+ }
22030
+ }
22031
+ throw new Error(`@smithy/core/schema - schema not found for ${id}`);
22032
+ }
22033
+ return this.schemas.get(id);
22034
+ }
22035
+ registerError(es, ctor) {
22036
+ const $error = es;
22037
+ const ns = $error[1];
22038
+ for (const r of [this, _TypeRegistry.for(ns)]) {
22039
+ r.schemas.set(ns + "#" + $error[2], $error);
22040
+ r.exceptions.set($error, ctor);
22041
+ }
22042
+ }
22043
+ getErrorCtor(es) {
22044
+ const $error = es;
22045
+ if (this.exceptions.has($error)) {
22046
+ return this.exceptions.get($error);
22047
+ }
22048
+ const registry2 = _TypeRegistry.for($error[1]);
22049
+ return registry2.exceptions.get($error);
22050
+ }
22051
+ getBaseException() {
22052
+ for (const exceptionKey of this.exceptions.keys()) {
22053
+ if (Array.isArray(exceptionKey)) {
22054
+ const [, ns, name15] = exceptionKey;
22055
+ const id = ns + "#" + name15;
22056
+ if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) {
22057
+ return exceptionKey;
22058
+ }
22059
+ }
22060
+ }
22061
+ return void 0;
22062
+ }
22063
+ find(predicate) {
22064
+ for (const schema of this.schemas.values()) {
22065
+ if (predicate(schema)) {
22066
+ return schema;
22067
+ }
22068
+ }
22069
+ return void 0;
22070
+ }
22071
+ clear() {
22072
+ this.schemas.clear();
22073
+ this.exceptions.clear();
22074
+ }
22075
+ normalizeShapeId(shapeId) {
22076
+ if (shapeId.includes("#")) {
22077
+ return shapeId;
22078
+ }
22079
+ return this.namespace + "#" + shapeId;
22080
+ }
22081
+ };
22082
+ }
22083
+ });
22084
+
22085
+ // node_modules/@smithy/core/dist-es/submodules/schema/index.js
22086
+ var init_schema = __esm({
22087
+ "node_modules/@smithy/core/dist-es/submodules/schema/index.js"() {
22088
+ init_TypeRegistry();
22900
22089
  }
22901
22090
  });
22902
22091
 
22903
22092
  // node_modules/@smithy/core/dist-es/submodules/config/index.js
22904
22093
  var init_config = __esm({
22905
22094
  "node_modules/@smithy/core/dist-es/submodules/config/index.js"() {
22095
+ init_booleanSelector();
22096
+ init_types2();
22906
22097
  init_constants();
22907
22098
  init_configLoader();
22908
22099
  }
@@ -22927,14 +22118,16 @@ var init_getEndpointUrlConfig = __esm({
22927
22118
  return void 0;
22928
22119
  },
22929
22120
  configFileSelector: (profile, config2) => {
22930
- if (config2 && profile.services) {
22931
- const servicesSection = config2[["services", profile.services].join(CONFIG_PREFIX_SEPARATOR)];
22932
- if (servicesSection) {
22933
- const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase());
22934
- const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)];
22935
- if (endpointUrl2)
22936
- return endpointUrl2;
22121
+ if (profile.services) {
22122
+ const servicesSectionKey = ["services", profile.services].join(CONFIG_PREFIX_SEPARATOR);
22123
+ if (!config2 || !config2[servicesSectionKey]) {
22124
+ throw new Error(`The services section "${profile.services}" specified in the profile is not present in the shared configuration file.`);
22937
22125
  }
22126
+ const servicesSection = config2[servicesSectionKey];
22127
+ const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase());
22128
+ const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)];
22129
+ if (endpointUrl2)
22130
+ return endpointUrl2;
22938
22131
  }
22939
22132
  const endpointUrl = profile[CONFIG_ENDPOINT_URL];
22940
22133
  if (endpointUrl)
@@ -22946,13 +22139,35 @@ var init_getEndpointUrlConfig = __esm({
22946
22139
  }
22947
22140
  });
22948
22141
 
22142
+ // node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getIgnoreConfiguredEndpointUrls.js
22143
+ var ENV_IGNORE_CONFIGURED_ENDPOINT_URLS, CONFIG_IGNORE_CONFIGURED_ENDPOINT_URLS, ignoreConfiguredEndpointUrlsConfigSelectors;
22144
+ var init_getIgnoreConfiguredEndpointUrls = __esm({
22145
+ "node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getIgnoreConfiguredEndpointUrls.js"() {
22146
+ init_config();
22147
+ ENV_IGNORE_CONFIGURED_ENDPOINT_URLS = "AWS_IGNORE_CONFIGURED_ENDPOINT_URLS";
22148
+ CONFIG_IGNORE_CONFIGURED_ENDPOINT_URLS = "ignore_configured_endpoint_urls";
22149
+ ignoreConfiguredEndpointUrlsConfigSelectors = {
22150
+ environmentVariableSelector: (env) => booleanSelector(env, ENV_IGNORE_CONFIGURED_ENDPOINT_URLS, SelectorType.ENV),
22151
+ configFileSelector: (profile) => booleanSelector(profile, CONFIG_IGNORE_CONFIGURED_ENDPOINT_URLS, SelectorType.CONFIG),
22152
+ default: false
22153
+ };
22154
+ }
22155
+ });
22156
+
22949
22157
  // node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromConfig.js
22950
22158
  var getEndpointFromConfig;
22951
22159
  var init_getEndpointFromConfig = __esm({
22952
22160
  "node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromConfig.js"() {
22953
22161
  init_config();
22954
22162
  init_getEndpointUrlConfig();
22955
- getEndpointFromConfig = async (serviceId) => loadConfig(getEndpointUrlConfig(serviceId ?? ""))();
22163
+ init_getIgnoreConfiguredEndpointUrls();
22164
+ getEndpointFromConfig = async (serviceId) => {
22165
+ const ignore2 = await loadConfig(ignoreConfiguredEndpointUrlsConfigSelectors)();
22166
+ if (ignore2) {
22167
+ return void 0;
22168
+ }
22169
+ return loadConfig(getEndpointUrlConfig(serviceId ?? ""))();
22170
+ };
22956
22171
  }
22957
22172
  });
22958
22173
 
@@ -22978,7 +22193,7 @@ var init_s3 = __esm({
22978
22193
  }
22979
22194
  return endpointParams;
22980
22195
  };
22981
- DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/;
22196
+ DOMAIN_PATTERN = /^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/;
22982
22197
  IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/;
22983
22198
  DOTS_PATTERN = /\.\./;
22984
22199
  isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName);
@@ -23067,7 +22282,7 @@ var init_toEndpointV12 = __esm({
23067
22282
  // node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromInstructions.js
23068
22283
  function bindGetEndpointFromInstructions(getEndpointFromConfig2) {
23069
22284
  return async (commandInput, instructionsSupplier, clientConfig, context) => {
23070
- if (!clientConfig.isCustomEndpoint) {
22285
+ if (!clientConfig.isCustomEndpoint && !clientConfig.ignoreConfiguredEndpointUrls) {
23071
22286
  let endpointFromConfig;
23072
22287
  if (clientConfig.serviceConfiguredEndpoint) {
23073
22288
  endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();
@@ -23077,6 +22292,7 @@ function bindGetEndpointFromInstructions(getEndpointFromConfig2) {
23077
22292
  if (endpointFromConfig) {
23078
22293
  clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
23079
22294
  clientConfig.isCustomEndpoint = true;
22295
+ context?.logger?.debug?.(`@smithy/core/endpoints - resolved endpoint from config: ${endpointFromConfig}`);
23080
22296
  }
23081
22297
  }
23082
22298
  const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);
@@ -23182,7 +22398,7 @@ function bindEndpointMiddleware(getEndpointFromConfig2) {
23182
22398
  }
23183
22399
  var init_endpointMiddleware = __esm({
23184
22400
  "node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/endpointMiddleware.js"() {
23185
- init_client();
22401
+ init_transport();
23186
22402
  init_getEndpointFromInstructions();
23187
22403
  }
23188
22404
  });
@@ -23232,7 +22448,8 @@ function bindResolveEndpointConfig(getEndpointFromConfig2) {
23232
22448
  tls,
23233
22449
  isCustomEndpoint,
23234
22450
  useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false),
23235
- useFipsEndpoint: normalizeProvider(useFipsEndpoint ?? false)
22451
+ useFipsEndpoint: normalizeProvider(useFipsEndpoint ?? false),
22452
+ ignoreConfiguredEndpointUrls: !!input.ignoreConfiguredEndpointUrls
23236
22453
  });
23237
22454
  let configuredEndpointPromise = void 0;
23238
22455
  resolvedConfig.serviceConfiguredEndpoint = async () => {
@@ -23251,61 +22468,6 @@ var init_resolveEndpointConfig = __esm({
23251
22468
  }
23252
22469
  });
23253
22470
 
23254
- // node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointError.js
23255
- var init_EndpointError = __esm({
23256
- "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointError.js"() {
23257
- }
23258
- });
23259
-
23260
- // node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointFunctions.js
23261
- var init_EndpointFunctions = __esm({
23262
- "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointFunctions.js"() {
23263
- }
23264
- });
23265
-
23266
- // node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointRuleObject.js
23267
- var init_EndpointRuleObject = __esm({
23268
- "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointRuleObject.js"() {
23269
- }
23270
- });
23271
-
23272
- // node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/ErrorRuleObject.js
23273
- var init_ErrorRuleObject = __esm({
23274
- "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/ErrorRuleObject.js"() {
23275
- }
23276
- });
23277
-
23278
- // node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/RuleSetObject.js
23279
- var init_RuleSetObject = __esm({
23280
- "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/RuleSetObject.js"() {
23281
- }
23282
- });
23283
-
23284
- // node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/TreeRuleObject.js
23285
- var init_TreeRuleObject = __esm({
23286
- "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/TreeRuleObject.js"() {
23287
- }
23288
- });
23289
-
23290
- // node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/shared.js
23291
- var init_shared = __esm({
23292
- "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/shared.js"() {
23293
- }
23294
- });
23295
-
23296
- // node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/index.js
23297
- var init_types2 = __esm({
23298
- "node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/index.js"() {
23299
- init_EndpointError();
23300
- init_EndpointFunctions();
23301
- init_EndpointRuleObject();
23302
- init_ErrorRuleObject();
23303
- init_RuleSetObject();
23304
- init_TreeRuleObject();
23305
- init_shared();
23306
- }
23307
- });
23308
-
23309
22471
  // node_modules/@smithy/core/dist-es/submodules/endpoints/index.js
23310
22472
  var getEndpointFromInstructions, resolveEndpointConfig, endpointMiddleware, getEndpointPlugin;
23311
22473
  var init_endpoints = __esm({
@@ -23316,7 +22478,6 @@ var init_endpoints = __esm({
23316
22478
  init_getEndpointPlugin();
23317
22479
  init_resolveEndpointConfig();
23318
22480
  init_transport();
23319
- init_types2();
23320
22481
  getEndpointFromInstructions = bindGetEndpointFromInstructions(getEndpointFromConfig);
23321
22482
  resolveEndpointConfig = bindResolveEndpointConfig(getEndpointFromConfig);
23322
22483
  endpointMiddleware = bindEndpointMiddleware(getEndpointFromConfig);
@@ -23420,58 +22581,77 @@ var init_ChecksumStream = __esm({
23420
22581
  "node_modules/@smithy/core/dist-es/submodules/serde/util-stream/checksum/ChecksumStream.js"() {
23421
22582
  import_node_stream = require("node:stream");
23422
22583
  init_toBase64();
23423
- ChecksumStream = class extends import_node_stream.Duplex {
22584
+ ChecksumStream = class extends import_node_stream.Readable {
23424
22585
  expectedChecksum;
23425
22586
  checksumSourceLocation;
23426
22587
  checksum;
23427
22588
  source;
23428
22589
  base64Encoder;
23429
- pendingCallback = null;
23430
22590
  constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) {
23431
22591
  super();
23432
- if (typeof source.pipe === "function") {
23433
- this.source = source;
23434
- } else {
22592
+ if (typeof source.pipe !== "function") {
23435
22593
  throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
23436
22594
  }
22595
+ this.source = source;
23437
22596
  this.base64Encoder = base64Encoder ?? toBase64;
23438
22597
  this.expectedChecksum = expectedChecksum;
23439
22598
  this.checksum = checksum;
23440
22599
  this.checksumSourceLocation = checksumSourceLocation;
23441
- this.source.pipe(this);
23442
- }
23443
- _read(size) {
23444
- if (this.pendingCallback) {
23445
- const callback = this.pendingCallback;
23446
- this.pendingCallback = null;
23447
- callback();
22600
+ this.source.on("data", this.onSourceData);
22601
+ this.source.on("end", this.onSourceEnd);
22602
+ this.source.on("error", this.onSourceError);
22603
+ this.source.on("close", this.onSourceClose);
22604
+ this.source.pause();
22605
+ }
22606
+ onSourceData = (chunk) => {
22607
+ if (this.destroyed) {
22608
+ return;
23448
22609
  }
23449
- }
23450
- _write(chunk, encoding, callback) {
23451
22610
  try {
23452
22611
  this.checksum.update(chunk);
23453
- const canPushMore = this.push(chunk);
23454
- if (!canPushMore) {
23455
- this.pendingCallback = callback;
23456
- return;
23457
- }
23458
22612
  } catch (e) {
23459
- return callback(e);
22613
+ this.destroy(e);
22614
+ return;
22615
+ }
22616
+ if (!this.push(chunk)) {
22617
+ this.source.pause();
22618
+ }
22619
+ };
22620
+ onSourceEnd = async () => {
22621
+ if (this.destroyed) {
22622
+ return;
23460
22623
  }
23461
- return callback();
23462
- }
23463
- async _final(callback) {
23464
22624
  try {
23465
22625
  const digest = await this.checksum.digest();
23466
22626
  const received = this.base64Encoder(digest);
23467
22627
  if (this.expectedChecksum !== received) {
23468
- return callback(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${received}" in response header "${this.checksumSourceLocation}".`));
22628
+ this.destroy(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${received}" in response header "${this.checksumSourceLocation}".`));
22629
+ return;
23469
22630
  }
23470
22631
  } catch (e) {
23471
- return callback(e);
22632
+ this.destroy(e);
22633
+ return;
23472
22634
  }
23473
22635
  this.push(null);
23474
- return callback();
22636
+ };
22637
+ onSourceError = (error40) => {
22638
+ this.destroy(error40);
22639
+ };
22640
+ onSourceClose = () => {
22641
+ if (!this.destroyed && !this.source.readableEnded) {
22642
+ this.destroy(new Error("Connection lost or stream closed before all data was received."));
22643
+ }
22644
+ };
22645
+ _read(_size2) {
22646
+ this.source.resume();
22647
+ }
22648
+ _destroy(error40, callback) {
22649
+ this.source?.removeListener("data", this.onSourceData);
22650
+ this.source?.removeListener("end", this.onSourceEnd);
22651
+ this.source?.removeListener("error", this.onSourceError);
22652
+ this.source?.removeListener("close", this.onSourceClose);
22653
+ this.source?.destroy();
22654
+ callback(error40);
23475
22655
  }
23476
22656
  };
23477
22657
  }
@@ -23939,6 +23119,7 @@ var import_node_stream4, headStream2, Collector;
23939
23119
  var init_headStream = __esm({
23940
23120
  "node_modules/@smithy/core/dist-es/submodules/serde/util-stream/headStream.js"() {
23941
23121
  import_node_stream4 = require("node:stream");
23122
+ init_concatBytes();
23942
23123
  init_headStream_browser();
23943
23124
  init_stream_type_check();
23944
23125
  headStream2 = (stream2, bytes) => {
@@ -23955,7 +23136,7 @@ var init_headStream = __esm({
23955
23136
  });
23956
23137
  collector.on("error", reject2);
23957
23138
  collector.on("finish", function() {
23958
- const bytes2 = new Uint8Array(Buffer.concat(this.buffers));
23139
+ const bytes2 = concatBytes(this.buffers);
23959
23140
  resolve9(bytes2);
23960
23141
  });
23961
23142
  });
@@ -23995,103 +23176,36 @@ var init_toUtf8_browser = __esm({
23995
23176
  }
23996
23177
  });
23997
23178
 
23998
- // node_modules/@smithy/core/dist-es/submodules/serde/util-base64/fromBase64.browser.js
23999
- var fromBase642;
24000
- var init_fromBase64_browser = __esm({
24001
- "node_modules/@smithy/core/dist-es/submodules/serde/util-base64/fromBase64.browser.js"() {
24002
- init_constants_for_browser();
24003
- fromBase642 = (input) => {
24004
- let totalByteLength = input.length / 4 * 3;
24005
- if (input.slice(-2) === "==") {
24006
- totalByteLength -= 2;
24007
- } else if (input.slice(-1) === "=") {
24008
- totalByteLength--;
24009
- }
24010
- const out = new ArrayBuffer(totalByteLength);
24011
- const dataView = new DataView(out);
24012
- for (let i = 0; i < input.length; i += 4) {
24013
- let bits = 0;
24014
- let bitLength = 0;
24015
- for (let j = i, limit = i + 3; j <= limit; j++) {
24016
- if (input[j] !== "=") {
24017
- if (!(input[j] in alphabetByEncoding)) {
24018
- throw new TypeError(`Invalid character ${input[j]} in base64 string.`);
24019
- }
24020
- bits |= alphabetByEncoding[input[j]] << (limit - j) * bitsPerLetter;
24021
- bitLength += bitsPerLetter;
24022
- } else {
24023
- bits >>= bitsPerLetter;
24024
- }
24025
- }
24026
- const chunkOffset = i / 4 * 3;
24027
- bits >>= bitLength % bitsPerByte;
24028
- const byteLength = Math.floor(bitLength / bitsPerByte);
24029
- for (let k = 0; k < byteLength; k++) {
24030
- const offset2 = (byteLength - k - 1) * bitsPerByte;
24031
- dataView.setUint8(chunkOffset + k, (bits & 255 << offset2) >> offset2);
24032
- }
24033
- }
24034
- return new Uint8Array(out);
24035
- };
24036
- }
24037
- });
24038
-
24039
23179
  // node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.browser.js
24040
23180
  async function collectBlob(blob) {
24041
- const base643 = await readToBase64(blob);
24042
- const arrayBuffer = fromBase642(base643);
24043
- return new Uint8Array(arrayBuffer);
23181
+ return blob.arrayBuffer().then((ab) => new Uint8Array(ab));
24044
23182
  }
24045
- async function collectStream(stream2) {
23183
+ async function collectReadableStream(stream2) {
24046
23184
  const chunks = [];
24047
23185
  const reader = stream2.getReader();
24048
- let isDone = false;
24049
23186
  let length = 0;
24050
- while (!isDone) {
23187
+ while (true) {
24051
23188
  const { done, value } = await reader.read();
24052
23189
  if (value) {
24053
23190
  chunks.push(value);
24054
23191
  length += value.length;
24055
23192
  }
24056
- isDone = done;
24057
- }
24058
- const collected = new Uint8Array(length);
24059
- let offset2 = 0;
24060
- for (const chunk of chunks) {
24061
- collected.set(chunk, offset2);
24062
- offset2 += chunk.length;
23193
+ if (done) {
23194
+ break;
23195
+ }
24063
23196
  }
24064
- return collected;
24065
- }
24066
- function readToBase64(blob) {
24067
- return new Promise((resolve9, reject2) => {
24068
- const reader = new FileReader();
24069
- reader.onloadend = () => {
24070
- if (reader.readyState !== 2) {
24071
- return reject2(new Error("Reader aborted too early"));
24072
- }
24073
- const result = reader.result ?? "";
24074
- const commaIndex = result.indexOf(",");
24075
- const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
24076
- resolve9(result.substring(dataOffset));
24077
- };
24078
- reader.onabort = () => reject2(new Error("Read aborted"));
24079
- reader.onerror = () => reject2(reader.error);
24080
- reader.readAsDataURL(blob);
24081
- });
23197
+ return concatBytes(chunks, length);
24082
23198
  }
24083
23199
  var streamCollector;
24084
23200
  var init_stream_collector_browser = __esm({
24085
23201
  "node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.browser.js"() {
24086
- init_fromBase64_browser();
23202
+ init_concatBytes();
23203
+ init_stream_type_check();
24087
23204
  streamCollector = async (stream2) => {
24088
- if (typeof Blob === "function" && stream2 instanceof Blob || stream2.constructor?.name === "Blob") {
24089
- if (Blob.prototype.arrayBuffer !== void 0) {
24090
- return new Uint8Array(await stream2.arrayBuffer());
24091
- }
23205
+ if (isBlob(stream2)) {
24092
23206
  return collectBlob(stream2);
24093
23207
  }
24094
- return collectStream(stream2);
23208
+ return collectReadableStream(stream2);
24095
23209
  };
24096
23210
  }
24097
23211
  });
@@ -24161,57 +23275,42 @@ var init_sdk_stream_mixin_browser = __esm({
24161
23275
  });
24162
23276
 
24163
23277
  // node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.js
24164
- async function collectReadableStream(stream2) {
24165
- const chunks = [];
24166
- const reader = stream2.getReader();
24167
- let isDone = false;
24168
- let length = 0;
24169
- while (!isDone) {
24170
- const { done, value } = await reader.read();
24171
- if (value) {
24172
- chunks.push(value);
24173
- length += value.length;
24174
- }
24175
- isDone = done;
24176
- }
24177
- const collected = new Uint8Array(length);
24178
- let offset2 = 0;
24179
- for (const chunk of chunks) {
24180
- collected.set(chunk, offset2);
24181
- offset2 += chunk.length;
24182
- }
24183
- return collected;
24184
- }
24185
- var import_node_stream5, Collector2, isReadableStreamInstance, streamCollector2;
23278
+ var import_node_stream5, streamCollector2, Collector2;
24186
23279
  var init_stream_collector = __esm({
24187
23280
  "node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.js"() {
24188
23281
  import_node_stream5 = require("node:stream");
24189
- Collector2 = class extends import_node_stream5.Writable {
24190
- bufferedBytes = [];
24191
- _write(chunk, encoding, callback) {
24192
- this.bufferedBytes.push(chunk);
24193
- callback();
24194
- }
24195
- };
24196
- isReadableStreamInstance = (stream2) => typeof ReadableStream === "function" && stream2 instanceof ReadableStream;
23282
+ init_concatBytes();
23283
+ init_stream_collector_browser();
23284
+ init_stream_type_check();
24197
23285
  streamCollector2 = (stream2) => {
24198
- if (isReadableStreamInstance(stream2)) {
23286
+ if (isBlob(stream2)) {
23287
+ return collectBlob(stream2);
23288
+ }
23289
+ if (isReadableStream(stream2)) {
24199
23290
  return collectReadableStream(stream2);
24200
23291
  }
24201
23292
  return new Promise((resolve9, reject2) => {
24202
23293
  const collector = new Collector2();
24203
- stream2.pipe(collector);
24204
- stream2.on("error", (err) => {
23294
+ const nodeStream = stream2;
23295
+ nodeStream.pipe(collector);
23296
+ nodeStream.on("error", (err) => {
24205
23297
  collector.end();
24206
23298
  reject2(err);
24207
23299
  });
24208
23300
  collector.on("error", reject2);
24209
23301
  collector.on("finish", function() {
24210
- const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes));
23302
+ const bytes = concatBytes(this.bufferedBytes);
24211
23303
  resolve9(bytes);
24212
23304
  });
24213
23305
  });
24214
23306
  };
23307
+ Collector2 = class extends import_node_stream5.Writable {
23308
+ bufferedBytes = [];
23309
+ _write(chunk, encoding, callback) {
23310
+ this.bufferedBytes.push(chunk);
23311
+ callback();
23312
+ }
23313
+ };
24215
23314
  }
24216
23315
  });
24217
23316
 
@@ -24228,7 +23327,7 @@ var init_sdk_stream_mixin = __esm({
24228
23327
  if (!(stream2 instanceof import_node_stream6.Readable)) {
24229
23328
  try {
24230
23329
  return sdkStreamMixin(stream2);
24231
- } catch (e) {
23330
+ } catch (ignored) {
24232
23331
  const name15 = stream2?.__proto__?.constructor?.name || stream2;
24233
23332
  throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name15}`);
24234
23333
  }
@@ -24315,6 +23414,7 @@ __export(serde_exports, {
24315
23414
  _parseRfc3339DateTimeWithOffset: () => _parseRfc3339DateTimeWithOffset,
24316
23415
  _parseRfc7231DateTime: () => _parseRfc7231DateTime,
24317
23416
  calculateBodyLength: () => calculateBodyLength,
23417
+ concatBytes: () => concatBytes,
24318
23418
  copyDocumentWithTransform: () => copyDocumentWithTransform,
24319
23419
  createBufferedReadable: () => createBufferedReadable,
24320
23420
  createChecksumStream: () => createChecksumStream2,
@@ -24363,6 +23463,7 @@ __export(serde_exports, {
24363
23463
  splitEvery: () => splitEvery,
24364
23464
  splitHeader: () => splitHeader,
24365
23465
  splitStream: () => splitStream2,
23466
+ streamCollector: () => streamCollector2,
24366
23467
  strictParseByte: () => strictParseByte,
24367
23468
  strictParseDouble: () => strictParseDouble,
24368
23469
  strictParseFloat: () => strictParseFloat,
@@ -24399,6 +23500,7 @@ var init_serde = __esm({
24399
23500
  init_hex_encoding();
24400
23501
  init_calculateBodyLength();
24401
23502
  init_toUint8Array();
23503
+ init_concatBytes();
24402
23504
  init_buffer_from();
24403
23505
  init_is_array_buffer();
24404
23506
  init_deserializerMiddleware();
@@ -24413,6 +23515,7 @@ var init_serde = __esm({
24413
23515
  init_sdk_stream_mixin();
24414
23516
  init_splitStream();
24415
23517
  init_stream_type_check();
23518
+ init_stream_collector();
24416
23519
  Uint8ArrayBlobAdapter = class extends bindUint8ArrayBlobAdapter(toUtf8, fromUtf8, toBase64, fromBase64) {
24417
23520
  };
24418
23521
  _getRandomValues = import_node_crypto2.getRandomValues;
@@ -24421,6 +23524,81 @@ var init_serde = __esm({
24421
23524
  }
24422
23525
  });
24423
23526
 
23527
+ // node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Js.js
23528
+ var CRC32_TABLE, ONES, Crc32Js;
23529
+ var init_Crc32Js = __esm({
23530
+ "node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Js.js"() {
23531
+ CRC32_TABLE = new Uint32Array(256);
23532
+ for (let i = 0; i < 256; ++i) {
23533
+ let c = i;
23534
+ for (let j = 0; j < 8; ++j) {
23535
+ c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
23536
+ }
23537
+ CRC32_TABLE[i] = c >>> 0;
23538
+ }
23539
+ ONES = 4294967295;
23540
+ Crc32Js = class {
23541
+ digestLength = 4;
23542
+ checksum = ONES;
23543
+ update(data2) {
23544
+ for (let i = 0; i < data2.length; ++i) {
23545
+ this.checksum = this.checksum >>> 8 ^ CRC32_TABLE[(this.checksum ^ data2[i]) & 255];
23546
+ }
23547
+ }
23548
+ digestSync() {
23549
+ return (this.checksum ^ ONES) >>> 0;
23550
+ }
23551
+ async digest() {
23552
+ const value = this.digestSync();
23553
+ const out = new Uint8Array(4);
23554
+ new DataView(out.buffer).setUint32(0, value, false);
23555
+ return out;
23556
+ }
23557
+ reset() {
23558
+ this.checksum = ONES;
23559
+ }
23560
+ };
23561
+ }
23562
+ });
23563
+
23564
+ // node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Node.js
23565
+ function buildNativeClass(nativeCrc32) {
23566
+ return class Crc32Node {
23567
+ digestLength = 4;
23568
+ value = 0;
23569
+ update(data2) {
23570
+ this.value = nativeCrc32(data2, this.value);
23571
+ }
23572
+ digestSync() {
23573
+ return this.value >>> 0;
23574
+ }
23575
+ async digest() {
23576
+ const out = new Uint8Array(4);
23577
+ new DataView(out.buffer).setUint32(0, this.digestSync(), false);
23578
+ return out;
23579
+ }
23580
+ reset() {
23581
+ this.value = 0;
23582
+ }
23583
+ };
23584
+ }
23585
+ var zlib, zlibCrc32, Crc32Node;
23586
+ var init_Crc32Node = __esm({
23587
+ "node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Node.js"() {
23588
+ zlib = __toESM(require("node:zlib"));
23589
+ init_Crc32Js();
23590
+ zlibCrc32 = typeof zlib.crc32 === "function" ? zlib.crc32 : void 0;
23591
+ Crc32Node = zlibCrc32 ? buildNativeClass(zlibCrc32) : Crc32Js;
23592
+ }
23593
+ });
23594
+
23595
+ // node_modules/@smithy/core/dist-es/submodules/checksum/index.js
23596
+ var init_checksum = __esm({
23597
+ "node_modules/@smithy/core/dist-es/submodules/checksum/index.js"() {
23598
+ init_Crc32Node();
23599
+ }
23600
+ });
23601
+
24424
23602
  // node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js
24425
23603
  function negate(bytes) {
24426
23604
  for (let i = 0; i < 8; i++) {
@@ -24502,27 +23680,27 @@ var init_HeaderMarshaller = __esm({
24502
23680
  formatHeaderValue(header) {
24503
23681
  switch (header.type) {
24504
23682
  case "boolean":
24505
- return Uint8Array.from([header.value ? 0 : 1]);
23683
+ return Uint8Array.from([header.value ? HEADER_VALUE_TYPE.boolTrue : HEADER_VALUE_TYPE.boolFalse]);
24506
23684
  case "byte":
24507
- return Uint8Array.from([2, header.value]);
23685
+ return Uint8Array.from([HEADER_VALUE_TYPE.byte, header.value]);
24508
23686
  case "short":
24509
23687
  const shortView = new DataView(new ArrayBuffer(3));
24510
- shortView.setUint8(0, 3);
23688
+ shortView.setUint8(0, HEADER_VALUE_TYPE.short);
24511
23689
  shortView.setInt16(1, header.value, false);
24512
23690
  return new Uint8Array(shortView.buffer);
24513
23691
  case "integer":
24514
23692
  const intView = new DataView(new ArrayBuffer(5));
24515
- intView.setUint8(0, 4);
23693
+ intView.setUint8(0, HEADER_VALUE_TYPE.integer);
24516
23694
  intView.setInt32(1, header.value, false);
24517
23695
  return new Uint8Array(intView.buffer);
24518
23696
  case "long":
24519
23697
  const longBytes = new Uint8Array(9);
24520
- longBytes[0] = 5;
23698
+ longBytes[0] = HEADER_VALUE_TYPE.long;
24521
23699
  longBytes.set(header.value.bytes, 1);
24522
23700
  return longBytes;
24523
23701
  case "binary":
24524
23702
  const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));
24525
- binView.setUint8(0, 6);
23703
+ binView.setUint8(0, HEADER_VALUE_TYPE.byteArray);
24526
23704
  binView.setUint16(1, header.value.byteLength, false);
24527
23705
  const binBytes = new Uint8Array(binView.buffer);
24528
23706
  binBytes.set(header.value, 3);
@@ -24530,14 +23708,14 @@ var init_HeaderMarshaller = __esm({
24530
23708
  case "string":
24531
23709
  const utf8Bytes = this.fromUtf8(header.value);
24532
23710
  const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));
24533
- strView.setUint8(0, 7);
23711
+ strView.setUint8(0, HEADER_VALUE_TYPE.string);
24534
23712
  strView.setUint16(1, utf8Bytes.byteLength, false);
24535
23713
  const strBytes = new Uint8Array(strView.buffer);
24536
23714
  strBytes.set(utf8Bytes, 3);
24537
23715
  return strBytes;
24538
23716
  case "timestamp":
24539
23717
  const tsBytes = new Uint8Array(9);
24540
- tsBytes[0] = 8;
23718
+ tsBytes[0] = HEADER_VALUE_TYPE.timestamp;
24541
23719
  tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);
24542
23720
  return tsBytes;
24543
23721
  case "uuid":
@@ -24545,8 +23723,8 @@ var init_HeaderMarshaller = __esm({
24545
23723
  throw new Error(`Invalid UUID received: ${header.value}`);
24546
23724
  }
24547
23725
  const uuidBytes = new Uint8Array(17);
24548
- uuidBytes[0] = 9;
24549
- uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1);
23726
+ uuidBytes[0] = HEADER_VALUE_TYPE.uuid;
23727
+ uuidBytes.set(fromHex(header.value.replace(/-/g, "")), 1);
24550
23728
  return uuidBytes;
24551
23729
  }
24552
23730
  }
@@ -24558,46 +23736,46 @@ var init_HeaderMarshaller = __esm({
24558
23736
  const name15 = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength));
24559
23737
  position += nameLength;
24560
23738
  switch (headers.getUint8(position++)) {
24561
- case 0:
23739
+ case HEADER_VALUE_TYPE.boolTrue:
24562
23740
  out[name15] = {
24563
23741
  type: BOOLEAN_TAG,
24564
23742
  value: true
24565
23743
  };
24566
23744
  break;
24567
- case 1:
23745
+ case HEADER_VALUE_TYPE.boolFalse:
24568
23746
  out[name15] = {
24569
23747
  type: BOOLEAN_TAG,
24570
23748
  value: false
24571
23749
  };
24572
23750
  break;
24573
- case 2:
23751
+ case HEADER_VALUE_TYPE.byte:
24574
23752
  out[name15] = {
24575
23753
  type: BYTE_TAG,
24576
23754
  value: headers.getInt8(position++)
24577
23755
  };
24578
23756
  break;
24579
- case 3:
23757
+ case HEADER_VALUE_TYPE.short:
24580
23758
  out[name15] = {
24581
23759
  type: SHORT_TAG,
24582
23760
  value: headers.getInt16(position, false)
24583
23761
  };
24584
23762
  position += 2;
24585
23763
  break;
24586
- case 4:
23764
+ case HEADER_VALUE_TYPE.integer:
24587
23765
  out[name15] = {
24588
23766
  type: INT_TAG,
24589
23767
  value: headers.getInt32(position, false)
24590
23768
  };
24591
23769
  position += 4;
24592
23770
  break;
24593
- case 5:
23771
+ case HEADER_VALUE_TYPE.long:
24594
23772
  out[name15] = {
24595
23773
  type: LONG_TAG,
24596
23774
  value: new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8))
24597
23775
  };
24598
23776
  position += 8;
24599
23777
  break;
24600
- case 6:
23778
+ case HEADER_VALUE_TYPE.byteArray:
24601
23779
  const binaryLength = headers.getUint16(position, false);
24602
23780
  position += 2;
24603
23781
  out[name15] = {
@@ -24606,7 +23784,7 @@ var init_HeaderMarshaller = __esm({
24606
23784
  };
24607
23785
  position += binaryLength;
24608
23786
  break;
24609
- case 7:
23787
+ case HEADER_VALUE_TYPE.string:
24610
23788
  const stringLength = headers.getUint16(position, false);
24611
23789
  position += 2;
24612
23790
  out[name15] = {
@@ -24615,14 +23793,14 @@ var init_HeaderMarshaller = __esm({
24615
23793
  };
24616
23794
  position += stringLength;
24617
23795
  break;
24618
- case 8:
23796
+ case HEADER_VALUE_TYPE.timestamp:
24619
23797
  out[name15] = {
24620
23798
  type: TIMESTAMP_TAG,
24621
23799
  value: new Date(new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf())
24622
23800
  };
24623
23801
  position += 8;
24624
23802
  break;
24625
- case 9:
23803
+ case HEADER_VALUE_TYPE.uuid:
24626
23804
  const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16);
24627
23805
  position += 16;
24628
23806
  out[name15] = {
@@ -24675,23 +23853,24 @@ function splitMessage({ byteLength, byteOffset, buffer }) {
24675
23853
  const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false);
24676
23854
  const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false);
24677
23855
  const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false);
24678
- const checksummer = new import_crc32.Crc32().update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH));
24679
- if (expectedPreludeChecksum !== checksummer.digest()) {
24680
- throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`);
23856
+ const checksummer = new Crc32Node();
23857
+ checksummer.update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH));
23858
+ if (expectedPreludeChecksum !== checksummer.digestSync()) {
23859
+ throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digestSync()})`);
24681
23860
  }
24682
23861
  checksummer.update(new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH)));
24683
- if (expectedMessageChecksum !== checksummer.digest()) {
24684
- throw new Error(`The message checksum (${checksummer.digest()}) did not match the expected value of ${expectedMessageChecksum}`);
23862
+ if (expectedMessageChecksum !== checksummer.digestSync()) {
23863
+ throw new Error(`The message checksum (${checksummer.digestSync()}) did not match the expected value of ${expectedMessageChecksum}`);
24685
23864
  }
24686
23865
  return {
24687
23866
  headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength),
24688
23867
  body: new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH))
24689
23868
  };
24690
23869
  }
24691
- var import_crc32, PRELUDE_MEMBER_LENGTH, PRELUDE_LENGTH, CHECKSUM_LENGTH, MINIMUM_MESSAGE_LENGTH;
23870
+ var PRELUDE_MEMBER_LENGTH, PRELUDE_LENGTH, CHECKSUM_LENGTH, MINIMUM_MESSAGE_LENGTH;
24692
23871
  var init_splitMessage = __esm({
24693
23872
  "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/splitMessage.js"() {
24694
- import_crc32 = __toESM(require_main3());
23873
+ init_checksum();
24695
23874
  PRELUDE_MEMBER_LENGTH = 4;
24696
23875
  PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2;
24697
23876
  CHECKSUM_LENGTH = 4;
@@ -24700,10 +23879,10 @@ var init_splitMessage = __esm({
24700
23879
  });
24701
23880
 
24702
23881
  // node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/EventStreamCodec.js
24703
- var import_crc322, EventStreamCodec;
23882
+ var EventStreamCodec;
24704
23883
  var init_EventStreamCodec = __esm({
24705
23884
  "node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/EventStreamCodec.js"() {
24706
- import_crc322 = __toESM(require_main3());
23885
+ init_checksum();
24707
23886
  init_HeaderMarshaller();
24708
23887
  init_splitMessage();
24709
23888
  EventStreamCodec = class {
@@ -24751,13 +23930,15 @@ var init_EventStreamCodec = __esm({
24751
23930
  const length = headers.byteLength + body.byteLength + 16;
24752
23931
  const out = new Uint8Array(length);
24753
23932
  const view = new DataView(out.buffer, out.byteOffset, out.byteLength);
24754
- const checksum = new import_crc322.Crc32();
23933
+ const checksum = new Crc32Node();
24755
23934
  view.setUint32(0, length, false);
24756
23935
  view.setUint32(4, headers.byteLength, false);
24757
- view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false);
23936
+ checksum.update(out.subarray(0, 8));
23937
+ view.setUint32(8, checksum.digestSync(), false);
24758
23938
  out.set(headers, 12);
24759
23939
  out.set(body, headers.byteLength + 12);
24760
- view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false);
23940
+ checksum.update(out.subarray(8, length - 4));
23941
+ view.setUint32(length - 4, checksum.digestSync(), false);
24761
23942
  return out;
24762
23943
  }
24763
23944
  decode(message) {
@@ -25121,6 +24302,7 @@ var init_EventStreamSerdeConfig = __esm({
25121
24302
  var EventStreamSerde;
25122
24303
  var init_EventStreamSerde = __esm({
25123
24304
  "node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js"() {
24305
+ init_schema();
25124
24306
  init_serde();
25125
24307
  EventStreamSerde = class {
25126
24308
  marshaller;
@@ -25128,12 +24310,14 @@ var init_EventStreamSerde = __esm({
25128
24310
  deserializer;
25129
24311
  serdeContext;
25130
24312
  defaultContentType;
25131
- constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType }) {
24313
+ compositeErrorRegistry;
24314
+ constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType, compositeErrorRegistry }) {
25132
24315
  this.marshaller = marshaller;
25133
24316
  this.serializer = serializer;
25134
24317
  this.deserializer = deserializer;
25135
24318
  this.serdeContext = serdeContext;
25136
24319
  this.defaultContentType = defaultContentType;
24320
+ this.compositeErrorRegistry = compositeErrorRegistry;
25137
24321
  }
25138
24322
  async serializeEventStream({ eventStream, requestSchema, initialRequest }) {
25139
24323
  const marshaller = this.marshaller;
@@ -25243,16 +24427,9 @@ var init_EventStreamSerde = __esm({
25243
24427
  }
25244
24428
  }
25245
24429
  }
25246
- if (hasBindings) {
25247
- return {
25248
- [unionMember]: out
25249
- };
25250
- }
25251
- if (body.byteLength === 0) {
25252
- return {
25253
- [unionMember]: {}
25254
- };
25255
- }
24430
+ return {
24431
+ [unionMember]: await this.readEventMember(eventStreamSchema, body, hasBindings, out)
24432
+ };
25256
24433
  }
25257
24434
  return {
25258
24435
  [unionMember]: await this.deserializer.read(eventStreamSchema, body)
@@ -25291,6 +24468,29 @@ var init_EventStreamSerde = __esm({
25291
24468
  }
25292
24469
  };
25293
24470
  }
24471
+ async readEventMember(eventStreamSchema, body, hasBindings, out) {
24472
+ let ErrCtor;
24473
+ const staticStructuralSchema = eventStreamSchema.getSchema();
24474
+ if (Array.isArray(staticStructuralSchema) && staticStructuralSchema[0] === -3) {
24475
+ const namespace = staticStructuralSchema[1];
24476
+ const nsRegistry = TypeRegistry.for(namespace);
24477
+ this.compositeErrorRegistry?.copyFrom(nsRegistry);
24478
+ ErrCtor = (this.compositeErrorRegistry ?? nsRegistry)?.getErrorCtor(staticStructuralSchema);
24479
+ }
24480
+ const dataObject = hasBindings ? out : body.byteLength === 0 ? {} : await this.deserializer.read(eventStreamSchema, body);
24481
+ if (ErrCtor) {
24482
+ const message = dataObject.message ?? dataObject.Message ?? "Unknown";
24483
+ const metadata = {};
24484
+ const $fault = eventStreamSchema.getMergedTraits().error;
24485
+ if ($fault) {
24486
+ metadata.$fault = $fault;
24487
+ }
24488
+ return Object.assign(new ErrCtor({}), metadata, {
24489
+ message
24490
+ }, dataObject);
24491
+ }
24492
+ return dataObject;
24493
+ }
25294
24494
  writeEventBody(unionMember, unionSchema, event) {
25295
24495
  const serializer = this.serializer;
25296
24496
  let eventType = unionMember;
@@ -25409,7 +24609,7 @@ var init_event_streams = __esm({
25409
24609
  });
25410
24610
 
25411
24611
  // node_modules/@smithy/eventstream-codec/dist-cjs/index.js
25412
- var require_dist_cjs5 = __commonJS({
24612
+ var require_dist_cjs2 = __commonJS({
25413
24613
  "node_modules/@smithy/eventstream-codec/dist-cjs/index.js"(exports2) {
25414
24614
  "use strict";
25415
24615
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -25440,7 +24640,7 @@ var require_dist_cjs5 = __commonJS({
25440
24640
  });
25441
24641
 
25442
24642
  // node_modules/@smithy/util-utf8/dist-cjs/index.js
25443
- var require_dist_cjs6 = __commonJS({
24643
+ var require_dist_cjs3 = __commonJS({
25444
24644
  "node_modules/@smithy/util-utf8/dist-cjs/index.js"(exports2) {
25445
24645
  "use strict";
25446
24646
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -25694,10 +24894,21 @@ var init_aws4fetch_esm = __esm({
25694
24894
  });
25695
24895
 
25696
24896
  // node_modules/@ai-sdk/amazon-bedrock/dist/index.mjs
24897
+ function supportsStrictTools(modelId) {
24898
+ return !rejectsNewerSchemaFields(modelId);
24899
+ }
24900
+ function supportsNativeStructuredOutput(modelId) {
24901
+ return !rejectsNewerSchemaFields(modelId);
24902
+ }
24903
+ function rejectsNewerSchemaFields(modelId) {
24904
+ return MODELS_REJECTING_NEWER_SCHEMA_FIELDS.some(
24905
+ (model) => modelId.includes(model)
24906
+ );
24907
+ }
25697
24908
  function createBedrockEventStreamDecoder(body, processEvent) {
25698
24909
  const codec = new import_eventstream_codec.EventStreamCodec(import_util_utf8.toUtf8, import_util_utf8.fromUtf8);
25699
24910
  let buffer = new Uint8Array(0);
25700
- const textDecoder2 = new TextDecoder();
24911
+ const textDecoder3 = new TextDecoder();
25701
24912
  return body.pipeThrough(
25702
24913
  new TransformStream({
25703
24914
  async transform(chunk, controller) {
@@ -25721,7 +24932,7 @@ function createBedrockEventStreamDecoder(body, processEvent) {
25721
24932
  buffer = buffer.slice(totalLength);
25722
24933
  const messageType = (_a17 = decoded.headers[":message-type"]) == null ? void 0 : _a17.value;
25723
24934
  const eventType = (_b16 = decoded.headers[":event-type"]) == null ? void 0 : _b16.value;
25724
- const data2 = textDecoder2.decode(decoded.body);
24935
+ const data2 = textDecoder3.decode(decoded.body);
25725
24936
  await processEvent({ messageType, eventType, data: data2 }, controller);
25726
24937
  } catch (e) {
25727
24938
  break;
@@ -25777,7 +24988,7 @@ async function prepareTools({
25777
24988
  toolChoice: preparedAnthropicToolChoice,
25778
24989
  toolWarnings: anthropicToolWarnings,
25779
24990
  betas: anthropicBetas
25780
- } = await (0, import_internal2.prepareTools)({
24991
+ } = await (0, import_internal3.prepareTools)({
25781
24992
  tools: ProviderTools,
25782
24993
  toolChoice,
25783
24994
  supportsStructuredOutput: false,
@@ -25791,7 +25002,7 @@ async function prepareTools({
25791
25002
  };
25792
25003
  }
25793
25004
  for (const tool6 of ProviderTools) {
25794
- const toolFactory = Object.values(import_internal2.anthropicTools).find((factory) => {
25005
+ const toolFactory = Object.values(import_internal3.anthropicTools).find((factory) => {
25795
25006
  const instance = factory({});
25796
25007
  return instance.id === tool6.id;
25797
25008
  });
@@ -25815,12 +25026,20 @@ async function prepareTools({
25815
25026
  }
25816
25027
  }
25817
25028
  const filteredFunctionTools = (toolChoice == null ? void 0 : toolChoice.type) === "tool" ? functionTools.filter((t) => t.name === toolChoice.toolName) : functionTools;
25029
+ const supportsStrictOnTools = supportsStrictTools(modelId);
25818
25030
  for (const tool6 of filteredFunctionTools) {
25031
+ if (!supportsStrictOnTools && tool6.strict != null) {
25032
+ toolWarnings.push({
25033
+ type: "unsupported",
25034
+ feature: "strict",
25035
+ details: `Tool '${tool6.name}' has strict: ${tool6.strict}, but strict mode is not supported by this model on Amazon Bedrock. The strict property will be ignored.`
25036
+ });
25037
+ }
25819
25038
  bedrockTools.push({
25820
25039
  toolSpec: {
25821
25040
  name: tool6.name,
25822
25041
  ...((_a17 = tool6.description) == null ? void 0 : _a17.trim()) !== "" ? { description: tool6.description } : {},
25823
- ...tool6.strict != null ? { strict: tool6.strict } : {},
25042
+ ...tool6.strict != null && supportsStrictOnTools ? { strict: tool6.strict } : {},
25824
25043
  inputSchema: {
25825
25044
  json: tool6.inputSchema
25826
25045
  }
@@ -25921,6 +25140,32 @@ function pushCachePoint(content, providerMetadata) {
25921
25140
  content.push(cachePoint);
25922
25141
  }
25923
25142
  }
25143
+ function sanitizeToolName(toolName) {
25144
+ return toolName.replace(/[^a-zA-Z0-9_-]/g, "") || "_";
25145
+ }
25146
+ function getBedrockImageSource({
25147
+ data: data2,
25148
+ functionality
25149
+ }) {
25150
+ if (data2 instanceof URL) {
25151
+ if (data2.protocol !== "s3:") {
25152
+ throw new UnsupportedFunctionalityError({ functionality });
25153
+ }
25154
+ return {
25155
+ s3Location: {
25156
+ uri: data2.toString()
25157
+ }
25158
+ };
25159
+ }
25160
+ return { bytes: convertToBase64(data2) };
25161
+ }
25162
+ function getBedrockImageFormatFromUrl(url2) {
25163
+ var _a17;
25164
+ const extension = (_a17 = url2.pathname.split(".").pop()) == null ? void 0 : _a17.toLowerCase();
25165
+ return getBedrockImageFormat(
25166
+ `image/${extension === "jpg" ? "jpeg" : extension}`
25167
+ );
25168
+ }
25924
25169
  async function shouldEnableCitations(providerMetadata) {
25925
25170
  var _a17, _b16;
25926
25171
  const bedrockOptions = await parseProviderOptions({
@@ -25973,19 +25218,22 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
25973
25218
  break;
25974
25219
  }
25975
25220
  case "file": {
25976
- if (part.data instanceof URL) {
25977
- throw new UnsupportedFunctionalityError({
25978
- functionality: "File URL data"
25979
- });
25980
- }
25981
25221
  if (part.mediaType.startsWith("image/")) {
25982
25222
  bedrockContent.push({
25983
25223
  image: {
25984
25224
  format: getBedrockImageFormat(part.mediaType),
25985
- source: { bytes: convertToBase64(part.data) }
25225
+ source: getBedrockImageSource({
25226
+ data: part.data,
25227
+ functionality: "File URL data"
25228
+ })
25986
25229
  }
25987
25230
  });
25988
25231
  } else {
25232
+ if (part.data instanceof URL) {
25233
+ throw new UnsupportedFunctionalityError({
25234
+ functionality: "File URL data"
25235
+ });
25236
+ }
25989
25237
  if (!part.mediaType) {
25990
25238
  throw new UnsupportedFunctionalityError({
25991
25239
  functionality: "file without mime type",
@@ -26039,6 +25287,18 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
26039
25287
  }
26040
25288
  };
26041
25289
  }
25290
+ case "image-url": {
25291
+ const url2 = new URL(contentPart.url);
25292
+ return {
25293
+ image: {
25294
+ format: getBedrockImageFormatFromUrl(url2),
25295
+ source: getBedrockImageSource({
25296
+ data: url2,
25297
+ functionality: `tool result image URL "${contentPart.url}"`
25298
+ })
25299
+ }
25300
+ };
25301
+ }
26042
25302
  case "file-data": {
26043
25303
  if (!contentPart.mediaType.startsWith("image/")) {
26044
25304
  const enableCitations = await shouldEnableCitations(
@@ -26086,7 +25346,7 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
26086
25346
  break;
26087
25347
  case "execution-denied":
26088
25348
  toolResultContent = [
26089
- { text: (_a17 = output.reason) != null ? _a17 : "Tool execution denied." }
25349
+ { text: (_a17 = output.reason) != null ? _a17 : "Tool call execution denied." }
26090
25350
  ];
26091
25351
  break;
26092
25352
  case "json":
@@ -26179,7 +25439,7 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
26179
25439
  bedrockContent.push({
26180
25440
  toolUse: {
26181
25441
  toolUseId: normalizeToolCallId(part.toolCallId, isMistral),
26182
- name: part.toolName,
25442
+ name: sanitizeToolName(part.toolName),
26183
25443
  input: part.input
26184
25444
  }
26185
25445
  });
@@ -26292,6 +25552,12 @@ function mapBedrockFinishReason(finishReason, isJsonResponseFromTool) {
26292
25552
  return "other";
26293
25553
  }
26294
25554
  }
25555
+ function isCohereEmbeddingModel(modelId) {
25556
+ return modelId.includes("cohere.embed-");
25557
+ }
25558
+ function isNovaEmbeddingModel(modelId) {
25559
+ return modelId.startsWith("amazon.nova-") && modelId.includes("embed");
25560
+ }
26295
25561
  function getBase64Data(file2) {
26296
25562
  if (file2.type === "url") {
26297
25563
  throw new Error(
@@ -26526,22 +25792,23 @@ Original error: ${errorMessage}`
26526
25792
  provider.tools = import_internal.anthropicTools;
26527
25793
  return provider;
26528
25794
  }
26529
- var import_internal, import_eventstream_codec, import_util_utf8, import_internal2, BEDROCK_STOP_REASONS, BEDROCK_IMAGE_MIME_TYPES, BEDROCK_DOCUMENT_MIME_TYPES, bedrockFilePartProviderOptions, amazonBedrockLanguageModelOptions, BedrockErrorSchema, createBedrockEventStreamResponseHandler, bedrockReasoningMetadataSchema, BedrockChatLanguageModel, BedrockStopReasonSchema, BedrockAdditionalModelResponseFieldsSchema, BedrockToolUseSchema, BedrockReasoningTextSchema, BedrockRedactedReasoningSchema, BedrockResponseSchema, BedrockStreamSchema, amazonBedrockEmbeddingModelOptionsSchema, BedrockEmbeddingModel, BedrockEmbeddingResponseSchema, modelMaxImagesPerCall, BedrockImageModel, bedrockImageResponseSchema, VERSION2, bedrockRerankingResponseSchema, amazonBedrockRerankingModelOptionsSchema, BedrockRerankingModel, bedrock;
25795
+ var import_internal, import_internal2, import_eventstream_codec, import_util_utf8, import_internal3, BEDROCK_STOP_REASONS, BEDROCK_IMAGE_MIME_TYPES, BEDROCK_DOCUMENT_MIME_TYPES, bedrockFilePartProviderOptions, amazonBedrockLanguageModelOptions, MODELS_REJECTING_NEWER_SCHEMA_FIELDS, BedrockErrorSchema, createBedrockEventStreamResponseHandler, bedrockReasoningMetadataSchema, BedrockChatLanguageModel, JsonObjectTextExtractor, BedrockStopReasonSchema, BedrockAdditionalModelResponseFieldsSchema, BedrockToolUseSchema, BedrockReasoningTextSchema, BedrockRedactedReasoningSchema, BedrockResponseSchema, BedrockStreamSchema, amazonBedrockEmbeddingModelOptionsSchema, BedrockEmbeddingModel, BedrockEmbeddingResponseSchema, modelMaxImagesPerCall, BedrockImageModel, bedrockImageResponseSchema, VERSION2, bedrockRerankingResponseSchema, amazonBedrockRerankingModelOptionsSchema, BedrockRerankingModel, bedrock;
26530
25796
  var init_dist3 = __esm({
26531
25797
  "node_modules/@ai-sdk/amazon-bedrock/dist/index.mjs"() {
26532
25798
  import_internal = require("@ai-sdk/anthropic/internal");
26533
25799
  init_dist2();
26534
25800
  init_dist2();
25801
+ import_internal2 = require("@ai-sdk/anthropic/internal");
26535
25802
  init_v4();
26536
25803
  init_v4();
26537
25804
  init_v4();
26538
25805
  init_dist();
26539
25806
  init_dist2();
26540
- import_eventstream_codec = __toESM(require_dist_cjs5(), 1);
26541
- import_util_utf8 = __toESM(require_dist_cjs6(), 1);
25807
+ import_eventstream_codec = __toESM(require_dist_cjs2(), 1);
25808
+ import_util_utf8 = __toESM(require_dist_cjs3(), 1);
26542
25809
  init_dist();
26543
25810
  init_dist2();
26544
- import_internal2 = require("@ai-sdk/anthropic/internal");
25811
+ import_internal3 = require("@ai-sdk/anthropic/internal");
26545
25812
  init_dist();
26546
25813
  init_dist2();
26547
25814
  init_v4();
@@ -26631,6 +25898,13 @@ var init_dist3 = __esm({
26631
25898
  */
26632
25899
  serviceTier: external_exports.enum(["reserved", "priority", "default", "flex"]).optional()
26633
25900
  });
25901
+ MODELS_REJECTING_NEWER_SCHEMA_FIELDS = [
25902
+ "claude-opus-4-7",
25903
+ "claude-opus-4-8",
25904
+ "claude-opus-5",
25905
+ "claude-fable-5",
25906
+ "claude-sonnet-5"
25907
+ ];
26634
25908
  BedrockErrorSchema = external_exports.object({
26635
25909
  message: external_exports.string(),
26636
25910
  type: external_exports.string().nullish()
@@ -26684,7 +25958,7 @@ var init_dist3 = __esm({
26684
25958
  this.specificationVersion = "v3";
26685
25959
  this.provider = "amazon-bedrock";
26686
25960
  this.supportedUrls = {
26687
- // no supported urls for bedrock
25961
+ "image/*": [/^s3:\/\//]
26688
25962
  };
26689
25963
  }
26690
25964
  async getArgs({
@@ -26751,8 +26025,10 @@ var init_dist3 = __esm({
26751
26025
  }
26752
26026
  const isAnthropicModel = this.modelId.includes("anthropic");
26753
26027
  const isThinkingEnabled = ((_b16 = bedrockOptions.reasoningConfig) == null ? void 0 : _b16.type) === "enabled" || ((_c = bedrockOptions.reasoningConfig) == null ? void 0 : _c.type) === "adaptive";
26754
- const useNativeStructuredOutput = isAnthropicModel && isThinkingEnabled && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null;
26755
- const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useNativeStructuredOutput ? {
26028
+ const { supportsStructuredOutput: modelSupportsStructuredOutput } = (0, import_internal2.getModelCapabilities)(this.modelId);
26029
+ const useNativeStructuredOutput = isAnthropicModel && supportsNativeStructuredOutput(this.modelId) && (modelSupportsStructuredOutput || isThinkingEnabled) && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null;
26030
+ const useJsonInstructionForStructuredOutput = isAnthropicModel && !supportsStrictTools(this.modelId) && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && tools2 != null && tools2.length > 0;
26031
+ const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && !useNativeStructuredOutput && !useJsonInstructionForStructuredOutput ? {
26756
26032
  type: "function",
26757
26033
  name: "json",
26758
26034
  description: "Respond with a JSON object.",
@@ -26862,7 +26138,7 @@ var init_dist3 = __esm({
26862
26138
  ...(_k = bedrockOptions.additionalModelRequestFields) == null ? void 0 : _k.output_config,
26863
26139
  format: {
26864
26140
  type: "json_schema",
26865
- schema: responseFormat.schema
26141
+ schema: (0, import_internal2.sanitizeJsonSchema)(responseFormat.schema)
26866
26142
  }
26867
26143
  }
26868
26144
  };
@@ -26917,6 +26193,13 @@ var init_dist3 = __esm({
26917
26193
  });
26918
26194
  }
26919
26195
  }
26196
+ if (useJsonInstructionForStructuredOutput) {
26197
+ filteredPrompt = injectJsonInstructionIntoMessages({
26198
+ messages: filteredPrompt,
26199
+ schema: responseFormat.schema,
26200
+ schemaSuffix: "You MUST answer with only a JSON object that matches the JSON schema above. Do not wrap it in markdown fences or include any other text."
26201
+ });
26202
+ }
26920
26203
  const isMistral = isMistralModel(this.modelId);
26921
26204
  const { system, messages } = await convertToBedrockChatMessages(
26922
26205
  filteredPrompt,
@@ -26949,6 +26232,7 @@ var init_dist3 = __esm({
26949
26232
  ...toolConfig.tools !== void 0 && toolConfig.tools.length > 0 ? { toolConfig } : {}
26950
26233
  },
26951
26234
  warnings,
26235
+ usesJsonInstruction: useJsonInstructionForStructuredOutput,
26952
26236
  usesJsonResponseTool: jsonResponseTool != null,
26953
26237
  betas
26954
26238
  };
@@ -26959,10 +26243,11 @@ var init_dist3 = __esm({
26959
26243
  return combineHeaders(await resolve(this.config.headers), headers);
26960
26244
  }
26961
26245
  async doGenerate(options) {
26962
- var _a17, _b16, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
26246
+ var _a17, _b16, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
26963
26247
  const {
26964
26248
  command: args,
26965
26249
  warnings,
26250
+ usesJsonInstruction,
26966
26251
  usesJsonResponseTool
26967
26252
  } = await this.getArgs(options);
26968
26253
  const url2 = `${this.getUrl(this.modelId)}/converse`;
@@ -26985,9 +26270,13 @@ var init_dist3 = __esm({
26985
26270
  });
26986
26271
  const content = [];
26987
26272
  let isJsonResponseFromTool = false;
26273
+ const jsonObjectTextExtractor = usesJsonInstruction ? new JsonObjectTextExtractor() : void 0;
26988
26274
  for (const part of response.output.message.content) {
26989
26275
  if (part.text != null) {
26990
- content.push({ type: "text", text: part.text });
26276
+ content.push({
26277
+ type: "text",
26278
+ text: (_a17 = jsonObjectTextExtractor == null ? void 0 : jsonObjectTextExtractor.process(part.text)) != null ? _a17 : part.text
26279
+ });
26991
26280
  }
26992
26281
  if (part.reasoningContent) {
26993
26282
  if ("reasoningText" in part.reasoningContent) {
@@ -27009,7 +26298,7 @@ var init_dist3 = __esm({
27009
26298
  text: "",
27010
26299
  providerMetadata: {
27011
26300
  bedrock: {
27012
- redactedData: (_a17 = part.reasoningContent.redactedReasoning.data) != null ? _a17 : ""
26301
+ redactedData: (_b16 = part.reasoningContent.redactedReasoning.data) != null ? _b16 : ""
27013
26302
  }
27014
26303
  }
27015
26304
  });
@@ -27025,17 +26314,17 @@ var init_dist3 = __esm({
27025
26314
  });
27026
26315
  } else {
27027
26316
  const isMistral = isMistralModel(this.modelId);
27028
- const rawToolCallId = (_c = (_b16 = part.toolUse) == null ? void 0 : _b16.toolUseId) != null ? _c : this.config.generateId();
26317
+ const rawToolCallId = (_d = (_c = part.toolUse) == null ? void 0 : _c.toolUseId) != null ? _d : this.config.generateId();
27029
26318
  content.push({
27030
26319
  type: "tool-call",
27031
26320
  toolCallId: normalizeToolCallId(rawToolCallId, isMistral),
27032
- toolName: (_e = (_d = part.toolUse) == null ? void 0 : _d.name) != null ? _e : `tool-${this.config.generateId()}`,
27033
- input: JSON.stringify((_g = (_f = part.toolUse) == null ? void 0 : _f.input) != null ? _g : {})
26321
+ toolName: (_f = (_e = part.toolUse) == null ? void 0 : _e.name) != null ? _f : `tool-${this.config.generateId()}`,
26322
+ input: JSON.stringify((_h = (_g = part.toolUse) == null ? void 0 : _g.input) != null ? _h : {})
27034
26323
  });
27035
26324
  }
27036
26325
  }
27037
26326
  }
27038
- const stopSequence = (_j = (_i = (_h = response.additionalModelResponseFields) == null ? void 0 : _h.delta) == null ? void 0 : _i.stop_sequence) != null ? _j : null;
26327
+ const stopSequence = (_k = (_j = (_i = response.additionalModelResponseFields) == null ? void 0 : _i.delta) == null ? void 0 : _j.stop_sequence) != null ? _k : null;
27039
26328
  const providerMetadata = response.trace || response.usage || response.performanceConfig || response.serviceTier || isJsonResponseFromTool || stopSequence ? {
27040
26329
  bedrock: {
27041
26330
  ...response.trace && typeof response.trace === "object" ? { trace: response.trace } : {},
@@ -27045,7 +26334,7 @@ var init_dist3 = __esm({
27045
26334
  ...response.serviceTier && {
27046
26335
  serviceTier: response.serviceTier
27047
26336
  },
27048
- ...(((_k = response.usage) == null ? void 0 : _k.cacheWriteInputTokens) != null || ((_l = response.usage) == null ? void 0 : _l.cacheDetails) != null) && {
26337
+ ...(((_l = response.usage) == null ? void 0 : _l.cacheWriteInputTokens) != null || ((_m = response.usage) == null ? void 0 : _m.cacheDetails) != null) && {
27049
26338
  usage: {
27050
26339
  ...response.usage.cacheWriteInputTokens != null && {
27051
26340
  cacheWriteInputTokens: response.usage.cacheWriteInputTokens
@@ -27066,16 +26355,17 @@ var init_dist3 = __esm({
27066
26355
  response.stopReason,
27067
26356
  isJsonResponseFromTool
27068
26357
  ),
27069
- raw: (_m = response.stopReason) != null ? _m : void 0
26358
+ raw: (_n = response.stopReason) != null ? _n : void 0
27070
26359
  },
27071
26360
  usage: convertBedrockUsage(response.usage),
27072
26361
  response: {
27073
- id: (_n = responseHeaders == null ? void 0 : responseHeaders["x-amzn-requestid"]) != null ? _n : void 0,
26362
+ id: (_o = responseHeaders == null ? void 0 : responseHeaders["x-amzn-requestid"]) != null ? _o : void 0,
27074
26363
  timestamp: (responseHeaders == null ? void 0 : responseHeaders["date"]) != null ? new Date(responseHeaders["date"]) : void 0,
27075
26364
  modelId: this.modelId,
27076
26365
  headers: responseHeaders
27077
26366
  },
27078
26367
  warnings,
26368
+ request: { body: args },
27079
26369
  ...providerMetadata && { providerMetadata }
27080
26370
  };
27081
26371
  }
@@ -27083,6 +26373,7 @@ var init_dist3 = __esm({
27083
26373
  const {
27084
26374
  command: args,
27085
26375
  warnings,
26376
+ usesJsonInstruction,
27086
26377
  usesJsonResponseTool
27087
26378
  } = await this.getArgs(options);
27088
26379
  const modelId = this.modelId;
@@ -27108,6 +26399,7 @@ var init_dist3 = __esm({
27108
26399
  let providerMetadata = void 0;
27109
26400
  let isJsonResponseFromTool = false;
27110
26401
  let stopSequence = null;
26402
+ const jsonObjectTextExtractor = usesJsonInstruction ? new JsonObjectTextExtractor() : void 0;
27111
26403
  const contentBlocks = {};
27112
26404
  return {
27113
26405
  stream: response.pipeThrough(
@@ -27123,7 +26415,7 @@ var init_dist3 = __esm({
27123
26415
  });
27124
26416
  },
27125
26417
  transform(chunk, controller) {
27126
- var _a17, _b16, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
26418
+ var _a17, _b16, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
27127
26419
  function enqueueError(bedrockError) {
27128
26420
  finishReason = { unified: "error", raw: void 0 };
27129
26421
  controller.enqueue({ type: "error", error: bedrockError });
@@ -27211,13 +26503,18 @@ var init_dist3 = __esm({
27211
26503
  id: String(blockIndex)
27212
26504
  });
27213
26505
  }
27214
- controller.enqueue({
27215
- type: "text-delta",
27216
- id: String(blockIndex),
27217
- delta: value.contentBlockDelta.delta.text
27218
- });
26506
+ const textDelta = (_m = jsonObjectTextExtractor == null ? void 0 : jsonObjectTextExtractor.process(
26507
+ value.contentBlockDelta.delta.text
26508
+ )) != null ? _m : value.contentBlockDelta.delta.text;
26509
+ if (textDelta.length > 0) {
26510
+ controller.enqueue({
26511
+ type: "text-delta",
26512
+ id: String(blockIndex),
26513
+ delta: textDelta
26514
+ });
26515
+ }
27219
26516
  }
27220
- if (((_m = value.contentBlockStop) == null ? void 0 : _m.contentBlockIndex) != null) {
26517
+ if (((_n = value.contentBlockStop) == null ? void 0 : _n.contentBlockIndex) != null) {
27221
26518
  const blockIndex = value.contentBlockStop.contentBlockIndex;
27222
26519
  const contentBlock = contentBlocks[blockIndex];
27223
26520
  if (contentBlock != null) {
@@ -27263,7 +26560,7 @@ var init_dist3 = __esm({
27263
26560
  delete contentBlocks[blockIndex];
27264
26561
  }
27265
26562
  }
27266
- if (((_n = value.contentBlockDelta) == null ? void 0 : _n.delta) && "reasoningContent" in value.contentBlockDelta.delta && value.contentBlockDelta.delta.reasoningContent) {
26563
+ if (((_o = value.contentBlockDelta) == null ? void 0 : _o.delta) && "reasoningContent" in value.contentBlockDelta.delta && value.contentBlockDelta.delta.reasoningContent) {
27267
26564
  const blockIndex = value.contentBlockDelta.contentBlockIndex || 0;
27268
26565
  const reasoningContent = value.contentBlockDelta.delta.reasoningContent;
27269
26566
  if ("text" in reasoningContent && reasoningContent.text) {
@@ -27318,7 +26615,7 @@ var init_dist3 = __esm({
27318
26615
  }
27319
26616
  }
27320
26617
  const contentBlockStart = value.contentBlockStart;
27321
- if (((_o = contentBlockStart == null ? void 0 : contentBlockStart.start) == null ? void 0 : _o.toolUse) != null) {
26618
+ if (((_p = contentBlockStart == null ? void 0 : contentBlockStart.start) == null ? void 0 : _p.toolUse) != null) {
27322
26619
  const toolUse = contentBlockStart.start.toolUse;
27323
26620
  const blockIndex = contentBlockStart.contentBlockIndex;
27324
26621
  const isJsonResponseTool = usesJsonResponseTool && toolUse.name === "json";
@@ -27346,7 +26643,7 @@ var init_dist3 = __esm({
27346
26643
  const blockIndex = contentBlockDelta.contentBlockIndex;
27347
26644
  const contentBlock = contentBlocks[blockIndex];
27348
26645
  if ((contentBlock == null ? void 0 : contentBlock.type) === "tool-call") {
27349
- const delta = (_p = contentBlockDelta.delta.toolUse.input) != null ? _p : "";
26646
+ const delta = (_q = contentBlockDelta.delta.toolUse.input) != null ? _q : "";
27350
26647
  if (!contentBlock.isJsonResponseTool) {
27351
26648
  controller.enqueue({
27352
26649
  type: "tool-input-delta",
@@ -27388,13 +26685,63 @@ var init_dist3 = __esm({
27388
26685
  }
27389
26686
  })
27390
26687
  ),
27391
- // TODO request?
26688
+ request: { body: args },
27392
26689
  response: { headers: responseHeaders }
27393
26690
  };
27394
26691
  }
27395
26692
  getUrl(modelId) {
27396
- const encodedModelId = encodeURIComponent(modelId);
27397
- return `${this.config.baseUrl()}/model/${encodedModelId}`;
26693
+ return `${this.config.baseUrl()}/model/${encodeURIComponent(modelId)}`;
26694
+ }
26695
+ };
26696
+ JsonObjectTextExtractor = class {
26697
+ constructor() {
26698
+ this.started = false;
26699
+ this.completed = false;
26700
+ this.depth = 0;
26701
+ this.inString = false;
26702
+ this.escaped = false;
26703
+ }
26704
+ process(text) {
26705
+ let result = "";
26706
+ for (const character of text) {
26707
+ if (this.completed) {
26708
+ break;
26709
+ }
26710
+ if (!this.started) {
26711
+ if (character !== "{") {
26712
+ continue;
26713
+ }
26714
+ this.started = true;
26715
+ this.depth = 1;
26716
+ result += character;
26717
+ continue;
26718
+ }
26719
+ result += character;
26720
+ if (this.escaped) {
26721
+ this.escaped = false;
26722
+ continue;
26723
+ }
26724
+ if (character === "\\" && this.inString) {
26725
+ this.escaped = true;
26726
+ continue;
26727
+ }
26728
+ if (character === '"') {
26729
+ this.inString = !this.inString;
26730
+ continue;
26731
+ }
26732
+ if (this.inString) {
26733
+ continue;
26734
+ }
26735
+ if (character === "{") {
26736
+ this.depth++;
26737
+ } else if (character === "}") {
26738
+ this.depth--;
26739
+ if (this.depth === 0) {
26740
+ this.completed = true;
26741
+ }
26742
+ }
26743
+ }
26744
+ return result;
27398
26745
  }
27399
26746
  };
27400
26747
  BedrockStopReasonSchema = external_exports.union([
@@ -27559,9 +26906,11 @@ var init_dist3 = __esm({
27559
26906
  this.config = config2;
27560
26907
  this.specificationVersion = "v3";
27561
26908
  this.provider = "amazon-bedrock";
27562
- this.maxEmbeddingsPerCall = 1;
27563
26909
  this.supportsParallelCalls = true;
27564
26910
  }
26911
+ get maxEmbeddingsPerCall() {
26912
+ return isCohereEmbeddingModel(this.modelId) ? 96 : 1;
26913
+ }
27565
26914
  getUrl(modelId) {
27566
26915
  const encodedModelId = encodeURIComponent(modelId);
27567
26916
  return `${this.config.baseUrl()}/model/${encodedModelId}/invoke`;
@@ -27586,8 +26935,8 @@ var init_dist3 = __esm({
27586
26935
  providerOptions,
27587
26936
  schema: amazonBedrockEmbeddingModelOptionsSchema
27588
26937
  })) != null ? _a17 : {};
27589
- const isNovaModel = this.modelId.startsWith("amazon.nova-") && this.modelId.includes("embed");
27590
- const isCohereModel = this.modelId.includes("cohere.embed-");
26938
+ const isNovaModel = isNovaEmbeddingModel(this.modelId);
26939
+ const isCohereModel = isCohereEmbeddingModel(this.modelId);
27591
26940
  const args = isNovaModel ? {
27592
26941
  taskType: "SINGLE_EMBEDDING",
27593
26942
  singleEmbeddingParams: {
@@ -27602,7 +26951,7 @@ var init_dist3 = __esm({
27602
26951
  // Cohere embedding models on Bedrock require `input_type`.
27603
26952
  // Without it, the service attempts other schema branches and rejects the request.
27604
26953
  input_type: (_e = bedrockOptions.inputType) != null ? _e : "search_query",
27605
- texts: [values2[0]],
26954
+ texts: values2,
27606
26955
  truncate: bedrockOptions.truncate,
27607
26956
  output_dimension: bedrockOptions.outputDimension
27608
26957
  } : {
@@ -27627,25 +26976,25 @@ var init_dist3 = __esm({
27627
26976
  fetch: this.config.fetch,
27628
26977
  abortSignal
27629
26978
  });
27630
- let embedding;
26979
+ let embeddings;
27631
26980
  if ("embedding" in response) {
27632
- embedding = response.embedding;
26981
+ embeddings = [response.embedding];
27633
26982
  } else if (Array.isArray(response.embeddings)) {
27634
26983
  const firstEmbedding = response.embeddings[0];
27635
26984
  if (typeof firstEmbedding === "object" && firstEmbedding !== null && "embeddingType" in firstEmbedding) {
27636
- embedding = firstEmbedding.embedding;
26985
+ embeddings = [firstEmbedding.embedding];
27637
26986
  } else {
27638
- embedding = firstEmbedding;
26987
+ embeddings = response.embeddings;
27639
26988
  }
27640
26989
  } else {
27641
- embedding = response.embeddings.float[0];
26990
+ embeddings = response.embeddings.float;
27642
26991
  }
27643
26992
  const headerTokenCount = Number(
27644
26993
  responseHeaders == null ? void 0 : responseHeaders["x-amzn-bedrock-input-token-count"]
27645
26994
  );
27646
26995
  const tokens = "inputTextTokenCount" in response ? response.inputTextTokenCount : "inputTokenCount" in response ? (_f = response.inputTokenCount) != null ? _f : 0 : headerTokenCount;
27647
26996
  return {
27648
- embeddings: [embedding],
26997
+ embeddings,
27649
26998
  usage: { tokens },
27650
26999
  warnings: []
27651
27000
  };
@@ -27866,7 +27215,7 @@ var init_dist3 = __esm({
27866
27215
  details: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
27867
27216
  preview: external_exports.unknown().optional()
27868
27217
  });
27869
- VERSION2 = true ? "4.0.116" : "0.0.0-test";
27218
+ VERSION2 = true ? "4.0.145" : "0.0.0-test";
27870
27219
  bedrockRerankingResponseSchema = lazySchema(
27871
27220
  () => zodSchema(
27872
27221
  external_exports.object({
@@ -28171,7 +27520,7 @@ function tryConvertToString(arr) {
28171
27520
  if (!isValidUTF8(arr)) {
28172
27521
  return void 0;
28173
27522
  }
28174
- return textDecoder.decode(arr);
27523
+ return textDecoder2.decode(arr);
28175
27524
  }
28176
27525
  function compareUint8Arrays(a, b) {
28177
27526
  const len = Math.min(a.length, b.length);
@@ -28182,13 +27531,13 @@ function compareUint8Arrays(a, b) {
28182
27531
  }
28183
27532
  return a.length - b.length;
28184
27533
  }
28185
- var isAscii, HIGH_SURROGATE_START, HIGH_SURROGATE_END, textDecoder;
27534
+ var isAscii, HIGH_SURROGATE_START, HIGH_SURROGATE_END, textDecoder2;
28186
27535
  var init_utfUtil = __esm({
28187
27536
  "node_modules/gpt-tokenizer/esm/utfUtil.js"() {
28188
27537
  isAscii = (codePoint) => codePoint <= 127;
28189
27538
  HIGH_SURROGATE_START = 55296;
28190
27539
  HIGH_SURROGATE_END = 56319;
28191
- textDecoder = new TextDecoder("utf8", { fatal: false });
27540
+ textDecoder2 = new TextDecoder("utf8", { fatal: false });
28192
27541
  }
28193
27542
  });
28194
27543
 
@@ -32423,6 +31772,8 @@ var require_brace_expansion = __commonJS({
32423
31772
  var escClose = "\0CLOSE" + Math.random() + "\0";
32424
31773
  var escComma = "\0COMMA" + Math.random() + "\0";
32425
31774
  var escPeriod = "\0PERIOD" + Math.random() + "\0";
31775
+ var EXPANSION_MAX = 1e5;
31776
+ var EXPANSION_MAX_LENGTH = 4e6;
32426
31777
  function numeric(str) {
32427
31778
  return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
32428
31779
  }
@@ -32456,11 +31807,12 @@ var require_brace_expansion = __commonJS({
32456
31807
  if (!str)
32457
31808
  return [];
32458
31809
  options = options || {};
32459
- var max = options.max == null ? Infinity : options.max;
31810
+ var max = options.max == null ? EXPANSION_MAX : options.max;
31811
+ var maxLength = options.maxLength == null ? EXPANSION_MAX_LENGTH : options.maxLength;
32460
31812
  if (str.substr(0, 2) === "{}") {
32461
31813
  str = "\\{\\}" + str.substr(2);
32462
31814
  }
32463
- return expand2(escapeBraces(str), max, true).map(unescapeBraces);
31815
+ return expand2(escapeBraces(str), max, maxLength, true).map(unescapeBraces);
32464
31816
  }
32465
31817
  function embrace(str) {
32466
31818
  return "{" + str + "}";
@@ -32474,18 +31826,90 @@ var require_brace_expansion = __commonJS({
32474
31826
  function gte(i, y) {
32475
31827
  return i >= y;
32476
31828
  }
32477
- function expand2(str, max, isTop) {
32478
- var expansions = [];
32479
- var m = balanced("{", "}", str);
32480
- if (!m) return [str];
32481
- var pre = m.pre;
32482
- var post = m.post.length ? expand2(m.post, max, false) : [""];
32483
- if (/\$$/.test(m.pre)) {
32484
- for (var k = 0; k < post.length && k < max; k++) {
32485
- var expansion = pre + "{" + m.body + "}" + post[k];
32486
- expansions.push(expansion);
31829
+ function combine(acc, pre, values2, max, maxLength, dropEmpties) {
31830
+ var out = [];
31831
+ var length = 0;
31832
+ for (var a = 0; a < acc.length; a++) {
31833
+ for (var v = 0; v < values2.length; v++) {
31834
+ if (out.length >= max) return out;
31835
+ var expansion = acc[a] + pre + values2[v];
31836
+ if (dropEmpties && !expansion) continue;
31837
+ if (length + expansion.length > maxLength) return out;
31838
+ out.push(expansion);
31839
+ length += expansion.length;
31840
+ }
31841
+ }
31842
+ return out;
31843
+ }
31844
+ function expandSequence(body, isAlphaSequence, max, maxLength) {
31845
+ var n = body.split(/\.\./);
31846
+ var N = [];
31847
+ if (n[0] === void 0 || n[1] === void 0) {
31848
+ return N;
31849
+ }
31850
+ var x = numeric(n[0]);
31851
+ var y = numeric(n[1]);
31852
+ var width = Math.max(n[0].length, n[1].length);
31853
+ var incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
31854
+ var test = lte;
31855
+ var reverse = y < x;
31856
+ if (reverse) {
31857
+ incr *= -1;
31858
+ test = gte;
31859
+ }
31860
+ var pad = n.some(isPadded);
31861
+ var length = 0;
31862
+ for (var i = x; test(i, y) && N.length < max; i += incr) {
31863
+ var c;
31864
+ if (isAlphaSequence) {
31865
+ c = String.fromCharCode(i);
31866
+ if (c === "\\") {
31867
+ c = "";
31868
+ }
31869
+ } else {
31870
+ c = String(i);
31871
+ if (pad) {
31872
+ var need = width - c.length;
31873
+ if (need > 0) {
31874
+ var z = new Array(need + 1).join("0");
31875
+ if (i < 0) {
31876
+ c = "-" + z + c.slice(1);
31877
+ } else {
31878
+ c = z + c;
31879
+ }
31880
+ }
31881
+ }
31882
+ }
31883
+ if (length + c.length > maxLength) break;
31884
+ N.push(c);
31885
+ length += c.length;
31886
+ }
31887
+ return N;
31888
+ }
31889
+ function expand2(str, max, maxLength, isTop) {
31890
+ var acc = [""];
31891
+ var dropEmpties = false;
31892
+ var firstGroup = true;
31893
+ for (; ; ) {
31894
+ const m = balanced("{", "}", str);
31895
+ if (!m) {
31896
+ return combine(acc, str, [""], max, maxLength, dropEmpties);
31897
+ }
31898
+ const pre = m.pre;
31899
+ if (/\$$/.test(pre)) {
31900
+ acc = combine(
31901
+ acc,
31902
+ pre + "{" + m.body + "}",
31903
+ [""],
31904
+ max,
31905
+ maxLength,
31906
+ dropEmpties && !m.post.length
31907
+ );
31908
+ firstGroup = false;
31909
+ if (!m.post.length) break;
31910
+ str = m.post;
31911
+ continue;
32487
31912
  }
32488
- } else {
32489
31913
  var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
32490
31914
  var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
32491
31915
  var isSequence = isNumericSequence || isAlphaSequence;
@@ -32493,74 +31917,69 @@ var require_brace_expansion = __commonJS({
32493
31917
  if (!isSequence && !isOptions) {
32494
31918
  if (m.post.match(/,(?!,).*\}/)) {
32495
31919
  str = m.pre + "{" + m.body + escClose + m.post;
32496
- return expand2(str, max, true);
31920
+ isTop = true;
31921
+ continue;
32497
31922
  }
32498
- return [str];
31923
+ return combine(
31924
+ acc,
31925
+ pre + "{" + m.body + "}" + m.post,
31926
+ [""],
31927
+ max,
31928
+ maxLength,
31929
+ dropEmpties
31930
+ );
31931
+ }
31932
+ if (firstGroup) {
31933
+ dropEmpties = isTop && !isSequence;
31934
+ firstGroup = false;
32499
31935
  }
32500
- var n;
31936
+ var values2;
32501
31937
  if (isSequence) {
32502
- n = m.body.split(/\.\./);
31938
+ values2 = expandSequence(m.body, isAlphaSequence, max, maxLength);
32503
31939
  } else {
32504
- n = parseCommaParts(m.body);
32505
- if (n.length === 1) {
32506
- n = expand2(n[0], max, false).map(embrace);
31940
+ var n = parseCommaParts(m.body);
31941
+ if (n.length === 1 && n[0] !== void 0) {
31942
+ n = expand2(n[0], max, maxLength, false).map(embrace);
32507
31943
  if (n.length === 1) {
32508
- return post.map(function(p) {
32509
- return m.pre + n[0] + p;
32510
- });
31944
+ acc = combine(
31945
+ acc,
31946
+ pre + n[0],
31947
+ [""],
31948
+ max,
31949
+ maxLength,
31950
+ dropEmpties && !m.post.length
31951
+ );
31952
+ if (!m.post.length) break;
31953
+ str = m.post;
31954
+ continue;
32511
31955
  }
32512
31956
  }
32513
- }
32514
- var N;
32515
- if (isSequence) {
32516
- var x = numeric(n[0]);
32517
- var y = numeric(n[1]);
32518
- var width = Math.max(n[0].length, n[1].length);
32519
- var incr = n.length == 3 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
32520
- var test = lte;
32521
- var reverse = y < x;
32522
- if (reverse) {
32523
- incr *= -1;
32524
- test = gte;
32525
- }
32526
- var pad = n.some(isPadded);
32527
- N = [];
32528
- for (var i = x; test(i, y) && N.length < max; i += incr) {
32529
- var c;
32530
- if (isAlphaSequence) {
32531
- c = String.fromCharCode(i);
32532
- if (c === "\\")
32533
- c = "";
32534
- } else {
32535
- c = String(i);
32536
- if (pad) {
32537
- var need = width - c.length;
32538
- if (need > 0) {
32539
- var z = new Array(need + 1).join("0");
32540
- if (i < 0)
32541
- c = "-" + z + c.slice(1);
32542
- else
32543
- c = z + c;
32544
- }
32545
- }
31957
+ var dropsEmpties = dropEmpties && !m.post.length && !pre;
31958
+ for (var d = 0; dropsEmpties && d < acc.length; d++) {
31959
+ if (acc[d]) {
31960
+ dropsEmpties = false;
32546
31961
  }
32547
- N.push(c);
32548
31962
  }
32549
- } else {
32550
- N = [];
32551
- for (var j = 0; j < n.length; j++) {
32552
- N.push.apply(N, expand2(n[j], max, false));
32553
- }
32554
- }
32555
- for (var j = 0; j < N.length; j++) {
32556
- for (var k = 0; k < post.length && expansions.length < max; k++) {
32557
- var expansion = pre + N[j] + post[k];
32558
- if (!isTop || isSequence || expansion)
32559
- expansions.push(expansion);
31963
+ values2 = [];
31964
+ var valuesLength = 0;
31965
+ outer: for (var j = 0; j < n.length; j++) {
31966
+ var expanded = expand2(n[j], max, maxLength, false);
31967
+ for (var k = 0; k < expanded.length; k++) {
31968
+ var v = expanded[k];
31969
+ if (dropsEmpties && !v) continue;
31970
+ if (values2.length >= max || valuesLength + v.length > maxLength) {
31971
+ break outer;
31972
+ }
31973
+ values2.push(v);
31974
+ valuesLength += v.length;
31975
+ }
32560
31976
  }
32561
31977
  }
31978
+ acc = combine(acc, pre, values2, max, maxLength, dropEmpties && !m.post.length);
31979
+ if (!m.post.length) break;
31980
+ str = m.post;
32562
31981
  }
32563
- return expansions;
31982
+ return acc;
32564
31983
  }
32565
31984
  }
32566
31985
  });
@@ -73833,6 +73252,7 @@ var require_fast_uri = __commonJS({
73833
73252
  return uriTokens.join("");
73834
73253
  }
73835
73254
  var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
73255
+ var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/;
73836
73256
  function getParseError(parsed, matches) {
73837
73257
  if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
73838
73258
  return 'URI path must start with "/" when authority is present.';
@@ -73862,6 +73282,11 @@ var require_fast_uri = __commonJS({
73862
73282
  uri = "//" + uri;
73863
73283
  }
73864
73284
  }
73285
+ const authorityMatch = uri.match(AUTHORITY_PREFIX);
73286
+ if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) {
73287
+ parsed.error = "URI authority must not contain a literal backslash.";
73288
+ malformedAuthorityOrPort = true;
73289
+ }
73865
73290
  const matches = uri.match(URI_PARSE);
73866
73291
  if (matches) {
73867
73292
  parsed.scheme = matches[1];
@@ -73905,7 +73330,7 @@ var require_fast_uri = __commonJS({
73905
73330
  if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
73906
73331
  if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
73907
73332
  try {
73908
- parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
73333
+ parsed.host = new URL("http://" + parsed.host).hostname;
73909
73334
  } catch (e) {
73910
73335
  parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
73911
73336
  }
@@ -78631,11 +78056,11 @@ function createHttpTransport(url2) {
78631
78056
  }
78632
78057
  };
78633
78058
  }
78634
- var import_client2, import_stdio, import_sse, import_websocket, MCPClientManager;
78635
- var init_client2 = __esm({
78059
+ var import_client, import_stdio, import_sse, import_websocket, MCPClientManager;
78060
+ var init_client = __esm({
78636
78061
  "src/agent/mcp/client.js"() {
78637
78062
  "use strict";
78638
- import_client2 = require("@modelcontextprotocol/sdk/client/index.js");
78063
+ import_client = require("@modelcontextprotocol/sdk/client/index.js");
78639
78064
  import_stdio = require("@modelcontextprotocol/sdk/client/stdio.js");
78640
78065
  import_sse = require("@modelcontextprotocol/sdk/client/sse.js");
78641
78066
  import_websocket = require("@modelcontextprotocol/sdk/client/websocket.js");
@@ -78746,7 +78171,7 @@ var init_client2 = __esm({
78746
78171
  console.error(`[MCP DEBUG] Connecting to ${name15} via ${serverConfig.transport}...`);
78747
78172
  }
78748
78173
  const transport = createTransport(serverConfig);
78749
- const client = new import_client2.Client(
78174
+ const client = new import_client.Client(
78750
78175
  {
78751
78176
  name: `probe-client-${name15}`,
78752
78177
  version: "1.0.0"
@@ -79129,7 +78554,7 @@ var MCPXmlBridge;
79129
78554
  var init_xmlBridge = __esm({
79130
78555
  "src/agent/mcp/xmlBridge.js"() {
79131
78556
  "use strict";
79132
- init_client2();
78557
+ init_client();
79133
78558
  init_config2();
79134
78559
  MCPXmlBridge = class {
79135
78560
  constructor(options = {}) {
@@ -79256,10 +78681,10 @@ var init_xmlBridge = __esm({
79256
78681
  var init_mcp = __esm({
79257
78682
  "src/agent/mcp/index.js"() {
79258
78683
  "use strict";
79259
- init_client2();
78684
+ init_client();
79260
78685
  init_config2();
79261
78686
  init_xmlBridge();
79262
- init_client2();
78687
+ init_client();
79263
78688
  init_config2();
79264
78689
  init_xmlBridge();
79265
78690
  }
@@ -88843,16 +88268,38 @@ var require_executor = __commonJS({
88843
88268
  });
88844
88269
  addOps(39, (exec6, done, ticks, a, b, obj, context, scope, bobj, inLoopOrSwitch) => {
88845
88270
  const [exception, catchBody, finallyBody] = b;
88846
- executeTreeWithDone(exec6, (err, res) => {
88847
- executeTreeWithDone(exec6, (e) => {
88848
- if (e)
88849
- done(e);
88850
- else if (err) {
88851
- executeTreeWithDone(exec6, done, ticks, context, catchBody, [new utils.Scope(scope)], inLoopOrSwitch);
88271
+ executeTreeWithDone(exec6, (tryErr, tryRes) => {
88272
+ const afterTryCatch = (resultErr, resultRes) => {
88273
+ executeTreeWithDone(exec6, (finallyErr) => {
88274
+ if (finallyErr)
88275
+ done(finallyErr);
88276
+ else if (resultErr)
88277
+ done(resultErr);
88278
+ else if (resultRes instanceof ExecReturn && (resultRes.returned || resultRes.breakLoop || resultRes.continueLoop)) {
88279
+ done(void 0, resultRes);
88280
+ } else {
88281
+ done();
88282
+ }
88283
+ }, ticks, context, finallyBody, [new utils.Scope(scope, {})]);
88284
+ };
88285
+ if (tryErr) {
88286
+ if (catchBody) {
88287
+ const sc = {};
88288
+ if (exception)
88289
+ sc[exception] = tryErr;
88290
+ executeTreeWithDone(exec6, (catchErr, catchRes) => {
88291
+ if (catchErr) {
88292
+ afterTryCatch(catchErr, void 0);
88293
+ } else {
88294
+ afterTryCatch(void 0, catchRes);
88295
+ }
88296
+ }, ticks, context, catchBody, [new utils.Scope(scope, sc)], inLoopOrSwitch);
88852
88297
  } else {
88853
- done(void 0, res);
88298
+ afterTryCatch(tryErr, void 0);
88854
88299
  }
88855
- }, ticks, context, finallyBody, [new utils.Scope(scope, {})]);
88300
+ } else {
88301
+ afterTryCatch(void 0, tryRes);
88302
+ }
88856
88303
  }, ticks, context, a, [new utils.Scope(scope)], inLoopOrSwitch);
88857
88304
  });
88858
88305
  addOps(88, (exec6, done) => {
@@ -90241,7 +89688,7 @@ var require_parser2 = __commonJS({
90241
89688
  let offset2 = 0;
90242
89689
  if (catchRes[1].startsWith("catch")) {
90243
89690
  catchRes = catchReg.exec(part.substring(res[0].length + body.length + 1).toString());
90244
- exception = catchRes[2];
89691
+ exception = catchRes[3] || "";
90245
89692
  catchBody = restOfExp(constants, part.substring(res[0].length + body.length + 1 + catchRes[0].length), [], "{");
90246
89693
  offset2 = res[0].length + body.length + 1 + catchRes[0].length + catchBody.length + 1;
90247
89694
  if ((catchRes = catchReg.exec(part.substring(offset2).toString())) && catchRes[1].startsWith("finally")) {
@@ -90252,7 +89699,7 @@ var require_parser2 = __commonJS({
90252
89699
  }
90253
89700
  const b = [
90254
89701
  exception,
90255
- lispifyBlock(insertSemicolons(constants, catchBody || emptyString), constants),
89702
+ catchBody !== void 0 ? lispifyBlock(insertSemicolons(constants, catchBody || emptyString), constants) : null,
90256
89703
  lispifyBlock(insertSemicolons(constants, finallyBody || emptyString), constants)
90257
89704
  ];
90258
89705
  ctx.lispTree = createLisp({
@@ -91474,6 +90921,11 @@ var init_acorn = __esm({
91474
90921
  // line being 1-based and column 0-based) will be attached to the
91475
90922
  // nodes.
91476
90923
  locations: false,
90924
+ // Pass an optional `{line, column}` object to use for the start of
90925
+ // the parse. This is mostly useful when using `parseExpressionAt`
90926
+ // with `locations: true`, to prevent the parser from having to
90927
+ // determine the line position at the start position.
90928
+ startLocation: null,
91477
90929
  // A function can be passed as `onToken` option, which will
91478
90930
  // cause Acorn to call that function with object in the same
91479
90931
  // format as tokens returned from `tokenizer().getToken()`. Note
@@ -91554,13 +91006,18 @@ var init_acorn = __esm({
91554
91006
  this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind);
91555
91007
  this.input = String(input);
91556
91008
  this.containsEsc = false;
91557
- if (startPos) {
91558
- this.pos = startPos;
91009
+ this.pos = startPos || 0;
91010
+ this.curLine = 1;
91011
+ if (options.startLocation) {
91012
+ this.lineStart = this.pos - options.startLocation.column;
91013
+ this.curLine = options.startLocation.line;
91014
+ } else if (startPos) {
91559
91015
  this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
91560
- this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
91016
+ if (this.options.locations) {
91017
+ this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
91018
+ }
91561
91019
  } else {
91562
- this.pos = this.lineStart = 0;
91563
- this.curLine = 1;
91020
+ this.lineStart = 0;
91564
91021
  }
91565
91022
  this.type = types$1.eof;
91566
91023
  this.value = null;
@@ -93579,7 +93036,7 @@ var init_acorn = __esm({
93579
93036
  expr = this.finishNode(node$1, "UpdateExpression");
93580
93037
  }
93581
93038
  }
93582
- if (!incDec && this.eat(types$1.starstar)) {
93039
+ if (!incDec && !(expr.type === "ArrowFunctionExpression" && expr.start === startPos) && this.eat(types$1.starstar)) {
93583
93040
  if (sawUnary) {
93584
93041
  this.unexpected(this.lastTokStart);
93585
93042
  } else {
@@ -96632,7 +96089,7 @@ var init_acorn = __esm({
96632
96089
  }
96633
96090
  return this.finishToken(type, word);
96634
96091
  };
96635
- version2 = "8.17.0";
96092
+ version2 = "8.18.0";
96636
96093
  Parser2.acorn = {
96637
96094
  Parser: Parser2,
96638
96095
  version: version2,
@@ -100198,7 +99655,7 @@ var init_executePlan = __esm({
100198
99655
  });
100199
99656
 
100200
99657
  // src/agent/mcp/built-in-server.js
100201
- var import_http, import_events2, import_crypto5, import_server, import_sse2, import_streamableHttp, import_types4, InMemoryEventStore, BuiltInMCPServer;
99658
+ var import_http, import_events2, import_crypto5, import_server, import_sse2, import_streamableHttp, import_types5, InMemoryEventStore, BuiltInMCPServer;
100202
99659
  var init_built_in_server = __esm({
100203
99660
  "src/agent/mcp/built-in-server.js"() {
100204
99661
  "use strict";
@@ -100208,7 +99665,7 @@ var init_built_in_server = __esm({
100208
99665
  import_server = require("@modelcontextprotocol/sdk/server/index.js");
100209
99666
  import_sse2 = require("@modelcontextprotocol/sdk/server/sse.js");
100210
99667
  import_streamableHttp = require("@modelcontextprotocol/sdk/server/streamableHttp.js");
100211
- import_types4 = require("@modelcontextprotocol/sdk/types.js");
99668
+ import_types5 = require("@modelcontextprotocol/sdk/types.js");
100212
99669
  InMemoryEventStore = class {
100213
99670
  constructor() {
100214
99671
  this.events = /* @__PURE__ */ new Map();
@@ -100442,7 +99899,7 @@ var init_built_in_server = __esm({
100442
99899
  if (this.debug) {
100443
99900
  console.log(`[MCP] Reusing existing transport for session: ${sessionId}`);
100444
99901
  }
100445
- } else if (!sessionId && method === "POST" && body && (0, import_types4.isInitializeRequest)(body)) {
99902
+ } else if (!sessionId && method === "POST" && body && (0, import_types5.isInitializeRequest)(body)) {
100446
99903
  if (this.debug) {
100447
99904
  console.log("[MCP] Creating new Streamable HTTP transport for initialization");
100448
99905
  }
@@ -100654,10 +100111,10 @@ var init_built_in_server = __esm({
100654
100111
  * Register MCP protocol handlers
100655
100112
  */
100656
100113
  registerHandlers() {
100657
- this.mcpServer.setRequestHandler(import_types4.ListToolsRequestSchema, async () => {
100114
+ this.mcpServer.setRequestHandler(import_types5.ListToolsRequestSchema, async () => {
100658
100115
  return this.handleListTools();
100659
100116
  });
100660
- this.mcpServer.setRequestHandler(import_types4.CallToolRequestSchema, async (request) => {
100117
+ this.mcpServer.setRequestHandler(import_types5.CallToolRequestSchema, async (request) => {
100661
100118
  return this.handleCallTool(request.params);
100662
100119
  });
100663
100120
  }