@probelabs/probe 0.6.0-rc134 → 0.6.0-rc136

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
@@ -8357,10 +8357,10 @@ var require_dist_cjs3 = __commonJS({
8357
8357
  }
8358
8358
  __name(resolveEventStreamConfig, "resolveEventStreamConfig");
8359
8359
  var import_protocol_http15 = require_dist_cjs2();
8360
- var eventStreamHandlingMiddleware = /* @__PURE__ */ __name((options) => (next, context) => async (args) => {
8360
+ var eventStreamHandlingMiddleware = /* @__PURE__ */ __name((options) => (next, context3) => async (args) => {
8361
8361
  const { request } = args;
8362
8362
  if (!import_protocol_http15.HttpRequest.isInstance(request)) return next(args);
8363
- return options.eventStreamPayloadHandler.handle(next, args, context);
8363
+ return options.eventStreamPayloadHandler.handle(next, args, context3);
8364
8364
  }, "eventStreamHandlingMiddleware");
8365
8365
  var eventStreamHandlingMiddlewareOptions = {
8366
8366
  tags: ["EVENT_STREAM", "SIGNATURE", "HANDLE"],
@@ -8490,13 +8490,13 @@ var require_dist_cjs5 = __commonJS({
8490
8490
  loggerMiddlewareOptions: () => loggerMiddlewareOptions
8491
8491
  });
8492
8492
  module2.exports = __toCommonJS2(index_exports2);
8493
- var loggerMiddleware = /* @__PURE__ */ __name(() => (next, context) => async (args) => {
8493
+ var loggerMiddleware = /* @__PURE__ */ __name(() => (next, context3) => async (args) => {
8494
8494
  try {
8495
8495
  const response = await next(args);
8496
- const { clientName, commandName, logger: logger2, dynamoDbDocumentClientOptions = {} } = context;
8496
+ const { clientName, commandName, logger: logger2, dynamoDbDocumentClientOptions = {} } = context3;
8497
8497
  const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
8498
- const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
8499
- const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
8498
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context3.inputFilterSensitiveLog;
8499
+ const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context3.outputFilterSensitiveLog;
8500
8500
  const { $metadata, ...outputWithoutMetadata } = response.output;
8501
8501
  logger2?.info?.({
8502
8502
  clientName,
@@ -8507,9 +8507,9 @@ var require_dist_cjs5 = __commonJS({
8507
8507
  });
8508
8508
  return response;
8509
8509
  } catch (error2) {
8510
- const { clientName, commandName, logger: logger2, dynamoDbDocumentClientOptions = {} } = context;
8510
+ const { clientName, commandName, logger: logger2, dynamoDbDocumentClientOptions = {} } = context3;
8511
8511
  const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
8512
- const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
8512
+ const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context3.inputFilterSensitiveLog;
8513
8513
  logger2?.error?.({
8514
8514
  clientName,
8515
8515
  commandName,
@@ -8556,8 +8556,8 @@ var require_invoke_store = __commonJS({
8556
8556
  /**
8557
8557
  * Initialize and run code within an invoke context
8558
8558
  */
8559
- static run(context, fn) {
8560
- return this.storage.run({ ...context }, fn);
8559
+ static run(context3, fn) {
8560
+ return this.storage.run({ ...context3 }, fn);
8561
8561
  }
8562
8562
  /**
8563
8563
  * Get the complete current context
@@ -8569,8 +8569,8 @@ var require_invoke_store = __commonJS({
8569
8569
  * Get a specific value from the context by key
8570
8570
  */
8571
8571
  static get(key) {
8572
- const context = this.storage.getStore();
8573
- return context?.[key];
8572
+ const context3 = this.storage.getStore();
8573
+ return context3?.[key];
8574
8574
  }
8575
8575
  /**
8576
8576
  * Set a custom value in the current context
@@ -8580,9 +8580,9 @@ var require_invoke_store = __commonJS({
8580
8580
  if (this.isProtectedKey(key)) {
8581
8581
  throw new Error(`Cannot modify protected Lambda context field`);
8582
8582
  }
8583
- const context = this.storage.getStore();
8584
- if (context) {
8585
- context[key] = value;
8583
+ const context3 = this.storage.getStore();
8584
+ if (context3) {
8585
+ context3[key] = value;
8586
8586
  }
8587
8587
  }
8588
8588
  /**
@@ -8710,7 +8710,7 @@ var import_types, getSmithyContext;
8710
8710
  var init_getSmithyContext = __esm({
8711
8711
  "node_modules/@smithy/core/dist-es/getSmithyContext.js"() {
8712
8712
  import_types = __toESM(require_dist_cjs());
8713
- getSmithyContext = (context) => context[import_types.SMITHY_CONTEXT_KEY] || (context[import_types.SMITHY_CONTEXT_KEY] = {});
8713
+ getSmithyContext = (context3) => context3[import_types.SMITHY_CONTEXT_KEY] || (context3[import_types.SMITHY_CONTEXT_KEY] = {});
8714
8714
  }
8715
8715
  });
8716
8716
 
@@ -8719,7 +8719,7 @@ var require_dist_cjs7 = __commonJS({
8719
8719
  "node_modules/@smithy/util-middleware/dist-cjs/index.js"(exports2) {
8720
8720
  "use strict";
8721
8721
  var types2 = require_dist_cjs();
8722
- var getSmithyContext9 = (context) => context[types2.SMITHY_CONTEXT_KEY] || (context[types2.SMITHY_CONTEXT_KEY] = {});
8722
+ var getSmithyContext9 = (context3) => context3[types2.SMITHY_CONTEXT_KEY] || (context3[types2.SMITHY_CONTEXT_KEY] = {});
8723
8723
  var normalizeProvider4 = (input) => {
8724
8724
  if (typeof input === "function")
8725
8725
  return input;
@@ -8771,12 +8771,12 @@ var init_httpAuthSchemeMiddleware = __esm({
8771
8771
  "node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js"() {
8772
8772
  import_util_middleware = __toESM(require_dist_cjs7());
8773
8773
  init_resolveAuthOptions();
8774
- httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => {
8775
- const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));
8774
+ httpAuthSchemeMiddleware = (config, mwOptions) => (next, context3) => async (args) => {
8775
+ const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context3, args.input));
8776
8776
  const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : [];
8777
8777
  const resolvedOptions = resolveAuthOptions(options, authSchemePreference);
8778
8778
  const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
8779
- const smithyContext = (0, import_util_middleware.getSmithyContext)(context);
8779
+ const smithyContext = (0, import_util_middleware.getSmithyContext)(context3);
8780
8780
  const failureReasons = [];
8781
8781
  for (const option of resolvedOptions) {
8782
8782
  const scheme = authSchemes.get(option.schemeId);
@@ -8789,7 +8789,7 @@ var init_httpAuthSchemeMiddleware = __esm({
8789
8789
  failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
8790
8790
  continue;
8791
8791
  }
8792
- const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};
8792
+ const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context3) || {};
8793
8793
  option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
8794
8794
  option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
8795
8795
  smithyContext.selectedHttpAuthScheme = {
@@ -8836,7 +8836,7 @@ var require_dist_cjs8 = __commonJS({
8836
8836
  "node_modules/@smithy/middleware-serde/dist-cjs/index.js"(exports2) {
8837
8837
  "use strict";
8838
8838
  var protocolHttp = require_dist_cjs2();
8839
- var deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => {
8839
+ var deserializerMiddleware = (options, deserializer) => (next, context3) => async (args) => {
8840
8840
  const { response } = await next(args);
8841
8841
  try {
8842
8842
  const parsed = await deserializer(response, options);
@@ -8853,10 +8853,10 @@ var require_dist_cjs8 = __commonJS({
8853
8853
  try {
8854
8854
  error2.message += "\n " + hint;
8855
8855
  } catch (e3) {
8856
- if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") {
8856
+ if (!context3.logger || context3.logger?.constructor?.name === "NoOpLogger") {
8857
8857
  console.warn(hint);
8858
8858
  } else {
8859
- context.logger?.warn?.(hint);
8859
+ context3.logger?.warn?.(hint);
8860
8860
  }
8861
8861
  }
8862
8862
  if (typeof error2.$responseBodyText !== "undefined") {
@@ -8886,9 +8886,9 @@ var require_dist_cjs8 = __commonJS({
8886
8886
  return k3.match(pattern);
8887
8887
  }) || [void 0, void 0])[1];
8888
8888
  };
8889
- var serializerMiddleware = (options, serializer) => (next, context) => async (args) => {
8889
+ var serializerMiddleware = (options, serializer) => (next, context3) => async (args) => {
8890
8890
  const endpointConfig = options;
8891
- const endpoint = context.endpointV2?.url && endpointConfig.urlParser ? async () => endpointConfig.urlParser(context.endpointV2.url) : endpointConfig.endpoint;
8891
+ const endpoint = context3.endpointV2?.url && endpointConfig.urlParser ? async () => endpointConfig.urlParser(context3.endpointV2.url) : endpointConfig.endpoint;
8892
8892
  if (!endpoint) {
8893
8893
  throw new Error("No valid endpoint provider available.");
8894
8894
  }
@@ -8971,11 +8971,11 @@ var init_httpSigningMiddleware = __esm({
8971
8971
  };
8972
8972
  defaultSuccessHandler = (httpResponse, signingProperties) => {
8973
8973
  };
8974
- httpSigningMiddleware = (config) => (next, context) => async (args) => {
8974
+ httpSigningMiddleware = (config) => (next, context3) => async (args) => {
8975
8975
  if (!import_protocol_http.HttpRequest.isInstance(args.request)) {
8976
8976
  return next(args);
8977
8977
  }
8978
- const smithyContext = (0, import_util_middleware2.getSmithyContext)(context);
8978
+ const smithyContext = (0, import_util_middleware2.getSmithyContext)(context3);
8979
8979
  const scheme = smithyContext.selectedHttpAuthScheme;
8980
8980
  if (!scheme) {
8981
8981
  throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
@@ -10968,14 +10968,14 @@ var import_util_stream, collectBody;
10968
10968
  var init_collect_stream_body = __esm({
10969
10969
  "node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js"() {
10970
10970
  import_util_stream = __toESM(require_dist_cjs18());
10971
- collectBody = async (streamBody = new Uint8Array(), context) => {
10971
+ collectBody = async (streamBody = new Uint8Array(), context3) => {
10972
10972
  if (streamBody instanceof Uint8Array) {
10973
10973
  return import_util_stream.Uint8ArrayBlobAdapter.mutate(streamBody);
10974
10974
  }
10975
10975
  if (!streamBody) {
10976
10976
  return import_util_stream.Uint8ArrayBlobAdapter.mutate(new Uint8Array());
10977
10977
  }
10978
- const fromContext = context.streamCollector(streamBody);
10978
+ const fromContext = context3.streamCollector(streamBody);
10979
10979
  return import_util_stream.Uint8ArrayBlobAdapter.mutate(await fromContext);
10980
10980
  };
10981
10981
  }
@@ -11005,83 +11005,16 @@ var init_deref = __esm({
11005
11005
  }
11006
11006
  });
11007
11007
 
11008
- // node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js
11009
- var TypeRegistry;
11010
- var init_TypeRegistry = __esm({
11011
- "node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js"() {
11012
- TypeRegistry = class _TypeRegistry {
11013
- namespace;
11014
- schemas;
11015
- exceptions;
11016
- static registries = /* @__PURE__ */ new Map();
11017
- constructor(namespace, schemas = /* @__PURE__ */ new Map(), exceptions = /* @__PURE__ */ new Map()) {
11018
- this.namespace = namespace;
11019
- this.schemas = schemas;
11020
- this.exceptions = exceptions;
11021
- }
11022
- static for(namespace) {
11023
- if (!_TypeRegistry.registries.has(namespace)) {
11024
- _TypeRegistry.registries.set(namespace, new _TypeRegistry(namespace));
11025
- }
11026
- return _TypeRegistry.registries.get(namespace);
11027
- }
11028
- register(shapeId, schema) {
11029
- const qualifiedName = this.normalizeShapeId(shapeId);
11030
- this.schemas.set(qualifiedName, schema);
11031
- }
11032
- getSchema(shapeId) {
11033
- const id = this.normalizeShapeId(shapeId);
11034
- if (!this.schemas.has(id)) {
11035
- throw new Error(`@smithy/core/schema - schema not found for ${id}`);
11036
- }
11037
- return this.schemas.get(id);
11038
- }
11039
- registerError(es, ctor) {
11040
- this.exceptions.set(es, ctor);
11041
- }
11042
- getErrorCtor(es) {
11043
- return this.exceptions.get(es);
11044
- }
11045
- getBaseException() {
11046
- for (const [id, schema] of this.schemas.entries()) {
11047
- if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) {
11048
- return schema;
11049
- }
11050
- }
11051
- return void 0;
11052
- }
11053
- find(predicate) {
11054
- return [...this.schemas.values()].find(predicate);
11055
- }
11056
- clear() {
11057
- this.schemas.clear();
11058
- this.exceptions.clear();
11059
- }
11060
- normalizeShapeId(shapeId) {
11061
- if (shapeId.includes("#")) {
11062
- return shapeId;
11063
- }
11064
- return this.namespace + "#" + shapeId;
11065
- }
11066
- getNamespace(shapeId) {
11067
- return this.normalizeShapeId(shapeId).split("#")[0];
11068
- }
11069
- };
11070
- }
11071
- });
11072
-
11073
11008
  // node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js
11074
11009
  var Schema;
11075
11010
  var init_Schema = __esm({
11076
11011
  "node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js"() {
11077
- init_TypeRegistry();
11078
11012
  Schema = class {
11079
11013
  name;
11080
11014
  namespace;
11081
11015
  traits;
11082
11016
  static assign(instance, values2) {
11083
11017
  const schema = Object.assign(instance, values2);
11084
- TypeRegistry.for(schema.namespace).register(schema.name, schema);
11085
11018
  return schema;
11086
11019
  }
11087
11020
  static [Symbol.hasInstance](lhs) {
@@ -11212,7 +11145,7 @@ var init_OperationSchema = __esm({
11212
11145
  });
11213
11146
 
11214
11147
  // node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js
11215
- var SimpleSchema, sim;
11148
+ var SimpleSchema, sim, simAdapter;
11216
11149
  var init_SimpleSchema = __esm({
11217
11150
  "node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js"() {
11218
11151
  init_Schema();
@@ -11229,6 +11162,12 @@ var init_SimpleSchema = __esm({
11229
11162
  traits,
11230
11163
  schemaRef
11231
11164
  });
11165
+ simAdapter = (namespace, name14, traits, schemaRef) => Schema.assign(new SimpleSchema(), {
11166
+ name: name14,
11167
+ namespace,
11168
+ traits,
11169
+ schemaRef
11170
+ });
11232
11171
  }
11233
11172
  });
11234
11173
 
@@ -11274,7 +11213,7 @@ function member(memberSchema, memberName) {
11274
11213
  function hydrate(ss) {
11275
11214
  const [id, ...rest] = ss;
11276
11215
  return {
11277
- [0]: sim,
11216
+ [0]: simAdapter,
11278
11217
  [1]: list,
11279
11218
  [2]: map,
11280
11219
  [3]: struct,
@@ -11517,16 +11456,16 @@ var init_schemaDeserializationMiddleware = __esm({
11517
11456
  import_protocol_http2 = __toESM(require_dist_cjs2());
11518
11457
  import_util_middleware3 = __toESM(require_dist_cjs7());
11519
11458
  init_NormalizedSchema();
11520
- schemaDeserializationMiddleware = (config) => (next, context) => async (args) => {
11459
+ schemaDeserializationMiddleware = (config) => (next, context3) => async (args) => {
11521
11460
  const { response } = await next(args);
11522
- let { operationSchema } = (0, import_util_middleware3.getSmithyContext)(context);
11461
+ let { operationSchema } = (0, import_util_middleware3.getSmithyContext)(context3);
11523
11462
  if (isStaticSchema(operationSchema)) {
11524
11463
  operationSchema = hydrate(operationSchema);
11525
11464
  }
11526
11465
  try {
11527
11466
  const parsed = await config.protocol.deserializeResponse(operationSchema, {
11528
11467
  ...config,
11529
- ...context
11468
+ ...context3
11530
11469
  }, response);
11531
11470
  return {
11532
11471
  response,
@@ -11541,10 +11480,10 @@ var init_schemaDeserializationMiddleware = __esm({
11541
11480
  try {
11542
11481
  error2.message += "\n " + hint;
11543
11482
  } catch (e3) {
11544
- if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") {
11483
+ if (!context3.logger || context3.logger?.constructor?.name === "NoOpLogger") {
11545
11484
  console.warn(hint);
11546
11485
  } else {
11547
- context.logger?.warn?.(hint);
11486
+ context3.logger?.warn?.(hint);
11548
11487
  }
11549
11488
  }
11550
11489
  if (typeof error2.$responseBodyText !== "undefined") {
@@ -11583,15 +11522,15 @@ var init_schemaSerializationMiddleware = __esm({
11583
11522
  "node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js"() {
11584
11523
  import_util_middleware4 = __toESM(require_dist_cjs7());
11585
11524
  init_NormalizedSchema();
11586
- schemaSerializationMiddleware = (config) => (next, context) => async (args) => {
11587
- let { operationSchema } = (0, import_util_middleware4.getSmithyContext)(context);
11525
+ schemaSerializationMiddleware = (config) => (next, context3) => async (args) => {
11526
+ let { operationSchema } = (0, import_util_middleware4.getSmithyContext)(context3);
11588
11527
  if (isStaticSchema(operationSchema)) {
11589
11528
  operationSchema = hydrate(operationSchema);
11590
11529
  }
11591
- const endpoint = context.endpointV2?.url && config.urlParser ? async () => config.urlParser(context.endpointV2.url) : config.endpoint;
11530
+ const endpoint = context3.endpointV2?.url && config.urlParser ? async () => config.urlParser(context3.endpointV2.url) : config.endpoint;
11592
11531
  const request = await config.protocol.serializeRequest(operationSchema, args.input, {
11593
11532
  ...config,
11594
- ...context,
11533
+ ...context3,
11595
11534
  endpoint
11596
11535
  });
11597
11536
  return next({
@@ -11655,6 +11594,78 @@ var init_sentinels = __esm({
11655
11594
  }
11656
11595
  });
11657
11596
 
11597
+ // node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js
11598
+ var TypeRegistry;
11599
+ var init_TypeRegistry = __esm({
11600
+ "node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js"() {
11601
+ TypeRegistry = class _TypeRegistry {
11602
+ namespace;
11603
+ schemas;
11604
+ exceptions;
11605
+ static registries = /* @__PURE__ */ new Map();
11606
+ constructor(namespace, schemas = /* @__PURE__ */ new Map(), exceptions = /* @__PURE__ */ new Map()) {
11607
+ this.namespace = namespace;
11608
+ this.schemas = schemas;
11609
+ this.exceptions = exceptions;
11610
+ }
11611
+ static for(namespace) {
11612
+ if (!_TypeRegistry.registries.has(namespace)) {
11613
+ _TypeRegistry.registries.set(namespace, new _TypeRegistry(namespace));
11614
+ }
11615
+ return _TypeRegistry.registries.get(namespace);
11616
+ }
11617
+ register(shapeId, schema) {
11618
+ const qualifiedName = this.normalizeShapeId(shapeId);
11619
+ const registry = _TypeRegistry.for(qualifiedName.split("#")[0]);
11620
+ registry.schemas.set(qualifiedName, schema);
11621
+ }
11622
+ getSchema(shapeId) {
11623
+ const id = this.normalizeShapeId(shapeId);
11624
+ if (!this.schemas.has(id)) {
11625
+ throw new Error(`@smithy/core/schema - schema not found for ${id}`);
11626
+ }
11627
+ return this.schemas.get(id);
11628
+ }
11629
+ registerError(es, ctor) {
11630
+ const $error = es;
11631
+ const registry = _TypeRegistry.for($error[1]);
11632
+ registry.schemas.set($error[1] + "#" + $error[2], $error);
11633
+ registry.exceptions.set($error, ctor);
11634
+ }
11635
+ getErrorCtor(es) {
11636
+ const $error = es;
11637
+ const registry = _TypeRegistry.for($error[1]);
11638
+ return registry.exceptions.get(es);
11639
+ }
11640
+ getBaseException() {
11641
+ for (const exceptionKey of this.exceptions.keys()) {
11642
+ if (Array.isArray(exceptionKey)) {
11643
+ const [, ns, name14] = exceptionKey;
11644
+ const id = ns + "#" + name14;
11645
+ if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) {
11646
+ return exceptionKey;
11647
+ }
11648
+ }
11649
+ }
11650
+ return void 0;
11651
+ }
11652
+ find(predicate) {
11653
+ return [...this.schemas.values()].find(predicate);
11654
+ }
11655
+ clear() {
11656
+ this.schemas.clear();
11657
+ this.exceptions.clear();
11658
+ }
11659
+ normalizeShapeId(shapeId) {
11660
+ if (shapeId.includes("#")) {
11661
+ return shapeId;
11662
+ }
11663
+ return this.namespace + "#" + shapeId;
11664
+ }
11665
+ };
11666
+ }
11667
+ });
11668
+
11658
11669
  // node_modules/@smithy/core/dist-es/submodules/schema/index.js
11659
11670
  var schema_exports = {};
11660
11671
  __export(schema_exports, {
@@ -11679,6 +11690,7 @@ __export(schema_exports, {
11679
11690
  op: () => op,
11680
11691
  serializerMiddlewareOption: () => serializerMiddlewareOption2,
11681
11692
  sim: () => sim,
11693
+ simAdapter: () => simAdapter,
11682
11694
  struct: () => struct,
11683
11695
  translateTraits: () => translateTraits
11684
11696
  });
@@ -12209,14 +12221,14 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e
12209
12221
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
12210
12222
  var _2, done = false;
12211
12223
  for (var i3 = decorators.length - 1; i3 >= 0; i3--) {
12212
- var context = {};
12213
- for (var p3 in contextIn) context[p3] = p3 === "access" ? {} : contextIn[p3];
12214
- for (var p3 in contextIn.access) context.access[p3] = contextIn.access[p3];
12215
- context.addInitializer = function(f3) {
12224
+ var context3 = {};
12225
+ for (var p3 in contextIn) context3[p3] = p3 === "access" ? {} : contextIn[p3];
12226
+ for (var p3 in contextIn.access) context3.access[p3] = contextIn.access[p3];
12227
+ context3.addInitializer = function(f3) {
12216
12228
  if (done) throw new TypeError("Cannot add initializers after decoration has completed");
12217
12229
  extraInitializers.push(accept(f3 || null));
12218
12230
  };
12219
- var result = (0, decorators[i3])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
12231
+ var result = (0, decorators[i3])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context3);
12220
12232
  if (kind === "accessor") {
12221
12233
  if (result === void 0) continue;
12222
12234
  if (result === null || typeof result !== "object") throw new TypeError("Object expected");
@@ -13354,20 +13366,20 @@ var init_HttpProtocol = __esm({
13354
13366
  getDefaultContentType() {
13355
13367
  throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`);
13356
13368
  }
13357
- async deserializeHttpMessage(schema, context, response, arg4, arg5) {
13369
+ async deserializeHttpMessage(schema, context3, response, arg4, arg5) {
13358
13370
  void schema;
13359
- void context;
13371
+ void context3;
13360
13372
  void response;
13361
13373
  void arg4;
13362
13374
  void arg5;
13363
13375
  return [];
13364
13376
  }
13365
13377
  getEventStreamMarshaller() {
13366
- const context = this.serdeContext;
13367
- if (!context.eventStreamMarshaller) {
13378
+ const context3 = this.serdeContext;
13379
+ if (!context3.eventStreamMarshaller) {
13368
13380
  throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");
13369
13381
  }
13370
- return context.eventStreamMarshaller;
13382
+ return context3.eventStreamMarshaller;
13371
13383
  }
13372
13384
  };
13373
13385
  }
@@ -13385,14 +13397,14 @@ var init_HttpBindingProtocol = __esm({
13385
13397
  init_extended_encode_uri_component();
13386
13398
  init_HttpProtocol();
13387
13399
  HttpBindingProtocol = class extends HttpProtocol {
13388
- async serializeRequest(operationSchema, _input, context) {
13400
+ async serializeRequest(operationSchema, _input, context3) {
13389
13401
  const input = {
13390
13402
  ..._input ?? {}
13391
13403
  };
13392
13404
  const serializer = this.serializer;
13393
13405
  const query2 = {};
13394
13406
  const headers = {};
13395
- const endpoint = await context.endpoint();
13407
+ const endpoint = await context3.endpoint();
13396
13408
  const ns = NormalizedSchema.of(operationSchema?.input);
13397
13409
  const schema = ns.getSchema();
13398
13410
  let hasNonHttpBindingMember = false;
@@ -13517,16 +13529,16 @@ var init_HttpBindingProtocol = __esm({
13517
13529
  query2[traits.httpQuery] = serializer.flush();
13518
13530
  }
13519
13531
  }
13520
- async deserializeResponse(operationSchema, context, response) {
13532
+ async deserializeResponse(operationSchema, context3, response) {
13521
13533
  const deserializer = this.deserializer;
13522
13534
  const ns = NormalizedSchema.of(operationSchema.output);
13523
13535
  const dataObject = {};
13524
13536
  if (response.statusCode >= 300) {
13525
- const bytes = await collectBody(response.body, context);
13537
+ const bytes = await collectBody(response.body, context3);
13526
13538
  if (bytes.byteLength > 0) {
13527
13539
  Object.assign(dataObject, await deserializer.read(15, bytes));
13528
13540
  }
13529
- await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
13541
+ await this.handleError(operationSchema, context3, response, dataObject, this.deserializeMetadata(response));
13530
13542
  throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.");
13531
13543
  }
13532
13544
  for (const header in response.headers) {
@@ -13534,9 +13546,9 @@ var init_HttpBindingProtocol = __esm({
13534
13546
  delete response.headers[header];
13535
13547
  response.headers[header.toLowerCase()] = value;
13536
13548
  }
13537
- const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context, response, dataObject);
13549
+ const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context3, response, dataObject);
13538
13550
  if (nonHttpBindingMembers.length) {
13539
- const bytes = await collectBody(response.body, context);
13551
+ const bytes = await collectBody(response.body, context3);
13540
13552
  if (bytes.byteLength > 0) {
13541
13553
  const dataFromBody = await deserializer.read(ns, bytes);
13542
13554
  for (const member2 of nonHttpBindingMembers) {
@@ -13547,7 +13559,7 @@ var init_HttpBindingProtocol = __esm({
13547
13559
  dataObject.$metadata = this.deserializeMetadata(response);
13548
13560
  return dataObject;
13549
13561
  }
13550
- async deserializeHttpMessage(schema, context, response, arg4, arg5) {
13562
+ async deserializeHttpMessage(schema, context3, response, arg4, arg5) {
13551
13563
  let dataObject;
13552
13564
  if (arg4 instanceof Set) {
13553
13565
  dataObject = arg5;
@@ -13572,7 +13584,7 @@ var init_HttpBindingProtocol = __esm({
13572
13584
  dataObject[memberName] = (0, import_util_stream2.sdkStreamMixin)(response.body);
13573
13585
  }
13574
13586
  } else if (response.body) {
13575
- const bytes = await collectBody(response.body, context);
13587
+ const bytes = await collectBody(response.body, context3);
13576
13588
  if (bytes.byteLength > 0) {
13577
13589
  dataObject[memberName] = await deserializer.read(memberSchema, bytes);
13578
13590
  }
@@ -13629,11 +13641,11 @@ var init_RpcProtocol = __esm({
13629
13641
  init_collect_stream_body();
13630
13642
  init_HttpProtocol();
13631
13643
  RpcProtocol = class extends HttpProtocol {
13632
- async serializeRequest(operationSchema, input, context) {
13644
+ async serializeRequest(operationSchema, input, context3) {
13633
13645
  const serializer = this.serializer;
13634
13646
  const query2 = {};
13635
13647
  const headers = {};
13636
- const endpoint = await context.endpoint();
13648
+ const endpoint = await context3.endpoint();
13637
13649
  const ns = NormalizedSchema.of(operationSchema?.input);
13638
13650
  const schema = ns.getSchema();
13639
13651
  let payload2;
@@ -13682,16 +13694,16 @@ var init_RpcProtocol = __esm({
13682
13694
  request.method = "POST";
13683
13695
  return request;
13684
13696
  }
13685
- async deserializeResponse(operationSchema, context, response) {
13697
+ async deserializeResponse(operationSchema, context3, response) {
13686
13698
  const deserializer = this.deserializer;
13687
13699
  const ns = NormalizedSchema.of(operationSchema.output);
13688
13700
  const dataObject = {};
13689
13701
  if (response.statusCode >= 300) {
13690
- const bytes = await collectBody(response.body, context);
13702
+ const bytes = await collectBody(response.body, context3);
13691
13703
  if (bytes.byteLength > 0) {
13692
13704
  Object.assign(dataObject, await deserializer.read(15, bytes));
13693
13705
  }
13694
- await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
13706
+ await this.handleError(operationSchema, context3, response, dataObject, this.deserializeMetadata(response));
13695
13707
  throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.");
13696
13708
  }
13697
13709
  for (const header in response.headers) {
@@ -13707,7 +13719,7 @@ var init_RpcProtocol = __esm({
13707
13719
  initialResponseContainer: dataObject
13708
13720
  });
13709
13721
  } else {
13710
- const bytes = await collectBody(response.body, context);
13722
+ const bytes = await collectBody(response.body, context3);
13711
13723
  if (bytes.byteLength > 0) {
13712
13724
  Object.assign(dataObject, await deserializer.read(ns, bytes));
13713
13725
  }
@@ -13740,8 +13752,8 @@ var init_resolve_path = __esm({
13740
13752
  });
13741
13753
 
13742
13754
  // node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js
13743
- function requestBuilder(input, context) {
13744
- return new RequestBuilder(input, context);
13755
+ function requestBuilder(input, context3) {
13756
+ return new RequestBuilder(input, context3);
13745
13757
  }
13746
13758
  var import_protocol_http6, RequestBuilder;
13747
13759
  var init_requestBuilder = __esm({
@@ -13758,9 +13770,9 @@ var init_requestBuilder = __esm({
13758
13770
  body = null;
13759
13771
  hostname = "";
13760
13772
  resolvePathStack = [];
13761
- constructor(input, context) {
13773
+ constructor(input, context3) {
13762
13774
  this.input = input;
13763
- this.context = context;
13775
+ this.context = context3;
13764
13776
  }
13765
13777
  async build() {
13766
13778
  const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint();
@@ -14129,15 +14141,15 @@ var init_requestBuilder2 = __esm({
14129
14141
  });
14130
14142
 
14131
14143
  // node_modules/@smithy/core/dist-es/setFeature.js
14132
- function setFeature(context, feature, value) {
14133
- if (!context.__smithy_context) {
14134
- context.__smithy_context = {
14144
+ function setFeature(context3, feature, value) {
14145
+ if (!context3.__smithy_context) {
14146
+ context3.__smithy_context = {
14135
14147
  features: {}
14136
14148
  };
14137
- } else if (!context.__smithy_context.features) {
14138
- context.__smithy_context.features = {};
14149
+ } else if (!context3.__smithy_context.features) {
14150
+ context3.__smithy_context.features = {};
14139
14151
  }
14140
- context.__smithy_context.features[feature] = value;
14152
+ context3.__smithy_context.features[feature] = value;
14141
14153
  }
14142
14154
  var init_setFeature = __esm({
14143
14155
  "node_modules/@smithy/core/dist-es/setFeature.js"() {
@@ -15289,15 +15301,15 @@ var init_setCredentialFeature = __esm({
15289
15301
  });
15290
15302
 
15291
15303
  // node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js
15292
- function setFeature2(context, feature, value) {
15293
- if (!context.__aws_sdk_context) {
15294
- context.__aws_sdk_context = {
15304
+ function setFeature2(context3, feature, value) {
15305
+ if (!context3.__aws_sdk_context) {
15306
+ context3.__aws_sdk_context = {
15295
15307
  features: {}
15296
15308
  };
15297
- } else if (!context.__aws_sdk_context.features) {
15298
- context.__aws_sdk_context.features = {};
15309
+ } else if (!context3.__aws_sdk_context.features) {
15310
+ context3.__aws_sdk_context.features = {};
15299
15311
  }
15300
- context.__aws_sdk_context.features[feature] = value;
15312
+ context3.__aws_sdk_context.features[feature] = value;
15301
15313
  }
15302
15314
  var init_setFeature2 = __esm({
15303
15315
  "node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js"() {
@@ -15398,9 +15410,9 @@ var init_AwsSdkSigV4Signer = __esm({
15398
15410
  return property2;
15399
15411
  };
15400
15412
  validateSigningProperties = async (signingProperties) => {
15401
- const context = throwSigningPropertyError("context", signingProperties.context);
15413
+ const context3 = throwSigningPropertyError("context", signingProperties.context);
15402
15414
  const config = throwSigningPropertyError("config", signingProperties.config);
15403
- const authScheme = context.endpointV2?.properties?.authSchemes?.[0];
15415
+ const authScheme = context3.endpointV2?.properties?.authSchemes?.[0];
15404
15416
  const signerFunction = throwSigningPropertyError("signer", config.signer);
15405
15417
  const signer = await signerFunction(authScheme);
15406
15418
  const signingRegion = signingProperties?.signingRegion;
@@ -17258,8 +17270,8 @@ var init_SmithyRpcV2CborProtocol = __esm({
17258
17270
  getPayloadCodec() {
17259
17271
  return this.codec;
17260
17272
  }
17261
- async serializeRequest(operationSchema, input, context) {
17262
- const request = await super.serializeRequest(operationSchema, input, context);
17273
+ async serializeRequest(operationSchema, input, context3) {
17274
+ const request = await super.serializeRequest(operationSchema, input, context3);
17263
17275
  Object.assign(request.headers, {
17264
17276
  "content-type": this.getDefaultContentType(),
17265
17277
  "smithy-protocol": "rpc-v2-cbor",
@@ -17278,7 +17290,7 @@ var init_SmithyRpcV2CborProtocol = __esm({
17278
17290
  } catch (e3) {
17279
17291
  }
17280
17292
  }
17281
- const { service, operation } = (0, import_util_middleware5.getSmithyContext)(context);
17293
+ const { service, operation } = (0, import_util_middleware5.getSmithyContext)(context3);
17282
17294
  const path7 = `/service/${service}/operation/${operation}`;
17283
17295
  if (request.path.endsWith("/")) {
17284
17296
  request.path += path7.slice(1);
@@ -17287,10 +17299,10 @@ var init_SmithyRpcV2CborProtocol = __esm({
17287
17299
  }
17288
17300
  return request;
17289
17301
  }
17290
- async deserializeResponse(operationSchema, context, response) {
17291
- return super.deserializeResponse(operationSchema, context, response);
17302
+ async deserializeResponse(operationSchema, context3, response) {
17303
+ return super.deserializeResponse(operationSchema, context3, response);
17292
17304
  }
17293
- async handleError(operationSchema, context, response, dataObject, metadata) {
17305
+ async handleError(operationSchema, context3, response, dataObject, metadata) {
17294
17306
  const errorName = loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown";
17295
17307
  let namespace = this.options.defaultNamespace;
17296
17308
  if (errorName.includes("#")) {
@@ -17451,14 +17463,14 @@ var init_AwsSmithyRpcV2CborProtocol = __esm({
17451
17463
  super({ defaultNamespace });
17452
17464
  this.awsQueryCompatible = !!awsQueryCompatible;
17453
17465
  }
17454
- async serializeRequest(operationSchema, input, context) {
17455
- const request = await super.serializeRequest(operationSchema, input, context);
17466
+ async serializeRequest(operationSchema, input, context3) {
17467
+ const request = await super.serializeRequest(operationSchema, input, context3);
17456
17468
  if (this.awsQueryCompatible) {
17457
17469
  request.headers["x-amzn-query-mode"] = "true";
17458
17470
  }
17459
17471
  return request;
17460
17472
  }
17461
- async handleError(operationSchema, context, response, dataObject, metadata) {
17473
+ async handleError(operationSchema, context3, response, dataObject, metadata) {
17462
17474
  if (this.awsQueryCompatible) {
17463
17475
  this.mixin.setQueryCompatError(dataObject, response);
17464
17476
  }
@@ -17558,9 +17570,9 @@ var init_ConfigurableSerdeContext = __esm({
17558
17570
  });
17559
17571
 
17560
17572
  // node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js
17561
- function jsonReviver(key, value, context) {
17562
- if (context?.source) {
17563
- const numericString = context.source;
17573
+ function jsonReviver(key, value, context3) {
17574
+ if (context3?.source) {
17575
+ const numericString = context3.source;
17564
17576
  if (typeof value === "number") {
17565
17577
  if (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER || numericString !== String(value)) {
17566
17578
  const isFractional = numericString.includes(".");
@@ -17823,9 +17835,9 @@ var require_dist_cjs26 = __commonJS({
17823
17835
  identifyOnResolve = toggle;
17824
17836
  return identifyOnResolve;
17825
17837
  },
17826
- resolve: (handler, context) => {
17838
+ resolve: (handler, context3) => {
17827
17839
  for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) {
17828
- handler = middleware(handler, context);
17840
+ handler = middleware(handler, context3);
17829
17841
  }
17830
17842
  if (identifyOnResolve) {
17831
17843
  console.log(stack.identify());
@@ -18425,7 +18437,7 @@ var init_common2 = __esm({
18425
18437
  "node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js"() {
18426
18438
  import_smithy_client = __toESM(require_dist_cjs27());
18427
18439
  import_util_utf86 = __toESM(require_dist_cjs11());
18428
- collectBodyString = (streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => (context?.utf8Encoder ?? import_util_utf86.toUtf8)(body));
18440
+ collectBodyString = (streamBody, context3) => (0, import_smithy_client.collectBody)(streamBody, context3).then((body) => (context3?.utf8Encoder ?? import_util_utf86.toUtf8)(body));
18429
18441
  }
18430
18442
  });
18431
18443
 
@@ -18434,7 +18446,7 @@ var parseJsonBody, parseJsonErrorBody, loadRestJsonErrorCode;
18434
18446
  var init_parseJsonBody = __esm({
18435
18447
  "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js"() {
18436
18448
  init_common2();
18437
- parseJsonBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
18449
+ parseJsonBody = (streamBody, context3) => collectBodyString(streamBody, context3).then((encoded) => {
18438
18450
  if (encoded.length) {
18439
18451
  try {
18440
18452
  return JSON.parse(encoded);
@@ -18449,8 +18461,8 @@ var init_parseJsonBody = __esm({
18449
18461
  }
18450
18462
  return {};
18451
18463
  });
18452
- parseJsonErrorBody = async (errorBody, context) => {
18453
- const value = await parseJsonBody(errorBody, context);
18464
+ parseJsonErrorBody = async (errorBody, context3) => {
18465
+ const value = await parseJsonBody(errorBody, context3);
18454
18466
  value.message = value.message ?? value.Message;
18455
18467
  return value;
18456
18468
  };
@@ -18861,8 +18873,8 @@ var init_AwsJsonRpcProtocol = __esm({
18861
18873
  this.deserializer = this.codec.createDeserializer();
18862
18874
  this.awsQueryCompatible = !!awsQueryCompatible;
18863
18875
  }
18864
- async serializeRequest(operationSchema, input, context) {
18865
- const request = await super.serializeRequest(operationSchema, input, context);
18876
+ async serializeRequest(operationSchema, input, context3) {
18877
+ const request = await super.serializeRequest(operationSchema, input, context3);
18866
18878
  if (!request.path.endsWith("/")) {
18867
18879
  request.path += "/";
18868
18880
  }
@@ -18881,7 +18893,7 @@ var init_AwsJsonRpcProtocol = __esm({
18881
18893
  getPayloadCodec() {
18882
18894
  return this.codec;
18883
18895
  }
18884
- async handleError(operationSchema, context, response, dataObject, metadata) {
18896
+ async handleError(operationSchema, context3, response, dataObject, metadata) {
18885
18897
  if (this.awsQueryCompatible) {
18886
18898
  this.mixin.setQueryCompatError(dataObject, response);
18887
18899
  }
@@ -19000,8 +19012,8 @@ var init_AwsRestJsonProtocol = __esm({
19000
19012
  this.codec.setSerdeContext(serdeContext);
19001
19013
  super.setSerdeContext(serdeContext);
19002
19014
  }
19003
- async serializeRequest(operationSchema, input, context) {
19004
- const request = await super.serializeRequest(operationSchema, input, context);
19015
+ async serializeRequest(operationSchema, input, context3) {
19016
+ const request = await super.serializeRequest(operationSchema, input, context3);
19005
19017
  const inputSchema = NormalizedSchema.of(operationSchema.input);
19006
19018
  if (!request.headers["content-type"]) {
19007
19019
  const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema);
@@ -19014,14 +19026,14 @@ var init_AwsRestJsonProtocol = __esm({
19014
19026
  }
19015
19027
  return request;
19016
19028
  }
19017
- async handleError(operationSchema, context, response, dataObject, metadata) {
19029
+ async handleError(operationSchema, context3, response, dataObject, metadata) {
19018
19030
  const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown";
19019
19031
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
19020
19032
  const ns = NormalizedSchema.of(errorSchema);
19021
19033
  const message = dataObject.message ?? dataObject.Message ?? "Unknown";
19022
19034
  const ErrorCtor = TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
19023
19035
  const exception = new ErrorCtor(message);
19024
- await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
19036
+ await this.deserializeHttpMessage(errorSchema, context3, response, dataObject);
19025
19037
  const output = {};
19026
19038
  for (const [name14, member2] of ns.structIterator()) {
19027
19039
  const target = member2.getMergedTraits().jsonName ?? name14;
@@ -20371,8 +20383,8 @@ var init_AwsQueryProtocol = __esm({
20371
20383
  getPayloadCodec() {
20372
20384
  throw new Error("AWSQuery protocol has no payload codec.");
20373
20385
  }
20374
- async serializeRequest(operationSchema, input, context) {
20375
- const request = await super.serializeRequest(operationSchema, input, context);
20386
+ async serializeRequest(operationSchema, input, context3) {
20387
+ const request = await super.serializeRequest(operationSchema, input, context3);
20376
20388
  if (!request.path.endsWith("/")) {
20377
20389
  request.path += "/";
20378
20390
  }
@@ -20389,16 +20401,16 @@ var init_AwsQueryProtocol = __esm({
20389
20401
  }
20390
20402
  return request;
20391
20403
  }
20392
- async deserializeResponse(operationSchema, context, response) {
20404
+ async deserializeResponse(operationSchema, context3, response) {
20393
20405
  const deserializer = this.deserializer;
20394
20406
  const ns = NormalizedSchema.of(operationSchema.output);
20395
20407
  const dataObject = {};
20396
20408
  if (response.statusCode >= 300) {
20397
- const bytes2 = await collectBody(response.body, context);
20409
+ const bytes2 = await collectBody(response.body, context3);
20398
20410
  if (bytes2.byteLength > 0) {
20399
20411
  Object.assign(dataObject, await deserializer.read(15, bytes2));
20400
20412
  }
20401
- await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
20413
+ await this.handleError(operationSchema, context3, response, dataObject, this.deserializeMetadata(response));
20402
20414
  }
20403
20415
  for (const header in response.headers) {
20404
20416
  const value = response.headers[header];
@@ -20407,7 +20419,7 @@ var init_AwsQueryProtocol = __esm({
20407
20419
  }
20408
20420
  const shortName = operationSchema.name.split("#")[1] ?? operationSchema.name;
20409
20421
  const awsQueryResultKey = ns.isStructSchema() && this.useNestedResult() ? shortName + "Result" : void 0;
20410
- const bytes = await collectBody(response.body, context);
20422
+ const bytes = await collectBody(response.body, context3);
20411
20423
  if (bytes.byteLength > 0) {
20412
20424
  Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey));
20413
20425
  }
@@ -20420,7 +20432,7 @@ var init_AwsQueryProtocol = __esm({
20420
20432
  useNestedResult() {
20421
20433
  return true;
20422
20434
  }
20423
- async handleError(operationSchema, context, response, dataObject, metadata) {
20435
+ async handleError(operationSchema, context3, response, dataObject, metadata) {
20424
20436
  const errorIdentifier = this.loadQueryErrorCode(response, dataObject) ?? "Unknown";
20425
20437
  const errorData = this.loadQueryError(dataObject);
20426
20438
  const message = this.loadQueryErrorMessage(dataObject);
@@ -20501,7 +20513,7 @@ var init_parseXmlBody = __esm({
20501
20513
  import_xml_builder2 = __toESM(require_dist_cjs28());
20502
20514
  import_smithy_client5 = __toESM(require_dist_cjs27());
20503
20515
  init_common2();
20504
- parseXmlBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
20516
+ parseXmlBody = (streamBody, context3) => collectBodyString(streamBody, context3).then((encoded) => {
20505
20517
  if (encoded.length) {
20506
20518
  let parsedObj;
20507
20519
  try {
@@ -20525,8 +20537,8 @@ var init_parseXmlBody = __esm({
20525
20537
  }
20526
20538
  return {};
20527
20539
  });
20528
- parseXmlErrorBody = async (errorBody, context) => {
20529
- const value = await parseXmlBody(errorBody, context);
20540
+ parseXmlErrorBody = async (errorBody, context3) => {
20541
+ const value = await parseXmlBody(errorBody, context3);
20530
20542
  if (value.Error) {
20531
20543
  value.Error.message = value.Error.message ?? value.Error.Message;
20532
20544
  }
@@ -20871,8 +20883,8 @@ var init_AwsRestXmlProtocol = __esm({
20871
20883
  getShapeId() {
20872
20884
  return "aws.protocols#restXml";
20873
20885
  }
20874
- async serializeRequest(operationSchema, input, context) {
20875
- const request = await super.serializeRequest(operationSchema, input, context);
20886
+ async serializeRequest(operationSchema, input, context3) {
20887
+ const request = await super.serializeRequest(operationSchema, input, context3);
20876
20888
  const inputSchema = NormalizedSchema.of(operationSchema.input);
20877
20889
  if (!request.headers["content-type"]) {
20878
20890
  const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema);
@@ -20887,17 +20899,17 @@ var init_AwsRestXmlProtocol = __esm({
20887
20899
  }
20888
20900
  return request;
20889
20901
  }
20890
- async deserializeResponse(operationSchema, context, response) {
20891
- return super.deserializeResponse(operationSchema, context, response);
20902
+ async deserializeResponse(operationSchema, context3, response) {
20903
+ return super.deserializeResponse(operationSchema, context3, response);
20892
20904
  }
20893
- async handleError(operationSchema, context, response, dataObject, metadata) {
20905
+ async handleError(operationSchema, context3, response, dataObject, metadata) {
20894
20906
  const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown";
20895
20907
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
20896
20908
  const ns = NormalizedSchema.of(errorSchema);
20897
20909
  const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown";
20898
20910
  const ErrorCtor = TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
20899
20911
  const exception = new ErrorCtor(message);
20900
- await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
20912
+ await this.deserializeHttpMessage(errorSchema, context3, response, dataObject);
20901
20913
  const output = {};
20902
20914
  for (const [name14, member2] of ns.structIterator()) {
20903
20915
  const target = member2.getMergedTraits().xmlName ?? name14;
@@ -21026,48 +21038,48 @@ var require_dist_cjs29 = __commonJS({
21026
21038
  });
21027
21039
  }
21028
21040
  var ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/;
21029
- async function checkFeatures(context, config, args) {
21041
+ async function checkFeatures(context3, config, args) {
21030
21042
  const request = args.request;
21031
21043
  if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") {
21032
- core$1.setFeature(context, "PROTOCOL_RPC_V2_CBOR", "M");
21044
+ core$1.setFeature(context3, "PROTOCOL_RPC_V2_CBOR", "M");
21033
21045
  }
21034
21046
  if (typeof config.retryStrategy === "function") {
21035
21047
  const retryStrategy = await config.retryStrategy();
21036
21048
  if (typeof retryStrategy.acquireInitialRetryToken === "function") {
21037
21049
  if (retryStrategy.constructor?.name?.includes("Adaptive")) {
21038
- core$1.setFeature(context, "RETRY_MODE_ADAPTIVE", "F");
21050
+ core$1.setFeature(context3, "RETRY_MODE_ADAPTIVE", "F");
21039
21051
  } else {
21040
- core$1.setFeature(context, "RETRY_MODE_STANDARD", "E");
21052
+ core$1.setFeature(context3, "RETRY_MODE_STANDARD", "E");
21041
21053
  }
21042
21054
  } else {
21043
- core$1.setFeature(context, "RETRY_MODE_LEGACY", "D");
21055
+ core$1.setFeature(context3, "RETRY_MODE_LEGACY", "D");
21044
21056
  }
21045
21057
  }
21046
21058
  if (typeof config.accountIdEndpointMode === "function") {
21047
- const endpointV2 = context.endpointV2;
21059
+ const endpointV2 = context3.endpointV2;
21048
21060
  if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) {
21049
- core$1.setFeature(context, "ACCOUNT_ID_ENDPOINT", "O");
21061
+ core$1.setFeature(context3, "ACCOUNT_ID_ENDPOINT", "O");
21050
21062
  }
21051
21063
  switch (await config.accountIdEndpointMode?.()) {
21052
21064
  case "disabled":
21053
- core$1.setFeature(context, "ACCOUNT_ID_MODE_DISABLED", "Q");
21065
+ core$1.setFeature(context3, "ACCOUNT_ID_MODE_DISABLED", "Q");
21054
21066
  break;
21055
21067
  case "preferred":
21056
- core$1.setFeature(context, "ACCOUNT_ID_MODE_PREFERRED", "P");
21068
+ core$1.setFeature(context3, "ACCOUNT_ID_MODE_PREFERRED", "P");
21057
21069
  break;
21058
21070
  case "required":
21059
- core$1.setFeature(context, "ACCOUNT_ID_MODE_REQUIRED", "R");
21071
+ core$1.setFeature(context3, "ACCOUNT_ID_MODE_REQUIRED", "R");
21060
21072
  break;
21061
21073
  }
21062
21074
  }
21063
- const identity2 = context.__smithy_context?.selectedHttpAuthScheme?.identity;
21075
+ const identity2 = context3.__smithy_context?.selectedHttpAuthScheme?.identity;
21064
21076
  if (identity2?.$source) {
21065
21077
  const credentials = identity2;
21066
21078
  if (credentials.accountId) {
21067
- core$1.setFeature(context, "RESOLVED_ACCOUNT_ID", "T");
21079
+ core$1.setFeature(context3, "RESOLVED_ACCOUNT_ID", "T");
21068
21080
  }
21069
21081
  for (const [key, value] of Object.entries(credentials.$source ?? {})) {
21070
- core$1.setFeature(context, key, value);
21082
+ core$1.setFeature(context3, key, value);
21071
21083
  }
21072
21084
  }
21073
21085
  }
@@ -21095,17 +21107,17 @@ var require_dist_cjs29 = __commonJS({
21095
21107
  }
21096
21108
  return buffer;
21097
21109
  }
21098
- var userAgentMiddleware = (options) => (next, context) => async (args) => {
21110
+ var userAgentMiddleware = (options) => (next, context3) => async (args) => {
21099
21111
  const { request } = args;
21100
21112
  if (!protocolHttp.HttpRequest.isInstance(request)) {
21101
21113
  return next(args);
21102
21114
  }
21103
21115
  const { headers } = request;
21104
- const userAgent = context?.userAgent?.map(escapeUserAgent) || [];
21116
+ const userAgent = context3?.userAgent?.map(escapeUserAgent) || [];
21105
21117
  const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
21106
- await checkFeatures(context, options, args);
21107
- const awsContext = context;
21108
- defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`);
21118
+ await checkFeatures(context3, options, args);
21119
+ const awsContext = context3;
21120
+ defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context3.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`);
21109
21121
  const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || [];
21110
21122
  const appId = await options.userAgentAppId();
21111
21123
  if (appId) {
@@ -22437,7 +22449,7 @@ var require_dist_cjs37 = __commonJS({
22437
22449
  this.eventStreamCodec = new eventstreamCodec.EventStreamCodec(options.utf8Encoder, options.utf8Decoder);
22438
22450
  this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0;
22439
22451
  }
22440
- async handle(next, args, context = {}) {
22452
+ async handle(next, args, context3 = {}) {
22441
22453
  const request = args.request;
22442
22454
  const { body: payload2, headers, query: query2 } = request;
22443
22455
  if (!(payload2 instanceof ReadableStream)) {
@@ -23421,7 +23433,7 @@ var require_dist_cjs44 = __commonJS({
23421
23433
  }
23422
23434
  return urlParser.parseUrl(endpoint);
23423
23435
  };
23424
- var getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => {
23436
+ var getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context3) => {
23425
23437
  if (!clientConfig.isCustomEndpoint) {
23426
23438
  let endpointFromConfig;
23427
23439
  if (clientConfig.serviceConfiguredEndpoint) {
@@ -23438,7 +23450,7 @@ var require_dist_cjs44 = __commonJS({
23438
23450
  if (typeof clientConfig.endpointProvider !== "function") {
23439
23451
  throw new Error("config.endpointProvider is not set.");
23440
23452
  }
23441
- const endpoint = clientConfig.endpointProvider(endpointParams, context);
23453
+ const endpoint = clientConfig.endpointProvider(endpointParams, context3);
23442
23454
  return endpoint;
23443
23455
  };
23444
23456
  var resolveParams = async (commandInput, instructionsSupplier, clientConfig) => {
@@ -23472,22 +23484,22 @@ var require_dist_cjs44 = __commonJS({
23472
23484
  return endpointParams;
23473
23485
  };
23474
23486
  var endpointMiddleware = ({ config, instructions }) => {
23475
- return (next, context) => async (args) => {
23487
+ return (next, context3) => async (args) => {
23476
23488
  if (config.isCustomEndpoint) {
23477
- core.setFeature(context, "ENDPOINT_OVERRIDE", "N");
23489
+ core.setFeature(context3, "ENDPOINT_OVERRIDE", "N");
23478
23490
  }
23479
23491
  const endpoint = await getEndpointFromInstructions(args.input, {
23480
23492
  getEndpointParameterInstructions() {
23481
23493
  return instructions;
23482
23494
  }
23483
- }, { ...config }, context);
23484
- context.endpointV2 = endpoint;
23485
- context.authSchemes = endpoint.properties?.authSchemes;
23486
- const authScheme = context.authSchemes?.[0];
23495
+ }, { ...config }, context3);
23496
+ context3.endpointV2 = endpoint;
23497
+ context3.authSchemes = endpoint.properties?.authSchemes;
23498
+ const authScheme = context3.authSchemes?.[0];
23487
23499
  if (authScheme) {
23488
- context["signing_region"] = authScheme.signingRegion;
23489
- context["signing_service"] = authScheme.signingName;
23490
- const smithyContext = utilMiddleware.getSmithyContext(context);
23500
+ context3["signing_region"] = authScheme.signingRegion;
23501
+ context3["signing_service"] = authScheme.signingName;
23502
+ const smithyContext = utilMiddleware.getSmithyContext(context3);
23491
23503
  const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption;
23492
23504
  if (httpAuthOption) {
23493
23505
  httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, {
@@ -24136,12 +24148,12 @@ var require_dist_cjs47 = __commonJS({
24136
24148
  clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions);
24137
24149
  }
24138
24150
  });
24139
- var retryMiddleware = (options) => (next, context) => async (args) => {
24151
+ var retryMiddleware = (options) => (next, context3) => async (args) => {
24140
24152
  let retryStrategy = await options.retryStrategy();
24141
24153
  const maxAttempts = await options.maxAttempts();
24142
24154
  if (isRetryStrategyV2(retryStrategy)) {
24143
24155
  retryStrategy = retryStrategy;
24144
- let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]);
24156
+ let retryToken = await retryStrategy.acquireInitialRetryToken(context3["partition_id"]);
24145
24157
  let lastError = new Error();
24146
24158
  let attempts = 0;
24147
24159
  let totalRetryDelay = 0;
@@ -24164,7 +24176,7 @@ var require_dist_cjs47 = __commonJS({
24164
24176
  const retryErrorInfo = getRetryErrorInfo(e3);
24165
24177
  lastError = asSdkError(e3);
24166
24178
  if (isRequest && isStreamingPayload.isStreamingPayload(request)) {
24167
- (context.logger instanceof smithyClient.NoOpLogger ? console : context.logger)?.warn("An error was encountered in a non-retryable streaming request.");
24179
+ (context3.logger instanceof smithyClient.NoOpLogger ? console : context3.logger)?.warn("An error was encountered in a non-retryable streaming request.");
24168
24180
  throw lastError;
24169
24181
  }
24170
24182
  try {
@@ -24186,7 +24198,7 @@ var require_dist_cjs47 = __commonJS({
24186
24198
  } else {
24187
24199
  retryStrategy = retryStrategy;
24188
24200
  if (retryStrategy?.mode)
24189
- context.userAgent = [...context.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]];
24201
+ context3.userAgent = [...context3.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]];
24190
24202
  return retryStrategy.retry(next, args);
24191
24203
  }
24192
24204
  };
@@ -24266,9 +24278,9 @@ var require_httpAuthSchemeProvider = __commonJS({
24266
24278
  var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2));
24267
24279
  var core_2 = (init_dist_es(), __toCommonJS(dist_es_exports));
24268
24280
  var util_middleware_1 = require_dist_cjs7();
24269
- var defaultBedrockRuntimeHttpAuthSchemeParametersProvider = async (config, context, input) => {
24281
+ var defaultBedrockRuntimeHttpAuthSchemeParametersProvider = async (config, context3, input) => {
24270
24282
  return {
24271
- operation: (0, util_middleware_1.getSmithyContext)(context).operation,
24283
+ operation: (0, util_middleware_1.getSmithyContext)(context3).operation,
24272
24284
  region: await (0, util_middleware_1.normalizeProvider)(config.region)() || (() => {
24273
24285
  throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
24274
24286
  })()
@@ -24282,10 +24294,10 @@ var require_httpAuthSchemeProvider = __commonJS({
24282
24294
  name: "bedrock",
24283
24295
  region: authParameters.region
24284
24296
  },
24285
- propertiesExtractor: (config, context) => ({
24297
+ propertiesExtractor: (config, context3) => ({
24286
24298
  signingProperties: {
24287
24299
  config,
24288
- context
24300
+ context: context3
24289
24301
  }
24290
24302
  })
24291
24303
  };
@@ -24293,7 +24305,7 @@ var require_httpAuthSchemeProvider = __commonJS({
24293
24305
  function createSmithyApiHttpBearerAuthHttpAuthOption(authParameters) {
24294
24306
  return {
24295
24307
  schemeId: "smithy.api#httpBearerAuth",
24296
- propertiesExtractor: ({ profile, filepath, configFilepath, ignoreCache }, context) => ({
24308
+ propertiesExtractor: ({ profile, filepath, configFilepath, ignoreCache }, context3) => ({
24297
24309
  identityProperties: {
24298
24310
  profile,
24299
24311
  filepath,
@@ -25039,10 +25051,10 @@ function createAwsAuthSigv4HttpAuthOption(authParameters) {
25039
25051
  name: "sso-oauth",
25040
25052
  region: authParameters.region
25041
25053
  },
25042
- propertiesExtractor: (config, context) => ({
25054
+ propertiesExtractor: (config, context3) => ({
25043
25055
  signingProperties: {
25044
25056
  config,
25045
- context
25057
+ context: context3
25046
25058
  }
25047
25059
  })
25048
25060
  };
@@ -25057,9 +25069,9 @@ var init_httpAuthSchemeProvider = __esm({
25057
25069
  "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthSchemeProvider.js"() {
25058
25070
  init_dist_es2();
25059
25071
  import_util_middleware6 = __toESM(require_dist_cjs7());
25060
- defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context, input) => {
25072
+ defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context3, input) => {
25061
25073
  return {
25062
- operation: (0, import_util_middleware6.getSmithyContext)(context).operation,
25074
+ operation: (0, import_util_middleware6.getSmithyContext)(context3).operation,
25063
25075
  region: await (0, import_util_middleware6.normalizeProvider)(config.region)() || (() => {
25064
25076
  throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
25065
25077
  })()
@@ -25405,10 +25417,10 @@ var init_endpointResolver = __esm({
25405
25417
  size: 50,
25406
25418
  params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"]
25407
25419
  });
25408
- defaultEndpointResolver = (endpointParams, context = {}) => {
25420
+ defaultEndpointResolver = (endpointParams, context3 = {}) => {
25409
25421
  return cache.get(endpointParams, () => (0, import_util_endpoints2.resolveEndpoint)(ruleSet, {
25410
25422
  endpointParams,
25411
- logger: context.logger
25423
+ logger: context3.logger
25412
25424
  }));
25413
25425
  };
25414
25426
  import_util_endpoints2.customEndpointFunctions.aws = import_util_endpoints.awsEndpointFunctions;
@@ -26018,8 +26030,8 @@ var init_Aws_restJson1 = __esm({
26018
26030
  import_smithy_client14 = __toESM(require_dist_cjs27());
26019
26031
  init_models_0();
26020
26032
  init_SSOOIDCServiceException();
26021
- se_CreateTokenCommand = async (input, context) => {
26022
- const b3 = requestBuilder(input, context);
26033
+ se_CreateTokenCommand = async (input, context3) => {
26034
+ const b3 = requestBuilder(input, context3);
26023
26035
  const headers = {
26024
26036
  "content-type": "application/json"
26025
26037
  };
@@ -26039,14 +26051,14 @@ var init_Aws_restJson1 = __esm({
26039
26051
  b3.m("POST").h(headers).b(body);
26040
26052
  return b3.build();
26041
26053
  };
26042
- de_CreateTokenCommand = async (output, context) => {
26054
+ de_CreateTokenCommand = async (output, context3) => {
26043
26055
  if (output.statusCode !== 200 && output.statusCode >= 300) {
26044
- return de_CommandError(output, context);
26056
+ return de_CommandError(output, context3);
26045
26057
  }
26046
26058
  const contents = (0, import_smithy_client14.map)({
26047
26059
  $metadata: deserializeMetadata(output)
26048
26060
  });
26049
- const data2 = (0, import_smithy_client14.expectNonNull)((0, import_smithy_client14.expectObject)(await parseJsonBody(output.body, context)), "body");
26061
+ const data2 = (0, import_smithy_client14.expectNonNull)((0, import_smithy_client14.expectObject)(await parseJsonBody(output.body, context3)), "body");
26050
26062
  const doc = (0, import_smithy_client14.take)(data2, {
26051
26063
  accessToken: import_smithy_client14.expectString,
26052
26064
  expiresIn: import_smithy_client14.expectInt32,
@@ -26057,46 +26069,46 @@ var init_Aws_restJson1 = __esm({
26057
26069
  Object.assign(contents, doc);
26058
26070
  return contents;
26059
26071
  };
26060
- de_CommandError = async (output, context) => {
26072
+ de_CommandError = async (output, context3) => {
26061
26073
  const parsedOutput = {
26062
26074
  ...output,
26063
- body: await parseJsonErrorBody(output.body, context)
26075
+ body: await parseJsonErrorBody(output.body, context3)
26064
26076
  };
26065
26077
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
26066
26078
  switch (errorCode) {
26067
26079
  case "AccessDeniedException":
26068
26080
  case "com.amazonaws.ssooidc#AccessDeniedException":
26069
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
26081
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context3);
26070
26082
  case "AuthorizationPendingException":
26071
26083
  case "com.amazonaws.ssooidc#AuthorizationPendingException":
26072
- throw await de_AuthorizationPendingExceptionRes(parsedOutput, context);
26084
+ throw await de_AuthorizationPendingExceptionRes(parsedOutput, context3);
26073
26085
  case "ExpiredTokenException":
26074
26086
  case "com.amazonaws.ssooidc#ExpiredTokenException":
26075
- throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
26087
+ throw await de_ExpiredTokenExceptionRes(parsedOutput, context3);
26076
26088
  case "InternalServerException":
26077
26089
  case "com.amazonaws.ssooidc#InternalServerException":
26078
- throw await de_InternalServerExceptionRes(parsedOutput, context);
26090
+ throw await de_InternalServerExceptionRes(parsedOutput, context3);
26079
26091
  case "InvalidClientException":
26080
26092
  case "com.amazonaws.ssooidc#InvalidClientException":
26081
- throw await de_InvalidClientExceptionRes(parsedOutput, context);
26093
+ throw await de_InvalidClientExceptionRes(parsedOutput, context3);
26082
26094
  case "InvalidGrantException":
26083
26095
  case "com.amazonaws.ssooidc#InvalidGrantException":
26084
- throw await de_InvalidGrantExceptionRes(parsedOutput, context);
26096
+ throw await de_InvalidGrantExceptionRes(parsedOutput, context3);
26085
26097
  case "InvalidRequestException":
26086
26098
  case "com.amazonaws.ssooidc#InvalidRequestException":
26087
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
26099
+ throw await de_InvalidRequestExceptionRes(parsedOutput, context3);
26088
26100
  case "InvalidScopeException":
26089
26101
  case "com.amazonaws.ssooidc#InvalidScopeException":
26090
- throw await de_InvalidScopeExceptionRes(parsedOutput, context);
26102
+ throw await de_InvalidScopeExceptionRes(parsedOutput, context3);
26091
26103
  case "SlowDownException":
26092
26104
  case "com.amazonaws.ssooidc#SlowDownException":
26093
- throw await de_SlowDownExceptionRes(parsedOutput, context);
26105
+ throw await de_SlowDownExceptionRes(parsedOutput, context3);
26094
26106
  case "UnauthorizedClientException":
26095
26107
  case "com.amazonaws.ssooidc#UnauthorizedClientException":
26096
- throw await de_UnauthorizedClientExceptionRes(parsedOutput, context);
26108
+ throw await de_UnauthorizedClientExceptionRes(parsedOutput, context3);
26097
26109
  case "UnsupportedGrantTypeException":
26098
26110
  case "com.amazonaws.ssooidc#UnsupportedGrantTypeException":
26099
- throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context);
26111
+ throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context3);
26100
26112
  default:
26101
26113
  const parsedBody = parsedOutput.body;
26102
26114
  return throwDefaultError({
@@ -26107,7 +26119,7 @@ var init_Aws_restJson1 = __esm({
26107
26119
  }
26108
26120
  };
26109
26121
  throwDefaultError = (0, import_smithy_client14.withBaseException)(SSOOIDCServiceException);
26110
- de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
26122
+ de_AccessDeniedExceptionRes = async (parsedOutput, context3) => {
26111
26123
  const contents = (0, import_smithy_client14.map)({});
26112
26124
  const data2 = parsedOutput.body;
26113
26125
  const doc = (0, import_smithy_client14.take)(data2, {
@@ -26122,7 +26134,7 @@ var init_Aws_restJson1 = __esm({
26122
26134
  });
26123
26135
  return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
26124
26136
  };
26125
- de_AuthorizationPendingExceptionRes = async (parsedOutput, context) => {
26137
+ de_AuthorizationPendingExceptionRes = async (parsedOutput, context3) => {
26126
26138
  const contents = (0, import_smithy_client14.map)({});
26127
26139
  const data2 = parsedOutput.body;
26128
26140
  const doc = (0, import_smithy_client14.take)(data2, {
@@ -26136,7 +26148,7 @@ var init_Aws_restJson1 = __esm({
26136
26148
  });
26137
26149
  return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
26138
26150
  };
26139
- de_ExpiredTokenExceptionRes = async (parsedOutput, context) => {
26151
+ de_ExpiredTokenExceptionRes = async (parsedOutput, context3) => {
26140
26152
  const contents = (0, import_smithy_client14.map)({});
26141
26153
  const data2 = parsedOutput.body;
26142
26154
  const doc = (0, import_smithy_client14.take)(data2, {
@@ -26150,7 +26162,7 @@ var init_Aws_restJson1 = __esm({
26150
26162
  });
26151
26163
  return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
26152
26164
  };
26153
- de_InternalServerExceptionRes = async (parsedOutput, context) => {
26165
+ de_InternalServerExceptionRes = async (parsedOutput, context3) => {
26154
26166
  const contents = (0, import_smithy_client14.map)({});
26155
26167
  const data2 = parsedOutput.body;
26156
26168
  const doc = (0, import_smithy_client14.take)(data2, {
@@ -26164,7 +26176,7 @@ var init_Aws_restJson1 = __esm({
26164
26176
  });
26165
26177
  return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
26166
26178
  };
26167
- de_InvalidClientExceptionRes = async (parsedOutput, context) => {
26179
+ de_InvalidClientExceptionRes = async (parsedOutput, context3) => {
26168
26180
  const contents = (0, import_smithy_client14.map)({});
26169
26181
  const data2 = parsedOutput.body;
26170
26182
  const doc = (0, import_smithy_client14.take)(data2, {
@@ -26178,7 +26190,7 @@ var init_Aws_restJson1 = __esm({
26178
26190
  });
26179
26191
  return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
26180
26192
  };
26181
- de_InvalidGrantExceptionRes = async (parsedOutput, context) => {
26193
+ de_InvalidGrantExceptionRes = async (parsedOutput, context3) => {
26182
26194
  const contents = (0, import_smithy_client14.map)({});
26183
26195
  const data2 = parsedOutput.body;
26184
26196
  const doc = (0, import_smithy_client14.take)(data2, {
@@ -26192,7 +26204,7 @@ var init_Aws_restJson1 = __esm({
26192
26204
  });
26193
26205
  return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
26194
26206
  };
26195
- de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
26207
+ de_InvalidRequestExceptionRes = async (parsedOutput, context3) => {
26196
26208
  const contents = (0, import_smithy_client14.map)({});
26197
26209
  const data2 = parsedOutput.body;
26198
26210
  const doc = (0, import_smithy_client14.take)(data2, {
@@ -26207,7 +26219,7 @@ var init_Aws_restJson1 = __esm({
26207
26219
  });
26208
26220
  return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
26209
26221
  };
26210
- de_InvalidScopeExceptionRes = async (parsedOutput, context) => {
26222
+ de_InvalidScopeExceptionRes = async (parsedOutput, context3) => {
26211
26223
  const contents = (0, import_smithy_client14.map)({});
26212
26224
  const data2 = parsedOutput.body;
26213
26225
  const doc = (0, import_smithy_client14.take)(data2, {
@@ -26221,7 +26233,7 @@ var init_Aws_restJson1 = __esm({
26221
26233
  });
26222
26234
  return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
26223
26235
  };
26224
- de_SlowDownExceptionRes = async (parsedOutput, context) => {
26236
+ de_SlowDownExceptionRes = async (parsedOutput, context3) => {
26225
26237
  const contents = (0, import_smithy_client14.map)({});
26226
26238
  const data2 = parsedOutput.body;
26227
26239
  const doc = (0, import_smithy_client14.take)(data2, {
@@ -26235,7 +26247,7 @@ var init_Aws_restJson1 = __esm({
26235
26247
  });
26236
26248
  return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
26237
26249
  };
26238
- de_UnauthorizedClientExceptionRes = async (parsedOutput, context) => {
26250
+ de_UnauthorizedClientExceptionRes = async (parsedOutput, context3) => {
26239
26251
  const contents = (0, import_smithy_client14.map)({});
26240
26252
  const data2 = parsedOutput.body;
26241
26253
  const doc = (0, import_smithy_client14.take)(data2, {
@@ -26249,7 +26261,7 @@ var init_Aws_restJson1 = __esm({
26249
26261
  });
26250
26262
  return (0, import_smithy_client14.decorateServiceException)(exception, parsedOutput.body);
26251
26263
  };
26252
- de_UnsupportedGrantTypeExceptionRes = async (parsedOutput, context) => {
26264
+ de_UnsupportedGrantTypeExceptionRes = async (parsedOutput, context3) => {
26253
26265
  const contents = (0, import_smithy_client14.map)({});
26254
26266
  const data2 = parsedOutput.body;
26255
26267
  const doc = (0, import_smithy_client14.take)(data2, {
@@ -26517,9 +26529,9 @@ var require_httpAuthSchemeProvider2 = __commonJS({
26517
26529
  exports2.resolveHttpAuthSchemeConfig = exports2.defaultSSOHttpAuthSchemeProvider = exports2.defaultSSOHttpAuthSchemeParametersProvider = void 0;
26518
26530
  var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2));
26519
26531
  var util_middleware_1 = require_dist_cjs7();
26520
- var defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => {
26532
+ var defaultSSOHttpAuthSchemeParametersProvider = async (config, context3, input) => {
26521
26533
  return {
26522
- operation: (0, util_middleware_1.getSmithyContext)(context).operation,
26534
+ operation: (0, util_middleware_1.getSmithyContext)(context3).operation,
26523
26535
  region: await (0, util_middleware_1.normalizeProvider)(config.region)() || (() => {
26524
26536
  throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
26525
26537
  })()
@@ -26533,10 +26545,10 @@ var require_httpAuthSchemeProvider2 = __commonJS({
26533
26545
  name: "awsssoportal",
26534
26546
  region: authParameters.region
26535
26547
  },
26536
- propertiesExtractor: (config, context) => ({
26548
+ propertiesExtractor: (config, context3) => ({
26537
26549
  signingProperties: {
26538
26550
  config,
26539
- context
26551
+ context: context3
26540
26552
  }
26541
26553
  })
26542
26554
  };
@@ -26734,10 +26746,10 @@ var require_endpointResolver = __commonJS({
26734
26746
  size: 50,
26735
26747
  params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"]
26736
26748
  });
26737
- var defaultEndpointResolver3 = (endpointParams, context = {}) => {
26749
+ var defaultEndpointResolver3 = (endpointParams, context3 = {}) => {
26738
26750
  return cache3.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
26739
26751
  endpointParams,
26740
- logger: context.logger
26752
+ logger: context3.logger
26741
26753
  }));
26742
26754
  };
26743
26755
  exports2.defaultEndpointResolver = defaultEndpointResolver3;
@@ -27035,8 +27047,8 @@ var require_dist_cjs57 = __commonJS({
27035
27047
  ...obj,
27036
27048
  ...obj.accessToken && { accessToken: smithyClient.SENSITIVE_STRING }
27037
27049
  });
27038
- var se_GetRoleCredentialsCommand = async (input, context) => {
27039
- const b3 = core.requestBuilder(input, context);
27050
+ var se_GetRoleCredentialsCommand = async (input, context3) => {
27051
+ const b3 = core.requestBuilder(input, context3);
27040
27052
  const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
27041
27053
  [_xasbt]: input[_aT]
27042
27054
  });
@@ -27049,8 +27061,8 @@ var require_dist_cjs57 = __commonJS({
27049
27061
  b3.m("GET").h(headers).q(query2).b(body);
27050
27062
  return b3.build();
27051
27063
  };
27052
- var se_ListAccountRolesCommand = async (input, context) => {
27053
- const b3 = core.requestBuilder(input, context);
27064
+ var se_ListAccountRolesCommand = async (input, context3) => {
27065
+ const b3 = core.requestBuilder(input, context3);
27054
27066
  const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
27055
27067
  [_xasbt]: input[_aT]
27056
27068
  });
@@ -27064,8 +27076,8 @@ var require_dist_cjs57 = __commonJS({
27064
27076
  b3.m("GET").h(headers).q(query2).b(body);
27065
27077
  return b3.build();
27066
27078
  };
27067
- var se_ListAccountsCommand = async (input, context) => {
27068
- const b3 = core.requestBuilder(input, context);
27079
+ var se_ListAccountsCommand = async (input, context3) => {
27080
+ const b3 = core.requestBuilder(input, context3);
27069
27081
  const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
27070
27082
  [_xasbt]: input[_aT]
27071
27083
  });
@@ -27078,8 +27090,8 @@ var require_dist_cjs57 = __commonJS({
27078
27090
  b3.m("GET").h(headers).q(query2).b(body);
27079
27091
  return b3.build();
27080
27092
  };
27081
- var se_LogoutCommand = async (input, context) => {
27082
- const b3 = core.requestBuilder(input, context);
27093
+ var se_LogoutCommand = async (input, context3) => {
27094
+ const b3 = core.requestBuilder(input, context3);
27083
27095
  const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
27084
27096
  [_xasbt]: input[_aT]
27085
27097
  });
@@ -27088,28 +27100,28 @@ var require_dist_cjs57 = __commonJS({
27088
27100
  b3.m("POST").h(headers).b(body);
27089
27101
  return b3.build();
27090
27102
  };
27091
- var de_GetRoleCredentialsCommand = async (output, context) => {
27103
+ var de_GetRoleCredentialsCommand = async (output, context3) => {
27092
27104
  if (output.statusCode !== 200 && output.statusCode >= 300) {
27093
- return de_CommandError3(output, context);
27105
+ return de_CommandError3(output, context3);
27094
27106
  }
27095
27107
  const contents = smithyClient.map({
27096
27108
  $metadata: deserializeMetadata3(output)
27097
27109
  });
27098
- const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
27110
+ const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context3)), "body");
27099
27111
  const doc = smithyClient.take(data2, {
27100
27112
  roleCredentials: smithyClient._json
27101
27113
  });
27102
27114
  Object.assign(contents, doc);
27103
27115
  return contents;
27104
27116
  };
27105
- var de_ListAccountRolesCommand = async (output, context) => {
27117
+ var de_ListAccountRolesCommand = async (output, context3) => {
27106
27118
  if (output.statusCode !== 200 && output.statusCode >= 300) {
27107
- return de_CommandError3(output, context);
27119
+ return de_CommandError3(output, context3);
27108
27120
  }
27109
27121
  const contents = smithyClient.map({
27110
27122
  $metadata: deserializeMetadata3(output)
27111
27123
  });
27112
- const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
27124
+ const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context3)), "body");
27113
27125
  const doc = smithyClient.take(data2, {
27114
27126
  nextToken: smithyClient.expectString,
27115
27127
  roleList: smithyClient._json
@@ -27117,14 +27129,14 @@ var require_dist_cjs57 = __commonJS({
27117
27129
  Object.assign(contents, doc);
27118
27130
  return contents;
27119
27131
  };
27120
- var de_ListAccountsCommand = async (output, context) => {
27132
+ var de_ListAccountsCommand = async (output, context3) => {
27121
27133
  if (output.statusCode !== 200 && output.statusCode >= 300) {
27122
- return de_CommandError3(output, context);
27134
+ return de_CommandError3(output, context3);
27123
27135
  }
27124
27136
  const contents = smithyClient.map({
27125
27137
  $metadata: deserializeMetadata3(output)
27126
27138
  });
27127
- const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
27139
+ const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context3)), "body");
27128
27140
  const doc = smithyClient.take(data2, {
27129
27141
  accountList: smithyClient._json,
27130
27142
  nextToken: smithyClient.expectString
@@ -27132,20 +27144,20 @@ var require_dist_cjs57 = __commonJS({
27132
27144
  Object.assign(contents, doc);
27133
27145
  return contents;
27134
27146
  };
27135
- var de_LogoutCommand = async (output, context) => {
27147
+ var de_LogoutCommand = async (output, context3) => {
27136
27148
  if (output.statusCode !== 200 && output.statusCode >= 300) {
27137
- return de_CommandError3(output, context);
27149
+ return de_CommandError3(output, context3);
27138
27150
  }
27139
27151
  const contents = smithyClient.map({
27140
27152
  $metadata: deserializeMetadata3(output)
27141
27153
  });
27142
- await smithyClient.collectBody(output.body, context);
27154
+ await smithyClient.collectBody(output.body, context3);
27143
27155
  return contents;
27144
27156
  };
27145
- var de_CommandError3 = async (output, context) => {
27157
+ var de_CommandError3 = async (output, context3) => {
27146
27158
  const parsedOutput = {
27147
27159
  ...output,
27148
- body: await core$1.parseJsonErrorBody(output.body, context)
27160
+ body: await core$1.parseJsonErrorBody(output.body, context3)
27149
27161
  };
27150
27162
  const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
27151
27163
  switch (errorCode) {
@@ -27171,7 +27183,7 @@ var require_dist_cjs57 = __commonJS({
27171
27183
  }
27172
27184
  };
27173
27185
  var throwDefaultError3 = smithyClient.withBaseException(SSOServiceException);
27174
- var de_InvalidRequestExceptionRes2 = async (parsedOutput, context) => {
27186
+ var de_InvalidRequestExceptionRes2 = async (parsedOutput, context3) => {
27175
27187
  const contents = smithyClient.map({});
27176
27188
  const data2 = parsedOutput.body;
27177
27189
  const doc = smithyClient.take(data2, {
@@ -27184,7 +27196,7 @@ var require_dist_cjs57 = __commonJS({
27184
27196
  });
27185
27197
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
27186
27198
  };
27187
- var de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
27199
+ var de_ResourceNotFoundExceptionRes = async (parsedOutput, context3) => {
27188
27200
  const contents = smithyClient.map({});
27189
27201
  const data2 = parsedOutput.body;
27190
27202
  const doc = smithyClient.take(data2, {
@@ -27197,7 +27209,7 @@ var require_dist_cjs57 = __commonJS({
27197
27209
  });
27198
27210
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
27199
27211
  };
27200
- var de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
27212
+ var de_TooManyRequestsExceptionRes = async (parsedOutput, context3) => {
27201
27213
  const contents = smithyClient.map({});
27202
27214
  const data2 = parsedOutput.body;
27203
27215
  const doc = smithyClient.take(data2, {
@@ -27210,7 +27222,7 @@ var require_dist_cjs57 = __commonJS({
27210
27222
  });
27211
27223
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
27212
27224
  };
27213
- var de_UnauthorizedExceptionRes = async (parsedOutput, context) => {
27225
+ var de_UnauthorizedExceptionRes = async (parsedOutput, context3) => {
27214
27226
  const contents = smithyClient.map({});
27215
27227
  const data2 = parsedOutput.body;
27216
27228
  const doc = smithyClient.take(data2, {
@@ -27517,10 +27529,10 @@ function createAwsAuthSigv4HttpAuthOption2(authParameters) {
27517
27529
  name: "sts",
27518
27530
  region: authParameters.region
27519
27531
  },
27520
- propertiesExtractor: (config, context) => ({
27532
+ propertiesExtractor: (config, context3) => ({
27521
27533
  signingProperties: {
27522
27534
  config,
27523
- context
27535
+ context: context3
27524
27536
  }
27525
27537
  })
27526
27538
  };
@@ -27536,9 +27548,9 @@ var init_httpAuthSchemeProvider2 = __esm({
27536
27548
  init_dist_es2();
27537
27549
  import_util_middleware7 = __toESM(require_dist_cjs7());
27538
27550
  init_STSClient();
27539
- defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => {
27551
+ defaultSTSHttpAuthSchemeParametersProvider = async (config, context3, input) => {
27540
27552
  return {
27541
- operation: (0, import_util_middleware7.getSmithyContext)(context).operation,
27553
+ operation: (0, import_util_middleware7.getSmithyContext)(context3).operation,
27542
27554
  region: await (0, import_util_middleware7.normalizeProvider)(config.region)() || (() => {
27543
27555
  throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
27544
27556
  })()
@@ -27648,10 +27660,10 @@ var init_endpointResolver2 = __esm({
27648
27660
  size: 50,
27649
27661
  params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"]
27650
27662
  });
27651
- defaultEndpointResolver2 = (endpointParams, context = {}) => {
27663
+ defaultEndpointResolver2 = (endpointParams, context3 = {}) => {
27652
27664
  return cache2.get(endpointParams, () => (0, import_util_endpoints4.resolveEndpoint)(ruleSet2, {
27653
27665
  endpointParams,
27654
- logger: context.logger
27666
+ logger: context3.logger
27655
27667
  }));
27656
27668
  };
27657
27669
  import_util_endpoints4.customEndpointFunctions.aws = import_util_endpoints3.awsEndpointFunctions;
@@ -28013,80 +28025,80 @@ var init_Aws_query = __esm({
28013
28025
  import_smithy_client24 = __toESM(require_dist_cjs27());
28014
28026
  init_models_02();
28015
28027
  init_STSServiceException();
28016
- se_AssumeRoleCommand = async (input, context) => {
28028
+ se_AssumeRoleCommand = async (input, context3) => {
28017
28029
  const headers = SHARED_HEADERS;
28018
28030
  let body;
28019
28031
  body = buildFormUrlencodedString({
28020
- ...se_AssumeRoleRequest(input, context),
28032
+ ...se_AssumeRoleRequest(input, context3),
28021
28033
  [_A]: _AR,
28022
28034
  [_V]: _
28023
28035
  });
28024
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
28036
+ return buildHttpRpcRequest(context3, headers, "/", void 0, body);
28025
28037
  };
28026
- se_AssumeRoleWithWebIdentityCommand = async (input, context) => {
28038
+ se_AssumeRoleWithWebIdentityCommand = async (input, context3) => {
28027
28039
  const headers = SHARED_HEADERS;
28028
28040
  let body;
28029
28041
  body = buildFormUrlencodedString({
28030
- ...se_AssumeRoleWithWebIdentityRequest(input, context),
28042
+ ...se_AssumeRoleWithWebIdentityRequest(input, context3),
28031
28043
  [_A]: _ARWWI,
28032
28044
  [_V]: _
28033
28045
  });
28034
- return buildHttpRpcRequest(context, headers, "/", void 0, body);
28046
+ return buildHttpRpcRequest(context3, headers, "/", void 0, body);
28035
28047
  };
28036
- de_AssumeRoleCommand = async (output, context) => {
28048
+ de_AssumeRoleCommand = async (output, context3) => {
28037
28049
  if (output.statusCode >= 300) {
28038
- return de_CommandError2(output, context);
28050
+ return de_CommandError2(output, context3);
28039
28051
  }
28040
- const data2 = await parseXmlBody(output.body, context);
28052
+ const data2 = await parseXmlBody(output.body, context3);
28041
28053
  let contents = {};
28042
- contents = de_AssumeRoleResponse(data2.AssumeRoleResult, context);
28054
+ contents = de_AssumeRoleResponse(data2.AssumeRoleResult, context3);
28043
28055
  const response = {
28044
28056
  $metadata: deserializeMetadata2(output),
28045
28057
  ...contents
28046
28058
  };
28047
28059
  return response;
28048
28060
  };
28049
- de_AssumeRoleWithWebIdentityCommand = async (output, context) => {
28061
+ de_AssumeRoleWithWebIdentityCommand = async (output, context3) => {
28050
28062
  if (output.statusCode >= 300) {
28051
- return de_CommandError2(output, context);
28063
+ return de_CommandError2(output, context3);
28052
28064
  }
28053
- const data2 = await parseXmlBody(output.body, context);
28065
+ const data2 = await parseXmlBody(output.body, context3);
28054
28066
  let contents = {};
28055
- contents = de_AssumeRoleWithWebIdentityResponse(data2.AssumeRoleWithWebIdentityResult, context);
28067
+ contents = de_AssumeRoleWithWebIdentityResponse(data2.AssumeRoleWithWebIdentityResult, context3);
28056
28068
  const response = {
28057
28069
  $metadata: deserializeMetadata2(output),
28058
28070
  ...contents
28059
28071
  };
28060
28072
  return response;
28061
28073
  };
28062
- de_CommandError2 = async (output, context) => {
28074
+ de_CommandError2 = async (output, context3) => {
28063
28075
  const parsedOutput = {
28064
28076
  ...output,
28065
- body: await parseXmlErrorBody(output.body, context)
28077
+ body: await parseXmlErrorBody(output.body, context3)
28066
28078
  };
28067
28079
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
28068
28080
  switch (errorCode) {
28069
28081
  case "ExpiredTokenException":
28070
28082
  case "com.amazonaws.sts#ExpiredTokenException":
28071
- throw await de_ExpiredTokenExceptionRes2(parsedOutput, context);
28083
+ throw await de_ExpiredTokenExceptionRes2(parsedOutput, context3);
28072
28084
  case "MalformedPolicyDocument":
28073
28085
  case "com.amazonaws.sts#MalformedPolicyDocumentException":
28074
- throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
28086
+ throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context3);
28075
28087
  case "PackedPolicyTooLarge":
28076
28088
  case "com.amazonaws.sts#PackedPolicyTooLargeException":
28077
- throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context);
28089
+ throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context3);
28078
28090
  case "RegionDisabledException":
28079
28091
  case "com.amazonaws.sts#RegionDisabledException":
28080
- throw await de_RegionDisabledExceptionRes(parsedOutput, context);
28092
+ throw await de_RegionDisabledExceptionRes(parsedOutput, context3);
28081
28093
  case "IDPCommunicationError":
28082
28094
  case "com.amazonaws.sts#IDPCommunicationErrorException":
28083
- throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context);
28095
+ throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context3);
28084
28096
  case "IDPRejectedClaim":
28085
28097
  case "com.amazonaws.sts#IDPRejectedClaimException":
28086
- throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context);
28098
+ throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context3);
28087
28099
  case "InvalidIdentityToken":
28088
28100
  case "com.amazonaws.sts#InvalidIdentityTokenException":
28089
- throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context);
28101
+ throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context3);
28090
28102
  default:
28091
28103
  const parsedBody = parsedOutput.body;
28092
28104
  return throwDefaultError2({
@@ -28096,70 +28108,70 @@ var init_Aws_query = __esm({
28096
28108
  });
28097
28109
  }
28098
28110
  };
28099
- de_ExpiredTokenExceptionRes2 = async (parsedOutput, context) => {
28111
+ de_ExpiredTokenExceptionRes2 = async (parsedOutput, context3) => {
28100
28112
  const body = parsedOutput.body;
28101
- const deserialized = de_ExpiredTokenException(body.Error, context);
28113
+ const deserialized = de_ExpiredTokenException(body.Error, context3);
28102
28114
  const exception = new ExpiredTokenException2({
28103
28115
  $metadata: deserializeMetadata2(parsedOutput),
28104
28116
  ...deserialized
28105
28117
  });
28106
28118
  return (0, import_smithy_client24.decorateServiceException)(exception, body);
28107
28119
  };
28108
- de_IDPCommunicationErrorExceptionRes = async (parsedOutput, context) => {
28120
+ de_IDPCommunicationErrorExceptionRes = async (parsedOutput, context3) => {
28109
28121
  const body = parsedOutput.body;
28110
- const deserialized = de_IDPCommunicationErrorException(body.Error, context);
28122
+ const deserialized = de_IDPCommunicationErrorException(body.Error, context3);
28111
28123
  const exception = new IDPCommunicationErrorException({
28112
28124
  $metadata: deserializeMetadata2(parsedOutput),
28113
28125
  ...deserialized
28114
28126
  });
28115
28127
  return (0, import_smithy_client24.decorateServiceException)(exception, body);
28116
28128
  };
28117
- de_IDPRejectedClaimExceptionRes = async (parsedOutput, context) => {
28129
+ de_IDPRejectedClaimExceptionRes = async (parsedOutput, context3) => {
28118
28130
  const body = parsedOutput.body;
28119
- const deserialized = de_IDPRejectedClaimException(body.Error, context);
28131
+ const deserialized = de_IDPRejectedClaimException(body.Error, context3);
28120
28132
  const exception = new IDPRejectedClaimException({
28121
28133
  $metadata: deserializeMetadata2(parsedOutput),
28122
28134
  ...deserialized
28123
28135
  });
28124
28136
  return (0, import_smithy_client24.decorateServiceException)(exception, body);
28125
28137
  };
28126
- de_InvalidIdentityTokenExceptionRes = async (parsedOutput, context) => {
28138
+ de_InvalidIdentityTokenExceptionRes = async (parsedOutput, context3) => {
28127
28139
  const body = parsedOutput.body;
28128
- const deserialized = de_InvalidIdentityTokenException(body.Error, context);
28140
+ const deserialized = de_InvalidIdentityTokenException(body.Error, context3);
28129
28141
  const exception = new InvalidIdentityTokenException({
28130
28142
  $metadata: deserializeMetadata2(parsedOutput),
28131
28143
  ...deserialized
28132
28144
  });
28133
28145
  return (0, import_smithy_client24.decorateServiceException)(exception, body);
28134
28146
  };
28135
- de_MalformedPolicyDocumentExceptionRes = async (parsedOutput, context) => {
28147
+ de_MalformedPolicyDocumentExceptionRes = async (parsedOutput, context3) => {
28136
28148
  const body = parsedOutput.body;
28137
- const deserialized = de_MalformedPolicyDocumentException(body.Error, context);
28149
+ const deserialized = de_MalformedPolicyDocumentException(body.Error, context3);
28138
28150
  const exception = new MalformedPolicyDocumentException({
28139
28151
  $metadata: deserializeMetadata2(parsedOutput),
28140
28152
  ...deserialized
28141
28153
  });
28142
28154
  return (0, import_smithy_client24.decorateServiceException)(exception, body);
28143
28155
  };
28144
- de_PackedPolicyTooLargeExceptionRes = async (parsedOutput, context) => {
28156
+ de_PackedPolicyTooLargeExceptionRes = async (parsedOutput, context3) => {
28145
28157
  const body = parsedOutput.body;
28146
- const deserialized = de_PackedPolicyTooLargeException(body.Error, context);
28158
+ const deserialized = de_PackedPolicyTooLargeException(body.Error, context3);
28147
28159
  const exception = new PackedPolicyTooLargeException({
28148
28160
  $metadata: deserializeMetadata2(parsedOutput),
28149
28161
  ...deserialized
28150
28162
  });
28151
28163
  return (0, import_smithy_client24.decorateServiceException)(exception, body);
28152
28164
  };
28153
- de_RegionDisabledExceptionRes = async (parsedOutput, context) => {
28165
+ de_RegionDisabledExceptionRes = async (parsedOutput, context3) => {
28154
28166
  const body = parsedOutput.body;
28155
- const deserialized = de_RegionDisabledException(body.Error, context);
28167
+ const deserialized = de_RegionDisabledException(body.Error, context3);
28156
28168
  const exception = new RegionDisabledException({
28157
28169
  $metadata: deserializeMetadata2(parsedOutput),
28158
28170
  ...deserialized
28159
28171
  });
28160
28172
  return (0, import_smithy_client24.decorateServiceException)(exception, body);
28161
28173
  };
28162
- se_AssumeRoleRequest = (input, context) => {
28174
+ se_AssumeRoleRequest = (input, context3) => {
28163
28175
  const entries = {};
28164
28176
  if (input[_RA] != null) {
28165
28177
  entries[_RA] = input[_RA];
@@ -28168,7 +28180,7 @@ var init_Aws_query = __esm({
28168
28180
  entries[_RSN] = input[_RSN];
28169
28181
  }
28170
28182
  if (input[_PA] != null) {
28171
- const memberEntries = se_policyDescriptorListType(input[_PA], context);
28183
+ const memberEntries = se_policyDescriptorListType(input[_PA], context3);
28172
28184
  if (input[_PA]?.length === 0) {
28173
28185
  entries.PolicyArns = [];
28174
28186
  }
@@ -28184,7 +28196,7 @@ var init_Aws_query = __esm({
28184
28196
  entries[_DS] = input[_DS];
28185
28197
  }
28186
28198
  if (input[_T] != null) {
28187
- const memberEntries = se_tagListType(input[_T], context);
28199
+ const memberEntries = se_tagListType(input[_T], context3);
28188
28200
  if (input[_T]?.length === 0) {
28189
28201
  entries.Tags = [];
28190
28202
  }
@@ -28194,7 +28206,7 @@ var init_Aws_query = __esm({
28194
28206
  });
28195
28207
  }
28196
28208
  if (input[_TTK] != null) {
28197
- const memberEntries = se_tagKeyListType(input[_TTK], context);
28209
+ const memberEntries = se_tagKeyListType(input[_TTK], context3);
28198
28210
  if (input[_TTK]?.length === 0) {
28199
28211
  entries.TransitiveTagKeys = [];
28200
28212
  }
@@ -28216,7 +28228,7 @@ var init_Aws_query = __esm({
28216
28228
  entries[_SI] = input[_SI];
28217
28229
  }
28218
28230
  if (input[_PC] != null) {
28219
- const memberEntries = se_ProvidedContextsListType(input[_PC], context);
28231
+ const memberEntries = se_ProvidedContextsListType(input[_PC], context3);
28220
28232
  if (input[_PC]?.length === 0) {
28221
28233
  entries.ProvidedContexts = [];
28222
28234
  }
@@ -28227,7 +28239,7 @@ var init_Aws_query = __esm({
28227
28239
  }
28228
28240
  return entries;
28229
28241
  };
28230
- se_AssumeRoleWithWebIdentityRequest = (input, context) => {
28242
+ se_AssumeRoleWithWebIdentityRequest = (input, context3) => {
28231
28243
  const entries = {};
28232
28244
  if (input[_RA] != null) {
28233
28245
  entries[_RA] = input[_RA];
@@ -28242,7 +28254,7 @@ var init_Aws_query = __esm({
28242
28254
  entries[_PI] = input[_PI];
28243
28255
  }
28244
28256
  if (input[_PA] != null) {
28245
- const memberEntries = se_policyDescriptorListType(input[_PA], context);
28257
+ const memberEntries = se_policyDescriptorListType(input[_PA], context3);
28246
28258
  if (input[_PA]?.length === 0) {
28247
28259
  entries.PolicyArns = [];
28248
28260
  }
@@ -28259,14 +28271,14 @@ var init_Aws_query = __esm({
28259
28271
  }
28260
28272
  return entries;
28261
28273
  };
28262
- se_policyDescriptorListType = (input, context) => {
28274
+ se_policyDescriptorListType = (input, context3) => {
28263
28275
  const entries = {};
28264
28276
  let counter = 1;
28265
28277
  for (const entry of input) {
28266
28278
  if (entry === null) {
28267
28279
  continue;
28268
28280
  }
28269
- const memberEntries = se_PolicyDescriptorType(entry, context);
28281
+ const memberEntries = se_PolicyDescriptorType(entry, context3);
28270
28282
  Object.entries(memberEntries).forEach(([key, value]) => {
28271
28283
  entries[`member.${counter}.${key}`] = value;
28272
28284
  });
@@ -28274,14 +28286,14 @@ var init_Aws_query = __esm({
28274
28286
  }
28275
28287
  return entries;
28276
28288
  };
28277
- se_PolicyDescriptorType = (input, context) => {
28289
+ se_PolicyDescriptorType = (input, context3) => {
28278
28290
  const entries = {};
28279
28291
  if (input[_a15] != null) {
28280
28292
  entries[_a15] = input[_a15];
28281
28293
  }
28282
28294
  return entries;
28283
28295
  };
28284
- se_ProvidedContext = (input, context) => {
28296
+ se_ProvidedContext = (input, context3) => {
28285
28297
  const entries = {};
28286
28298
  if (input[_PAr] != null) {
28287
28299
  entries[_PAr] = input[_PAr];
@@ -28291,14 +28303,14 @@ var init_Aws_query = __esm({
28291
28303
  }
28292
28304
  return entries;
28293
28305
  };
28294
- se_ProvidedContextsListType = (input, context) => {
28306
+ se_ProvidedContextsListType = (input, context3) => {
28295
28307
  const entries = {};
28296
28308
  let counter = 1;
28297
28309
  for (const entry of input) {
28298
28310
  if (entry === null) {
28299
28311
  continue;
28300
28312
  }
28301
- const memberEntries = se_ProvidedContext(entry, context);
28313
+ const memberEntries = se_ProvidedContext(entry, context3);
28302
28314
  Object.entries(memberEntries).forEach(([key, value]) => {
28303
28315
  entries[`member.${counter}.${key}`] = value;
28304
28316
  });
@@ -28306,7 +28318,7 @@ var init_Aws_query = __esm({
28306
28318
  }
28307
28319
  return entries;
28308
28320
  };
28309
- se_Tag = (input, context) => {
28321
+ se_Tag = (input, context3) => {
28310
28322
  const entries = {};
28311
28323
  if (input[_K] != null) {
28312
28324
  entries[_K] = input[_K];
@@ -28316,7 +28328,7 @@ var init_Aws_query = __esm({
28316
28328
  }
28317
28329
  return entries;
28318
28330
  };
28319
- se_tagKeyListType = (input, context) => {
28331
+ se_tagKeyListType = (input, context3) => {
28320
28332
  const entries = {};
28321
28333
  let counter = 1;
28322
28334
  for (const entry of input) {
@@ -28328,14 +28340,14 @@ var init_Aws_query = __esm({
28328
28340
  }
28329
28341
  return entries;
28330
28342
  };
28331
- se_tagListType = (input, context) => {
28343
+ se_tagListType = (input, context3) => {
28332
28344
  const entries = {};
28333
28345
  let counter = 1;
28334
28346
  for (const entry of input) {
28335
28347
  if (entry === null) {
28336
28348
  continue;
28337
28349
  }
28338
- const memberEntries = se_Tag(entry, context);
28350
+ const memberEntries = se_Tag(entry, context3);
28339
28351
  Object.entries(memberEntries).forEach(([key, value]) => {
28340
28352
  entries[`member.${counter}.${key}`] = value;
28341
28353
  });
@@ -28343,7 +28355,7 @@ var init_Aws_query = __esm({
28343
28355
  }
28344
28356
  return entries;
28345
28357
  };
28346
- de_AssumedRoleUser = (output, context) => {
28358
+ de_AssumedRoleUser = (output, context3) => {
28347
28359
  const contents = {};
28348
28360
  if (output[_ARI] != null) {
28349
28361
  contents[_ARI] = (0, import_smithy_client24.expectString)(output[_ARI]);
@@ -28353,13 +28365,13 @@ var init_Aws_query = __esm({
28353
28365
  }
28354
28366
  return contents;
28355
28367
  };
28356
- de_AssumeRoleResponse = (output, context) => {
28368
+ de_AssumeRoleResponse = (output, context3) => {
28357
28369
  const contents = {};
28358
28370
  if (output[_C] != null) {
28359
- contents[_C] = de_Credentials(output[_C], context);
28371
+ contents[_C] = de_Credentials(output[_C], context3);
28360
28372
  }
28361
28373
  if (output[_ARU] != null) {
28362
- contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
28374
+ contents[_ARU] = de_AssumedRoleUser(output[_ARU], context3);
28363
28375
  }
28364
28376
  if (output[_PPS] != null) {
28365
28377
  contents[_PPS] = (0, import_smithy_client24.strictParseInt32)(output[_PPS]);
@@ -28369,16 +28381,16 @@ var init_Aws_query = __esm({
28369
28381
  }
28370
28382
  return contents;
28371
28383
  };
28372
- de_AssumeRoleWithWebIdentityResponse = (output, context) => {
28384
+ de_AssumeRoleWithWebIdentityResponse = (output, context3) => {
28373
28385
  const contents = {};
28374
28386
  if (output[_C] != null) {
28375
- contents[_C] = de_Credentials(output[_C], context);
28387
+ contents[_C] = de_Credentials(output[_C], context3);
28376
28388
  }
28377
28389
  if (output[_SFWIT] != null) {
28378
28390
  contents[_SFWIT] = (0, import_smithy_client24.expectString)(output[_SFWIT]);
28379
28391
  }
28380
28392
  if (output[_ARU] != null) {
28381
- contents[_ARU] = de_AssumedRoleUser(output[_ARU], context);
28393
+ contents[_ARU] = de_AssumedRoleUser(output[_ARU], context3);
28382
28394
  }
28383
28395
  if (output[_PPS] != null) {
28384
28396
  contents[_PPS] = (0, import_smithy_client24.strictParseInt32)(output[_PPS]);
@@ -28394,7 +28406,7 @@ var init_Aws_query = __esm({
28394
28406
  }
28395
28407
  return contents;
28396
28408
  };
28397
- de_Credentials = (output, context) => {
28409
+ de_Credentials = (output, context3) => {
28398
28410
  const contents = {};
28399
28411
  if (output[_AKI] != null) {
28400
28412
  contents[_AKI] = (0, import_smithy_client24.expectString)(output[_AKI]);
@@ -28410,49 +28422,49 @@ var init_Aws_query = __esm({
28410
28422
  }
28411
28423
  return contents;
28412
28424
  };
28413
- de_ExpiredTokenException = (output, context) => {
28425
+ de_ExpiredTokenException = (output, context3) => {
28414
28426
  const contents = {};
28415
28427
  if (output[_m] != null) {
28416
28428
  contents[_m] = (0, import_smithy_client24.expectString)(output[_m]);
28417
28429
  }
28418
28430
  return contents;
28419
28431
  };
28420
- de_IDPCommunicationErrorException = (output, context) => {
28432
+ de_IDPCommunicationErrorException = (output, context3) => {
28421
28433
  const contents = {};
28422
28434
  if (output[_m] != null) {
28423
28435
  contents[_m] = (0, import_smithy_client24.expectString)(output[_m]);
28424
28436
  }
28425
28437
  return contents;
28426
28438
  };
28427
- de_IDPRejectedClaimException = (output, context) => {
28439
+ de_IDPRejectedClaimException = (output, context3) => {
28428
28440
  const contents = {};
28429
28441
  if (output[_m] != null) {
28430
28442
  contents[_m] = (0, import_smithy_client24.expectString)(output[_m]);
28431
28443
  }
28432
28444
  return contents;
28433
28445
  };
28434
- de_InvalidIdentityTokenException = (output, context) => {
28446
+ de_InvalidIdentityTokenException = (output, context3) => {
28435
28447
  const contents = {};
28436
28448
  if (output[_m] != null) {
28437
28449
  contents[_m] = (0, import_smithy_client24.expectString)(output[_m]);
28438
28450
  }
28439
28451
  return contents;
28440
28452
  };
28441
- de_MalformedPolicyDocumentException = (output, context) => {
28453
+ de_MalformedPolicyDocumentException = (output, context3) => {
28442
28454
  const contents = {};
28443
28455
  if (output[_m] != null) {
28444
28456
  contents[_m] = (0, import_smithy_client24.expectString)(output[_m]);
28445
28457
  }
28446
28458
  return contents;
28447
28459
  };
28448
- de_PackedPolicyTooLargeException = (output, context) => {
28460
+ de_PackedPolicyTooLargeException = (output, context3) => {
28449
28461
  const contents = {};
28450
28462
  if (output[_m] != null) {
28451
28463
  contents[_m] = (0, import_smithy_client24.expectString)(output[_m]);
28452
28464
  }
28453
28465
  return contents;
28454
28466
  };
28455
- de_RegionDisabledException = (output, context) => {
28467
+ de_RegionDisabledException = (output, context3) => {
28456
28468
  const contents = {};
28457
28469
  if (output[_m] != null) {
28458
28470
  contents[_m] = (0, import_smithy_client24.expectString)(output[_m]);
@@ -28466,8 +28478,8 @@ var init_Aws_query = __esm({
28466
28478
  cfId: output.headers["x-amz-cf-id"]
28467
28479
  });
28468
28480
  throwDefaultError2 = (0, import_smithy_client24.withBaseException)(STSServiceException);
28469
- buildHttpRpcRequest = async (context, headers, path7, resolvedHostname, body) => {
28470
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
28481
+ buildHttpRpcRequest = async (context3, headers, path7, resolvedHostname, body) => {
28482
+ const { hostname, protocol = "https", port, path: basePath } = await context3.endpoint();
28471
28483
  const contents = {
28472
28484
  protocol,
28473
28485
  hostname,
@@ -29350,7 +29362,7 @@ var require_dist_cjs63 = __commonJS({
29350
29362
  this.eventStreamCodec = new import_eventstream_codec.EventStreamCodec(options.utf8Encoder, options.utf8Decoder);
29351
29363
  this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0;
29352
29364
  }
29353
- async handle(next, args, context = {}) {
29365
+ async handle(next, args, context3 = {}) {
29354
29366
  const request = args.request;
29355
29367
  const { body: payload2, query: query2 } = request;
29356
29368
  if (!(payload2 instanceof import_stream.Readable)) {
@@ -29487,10 +29499,10 @@ var require_endpointResolver2 = __commonJS({
29487
29499
  size: 50,
29488
29500
  params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"]
29489
29501
  });
29490
- var defaultEndpointResolver3 = (endpointParams, context = {}) => {
29502
+ var defaultEndpointResolver3 = (endpointParams, context3 = {}) => {
29491
29503
  return cache3.get(endpointParams, () => (0, util_endpoints_2.resolveEndpoint)(ruleset_1.ruleSet, {
29492
29504
  endpointParams,
29493
- logger: context.logger
29505
+ logger: context3.logger
29494
29506
  }));
29495
29507
  };
29496
29508
  exports2.defaultEndpointResolver = defaultEndpointResolver3;
@@ -30898,8 +30910,8 @@ var require_dist_cjs65 = __commonJS({
30898
30910
  ...obj,
30899
30911
  ...obj.input && { input: CountTokensInputFilterSensitiveLog(obj.input) }
30900
30912
  });
30901
- var se_ApplyGuardrailCommand = async (input, context) => {
30902
- const b3 = core.requestBuilder(input, context);
30913
+ var se_ApplyGuardrailCommand = async (input, context3) => {
30914
+ const b3 = core.requestBuilder(input, context3);
30903
30915
  const headers = {
30904
30916
  "content-type": "application/json"
30905
30917
  };
@@ -30908,15 +30920,15 @@ var require_dist_cjs65 = __commonJS({
30908
30920
  b3.p("guardrailVersion", () => input.guardrailVersion, "{guardrailVersion}", false);
30909
30921
  let body;
30910
30922
  body = JSON.stringify(smithyClient.take(input, {
30911
- content: (_2) => se_GuardrailContentBlockList(_2, context),
30923
+ content: (_2) => se_GuardrailContentBlockList(_2, context3),
30912
30924
  outputScope: [],
30913
30925
  source: []
30914
30926
  }));
30915
30927
  b3.m("POST").h(headers).b(body);
30916
30928
  return b3.build();
30917
30929
  };
30918
- var se_ConverseCommand = async (input, context) => {
30919
- const b3 = core.requestBuilder(input, context);
30930
+ var se_ConverseCommand = async (input, context3) => {
30931
+ const b3 = core.requestBuilder(input, context3);
30920
30932
  const headers = {
30921
30933
  "content-type": "application/json"
30922
30934
  };
@@ -30928,18 +30940,18 @@ var require_dist_cjs65 = __commonJS({
30928
30940
  additionalModelResponseFieldPaths: (_2) => smithyClient._json(_2),
30929
30941
  guardrailConfig: (_2) => smithyClient._json(_2),
30930
30942
  inferenceConfig: (_2) => se_InferenceConfiguration(_2),
30931
- messages: (_2) => se_Messages(_2, context),
30943
+ messages: (_2) => se_Messages(_2, context3),
30932
30944
  performanceConfig: (_2) => smithyClient._json(_2),
30933
30945
  promptVariables: (_2) => smithyClient._json(_2),
30934
30946
  requestMetadata: (_2) => smithyClient._json(_2),
30935
- system: (_2) => se_SystemContentBlocks(_2, context),
30947
+ system: (_2) => se_SystemContentBlocks(_2, context3),
30936
30948
  toolConfig: (_2) => se_ToolConfiguration(_2)
30937
30949
  }));
30938
30950
  b3.m("POST").h(headers).b(body);
30939
30951
  return b3.build();
30940
30952
  };
30941
- var se_ConverseStreamCommand = async (input, context) => {
30942
- const b3 = core.requestBuilder(input, context);
30953
+ var se_ConverseStreamCommand = async (input, context3) => {
30954
+ const b3 = core.requestBuilder(input, context3);
30943
30955
  const headers = {
30944
30956
  "content-type": "application/json"
30945
30957
  };
@@ -30951,18 +30963,18 @@ var require_dist_cjs65 = __commonJS({
30951
30963
  additionalModelResponseFieldPaths: (_2) => smithyClient._json(_2),
30952
30964
  guardrailConfig: (_2) => smithyClient._json(_2),
30953
30965
  inferenceConfig: (_2) => se_InferenceConfiguration(_2),
30954
- messages: (_2) => se_Messages(_2, context),
30966
+ messages: (_2) => se_Messages(_2, context3),
30955
30967
  performanceConfig: (_2) => smithyClient._json(_2),
30956
30968
  promptVariables: (_2) => smithyClient._json(_2),
30957
30969
  requestMetadata: (_2) => smithyClient._json(_2),
30958
- system: (_2) => se_SystemContentBlocks(_2, context),
30970
+ system: (_2) => se_SystemContentBlocks(_2, context3),
30959
30971
  toolConfig: (_2) => se_ToolConfiguration(_2)
30960
30972
  }));
30961
30973
  b3.m("POST").h(headers).b(body);
30962
30974
  return b3.build();
30963
30975
  };
30964
- var se_CountTokensCommand = async (input, context) => {
30965
- const b3 = core.requestBuilder(input, context);
30976
+ var se_CountTokensCommand = async (input, context3) => {
30977
+ const b3 = core.requestBuilder(input, context3);
30966
30978
  const headers = {
30967
30979
  "content-type": "application/json"
30968
30980
  };
@@ -30970,13 +30982,13 @@ var require_dist_cjs65 = __commonJS({
30970
30982
  b3.p("modelId", () => input.modelId, "{modelId}", false);
30971
30983
  let body;
30972
30984
  body = JSON.stringify(smithyClient.take(input, {
30973
- input: (_2) => se_CountTokensInput(_2, context)
30985
+ input: (_2) => se_CountTokensInput(_2, context3)
30974
30986
  }));
30975
30987
  b3.m("POST").h(headers).b(body);
30976
30988
  return b3.build();
30977
30989
  };
30978
- var se_GetAsyncInvokeCommand = async (input, context) => {
30979
- const b3 = core.requestBuilder(input, context);
30990
+ var se_GetAsyncInvokeCommand = async (input, context3) => {
30991
+ const b3 = core.requestBuilder(input, context3);
30980
30992
  const headers = {};
30981
30993
  b3.bp("/async-invoke/{invocationArn}");
30982
30994
  b3.p("invocationArn", () => input.invocationArn, "{invocationArn}", false);
@@ -30984,8 +30996,8 @@ var require_dist_cjs65 = __commonJS({
30984
30996
  b3.m("GET").h(headers).b(body);
30985
30997
  return b3.build();
30986
30998
  };
30987
- var se_InvokeModelCommand = async (input, context) => {
30988
- const b3 = core.requestBuilder(input, context);
30999
+ var se_InvokeModelCommand = async (input, context3) => {
31000
+ const b3 = core.requestBuilder(input, context3);
30989
31001
  const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
30990
31002
  [_ct]: input[_cT] || "application/octet-stream",
30991
31003
  [_a16]: input[_a16],
@@ -31003,8 +31015,8 @@ var require_dist_cjs65 = __commonJS({
31003
31015
  b3.m("POST").h(headers).b(body);
31004
31016
  return b3.build();
31005
31017
  };
31006
- var se_InvokeModelWithBidirectionalStreamCommand = async (input, context) => {
31007
- const b3 = core.requestBuilder(input, context);
31018
+ var se_InvokeModelWithBidirectionalStreamCommand = async (input, context3) => {
31019
+ const b3 = core.requestBuilder(input, context3);
31008
31020
  const headers = {
31009
31021
  "content-type": "application/json"
31010
31022
  };
@@ -31012,13 +31024,13 @@ var require_dist_cjs65 = __commonJS({
31012
31024
  b3.p("modelId", () => input.modelId, "{modelId}", false);
31013
31025
  let body;
31014
31026
  if (input.body !== void 0) {
31015
- body = se_InvokeModelWithBidirectionalStreamInput(input.body, context);
31027
+ body = se_InvokeModelWithBidirectionalStreamInput(input.body, context3);
31016
31028
  }
31017
31029
  b3.m("POST").h(headers).b(body);
31018
31030
  return b3.build();
31019
31031
  };
31020
- var se_InvokeModelWithResponseStreamCommand = async (input, context) => {
31021
- const b3 = core.requestBuilder(input, context);
31032
+ var se_InvokeModelWithResponseStreamCommand = async (input, context3) => {
31033
+ const b3 = core.requestBuilder(input, context3);
31022
31034
  const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
31023
31035
  [_ct]: input[_cT] || "application/octet-stream",
31024
31036
  [_xaba]: input[_a16],
@@ -31036,8 +31048,8 @@ var require_dist_cjs65 = __commonJS({
31036
31048
  b3.m("POST").h(headers).b(body);
31037
31049
  return b3.build();
31038
31050
  };
31039
- var se_ListAsyncInvokesCommand = async (input, context) => {
31040
- const b3 = core.requestBuilder(input, context);
31051
+ var se_ListAsyncInvokesCommand = async (input, context3) => {
31052
+ const b3 = core.requestBuilder(input, context3);
31041
31053
  const headers = {};
31042
31054
  b3.bp("/async-invoke");
31043
31055
  const query2 = smithyClient.map({
@@ -31053,8 +31065,8 @@ var require_dist_cjs65 = __commonJS({
31053
31065
  b3.m("GET").h(headers).q(query2).b(body);
31054
31066
  return b3.build();
31055
31067
  };
31056
- var se_StartAsyncInvokeCommand = async (input, context) => {
31057
- const b3 = core.requestBuilder(input, context);
31068
+ var se_StartAsyncInvokeCommand = async (input, context3) => {
31069
+ const b3 = core.requestBuilder(input, context3);
31058
31070
  const headers = {
31059
31071
  "content-type": "application/json"
31060
31072
  };
@@ -31070,14 +31082,14 @@ var require_dist_cjs65 = __commonJS({
31070
31082
  b3.m("POST").h(headers).b(body);
31071
31083
  return b3.build();
31072
31084
  };
31073
- var de_ApplyGuardrailCommand = async (output, context) => {
31085
+ var de_ApplyGuardrailCommand = async (output, context3) => {
31074
31086
  if (output.statusCode !== 200 && output.statusCode >= 300) {
31075
- return de_CommandError3(output, context);
31087
+ return de_CommandError3(output, context3);
31076
31088
  }
31077
31089
  const contents = smithyClient.map({
31078
31090
  $metadata: deserializeMetadata3(output)
31079
31091
  });
31080
- const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
31092
+ const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context3)), "body");
31081
31093
  const doc = smithyClient.take(data2, {
31082
31094
  action: smithyClient.expectString,
31083
31095
  actionReason: smithyClient.expectString,
@@ -31089,18 +31101,18 @@ var require_dist_cjs65 = __commonJS({
31089
31101
  Object.assign(contents, doc);
31090
31102
  return contents;
31091
31103
  };
31092
- var de_ConverseCommand = async (output, context) => {
31104
+ var de_ConverseCommand = async (output, context3) => {
31093
31105
  if (output.statusCode !== 200 && output.statusCode >= 300) {
31094
- return de_CommandError3(output, context);
31106
+ return de_CommandError3(output, context3);
31095
31107
  }
31096
31108
  const contents = smithyClient.map({
31097
31109
  $metadata: deserializeMetadata3(output)
31098
31110
  });
31099
- const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
31111
+ const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context3)), "body");
31100
31112
  const doc = smithyClient.take(data2, {
31101
31113
  additionalModelResponseFields: (_2) => de_Document(_2),
31102
31114
  metrics: smithyClient._json,
31103
- output: (_2) => de_ConverseOutput(core$1.awsExpectUnion(_2), context),
31115
+ output: (_2) => de_ConverseOutput(core$1.awsExpectUnion(_2), context3),
31104
31116
  performanceConfig: smithyClient._json,
31105
31117
  stopReason: smithyClient.expectString,
31106
31118
  trace: (_2) => de_ConverseTrace(_2),
@@ -31109,39 +31121,39 @@ var require_dist_cjs65 = __commonJS({
31109
31121
  Object.assign(contents, doc);
31110
31122
  return contents;
31111
31123
  };
31112
- var de_ConverseStreamCommand = async (output, context) => {
31124
+ var de_ConverseStreamCommand = async (output, context3) => {
31113
31125
  if (output.statusCode !== 200 && output.statusCode >= 300) {
31114
- return de_CommandError3(output, context);
31126
+ return de_CommandError3(output, context3);
31115
31127
  }
31116
31128
  const contents = smithyClient.map({
31117
31129
  $metadata: deserializeMetadata3(output)
31118
31130
  });
31119
31131
  const data2 = output.body;
31120
- contents.stream = de_ConverseStreamOutput(data2, context);
31132
+ contents.stream = de_ConverseStreamOutput(data2, context3);
31121
31133
  return contents;
31122
31134
  };
31123
- var de_CountTokensCommand = async (output, context) => {
31135
+ var de_CountTokensCommand = async (output, context3) => {
31124
31136
  if (output.statusCode !== 200 && output.statusCode >= 300) {
31125
- return de_CommandError3(output, context);
31137
+ return de_CommandError3(output, context3);
31126
31138
  }
31127
31139
  const contents = smithyClient.map({
31128
31140
  $metadata: deserializeMetadata3(output)
31129
31141
  });
31130
- const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
31142
+ const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context3)), "body");
31131
31143
  const doc = smithyClient.take(data2, {
31132
31144
  inputTokens: smithyClient.expectInt32
31133
31145
  });
31134
31146
  Object.assign(contents, doc);
31135
31147
  return contents;
31136
31148
  };
31137
- var de_GetAsyncInvokeCommand = async (output, context) => {
31149
+ var de_GetAsyncInvokeCommand = async (output, context3) => {
31138
31150
  if (output.statusCode !== 200 && output.statusCode >= 300) {
31139
- return de_CommandError3(output, context);
31151
+ return de_CommandError3(output, context3);
31140
31152
  }
31141
31153
  const contents = smithyClient.map({
31142
31154
  $metadata: deserializeMetadata3(output)
31143
31155
  });
31144
- const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
31156
+ const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context3)), "body");
31145
31157
  const doc = smithyClient.take(data2, {
31146
31158
  clientRequestToken: smithyClient.expectString,
31147
31159
  endTime: (_2) => smithyClient.expectNonNull(smithyClient.parseRfc3339DateTimeWithOffset(_2)),
@@ -31156,33 +31168,33 @@ var require_dist_cjs65 = __commonJS({
31156
31168
  Object.assign(contents, doc);
31157
31169
  return contents;
31158
31170
  };
31159
- var de_InvokeModelCommand = async (output, context) => {
31171
+ var de_InvokeModelCommand = async (output, context3) => {
31160
31172
  if (output.statusCode !== 200 && output.statusCode >= 300) {
31161
- return de_CommandError3(output, context);
31173
+ return de_CommandError3(output, context3);
31162
31174
  }
31163
31175
  const contents = smithyClient.map({
31164
31176
  $metadata: deserializeMetadata3(output),
31165
31177
  [_cT]: [, output.headers[_ct]],
31166
31178
  [_pCL]: [, output.headers[_xabpl]]
31167
31179
  });
31168
- const data2 = await smithyClient.collectBody(output.body, context);
31180
+ const data2 = await smithyClient.collectBody(output.body, context3);
31169
31181
  contents.body = data2;
31170
31182
  return contents;
31171
31183
  };
31172
- var de_InvokeModelWithBidirectionalStreamCommand = async (output, context) => {
31184
+ var de_InvokeModelWithBidirectionalStreamCommand = async (output, context3) => {
31173
31185
  if (output.statusCode !== 200 && output.statusCode >= 300) {
31174
- return de_CommandError3(output, context);
31186
+ return de_CommandError3(output, context3);
31175
31187
  }
31176
31188
  const contents = smithyClient.map({
31177
31189
  $metadata: deserializeMetadata3(output)
31178
31190
  });
31179
31191
  const data2 = output.body;
31180
- contents.body = de_InvokeModelWithBidirectionalStreamOutput(data2, context);
31192
+ contents.body = de_InvokeModelWithBidirectionalStreamOutput(data2, context3);
31181
31193
  return contents;
31182
31194
  };
31183
- var de_InvokeModelWithResponseStreamCommand = async (output, context) => {
31195
+ var de_InvokeModelWithResponseStreamCommand = async (output, context3) => {
31184
31196
  if (output.statusCode !== 200 && output.statusCode >= 300) {
31185
- return de_CommandError3(output, context);
31197
+ return de_CommandError3(output, context3);
31186
31198
  }
31187
31199
  const contents = smithyClient.map({
31188
31200
  $metadata: deserializeMetadata3(output),
@@ -31190,17 +31202,17 @@ var require_dist_cjs65 = __commonJS({
31190
31202
  [_pCL]: [, output.headers[_xabpl]]
31191
31203
  });
31192
31204
  const data2 = output.body;
31193
- contents.body = de_ResponseStream(data2, context);
31205
+ contents.body = de_ResponseStream(data2, context3);
31194
31206
  return contents;
31195
31207
  };
31196
- var de_ListAsyncInvokesCommand = async (output, context) => {
31208
+ var de_ListAsyncInvokesCommand = async (output, context3) => {
31197
31209
  if (output.statusCode !== 200 && output.statusCode >= 300) {
31198
- return de_CommandError3(output, context);
31210
+ return de_CommandError3(output, context3);
31199
31211
  }
31200
31212
  const contents = smithyClient.map({
31201
31213
  $metadata: deserializeMetadata3(output)
31202
31214
  });
31203
- const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
31215
+ const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context3)), "body");
31204
31216
  const doc = smithyClient.take(data2, {
31205
31217
  asyncInvokeSummaries: (_2) => de_AsyncInvokeSummaries(_2),
31206
31218
  nextToken: smithyClient.expectString
@@ -31208,24 +31220,24 @@ var require_dist_cjs65 = __commonJS({
31208
31220
  Object.assign(contents, doc);
31209
31221
  return contents;
31210
31222
  };
31211
- var de_StartAsyncInvokeCommand = async (output, context) => {
31223
+ var de_StartAsyncInvokeCommand = async (output, context3) => {
31212
31224
  if (output.statusCode !== 200 && output.statusCode >= 300) {
31213
- return de_CommandError3(output, context);
31225
+ return de_CommandError3(output, context3);
31214
31226
  }
31215
31227
  const contents = smithyClient.map({
31216
31228
  $metadata: deserializeMetadata3(output)
31217
31229
  });
31218
- const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
31230
+ const data2 = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context3)), "body");
31219
31231
  const doc = smithyClient.take(data2, {
31220
31232
  invocationArn: smithyClient.expectString
31221
31233
  });
31222
31234
  Object.assign(contents, doc);
31223
31235
  return contents;
31224
31236
  };
31225
- var de_CommandError3 = async (output, context) => {
31237
+ var de_CommandError3 = async (output, context3) => {
31226
31238
  const parsedOutput = {
31227
31239
  ...output,
31228
- body: await core$1.parseJsonErrorBody(output.body, context)
31240
+ body: await core$1.parseJsonErrorBody(output.body, context3)
31229
31241
  };
31230
31242
  const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
31231
31243
  switch (errorCode) {
@@ -31275,7 +31287,7 @@ var require_dist_cjs65 = __commonJS({
31275
31287
  }
31276
31288
  };
31277
31289
  var throwDefaultError3 = smithyClient.withBaseException(BedrockRuntimeServiceException);
31278
- var de_AccessDeniedExceptionRes2 = async (parsedOutput, context) => {
31290
+ var de_AccessDeniedExceptionRes2 = async (parsedOutput, context3) => {
31279
31291
  const contents = smithyClient.map({});
31280
31292
  const data2 = parsedOutput.body;
31281
31293
  const doc = smithyClient.take(data2, {
@@ -31288,7 +31300,7 @@ var require_dist_cjs65 = __commonJS({
31288
31300
  });
31289
31301
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
31290
31302
  };
31291
- var de_ConflictExceptionRes = async (parsedOutput, context) => {
31303
+ var de_ConflictExceptionRes = async (parsedOutput, context3) => {
31292
31304
  const contents = smithyClient.map({});
31293
31305
  const data2 = parsedOutput.body;
31294
31306
  const doc = smithyClient.take(data2, {
@@ -31301,7 +31313,7 @@ var require_dist_cjs65 = __commonJS({
31301
31313
  });
31302
31314
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
31303
31315
  };
31304
- var de_InternalServerExceptionRes2 = async (parsedOutput, context) => {
31316
+ var de_InternalServerExceptionRes2 = async (parsedOutput, context3) => {
31305
31317
  const contents = smithyClient.map({});
31306
31318
  const data2 = parsedOutput.body;
31307
31319
  const doc = smithyClient.take(data2, {
@@ -31314,7 +31326,7 @@ var require_dist_cjs65 = __commonJS({
31314
31326
  });
31315
31327
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
31316
31328
  };
31317
- var de_ModelErrorExceptionRes = async (parsedOutput, context) => {
31329
+ var de_ModelErrorExceptionRes = async (parsedOutput, context3) => {
31318
31330
  const contents = smithyClient.map({});
31319
31331
  const data2 = parsedOutput.body;
31320
31332
  const doc = smithyClient.take(data2, {
@@ -31329,7 +31341,7 @@ var require_dist_cjs65 = __commonJS({
31329
31341
  });
31330
31342
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
31331
31343
  };
31332
- var de_ModelNotReadyExceptionRes = async (parsedOutput, context) => {
31344
+ var de_ModelNotReadyExceptionRes = async (parsedOutput, context3) => {
31333
31345
  const contents = smithyClient.map({});
31334
31346
  const data2 = parsedOutput.body;
31335
31347
  const doc = smithyClient.take(data2, {
@@ -31342,7 +31354,7 @@ var require_dist_cjs65 = __commonJS({
31342
31354
  });
31343
31355
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
31344
31356
  };
31345
- var de_ModelStreamErrorExceptionRes = async (parsedOutput, context) => {
31357
+ var de_ModelStreamErrorExceptionRes = async (parsedOutput, context3) => {
31346
31358
  const contents = smithyClient.map({});
31347
31359
  const data2 = parsedOutput.body;
31348
31360
  const doc = smithyClient.take(data2, {
@@ -31357,7 +31369,7 @@ var require_dist_cjs65 = __commonJS({
31357
31369
  });
31358
31370
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
31359
31371
  };
31360
- var de_ModelTimeoutExceptionRes = async (parsedOutput, context) => {
31372
+ var de_ModelTimeoutExceptionRes = async (parsedOutput, context3) => {
31361
31373
  const contents = smithyClient.map({});
31362
31374
  const data2 = parsedOutput.body;
31363
31375
  const doc = smithyClient.take(data2, {
@@ -31370,7 +31382,7 @@ var require_dist_cjs65 = __commonJS({
31370
31382
  });
31371
31383
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
31372
31384
  };
31373
- var de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
31385
+ var de_ResourceNotFoundExceptionRes = async (parsedOutput, context3) => {
31374
31386
  const contents = smithyClient.map({});
31375
31387
  const data2 = parsedOutput.body;
31376
31388
  const doc = smithyClient.take(data2, {
@@ -31383,7 +31395,7 @@ var require_dist_cjs65 = __commonJS({
31383
31395
  });
31384
31396
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
31385
31397
  };
31386
- var de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
31398
+ var de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context3) => {
31387
31399
  const contents = smithyClient.map({});
31388
31400
  const data2 = parsedOutput.body;
31389
31401
  const doc = smithyClient.take(data2, {
@@ -31396,7 +31408,7 @@ var require_dist_cjs65 = __commonJS({
31396
31408
  });
31397
31409
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
31398
31410
  };
31399
- var de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
31411
+ var de_ServiceUnavailableExceptionRes = async (parsedOutput, context3) => {
31400
31412
  const contents = smithyClient.map({});
31401
31413
  const data2 = parsedOutput.body;
31402
31414
  const doc = smithyClient.take(data2, {
@@ -31409,7 +31421,7 @@ var require_dist_cjs65 = __commonJS({
31409
31421
  });
31410
31422
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
31411
31423
  };
31412
- var de_ThrottlingExceptionRes = async (parsedOutput, context) => {
31424
+ var de_ThrottlingExceptionRes = async (parsedOutput, context3) => {
31413
31425
  const contents = smithyClient.map({});
31414
31426
  const data2 = parsedOutput.body;
31415
31427
  const doc = smithyClient.take(data2, {
@@ -31422,7 +31434,7 @@ var require_dist_cjs65 = __commonJS({
31422
31434
  });
31423
31435
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
31424
31436
  };
31425
- var de_ValidationExceptionRes = async (parsedOutput, context) => {
31437
+ var de_ValidationExceptionRes = async (parsedOutput, context3) => {
31426
31438
  const contents = smithyClient.map({});
31427
31439
  const data2 = parsedOutput.body;
31428
31440
  const doc = smithyClient.take(data2, {
@@ -31435,367 +31447,367 @@ var require_dist_cjs65 = __commonJS({
31435
31447
  });
31436
31448
  return smithyClient.decorateServiceException(exception, parsedOutput.body);
31437
31449
  };
31438
- var se_InvokeModelWithBidirectionalStreamInput = (input, context) => {
31450
+ var se_InvokeModelWithBidirectionalStreamInput = (input, context3) => {
31439
31451
  const eventMarshallingVisitor = (event) => exports2.InvokeModelWithBidirectionalStreamInput.visit(event, {
31440
- chunk: (value) => se_BidirectionalInputPayloadPart_event(value, context),
31452
+ chunk: (value) => se_BidirectionalInputPayloadPart_event(value, context3),
31441
31453
  _: (value) => value
31442
31454
  });
31443
- return context.eventStreamMarshaller.serialize(input, eventMarshallingVisitor);
31455
+ return context3.eventStreamMarshaller.serialize(input, eventMarshallingVisitor);
31444
31456
  };
31445
- var se_BidirectionalInputPayloadPart_event = (input, context) => {
31457
+ var se_BidirectionalInputPayloadPart_event = (input, context3) => {
31446
31458
  const headers = {
31447
31459
  ":event-type": { type: "string", value: "chunk" },
31448
31460
  ":message-type": { type: "string", value: "event" },
31449
31461
  ":content-type": { type: "string", value: "application/json" }
31450
31462
  };
31451
31463
  let body = new Uint8Array();
31452
- body = se_BidirectionalInputPayloadPart(input, context);
31453
- body = context.utf8Decoder(JSON.stringify(body));
31464
+ body = se_BidirectionalInputPayloadPart(input, context3);
31465
+ body = context3.utf8Decoder(JSON.stringify(body));
31454
31466
  return { headers, body };
31455
31467
  };
31456
- var de_ConverseStreamOutput = (output, context) => {
31457
- return context.eventStreamMarshaller.deserialize(output, async (event) => {
31468
+ var de_ConverseStreamOutput = (output, context3) => {
31469
+ return context3.eventStreamMarshaller.deserialize(output, async (event) => {
31458
31470
  if (event["messageStart"] != null) {
31459
31471
  return {
31460
- messageStart: await de_MessageStartEvent_event(event["messageStart"], context)
31472
+ messageStart: await de_MessageStartEvent_event(event["messageStart"], context3)
31461
31473
  };
31462
31474
  }
31463
31475
  if (event["contentBlockStart"] != null) {
31464
31476
  return {
31465
- contentBlockStart: await de_ContentBlockStartEvent_event(event["contentBlockStart"], context)
31477
+ contentBlockStart: await de_ContentBlockStartEvent_event(event["contentBlockStart"], context3)
31466
31478
  };
31467
31479
  }
31468
31480
  if (event["contentBlockDelta"] != null) {
31469
31481
  return {
31470
- contentBlockDelta: await de_ContentBlockDeltaEvent_event(event["contentBlockDelta"], context)
31482
+ contentBlockDelta: await de_ContentBlockDeltaEvent_event(event["contentBlockDelta"], context3)
31471
31483
  };
31472
31484
  }
31473
31485
  if (event["contentBlockStop"] != null) {
31474
31486
  return {
31475
- contentBlockStop: await de_ContentBlockStopEvent_event(event["contentBlockStop"], context)
31487
+ contentBlockStop: await de_ContentBlockStopEvent_event(event["contentBlockStop"], context3)
31476
31488
  };
31477
31489
  }
31478
31490
  if (event["messageStop"] != null) {
31479
31491
  return {
31480
- messageStop: await de_MessageStopEvent_event(event["messageStop"], context)
31492
+ messageStop: await de_MessageStopEvent_event(event["messageStop"], context3)
31481
31493
  };
31482
31494
  }
31483
31495
  if (event["metadata"] != null) {
31484
31496
  return {
31485
- metadata: await de_ConverseStreamMetadataEvent_event(event["metadata"], context)
31497
+ metadata: await de_ConverseStreamMetadataEvent_event(event["metadata"], context3)
31486
31498
  };
31487
31499
  }
31488
31500
  if (event["internalServerException"] != null) {
31489
31501
  return {
31490
- internalServerException: await de_InternalServerException_event(event["internalServerException"], context)
31502
+ internalServerException: await de_InternalServerException_event(event["internalServerException"], context3)
31491
31503
  };
31492
31504
  }
31493
31505
  if (event["modelStreamErrorException"] != null) {
31494
31506
  return {
31495
- modelStreamErrorException: await de_ModelStreamErrorException_event(event["modelStreamErrorException"], context)
31507
+ modelStreamErrorException: await de_ModelStreamErrorException_event(event["modelStreamErrorException"], context3)
31496
31508
  };
31497
31509
  }
31498
31510
  if (event["validationException"] != null) {
31499
31511
  return {
31500
- validationException: await de_ValidationException_event(event["validationException"], context)
31512
+ validationException: await de_ValidationException_event(event["validationException"], context3)
31501
31513
  };
31502
31514
  }
31503
31515
  if (event["throttlingException"] != null) {
31504
31516
  return {
31505
- throttlingException: await de_ThrottlingException_event(event["throttlingException"], context)
31517
+ throttlingException: await de_ThrottlingException_event(event["throttlingException"], context3)
31506
31518
  };
31507
31519
  }
31508
31520
  if (event["serviceUnavailableException"] != null) {
31509
31521
  return {
31510
- serviceUnavailableException: await de_ServiceUnavailableException_event(event["serviceUnavailableException"], context)
31522
+ serviceUnavailableException: await de_ServiceUnavailableException_event(event["serviceUnavailableException"], context3)
31511
31523
  };
31512
31524
  }
31513
31525
  return { $unknown: event };
31514
31526
  });
31515
31527
  };
31516
- var de_InvokeModelWithBidirectionalStreamOutput = (output, context) => {
31517
- return context.eventStreamMarshaller.deserialize(output, async (event) => {
31528
+ var de_InvokeModelWithBidirectionalStreamOutput = (output, context3) => {
31529
+ return context3.eventStreamMarshaller.deserialize(output, async (event) => {
31518
31530
  if (event["chunk"] != null) {
31519
31531
  return {
31520
- chunk: await de_BidirectionalOutputPayloadPart_event(event["chunk"], context)
31532
+ chunk: await de_BidirectionalOutputPayloadPart_event(event["chunk"], context3)
31521
31533
  };
31522
31534
  }
31523
31535
  if (event["internalServerException"] != null) {
31524
31536
  return {
31525
- internalServerException: await de_InternalServerException_event(event["internalServerException"], context)
31537
+ internalServerException: await de_InternalServerException_event(event["internalServerException"], context3)
31526
31538
  };
31527
31539
  }
31528
31540
  if (event["modelStreamErrorException"] != null) {
31529
31541
  return {
31530
- modelStreamErrorException: await de_ModelStreamErrorException_event(event["modelStreamErrorException"], context)
31542
+ modelStreamErrorException: await de_ModelStreamErrorException_event(event["modelStreamErrorException"], context3)
31531
31543
  };
31532
31544
  }
31533
31545
  if (event["validationException"] != null) {
31534
31546
  return {
31535
- validationException: await de_ValidationException_event(event["validationException"], context)
31547
+ validationException: await de_ValidationException_event(event["validationException"], context3)
31536
31548
  };
31537
31549
  }
31538
31550
  if (event["throttlingException"] != null) {
31539
31551
  return {
31540
- throttlingException: await de_ThrottlingException_event(event["throttlingException"], context)
31552
+ throttlingException: await de_ThrottlingException_event(event["throttlingException"], context3)
31541
31553
  };
31542
31554
  }
31543
31555
  if (event["modelTimeoutException"] != null) {
31544
31556
  return {
31545
- modelTimeoutException: await de_ModelTimeoutException_event(event["modelTimeoutException"], context)
31557
+ modelTimeoutException: await de_ModelTimeoutException_event(event["modelTimeoutException"], context3)
31546
31558
  };
31547
31559
  }
31548
31560
  if (event["serviceUnavailableException"] != null) {
31549
31561
  return {
31550
- serviceUnavailableException: await de_ServiceUnavailableException_event(event["serviceUnavailableException"], context)
31562
+ serviceUnavailableException: await de_ServiceUnavailableException_event(event["serviceUnavailableException"], context3)
31551
31563
  };
31552
31564
  }
31553
31565
  return { $unknown: event };
31554
31566
  });
31555
31567
  };
31556
- var de_ResponseStream = (output, context) => {
31557
- return context.eventStreamMarshaller.deserialize(output, async (event) => {
31568
+ var de_ResponseStream = (output, context3) => {
31569
+ return context3.eventStreamMarshaller.deserialize(output, async (event) => {
31558
31570
  if (event["chunk"] != null) {
31559
31571
  return {
31560
- chunk: await de_PayloadPart_event(event["chunk"], context)
31572
+ chunk: await de_PayloadPart_event(event["chunk"], context3)
31561
31573
  };
31562
31574
  }
31563
31575
  if (event["internalServerException"] != null) {
31564
31576
  return {
31565
- internalServerException: await de_InternalServerException_event(event["internalServerException"], context)
31577
+ internalServerException: await de_InternalServerException_event(event["internalServerException"], context3)
31566
31578
  };
31567
31579
  }
31568
31580
  if (event["modelStreamErrorException"] != null) {
31569
31581
  return {
31570
- modelStreamErrorException: await de_ModelStreamErrorException_event(event["modelStreamErrorException"], context)
31582
+ modelStreamErrorException: await de_ModelStreamErrorException_event(event["modelStreamErrorException"], context3)
31571
31583
  };
31572
31584
  }
31573
31585
  if (event["validationException"] != null) {
31574
31586
  return {
31575
- validationException: await de_ValidationException_event(event["validationException"], context)
31587
+ validationException: await de_ValidationException_event(event["validationException"], context3)
31576
31588
  };
31577
31589
  }
31578
31590
  if (event["throttlingException"] != null) {
31579
31591
  return {
31580
- throttlingException: await de_ThrottlingException_event(event["throttlingException"], context)
31592
+ throttlingException: await de_ThrottlingException_event(event["throttlingException"], context3)
31581
31593
  };
31582
31594
  }
31583
31595
  if (event["modelTimeoutException"] != null) {
31584
31596
  return {
31585
- modelTimeoutException: await de_ModelTimeoutException_event(event["modelTimeoutException"], context)
31597
+ modelTimeoutException: await de_ModelTimeoutException_event(event["modelTimeoutException"], context3)
31586
31598
  };
31587
31599
  }
31588
31600
  if (event["serviceUnavailableException"] != null) {
31589
31601
  return {
31590
- serviceUnavailableException: await de_ServiceUnavailableException_event(event["serviceUnavailableException"], context)
31602
+ serviceUnavailableException: await de_ServiceUnavailableException_event(event["serviceUnavailableException"], context3)
31591
31603
  };
31592
31604
  }
31593
31605
  return { $unknown: event };
31594
31606
  });
31595
31607
  };
31596
- var de_BidirectionalOutputPayloadPart_event = async (output, context) => {
31608
+ var de_BidirectionalOutputPayloadPart_event = async (output, context3) => {
31597
31609
  const contents = {};
31598
- const data2 = await core$1.parseJsonBody(output.body, context);
31599
- Object.assign(contents, de_BidirectionalOutputPayloadPart(data2, context));
31610
+ const data2 = await core$1.parseJsonBody(output.body, context3);
31611
+ Object.assign(contents, de_BidirectionalOutputPayloadPart(data2, context3));
31600
31612
  return contents;
31601
31613
  };
31602
- var de_ContentBlockDeltaEvent_event = async (output, context) => {
31614
+ var de_ContentBlockDeltaEvent_event = async (output, context3) => {
31603
31615
  const contents = {};
31604
- const data2 = await core$1.parseJsonBody(output.body, context);
31605
- Object.assign(contents, de_ContentBlockDeltaEvent(data2, context));
31616
+ const data2 = await core$1.parseJsonBody(output.body, context3);
31617
+ Object.assign(contents, de_ContentBlockDeltaEvent(data2, context3));
31606
31618
  return contents;
31607
31619
  };
31608
- var de_ContentBlockStartEvent_event = async (output, context) => {
31620
+ var de_ContentBlockStartEvent_event = async (output, context3) => {
31609
31621
  const contents = {};
31610
- const data2 = await core$1.parseJsonBody(output.body, context);
31622
+ const data2 = await core$1.parseJsonBody(output.body, context3);
31611
31623
  Object.assign(contents, smithyClient._json(data2));
31612
31624
  return contents;
31613
31625
  };
31614
- var de_ContentBlockStopEvent_event = async (output, context) => {
31626
+ var de_ContentBlockStopEvent_event = async (output, context3) => {
31615
31627
  const contents = {};
31616
- const data2 = await core$1.parseJsonBody(output.body, context);
31628
+ const data2 = await core$1.parseJsonBody(output.body, context3);
31617
31629
  Object.assign(contents, smithyClient._json(data2));
31618
31630
  return contents;
31619
31631
  };
31620
- var de_ConverseStreamMetadataEvent_event = async (output, context) => {
31632
+ var de_ConverseStreamMetadataEvent_event = async (output, context3) => {
31621
31633
  const contents = {};
31622
- const data2 = await core$1.parseJsonBody(output.body, context);
31634
+ const data2 = await core$1.parseJsonBody(output.body, context3);
31623
31635
  Object.assign(contents, de_ConverseStreamMetadataEvent(data2));
31624
31636
  return contents;
31625
31637
  };
31626
- var de_InternalServerException_event = async (output, context) => {
31638
+ var de_InternalServerException_event = async (output, context3) => {
31627
31639
  const parsedOutput = {
31628
31640
  ...output,
31629
- body: await core$1.parseJsonBody(output.body, context)
31641
+ body: await core$1.parseJsonBody(output.body, context3)
31630
31642
  };
31631
31643
  return de_InternalServerExceptionRes2(parsedOutput);
31632
31644
  };
31633
- var de_MessageStartEvent_event = async (output, context) => {
31645
+ var de_MessageStartEvent_event = async (output, context3) => {
31634
31646
  const contents = {};
31635
- const data2 = await core$1.parseJsonBody(output.body, context);
31647
+ const data2 = await core$1.parseJsonBody(output.body, context3);
31636
31648
  Object.assign(contents, smithyClient._json(data2));
31637
31649
  return contents;
31638
31650
  };
31639
- var de_MessageStopEvent_event = async (output, context) => {
31651
+ var de_MessageStopEvent_event = async (output, context3) => {
31640
31652
  const contents = {};
31641
- const data2 = await core$1.parseJsonBody(output.body, context);
31653
+ const data2 = await core$1.parseJsonBody(output.body, context3);
31642
31654
  Object.assign(contents, de_MessageStopEvent(data2));
31643
31655
  return contents;
31644
31656
  };
31645
- var de_ModelStreamErrorException_event = async (output, context) => {
31657
+ var de_ModelStreamErrorException_event = async (output, context3) => {
31646
31658
  const parsedOutput = {
31647
31659
  ...output,
31648
- body: await core$1.parseJsonBody(output.body, context)
31660
+ body: await core$1.parseJsonBody(output.body, context3)
31649
31661
  };
31650
31662
  return de_ModelStreamErrorExceptionRes(parsedOutput);
31651
31663
  };
31652
- var de_ModelTimeoutException_event = async (output, context) => {
31664
+ var de_ModelTimeoutException_event = async (output, context3) => {
31653
31665
  const parsedOutput = {
31654
31666
  ...output,
31655
- body: await core$1.parseJsonBody(output.body, context)
31667
+ body: await core$1.parseJsonBody(output.body, context3)
31656
31668
  };
31657
31669
  return de_ModelTimeoutExceptionRes(parsedOutput);
31658
31670
  };
31659
- var de_PayloadPart_event = async (output, context) => {
31671
+ var de_PayloadPart_event = async (output, context3) => {
31660
31672
  const contents = {};
31661
- const data2 = await core$1.parseJsonBody(output.body, context);
31662
- Object.assign(contents, de_PayloadPart(data2, context));
31673
+ const data2 = await core$1.parseJsonBody(output.body, context3);
31674
+ Object.assign(contents, de_PayloadPart(data2, context3));
31663
31675
  return contents;
31664
31676
  };
31665
- var de_ServiceUnavailableException_event = async (output, context) => {
31677
+ var de_ServiceUnavailableException_event = async (output, context3) => {
31666
31678
  const parsedOutput = {
31667
31679
  ...output,
31668
- body: await core$1.parseJsonBody(output.body, context)
31680
+ body: await core$1.parseJsonBody(output.body, context3)
31669
31681
  };
31670
31682
  return de_ServiceUnavailableExceptionRes(parsedOutput);
31671
31683
  };
31672
- var de_ThrottlingException_event = async (output, context) => {
31684
+ var de_ThrottlingException_event = async (output, context3) => {
31673
31685
  const parsedOutput = {
31674
31686
  ...output,
31675
- body: await core$1.parseJsonBody(output.body, context)
31687
+ body: await core$1.parseJsonBody(output.body, context3)
31676
31688
  };
31677
31689
  return de_ThrottlingExceptionRes(parsedOutput);
31678
31690
  };
31679
- var de_ValidationException_event = async (output, context) => {
31691
+ var de_ValidationException_event = async (output, context3) => {
31680
31692
  const parsedOutput = {
31681
31693
  ...output,
31682
- body: await core$1.parseJsonBody(output.body, context)
31694
+ body: await core$1.parseJsonBody(output.body, context3)
31683
31695
  };
31684
31696
  return de_ValidationExceptionRes(parsedOutput);
31685
31697
  };
31686
- var se_BidirectionalInputPayloadPart = (input, context) => {
31698
+ var se_BidirectionalInputPayloadPart = (input, context3) => {
31687
31699
  return smithyClient.take(input, {
31688
- bytes: context.base64Encoder
31700
+ bytes: context3.base64Encoder
31689
31701
  });
31690
31702
  };
31691
- var se_ContentBlock = (input, context) => {
31703
+ var se_ContentBlock = (input, context3) => {
31692
31704
  return exports2.ContentBlock.visit(input, {
31693
31705
  cachePoint: (value) => ({ cachePoint: smithyClient._json(value) }),
31694
31706
  citationsContent: (value) => ({ citationsContent: smithyClient._json(value) }),
31695
- document: (value) => ({ document: se_DocumentBlock(value, context) }),
31696
- guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value, context) }),
31697
- image: (value) => ({ image: se_ImageBlock(value, context) }),
31698
- reasoningContent: (value) => ({ reasoningContent: se_ReasoningContentBlock(value, context) }),
31707
+ document: (value) => ({ document: se_DocumentBlock(value, context3) }),
31708
+ guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value, context3) }),
31709
+ image: (value) => ({ image: se_ImageBlock(value, context3) }),
31710
+ reasoningContent: (value) => ({ reasoningContent: se_ReasoningContentBlock(value, context3) }),
31699
31711
  text: (value) => ({ text: value }),
31700
- toolResult: (value) => ({ toolResult: se_ToolResultBlock(value, context) }),
31712
+ toolResult: (value) => ({ toolResult: se_ToolResultBlock(value, context3) }),
31701
31713
  toolUse: (value) => ({ toolUse: se_ToolUseBlock(value) }),
31702
- video: (value) => ({ video: se_VideoBlock(value, context) }),
31714
+ video: (value) => ({ video: se_VideoBlock(value, context3) }),
31703
31715
  _: (name14, value) => ({ [name14]: value })
31704
31716
  });
31705
31717
  };
31706
- var se_ContentBlocks = (input, context) => {
31718
+ var se_ContentBlocks = (input, context3) => {
31707
31719
  return input.filter((e3) => e3 != null).map((entry) => {
31708
- return se_ContentBlock(entry, context);
31720
+ return se_ContentBlock(entry, context3);
31709
31721
  });
31710
31722
  };
31711
- var se_ConverseTokensRequest = (input, context) => {
31723
+ var se_ConverseTokensRequest = (input, context3) => {
31712
31724
  return smithyClient.take(input, {
31713
- messages: (_2) => se_Messages(_2, context),
31714
- system: (_2) => se_SystemContentBlocks(_2, context)
31725
+ messages: (_2) => se_Messages(_2, context3),
31726
+ system: (_2) => se_SystemContentBlocks(_2, context3)
31715
31727
  });
31716
31728
  };
31717
- var se_CountTokensInput = (input, context) => {
31729
+ var se_CountTokensInput = (input, context3) => {
31718
31730
  return exports2.CountTokensInput.visit(input, {
31719
- converse: (value) => ({ converse: se_ConverseTokensRequest(value, context) }),
31720
- invokeModel: (value) => ({ invokeModel: se_InvokeModelTokensRequest(value, context) }),
31731
+ converse: (value) => ({ converse: se_ConverseTokensRequest(value, context3) }),
31732
+ invokeModel: (value) => ({ invokeModel: se_InvokeModelTokensRequest(value, context3) }),
31721
31733
  _: (name14, value) => ({ [name14]: value })
31722
31734
  });
31723
31735
  };
31724
- var se_DocumentBlock = (input, context) => {
31736
+ var se_DocumentBlock = (input, context3) => {
31725
31737
  return smithyClient.take(input, {
31726
31738
  citations: smithyClient._json,
31727
31739
  context: [],
31728
31740
  format: [],
31729
31741
  name: [],
31730
- source: (_2) => se_DocumentSource(_2, context)
31742
+ source: (_2) => se_DocumentSource(_2, context3)
31731
31743
  });
31732
31744
  };
31733
- var se_DocumentSource = (input, context) => {
31745
+ var se_DocumentSource = (input, context3) => {
31734
31746
  return exports2.DocumentSource.visit(input, {
31735
- bytes: (value) => ({ bytes: context.base64Encoder(value) }),
31747
+ bytes: (value) => ({ bytes: context3.base64Encoder(value) }),
31736
31748
  content: (value) => ({ content: smithyClient._json(value) }),
31737
31749
  s3Location: (value) => ({ s3Location: smithyClient._json(value) }),
31738
31750
  text: (value) => ({ text: value }),
31739
31751
  _: (name14, value) => ({ [name14]: value })
31740
31752
  });
31741
31753
  };
31742
- var se_GuardrailContentBlock = (input, context) => {
31754
+ var se_GuardrailContentBlock = (input, context3) => {
31743
31755
  return exports2.GuardrailContentBlock.visit(input, {
31744
- image: (value) => ({ image: se_GuardrailImageBlock(value, context) }),
31756
+ image: (value) => ({ image: se_GuardrailImageBlock(value, context3) }),
31745
31757
  text: (value) => ({ text: smithyClient._json(value) }),
31746
31758
  _: (name14, value) => ({ [name14]: value })
31747
31759
  });
31748
31760
  };
31749
- var se_GuardrailContentBlockList = (input, context) => {
31761
+ var se_GuardrailContentBlockList = (input, context3) => {
31750
31762
  return input.filter((e3) => e3 != null).map((entry) => {
31751
- return se_GuardrailContentBlock(entry, context);
31763
+ return se_GuardrailContentBlock(entry, context3);
31752
31764
  });
31753
31765
  };
31754
- var se_GuardrailConverseContentBlock = (input, context) => {
31766
+ var se_GuardrailConverseContentBlock = (input, context3) => {
31755
31767
  return exports2.GuardrailConverseContentBlock.visit(input, {
31756
- image: (value) => ({ image: se_GuardrailConverseImageBlock(value, context) }),
31768
+ image: (value) => ({ image: se_GuardrailConverseImageBlock(value, context3) }),
31757
31769
  text: (value) => ({ text: smithyClient._json(value) }),
31758
31770
  _: (name14, value) => ({ [name14]: value })
31759
31771
  });
31760
31772
  };
31761
- var se_GuardrailConverseImageBlock = (input, context) => {
31773
+ var se_GuardrailConverseImageBlock = (input, context3) => {
31762
31774
  return smithyClient.take(input, {
31763
31775
  format: [],
31764
- source: (_2) => se_GuardrailConverseImageSource(_2, context)
31776
+ source: (_2) => se_GuardrailConverseImageSource(_2, context3)
31765
31777
  });
31766
31778
  };
31767
- var se_GuardrailConverseImageSource = (input, context) => {
31779
+ var se_GuardrailConverseImageSource = (input, context3) => {
31768
31780
  return exports2.GuardrailConverseImageSource.visit(input, {
31769
- bytes: (value) => ({ bytes: context.base64Encoder(value) }),
31781
+ bytes: (value) => ({ bytes: context3.base64Encoder(value) }),
31770
31782
  _: (name14, value) => ({ [name14]: value })
31771
31783
  });
31772
31784
  };
31773
- var se_GuardrailImageBlock = (input, context) => {
31785
+ var se_GuardrailImageBlock = (input, context3) => {
31774
31786
  return smithyClient.take(input, {
31775
31787
  format: [],
31776
- source: (_2) => se_GuardrailImageSource(_2, context)
31788
+ source: (_2) => se_GuardrailImageSource(_2, context3)
31777
31789
  });
31778
31790
  };
31779
- var se_GuardrailImageSource = (input, context) => {
31791
+ var se_GuardrailImageSource = (input, context3) => {
31780
31792
  return exports2.GuardrailImageSource.visit(input, {
31781
- bytes: (value) => ({ bytes: context.base64Encoder(value) }),
31793
+ bytes: (value) => ({ bytes: context3.base64Encoder(value) }),
31782
31794
  _: (name14, value) => ({ [name14]: value })
31783
31795
  });
31784
31796
  };
31785
- var se_ImageBlock = (input, context) => {
31797
+ var se_ImageBlock = (input, context3) => {
31786
31798
  return smithyClient.take(input, {
31787
31799
  format: [],
31788
- source: (_2) => se_ImageSource(_2, context)
31800
+ source: (_2) => se_ImageSource(_2, context3)
31789
31801
  });
31790
31802
  };
31791
- var se_ImageSource = (input, context) => {
31803
+ var se_ImageSource = (input, context3) => {
31792
31804
  return exports2.ImageSource.visit(input, {
31793
- bytes: (value) => ({ bytes: context.base64Encoder(value) }),
31805
+ bytes: (value) => ({ bytes: context3.base64Encoder(value) }),
31794
31806
  s3Location: (value) => ({ s3Location: smithyClient._json(value) }),
31795
31807
  _: (name14, value) => ({ [name14]: value })
31796
31808
  });
31797
31809
  };
31798
- var se_InferenceConfiguration = (input, context) => {
31810
+ var se_InferenceConfiguration = (input, context3) => {
31799
31811
  return smithyClient.take(input, {
31800
31812
  maxTokens: [],
31801
31813
  stopSequences: smithyClient._json,
@@ -31803,128 +31815,128 @@ var require_dist_cjs65 = __commonJS({
31803
31815
  topP: smithyClient.serializeFloat
31804
31816
  });
31805
31817
  };
31806
- var se_InvokeModelTokensRequest = (input, context) => {
31818
+ var se_InvokeModelTokensRequest = (input, context3) => {
31807
31819
  return smithyClient.take(input, {
31808
- body: context.base64Encoder
31820
+ body: context3.base64Encoder
31809
31821
  });
31810
31822
  };
31811
- var se_Message = (input, context) => {
31823
+ var se_Message = (input, context3) => {
31812
31824
  return smithyClient.take(input, {
31813
- content: (_2) => se_ContentBlocks(_2, context),
31825
+ content: (_2) => se_ContentBlocks(_2, context3),
31814
31826
  role: []
31815
31827
  });
31816
31828
  };
31817
- var se_Messages = (input, context) => {
31829
+ var se_Messages = (input, context3) => {
31818
31830
  return input.filter((e3) => e3 != null).map((entry) => {
31819
- return se_Message(entry, context);
31831
+ return se_Message(entry, context3);
31820
31832
  });
31821
31833
  };
31822
- var se_ModelInputPayload = (input, context) => {
31834
+ var se_ModelInputPayload = (input, context3) => {
31823
31835
  return input;
31824
31836
  };
31825
- var se_ReasoningContentBlock = (input, context) => {
31837
+ var se_ReasoningContentBlock = (input, context3) => {
31826
31838
  return exports2.ReasoningContentBlock.visit(input, {
31827
31839
  reasoningText: (value) => ({ reasoningText: smithyClient._json(value) }),
31828
- redactedContent: (value) => ({ redactedContent: context.base64Encoder(value) }),
31840
+ redactedContent: (value) => ({ redactedContent: context3.base64Encoder(value) }),
31829
31841
  _: (name14, value) => ({ [name14]: value })
31830
31842
  });
31831
31843
  };
31832
- var se_SystemContentBlock = (input, context) => {
31844
+ var se_SystemContentBlock = (input, context3) => {
31833
31845
  return exports2.SystemContentBlock.visit(input, {
31834
31846
  cachePoint: (value) => ({ cachePoint: smithyClient._json(value) }),
31835
- guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value, context) }),
31847
+ guardContent: (value) => ({ guardContent: se_GuardrailConverseContentBlock(value, context3) }),
31836
31848
  text: (value) => ({ text: value }),
31837
31849
  _: (name14, value) => ({ [name14]: value })
31838
31850
  });
31839
31851
  };
31840
- var se_SystemContentBlocks = (input, context) => {
31852
+ var se_SystemContentBlocks = (input, context3) => {
31841
31853
  return input.filter((e3) => e3 != null).map((entry) => {
31842
- return se_SystemContentBlock(entry, context);
31854
+ return se_SystemContentBlock(entry, context3);
31843
31855
  });
31844
31856
  };
31845
- var se_Tool = (input, context) => {
31857
+ var se_Tool = (input, context3) => {
31846
31858
  return exports2.Tool.visit(input, {
31847
31859
  cachePoint: (value) => ({ cachePoint: smithyClient._json(value) }),
31848
31860
  toolSpec: (value) => ({ toolSpec: se_ToolSpecification(value) }),
31849
31861
  _: (name14, value) => ({ [name14]: value })
31850
31862
  });
31851
31863
  };
31852
- var se_ToolConfiguration = (input, context) => {
31864
+ var se_ToolConfiguration = (input, context3) => {
31853
31865
  return smithyClient.take(input, {
31854
31866
  toolChoice: smithyClient._json,
31855
31867
  tools: (_2) => se_Tools(_2)
31856
31868
  });
31857
31869
  };
31858
- var se_ToolInputSchema = (input, context) => {
31870
+ var se_ToolInputSchema = (input, context3) => {
31859
31871
  return exports2.ToolInputSchema.visit(input, {
31860
31872
  json: (value) => ({ json: se_Document(value) }),
31861
31873
  _: (name14, value) => ({ [name14]: value })
31862
31874
  });
31863
31875
  };
31864
- var se_ToolResultBlock = (input, context) => {
31876
+ var se_ToolResultBlock = (input, context3) => {
31865
31877
  return smithyClient.take(input, {
31866
- content: (_2) => se_ToolResultContentBlocks(_2, context),
31878
+ content: (_2) => se_ToolResultContentBlocks(_2, context3),
31867
31879
  status: [],
31868
31880
  toolUseId: []
31869
31881
  });
31870
31882
  };
31871
- var se_ToolResultContentBlock = (input, context) => {
31883
+ var se_ToolResultContentBlock = (input, context3) => {
31872
31884
  return exports2.ToolResultContentBlock.visit(input, {
31873
- document: (value) => ({ document: se_DocumentBlock(value, context) }),
31874
- image: (value) => ({ image: se_ImageBlock(value, context) }),
31885
+ document: (value) => ({ document: se_DocumentBlock(value, context3) }),
31886
+ image: (value) => ({ image: se_ImageBlock(value, context3) }),
31875
31887
  json: (value) => ({ json: se_Document(value) }),
31876
31888
  text: (value) => ({ text: value }),
31877
- video: (value) => ({ video: se_VideoBlock(value, context) }),
31889
+ video: (value) => ({ video: se_VideoBlock(value, context3) }),
31878
31890
  _: (name14, value) => ({ [name14]: value })
31879
31891
  });
31880
31892
  };
31881
- var se_ToolResultContentBlocks = (input, context) => {
31893
+ var se_ToolResultContentBlocks = (input, context3) => {
31882
31894
  return input.filter((e3) => e3 != null).map((entry) => {
31883
- return se_ToolResultContentBlock(entry, context);
31895
+ return se_ToolResultContentBlock(entry, context3);
31884
31896
  });
31885
31897
  };
31886
- var se_Tools = (input, context) => {
31898
+ var se_Tools = (input, context3) => {
31887
31899
  return input.filter((e3) => e3 != null).map((entry) => {
31888
31900
  return se_Tool(entry);
31889
31901
  });
31890
31902
  };
31891
- var se_ToolSpecification = (input, context) => {
31903
+ var se_ToolSpecification = (input, context3) => {
31892
31904
  return smithyClient.take(input, {
31893
31905
  description: [],
31894
31906
  inputSchema: (_2) => se_ToolInputSchema(_2),
31895
31907
  name: []
31896
31908
  });
31897
31909
  };
31898
- var se_ToolUseBlock = (input, context) => {
31910
+ var se_ToolUseBlock = (input, context3) => {
31899
31911
  return smithyClient.take(input, {
31900
31912
  input: (_2) => se_Document(_2),
31901
31913
  name: [],
31902
31914
  toolUseId: []
31903
31915
  });
31904
31916
  };
31905
- var se_VideoBlock = (input, context) => {
31917
+ var se_VideoBlock = (input, context3) => {
31906
31918
  return smithyClient.take(input, {
31907
31919
  format: [],
31908
- source: (_2) => se_VideoSource(_2, context)
31920
+ source: (_2) => se_VideoSource(_2, context3)
31909
31921
  });
31910
31922
  };
31911
- var se_VideoSource = (input, context) => {
31923
+ var se_VideoSource = (input, context3) => {
31912
31924
  return exports2.VideoSource.visit(input, {
31913
- bytes: (value) => ({ bytes: context.base64Encoder(value) }),
31925
+ bytes: (value) => ({ bytes: context3.base64Encoder(value) }),
31914
31926
  s3Location: (value) => ({ s3Location: smithyClient._json(value) }),
31915
31927
  _: (name14, value) => ({ [name14]: value })
31916
31928
  });
31917
31929
  };
31918
- var se_Document = (input, context) => {
31930
+ var se_Document = (input, context3) => {
31919
31931
  return input;
31920
31932
  };
31921
- var de_AsyncInvokeSummaries = (output, context) => {
31933
+ var de_AsyncInvokeSummaries = (output, context3) => {
31922
31934
  const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
31923
31935
  return de_AsyncInvokeSummary(entry);
31924
31936
  });
31925
31937
  return retVal;
31926
31938
  };
31927
- var de_AsyncInvokeSummary = (output, context) => {
31939
+ var de_AsyncInvokeSummary = (output, context3) => {
31928
31940
  return smithyClient.take(output, {
31929
31941
  clientRequestToken: smithyClient.expectString,
31930
31942
  endTime: (_2) => smithyClient.expectNonNull(smithyClient.parseRfc3339DateTimeWithOffset(_2)),
@@ -31937,12 +31949,12 @@ var require_dist_cjs65 = __commonJS({
31937
31949
  submitTime: (_2) => smithyClient.expectNonNull(smithyClient.parseRfc3339DateTimeWithOffset(_2))
31938
31950
  });
31939
31951
  };
31940
- var de_BidirectionalOutputPayloadPart = (output, context) => {
31952
+ var de_BidirectionalOutputPayloadPart = (output, context3) => {
31941
31953
  return smithyClient.take(output, {
31942
- bytes: context.base64Decoder
31954
+ bytes: context3.base64Decoder
31943
31955
  });
31944
31956
  };
31945
- var de_ContentBlock = (output, context) => {
31957
+ var de_ContentBlock = (output, context3) => {
31946
31958
  if (output.cachePoint != null) {
31947
31959
  return {
31948
31960
  cachePoint: smithyClient._json(output.cachePoint)
@@ -31955,22 +31967,22 @@ var require_dist_cjs65 = __commonJS({
31955
31967
  }
31956
31968
  if (output.document != null) {
31957
31969
  return {
31958
- document: de_DocumentBlock(output.document, context)
31970
+ document: de_DocumentBlock(output.document, context3)
31959
31971
  };
31960
31972
  }
31961
31973
  if (output.guardContent != null) {
31962
31974
  return {
31963
- guardContent: de_GuardrailConverseContentBlock(core$1.awsExpectUnion(output.guardContent), context)
31975
+ guardContent: de_GuardrailConverseContentBlock(core$1.awsExpectUnion(output.guardContent), context3)
31964
31976
  };
31965
31977
  }
31966
31978
  if (output.image != null) {
31967
31979
  return {
31968
- image: de_ImageBlock(output.image, context)
31980
+ image: de_ImageBlock(output.image, context3)
31969
31981
  };
31970
31982
  }
31971
31983
  if (output.reasoningContent != null) {
31972
31984
  return {
31973
- reasoningContent: de_ReasoningContentBlock(core$1.awsExpectUnion(output.reasoningContent), context)
31985
+ reasoningContent: de_ReasoningContentBlock(core$1.awsExpectUnion(output.reasoningContent), context3)
31974
31986
  };
31975
31987
  }
31976
31988
  if (smithyClient.expectString(output.text) !== void 0) {
@@ -31978,7 +31990,7 @@ var require_dist_cjs65 = __commonJS({
31978
31990
  }
31979
31991
  if (output.toolResult != null) {
31980
31992
  return {
31981
- toolResult: de_ToolResultBlock(output.toolResult, context)
31993
+ toolResult: de_ToolResultBlock(output.toolResult, context3)
31982
31994
  };
31983
31995
  }
31984
31996
  if (output.toolUse != null) {
@@ -31988,12 +32000,12 @@ var require_dist_cjs65 = __commonJS({
31988
32000
  }
31989
32001
  if (output.video != null) {
31990
32002
  return {
31991
- video: de_VideoBlock(output.video, context)
32003
+ video: de_VideoBlock(output.video, context3)
31992
32004
  };
31993
32005
  }
31994
32006
  return { $unknown: Object.entries(output)[0] };
31995
32007
  };
31996
- var de_ContentBlockDelta = (output, context) => {
32008
+ var de_ContentBlockDelta = (output, context3) => {
31997
32009
  if (output.citation != null) {
31998
32010
  return {
31999
32011
  citation: smithyClient._json(output.citation)
@@ -32001,7 +32013,7 @@ var require_dist_cjs65 = __commonJS({
32001
32013
  }
32002
32014
  if (output.reasoningContent != null) {
32003
32015
  return {
32004
- reasoningContent: de_ReasoningContentBlockDelta(core$1.awsExpectUnion(output.reasoningContent), context)
32016
+ reasoningContent: de_ReasoningContentBlockDelta(core$1.awsExpectUnion(output.reasoningContent), context3)
32005
32017
  };
32006
32018
  }
32007
32019
  if (smithyClient.expectString(output.text) !== void 0) {
@@ -32014,27 +32026,27 @@ var require_dist_cjs65 = __commonJS({
32014
32026
  }
32015
32027
  return { $unknown: Object.entries(output)[0] };
32016
32028
  };
32017
- var de_ContentBlockDeltaEvent = (output, context) => {
32029
+ var de_ContentBlockDeltaEvent = (output, context3) => {
32018
32030
  return smithyClient.take(output, {
32019
32031
  contentBlockIndex: smithyClient.expectInt32,
32020
- delta: (_2) => de_ContentBlockDelta(core$1.awsExpectUnion(_2), context)
32032
+ delta: (_2) => de_ContentBlockDelta(core$1.awsExpectUnion(_2), context3)
32021
32033
  });
32022
32034
  };
32023
- var de_ContentBlocks = (output, context) => {
32035
+ var de_ContentBlocks = (output, context3) => {
32024
32036
  const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
32025
- return de_ContentBlock(core$1.awsExpectUnion(entry), context);
32037
+ return de_ContentBlock(core$1.awsExpectUnion(entry), context3);
32026
32038
  });
32027
32039
  return retVal;
32028
32040
  };
32029
- var de_ConverseOutput = (output, context) => {
32041
+ var de_ConverseOutput = (output, context3) => {
32030
32042
  if (output.message != null) {
32031
32043
  return {
32032
- message: de_Message(output.message, context)
32044
+ message: de_Message(output.message, context3)
32033
32045
  };
32034
32046
  }
32035
32047
  return { $unknown: Object.entries(output)[0] };
32036
32048
  };
32037
- var de_ConverseStreamMetadataEvent = (output, context) => {
32049
+ var de_ConverseStreamMetadataEvent = (output, context3) => {
32038
32050
  return smithyClient.take(output, {
32039
32051
  metrics: smithyClient._json,
32040
32052
  performanceConfig: smithyClient._json,
@@ -32042,31 +32054,31 @@ var require_dist_cjs65 = __commonJS({
32042
32054
  usage: smithyClient._json
32043
32055
  });
32044
32056
  };
32045
- var de_ConverseStreamTrace = (output, context) => {
32057
+ var de_ConverseStreamTrace = (output, context3) => {
32046
32058
  return smithyClient.take(output, {
32047
32059
  guardrail: (_2) => de_GuardrailTraceAssessment(_2),
32048
32060
  promptRouter: smithyClient._json
32049
32061
  });
32050
32062
  };
32051
- var de_ConverseTrace = (output, context) => {
32063
+ var de_ConverseTrace = (output, context3) => {
32052
32064
  return smithyClient.take(output, {
32053
32065
  guardrail: (_2) => de_GuardrailTraceAssessment(_2),
32054
32066
  promptRouter: smithyClient._json
32055
32067
  });
32056
32068
  };
32057
- var de_DocumentBlock = (output, context) => {
32069
+ var de_DocumentBlock = (output, context3) => {
32058
32070
  return smithyClient.take(output, {
32059
32071
  citations: smithyClient._json,
32060
32072
  context: smithyClient.expectString,
32061
32073
  format: smithyClient.expectString,
32062
32074
  name: smithyClient.expectString,
32063
- source: (_2) => de_DocumentSource(core$1.awsExpectUnion(_2), context)
32075
+ source: (_2) => de_DocumentSource(core$1.awsExpectUnion(_2), context3)
32064
32076
  });
32065
32077
  };
32066
- var de_DocumentSource = (output, context) => {
32078
+ var de_DocumentSource = (output, context3) => {
32067
32079
  if (output.bytes != null) {
32068
32080
  return {
32069
- bytes: context.base64Decoder(output.bytes)
32081
+ bytes: context3.base64Decoder(output.bytes)
32070
32082
  };
32071
32083
  }
32072
32084
  if (output.content != null) {
@@ -32084,7 +32096,7 @@ var require_dist_cjs65 = __commonJS({
32084
32096
  }
32085
32097
  return { $unknown: Object.entries(output)[0] };
32086
32098
  };
32087
- var de_GuardrailAssessment = (output, context) => {
32099
+ var de_GuardrailAssessment = (output, context3) => {
32088
32100
  return smithyClient.take(output, {
32089
32101
  automatedReasoningPolicy: (_2) => de_GuardrailAutomatedReasoningPolicyAssessment(_2),
32090
32102
  contentPolicy: smithyClient._json,
@@ -32095,13 +32107,13 @@ var require_dist_cjs65 = __commonJS({
32095
32107
  wordPolicy: smithyClient._json
32096
32108
  });
32097
32109
  };
32098
- var de_GuardrailAssessmentList = (output, context) => {
32110
+ var de_GuardrailAssessmentList = (output, context3) => {
32099
32111
  const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
32100
32112
  return de_GuardrailAssessment(entry);
32101
32113
  });
32102
32114
  return retVal;
32103
32115
  };
32104
- var de_GuardrailAssessmentListMap = (output, context) => {
32116
+ var de_GuardrailAssessmentListMap = (output, context3) => {
32105
32117
  return Object.entries(output).reduce((acc, [key, value]) => {
32106
32118
  if (value === null) {
32107
32119
  return acc;
@@ -32110,7 +32122,7 @@ var require_dist_cjs65 = __commonJS({
32110
32122
  return acc;
32111
32123
  }, {});
32112
32124
  };
32113
- var de_GuardrailAssessmentMap = (output, context) => {
32125
+ var de_GuardrailAssessmentMap = (output, context3) => {
32114
32126
  return Object.entries(output).reduce((acc, [key, value]) => {
32115
32127
  if (value === null) {
32116
32128
  return acc;
@@ -32119,7 +32131,7 @@ var require_dist_cjs65 = __commonJS({
32119
32131
  return acc;
32120
32132
  }, {});
32121
32133
  };
32122
- var de_GuardrailAutomatedReasoningFinding = (output, context) => {
32134
+ var de_GuardrailAutomatedReasoningFinding = (output, context3) => {
32123
32135
  if (output.impossible != null) {
32124
32136
  return {
32125
32137
  impossible: de_GuardrailAutomatedReasoningImpossibleFinding(output.impossible)
@@ -32157,32 +32169,32 @@ var require_dist_cjs65 = __commonJS({
32157
32169
  }
32158
32170
  return { $unknown: Object.entries(output)[0] };
32159
32171
  };
32160
- var de_GuardrailAutomatedReasoningFindingList = (output, context) => {
32172
+ var de_GuardrailAutomatedReasoningFindingList = (output, context3) => {
32161
32173
  const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
32162
32174
  return de_GuardrailAutomatedReasoningFinding(core$1.awsExpectUnion(entry));
32163
32175
  });
32164
32176
  return retVal;
32165
32177
  };
32166
- var de_GuardrailAutomatedReasoningImpossibleFinding = (output, context) => {
32178
+ var de_GuardrailAutomatedReasoningImpossibleFinding = (output, context3) => {
32167
32179
  return smithyClient.take(output, {
32168
32180
  contradictingRules: smithyClient._json,
32169
32181
  logicWarning: smithyClient._json,
32170
32182
  translation: (_2) => de_GuardrailAutomatedReasoningTranslation(_2)
32171
32183
  });
32172
32184
  };
32173
- var de_GuardrailAutomatedReasoningInvalidFinding = (output, context) => {
32185
+ var de_GuardrailAutomatedReasoningInvalidFinding = (output, context3) => {
32174
32186
  return smithyClient.take(output, {
32175
32187
  contradictingRules: smithyClient._json,
32176
32188
  logicWarning: smithyClient._json,
32177
32189
  translation: (_2) => de_GuardrailAutomatedReasoningTranslation(_2)
32178
32190
  });
32179
32191
  };
32180
- var de_GuardrailAutomatedReasoningPolicyAssessment = (output, context) => {
32192
+ var de_GuardrailAutomatedReasoningPolicyAssessment = (output, context3) => {
32181
32193
  return smithyClient.take(output, {
32182
32194
  findings: (_2) => de_GuardrailAutomatedReasoningFindingList(_2)
32183
32195
  });
32184
32196
  };
32185
- var de_GuardrailAutomatedReasoningSatisfiableFinding = (output, context) => {
32197
+ var de_GuardrailAutomatedReasoningSatisfiableFinding = (output, context3) => {
32186
32198
  return smithyClient.take(output, {
32187
32199
  claimsFalseScenario: smithyClient._json,
32188
32200
  claimsTrueScenario: smithyClient._json,
@@ -32190,7 +32202,7 @@ var require_dist_cjs65 = __commonJS({
32190
32202
  translation: (_2) => de_GuardrailAutomatedReasoningTranslation(_2)
32191
32203
  });
32192
32204
  };
32193
- var de_GuardrailAutomatedReasoningTranslation = (output, context) => {
32205
+ var de_GuardrailAutomatedReasoningTranslation = (output, context3) => {
32194
32206
  return smithyClient.take(output, {
32195
32207
  claims: smithyClient._json,
32196
32208
  confidence: smithyClient.limitedParseDouble,
@@ -32199,30 +32211,30 @@ var require_dist_cjs65 = __commonJS({
32199
32211
  untranslatedPremises: smithyClient._json
32200
32212
  });
32201
32213
  };
32202
- var de_GuardrailAutomatedReasoningTranslationAmbiguousFinding = (output, context) => {
32214
+ var de_GuardrailAutomatedReasoningTranslationAmbiguousFinding = (output, context3) => {
32203
32215
  return smithyClient.take(output, {
32204
32216
  differenceScenarios: smithyClient._json,
32205
32217
  options: (_2) => de_GuardrailAutomatedReasoningTranslationOptionList(_2)
32206
32218
  });
32207
32219
  };
32208
- var de_GuardrailAutomatedReasoningTranslationList = (output, context) => {
32220
+ var de_GuardrailAutomatedReasoningTranslationList = (output, context3) => {
32209
32221
  const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
32210
32222
  return de_GuardrailAutomatedReasoningTranslation(entry);
32211
32223
  });
32212
32224
  return retVal;
32213
32225
  };
32214
- var de_GuardrailAutomatedReasoningTranslationOption = (output, context) => {
32226
+ var de_GuardrailAutomatedReasoningTranslationOption = (output, context3) => {
32215
32227
  return smithyClient.take(output, {
32216
32228
  translations: (_2) => de_GuardrailAutomatedReasoningTranslationList(_2)
32217
32229
  });
32218
32230
  };
32219
- var de_GuardrailAutomatedReasoningTranslationOptionList = (output, context) => {
32231
+ var de_GuardrailAutomatedReasoningTranslationOptionList = (output, context3) => {
32220
32232
  const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
32221
32233
  return de_GuardrailAutomatedReasoningTranslationOption(entry);
32222
32234
  });
32223
32235
  return retVal;
32224
32236
  };
32225
- var de_GuardrailAutomatedReasoningValidFinding = (output, context) => {
32237
+ var de_GuardrailAutomatedReasoningValidFinding = (output, context3) => {
32226
32238
  return smithyClient.take(output, {
32227
32239
  claimsTrueScenario: smithyClient._json,
32228
32240
  logicWarning: smithyClient._json,
@@ -32230,7 +32242,7 @@ var require_dist_cjs65 = __commonJS({
32230
32242
  translation: (_2) => de_GuardrailAutomatedReasoningTranslation(_2)
32231
32243
  });
32232
32244
  };
32233
- var de_GuardrailContextualGroundingFilter = (output, context) => {
32245
+ var de_GuardrailContextualGroundingFilter = (output, context3) => {
32234
32246
  return smithyClient.take(output, {
32235
32247
  action: smithyClient.expectString,
32236
32248
  detected: smithyClient.expectBoolean,
@@ -32239,21 +32251,21 @@ var require_dist_cjs65 = __commonJS({
32239
32251
  type: smithyClient.expectString
32240
32252
  });
32241
32253
  };
32242
- var de_GuardrailContextualGroundingFilters = (output, context) => {
32254
+ var de_GuardrailContextualGroundingFilters = (output, context3) => {
32243
32255
  const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
32244
32256
  return de_GuardrailContextualGroundingFilter(entry);
32245
32257
  });
32246
32258
  return retVal;
32247
32259
  };
32248
- var de_GuardrailContextualGroundingPolicyAssessment = (output, context) => {
32260
+ var de_GuardrailContextualGroundingPolicyAssessment = (output, context3) => {
32249
32261
  return smithyClient.take(output, {
32250
32262
  filters: (_2) => de_GuardrailContextualGroundingFilters(_2)
32251
32263
  });
32252
32264
  };
32253
- var de_GuardrailConverseContentBlock = (output, context) => {
32265
+ var de_GuardrailConverseContentBlock = (output, context3) => {
32254
32266
  if (output.image != null) {
32255
32267
  return {
32256
- image: de_GuardrailConverseImageBlock(output.image, context)
32268
+ image: de_GuardrailConverseImageBlock(output.image, context3)
32257
32269
  };
32258
32270
  }
32259
32271
  if (output.text != null) {
@@ -32263,21 +32275,21 @@ var require_dist_cjs65 = __commonJS({
32263
32275
  }
32264
32276
  return { $unknown: Object.entries(output)[0] };
32265
32277
  };
32266
- var de_GuardrailConverseImageBlock = (output, context) => {
32278
+ var de_GuardrailConverseImageBlock = (output, context3) => {
32267
32279
  return smithyClient.take(output, {
32268
32280
  format: smithyClient.expectString,
32269
- source: (_2) => de_GuardrailConverseImageSource(core$1.awsExpectUnion(_2), context)
32281
+ source: (_2) => de_GuardrailConverseImageSource(core$1.awsExpectUnion(_2), context3)
32270
32282
  });
32271
32283
  };
32272
- var de_GuardrailConverseImageSource = (output, context) => {
32284
+ var de_GuardrailConverseImageSource = (output, context3) => {
32273
32285
  if (output.bytes != null) {
32274
32286
  return {
32275
- bytes: context.base64Decoder(output.bytes)
32287
+ bytes: context3.base64Decoder(output.bytes)
32276
32288
  };
32277
32289
  }
32278
32290
  return { $unknown: Object.entries(output)[0] };
32279
32291
  };
32280
- var de_GuardrailTraceAssessment = (output, context) => {
32292
+ var de_GuardrailTraceAssessment = (output, context3) => {
32281
32293
  return smithyClient.take(output, {
32282
32294
  actionReason: smithyClient.expectString,
32283
32295
  inputAssessment: (_2) => de_GuardrailAssessmentMap(_2),
@@ -32285,16 +32297,16 @@ var require_dist_cjs65 = __commonJS({
32285
32297
  outputAssessments: (_2) => de_GuardrailAssessmentListMap(_2)
32286
32298
  });
32287
32299
  };
32288
- var de_ImageBlock = (output, context) => {
32300
+ var de_ImageBlock = (output, context3) => {
32289
32301
  return smithyClient.take(output, {
32290
32302
  format: smithyClient.expectString,
32291
- source: (_2) => de_ImageSource(core$1.awsExpectUnion(_2), context)
32303
+ source: (_2) => de_ImageSource(core$1.awsExpectUnion(_2), context3)
32292
32304
  });
32293
32305
  };
32294
- var de_ImageSource = (output, context) => {
32306
+ var de_ImageSource = (output, context3) => {
32295
32307
  if (output.bytes != null) {
32296
32308
  return {
32297
- bytes: context.base64Decoder(output.bytes)
32309
+ bytes: context3.base64Decoder(output.bytes)
32298
32310
  };
32299
32311
  }
32300
32312
  if (output.s3Location != null) {
@@ -32304,24 +32316,24 @@ var require_dist_cjs65 = __commonJS({
32304
32316
  }
32305
32317
  return { $unknown: Object.entries(output)[0] };
32306
32318
  };
32307
- var de_Message = (output, context) => {
32319
+ var de_Message = (output, context3) => {
32308
32320
  return smithyClient.take(output, {
32309
- content: (_2) => de_ContentBlocks(_2, context),
32321
+ content: (_2) => de_ContentBlocks(_2, context3),
32310
32322
  role: smithyClient.expectString
32311
32323
  });
32312
32324
  };
32313
- var de_MessageStopEvent = (output, context) => {
32325
+ var de_MessageStopEvent = (output, context3) => {
32314
32326
  return smithyClient.take(output, {
32315
32327
  additionalModelResponseFields: (_2) => de_Document(_2),
32316
32328
  stopReason: smithyClient.expectString
32317
32329
  });
32318
32330
  };
32319
- var de_PayloadPart = (output, context) => {
32331
+ var de_PayloadPart = (output, context3) => {
32320
32332
  return smithyClient.take(output, {
32321
- bytes: context.base64Decoder
32333
+ bytes: context3.base64Decoder
32322
32334
  });
32323
32335
  };
32324
- var de_ReasoningContentBlock = (output, context) => {
32336
+ var de_ReasoningContentBlock = (output, context3) => {
32325
32337
  if (output.reasoningText != null) {
32326
32338
  return {
32327
32339
  reasoningText: smithyClient._json(output.reasoningText)
@@ -32329,15 +32341,15 @@ var require_dist_cjs65 = __commonJS({
32329
32341
  }
32330
32342
  if (output.redactedContent != null) {
32331
32343
  return {
32332
- redactedContent: context.base64Decoder(output.redactedContent)
32344
+ redactedContent: context3.base64Decoder(output.redactedContent)
32333
32345
  };
32334
32346
  }
32335
32347
  return { $unknown: Object.entries(output)[0] };
32336
32348
  };
32337
- var de_ReasoningContentBlockDelta = (output, context) => {
32349
+ var de_ReasoningContentBlockDelta = (output, context3) => {
32338
32350
  if (output.redactedContent != null) {
32339
32351
  return {
32340
- redactedContent: context.base64Decoder(output.redactedContent)
32352
+ redactedContent: context3.base64Decoder(output.redactedContent)
32341
32353
  };
32342
32354
  }
32343
32355
  if (smithyClient.expectString(output.signature) !== void 0) {
@@ -32348,22 +32360,22 @@ var require_dist_cjs65 = __commonJS({
32348
32360
  }
32349
32361
  return { $unknown: Object.entries(output)[0] };
32350
32362
  };
32351
- var de_ToolResultBlock = (output, context) => {
32363
+ var de_ToolResultBlock = (output, context3) => {
32352
32364
  return smithyClient.take(output, {
32353
- content: (_2) => de_ToolResultContentBlocks(_2, context),
32365
+ content: (_2) => de_ToolResultContentBlocks(_2, context3),
32354
32366
  status: smithyClient.expectString,
32355
32367
  toolUseId: smithyClient.expectString
32356
32368
  });
32357
32369
  };
32358
- var de_ToolResultContentBlock = (output, context) => {
32370
+ var de_ToolResultContentBlock = (output, context3) => {
32359
32371
  if (output.document != null) {
32360
32372
  return {
32361
- document: de_DocumentBlock(output.document, context)
32373
+ document: de_DocumentBlock(output.document, context3)
32362
32374
  };
32363
32375
  }
32364
32376
  if (output.image != null) {
32365
32377
  return {
32366
- image: de_ImageBlock(output.image, context)
32378
+ image: de_ImageBlock(output.image, context3)
32367
32379
  };
32368
32380
  }
32369
32381
  if (output.json != null) {
@@ -32376,34 +32388,34 @@ var require_dist_cjs65 = __commonJS({
32376
32388
  }
32377
32389
  if (output.video != null) {
32378
32390
  return {
32379
- video: de_VideoBlock(output.video, context)
32391
+ video: de_VideoBlock(output.video, context3)
32380
32392
  };
32381
32393
  }
32382
32394
  return { $unknown: Object.entries(output)[0] };
32383
32395
  };
32384
- var de_ToolResultContentBlocks = (output, context) => {
32396
+ var de_ToolResultContentBlocks = (output, context3) => {
32385
32397
  const retVal = (output || []).filter((e3) => e3 != null).map((entry) => {
32386
- return de_ToolResultContentBlock(core$1.awsExpectUnion(entry), context);
32398
+ return de_ToolResultContentBlock(core$1.awsExpectUnion(entry), context3);
32387
32399
  });
32388
32400
  return retVal;
32389
32401
  };
32390
- var de_ToolUseBlock = (output, context) => {
32402
+ var de_ToolUseBlock = (output, context3) => {
32391
32403
  return smithyClient.take(output, {
32392
32404
  input: (_2) => de_Document(_2),
32393
32405
  name: smithyClient.expectString,
32394
32406
  toolUseId: smithyClient.expectString
32395
32407
  });
32396
32408
  };
32397
- var de_VideoBlock = (output, context) => {
32409
+ var de_VideoBlock = (output, context3) => {
32398
32410
  return smithyClient.take(output, {
32399
32411
  format: smithyClient.expectString,
32400
- source: (_2) => de_VideoSource(core$1.awsExpectUnion(_2), context)
32412
+ source: (_2) => de_VideoSource(core$1.awsExpectUnion(_2), context3)
32401
32413
  });
32402
32414
  };
32403
- var de_VideoSource = (output, context) => {
32415
+ var de_VideoSource = (output, context3) => {
32404
32416
  if (output.bytes != null) {
32405
32417
  return {
32406
- bytes: context.base64Decoder(output.bytes)
32418
+ bytes: context3.base64Decoder(output.bytes)
32407
32419
  };
32408
32420
  }
32409
32421
  if (output.s3Location != null) {
@@ -32413,7 +32425,7 @@ var require_dist_cjs65 = __commonJS({
32413
32425
  }
32414
32426
  return { $unknown: Object.entries(output)[0] };
32415
32427
  };
32416
- var de_Document = (output, context) => {
32428
+ var de_Document = (output, context3) => {
32417
32429
  return output;
32418
32430
  };
32419
32431
  var deserializeMetadata3 = (output) => ({
@@ -36979,7 +36991,7 @@ var init_esm2 = __esm({
36979
36991
  free: c3.#free,
36980
36992
  // methods
36981
36993
  isBackgroundFetch: (p3) => c3.#isBackgroundFetch(p3),
36982
- backgroundFetch: (k3, index, options, context) => c3.#backgroundFetch(k3, index, options, context),
36994
+ backgroundFetch: (k3, index, options, context3) => c3.#backgroundFetch(k3, index, options, context3),
36983
36995
  moveToTail: (index) => c3.#moveToTail(index),
36984
36996
  indexes: (options) => c3.#indexes(options),
36985
36997
  rindexes: (options) => c3.#rindexes(options),
@@ -37766,7 +37778,7 @@ var init_esm2 = __esm({
37766
37778
  const v3 = this.#valList[index];
37767
37779
  return this.#isBackgroundFetch(v3) ? v3.__staleWhileFetching : v3;
37768
37780
  }
37769
- #backgroundFetch(k3, index, options, context) {
37781
+ #backgroundFetch(k3, index, options, context3) {
37770
37782
  const v3 = index === void 0 ? void 0 : this.#valList[index];
37771
37783
  if (this.#isBackgroundFetch(v3)) {
37772
37784
  return v3;
@@ -37779,7 +37791,7 @@ var init_esm2 = __esm({
37779
37791
  const fetchOpts = {
37780
37792
  signal: ac.signal,
37781
37793
  options,
37782
- context
37794
+ context: context3
37783
37795
  };
37784
37796
  const cb = (v4, updateCache = false) => {
37785
37797
  const { aborted } = ac.signal;
@@ -37896,7 +37908,7 @@ var init_esm2 = __esm({
37896
37908
  allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,
37897
37909
  ignoreFetchAbort = this.ignoreFetchAbort,
37898
37910
  allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,
37899
- context,
37911
+ context: context3,
37900
37912
  forceRefresh = false,
37901
37913
  status,
37902
37914
  signal
@@ -37931,7 +37943,7 @@ var init_esm2 = __esm({
37931
37943
  if (index === void 0) {
37932
37944
  if (status)
37933
37945
  status.fetch = "miss";
37934
- const p3 = this.#backgroundFetch(k3, index, options, context);
37946
+ const p3 = this.#backgroundFetch(k3, index, options, context3);
37935
37947
  return p3.__returned = p3;
37936
37948
  } else {
37937
37949
  const v3 = this.#valList[index];
@@ -37956,7 +37968,7 @@ var init_esm2 = __esm({
37956
37968
  this.#statusTTL(status, index);
37957
37969
  return v3;
37958
37970
  }
37959
- const p3 = this.#backgroundFetch(k3, index, options, context);
37971
+ const p3 = this.#backgroundFetch(k3, index, options, context3);
37960
37972
  const hasStale = p3.__staleWhileFetching !== void 0;
37961
37973
  const staleVal = hasStale && allowStale;
37962
37974
  if (status) {
@@ -37978,13 +37990,13 @@ var init_esm2 = __esm({
37978
37990
  if (!memoMethod) {
37979
37991
  throw new Error("no memoMethod provided to constructor");
37980
37992
  }
37981
- const { context, forceRefresh, ...options } = memoOptions;
37993
+ const { context: context3, forceRefresh, ...options } = memoOptions;
37982
37994
  const v3 = this.get(k3, options);
37983
37995
  if (!forceRefresh && v3 !== void 0)
37984
37996
  return v3;
37985
37997
  const vv = memoMethod(k3, v3, {
37986
37998
  options,
37987
- context
37999
+ context: context3
37988
38000
  });
37989
38001
  this.set(k3, vv, options);
37990
38002
  return vv;
@@ -55239,8 +55251,8 @@ function mapFlowchartParserError(err, text) {
55239
55251
  };
55240
55252
  }
55241
55253
  if (tokType === "QuotedString") {
55242
- const context = err?.context;
55243
- const inLinkRule = context?.ruleStack?.includes("linkTextInline") || context?.ruleStack?.includes("link") || false;
55254
+ const context3 = err?.context;
55255
+ const inLinkRule = context3?.ruleStack?.includes("linkTextInline") || context3?.ruleStack?.includes("link") || false;
55244
55256
  const lineContent = allLines[Math.max(0, line - 1)] || "";
55245
55257
  const beforeQuote = lineContent.slice(0, Math.max(0, column - 1));
55246
55258
  const hasLinkBefore = beforeQuote.match(/--\s*$|==\s*$|-\.\s*$|-\.-\s*$|\[\s*$/);
@@ -72831,7 +72843,7 @@ ${fixedContent}
72831
72843
  };
72832
72844
  }
72833
72845
  }
72834
- var HTML_ENTITY_MAP, JsonFixingAgent, MermaidFixingAgent;
72846
+ var HTML_ENTITY_MAP, sessionIdCounter, JsonFixingAgent, MermaidFixingAgent;
72835
72847
  var init_schemaUtils = __esm({
72836
72848
  "src/agent/schemaUtils.js"() {
72837
72849
  "use strict";
@@ -72847,11 +72859,12 @@ var init_schemaUtils = __esm({
72847
72859
  // Also handle XML/HTML5 apostrophe entity
72848
72860
  "&nbsp;": " "
72849
72861
  };
72862
+ sessionIdCounter = 0;
72850
72863
  JsonFixingAgent = class {
72851
72864
  constructor(options = {}) {
72852
72865
  this.ProbeAgent = null;
72853
72866
  this.options = {
72854
- sessionId: options.sessionId || `json-fixer-${Date.now()}`,
72867
+ sessionId: options.sessionId || `json-fixer-${Date.now()}-${sessionIdCounter++}`,
72855
72868
  path: options.path || process.cwd(),
72856
72869
  provider: options.provider,
72857
72870
  model: options.model,
@@ -73001,7 +73014,7 @@ Provide only the corrected JSON without any markdown formatting or explanations.
73001
73014
  constructor(options = {}) {
73002
73015
  this.ProbeAgent = null;
73003
73016
  this.options = {
73004
- sessionId: options.sessionId || `mermaid-fixer-${Date.now()}`,
73017
+ sessionId: options.sessionId || `mermaid-fixer-${Date.now()}-${sessionIdCounter++}`,
73005
73018
  path: options.path || process.cwd(),
73006
73019
  provider: options.provider,
73007
73020
  model: options.model,
@@ -75224,16 +75237,14 @@ Remember: Use proper XML format with BOTH opening and closing tags:
75224
75237
  <parameter>value</parameter>
75225
75238
  </tool_name>
75226
75239
 
75227
- IMPORTANT: A schema was provided for the final output format. You have two options:
75240
+ IMPORTANT: A schema was provided for the final output format.
75228
75241
 
75229
- Option 1 - Use attempt_completion with your complete answer:
75242
+ You MUST use attempt_completion to provide your answer:
75230
75243
  <attempt_completion>
75231
- [Your complete answer here - will be automatically formatted to match the schema]
75244
+ [Your complete answer here - provide in natural language, it will be automatically formatted to match the schema]
75232
75245
  </attempt_completion>
75233
75246
 
75234
- Option 2 - Provide a natural response without any tool, and it will be automatically formatted.
75235
-
75236
- Do NOT try to format your response as JSON yourself - this will be done automatically.`;
75247
+ Your response will be automatically formatted to JSON. You can provide your answer in natural language or as JSON - either will work.`;
75237
75248
  } else {
75238
75249
  reminderContent = `Please use one of the available tools to help answer the question, or use attempt_completion if you have enough information to provide a final answer.
75239
75250
 
@@ -75470,7 +75481,7 @@ Convert your previous response content into actual JSON data that follows this s
75470
75481
  }
75471
75482
  } else if (reachedMaxIterations && options.schema && this.debug) {
75472
75483
  console.log("[DEBUG] Skipping schema formatting due to max iterations reached without completion");
75473
- } else if (completionAttempted && options.schema && !options._schemaFormatted) {
75484
+ } else if (completionAttempted && options.schema && !options._schemaFormatted && !options._skipValidation) {
75474
75485
  try {
75475
75486
  finalResult = cleanSchemaResponse(finalResult);
75476
75487
  if (!this.disableMermaidValidation) {
@@ -75524,7 +75535,9 @@ Convert your previous response content into actual JSON data that follows this s
75524
75535
  );
75525
75536
  finalResult = await this.answer(schemaDefinitionPrompt, [], {
75526
75537
  ...options,
75527
- _schemaFormatted: true
75538
+ _schemaFormatted: true,
75539
+ _skipValidation: true
75540
+ // Skip validation in recursive correction calls to prevent loops
75528
75541
  });
75529
75542
  finalResult = cleanSchemaResponse(finalResult);
75530
75543
  validation = validateJsonResponse(finalResult);
@@ -75564,7 +75577,9 @@ Convert your previous response content into actual JSON data that follows this s
75564
75577
  }
75565
75578
  finalResult = await this.answer(correctionPrompt, [], {
75566
75579
  ...options,
75567
- _schemaFormatted: true
75580
+ _schemaFormatted: true,
75581
+ _skipValidation: true
75582
+ // Skip validation in recursive correction calls to prevent loops
75568
75583
  });
75569
75584
  finalResult = cleanSchemaResponse(finalResult);
75570
75585
  validation = validateJsonResponse(finalResult, { debug: this.debug });
@@ -76095,6 +76110,667 @@ var init_simpleTelemetry = __esm({
76095
76110
  }
76096
76111
  });
76097
76112
 
76113
+ // src/agent/fileSpanExporter.js
76114
+ var import_fs9, import_core17, ExportResultCode, FileSpanExporter;
76115
+ var init_fileSpanExporter = __esm({
76116
+ "src/agent/fileSpanExporter.js"() {
76117
+ "use strict";
76118
+ import_fs9 = require("fs");
76119
+ import_core17 = __toESM(require("@opentelemetry/core"), 1);
76120
+ ({ ExportResultCode } = import_core17.default);
76121
+ FileSpanExporter = class {
76122
+ constructor(filePath = "./traces.jsonl") {
76123
+ this.filePath = filePath;
76124
+ this.stream = (0, import_fs9.createWriteStream)(filePath, { flags: "a" });
76125
+ this.stream.on("error", (error2) => {
76126
+ console.error(`[FileSpanExporter] Stream error: ${error2.message}`);
76127
+ });
76128
+ }
76129
+ /**
76130
+ * Export spans to file
76131
+ * @param {ReadableSpan[]} spans - Array of spans to export
76132
+ * @param {function} resultCallback - Callback to call with the export result
76133
+ */
76134
+ export(spans, resultCallback) {
76135
+ if (!spans || spans.length === 0) {
76136
+ resultCallback({ code: ExportResultCode.SUCCESS });
76137
+ return;
76138
+ }
76139
+ try {
76140
+ const timestamp = Date.now();
76141
+ spans.forEach((span, index) => {
76142
+ let parentSpanId = void 0;
76143
+ if (span.parentSpanContext) {
76144
+ parentSpanId = span.parentSpanContext.spanId;
76145
+ } else if (span._parentSpanContext) {
76146
+ parentSpanId = span._parentSpanContext.spanId;
76147
+ } else if (span.parent) {
76148
+ parentSpanId = span.parent.spanId;
76149
+ } else if (span._parent) {
76150
+ parentSpanId = span._parent.spanId;
76151
+ } else if (span._parentId) {
76152
+ parentSpanId = span._parentId;
76153
+ } else if (span.parentSpanId) {
76154
+ parentSpanId = span.parentSpanId;
76155
+ }
76156
+ const spanData = {
76157
+ traceId: span.spanContext().traceId,
76158
+ spanId: span.spanContext().spanId,
76159
+ parentSpanId,
76160
+ name: span.name,
76161
+ kind: span.kind,
76162
+ startTimeUnixNano: span.startTime[0] * 1e9 + span.startTime[1],
76163
+ endTimeUnixNano: span.endTime[0] * 1e9 + span.endTime[1],
76164
+ attributes: this.convertAttributes(span.attributes),
76165
+ status: span.status,
76166
+ events: span.events?.map((event) => ({
76167
+ timeUnixNano: event.time[0] * 1e9 + event.time[1],
76168
+ name: event.name,
76169
+ attributes: this.convertAttributes(event.attributes)
76170
+ })) || [],
76171
+ links: span.links?.map((link) => ({
76172
+ traceId: link.context.traceId,
76173
+ spanId: link.context.spanId,
76174
+ attributes: this.convertAttributes(link.attributes)
76175
+ })) || [],
76176
+ resource: {
76177
+ attributes: this.convertAttributes(span.resource?.attributes || {})
76178
+ },
76179
+ instrumentationLibrary: {
76180
+ name: span.instrumentationLibrary?.name || "unknown",
76181
+ version: span.instrumentationLibrary?.version || "unknown"
76182
+ },
76183
+ timestamp
76184
+ };
76185
+ this.stream.write(JSON.stringify(spanData) + "\n");
76186
+ });
76187
+ resultCallback({ code: ExportResultCode.SUCCESS });
76188
+ } catch (error2) {
76189
+ console.error(`[FileSpanExporter] Export error: ${error2.message}`);
76190
+ resultCallback({
76191
+ code: ExportResultCode.FAILED,
76192
+ error: error2
76193
+ });
76194
+ }
76195
+ }
76196
+ /**
76197
+ * Convert OpenTelemetry attributes to plain object
76198
+ * @param {Object} attributes - OpenTelemetry attributes
76199
+ * @returns {Object} Plain object with string values
76200
+ */
76201
+ convertAttributes(attributes) {
76202
+ if (!attributes) return {};
76203
+ const result = {};
76204
+ for (const [key, value] of Object.entries(attributes)) {
76205
+ if (typeof value === "object" && value !== null) {
76206
+ result[key] = JSON.stringify(value);
76207
+ } else {
76208
+ result[key] = String(value);
76209
+ }
76210
+ }
76211
+ return result;
76212
+ }
76213
+ /**
76214
+ * Shutdown the exporter
76215
+ * @returns {Promise<void>}
76216
+ */
76217
+ async shutdown() {
76218
+ return new Promise((resolve4) => {
76219
+ if (this.stream) {
76220
+ this.stream.end(() => {
76221
+ console.log(`[FileSpanExporter] File stream closed: ${this.filePath}`);
76222
+ resolve4();
76223
+ });
76224
+ } else {
76225
+ resolve4();
76226
+ }
76227
+ });
76228
+ }
76229
+ /**
76230
+ * Force flush any pending spans
76231
+ * @returns {Promise<void>}
76232
+ */
76233
+ async forceFlush() {
76234
+ return new Promise((resolve4, reject2) => {
76235
+ if (this.stream) {
76236
+ const flushTimeout = setTimeout(() => {
76237
+ console.warn("[FileSpanExporter] Flush timeout after 5 seconds");
76238
+ resolve4();
76239
+ }, 5e3);
76240
+ if (this.stream.writableCorked) {
76241
+ this.stream.uncork();
76242
+ }
76243
+ if (this.stream.writableNeedDrain) {
76244
+ this.stream.once("drain", () => {
76245
+ clearTimeout(flushTimeout);
76246
+ resolve4();
76247
+ });
76248
+ } else {
76249
+ setImmediate(() => {
76250
+ clearTimeout(flushTimeout);
76251
+ resolve4();
76252
+ });
76253
+ }
76254
+ } else {
76255
+ resolve4();
76256
+ }
76257
+ });
76258
+ }
76259
+ };
76260
+ }
76261
+ });
76262
+
76263
+ // src/agent/telemetry.js
76264
+ function initializeTelemetryFromOptions(options) {
76265
+ const config = new TelemetryConfig({
76266
+ serviceName: "probe-agent",
76267
+ serviceVersion: "1.0.0",
76268
+ enableFile: options.traceFile !== void 0,
76269
+ enableRemote: options.traceRemote !== void 0,
76270
+ enableConsole: options.traceConsole,
76271
+ filePath: options.traceFile || "./traces.jsonl",
76272
+ remoteEndpoint: options.traceRemote || "http://localhost:4318/v1/traces"
76273
+ });
76274
+ config.initialize();
76275
+ return config;
76276
+ }
76277
+ var import_sdk_node, import_resources, import_semantic_conventions, import_api, import_exporter_trace_otlp_http, import_sdk_trace_base, import_fs10, import_path11, NodeSDK, Resource, OTLPTraceExporter, BatchSpanProcessor, ConsoleSpanExporter, TelemetryConfig;
76278
+ var init_telemetry = __esm({
76279
+ "src/agent/telemetry.js"() {
76280
+ "use strict";
76281
+ import_sdk_node = __toESM(require("@opentelemetry/sdk-node"), 1);
76282
+ import_resources = __toESM(require("@opentelemetry/resources"), 1);
76283
+ import_semantic_conventions = require("@opentelemetry/semantic-conventions");
76284
+ import_api = require("@opentelemetry/api");
76285
+ import_exporter_trace_otlp_http = __toESM(require("@opentelemetry/exporter-trace-otlp-http"), 1);
76286
+ import_sdk_trace_base = __toESM(require("@opentelemetry/sdk-trace-base"), 1);
76287
+ import_fs10 = require("fs");
76288
+ import_path11 = require("path");
76289
+ init_fileSpanExporter();
76290
+ ({ NodeSDK } = import_sdk_node.default);
76291
+ ({ Resource } = import_resources.default);
76292
+ ({ OTLPTraceExporter } = import_exporter_trace_otlp_http.default);
76293
+ ({ BatchSpanProcessor, ConsoleSpanExporter } = import_sdk_trace_base.default);
76294
+ TelemetryConfig = class {
76295
+ constructor(options = {}) {
76296
+ this.serviceName = options.serviceName || "probe-agent";
76297
+ this.serviceVersion = options.serviceVersion || "1.0.0";
76298
+ this.enableFile = options.enableFile || false;
76299
+ this.enableRemote = options.enableRemote || false;
76300
+ this.enableConsole = options.enableConsole || false;
76301
+ this.filePath = options.filePath || "./traces.jsonl";
76302
+ this.remoteEndpoint = options.remoteEndpoint || "http://localhost:4318/v1/traces";
76303
+ this.sdk = null;
76304
+ this.tracer = null;
76305
+ }
76306
+ /**
76307
+ * Initialize OpenTelemetry SDK
76308
+ */
76309
+ initialize() {
76310
+ if (this.sdk) {
76311
+ console.warn("Telemetry already initialized");
76312
+ return;
76313
+ }
76314
+ const resource = new Resource({
76315
+ [import_semantic_conventions.ATTR_SERVICE_NAME]: this.serviceName,
76316
+ [import_semantic_conventions.ATTR_SERVICE_VERSION]: this.serviceVersion
76317
+ });
76318
+ const spanProcessors = [];
76319
+ if (this.enableFile) {
76320
+ try {
76321
+ const dir = (0, import_path11.dirname)(this.filePath);
76322
+ if (!(0, import_fs10.existsSync)(dir)) {
76323
+ (0, import_fs10.mkdirSync)(dir, { recursive: true });
76324
+ }
76325
+ const fileExporter = new FileSpanExporter(this.filePath);
76326
+ spanProcessors.push(new BatchSpanProcessor(fileExporter, {
76327
+ maxQueueSize: 2048,
76328
+ maxExportBatchSize: 512,
76329
+ scheduledDelayMillis: 500,
76330
+ exportTimeoutMillis: 3e4
76331
+ }));
76332
+ console.log(`[Telemetry] File exporter enabled, writing to: ${this.filePath}`);
76333
+ } catch (error2) {
76334
+ console.error(`[Telemetry] Failed to initialize file exporter: ${error2.message}`);
76335
+ }
76336
+ }
76337
+ if (this.enableRemote) {
76338
+ try {
76339
+ const remoteExporter = new OTLPTraceExporter({
76340
+ url: this.remoteEndpoint
76341
+ });
76342
+ spanProcessors.push(new BatchSpanProcessor(remoteExporter, {
76343
+ maxQueueSize: 2048,
76344
+ maxExportBatchSize: 512,
76345
+ scheduledDelayMillis: 500,
76346
+ exportTimeoutMillis: 3e4
76347
+ }));
76348
+ console.log(`[Telemetry] Remote exporter enabled, endpoint: ${this.remoteEndpoint}`);
76349
+ } catch (error2) {
76350
+ console.error(`[Telemetry] Failed to initialize remote exporter: ${error2.message}`);
76351
+ }
76352
+ }
76353
+ if (this.enableConsole) {
76354
+ const consoleExporter = new ConsoleSpanExporter();
76355
+ spanProcessors.push(new BatchSpanProcessor(consoleExporter, {
76356
+ maxQueueSize: 2048,
76357
+ maxExportBatchSize: 512,
76358
+ scheduledDelayMillis: 500,
76359
+ exportTimeoutMillis: 3e4
76360
+ }));
76361
+ console.log(`[Telemetry] Console exporter enabled`);
76362
+ }
76363
+ if (spanProcessors.length === 0) {
76364
+ console.log("[Telemetry] No exporters configured, telemetry will not be collected");
76365
+ return;
76366
+ }
76367
+ this.sdk = new NodeSDK({
76368
+ resource,
76369
+ spanProcessors
76370
+ });
76371
+ try {
76372
+ this.sdk.start();
76373
+ this.tracer = import_api.trace.getTracer(this.serviceName, this.serviceVersion);
76374
+ console.log(`[Telemetry] OpenTelemetry SDK initialized successfully`);
76375
+ } catch (error2) {
76376
+ console.error(`[Telemetry] Failed to start OpenTelemetry SDK: ${error2.message}`);
76377
+ }
76378
+ }
76379
+ /**
76380
+ * Get the tracer instance
76381
+ */
76382
+ getTracer() {
76383
+ return this.tracer;
76384
+ }
76385
+ /**
76386
+ * Create a span with the given name and attributes
76387
+ */
76388
+ createSpan(name14, attributes = {}) {
76389
+ if (!this.tracer) {
76390
+ return null;
76391
+ }
76392
+ return this.tracer.startSpan(name14, {
76393
+ attributes
76394
+ });
76395
+ }
76396
+ /**
76397
+ * Wrap a function to automatically create spans
76398
+ */
76399
+ wrapFunction(name14, fn, attributes = {}) {
76400
+ if (!this.tracer) {
76401
+ return fn;
76402
+ }
76403
+ return async (...args) => {
76404
+ const span = this.createSpan(name14, attributes);
76405
+ if (!span) {
76406
+ return fn(...args);
76407
+ }
76408
+ try {
76409
+ const result = await import_api.context.with(import_api.trace.setSpan(import_api.context.active(), span), () => fn(...args));
76410
+ span.setStatus({ code: import_api.SpanStatusCode.OK });
76411
+ return result;
76412
+ } catch (error2) {
76413
+ span.setStatus({
76414
+ code: import_api.SpanStatusCode.ERROR,
76415
+ message: error2.message
76416
+ });
76417
+ span.recordException(error2);
76418
+ throw error2;
76419
+ } finally {
76420
+ span.end();
76421
+ }
76422
+ };
76423
+ }
76424
+ /**
76425
+ * Force flush all pending spans
76426
+ */
76427
+ async forceFlush() {
76428
+ if (this.sdk) {
76429
+ try {
76430
+ const tracerProvider = import_api.trace.getTracerProvider();
76431
+ if (tracerProvider && typeof tracerProvider.forceFlush === "function") {
76432
+ await tracerProvider.forceFlush();
76433
+ }
76434
+ await new Promise((resolve4) => setTimeout(resolve4, 100));
76435
+ console.log("[Telemetry] OpenTelemetry spans flushed successfully");
76436
+ } catch (error2) {
76437
+ console.error(`[Telemetry] Failed to flush OpenTelemetry spans: ${error2.message}`);
76438
+ }
76439
+ }
76440
+ }
76441
+ /**
76442
+ * Shutdown telemetry
76443
+ */
76444
+ async shutdown() {
76445
+ if (this.sdk) {
76446
+ try {
76447
+ await this.sdk.shutdown();
76448
+ console.log("[Telemetry] OpenTelemetry SDK shutdown successfully");
76449
+ } catch (error2) {
76450
+ console.error(`[Telemetry] Failed to shutdown OpenTelemetry SDK: ${error2.message}`);
76451
+ }
76452
+ }
76453
+ }
76454
+ };
76455
+ }
76456
+ });
76457
+
76458
+ // src/agent/appTracer.js
76459
+ var import_api2, AppTracer;
76460
+ var init_appTracer = __esm({
76461
+ "src/agent/appTracer.js"() {
76462
+ "use strict";
76463
+ import_api2 = require("@opentelemetry/api");
76464
+ AppTracer = class {
76465
+ constructor(telemetryConfig, sessionId = null) {
76466
+ this.telemetryConfig = telemetryConfig;
76467
+ this.tracer = telemetryConfig?.getTracer();
76468
+ this.sessionId = sessionId || this.generateSessionId();
76469
+ this.traceId = this.generateTraceId();
76470
+ }
76471
+ /**
76472
+ * Generate a unique session ID
76473
+ */
76474
+ generateSessionId() {
76475
+ return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
76476
+ }
76477
+ /**
76478
+ * Generate trace ID from session ID for consistent tracing
76479
+ */
76480
+ generateTraceId() {
76481
+ if (!this.sessionId) return null;
76482
+ const hash = this.hashString(this.sessionId);
76483
+ return hash.padEnd(32, "0").substring(0, 32);
76484
+ }
76485
+ /**
76486
+ * Simple hash function for session ID
76487
+ */
76488
+ hashString(str) {
76489
+ let hash = 0;
76490
+ for (let i3 = 0; i3 < str.length; i3++) {
76491
+ const char = str.charCodeAt(i3);
76492
+ hash = (hash << 5) - hash + char;
76493
+ hash = hash & hash;
76494
+ }
76495
+ return Math.abs(hash).toString(16);
76496
+ }
76497
+ /**
76498
+ * Check if tracing is enabled
76499
+ */
76500
+ isEnabled() {
76501
+ return this.tracer !== null;
76502
+ }
76503
+ /**
76504
+ * Create a root span for the agent session
76505
+ */
76506
+ createSessionSpan(attributes = {}) {
76507
+ if (!this.isEnabled()) return null;
76508
+ return this.tracer.startSpan("agent.session", {
76509
+ attributes: {
76510
+ "session.id": this.sessionId,
76511
+ "trace.id": this.traceId,
76512
+ ...attributes
76513
+ }
76514
+ });
76515
+ }
76516
+ /**
76517
+ * Create a span for AI model requests
76518
+ */
76519
+ createAISpan(modelName, provider, attributes = {}) {
76520
+ if (!this.isEnabled()) return null;
76521
+ return this.tracer.startSpan("ai.request", {
76522
+ attributes: {
76523
+ "ai.model": modelName,
76524
+ "ai.provider": provider,
76525
+ "session.id": this.sessionId,
76526
+ ...attributes
76527
+ }
76528
+ });
76529
+ }
76530
+ /**
76531
+ * Create a span for tool calls
76532
+ */
76533
+ createToolSpan(toolName, attributes = {}) {
76534
+ if (!this.isEnabled()) return null;
76535
+ return this.tracer.startSpan("tool.call", {
76536
+ attributes: {
76537
+ "tool.name": toolName,
76538
+ "session.id": this.sessionId,
76539
+ ...attributes
76540
+ }
76541
+ });
76542
+ }
76543
+ /**
76544
+ * Create a span for code search operations
76545
+ */
76546
+ createSearchSpan(query2, attributes = {}) {
76547
+ if (!this.isEnabled()) return null;
76548
+ return this.tracer.startSpan("search.query", {
76549
+ attributes: {
76550
+ "search.query": query2,
76551
+ "session.id": this.sessionId,
76552
+ ...attributes
76553
+ }
76554
+ });
76555
+ }
76556
+ /**
76557
+ * Create a span for code extraction operations
76558
+ */
76559
+ createExtractSpan(files, attributes = {}) {
76560
+ if (!this.isEnabled()) return null;
76561
+ return this.tracer.startSpan("extract.files", {
76562
+ attributes: {
76563
+ "extract.file_count": Array.isArray(files) ? files.length : 1,
76564
+ "extract.files": Array.isArray(files) ? files.join(",") : files,
76565
+ "session.id": this.sessionId,
76566
+ ...attributes
76567
+ }
76568
+ });
76569
+ }
76570
+ /**
76571
+ * Create a span for agent iterations
76572
+ */
76573
+ createIterationSpan(iteration, attributes = {}) {
76574
+ if (!this.isEnabled()) return null;
76575
+ return this.tracer.startSpan("agent.iteration", {
76576
+ attributes: {
76577
+ "iteration.number": iteration,
76578
+ "session.id": this.sessionId,
76579
+ ...attributes
76580
+ }
76581
+ });
76582
+ }
76583
+ /**
76584
+ * Create a span for delegation operations
76585
+ */
76586
+ createDelegationSpan(task, attributes = {}) {
76587
+ if (!this.isEnabled()) return null;
76588
+ return this.tracer.startSpan("agent.delegation", {
76589
+ attributes: {
76590
+ "delegation.task": task.substring(0, 200) + (task.length > 200 ? "..." : ""),
76591
+ "delegation.task_length": task.length,
76592
+ "session.id": this.sessionId,
76593
+ ...attributes
76594
+ }
76595
+ });
76596
+ }
76597
+ /**
76598
+ * Create a span for JSON validation operations
76599
+ */
76600
+ createJsonValidationSpan(responseLength, attributes = {}) {
76601
+ if (!this.isEnabled()) return null;
76602
+ return this.tracer.startSpan("validation.json", {
76603
+ attributes: {
76604
+ "validation.response_length": responseLength,
76605
+ "session.id": this.sessionId,
76606
+ ...attributes
76607
+ }
76608
+ });
76609
+ }
76610
+ /**
76611
+ * Create a span for Mermaid validation operations
76612
+ */
76613
+ createMermaidValidationSpan(diagramCount, attributes = {}) {
76614
+ if (!this.isEnabled()) return null;
76615
+ return this.tracer.startSpan("validation.mermaid", {
76616
+ attributes: {
76617
+ "validation.diagram_count": diagramCount,
76618
+ "session.id": this.sessionId,
76619
+ ...attributes
76620
+ }
76621
+ });
76622
+ }
76623
+ /**
76624
+ * Create a span for schema processing operations
76625
+ */
76626
+ createSchemaProcessingSpan(schemaType, attributes = {}) {
76627
+ if (!this.isEnabled()) return null;
76628
+ return this.tracer.startSpan("schema.processing", {
76629
+ attributes: {
76630
+ "schema.type": schemaType,
76631
+ "session.id": this.sessionId,
76632
+ ...attributes
76633
+ }
76634
+ });
76635
+ }
76636
+ /**
76637
+ * Record delegation events
76638
+ */
76639
+ recordDelegationEvent(eventType, data2 = {}) {
76640
+ if (!this.isEnabled()) return;
76641
+ this.addEvent(`delegation.${eventType}`, {
76642
+ "session.id": this.sessionId,
76643
+ ...data2
76644
+ });
76645
+ }
76646
+ /**
76647
+ * Record JSON validation events
76648
+ */
76649
+ recordJsonValidationEvent(eventType, data2 = {}) {
76650
+ if (!this.isEnabled()) return;
76651
+ this.addEvent(`json_validation.${eventType}`, {
76652
+ "session.id": this.sessionId,
76653
+ ...data2
76654
+ });
76655
+ }
76656
+ /**
76657
+ * Record Mermaid validation events
76658
+ */
76659
+ recordMermaidValidationEvent(eventType, data2 = {}) {
76660
+ if (!this.isEnabled()) return;
76661
+ this.addEvent(`mermaid_validation.${eventType}`, {
76662
+ "session.id": this.sessionId,
76663
+ ...data2
76664
+ });
76665
+ }
76666
+ /**
76667
+ * Add an event to the current or most recent span
76668
+ */
76669
+ addEvent(name14, attributes = {}) {
76670
+ if (!this.isEnabled()) return;
76671
+ const activeSpan = import_api2.trace.getActiveSpan();
76672
+ if (activeSpan) {
76673
+ activeSpan.addEvent(name14, {
76674
+ "session.id": this.sessionId,
76675
+ ...attributes
76676
+ });
76677
+ } else {
76678
+ if (this.telemetryConfig?.enableConsole) {
76679
+ console.log(`[Event] ${name14}:`, attributes);
76680
+ }
76681
+ }
76682
+ }
76683
+ /**
76684
+ * Set attributes on the current span
76685
+ */
76686
+ setAttributes(attributes) {
76687
+ if (!this.isEnabled()) return;
76688
+ const activeSpan = import_api2.trace.getActiveSpan();
76689
+ if (activeSpan) {
76690
+ activeSpan.setAttributes({
76691
+ "session.id": this.sessionId,
76692
+ ...attributes
76693
+ });
76694
+ }
76695
+ }
76696
+ /**
76697
+ * Wrap a function with automatic span creation
76698
+ */
76699
+ wrapFunction(spanName, fn, attributes = {}) {
76700
+ if (!this.isEnabled()) {
76701
+ return fn;
76702
+ }
76703
+ return async (...args) => {
76704
+ const span = this.tracer.startSpan(spanName, {
76705
+ attributes: {
76706
+ "session.id": this.sessionId,
76707
+ ...attributes
76708
+ }
76709
+ });
76710
+ try {
76711
+ const result = await import_api2.context.with(import_api2.trace.setSpan(import_api2.context.active(), span), () => fn(...args));
76712
+ span.setStatus({ code: import_api2.SpanStatusCode.OK });
76713
+ return result;
76714
+ } catch (error2) {
76715
+ span.setStatus({
76716
+ code: import_api2.SpanStatusCode.ERROR,
76717
+ message: error2.message
76718
+ });
76719
+ span.recordException(error2);
76720
+ throw error2;
76721
+ } finally {
76722
+ span.end();
76723
+ }
76724
+ };
76725
+ }
76726
+ /**
76727
+ * Execute a function within a span context
76728
+ */
76729
+ async withSpan(spanName, fn, attributes = {}) {
76730
+ if (!this.isEnabled()) {
76731
+ return fn();
76732
+ }
76733
+ const span = this.tracer.startSpan(spanName, {
76734
+ attributes: {
76735
+ "session.id": this.sessionId,
76736
+ ...attributes
76737
+ }
76738
+ });
76739
+ try {
76740
+ const result = await import_api2.context.with(import_api2.trace.setSpan(import_api2.context.active(), span), () => fn());
76741
+ span.setStatus({ code: import_api2.SpanStatusCode.OK });
76742
+ return result;
76743
+ } catch (error2) {
76744
+ span.setStatus({
76745
+ code: import_api2.SpanStatusCode.ERROR,
76746
+ message: error2.message
76747
+ });
76748
+ span.recordException(error2);
76749
+ throw error2;
76750
+ } finally {
76751
+ span.end();
76752
+ }
76753
+ }
76754
+ /**
76755
+ * Force flush all pending spans
76756
+ */
76757
+ async flush() {
76758
+ if (this.telemetryConfig) {
76759
+ await this.telemetryConfig.forceFlush();
76760
+ }
76761
+ }
76762
+ /**
76763
+ * Shutdown tracing
76764
+ */
76765
+ async shutdown() {
76766
+ if (this.telemetryConfig) {
76767
+ await this.telemetryConfig.shutdown();
76768
+ }
76769
+ }
76770
+ };
76771
+ }
76772
+ });
76773
+
76098
76774
  // src/agent/storage/index.js
76099
76775
  var init_storage = __esm({
76100
76776
  "src/agent/storage/index.js"() {
@@ -76115,6 +76791,7 @@ var init_hooks = __esm({
76115
76791
  // src/index.js
76116
76792
  var index_exports = {};
76117
76793
  __export(index_exports, {
76794
+ AppTracer: () => AppTracer,
76118
76795
  DEFAULT_SYSTEM_MESSAGE: () => DEFAULT_SYSTEM_MESSAGE,
76119
76796
  HOOK_TYPES: () => HOOK_TYPES,
76120
76797
  HookManager: () => HookManager,
@@ -76123,6 +76800,7 @@ __export(index_exports, {
76123
76800
  SimpleAppTracer: () => SimpleAppTracer,
76124
76801
  SimpleTelemetry: () => SimpleTelemetry,
76125
76802
  StorageAdapter: () => StorageAdapter,
76803
+ TelemetryConfig: () => TelemetryConfig,
76126
76804
  attemptCompletionSchema: () => attemptCompletionSchema,
76127
76805
  attemptCompletionToolDefinition: () => attemptCompletionToolDefinition,
76128
76806
  bashSchema: () => bashSchema,
@@ -76139,6 +76817,7 @@ __export(index_exports, {
76139
76817
  getBinaryPath: () => getBinaryPath,
76140
76818
  grep: () => grep,
76141
76819
  initializeSimpleTelemetryFromOptions: () => initializeSimpleTelemetryFromOptions,
76820
+ initializeTelemetryFromOptions: () => initializeTelemetryFromOptions,
76142
76821
  listFilesByLevel: () => listFilesByLevel,
76143
76822
  listFilesToolInstance: () => listFilesToolInstance,
76144
76823
  parseXmlToolCall: () => parseXmlToolCall,
@@ -76171,6 +76850,8 @@ var init_index = __esm({
76171
76850
  init_bash();
76172
76851
  init_ProbeAgent();
76173
76852
  init_simpleTelemetry();
76853
+ init_telemetry();
76854
+ init_appTracer();
76174
76855
  init_probeTool();
76175
76856
  init_storage();
76176
76857
  init_hooks();
@@ -76179,6 +76860,7 @@ var init_index = __esm({
76179
76860
  init_index();
76180
76861
  // Annotate the CommonJS export names for ESM import in node:
76181
76862
  0 && (module.exports = {
76863
+ AppTracer,
76182
76864
  DEFAULT_SYSTEM_MESSAGE,
76183
76865
  HOOK_TYPES,
76184
76866
  HookManager,
@@ -76187,6 +76869,7 @@ init_index();
76187
76869
  SimpleAppTracer,
76188
76870
  SimpleTelemetry,
76189
76871
  StorageAdapter,
76872
+ TelemetryConfig,
76190
76873
  attemptCompletionSchema,
76191
76874
  attemptCompletionToolDefinition,
76192
76875
  bashSchema,
@@ -76203,6 +76886,7 @@ init_index();
76203
76886
  getBinaryPath,
76204
76887
  grep,
76205
76888
  initializeSimpleTelemetryFromOptions,
76889
+ initializeTelemetryFromOptions,
76206
76890
  listFilesByLevel,
76207
76891
  listFilesToolInstance,
76208
76892
  parseXmlToolCall,